query
stringlengths
11
3.13k
ru_query
stringlengths
9
3.91k
document
stringlengths
18
71k
metadata
dict
negatives
listlengths
0
100
negative_scores
listlengths
0
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Gets the left offset of the y axis description
Получает левый сдвиг описания оси y
public function getYDescriptionOffsetLeft() { return $this->ydescr_offX; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAxisYLabelOffsetX()\n\t{\n\t\treturn $this->axis_ylabel_offX;\n\t}", "public function getAxisXLabelOffsetY()\n\t{\n\t\treturn $this->axis_xlabel_offY;\n\t}", "public function getXDescriptionOffsetBottom()\n\t{\n\t\treturn $this->xdescr_offY;\n\t}", "public function getAxisYLabelOffsetY()\n\t{\n\t\treturn $this->axis_ylabel_offY;\n\t}", "public function getTitleOffsetTop()\n\t{\n\t\treturn $this->title_offY;\n\t}", "public function getAxisXLabelOffsetX()\n\t{\n\t\treturn $this->axis_xlabel_offX;\n\t}", "public function getAxisPaddingLeft()\n\t{\n\t\treturn $this->axis_padding_left;\n\t}", "public function getStartY() {\n return $this->cells[0]->y;\n }", "public function getAxisPaddingRight()\n\t{\n\t\treturn $this->axis_padding_right;\n\t}", "public function get_y_pos() {\n return $this->y_pos;\n }", "public function setYDescriptionOffsetLeft($dx)\n\t{\n\t\t$this->ydescr_offX = $dy;\n\t}", "public function getMinY()\n {\n return $this->getY();\n }", "public function getOffsetY(): int\n {\n return $this->offsetY;\n }", "public function getAbsY1()\n {\n return $this->absY1;\n }", "public function getOffset()\r\n\t{\r\n\t\treturn $this->date->getOffset();\r\n\t}", "function getTopRight() { return $this->_topright; }", "public function get_baseline_offset() {\r\n if ($this->sizefixed == false) {\r\n $this->recompute_size();\r\n }\r\n return $this->baselineoffset;\r\n }", "public function getAbsY2()\n {\n return $this->absY2;\n }", "public function getLabelposition()\n {\n return $this->LABELPOSITION;\n }", "public function getRelY1()\n {\n return $this->getParentBB()->getAbsY1() - $this->getAbsY1();\n }", "public function getMinYValue()\r\n {\r\n return $this->minMandatoryValue(parent::getMinYValue());\r\n }", "public function getAxisDistanceY()\n\t{\n\t\treturn $this->axis_distance_y;\n\t}", "public function getPosy()\n\t{\n\t\treturn $this->posy;\n\t}", "function getOffset() ;", "public function getOffset() {\n\t\tif($this->offset > 0) return \" OFFSET $this->offset \";\n\t}", "public function getAxisPaddingTop()\n\t{\n\t\treturn $this->axis_padding_top;\n\t}", "function getPositionY(){\n\t\t\treturn $this -> positionY;\n\t\t}", "function getSeriesPosition() {\n\t\treturn $this->getData('seriesPosition');\n\t}", "public function get_label_position()\n\t{\n\t\treturn $this->_label_position;\n\t}", "public function getBottomLeft() {\n return $this->bottom_left;\n }", "function getBottomLeft() { return $this->_bottomleft; }", "public function getOffsetX(): int\n {\n return $this->offsetX;\n }", "public function getDisplayPosition()\n {\n return Mage::getStoreConfig(self::XML_PATH_DISPLAY_POSITION);\n }", "public function getRealY()\n\t{\n\t\treturn $this->y;\n\t}", "public function getActualLine()\n {\n return $this->_position;\n\n }", "function getY() {\n return $this->y;\n }", "public function getOffset() {}", "function getOffset(): int {\n\t\treturn $this->offset;\n\t}", "public function getOffset()\n\t{\n\t\treturn $this->offset;\n\t}", "public function getY() {\n\t\treturn ($this->y);\n\t}", "public function getOffset() {\r\n\t\treturn $this->offset;\r\n\t}", "public function getStrokeDashOffset () {}", "private function getPosition()\n {\n if ($this->labelCounter == 1) {\n return [0, 0];\n }\n\n if ($this->labelCounter == 2) {\n return [0, Fpdi::PAGE_SIZE_A6_WIDTH];\n }\n\n if ($this->labelCounter == 3) {\n return [Fpdi::PAGE_SIZE_A6_HEIGHT, 0];\n }\n\n if ($this->labelCounter == 4) {\n return [Fpdi::PAGE_SIZE_A6_HEIGHT, Fpdi::PAGE_SIZE_A6_WIDTH];\n }\n }", "public function getOffsets()\n {\n return $this->offsets;\n }", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getOffset()\n\t{\n\t\treturn ($this->getCurrentPage() - 1)*$this->getCount();\n\t}", "public function getAxisLabelLineLength()\n\t{\n\t\treturn $this->axis_label_linelength;\n\t}", "public function getLocationY()\r\n {\r\n return $this->getAttr('Location_Y');\r\n }", "public function getY(): int\n {\n return $this->y;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "function get_y_min()\n\t{\n\t\t$values = array();\n\n\t\tforeach($this->_config[self::VALUES] as $index=>$value)\n\t\t{\n\t\t\trsort($value);\n\t\t\t$values[] = array_pop($value);\n\t\t}\n\n\t\t$x = array_values($values);\n\t\trsort($x);\n\t\treturn array_pop($x);\n\t}", "public function getDimensionY()\n {\n return $this->dimensionY;\n }", "public function GetOffset ()\n {\n return $this->mOffset;\n }", "function GetMouseY(): int { return 0; }", "function calYposition($widths, $yTop, $yBottom) {\n\t\t$totalWidth = array_sum($widths);\n\t\t$y = $yTop + ($yBottom-$yTop-$totalWidth)/2;\n\t\treturn $y;\n\t}", "public function getOffset()\n {\n return $this->offset;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getOffset()\n {\n return $this->getOption('offset');\n }", "public function getAxisPaddingBottom()\n\t{\n\t\treturn $this->axis_padding_bottom;\n\t}", "private function getOffset()\n {\n if(is_integer($this->offset)){\n return $this->offset;\n }\n\n return $this->guessOffset();\n }", "public function getOffset() {\n return $this->offset;\n }", "public function getOffset() {\n return $this->offset;\n }", "public function getOffset() {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->_offset;\n }", "public function getOffset()\n {\n return $this->_offset;\n }", "public function getOffset()\n {\n return $this->_offset;\n }", "public function getTopRight() {\n return $this->top_right;\n }", "public function getAreaY()\n {\n return $this->area_y;\n }", "public function getY()\n\t{\n\t\treturn $this->y;\n\t}", "public function getLeftEnd(): int\n {\n return $this->leftStart + $this->leftLength;\n }", "public function getDimensionY();", "public function getRightStart(): int\n {\n return $this->rightStart;\n }", "public function getLeft() {}", "public function getOffset(){\n return $this->offset;\n }", "public function getCenterY()\n {\n return $this->getY() + $this->getHeight() / 2.0;\n }", "function _fillLeft()\n {\n if ($this->_alignment & IMAGE_GRAPH_ALIGN_RIGHT) {\n return $this->_left - $this->_font->width($this->_text);\n }\n if ($this->_alignment & IMAGE_GRAPH_ALIGN_CENTER_X) {\n return $this->_left - $this->_font->_centerWidth($this->_text);\n } else {\n return $this->_left;\n }\n }", "public function getOffset()\n {\n return abs($this->getCurrentPageNumber() - 1) * $this->getItemNumberPerPage();\n }", "public function getOffset(): int\n {\n return $this->pointer->offset;\n }", "function getBottomRight() { return $this->_bottomright; }", "public function getMaxY()\n {\n return $this->getY() + $this->getHeight();\n }", "public function getOffset()\r\n {\r\n return ($this->_current_page-1)*$this->_page_size;\r\n }", "public function getTraceOffset()\n {\n return $this->offset;\n }" ]
[ "0.7983535", "0.757131", "0.75322115", "0.71225005", "0.68216515", "0.6811708", "0.67788726", "0.64445883", "0.64382833", "0.631296", "0.63021713", "0.6246387", "0.6198067", "0.61644", "0.6019564", "0.6001948", "0.59560335", "0.5918793", "0.5909143", "0.59085774", "0.58942163", "0.58935374", "0.58886", "0.5885875", "0.5861758", "0.5836035", "0.5795367", "0.5790885", "0.576891", "0.57598037", "0.575784", "0.5750825", "0.5742223", "0.5714652", "0.565936", "0.5656638", "0.5654899", "0.56547445", "0.56443405", "0.56403446", "0.5634989", "0.56328833", "0.56308013", "0.562604", "0.5618007", "0.5618007", "0.5618007", "0.5618007", "0.5618007", "0.5618007", "0.5616841", "0.56164825", "0.56141305", "0.5608288", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5575006", "0.5563692", "0.556199", "0.5556148", "0.5555242", "0.5553669", "0.5548669", "0.55475205", "0.55475205", "0.55475205", "0.55475205", "0.55475205", "0.5546781", "0.5544109", "0.553968", "0.5533602", "0.5533602", "0.552811", "0.55227727", "0.55227727", "0.55227727", "0.5517753", "0.5509931", "0.550423", "0.5496818", "0.5494684", "0.54933244", "0.5491518", "0.54897827", "0.5479698", "0.5477257", "0.5462374", "0.5458468", "0.54577386", "0.5456315", "0.54476726", "0.5447062" ]
0.8824287
0
Gets the distance between two axis marker strokes
Получает расстояние между двумя метками оси
public function getAxisStrokeDistance() { return $this->delta_pixel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStrokeDashOffset () {}", "public function getAxisDistanceY()\n\t{\n\t\treturn $this->axis_distance_y;\n\t}", "private function _getSlope() {\n\t\t$compare_x = $this->pointB->x - $this->pointA->x;\n\t\t$compare_y = $this->pointB->y - $this->pointA->y;\n\n\t\treturn $compare_y / $compare_x;\n\t}", "public function getOffsetDistance()\n {\n return $this->offsetDistance;\n }", "private function getLen($x1, $y1, $x2, $y2 ){\n if ($y1 == $y2) return abs($x1 - $x2);\n else\n {\n if ($x1 == $x2) return abs($y1 - $y2);\n else return bcsqrt(pow(abs($x1 - $x2), 2) + pow(abs($y1 - $y2), 2));\n }\n }", "public function DistanceToLine(Location $seg1, Location $seg2)\n {\n $ab = $seg1->DistanceTo($seg2);\n $ac = $seg1->DistanceTo($this);\n $bc = $seg2->DistanceTo($this);\n\n $A = $bc;\n $B = $ac;\n $C = $ab;\n\n $angle_A = rad2deg(acos((pow($B, 2) + pow($C, 2) - pow($A, 2)) / (2 * $B * $C)));\n $angle_B = rad2deg(acos((pow($C, 2) + pow($A, 2) - pow($B, 2)) / (2 * $C * $A)));\n $angle_C = rad2deg(acos((pow($A, 2) + pow($B, 2) - pow($C, 2)) / (2 * $A * $B)));\n\n if($ab + $ac == $bc)\n {\n return 0;\n }\n else if($angle_A <= 90 && $angle_B <= 90)\n {\n $s = ($ab + $ac + $bc) / 2;\n $area = sqrt($s * ($s - $ab) * ($s - $ac) * ($s - $bc));\n $height = $area / (0.5 * $ab);\n return $height;\n }\n else\n {\n return ($ac > $bc) ? $bc : $ac;\n }\n }", "function getDistance($lat1, $long1, $lat2, $long2)\n\t{\n\t $l1 = deg2rad ($lat1);\n\t $l2 = deg2rad ($lat2);\n\t $o1 = deg2rad ($long1);\n\t $o2 = deg2rad ($long2);\n\n\t\t$this->kilometers ? $radius = 6372.795 : $radius = 3959.8712 ;\n\n\n\t\treturn 2 * $radius * asin(min(1, sqrt( pow(sin(($l2-$l1)/2), 2) + cos($l1)*cos($l2)* pow(sin(($o2-$o1)/2), 2) )));\n\t}", "public function getDistance();", "function getLength($X1, $Y1, $X2, $Y2)\n\t{\n\t\treturn (sqrt(pow(max($X1, $X2) - min($X1, $X2) , 2) + pow(max($Y1, $Y2) - min($Y1, $Y2) , 2)));\n\t}", "private function getDistance($x1, $y1, $x2, $y2) {\n\t\t$x = ( pow($x2-$x1,2));\n\t\t$y = ( pow($y2-$y1,2));\n\t\t$distance = ( sqrt($x + $y) );\n\t\treturn $distance;\n\t}", "function gmop_distance( $lat1, $lon1, $lat2, $lon2 ) {\n\t$distance = ( 3958 * 3.1415926 * sqrt( ( $lat2 - $lat1 ) * ( $lat2 - $lat1 ) + cos( $lat2 / 57.29578 ) * cos( $lat1 / 57.29578 ) * ( $lon2 - $lon1 ) * ( $lon2 - $lon1 ) ) / 180 );\n\treturn $distance;\n}", "function distance ($ax,$ay, $bx,$by)\n{\n\t$dx = $bx - $ax;\n\t$dy = $by - $ay;\n\treturn sqrt( $dx*$dx + $dy*$dy );\n}", "public function getStrokeWidth () {}", "function getDistance( $latitude1, $longitude1, $latitude2, $longitude2 ) {\n $earth_radius = 6371000;\n\n $dLat = deg2rad( $latitude2 - $latitude1 );\n $dLon = deg2rad( $longitude2 - $longitude1 );\n\n $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2);\n $c = 2 * asin(sqrt($a));\n $d = $earth_radius * $c;\n\n return $d;\n}", "public function getDistance($refDimension);", "private function getDistance($lat1,$long1,$lat2,$long2)\n\t{\n\t\t$pi80 = M_PI / 180;\n\t\t$lat1 *= $pi80;\n\t\t$long1 *= $pi80;\n\t\t$lat2 *= $pi80;\n\t\t$long2 *= $pi80;\n\t\t\n\t\t$r = 6372.797; // mean radius of Earth in km\n\t\t$dlat = $lat2 - $lat1;\n\t\t$dlng = $long2 - $long1;\n\t\t$a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t\t$c = 2 * atan2(sqrt($a), sqrt(1 - $a)); \n\t\treturn $r * $c * 1000; \t\t\n\t}", "function getDistance($p1, $p2){\n $dist = sqrt(pow($p1->lat-$p2->lat, 2) + pow($p1->lon-$p2->lon, 2));\n return $dist;\n}", "public function calcDistance(TrackpointInterface $tp1, TrackpointInterface $tp2);", "function getDistance($lat1, $lon1, $lat2, $lon2) {\n\n $pi80 = M_PI / 180;\n $lat1 *= $pi80;\n $lon1 *= $pi80;\n $lat2 *= $pi80;\n $lon2 *= $pi80;\n\n $r = 6372.797; // mean radius of Earth in km\n $dlat = $lat2 - $lat1;\n $dlon = $lon2 - $lon1;\n $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlon / 2) * sin($dlon / 2);\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $km = $r * $c;\n\n return round($km) + 4;\n }", "function getDistance($coordsA, $coordsB){\n\n $differenceInX = $coordsA[1] - $coordsB[1];\n $differenceInY = $coordsA[0] - $coordsB[0];\n\n $sumOfDifferences = pow($differenceInX, 2) + pow($differenceInY, 2);\n $distance = sqrt($sumOfDifferences);\n\n return $distance;\n}", "function coor2dist( $lat1, $lon1, $lat2, $lon2 )\r\n\t\t\t{\r\n\t\t\t\t$dx = ($lon2-$lon1)*cos(deg2rad($lat1));\r\n\t\t\t\t$dy = ($lat2-$lat1);\r\n\t\t\t\treturn ( sqrt( $dx*$dx+$dy*$dy ) ); \r\n\t\t\t}", "function getDistance($lat1, $lon1, $lat2, $lon2){\r\n\t\t\t\t\t\t$earthRadius = 6371;\r\n\t\t\t\t\t\t$latfrom = deg2rad($lat1);\r\n\t\t\t\t\t\t$lonfrom = deg2rad($lon1);\r\n\t\t\t\t\t\t$latto = deg2rad($lat2);\r\n\t\t\t\t\t\t$lonoto = deg2rad($lon2);\r\n\t\t\t\t\r\n\t\t\t\t\t\t$latDelta = $latto - $latfrom;\r\n\t\t\t\t\t\t$lonDelta = $lonoto - $lonfrom;\r\n\t\t\t\t\r\n\t\t\t\t\t\t$angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2)+\r\n\t\t\t\t\t\tcos($latfrom) * cos($latto) * pow(sin($lonDelta / 2), 2)));\r\n\t\t\t\t\t\treturn $angle * $earthRadius;\r\n\t\t\t\t\t}", "function GML_distance($lat1, $lon1, $lat2, $lon2) { \n\tif($lat1==$lat2 && $lon1==$lon2)\n\t\treturn(array(0,0,0,\"N\"));\n $theta = $lon1 - $lon2; \n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); \n $dist = acos($dist); \n $dist = rad2deg($dist); \n $miles = $dist * 60 * 1.1515;\n\t$bearingDeg = (rad2deg(atan2(sin(deg2rad($lon2) - deg2rad($lon1)) * \n\t cos(deg2rad($lat2)), cos(deg2rad($lat1)) * sin(deg2rad($lat2)) - \n\t sin(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon2) - deg2rad($lon1)))) + 360) % 360;\n\n\t$bearingWR = GML_direction($bearingDeg);\n\t\n $km = $miles * 1.609344; \n $kts = $miles * 0.8684;\n\t//$miles = round($miles);\n\treturn(array($kts,$km,$bearingDeg,$bearingWR));\n}", "public function getDistance(Coordinate $a, Coordinate $b)\n {\n $dLatitudeRadian = $b->latitudeRadian - $a->latitudeRadian;\n $dLongitudeRadian = $b->longitudeRadian - $a->longitudeRadian;\n if ($dLatitudeRadian == 0) {\n return 0;\n }\n\n //google maps里面实现的算法\n $distance = 2 * asin(sqrt(pow(sin($dLatitudeRadian / 2), 2) + cos($a->latitudeRadian) * cos($b->latitudeRadian) * pow(sin($dLongitudeRadian / 2), 2))); //google maps里面实现的算法\n // $distance = $distance * Coordinate::EARTH_RADIUS;\n $distance = $distance * $a->localEarthRadius;\n\n return $distance;\n }", "function distance($x1, $y1, $x2, $y2) {\n\t$diff_x = pow(x2 - x1, 2);\n\t$diff_y = pow(y2 - y1, 2);\n\t$result = sqrt(diff_x + diff_y);\n\treturn result;\n}", "function getDistance( $lat1, $long1, $lat2, $long2)\n\t{\n\t\t$R = 6371; // Earth's Radius\n\t\t$dLat = ($lat2-$lat1) * (3.142/180); \n\t\t$dLon = ($long2-$long1) * (3.142/180); \n\t\n\t\t$a = (sin($dLat/2) * sin($dLat/2)) +\n\t\tcos(($lat1)* (3.142/180)) * cos(($lat2)* (3.142/180)) * \n\t\tsin($dLon/2) * sin($dLon/2); \n\t\n\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\t\n\t\t$d = $R * $c; \n\t\treturn $d;\n\t}", "public function getDistanceAttribute();", "function getDistanceAA($p1, $p2){\n if (isset($p1[\"x\"])) $dist = sqrt(pow($p1[\"x\"]-$p2[\"x\"], 2) + pow($p1[\"y\"]-$p2[\"y\"], 2));\n else $dist = sqrt(pow($p1[\"lat\"]-$p2[\"lat\"], 2) + pow($p1[\"lon\"]-$p2[\"lon\"], 2));\n return $dist;\n}", "function distance($lat1, $lng1, $lat2, $lng2){\r\n $pi80 = M_PI / 180;\r\n $lat1 *= $pi80;\r\n $lng1 *= $pi80;\r\n $lat2 *= $pi80;\r\n $lng2 *= $pi80;\r\n $r = 6372.797; // mean radius of Earth in km\r\n $dlat = $lat2 - $lat1;\r\n $dlng = $lng2 - $lng1;\r\n $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\r\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\r\n $km = $r * $c;\r\n return floor($km);\r\n}", "function getDistance( $latitude1, $longitude1, $latitude2, $longitude2 ) \n{\n $earth_radius = 6371;\n\n $dLat = deg2rad( $latitude2 - $latitude1 ); \n $dLon = deg2rad( $longitude2 - $longitude1 ); \n\n $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2); \n $c = 2 * asin(sqrt($a)); \n $d = $earth_radius * $c; \n\n return $d;\n}", "public function getDistance()\r\n\t{\r\n\t\treturn $this->distance;\r\n\t}", "function getDistance($latitude1, $longitude1, $latitude2, $longitude2){ \n $earth_radius = 6371;\n //\n $dLat = deg2rad($latitude2 - $latitude1);\n $dLon = deg2rad($longitude2 - $longitude1);\n //\n $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2);\n $c = 2 * asin(sqrt($a));\n $d = $earth_radius * $c;\n // \n return $d;\n }", "public function getDistance()\n {\n $context = $this->context();\n\n $from = $context->travel_data->pick_up->location;\n $to = $context->travel_data->drop_off->location;\n\n return \\App\\Models\\Product\\Location::getDistance($from->latitude, $from->longitude, $to->latitude, $to->longitude);\n }", "function getDistance($latitude1, $longitude1, $latitude2, $longitude2) { \n $earth_radius = 6371; \n \n $dLat = deg2rad($latitude2 - $latitude1); \n $dLon = deg2rad($longitude2 - $longitude1); \n \n $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2); \n $c = 2 * asin(sqrt($a)); \n $d = $earth_radius * $c; \n \n return $d*1000; \n}", "public function get_stroke()\n {\n return $this->stroke;\n }", "public function getStrokeAntialias () {}", "public function get_distance()\n {\n return $this->distance;\n }", "public function getDistance()\n {\n return $this->distance;\n }", "public function getDistance()\n {\n return $this->distance;\n }", "function distance($lat1, $lon1, $lat2, $lon2)\n{\n return (6371000*3.1415926*sqrt(($lat2-$lat1)*($lat2-$lat1) + cos($lat2/57.29578)*cos($lat1/57.29578)*($lon2-$lon1)*($lon2-$lon1))/180);\n}", "private static function calculateDistance(float $lat1, float $lon1, float $lat2, float $lon2)\n {\n\n $pi80 = M_PI / 180;\n $lat1 *= $pi80;\n $lon1 *= $pi80;\n $lat2 *= $pi80;\n $lon2 *= $pi80;\n\n $r = 6372.797; // mean radius of Earth in km\n $dlat = $lat2 - $lat1;\n $dlon = $lon2 - $lon1;\n $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlon / 2) * sin($dlon / 2);\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $km = $r * $c;\n\n //echo '<br/>'.$km;\n return $km;\n }", "private function dist($A,$B)\n {\n return 2*asin(sqrt($this->Haversine($B['lat']-$A['lat'])+cos($A['lat'])*cos($B['lat'])*$this->Haversine($B['lng'] - $A['lng'])));\n }", "public static function Distance($x,$y)\n {\n $distance=sqrt($x*$x+$y*$y);\n echo \"distance of point :\".$distance ;\n }", "function distance($lat1, $lon1, $lat2, $lon2)\n\t{\n\t\t$theta = $lon1 - $lon2;\n\t\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n\t\t$dist = acos($dist);\n\t\t$dist = rad2deg($dist);\n\t\t$miles = $dist * 60 * 1.1515;\n\t\t$kilo = $miles * 1.609344;\n\t\treturn $kilo;\n\t}", "function distance($lat1, $lon1, $lat2, $lon2) {\n\n\t\t$iRadiusEarth = 6371; // kms\n\t\t$lat1 /= 57.29578;\n\t\t$lat2 /= 57.29578;\n\t\t$lon1 /= 57.29578;\n\t\t$lon2 /= 57.29578;\n\t\t\n\t\t$dlat=$lat2-$lat1;\n\t\t$dlon=$lon2-$lon1;\n\t \n\t\t$a = ( sin($dlat/2) * sin($dlat/2) ) + ( cos($lat1) * cos($lat2) ) * ( sin($dlon/2) * sin($dlon/2) );\n\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\t\t$d = $iRadiusEarth * $c;\n\n\t\t// Distance is returned in Kms\n\t\treturn $d;\n\t}", "private function _calcDistance( $pointOne, $pointTwo )\n {\n $dX = $pointTwo['x'] - $pointOne['x'];\n $dY = $pointTwo['y'] - $pointOne['y'];\n return sqrt( $dX * $dX + $dY * $dY );\n }", "private function distanceBetweenTwoPoints($x1, $y1, $x2, $y2)\n {\n $x1 -= $x2;\n $y1 -= $y2;\n return sqrt($x1 * $x1 + $y1 * $y1);\n }", "public function get_stroke() {\n return $this->stroke;\n }", "public function getDistance()\n {\n return $this->_distance;\n }", "function distanceHaversine($p1, $p2)\n\t{\n\t\t$lat1 = $p1->latitude;\n\t\t$lon1 = $p1->longitude;\n\t\t$lat2 = $p2->latitude;\n\t\t$lon2 = $p2->longitude;\n\t\n\t\t$theta = $lon1 - $lon2; \n\t\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); \n\t\t$dist = acos($dist); \n\t\t$dist = rad2deg($dist); \n\t\treturn $dist * 60 * 1.1515;\n\t}", "function distance($lat1, $lng1,$lat2, $lng2)\n{\n //list($lat2, $lng2) = $location2;\n $dp = deg2rad(abs($lat1 - $lat2));\n $dr = deg2rad(abs($lng1 - $lng2));\n $p = deg2rad($lat1 + (($lat2 - $lat1) / 2));\n $m = 6335439 / sqrt(pow((1 - 0.006694 * pow(sin($p), 2)), 3));\n $n = 6378137 / sqrt(1 - 0.006694 * pow(sin($p), 2));\n //$d = round(sqrt(pow(($m * $dp), 2) + pow(($n * cos($p) * $dr), 2)), 4);\n $d = sqrt(pow(($m * $dp), 2) + pow(($n * cos($p) * $dr), 2));\n return $d;\n}", "function getDistance($lat,$lon,$latitude2,$longitude2)\n{\n\t$earthRadius=6371;\n\t$latFrom= deg2rad($lat);\n\t$lonFrom= deg2rad($lon);\n\t$latTo= deg2rad($latitude2);\n\t$lonTo= deg2rad($longitude2);\n\t$latDelta=$latTo -$latFrom;\n\t$lonDelta=$lonTo -$lonFrom;\n\t$angle=2*asin(sqrt(pow(sin($latDelta/2),2)+ cos($latFrom)*cos($latTo)*pow(sin($lonDelta/2),2)));\n\treturn $angle*$earthRadius;\n}", "public function getDiameter(){\n return ($this->radius * 2);\n }", "function earth_distance($longitude1, $latitude1, $longitude2, $latitude2) {\n $long1 = deg2rad($longitude1);\n $lat1 = deg2rad($latitude1);\n $long2 = deg2rad($longitude2);\n $lat2 = deg2rad($latitude2);\n $radius = earth_radius(($latitude1 + $latitude2) / 2);\n\n $cosangle = cos($lat1)*cos($lat2) *\n (cos($long1)*cos($long2) + sin($long1)*sin($long2)) +\n sin($lat1)*sin($lat2);\n return acos($cosangle) * $radius;\n}", "public function setAxisStrokeDistance($distance)\n\t{\n\t\t$this->delta_pixel = $distance;\n\t}", "public function distance()\n {\n list($dLat, $dLong, $dPhi) = $this->dLatLongPhi();\n $q = (abs($dPhi) > 0.000000000001) ? $dLat / $dPhi : cos($this->geo->from['radlat']);\n\n return sqrt(pow($dLat, 2) + pow($q, 2) * pow($dLong, 2)) * $this->geo->radius;\n }", "public function distance($anotherPoint) {\n return sqrt(pow($this->x - $anotherPoint->x, 2) + pow($this->y - $anotherPoint->y, 2));\n }", "public function getAxisDistanceX()\n\t{\n\t\treturn $this->axis_distance_x;\n\t}", "public function getStroke() {\n return $this->stroke;\n }", "public function calcDistance(TrackpointInterface $tp1, TrackpointInterface $tp2)\n {\n $lat1 = deg2rad($tp1->getLat());\n $lat2 = deg2rad($tp2->getLat());\n $long1 = deg2rad($tp2->getLat() - $tp1->getLat());\n $long2 = deg2rad($tp2->getLong() - $tp1->getLong());\n\n $tmp = sin($long1 / 2) * sin($long1 / 2) + cos($lat1) * cos($lat2) * sin($long2 / 2) * sin($long2 / 2);\n $tmp = 2 * atan2(sqrt($tmp), sqrt(1 - $tmp));\n\n return $tmp * $this->radius;\n }", "public function getAxisLabelLineLength()\n\t{\n\t\treturn $this->axis_label_linelength;\n\t}", "function _distance($arr1, $arr2)\n {\n $sumdist = 0;\n\n foreach ($arr2 as $key => $value) {\n if (isset($arr1[$key])) {\n $distance = abs($value - $arr1[$key]);\n } else {\n // $this->_threshold sets the maximum possible distance value\n // for any one pair of trigrams\n $distance = $this->_threshold;\n }\n $sumdist += $distance;\n }\n\n return $sumdist;\n\n // todo: there are other distance statistics to try, e.g. relative\n // entropy, but they're probably more costly to compute\n }", "public function getDistance($lat1, $lng1, $lat2, $lng2){\n $r= 6371000;\n $currLat1 = deg2rad($lat1);\n $currLat2 = deg2rad($lat2);\n $deltaLat = deg2rad($lat2-$lat1);\n $deltaLng = deg2rad($lng2-$lng1);\n\n $a = (sin($deltaLat/2) * sin($deltaLat/2)) +\n (cos($currLat1) * cos($currLat2) * sin($deltaLng) * sin($deltaLng));\n $c = 2 * atan2(sqrt($a), sqrt(1-$a));\n $d = $r * $c;\n\n return $d;\n }", "private function distanceSqBetweenTwoPoints($x1, $y1, $x2, $y2)\n {\n $x1 -= $x2;\n $y1 -= $y2;\n return ($x1 * $x1 + $y1 * $y1);\n }", "function great_circle_distance($lat1 = '', $lon1 = '', $lat2 = '', $lon2 = '')\r\n\t{\r\n\t\t$theta = ($lon1 - $lon2);\r\n\t\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n\t\t$dist = acos($dist);\r\n\t\t$dist = rad2deg($dist);\r\n\t\t$final = ($dist * 60 * 1.1515);\r\n\t\r\n\t\treturn $final;\r\n\t}", "public function getOffsetY(): int\n {\n return $this->offsetY;\n }", "function distance($lat1, $lon1, $lat2, $lon2)\n {\n $r = 6366;\n $lat1 = deg2rad($lat1);\n $lat2 = deg2rad($lat2);\n $lon1 = deg2rad($lon1);\n $lon2 = deg2rad($lon2);\n\n //calcul précis\n $dp= 2 * asin(sqrt(pow (sin(($lat1-$lat2)/2) , 2) + cos($lat1)*cos($lat2)* pow( sin(($lon1-$lon2)/2) , 2)));\n\n //sortie en km\n $d = $dp * $r;\n\n $h = sqrt(pow($d,2));\n\n return $h;\n }", "public function getAxisXLabelOffsetY()\n\t{\n\t\treturn $this->axis_xlabel_offY;\n\t}", "function calc_distance($lat1, $lng1, $lat2, $lng2) {\n\n //Diferença entra as longitudes\n $theta = $lng1 - $lng2;\n\n //Pegando os radianos\n $rad_lat_1 = deg2rad($lat1);\n $rad_lat_2 = deg2rad($lat2);\n $rad_lng = deg2rad($theta);\n\n //Pegando os senos\n $sen_lat_1 = sin($rad_lat_1);\n $sen_lat_2 = sin($rad_lat_2);\n\n //Pegando os cossenos\n $cos_lat_1 = cos($rad_lat_1);\n $cos_lat_2 = cos($rad_lat_2);\n $cos_lng = cos($rad_lng);\n\n //alpha = sin1 * sin2 + cos1 + cos2 * cos theta (em radianos)\n $distance = $sen_lat_1 * $sen_lat_2 + $cos_lat_1 * $cos_lat_2 * $cos_lng;\n\n //Inverte o valor (reverte o cos)\n $distance_rev = acos($distance);\n\n //converte a reversao para radianos do cosseno em graus\n $true_distance = rad2deg($distance_rev);\n\n //segundos\n $seg = $true_distance * 60;\n //milhas\n $miles = $seg * 1.1515;\n\n //Convertendo milhas em km depois metros\n return ($miles * 1.609344) * 1000;\n}", "public static function distance( $lat1, $lon1, $lat2, $lon2 ) {\n\t\t$lat1 = deg2rad( $lat1 );\n\t\t$lon1 = deg2rad( $lon1 );\n\t\t$lat2 = deg2rad( $lat2 );\n\t\t$lon2 = deg2rad( $lon2 );\n\t\t$sin1 = sin( ( $lat2 - $lat1 ) / 2 );\n\t\t$sin2 = sin( ( $lon2 - $lon1 ) / 2 );\n\t\treturn 2 * self::EARTH_RADIUS *\n\t\t\tasin( sqrt( $sin1 * $sin1 + cos( $lat1 ) * cos( $lat2 ) * $sin2 * $sin2 ) );\n\t}", "function dist($v1, $v2)\n{\n\t$dim = count($v1);\n\t$d = array();\n\tfor($a = 0; $a < $dim; $a++){\n\t\t$d[] = pow(abs($v1[$a] - $v2[$a]),2);\n\t}\n\treturn round(sqrt(array_sum($d)),2);\n}", "public function getPointSize () {}", "function distance($lat1, $lng1, $lat2, $lng2, $unit = 'k') {\n $earth_radius = 6378137; // Terre = sphère de 6378km de rayon\n\n $rlo1 = deg2rad($lng1);\n $rla1 = deg2rad($lat1);\n\n $rlo2 = deg2rad($lng2);\n $rla2 = deg2rad($lat2);\n $dlo = ($rlo2 - $rlo1) / 2;\n $dla = ($rla2 - $rla1) / 2;\n $a = (sin($dla) * sin($dla)) + cos($rla1) * cos($rla2) * (sin($dlo) * sin($dlo));\n $d = 2 * atan2(sqrt($a), sqrt(1 - $a));\n //\n $meter = ($earth_radius * $d);\n if ($unit == 'k') {\n return $meter / 1000;\n }\n return $meter;\n }", "function getBookmarkDistance( $aBookmark ) {\r\n if (!isset($this->bookmarks[$aBookmark])) {\r\n return false;\r\n }\r\n return $this->charPosition - $this->bookmarks[$aBookmark]->charPosition;\r\n }", "public function getStrokeDashArray () {}", "function get_distance($lat1, $long1, $lat2, $long2, $unit = 'metres') {\n\t$point1 = new LatLong(new Coordinate($lat1), new Coordinate($long1));\n\t$point2 = new LatLong(new Coordinate($lat2), new Coordinate($long2));\n\t$distance = new Distance($point1, $point2);\n\treturn $distance->get(new GreatCircle());\n}", "public function getStrokeMiterLimit () {}", "function distance_slc($lat1, $lon1, $lat2, $lon2) {\r\n //global $earth_radius;\r\n //global $delta_lat;\r\n //global $delta_lon;\r\n \r\n $earth_radius = 3960.00; # in miles\r\n $delta_lat = $lat2 - $lat1 ;\r\n $delta_lon = $lon2 - $lon1 ; \r\n \r\n $distance = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($delta_lon)) ;\r\n $distance = acos($distance);\r\n $distance = rad2deg($distance);\r\n $distance = $distance * 60 * 1.1515;\r\n $distance = round($distance, 4);\r\n \r\n return $distance;\r\n}", "public function distanceByLandmark(string $markName1, string $markName2): ?float\n {\n $distance = $this->redis->geoDist($this->mapIndex, $markName1, $markName2, 'm');\n return (isset($distance) && $distance !== false ? round($distance, 2) : null);\n }", "function distance($x1,$y1,$z1,$x2,$y2,$z2) {\n\treturn pow(pow(abs($x1-$x2),3)+pow(abs($y1-$y2),3)+pow(abs($z1-$z2),3),1/3);\n}", "function getMapsDistanceDurationTwoPts($o_lat,$o_lon,$d_lat,$d_lon)\n{\n $base_url = \"https://maps.googleapis.com/maps/api/distancematrix/json\";\n $api_key = \"#########\"; // Fill this in with your API key for functionality\n $curl = curl_init();\n $data = [\"units\" => \"imperial\",\"origins\" => $o_lat.','.$o_lon,\n \"destinations\" => $d_lat.','.$d_lon ,\"key\" => $api_key];\n $url = sprintf(\"%s?%s\", $base_url, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_URL, $url);\n $response = curl_exec($curl);\n curl_close($curl);\n $json = json_decode($response,true);\n $result = array(\n $json['rows'][0]['elements'][0]['distance']['value']/1600,\n $json['rows'][0]['elements'][0]['duration']['value']/60\n );\n// var_dump($json);\n// print_r($result);\n return $result;\n}", "public function getThickness() : int {\n return $this -> thickness;\n }", "public static function Distance($coord_1, $coord_2) {\n\t\treturn sqrt(pow($coord_1['x']-$coord_2['x'], 2) + pow($coord_1['y']-$coord_2['y'], 2));\n\t}", "function haversineDistance($lon1, $lat1, $lon2, $lat2)\n{\n $lat1Rad = deg2rad($lat1);\n $lat2Rad = deg2rad($lat2);\n\n $deltaLat = deg2rad($lat2 - $lat1);\n $deltaLon = deg2rad($lon2 - $lon1);\n\n $result =\n 2 * EARTH_RADIUS *\n sqrt(\n pow(sin($deltaLat / 2), 2) +\n cos($lat1Rad) * cos($lat2Rad) * pow(sin($deltaLon / 2), 2)\n );\n\n return (int) $result;\n}", "private function calculateDistance($lat, $long, $lat2, $long2)\n {\n $dlong = $long2 - $long;\n $dlat = $lat2 - $lat;\n $a = (sin($dlat/2))^2 + cos($lat) * cos($lat2 * (sin($dlong/2)))^2;\n $c = 2 * atan2(sqrt($a), sqrt(1-$a));\n $d = 3959 * $c;\n\n return $d;\n }", "private function calculateFinalDistance() {\n $finalDistance = abs(0 - $this->currentX) + abs(0 - $this->currentY);\n return $finalDistance;\n }", "function distance($lat1, $lon1, $lat2, $lon2) {\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n }\n else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n\n return $miles;\n }\n}", "function getDistanceOA($p1, $p2){\n $dist = sqrt(pow($p1->lat-$p2[\"lat\"], 2) + pow($p1->lon-$p2[\"lon\"], 2));\n return $dist;\n}", "public function getTotalDistance()\n {\n return $this->totalDistance;\n }", "function distance($lat1, $lon1, $lat2, $lon2) {\n\t\t$theta = $lon1 - $lon2;\n\t\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n\t\t$dist = acos($dist);\n\t\t$dist = rad2deg($dist);\n\t\t$miles = $dist * 60 * 1.1515;\n\t\treturn ($miles * 1.609344);\n\t}", "function distance($lat1, $lon1, $lat2, $lon2) {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n}", "function euDist($pt1, $pt2){\n\treturn ($pt1[0]-$pt2[0])*($pt1[0]-$pt2[0]) + ($pt1[1]-$pt2[1])*($pt1[1]-$pt2[1]);\n}", "public function getDistanceBetweenAtoB(){\n $radiusOfEarth = 6371;\n $a = pow(sin(deg2rad(($this->latitudeA - $this->latitudeB) / 2)), 2)\n + pow(sin(deg2rad(($this->longtitudeA - $this->longtitudeB) / 2)), 2)\n * cos(deg2rad($this->latitudeB)) * cos(deg2rad($this->latitudeA));\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $distance = round((($radiusOfEarth * $c)/1.6), $mode = PHP_ROUND_HALF_UP);\n \n return $distance;\n \n }", "function distance(float $lat1, float $lon1, float $lat2, float $lon2): float {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n}", "public function distance()\n {\n return $this->buildUnit('distance', Measures\\Distance::class);\n }", "function setLineK($L){\n $result['A'] = $L['end']['y'] - $L['start']['y'];\n $result['B'] = $L['start']['x'] - $L['end']['x'];\n $result['C'] = -($L['start']['y']*$L['end']['x'] - $L['start']['x']*$L['end']['y']);\n return $result;\n }", "protected function getSphericalDistance($lat1, $long1, $lat2, $long2) {\n\t\t$lat1 = deg2rad($lat1);\n\t\t$long1 = deg2rad($long1);\n\t\t$lat2 = deg2rad($lat2);\n\t\t$long2 = deg2rad($long2);\n\n\t\t$R = 6371; // km\n\t\t$d = acos(\n\t\t\tsin($lat1) * sin($lat2) +\n\t\t\tcos($lat1) * cos($lat2) *\n\t\t\tcos($long2 - $long1)\n\t\t) * $R;\n\n\t\treturn $d;\n\t}", "public function shapeDeviation() {\n\t\t$Difference = 100 * ($this->prognosisByShapeInSeconds() - $this->Activity->duration()) / $this->Activity->duration();\n\n\t\treturn HTML::plusMinus(sprintf(\"%01.2f\", $Difference), 2).' &#37;';\n\t}", "private function calculateDistanceBetween2LatAndLng($lat1, $lng1, $lat2, $lng2) {\n $R = 6371; //6371 for km, 3959 for mile\n $lat1 = deg2rad($lat1);\n $lng1 = deg2rad($lng1);\n $lat2 = deg2rad($lat2);\n $lng2 = deg2rad($lng2);\n\n $d = acos(sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($lng2 - $lng1)) * $R;\n return $d;\n }", "function calculateDistance( $lat1, $lon1, $ele1, $lat2, $lon2, $ele2, $distancetype ) {\n\tif ( '2' == $distancetype ) {\n\t\treturn (float) $ele1 - (float) $ele2;\n\n\t\t/* Distance typ: Flat */\n\t} elseif ( '1' == $distancetype ) {\n\t\t$alpha = (float) sin( (float) toRadians( (float) $lat2 - (float) $lat1 ) / 2 );\n\t\t$beta = (float) sin( (float) toRadians( (float) $lon2 - (float) $lon1 ) / 2 );\n\t\t/* Distance in meters */\n\t\t$a = (float) ( (float) $alpha * (float) $alpha ) + (float) ( (float) cos( (float) toRadians( $lat1 ) ) * (float) cos( (float) toRadians( $lat2 ) ) * (float) $beta * (float) $beta );\n\t\t$dist = 2 * 6369628.75 * (float) atan2( (float) sqrt( (float) $a ), (float) sqrt( 1 - (float) $a ) );\n\t\treturn (float) sqrt( (float) pow( (float) $dist, 2 ) + pow( (float) $lat1 - (float) $lat2, 2 ) );\n\n\t\t/* Distance typ: Normal */\n\t} else {\n\t\t$alpha = (float) sin( (float) toRadians( (float) $lat2 - (float) $lat1 ) / 2 );\n\t\t$beta = (float) sin( (float) toRadians( (float) $lon2 - (float) $lon1 ) / 2 );\n\t\t/* Distance in meters */\n\t\t$a = (float) ( (float) $alpha * (float) $alpha ) + (float) ( (float) cos( (float) toRadians( $lat1 ) ) * (float) cos( (float) toRadians( $lat2 ) ) * (float) $beta * (float) $beta );\n\t\t$dist = 2 * 6369628.75 * (float) atan2( (float) sqrt( (float) $a ), (float) sqrt( 1 - (float) $a ) );\n\t\t$d = (float) sqrt( (float) pow( (float) $dist, 2 ) + pow( (float) $lat1 - (float) $lat2, 2 ) );\n\t\treturn sqrt( (float) pow( (float) $ele1 - (float) $ele2, 2 ) + (float) pow( (float) $d, 2 ) );\n\t}\n}" ]
[ "0.6170504", "0.55761814", "0.5497797", "0.54819727", "0.5480287", "0.5421208", "0.54104215", "0.53908086", "0.53571934", "0.5319497", "0.5312964", "0.5311079", "0.5308417", "0.5279954", "0.5271083", "0.5243663", "0.5237232", "0.5229777", "0.52223706", "0.5218209", "0.52107817", "0.521012", "0.52059674", "0.5190885", "0.51802254", "0.5168176", "0.5163694", "0.5157305", "0.5153313", "0.5129615", "0.51186866", "0.511574", "0.50856066", "0.5061582", "0.50534165", "0.5043964", "0.50407654", "0.5037216", "0.5037216", "0.5029947", "0.50145936", "0.5014379", "0.5012368", "0.5008441", "0.4994313", "0.49924284", "0.498084", "0.49780452", "0.49718267", "0.49545136", "0.49390867", "0.4920236", "0.49164057", "0.49162707", "0.49125874", "0.4910506", "0.49000174", "0.4888517", "0.48746368", "0.48680985", "0.4865138", "0.48639077", "0.48541686", "0.48433146", "0.48291647", "0.48282367", "0.48262256", "0.47968504", "0.4794761", "0.47848207", "0.47748512", "0.47732818", "0.47683138", "0.4755221", "0.4752092", "0.47403237", "0.47337246", "0.47330394", "0.47273508", "0.47216216", "0.47175783", "0.47092006", "0.47087097", "0.4703974", "0.47035578", "0.47019845", "0.46989906", "0.4690948", "0.46905413", "0.46842796", "0.4666752", "0.46657854", "0.46577758", "0.46547675", "0.465175", "0.46346903", "0.4631972", "0.46296206", "0.46285865", "0.46267307" ]
0.7578307
0
Gets the chart data color (line)
Получает цвет данных диаграммы (линия)
public function getDataColor() { return $this->data_color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_line_color() {\n return $this->line_color;\n }", "public function getColor() {\n return $this->_dataHelper->getColor();\n }", "public function getColor()\n {\n return $this->value;\n }", "public function getColor()\n {\n return ($this->info['color'] ?? static::DEFAULT_COLOR);\n }", "protected function getColor()\r\n {\r\n return $this->color;\r\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "protected function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->_color;\n }", "public function getColor ()\r\n {\r\n return $this->color;\r\n }", "public static function _getColorLineAvailable(){\n return [\n \"#18dae6\", \"#da4931\", \"#5ff347\", \"#3b3fe7\",\n \"#eda129\", \"#d726dd\", \"#d0e521\", \"#e820e1\",\n \"#c21b26\"\n ];\n }", "public function getChartColour() {\n\t\t$theme = Tactile_AccountMagic::getValue('theme', 'green');\n\t\tswitch ($theme) {\n\t\t\tcase 'red':\n\t\t\t\t$colour = array('a40404', 'CC7777');\n\t\t\t\tbreak;\n\t\t\tcase 'blue':\n\t\t\t\t$colour = array('1C336E','4671D5');\n\t\t\t\tbreak;\n\t\t\tcase 'grey':\n\t\t\t\t$colour = array('343434', '999999');\n\t\t\t\tbreak;\n\t\t\tcase 'orange':\n\t\t\t\t$colour = array('DD8800', 'ff9c00');\n\t\t\t\tbreak;\n\t\t\tcase 'purple':\n\t\t\t\t$colour = array('570094', '8100db');\n\t\t\t\tbreak;\n\t\t\tcase 'custom':\n\t\t\t\t$pri = preg_replace('/^#/','', Tactile_AccountMagic::getValue('theme_custom_primary', '#105F15'));\n\t\t\t\t$sec = preg_replace('/^#/','', Tactile_AccountMagic::getValue('theme_custom_secondary', '#569C30'));\n\t\t\t\t$colour = array($pri, $sec);\n\t\t\t\tbreak;\n\t\t\tcase 'green':\n\t\t\tdefault:\n\t\t\t\t$colour = array('105F15', '569C30');\n\t\t}\n\t\treturn $colour;\n\t}", "public function getAxisColor() {\n return $this->axisColor;\n }", "public function getColor(){\r\n return $this->coo->readCookie($this->dColor);\r\n }", "function get_colour()\n\t{\n\t\tif (!array_key_exists($this->colour_number, $this->chart_options['colours']))\n\t\t{\n\t\t\t$this->colour_number = 0;\n\t\t}\n\n\t\t$send_colour = $this->chart_options['colours'][$this->colour_number];\n\t\t$this->colour_number++;\n\n\t\treturn $send_colour;\n\t}", "public function getColor()\n {\n // Busca en esta clase la propiedad X\n return $this->color;\n }", "public function getColor() {\n\t\treturn $this->color;\n\t}", "public function getColor() {\n\t\treturn $this->color;\n\t}", "public function getColor(){\n\t\treturn $this->color;\n\t}", "public function getcolor()\n {\n return $this->color;\n }", "function getColor() {\n return $this->color;\n }", "public function getColor(){\n\t \treturn $this->color;\n\n\t}", "public function getColor(){\n return $this->color;\n }", "public function getStrokeColor () {}", "function get_color() {\n return $this->munge_color( $this->_props[\"color\"] );\n }", "public function colorData()\n {\n return array(\n array('hex' => '000000', 'rgb' => array(0, 0, 0), 'hsl' => array(0, 0, 0)),\n array('hex' => 'FFFFFF', 'rgb' => array(255, 255, 255), 'hsl' => array(0, 0, 1)),\n array('hex' => 'FF0000', 'rgb' => array(255, 0, 0), 'hsl' => array(0, 1, 0.5)),\n array('hex' => '00FF00', 'rgb' => array(0, 255, 0), 'hsl' => array(120, 1, 0.5)),\n array('hex' => '0000FF', 'rgb' => array(0, 0, 255), 'hsl' => array(240, 1, 0.5)),\n array('hex' => 'FFFF00', 'rgb' => array(255, 255, 0), 'hsl' => array(60, 1, 0.5)),\n array('hex' => '00FFFF', 'rgb' => array(0, 255, 255), 'hsl' => array(180, 1, 0.5)),\n array('hex' => 'FF00FF', 'rgb' => array(255, 0, 255), 'hsl' => array(300, 1, 0.5)),\n array('hex' => 'C0C0C0', 'rgb' => array(192, 192, 192), 'hsl' => array(0, 0, 0.753)),\n array('hex' => '808080', 'rgb' => array(128, 128, 128), 'hsl' => array(0, 0, 0.5)),\n array('hex' => '800000', 'rgb' => array(128, 0, 0), 'hsl' => array(0, 1, 0.25)),\n array('hex' => '808000', 'rgb' => array(128, 128, 0), 'hsl' => array(60, 1, 0.25)),\n array('hex' => '008000', 'rgb' => array(0, 128, 0), 'hsl' => array(120, 1, 0.25)),\n array('hex' => '800080', 'rgb' => array(128, 0, 128), 'hsl' => array(300, 1, 0.25)),\n array('hex' => '008080', 'rgb' => array(0, 128, 128), 'hsl' => array(180, 1, 0.25)),\n array('hex' => '000080', 'rgb' => array(0, 0, 128), 'hsl' => array(240, 1, 0.25))\n );\n }", "public function getTickColor() {\n return $this->tickColor;\n }", "public function getColor() {\n return $this->transformTo($this->type);\n }", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "function getColor(){\r\n return substr($this->getProp('color'),0,6);\r\n }", "public function getColor(): string\n {\n return $this->color;\n }", "public function getColor(): string\n {\n return $this->color;\n }", "public function getColor();", "public function getColor();", "public function getcolor(){\n\t\treturn $this->_color;\n\t}", "public function getAttributeColorArray() {\n return $this->_getAttributeArray('color');\n }", "public function get_color()\r\n\t{\r\n\r\n\t\t$sql = \"select * from color\";\r\n\t\treturn $this->db->query($sql)->result();\r\n\r\n\t}", "public function getColor(): ?string\n {\n if (count($this->color) == 0) {\n return null;\n }\n return $this->color['value'];\n }", "public function getColour()\n {\n return $this->colour;\n }", "public function getColor(){\n return $this->Color;\n }", "public function getIdColor()\n {\n return $this->id_color;\n }", "function getColor(){\n return $this->state['color'];\n }", "public function getColor()\n {\n $color = $this->getField('HeadlineColor');\n //SS_Log::log($color, SS_Log::WARN);\n switch ($color) {\n case \"Weiss\":\n return 'color: #ffffff !important;';\n break;\n case \"Schwarz\":\n return 'color: #000000 !important;';\n break;\n case \"Grau\":\n return 'color: #8797ae !important;';\n break;\n case \"Blau\":\n return 'color: #57bfe1 !important;';\n break;\n }\n }", "public function getColor() {\r\n return parent::getColor();\r\n }", "function lineColor($row){\n\t$name = $row[0];\n\tif(strpos($name,\"Green\")!==false)\n\t\treturn \"#347C17\";\n\telse if(strpos($name,\"Red\")!==false)\n\t\treturn \"#C11B17\";\n\telse if(strpos($name,\"Silver\")!==false)\n\t\treturn \"#463E41\";\n\telse if(strpos($name,\"Gold\")!==false)\n\t\treturn \"#D4A017\";\n\telse if(strpos($name,\"Blue\")!==false)\n\t\treturn \"#1569C7\";\n\telse\n\t\treturn \"\";\n}", "function getData ()\n\t{\n\t\treturn $this->bgcolor.\"\\n\".$this->bordercolor;\n\t}", "public function getFillColor () {}", "public function get_product_color()\r\n\t{\r\n\r\n\t\t$sql = \"select * from product_color \";\r\n\t\treturn $this->db->query($sql)->result();\r\n\r\n\t}", "public function getColor(): ?string\n {\n return $this->color;\n }", "public function getColor(): ?string\n {\n return $this->color;\n }", "protected function getColor() {\n return null;\n }", "public function getColor(): ?string\n {\n return isset($this->Color) ? $this->Color : null;\n }", "public function getColor()\n {\n if ($this->category == 2 || $this->category == 3 || $this->category == 4) $color = 'red'; else $color = 'green';\n\n $this->getBalance() == 0 ? $this->setColor('black') : $this->setColor($color);\n\n return $this->color;\n }", "public function getColor() {\n if (!$this->exists()) {\n if ($this->isLikelyDeletedUser()) {\n return null;\n }\n /*\n If the user does not exist, get the anonymous user color.\n */\n if (self::$anonColor !== null) return self::$anonColor;\n\n $db = Database::connect();\n self::$anonColor = $db\n ->from(\"group\")\n ->where(\"level\", 0)\n ->value(\"color\");\n\n return self::$anonColor;\n }\n return $this->data[\"color\"];\n }", "function getSeriePalette($serie) {\r\n if ( !isset($this->data[\"Series\"][$serie]) ) { \r\n return null; \r\n }\r\n \r\n return [\r\n \"R\" => $this->data[\"Series\"][$serie][\"Color\"][\"R\"],\r\n \"G\" => $this->data[\"Series\"][$serie][\"Color\"][\"G\"],\r\n \"B\" => $this->data[\"Series\"][$serie][\"Color\"][\"B\"],\r\n \"Alpha\" => $this->data[\"Series\"][$serie][\"Color\"][\"Alpha\"],\r\n ];\r\n }", "public function getColors()\n {\n return $this->colors;\n }", "public function getColor()\r\n {\r\n }", "function get_color () {\n return (array) get_option($this->prefix . $this->_color , array());\n }", "public function getColorValue ($color) {}", "public function GetColor($color) {\n // depending on the selected category (i.e Pass, Fail, Merit... etc)\n $color_array = array();\n $chart_colors = $this->c->getParameter('chart_colors');\n \n if (array_key_exists($color, $chart_colors)){\n $color_array = array(\n \"R\" => $chart_colors[$color]['R'], \n \"G\" => $chart_colors[$color]['G'], \n \"B\" => $chart_colors[$color]['B'],\n \"Alpha\" => $chart_colors[$color]['Alpha']);\n } else {\n $color_array = array(\n \"R\" => $chart_colors['light_grey']['R'], \n \"G\" => $chart_colors['light_grey']['G'], \n \"B\" => $chart_colors['light_grey']['B'],\n \"Alpha\" => $chart_colors['light_grey']['Alpha']);\n }\n \n return $color_array;\n }", "public function getColorId() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"colorId\");\n\t}", "function GetColor() {\n\t\t$color=null;\n\t\tswitch($this->_level) {\n\t\t\tcase 0:\n\t\t\t\t$color = \"green\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$color = \"orange\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$color = \"red\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $color;\n\t}", "public function getColorAttribute() {\n $color = 'green darken-2';\n\n // Negative points (reward redemption)\n //if ($this->points < 0) $color = 'red darken-2';\n if ($this->points < 0) $color = 'blue darken-2';\n\n switch ($this->event) {\n case 'Sign up bonus': $color = 'orange darken-2'; break;\n }\n return $color;\n }", "public function getColors() {\n return $this->colors;\n }", "public function getBackgroundColor() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"backgroundColor\");\n\t}", "public function getRed()\n {\n return $this->r;\n }", "public function getColorAttribute()\n {\n $agenda = $this->agenda()->first();\n switch ($this->priority) {\n case '0':\n $color = \"#\".$agenda->priority_low_color;\n break;\n case '1':\n $color = \"#\".$agenda->priority_medium_color;\n break;\n case '2':\n $color = \"#\".$agenda->priority_high_color;\n break;\n\n default:\n $color = \"#000000\";\n break;\n }\n return $color;\n }", "public function getEnvColours()\n {\n // Lazily load colours from environment data\n if ($this->_colours === null) {\n $environments = $this->getEnvironments();\n if (!isset($environments[$this->getEnvironment()])) {\n return null;\n }\n $data = $environments[$this->getEnvironment()];\n //$this->_colours = Mage::getModel('c3_environmentbanner/colours')\n // ->setData($data);\n $this->_colours = $this->_colours2;\n $this->_colours->setData($data);\n\n }\n\n return $this->_colours;\n }", "public function getRed()\n {\n return $this->red;\n }", "public function getRed()\n {\n return $this->_red;\n }", "public static function getColors();", "public function getColorCode();", "function get_color($prd_id){\n\t\treturn $this -> get_records('prd_id = '.$prd_id,'fs_products_color');\n\t}", "public function getColors(): array\n {\n return array_values($this->colors);\n }", "public function getLabelColor() {\n return $this->labelColor;\n }", "public function getForegroundColor() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"foregroundColor\");\n\t}", "public function getColors()\r\n\t{\r\n\t\treturn $this->_colors;\r\n\t}", "protected function getColors()\n {\n if ($this->deleted_at) {\n return [\n 'textColor' => '#fff',\n 'backgroundColor' => '#cdcdcd',\n 'borderColor' => '#cdcdcd'\n ];\n }\n switch ($this->type) {\n case 'callcenter-appointment':\n return [\n 'textColor' => '#fff',\n 'backgroundColor' => '#db0630',\n 'borderColor' => '#db0630'\n ];\n case 'general':\n case 'seminar':\n case 'networking':\n return [\n 'textColor' => '#fff',\n 'backgroundColor' => '#3f888f',\n 'borderColor' => '#3f888f'\n ];\n case 'private':\n return [\n 'textColor' => '#fff',\n 'borderColor' => in_array($this->pivot->role, ['owner', 'attendee'])\n ? '#4682B4'\n : '#505050', \n 'backgroundColor' => in_array($this->pivot->role, ['owner', 'attendee'])\n ? '#4682B4'\n : '#505050', \n ];\n default:\n return $this->getColorsByRole();\n }\n }", "public function getColor($c_name) {\r\n\t\treturn $this->color_ref[$c_name];\r\n\t}", "function overlap_get_color(){\r\n return overlap_get_color_scheme();\r\n}", "function getFCColor() \r\n\t{\r\n\t\t//accessing the global variables\r\n\t\tglobal $FC_ColorCounter;\r\n\t\tglobal $arr_FCColors;\r\n\t\t\r\n\t\t//Update index\r\n\t\t$FC_ColorCounter++;\r\n\t\t//Return color\r\n\t\treturn($this->arr_FCColors[$FC_ColorCounter % count($this->arr_FCColors)]);\r\n\t}", "function default_chart_color($index) {\r\n\tswitch ($index) {\r\n\t\tcase 0: return \"#3366cc\";\r\n\t\tcase 1: return \"#dc3912\";\r\n\t\tcase 2: return \"#ff9900\";\r\n\t\tcase 3: return \"#109618\";\r\n\t\tcase 4: return \"#990099\";\r\n\t\tcase 5: return \"#3b3eac\";\r\n\t\tcase 6: return \"#0099c6\";\r\n\t\tcase 7: return \"#dd4477\";\r\n\t\tcase 8: return \"#66aa00\";\r\n\t\tcase 9: return \"#b82e2e\";\r\n\t\tcase 10: return \"#316395\";\r\n\t\tcase 11: return \"#994499\";\r\n\t\tcase 12: return \"#22aa99\";\r\n\t\tcase 13: return \"#aaaa11\";\r\n\t\tcase 14: return \"#6633cc\";\r\n\t\tcase 15: return \"#e67300\";\r\n\t\tcase 16: return \"#8b0707\";\r\n\t\tcase 17: return \"#329262\";\r\n\t\tcase 18: return \"#5574a6\";\r\n\t\tcase 19: return \"#3b3eac\";\r\n\t}\r\n\t// unknown\r\n\treturn \"white\";\r\n}", "public function getJsPdfColor()\n {\n $rgb = $this->toRgbArray();\n if ($this->cmp_alpha == 0) {\n return '[\"T\"]'; // transparent color\n }\n return sprintf('[\"RGB\",%F,%F,%F]', $rgb['red'], $rgb['green'], $rgb['blue']);\n }", "public function getRGB()\n {\n return $this->value->rgb;\n }", "public function getColorOfCurrentPixel()\n {\n return $this->_currentColor;\n }" ]
[ "0.75723577", "0.7392424", "0.7036361", "0.700127", "0.6877185", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.686521", "0.683949", "0.67967296", "0.6793958", "0.6791811", "0.6782539", "0.6774605", "0.6758421", "0.6752394", "0.67442936", "0.67290324", "0.6729021", "0.6729021", "0.66742265", "0.6653837", "0.66507816", "0.6644611", "0.66163", "0.6533771", "0.6521711", "0.651966", "0.64646816", "0.64491594", "0.64483213", "0.64483213", "0.64483213", "0.64437807", "0.64195347", "0.64195347", "0.6374501", "0.6374501", "0.63548374", "0.634386", "0.62865686", "0.62852234", "0.6253996", "0.6251131", "0.6212017", "0.618458", "0.61744636", "0.6165951", "0.61599386", "0.61101556", "0.6107375", "0.6089551", "0.6083332", "0.6083332", "0.60731775", "0.6064521", "0.60615724", "0.6050446", "0.6049929", "0.60297245", "0.6026553", "0.60236", "0.60124415", "0.5990806", "0.5990169", "0.5978341", "0.5974492", "0.5955502", "0.59516716", "0.59453624", "0.5943113", "0.59385866", "0.59141254", "0.589695", "0.58956003", "0.58954006", "0.5860543", "0.58580095", "0.583934", "0.58322376", "0.5814057", "0.57627654", "0.57549363", "0.57457536", "0.57344556", "0.5715032", "0.5711504", "0.57048255", "0.5680917" ]
0.7840619
0
Actualiza la suma del recibo, de forma forzada
Обновите сумму чека, принудительно
function setSumaDeRecibo($monto = 0){ $this->mSumaDeRecibo = $monto; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recalcula(){\n\t\t$mSQL = 'UPDATE lrece a SET lista=(SELECT SUM(lista) FROM itlrece b WHERE a.id=b.id_lrece );';\n\t\t$this->db->query($mSQL);\n\t\t$mSQL = 'UPDATE lrece SET litros=lleno, neto=lleno, diferen=lleno-lista WHERE vacio=0 AND lleno>0;';\n\t\t$this->db->query($mSQL);\n\t\t$mSQL = 'UPDATE lrece SET lista=TRUNCATE(lista,0);';\n\t\t$this->db->query($mSQL);\n\t\t$mSQL = 'UPDATE lrece SET litros=TRUNCATE(ROUND((lleno-vacio)/densidad,2),0), neto=lleno-vacio, diferen=ROUND((lleno-vacio)/densidad,2)-lista\n\t\tWHERE vacio>0 AND lleno>0;';\n\t\t$this->db->query($mSQL);\n\t\t$mSQL = 'UPDATE lrece SET diferen=litros-lista;';\n\t\t$this->db->query($mSQL);\n\t\techo \"Calculo Concluido\";\n\t}", "public function updateTotalBillToPaymentsSection(){\n \t$totalAmount=0;\n \t$pos=session()->get('pos');\n foreach($pos as $id=>$productAttribute){\n $totalAmount += $productAttribute['price']*$productAttribute['quantity'];\n }\n $this->emit('totalAmountEvent', $totalAmount);\n }", "function setFinalizarRecibo($UpdateSaldo = false, $tesoreria_cargada = false){\n\t\t$this->mMoneda\t\t= strtoupper($this->mMoneda);\n\t\t$xLog\t\t\t\t= new cCoreLog();\n\t\t$xAv\t\t\t\t= new cAML();\n\t\t$xQL\t\t\t\t= new MQL();\n\t\t//generar Poliza a demanda\n\t\t$finalizado\t\t\t\t= true;\n\t\t//tranferencia.egresos cheque\n\t\tif(MODULO_CAJA_ACTIVADO == false){ $tesoreria_cargada = true;/* Forzar AML si Tesoreria esta Desactivado */ }\n\t\t/**\n\t\t * Modificacion de la condicion de socio por afectar al recibo en SI?\n\t\t */\n\t\t$this->mPeriodoActivo;\n\t\tif ($UpdateSaldo == true){\n\t\t\tif ( ($this->mSumaDeRecibo == 0) OR ($this->mForceUpdateSaldos == true) OR ( !isset($this->mSumaDeRecibo) ) OR ( $this->mSumaDeRecibo == false ) OR ( $this->mSumaDeRecibo == '' ) ){\n\t\t\t\t$sqlSUM = \"SELECT\n\t\t\t\t\t\t\t\tSUM(`operaciones_mvtos`.`afectacion_real` * `operaciones_mvtos`.`valor_afectacion`) \tAS 'monto',\n\t\t\t\t\t\t\t\tCOUNT(`operaciones_mvtos`.`idoperaciones_mvtos`)\t\t\t\t\t\t\t\t\t\tAS 'numero',\n\t\t\t\t\t\t\t\t`operaciones_mvtos`.`recibo_afectado`,\n\t\t\t\t\t\t\t\t`operaciones_mvtos`.`socio_afectado`\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t`operaciones_mvtos` `operaciones_mvtos`\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t(`operaciones_mvtos`.`recibo_afectado` =\" . $this->mCodigoDeRecibo . \")\n\n\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t`operaciones_mvtos`.`recibo_afectado` \";\n\t\t\t\t$TDRec\t\t\t\t\t= obten_filas($sqlSUM);\n\n\t\t\t\t$this->mSumaDeRecibo \t= (!isset($TDRec[\"monto\"])) ? 0 : $TDRec[\"monto\"];\n\t\t\t\t$this->mNumeroDeMvtos\t= (!isset($TDRec[\"numero\"])) ? 0 : $TDRec[\"numero\"];\n\t\t\t\t$this->mMessages\t\t.= \"OK\\tMonto Actualizado a \" . $this->mSumaDeRecibo . \" y # Operaciones \" . $this->mNumeroDeMvtos . \"\\r\\n\";\n\t\t\t}\n\t\t\tif($this->getAfectacionEnCaja() !== 0){\n\t\t\t\t$this->mSumaDeRecibo\t= $this->mSumaDeRecibo * $this->getAfectacionEnCaja();\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"UPDATE operaciones_recibos SET total_operacion=\" . $this->mSumaDeRecibo . \"\tWHERE\tidoperaciones_recibos= \" . $this->mCodigoDeRecibo . \"\t\";\n\t\t\t$xRs = $xQL->setRawQuery($sql);\n\t\t}\n\n\t\t$this->mTotalRecibo\t= $this->mSumaDeRecibo;\n\t\t$this->setCleanCache();\n\t\t//-- AML\n\t\tif(MODULO_AML_ACTIVADO == true AND $this->isPagable() == true AND $tesoreria_cargada == true){\n\t\t\t$xAml\t\t= new cAMLPersonas($this->mSocio);\n\t\t\t$xMat\t\t= new cAMLMatrizDeRiesgo();\n\t\t\t$xAmlO\t\t= new cAMLOperaciones();\n\t\t\t$NivelRiesgo= 0;\n\t\t\t$Factores\t= 0;\n\t\t\t$xAml->init();\n\t\t\t$xAml->setForceAlerts();\n\t\t\t\n\t\t\t\n\t\t\t$this->init();\n\t\t\t//Revisa una persona si es M}Vigilada\n\t\t\tif($xAml->getEsPersonaVigilada() == true){\n\t\t\t\t$xTipoPago\t\t\t= new cTesoreriaTiposDePagoCobro($this->mTipoDePago);\n\t\t\t\t$tipo_de_pago_aml\t= $this->mTipoDePago;\n\t\t\t\t$res\t\t\t\t= false;\n\t\t\t\tif($xTipoPago->init() == true){\n\t\t\t\t\t//Actualizar Origen AML\n\t\t\t\t\t$this->mTipoOrigenAML\t= $xTipoPago->getTipoEnAML();\n\t\t\t\t\tif($this->mTipoOrigenAML>0){\n\t\t\t\t\t\t$res\t\t= $xAmlO->analizarOperacion($this->mSocio, 0, $this->mMoneda, $tipo_de_pago_aml, \t$this->getFechaDeRecibo(), $this->getCodigoDeRecibo(), $this->mTipoOrigenAML);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($res == false ){\n\t\t\t\t\t$xLog->add(\"OK\\tAML Normal por Tipo de Pago $tipo_de_pago_aml y en AML \" . $this->mTipoOrigenAML . \"\\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t\t$xLog->add($xAmlO->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t} else {\n\t\t\t\t\t//REPORTAR\n\t\t\t\t\t$xAv\t\t\t= new cAML();\n\t\t\t\t\tif($xAmlO->getTipoDeReporte() == AML_REPORTE_INMEDIATO){\n\t\t\t\t\t\t$xAv->setForceRegistroRiesgo();\n\t\t\t\t\t\t$xLog->add(\"WARN\\tAML de Aviso Inmediato por Tipo de Pago $tipo_de_pago_aml y en AML \" . $this->mTipoOrigenAML . \"\\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t\t}\n\t\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $xAmlO->getTipoDeAlerta(), $xAmlO->getMessageAlert(), $this->mCodigoDeRecibo, $this->mFechaDeOperacion);\n\t\t\t\t}\n\t\t\t\t//Riesgo de Operación Implicita\n\t\t\t\t\n\t\t\t\t$xLog->add($xAmlO->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t}\n\t\t\t//Validar si es person riesgosa\n\t\t\t\n\t\t\t$xSoc\t\t\t\t\t= $xAml->getOPersona();\n\t\t\t$EstadoReportado\t\t= false;\n\t\t\t//Operaciones con Personas Bloqueadas\n\t\t\tif($xSoc->getEsPersonaSDN() == true ){ //AND $xAml->getEsPersonaVigilada() == true\n\t\t\t\t$xMat->initByTopico($xMat->O_PERSONA_BLOQUEADO);\n\t\t\t\t$idriesgo\t\t\t= $xMat->getTipoRiesgo();\n\t\t\t\t$xLog->add(\"REPORTE\\tOperaciones con persona ALTAMENTE RIESGOSA en el Recibo de Operacion : \" . $this->mCodigoDeRecibo);\n\t\t\t\t$xAv\t\t\t\t= new cAML();\n\t\t\t\t$xAv->setForceRegistroRiesgo();\n\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t$xLog->add($xAv->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t$EstadoReportado\t= true;\n\t\t\t\t$NivelRiesgo\t\t+= $xMat->getNivelRiesgo();\n\t\t\t\t$Factores++;\n\t\t\t}\n\t\t\t//REPORTAR operaciones con PEPs\n\t\t\tif( $xSoc->getEsPersonaPoliticamenteExpuesta() == true AND $xAml->getEsPersonaVigilada() == true ){\n\t\t\t\t$xMat->initByTopico($xMat->O_PERSONA_PEPS);\n\t\t\t\t$idriesgo\t\t\t= $xMat->getTipoRiesgo();\n\t\t\t\t$xLog->add(\"REPORTE\\tOperaciones con PEPS Recibo de Operacion : \" . $this->mCodigoDeRecibo);\n\t\t\t\t$xAv\t\t\t= new cAML();\n\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t$xLog->add($xAv->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t$EstadoReportado\t= true;\n\t\t\t\t$NivelRiesgo\t\t+= $xMat->getNivelRiesgo();\n\t\t\t\t$Factores++;\n\t\t\t}\n\t\t\t//Reportar Operaciones con Persona de Alto Riesgo, si es vigilada y si no ha sido verificado antes\n\t\t\tif($xSoc->getEsPersonaRiesgosa() == true AND $xAml->getEsPersonaVigilada() == true AND $EstadoReportado == false ){\n\t\t\t\t$xMat->initByTopico($xMat->O_PERSONA_ALTORIESGO);\n\t\t\t\t$idriesgo\t\t\t= $xMat->getTipoRiesgo();\n\t\t\t\t$xLog->add(\"REPORTE\\tOperaciones con Personas de Alto Riesgo en el Recibo de Operacion : \" . $this->mCodigoDeRecibo);\n\t\t\t\t$xAv\t\t\t= new cAML();\n\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t$xLog->add($xAv->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t$NivelRiesgo\t\t+= $xMat->getNivelRiesgo();\n\t\t\t\t$Factores++;\n\t\t\t}\n\t\t\t\n\t\t\t//Operaciones de una exhibicion 500 y en Moneda Extranjera\n\t\t\tif($this->mMoneda != AML_CLAVE_MONEDA_LOCAL){\n\t\t\t\t$xRisk\t\t\t= new cAMLCatalogoDeRiesgos(AML_CLAVE_RIESGO_OPS_INDIVIDUALES);\n\t\t\t\t\n\t\t\t\tif($xRisk->init() == true){\n\t\t\t\t\t$xMon\t\t= new cMonedas($this->mMoneda);\n\t\t\t\t\t$unidades\t= $xMon->getEnDolares($this->getUnidadesOriginales());\n\t\t\t\t\tif($unidades >= $xRisk->getUnidadesPonderadas()){\n\t\t\t\t\t\t$xLog->add(\"REPORTE\\tOperaciones($unidades) excedidas de 500 USD en el recibo \" . $this->mCodigoDeRecibo . \" Moneda \" . $this->mMoneda);\n\t\t\t\t\t\t$idriesgo\t\t= $xRisk->getClave();\n\t\t\t\t\t\t$xAv\t\t\t= new cAML();\n\t\t\t\t\t\t$xAv->setForceRegistroRiesgo();\n\t\t\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t\t\t$xLog->add($xAv->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t\t\t$NivelRiesgo\t\t+= $xMat->getNivelRiesgo();\n\t\t\t\t\t\t$Factores++;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$xLog->add(\"OK\\tLimites(500USD) sin exceder en la Moneda \" . $this->mMoneda . \" por $unidades \\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$xLog->add(\"OK\\tNo hay Riesgo(500USD) Iniciado para la\" . $this->mMoneda . \" por $unidades \\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Agregar Relevantes por 10000USD\n\t\t\tif($this->isEfectivo() == true){\n\t\t\t\t$xRisk\t\t\t= new cAMLCatalogoDeRiesgos(AML_CLAVE_RIESGO_OPS_RELEVANTES);\n\t\t\t\tif($xRisk->init() == true){\n\t\t\t\t\t$xMon\t\t= new cMonedas($this->mMoneda);\n\t\t\t\t\t$mmonto\t\t= ($this->mMoneda == AML_CLAVE_MONEDA_LOCAL) ? $this->getTotal() : $this->getUnidadesOriginales();\n\t\t\t\t\t$unidades\t= $xMon->getEnDolares($mmonto);\n\t\t\t\t\t$idriesgo\t= $xRisk->getClave();\n\t\t\t\t\t\n\t\t\t\t\tif($unidades >= $xRisk->getUnidadesPonderadas()){\n\t\t\t\t\t\t$xLog->add(\"REPORTE\\tOperaciones Relevantes por $unidades USD en el recibo \" . $this->mCodigoDeRecibo . \" Moneda \" . $this->mMoneda);\n\t\t\t\t\t\t$xAv->setForceRegistroRiesgo();\n\t\t\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t\t\t$xLog->add($xAv->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t\t\t\t\t$NivelRiesgo\t\t+= $xMat->getNivelRiesgo();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$Factores++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$xLog->add(\"OK\\tLimites(Relevantes) sin exceder en la Moneda \" . $this->mMoneda . \" por $unidades \\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$xLog->add(\"OK\\tNo hay Riesgo(Relevantes) Iniciado para la\" . $this->mMoneda . \" por $unidades \\r\\n\", $xLog->DEVELOPER);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tif($xAml->getEsPersonaOmitida() == true){\n\t\t\t\t$xLog->add(\"OK\\tLa Persona esta en Lista de Omitidos. No se vigila perfil transaccional u Operaciones por Nucleo.\\r\\n\");\n\t\t\t} else {\n\t\t\t\t//Operaciones Internas Preocupantes por Usuario\n\t\t\t\t$xAml->setAnalizarTransaccionalidadPorNucleo($this->mCodigoDeRecibo, $this->mFechaDeOperacion, $this->mUsuario, true);\n\t\t\t\t\n\t\t\t\t$xAml->setVerificarPerfilTransaccional(false, true);\n\t\t\t\t\n\t\t\t\t//Analizar Riesgo de Producto\n\n\t\t\t\t\t\n\t\t\t\t$xTipoRec\t= new cTipoDeRecibo($this->getTipoDeRecibo());\n\t\t\t\tif($xTipoRec->init() == true){\n\t\t\t\t\tif($xTipoRec->getEsDeCaptacion()){\n\t\t\t\t\t\t$xCapt\t= new cCuentaDeCaptacion($this->getCodigoDeDocumento());\n\t\t\t\t\t\tif($xCapt->init() == true){\n\t\t\t\t\t\t\t$NivelRiesgo\t= $xCapt->OProducto()->getAMLRiesgoAsoc();\n\t\t\t\t\t\t\t$Factores++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($xTipoRec->getEsDeCredito()){\n\t\t\t\t\t\t$xCred\t= new cCredito($this->getCodigoDeDocumento());\n\t\t\t\t\t\tif($xCred->init() == true){\n\t\t\t\t\t\t\t$NivelRiesgo\t= $xCred->getOProductoDeCredito()->getAMLRiesgoAsoc();\n\t\t\t\t\t\t\t$Factores++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($NivelRiesgo>0){\n\t\t\t\t$xMRisk\t\t= new cRiesgos();\n\t\t\t\t$riesgo\t\t= $xMRisk->getNivelarR(($NivelRiesgo/$Factores));\n\t\t\t\tif($riesgo >= SYS_RIESGO_MEDIO){\n\t\t\t\t\tif($xMat->initByTopico($xMat->O_RIESGO_PDTO) == true){\n\t\t\t\t\t\t$idriesgo\t= $xMat->getTipoRiesgo();\n\t\t\t\t\t\t$xLog->add(\"REPORTE\\tLa operacion en el Recibo \". $this->mCodigoDeRecibo . \" se Reportar por Riesgo Medio o Mayor.\\r\\n\");\n\t\t\t\t\t\t$xAv->setForceRegistroRiesgo();\n\t\t\t\t\t\t$xAv->sendAlerts($this->mSocio, getOficialAML(), $idriesgo, $xLog->getMessages(), $this->mCodigoDeRecibo, $this->getFechaDeRecibo());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Validar Operaciones\n\t\t\t\n\t\t\t//Agregar Nivel de Riesgo de Producto\n\t\t\t$xLog->add($xAml->getMessages(OUT_TXT), $xLog->DEVELOPER);\n\t\t}\n\t\t$this->mMessages\t\t.= $xLog->getMessages();\n\t\t\n\t\t\n\t\treturn $finalizado;\n\t}", "public function actualizar($registro){\n\n\t\tif(is_array($registro)){\n\n\t\t\t$registro = (object)$registro;\n\n\t\t}\n\n\t\t$costo_operacion \t\t\t\t= $registro->f;\n\t\t$cantidad \t\t\t\t\t\t= $registro->d;\n\t\t$sumatotal \t\t\t\t\t \t= $cantidad * $costo_operacion;\n\n\t\t$this->_id_trabajo \t\t\t= $this->formatear($registro->a, \"Entero\");\n\t\t$this->_cantidad \t\t\t= $this->formatear($registro->d, \"Cadena\");\n\t\t$this->_observacion \t\t= $this->formatear($registro->e, \"Cadena\");\n\t\t$this->_pago \t\t\t\t= $sumatotal;\n\t\t$this->_id_usuario \t\t\t= $this->formatear($registro->g, \"Cadena\");\n\t\t$this->_id_prenda \t\t\t= $this->formatear($registro->h, \"Cadena\");\n\t\t$this->_id_operacion \t\t= $this->formatear($registro->i, \"Cadena\");\n\t\t$this->_id_talla \t\t\t= $this->formatear($registro->j, \"Cadena\");\n\t\t$this->_id_modelo \t\t\t= $this->formatear($registro->k, \"Cadena\");\n\t\t$this->_id_color \t\t\t= $this->formatear($registro->l, \"Cadena\");\n\t\t$this->_id_entrega \t\t\t= $this->formatear($registro->m, \"Cadena\");\n\n\t\t\n\t\t$this->_sql \t\t\t= sprintf(\"UPDATE trabajo SET \n\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.updated_at \t\t\t\t=NOW(),\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.cantidad \t\t\t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.observacion \t\t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.pago \t\t\t\t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.usuario_id_usuario\t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.prenda_id_prenda \t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.operacion_id_operacion\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.talla_id_talla \t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.modelo_id_modelo \t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.color_id_color \t\t\t=%s,\n\t\t\t\t\t\t\t\t\t\t\ttrabajo.entrega_id_entrega \t\t=%s\n\t\t\t\t\t\t\t\t\t\t\tWHERE trabajo.id_trabajo \t\t=%s \n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1;\",\n\t\t\t\t\t\t\t\t\t\t\t$this->_cantidad,\n\t\t\t\t\t\t\t\t\t\t\t$this->_observacion, \t\n\t\t\t\t\t\t\t\t\t\t\t$this->_pago,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_usuario,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_prenda,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_operacion,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_talla,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_modelo,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_color,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_entrega,\n\t\t\t\t\t\t\t\t\t\t\t$this->_id_trabajo);\n\t\treturn $this->sentenciaSQL($this->_sql, 5);\n\t}", "function setSum($oid) {\n $total = totalOrderPrice($oid);\n updateOrderWithTotal($oid, $total);\n }", "public function updateCarrito(){\n foreach($this->carrito as $key=>$producto){\n $cantidadUpdate = $_POST[$producto->getRefPieza()];\n if( $cantidadUpdate == 0){ unset($this->carrito[$key]); }\n else { $producto->setCantidad($cantidadUpdate); }\n }\n }", "public function calcularTotal() {\n $total = 0;\n foreach ($this->lineadeDocumento as $linea) {\n $total += $linea->getPrecioT();\n }\n $this->total = $total;\n }", "public function updateTotalSum(): void\n {\n $this->update([\n 'total_without_vat' => $this->items->sum('total_without_vat'),\n 'total_with_vat' => $this->items->sum('total_with_vat'),\n ]);\n }", "public function restarMemoria(){\n\n if(is_numeric($this->pantalla)){ //Comprobar si es un number\n $resta = $this->memoria - $this->pantalla;\n $this->memoria = $resta;\n $this->pantalla = $this->memoria;\n } else {\n $this->pantalla = \"Operación no permitida\";\n }\n\n }", "public function restarMemoria(){\n\n if(is_numeric($this->pantalla)){ //Comprobar si es un number\n $resta = $this->memoria - $this->pantalla;\n $this->memoria = $resta;\n $this->pantalla = $this->memoria;\n } else {\n $this->pantalla = \"Operación no permitida\";\n }\n\n }", "function adiciona_registro($sum_nota_media, $sum_resultado_medio, $sum_total_nota, $sum_total_resultado, $quebra_participante, $quebra_pista, $quebra_participante_orig, $quebra_pista_orig)\n {\n //----- Participante\n if (!isset($this->array_total_participante[$quebra_participante_orig]))\n {\n $this->array_total_participante[$quebra_participante_orig][0] = 1;\n $this->array_total_participante[$quebra_participante_orig][1] = $sum_nota_media;\n $this->array_total_participante[$quebra_participante_orig][2] = $sum_resultado_medio;\n $this->array_total_participante[$quebra_participante_orig][3] = $sum_total_nota;\n $this->array_total_participante[$quebra_participante_orig][4] = $sum_total_resultado;\n $this->array_total_participante[$quebra_participante_orig][5] = $quebra_participante;\n $this->array_total_participante[$quebra_participante_orig][6] = $quebra_participante_orig;\n }\n else\n {\n $this->array_total_participante[$quebra_participante_orig][0]++;\n $this->array_total_participante[$quebra_participante_orig][1] += $sum_nota_media;\n $this->array_total_participante[$quebra_participante_orig][2] += $sum_resultado_medio;\n $this->array_total_participante[$quebra_participante_orig][3] += $sum_total_nota;\n $this->array_total_participante[$quebra_participante_orig][4] += $sum_total_resultado;\n }\n //----- Pista\n if (!isset($this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig]))\n {\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][0] = 1;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][1] = $sum_nota_media;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][2] = $sum_resultado_medio;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][3] = $sum_total_nota;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][4] = $sum_total_resultado;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][5] = $quebra_pista;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][6] = $quebra_pista_orig;\n }\n else\n {\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][0]++;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][1] += $sum_nota_media;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][2] += $sum_resultado_medio;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][3] += $sum_total_nota;\n $this->array_total_pista[$quebra_participante_orig][$quebra_pista_orig][4] += $sum_total_resultado;\n }\n }", "public function SaveTotal() {\n $this->sumTotal += $this->sumThrow;\n }", "public function sumaHorasPrevistasTareas() {\n $conexion = ProyectoDB::connectDB();\n $update = \"UPDATE requisito SET \"\n . \"horaPreReq =(SELECT SUM(horPreTar) FROM tarea WHERE codReq='\" . $this->codReq . \"')\"\n . \" WHERE codReq=\\\"\" . $this->codReq . \"\\\"\";\n $conexion->exec($update);\n \n }", "public function saveRentabilidaBono($iduser, $bono, $concepto, $referido)\n {\n $checkRentabilidad = DB::table('log_rentabilidad')->where([\n ['iduser', '=', $iduser],\n ['progreso', '<', 100]\n ])->first();\n if ($checkRentabilidad != null) {\n $ganado = $bono;\n $balance = $ganado;\n $idRentabilidad = $checkRentabilidad->id;\n $finalizado = 0;\n\n $totalGanado = ($checkRentabilidad->ganado + $ganado);\n $finalizacion = 0;\n if ($totalGanado >= $checkRentabilidad->limite) {\n if ($checkRentabilidad->ganado < $checkRentabilidad->limite) {\n $totalGanado = $checkRentabilidad->limite;\n $ganado = ($totalGanado - $checkRentabilidad->ganado);\n }else{\n $finalizacion = 1;\n $finalizado = 1;\n }\n }\n if ($finalizacion == 0) { \n $progreso = (($totalGanado / $checkRentabilidad->limite) * 100);\n $balance = ($totalGanado - $checkRentabilidad->retirado);\n $dataRentabilidad = [\n 'ganado' => $totalGanado,\n 'progreso' => $progreso,\n 'balance' => $balance\n ];\n DB::table('log_rentabilidad')->where('id', $checkRentabilidad->id)->update($dataRentabilidad);\n }\n\n $user = User::find($iduser);\n $user->wallet_amount = ($user->wallet_amount + $ganado);\n\n $dataLogRentabilidadPay = [\n 'iduser' => $iduser,\n 'id_log_renta' => $idRentabilidad,\n 'porcentaje' => 0,\n 'debito' => $ganado,\n 'balance' => $balance,\n 'fecha_pago' => Carbon::now(),\n 'concepto' => 'Rentabilidad pagada por medio del '.$concepto.' , al usuario '.$user->display_name\n ];\n\n $datosComisions = [\n 'iduser' => $iduser,\n 'usuario' => $user->display_name,\n 'descripcion' => $concepto,\n 'puntos' => 0,\n 'puntosI' => 0,\n 'puntosD' => 0,\n 'email_referred' => $referido,\n 'descuento' => 0,\n 'debito' => $ganado,\n 'credito' => 0,\n 'balance' => $user->wallet_amount,\n 'tipotransacion' => 2\n ];\n\n if ($finalizado == 0) {\n $user->save();\n DB::table('log_rentabilidad_pay')->insert($dataLogRentabilidadPay);\n $this->wallet->saveWallet($datosComisions);\n }\n }\n }", "public function actualizarTotalCompra(int $idCompra, int $totalActualizar){\n\n \n $this->db->where('id', $idCompra);\n\n $data = array( \n\n 'total'=> $totalActualizar\n \n \n );\n \n $this->db->update('compras',$data);\n\n }", "public function updateTotal()\n {\n $this->updateRequested = true;\n $this->saveState();\n }", "function Pay($aMedio = NULL) {\n\t\t$pagosparciales = 0;\n\t\t$oParciales = &$this->getPartialDrafts();\n\t\tif ($oParciales)\n\t\t\tfor ($idx = $oParciales->firstItem(); isset($idx); $idx = $oParciales->nextItem()) {\n\t\t\t\t$oItem = &$oParciales->getItem();\n\t\t\t\t$pagosparciales += $oItem->getAmmount('paid');\n\t\t\t}\n\t\t$pendiente = abs($this->getAmmount('total')) - $pagosparciales;\n\t\t$this->debug(\"Pendiente: \".$pendiente.' ya patado: '.$pagosparciales.' Que suma: '.($pendiente+$pagosparciales),'Pay');\n\n\t\t$this->update(array('monto_pagado' => $pendiente));\n\t\t// Para que vuelque a iconta\n\t\t$this->bAmmountChange = true;\n\n\t\tif (is_array($aMedio) AND sizeof($aMedio)) \n\t\t\tforeach ($aMedio as $fld => $val) {\n\t\t\t\tswitch ($fld) {\n\t\t\t\t\tcase 'id_banco':\n\t\t\t\t\t\t$this->update(array('id_banco' => $val));\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn true;\n\t}", "public function actionCalcula() {\n\t\t\r\n\t\t$total = $_POST['alu_mat_tot'];\n\t\t$varones = $_POST['alu_mat_var'];\n\t\t\n\t\t$mujeres = $total - $varones;\r\n\t\t\r\n\t\t$_POST['alu_mat_muj'] = $mujeres;\n\t\techo $mujeres;\n\t}", "public function ruta_suma($data){\n \n\n //lista de las tablas que se ven afectadas\n $tabla_struct = $this->db->dbprefix('pstruct_'.$data[\"tabla\"]);\n $tabla_data = $this->db->dbprefix('pdata_'.$data[\"tabla\"]);\n $sql=\"\n SELECT nodo.id id_nivel, (COUNT(padre.id) ) AS id_tabla\n FROM \".$tabla_struct.\" AS nodo,\n \".$tabla_struct.\" AS padre\n WHERE nodo.lft BETWEEN padre.lft AND padre.rgt\n GROUP BY nodo.id\n ORDER BY nodo.lft\n \"; \n $query = $this->db->query($sql); \n $registros = $query->result();\n\n $total=0;\n foreach ($registros as $key => $value) {\n if ($data['id_nivel'] != $value->id_nivel) //excluyendo el nivel actual\n if ( $value->id_tabla ==1) {\n\n\n\n $cons = \"SELECT sum(n.tiempo_disponible *\n (SELECT u.salario\n FROM \".$this->registro_proyecto .\" up inner join \".$this->usuarios .\" u on SUBSTRING( id_val , locate( '\\\"', id_val)+1 , CASE WHEN ( locate( ',',id_val,2)-2 > 0) THEN locate( ',',id_val,2)-2 ELSE locate( '\\\"',id_val,2)-2 END ) = u.id\n where id_nivel = \".$value->id_nivel.\" AND id_proyecto=\".$data['id_proyecto'].\" AND id_entorno=\".$this->session->userdata('entorno_activo').\"\n ) \n ) total \n\n FROM \".$this->registro_proyecto .\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n $total += $result->row()->total;\n\n } else { \n\n $cons = \"SELECT sum(tiempo_disponible*\n (SELECT u.salario\n FROM inven_registro_nivel\". $value->id_tabla.\" up inner join \".$this->usuarios .\" u on SUBSTRING( id_val , locate( '\\\"', id_val)+1 , CASE WHEN ( locate( ',',id_val,2)-2 > 0) THEN locate( ',',id_val,2)-2 ELSE locate( '\\\"',id_val,2)-2 END ) = u.id\n where id_nivel = \".$value->id_nivel.\" AND id_proyecto=\".$data['id_proyecto'].\" AND id_entorno=\".$this->session->userdata('entorno_activo').\"\n ) \n ) total \n FROM inven_registro_nivel\". $value->id_tabla.\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n \n //return $cons;\n $result = $this->db->query( $cons); \n $total += $result->row()->total;\n }\n } \n\n\n $cons = 'SELECT importe total FROM '.$this->catalogo_proyectos .' as c where \n c.id='.$data['id_proyecto'].' AND c.id_entorno='.$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n $datoss['total'] = $result->row()->total-$total;\n\n\n //fin de total de tiempo disponible\n\n \n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n //Fecha creacion\n $cons = 'SELECT ( CASE WHEN UNIX_TIMESTAMP(c.fecha_creacion) > 0 THEN DATE_FORMAT((c.fecha_creacion),\"%Y-%m-%d 0:00\") ELSE \"\" END ) AS fecha_creacion\n FROM '.$this->registro_proyecto .' as c where \n c.id_proyecto='.$data['id_proyecto'].' AND c.id_entorno='.$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n $fecha_creacion = $result->row()->fecha_creacion;\n\n\n //listado de sus padres, abuelos, etc en orden descendente\n $cons = \"SELECT estructura.id id_nivel, data.nm,\n ( SELECT (COUNT(padre.id)) AS id_tabla\n FROM \".$tabla_struct.\" AS nodo,\n \".$tabla_struct.\" AS padre\n WHERE nodo.lft BETWEEN padre.lft AND padre.rgt\n AND nodo.id = estructura.id\n GROUP BY nodo.id\n ORDER BY nodo.lft\n ) id_tabla\n from (\n SELECT padre.id\n FROM \".$tabla_struct.\" AS nodo,\n \".$tabla_struct.\" AS padre\n WHERE nodo.lft BETWEEN padre.lft AND padre.rgt\n AND nodo.id = \".$data['id_nivel'].\"\n ORDER BY padre.lft desc\n ) estructura\n INNER JOIN \".$tabla_data.\" data ON data.id=estructura.id\n \";\n\n $result = $this->db->query( $cons); \n $padres = $result->result();\n\n //listados de hijos, nietos, etc\n $cons = \"SELECT estructura.id id_nivel, data.nm, \n ( SELECT (COUNT(padre.id)) AS id_tabla\n FROM \".$tabla_struct.\" AS nodo,\n \".$tabla_struct.\" AS padre\n WHERE nodo.lft BETWEEN padre.lft AND padre.rgt\n AND nodo.id = estructura.id\n GROUP BY nodo.id\n ORDER BY nodo.lft\n ) id_tabla\n from ( \n SELECT nodo.id\n FROM \".$tabla_struct.\" AS nodo ,\n \".$tabla_struct.\" AS padre\n WHERE nodo.lft BETWEEN padre.lft AND padre.rgt\n AND padre.id = \".$data['id_nivel'].\"\n ORDER BY nodo.lft ) estructura\n INNER JOIN \".$tabla_data.\" data ON data.id=estructura.id\n \";\n $result = $this->db->query( $cons); \n $hijos = $result->result();\n \n\n\n $fecha_inicial= array();\n $fecha_final= array();\n foreach ($padres as $key => $value) {\n \n //if ($data['id_nivel'] != $value->id_nivel) //excluyendo el nivel actual\n \n if ( $value->id_tabla ==1) {\n \n $cons = \"SELECT ( CASE WHEN UNIX_TIMESTAMP(n.fecha_inicial) > 0 THEN DATE_FORMAT((n.fecha_inicial),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_inicial,\n ( CASE WHEN UNIX_TIMESTAMP(n.fecha_final) > 0 THEN DATE_FORMAT((n.fecha_final),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_final\n FROM \".$this->registro_proyecto .\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n \n if ($data['id_nivel'] != $value->id_nivel) {\n if ($result->row()->fecha_inicial!=\"\")\n $fecha_inicial[] = $result->row()->fecha_inicial;\n\n if ($result->row()->fecha_final!=\"\")\n $fecha_final[] = $result->row()->fecha_final;\n } else {\n $fecha_inicio = $result->row()->fecha_inicial;\n $fecha_fin = $result->row()->fecha_final;\n }\n\n\n } else { \n\n $cons = \"SELECT ( CASE WHEN UNIX_TIMESTAMP(n.fecha_inicial) > 0 THEN DATE_FORMAT((n.fecha_inicial),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_inicial,\n ( CASE WHEN UNIX_TIMESTAMP(n.fecha_final) > 0 THEN DATE_FORMAT((n.fecha_final),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_final\n FROM inven_registro_nivel\". $value->id_tabla.\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n\n if ($data['id_nivel'] != $value->id_nivel) {\n if ($result->row()->fecha_inicial!=\"\")\n $fecha_inicial[] = $result->row()->fecha_inicial;\n\n if ($result->row()->fecha_final!=\"\")\n $fecha_final[] = $result->row()->fecha_final;\n } else {\n $fecha_inicio = $result->row()->fecha_inicial;\n $fecha_fin = $result->row()->fecha_final;\n }\n\n\n }\n\n\n\n\n\n\n\n\n\n } \n\n\n if (!($fecha_inicial)) //sino hay ninguna fecha_inicial entonces tomará la de creacion\n $fecha_inicial_padre = $fecha_creacion; //$fecha_inicial[] = $fecha_creacion;\n else \n $fecha_inicial_padre = $fecha_inicial[0]; \n\n\n if (!($fecha_final)) { //sino hay ninguna fecha_final entonces tomará la de fecha inicial\n //$fecha_final_padre = $fecha_inicial_padre; //$fecha_final[] = $fecha_inicial[0];\n $fecha_final_padre = '';\n } else { \n $fecha_final_padre = $fecha_final[0]; \n }\n\n \n\n //>= $fecha_inicial[0] and <= $fecha_final[0]\n\n\n\n\n $fecha_inicial= array();\n $fecha_final= array();\n\n foreach ($hijos as $key => $value) {\n if ($data['id_nivel'] != $value->id_nivel) //excluyendo el nivel actual\n if ( $value->id_tabla ==1) {\n \n $cons = \"SELECT ( CASE WHEN UNIX_TIMESTAMP(n.fecha_inicial) > 0 THEN DATE_FORMAT((n.fecha_inicial),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_inicial,\n ( CASE WHEN UNIX_TIMESTAMP(n.fecha_final) > 0 THEN DATE_FORMAT((n.fecha_final),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_final\n FROM \".$this->registro_proyecto .\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n \n if ($result->row()->fecha_inicial!=\"\")\n $fecha_inicial[] = $result->row()->fecha_inicial;\n\n if ($result->row()->fecha_final!=\"\")\n $fecha_final[] = $result->row()->fecha_final;\n\n } else { \n\n $cons = \"SELECT ( CASE WHEN UNIX_TIMESTAMP(n.fecha_inicial) > 0 THEN DATE_FORMAT((n.fecha_inicial),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_inicial,\n ( CASE WHEN UNIX_TIMESTAMP(n.fecha_final) > 0 THEN DATE_FORMAT((n.fecha_final),'%Y-%m-%d 0:00') ELSE '' END ) AS fecha_final\n FROM inven_registro_nivel\". $value->id_tabla.\" as n where n.id_nivel = \".$value->id_nivel.\" \n AND n.id_proyecto=\".$data['id_proyecto'].\" AND n.id_entorno=\".$this->session->userdata('entorno_activo');\n $result = $this->db->query( $cons); \n\n\n if ($result->row()->fecha_inicial!=\"\")\n $fecha_inicial[] = $result->row()->fecha_inicial;\n\n if ($result->row()->fecha_final!=\"\")\n $fecha_final[] = $result->row()->fecha_final;\n\n }\n } \n\n\n\n\n\n sort($fecha_inicial);\n\n $fecha_final_hijo_mayor =\"\";\n $fecha_inicial_hijo_mayor=\"\";\n\n if ($fecha_inicial) {\n $fecha_inicial_hijo_menor = $fecha_inicial[0]; \n $fecha_inicial_hijo_mayor = $fecha_inicial[count($fecha_inicial)-1]; \n } else {\n $fecha_inicial_hijo_menor ='';\n //$fecha_inicial_hijo_menor = $fecha_final_padre; \n }\n\n sort($fecha_final);\n\n if ($fecha_final) {\n $fecha_final_hijo_menor = $fecha_final[0]; \n $fecha_final_hijo_mayor = $fecha_final[count($fecha_final)-1]; \n } else {\n $fecha_final_hijo_menor = '';\n //$fecha_final_hijo_menor = $fecha_final_padre; \n }\n\n\n //<= $fecha_inicial[0] and <= $fecha_final[0]\n\n\n\n\n/*\n $cond =' fecha_inicial >=\"'.$fecha_creacion.'\"' ;\n$cond .= ($fecha_inicial_padre!='') ? ' AND fecha_inicial >=\"'.$fecha_inicial_padre.'\"' : '' ; \n$cond .= ($fecha_final_padre!='') ? ' AND fecha_inicial <=\"'.$fecha_final_padre.'\"' : '' ; \n$cond .= ($fecha_inicial_hijo_menor!='') ? ' AND fecha_inicial <=\"'.$fecha_inicial_hijo_menor.'\"' : '' ; \n$cond .= ($fecha_final_hijo_menor!='') ? ' AND fecha_inicial <=\"'.$fecha_final_hijo_menor.'\"' : '' ; \n$cond .= ($fecha_fin!='') ? ' AND fecha_inicial <=\"'.$fecha_fin.'\"' : '' ; \n*/\n\n\n/*\n//fecha_inicial\n$datos['cond_finicial'] = \" fecha_inicial >='\".$fecha_creacion.\"'\" ;\n$datos['cond_finicial'] .= ($fecha_inicial_padre!=\"\") ? \" AND fecha_inicial >='\".$fecha_inicial_padre.\"'\" : \"\" ; \n\n$datos['cond_finicial'] .= ($fecha_final_padre!=\"\") ? \" AND fecha_inicial <='\".$fecha_final_padre.\"'\" : \"\" ; \n$datos['cond_finicial'] .= ($fecha_inicial_hijo_menor!=\"\") ? \" AND fecha_inicial <='\".$fecha_inicial_hijo_menor.\"'\" : \"\" ; \n$datos['cond_finicial'] .= ($fecha_final_hijo_menor!=\"\") ? \" AND fecha_inicial <='\".$fecha_final_hijo_menor.\"'\" : \"\" ; \n$datos['cond_finicial'] .= ($fecha_fin!=\"\") ? \" AND fecha_inicial <='\".$fecha_fin.\"'\" : \"\" ; \n\n\n//fecha_final\n$datos['cond_ffinal'] =\" fecha_final >='\".$fecha_creacion.\"'\" ;\n$datos['cond_ffinal'] .= ($fecha_inicial_padre!=\"\") ? \" AND fecha_final >='\".$fecha_inicial_padre.\"'\" : \"\" ; \n$datos['cond_ffinal'] .= ($fecha_final_padre!=\"\") ? \" AND fecha_final <='\".$fecha_final_padre.\"'\" : \"\" ; \n$datos['cond_ffinal'] .= ($fecha_inicial_hijo_mayor!=\"\") ? \" AND fecha_final >='\".$fecha_inicial_hijo_mayor.\"'\" : \"\" ; \n$datos['cond_ffinal'] .= ($fecha_final_hijo_mayor!=\"\") ? \" AND fecha_final >='\".$fecha_final_hijo_mayor.\"'\" : \"\" ; \n$datos['cond_ffinal'] .= ($fecha_inicio!=\"\") ? \" AND fecha_final >='\".$fecha_inicio.\"'\" : \"\" ; \n*/\n\n\n$datos['cond_finicial_mayor']= array();\n$datos['cond_ffinal_mayor']= array();\n$datos['cond_finicial_menor']= array();\n$datos['cond_ffinal_menor'] = array();\n\n\n\nif ($fecha_creacion!=\"\") {\n $datos['cond_finicial_mayor'][] = $fecha_creacion;\n $datos['cond_ffinal_mayor'][] = $fecha_creacion;\n}\n\nif ($fecha_inicial_padre!=\"\") {\n $datos['cond_finicial_mayor'][] = $fecha_inicial_padre;\n $datos['cond_ffinal_mayor'][] = $fecha_inicial_padre;\n}\n\nif ($fecha_final_padre!=\"\") {\n $datos['cond_finicial_menor'][] = $fecha_final_padre;\n $datos['cond_ffinal_menor'][] = $fecha_final_padre;\n\n} \n\nif ($fecha_inicial_hijo_menor!=\"\") {\n $datos['cond_finicial_menor'][] = $fecha_inicial_hijo_menor;\n}\n\nif ($fecha_final_hijo_menor!=\"\") {\n $datos['cond_finicial_menor'][] = $fecha_final_hijo_menor;\n}\n\n\nif ($fecha_fin!=\"\") {\n $datos['cond_finicial_menor'][] = $fecha_fin;\n} \n\nif ($fecha_inicial_hijo_mayor!=\"\") {\n $datos['cond_ffinal_mayor'][] = $fecha_inicial_hijo_mayor;\n} \n\n\nif ($fecha_final_hijo_mayor!=\"\") {\n $datos['cond_ffinal_mayor'][] = $fecha_final_hijo_mayor;\n} \n\nif ($fecha_inicio!=\"\") {\n $datos['cond_ffinal_mayor'][] = $fecha_inicio;\n} \n\n\nsort($datos['cond_finicial_mayor']);\nsort($datos['cond_ffinal_mayor']);\n\nsort($datos['cond_finicial_menor']);\nsort($datos['cond_ffinal_menor']);\n\n\n$datoss['inicial_start'] = $datos['cond_finicial_mayor'][count($datos['cond_finicial_mayor'])-1];\n$datoss['inicial_end'] = (isset($datos['cond_finicial_menor'][0])) ? ($datos['cond_finicial_menor'][0]) : null;\n\n$datoss['final_start'] = (isset($datos['cond_ffinal_mayor'][count($datos['cond_ffinal_mayor'])-1])) ? $datos['cond_ffinal_mayor'][count($datos['cond_ffinal_mayor'])-1] : null;\n$datoss['final_end']= (isset($datos['cond_ffinal_menor'][0])) ? $datos['cond_ffinal_menor'][0] : null;\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n return ($datoss); \n\n\n\n\n if ($query->num_rows() > 0)\n return $query->row()->ruta;\n else\n return 'vacio';\n $login->free_result();\n }", "public function actionCalculoTasaAmortizacion() {\n $fuenteFinanciamineto = $_POST['fuenteFinanciamineto'];\n $programa = $_POST['programa'];\n $montoInical = $_POST['montoInical'];\n $montoVivienda = (float) $_POST['montoVivienda'];\n $idUnidadFamiliar = $_POST['idUnidadFamiliar'];\n $igresoFamiliar = $_POST['valorSalario'];\n $reconocimientoVivienda = $_POST['damnificado'];\n $tasaInteres = TasaInteres::model()->findByPk($_POST['tasaInteres'])->tasa_interes;\n $plazoCredito = $_POST['plazoCredito'];\n $fechaProtocolizacion = Generico::formatoFecha($_POST['fechaProtocolizacion']);\n $cuotasExtras = $_POST['cuotasExtras'];\n\n //MAXIMA CUOTA FINANCIERA $ingresofamiliar * 35%\n $CuotaFinanciamientoMaximo = CalculosController::actionCuotaFinancieraMaxima($igresoFamiliar);\n //MAXIMA CAPACIDAD DE PAGO \n $CapacidadPago = floatval(CalculosController::actionMaximaCapacidadPago($tasaInteres, $plazoCredito, $CuotaFinanciamientoMaximo));\n\n /* INICIO DE CONDIONES DE CALCULOS PARA FASP */\n if ($fuenteFinanciamineto == '3') { // FUENTE DE FINANCIAMIENTO FASP\n //PORCENTAJE DEL SUBSIDIO QUE LE CORRESPONDE AL BENEFICIARIO , DE ACUERDO A LAS CONDICIONES DE FINANCIAMIENTO\n $subsidio = FaspController::actionSubsidio($CapacidadPago, $montoVivienda, $idUnidadFamiliar, $igresoFamiliar);\n //SUBSIDIO DIRECTO HABITACIONAL QUE LE CORRESPONDE AL BENEFICIARIO \n if ($subsidio == '0') {\n $costoASubsidiar = 0.00;\n } else {\n $costoASubsidiar = $montoVivienda * ($subsidio / 100);\n }\n\n\n //DIFERENCIA DE PAGO ENTRE LA CAPACIDAD DE PAGO Y EL MONTO DE LA VIVIENDA\n if ($CapacidadPago >= $montoVivienda) {\n $diferenciaPago = 0.00;\n } else if ($CapacidadPago < $montoVivienda) {\n $diferenciaPago = (-($CapacidadPago - $montoVivienda)) * 1;\n }\n\n //MONTO RESTANTE DEL PRECIO DE LA VIVIENDA Y EL SUDSIDIO DIRECTO HABITACIONAL\n if ($diferenciaPago < $costoASubsidiar) {\n $restacostoAsubsidiar = $montoVivienda - $montoInical - $diferenciaPago;\n } else {\n $restacostoAsubsidiar = $montoVivienda - $montoInical - $costoASubsidiar;\n }\n\n\n /*\n * CONDICION SI ES DIGNIFICADO APLICA EL 50% / SOBRE EL MONTO RESTANTE \n * SI EN EL CENSO SE CARGO COMO (140)CENSO REFUGIADOS\n */\n if ($reconocimientoVivienda == '1') {\n $MontoReconocimientoVivienda = FaspController::actionMontoReconocidoPerdidaVivienda($restacostoAsubsidiar);\n //NUEVO MONTO CREDITO REQUERIDO \n $CreditoRequerido = CalculosController::actionCreditoRequeridoDamnificado($restacostoAsubsidiar, $montoInical, $MontoReconocimientoVivienda);\n } else {\n $MontoReconocimientoVivienda = 0.00;\n // NUEVO MONTO CREDITO REQUERIDO\n $CreditoRequerido = CalculosController::actionCreditoRequeridoSae($montoVivienda, $diferenciaPago);\n }\n\n /*\n * NUEVO CREDITO REQUERIDO PARA CUOTAS EXTRAORDINARIAS\n */\n if (($CreditoRequerido + $costoASubsidiar) < $montoVivienda) {\n $CreditoRequeCExtra = $montoVivienda - $CreditoRequerido - $costoASubsidiar;\n } else {\n $CreditoRequeCExtra = 0.00;\n }\n if ($cuotasExtras == 'true') {\n\n $fongar = CalculosController::actionFondoGarantia($CreditoRequerido, $CreditoRequeCExtra);\n $fongar_2 = CalculosController::actionFondoGarantia($CreditoRequerido);\n \n } else {\n $fongar_2 = CalculosController::actionFondoGarantia($CreditoRequerido);\n //CUOTA INICIAL FONGAR $creditorequerido + $creditorequeridocuotasestras *1,43%\n $fongar = CalculosController::actionFondoGarantia($CreditoRequerido);\n }\n //MONTO CUOTA FINANCIERA REQUERIDA\n $montoCoutaFinanciera = CalculosController::actionMontoCoutaFinanciera($tasaInteres, $plazoCredito, $CreditoRequerido);\n //FONDO DE GARANTIA MENSUAL $creditoRequerido * 1,43%/ 12 cuotas al año \n $fondoGarantiaMensual = CalculosController:: actionFondoGarantiaMensual($fongar_2);\n //CUOTA TOTAL A PAGAR MENSUAL $montoCoutaFinanciera + $fondoGarantiaMensual\n $cuotaMensual = CalculosController::actionCoutaTotalMensual($montoCoutaFinanciera, $fondoGarantiaMensual);\n // % MAXIMA CUOTA FINANCIERA (> 35%)\n $maximacoutafinan = ($montoCoutaFinanciera / $igresoFamiliar) * 100;\n\n /*\n * CUOTAS EXTRAORDINARIAS\n * si el credito requerido y el subsidio directo no cubre el precio de la vivienda se \n * se calcula las cuotas extraordinarias \n */\n\n\n if ($cuotasExtras == 'true') {\n if ($CreditoRequerido <= $restacostoAsubsidiar) {\n //CUOTAS FINANCIERA MAXIMA PARA CUOTAS EXTRAORDINARIAS (2 coutas al año) \n $cuotaExtraEspecial = CalculosController::actionCoutaExtraEspecial($CuotaFinanciamientoMaximo);\n //CAPACIDAD DE PAGO PARA 2 CUOTAS EXTRAORDINARIAS \n $capacidadPagoExtra = CalculosController::actionMaximaCapPagoCuotasExtra($tasaInteres, $plazoCredito, $cuotaExtraEspecial);\n // FONDO DE GARANTIA SEMESTRAL C/U(2coutas extraordinarias) DE ACUERDO AL NUEVO CREDITO REQUERIDO\n $fondoGarantiaCExtra = CalculosController::actionFondoGarantiaCExtra($CreditoRequeCExtra);\n /*\n * MONTO DE LA CUOTA FINANCIERA REQUERIDA POR 2 CUOTAS EXTRAORDINARIAS \n * $plazoCredito = cantidad de años \n * $tasa interes aplicable\n * $CreditoRequeridoCExtra = montoVivienda - $CreditoReuerido() - $costoAsubsidiar(subsioAplicable)\n */\n $CuotaFinancieraCExtra = CalculosController::actionMontoCoutaFinancieraFaov($tasaInteres, $plazoCredito, $CreditoRequeCExtra);\n //CUOTA TOTAL A PAGAR SEMESTRAL \n $cuotaTotal = $CuotaFinancieraCExtra + $fondoGarantiaCExtra;\n } else {\n $cuotaExtraEspecial = 0.00;\n $capacidadPagoExtra = 0.00;\n $fondoGarantiaCExtra = 0.00;\n $CuotaFinancieraCExtra = 0.00;\n $cuotaTotal = 0.00;\n }\n } else {\n $cuotaExtraEspecial = 0;\n $cuotaExtraEspecial = 0.00;\n $capacidadPagoExtra = 0.00;\n $fondoGarantiaCExtra = 0.00;\n $CuotaFinancieraCExtra = 0.00;\n $cuotaTotal = 0.00;\n }\n\n\n $totalCreditoSDH = $CapacidadPago + $capacidadPagoExtra + $MontoReconocimientoVivienda + $costoASubsidiar;\n\n $data = array(\n 'cantidadDisponible' => number_format($totalCreditoSDH, 2, ',', ''),\n 'coutaFinanciamientoMaxima' => number_format($CuotaFinanciamientoMaximo, 2, ',', '.'),\n 'plazoMeses' => $plazoCredito * 12,\n 'capacidadPago' => number_format($CapacidadPago, 2, ',', '.'),\n 'subsidioCorreponde' => $subsidio . '%',\n 'subsidioMaximo' => number_format($costoASubsidiar, 2, ',', '.'),\n 'diferenciaPago' => number_format($diferenciaPago, 2, ',', '.'),\n 'restaCostoAsudsidiar' => number_format($restacostoAsubsidiar, 2, ',', '.'),\n 'reconocimientoViviendaPerdida' => number_format($MontoReconocimientoVivienda, 2, ',', '.'),\n 'creditoRequerido' => number_format($CreditoRequerido, 2, ',', '.'),\n 'coutaInicialFongar' => number_format($fongar, 2, ',', ''),\n 'montoCoutaFinaciera' => number_format($montoCoutaFinanciera, 2, ',', '.'),\n 'tasaFongar' => '1,43%',\n 'fondoGarantiaMensual' => number_format($fondoGarantiaMensual, 2, ',', '.'),\n 'coutaMensualPagar' => number_format($cuotaMensual, 2, ',', '.'),\n 'maxCoutaFinan' => ((number_format($maximacoutafinan, 0, ',', '')) > 35) ? '35%' : number_format($maximacoutafinan, 0, ',', '') . '%',\n 'cuotaExtraEspecial' => number_format($cuotaExtraEspecial, 2, ',', '.'),\n 'capacidadPagoExtra' => number_format($capacidadPagoExtra, 2, ',', '.'),\n 'fondoGarantiaCExtra' => number_format($fondoGarantiaCExtra, 2, ',', '.'),\n 'cuotaTotal' => number_format($cuotaTotal, 2, ',', '.'),\n );\n echo json_encode($data);\n\n /* INICIO CONDICIONES PARA CALCULOS DE FAOV */\n } else if ($fuenteFinanciamineto == '2') { // FUENTE DE FINANCIAMIENTO FAOV\n //$Credito Requerido es el Monto del credito Hipotecarioa a Otorgar Cuotas Mensuales \n if ($CapacidadPago > $montoVivienda) {\n $CreditoRequerido = CalculosController::actionMontoCHMensual($montoVivienda, $montoInical);\n } else {\n $CreditoRequerido = $CapacidadPago;\n }\n // fondo de garantia para faov\n $fongarfaov = CalculosController::actionFondoGarantiaFaov($CreditoRequerido);\n //fondo de garantia \n $fondoGarantiaMensual = CalculosController::actionFondoGarantiaMensualfaov($fongarfaov);\n //monto couta financiera requerida\n $montoCoutaFinanciera = CalculosController::actionMontoCoutaFinanciera($tasaInteres, $plazoCredito, $CreditoRequerido);\n //couta mensuales Total a pagar $CuotaFinanciamientoMaximo + $fondoGarantiaMensual\n $cuotaMensual = CalculosController::actionCoutaMensualfaov($montoCoutaFinanciera, $fondoGarantiaMensual);\n //% de la couta financiera en relacion al ingreso familiar lo maximo sera el 35%\n $maximacoutafinan = ($montoCoutaFinanciera / $igresoFamiliar) * 100;\n //Prima inicial fongar $CreditoRequerido * $tasafongar\n $fongar = CalculosController::actionFondoGarantia($CreditoRequerido);\n //Comision flat $CreditoRequerido * 5%\n $comisionFlat = FaovController::actionComisionFlat($CreditoRequerido);\n //diferencia de pago -> Monto Credito Hipotecario A otorgar(Cuotas Extraordinarias)\n \n $diferenciaPago = $montoVivienda - $CapacidadPago - $montoInical;\n if ($diferenciaPago< 0){\n \n $diferenciaPago = ($montoVivienda - $CapacidadPago - $montoInical) *-1;\n }\n //$cuotasExtras swich para indicar si desea aplicar las cuotas extraordinarias\n if ($cuotasExtras == 'true') {\n //Maxima cuota Financiera * 2 cuotas extraordinarias \n $maxCuotafina = CalculosController::actionCoutaExtraEspecial($CuotaFinanciamientoMaximo);\n //Nueva capacidad de pago con 2 cuotas extraordinarias\n $capacidadPagoExtra = CalculosController::actionMaximaCapPagoCuotasExtra($tasaInteres, $plazoCredito, $maxCuotafina);\n //Cuota Financiera Requerida (para 2 cuotas extraordinarias) \n $montoCoutaFinanExtra = CalculosController::actionMontoCoutaFinancieraFaov($tasaInteres, $plazoCredito, $diferenciaPago);\n //Fondo Garantia para cuotas extraordinarias\n $fondoGarantiaCExtra = CalculosController::actionFondoGarantiaCExtra($diferenciaPago);\n //cuota semestral a total a pagar\n $totalSemestral = $montoCoutaFinanExtra + $fondoGarantiaCExtra;\n //prima inicial fongar $difereciaPago * 1,43% tasafongar \n $primaInicialFongar = CalculosController::actionInicialFongarCExtra($diferenciaPago);\n\n\n if ($diferenciaPago > $capacidadPagoExtra) {\n\n //Subsidio Directo Habitacional 25% del pvp\n $subsidioDHPvp = FaovController::actionSubsidioDH($montoVivienda);\n //Subsidio Directo Habitacional Requerido \n $subsidioRequerido = FaovController::actionSubsidioDHRequerido($montoVivienda, $CreditoRequerido, $capacidadPagoExtra);\n\n\n //Monto Total del Credito y subsidio // suma de la maxima capacidad de pago + nueva capacidad de pago con cuotaExtra + Subsidio al credito25%pvp\n $totalCreditoSDH = FaovController::actionTotalCreditoSubsidioDH($CreditoRequerido, $capacidadPagoExtra, $subsidioDHPvp);\n $totalCreditoSDH = $totalCreditoSDH + $montoInical;\n //Monto total Credito A otorgar (Cuotas Mensuales y Extraordinarias mas el subsidio)\n $totalCSDHExtra = $CreditoRequerido + $diferenciaPago;\n } else {\n $subsidioDHPvp = 0.00;\n $subsidioRequerido = 0.00;\n $totalCreditoSDH = 0.00;\n $totalCSDHExtra = 0.00;\n }\n $h = '';\n } else {\n $h = '';\n $maxCuotafina = 0.00;\n $capacidadPagoExtra = 0.00;\n $montoCoutaFinanExtra = 0.00;\n $fondoGarantiaCExtra = 0.00;\n $totalSemestral = 0.00;\n $primaInicialFongar = 0.00;\n\n $subsidioDHPvp = 0.00;\n $totalCreditoSDH = FaovController::actionTotalCreditoSubsidioDH($CreditoRequerido, $capacidadPagoExtra, $subsidioDHPvp);\n $totalCreditoSDH = $totalCreditoSDH + $montoInical;\n $subsidioRequerido = 0.00;\n $totalCSDHExtra = 0.00;\n }\n\n\n $data = array(\n 'cantidadDisponible' => number_format($totalCreditoSDH, 2, ',', ''),\n 'coutaFinanciamientoMaxima' => number_format($CuotaFinanciamientoMaximo, 2, ',', '.'), //maxima couta financiera\n 'plazoMeses' => $plazoCredito * 12,\n 'capacidadPago' => number_format($CapacidadPago, 2, ',', '.'), // monto credito al largo plazo\n 'diferenciaPago' => number_format($diferenciaPago, 2, ',', '.'),\n 'creditoRequerido' => number_format($CreditoRequerido, 2, ',', '.'),\n 'maxCoutaFinan' => ((number_format($maximacoutafinan, 0, ',', '')) > 35) ? '30%' : number_format($maximacoutafinan, 0, ',', '') . '%',\n 'montoCoutaFinaciera' => number_format($montoCoutaFinanciera, 2, ',', '.'),\n 'fondoGarantiaMensual' => number_format($fondoGarantiaMensual, 2, ',', '.'),\n 'coutaMensualPagar' => number_format($cuotaMensual, 2, ',', '.'),\n 'coutaInicialFongar' => number_format($fongar, 2, ',', '.'),\n 'comisionFlat' => number_format($comisionFlat, 2, ',', '.'),\n 'tasaFongar' => '1,43%',\n 'maxCuotafina' => number_format($maxCuotafina, 2, ',', '.'),\n 'capacidadPagoExtra' => number_format($capacidadPagoExtra, 2, ',', '.'),\n 'montoCoutaFinanExtra' => number_format($montoCoutaFinanExtra, 2, ',', '.'),\n 'fondoGarantiaCExtra' => number_format($fondoGarantiaCExtra, 2, ',', '.'),\n 'totalSemestral' => number_format($totalSemestral, 2, ',', '.'),\n 'subsidioDHPvp' => number_format($subsidioDHPvp, 2, ',', '.'),\n 'subsidioRequerido' => number_format($subsidioRequerido, 2, ',', '.'),\n 'h' => $h,\n );\n echo json_encode($data);\n }\n }", "public function update(Request $request, $id)\n {\n $abonos = Abonos::findOrFail($id);\n\n $carteras = Cartera::where('id_factura',$request->id_factura)->get();\n $saldo = $carteras[0]->valor_saldo; //saco el saldo actual\n if($saldo >=1 ){ \n $saldo_sin_abono = $saldo + $abonos->valor_abono;//le sumo el valor de abono viejo\n $saldo_con_abono = $saldo_sin_abono - $request->valor_abono;//le resto el valor de abono nuevo \n\n $carteras = Cartera::findOrFail($carteras[0]->id);\n $carteras->valor_saldo = $saldo_con_abono;//actualizamos el saldo\n $carteras->save();\n\n $abonos->fill($request->all());//actualizamos el abono\n $abonos->save();\n flash('El abono ha sido actualizado con Exito');\n return Redirect::to(\"/abonos\");\n }\n else{\n flash('Ya esta factura fue cancelada, Verifique!')->error();\n return Redirect::to(\"/abonos\");\n }\n }", "public function sum();", "public function sum();", "public function depositar ($valor) {\n //$this pega a própria classe\n $this->saldo += $valor; \n }", "public function sum_totales($data){\n $sum_dias_trab=0;\n $sum_dev1=0;\n $sum_alim=0;\n $sum_basico=0;\n $sum_septimos=0;\n $sum_subsidios=0;\n $sum_otros=0;\n $sum_feriados=0;\n $sum_dev2=0;\n $sum_h_ext=0;\n $sum_tot_hext=0;\n $sum_act_extra_tot=0;\n $sum_vacs=0;\n $sum_aguin=0;\n $sum_acum=0;\n $sum_inss_lab=0;\n $sum_prestam=0;\n $sum_inss_pat=0;\n $sum_tot_recib=0;\n $sum_dinero_activ=0;\n\n foreach ($data as $trab) {\n $sum_tot_recib +=$trab['salario_'];\n $sum_dias_trab+=$trab['dias'];\n $sum_dev1+=$trab['total_deven'];\n $sum_alim+=$trab['alim_tot'];\n $sum_basico+=$trab['total_basic'];\n $sum_septimos+=$trab['total_septimo'];\n $sum_subsidios+=$trab['subsidio'];\n $sum_otros+=$trab['otros'];\n $sum_feriados+=$trab['feriado'];\n $sum_dev2+=$trab['devengado2'];\n $sum_h_ext+=$trab['cant_horas_ext'];\n $sum_tot_hext+=$trab['horas_ext_tot'];\n $sum_act_extra_tot+=$trab['cant_act_ext'];\n $sum_dinero_activ+=$trab['act_extra_tot'];\n $sum_vacs+=$trab['vac_tot'];\n $sum_aguin+=$trab['agui_tot'];\n $sum_acum+=$trab['total_acum'];\n $sum_inss_lab+=$trab['inss'];\n $sum_prestam+=$trab['prestamos'];\n $sum_inss_pat+=$trab['inss_patronal'];\n }\n $dev=$sum_dev1;\n\n $septimo=$sum_septimos;\n $feriados=$sum_feriados;\n $tot_dev2=$sum_dev2;\n $prestamos=$sum_prestam;\n $alim=$sum_alim;\n $tot_hext=$sum_tot_hext;\n $dinero_cuje=$sum_dinero_activ;\n $a_vac=$dev+$septimo+$feriados;\n $vacs_para_suma=0;\n $vacs=$a_vac*0.083333;\n $sum_vacs=round($vacs,2);\n\n $sum_aguin=round($vacs,2);\n $tot_acum=$sum_vacs+$sum_vacs+$tot_dev2+$tot_hext+$dinero_cuje;\n $var= 'vacs= '.$sum_vacs.' TotDev2= '.$tot_dev2.' tot_hext= '.$tot_hext.' Dine cuje = '.$dinero_cuje;\n $sum_acum=round($tot_acum,2);\n $inss_lab=(($tot_acum-$vacs-$alim)*4.25)/100;\n $sum_inss_lab=round($inss_lab,2);\n $tot_recib=$tot_acum-$inss_lab-$prestamos;\n $sum_tot_recib=round($tot_recib,2);\n $inss_pat=(($tot_acum-$vacs-$alim)*13)/100;\n $sum_inss_pat=round($inss_pat,2);\n /****************************************************/\n\n // $tot_hext=$suma['sum_tot_hext'];\n // $dinero_cuje=$suma['sum_dinero_activ'];\n // $a_vac=$dev+$septimo+$feriados;\n // $vacs_para_suma=0;\n // $vacs=$a_vac*0.083333;\n // $tot_acum=$vacs+$vacs+$tot_dev2+$tot_hext+$dinero_cuje;\n\n /*\n\n\n $inss_pat=(($tot_acum-$vacs-$alim)*13)/100;\n $sum_inss_pat=round($inss_pat,2);\n */\n $totales= [\n 'aa'=>$var,\n \"sum_tot_recib\"=>round($sum_tot_recib,2),\n 'sum_dias_trab'=>round($sum_dias_trab,2),\n \"sum_dev1\"=>round($sum_dev1,2),\n \"sum_alim\"=>round($sum_alim,2),\n \"sum_basico\"=>round($sum_basico,2),\n 'sum_septimos'=>round($sum_septimos,2),\n 'sum_subsidios'=>round($sum_subsidios,2),\n 'sum_otros'=>round($sum_otros,2),\n 'sum_feriados'=>round($sum_feriados,2),\n 'sum_dev2'=>round($sum_dev2,2),\n 'sum_act_extra_tot'=>round($sum_act_extra_tot,2),\n 'sum_h_ext'=>round($sum_h_ext,2),\n 'sum_tot_hext'=>round($sum_tot_hext,2),\n 'sum_vacs'=>$sum_vacs,\n 'sum_aguin'=>$sum_aguin,\n 'sum_acum'=>$sum_acum,\n 'sum_inss_lab'=>round($sum_inss_lab,2),\n 'sum_prestam'=>round($sum_prestam,2),\n 'sum_inss_pat'=>round($sum_inss_pat,2),\n 'sum_dinero_activ'=>round($sum_dinero_activ,2),\n ];\n return $totales;\n }", "public function calculateSum()\n {\n $sum = 0;\n foreach ($this->positions as $position) {\n $position->calculate();\n $sum += $position->priceSum;\n }\n\n $this->total = ['priceSum' => $sum];\n }", "public function update(Request $request, $id_receta)\n {\n \n try {\n DB::beginTransaction();\n if ($request->insumos) {\n $receta = Receta::findOrFail($id_receta);\n $receta->costo_produccion = $this->costo_produccion($request->get('insumos'));\n $receta->fkidproducto = $request->get('producto');\n $receta->total_masa = $this->cantidad_masa($request->get('insumos'));\n $receta->peso = $request->get('peso');\n $receta->bollos = (($this->cantidad_masa($request->get('insumos'))) / $request->get('peso'));\n $receta->cantidad_producto = (($receta->bollos) * 30);\n\n $receta->update();\n\n $id_insumo = $request->get('insumos');\n\n $id_detalle= DB::table('receta_insumo as insu')\n ->select('id_detalle')->where('fkidreceta','=',$id_receta)->get();\n $cont=1;\n $insumo[]=array();\n $cantidad[]=array();\n $unidad[]=array();\n \n foreach ($id_insumo as $insu) {\n $insumo[]=$insu['idinsumo'];\n $cantidad[]=$insu['cantidad'];\n $unidad[]=$insu['unidad'];\n \n }\n foreach ($id_detalle as $det) {\n $receta_insumo = RecetaInsumo::findOrFail($det->id_detalle);\n $receta_insumo->fkidreceta = $receta->idreceta;\n $receta_insumo->fkidinsumo = $insumo[$cont];\n $receta_insumo->cantidad = $cantidad[$cont];\n $receta_insumo->unidad_medida = $unidad[$cont];\n $receta_insumo->costo = ($cantidad[$cont]) * ($this->obtener_iteminsumo($insumo[$cont]));\n \n $receta_insumo->update();\n \n $cont=$cont+1;\n }\n }else{\n return response([\"respuesta\" => \"no hay insumos\", \"message\" => \"No esta mandando insumos\"], Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n \n DB::commit();\n return response([\"data\" => $receta_insumo, 'message' => MessageResponse::SAVE_OKEY], Response::HTTP_OK);\n } catch (\\Throwable $e) {\n dd($e);\n DB::rollback();\n return response([\"respuesta\" => $e, \"message\" => MessageException::DB_SAVEDATA], Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n }", "public function setSum(int $sum): void\n {\n $this->sum = $sum;\n }", "public function atualizaValorDocumento($id_documento){\n\n $consulta =\n \" UPDATE\n documento\n SET vl_total =\n (\n SELECT\n SUM(p.vl_preco)\n FROM documento_item di\n INNER JOIN produto p ON (di.id_produto = p.id_produto)\n WHERE\n di.id_documento = $id_documento\n )\n WHERE\n id_documento = $id_documento \";\n\n $resultado = Conexao::getInstance()->executaQuery($consulta);\n\n return $resultado;\n }", "function update_total()\n {\n $this->db->begin();\n\n // Clean parameters\n if (empty($this->total_localtax1)) $this->total_localtax1=0;\n if (empty($this->total_localtax2)) $this->total_localtax2=0;\n\n // Mise a jour ligne en base\n $sql = \"UPDATE \".MAIN_DB_PREFIX.\"repairdet SET\";\n $sql.= \" total_ht='\".price2num($this->total_ht).\"'\";\n $sql.= \",total_tva='\".price2num($this->total_tva).\"'\";\n $sql.= \",total_localtax1='\".price2num($this->total_localtax1).\"'\";\n $sql.= \",total_localtax2='\".price2num($this->total_localtax2).\"'\";\n $sql.= \",total_ttc='\".price2num($this->total_ttc).\"'\";\n $sql.= \" WHERE rowid = \".$this->rowid;\n\n dol_syslog(\"RepairLine::update_total sql=$sql\");\n\n $resql=$this->db->query($sql);\n if ($resql)\n {\n $this->db->commit();\n return 1;\n }\n else\n {\n $this->error=$this->db->error();\n dol_syslog(\"RepairLine::update_total Error \".$this->error, LOG_ERR);\n $this->db->rollback();\n return -2;\n }\n }", "public function acelerar(){\n\t\t$this->velocidad += 10;\n\t}", "function index()\n{\n$now = new \\DateTime();\n$recibo=DB::table('recibonomina')\n\t\t->select('idReciboNomina')\n\t\t->max('idReciboNomina');\n\n\n$sistemas['fecha']= $now->format('d-m-Y');\n$sistemas['grado']='ninguno';\n$sistemas['nombre']='ninguno';\n\n\n$suma=1;\n\nif(!is_null($recibo))\n{\n$suma=$recibo+1;\n}\n\n$sistemas['recibo']=$suma;\n \n return view('reciboEmpleado',['sistemas' => $sistemas]);\n}", "public function calculaCalorias()\n {\n $calorias = $this->alimento->calorias;\n $this->calorias_total = $this->quantidade * $calorias;\n }", "public function MeteCarrito() {\n $datosprod=array(\n \"id\"=>$this->input->post('idpro'),\n\t\t\"cantidad\"=>$this->input->post('cantidad'),\n\t\t\"precio\"=>$this->input->post('prefi'),\n );\n $this->carrito->add($datosprod);\n\n $this->Muestracarrito();\n \n }", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_pedidos_produtos where mgt_pedido_produto_numero_pedido = \" . trim($this->mgt_pedido_numero->Text) . \" order by mgt_pedido_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Fields['mgt_pedido_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Fields['mgt_pedido_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Pedidos_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "function actualizaSubtotales($solicitud,$subtotalByN,$subtotalColor,$totalEncuadernacion,$totalVarios,$totalEspiral,$totalEncolado,$totalVarios1,$totalVarios2){\r\n\r\n\tglobal $sentenciaUpdateTrabajoSubtotal,$mysqlCon;\r\n\t$trabajo = 1;\r\n\r\n\tif ($subtotalByN == null)\r\n\t\t$subtotalByN = 0;\r\n\r\n\tif ($subtotalColor == null)\r\n\t\t$subtotalColor = 0;\r\n\r\n\tif ($totalEncuadernacion ==null)\r\n\t\t$totalEncuadernacion = 0;\r\n\r\n\tif ($totalVarios == null)\r\n\t\t$totalVarios = 0;\r\n\r\n\tif ($totalEspiral == null)\r\n\t\t$totalEspiral = 0;\r\n\r\n\tif($totalEncolado == null)\r\n\t\t$totalEncolado = 0;\r\n\r\n\tif($totalVarios1 == null)\r\n\t\t$totalVarios1 = 0;\r\n\r\n\tif($totalVarios2 == null)\r\n\t\t$totalVarios2= 0;\r\n\r\n\t$stmt = $mysqlCon->prepare($sentenciaUpdateTrabajoSubtotal);\r\n\t$stmt->bind_param('ddddddddii',$subtotalByN,$subtotalColor,$totalEncuadernacion,$totalVarios,$totalEspiral,$totalEncolado,$totalVarios1,$totalVarios2,$trabajo,$solicitud);\r\n\t$stmt->execute();\r\n\t$stmt->close();\r\n\r\n}", "function update_amounts($value, $key){\n global $data_set;\n $data_set[$key]->amount += $value;\n }", "function totaliza()\n {\n $this->total->resumo(\"res\", $this->array_total_participante, $this->array_total_pista);\n ksort($this->array_total_participante);\n ksort($this->array_total_pista);\n }", "public function update(Request $request, Sum $sum)\n {\n //\n }", "function actualizarInventario($oInventario1){\n $oCompra_Detalle=ingreso_detalle::getByID($oInventario1->ingreso_detalle_ID);\n $oCompra=ingreso::getByID($oCompra_Detalle->ingreso_ID);\n $precio_compra_soles=0;\n $precio_compra_dolares=0;\n if($oCompra->moneda_ID==1){\n $precio_compra_soles=$oCompra_Detalle->precio;\n //number_format($costo_venta_unitario,2,\".\",\",\");\n $precio_compra_dolares=round($precio_compra_soles/$oCompra->tipo_cambio,2);\n }else {\n $precio_compra_dolares=$oCompra_Detalle->precio;\n $precio_compra_soles=round($precio_compra_dolares*$oCompra->tipo_cambio,2);\n }\n $osalida_detalle=salida_detalle::getByID($oInventario1->salida_detalle_ID);\n $osalida=salida::getByID($osalida_detalle->salida_ID);\n $oOperador=operador::getByID($osalida->operador_ID);\n $precio_venta_soles=$osalida_detalle->precio_venta_unitario_soles;\n $precio_venta_dolares=$osalida_detalle->precio_venta_unitario_dolares;\n if($osalida->moneda_ID==1){\n //Si es una venta en soles sacamos la utilidad en esta moneda\n $oInventario1->utilidad_soles=$precio_venta_soles-$precio_compra_soles;\n $oInventario1->comision_soles=$oInventario1->utilidad_soles*$oOperador->comision;\n $oInventario1->utilidad_dolares=0;\n $oInventario1->comision_dolares=0;\n }else{\n $oInventario1->utilidad_soles=0;\n $oInventario1->comision_soles=0;\n $oInventario1->utilidad_dolares=$precio_venta_dolares-$precio_compra_dolares;\n $oInventario1->comision_dolares=$oInventario1->utilidad_dolares*$oOperador->comision;\n }\n \n \n \n $oInventario1->usuario_mod_id=$_SESSION['usuario_ID'];\n $oInventario1->actualizar();\n\n}", "private function _updateData() {\n $bills = \\App\\Models\\Backoffice\\Bill::all();\n foreach ($bills as $bill) {\n $bill->num_tokens = $bill->num_tokens['ADT'] * 100;\n $bill->save();\n }\n }", "public function updateCostosPersonal()\n {\n\n /*\n # code...\n $personalTareos = PersonalTareo::all();\n\n foreach ($personalTareos as $personalTareo) {\n \n $idPersona = $personalTareo->persona_id;\n\n $persona = Persona::find($idPersona);\n\n $personalTareo->costo_h = $persona->costo_h;\n $personalTareo->save();\n\n }*/\n\n \n\n }", "public function calculateTotals() {\n $this->totals = 0;\n foreach ($this->contents as $productoId => $item) {\n $this->totals += $item->getImporte();\n }\n}", "public function update(AbonosRequest $request, Abonos $abonos,Creditos $creditos)\n {\n $id = $request->creditos_id;\n $idabono = $abonos->id;\n\n $eliminar = Abonos::where('id', '=', $idabono)->delete(); \n\n $abonos = Abonos::create($request->all());\n\n // Lo que debe el Cliente tot_actual\n\n //obtengo el id del credito por medio del arrego en el request\n $id = $request->creditos_id;\n\n // Suma de Todos los abonos normales \n $sumnormal = Abonos::where('creditos_id', '=', $id)->where('tipo_cuota', '=', 1)->sum('cuota');\n // Suma de Todos los abonos interes\n $suminter = Abonos::where('creditos_id', '=', $id)->where('tipo_cuota', '=', 2)->sum('cuota');\n\n\n // Capital Actual utilidad_act\n $capitala = Creditos::where('id', '=', $id)->value('capital');\n\n $capactual = $capitala-$sumnormal;\n\n $capitalb = 0;\n $totalabonos = $sumnormal; \n\n if ($capactual>0)\n {\n $capitalb = $capactual;\n }\n elseif($capactual<=0)\n {\n $capitalb = 0; \n }\n\n // Utilidad Actual utilidad_act\n\n $util = $sumnormal-$capitala;\n\n $util_act = 0; \n\n if ($util<=0)\n {\n $util_act = 0;\n }\n elseif($util>0)\n {\n $util_act = $util; \n }\n\n // sumo a utilidad de forma directa abonos a utilidad \n\n $utilabo = $util_act + $suminter;\n\n // sumo a total sum_abonos\n\n //suma total normal y interes\n\n $sumnyi = $sumnormal + $suminter;\n\n\n\n \n\n // Total debe: tot_actual\n $tot_actual = Creditos::where('id', '=', $id)->value('total');\n\n $tota = $tot_actual-$sumnormal;\n\n $debe_act = 0; \n\n if ($tota<0)\n {\n $debe_act = 0;\n }\n elseif($tota>=0)\n {\n $debe_act = $tota; \n }\n\n //resto a tot_actual las cuotas de solo interes (pendiente)\n\n $totactual = $debe_act - $suminter;\n\n\n\n //actualizo el valor en la tabla creditos \n $creditoactual = Creditos::find($id);\n $creditoactual->sum_abonos = $sumnyi;\n $creditoactual->cap_actual = $capitalb;\n $creditoactual->utilidad_act = $utilabo;\n $creditoactual->tot_actual = $totactual;\n $creditoactual->save();\n\n \n return redirect()->route('abonos.index', ['id' => $id])\n ->with('info', 'Abono Modificado con éxito');\n\n \n\n }", "public function withDrawSalary()\r\n {\r\n $sum = 0.0;\r\n foreach($this->jobs as $index => $job )\r\n {\r\n // ar dabras yra pabaigtas\r\n if($job->done()) {\r\n // darbas yra pabaigtas\r\n // pridedame darbo uzmokesti prie bendros sumos\r\n $sum += $job->getAmount();\r\n // istrinti pabaigta darba \r\n array_splice($this->jobs, $index, 1);\r\n }\r\n }\r\n return $sum;\r\n }", "function updateTotalScore() {\n \t$this->set('totalScore',$this->get('regScore')+$this->get('ctsScore')+\n \t\t\t $this->get('fslScore0')+$this->get('fslScore1')+$this->get('fslScore2')+$this->get('fslScore3')+$this->get('cpaScore'));\n \t$this->set('totalDuration',$this->get('regDuration')+$this->get('ctsDuration')+$this->get('fslDuration')+$this->get('cpaDuration'));\n \treturn $this->update(); \t\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n $transaction = $model->dbConnection->beginTransaction();\n try {\n\n if (isset($_POST['Recibos'])) {\n $model->attributes = $_POST['Recibos'];\n \n $ultimo = $model->getUltimoNumero(\"1\");\n //actualizamos el numero de recibo en la tabla documentos\n $sql = \"update documentos set ultimoNumero='\" . ($ultimo+1). \"' where tipoDocumento='REC' and sucursal=1\";\n $result = Yii::app()->db->createCommand($sql)->execute();\n if ($result==0){\n $error = 'Error al actualizar el numero de recibo actual';\n throw new Exception($error);\n }\n //seteamos el estado de finalizado en el recibo\n $model->sucursal='1';\n $model->numero=$ultimo;\n $model->userStamp=Yii::app()->user->model->username;\n $model->estado = 1;\n if ($model->save()) {\n \n //borramos los registros de pagos \n //acreditamos en cuenta corriente\n $saldos = $model->RecibosNotaVenta;\n foreach ($saldos as $saldo) {\n //metemos el registro en cuenta corriente\n $notaVenta = NotaVenta::model()->findBypk($saldo->notaVentaId);\n $saldoAnterior=$notaVenta->getSaldo();\n\n $ctacte = new CtaCteClientes();\n $ctacte->tipoMov = 1; //credito\n $ctacte->notaVentaId = $saldo->notaVentaId;\n $ctacte->fecha = date(\"Y-m-d\");\n $ctacte->conceptoId = 10;\n $ctacte->monto = $saldo->monto;\n //antes del recargo si con lo que paga cancelamos la nota de venta\n //ponemos el estado correspondiente\n \n $diferencia=$saldoAnterior-$saldo->monto;\n if ($diferencia<=0) {\n $notaVenta->estado = 1;\n } else {\n $notaVenta->estado = 0;\n }\n if (!$notaVenta->save()) {\n $error = 'Error al Guardar la nota de Venta:' . $notaVenta->getErrors();\n throw new Exception($error);\n }\n\n //si tiene recargo tenemos que reflejarlo en la ctacte\n if ($saldo->recargo > 0) {\n\n //debito \n $ctacteRd = new CtaCteClientes();\n $ctacteRd->tipoMov = 0;\n $ctacteRd->notaVentaId = $saldo->notaVentaId;\n $ctacteRd->fecha = date(\"Y-m-d\");\n $ctacteRd->conceptoId = 14;\n $ctacteRd->monto = $saldo->recargo;\n $ctacteRd->userStamp = Yii::app()->user->model->username;\n $ctacteRd->timeStamp = Date(\"Y-m-d h:m:s\");\n if (!$ctacteRd->save()) {\n $error = 'Error al Guardar El credito por REcargo en Ctacte:' . $ctacteRd->getErrors();\n throw new Exception($error);\n }\n //credito\n $ctacteRc = new CtaCteClientes();\n $ctacteRc->tipoMov = 1;\n $ctacteRc->notaVentaId = $saldo->notaVentaId;\n $ctacteRc->fecha = date(\"Y-m-d\");\n $ctacteRc->conceptoId = 10;\n $ctacteRc->monto = $saldo->recargo;\n $ctacteRc->userStamp = Yii::app()->user->model->username;\n $ctacteRc->timeStamp = Date(\"Y-m-d h:m:s\");\n if (!$ctacteRc->save()) {\n $error = 'Error al Guardar El credito por REcargo en Ctacte:' . $ctacteRc->getErrors();\n throw new Exception($error);\n }\n }\n $ctacte->userStamp = Yii::app()->user->model->username;\n $ctacte->timeStamp = Date(\"Y-m-d h:m:s\");\n if (!$ctacte->save()) {\n $error = 'Error al Guardar El credito en Ctacte:' . $ctacte->getErrors();\n throw new Exception($error);\n }\n }\n \n //flujo de fondos\n $pagos = $model->formaPago;\n $cantidad=count($pagos);\n foreach ($pagos as $pago) {\n \n //insertamos en la cajaDiaria\n $flujoFondos= new FlujoFondos();\n $flujoFondos->fecha=date(\"Y-m-d\");\n $flujoFondos->cuentaId=Yii::app()->params['cuentaCajaDiaria'];\n $flujoFondos->tipoMov=1; //ingreso\n $flujoFondos->monto=$pago->monto;\n $flujoFondos->conceptoId=7; //pagos por abonos\n $flujoFondos->tipoFondoId=$pago->tipoFormaPago;\n $flujoFondos->descripcion=\"Cliente:\".$model->cliente->razonSocial.\" Referencia (\".$cantidad.\"): \".$pago->numeroReferencia.\" | <a target=new href='/arlab/index.php/recibos/ReciboPDF/\".$model->id.\"'> Recibo</a>\";\n $flujoFondos->monedaId=1; //pesos\n $flujoFondos->userStamp=Yii::app()->user->model->username;\n $flujoFondos->timeStamp= Date(\"Y-m-d h:m:s\");\n\n if (!($flujoFondos->save()))\n {\n $error = 'Error al Registrar el Flujo de Fondos:' . $model->getErrors();\n throw new Exception($error); \n }\n\n }\n \n $transaction->commit();\n //redirijimos a la hoja del cliente\n $this->actionFinal($model->id);\n } else {\n $error = 'Error al Guardar el estado del recibo:' . $model->getErrors();\n throw new Exception($error);\n }\n } else {\n $this->render('_formUpdate', array('model' => $model,));\n }\n } catch (Exception $e) {\n echo(var_dump($e));\n $transaction->rollBack();\n Yii::app()->end();\n }\n }", "private function calcFormularAmount(){\n\t\t$i=0;\n\t\t$value=0.0;\n\t\t$no_of_tokens=count($this->buf);\n\t\twhile($i<$no_of_tokens){\n\t\t\tif($i==0){\n\t\t\t\t$this->prev_amount[$this->modifier]=$this->prev_amount[$this->buf[$i]];\n\t\t\t\tfor($x=0;$x<NO_OF_MONTHS;$x+=$this->inc){\n\t\t\t\t\t$this->amount[$this->modifier][$x]=$this->amount[$this->buf[$i]][$x];\n\t\t\t\t}\n\t\t\t\t$this->total_amount[$this->modifier]=$this->total_amount[$this->buf[$i]];\n\t\t\t}\n\t\t\telseif($i%2==0){\n\t\t\t\tswitch($this->buf[$i-1]){\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\t$this->prev_amount[$this->modifier]+=$this->prev_amount[$this->buf[$i]];\n\t\t\t\t\t\tfor($x=0;$x<NO_OF_MONTHS;$x+=$this->inc){\n\t\t\t\t\t\t\t$this->amount[$this->modifier][$x]+=$this->amount[$this->buf[$i]][$x];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->total_amount[$this->modifier]+=$this->total_amount[$this->buf[$i]];\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\t$this->prev_amount[$this->modifier]-=$this->prev_amount[$this->buf[$i]];\n\t\t\t\t\t\tfor($x=0;$x<NO_OF_MONTHS;$x+=$this->inc){\n\t\t\t\t\t\t\t$this->amount[$this->modifier][$x]-=$this->amount[$this->buf[$i]][$x];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->total_amount[$this->modifier]-=$this->total_amount[$this->buf[$i]];\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"*\":\n\t\t\t\t\t\t$this->prev_amount[$this->modifier]*=$this->prev_amount[$this->buf[$i]];\n\t\t\t\t\t\tfor($x=0;$x<NO_OF_MONTHS;$x+=$this->inc){\n\t\t\t\t\t\t\t$this->amount[$this->modifier][$x]*=$this->amount[$this->buf[$i]][$x];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->total_amount[$this->modifier]*=$this->total_amount[$this->buf[$i]];\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"/\":\n\t\t\t\t\t\t$this->prev_amount[$this->modifier]/=$this->prev_amount[$this->buf[$i]];\n\t\t\t\t\t\tfor($x=0;$x<NO_OF_MONTHS;$x+=$this->inc){\n\t\t\t\t\t\t\t$this->amount[$this->modifier][$x]/=$this->amount[$this->buf[$i]][$x];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->total_amount[$this->modifier]/=$this->total_amount[$this->buf[$i]];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t}", "function atualizar($id, $qtd, $total){\n\t\t$query = \"update carrinho set qtd = \". $qtd .\", valortotal = \". $total .\" where oid_carrinho = \". $id .\";\";\n\t\t$exec = mysql_query($query);\n\n\t\tif(!$exec) echo($query);\n\t}", "function incrementar_stock_rma($id_prod,$cantidad,$id_prod_ant=\"\",$comentario,$estado_rma,$cod,$des_cod,$id_prov,$id_info_rma=\"\",$nro_orden=\"\",$nuevo_coment=\"\",$id_nota_credito=\"null\",$ubicacion=\"\",$caso,$defecto,$tipo_log=\"\",$id_licitacion=0,$id_movimiento_material=0,$san_luis=0)\r\n{\r\n\tglobal $_ses_user,$db;\r\n\r\n\t$db->StartTrans();\r\n\t$fecha1=date(\"Y-m-d\");\r\n\t$fecha=date(\"Y-m-d H:i:s\");\r\n\t$usuario=$_ses_user[\"name\"];\r\n\t//print_r($_ses_user);\r\n\t($san_luis) ? $nombre_deposito = \"RMA-Produccion-San Luis\" : $nombre_deposito=\"RMA\";\r\n\t$sel=\"select id_deposito from general.depositos where nombre='$nombre_deposito' \";\r\n\t$eje_se=sql($sel,\"No se pudo recuperar el id_tipo_movimiento\") or fin_pagina();\r\n\t$id_dep=$eje_se->fields['id_deposito'];\r\n\tif($estado_rma==\"\")\r\n\t{$estado_rma=1;}\r\n\r\n\tif($id_prov==\"\")\r\n\t$id_prov=\"null\";\r\n\tif($nro_orden==\"\")\r\n\t$nro_orden=\"null\";\r\n\t/*if($ubicacion!=\"\")\r\n\t{\r\n\t$sql=\"update en_stock set ubicacion='$ubicacion'\r\n\twhere id_deposito=$id_dep and id_prod_esp=$id_prod\";\r\n\tsql($sql,\"No se pudo actualizae la ubicacion\") or fin_pagina();\r\n\t}*/\r\n\tif($id_info_rma==\"\")\r\n\t{\r\n\t\t$sel=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Ingreso RMA' \";\r\n\t\t$eje_sel=sql($sel,\"No se pudo recuperar el id_tipo_movimiento\") or fin_pagina();\r\n\t\t$id_tip_mov=$eje_sel->fields['id_tipo_movimiento'];\r\n\t\tagregar_stock($id_prod,$cantidad,$id_dep,$comentario,$id_tip_mov,\"disponible\",\"\",\"\",\"\",\"\",\"\");\r\n\t\t//$db->StartTrans();\r\n\t\t$sql=\" select id_en_stock from en_stock where id_prod_esp=$id_prod and id_deposito=$id_dep\";\r\n\t\t$res=sql($sql,\"<br>Error al traer el id del stock (agregar_stock)<br>\") or fin_pagina();\r\n\t\t$id_en_stock=$res->fields['id_en_stock'];\r\n\t\t$id_nota_credito=\"null\";\r\n\t\t$sql=\"select nextval('info_rma_id_info_rma_seq') as id_info_rma \";\r\n\t\t$res=sql($sql,\"<br>Error al traer la la secuencia de info_rma (agregar_stock)<br>\") or fin_pagina();\r\n\t\t$id_info_rma=$res->fields[\"id_info_rma\"];\r\n\t\t$campos= \"id_info_rma,desc_void,id_proveedor,nro_orden,cantidad,id_estado_rma,id_en_stock,id_nota_credito,fecha_hist,nrocaso,defecto_parte,fecha_creacion\";\r\n\t\tif($ubicacion!=\"\") {\r\n\t\t\t$campos.=\",id_ubicacion_rma\";\r\n\t\t}\r\n\t\t$values= \"$id_info_rma,'$des_cod',$id_prov,$nro_orden,$cantidad,$estado_rma,$id_en_stock,$id_nota_credito,'$fecha','$caso','$defecto','$fecha'\";\r\n\t\tif($ubicacion!=\"\") {\r\n\t\t\t$values.=\",$ubicacion\";\r\n\t\t}\r\n\t\tif ($id_licitacion) {\r\n\t\t\t$campos.=\",id_licitacion\";\r\n\t\t\t$values.=\",$id_licitacion\";\r\n\t\t}\r\n\r\n\t\tif ($id_movimiento_material) {\r\n\t\t\t$campos.=\",id_movimiento_material\";\r\n\t\t\t$values.=\",$id_movimiento_material\";\r\n\t\t}\r\n\t\t$sql=\" insert into stock.info_rma ($campos) values ($values)\";\r\n\t\tsql($sql,\"<br>Error al insertar en la tabla del stock(agregar_stock)<br>\") or fin_pagina();\r\n\r\n\r\n\r\n\t\tif($tipo_log==\"\")\r\n\t\t$tipo_log=\"Creacion\";\r\n\t\t$campos= \"id_info_rma,void\";\r\n\t\t$contar=0;\r\n\t\twhile($contar<$cantidad)\r\n\t\t{\r\n\t\t\t$void1=$cod[$contar];\r\n\t\t\t$values= \"$id_info_rma,'$void1'\";\r\n\t\t\t$sql_void=\" insert into void_rma ($campos) values ($values)\";\r\n\t\t\tsql($sql_void,\"<br>Error al insertar en la tabla de void_rma<br>\") or fin_pagina();\r\n\t\t\t$contar++;\r\n\t\t}\r\n\t\t$estado_rma=1;\r\n\t\t//$db->CompleteTrans();\r\n\t}//finif($id_info_rma==\"\")\r\n\r\n\telse\r\n\t{\r\n\t\tif($id_prod_ant==$id_prod)\r\n\t\t{\r\n\t\t\t////////////////////////////////Update de Info_Rma///////////////////////////////////\r\n\r\n\t\t\t$updat=\"update stock.info_rma set id_proveedor=$id_prov,id_estado_rma=$estado_rma,desc_void='$des_cod',void='$cod',nro_orden=$nro_orden,nrocaso='$caso',defecto_parte='$defecto',cantidad=$cantidad\";\r\n\t\t\tif($ubicacion!=\"\")\r\n\t\t\t{\r\n\t\t\t\t$updat.=\",id_ubicacion_rma=$ubicacion\";\r\n\t\t\t}\r\n\r\n\t\t\tif($estado_rma==4)\r\n\t\t\t{\r\n\t\t\t\t$se_id_in_r=\"select id_estado_rma from stock.info_rma where id_info_rma=$id_info_rma\";\r\n\t\t\t\t$inf_rma=sql($se_id_in_r,\"No se puede seleccionar el estado del rma\") or fin_pagina();\r\n\t\t\t\t$id_est=$inf_rma->fields['id_estado_rma'];\r\n\t\t\t\t$tipo_log=\"Entrega\";\r\n\r\n\t\t\t\tif($id_est!=$estado_rma)\r\n\t\t\t\t{\r\n\t\t\t\t\t$updat.=\" ,fecha_hist='$fecha'\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t$tipo_log=\"Modificacion\";\r\n\r\n\t\t\t$updat.=\" where id_info_rma=$id_info_rma\";\r\n\t\t\tsql($updat,\"No se pudo guardar los datos de info_rma\") or fin_pagina();\r\n\t\t}//////Fin if($id_prod_ant==$id_prod)\r\n\r\n\t\telse//si hubo cambio de producto\r\n\t\t{\r\n\t\t\t$sel=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Descuento de stock RMA por cambio de producto' \";\r\n\t\t\t$eje_sel=sql($sel,\"No se pudo recuperar el id_tipo_movimiento\") or fin_pagina();\r\n\t\t\t$id_tip_mov=$eje_sel->fields['id_tipo_movimiento'];\r\n\t\t\tdescontar_stock_disponible($id_prod_ant,$cantidad,$id_dep,$id_tip_mov,\"Descuento por cambio de producto en el RMA Nº $id_info_rma\");\r\n\t\t\t$sel=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Ingreso RMA' \";\r\n\t\t\t$eje_sel=sql($sel,\"No se pudo recuperar el id_tipo_movimiento\") or fin_pagina();\r\n\t\t\t$id_tip_mov=$eje_sel->fields['id_tipo_movimiento'];\r\n\t\t\t$comentario=\"Se cambió el producto para el RMA Nº $id_info_rma\";\r\n\t\t\tagregar_stock($id_prod,$cantidad,$id_dep,$comentario,$id_tip_mov,\"disponible\",\"\",\"\",\"\",\"\",\"\");\r\n\r\n\t\t\t$sql=\" select id_en_stock from en_stock where id_prod_esp=$id_prod and id_deposito=$id_dep\";\r\n\t\t\t$res=sql($sql,\"<br>Error al traer el id del stock (agregar_stock)<br>\") or fin_pagina();\r\n\t\t\t$id_en_stock=$res->fields['id_en_stock'];\r\n\r\n\t\t\t$tipo_log=\"Cambio producto $id_prod_ant por $id_prod\";\r\n\t\t\t$campos= \"id_info_rma,id_estado_rma,fecha,usuario_log,tipo_log,comentario\";\r\n\t\t\t$values= \"$id_info_rma,$estado_rma,'$fecha','$usuario','$tipo_log','Cambio del producto'\";\r\n\t\t\t$sql=\" insert into stock.log_info_rma ($campos) values ($values)\";\r\n\t\t\tsql($sql,\"<br>Error al insertar en la tabla del comentario(agregar_stock)<br>\") or fin_pagina();\r\n\r\n\t\t\t$updat=\"update stock.info_rma set id_proveedor=$id_prov,id_en_stock=$id_en_stock,id_estado_rma=$estado_rma,desc_void='$des_cod',void='$cod',nro_orden=$nro_orden,nrocaso='$caso',defecto_parte='$defecto'\";\r\n\r\n\t\t\tif($ubicacion!=\"\")\r\n\t\t\t{\r\n\t\t\t\t$updat.=\",id_ubicacion_rma=$ubicacion\";\r\n\t\t\t}\r\n\r\n\t\t\tif($estado_rma==4)\r\n\t\t\t{\r\n\t\t\t\t$se_id_in_r=\"select id_estado_rma from stock.info_rma where id_info_rma=$id_info_rma\";\r\n\t\t\t\t$inf_rma=sql($se_id_in_r,\"No se puede seleccionar el estado del rma\") or fin_pagina();\r\n\t\t\t\t$id_est=$inf_rma->fields['id_estado_rma'];\r\n\t\t\t\t$tipo_log=\"Entrega\";\r\n\r\n\t\t\t\tif($id_est!=$estado_rma)\r\n\t\t\t\t{\r\n\t\t\t\t\t$updat.=\" ,fecha_hist='$fecha'\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t$tipo_log=\"Modificacion\";\r\n\r\n\t\t\t$updat.=\" where id_info_rma=$id_info_rma\";\r\n\t\t\tsql($updat,\"No se pudo guardar los datos de info_rma\") or fin_pagina();\r\n\r\n\t\t\t//traemos los nombres y precios del nuevo y el anterior producto de este RMA\r\n\t\t\t$query=\"select descripcion,precio_stock from general.producto_especifico where id_prod_esp=$id_prod_ant\";\r\n\t\t\t$prod_orig=sql($query,\"<br>Error al traer datos del producto original del RMA<br>\") or fin_pagina();\r\n\t\t\t$nombre_prod_original=$prod_orig->fields[\"descripcion\"];\r\n\t\t\t$precio_producto_original=$prod_orig->fields[\"precio_stock\"];\r\n\r\n\t\t\t$query=\"select descripcion,precio_stock from general.producto_especifico where id_prod_esp=$id_prod\";\r\n\t\t\t$prod_nuevo=sql($query,\"<br>Error al traer datos del producto nuevo del RMA<br>\") or fin_pagina();\r\n\t\t\t$nombre_nuevo_producto=$prod_nuevo->fields[\"descripcion\"];\r\n\t\t\t$precio_nuevo_producto=$prod_nuevo->fields[\"precio_stock\"];\r\n\r\n\t\t\t//si el precio del nuevo producto es distinto del precio del producto original\r\n\t\t\tif($precio_nuevo_producto!=$precio_producto_original)\r\n\t\t\t{\r\n\t\t\t\t$monto_original=$precio_producto_original*$cantidad;\r\n\t\t\t\t$monto_nuevo=$precio_nuevo_producto*$cantidad;\r\n\t\t\t\t$variacion=$monto_nuevo-$monto_original;\r\n\r\n\t\t\t\t//enviamos mail a noelia avisando del cambio de producto\r\n\t\t\t\t$para=\"noelia@coradir.com.ar\";\r\n\t\t\t\t$asunto=\"Para el RMA Nº $id_info_rma se cambió el producto cargado anteriormente\";\r\n\t\t\t\t$texto=\"AVISO: Para el RMA Nº $id_info_rma se cambió el producto: $nombre_prod_original\\n\";\r\n\t\t\t\t$texto.=\"por el producto: $nombre_nuevo_producto.\\n\\n\";\r\n\t\t\t\t$texto.=\"El monto del RMA con el producto original ($nombre_prod_original) era: U\\$S \".formato_money($monto_original).\".\\n\";\r\n\t\t\t\t$texto.=\"El monto del RMA con el nuevo producto ($nombre_nuevo_producto) es: U\\$S \".formato_money($monto_nuevo).\"\\n\\n\";\r\n\t\t\t\t$texto.=\"Esto va a provocar una variación de U\\$S \".formato_money($variacion).\" en el balance, en el stock de RMA.\\n\\n\";\r\n\t\t\t\t$texto.=\"Usuario que realizó el cambio: $usuario - Fecha: \".date(\"d/m/Y H:i:s\").\"\\n\\n\\n\";\r\n\t\t\t\t//echo $texto;die;\r\n\t\t\t\tenviar_mail($para,$asunto,$texto,'','','','','');\r\n\r\n\t\t\t}//de if($precio_nuevo_producto!=$precio_producto_original)\r\n\r\n\t\t}///////Fin del Else de if($id_prod_ant==$id_prod)\r\n\r\n\t\t$del=\"DELETE from void_rma where id_info_rma=$id_info_rma\";\r\n\t\tsql($del,\"no se pudo eliminar los void\")or fin_pagina();\r\n\t\t$contar=0;\r\n\t\t$campos= \"id_info_rma,void\";\r\n\t\twhile($contar<$cantidad)\r\n\t\t{\r\n\t\t\t$void1=$cod[$contar];\r\n\t\t\tif($void1!=\"\")\r\n\t\t\t{\r\n\t\t\t\t$values= \"$id_info_rma,'$void1'\";\r\n\t\t\t\t$sql_void=\" insert into void_rma ($campos) values ($values)\";\r\n\t\t\t\tsql($sql_void,\"<br>Error al insertar en la tabla de void_rma<br>\") or fin_pagina();\r\n\t\t\t}\r\n\t\t\t$contar++;\r\n\t\t}\r\n\t}\r\n\r\n\tif($nuevo_coment!=\"\")\r\n\t{\r\n\t\t$campos= \"id_info_rma,usuario,fecha,texto\";\r\n\t\t$values= \"$id_info_rma,'$usuario','$fecha1','$nuevo_coment'\";\r\n\t\t$sql=\" insert into stock.comentario_rma ($campos) values ($values)\";\r\n\t\tsql($sql,\"<br>Error al insertar en la tabla del comentario(agregar_stock)<br>\") or fin_pagina();\r\n\t}\r\n\t$campos= \"id_info_rma,id_estado_rma,fecha,usuario_log,tipo_log\";\r\n\t$values= \"$id_info_rma,$estado_rma,'$fecha','$usuario','$tipo_log'\";\r\n\t$sql=\" insert into stock.log_info_rma ($campos) values ($values)\";\r\n\tsql($sql,\"<br>Error al insertar en la tabla del comentario(agregar_stock)<br>\") or fin_pagina();\r\n\r\n\t$db->CompleteTrans();\r\n\r\n\treturn $id_info_rma;\r\n}", "private function calcTotals(){\n $this->GranTotal = 0;\n $this->TotalImpuestos =[];\n foreach ($this->Items as $item) {\n $this->GranTotal += $item->Precio;\n foreach ($item->Impuestos as $impuesto) {\n if(!isset($this->TotalImpuestos[$impuesto->NombreCorto])){\n $this->TotalImpuestos[$impuesto->NombreCorto] = 0;\n }\n //sumar tipo de impuesto\n $this->TotalImpuestos[$impuesto->NombreCorto] += $impuesto->MontoImpuesto;\n // $this->GranTotal += $impuesto->MontoImpuesto;\n }\n }\n $this->GranTotal = $this->GranTotal;\n }", "public function updateTotal(&$total, Reservation $reservation) {}", "public function update(Request $request, $id)\n {\n try{\n DB::beginTransaction();\n $coti=Cotizacione::find($request->cotizacion_id);\n $trabajo=TrabajoDetalle::find($id);\n \n //quitar ala cotizacion lo que tiene en el repuesto\n $totalante=$trabajo->cantidad*$trabajo->precio;\n $cotitot=$coti->subtotal;\n $coti->subtotal=$cotitot-$totalante;\n $coti->save();\n //edito el trabajo\n $trabajo->precio=$request->precio;\n $trabajo->nombre=$request->nombre;\n $trabajo->save();\n //cambio los totales\n if($coti->coniva=='si'){\n $tot=$request->precio*1;\n $subto=$coti->subtotal;\n $n=$subto+$tot;\n $iva=$n*\\App\\Porcentaje::retornar_porcentaje('iva');\n $nt=$n+$iva;\n $coti->subtotal=$n;\n $coti->iva=$iva;\n $coti->total=$nt;\n $coti->save();\n Cotizacione::carcular_ivar($coti->id);\n }else{\n $tot=$request->precio*1;\n $subto=$coti->subtotal;\n $n=$subto+$tot;\n $coti->subtotal=$n;\n $coti->total=$n;\n $coti->iva=0;\n $coti->save();\n Cotizacione::quitar_ivar($coti->id);\n }\n DB::commit();\n return array(1,\"exito\");\n }catch(Exception $e){\n DB::rollback();\n return array(-1,\"error\",$e->getMessage());\n }\n }", "public function actionUpdateRecountAmount($logId, $value)\n {\n $searchModel = new CbEncashment();\n $searchModel->updateRecountAmount($logId, $value);\n }", "function actualizar_stock($id,$stockAsumar){\n $sql = \"SELECT * FROM `productos_inventario` WHERE `id_producto` = $id;\";\n $producto = mysqli_query($conexion, $sql);\n $ultimo_producto = mysqli_fetch_assoc($producto);//usar cuando se espera varios resultados\n\n $stock = $ultimo_producto['cantidad_stock']; //Stock del producto\n $cantidad_nueva = $stock + $stockAsumar;\n\n $consulta_stock = \"UPDATE `productos_inventario` SET `cantidad_stock`= $cantidad_nueva WHERE `id_producto` = $id_producto\";\n $consulta = mysqli_query($conexion, $consulta_stock);\n}", "public function setPlayerTotal(int $sum, $app)\n {\n $this->player->overallTotal += $sum;\n $this->start(1, $app);\n\n\n\n\n\n\n }", "public function ActualizarMovimientos()\n{\n\tself::SetNames();\nif(empty($_POST[\"tipomovimiento\"]) or empty($_POST[\"montomovimiento\"]) or empty($_POST[\"codmediopago\"]) or empty($_POST[\"codcaja\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\tif($_POST[\"montomovimiento\"]>0)\n\t{\n\n\t#################### AGREGAMOS EL INGRESO A ARQUEO EN CAJA ####################\n\t$sql = \"SELECT montoinicial, ingresos, egresos FROM arqueocaja WHERE codcaja = '\".limpiar($_POST[\"codcaja\"]).\"' AND statusarqueo = '1'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$inicial = $row['montoinicial'];\n\t$ingreso = $row['ingresos'];\n\t$egreso = $row['egresos'];\n\t$total = $inicial+$ingreso-$egreso;\n\t$montomovimiento = limpiar($_POST[\"montomovimiento\"]);\n\t$montomovimientodb = limpiar($_POST[\"montomovimientodb\"]);\n\t$ingresobd = number_format($ingreso-$montomovimientodb, 2, '.', '');\n\t$totalmovimiento = number_format($montomovimiento-$montomovimientodb, 2, '.', '');\n\n\tif($_POST[\"tipomovimiento\"]==\"INGRESO\"){\n\n\t$sql = \"UPDATE arqueocaja SET \"\n\t\t.\" ingresos = ? \"\n\t\t.\" WHERE \"\n\t\t.\" codcaja = ? AND statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $ingresos);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$ingresos = number_format($montomovimiento+$ingresobd, 2, '.', '');\n\t\t$codcaja = limpiar($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\n\t $sql = \"UPDATE movimientoscajas SET\"\n\t\t.\" codcaja = ?, \"\n\t\t.\" tipomovimiento = ?, \"\n\t\t.\" descripcionmovimiento = ?, \"\n\t\t.\" montomovimiento = ?, \"\n\t\t.\" codmediopago = ? \"\n\t\t.\" WHERE \"\n\t\t.\" codmovimiento = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $codcaja);\n\t\t$stmt->bindParam(2, $tipomovimiento);\n\t\t$stmt->bindParam(3, $descripcionmovimiento);\n\t\t$stmt->bindParam(4, $montomovimiento);\n\t\t$stmt->bindParam(5, $codmediopago);\n\t\t$stmt->bindParam(6, $codmovimiento);\n\n\t\t$codcaja = limpiar($_POST[\"codcaja\"]);\n\t\t$tipomovimiento = limpiar($_POST[\"tipomovimiento\"]);\n\t\t$descripcionmovimiento = limpiar($_POST[\"descripcionmovimiento\"]);\n\t\t$montomovimiento = limpiar($_POST[\"montomovimiento\"]);\n\t\t$codmediopago = limpiar($_POST[\"codmediopago\"]);\n\t\t$codmovimiento = limpiar($_POST[\"codmovimiento\"]);\n\t\t$stmt->execute();\n\n\t} else {\n\n\t\t if($totalmovimiento>$total){\n\t\t\n\t\techo \"2\";\n\t\texit;\n\n\t } else {\n\n\t$sql = \"UPDATE arqueocaja SET\"\n\t\t.\" egresos = ? \"\n\t\t.\" WHERE \"\n\t\t.\" codcaja = ? AND statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $egresos);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$egresos = number_format($totalmovimiento+$egreso, 2, '.', '');\n\t\t$codcaja = limpiar($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \"UPDATE movimientoscajas SET\"\n\t\t.\" codcaja = ?, \"\n\t\t.\" tipomovimiento = ?, \"\n\t\t.\" descripcionmovimiento = ?, \"\n\t\t.\" montomovimiento = ?, \"\n\t\t.\" codmediopago = ? \"\n\t\t.\" WHERE \"\n\t\t.\" codmovimiento = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $codcaja);\n\t\t$stmt->bindParam(2, $tipomovimiento);\n\t\t$stmt->bindParam(3, $descripcionmovimiento);\n\t\t$stmt->bindParam(4, $montomovimiento);\n\t\t$stmt->bindParam(5, $codmediopago);\n\t\t$stmt->bindParam(6, $codmovimiento);\n\n\t\t$codcaja = limpiar($_POST[\"codcaja\"]);\n\t\t$tipomovimiento = limpiar($_POST[\"tipomovimiento\"]);\n\t\t$descripcionmovimiento = limpiar($_POST[\"descripcionmovimiento\"]);\n\t\t$montomovimiento = limpiar($_POST[\"montomovimiento\"]);\n\t\t$codmediopago = limpiar($_POST[\"codmediopago\"]);\n\t\t$codmovimiento = limpiar($_POST[\"codmovimiento\"]);\n\t\t$stmt->execute();\n\n\t }\n\t}\t\n\t\necho \"<span class='fa fa-check-square-o'></span> EL MOVIMIENTO EN CAJA HA SIDO ACTUALIZADO EXITOSAMENTE\";\nexit;\n\t}\n\telse\n\t{\n\t\techo \"3\";\n\t\texit;\n\t}\n}", "function setsumtraslados_remoto($cod,$suc){\r\n $con_remoto = new dbmanager;\r\n //usamos el metodo conectar para realizar la conexion\r\n if($con_remoto->conectar_remoto()==true){\r\n $query = \"SELECT sum(cantidad) as cantidad FROM tbl_itemtraslado WHERE cod_t='$cod' and sucursal=$suc\"; \r\n\t $result = @mysql_query($query);\r\n\t \r\n\t if (!$result){\r\n\t return false;\r\n\t }\r\n\t else{\r\n\t $row = mysql_fetch_assoc($result);\t \r\n\t return $row['cantidad'];\r\n\t }\r\n }\r\n }", "public function summa($summa)\n {\n\n // $summa = 0; \n\n foreach ($purchases as $purchase) {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != null && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != null)\n\n {\n\n if ($purchase->first()->book->discont_global > $purchase->first()->book->author->discont_id && $purchase->magazin->discont_global >= $purchase->magazin->author->discont_id) \n\n {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } else {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n }\n\n } elseif($purchase->first()->book->discont_privat != null && $purchase->magazin->discont_privat != null)\n\n {\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } else {\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n } \n}\n }", "public function depreciacion($id){\n $montoanual = 0;\n $suma = 0;\n $depreacumulada = 0;\n $valorlibros = 0;\n $depreciacion[] = null;\n $monto = 0;\n $activo = $this->obtenerActivo($id); //RECUPERAR EL ACTIVO\n\n if($activo != null){\n $porcentaje = $activo[0]['porcentaje'] / 100;\n $valorlibros = $activo[0]['monto'] * $porcentaje;\n $monto = $activo[0]['monto'] * $porcentaje; //MONTO A DEPRECIAR\n $depreciacion[] = array( \n \"tiempo\" => 0,\n \"depreanual\" => 0,\n \"depreacumulada\" => 0,\n \"valorenlibros\" => $valorlibros,\n \"fecha\" => \"\");\n\n $tipoactivo = null;\n if($activo != null){\n $tipoactivo = $this->obtenerTipoactivo($activo[0]['id_tipoactivo']);\n if($tipoactivo != null){ //INICIO DE IF\n $datos['id'] = $activo[0]['id'];\n $datos['monto'] = $activo[0]['monto'];\n $datos['montodepreciar'] = $monto;\n $datos['vida'] = $tipoactivo[0]['tiempo'];\n $datos['estado'] = $activo[0]['estado'];\n $datos['codigo'] = $activo[0]['codigo'];\n $datos['nombre'] = $activo[0]['descripcion'];\n $datos['tiempousados'] = $activo[0]['tiempo_usado'];\n $datos['fechaadquicicion'] = $activo[0]['fecha'];\n $datos['tangente'] = $activo[0]['tanintan'];\n\n\n //$dias = $this->diasTotalesDepreciacion($activo[0]['fecha'], $tipoactivo[0]['tiempo']);\n $pormeses = $tipoactivo[0]['tiempo'] * 12; \n $montomensual = $monto / $pormeses ;\n $montoanual = $montomensual * 12;\n\n $fechaMes = $activo[0]['fecha'];\n $num = 0; \n for($i = 0 ; $i < $pormeses ; $i++){\n $suma = $suma + $montomensual ;\n\n if(date(\"m\", strtotime($fechaMes)) == 12 || ($pormeses - $i == 1)){\n\n $fechadecierre = $fechaMes;\n $mesfechacierre = date(\"m\", strtotime($fechadecierre));\n\n if($mesfechacierre < 12){\n $fechadecierre = date('Y-m-d', strtotime((12 - $mesfechacierre).\" month\", strtotime($fechadecierre)));\n }\n $diafechacierre = date(\"d\", strtotime($fechadecierre));\n if($diafechacierre < 31){\n $fechadecierre = date('Y-m-d', strtotime((31 - $diafechacierre).\" day\", strtotime($fechadecierre)));\n }\n\n\n $num++;\n $depreacumulada += $suma;\n $valorlibros = $valorlibros-$suma;\n // $valorlibros = number_format($valorlibros,2);\n $depreciacion[] = array( \n \"tiempo\" => $num,\n \"depreanual\" => $montoanual,\n \"depreacumulada\" => number_format($depreacumulada,2),\n \"valorenlibros\" => number_format($valorlibros,2),\n \"fecha\" => $fechadecierre);\n\n $suma = 0;\n } \n $fechaMes = $this->Mes($fechaMes, 1); \n }\n\n }//FIN DE IF\n }\n }\n\n $datos['depreciacion'] = $depreciacion;\n\n return $datos;\n }", "static function formulario1_agregar_nuevo_detalle_de_reembolso($id_de_usuario,$numero_de_documento,$indice_de_reembolso,$numero_de_factura,$fecha_de_factura,$indice_de_establecimiento,$indice_de_servicio_medico,$valor_de_calculo,$subtotal,$valor_no_cubierto,$tipo_de_operacion)\n {\n $saldo_a_cubrir = $subtotal - $valor_no_cubierto;\n\n //OPERACION PARA PORCENTAJES\n if($tipo_de_operacion==2)\n {\n $valor_copago = round(($saldo_a_cubrir - ($saldo_a_cubrir*($valor_de_calculo/100))),2);\n }\n //OPERACON PARA VALOR EN DOLARES\n elseif($tipo_de_operacion==1)\n {\n $valor_copago = $saldo_a_cubrir - $valor_de_calculo;\n }\n else\n {\n $valor_copago = 0;\n }\n\n //EVALUAR SI EL SALDO ES SUFICIENTE PARA LA OPERACION DE REEMBOLSO\n $datos_de_encabezado_de_reembolso= Conexion::conect()->get('encabezado_de_reembolso','*',['indice_de_reembolso'=>$indice_de_reembolso]);\n $saldo_de_usuario = MovimientoDeUsuario::retornar_saldo_de_usuario($datos_de_encabezado_de_reembolso['numero_de_id_de_usuario_fk']);\n if($saldo_de_usuario>=$saldo_a_cubrir)\n {\n if(Conexion::conect()->insert('detalles_de_reembolso',[\n 'indice_de_reembolso_fk'=>$indice_de_reembolso,\n 'numero_de_factura' =>$numero_de_factura,\n 'indice_de_establecimiento_fk'=>$indice_de_establecimiento,\n 'indice_de_servicio_medico_fk'=>$indice_de_servicio_medico,\n 'fecha_de_factura'=>$fecha_de_factura,\n 'subtotal'=>$subtotal,\n 'valor_no_cubierto'=>$valor_no_cubierto,\n 'valor_cubierto'=>$subtotal-$valor_no_cubierto,\n 'valor_copago'=>$valor_copago\n ])){\n Historial::nueva_actividad($id_de_usuario,'REEMBOLSOS','registro de nuevo detalle al reembolso '.$numero_de_documento);\n MovimientoDeUsuario::nuevo_movimiento($datos_de_encabezado_de_reembolso['numero_de_id_de_usuario_fk'],'NUEVA FACTURA AGREGADA A REEMBOLSO',$numero_de_factura,0,$saldo_a_cubrir);\n\n echo \"$(\\\"form\\\").html(\\\"<div class=\\'text-dark-tp3\\'><h3 class=\\'text-success-d1 text-130\\'>Detalle registrado</h3>Factura o detalle registrado exitosamente .</div>\\\")\";\n }\n else\n {\n echo \"$(\\\"form\\\").html(\\\"<div class=\\'text-dark-tp3\\'><h3 class=\\'text-success-d1 text-130\\'>Detalle no registrado</h3>Error al registrar detalle</div>\\\")\";\n }\n }\n else\n {\n echo \"$(\\\"form\\\").html(\\\"<div class=\\'text-dark-tp3\\'><h3 class=\\'text-success-d1 text-130\\'>Detalle no registrado</h3>saldo insuficiente para realizar esta operacion </div>\\\")\";\n }\n }", "public function saveRentabilidad(int $idorden, int $iduser, array $paquete, float $porcentaje, string $tipo_cobro)\n {\n $checkRentabilidad = DB::table('log_rentabilidad')->where([\n ['iduser', '=', $iduser],\n ['idcompra', '=', $idorden],\n ['idproducto', '=', $paquete['idproducto']],\n // ['nivel_minimo_cobro', '=', 0]\n ])->first();\n\n $porc = ($porcentaje / 100);\n $ganado = ($paquete['precio'] * $porc);\n $balance = $ganado;\n $idRentabilidad = 0;\n $finalizado = 0;\n\n // if ($checkRentabilidad == null) {\n // $detallaPaquete = [\n // 'nombre' => $paquete['nombre'],\n // 'img' => $paquete['img2']\n // ];\n // $limite = ($paquete['precio'] * 2);\n // $progreso = (($ganado * 100) / $limite);\n\n // $dataRentabilidad = [\n // 'iduser' => $iduser,\n // 'idcompra' => $idorden,\n // 'idproducto' => $paquete['idproducto'],\n // 'detalles_producto' => json_encode($detallaPaquete),\n // 'precio' => $paquete['precio'],\n // 'limite' => $limite,\n // 'ganado' => $ganado,\n // 'progreso' => $progreso,\n // 'nivel_minimo_cobro' => ($tipo_cobro == 'Manual') ? 7 : 0,\n // ];\n\n // $idRentabilidad = DB::table('log_rentabilidad')->insertGetId($dataRentabilidad);\n if($checkRentabilidad != null){\n\n $totalGanado = ($checkRentabilidad->ganado + $ganado);\n $finalizacion = 0;\n if ($totalGanado >= $checkRentabilidad->limite) {\n if ($checkRentabilidad->ganado < $checkRentabilidad->limite) {\n $totalGanado = $checkRentabilidad->limite;\n $ganado = ($totalGanado - $checkRentabilidad->ganado);\n }else{\n $finalizacion = 1;\n $finalizado = 1;\n }\n }\n if ($finalizacion == 0) { \n $progreso = (($totalGanado / $checkRentabilidad->limite) * 100);\n $balance = ($totalGanado - $checkRentabilidad->retirado);\n $dataRentabilidad = [\n 'ganado' => $totalGanado,\n 'progreso' => $progreso,\n 'nivel_minimo_cobro' => ($tipo_cobro == 'Manual') ? 7 : 0,\n 'balance' => $balance\n ];\n DB::table('log_rentabilidad')->where('id', $checkRentabilidad->id)->update($dataRentabilidad);\n $idRentabilidad = $checkRentabilidad->id;\n\n $user = User::find($iduser);\n $user->wallet_amount = ($user->wallet_amount + $ganado);\n $user->save();\n \n $dataLogRentabilidadPay = [\n 'iduser' => $iduser,\n 'id_log_renta' => $idRentabilidad,\n 'porcentaje' => $porcentaje,\n 'debito' => $ganado,\n 'balance' => $user->wallet_amount,\n 'fecha_pago' => Carbon::now(),\n 'concepto' => 'Rentabilidad pagada de la compra '.$idorden.', del producto '.$paquete['nombre'].', al usuario '.$user->display_name\n ];\n \n $concepto = 'Utilidad ('.$porcentaje.'%)';\n $datosComisions = [\n 'iduser' => $iduser,\n 'usuario' => $user->display_name,\n 'descripcion' => $concepto,\n 'puntos' => 0,\n 'puntosI' => 0,\n 'puntosD' => 0,\n 'email_referred' => $user->user_email,\n 'descuento' => 0,\n 'debito' => $ganado,\n 'credito' => 0,\n 'balance' => $user->wallet_amount,\n 'tipotransacion' => 2\n ];\n // if ($iduser == 1000 || $iduser == 959 || $iduser == 709) {\n // dump($finalizado);\n // }\n if ($finalizado == 0) {\n DB::table('log_rentabilidad_pay')->insert($dataLogRentabilidadPay);\n $this->wallet->saveWallet($datosComisions);\n }\n }\n }\n }", "public function addToCart($idCliente, $codDisco){\r\n\r\n //controllo se l'elemento è già nel carrello\r\n $qta = Carrello::exist($idCliente, $codDisco);\r\n if($qta>0)\r\n {\r\n $query=\"UPDATE `Carrello` SET `quantita`='\". ($qta+1) .\"' WHERE `codDisco` = '\".$codDisco.\"'\";\r\n }\r\n else\r\n {\r\n $qta=1;\r\n $query=\"INSERT INTO `Carrello`(`idCompratore`,`codDisco`,`quantita`) VALUES ('\".$idCliente.\"','\".$codDisco.\"','\".$qta.\"')\";\r\n }\r\n \r\n $mysqli=Database::avviaDatabase();\r\n Database::lanciaQuery($query, $mysqli);\r\n Database::chiudiDatabase($mysqli);\r\n \r\n}", "public function actionEditPrecioUnitario()\r\n {\r\n Yii::import('booster.components.TbEditableSaver');\r\n $es = new TbEditableSaver('DetallePedido');\r\n// /$_cantidad= $es->value;\r\n $es->onBeforeUpdate= function($event) {\r\n\r\n $model=$this->loadModel(yii::app()->request->getParam('pk')); //obteniendo el Model de detalleCompra\r\n $_precioUnitario= yii::app()->request->getParam('value');\r\n $_subtotal=$model->cantidad*$_precioUnitario;//calculando el subtotal\r\n $_impuesto=$_subtotal*((int)Yii::app()->params['impuesto']*0.01); //calculando impuesto\r\n $_total=$_subtotal+$_impuesto; //calculando total\r\n \r\n $event->sender->setAttribute('subtotal', $_subtotal);//Actualizando Cantidad\r\n $event->sender->setAttribute('impuesto', $_impuesto);//Actualizando impuesto\r\n $event->sender->setAttribute('total', $_total); //actualizando total\r\n \r\n };\r\n \r\n $es->update();\r\n }", "public function actualizar_cuadro($cuadro, $total, $habitos, $puntualidad, $evaluacion)\n\t{\n\t\t$this->db->query('UPDATE CUADROS SET total_bloque = '.$total.', habitos_orden = \"'.$habitos.'\", punt_asist = \"'.$puntualidad.'\", evaluacion_bloque = '.$evaluacion.' where id_cuadros = '.$cuadro);\n\t}", "public function calcularTotal(Emissao $contrato)\n {\n $total = 0;\n\n $this->quantidade[] = $contrato;\n\n foreach($this->quantidade as $qtd );\n\n $total += $qtd;\n\n echo $total;\n\n }", "public function UpdateTotalTransaccion($id)\n {\n $Resumen = Transaccion::getTotalDetalleCuentas($id);\n $Transaction = Transaccion::findOrFail($id);\n $Transaction->monto = $Resumen[0]['sumventa']-$Resumen[0]['sumcobro'];\n $Transaction->save();\n }", "function SumBros($tarBroId, $broIdsA, $sumType, $sumA=[]) { # $sumA=[] for a Set summing op with base initialised to false\n global $DiMesA, $yrBrOsA, $BrosThisDataTypeA, $year, $Debug;\n $numDiMesA = array_fill(BroDatT_Start, BroDatT_End, 0); # [ , 0, 0]\n foreach ($broIdsA as $broId) { # thru the Bros that sum to the target $tarBroId\n if (isset($yrBrOsA[$broId])) { # There is data for this $broId. Sum to the target $sumA[]\n foreach ($yrBrOsA[$broId]->SummingBroDatAs() as $amalBroDatKey => $datA) { # [AmalBroDatKey => [0 => Bal, 1 => SrceN]] for the Summing BroDats i.e. excluding the Base one(s) if there are DiMes or Tuple instances, non-Primary ones, and in a Pya year, all non-Pya BroDats. Should only be called for a Non-StartEnd Summing Bro. For Tuples, the Inst # is stripped from the key and same key results wo Inst are summed.\n #echo \"amalBroDatKey |$amalBroDatKey| => [{$datA[0]},{$datA[1]}]<br>\";\n $bal = $datA[0];\n if (isset($sumA[$amalBroDatKey])) {\n $sumA[$amalBroDatKey][0] += $bal;\n if ($Debug) {$sumTypeS = $sumType==BroDatSrce_S ? 'Set' : 'SumEnd'; DebugMsg(\"$sumTypeS Summing year $year $tarBroId,$amalBroDatKey Bal {$sumA[$amalBroDatKey][0]} after adding Bro $broId,$amalBroDatKey bal $bal\");}\n }else{\n if (is_string($amalBroDatKey)) ++$numDiMesA[(int)$amalBroDatKey];\n $sumA[$amalBroDatKey] = [$bal, BroDatSrce_S]; # [BroDatKey => [0 => Bal, 1 => SrceN]]\n if ($Debug) {$sumTypeS = $sumType==BroDatSrce_S ? 'Set' : 'SumEnd'; DebugMsg(\"$sumTypeS Summing year $year $tarBroId,$amalBroDatKey Bal $bal created from Bro $broId,$amalBroDatKey bal $bal\");}\n }\n }\n }\n }\n if (!count($sumA))\n return; # nothing summed\n\n # Got summed data\n # If there a Base sum or sums and there are DiMes involved, then the Base or Bases need adjustment.\n # the target Bro's Mandatory/Default DiMe if it has one, o'wise to DiMeId_Unallocated\n $tarBrO = isset($yrBrOsA[$tarBroId]) ? $yrBrOsA[$tarBroId] : $yrBrOsA[$tarBroId] = new Bro($tarBroId);\n $tarUsableDims = $tarBrO->InfoA[BroI_SumUsableDims];\n if ($tarUsableDims && ($numDiMesA[BroDatT_End] || $numDiMesA[BroDatT_Start])) {\n # Target has Usable Dims and DiMes are involved, so check that that DiMes in the sum are OK for the target's usable dims.\n # have 1 or more DiMe sums\n # First check if target has Group (dimId == 1) but sum has a dim Consol (dimId == 2) balance, and vice versa.\n # which is OK if the DiMe is Consol or Consol.Consol (DiMeIds 3,4) which are the same as Group.Consol or Group (DiMeIds 2,1)\n # and if so change the Consol 3,4 sum to Group 2,1\n if ($tarUsableDims[0]==='1') { # will be first if present as usable dims are sorted\n foreach ($sumA as $amalBroDatKey => $sumDatA) # [0 => Bal, 1 => SrceN]\n if (is_string($amalBroDatKey)) { # only do DiMes i.e. skip StartBase and Base sums\n # '3' -> '2', or 'x,3' -> 'x,2' or 'x,3,y' -> 'x,2,y' and ditto for 4->1 i.e. ref length doesn't change and only 1 char each time\n list($broDatType, $diMeIdsA) = UnpackAmalBroDatKey($amalBroDatKey);\n foreach ($diMeIdsA as $i => $diMeId) # djh?? Only need to check first 2?\n if ($diMeId===3 || $diMeId===4) { # 3 or 4\n $diMeIdsA[$i] = $diMeId===3 ? 2 : 1; # 3->2, 4->1\n $newDatKey = substr($amalBroDatKey,0,2).implode(',', $diMeIdsA);\n if (isset($sumA[$newDatKey]))\n $sumA[$newDatKey][0] += $sumDatA[0];\n else\n $sumA[$newDatKey] = $sumDatA;\n unset($sumA[$amalBroDatKey]);\n if ($Debug) DebugMsg(\"Changed $amalBroDatKey to $newDatKey (Consol to Group re Target Usable Dims of $tarUsableDims\");\n break;\n }\n }\n }else if ($tarUsableDims[0]==='2') { # will be first. Never have both 1 and 2\n # If target has Consol (dimId == 2) but sum has a dim Group (dimId == 1) balance, and vice versa.\n # which is OK if the DiMe is Group.Consol or Group (DiMeIds 2,1) which are the same as Consol or Consol.Consol (DiMeIds 3,4)\n # and if so change the Group 2,1 sum to Consol 3,4\n foreach ($sumA as $amalBroDatKey => $sumDatA) # [0 => Bal, 1 => SrceN]\n # '1' -> '4', or 'x,1' -> 'x,4' or 'x,1,y' -> 'x,4,y' and ditto for 2->3 i.e. ref length doesn't change and only 1 char each time\n if (is_string($amalBroDatKey)) { # only do DiMes i.e. skip StartBase and Base sums\n list($broDatType, $diMeIdsA) = UnpackAmalBroDatKey($amalBroDatKey);\n foreach ($diMeIdsA as $i => $diMeId) # djh?? Only need to check first 2?\n if ($diMeId===1 || $diMeId===2) { # 1 or 2\n $diMeIdsA[$i] = $diMeId===1 ? 4 : 3; # 1->4, 2->3\n $newDatKey = substr($amalBroDatKey,0,2).implode(',', $diMeIdsA);\n if (isset($sumA[$newDatKey]))\n $sumA[$newDatKey][0] += $sumDatA[0];\n else\n $sumA[$newDatKey] = $sumDatA;\n unset($sumA[$amalBroDatKey]);\n if ($Debug) DebugMsg(\"Changed $amalBroDatKey to $newDatKey (Group to Consol re Target Usable Dims of $tarUsableDims\");\n break;\n }\n }\n }\n # Now check the Dim/DiMe use and adjust if necessary\n foreach ($sumA as $amalBroDatKey => $sumDatA) { # [0 => Bal, 1 => SrceN]\n if (is_string($amalBroDatKey)) { # only do DiMes i.e. skip StartBase and Base sums\n list($broDatType, $diMeIdsA) = UnpackAmalBroDatKey($amalBroDatKey);\n foreach ($diMeIdsA as $diMeId)\n if ($diMeId<DiMeId_Unallocated) { # skip the unallocated cases\n $dimId = $DiMesA[$diMeId][DiMeI_DimId];\n if (!InChrList($dimId, $tarUsableDims) && !($broDiMesA && $broDiMesA[II_AllowsA] && in_array($diMeId, $broDiMesA[II_AllowsA]))) {\n if ($sumDatA[0] && IsPrimary($sumDatA[1])) { # skip if zero or not a primary entry but still zap the $sumA entry\n # Not an allowed Dim in Target so -> Unallocated\n $newDatKey = \"$broDatType,\".DiMeId_Unallocated;\n if (isset($sumA[$newDatKey])) {\n $sumA[$newDatKey][0] += $sumDatA[0];\n if ($Debug) DebugMsg(\"$sumTypeS Summing year $year $tarBroId Unallocated Bal {$sumA[$newDatKey][0]} after adding $tarBroId,$amalBroDatKey bal {$sumDatA[0]} as $amalBroDatKey (Dim $dimId) is not available in $tarBroId)\");\n }else{\n $sumA[$newDatKey] = [$sumDatA[0], BroDatSrce_S]; # [0 => Bal, 1 => SrceN]\n ++$numDiMesA[$broDatType];\n if ($Debug) DebugMsg(\"$sumTypeS Summing year $year $tarBroId Unallocated Bal {$sumDatA[0]} created from $tarBroId,$amalBroDatKey as $amalBroDatKey (Dim $dimId) is not available in $tarBroId\");\n }\n }\n unset($sumA[$amalBroDatKey]);\n --$numDiMesA[$broDatType];\n break;\n }\n }\n }\n }\n # Move unallocated entry to Base if that is all that is left\n foreach ([BroDatT_Start, BroDatT_End] as $broDatType) {\n if ($numDiMesA[$broDatType]===1 && isset($sumA[$unallocDatKey = \"$broDatType,\".DiMeId_Unallocated])) {\n $sumA[$broDatType] = [$sumA[$unallocDatKey][0], BroDatSrce_S]; # [0 => Bal, 1 => SrceN]\n if ($Debug) DebugMsg(\"$sumTypeS Summing year $year $tarBroId Base Bal {$sumA[$broDatType][0]} created from all DiMes -> unallocated\");\n unset($sumA[$unallocDatKey]);\n --$numDiMesA[$broDatType];\n }\n }\n }\n # If there are DiMes and Base as can happen from some Bros in the sum being Base only and some with DiMes, move the Base to the default DiMe\n # Really only need to do this here if the default DiMe also has a balance as o'wise Bro::add data could handle the reallocation of Base to default.\n # But as a DefaultDiMeId() call to get the default DiMe is needed anyway, do the switch here to avoid another DefaultDiMeId() call in Bro:add data\n # (If this switch is not done here where there are both Base and default DiMe sums, on a repeat loop Bro::add data replaces the default bal twice -> 2 changes even if final result is as it was before.)\n foreach ([BroDatT_Start, BroDatT_End] as $broDatType) {\n if ($numDiMesA[$broDatType] && isset($sumA[$broDatType])) {\n $defaultDiMeId = $tarBrO->DefaultDiMeId();\n $defaultDatKey = \"$broDatType,$defaultDiMeId\";\n if (isset($sumA[$defaultDatKey])) {\n $sumA[$defaultDatKey][0] += $sumA[$broDatType][0];\n if ($Debug) DebugMsg(\"$sumTypeS Summing year $year $tarBroId Base Bal {$sumA[$broDatType][0]} -> Default DiMe $defaultDiMeId -> bal {$sumA[$defaultDatKey][0]}\");\n }else{\n $sumA[$defaultDatKey] = [$sumA[$broDatType][0], BroDatSrce_S]; # [0 => Bal, 1 => SrceN]\n #++$numDiMesA[$broDatType];\n if ($Debug) DebugMsg(\"$sumTypeS Summing year $year $tarBroId default $defaultDiMeId Bal {$sumA[$broDatType][0]} created from Base\");\n }\n unset($sumA[$broDatType]);\n }\n }\n #if ($Debug && count($sumA)) foreach ($sumA as $amalBroDatKey => $sumDatA) DebugMsg(\"$tarBroId sumA[$amalBroDatKey] Bal = {$sumDatA[0]}\");\n # Add Sum values to $BrosThisDataTypeA and $yrBrOsA\n $BrosThisDataTypeA[$tarBroId] = 1;\n $tarIsSe = $tarBrO->IsStartEnd();\n # echo \"Summing to $tarBroId tarIsSe=$tarIsSe<br>\";\n foreach ($sumA as $amalBroDatKey => $sumDatA) # [0 => Bal, 1 => SrceN]\n if (IsEndAmalBroDatKey($amalBroDatKey) || $tarIsSe) # add data if not Start or Start too if target is StartEnd\n $tarBrO($amalBroDatKey, $sumDatA[0], $sumDatA[1], 0, 0, BroAddDataOp_Replace); # add data ($broDatTypeOrBroDatKey, $dat, $srceN, $inst=0, $diMeIdOrDiMeIdsA=0, $op=BroAddDataOp_Unique)\n}", "public function ActualizarCompras()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codcompra\"]) or empty($_POST[\"fechaemision\"]) or empty($_POST[\"fecharecepcion\"]) or empty($_POST[\"codproveedor\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\tif (limpiar(isset($_POST['fechavencecredito']))) { \n\n\t\t$fechaactual = date(\"Y-m-d\");\n\t\t$fechavence = date(\"Y-m-d\",strtotime($_POST['fechavencecredito']));\n\t\t\n\t if (strtotime($fechavence) < strtotime($fechaactual)) {\n\t \n\t echo \"2\";\n\t\t exit;\n\t \n\t }\n }\n\n\t\tfor($i=0;$i<count($_POST['coddetallecompra']);$i++){ //recorro el array\n\t if (!empty($_POST['coddetallecompra'][$i])) {\n\n\t\t if($_POST['cantcompra'][$i]==0){\n\n\t\t\t echo \"3\";\n\t\t\t exit();\n\n\t\t }\n\t }\n }\n\n $this->dbh->beginTransaction();\n\n for($i=0;$i<count($_POST['coddetallecompra']);$i++){ //recorro el array\n\t if (!empty($_POST['coddetallecompra'][$i])) {\n\n\t$sql = \"SELECT cantcompra FROM detallecompras WHERE coddetallecompra = '\".limpiar($_POST['coddetallecompra'][$i]).\"' AND codcompra = '\".limpiar($_POST[\"codcompra\"]).\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t\n\t\t$cantidadbd = $row['cantcompra'];\n\n\t\tif($cantidadbd != $_POST['cantcompra'][$i]){\n\n\t\t\t$query = \"UPDATE detallecompras set\"\n\t\t\t.\" cantcompra = ?, \"\n\t\t\t.\" valortotal = ?, \"\n\t\t\t.\" totaldescuentoc = ?, \"\n\t\t\t.\" valorneto = ? \"\n\t\t\t.\" WHERE \"\n\t\t\t.\" coddetallecompra = ? AND codcompra = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $cantcompra);\n\t\t\t$stmt->bindParam(2, $valortotal);\n\t\t\t$stmt->bindParam(3, $totaldescuento);\n\t\t\t$stmt->bindParam(4, $valorneto);\n\t\t\t$stmt->bindParam(5, $coddetallecompra);\n\t\t\t$stmt->bindParam(6, $codcompra);\n\n\t\t\t$cantcompra = limpiar(number_format($_POST['cantcompra'][$i], 2, '.', ''));\n\t\t\t$preciocompra = limpiar($_POST['preciocompra'][$i]);\n\t\t\t$precioventa = limpiar($_POST['precioventa'][$i]);\n\t\t\t$ivaproducto = limpiar($_POST['ivaproducto'][$i]);\n\t\t\t$descuento = limpiar($_POST['descfactura'][$i]/100);\n\t\t\t$valortotal = number_format($_POST['preciocompra'][$i] * $_POST['cantcompra'][$i], 2, '.', '');\n\t\t\t$totaldescuento = number_format($valortotal * $descuento, 2, '.', '');\n\t\t\t$valorneto = number_format($valortotal - $totaldescuento, 2, '.', '');\n\t\t\t$coddetallecompra = limpiar($_POST['coddetallecompra'][$i]);\n\t\t\t$codcompra = limpiar($_POST[\"codcompra\"]);\n\t\t\t$stmt->execute();\n\n\n\tif(limpiar($_POST['tipoentrada'][$i])==\"PRODUCTO\"){\n\n\t\t\t$sql = \"SELECT existencia FROM productos WHERE codproducto = '\".limpiar($_POST['codproducto'][$i]).\"'\";\n\t\t foreach ($this->dbh->query($sql) as $row)\n\t\t {\n\t\t\t$this->p[] = $row;\n\t\t }\n\t\t $existenciaproductobd = $row['existencia'];\n\t\t $cantcompra = $_POST[\"cantcompra\"][$i];\n\t\t $cantidadcomprabd = $_POST[\"cantidadcomprabd\"][$i];\n\t\t $totalcompra = $cantcompra-$cantidadcomprabd;\n\n\t\t ############ ACTUALIZAMOS EXISTENCIA DEL PRODUCTO EN ALMACEN ################\n\t\t $sql2 = \" UPDATE productos set \"\n\t\t .\" existencia = ? \"\n\t\t .\" WHERE \"\n\t\t .\" codproducto = '\".limpiar($_POST[\"codproducto\"][$i]).\"';\n\t\t \";\n\t\t $stmt = $this->dbh->prepare($sql2);\n\t\t $stmt->bindParam(1, $existencia);\n\t\t $existencia = limpiar(number_format($existenciaproductobd+$totalcompra, 2, '.', ''));\n\t\t $stmt->execute();\n\n\t\t ############## ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN KARDEX ###################\n\t\t $sql3 = \" UPDATE kardex set \"\n\t\t .\" entradas = ?, \"\n\t\t .\" stockactual = ? \"\n\t\t .\" WHERE \"\n\t\t .\" codproceso = '\".limpiar($_POST[\"codcompra\"]).\"' and codproducto = '\".limpiar($_POST[\"codproducto\"][$i]).\"';\n\t\t \";\n\t\t $stmt = $this->dbh->prepare($sql3);\n\t\t $stmt->bindParam(1, $entradas);\n\t\t $stmt->bindParam(2, $existencia);\n\n\t\t $entradas = limpiar(number_format($_POST[\"cantcompra\"][$i], 2, '.', ''));\n\t\t $existencia = limpiar(number_format($existenciaproductobd+$totalcompra, 2, '.', ''));\n\t\t $stmt->execute();\n\n\t\t} else {\n\n\t\t ############### VERIFICO LA EXISTENCIA DEL INGREDIENTE EN ALMACEN ################\t\n\t\t\t$sql = \"SELECT cantingrediente FROM ingredientes WHERE empresa = \".$_SESSION[\"empresa\"].\" AND codingrediente = '\".limpiar($_POST['codproducto'][$i]).\"'\";\n\t\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\t$existenciaingredientebd = $row['cantingrediente'];\n\t\t\t$cantcompra = $_POST[\"cantcompra\"][$i];\n\t\t\t$cantidadcomprabd = $_POST[\"cantidadcomprabd\"][$i];\n\t\t\t$totalcompra = $cantcompra-$cantidadcomprabd;\n\n\t\t ############ ACTUALIZAMOS EXISTENCIA DEL INGREDIENTE EN ALMACEN ################\n\t\t\t$sql2 = \" UPDATE ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" WHERE \"\n\t\t\t.\" codingrediente = '\".limpiar($_POST[\"codproducto\"][$i]).\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->bindParam(1, $cantingrediente);\n\t\t\t$cantingrediente = limpiar(number_format($existenciaingredientebd+$totalcompra, 2, '.', ''));\n\t\t\t$stmt->execute();\n\n\t\t############## ACTUALIZAMOS LOS DATOS DEL INSUMOS EN KARDEX ###################\n\t\t\t$sql3 = \" UPDATE kardex_ingredientes set \"\n\t\t\t.\" entradas = ?, \"\n\t\t\t.\" stockactual = ? \"\n\t\t\t.\" WHERE \"\n\t\t\t.\" codproceso = '\".limpiar($_POST[\"codcompra\"]).\"' and codingrediente = '\".limpiar($_POST[\"codproducto\"][$i]).\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t\t$stmt->bindParam(1, $entradas);\n\t\t\t$stmt->bindParam(2, $cantingrediente);\n\n\t\t\t$entradas = limpiar(number_format($_POST[\"cantcompra\"][$i], 2, '.', ''));\n\t\t\t$cantingrediente = limpiar(number_format($existenciaingredientebd+$totalcompra, 2, '.', ''));\n\t\t\t$stmt->execute();\n\n\t\t}\n\n\n\t\t\t} else {\n\n echo \"\";\n\n\t\t }\n\t }\n }\n\n $this->dbh->commit();\n\n ############ SUMO LOS IMPORTE DE PRODUCTOS CON IVA ##############\n\t\t\t$sql3 = \"SELECT SUM(valorneto) AS valorneto FROM detallecompras WHERE codcompra = '\".limpiar($_POST[\"codcompra\"]).\"' AND ivaproductoc = 'SI'\";\n\t\t\tforeach ($this->dbh->query($sql3) as $row3)\n\t\t\t{\n\t\t\t\t$this->p[] = $row3;\n\t\t\t}\n\t\t\t$subtotalivasic = ($row3['valorneto']== \"\" ? \"0.00\" : $row3['valorneto']);\n\n\t\t ############ SUMO LOS IMPORTE DE PRODUCTOS SIN IVA ##############\n\t\t\t$sql4 = \"SELECT SUM(valorneto) AS valorneto FROM detallecompras WHERE codcompra = '\".limpiar($_POST[\"codcompra\"]).\"' AND ivaproductoc = 'NO'\";\n\t\t\tforeach ($this->dbh->query($sql4) as $row4)\n\t\t\t{\n\t\t\t\t$this->p[] = $row4;\n\t\t\t}\n\t\t\t$subtotalivanoc = ($row4['valorneto']== \"\" ? \"0.00\" : $row4['valorneto']);\n\n ############ ACTUALIZO LOS TOTALES EN LA COTIZACION ##############\n\t\t\t$sql = \" UPDATE compras SET \"\n\t\t\t.\" codproveedor = ?, \"\n\t\t\t.\" subtotalivasic = ?, \"\n\t\t\t.\" subtotalivanoc = ?, \"\n\t\t\t.\" totalivac = ?, \"\n\t\t\t.\" descuentoc = ?, \"\n\t\t\t.\" totaldescuentoc = ?, \"\n\t\t\t.\" totalpagoc = ?, \"\n\t\t\t.\" tipocompra = ?, \"\n\t\t\t.\" formacompra = ?, \"\n\t\t\t.\" fechavencecredito = ?, \"\n\t\t\t.\" fechaemision = ?, \"\n\t\t\t.\" fecharecepcion = ? \"\n\t\t\t.\" WHERE \"\n\t\t\t.\" codcompra = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $codproveedor);\n\t\t\t$stmt->bindParam(2, $subtotalivasic);\n\t\t\t$stmt->bindParam(3, $subtotalivanoc);\n\t\t\t$stmt->bindParam(4, $totalivac);\n\t\t\t$stmt->bindParam(5, $descuentoc);\n\t\t\t$stmt->bindParam(6, $totaldescuentoc);\n\t\t\t$stmt->bindParam(7, $totalpagoc);\n\t\t\t$stmt->bindParam(8, $tipocompra);\n\t\t\t$stmt->bindParam(9, $formacompra);\n\t\t\t$stmt->bindParam(10, $fechavencecredito);\n\t\t\t$stmt->bindParam(11, $fechaemision);\n\t\t\t$stmt->bindParam(12, $fecharecepcion);\n\t\t\t$stmt->bindParam(13, $codcompra);\n\n\t\t\t$codproveedor = limpiar($_POST[\"codproveedor\"]);\n\t\t\t$ivac = $_POST[\"iva\"]/100;\n\t\t\t$totalivac = number_format($subtotalivasic*$ivac, 2, '.', '');\n\t\t\t$descuentoc = limpiar($_POST[\"descuento\"]);\n\t\t $txtDescuento = $_POST[\"descuento\"]/100;\n\t\t $total = number_format($subtotalivasic+$subtotalivanoc+$totalivac, 2, '.', '');\n\t\t $totaldescuentoc = number_format($total*$txtDescuento, 2, '.', '');\n\t\t $totalpagoc = number_format($total-$totaldescuentoc, 2, '.', '');\n\n\t\t\t$tipocompra = limpiar($_POST[\"tipocompra\"]);\n\t\t\tif (limpiar($_POST[\"tipocompra\"]==\"CONTADO\")) { $formacompra = limpiar($_POST[\"formacompra\"]); } else { $formacompra = \"CREDITO\"; }\n\t\t\tif (limpiar($_POST[\"tipocompra\"]==\"CREDITO\")) { $fechavencecredito = limpiar(date(\"Y-m-d\",strtotime($_POST['fechavencecredito']))); } else { $fechavencecredito = \"0000-00-00\"; }\n\t\t\tif (limpiar($_POST[\"tipocompra\"]==\"CONTADO\")) { $statuscompra = limpiar(\"PAGADA\"); } else { $statuscompra = \"PENDIENTE\"; }\n\t\t\t\n\t\t\t$fechaemision = limpiar(date(\"Y-m-d\",strtotime($_POST['fechaemision'])));\n\t\t\t$fecharecepcion = limpiar(date(\"Y-m-d\",strtotime($_POST['fecharecepcion'])));\n\t\t\t$codcompra = limpiar($_POST[\"codcompra\"]);\n\t\t\t$stmt->execute();\n\n\necho \"<span class='fa fa-check-square-o'></span> LA COMPRA DE PRODUCTOS E INGREDIENTES HA SIDO ACTUALIZADA EXITOSAMENTE <a href='reportepdf?codcompra=\".encrypt($codcompra).\"&tipo=\".encrypt(\"FACTURACOMPRA\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Documento' target='_black' rel='noopener noreferrer'><font color='black'><strong>IMPRIMIR REPORTE</strong></font color></a></div>\";\n\texit;\n}", "function ActualizaJornadas ( $sContrato, $sNumeroOrden ,$dIdFecha) \n{\n // Proceso correcto para el calculo de los tiempos muertos ...\n // Tiempos involucrados en todo el contrato\n // Solo reportes diarios con turno diferente a Tierra\n // Total de Personal del Dia por Contrato (Excluye Turnos en Tierra)\n\t $iPersonalTotal = 0 ;\n\t $sql =\"SELECT SUM(b.dCantidad) as dTotal \n\t \t\t FROM bitacoradepersonal b \n\t\t\t INNER JOIN bitacoradeactividades b2 ON (b.sContrato = b2.sContrato And b.dIdFecha = b2.dIdFecha and b.iIdDiario = b2.iIdDiario) \n INNER JOIN turnos t ON (b2.sContrato = t.sContrato And b2.sIdTurno = t.sIdTurno And t.sOrigenTierra = 'No')\n WHERE b.sContrato = '$sContrato' And b.dIdFecha = '$dIdFecha' Group By b2.sContrato\";\n\n\t $result = mysql_query($sql);\n\t if(mysql_error())mensaje(\"26: \".mysql_error());\n If ($row = mysql_fetch_array($result))\n $iPersonalTotal = $row['dTotal'] ;\n\n\t$sql = \"SELECT r.sNumeroOrden, r.dIdFecha, r.sIdTurno, r.sTiempoMuerto, r.iPersonal \n\t \t\t\tFROM reportediario r \n\t\t\t\tINNER JOIN turnos t ON (r.sContrato = t.sContrato And r.sIdTurno = t.sIdTurno And t.sOrigenTierra = 'No')\n WHERE r.sContrato = '$sContrato' And r.dIdFecha = '$dIdFecha' \";\n $result = mysql_query($sql);\n if(mysql_error())mensaje(\"27: \".mysql_error());\n While ($row = mysql_fetch_array($result))\n {\n If ($iPersonalTotal == 0)\n $sMuertoReal = sTiempoMuertoIri( $row['sTiempoMuerto'] , 1 , 1, 1 );\n Else\n $sMuertoReal = sTiempoMuertoIri( $row['sTiempoMuerto'] , $iPersonalTotal , $row['iPersonal'], 1 ) ;\n \n\t\t\t$sql = \"UPDATE reportediario SET sTiempoMuertoReal = '$sMuertoReal' \n\t\t\t\t\t WHERE sContrato = '$sContrato' And sNumeroOrden = '\".$row['sNumeroOrden'].\"' And dIdFecha = '\".$row['dIdFecha'].\"' \n\t\t\t\t\t And sIdTurno = '\".$row['sIdTurno'].\"' \";\n\t\t\tmysql_query($sql);\n\t\t\tif(mysql_error())mensaje(\"28: \".mysql_error());\n }\n}", "protected function doAddition() {\n\n }", "public function rep_cuadro_modificacion_poa($dist_id,$tp_id){\n $trimestre = array('1' => '3','2' => '6','3' => '9','4' => '12'); \n $data['distrital']=$this->model_proyecto->dep_dist($dist_id);\n $data['mes'] = $this->mes_nombre();\n $unidades=$this->mrep_operaciones->list_unidades($dist_id,$tp_id);\n if(count($data['distrital'])!=0){\n $titulo='GASTO CORRIENTE';\n if($tp_id==1){\n $titulo='PROYECTO DE INVERSI&Oacute;N';\n }\n\n $tabla='';\n $sum_ope=0;$sum_req=0;$sum_total=0;\n $tabla.='\n <table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.2 style=\"width:100%;\" align=center>\n <thead>\n <tr>\n <th style=\"width:7%; height:16px;\" align=center></th>';\n for ($i=1; $i <=$trimestre[$this->tmes]; $i++) { \n $mes=$this->get_mes($i);\n $tabla.='<th style=\"width:7%;\" align=center>'.$mes[1].'</th>';\n }\n $tabla.='\n <th style=\"width:7%;\" align=center>TOTAL</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td style=\"height:15px;\">OPERACIONES</td>';\n for ($i=1; $i <=$trimestre[$this->tmes]; $i++) {\n $num_ope=$this->nro_mod_operaciones($dist_id,$i,$tp_id);\n $tabla.='<td align=right>'.$num_ope.'</td>'; /// Operaciones\n $sum_ope=$sum_ope+$num_ope;\n }\n $tabla.='\n <td align=right bgcolor=\"#c8eff5\"><b>'.$sum_ope.'</b></td>\n </tr>\n <tr>\n <td style=\"height:15px;\">REQUERIMIENTOS</td>';\n for ($i=1; $i <=$trimestre[$this->tmes]; $i++) {\n $num_req=$this->nro_mod_requerimientos($dist_id,$i,$tp_id);\n $tabla.='<td align=right>'.$num_req.'</td>'; /// Requerimientos\n $sum_req=$sum_req+$num_req;\n }\n $tabla.='\n <td align=right bgcolor=\"#c8eff5\"><b>'.$sum_req.'</b></td>\n </tr>\n </tbody>\n </table>';\n\n $data['lista']=$tabla;\n $data['titulo_reporte']='CUADRO MODIFICACIONES POA '.$this->gestion.' (de 01/'.$this->gestion.' al '.$trimestre[$this->tmes].'/'.$this->gestion.')';\n $data['titulo_pie']='Modificaciones_POA_'.$data['distrital'][0]['dist_distrital'].'_'.$this->gestion.'';\n $this->load->view('admin/reportes_cns/resumen_operaciones/reporte_modificacion_poa', $data);\n }\n else{\n echo \"Error !!!\";\n }\n }", "function total_monto(){\n\t\tif(isset($_SESSION['carro']) && $_SESSION['carro']!=\"\"){\n\t\t\t$carro_size=count($_SESSION['carro']);\n\t\t\tif($carro_size<=0){\n\t\t\t\t$this->numero=0;\n\t\t\t\t$this->total=0;\n\t\t\t\t$this->descuento=0;\n\t\t\t}else{\n\t\t\t\t$this->numero=0;\n\t\t\t\t$this->total=0;\n\t\t\t\t$this->descuento=0;\n\t\t\t\t$total_detal=0;\n\t\t\t\t$total_mayor=0;\n\t\t\t\tforeach($_SESSION['carro'] as $valor => $indice){\n\t\t\t\t\t$this->numero = $this->numero+$_SESSION['carro'][$valor]['cantidad'];\n\t\t\t\t\t$total_detal = $total_detal+($_SESSION['carro'][$valor]['precio_det']*$_SESSION['carro'][$valor]['cantidad']);\n\t\t\t\t\t$total_mayor = $total_mayor+($_SESSION['carro'][$valor]['precio_may']*$_SESSION['carro'][$valor]['cantidad']);\n\t\t\t\t}\n\t\t\t\tif($this->numero>=100){\n\t\t\t\t\t$this->total=$total_mayor;\n\t\t\t\t\t$this->descuento=0;\n\t\t\t\t\t$this->ahorro=$total_detal-$total_mayor;\n\t\t\t\t}else if($this->numero>=100 && $this->numero<=101){\n\t\t\t\t\t$this->total=$total_detal;\n\t\t\t\t\t$this->descuento=$total_detal*0.10;\n\t\t\t\t}else{\n\t\t\t\t\t$this->total=$total_detal;\n\t\t\t\t\t$this->descuento=0;\n\t\t\t\t}\n\t\t\t\t/* for($i=0;$i<=$carro_size-1;$i++){\n\t\t\t\t\t$this->numero = $this->numero+$_SESSION['carro'][$i]['cantidad'];\n\t\t\t\t\t$this->total = $this->total+($_SESSION['carro'][$i]['precio']*$_SESSION['carro'][$i]['cantidad']);\n\t\t\t\t} */\n\t\t\t}\n\t\t}else{\n\t\t\t$this->numero=0;\n\t\t\t$this->total=0;\n\t\t\t$this->descuento=0;\n\t\t}\n\t}", "public static function saveSum($session_id, $sum) {\n \t$payment = self::findBySessionId($session_id);\n \tif(is_object($payment)) {\n\t \t$payment->Sum = $sum;\n\t \t$payment->Date = new CDbExpression(\"NOW()\");\n\t \t$payment->save();\n \t}\n }", "private function aumentarFolio($documento){\n\t\t$this->db->prepare(\n\t\t\"\n \tUPDATE folios SET folio=folio+1 where id_documento=$documento;\n\t\t\"\n\t\t);\n\t\t$this->db->query();\n\t}", "public function payBonus()\n {\n $compras = $this->funciones->getAllCompras();\n $this->bonoDirecto($compras);\n $this->bonoIndirecto($compras);\n $this->puntosBinarios($compras);\n // $this->puntosRangos();\n }", "function incrementarMonto($numeroMes, $tikets, $precio, $cantidad)\n{\n $montoNuevo = $cantidad * $precio; //dinero recolectado por el nuevo juego en ese mes\n $tikets[$numeroMes] = $tikets[$numeroMes] + $montoNuevo;\n return $tikets;\n}", "public static function actualizar_registro_pago( $total_nota, $factura, $nota, $accion )\n {\n\n // total_nota es negativo cuando se hace la nota y positivo cuando se anula\n\n $movimiento_cxc = CxcMovimiento::where('core_tipo_transaccion_id', $factura->core_tipo_transaccion_id)\n ->where('core_tipo_doc_app_id', $factura->core_tipo_doc_app_id)\n ->where('consecutivo', $factura->consecutivo)\n ->get()\n ->first();\n\n $nuevo_total_pendiente = $movimiento_cxc->saldo_pendiente + $total_nota; \n $nuevo_total_pagado = $movimiento_cxc->valor_pagado - $total_nota;\n\n $estado = 'Pendiente';\n if ( $nuevo_total_pendiente == 0)\n {\n $estado = 'Pagado';\n }\n\n $movimiento_cxc->update( [ \n 'valor_pagado' => $nuevo_total_pagado,\n 'saldo_pendiente' => $nuevo_total_pendiente,\n 'estado' => $estado\n ] );\n\n $datos = ['core_tipo_transaccion_id' => $nota->core_tipo_transaccion_id]+\n ['core_tipo_doc_app_id' => $nota->core_tipo_doc_app_id]+\n ['consecutivo' => $nota->consecutivo]+\n ['fecha' => $nota->fecha]+\n ['core_empresa_id' => $nota->core_empresa_id]+\n ['core_tercero_id' => $nota->core_tercero_id]+\n ['modelo_referencia_tercero_index' => 'App\\Ventas\\Cliente']+\n ['referencia_tercero_id' => $factura->cliente_id]+\n ['doc_cxc_transacc_id' => $factura->core_tipo_transaccion_id]+\n ['doc_cxc_tipo_doc_id' => $factura->core_tipo_doc_app_id]+\n ['doc_cxc_consecutivo' => $factura->consecutivo]+\n ['doc_cruce_transacc_id' => 0]+\n ['doc_cruce_tipo_doc_id' => 0]+\n ['doc_cruce_consecutivo' => 0]+\n ['abono' => abs($total_nota)]+\n ['creado_por' => $nota->creado_por];\n\n if ( $accion == 'crear')\n {\n // Almacenar registro de abono\n CxcAbono::create( $datos );\n }else{\n // Eliminar registro de abono\n CxcAbono::where( $datos )->delete();\n }\n }", "function updateAmount()\n\t{\n\t\tglobal $conf;\n\n\t\t$this->errno = 0;\n\t\t$this->db->begin();\n\t\t$total = 0;\n\t\t$nb = 0;\n\t\t$sql = \"SELECT amount \";\n\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"bank\";\n\t\t$sql.= \" WHERE fk_bordereau = \".$this->id;\n\n\t\t$resql = $this->db->query($sql);\n\t\tif ( $resql )\n\t\t{\n\t\t\twhile ( $row = $this->db->fetch_row($resql) )\n\t\t\t{\n\t\t\t\t$total += $row[0];\n\t\t\t\t$nb++;\n\t\t\t}\n\n\t\t\t$this->db->free($resql);\n\n\t\t\t$sql = \"UPDATE \".MAIN_DB_PREFIX.\"bordereau_cheque\";\n\t\t\t$sql.= \" SET amount = '\".price2num($total).\"'\";\n\t\t\t$sql.= \", nbcheque = \".$nb;\n\t\t\t$sql.= \" WHERE rowid = \".$this->id;\n\t\t\t$sql.= \" AND entity = \".$conf->entity;\n\n\t\t\t$resql = $this->db->query($sql);\n\t\t\tif (!$resql)\n\t\t\t{\n\t\t\t\t$this->errno = -1030;\n\t\t\t\tdol_syslog(get_class($this).\"::updateAmount ERREUR UPDATE ($this->errno)\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errno = -1031;\n\t\t\tdol_syslog(get_class($this).\"::updateAmount ERREUR SELECT ($this->errno)\");\n\t\t}\n\n\t\tif ($this->errno === 0)\n\t\t{\n\t\t\t$this->db->commit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->rollback();\n\t\t\tdol_syslog(get_class($this).\"::updateAmount ROLLBACK ($this->errno)\");\n\t\t}\n\n\t\treturn $this->errno;\n\t}", "public function incrementaSalvataggi(){\n \t$this->nsalvataggi++;\n }", "function evaluaRangos($datosEstudiante) { \n $planEstudiante=$datosEstudiante['planEstudioEstudiante']; \n $this->parametrosPlan=$this->parametros_plan($planEstudiante);\n \n $totalCreditos=$this->parametrosPlan[0]['parametro_creditosPlan'];\n $OB= $this->parametrosPlan[0]['parametros_OB'];\n $OC= $this->parametrosPlan[0]['parametros_OC'];\n $EI= $this->parametrosPlan[0]['parametros_EI'];\n $EE= $this->parametrosPlan[0]['parametros_EE'];\n $CP= $this->parametrosPlan[0]['parametros_CP'];\n if(is_array($this->espaciosAprobados))\n {\n $OBEst=0;\n $OCEst=0;\n $EIEst=0;\n $EEEst=0;\n $CPEst=0;\n $totalCreditosEst=0;\n $numeroAprobados=count($this->espaciosAprobados);\n for($i=0;$i<$numeroAprobados; $i++)\n {\n $idEspacio=(isset($this->espaciosAprobados[$i])?$this->espaciosAprobados[$i]:'');\n foreach ($this->espaciosCursados as $value) {\n if ($value['CODIGO']==$idEspacio){\n $registroCreditosEspacio=$value;\n }\n }\n if (isset($registroCreditosEspacio['CLASIFICACION']))\n {\n switch($registroCreditosEspacio['CLASIFICACION'])\n {\n case '1':\n $OBEst=$OBEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case '2':\n $OCEst=$OCEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case '3':\n $EIEst=$EIEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case '4':\n $EEEst=$EEEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case '5':\n $CPEst=$CPEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n }\n }\n }\n }\n if(is_array($this->espaciosInscritos)){\n $numeroInscritos=count($this->espaciosInscritos);\n for($i=0;$i<$numeroInscritos;$i++) {\n $codEspacio=(isset($this->espaciosInscritos[$i])?$this->espaciosInscritos[$i]:'');\n foreach ($this->espaciosPlan as $value) {\n if ($value['CODIGO']==$codEspacio){\n $registroCreditosEspacio=$value;\n }else\n {\n $registroCreditosEspacio='';\n }\n }\n if(is_array($registroCreditosEspacio)) {\n switch($registroCreditosEspacio['CLASIFICACION'])\n {\n case 'OB':\n $OBEst=$OBEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case 'OC':\n $OCEst=$OCEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case 'EI':\n $EIEst=$EIEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case 'EE':\n $EEEst=$EEEst+$registroCreditosEspacio['CREDITOS'];\n break;\n\n case 'CP':\n $CPEst=$CPEst+$registroCreditosEspacio['CREDITOS'];\n break;\n }\n }\n }\n }\n return array($OBEst, $OCEst, $EIEst, $EEEst, $CPEst, $OB, $OC, $EI, $EE, $CP);\n\n }", "private static function SaveGastoAndAccumulateAmount($uf, $montoGasto, $idGastoLiquidacion){\n\t\t$monto = NumHelper::NumFormat($montoGasto);\n\t\tself::InsertGastoExpensa($uf, $monto, $idGastoLiquidacion);\n\t\tforeach (self::$arrLiquidaciones as $liquidacion){\n\t\t\tif($liquidacion->idUF == $uf->id){\n\t\t\t\t$liquidacion->monto += self::CheckContractTax($uf, $monto);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function store(AbonosRequest $request,Creditos $creditos )\n {\n \n \n $abonos = Abonos::create($request->all());\n\n // Lo que debe el Cliente tot_actual\n\n //obtengo el id del credito por medio del arrego en el request\n $id = $request->creditos_id;\n\n // Suma de Todos los abonos normales \n $sumnormal = Abonos::where('creditos_id', '=', $id)->where('tipo_cuota', '=', 1)->sum('cuota');\n // Suma de Todos los abonos interes\n $suminter = Abonos::where('creditos_id', '=', $id)->where('tipo_cuota', '=', 2)->sum('cuota');\n\n\n // Capital Actual utilidad_act\n $capitala = Creditos::where('id', '=', $id)->value('capital');\n\n $capactual = $capitala-$sumnormal;\n\n $capitalb = 0;\n $totalabonos = $sumnormal; \n\n if ($capactual>0)\n {\n $capitalb = $capactual;\n }\n elseif($capactual<=0)\n {\n $capitalb = 0; \n }\n\n // Utilidad Actual utilidad_act\n\n $util = $sumnormal-$capitala;\n\n $util_act = 0; \n\n if ($util<=0)\n {\n $util_act = 0;\n }\n elseif($util>0)\n {\n $util_act = $util; \n }\n\n // sumo a utilidad de forma directa abonos a utilidad \n\n $utilabo = $util_act + $suminter;\n\n // sumo a total sum_abonos\n\n //suma total normal y interes\n\n $sumnyi = $sumnormal + $suminter;\n\n\n\n \n\n // Total debe: tot_actual\n $tot_actual = Creditos::where('id', '=', $id)->value('total');\n\n $tota = $tot_actual-$sumnormal;\n\n $debe_act = 0; \n\n if ($tota<0)\n {\n $debe_act = 0;\n }\n elseif($tota>=0)\n {\n $debe_act = $tota; \n }\n\n //resto a tot_actual las cuotas de solo interes (pendiente)\n\n $totactual = $debe_act - $suminter;\n\n\n\n //actualizo el valor en la tabla creditos \n $creditoactual = Creditos::find($id);\n $creditoactual->sum_abonos = $sumnyi;\n $creditoactual->cap_actual = $capitalb;\n $creditoactual->utilidad_act = $utilabo;\n $creditoactual->tot_actual = $totactual;\n $creditoactual->save();\n\n \n return redirect()->route('abonos.index', ['id' => $id])\n ->with('info', 'Abono Nuevo creado con éxito');\n\n \n\n }", "function set_total($camp,$pos,$tam=0,$alinea=\"\",$borde=0,$fillColor=0,$tfuen,$estilo=\"\",$valor=0){\n\n\t\t$this->totales[]=array('campo'=>$camp,'pos'=>$pos,\n\t\t\t\t\t\t\t\t\"ancho\"=>$tam,'alinea'=>$alinea,'tfuente'=>$tfuen,\n\t\t\t\t\t\t\t\t'estilo'=>$estilo,'borde'=>$borde,'relleno'=>$fillColor,\n\t\t\t\t\t\t\t\t'valor'=>$valor);\n\t}", "public function sendboradiary()\n {\n $todaydate = date('Y-m-d');\n $todaydate = strtotime($todaydate) - 3600*24;\n $todaydate = date('Y-m-d',$todaydate);\n $medicine = array('Pitavol' => 0 , \n 'Denset' => 0 , \n 'Lepax10' => 0 , \n 'Lepax5' => 0 , \n 'Lexapro' => 0 , \n 'Ebixa' => 0 , \n 'Deanxit' => 0 , \n 'LendorminBora' => 0 , \n 'Lendorminann' => 0 ,\n 'Wilcon' => 0 ,\n 'Kso' => 0 ,\n 'Bpn' => 0,\n 'Others' => 0,\n );\n\n $itemno = array( 'Pitavol' => null , \n 'Denset' => null , \n 'Lepax10' => null , \n 'Lepax5' => null , \n 'Lexapro' => null , \n 'Ebixa' => null , \n 'Deanxit' => null , \n 'LendorminBora' => null , \n 'Lendorminann' => null ,\n 'Wilcon' => null ,\n 'Kso' => null ,\n 'Bpn' => null,\n 'Others' => null,\n );\n\n $qtys = array( 'Pitavol' => 0 , \n 'Denset' => 0 , \n 'Lepax10' => 0 , \n 'Lepax5' => 0 , \n 'Lexapro' => 0 , \n 'Ebixa' => 0 , \n 'Deanxit' => 0 , \n 'LendorminBora' => 0 , \n 'Lendorminann' => 0 ,\n 'Wilcon' => 0 ,\n 'Kso' => 0 ,\n 'Bpn' => 0,\n 'Others' => 0,\n );\n $total = 0; \n $yearstart = substr($todaydate, 0,5).'01-01';//依照選擇的日期轉換每月年年初 \n $monthstart = substr($todaydate, 0,8).'01';//依照選擇的日期轉換每月月初 \n $chardate = str_replace('-','',$todaydate);\n $dailyreportstable = dailyreport::where('InvDate','=',$todaydate)->get();\n foreach ($dailyreportstable as $dailyreport) {\n $BORAItemNo = $dailyreport->BORAItemNo;\n $dailysell = $dailyreport->InoviceAmt;\n $qty = $dailyreport->OrderQty; \n $BORACustomerNo = $dailyreport->BORACustomerNo; \n $SaleType = $dailyreport->SaleType;\n switch ($BORAItemNo) {\n case '68PTV001':\n //10824 = 和安\n if ($BORACustomerNo<>'10824') {\n $medicine['Pitavol'] = $medicine['Pitavol'] + $dailysell;\n $qtys['Pitavol'] = $qtys['Pitavol'] + $qty ; \n $itemno['Pitavol'] = $BORAItemNo;\n } \n break;\n case '68DEN001':\n if ($BORACustomerNo<>'10824') {\n $medicine['Denset'] = $medicine['Denset'] + $dailysell ;\n $qtys['Denset'] = $qtys['Denset'] + $qty ; \n $itemno['Denset'] = $BORAItemNo;\n } \n break;\n case '68LEP002':\n $medicine['Lepax10'] = $medicine['Lepax10'] + $dailysell ;\n $qtys['Lepax10'] = $qtys['Lepax10'] + $qty ; \n $itemno['Lepax10'] = $BORAItemNo;\n break;\n case '68LEP001':\n $medicine['Lepax5'] = $medicine['Lepax5'] + $dailysell ;\n $qtys['Lepax5'] = $qtys['Lepax5'] + $qty ;\n $itemno['Lepax5'] = $BORAItemNo; \n break;\n case '68LXP001':\n $medicine['Lexapro'] = $medicine['Lexapro'] + $dailysell ;\n $qtys['Lexapro'] = $qtys['Lexapro'] + $qty ; \n $itemno['Lexapro'] = $BORAItemNo;\n break;\n case '68EBP001': \n $medicine['Ebixa'] = $medicine['Ebixa'] + $dailysell ;\n $qtys['Ebixa'] = $qtys['Ebixa'] + $qty ; \n $itemno['Ebixa'] = $BORAItemNo;\n break;\n case '68DEP001':\n $medicine['Deanxit'] = $medicine['Deanxit'] + $dailysell ;\n $qtys['Deanxit'] = $qtys['Deanxit'] + $qty ; \n $itemno['Deanxit'] = $BORAItemNo;\n break;\n ////分段一下這邊是LendorminBora兩種分類 \n case '68LMP002':\n $medicine['LendorminBora'] = $medicine['LendorminBora'] + $dailysell ;\n $qtys['LendorminBora'] = $qtys['LendorminBora'] + $qty ; \n $itemno['LendorminBora'] = $BORAItemNo ; \n break;\n case '68PTV001123':\n $medicine['Lendorminann'] = $medicine['Lendorminann'] + $dailysell ;\n $qtys['Lendorminann'] = $qtys['Lendorminann'] + $qty ; \n $itemno['Lendorminann'] = $BORAItemNo ; \n break;\n //分段一下這邊是聯邦產品 \n case '67HWLCBN'://胃爾康 100ml\n $medicine['Wilcon'] = $medicine['Wilcon'] + $dailysell ;\n $qtys['Wilcon'] = $qtys['Wilcon'] + $qty ; \n $itemno['Wilcon'] = $BORAItemNo ; \n break; \n case '67HWLCBC'://胃爾康 100ml \n $medicine['Wilcon'] = $medicine['Wilcon'] + $dailysell ;\n $qtys['Wilcon'] = $qtys['Wilcon'] + $qty ; \n break; \n case '67HWLCBJ'://胃爾康 60ml\n $medicine['Wilcon'] = $medicine['Wilcon'] + $dailysell ;\n $qtys['Wilcon'] = $qtys['Wilcon'] + $qty ; \n break; \n case '67QCTCBQ'://氯四環素\n $medicine['Kso'] = $medicine['Kso'] + $dailysell ;\n $qtys['Kso'] = $qtys['Kso'] + $qty ; \n $itemno['Kso'] = $BORAItemNo ; \n break; \n case '57ABPNPA'://帕金寧\n $medicine['Bpn'] = $medicine['Bpn'] + $dailysell ;\n $qtys['Bpn'] = $qtys['Bpn'] + $qty ; \n $itemno['Bpn'] = $BORAItemNo ; \n break; \n case '57ABPNBA'://帕金寧\n $medicine['Bpn'] = $medicine['Bpn'] + $dailysell ;\n $qtys['Bpn'] = $qtys['Bpn'] + $qty ; \n break; \n default:\n //10973 = 衛采 11032 = 聯邦化學 57ARZTPG = 羅莎疼\n if ($BORACustomerNo<>'10973' and $BORACustomerNo<>'11032' and $BORAItemNo<>'57ARZTPG' ) \n {\n $medicine['Others'] = $medicine['Others'] + $dailysell ;\n $qtys['Others'] = $qtys['Others'] + $qty ; \n $itemno['Others'] = $BORAItemNo ; \n break;\n } \n }\n }\n //和安戀多眠另外再算一次\n $dailyreportstable = hareport::where('INVDT','=',$todaydate)->get();\n foreach ($dailyreportstable as $dailyreport) {\n $HAItemNo = $dailyreport->HAITMNO;\n $dailysell = $dailyreport->INVAM;\n $qty = $dailyreport->ORQTY; \n $HACustomerNo = $dailyreport->CUSNAME; \n $CDAMT = $dailyreport->CDAMT;\n switch ($HAItemNo) {\n case 'LEN25100':\n $medicine['Lendorminann'] = $medicine['Lendorminann'] + $dailysell - $CDAMT ;\n $qtys['Lendorminann'] = $qtys['Lendorminann'] + $qty ; \n $itemno['Lendorminann'] = $HACustomerNo ; \n break;\n default:\n\n break;\n } \n }\n\n //百靈佳戀多眠另外再算一次\n $dailyreportstable = boehringer::where('Date','=',$todaydate)->get();\n foreach ($dailyreportstable as $dailyreport) {\n $amount = $dailyreport->Amount;\n $qty = $dailyreport->QTY;\n if ($dailyreport['SaleType']=='R2') {\n $amount = 0 - $amount;\n }\n $medicine['Lendorminann'] = $medicine['Lendorminann'] + $amount;\n $qtys['Lendorminann'] = $qtys['Lendorminann'] + $qty ;\n } \n //每月銷售累加 還有 and 寫法\n $dailyreportstable = dailyreport::where('InvDate','>=',$monthstart)->where('InvDate','<=',$todaydate)->get();\n $MA = array( 'Pitavol' => 0 , \n 'Denset' => 0 , \n 'Lepax10' => 0 , \n 'Lepax5' => 0 , \n 'Lexapro' => 0 , \n 'Ebixa' => 0 , \n 'Deanxit' => 0 , \n 'LendorminBora' => 0 , \n 'Lendorminann' => 0 ,\n 'Wilcon' => 0 ,\n 'Kso' => 0 ,\n 'Bpn' => 0,\n 'Others' => 0,\n );\n foreach ($dailyreportstable as $dailyreport) {\n $BORAItemNo = $dailyreport->BORAItemNo;\n $MonthTotal = $dailyreport->InoviceAmt; \n $BORACustomerNo= $dailyreport->BORACustomerNo; \n $SalesType= $dailyreport->SalesType; \n switch ($BORAItemNo) {\n case '68PTV001':\n if ($BORACustomerNo<>'10824' ) {\n $MA['Pitavol'] = $MA['Pitavol'] + $MonthTotal;\n } \n break;\n case '68DEN001':\n if ($BORACustomerNo<>'10824') {\n $MA['Denset'] = $MA['Denset'] + $MonthTotal;\n } \n break;\n case '68LEP002':\n $MA['Lepax10'] = $MA['Lepax10'] + $MonthTotal;\n break;\n case '68LEP001':\n $MA['Lepax5'] = $MA['Lepax5'] + $MonthTotal;\n break;\n case '68LXP001':\n $MA['Lexapro'] = $MA['Lexapro'] + $MonthTotal;\n break;\n case '68EBP001': \n $MA['Ebixa'] = $MA['Ebixa'] + $MonthTotal;\n break;\n case '68DEP001':\n $MA['Deanxit'] = $MA['Deanxit'] + $MonthTotal;\n break;\n ////分段一下這邊是LendorminBora兩種分類 \n case '68LMP002':\n $MA['LendorminBora'] = $MA['LendorminBora'] + $MonthTotal;\n break;\n case '68PTV001123':\n $MA['Lendorminann'] = $MA['Lendorminann'] + $MonthTotal;\n break;\n //分段一下這邊是聯邦產品 \n case '67HWLCBN'://胃爾康 100ml\n $MA['Wilcon'] = $MA['Wilcon'] + $MonthTotal;\n break; \n case '67HWLCBC'://胃爾康 100ml \n $MA['Wilcon'] = $MA['Wilcon'] + $MonthTotal;\n break; \n case '67HWLCBJ'://胃爾康 60ml \n $MA['Wilcon'] = $MA['Wilcon'] + $MonthTotal;\n break; \n case '67QCTCBQ'://氯四環素\n $MA['Kso'] = $MA['Kso'] + $MonthTotal;\n break; \n case '57ABPNPA'://帕金寧\n $MA['Bpn'] = $MA['Bpn'] + $MonthTotal;\n break; \n case '57ABPNBA'://帕金寧\n $MA['Bpn'] = $MA['Bpn'] + $MonthTotal;\n break; \n default:\n if ($BORACustomerNo<>'10973' and $BORACustomerNo<>'11032' and $BORAItemNo<>'57ARZTPG') \n {\n $MA['Others'] = $MA['Others'] + $MonthTotal;\n break;\n } \n }\n }\n //和安戀多眠另外再算一次 \n $dailyreportstable = hareport::where('INVDT','>=',$monthstart)->where('INVDT','<=',$todaydate)->get();\n foreach ($dailyreportstable as $dailyreport) {\n $HAItemNo = $dailyreport->HAITMNO;\n $dailysell = $dailyreport->INVAM; \n $CDAMT = $dailyreport->CDAMT;\n switch ($HAItemNo) {\n case 'LEN25100':\n $MA['Lendorminann'] = $MA['Lendorminann'] + $dailysell - $CDAMT;\n break;\n default:\n\n break;\n } \n } \n //百靈佳戀多眠另外再算一次\n $dailyreportstable = boehringer::where('Date','>=',$monthstart)->where('Date','<=',$todaydate)->get();\n foreach ($dailyreportstable as $dailyreport) {\n $amount = $dailyreport->Amount;\n if ($dailyreport['SaleType']=='R2') {\n $amount = 0 - $amount;\n }\n $MA['Lendorminann'] = $MA['Lendorminann'] + $amount;\n } \n //每月目標業績\n $monthbudgets = boramonthbudget::where('month','>=',$monthstart)->where('month','<=',$todaydate)->get();\n $MB = array( 'Pitavol' => 0 , \n 'Denset' => 0 , \n 'Lepax10' => 0 , \n 'Lepax5' => 0 , \n 'Lexapro' => 0 , \n 'Ebixa' => 0 , \n 'Deanxit' => 0 , \n 'LendorminBora' => 0 , \n 'Lendorminann' => 0 ,\n 'Wilcon' => 0 ,\n 'Kso' => 0 ,\n 'Bpn' => 0,\n 'Others' => 0,\n );\n $MC = array( 'Pitavol' => 0 , \n 'Denset' => 0 , \n 'Lepax10' => 0 , \n 'Lepax5' => 0 , \n 'Lexapro' => 0 , \n 'Ebixa' => 0 , \n 'Deanxit' => 0 , \n 'LendorminBora' => 0 , \n 'Lendorminann' => 0 ,\n 'Wilcon' => 0 ,\n 'Kso' => 0 ,\n 'Bpn' => 0,\n 'Others' => 0,\n );\n foreach ($monthbudgets as $monthbudget) {\n $BORAItemNo = $monthbudget->BORAItemNo;\n $MonthTotal = $monthbudget->budget; \n switch ($BORAItemNo) {\n case '68PTV001':\n $MB['Pitavol'] = $MonthTotal;\n break;\n case '68DEN001':\n $MB['Denset'] = $MonthTotal ;\n break;\n case '68LEP002':\n $MB['Lepax10'] = $MonthTotal ;\n break;\n case '68LEP001':\n $MB['Lepax5'] = $MonthTotal ;\n break;\n case '68LXP001':\n $MB['Lexapro'] = $MonthTotal ;\n break;\n case '68EBP001': \n $MB['Ebixa'] = $MonthTotal ;\n break;\n case '68DEP001':\n $MB['Deanxit'] = $MonthTotal ;\n break;\n ////分段一下這邊是LendorminBora兩種分類 \n case '68LMP002':\n $MB['LendorminBora'] = $MonthTotal ;\n break;\n case '68PTV001123':\n $MB['Lendorminann'] = $MonthTotal ;\n break;\n //分段一下這邊是聯邦產品 \n case '67HWLCBN'://胃爾康 100ml\n $MB['Wilcon'] = $MonthTotal ; \n break; \n case '67HWLCBC'://胃爾康 100ml \n $MB['Wilcon'] = $MonthTotal ; \n break; \n case '67HWLCBJ'://胃爾康 60ml \n $MB['Wilcon'] = $MonthTotal ; \n break; \n case '67QCTCBQ'://氯四環素\n $MB['Kso'] = $MonthTotal ;\n break; \n case '57ABPNPA'://帕金寧\n $MB['Bpn'] = $MonthTotal ;\n break; \n case '57ABPNBA'://帕金寧\n $MB['Bpn'] = $MonthTotal ;\n break; \n case '11111111'://others\n $MB['Others'] = $MonthTotal ;\n break; \n default:\n break;\n }\n } \n $q = 0 ;\n $allqty = 0 ;\n $totalsell = 0 ;\n $totalma = 0; \n $totalmb = 0;\n $totalmc = 0;\n foreach ($MB as $key => $value) {\n if ($MB[$key]<>0)\n {\n $q = $q + 1 ;\n }\n }\n foreach ($qtys as $key => $value) {\n $allqty = $allqty + $qtys[$key] ;\n }\n foreach ($medicine as $key => $value) {\n $totalsell = $totalsell + $medicine[$key];\n }\n foreach ($MA as $key => $value) {\n $totalma = $totalma + $MA[$key];\n }\n foreach ($MB as $key => $value) {\n $totalmb = $totalmb + $MB[$key] ;\n }\n foreach ($MC as $key => $value) {\n if ($MB[$key]<>0)\n { \n $MC[$key] = round(($MA[$key] / $MB[$key])* 100) ;\n }\n else\n {\n $MC[$key] = 0 ;\n } \n }\n foreach ($MC as $key => $value) {\n $totalmc = $totalmc + $MC[$key] ;\n }\n $totalmc = round(($totalma / $totalmb) * 100) ;\n return view('sendboradiary',['Pitavol'=>$medicine['Pitavol'],\n 'Denset'=>$medicine['Denset'],\n 'Lepax10'=>$medicine['Lepax10'],\n 'Lepax5'=>$medicine['Lepax5'],\n 'Lexapro'=>$medicine['Lexapro'],\n 'Ebixa'=>$medicine['Ebixa'],\n 'Deanxit'=> $medicine['Deanxit'],\n 'LendorminBora'=>$medicine['LendorminBora'],\n 'Lendorminann'=>$medicine['Lendorminann'],\n 'Wilcon'=>$medicine['Wilcon'],\n 'Kso'=>$medicine['Kso'],\n 'Bpn'=>$medicine['Bpn'],\n 'Others'=>$medicine['Others'],\n 'itemno'=>$itemno,\n 'qtys'=>$qtys,\n 'todaydate'=>$todaydate,\n 'totalsell'=>$totalsell,\n 'allqty'=>$allqty,\n 'MA'=>$MA, \n 'MB'=>$MB, \n 'MC'=>$MC, \n 'chardate'=>$chardate, \n 'totalma'=>$totalma,\n 'totalmb'=>$totalmb,\n 'totalmc'=>$totalmc, \n ]);\n }", "function tambahSaldoRekening($jumlahSetoran,$idRekening){\n \tglobal $conn;\n // find saldo rekening\t\n \t$query = \"\n \tSELECT saldo_rekening FROM tb_rekening \n \tWHERE id_rekening ='\".$idRekening.\"'\n \t\";\n \t$hasil = mysqli_fetch_assoc(mysqli_query($conn,$query));\n \t$saldo = $hasil[\"saldo_rekening\"];\n\n \t$saldo_akhir = $saldo + $jumlahSetoran;\n\n // update saldo rekening\n \t$tambah = \"UPDATE tb_rekening SET\n\t\t\t\tsaldo_rekening = '\".$saldo_akhir.\"'\n\t\t\t WHERE id_rekening = '\".$idRekening.\"'\n\t\t\t\";\t\n\t\tmysqli_query($conn,$tambah);\t\n \treturn $saldo_akhir;\n\n }", "public function modificarInsumo(){\n // $insumo = new insumoModelo;\n // $insumo->setNombre($_POST[\"txtNombre\"]);\n // $insumo->setMedida($_POST[\"txtMedida\"]);\n // $insumo->setIdMedida($_POST[\"und\"]);\n // $insumo->setIdInsumo($_POST[\"txtId\"]);\n // $crudInsumo->modificarInsumo($insumo);\n }", "function montantTotal(){\n\n $total =0;\n\n for ($i=0; $i < count($_SESSION['panier']['id_produit']); $i++) { \n $total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i]; // on mutiplie la quantité par le prix à chaque tour de boucle que l'on ajoute dans $total avec l'opérateur += pour le pas écraser la dernière valeur\n }\n return $total;\n}", "function addproduto($produto) {\r\n $produto->nitem = count($this->produto) + 1;\r\n $produto->cfop = str_replace('.','',$produto->cfop);\r\n $produto->ncm = str_replace('.','',$produto->ncm);\r\n $this->produto[] = $produto;\r\n // sumariza\r\n $this->totais->vbc += $produto->icms->base; \r\n $this->totais->vicms += $produto->icms->valor;\r\n $this->totais->vbcst += $produto->st->base;\r\n $this->totais->vst += $produto->st->valor;\r\n $this->totais->vprod += $produto->vprod;\r\n $this->totais->vfrete += $produto->vfrete;\r\n $this->totais->vseg += $produto->vseg;\r\n $this->totais->voutro += $produto->voutr;\r\n $this->totais->vdesc += $produto->vdesc;\r\n $this->totais->vipi += $produto->ipi->valor;\r\n $this->totais->vpis += $produto->pis->valor;\r\n $this->totais->vcofins+= $produto->cofins->valor;\r\n $this->totais->vnf += (($produto->vprod + $produto->vfrete + $produto->voutr + $produto->vseg + $produto->ipi->valor+ $produto->st->valor) - $produto->vdesc);\r\n }", "public function reserveAmountAdd(Request $request, $claimId) {\n $claimObj = Policyclaims::find($claimId);\n \n $historyId = $request->get('history_id',0);\n $newBalance=0;\n if($historyId > 0) {\n $historyObj = ClaimPaymentreserve::find($historyId); \n $newBalance = $historyObj->balance_reserve_sum;\n \n } else {\n $currentBalance = $claimObj->reserve_sum_balance;\n $newBalance = floatval($currentBalance) + floatval($request->get('claim_reserve_sum')); \n }\n \n $claimObj->reserve_sum_balance = $newBalance;\n $claimObj->save();\n $message = ($historyId >0) ? 'Successfully update reserve amount details!' : 'Successfully enter reserve amount details!';\n $this->addReserveAmountDetails($request, $claimId, $newBalance);\n \n //log entry\n $logArray['claim_id'] = $claimId;\n $logArray['kind'] = 'Reserve some value is updated';\n $logArray['entered_date'] = date('Y-m-d h:i');\n $logArray['edited_by'] = Auth::user()->id; \n DB::table('claim_log')->insert($logArray);\n \n \n return back()->with(['success' => 'Successfully enter reserve amount details!', 'overviewtabselected' => 'document']);\n }", "public function sum(): StatsRequest;", "function visitaAdd(){\n $res=$this->con->query(\"UPDATE tbl_datos_generales SET visitas=visitas+1 WHERE Id=1 \");\n \n return $res; \n }", "public function restarSaldo();", "function set_totalizar($camp,$pos,$tam=0,$alinea=\"\",$borde=0,$fillColor=0,$tfuen,$estilo=\"\",$valor=0){\n\n\t\t$this->totalizar[]=array('campo'=>$camp,'pos'=>$pos,\n\t\t\t\t\t\t\t\t\"ancho\"=>$tam,'alinea'=>$alinea,'tfuente'=>$tfuen,\n\t\t\t\t\t\t\t\t'estilo'=>$estilo,'borde'=>$borde,'relleno'=>$fillColor,\n\t\t\t\t\t\t\t\t'valor'=>$valor);\n\t}", "public function total(){\n $lastInvoice = Invoice::where('debit_date', '<', $this->debit_date)->orderBy('debit_date', 'desc')->first();\n return $this->transactions()->sum('value') + (isset($lastInvoice) ? $lastInvoice->total() : 0);\n }", "public function setComputerTotal(int $sum, $app)\n {\n $this->computer->setTotal($sum);\n $this->start(2, $app);\n\n // echo \" computer 2 \" . $this->turn;\n }", "public function total(){\r\n appTrace(debug_backtrace(), $_SESSION['cart']);\r\n \r\n $records = $this->model->getRecords();\r\n //var_dump($records);\r\n foreach($records as $record){\r\n if(isset($_POST['cart']['quantity'][$product_id])){\r\n $_SESSION['cart'][$product_id] = $_POST['cart']['quantity'][$product_id];\r\n } else {\r\n throw new \\Exception(\"cCart.total: quantity is empty)\");\r\n }\r\n }\r\n }", "public function insertar(Pedido $pedido,$total,$mesa)\r\n\t{\r\n $Estadomesa=\"select estado from tbl_mesa WHERE num_mesa=$mesa\";\r\n $respuesta=$this->conexion->prepare($Estadomesa);\r\n $respuesta->execute();\r\n $r=$respuesta->fetch();\r\n \r\n \r\n \r\n /////////Si esta ocupada se realiza el pedido sobre el ultimo pedido realizado a esa mesa////////////\r\n if($r['estado']==0){\r\n $buscarId= \"select max(id_pedido) id_pedido from tbl_pedido where num_mesa=$mesa\";//id del pedido al cual se va ingresar\r\n $buscarId= \"select max(id_pedido) id_pedido from tbl_pedido\";\r\n $resultado=$this->conexion->prepare($buscarId);\r\n $resultado->execute(); //id del pedido al cual se va ingresar\r\n $idUltimaVenta = 0; //inicializar variable para almacenar el id\r\n while ($fila=$resultado->fetch(PDO::FETCH_ASSOC)) {\r\n $idUltimaVenta=$fila['id_pedido'] ;\r\n }// toma el id y lo asigna a la varible inicializada\r\n foreach($_SESSION[\"carrito\"] as $p){\r\n $query=\"insert into tbl_dlle_producto_pedido (id_producto,id_pedido,cantidad,precioAcumulado) values(\r\n '\".$p->__GET(\"id_producto\").\"',\r\n '\".$idUltimaVenta.\"',\r\n '\".$p->__GET(\"cantidad\").\"',\r\n '\".$p->__GET(\"subTotal\").\"')\"; \r\n $this->conexion->prepare($query)->execute(); // se agrega productos al pedido\r\n \r\n }\r\n $consulto=\"SELECT total FROM tbl_pedido WHERE id_pedido=$idUltimaVenta\";\r\n $resulto=$this->conexion->prepare($consulto);\r\n $resulto->execute();\r\n $totalP=$resulto->fetch();\r\n $nuevoTotal=$totalP['total']+$total;\r\n echo $nuevoTotal;\r\n $actualizarT=\"UPDATE tbl_pedido SET total=$nuevoTotal WHERE id_pedido=$idUltimaVenta\";\r\n $this->conexion->prepare($actualizarT)->execute();\r\n }\r\n \r\n /////////Si esta disponible se realiza un nuevo pedido ////////////\r\n else if($r['estado']==1){\r\n $insertarP=\"INSERT INTO tbl_pedido (id_pedido,num_mesa,responsable,descuento,subtotal,total,estado) values (?,?,?,?,?,$total,1)\";\r\n $this->conexion->prepare($insertarP)->execute(array(\r\n\t\t\t\t$pedido->__GET('id_pedido'),\r\n\t\t\t\t$pedido->__GET('num_mesa'),\r\n\t\t\t\t$pedido->__GET('responsable'),\r\n\t\t\t\t$pedido->__GET('descuento'),\r\n\t\t\t\t$pedido->__GET('subtotal'),\r\n \t)); // creaamos nuevo pedido\r\n $buscarId2= \"select max(id_pedido) id_pedido from tbl_pedido\";\r\n $resultado=$this->conexion->prepare($buscarId2);\r\n $resultado->execute(); //id del pedido al cual se va ingresar\r\n $idUltimaVenta = 0; //inicializar variable para almacenar el id\r\n while ($fila=$resultado->fetch(PDO::FETCH_ASSOC)) {\r\n $idUltimaVenta=$fila['id_pedido'] ;\r\n }// toma el id y lo asigna a la varible inicializada\r\n foreach($_SESSION[\"carrito\"] as $p){\r\n $query=\"insert into tbl_dlle_producto_pedido (id_producto,id_pedido,cantidad,precioAcumulado) values(\r\n '\".$p->__GET(\"id_producto\").\"',\r\n '\".$idUltimaVenta.\"',\r\n '\".$p->__GET(\"cantidad\").\"',\r\n '\".$p->__GET(\"subTotal\").\"')\"; \r\n $this->conexion->prepare($query)->execute(); // se agrega productos al pedido\r\n }\r\n $cambiarEstado=\"UPDATE tbl_mesa SET estado=0 WHERE num_mesa=$mesa\";\r\n $resultado2=$this->conexion->prepare($cambiarEstado);\r\n $resultado2->execute();\r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n }", "protected function _updateTotals($data)\n {\n foreach ($data as $key => $amount) {\n if (null !== $amount) {\n $was = $this->getDataUsingMethod($key);\n $this->setDataUsingMethod($key, $was + $amount);\n }\n }\n }", "public function recalcTotalsFromAdmin($order_id){\n\n $subtotal = Order_Menus::where('order_id', $order_id)->sum('subtotal');\n\n DB::table('order_totals')\n ->where('order_id', $order_id)\n ->where('code', 'subtotal')\n ->update(['value' => $subtotal]);\n\n $subtotals = DB::table('order_totals')\n ->select('value')\n ->where('order_id', $order_id)\n ->where('code', '!=', 'subtotal')\n ->where('code', '!=', 'total')\n ->orderBy('priority')\n ->get();\n\n foreach($subtotals as $sub){\n $subtotal += $sub->value;\n }\n\n DB::table('order_totals')\n ->where('order_id', $order_id)\n ->where('code', 'total')\n ->update(['value' => $subtotal]);\n\n $model = $this->formFindModelObject($order_id);\n $model->order_total = $subtotal;\n $model->save();\n\n }" ]
[ "0.6380769", "0.6229964", "0.6104765", "0.6052068", "0.60159934", "0.59960294", "0.5972701", "0.5952419", "0.59464693", "0.59464693", "0.59449553", "0.59341854", "0.5923656", "0.59032303", "0.58673346", "0.58601075", "0.5756147", "0.57430726", "0.5742394", "0.57051736", "0.5692139", "0.5684811", "0.5684811", "0.56820196", "0.5675553", "0.56633645", "0.56532365", "0.56454736", "0.5639441", "0.5638301", "0.56355286", "0.5626986", "0.5624298", "0.5624049", "0.56233513", "0.56217474", "0.5620946", "0.5618768", "0.5608222", "0.56049687", "0.56017375", "0.5569346", "0.5568397", "0.5562141", "0.5562128", "0.5557203", "0.5537885", "0.5500535", "0.5498989", "0.54937536", "0.54719186", "0.54661906", "0.54539126", "0.5448375", "0.5446541", "0.54352635", "0.5429061", "0.5424049", "0.5421617", "0.54176414", "0.54173934", "0.54145473", "0.54006624", "0.5393922", "0.5382415", "0.53789955", "0.5369259", "0.53676265", "0.5367118", "0.5365125", "0.53492504", "0.53367627", "0.532976", "0.5324645", "0.53162307", "0.5312902", "0.5303852", "0.5301254", "0.52994823", "0.5299151", "0.52960736", "0.5293866", "0.5290387", "0.5289874", "0.52829677", "0.5274745", "0.52680767", "0.52623045", "0.52592564", "0.52547795", "0.5252945", "0.52524215", "0.525119", "0.5250919", "0.52457005", "0.5236767", "0.52304286", "0.52284", "0.5221544", "0.5220953" ]
0.74905276
0
Test salary payment date when there is weekend
Тест даты выплаты зарплаты, когда есть выходной
public function testSalaryPaymentDateIsWeekend(): void { $dateTime = new \DateTime('31 March 2019'); $dateTimeMock = Mockery::mock(DateTime::class); $dateTimeMock->shouldReceive('modify') ->once() ->with('last day of this month') ->andReturn($dateTime); $dateTimeMock->shouldReceive('modify') ->once() ->with('today') ->andReturn($dateTime); $dayCalculatorService = new DateCalculatorService($dateTimeMock); $result = $dayCalculatorService->getSalaryPaymentDate(); $this->assertEquals('29-03-2019', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBonusPaymentDateIsWeekend(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $bonusDateTime = new \\DateTime('16 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify->modify')\n ->twice()\n ->with('+14 days')\n ->andReturn($bonusDateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('20-02-2019', $result);\n }", "private function salaryCalculation(){\n \n $today= date('d');\n \n $previous_week = strtotime(\"-1 week\");\n\n if(1<= $today && $today <= 7){\n $month = date('m');\n $year = date('Y');\n $previousMonth = $month-1; //privious month\n $previousMonth = ($previousMonth == 0) ? '12' : $previousMonth; //if is Zero than it make 12 of privious month\n $year = ($previousMonth == 12) ? $year-1 : $year; //make yer is this month is first of this yr than make it of last yr\n $previous_month_total_days = cal_days_in_month(CAL_GREGORIAN, $previousMonth, $year); //count total dayes of last month\n\n \n $this->monthlyPaymentCount($today,$previousMonth, $year, $previous_month_total_days);\n }\n\n if($today = date('d',strtotime(\"last saturday\"))){\n $this->weeklyPaymentCount();\n }\n\n $this->dailyPaymentCount();\n\n\n }", "public function testIsWeekend()\n {\n $this->assertTrue($this->getCalculator()->isWeekend('2019-05-04'));\n $this->assertTrue($this->getCalculator()->isWeekend('2019-05-05'));\n }", "public function testSalaryPaymentDate(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('28-02-2019', $result);\n }", "public function testSalaryPaymentDateIsPassed(): void\n {\n $dateTime = new \\DateTime('31 March 2019');\n $today = new \\DateTime('30 March 2019');\n $dateTimeMock = Mockery::mock(DateTime::class);\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('-', $result);\n }", "public function test_recurring_sunday() {\n\t\t$mock = get_week_mock(1, array(SUNDAY));\n\t\t$mock->set_start('2019-01-01 11:55');\n\t\t$mock->set_end('2019-01-01 13:00');\n\t\t$schedule = new RecurringDowntime($mock);\n\t\t$input = mock_date('2019-05-26');\n\t\t// Match week\n\t\t$this->assertTrue($schedule->match_week_interval($input));\n\t\t// Match day\n\t\t$days = $schedule->pluck_recurrence('day');\n\t\t$this->assertTrue(in_array($input->get_day_of_week(), $days));\n\t}", "public function testTruthAndReconciliationDayOnAfter2021(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"last day of september {$year}\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function testRepublicDayOnAfter1946(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-6-2\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function getSalaryPaymentDate($date);", "function isWeekend($date = null, $stepDay = null, $getAlsoWeekendDay = false){\n if(is_null($date)) $date = date('Y-m-d');\n //if setpDay is null, we set it to 0\n if(is_null($stepDay)) $stepDay = 0;\n //Add step days to check weekend falls in future or now\n $date = date('Y-m-d', strtotime($date.' + '.$stepDay.' days'));\n //$yeahIsWeekend take true/false switch weekend falling or not\n $yeahIsWeekend = date('D', strtotime($date)) ==='Sat' || date('D', strtotime($date)) === 'Sun';\n $whichWeekendDay = null;\n //if date is Saturday $whichWeekendDay take S letter\n if(date('D', strtotime($date)) ==='Sat') $whichWeekendDay = 'S';\n //if date is Sunday $whichWeekendDay take D letter\n elseif(date('D', strtotime($date)) ==='Sun') $whichWeekendDay = 'D';\n //return true/false switch weekend falling or not | tab or boolean swicth getter format\n return $getAlsoWeekendDay ? [$yeahIsWeekend, $whichWeekendDay] : $yeahIsWeekend;\n }", "function mf_validate_date_weekend($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$error_message = $mf_lang['val_date_na'];\r\n\t\t\r\n\t\t$target_value = $value[0];\r\n\t\t\r\n\t\tif(date('N', strtotime($target_value)) >= 6){\r\n\t\t\treturn $error_message;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function testIsWeekend()\n {\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-01')->isWeekend());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-02')->isWeekend());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-03')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-04')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-05')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-06')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-07')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-08')->isWeekend());\n }", "public function validateDelivery()\n {\n $holiday = new Holiday;\n $delivery_date_day = date('w', strtotime(date('Y-m-d')));\n $delivery_date = date('Y-m-d');\n\n switch ($delivery_date_day){ \n case 5: // if this is friday\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+3 days'));\n break;\n case 6:\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+2 days'));\n break;\n case 7:\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+1 days'));\n break;\n }\n \n while (true) {\n if (!$holiday->isHoliday($delivery_date)) break; // if not holiday destroy infinite loop\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+ 1 day')); // if still it is holiday add 1 day to its delivery date\n }\n return $delivery_date;\n }", "public function testBonusPaymentDateIsPassed(): void\n {\n\n $firstDay = new \\DateTime('1 February 2019');\n $today = new \\DateTime('18 February 2019');\n $bonusDay = new \\DateTime('16 February 2019');\n $nextWednesday = new \\DateTime('16 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('first day of this month')\n ->andReturn($firstDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('+14 days')\n ->andReturn($bonusDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('next wednesday')\n ->andReturn($nextWednesday);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('-', $result);\n }", "protected function _isWeekend()\n {\n $day = date(\n 'N', mktime(0, 0, 0, $this->_month, $this->_date, $this->_year)\n );\n return in_array($day, array(6, 7));\n }", "function test($entity_id,$date){\nglobal $adb,$log,$current_user;\n$paymentid=$entity_id;//$_REQUEST['paymentid']\n$datefrom=date('Y-m-d',strtotime($date));//$_REQUEST['start_date']\n$dat_fmt = $current_user->date_format;\n$dateFormat=($dat_fmt == 'dd-mm-yyyy') ? 'd-m-Y' : (($dat_fmt == 'mm-dd-yyyy') ? 'm-d-Y' : (($dat_fmt == 'yyyy-mm-dd') ? 'Y-m-d' : ''));\n\n$res = $adb->pquery(\"Select * from vtiger_payamentstype WHERE payamentstypeid=?\", array($paymentid));\n //$datefrom = $adb->query_result($res, 0, 'docdate_from');\n $diffdays = $adb->query_result($res, 0, 'differdays');\n $endofmonth = $adb->query_result($res, 0, 'endofmonth');\n $extradays = $adb->query_result($res, 0, 'extradays');\n\n $calc_date = $datefrom;\n if ($diffdays <> 0) {\n if ($diffdays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $diffdays day$s\"));\n }\n if ($endofmonth > 0) {\n $calc_date = date('Y-m-d', strtotime($calc_date));\n }\n if ($extradays <> 0) {\n if ($extradays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $extradays day$s\"));\n }\n $calc_date=date($dateFormat,strtotime($calc_date));\n return $calc_date;\n}", "public function Set_Pay_Date_Calc() { \n\t\t$this->pdc = new Pay_Date_Calc_3($this->holidays); \n\t\t$this->next_bus_day \t= date('m/d/Y', strtotime($this->pdc->Get_Business_Days_Forward(date('Y-m-d'), 1)));\n\t}", "public function test_should_calculate_business_days()\n {\n $startDate = clone $this->date;\n $endDate = $this->date->addMonth()->format('Y-m-d');\n\n $noOfBusinessDays = $this->calculateBusinessDays();\n\n $response = $this->get('calculate/business-days/?start_date=' . $startDate->format('Y-m-d') . '&end_date=' . $endDate);\n $response->assertSuccessful();\n $this->assertEquals($noOfBusinessDays, $response->getContent());\n }", "function isWorkingDayNext(&$PDOdb, $dateTest){\n\n\t\t$date=strtotime('+1day',$dateTest);\n\n\t\treturn $this->isWorkingDay($PDOdb, date('Y-m-d', $date));\n\n\t}", "public function testSaturdaySubstitution(): void\n {\n // 2020-05-09 victoryDay (День перемоги)\n $year = 2020;\n $holiday = 'victoryDay';\n\n $this->assertHolidayWithSubstitution(\n self::REGION,\n $holiday,\n $year,\n new \\DateTime(\"{$year}-05-09\", new \\DateTimeZone(self::TIMEZONE)),\n new \\DateTime(\"{$year}-05-11\", new \\DateTimeZone(self::TIMEZONE))\n );\n\n unset($year, $holiday);\n }", "public function testIsHoliday()\n {\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-31'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-23'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-24'));\n }", "private function getTargetGatepass($value){\n $date = new DateTime($value);\n $date->modify('+1 day');\n // Output\n $value = $date->format('Y-m-d');\n if((date('N', strtotime($value)) >= 6) == 1) {\n // Create a new DateTime object\n $date = new DateTime($value);\n \n // Modify the date it contains\n $date->modify('next monday');\n \n // Output\n $newdate = $date->format('Y-m-d');\n \n \n while(Holiday::where('holiday_date','=',$newdate)->count() == 1){\n $date = new DateTime( (string) $newdate ) ;\n $date->modify('+1 day');\n $newdate = $date->format('Y-m-d');\n if((date('N', strtotime((string) $newdate )) >= 6) == 1) {\n // Modify the date it contains\n $date->modify('next monday');\n // Output\n $newdate = $date->format('Y-m-d');\n }\n \n \n }\n \n //echo date(\"Y-m-d\", strtotime(\"next monday\"));\n }else{\n $date = new DateTime($value);\n \n // Output\n $newdate = $date->format('Y-m-d');\n \n while(Holiday::where('holiday_date','=',$newdate)->count() == 1){\n $date = new DateTime( (string) $newdate ) ;\n $date->modify('+1 day');\n $newdate = $date->format('Y-m-d');\n if((date('N', strtotime((string) $newdate )) >= 6) == 1) {\n // Modify the date it contains\n $date->modify('next monday');\n // Output\n $newdate = $date->format('Y-m-d');\n }\n \n \n }\n \n //echo Holiday::where('holiday_date','=', (string) $newdate )->count();\n \n }\n \n return $newdate;\n }", "public function isWeekend(): bool\n {\n return $this->value === self::SATURDAY || $this->value === self::SUNDAY;\n }", "public function test_should_calculate_sector_based_on_weekly_selector()\n {\n $request = $this->prepareSectorRequestData('weekly');\n\n $response = $this->post('calculateSectors', $request)->getOriginalContent();\n\n foreach ($response as $sector) {\n //This assertion check the every sector last date day must be the delivery day\n //If its match then assert true else false\n if (carbon::parse($sector['end_date'])->format('l') === $request['delivery_day']) {\n $this->assertTrue(true);\n } else {\n $this->assertFalse(false);\n }\n }\n //This assertion check the last sector end date must be the delivery end date\n $this->assertEquals(last($response)['end_date'], $request['overall_end_date']);\n }", "public function cal_salary(){\n\t\treturn $this->per_day_amt * $this->present_day_amt;\n\t}", "public function salary_reminder1(){\n \n $cur_month = date('m');\n $cur_year = date('Y');\n \n $last_month = date('m', strtotime('-1 month'));\n \n if($cur_month == 1){\n $year = $cur_year-1;\n }else{\n $year = $cur_year;\n }\n \n //$num_days = cal_days_in_month(CAL_GREGORIAN, $cur_month, $cur_year);\n $num_days1 = cal_days_in_month(CAL_GREGORIAN, $last_month, $year);\n $day_array = array();\n $j=0;\n \n for($k=27; $k <= $num_days1; $k++){\n $date = $year.\"-\".$last_month.\"-\".$k;\n $weekDay = date('w', strtotime($date));\n \n $this->load->model('employee_model');\n $festival = $this->employee_model->get_festival($date);\n \n if($weekDay == 0 || $weekDay == 6){\n //echo $k.\"<br>\";\n }else if (!empty ($festival)){\n //echo $k.\"<br>\";\n }else{\n $day_array[$j] = $date;\n $j++;\n }\n }\n \n for($i=1; $i<= 26; $i++){\n \n $date = $cur_year.\"-\".$cur_month.\"-\".$i;\n $weekDay = date('w', strtotime($date));\n \n $this->load->model('employee_model');\n $festival = $this->employee_model->get_festival($date);\n \n if($weekDay == 0 || $weekDay == 6){\n //echo $i.\"<br>\";\n }else if (!empty ($festival)){\n //echo $i.\"<br>\";\n }else{\n $day_array[$j] = $date;\n $j++;\n }\n \n }\n //echo \"<pre>\";print_r($day_array); exit;\n \n $employees = $this->employee_model->get_all_employees();\n \n $this->load->model('leave_model');\n $this->load->model('work_model');\n $this->load->model('short_leave_model');\n \n foreach($employees as $employee){\n $days = 0;\n $hours = 0;\n //echo \"hi\".sizeof($day_array).\"<br><pre>\".print_r($employee);\n $info = '';\n $msg = '';\n $info.= '<table border=\"1\">';\n $info.= '<tr>';\n $info.= '<th>Date</th>';\n $info.= '<th>Deduction</th>';\n $info.= '</tr>';\n \n for($i=0; $i < sizeof($day_array); $i++){\n \n $date1=date_create($employee['doj']);\n $date2=date_create($day_array[$i]);\n $diff=date_diff($date1,$date2);\n $num_days = $diff->format(\"%R%a days\");\n //echo $employee['emp_name'].\" \".$employee['doj'].\" \".$day_array[$i].\" \".$num_days.\"<br>\";\n if($num_days >= 0){\n $is_leave=$this->leave_model->get_date_wise_leave($day_array[$i], $employee['id']);\n\n if((!isset($is_leave) || empty($is_leave))){\n //echo \"here\"; exit;\n $timesheet = $this->work_model->get_approved_timesheet($day_array[$i], $employee['id']);\n\n //echo \"<pre>\"; print_r($timesheet); exit;\n\n if( (isset($timesheet) && !empty($timesheet)) ){\n if($timesheet['hours'] < 7){\n\n $is_half_day=$this->leave_model->get_date_wise_half_day($day_array[$i], $employee['id']);\n\n if((!isset($is_half_day) || empty($is_half_day))){\n\n $is_short_leave=$this->short_leave_model->get_date_wise_short_leave($day_array[$i], $employee['id']);\n\n if((!isset($is_short_leave) || empty($is_short_leave))){\n $hours = $hours + (8-$timesheet['hours']);\n \n if($hours >= 8){\n //echo \"here \".$days.\" \".($days+floor($hours/8)).\"<br>\";\n \n $days = ($days+floor($hours/8));\n $hours = $hours%8;\n //echo $days.\"<br>\"; exit;\n }\n\n $info.= '<tr>';\n\n $info.= '<td>';\n $info.= $day_array[$i];\n $info.= '</td>';\n\n $info.= '<td>';\n $info.= ((8-$timesheet['hours']) > 1) ? (8-$timesheet['hours']).\" Hrs\" : (8-$timesheet['hours']).\" Hr\";\n $info.= '</td>';\n\n $info.= '</tr>';\n }else{\n if($timesheet['hours'] < 6){\n $hours = $hours + (6-$timesheet['hours']);\n \n if($hours >= 8){\n \n $days = $days + floor($hours/8);\n $hours = $hours%8;\n }\n\n $info.= '<tr>';\n\n $info.= '<td>';\n $info.= $day_array[$i];\n $info.= '</td>';\n\n $info.= '<td>';\n $info.= ((6-$timesheet['hours']) > 1) ? (6-$timesheet['hours']).\" Hrs\" : (6-$timesheet['hours']).\" Hr\";\n $info.= '</td>';\n\n $info.= '</tr>';\n }\n }\n\n }else{\n if($timesheet['hours'] < 3){\n $hours = $hours + (4-$timesheet['hours']);\n \n if($hours >= 8){\n \n $days = $days + floor($hours/8);\n $hours = $hours%8;\n }\n \n $info.= '<tr>';\n\n $info.= '<td>';\n $info.= $day_array[$i];\n $info.= '</td>';\n\n $info.= '<td>';\n $info.= ((4-$timesheet['hours']) > 1) ? (4-$timesheet['hours']).\" Hrs\" : (4-$timesheet['hours']).\" Hr\";\n $info.= '</td>';\n\n $info.= '</tr>';\n }\n }\n\n\n }\n }else{\n $days = $days +1;\n\n $info.= '<tr>';\n\n $info.= '<td>';\n $info.= $day_array[$i];\n $info.= '</td>';\n\n $info.= '<td>';\n $info.= \"1 Day\";\n $info.= '</td>';\n\n $info.= '</tr>';\n }\n\n }\n }\n }\n $info.= '</table>';\n \n if($days > 0 || $hours > 0){\n \n if($days > 1){\n $day_print = $days.\" Days\";\n }else{\n $day_print = $days.\" Day\";\n }\n \n if($hours > 1){\n $hour_print = $hours.\" Hrs\";\n }else{\n $hour_print = $hours.\" Hr\";\n }\n \n $msg.= \"Hi \".$employee['emp_name'].\", <br><br>\";\n $msg.= \"Your salary calculation is going to process and your salary for below mentioned date/dates will be deducted.<br><br>\";\n $msg.= $info;\n $msg.= \"<br>Total of \".$day_print.\" and \".$hour_print.\".<br>\";\n $msg.= \"<br>Please take necessary action to prevent the deduction.<br><br>\";\n $msg.= \"Regards<br>\";\n $msg.= \"HR Department<br><br>\";\n $msg.= \"This is a system generated email. Please do not reply.<br>\";\n //echo $msg;\n $to = $employee['gi_email'];\n $subject = \"Salary Calculation\";\n $this->sendMail($to, $subject, $msg);\n }\n }\n \n }", "public function testLiberationDayOnAfter1949(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-4-25\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function calculateSeollal(): void\n {\n if ($this->year >= 1985 && isset(self::LUNAR_HOLIDAY['seollal'][$this->year])) {\n $seollal = new DateTime(self::LUNAR_HOLIDAY['seollal'][$this->year], DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $this->addHoliday(new Holiday(\n 'seollal',\n ['en' => 'Seollal', 'ko' => '설날'],\n $seollal,\n $this->locale\n ));\n if ($this->year > 1989) {\n $dayBeforeSeollal = clone $seollal;\n $dayBeforeSeollal->sub(new DateInterval('P1D'));\n $this->addHoliday(new Holiday(\n 'dayBeforeSeollal',\n ['en' => 'Day before Seollal', 'ko' => '설날 연휴'],\n $dayBeforeSeollal,\n $this->locale\n ));\n $dayAfterSeollal = clone $seollal;\n $dayAfterSeollal->add(new DateInterval('P1D'));\n $this->addHoliday(new Holiday(\n 'dayAfterSeollal',\n ['en' => 'Day after Seollal', 'ko' => '설날 연휴'],\n $dayAfterSeollal,\n $this->locale\n ));\n }\n }\n }", "public function pay_period_number($date)\n {\n // https://fireprotected.slack.com/archives/engineering/p1481217169000234\n // Every month has 2 pay periods. Going to mark them by pay date: i.e the first and third friday\n\t//june2018 will have 3: 1,15,29\n\n $pay_period_number = 0;\n\n\t//year can not be hard coded, why is this here?\n if ($date->year < 2018) return 1;\n\n // Get the Pay Dates for current month\n\n $paydates = $this->pay_dates_for_month($date);\n\n\n // See which one is after $date\n\n if ($paydates->first->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n\n\t//we are not in first period, did we pass up 2nd and there is a 3rd?\n if ($paydates->second->gte($date)) {\n\n\t\t\tlog_message('debug', '---------------------> paydates ' . print_r($paydates, true) );\n\n//what is this code doing?\n//the paydate is already a friday based on the code defining first/second/(third)\n/*\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n\t\t\tlog_message('debug', '---------------------> paydates check' . print_r($check, true) );\n\t\t\tlog_message('debug', '---------------------> paydates next friday' . print_r($friday, true) );\n if ($friday->isSameDay($paydates->second)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n*/\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n\n/*\n\t//rare, we have a 3rd\n if ( $paydates->third && $paydates->third->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n*/\n\n // if after them both, then use the next month's first pay date\n $paydates->second->addMonth();\n\n $nextMonthPaydates = $this->pay_dates_for_month($paydates->second);\n $pay_period_number = $nextMonthPaydates->first->month * 2;\n\t\t\t\t\tlog_message('debug', '---------------------> pay_period 3 or next month ' . print_r($pay_period_number, true) );\n return $pay_period_number - 1;\n }", "public function testIsBusinessDate()\n {\n // holidays\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-31'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-23'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-24'));\n\n // weekends\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-04'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-05'));\n\n // weekdays\n $this->assertTrue($this->getCalculator()->isBusinessDate('2019-05-01'));\n $this->assertTrue($this->getCalculator()->isBusinessDate('2019-05-09'));\n }", "function isWeekend($date) {\n return (date('N', strtotime($date)) >= 6);\n }", "public function testDayOfWeekNextYear()\n {\n // Test the day of the week for the next year - July 2nd 1991.\n $testDate2 = '02.07.1991';\n $retValueDate2 = $this->customCalendar->getDayOfWeek($testDate2);\n $this->assertNotNull($retValueDate2, \"The returned value from getDayOfWeek for \" . $testDate2);\n\n $dayOfWeekDate2 = 'Thursday';\n $this->assertEquals($dayOfWeekDate2, $retValueDate2);\n }", "function getBatchPaymentDate(){\n $paymentDate = date('Y-m-d');\n $currDateTs=strtotime($paymentDate);\n $offsetDays=0;\n if($this->cuttoffMissed===true){\n $offsetDays++;\n }\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n while ($this->isHoliday($paymentDate)==true) {\n $offsetDays++;\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n }\n \n\n return $paymentDate;\n }", "public function testBonusPaymentDate(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $bonusDateTime = new \\DateTime('15 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify->modify')\n ->twice()\n ->with('+14 days')\n ->andReturn($bonusDateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('15-02-2019', $result);\n }", "private function calculateReformationDay(): void\n {\n if ($this->year < 1517) {\n return;\n }\n\n $this->addHoliday($this->reformationDay($this->year, $this->timezone, $this->locale));\n }", "private function calculateReformationDay(): void\n {\n if ($this->year < 1517) {\n return;\n }\n\n $this->addHoliday($this->reformationDay($this->year, $this->timezone, $this->locale));\n }", "public function testDateTimeGetPublicHolidays()\n {\n }", "public function testWorkingDays()\n {\n $this->assertEquals(23, $this->testTraitClass->getWorkingDays(5, 1, 2019));\n $this->assertEquals(20, $this->testTraitClass->getWorkingDays(5, 2, 2019));\n $this->assertEquals(23, $this->testTraitClass->getWorkingDays(5, 7, 2019));\n $this->assertEquals(19, $this->testTraitClass->getWorkingDays(4, 7, 2019));\n $this->assertEquals(5, $this->testTraitClass->getWorkingDays(1, 7, 2019));\n $this->assertEquals(10, $this->testTraitClass->getWorkingDays(2, 7, 2019));\n $this->assertEquals(15, $this->testTraitClass->getWorkingDays(3, 7, 2019));\n $this->assertEquals(19, $this->testTraitClass->getWorkingDays(4, 7, 2019));\n }", "public function testIsWeekday()\n {\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-01')->isWeekday());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-02')->isWeekday());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-03')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-04')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-05')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-06')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-07')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-08')->isWeekday());\n }", "public function testGetBusinessDate()\n {\n $date = '2019-05-01';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-06T00:00:00Z', 5, 0, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-22';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-29T00:00:00Z', 7, 2, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-1';\n $delay = 16;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-27T00:00:00Z', 26, 2, 8))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n }", "public function isWeekend()\n {\n return (int)$this->date->format('N') > 5;\n }", "public function test_interval_hit_one() {\n\t\t$mock = get_week_mock(1);\n\t\t$mock->set_start('1980-01-01');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-08')));\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-15')));\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-22')));\n\t}", "public function calculateLiberationDay(): void\n {\n if ($this->year >= 1949) {\n $this->addHoliday(new Holiday(\n 'liberationDay',\n ['en' => 'Liberation Day', 'ko' => '광복절'],\n new DateTime(\"$this->year-8-15\", DateTimeZoneFactory::getDateTimeZone($this->timezone)),\n $this->locale\n ));\n }\n }", "function getWorkingDays($leave_start_date,$endDate)\n\t\t\t{\n\t\t\t\t $endDate = strtotime($endDate);\n\t\t\t\t $leave_start_date = strtotime($leave_start_date);\n\n\n\t\t\t\t //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n\t\t\t\t //We add one to inlude both dates in the interval.\n\t\t\t\t $days = ($endDate - $leave_start_date) / 86400 + 1;\n\n\t\t\t\t $no_full_weeks = floor($days / 7);\n\t\t\t\t $no_remaining_days = fmod($days, 7);\n\n\t\t\t\t //It will return 1 if it's Monday,.. ,7 for Sunday\n\t\t\t\t $the_first_day_of_week = date(\"N\", $leave_start_date);\n\t\t\t\t $the_last_day_of_week = date(\"N\", $endDate);\n\n\t\t\t\t //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n\t\t\t\t //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n\t\t\t\t if ($the_first_day_of_week <= $the_last_day_of_week) \n\t\t\t\t {\n\t\t\t\t if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n\t\t\t\t if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t // (edit by Tokes to fix an edge case where the start day was a Sunday\n\t\t\t\t // and the end day was NOT a Saturday)\n\n\t\t\t\t // the day of the week for start is later than the day of the week for end\n\t\t\t\t if ($the_first_day_of_week == 7) \n\t\t\t\t {\n\t\t\t\t // if the start date is a Sunday, then we definitely subtract 1 day\n\t\t\t\t $no_remaining_days--;\n\n\t\t\t\t if ($the_last_day_of_week == 6) \n\t\t\t\t {\n\t\t\t\t // if the end date is a Saturday, then we subtract another day\n\t\t\t\t $no_remaining_days--;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n\t\t\t\t // so we skip an entire weekend and subtract 2 days\n\t\t\t\t $no_remaining_days -= 2;\n\t\t\t\t }\n\t\t\t\t }\n\n\t\t\t\t //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\n\t\t\t\t\t//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n\t\t\t\t $workingDays = $no_full_weeks * 5;\n\t\t\t\t if ($no_remaining_days > 0 )\n\t\t\t\t {\n\t\t\t\t $workingDays += $no_remaining_days;\n\t\t\t\t } \n\t\t\t\t return $workingDays;\n\t\t\t}", "public function testRepublicDayBefore1946(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "public function testSundaySubstitution(): void\n {\n // 2020-06-28 constitutionDay (День Конституції)\n $year = 2020;\n $holiday = 'constitutionDay';\n\n $this->assertHolidayWithSubstitution(\n self::REGION,\n $holiday,\n $year,\n new \\DateTime(\"{$year}-06-28\", new \\DateTimeZone(self::TIMEZONE)),\n new \\DateTime(\"{$year}-06-29\", new \\DateTimeZone(self::TIMEZONE))\n );\n\n unset($year, $holiday);\n }", "public function salary_calculation(){\n \n $cur_month = date('m');\n $cur_year = date('Y');\n \n $last_month = date('m', strtotime('-1 month'));\n \n if($cur_month == 1){\n $year = $cur_year-1;\n }else{\n $year = $cur_year;\n }\n \n $num_days1 = cal_days_in_month(CAL_GREGORIAN, $last_month, $year);\n $day_array = array();\n $j=0;\n \n for($k=27; $k <= $num_days1; $k++){\n $date = $year.\"-\".$last_month.\"-\".$k;\n $weekDay = date('w', strtotime($date));\n \n $this->load->model('employee_model');\n $festival = $this->employee_model->get_festival($date);\n \n if($weekDay == 0 || $weekDay == 6){\n //echo $k.\"<br>\";\n }else if (!empty ($festival)){\n //echo $k.\"<br>\";\n }else{\n $day_array[$j] = $date;\n $j++;\n }\n }\n \n for($i=1; $i<= 26; $i++){\n \n $date = $cur_year.\"-\".$cur_month.\"-\".$i;\n $weekDay = date('w', strtotime($date));\n \n $this->load->model('employee_model');\n $festival = $this->employee_model->get_festival($date);\n \n if($weekDay == 0 || $weekDay == 6){\n //echo $i.\"<br>\";\n }else if (!empty ($festival)){\n //echo $i.\"<br>\";\n }else{\n $day_array[$j] = $date;\n $j++;\n }\n \n }\n \n $data_array = array();\n $array_count = 0;\n $employees = $this->employee_model->get_all_employees();\n \n $this->load->model('leave_model');\n $this->load->model('work_model');\n $this->load->model('short_leave_model');\n \n foreach($employees as $employee){\n $days = 0;\n $hours = 0;\n $msg = '';\n \n for($i=0; $i < sizeof($day_array); $i++){\n \n $date1=date_create($employee['doj']);\n $date2=date_create($day_array[$i]);\n $diff=date_diff($date1,$date2);\n $num_days = $diff->format(\"%R%a days\");\n \n if($num_days >= 0){\n $is_leave=$this->leave_model->get_date_wise_leave($day_array[$i], $employee['id']);\n\n if((!isset($is_leave) || empty($is_leave))){\n \n $timesheet = $this->work_model->get_approved_timesheet($day_array[$i], $employee['id']);\n\n if( (isset($timesheet) && !empty($timesheet)) ){\n if($timesheet['hours'] < 7){\n\n $is_half_day=$this->leave_model->get_date_wise_half_day($day_array[$i], $employee['id']);\n\n if((!isset($is_half_day) || empty($is_half_day))){\n\n $is_short_leave=$this->short_leave_model->get_date_wise_short_leave($day_array[$i], $employee['id']);\n\n if((!isset($is_short_leave) || empty($is_short_leave))){\n $hours = $hours + (8-$timesheet['hours']);\n \n if($hours >= 8){\n \n $days = ($days+floor($hours/8));\n $hours = $hours%8;\n }\n }else{\n if($timesheet['hours'] < 6){\n $hours = $hours + (6-$timesheet['hours']);\n \n if($hours >= 8){\n \n $days = $days + floor($hours/8);\n $hours = $hours%8;\n }\n }\n }\n\n }else{\n if($timesheet['hours'] < 3){\n $hours = $hours + (4-$timesheet['hours']);\n \n if($hours >= 8){\n \n $days = $days + floor($hours/8);\n $hours = $hours%8;\n }\n }\n }\n\n\n }\n }else{\n \n $days = $days +1;\n }\n\n }\n }\n }\n \n if($days > 0 || $hours > 0){\n \n if($days > 1){\n $day_print = $days.\" Days\";\n }else{\n $day_print = $days.\" Day\";\n }\n \n if($hours > 1){\n $hour_print = $hours.\" Hrs\";\n }else{\n $hour_print = $hours.\" Hr\";\n }\n \n $data_array[$array_count] = array(\n 'Employee ID' => $employee['empID'],\n 'Employee Name' => $employee['emp_name'],\n 'Deduction' => $day_print.\" \".$hour_print\n );\n $array_count++;\n \n// $msg.= \"Hi \".$employee['emp_name'].\", <br><br>\";\n// $msg.= \"Your salary calculation is going to process and your salary for below mentioned date/dates will be deducted.<br><br>\";\n// $msg.= $info;\n// $msg.= \"<br>Total of \".$day_print.\" and \".$hour_print.\".<br>\";\n// $msg.= \"<br>Please take necessary action to prevent the deduction.<br><br>\";\n// $msg.= \"Regards<br>\";\n// $msg.= \"HR Department<br>\";\n// echo $msg;\n\n }\n }\n \n //echo \"<pre>\"; print_r($data_array); echo \"</pre>\";\n \n $start_date = $day_array[0];\n $end_date = $day_array[sizeof($day_array)-1];\n $filename='Salary_Calculation_CRG_'.time().'.xls';\n\n $headers = array('Employee ID', 'Employee Name', 'Deduction');\n\n $title = 'Salary Deduction for Period '.date('jS M, Y', strtotime($start_date)).' to '.date('jS M, Y', strtotime($end_date));\n\n $this->create_excel_general($headers, $data_array, $filename, $title, 'assets/salary_calc/');\n \n// $attachment = 'assets/salary_calc/'.$filename;\n// $to = punet.dwivedi@crgroup.com;\n// $subject = \"Salary Calculation\";\n// $this->sendMail($to, $subject, $msg, '', $attachment);\n \n }", "function trialProductsCalcDate($relid) {\n\n // get free period value\n $days = trialProductsGetFreePeriod($relid);\n\n $date = new \\DateTime();\n\n // calc next duedate\n $date->modify('+' . $days . ' days');\n\n $date = $date->format('Y-m-d');\n\n return $date;\n\n}", "public function testDayOfWeekPrevYear()\n {\n // Test the day of the week for the next year - Jan 1st 1989.\n $testDate2 = '01.01.1989';\n $retValueDate2 = $this->customCalendar->getDayOfWeek($testDate2);\n $this->assertNotNull($retValueDate2, \"The returned value from getDayOfWeek for \" . $testDate2);\n\n $dayOfWeekDate2 = 'Tuesday';\n $this->assertEquals($dayOfWeekDate2, $retValueDate2);\n }", "function getWorkingDays($startDate, $endDate)\n{\n$begin = strtotime($startDate);\n$end = strtotime($endDate);\nif ($begin > $end) {\nreturn 0;\n} else {\n$no_days = 0;\n\nwhile ($begin <= $end) {\n$what_day = date(\"N\", $begin);\nif (!in_array($what_day, [4,5,6]) ) // 6 and 7 are weekend\n$no_days++;\n$begin += 86400; // +1 day\n};\n\nreturn $no_days;\n}\n}", "public function testRespectForTheAgedDayBetween1996And2003SubstitutedNextWorkingDay(): void\n {\n $year = 2002;\n $this->assertHoliday(\n self::REGION,\n self::SUBSTITUTE_PREFIX.self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-9-16\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "function weekend_days($starttime, $duration)\n{\n if ($starttime && $duration)\n {\n $org_st = $starttime;\n\n for ($i = 0;$i < $duration;$i++)\n {\n $daty = date(w, $starttime);\n $startdate = date(\"d-M-Y\", $starttime);\n $starttime = $starttime + (60 * 60 * 24);\n\n if ($daty == 0 || $daty == 6)\n {\n $x = $x + 1;\n # $duration = $duration +1;\n \n }\n else\n {\n $leave = HolidayCheck($startdate);\n if ($leave == 1) $x = $x + 1;\n }\n\n }\n\n }\n if (!$x) $x = 0;\n return $x;\n}", "public function testExample()\n {\n\n // $dateStr = '2017-4-7 00:00:00';\n \n \n // $start = date_create($dateStr);\n // $end = date_create($dateStr);\n \n \n \n // $i = 0;\n // $datafac = new ReportUserrbSubDayData();\n // //$datafac->makeAllDayReport();\n // //$datafac->makeSettlement(\"2017-04-06 0:00:00\",\"2017-04-07 0:00:00\",\"CYC01\");\n \n // // while($i<69){\n // dump(\"Begin.\");\n // date_add($end,date_interval_create_from_date_string(\"1 day\"));\n // dump($start);\n // dump($end); \n\n // $userFac = new UserData();\n\n // // $pageSize = 100;\n // // $pageIndex = 1;\n // $result = $userFac->query([],$pageSize,$pageIndex);\n // while($pageIndex<=($result[\"pageCount\"])){ \n // foreach($result[\"items\"] as $resultitem){\n \n // $datafac->createReport(\n // date_format($start,\"Y-m-d H:00:00\"),\n // date_format($end,\"Y-m-d H:00:00\"),\n // \"CYC01\"); \n // // $datafac->makeReport(\"RUR2017070315112107465\",3);\n // // }\n // // $pageIndex ++;\n // // $result = $userFac->query([],$pageSize,$pageIndex); \n // //}\n \n // date_add($start,date_interval_create_from_date_string(\"1 day\"));\n \n // // $i++;\n \n // // }\n \n // $this->assertTrue(true);\n }", "public function testIsWorkingDay()\n\t{\n\t\t$free = array(\n\t\t\t'2010-01-01',\n\t\t\t'2010-11-17',\n\t\t\t'2010-12-24',\n\t\t\t'2011-01-16',\n\t\t\t'2011-04-25',\n\t\t\t'2020-04-13'\n\t\t);\n\n\t\t$working = array(\n\t\t\t'2010-12-31',\n\t\t\t'2011-07-20',\n\t\t\t'2010-11-11',\n\t\t\t'2020-04-14'\n\t\t);\n\n\t\tforeach ($free as $day) {\n\t\t\t$this->assertFalse(Jyxo_Time_Util::isWorkDay(new Jyxo_Time_Time($day)));\n\t\t}\n\n\t\tforeach ($working as $day) {\n\t\t\t$this->assertTrue(Jyxo_Time_Util::isWorkDay(new Jyxo_Time_Time($day)));\n\t\t}\n\t}", "public function lastDayIsAWorkingDay()\r\n {\r\n $todaydate = new \\DateTime(date('m/d/Y h:i:s a', time()));\r\n //initialise to this month, last day\r\n $workingDayStringVal = $todaydate->modify('last day of this month');\r\n \r\n if(date('N', strtotime($workingDayStringVal)) <= 6)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "public function paySalary()\n {\n }", "public function testConstitutionMemorialDayOnAfter1948()\n {\n $year = 1967;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-3\", new DateTimeZone(self::TIMEZONE)));\n $year = 2009;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-6\", new DateTimeZone(self::TIMEZONE))); // Substituted day\n }", "public function calculateIndependenceMovementDay(): void\n {\n if ($this->year >= 1949) {\n $this->addHoliday(new Holiday(\n 'independenceMovementDay',\n ['en' => 'Independence Movement Day', 'ko' => '삼일절'],\n new DateTime(\"$this->year-3-1\", DateTimeZoneFactory::getDateTimeZone($this->timezone)),\n $this->locale\n ));\n }\n }", "function isWeekend() {\n $weekday = $this->getWeekday();\n return $weekday == 0 || $weekday == 6;\n }", "function isWeekend()\r\n {\r\n return $this->weekendflag; \r\n }", "public function testOfficialHolidays(): void\n {\n $officialHolidays = [];\n\n if ($this->year >= 1949) {\n $officialHolidays[] = 'independenceMovementDay';\n $officialHolidays[] = 'liberationDay';\n $officialHolidays[] = 'nationalFoundationDay';\n $officialHolidays[] = 'newYearsDay';\n $officialHolidays[] = 'chuseok';\n $officialHolidays[] = 'christmasDay';\n\n if ($this->year >= 1950 && $this->year < 1976) {\n $officialHolidays[] = 'unitedNationsDay';\n }\n\n if ($this->year >= 1956) {\n $officialHolidays[] = 'memorialDay';\n }\n\n if ($this->year >= 1975) {\n $officialHolidays[] = 'childrensDay';\n $officialHolidays[] = 'buddhasBirthday';\n }\n\n if ($this->year >= 1976 && $this->year <= 1990) {\n $officialHolidays[] = 'armedForcesDay';\n }\n\n if ($this->year >= 1985) {\n $officialHolidays[] = 'seollal';\n }\n\n if ($this->year >= 1986) {\n $officialHolidays[] = 'dayAfterChuseok';\n }\n\n if ($this->year >= 1989) {\n $officialHolidays[] = 'dayBeforeChuseok';\n $officialHolidays[] = 'dayBeforeSeollal';\n $officialHolidays[] = 'dayAfterSeollal';\n }\n\n if ($this->year <= 1989) {\n $officialHolidays[] = 'twoDaysLaterNewYearsDay';\n }\n\n if ($this->year <= 1990 || $this->year > 2012) {\n $officialHolidays[] = 'hangulDay';\n }\n\n if ($this->year <= 1998) {\n $officialHolidays[] = 'dayAfterNewYearsDay';\n }\n\n if ($this->year <= 2005) {\n $officialHolidays[] = 'arborDay';\n }\n\n if ($this->year < 2008) {\n $officialHolidays[] = 'constitutionDay';\n }\n }\n\n $this->assertDefinedHolidays($officialHolidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL);\n }", "function fn_cp_admin_checkout_modifications_get_planned_date($number_working_days, $company_id, $date = 0)\n{\n if (empty($date)) {\n $date = strtotime('now');\n }\n\n\n $added_days = 0;\n $i = 0;\n\n /* We need it?*/\n\n /*$first_day_analizator = new DayAnalizator($company_id, $date);\n $first_working_day = $first_day_analizator->isWorkDay();\n if ($first_working_day != 1) {\n $number_working_days ++;\n }*/\n \n while ($added_days <= $number_working_days) {\n //$checked_day = date('Ymd',strtotime(\"+ $i days\"));\n //$is_working_day = fn_cp_get_working_day($checked_day);\n\n $i++;\n\n $day_analizator = new DayAnalizator($company_id, $date + ($i * SECONDS_IN_DAY));\n $is_working_day = $day_analizator->isWorkDay(false);\n\n if ($is_working_day == 1) {\n $added_days++;\n\n }\n }\n\n $date = strtotime(\"+$i day\", $date);\n\n return $date;\n}", "public function get_working_days($startDate,$endDate,$holidays){\n $endDate = strtotime($endDate);\n $startDate = strtotime($startDate);\n\n\n //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n //We add one to inlude both dates in the interval.\n $days = ($endDate - $startDate) / 86400 + 1;\n\n $no_full_weeks = floor($days / 7);\n $no_remaining_days = fmod($days, 7);\n\n //It will return 1 if it's Monday,.. ,7 for Sunday\n $the_first_day_of_week = date(\"N\", $startDate);\n $the_last_day_of_week = date(\"N\", $endDate);\n\n //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n if ($the_first_day_of_week <= $the_last_day_of_week) {\n if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n }\n else {\n // (edit by Tokes to fix an edge case where the start day was a Sunday\n // and the end day was NOT a Saturday)\n\n // the day of the week for start is later than the day of the week for end\n if ($the_first_day_of_week == 7) {\n // if the start date is a Sunday, then we definitely subtract 1 day\n $no_remaining_days--;\n\n if ($the_last_day_of_week == 6) {\n // if the end date is a Saturday, then we subtract another day\n $no_remaining_days--;\n }\n }\n else {\n // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n // so we skip an entire weekend and subtract 2 days\n $no_remaining_days -= 2;\n }\n }\n\n //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\n//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n $workingDays = $no_full_weeks * 5;\n if ($no_remaining_days > 0 )\n {\n $workingDays += $no_remaining_days;\n }\n\n //We subtract the holidays\n foreach($holidays as $holiday){\n $time_stamp=strtotime($holiday);\n //If the holiday doesn't fall in weekend\n if ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\",$time_stamp) != 6 && date(\"N\",$time_stamp) != 7)\n $workingDays--;\n }\n\n return $workingDays;\n}", "public function testFirstMondayDate()\n {\n $this->assertEquals(7, $this->testTraitClass->getFirstMondayDate(1, 2019));\n $this->assertEquals(4, $this->testTraitClass->getFirstMondayDate(2, 2019));\n $this->assertEquals(1, $this->testTraitClass->getFirstMondayDate(7, 2019));\n }", "public function test_interval_hit() {\n\t\t$mock = get_week_mock(5);\n\t\t$mock->set_start('1980-03-01');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t// Create future dates that coincides with the repeat interval\n\t\t$input1 = mock_date('1980-04-07');\n\t\t$input2 = mock_date('1980-05-14');\n\t\t$input3 = mock_date('1980-06-19');\n\n\t\t$this->assertTrue($schedule->match_week_interval($input1));\n\t\t$this->assertTrue($schedule->match_week_interval($input2));\n\t\t$this->assertTrue($schedule->match_week_interval($input3));\n\t}", "public function testExtendDueDate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function chk_business_day($start_time, $item_id) {\n $start_date=strtotime(date('Y-m-d',$start_time));\n /* Get Weekdate */\n $dayweek=date('w',$start_date);\n /* Get weekends */\n $this->db->select('item_id, c.calendar_id as calendar_id, c.mon_work, c.tue_work, c.wed_work, c.thu_work, c.fri_work, c.sat_work, c.sun_work',FALSE);\n $this->db->from('sb_items i');\n $this->db->join('sb_vendor_items vi','vi.vendor_item_id=i.vendor_item_id');\n $this->db->join(\"vendors v\",\"v.vendor_id=vi.vendor_item_vendor\");\n $this->db->join(\"calendars c\",\"c.calendar_id=v.calendar_id\");\n $this->db->where('i.item_id',$item_id);\n $cal = $this->db->get()->row_array();\n switch ($dayweek) {\n case 0:\n $workday=$cal['sun_work'];\n break;\n case 1:\n $workday=$cal['mon_work'];\n break;\n case 2:\n $workday=$cal['tue_work'];\n break;\n case 3:\n $workday=$cal['wed_work'];\n break;\n case 4:\n $workday=$cal['thu_work'];\n break;\n case 5:\n $workday=$cal['fri_work'];\n break;\n case 6:\n $workday=$cal['sat_work'];\n break;\n }\n if ($workday==1) {\n /* Get Holiday */\n $this->db->select('count(calendar_line_id) cnt');\n $this->db->from('calendar_lines');\n $this->db->where('calendar_id',$cal['calendar_id']);\n $this->db->where('line_date',$start_date);\n $res=$this->db->get()->row_array();\n if ($res['cnt']==0) {\n return 1;\n } else {\n return 0;\n }\n } else {\n return $workday;\n }\n }", "public function test_adding_13_days_to_31_jan_returns_13_feb(): void\n {\n $this->assertEquals(\n new DateTime('2019-02-13'),\n Date::addPeriod(new DateTime('2019-01-31'), Date::PERIOD_DAY, 13)\n );\n }", "public function calculateEventPayDay($date)\n {\n $date = \\DateTime::createFromFormat('Y-m-d H:i:s', $date);\n $day = $date->format('d');\n $period = (int)($day / 7) + 1;\n $baseDate = ($period * 7);\n $payday = $baseDate + 4;\n $date->setDate($date->format('Y'), $date->format('m'), $payday);\n if ($date->format('N') == 6 || $date->format('N') == 7) {\n while ($date->format('N') != 4) {\n $date->setDate($date->format('Y'), $date->format('m'), ($date->format('d') + 1));\n }\n }\n\n return $date;\n\n }", "public function testIsSunday()\n {\n $data = $this->_data;\n\n $data['startTime'] = gmdate('c', strtotime('next Sunday'));\n $s = new App_Service_Amazon_Ec2_EbsSnapshot($data);\n $this->assertTrue($s->isSunday());\n\n $data['startTime'] = gmdate('c', strtotime('next Thursday'));\n $s = new App_Service_Amazon_Ec2_EbsSnapshot($data);\n $this->assertFalse($s->isSunday());\n }", "public function testTruthAndReconciliationDayBefore2021(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "public function testAddingStartingPriceForUser()\n {\n $targetPrice = 101;\n $now = Carbon::now();\n\n Week::storePrice($this->user->phone_number,$targetPrice);\n\n /** @var Week $week */\n $week = Week::where('year', '=', $now->year)\n ->where('week', '=', $now->week)\n ->where('user_id', '=', $this->user->id)\n ->first();\n\n $this->assertEquals(\n $week->price_start,\n $targetPrice,\n 'Could not assert price_start was set on the correct week'\n );\n $this->assertNull($week->price_monday_morning);\n }", "private function weeklyPaymentCount(){\n $last_saturday = date(\"Y-m-d\",strtotime(\"last saturday\")); \n //get all worker info who is monthly pated\n $workerInfo = DB::table('workar_basic_infos')\n ->join('worker_payment_infos', 'workar_basic_infos.id', '=', 'worker_payment_infos.workerId')\n ->where('worker_payment_infos.paymentType',2)\n ->whereDate('workar_basic_infos.created_at', '<=',$last_saturday)\n ->select('workar_basic_infos.*')->get();\n \n //make a foreach loop then one by one chack attendes and worker time\n foreach ($workerInfo as $wokerInfo)\n {\n //check is this worker salary/wages already count or not\n $prv_saturday = date(\"Y-m-d\",strtotime(\"last saturday -1 week\"));\n $salery_wages_check = SalaryInfo::where('workerId', $wokerInfo->id)->whereDate('salaryTo','=',$prv_saturday)\n ->whereDate('salaryFrom','=',$last_saturday)->first();\n\n //check salary or wagies allready store or not\n if (is_null($salery_wages_check) || empty($salery_wages_check))\n { \n //store and calculate worker salary and wagies\n $this->SalaryAndWagesCalculate($wokerInfo->id,Null,NuLL,7);\n \n }\n \n }\n return;\n }", "function isWeekend( $date )\r\n\t\t{\r\n\t\t$weekendDays = array ( 0, 6 );\r\n\t\t$dateArray = getdate( $date );\r\n\t\tif ( in_array( $dateArray[ 'wday' ], $weekendDays ) ) return true;\r\n\t\telse\r\n\t\treturn false;\r\n\t\t}", "function getWorkingDays($startDate, $endDate, $holidays)\n {\n $endDate = strtotime($endDate);\n $startDate = strtotime($startDate);\n //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n //We add one to inlude both dates in the interval.\n $days = ($endDate - $startDate) / 86400 + 1;\n $no_full_weeks = floor($days / 7);\n $no_remaining_days = fmod($days, 7);\n //It will return 1 if it's Monday,.. ,7 for Sunday\n $the_first_day_of_week = date(\"N\", $startDate);\n $the_last_day_of_week = date(\"N\", $endDate);\n //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n if ($the_first_day_of_week <= $the_last_day_of_week) {\n if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n } else {\n // (edit by Tokes to fix an edge case where the start day was a Sunday\n // and the end day was NOT a Saturday)\n // the day of the week for start is later than the day of the week for end\n if ($the_first_day_of_week == 7) {\n // if the start date is a Sunday, then we definitely subtract 1 day\n $no_remaining_days--;\n if ($the_last_day_of_week == 6) {\n // if the end date is a Saturday, then we subtract another day\n $no_remaining_days--;\n }\n } else {\n // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n // so we skip an entire weekend and subtract 2 days\n $no_remaining_days -= 2;\n }\n }\n //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\n //---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n $workingDays = $no_full_weeks * 5;\n if ($no_remaining_days > 0) {\n $workingDays += $no_remaining_days;\n }\n //We subtract the holidays\n foreach ($holidays as $holiday) {\n $time_stamp = strtotime($holiday);\n //If the holiday doesn't fall in weekend\n if ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\", $time_stamp) != 6 && date(\"N\", $time_stamp) != 7)\n $workingDays--;\n }\n return $workingDays;\n }", "function getWorkingDays($startDate, $endDate, $holidays) {\r\n\r\n // do strtotime calculations just once\r\n $endDate = strtotime($endDate);\r\n $startDate = strtotime($startDate);\r\n\r\n\r\n //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\r\n //We add one to inlude both dates in the interval.\r\n $days = ($endDate - $startDate) / 86400;\r\n\r\n $no_full_weeks = floor($days / 7);\r\n $no_remaining_days = fmod($days, 7);\r\n\r\n //It will return 1 if it's Monday,.. ,7 for Sunday\r\n $the_first_day_of_week = date(\"N\", $startDate);\r\n $the_last_day_of_week = date(\"N\", $endDate);\r\n\r\n //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\r\n //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\r\n if ($the_first_day_of_week <= $the_last_day_of_week) {\r\n if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week)\r\n $no_remaining_days--;\r\n if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week)\r\n $no_remaining_days--;\r\n } else {\r\n // (edit by Tokes to fix an edge case where the start day was a Sunday\r\n // and the end day was NOT a Saturday)\r\n // the day of the week for start is later than the day of the week for end\r\n if ($the_first_day_of_week == 7) {\r\n // if the start date is a Sunday, then we definitely subtract 1 day\r\n $no_remaining_days--;\r\n\r\n if ($the_last_day_of_week == 6) {\r\n // if the end date is a Saturday, then we subtract another day\r\n $no_remaining_days--;\r\n }\r\n } else {\r\n // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\r\n // so we skip an entire weekend and subtract 2 days\r\n $no_remaining_days -= 2;\r\n }\r\n }\r\n\r\n //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\r\n//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\r\n $workingDays = $no_full_weeks * 5;\r\n if ($no_remaining_days > 0) {\r\n $workingDays += $no_remaining_days;\r\n }\r\n\r\n //We subtract the holidays\r\n foreach ($holidays as $holiday) {\r\n $time_stamp = strtotime($holiday);\r\n //If the holiday doesn't fall in weekend\r\n if ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\", $time_stamp) != 6 && date(\"N\", $time_stamp) != 7)\r\n $workingDays--;\r\n }\r\n\r\n if ($workingDays < 0) {\r\n $workingDays = .01;\r\n }\r\n return $workingDays;\r\n\r\n\r\n ////Example:\r\n//\r\n//$holidays=array(\"2008-12-25\",\"2008-12-26\",\"2009-01-01\");\r\n//\r\n//echo getWorkingDays(\"2008-12-22\",\"2009-01-02\",$holidays)\r\n//// => will return 7\r\n//\r\n}", "function daysUntilRentDue($property_id, $final_rent){\n\t\tglobal $db;\n\t\t$tenancies = getTenant($property_id);\n\t\t// TODO: Needs to handle multiple tenancies (over time)\n\t\t$tenancy = $tenancies[0];\n\t\t$tenancy_id = $tenancy[\"tenancy_id\"];\n\t\t$tenant_id = $tenancy[\"tenant_id\"];\n\n\t\t// Get daily rent amount\n\t\t$daily_rent = getDailyRent($tenant_id, $property_id);\n\t\t// Days paid since tenancy started\n\t\t$daysPaid = floor($final_rent / $daily_rent);\n\t\t// Now work out days between (day_start)+days paid and today\n\t\t$start_date = date_create($tenancy[\"start_date\"]);\n\t\t// ad the days paid\n\t\t$start_date->add(new DateInterval(\"P\".$daysPaid.\"D\"));\n\t\t// generate today\n\t\t$today = date_create();\n\t\t// now work out the difference between today and how far we've paid\n\t\t$diff = $today->diff($start_date);\n\t\t$days_until = $diff->days;\n\t\tif($diff->invert){\n\t\t\t// PHP date objects don't like negative days\n\t\t\t// but instead use a invert field\n\t\t\t// so if it's inverted, multiply by -1\n\t\t\t$days_until *= -1;\n\t\t}\n\t\t\n\t\treturn $days_until;\n\t}", "function getDateForSpecificDayBetweenDates($start, $end, $weekday)\n {\n $weekdays=\"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\";\n $arr_weekdays=explode(\",\", $weekdays);\n $arr_weekdays_day = explode(\",\", $weekday);\n //print_r($arr_weekdays_day);\n $i = 1;\n\t\t$string='';\n foreach($arr_weekdays_day as $weekdays)\n {\n\t\t\tif($weekdays==1){$weekdays=0;}elseif($weekdays==2){$weekdays=1;}elseif($weekdays==3){$weekdays=2;}elseif($weekdays==4){$weekdays=3;}elseif($weekdays==5){$weekdays=4;}elseif($weekdays==6){$weekdays=5;}elseif($weekdays==7){$weekdays=6;}\n $weekday = $arr_weekdays[$weekdays];\n if(!$weekday)\n $this->inventory_model->store_error(current_user_type(),hotel_id(),\"2\",'Invalid WeekDay','Bulk Update',date('m/d/Y h:i:s a', time()));\n $starts\t= strtotime(\"+0 day\", strtotime($start) );\n\t\t\t//$starts\t= strtotime($start);\n $ends\t= strtotime($end);\n //$dateArr = array();\n $friday = strtotime($weekday, $starts);\n while($friday <= $ends)\n {\n /*$dateArr[] = date(\"Y-m-d\", $friday);\n $friday = strtotime(\"+1 weeks\", $friday);*/\n $dateArr[] = date(\"Y-m-d\", $friday);\n $date \t= date(\"Y-m-d\", $friday);\n $string .= \"value\".$i.\"='\".$date.\"' \";\n $friday = strtotime(\"+1 weeks\", $friday);\n $i++;\n }\n //$dateArr[] = date(\"Y-m-d\", $friday);\n }\n\t\t//echo $string.'<br>';\n //return $dateArr;\n return $string;\n }", "public function testValidationHolidaysOk()\n {\n $noHolidaysConstraint = new NoHolidays();\n $noHolidaysValidator = $this->initValidator();\n\n $noHolidaysValidator->validate(new \\DateTime(\"2018-12-24\"), $noHolidaysConstraint);\n\n }", "public function AllowPayOnDay()\n\t{\n\t\treturn false;\n\t}", "public function standardWorkDay() {\n $this->set_time(8, 17);\n }", "function Date_Holidays()\n {\n }", "public function testGetPayableTimeForFullSingleDay()\n {\n $calculator = new ParkingTimeCalculator();\n $parking = new Parking(strtotime('2017-02-13 12:00:00'), strtotime('2017-02-13 17:00:00'));\n $periodStart = '13:00';\n $periodEnd = '16:00';\n\n $this->assertEquals(180, $calculator->getPayableMinutes($parking, $periodStart, $periodEnd));\n }", "function dtlIsWeekend($dts) {\n // * returns false if invalid input\n if (!dtlIsValidDate($dts) && !dtlIsValidDateTime($dts)) {\n return false;\n }\n $dowName = dtlGetDayName($dts, 'EN');\n return $dowName == 'Sunday' || $dowName == 'Saturday';\n}", "function getDiasUteis($startDate,$endDate,$holidays){\n\t // do strtotime calculations just once\n\t $endDate = strtotime($endDate);\n\t $startDate = strtotime($startDate);\n\t\n\t\n\t //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n\t //We add one to inlude both dates in the interval.\n\t $days = ($endDate - $startDate) / 86400 + 1;\n\t\n\t $no_full_weeks = floor($days / 7);\n\t $no_remaining_days = fmod($days, 7);\n\t\n\t //It will return 1 if it's Monday,.. ,7 for Sunday\n\t $the_first_day_of_week = date(\"N\", $startDate);\n\t $the_last_day_of_week = date(\"N\", $endDate);\n\t\n\t //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n\t //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n\t if ($the_first_day_of_week <= $the_last_day_of_week) {\n\t if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n\t if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n\t }\n\t else {\n\t // (edit by Tokes to fix an edge case where the start day was a Sunday\n\t // and the end day was NOT a Saturday)\n\t\n\t // the day of the week for start is later than the day of the week for end\n\t if ($the_first_day_of_week == 7) {\n\t // if the start date is a Sunday, then we definitely subtract 1 day\n\t $no_remaining_days--;\n\t\n\t if ($the_last_day_of_week == 6) {\n\t // if the end date is a Saturday, then we subtract another day\n\t $no_remaining_days--;\n\t }\n\t }\n\t else {\n\t // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n\t // so we skip an entire weekend and subtract 2 days\n\t $no_remaining_days -= 2;\n\t }\n\t }\n\t\n\t //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\n\t//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n\t $workingDays = $no_full_weeks * 5;\n\t if ($no_remaining_days > 0 )\n\t {\n\t $workingDays += $no_remaining_days;\n\t }\n\t\n\t //We subtract the holidays\n\t foreach($holidays as $holiday){\n\t $time_stamp=strtotime($holiday);\n\t //If the holiday doesn't fall in weekend\n\t if ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\",$time_stamp) != 6 && date(\"N\",$time_stamp) != 7)\n\t $workingDays--;\n\t }\n\t\n\t return $workingDays;\n\t}", "function dateOfWeek($Ymd, $day, $week_start_day = 'Sunday') {\n// global $week_start_day;\n if (!isset($week_start_day)) $week_start_day = 'Sunday';\n $timestamp = strtotime($Ymd);\n $num = date('w', strtotime($week_start_day));\n $start_day_time = strtotime((date('w',$timestamp)==$num ? \"$week_start_day\" : \"last $week_start_day\"), $timestamp);\n $ret_unixtime = strtotime($day,$start_day_time);\n // Fix for 992744\n // $ret_unixtime = strtotime('+12 hours', $ret_unixtime);\n $ret_unixtime += (12 * 60 * 60);\n $ret = date('Ymd',$ret_unixtime);\n return $ret;\n}", "public function isWeekend(): bool\n {\n return in_array((int) $this->getData()['dayOfWeek'], [0, 6], true);\n }", "public function get_suspend_until_date($numWeeksToSuspend){\n date_default_timezone_set('America/Los_Angeles');\n $date = strtotime(date('Y-m-d G:i:s'));\n $thursday = strtotime(date('Y-m-d', strtotime('next Thursday')));\n if($thursday - $date >= 7){\n $numWeeksToSuspend += 1; \n }\n\n return date('Y-m-d', strtotime('+'.$numWeeksToSuspend.' Sunday'));\n \n }", "function expirationdatesubs($plan,$sub_professional,$sub_enterprise,$remdays,$plan_expire,$currentplan){\r\n $subs=1;\r\n if($plan==2){$subs = $sub_professional;}\r\n if($plan==3){$subs = $sub_enterprise;}\r\n\r\n if($currentplan=='Trial'){\r\n $dadate = date('Y-m-d');\r\n }else{\r\n if($remdays>=1){\r\n $dadate = $plan_expire;\r\n }else{\r\n $dadate = date('Y-m-d');\r\n }\r\n }\r\n\r\n $date = new DateTime($dadate);\r\n $date->modify('+'.$subs.' month');\r\n $date = $date->format('Y-m-d');\r\n return $date;\r\n //date('Y-m-d', strtotime($date. ' + 14 days'))\r\n }", "public function checkWeekLimit(array $payments)\n\t{\n\t\t$users = $this->groupPaymentsByUser($payments);\n\n\t foreach ($users as $user_id) {\n\n\t \t$sum = 0;\n\t \t$date1 = null;\n\t \t$week_day = 0;\n\t \t$cash_out_count = 0;\n\n\t\t\t// all user operations\n\t \tforeach ($user_id as $user) {\n\n\t\t \tif ($user->operation == 'cash_out') {\n\n\t\t \t\t// user cash out times\n\t\t \t\t$cash_out_count++;\n\t\t \t\n\t\t\t \tif ($date1 == null) {\n\n\t\t\t \t\t// set first cash out date and week day\n\t\t\t \t\t$date1 = new \\DateTime($user->date);\n\t\t \t\t\t$week_day = date('w', strtotime($user->date));\n\n\t\t \t\t\t// make Sunday from 0 to 7\n\t\t \t\t\tif ($week_day == 0) {\n\n\t\t \t\t\t\t$week_day = 7;\n\n\t\t \t\t\t}\n\n\t\t\t \t\t$user->difference = 0;\n\t\t\t \t\t$sum = $this->convertToEur($user->amount, $user->currency);\n\n\t\t\t \t\tif ($sum > self::CASH_OUT_WEEK_LIMIT) {\n\n\t\t\t\t \t\t$user->week_amount_eur = $sum;\n\t\t\t\t \t\t$sum = self::CASH_OUT_WEEK_LIMIT;\n\t\t\t \t\t\t\n\t\t\t \t\t} else {\n\n\t\t\t \t\t\t$user->week_amount_eur = $sum;\n\n\t\t\t \t\t}\n\n\t\t\t \t} else {\n\t\t\t \t\t// other cash out dates and week days\n\t\t\t \t\t$date2 = new \\DateTime($user->date);\n\t\t \t\t\t$week_day2 = date('w', strtotime($user->date));\n\n\t\t \t\t\t// make Sunday from 0 to 7\n\t\t \t\t\tif ($week_day2 == 0) {\n\n\t\t \t\t\t\t$week_day2 = 7;\n\n\t\t \t\t\t}\n\n\t\t \t\t\t// days between cash outs\n\t\t\t \t\t$interval = $date1->diff($date2);\n\t\t\t\t\t\t$user->difference = $interval->format('%a');\n\n\t\t\t\t\t\t// check if it is same week from Monday to Sunday\n\t\t\t\t\t\tif ($user->difference < 7 && $week_day2 >= $week_day) {\n\n\t\t\t \t\t\t$sum += $this->convertToEur($user->amount, $user->currency);\n\n\t\t\t \t\t\tif ($sum > self::CASH_OUT_WEEK_LIMIT) {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $sum;\n\t\t\t \t\t\t\t$sum = self::CASH_OUT_WEEK_LIMIT;\n\n\t\t\t \t\t\t} else if ($cash_out_count > self::CASH_OUT_COUNT_LIMIT) {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $this->convertToEur($user->amount, $user->currency) + self::CASH_OUT_WEEK_LIMIT;\n\n\t\t\t \t\t\t} else {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $sum;\n\t\t\t \t\t\t\n\t\t\t \t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$sum = $this->convertToEur($user->amount, $user->currency);\n\t\t\t\t \t\t$user->week_amount_eur = $sum;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$date1 = $date2;\n\t\t\t\t\t\t$week_day = $week_day2;\n\n\t\t\t \t}\n\n\t\t\t } else {\n\n\t\t\t \t$user->week_amount_eur = 0;\n\t\t\t \t$user->difference = 0;\n\n\t\t\t }\n\t \t}\n\t }\n\n\t\treturn $payments;\n\t}", "public function testGettingWebPublishingDates()\n {\n // Product with start date but with no end date\n $expectedWebPublishingStartDate = new DateTime('2014-08-15');\n $this->assertEquals($expectedWebPublishingStartDate, $this->groschen->getWebPublishingStartDate());\n $this->assertNull($this->groschen->getWebPublishingEndDate());\n\n // Product with both dates\n $groschen = new Groschen('9789510240243');\n $expectedWebPublishingStartDate = new DateTime('2019-02-21');\n $expectedWebPublishingEndDate = new DateTime('2019-02-25');\n $this->assertEquals($expectedWebPublishingStartDate, $groschen->getWebPublishingStartDate());\n $this->assertEquals($expectedWebPublishingEndDate, $groschen->getWebPublishingEndDate());\n }", "function check_paid_record($insdate=null,$paydate=null,$tmz_id=null,$paydays=null) {\n\t $status = 0;\t\n\t $today = date('Y-m-d');\t\n $tmz = isset($tmz_id) ? $tmz_id : $this->tmz_id;\t \n\t //echo $insdate,'>>',$paydate,'>>',$tmz_id,'>>';\n\t $tmz_today = $this->make_gmt_date(null,$tmz); \n\t $paydays = $paydays?intval($paydays):0;\n\t\n\t if ($paydate)\n $expres = $this->date_diff($tmz_today,$paydate) + $this->freedays + $paydays;\n\t elseif ($insdate) \t \n\t $expres = $this->date_diff($tmz_today,$insdate) + $this->freedays + $paydays;\n\t else\n\t return ;\t \n\t //echo '>',$expres,'>';\n\t\t\t \n\t if ($expres>0) {\n\t //not expired yes\n\t\t $status = 0;\n\t }\n\t else {\n\t if (($this->gracedays) && ($this->gracedays>abs($expres))) {\n\t\t //into grace period..days left\n\t\t $status = ($this->gracedays - abs($expres)) * 1;//plus 1... when 1-1=0\n\t\t\t\t //echo $status,'gin>';\n\t\t\t\t $this->grace_records += 1;\t\n\t\t }\n\t /*elseif (($gracedays) && ($gracedays==abs($expres))) {\n\t\t\t //into grace period..days left,,zero problem\n\t\t\t $status = 1;\n\t\t\t\t //echo $status,'giso>';\n\t\t\t\t $this->grace_records += 1;\t\t\t\t \t\t\t\t \t\t\t\t\t \n\t\t }*/\t\t \n\t\t else {\n\t\t\t //out of grace period or no grace period\n \t\t $status = -1;\n\t\t\t\t //echo $status,'gout>';\n\t\t\t\t $this->expired_records += 1;\t\t\t\t\t \n\t\t } \n }\n\t //echo '+',$status,'+';\n\t return ($status);\t\n\t}", "private function getNextWorkingDate($currentdate){\n\n\t$newdate = date('Y-m-d',strtotime($currentdate)); //get todays date\n $bankholidayArray = explode(\",\", $this->bankHolidays); //get bank holiday as array\n\n foreach ($bankholidayArray as &$value) { //for every bank holiday\n if ($newdate === $value) { //if the next day is a bank holiday\n $newdate = date('Y-m-d', strtotime($value . ' +1 Weekday')); //look for next weekday after bank holiday, set it as delivery\n }\n }\n return $newdate;\n }", "public function testGetEndDatetime()\n {\n $nextWeek = DateTime::today()->addDays(7);\n $period = new DatePeriod(DateTime::today(), DateInterval::day(), $nextWeek);\n $this->assertInstanceOf(DateTime::class, $period->getEndDatetime());\n $this->assertSame($nextWeek->getTimestamp(), $period->getEndDatetime()->getTimestamp());\n }", "public static function getWorkingDays($endDate, $startDate){\t\t\n\t\t\n\t\t$holidays=array(\"2017-01-01\",\"2017-02-27\",\"2017-04-14\",\"2017-09-07\",\"2017-12-25\");\n\t\t\n\t\t// do strtotime calculations just once \n\t\t//$endDate = strtotime(str_replace('/', '-', $endDate));\n\t\t//$startDate = strtotime(str_replace('/', '-', $startDate));\t\t\t\n\n\t\t//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n\t\t//We add one to inlude both dates in the interval.\n\t\t$days = ($endDate - $startDate) / 86400 + 1;\n\n\t\t$no_full_weeks = floor($days / 7);\n\t\t$no_remaining_days = fmod($days, 7);\n\n\t\t//It will return 1 if it's Monday,.. ,7 for Sunday\n\t\t$the_first_day_of_week = date(\"N\", $startDate);\n\t\t$the_last_day_of_week = date(\"N\", $endDate);\n\n\t\t//---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n\t\t//In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n\t\tif ($the_first_day_of_week <= $the_last_day_of_week) {\n\t\t\tif ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n\t\t\tif ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n\t\t}\n\t\telse {\n\t\t\t// (edit by Tokes to fix an edge case where the start day was a Sunday\n\t\t\t// and the end day was NOT a Saturday)\n\n\t\t\t// the day of the week for start is later than the day of the week for end\n\t\t\tif ($the_first_day_of_week == 7) {\n\t\t\t\t// if the start date is a Sunday, then we definitely subtract 1 day\n\t\t\t\t$no_remaining_days--;\n\n\t\t\t\tif ($the_last_day_of_week == 6) {\n\t\t\t\t\t// if the end date is a Saturday, then we subtract another day\n\t\t\t\t\t$no_remaining_days--;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n\t\t\t\t// so we skip an entire weekend and subtract 2 days\n\t\t\t\t$no_remaining_days -= 2;\n\t\t\t}\n\t\t}\n\n\t\t//The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder //---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n\t\t$workingDays = $no_full_weeks * 5;\n\t\tif ($no_remaining_days > 0 )\n\t\t{\n\t\t $workingDays += $no_remaining_days;\n\t\t}\n\n\t\t//We subtract the holidays\n\t\tforeach($holidays as $holiday){\n\t\t\t$time_stamp=strtotime($holiday);\n\t\t\t//If the holiday doesn't fall in weekend\n\t\t\tif ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\",$time_stamp) != 6 && date(\"N\",$time_stamp) != 7)\n\t\t\t\t$workingDays--;\n\t\t}\n\t\t\n\t\t//$workingDays = round($workingDays);\n\t\t\t\n\t\treturn $workingDays;\n\t}", "function dow($pday)\r\n { return (7 + ($pday % 7)) % 7; }", "function add_sub_days_months($start_date,$str_time_span){\n $next_date = new DateTime($start_date);\n //echo $next_date->format('Y-m-d'). \"<br />\";\n\n if (strchr($str_time_span,\"D\") ==\"D\"){\n $pos = strpos($str_time_span,\"D\");\n $num_days = substr($str_time_span,0,$pos);\n add_days($next_date,$num_days);\n ///echo $num_days . \"<br />\";\n //$next_date ->add(new DateInterval('P'.$num_days.'D'));\n //echo $next_date->format('Y-m-d');\n }elseif (strchr($str_time_span,\"M\") ==\"M\"){\n $pos = strpos($str_time_span,\"M\");\n $num_months = substr($str_time_span,0,$pos);\n //echo $num_months .\"<br />\";\n add_months($next_date, $num_months);\n //echo $next_date->format('Y-m-d');\n }else{\n echo \"Check format of para: str_next_payment\";\n return null;\n }\n return $next_date->format('Y-m-d');\n}", "function getWorkingDays($startDate,$endDate,$holidays){\n $endDate = strtotime($endDate);\n $startDate = strtotime($startDate);\n //The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24\n //We add one to inlude both dates in the interval.\n $days = ($endDate - $startDate) / 86400 + 1;\n\n $no_full_weeks = floor($days / 7);\n $no_remaining_days = fmod($days, 7);\n\n //It will return 1 if it's Monday,.. ,7 for Sunday\n $the_first_day_of_week = date('N', $startDate);\n $the_last_day_of_week = date('N', $endDate);\n\n //---->The two can be equal in leap years when february has 29 days, the equal sign is added here\n //In the first case the whole interval is within a week, in the second case the interval falls in two weeks.\n\n if ($the_first_day_of_week <= $the_last_day_of_week) {\n if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;\n if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;\n } else {\n // (edit by Tokes to fix an edge case where the start day was a Sunday\n // and the end day was NOT a Saturday)\n // the day of the week for start is later than the day of the week for end\n if ($the_first_day_of_week == 7) {\n // if the start date is a Sunday, then we definitely subtract 1 day\n $no_remaining_days--;\n if ($the_last_day_of_week == 6) {\n // if the end date is a Saturday, then we subtract another day\n $no_remaining_days--;\n }\n } else {\n // the start date was a Saturday (or earlier), and the end date was (Mon..Fri)\n // so we skip an entire weekend and subtract 2 days\n $no_remaining_days -= 2;\n }\n }\n //The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder\n //---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it\n $workingDays = $no_full_weeks * 5;\n if ($no_remaining_days > 0 ) $workingDays += $no_remaining_days;\n //We subtract the holidays\n foreach($holidays as $holiday){\n $time_stamp=strtotime($holiday);\n //If the holiday doesn't fall in weekend\n if ($startDate <= $time_stamp && $time_stamp <= $endDate && date(\"N\",$time_stamp) != 6 && date(\"N\",$time_stamp) != 7) $workingDays--;\n }\n return $workingDays;\n}", "function plan_next_period_d ($target_period,$first_day){\n\t\t$r = 0;\n\t\t$end_day = new DateTime($first_day);\n\t\t$end_day -> add(new DateInterval('P30D'));\n\t\t$mysqli = pr_connect();\n\t\t$sql = \"SELECT EQID, INS_INTERVAL, STARTDAY FROM inspection_period\";\n\t\t$result = $mysqli->query($sql);\n\t\twhile ($row = $result->fetch_assoc()){\n\t\t\t$new_plan_date = new DateTime($first_day);\n\t\t\t$new_plan_date -> add(new DateInterval('P'.$row['STARTDAY'].'D'));\n\t\t\tif (($d = add_new_inspection($row['EQID'],$target_period, $new_plan_date->format('Y/m/d'))) > 0) {\n\t\t\t\t$r += $d;\n\n\t\t\t\twhile ($new_plan_date-> add(new DateInterval('P'.$row['INS_INTERVAL'].'D')) < $end_day){\n\t\t\t\t\tif (($d = add_new_inspection($row['EQID'],$target_period, $new_plan_date->format('Y/m/d'))) > 0) {\n\t\t\t\t\t\t$r += $d; \n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tdie($d);\n\t\t\t\t\t} //end else\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdie($d);\n\t\t\t}\n\t\t} // end while\n\treturn $r;\t\n\n\t}", "public function testGetWDay()\n\t{\n\n\t\t// 火曜日\n\t\t$timestamp = strtotime(\"2017/4/4 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(2, $datetime->getWDay());\n\n\t\t// 水曜日\n\t\t$timestamp = strtotime(\"2017/4/5 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(3, $datetime->getWDay());\n\n\t\t// 木曜日\n\t\t$timestamp = strtotime(\"2017/4/6 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(4, $datetime->getWDay());\n\n\n\t\t// 金曜日\n\t\t$timestamp = strtotime(\"2017/4/7 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(5, $datetime->getWDay());\n\n\t\t// 土曜日\n\t\t$timestamp = strtotime(\"2017/4/8 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(6, $datetime->getWDay());\n\n\t\t// 日曜日\n\t\t$timestamp = strtotime(\"2017/4/9 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(0, $datetime->getWDay());\n\n\t\t//月曜日\n\t\t$timestamp = strtotime(\"2017/4/10 23:59:00\");\n\t\t$datetime = new HDateTime($timestamp);\n\t\t$weekday = date('N', $timestamp);\n\t\t$this->assertEquals(1, $datetime->getWDay());\n\n\t}" ]
[ "0.7162962", "0.70019376", "0.6994768", "0.65890104", "0.64033735", "0.6378106", "0.6192878", "0.6156815", "0.6138375", "0.61122704", "0.60171837", "0.6002239", "0.5916563", "0.59128433", "0.5886836", "0.5867806", "0.58610344", "0.58339584", "0.5820122", "0.58150816", "0.5806457", "0.5791481", "0.57698435", "0.574032", "0.5737561", "0.57350737", "0.5729713", "0.57092017", "0.5693605", "0.56842613", "0.5681063", "0.5680188", "0.5677927", "0.5670268", "0.56636506", "0.56636506", "0.56503075", "0.5622809", "0.56141466", "0.56108236", "0.5609468", "0.5604754", "0.559373", "0.55913055", "0.55859303", "0.5570117", "0.55647194", "0.5561863", "0.5533855", "0.55194473", "0.5516817", "0.55134463", "0.5510198", "0.55097723", "0.5507628", "0.55044", "0.55042857", "0.55001545", "0.5490469", "0.548906", "0.5485165", "0.5462178", "0.54304487", "0.54289776", "0.54209846", "0.5420837", "0.5420584", "0.5416812", "0.54154146", "0.5409823", "0.5400037", "0.53980285", "0.5397667", "0.5395855", "0.53946257", "0.538967", "0.5384395", "0.5383486", "0.5382651", "0.5380984", "0.537817", "0.53682464", "0.5354057", "0.5349659", "0.5348137", "0.5346119", "0.53422403", "0.53382814", "0.53301805", "0.53267354", "0.532493", "0.532485", "0.5322429", "0.53148776", "0.531264", "0.5311786", "0.53039575", "0.530272", "0.5297518", "0.52922726" ]
0.76309633
0
Test bonus payment date
Дата тестового бонусного платежа
public function testBonusPaymentDate(): void { $dateTime = new \DateTime('28 February 2019'); $bonusDateTime = new \DateTime('15 February 2019'); $this->dateTimeMock->shouldReceive('modify->modify') ->twice() ->with('+14 days') ->andReturn($bonusDateTime); $this->dateTimeMock->shouldReceive('modify') ->once() ->with('today') ->andReturn($dateTime); $dayCalculatorService = new DateCalculatorService($this->dateTimeMock); $result = $dayCalculatorService->getBonusPaymentDate(); $this->assertEquals('15-02-2019', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBonusPaymentDateIsPassed(): void\n {\n\n $firstDay = new \\DateTime('1 February 2019');\n $today = new \\DateTime('18 February 2019');\n $bonusDay = new \\DateTime('16 February 2019');\n $nextWednesday = new \\DateTime('16 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('first day of this month')\n ->andReturn($firstDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('+14 days')\n ->andReturn($bonusDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('next wednesday')\n ->andReturn($nextWednesday);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('-', $result);\n }", "public function getBonusPaymentDate($date);", "public function getPaymentDate();", "public function testSalaryPaymentDate(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('28-02-2019', $result);\n }", "public function testSalaryPaymentDateIsPassed(): void\n {\n $dateTime = new \\DateTime('31 March 2019');\n $today = new \\DateTime('30 March 2019');\n $dateTimeMock = Mockery::mock(DateTime::class);\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('-', $result);\n }", "public function testGetDate(): void\n {\n $investor1 = new Investor(\"Investor 1\");\n $trancheA = new Tranche(\"Tranche A\", 3, 1000);\n $investment = new Investment(\n $investor1,\n $trancheA,\n 50000, \n \"2020-10-01\"\n );\n $this->assertEquals(\"2020-10-01\", $investment->getDate());\n }", "public function getSalaryPaymentDate($date);", "public function testGandSDate(){\n $priseRdv= $this->getPriseRdv(new \\DateTime(\"2020-11-05\"));\n $priseRdv->setDate(new \\DateTime(\"2020-11-05\"));\n $this->assertEquals(new \\DateTime(\"2020-11-05\"), $priseRdv->getDate());\n }", "function test($entity_id,$date){\nglobal $adb,$log,$current_user;\n$paymentid=$entity_id;//$_REQUEST['paymentid']\n$datefrom=date('Y-m-d',strtotime($date));//$_REQUEST['start_date']\n$dat_fmt = $current_user->date_format;\n$dateFormat=($dat_fmt == 'dd-mm-yyyy') ? 'd-m-Y' : (($dat_fmt == 'mm-dd-yyyy') ? 'm-d-Y' : (($dat_fmt == 'yyyy-mm-dd') ? 'Y-m-d' : ''));\n\n$res = $adb->pquery(\"Select * from vtiger_payamentstype WHERE payamentstypeid=?\", array($paymentid));\n //$datefrom = $adb->query_result($res, 0, 'docdate_from');\n $diffdays = $adb->query_result($res, 0, 'differdays');\n $endofmonth = $adb->query_result($res, 0, 'endofmonth');\n $extradays = $adb->query_result($res, 0, 'extradays');\n\n $calc_date = $datefrom;\n if ($diffdays <> 0) {\n if ($diffdays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $diffdays day$s\"));\n }\n if ($endofmonth > 0) {\n $calc_date = date('Y-m-d', strtotime($calc_date));\n }\n if ($extradays <> 0) {\n if ($extradays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $extradays day$s\"));\n }\n $calc_date=date($dateFormat,strtotime($calc_date));\n return $calc_date;\n}", "public function maybe_set_date_paid()\n {\n }", "public function testBonusPaymentDateIsWeekend(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $bonusDateTime = new \\DateTime('16 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify->modify')\n ->twice()\n ->with('+14 days')\n ->andReturn($bonusDateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('20-02-2019', $result);\n }", "function nextPayment($date_to_pay)\n{\n if(empty($date_to_pay)) {\n return \"No date provided\";\n }\n\n $periods = array(\"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\", \"decade\");\n $lengths = array(\"60\",\"60\",\"24\",\"7\",\"4.35\",\"12\",\"10\");\n\n $now = time();\n $unix_date = strtotime($date_to_pay);\n\n // check validity of date\n if(empty($unix_date)) {\n return \"Bad date\";\n }\n\n // is it future date or past date\n if($now > $unix_date) {\n $difference = $now - $unix_date;\n $tense = \"ago\";\n\n } else {\n $difference = $unix_date - $now;\n $tense = \"from now\";\n }\n\n for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {\n $difference /= $lengths[$j];\n }\n\n $difference = round($difference);\n\n if($difference != 1) {\n $periods[$j].= \"s\";\n }\n\n return \"$difference $periods[$j] {$tense}\";\n}", "public function testCanGetInvestmentDate() : void\n {\n $this->assertEquals(DateTime::createFromFormat('d/m/Y', '01/10/2015'), $this->investment->getInvestmentDate());\n }", "public function isDue($date = 'now');", "public function getDatePayment()\n {\n return $this->date_payment;\n }", "public function testSetGetDueDate()\n {\n $dueDate = new DateTime('+14 days');\n $this->invoice->setIssuedDate('+14 days');\n $this->assertEquals($this->invoice->getDueDate()->format('Y-m-d'), $dueDate->format('Y-m-d'));\n }", "function determine_date_of_completion($date, $period, $paymentmode){\n # code...\n // Your date\n $date_of_issue = new \\DateTime($date); // empty for now or pass any date string as param\n\n\n // or even easier\n if($paymentmode == 'monthly'){\n $date_of_completion = $date_of_issue->modify('+'.$period.' months');\n return $date_of_completion->format('Y-m-d');\n }\n if($paymentmode == 'weekly'){\n $period *= 4;\n $date_of_completion = $date_of_issue->modify('+'.$period.' weeks');\n return $date_of_completion->format('Y-m-d');\n }\n if($paymentmode == 'daily'){\n $period *= 30;\n $date_of_completion = $date_of_issue->modify('+'.$period.' days');\n return $date_of_completion->format('Y-m-d');\n }\n }", "protected function _setPaymentDate()\n {\n \t$endOfMonth = date(\n 'd', mktime(0, 0, 0, $this->_month+1, 1, $this->_year) - 1\n );\n \tswitch ($this->_config['paydate']) {\n \t\tcase 'start':\n \t\t\t$this->_date = 1;\n \t\t\treturn;\n \t\tcase 'end':\n \t\t\t$this->_date = date(\n \t\t\t 'd', mktime(0, 0, 0, $this->_month+1, 1, $this->_year) - 1\n \t\t\t);\n \t\t\treturn;\n \t\tdefault:\n \t\t\t$this->_date = $this->_config['paydate'];\n \t\t\tif ($this->_config['paydate'] > $endOfMonth) {\n \t\t\t\t$this->_date = $endOfMonth;\n \t\t\t}\n \t\t\treturn;\n \t}\n }", "public function testExample()\n {\n $date = '2017-03-20';\n dump(Debt::total([\n 'date_start' => $date,\n 'date_end' => $date\n ]));\n // foreach($this->dates as $index => $date) {\n // if ($index == 1) {\n // break;\n // }\n // Debt::total($date, $date);\n // }\n $this->assertTrue(true);\n }", "public static function isValidPaymentDate($date) {\n return $date != self::EMPTY_DATE && $date <= self::getCurrentTimeFormatted(self::DB_DATE_FORMAT);\n }", "public function testPaymentLastPaymentDataPost()\n {\n }", "public function testCalculationOfPHDStudentPaymentIncorrectDateFormat() {\n //get the first PHD student whose name is 'Alicia Reid'\n $phdStudent = User::where('name','=','Alicia Reid')->first();\n\n /*\n call the 'calculatePHDStudentPayment' function of the 'PaymentController'\n and set the value of the 'id' parameter to be the ID of the PHD student\n and set the value of the 'fromDate' parameter to be the letter 'a' \n (which the controller expects due to the way the dates are stored in the \n database) and the value of the 'toDate' parameter to\n to be the letter 'b'\n */\n $response = $this->action('GET', 'PaymentController@calculatePHDStudentPayment', array(\n 'id' => $phdStudent->id,\n 'fromDate' =>'a',\n 'toDate' => 'b'\n ));\n\n /*\n get the view returned from calling the 'calculatePHDStudentPayment'\n of the 'PaymentController'\n */\n $view = $response->original;\n\n\n $errorsReceived = $view['errors'];\n\n /*\n assert that the assert that the 'errors' variable (which is an array)\n contained in the view has a value of\n \"Please ensure that you provide a 'from' and a 'to' date\n in the format yyyy-mm-dd.\"\n */\n $this->assertContains(\n \"Please ensure that you provide a 'from' and a 'to' date\n in the format yyyy-mm-dd.\", $errorsReceived\n );\n\n }", "public function testGetDateExpire()\n {\n $model = new User_Model_DbTable_UserAction();\n $userAction = $model->fetchNew();\n \n // empty date\n $this->assertNull($userAction->getDateExpire());\n \n // date set\n $dateString = self::TEST_DATE;\n $format = self::TEST_DATE_FORMAT;\n \n $userAction->date_expire = self::TEST_DATE;\n $dateExpire = $userAction->getDateExpire();\n \n $this->assertInstanceOf('Zend_Date', $dateExpire);\n $this->assertEquals($dateExpire->get($format), $dateString);\n }", "public function getPurchaseDate();", "function getBatchPaymentDate(){\n $paymentDate = date('Y-m-d');\n $currDateTs=strtotime($paymentDate);\n $offsetDays=0;\n if($this->cuttoffMissed===true){\n $offsetDays++;\n }\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n while ($this->isHoliday($paymentDate)==true) {\n $offsetDays++;\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n }\n \n\n return $paymentDate;\n }", "function check_paid_record($insdate=null,$paydate=null,$tmz_id=null,$paydays=null) {\n\t $status = 0;\t\n\t $today = date('Y-m-d');\t\n $tmz = isset($tmz_id) ? $tmz_id : $this->tmz_id;\t \n\t //echo $insdate,'>>',$paydate,'>>',$tmz_id,'>>';\n\t $tmz_today = $this->make_gmt_date(null,$tmz); \n\t $paydays = $paydays?intval($paydays):0;\n\t\n\t if ($paydate)\n $expres = $this->date_diff($tmz_today,$paydate) + $this->freedays + $paydays;\n\t elseif ($insdate) \t \n\t $expres = $this->date_diff($tmz_today,$insdate) + $this->freedays + $paydays;\n\t else\n\t return ;\t \n\t //echo '>',$expres,'>';\n\t\t\t \n\t if ($expres>0) {\n\t //not expired yes\n\t\t $status = 0;\n\t }\n\t else {\n\t if (($this->gracedays) && ($this->gracedays>abs($expres))) {\n\t\t //into grace period..days left\n\t\t $status = ($this->gracedays - abs($expres)) * 1;//plus 1... when 1-1=0\n\t\t\t\t //echo $status,'gin>';\n\t\t\t\t $this->grace_records += 1;\t\n\t\t }\n\t /*elseif (($gracedays) && ($gracedays==abs($expres))) {\n\t\t\t //into grace period..days left,,zero problem\n\t\t\t $status = 1;\n\t\t\t\t //echo $status,'giso>';\n\t\t\t\t $this->grace_records += 1;\t\t\t\t \t\t\t\t \t\t\t\t\t \n\t\t }*/\t\t \n\t\t else {\n\t\t\t //out of grace period or no grace period\n \t\t $status = -1;\n\t\t\t\t //echo $status,'gout>';\n\t\t\t\t $this->expired_records += 1;\t\t\t\t\t \n\t\t } \n }\n\t //echo '+',$status,'+';\n\t return ($status);\t\n\t}", "public function testSetGetDateConfirmedFromDate()\n {\n $user = new UserModel();\n $date = new \\Ilch\\Date();\n $expectedTimestamp = $date->getTimestamp();\n $user->setDateConfirmed($date);\n $actualDate = $user->getDateConfirmed();\n\n $this->assertEquals($expectedTimestamp, $actualDate->getTimestamp(), 'The date_confirmed wasnt saved or returned correctly using a Ilch_Date object.');\n }", "public function testCountPaidToday()\n {\n $this->insight->accounts->addTrial(1, new DateTimeValue('2016-02-12'));\n $this->insight->accounts->addTrial(2, new DateTimeValue('2016-02-13')); // Convert to free on 2016-02-14\n $this->insight->accounts->addTrial(3, new DateTimeValue('2016-02-14')); // Convert to paid on 2016-02-15\n $this->insight->accounts->addTrial(4, new DateTimeValue('2016-02-15')); // Cancel\n $this->insight->accounts->addPaid(5, new PlanL(), new Yearly(), new DateTimeValue('2016-02-16')); // Converts to free plan on 2016-02-16\n $this->insight->accounts->changePlan(5, new FreePlan(), new None(), new DateTimeValue('2016-02-16'));\n\n $this->insight->accounts->changePlan(2, new PlanM(), new Yearly(), new DateTimeValue('2016-02-14'));\n $this->insight->accounts->changePlan(3, new FreePlan(), new None(), new DateTimeValue('2016-02-15'));\n $this->insight->accounts->cancel(4, AccountsInterface::USER_CANCELED, new DateTimeValue('2016-02-16'));\n\n $this->current_timestamp = new DateTimeValue('2016-02-16');\n DateTimeValue::setTestNow($this->current_timestamp);\n\n $this->assertEquals(2, $this->insight->accounts->countPaid());\n }", "public function Get_Pay_Date_Calc() { return $this->pdc; }", "public function Set_Pay_Date_Calc() { \n\t\t$this->pdc = new Pay_Date_Calc_3($this->holidays); \n\t\t$this->next_bus_day \t= date('m/d/Y', strtotime($this->pdc->Get_Business_Days_Forward(date('Y-m-d'), 1)));\n\t}", "public function testCalculationOfPHDStudentPaymentInvalidDateRange() {\n\n //get the first PHD student whose name is 'Alicia Reid'\n $phdStudent = User::where('name','=','Alicia Reid')->first();\n\n /*\n call the 'calculatePHDStudentPayment' function of the 'PaymentController'\n and set the value of the 'id' parameter to be the ID of the PHD student\n and set the value of the 'fromDate' parameter in YYYY-MM-DD format \n (which the controller expects due to the way the dates are stored in the \n database) to '2016-10-15' and the value of the 'toDate' parameter to\n '2015-11-15'\n */\n $response = $this->action('GET', 'PaymentController@calculatePHDStudentPayment', array(\n 'id' => $phdStudent->id,\n 'fromDate' =>'2016-10-15',\n 'toDate' => '2015-11-15'\n ));\n\n /*\n get the view returned from calling the 'calculatePHDStudentPayment'\n of the 'PaymentController'\n */\n $view = $response->original;\n\n\n $errorsReceived = $view['errors'];\n /*\n assert that the assert that the 'errors' variable (which is an array)\n contained in the view has a value of\n 'Please make sure the from date is earlier than the to date.'\n */\n $this->assertContains(\n 'Please make sure the from date is earlier than the to date.', $errorsReceived\n );\n }", "function hasRenewalDate()\n {\n if (PAYMENT_FEATURE != \"on\") {\n return false;\n }\n if ((CREDITCARDPAYMENT_FEATURE != \"on\") && (PAYMENT_INVOICE_STATUS != \"on\") && (PAYMENT_MANUAL_STATUS != \"on\")) {\n return false;\n }\n if ($this->getPrice('monthly') <= 0 && $this->getPrice('yearly') <= 0) {\n return false;\n }\n\n return true;\n }", "public function is_paid()\n {\n }", "protected function payout_calculation()\n {\n //check date on images, use for date range calculations only gather likes between requested dates\n //TODO: Need to check limit on API calls\n \n }", "public function test_createPaymentDates_generatesPaymentDatesObjectsForRemainderOfCurrentYear_ifNullIsPassed()\n {\n Carbon::setTestNow(Carbon::create(1999, 6, 15));\n\n $mockedInput = $this->createMockedInput(null);\n\n $paymentDates = PaymentDatesFactory::createPaymentDates($mockedInput);\n\n $expectedResult = array(\n new PaymentDates(new Month(6), new Year('1999')),\n new PaymentDates(new Month(7), new Year('1999')),\n new PaymentDates(new Month(8), new Year('1999')),\n new PaymentDates(new Month(9), new Year('1999')),\n new PaymentDates(new Month(10), new Year('1999')),\n new PaymentDates(new Month(11), new Year('1999')),\n new PaymentDates(new Month(12), new Year('1999'))\n );\n\n $this->assertEquals($expectedResult, $paymentDates);\n\n // ... and we are now back in the present\n Carbon::setTestNow();\n }", "public function markPaid(){\n\t\t\t$returnVar = false ;\n\t\t\t// Open\n\t\t\t$conn = new ConnectionSimple ;\n\t\t\t$conn->connect(DM_DB_NAME) ;\n\t\t\t// sql\n\t\t\t$sql = \"UPDATE affiliates_payments \" ;\n\t\t\t$sql.= \"SET payment_date = '\".date(DM_PHP_DATE_FORMAT).\"' \" ;\n\t\t\t$sql.= \"WHERE payment_id = '\".mysql_escape_string($this->paymentId).\"' AND payment_date IS NULL ; \" ;\n\t\t\tif(mysql_query($sql) or die( mysql_error())){\n\t\t\t\t$returnVar = true ;\n\t\t\t}\n\t\t\t// Close\n\t\t\t$conn->disconnect(DM_DB_NAME) ;\n\t\t\t// return\n\t\t\treturn $returnVar ;\n\t\t}", "public function test_create_to_do_with_valid_due_date() {\n $_POST['ce_to_do_month'] = date('n');\n\t\t$_POST['ce_to_do_day'] = date('j');\n\t\t$_POST['ce_to_do_year'] = date('Y');\n\t\t$_POST['hidden_ce_to_do_clear'] = 0;\n\n\t\t$factoryId = $this->factory()->post->create(['post_type' => self::POST_TYPE]); \n \n $meta = get_post_meta($factoryId, self::DUE_DATE_FIELD, true);\n \n //test the meta value was updated correctly\n $this->assertEquals($meta, $_POST['ce_to_do_month'] . '-' . $_POST['ce_to_do_day'] . '-' . $_POST['ce_to_do_year']);\n\t}", "public function actionCheck(){\n $users = User::find()->indexBy('id')->where(['account_id' => User::ACCOUNT_BUSINESS])->all();\n// $pays_test = Pay::find()->indexBy('id')->where(['status' => Pay::STATUS_TEST])->all();\n $time_now = time();\n foreach ($users as $user){\n /* @var User $user*/\n $pay = $user->getLastPayment();\n if(isset($pay) && !empty($pay)){\n if($time_now < $pay->date2_int){\n $payment_date = $pay->date1_int;\n $payment_expire = $pay->date2_int;\n $days_to_expire = round(abs($time_now - $payment_expire) / 86400);\n\n if ($days_to_expire == 7){\n //to create a new invoice with status non paymant\n $next_period_date1 = strtotime('+1 day', $pay->date2_int);\n// echo date('d,m,Y', $next_period_date1).' ';\n $next_period_date2 = strtotime('+1 month', $next_period_date1);\n// echo date('d,m,Y', $next_period_date2).'';\n $next_period_pay = new Pay();\n $next_period_pay->user_id = $user->id;\n $next_period_pay->summa = 50;\n $next_period_pay->date1_int = $next_period_date1;\n $next_period_pay->date2_int = $next_period_date2;\n $next_period_pay->status = Pay::STATUS_NOTCONFIRMED;\n $next_period_pay->save();\n\n $new_pay_id = $next_period_pay->id;\n\n $form = new ManagerForm();\n $form->pay_id = $new_pay_id;\n //send new invoice and notification\n $form->sendWarning($days_to_expire);\n\n } elseif($days_to_expire == 3 || $days_to_expire == 1){\n\n $pay = $user->getLastOpenInvoice();\n $form = new ManagerForm();\n $form->pay_id = $pay->id;\n $form->sendWarning($days_to_expire);\n\n } elseif($days_to_expire == 0){\n //to disable an Account Bisness\n $user->account_id = User::ACCOUNT_BASIC;\n $user->save();\n\n }\n }\n\n }\n }\n }", "public function getCloseApproachDate();", "public function testCardValidTillExpiryMonth()\n {\n $card = new Card(99999, '123', new DateTime('@'.strtotime(\"midnight UTC\")));\n $this->assertInstanceOf('Namshi\\Innovate\\Payment\\Card', $card);\n }", "function trialProductsCalcDate($relid) {\n\n // get free period value\n $days = trialProductsGetFreePeriod($relid);\n\n $date = new \\DateTime();\n\n // calc next duedate\n $date->modify('+' . $days . ' days');\n\n $date = $date->format('Y-m-d');\n\n return $date;\n\n}", "public function getPaymentAccountAgeDate();", "public function testErrorActionProposeNewTemplateDueDateNotFomatDate()\n\t{\n\t\t$templateParrent = TemplateFolderModelMongo::where('name', 'Templates')->where('parent_id', '0')->first();\n\t\t//initialization data\n\t\t$data = [\n\t\t\t'name' => 'test dua date not fomat date',\n\t\t\t'folder_id' => $templateParrent->_id,\n\t\t\t'due_date' => 'fgsdf safsa',\n\t\t\t'description' => 'description template',\n\t\t];\n\n\t\t$userLoginTest = UserModel::find(6);\n\t\t// login and call test method api post propose new template\n\t\t$request = $this->actingAs($userLoginTest)->post('api/template-content-manager', $data);\n\t\t// $request->dump();\n\t\t$request->seeJson(['status' => 0]);\n\t}", "public function testcheckAgeByBirthdate()\n { \n $verificationModelMock = $this->getModelMock('postident/config', array(\n 'getMinAge'\n ));\n $verificationModelMock->expects($this->any())\n ->method('getMinAge')\n ->will($this->returnValue(18));\n $this->replaceByMock('model', 'postident/verification', $verificationModelMock);\n $this->assertTrue(Mage::getModel('postident/IdCard_Abstract')->checkAgeByBirthdate( \n '1980-05-10 00:00:00.0',\n '2010-05-10 00:00:00.0'\n ));\n $this->assertFalse(Mage::getModel('postident/IdCard_Abstract')->checkAgeByBirthdate( \n '1998-05-10 00:00:00.0',\n '1999-05-10 00:00:00.0'\n ));\n //assertion for 17y and 3xx days\n $this->assertFalse(Mage::getModel('postident/IdCard_Abstract')->checkAgeByBirthdate( \n '1980-01-01 00:00:00.0',\n '1997-12-31 00:00:00.0'\n ));\n //assertion for 18y and 1 day\n $this->assertTrue(Mage::getModel('postident/IdCard_Abstract')->checkAgeByBirthdate( \n '1980-01-01 00:00:00.0',\n '1998-01-02 00:00:00.0'\n ));\n }", "public function testPaymentConditionsPost()\n {\n }", "function validDate($biddate, $bidtime) {\r\n $today = date(\"Y-m-d H:i:s\");\r\n $total_date = $biddate.' '.$bidtime;\r\n if($today > $total_date) {\r\n echo \"Error: Date must be a future item and date<br><br>\";\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "public function getDatePaid()\n\t\t{\n\t\t\tif(isset($this->_date_paid)){\n\t\t\t\treturn $this->_date_paid;\t\n\t\t\t}\n\t\t}", "public function testGetSalesWithValidPromotorTokenMarchMonthLeapYear()\n { \n $knownDate = Carbon::parse('2016-03-31');\n Carbon::setTestNow($knownDate); \n \n // Set time\n $dateObject = Carbon::now();\n \n // Set time\n $time = $dateObject->format('Y-m');\n $thisMonth = $dateObject->format('Y-m-d');\n \n // Substract date by 1 month\n $dateObject = Carbon::parse('2016-02-20');\n \n $timeLastMonth = $dateObject->format('Y-m');\n $lastMonth = $dateObject->format('Y-m-d');\n\n // Populate data\n $panasonicID = $this->_populatePanasonic();\n $arcoID = $this->_populateArco($panasonicID);\n $tlID = $this->_populateTL($arcoID);\n $promotorID = $this->_populatePromotor($tlID);\n $branchID = $this->_populateBranch($tlID);\n $dealerID = $this->_populateDealer();\n $dealerAccountID = $this->_populateDealerAccount($tlID);\n\n // Populate product data\n $productCategoryID = $this->_populateProductCategory();\n $productID = $this->_populateProduct($productCategoryID);\n \n // Populate target\n $currentTargetValue = 100000;\n $lastTargetValue = 500000;\n \n $currentTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $currentTargetValue, \n 'month' => $time\n ];\n \n $lastTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $lastTargetValue, \n 'month' => $timeLastMonth\n ];\n \n $this->_populatePromotorTarget($currentTarget);\n $this->_populatePromotorTarget($lastTarget);\n \n \n // Populate Report\n $priceThisMonth = 90000;\n $priceLastMonth = 100000;\n $quantityThisMonth = 1;\n $quantityLastMonth = 1;\n \n $reportThisMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceThisMonth, \n 'quantity' => $quantityThisMonth, \n 'date' => $thisMonth\n ];\n \n $reportLastMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceLastMonth, \n 'quantity' => $quantityLastMonth, \n 'date' => $lastMonth\n ];\n \n $this->_populateReport($reportThisMonth);\n $this->_populateReport($reportLastMonth);\n\n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $response = $this->call('GET', '/api/1.5.0/report-sales', ['token' => $encryptedToken]);\n $result = json_decode($response->getContent(), true);\n \n // Verify\n $this->assertTrue(array_key_exists('result', $result));\n $this->assertEquals($result['result']['targetPromotorProduct'][$productID]['product_ID'], $productID);\n $this->assertEquals($result['result']['targetPromotor'], $currentTargetValue);\n $this->assertEquals($result['result']['targetPromotorData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['targetDealer'], $currentTargetValue);\n $this->assertEquals($result['result']['targetDealerData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['comparison'], $lastTargetValue);\n $this->assertEquals($result['result']['comparisonData'], $priceLastMonth*$quantityLastMonth);\n }", "public function testupdatedateDebut()\n\t{\n\t\t$this->viderTable();\n\t\t$this->create1These();\n\t\t$TS = new TheseService($this->em);\n\t\t\n\t\t$req = $TS->updatedateDebut(1, new \\DateTime('2015-01-01'));\n\t\t\n\t\t$these = $this->em->getRepository('DTDoctoramaBundle:These')->findOneById(1);\n\t\t$this->assertEquals(new \\DateTime('2015-01-01'), $these->getDateDebut());\t\n\t}", "public function testActivatePaymentMethod()\n {\n\n }", "public function testSetGetDateConfirmedFromStamp()\n {\n $user = new UserModel();\n $user->setDateConfirmed(987654321);\n $actualDate = $user->getDateConfirmed();\n\n $this->assertInstanceOf('\\\\Ilch\\\\Date', $actualDate, 'The date_confirmed was not created using Ilch_Date.');\n $this->assertEquals(987654321, $actualDate->getTimestamp(), 'The timestamp of the date_confirmed wasnt saved or returned correctly.');\n }", "public function setDatePaid()\n\t\t{\n\t\t\t$this->_date_paid = strftime(\"%Y-%m-%d %H:%I:%S\", time());\n\t\t}", "public function testSetDateExpire()\n {\n $model = new User_Model_DbTable_UserAction();\n $userAction = $model->fetchNew();\n \n $dateString = self::TEST_DATE;\n $format = self::TEST_DATE_FORMAT;\n \n $date = new Zend_Date($dateString, $format);\n $userAction->setDateExpire($date);\n $this->assertEquals($date->get($format), $userAction->date_expire);\n \n $date = new Zend_Date();\n $date->add('24', Zend_Date::HOUR);\n $userAction->setDateExpire($date);\n $this->assertEquals($date->get($format), $userAction->date_expire);\n }", "abstract function doPayment();", "function payoutToday()\n {\n $today = Carbon::today();\n\n $referralbonusin = Bonus::WhereDate('readyby','=', $today )\n ->sum('amounttobeneficiary');\n\n $referralbonusout = Subject::WhereDate('shift','=', $today )\n ->sum('Txsum');\n\n $balance = $referralbonusin + $referralbonusout;\n\n return $balance;\n\n }", "function expirationdatesubs($plan,$sub_professional,$sub_enterprise,$remdays,$plan_expire,$currentplan){\r\n $subs=1;\r\n if($plan==2){$subs = $sub_professional;}\r\n if($plan==3){$subs = $sub_enterprise;}\r\n\r\n if($currentplan=='Trial'){\r\n $dadate = date('Y-m-d');\r\n }else{\r\n if($remdays>=1){\r\n $dadate = $plan_expire;\r\n }else{\r\n $dadate = date('Y-m-d');\r\n }\r\n }\r\n\r\n $date = new DateTime($dadate);\r\n $date->modify('+'.$subs.' month');\r\n $date = $date->format('Y-m-d');\r\n return $date;\r\n //date('Y-m-d', strtotime($date. ' + 14 days'))\r\n }", "public function getNextPaymentDate()\n {\n return $this->getParameter('nextPaymentDate') ?: date('j M Y');\n }", "function calculate_balance($rate, $cur_date, $reg_date) {\n $date_diff = $cur_date - $reg_date;\n\n//Get the date_diff\n//Balance is rate multiplied by the rate diff in addition to the left amount for the previous transaction.\n}", "public function testSetDateDebProf() {\n\n // Set a Date/time mock.\n $dateDebProf = new DateTime(\"2018-09-10\");\n\n $obj = new Clients();\n\n $obj->setDateDebProf($dateDebProf);\n $this->assertSame($dateDebProf, $obj->getDateDebProf());\n }", "function testValidateEatByDate($dateToEvaluate){\n if(validateEatByDate($dateToEvaluate)==NULL){\n echo \"ERROR: PRECEDES CURRENT DATE.</P>\";\n } else {\n echo \"EAT BY DATE IS VALID</P>\";\n } \n }", "public function pay_period_number($date)\n {\n // https://fireprotected.slack.com/archives/engineering/p1481217169000234\n // Every month has 2 pay periods. Going to mark them by pay date: i.e the first and third friday\n\t//june2018 will have 3: 1,15,29\n\n $pay_period_number = 0;\n\n\t//year can not be hard coded, why is this here?\n if ($date->year < 2018) return 1;\n\n // Get the Pay Dates for current month\n\n $paydates = $this->pay_dates_for_month($date);\n\n\n // See which one is after $date\n\n if ($paydates->first->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n\n\t//we are not in first period, did we pass up 2nd and there is a 3rd?\n if ($paydates->second->gte($date)) {\n\n\t\t\tlog_message('debug', '---------------------> paydates ' . print_r($paydates, true) );\n\n//what is this code doing?\n//the paydate is already a friday based on the code defining first/second/(third)\n/*\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n\t\t\tlog_message('debug', '---------------------> paydates check' . print_r($check, true) );\n\t\t\tlog_message('debug', '---------------------> paydates next friday' . print_r($friday, true) );\n if ($friday->isSameDay($paydates->second)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n*/\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n\n/*\n\t//rare, we have a 3rd\n if ( $paydates->third && $paydates->third->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n*/\n\n // if after them both, then use the next month's first pay date\n $paydates->second->addMonth();\n\n $nextMonthPaydates = $this->pay_dates_for_month($paydates->second);\n $pay_period_number = $nextMonthPaydates->first->month * 2;\n\t\t\t\t\tlog_message('debug', '---------------------> pay_period 3 or next month ' . print_r($pay_period_number, true) );\n return $pay_period_number - 1;\n }", "function isPaid() {\n return $this->getClosedOn() instanceof DateValue && $this->getStatus() == INVOICE_STATUS_PAID;\n }", "function payoutTommorow()\n {\n $tomorrow = Carbon::tomorrow();\n \n $referralbonusin = Bonus::WhereDate('readyby','=', $tomorrow )\n ->sum('amounttobeneficiary');\n \n $referralbonusout = Subject::WhereDate('shift','=', $tomorrow )\n ->sum('Txsum');\n \n $balance = $referralbonusin + $referralbonusout;\n \n return $balance;\n \n }", "public function testCrceOnlinePaymentGetRecurringCharges()\n {\n\n }", "public function pay_now() \n\t{\n\t\t$amount = $_POST['amount'];\n\t\t$sponsorID = $_POST['sponsor'];\n\t\t$event = $_POST['event'];\n\t\t//\n\t\t$wal_debit\t= $this->ledger_model->total_wallet_debit();\n\t\t$wal_credit\t= $this->ledger_model->total_wallet_credit();\n\t\tforeach( $wal_debit->result() \t\tas $wal_debit);\n\t\tforeach( $wal_credit->result() \t\tas $wal_credit); \n\t\t$wal_debit\t\t\t= $wal_debit->debit;\n\t\t$wal_credit \t= $wal_credit->credit;\n\t\t$wallet_balance = ( $wal_debit - $wal_credit ) ;\n\t\t$balance=$wallet_balance;\n\t\t//\n\t\tif($balance < $amount)\n\t\t{\n\t\t\techo \"You have only \".round($balance ,3).\" rupees.Please increase your CPA balance\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pay = $this->Event_model->pay_now($amount,$sponsorID,$event);\n\t\t\tif($pay)\n\t\t\t{\n\t\t\t\techo \"Thank you for your contribution...\";\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function trialbusinesspaymentplan(Request $request) {\n $encryptId = request('id');\n $isdegrade = request('isdegrade');\n if($isdegrade == 'true') {\n\t\t\t\t$degrade = true;\n\t\t\t} else {\n\t\t\t\t$degrade = false;\n\t\t\t}\n $id = decrypt($encryptId);\n $companyData = Companydetail::where('authid', (int)$id)->where('status','active')->get();\n if(!empty($companyData) && count($companyData) > 0) {\n\t\t\t\t$currentDate = date('Y-m-d H:i:s');\n /*\n\t\t\t\tif($companyData[0]->nextpaymentdate > $currentDate) {\n\t\t\t\t\t$lastPaymentDate = $companyData[0]->lastpaymentdate;\n\t\t\t\t\tif($lastPaymentDate == 'null') {\n\t\t\t\t\t\t$nextDate = date('Y-m-d 00:00:00', strtotime(\"+ 30 days\", strtotime($currentDate)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($companyData[0]->remaintrial > 0) {\n\t\t\t\t\t\t\t$nextDate = date('Y-m-d 00:00:00', strtotime(\"+ 30 days\", strtotime($currentDate)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$currStr = strtotime($currentDate);\n\t\t\t\t\t\t\t$NxtStr = strtotime($companyData[0]->nextpaymentdate);\n\t\t\t\t\t\t\t$diffcheck = $NxtStr - $currStr;\n\t\t\t\t\t\t\t$dayTrial = 0;\n\t\t\t\t\t\t\tif($diffcheck > 0) {\n\t\t\t\t\t\t\t\t$dayTrial = (int)($diffcheck/(24*60*60));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$trialDaysNxt = $dayTrial + 30;\n\t\t\t\t\t\t\t$nextDate = date('Y-m-d 00:00:00', strtotime(\"+ \".$trialDaysNxt.\" days\", strtotime($currentDate)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$nextDate = date('Y-m-d 00:00:00', strtotime(\"+ 30 days\", strtotime($currentDate)));\n\t\t\t\t}\n */\n $IsDayLeft = false;\n $days = 0;\n $trailDays = 0;\n if($companyData[0]->nextpaymentdate > $currentDate) {\n $CreatedDate = strtotime($companyData[0]->nextpaymentdate);\n $CurrentDates = strtotime(date('Y-m-d H:i:s'));\n $differStrTime = $CreatedDate - $CurrentDates;\n if($differStrTime > 0) {\n $day = round($differStrTime/(24*60*60));\n if($day > 0) {\n $trailDays = $days = $day;\n $IsDayLeft = true;\n }\n }\n }\n if($IsDayLeft) {\n $days = $days+30;\n $nextDate = date('Y-m-d 00:00:00', strtotime(\"+ \".$days.\" days\", strtotime($currentDate)));\n } else {\n $nextDate = date('Y-m-d 00:00:00', strtotime(\"+ 30 days\", strtotime($currentDate)));\n }\n\t\t\t\t$paymentPlan = $companyData[0]->paymentplan;\n\t\t\t\t$paymentHistory = DB::table('paymenthistory')->where('companyid',((int)$id))->orderBy('id','DESC')->first();\n\t\t\t\tif(!empty($paymentHistory)) {\n\t\t\t\t\t$statusHistory = DB::table('paymenthistory')->where('id', (int)$paymentHistory->id)->update(['expiredate' => date('Y-m-d H:i:s')]);\n\t\t\t\t\tif($statusHistory) {\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn response()->json(['error'=>'networkerror'], 401);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$trial = 0;\n /*\n\t\t\t\tif($companyData[0]->remaintrial > 0) {\n\t\t\t\t\tif($companyData[0]->lastpaymentdate == null ) {\n\t\t\t\t\t\t$CreatedDate = strtotime($companyData[0]->created_at);\n\t\t\t\t\t\t$CurrentDates = strtotime(\"- 30 days\", strtotime(date('Y-m-d H:i:s')));\n\t\t\t\t\t\t$differStrTime = $CreatedDate - $CurrentDates;\n\t\t\t\t\t\tif($differStrTime > 0) {\n\t\t\t\t\t\t\t$day = ceil($differStrTime/(24*60*60));\n\t\t\t\t\t\t\t$dayremain = $companyData[0]->remaintrial - $day;\n\t\t\t\t\t\t\tif($dayremain > 0 && $dayremain < 31) {\n\t\t\t\t\t\t\t\t$trial = $dayremain;\n\t\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\t$CreatedDate = strtotime($companyData[0]->nextpaymentdate);\n\t\t\t\t\t\t$CurrentDates = strtotime(date('Y-m-d H:i:s'));\n\t\t\t\t\t\t$differStrTime = $CreatedDate - $CurrentDates;\n\t\t\t\t\t\tif($differStrTime > 0) {\n\t\t\t\t\t\t\t$day = floor($differStrTime/(24*60*60));\n\t\t\t\t\t\t\tif($day < $companyData[0]->remaintrial) {\n\t\t\t\t\t\t\t\t$trial = $day;\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}\n */\n\t\t\t\t$statusCompany = Companydetail::where('authid', (int)$id)->update(['subscriptiontype' => 'manual','nextpaymentdate' => $nextDate, 'paymentplan' => (int)(request('subplan')),'plansubtype' => 'free','status' => 'active','lead_payment'=>0,'lastpaymentdate' =>$currentDate,'next_paymentplan' =>(int)(request('subplan')),'remaintrial' =>$trial,'account_type' =>'paid','free_subscription_period' => null,'free_subscription_start' => null,'free_subscription_end' => null,'remaintrial'=> $trailDays ]);\n\t\t\t\tif($statusCompany) {\n $statusPayment = DB::table('paymenthistory')->insert(\n ['companyid' => (int)$id,'transactionfor' => 'registrationfee',\n 'amount' => '0.00',\n 'status' => 'approved' ,\n 'payment_type' => (int)(request('subplan')),\n 'expiredate' => $nextDate,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]);\n\t\t\t\t\tif($statusPayment) {\n\t\t\t\t\t\tif($degrade) {\n\t\t\t\t\t\t\tDB::table('degrade')->insert(\n ['authid' => (int)$id,\n 'paymentplan' => (int)(request('subplan')),\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($companyData[0]->subscription_id) && $companyData[0]->subscription_id != null) {\n \t\t\t\t\t\ttry {\n $stripe = Stripe::make(config()->get('services')['stripe']['secret']);\n $subscription = $stripe->subscriptions()->cancel($companyData[0]->customer_id , $companyData[0]->subscription_id);\n $deletSub = Companydetail::where('authid', (int)$id)->update(['subscription_id' => null]);\n }\tcatch(\\Cartalyst\\Stripe\\Exception\\NotFoundException $e) {\n\n } catch(Exception $e) {\n return response()->json(['error'=>$e->getMessage()], 401);\n }\n\t\t\t\t\t\t}\n $zaiperenv = env('ZAIPER_ENV','local');\n if($zaiperenv == 'live') {\n $this->companyCreateZapierbyID($id);\n }\n\t\t\t\t\t\treturn response()->json(['success' => true,'nextdate' =>$nextDate], $this->successStatus);\n \n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn response()->json(['error'=>'networkerror'], 401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn response()->json(['error'=>'networkerror'], 401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn response()->json(['error'=>'networkerror'], 401);\n\t\t\t}\n }", "public function testGetDateActualite() \r\n { \r\n $actu = new Actualite(); \r\n\t\t$date = new DateTime('2018-03-26T08:30:00.000000Z');\r\n\t\t\r\n $actu->setDateActualite($date);\r\n\t\t$resultat = $actu->getDateActualite();\r\n \r\n $this->assertEquals('2018-03-26T08:30:00.000000Z', $resultat); \r\n }", "public function getRegularDue();", "public function testGetSalesWithValidPromotorToken()\n { \n $knownDate = Carbon::parse('2017-06-20');\n Carbon::setTestNow($knownDate); \n \n // Set time\n $dateObject = Carbon::now();\n \n // Set time\n $time = $dateObject->format('Y-m');\n $thisMonth = $dateObject->format('Y-m-d');\n \n // Substract date by 1 month\n $dateObject = Carbon::parse('2017-05-20');\n \n $timeLastMonth = $dateObject->format('Y-m');\n $lastMonth = $dateObject->format('Y-m-d');\n\n // Populate data\n $panasonicID = $this->_populatePanasonic();\n $arcoID = $this->_populateArco($panasonicID);\n $tlID = $this->_populateTL($arcoID);\n $promotorID = $this->_populatePromotor($tlID);\n $branchID = $this->_populateBranch($tlID);\n $dealerID = $this->_populateDealer();\n $dealerAccountID = $this->_populateDealerAccount($tlID);\n\n // Populate product data\n $productCategoryID = $this->_populateProductCategory();\n $productID = $this->_populateProduct($productCategoryID);\n \n // Populate target\n $currentTargetValue = 100000;\n $lastTargetValue = 500000;\n \n $currentTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $currentTargetValue, \n 'month' => $time\n ];\n \n $lastTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $lastTargetValue, \n 'month' => $timeLastMonth\n ];\n \n $this->_populatePromotorTarget($currentTarget);\n $this->_populatePromotorTarget($lastTarget);\n \n \n // Populate Report\n $priceThisMonth = 90000;\n $priceLastMonth = 100000;\n $quantityThisMonth = 1;\n $quantityLastMonth = 1;\n \n $reportThisMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceThisMonth, \n 'quantity' => $quantityThisMonth, \n 'date' => $thisMonth\n ];\n \n $reportLastMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceLastMonth, \n 'quantity' => $quantityLastMonth, \n 'date' => $lastMonth\n ];\n \n $this->_populateReport($reportThisMonth);\n $this->_populateReport($reportLastMonth);\n \n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $response = $this->call('GET', '/api/1.5.0/report-sales', ['token' => $encryptedToken]);\n $result = json_decode($response->getContent(), true);\n \n // Verify\n $this->assertTrue(array_key_exists('result', $result));\n $this->assertEquals($result['result']['targetPromotorProduct'][$productID]['product_ID'], $productID);\n $this->assertEquals($result['result']['targetPromotor'], $currentTargetValue);\n $this->assertEquals($result['result']['targetPromotorData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['targetDealer'], $currentTargetValue);\n $this->assertEquals($result['result']['targetDealerData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['comparison'], $lastTargetValue);\n $this->assertEquals($result['result']['comparisonData'], $priceLastMonth*$quantityLastMonth);\n }", "public function testExtendDueDate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testCalculatePHDStudentPaymentSuccess() {\n\n //get the first PHD student whose name is 'Alicia Reid'\n $phdStudent = User::where('name','=','Alicia Reid')->first();\n\n /*\n call the 'calculatePHDStudentPayment' function of the 'PaymentController'\n and set the value of the 'id' parameter to be the ID of the PHD student\n and set the value of the 'fromDate' parameter in YYYY-MM-DD format \n (which the controller expect due to the way the dates are stored in the \n database) to '2016-10-01' and the value of the 'toDate' parameter to\n '2016-11-10'\n */\n $response = $this->action('GET', 'PaymentController@calculatePHDStudentPayment', array(\n 'id' => $phdStudent->id,\n 'fromDate' =>'2016-10-01',\n 'toDate' => '2016-11-10'\n ));\n\n /*\n get the view returned from calling the 'calculatePHDStudentPayment'\n of the 'PaymentController'\n */\n \t$view = $response->original;\n\n /*\n assert that the value of the 'totalPayment' variable contained\n in the view has a value of 227.9\n */\n \t$this->assertEquals(227.90, $view['totalPayment']);\n\n\n /*\n assert that the value of the 'demonstratorHours' variable contained\n in the view has a value of 10\n */\n \t$this->assertEquals(10, $view['demonstratorHours']);\n\n /*\n assert that the value of the 'teachingHours' variable contained\n in the view has a value of 10\n */\n \t$this->assertEquals(10, $view['teachingHours']);\n\n /*\n the finding of the phd student from the id depends purely upon built in \n laravel methods which will have been tested by the developers and\n as such there is no reason to test the right phd student has been sent\n to the view. The same concept applies to querying the 'sessions' \n relationship of the PHD student/User\n */\n\n }", "function get_empl_loan_monthly_payment($id, $date){\n\t$datey = date2sql($date);\n\t$sql = \"SELECT SUM(`monthly_pay`) FROM \".TB_PREF.\"kv_empl_loan WHERE `periods_paid` < `periods` AND `empl_id`=\".db_escape($id).\" AND date <= \".db_escape($datey).\" AND status='Active'\";\n\t\n\t$result = db_query($sql, \"could not get bonus type\");\n\t\n\t$row = db_fetch_row($result);\n\t\n\t//display_error($sql);\n\tif(!empty($row[0]))\n\t\treturn $row[0];\n\telse\n\t\treturn 0;\n}", "public function test_it_return_valid_bill_payment_term() {\n\n // Test with bill that has payment term\n $this->assertEquals(date('d-m-Y', strtotime($this->bill->payment_term)), BillData::getPaymentTerm($this->bill->id));\n\n // Test with bill that does not have payment term\n $bill = factory(\\App\\Bill::class)->create([\n 'user_id' => $this->user->id,\n 'client_id' => $this->client->id,\n 'payment_term' => ''\n ]);\n $this->assertEquals(false, BillData::getPaymentTerm($bill->id));\n }", "public function testPaymentCreatePost()\n {\n }", "public function testCrceOnlinePaymentUpdatePlan()\n {\n\n }", "public function setPaymentDateAttribute($value)\n\t{\n\t\t//only set the payment if the user set it, otherwise the app would crash\n\t\tif($value)\n\t $this->attributes['payment_date'] = Carbon::createFromFormat('Y-m-d', $value);\n\t}", "public function testHasPayment()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function updateDueAmountBydate($id)\n {\n $rs = $this->getPaymentDetails($id);\n $res = $rs->fetch_object();\n $index = 0;\n $data = array();\n foreach ($res as $key) {\n $data[$index] = $key;\n $index++;\n }\n $amount = json_decode($data[0]);\n $payment_status = json_decode($data[1]);\n $package_amount = $data[2];\n $paymentDone = unserialize($data[3]);\n $pendingPayment = json_decode($data[4]);\n $totalPendingAmount = json_decode($data[5]);\n $paidAmount = 0;\n $pendingAmount = 0;\n $dueTillToday = 0;\n $arr = array(\"hgh\", \"key1\", \"key2\", \"key3\", \"key4\", \"key5\", \"key6\", \"key7\", \"key8\", \"key9\", \"key10\", \"key11\", \"key12\", \"key13\", \"key14\");\n for ($i = 1; $i < 15; $i++) {\n $xyz = $arr[$i];\n if ((is_null($pendingPayment->$xyz) || $pendingPayment->$xyz > 0 ) && (date((($this->getPaymentDate($i))->fetch_object())->paymentDate) <= date('Y-m-d'))) {\n $pendingPayment->$xyz = $totalPendingAmount->$xyz;\n } elseif (is_null($pendingPayment->$xyz) && (date((($this->getPaymentDate($i))->fetch_object())->paymentDate) > date('Y-m-d'))) {\n $pendingPayment->$xyz = null;\n } else {\n $pendingPayment->$xyz = $pendingPayment->$xyz;\n }\n }\n $dueTillToday = $this->getTotalOfDueTillToday($pendingPayment);\n $totalPendingAmount = $this->getTotalOfDueTillToday($totalPendingAmount);\n $paidTotal = $this->getTotalOfPaid($paymentDone); \n $pendingTotal = $package_amount - $paidTotal;\n // var_dump(($package_amount - $paidTotal) == $totalPendingAmount);\n $pendingPayment = json_encode($pendingPayment);\n $this->UpdatePendingPaymentByDate($id, $pendingPayment);\n $this->UpdateDueTable($id,$package_amount,$paidTotal,$pendingTotal,$dueTillToday);\n }", "public function getPaidDate() : \\DateTime\n {\n return $this->paidDate;\n }", "public function testCardExpirationDateValidationFails()\n {\n $card = new Card();\n $card['ExpirationMonth'] = gmdate('m');\n $card['ExpirationYear'] = gmdate('y') - 1;\n $card->validate();\n }", "public function getPaymorrowOxPayment()\n {\n }", "function calcul_date_relance($id_recommandation, $action_id_category, $r_sub_category_code, $prochaine_echeance) \n{\n // LE SERVICE : $r_sub_category_code\n\n\t $date_relance = $prochaine_echeance + 4 ;\n return ($date_relance );\n}", "public function testGetSalesWithValidPromotorTokenOddMonth()\n { \n $knownDate = Carbon::parse('2017-07-31');\n Carbon::setTestNow($knownDate); \n \n // Set time\n $dateObject = Carbon::now();\n \n // Set time\n $time = $dateObject->format('Y-m');\n $thisMonth = $dateObject->format('Y-m-d');\n \n // Substract date by 1 month\n $dateObject = Carbon::parse('2017-06-20');\n \n $timeLastMonth = $dateObject->format('Y-m');\n $lastMonth = $dateObject->format('Y-m-d');\n\n // Populate data\n $panasonicID = $this->_populatePanasonic();\n $arcoID = $this->_populateArco($panasonicID);\n $tlID = $this->_populateTL($arcoID);\n $promotorID = $this->_populatePromotor($tlID);\n $branchID = $this->_populateBranch($tlID);\n $dealerID = $this->_populateDealer();\n $dealerAccountID = $this->_populateDealerAccount($tlID);\n\n // Populate product data\n $productCategoryID = $this->_populateProductCategory();\n $productID = $this->_populateProduct($productCategoryID);\n \n // Populate target\n $currentTargetValue = 100000;\n $lastTargetValue = 500000;\n \n $currentTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $currentTargetValue, \n 'month' => $time\n ];\n \n $lastTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $lastTargetValue, \n 'month' => $timeLastMonth\n ];\n \n $this->_populatePromotorTarget($currentTarget);\n $this->_populatePromotorTarget($lastTarget);\n \n \n // Populate Report\n $priceThisMonth = 90000;\n $priceLastMonth = 100000;\n $quantityThisMonth = 1;\n $quantityLastMonth = 1;\n \n $reportThisMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceThisMonth, \n 'quantity' => $quantityThisMonth, \n 'date' => $thisMonth\n ];\n \n $reportLastMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceLastMonth, \n 'quantity' => $quantityLastMonth, \n 'date' => $lastMonth\n ];\n \n $this->_populateReport($reportThisMonth);\n $this->_populateReport($reportLastMonth);\n\n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $response = $this->call('GET', '/api/1.5.0/report-sales', ['token' => $encryptedToken]);\n $result = json_decode($response->getContent(), true);\n \n // Verify\n $this->assertTrue(array_key_exists('result', $result));\n $this->assertEquals($result['result']['targetPromotorProduct'][$productID]['product_ID'], $productID);\n $this->assertEquals($result['result']['targetPromotor'], $currentTargetValue);\n $this->assertEquals($result['result']['targetPromotorData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['targetDealer'], $currentTargetValue);\n $this->assertEquals($result['result']['targetDealerData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['comparison'], $lastTargetValue);\n $this->assertEquals($result['result']['comparisonData'], $priceLastMonth*$quantityLastMonth);\n }", "public function testCrceOnlinePaymentGetRecurringOnlinePayments()\n {\n\n }", "public function setPaymentDate($timestamp);", "public function testGetSalesWithValidPromotorTokenMarchMonth()\n { \n $knownDate = Carbon::parse('2017-03-31');\n Carbon::setTestNow($knownDate); \n \n // Set time\n $dateObject = Carbon::now();\n \n // Set time\n $time = $dateObject->format('Y-m');\n $thisMonth = $dateObject->format('Y-m-d');\n \n // Substract date by 1 month\n $dateObject = Carbon::parse('2017-02-20');\n \n $timeLastMonth = $dateObject->format('Y-m');\n $lastMonth = $dateObject->format('Y-m-d');\n\n // Populate data\n $panasonicID = $this->_populatePanasonic();\n $arcoID = $this->_populateArco($panasonicID);\n $tlID = $this->_populateTL($arcoID);\n $promotorID = $this->_populatePromotor($tlID);\n $branchID = $this->_populateBranch($tlID);\n $dealerID = $this->_populateDealer();\n $dealerAccountID = $this->_populateDealerAccount($tlID);\n\n // Populate product data\n $productCategoryID = $this->_populateProductCategory();\n $productID = $this->_populateProduct($productCategoryID);\n \n // Populate target\n $currentTargetValue = 100000;\n $lastTargetValue = 500000;\n \n $currentTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $currentTargetValue, \n 'month' => $time\n ];\n \n $lastTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $lastTargetValue, \n 'month' => $timeLastMonth\n ];\n \n $this->_populatePromotorTarget($currentTarget);\n $this->_populatePromotorTarget($lastTarget);\n \n \n // Populate Report\n $priceThisMonth = 90000;\n $priceLastMonth = 100000;\n $quantityThisMonth = 1;\n $quantityLastMonth = 1;\n \n $reportThisMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceThisMonth, \n 'quantity' => $quantityThisMonth, \n 'date' => $thisMonth\n ];\n \n $reportLastMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceLastMonth, \n 'quantity' => $quantityLastMonth, \n 'date' => $lastMonth\n ];\n \n $this->_populateReport($reportThisMonth);\n $this->_populateReport($reportLastMonth);\n\n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $response = $this->call('GET', '/api/1.5.0/report-sales', ['token' => $encryptedToken]);\n $result = json_decode($response->getContent(), true);\n \n // Verify\n $this->assertTrue(array_key_exists('result', $result));\n $this->assertEquals($result['result']['targetPromotorProduct'][$productID]['product_ID'], $productID);\n $this->assertEquals($result['result']['targetPromotor'], $currentTargetValue);\n $this->assertEquals($result['result']['targetPromotorData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['targetDealer'], $currentTargetValue);\n $this->assertEquals($result['result']['targetDealerData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['comparison'], $lastTargetValue);\n $this->assertEquals($result['result']['comparisonData'], $priceLastMonth*$quantityLastMonth);\n }", "abstract public function getMonthlyFee();", "public function test_should_calculate_business_days()\n {\n $startDate = clone $this->date;\n $endDate = $this->date->addMonth()->format('Y-m-d');\n\n $noOfBusinessDays = $this->calculateBusinessDays();\n\n $response = $this->get('calculate/business-days/?start_date=' . $startDate->format('Y-m-d') . '&end_date=' . $endDate);\n $response->assertSuccessful();\n $this->assertEquals($noOfBusinessDays, $response->getContent());\n }", "function customer_date_field_process()\n {\n if (!$_POST['ia_datepicker_for_dob']) {\n wc_add_notice(__('<b>Billing Enter your age</b> is a required field'), 'error');\n return;\n }\n $currentCountry = wc_get_base_location();\n $currentState = $currentCountry['state'];\n $getAllAgeLimitToSetDefault = get_option('ia_configure_restriction');\n $defaultAgeLimit = $getAllAgeLimitToSetDefault[\"age_restriction\"]['Default'];\n $currentStateRistriction = get_option(\"ia_configure_restriction\", $defaultAgeLimit);\n $currentStateRistriction = $currentStateRistriction[$currentState];\n $currentStateRistriction = (int)$currentStateRistriction;\n $secondsInLimitedAge = $currentStateRistriction * 31556952;\n $date1 = $_POST['ia_datepicker_for_dob'];\n $date2 = date('Y-m-d');\n $diff = abs(strtotime($date2) - strtotime($date1));\n if ($diff < $secondsInLimitedAge) {\n wc_add_notice(__('<b>You are not eligibile for check out</b> '), 'error');\n return;\n }\n }", "function ltiGetDueDate() {\n $retval = new stdClass();\n $retval->message = false;\n $retval->penalty = 0;\n $retval->dayspastdue = 0;\n $retval->percent = 0;\n $retval->duedate = false;\n $retval->duedatestr = false;\n\n $duedatestr = ltiGetCustom('due');\n if ( $duedatestr === false ) return $retval;\n $duedate = strtotime($duedatestr);\n\n $diff = -1;\n $penalty = false;\n\n date_default_timezone_set('Pacific/Honolulu'); // Lets be generous\n if ( ltiGetCustom('timezone') ) {\n date_default_timezone_set(ltiGetCustom('timezone'));\n }\n\n if ( $duedate === false ) return $retval;\n\n // If it is just a date - add nearly an entire day of time...\n if ( strlen($duedatestr) <= 10 ) $duedate = $duedate + 24*60*60 - 1;\n $diff = time() - $duedate;\n\n $retval->duedate = $duedate;\n $retval->duedatestr = $duedatestr;\n // Should be a percentage off between 0.0 and 1.0\n if ( $diff > 0 ) {\n $penalty_time = ltiGetCustom('penalty_time') ? ltiGetCustom('penalty_time') + 0 : 24*60*60;\n $penalty_cost = ltiGetCustom('penalty_cost') ? ltiGetCustom('penalty_cost') + 0.0 : 0.2;\n $penalty_exact = $diff / $penalty_time;\n $penalties = intval($penalty_exact) + 1;\n $penalty = $penalties * $penalty_cost;\n if ( $penalty < 0 ) $penalty = 0;\n if ( $penalty > 1 ) $penalty = 1;\n $retval->penalty = $penalty;\n $retval->dayspastdue = $diff / (24*60*60);\n $retval->percent = intval($penalty * 100);\n $retval ->message = 'It is currently '.sprintf(\"%10.2f\",$retval->dayspastdue).\" days\\n\".\n 'past the due date ('.htmlentities($duedatestr).') so your late penalty is '.$retval->percent.\" percent.\\n\";\n }\n return $retval;\n}", "public function testApproxBondYTMFactoryMonthly()\n {\n $this->assertApproxBondYTM(\\FinanCalc\\FinanCalc\n ::getInstance()\n ->getFactory('BondYTMCalculatorFactory')\n ->newMonthlyCouponsBond(10000, 10800, 1.752, 0.25));\n }", "public function testSetGetIssuedDate()\n {\n $createdIssuedDate = new DateTime('today');\n $this->invoice->setIssuedDate('Today');\n $this->assertEquals($this->invoice->getIssuedDate()->format('Y-m-d'), $createdIssuedDate->format('Y-m-d'));\n }", "public function test_get_due_date() {\n $this->resetAfterTest();\n $tsassign = new plagiarism_turnitinsim_assign();\n\n // Log instructor in.\n $this->setUser($this->instructor);\n\n // Create assign module with a due date.\n $record = new stdClass();\n $record->course = $this->course;\n $record->duedate = 1000000001;\n $assign = $this->getDataGenerator()->create_module('assign', $record);\n\n $response = $tsassign->get_due_date($assign->id);\n $this->assertEquals(1000000001, $response);\n\n // Create assign module without a due date.\n $record = new stdClass();\n $record->course = $this->course;\n $record->duedate = 1000000001;\n $assign = $this->getDataGenerator()->create_module('assign', $record);\n\n $response = $tsassign->get_due_date($assign->id);\n $this->assertEquals(1000000001, $response);\n }", "public function calcExpirationDate($_expiration_date){\r\n $_expiration_date = date_create_from_format(\"m/y\",\"$_expiration_date\"); // qui dichiaro che la stringa della data di scadenza della carta diventa un dato \"date\" dicendogli che il primo parametro è il mese e il secondo è l'anno\r\n $this->expiration_date = date_format($_expiration_date,\"y/m\");//qui riformatto l'ordine e metto prima l'anno del mese,in modo che quando farà il confronto lo farà prima in base all'anno\r\n if($this->expiration_date < strftime(\"%y/%m\")){ //grazie al metodo \"strftime\" vado a prendere la data attuale dandogli le regole all'interno\r\n throw new Exception(\"Attenzione! \" . $this->name . \" \" . $this->lastname .\" la tua carta è scaduta, aggiorna la tua carta.\");\r\n }else{\r\n $this->expiration_date = date_format($_expiration_date,\"m/y\");// qui riformatto la data in modo che se non ci sono errori sarà come l'originale\r\n return $this->getExpirationDate();\r\n }\r\n }", "public function testSalaryPaymentDateIsWeekend(): void\n {\n $dateTime = new \\DateTime('31 March 2019');\n $dateTimeMock = Mockery::mock(DateTime::class);\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('29-03-2019', $result);\n }", "public function testCalculateReturnsGoodPrixForRegularClient()\n {\n $this->client->setAnniversaire(\\DateTime::createFromFormat($this->format, $this->getPreviousYears(\"-13 years\")))->setDiscount(false);\n $this->reservation->addClient($this->client)->setType('journee');\n $result = $this->PrixManager->calculate($this->reservation);\n $this->assertEquals(16, $result);\n }", "public function testPurchasesWithPaymentPost()\n {\n }", "public function testGetBusinessDate()\n {\n $date = '2019-05-01';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-06T00:00:00Z', 5, 0, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-22';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-29T00:00:00Z', 7, 2, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-1';\n $delay = 16;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-27T00:00:00Z', 26, 2, 8))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n }", "public function isUserPaymentPaymorrowMethod()\n {\n }", "public function validatePayment()\n {\n }" ]
[ "0.75928265", "0.74541163", "0.6825568", "0.66008466", "0.65375143", "0.6525036", "0.64878345", "0.64219874", "0.62809706", "0.62751895", "0.6268957", "0.6172843", "0.61654437", "0.61646694", "0.6159033", "0.61121505", "0.6100037", "0.60720855", "0.5967875", "0.5940052", "0.59331876", "0.5909362", "0.59080845", "0.59004503", "0.58888835", "0.5873715", "0.5863631", "0.5859714", "0.58460534", "0.5837215", "0.583649", "0.58183074", "0.5806332", "0.57983834", "0.5776687", "0.5746568", "0.57434565", "0.57384557", "0.57375634", "0.5721905", "0.57189876", "0.57033646", "0.56991357", "0.56967175", "0.5689383", "0.56775165", "0.565525", "0.5653822", "0.56475306", "0.5640608", "0.56385297", "0.563531", "0.56315047", "0.5629141", "0.5622816", "0.5616038", "0.5613764", "0.56099844", "0.5607814", "0.56044406", "0.55923134", "0.5592012", "0.5590649", "0.5581149", "0.55618894", "0.55524075", "0.55467385", "0.5535474", "0.55334616", "0.55332017", "0.5533018", "0.5527493", "0.55251247", "0.5517722", "0.54946846", "0.54944193", "0.5484993", "0.5481939", "0.54771227", "0.54715085", "0.54651594", "0.54627514", "0.5458477", "0.54577786", "0.5455914", "0.5450115", "0.54464537", "0.5434077", "0.54301524", "0.5430045", "0.542534", "0.54246855", "0.54192597", "0.5413965", "0.5412409", "0.5411765", "0.54063183", "0.5402054", "0.5393936", "0.53937715" ]
0.7595731
0
Test bonus payment date is weekend
Дата выплаты тестового бонуса приходится на выходной день
public function testBonusPaymentDateIsWeekend(): void { $dateTime = new \DateTime('28 February 2019'); $bonusDateTime = new \DateTime('16 February 2019'); $this->dateTimeMock->shouldReceive('modify->modify') ->twice() ->with('+14 days') ->andReturn($bonusDateTime); $this->dateTimeMock->shouldReceive('modify') ->once() ->with('today') ->andReturn($dateTime); $dayCalculatorService = new DateCalculatorService($this->dateTimeMock); $result = $dayCalculatorService->getBonusPaymentDate(); $this->assertEquals('20-02-2019', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIsWeekend()\n {\n $this->assertTrue($this->getCalculator()->isWeekend('2019-05-04'));\n $this->assertTrue($this->getCalculator()->isWeekend('2019-05-05'));\n }", "public function testSalaryPaymentDateIsWeekend(): void\n {\n $dateTime = new \\DateTime('31 March 2019');\n $dateTimeMock = Mockery::mock(DateTime::class);\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('29-03-2019', $result);\n }", "public function testIsWeekend()\n {\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-01')->isWeekend());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-02')->isWeekend());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-03')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-04')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-05')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-06')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-07')->isWeekend());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-08')->isWeekend());\n }", "public function isWeekend()\n {\n return (int)$this->date->format('N') > 5;\n }", "protected function _isWeekend()\n {\n $day = date(\n 'N', mktime(0, 0, 0, $this->_month, $this->_date, $this->_year)\n );\n return in_array($day, array(6, 7));\n }", "public function isWeekend(): bool\n {\n return $this->value === self::SATURDAY || $this->value === self::SUNDAY;\n }", "function isWeekend($date) {\n return (date('N', strtotime($date)) >= 6);\n }", "function mf_validate_date_weekend($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$error_message = $mf_lang['val_date_na'];\r\n\t\t\r\n\t\t$target_value = $value[0];\r\n\t\t\r\n\t\tif(date('N', strtotime($target_value)) >= 6){\r\n\t\t\treturn $error_message;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function isWeekend()\r\n {\r\n return $this->weekendflag; \r\n }", "public function test_recurring_sunday() {\n\t\t$mock = get_week_mock(1, array(SUNDAY));\n\t\t$mock->set_start('2019-01-01 11:55');\n\t\t$mock->set_end('2019-01-01 13:00');\n\t\t$schedule = new RecurringDowntime($mock);\n\t\t$input = mock_date('2019-05-26');\n\t\t// Match week\n\t\t$this->assertTrue($schedule->match_week_interval($input));\n\t\t// Match day\n\t\t$days = $schedule->pluck_recurrence('day');\n\t\t$this->assertTrue(in_array($input->get_day_of_week(), $days));\n\t}", "function isWeekend($date = null, $stepDay = null, $getAlsoWeekendDay = false){\n if(is_null($date)) $date = date('Y-m-d');\n //if setpDay is null, we set it to 0\n if(is_null($stepDay)) $stepDay = 0;\n //Add step days to check weekend falls in future or now\n $date = date('Y-m-d', strtotime($date.' + '.$stepDay.' days'));\n //$yeahIsWeekend take true/false switch weekend falling or not\n $yeahIsWeekend = date('D', strtotime($date)) ==='Sat' || date('D', strtotime($date)) === 'Sun';\n $whichWeekendDay = null;\n //if date is Saturday $whichWeekendDay take S letter\n if(date('D', strtotime($date)) ==='Sat') $whichWeekendDay = 'S';\n //if date is Sunday $whichWeekendDay take D letter\n elseif(date('D', strtotime($date)) ==='Sun') $whichWeekendDay = 'D';\n //return true/false switch weekend falling or not | tab or boolean swicth getter format\n return $getAlsoWeekendDay ? [$yeahIsWeekend, $whichWeekendDay] : $yeahIsWeekend;\n }", "function isWorkingDayNext(&$PDOdb, $dateTest){\n\n\t\t$date=strtotime('+1day',$dateTest);\n\n\t\treturn $this->isWorkingDay($PDOdb, date('Y-m-d', $date));\n\n\t}", "public function isWeekend(): bool\n {\n return in_array((int) $this->getData()['dayOfWeek'], [0, 6], true);\n }", "function isWeekend() {\n $weekday = $this->getWeekday();\n return $weekday == 0 || $weekday == 6;\n }", "function isWeekend( $date )\r\n\t\t{\r\n\t\t$weekendDays = array ( 0, 6 );\r\n\t\t$dateArray = getdate( $date );\r\n\t\tif ( in_array( $dateArray[ 'wday' ], $weekendDays ) ) return true;\r\n\t\telse\r\n\t\treturn false;\r\n\t\t}", "public function testIsHoliday()\n {\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-31'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-23'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-24'));\n }", "public function testTruthAndReconciliationDayOnAfter2021(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"last day of september {$year}\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "function isNew($publishd_at)\n{\n return (Carbon::now()->diffInDays(Carbon::createFromFormat('Y-m-d H:i:s', $publishd_at))) <= 7;\n}", "private function getTargetGatepass($value){\n $date = new DateTime($value);\n $date->modify('+1 day');\n // Output\n $value = $date->format('Y-m-d');\n if((date('N', strtotime($value)) >= 6) == 1) {\n // Create a new DateTime object\n $date = new DateTime($value);\n \n // Modify the date it contains\n $date->modify('next monday');\n \n // Output\n $newdate = $date->format('Y-m-d');\n \n \n while(Holiday::where('holiday_date','=',$newdate)->count() == 1){\n $date = new DateTime( (string) $newdate ) ;\n $date->modify('+1 day');\n $newdate = $date->format('Y-m-d');\n if((date('N', strtotime((string) $newdate )) >= 6) == 1) {\n // Modify the date it contains\n $date->modify('next monday');\n // Output\n $newdate = $date->format('Y-m-d');\n }\n \n \n }\n \n //echo date(\"Y-m-d\", strtotime(\"next monday\"));\n }else{\n $date = new DateTime($value);\n \n // Output\n $newdate = $date->format('Y-m-d');\n \n while(Holiday::where('holiday_date','=',$newdate)->count() == 1){\n $date = new DateTime( (string) $newdate ) ;\n $date->modify('+1 day');\n $newdate = $date->format('Y-m-d');\n if((date('N', strtotime((string) $newdate )) >= 6) == 1) {\n // Modify the date it contains\n $date->modify('next monday');\n // Output\n $newdate = $date->format('Y-m-d');\n }\n \n \n }\n \n //echo Holiday::where('holiday_date','=', (string) $newdate )->count();\n \n }\n \n return $newdate;\n }", "public function testBonusPaymentDateIsPassed(): void\n {\n\n $firstDay = new \\DateTime('1 February 2019');\n $today = new \\DateTime('18 February 2019');\n $bonusDay = new \\DateTime('16 February 2019');\n $nextWednesday = new \\DateTime('16 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('first day of this month')\n ->andReturn($firstDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('+14 days')\n ->andReturn($bonusDay);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('next wednesday')\n ->andReturn($nextWednesday);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('-', $result);\n }", "public function testIsBusinessDate()\n {\n // holidays\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-31'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-23'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-24'));\n\n // weekends\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-04'));\n $this->assertFalse($this->getCalculator()->isBusinessDate('2019-05-05'));\n\n // weekdays\n $this->assertTrue($this->getCalculator()->isBusinessDate('2019-05-01'));\n $this->assertTrue($this->getCalculator()->isBusinessDate('2019-05-09'));\n }", "public function testIsWeekday()\n {\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-01')->isWeekday());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-02')->isWeekday());\n $this->assertFalse(DateTime::createFromFormat('Y-m-d', '2021-01-03')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-04')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-05')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-06')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-07')->isWeekday());\n $this->assertTrue(DateTime::createFromFormat('Y-m-d', '2021-01-08')->isWeekday());\n }", "public function isWeekend()\n {\n return in_array($this->dayOfWeek, static::$weekendDays);\n }", "public function validateDelivery()\n {\n $holiday = new Holiday;\n $delivery_date_day = date('w', strtotime(date('Y-m-d')));\n $delivery_date = date('Y-m-d');\n\n switch ($delivery_date_day){ \n case 5: // if this is friday\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+3 days'));\n break;\n case 6:\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+2 days'));\n break;\n case 7:\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+1 days'));\n break;\n }\n \n while (true) {\n if (!$holiday->isHoliday($delivery_date)) break; // if not holiday destroy infinite loop\n $delivery_date = date('Y-m-d', strtotime($delivery_date . '+ 1 day')); // if still it is holiday add 1 day to its delivery date\n }\n return $delivery_date;\n }", "private function isWeekEnd($date)\n {\n if ($date->format('N') >= 6) {\n return true;\n } else {\n return false;\n }\n }", "public function isWeekday()\n {\n return !$this->isWeekend();\n }", "public function testBonusPaymentDate(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $bonusDateTime = new \\DateTime('15 February 2019');\n\n $this->dateTimeMock->shouldReceive('modify->modify')\n ->twice()\n ->with('+14 days')\n ->andReturn($bonusDateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getBonusPaymentDate();\n $this->assertEquals('15-02-2019', $result);\n }", "public function testRepublicDayOnAfter1946(): void\n {\n $year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-6-2\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function isWeekday(): bool\n {\n return $this->value >= self::MONDAY && $this->value <= self::FRIDAY;\n }", "function isWeekend(string $myDate, $weekend = WEEKEND) :bool\n{\n\treturn (in_array($myDate, $weekend));\n}", "function is_half_holiday($begin,$end,$time_begin,$time_end)\n{\n\tglobal $wpdb;\n\t\n\t$is_half_holiday = 'n';\n\t\n\t$half_holiday_days = \"SELECT * FROM \" . WP_CALENDAR_TABLE_Aula . \" WHERE event_category=5 AND event_valid='y' AND event_begin<='\" . $begin . \"' AND event_end>='\" . $end . \"'\";\n\t$result = $wpdb->get_results($half_holiday_days);\n\t\n\tif(!empty($result))\n\t{\n\t\tif(($time_begin >= '14:00') || ($time_end >= '14:00'))\n\t\t{\n\t\t\t$is_half_holiday = 'y';\t\n\t\t}\n\t}\n\t\n\treturn $is_half_holiday;\n\t\n}", "public function test_interval_hit_one() {\n\t\t$mock = get_week_mock(1);\n\t\t$mock->set_start('1980-01-01');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-08')));\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-15')));\n\t\t$this->assertTrue($schedule->match_week_interval(mock_date('1980-01-22')));\n\t}", "public function lastDayIsAWorkingDay()\r\n {\r\n $todaydate = new \\DateTime(date('m/d/Y h:i:s a', time()));\r\n //initialise to this month, last day\r\n $workingDayStringVal = $todaydate->modify('last day of this month');\r\n \r\n if(date('N', strtotime($workingDayStringVal)) <= 6)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "function checkVW($date) {\n //get current date\n date_default_timezone_set('GMT');\n $ph_time = time() + 8 * 60 * 60; //sets the current time to philippine time\n $today = date('Y-m-d H:i',$ph_time);\n $day = date(\"D\",$ph_time);\n $thisweek = $today;\n \n $thisweek = strtotime(\"last Wednesday\");\n if($day == 'Wed') {\n $end = strtotime($today);\n } else {\n $end = strtotime(\"next Wednesday\");\n }\n// echo '<br>'.date('Y-m-d',$thisweek).'===='.strtotime(date('Y-m-d',$thisweek)).'<br>';\n $time = strtotime( $date );\n $myDate = date( 'y-m-d', $time );\n// echo $date.'===='.$time.'=='.$myDate.'<br>';\n// echo date('Y-m-d',$end).'===='.strtotime(date('Y-m-d',$end)).'<br>';\n if($time >= $thisweek && $time < $end) { \n// echo 'true';\n return true;\n } else {\n return false;\n }\n }", "public function onSaturday(bool $set = null);", "public function onFriday(bool $set = null);", "public function isPaymorrowActive()\n {\n }", "public function test_legacy_recurrence_on() {\n\t\t$mock = new DowntimeModel();\n\t\t$mock->set_start('2019-04-10');\n\t\t$mock->recurrence = array(\n\t\t\t'label' => 'custom',\n\t\t\t'no' => '1',\n\t\t\t'text' => 'week'\n\t\t);\n\t\t$mock->recurrence_on = array('day' => WEDNESDAY);\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t$dow_output = $schedule->pluck_recurrence(DAY);\n\t\t$this->assertFalse(in_array(MONDAY, $dow_output));\n\t\t$this->assertFalse(in_array(TUESDAY, $dow_output));\n\t\t$this->assertTrue(in_array($schedule->start->get_day_of_week(), $dow_output)); // WEDNESDAY\n\t\t$this->assertFalse(in_array(THURSDAY, $dow_output));\n\t\t$this->assertFalse(in_array(FRIDAY, $dow_output));\n\t\t$this->assertFalse(in_array(SATURDAY, $dow_output));\n\t\t$this->assertFalse(in_array(SUNDAY, $dow_output));\n\t}", "public function test_interval_hit() {\n\t\t$mock = get_week_mock(5);\n\t\t$mock->set_start('1980-03-01');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t// Create future dates that coincides with the repeat interval\n\t\t$input1 = mock_date('1980-04-07');\n\t\t$input2 = mock_date('1980-05-14');\n\t\t$input3 = mock_date('1980-06-19');\n\n\t\t$this->assertTrue($schedule->match_week_interval($input1));\n\t\t$this->assertTrue($schedule->match_week_interval($input2));\n\t\t$this->assertTrue($schedule->match_week_interval($input3));\n\t}", "public function AllowPayOnDay()\n\t{\n\t\treturn false;\n\t}", "public function testDateTimeGetPublicHolidays()\n {\n }", "public function isNextWeek()\n {\n return $this->weekOfYear === static::now($this->getTimezone())->addWeek()->weekOfYear;\n }", "public function test_should_calculate_business_days()\n {\n $startDate = clone $this->date;\n $endDate = $this->date->addMonth()->format('Y-m-d');\n\n $noOfBusinessDays = $this->calculateBusinessDays();\n\n $response = $this->get('calculate/business-days/?start_date=' . $startDate->format('Y-m-d') . '&end_date=' . $endDate);\n $response->assertSuccessful();\n $this->assertEquals($noOfBusinessDays, $response->getContent());\n }", "protected function isEndOfWeek($date)\r\n {\r\n return (date('w', $date) == 6);\r\n }", "function is_bank_holiday($begin,$end)\n{\n\tglobal $wpdb;\n\t\n\t$is_bank_holiday = 'n';\n\t\n\t$bank_holiday_days = \"SELECT * FROM \" . WP_CALENDAR_TABLE_Aula . \" WHERE event_category=4 AND event_valid='y' AND event_begin<='\" . $begin . \"' AND event_end>='\" . $end . \"'\";\n\t$result = $wpdb->get_results($bank_holiday_days);\n\t\n\tif(!empty($result))\n\t{\n\t\t$is_bank_holiday = 'y';\n\t}\n\t\n\treturn $is_bank_holiday;\n\t\n}", "private function getNextWorkingDate($currentdate){\n\n\t$newdate = date('Y-m-d',strtotime($currentdate)); //get todays date\n $bankholidayArray = explode(\",\", $this->bankHolidays); //get bank holiday as array\n\n foreach ($bankholidayArray as &$value) { //for every bank holiday\n if ($newdate === $value) { //if the next day is a bank holiday\n $newdate = date('Y-m-d', strtotime($value . ' +1 Weekday')); //look for next weekday after bank holiday, set it as delivery\n }\n }\n return $newdate;\n }", "public function testGetBusinessDate()\n {\n $date = '2019-05-01';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-06T00:00:00Z', 5, 0, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-22';\n $delay = 3;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-29T00:00:00Z', 7, 2, 2))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n\n $date = '2019-05-1';\n $delay = 16;\n\n $this->assertEquals(\n (new BusinessDay('2019-05-27T00:00:00Z', 26, 2, 8))->toArray(),\n $this->getCalculator()->getBusinessDate($date, $delay)->toArray()\n );\n }", "function endOfWeek($date)\n {\n $viewtime = adodb_mktime(0,0,0,substr($date,5,2),substr($date,8,2),substr($date,0,4));\n $weekday = strftime(\"%w\",$viewtime);\n if ($weekday==0) $weekday=7;\n return date(\"Y-m-d\" ,$viewtime-(86400*($weekday-7)));\n }", "public function testIsWorkingDay()\n\t{\n\t\t$free = array(\n\t\t\t'2010-01-01',\n\t\t\t'2010-11-17',\n\t\t\t'2010-12-24',\n\t\t\t'2011-01-16',\n\t\t\t'2011-04-25',\n\t\t\t'2020-04-13'\n\t\t);\n\n\t\t$working = array(\n\t\t\t'2010-12-31',\n\t\t\t'2011-07-20',\n\t\t\t'2010-11-11',\n\t\t\t'2020-04-14'\n\t\t);\n\n\t\tforeach ($free as $day) {\n\t\t\t$this->assertFalse(Jyxo_Time_Util::isWorkDay(new Jyxo_Time_Time($day)));\n\t\t}\n\n\t\tforeach ($working as $day) {\n\t\t\t$this->assertTrue(Jyxo_Time_Util::isWorkDay(new Jyxo_Time_Time($day)));\n\t\t}\n\t}", "function dtlIsWeekend($dts) {\n // * returns false if invalid input\n if (!dtlIsValidDate($dts) && !dtlIsValidDateTime($dts)) {\n return false;\n }\n $dowName = dtlGetDayName($dts, 'EN');\n return $dowName == 'Sunday' || $dowName == 'Saturday';\n}", "public function checkWeekLimit(array $payments)\n\t{\n\t\t$users = $this->groupPaymentsByUser($payments);\n\n\t foreach ($users as $user_id) {\n\n\t \t$sum = 0;\n\t \t$date1 = null;\n\t \t$week_day = 0;\n\t \t$cash_out_count = 0;\n\n\t\t\t// all user operations\n\t \tforeach ($user_id as $user) {\n\n\t\t \tif ($user->operation == 'cash_out') {\n\n\t\t \t\t// user cash out times\n\t\t \t\t$cash_out_count++;\n\t\t \t\n\t\t\t \tif ($date1 == null) {\n\n\t\t\t \t\t// set first cash out date and week day\n\t\t\t \t\t$date1 = new \\DateTime($user->date);\n\t\t \t\t\t$week_day = date('w', strtotime($user->date));\n\n\t\t \t\t\t// make Sunday from 0 to 7\n\t\t \t\t\tif ($week_day == 0) {\n\n\t\t \t\t\t\t$week_day = 7;\n\n\t\t \t\t\t}\n\n\t\t\t \t\t$user->difference = 0;\n\t\t\t \t\t$sum = $this->convertToEur($user->amount, $user->currency);\n\n\t\t\t \t\tif ($sum > self::CASH_OUT_WEEK_LIMIT) {\n\n\t\t\t\t \t\t$user->week_amount_eur = $sum;\n\t\t\t\t \t\t$sum = self::CASH_OUT_WEEK_LIMIT;\n\t\t\t \t\t\t\n\t\t\t \t\t} else {\n\n\t\t\t \t\t\t$user->week_amount_eur = $sum;\n\n\t\t\t \t\t}\n\n\t\t\t \t} else {\n\t\t\t \t\t// other cash out dates and week days\n\t\t\t \t\t$date2 = new \\DateTime($user->date);\n\t\t \t\t\t$week_day2 = date('w', strtotime($user->date));\n\n\t\t \t\t\t// make Sunday from 0 to 7\n\t\t \t\t\tif ($week_day2 == 0) {\n\n\t\t \t\t\t\t$week_day2 = 7;\n\n\t\t \t\t\t}\n\n\t\t \t\t\t// days between cash outs\n\t\t\t \t\t$interval = $date1->diff($date2);\n\t\t\t\t\t\t$user->difference = $interval->format('%a');\n\n\t\t\t\t\t\t// check if it is same week from Monday to Sunday\n\t\t\t\t\t\tif ($user->difference < 7 && $week_day2 >= $week_day) {\n\n\t\t\t \t\t\t$sum += $this->convertToEur($user->amount, $user->currency);\n\n\t\t\t \t\t\tif ($sum > self::CASH_OUT_WEEK_LIMIT) {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $sum;\n\t\t\t \t\t\t\t$sum = self::CASH_OUT_WEEK_LIMIT;\n\n\t\t\t \t\t\t} else if ($cash_out_count > self::CASH_OUT_COUNT_LIMIT) {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $this->convertToEur($user->amount, $user->currency) + self::CASH_OUT_WEEK_LIMIT;\n\n\t\t\t \t\t\t} else {\n\n\t\t\t \t\t\t\t$user->week_amount_eur = $sum;\n\t\t\t \t\t\t\n\t\t\t \t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$sum = $this->convertToEur($user->amount, $user->currency);\n\t\t\t\t \t\t$user->week_amount_eur = $sum;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$date1 = $date2;\n\t\t\t\t\t\t$week_day = $week_day2;\n\n\t\t\t \t}\n\n\t\t\t } else {\n\n\t\t\t \t$user->week_amount_eur = 0;\n\t\t\t \t$user->difference = 0;\n\n\t\t\t }\n\t \t}\n\t }\n\n\t\treturn $payments;\n\t}", "public function testExtendDueDate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testSaturdaySubstitution(): void\n {\n // 2020-05-09 victoryDay (День перемоги)\n $year = 2020;\n $holiday = 'victoryDay';\n\n $this->assertHolidayWithSubstitution(\n self::REGION,\n $holiday,\n $year,\n new \\DateTime(\"{$year}-05-09\", new \\DateTimeZone(self::TIMEZONE)),\n new \\DateTime(\"{$year}-05-11\", new \\DateTimeZone(self::TIMEZONE))\n );\n\n unset($year, $holiday);\n }", "public function chk_business_day($start_time, $item_id) {\n $start_date=strtotime(date('Y-m-d',$start_time));\n /* Get Weekdate */\n $dayweek=date('w',$start_date);\n /* Get weekends */\n $this->db->select('item_id, c.calendar_id as calendar_id, c.mon_work, c.tue_work, c.wed_work, c.thu_work, c.fri_work, c.sat_work, c.sun_work',FALSE);\n $this->db->from('sb_items i');\n $this->db->join('sb_vendor_items vi','vi.vendor_item_id=i.vendor_item_id');\n $this->db->join(\"vendors v\",\"v.vendor_id=vi.vendor_item_vendor\");\n $this->db->join(\"calendars c\",\"c.calendar_id=v.calendar_id\");\n $this->db->where('i.item_id',$item_id);\n $cal = $this->db->get()->row_array();\n switch ($dayweek) {\n case 0:\n $workday=$cal['sun_work'];\n break;\n case 1:\n $workday=$cal['mon_work'];\n break;\n case 2:\n $workday=$cal['tue_work'];\n break;\n case 3:\n $workday=$cal['wed_work'];\n break;\n case 4:\n $workday=$cal['thu_work'];\n break;\n case 5:\n $workday=$cal['fri_work'];\n break;\n case 6:\n $workday=$cal['sat_work'];\n break;\n }\n if ($workday==1) {\n /* Get Holiday */\n $this->db->select('count(calendar_line_id) cnt');\n $this->db->from('calendar_lines');\n $this->db->where('calendar_id',$cal['calendar_id']);\n $this->db->where('line_date',$start_date);\n $res=$this->db->get()->row_array();\n if ($res['cnt']==0) {\n return 1;\n } else {\n return 0;\n }\n } else {\n return $workday;\n }\n }", "public function isCurrentWeek(): bool;", "public function pay_period_number($date)\n {\n // https://fireprotected.slack.com/archives/engineering/p1481217169000234\n // Every month has 2 pay periods. Going to mark them by pay date: i.e the first and third friday\n\t//june2018 will have 3: 1,15,29\n\n $pay_period_number = 0;\n\n\t//year can not be hard coded, why is this here?\n if ($date->year < 2018) return 1;\n\n // Get the Pay Dates for current month\n\n $paydates = $this->pay_dates_for_month($date);\n\n\n // See which one is after $date\n\n if ($paydates->first->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n\n\t//we are not in first period, did we pass up 2nd and there is a 3rd?\n if ($paydates->second->gte($date)) {\n\n\t\t\tlog_message('debug', '---------------------> paydates ' . print_r($paydates, true) );\n\n//what is this code doing?\n//the paydate is already a friday based on the code defining first/second/(third)\n/*\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n\t\t\tlog_message('debug', '---------------------> paydates check' . print_r($check, true) );\n\t\t\tlog_message('debug', '---------------------> paydates next friday' . print_r($friday, true) );\n if ($friday->isSameDay($paydates->second)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n*/\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number;\n }\n\n/*\n\t//rare, we have a 3rd\n if ( $paydates->third && $paydates->third->gte($date)) {\n\n // If it's in the same week, then it's not the one\n $check = $date->copy()->startOfWeek();\n Carbon::setTestNow($check);\n $friday = new Carbon('next friday');\n Carbon::setTestNow();\n\n if (!$friday->isSameDay($paydates->first)) {\n\n //use this one\n $pay_period_number = $paydates->first->month * 2;\n return $pay_period_number - 1;\n\n }\n }\n*/\n\n // if after them both, then use the next month's first pay date\n $paydates->second->addMonth();\n\n $nextMonthPaydates = $this->pay_dates_for_month($paydates->second);\n $pay_period_number = $nextMonthPaydates->first->month * 2;\n\t\t\t\t\tlog_message('debug', '---------------------> pay_period 3 or next month ' . print_r($pay_period_number, true) );\n return $pay_period_number - 1;\n }", "public function isCurrentWeek(): bool {\n $today = date('Y-m-W');\n $thisDay = $this->getDateTime()->format('Y-m-W');\n return $today === $thisDay;\n }", "public function isDue($date = 'now');", "public function isClosingDay($value)\n {\n $test = $this->em\n ->getRepository('OCCoreBundle:Closingdays')\n ->testVisitDay($value) \n ;\n\n $day = date_format($value, 'N');\n \n if (!empty($test) OR ($day==2) OR ($day==7)){\n return true;\n } else {\n return false;\n }\n \n }", "public function calculateEventPayDay($date)\n {\n $date = \\DateTime::createFromFormat('Y-m-d H:i:s', $date);\n $day = $date->format('d');\n $period = (int)($day / 7) + 1;\n $baseDate = ($period * 7);\n $payday = $baseDate + 4;\n $date->setDate($date->format('Y'), $date->format('m'), $payday);\n if ($date->format('N') == 6 || $date->format('N') == 7) {\n while ($date->format('N') != 4) {\n $date->setDate($date->format('Y'), $date->format('m'), ($date->format('d') + 1));\n }\n }\n\n return $date;\n\n }", "function find_payable_opt()\n {\n global $mySession;\n $db = new Db();\n\n $bookDate = date('Y-m-d', strtotime($mySession->arrivalDate));\n\n $chkQuery = $db->runQuery(\"SELECT case when date_Add(curdate(), interval 8 WEEK) < '\" . $bookDate . \"'\n\t\t\t\t\t\t\t then '1'\n\t\t\t\t\t\t\t else '2' end as cond\");\n\n //1 is returned when customer is booking 8 weeks earlier than the booking date \n //2 is returned when the customer is not booking 8 weeks earlier\n return $chkQuery[0]['cond'];\n }", "private function checkEventDateFuture(){\n $startTime = Carbon::createFromFormat('m/d/Y h:i a', $this->start_time);\n $now = Carbon::now();\n\n return $now->diffInHours($startTime, false) >= 2;\n }", "public function testDayOfWeekNextYear()\n {\n // Test the day of the week for the next year - July 2nd 1991.\n $testDate2 = '02.07.1991';\n $retValueDate2 = $this->customCalendar->getDayOfWeek($testDate2);\n $this->assertNotNull($retValueDate2, \"The returned value from getDayOfWeek for \" . $testDate2);\n\n $dayOfWeekDate2 = 'Thursday';\n $this->assertEquals($dayOfWeekDate2, $retValueDate2);\n }", "public function onSunday(bool $set = null);", "function getBatchPaymentDate(){\n $paymentDate = date('Y-m-d');\n $currDateTs=strtotime($paymentDate);\n $offsetDays=0;\n if($this->cuttoffMissed===true){\n $offsetDays++;\n }\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n while ($this->isHoliday($paymentDate)==true) {\n $offsetDays++;\n $paymentDate = date('Y-m-d',strtotime(\"+\".$offsetDays.\" day\",$currDateTs));\n }\n \n\n return $paymentDate;\n }", "function check_restaurant_closed( $restaurant_id, $package = array() ){\n\n\t$restaurant_closed \t= false;\n\t$current_time \t\t\t= ( isset( $package[\"preorder\"] ) ) ? strtotime( $package[\"preorder\"] ) : current_time( 'timestamp' );\n\t$current_week \t= date( 'w', $current_time );\n\t$restaurant_schedule = ( get_field( \"dms_restaurant_schedule\", \"user_\" . $restaurant_id ) ) ? get_field( \"dms_restaurant_schedule\", \"user_\" . $restaurant_id ) : array();\n\n\t$week_found = false;\n\tif( !empty( $restaurant_schedule ) ){\n\t\tforeach ( $restaurant_schedule as $key => $restaurant_hour ) {\n\n\t\t\tif( $week_found ) continue;\n\n\t\t\t$day = $restaurant_hour[\"dms_restaurant_hours_day\"];\n\n\t\t\tif( $day == $current_week ){\n\t\t\t\t$morning_start = $restaurant_hour[\"dms_restaurant_hours_morning_start\"];\n\t\t\t\t$morning_end = $restaurant_hour[\"dms_restaurant_hours_morning_end\"];\n\t\t\t\t$afternoon_start = $restaurant_hour[\"dms_restaurant_hours_afternoon_start\"];\n\t\t\t\t$afternoon_end = $restaurant_hour[\"dms_restaurant_hours_afternoon_end\"];\n\n\t\t\t\t$time_morning_start = ( $morning_start ) ? strtotime( $morning_start ) : false;\n\t\t\t\t$time_morning_end = ( $morning_end ) ? strtotime( $morning_end ) : false;\n\t\t\t\t$time_afternoon_start = ( $afternoon_start ) ? strtotime( $afternoon_start ) : false;\n\t\t\t\t$time_afternoon_end = ( $afternoon_end ) ? strtotime( $afternoon_end ) : false;\n\n\t\t\t\tif( $current_time < $time_morning_start ){\n\t\t\t\t\t$restaurant_closed[\"type\"] = \"closed_until\";\n\t\t\t\t\t$restaurant_closed[\"label\"] = sprintf( __( \"Restaurant is closed until %s.\", THEME_NAME ), $morning_start );\n\t\t\t\t}\n\n\t\t\t\tif( $time_morning_end && $time_afternoon_start ){\n\n\t\t\t\t\tif( $current_time >= $time_morning_end && $current_time < $time_afternoon_start ){\n\t\t\t\t\t\t$restaurant_closed[\"type\"] = \"closed_until\";\n\t\t\t\t\t\t$restaurant_closed[\"label\"] = sprintf( __( \"Restaurant is closed until %s.\", THEME_NAME ), $afternoon_start );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( $current_time >= $time_afternoon_end ){\n\t\t\t\t\t$restaurant_closed = __( \"Restaurant is already closed.\", THEME_NAME );\n\t\t\t\t}\n\n\t\t\t\t$week_found = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif( !$week_found ){\n\t\t$restaurant_closed[\"type\"] = \"closed\";\n\t\t$restaurant_closed[\"label\"] = __( 'Restaurant is closed today.', THEME_NAME );\n\t}\n\n\tif( $restaurant_closed ){\n\t\treturn $restaurant_closed;\n\t}\n\n\t$delivery_id \t\t= get_field( \"dms_restaurant_delivery\", \"user_\" . $restaurant_id );\n\t$restaurant_hours = ( get_field( \"dms_restaurant_hours\", $delivery_id ) ) ? get_field( \"dms_restaurant_hours\", $delivery_id ) : array();\n\t$week_found \t\t= false;\n\n\tif( !empty( $restaurant_hours ) ){\n\t\tforeach ( $restaurant_hours as $key => $restaurant_hour ) {\n\n\t\t\tif( $week_found ) continue;\n\n\t\t\t$day = $restaurant_hour[\"dms_restaurant_hours_day\"];\n\n\t\t\tif( $day == $current_week ){\n\t\t\t\t$morning_start = $restaurant_hour[\"dms_restaurant_hours_morning_start\"];\n\t\t\t\t$morning_end = $restaurant_hour[\"dms_restaurant_hours_morning_end\"];\n\t\t\t\t$afternoon_start = $restaurant_hour[\"dms_restaurant_hours_afternoon_start\"];\n\t\t\t\t$afternoon_end = $restaurant_hour[\"dms_restaurant_hours_afternoon_end\"];\n\n\t\t\t\t$time_morning_start = ( $morning_start ) ? strtotime( $morning_start ) : false;\n\t\t\t\t$time_morning_end = ( $morning_end ) ? strtotime( $morning_end ) : false;\n\t\t\t\t$time_afternoon_start = ( $afternoon_start ) ? strtotime( $afternoon_start ) : false;\n\t\t\t\t$time_afternoon_end = ( $afternoon_end ) ? strtotime( $afternoon_end ) : false;\n\n\t\t\t\tif( $current_time < $time_morning_start ){\n\t\t\t\t\t$restaurant_closed[\"type\"] = \"nodel_until\";\n\t\t\t\t\t$restaurant_closed[\"label\"] = sprintf( __( \"Until %s we don't have a delivery service. But you can pickup your order at the restaurant.\", THEME_NAME ), $morning_start );\n\t\t\t\t}\n\n\t\t\t\tif( $time_morning_end && $time_afternoon_start ){\n\n\t\t\t\t\tif( $current_time >= $time_morning_end && $current_time < $time_afternoon_start ){\n\t\t\t\t\t\t$restaurant_closed[\"type\"] = \"nodel_until\";\n\t\t\t\t\t\t$restaurant_closed[\"label\"] = sprintf( __( \"Until %s we don't have a delivery service. But you can pickup your order at the restaurant.\", THEME_NAME ), $afternoon_start );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( $current_time >= $time_afternoon_end ){\n\t\t\t\t\t$restaurant_closed[\"type\"] = \"nodel\";\n\t\t\t\t\t$restaurant_closed[\"label\"] = __( \"We already don't have a delivery service. But you can pickup your order at the restaurant.\", THEME_NAME );\n\t\t\t\t}\n\n\t\t\t\t$week_found = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif( !$week_found ){\n\t\t$restaurant_closed[\"type\"] = \"nodel\";\n\t\t$restaurant_closed[\"label\"] = __( \"We don't have a delivery service today. But you can pickup your order at the restaurant.\", THEME_NAME );\n\t}\n\n\treturn $restaurant_closed;\n}", "public function can_submit_today()\n {\n // For testing, you can uncomment below to set what day today is globally\n //Carbon::setTestNow(Carbon::create(2018, 1, 15, 10, 18, 00));\n\n $today = Carbon::now();\n\n $submission_date = $this->submission_date();\n\n if ($today->isSameDay($submission_date)) {\n // Check if it's not past the deadline\n //return $today->lte($submission_date);\n }\n\n // Return quick if the actual submission date is not on a Monday\n// if (!$submission_date->isMonday()) return false;\n\n // If today is the Friday before a Monday submission date, allow (from 6pm)\n Carbon::setTestNow($submission_date);\n $friday_before_submission = new Carbon('last friday');\n $friday_before_submission->hour = 18;\n $friday_before_submission->minute = 0;\n $friday_before_submission->second = 0;\n Carbon::setTestNow();\n\n\n // Check if now is between Friday 6pm and Monday 2pm\n return $today->between($friday_before_submission, $submission_date);\n }", "public function testSalaryPaymentDate(): void\n {\n $dateTime = new \\DateTime('28 February 2019');\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $this->dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($dateTime);\n\n $dayCalculatorService = new DateCalculatorService($this->dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('28-02-2019', $result);\n }", "function send_subscription_reminder($last_notified, $next_billing_cycle)\n{\n $notify_days = json_decode(get_option('subscription_product_notify_days'));\n\n foreach ($notify_days as $day) {\n echo \"\\n\";\n $_last_notified = is_null($last_notified) ? 0 : $last_notified;\n $today = date('Y-m-d');\n $comparedate = date('Y-m-d', strtotime($today . '+' . $day . ' days'));\n $_next_billing_cycle = date('Y-m-d', $next_billing_cycle);\n\n if (($_last_notified != $today) && $_next_billing_cycle == $comparedate) {\n return true;\n }\n }\n return false;\n}", "private static function dateIsTargetDay(\\DateTime $date)\n {\n // $date is a saturday or sunday\n if ($date->format('N') === '6' || $date->format('N') === '7')\n return false;\n\n $day = $date->format('m-d');\n if ($day === '01-01' // new year's day\n || $day === '05-01' // labour day\n || $day === '12-25' // first christmas day\n || $day === '12-26') // second christmas day\n return false;\n\n $year = $date->format('Y');\n $daysToEasterSunday = easter_days((int) $year);\n $goodFriday = \\DateTime::createFromFormat('Y-m-d', $year . '-03-21')\n ->modify('+' . ($daysToEasterSunday - 2) . ' days')\n ->format('m-d');\n $easterMonday = \\DateTime::createFromFormat('Y-m-d', $year . '-03-21')\n ->modify('+' . ($daysToEasterSunday + 1) . ' days')\n ->format('m-d');\n\n if ($day === $goodFriday || $day === $easterMonday)\n return false;\n\n return true;\n }", "public function testSalaryPaymentDateIsPassed(): void\n {\n $dateTime = new \\DateTime('31 March 2019');\n $today = new \\DateTime('30 March 2019');\n $dateTimeMock = Mockery::mock(DateTime::class);\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('last day of this month')\n ->andReturn($dateTime);\n\n $dateTimeMock->shouldReceive('modify')\n ->once()\n ->with('today')\n ->andReturn($today);\n\n $dayCalculatorService = new DateCalculatorService($dateTimeMock);\n $result = $dayCalculatorService->getSalaryPaymentDate();\n $this->assertEquals('-', $result);\n }", "function numberofdayswithoutweekends($start,$end ){\r\nrequire \"global_variable.php\";\r\n\t$startdate = new Datetime (date($start));\r\n\t$enddate = new Datetime (date($end));\r\n\t$enddate->modify('+1 day');\r\n\r\n\t$interval = $enddate->diff($startdate);\r\n\r\n\t// total days\r\n\t$days = $interval->days;\r\n\r\n\t// create an iterateable period of date (P1D equates to 1 day)\r\n\t$period = new DatePeriod($startdate, new DateInterval('P1D'), $enddate);\r\n\t//get holidays\r\n\t$conn = connecttodatabase();\r\n\t $sql = \"SELECT Date FROM $holidays_tbl ORDER BY `Date` DESC\";\r\n\t$request = mysql_query($sql,$conn);\r\n\t$holidays_date = array();\r\n\twhile($holiday = mysql_fetch_array($request)){\r\n\t\t$holidays_date[]=$holiday[0];\r\n\t}\r\n\t// best stored as array, so you can add more than one\r\n\t\r\n\tforeach($period as $dt) {\r\n\t\t$curr = $dt->format('D');\r\n\r\n\t//\t for the updated question\r\n\t\tif (in_array($dt->format('Y-m-d'), $holidays_date)) {\r\n\t\t $days--;\r\n\t\t}\r\n\r\n\t\t// substract if Saturday or Sunday\r\n\t\tif ($curr == 'Sat' || $curr == 'Sun') {\r\n\t\t\t$days--;\r\n\t\t}\r\n\t}return $days;\r\n}", "public function hasGracePeriodPast(): bool;", "public function getCurrentEndDate() {\n return date(\"Y-m-d\", strtotime('friday this week'));\n }", "public static function bkap_check_timeslot_for_weekday( $product_id, $start_date ) {\n \n $booking_settings = get_post_meta( $product_id, 'woocommerce_booking_settings', true );\n \n $start_weekday \t\t = \tdate( 'w', strtotime( $start_date ) );\n $start_booking_weekday = \t'booking_weekday_' . $start_weekday;\n\n if ( is_array( $booking_settings['booking_time_settings'] ) && array_key_exists( $start_booking_weekday, $booking_settings['booking_time_settings'] ) ) {\n return true;\n }else if ( is_array( $booking_settings['booking_time_settings'] ) && \n array_key_exists( date( 'j-n-Y', strtotime( $start_date ) ), $booking_settings['booking_time_settings'] ) ) {\n return true;\n }\n \n return false;\n \n }", "public function test_is_due_returns_false_when_too_soon() {\n $container = new Pimple(array(\n 'now' => mktime(0, 0, 0, 7, 23, 2014),\n 'window_after_hour' => 1,\n 'window_before_hour' => 7,\n ));\n $this->_cut = new mod_vocabcards_cron_manager($container);\n $this->assertFalse($this->_cut->is_due());\n }", "public function checkWeekIsEnd($iId): bool;", "function checkExpiryDay($user_id){\n \n \t$res = $this->db->query(\"select timezone,display_day from itms_users where user_id = '$user_id'\");\n\t\n\t\tforeach ($res->result() as $row){\n\t\t $display_day = $row->display_day;\n\t $timezone= $row->timezone;\n\t\t\t\t\n\t\t}\n \n $day = strtolower(date('l'));\n\t\t$days = array();\n\t $days = explode(\",\",$display_day);\n\n\t \t\n\t\tif((in_array($day, $days) || in_array(\"all\", $days))){\n\t\t\treturn true; \n\t\t} else {\n\t\t\treturn false;\n\t\t}\n }", "public function testSendReminder()\n {\n Mail::fake();\n\n $race = Race::nextOrLast();\n\n $original = $race->weekend_start;\n\n $race->weekend_start = new Carbon('+1 day 5 minutes');\n\n $race->save();\n\n PicksReminder::dispatch();\n\n Mail::assertSent(PicksReminded::class);\n\n $race->weekend_start = $original;\n\n $race->save();\n }", "public static function isHoliday()\r\n {\r\n $now = Carbon::now();\r\n $isWeekend = $now->isWeekend();\r\n $date = $now->format('dm');\r\n $dateWithYear = $now->format('dmy');\r\n $lunarDate = Lunar::Gregorian2Lunar($now->format('Y-m-d'));\r\n $lunarDate = implode('', array_reverse(explode('-', $lunarDate['en'] ?? '')));\r\n\r\n return $isWeekend || in_array($date, self::GREGORIAN_HOLIDAYS)\r\n || in_array($lunarDate, self::LUNAR_HOLIDAYS)\r\n || in_array($dateWithYear, explode(',', env('HOLIDAYS')));\r\n }", "public function testAddingStartingPriceForUser()\n {\n $targetPrice = 101;\n $now = Carbon::now();\n\n Week::storePrice($this->user->phone_number,$targetPrice);\n\n /** @var Week $week */\n $week = Week::where('year', '=', $now->year)\n ->where('week', '=', $now->week)\n ->where('user_id', '=', $this->user->id)\n ->first();\n\n $this->assertEquals(\n $week->price_start,\n $targetPrice,\n 'Could not assert price_start was set on the correct week'\n );\n $this->assertNull($week->price_monday_morning);\n }", "public function testTruthAndReconciliationDayBefore2021(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "static function isWithinRangeOfWeekday($date, $weekday) {\n\n $nextWeekday = dateOfNextWeekday($date, $weekday);\n $daysEllapsed = (strtotime($nextWeekday) - time()) / (60 * 60 * 24);\n return ($daysEllapsed <= self::CHARGE_DAYS_BEFORE);\n\n }", "public function get_suspend_until_date($numWeeksToSuspend){\n date_default_timezone_set('America/Los_Angeles');\n $date = strtotime(date('Y-m-d G:i:s'));\n $thursday = strtotime(date('Y-m-d', strtotime('next Thursday')));\n if($thursday - $date >= 7){\n $numWeeksToSuspend += 1; \n }\n\n return date('Y-m-d', strtotime('+'.$numWeeksToSuspend.' Sunday'));\n \n }", "function Date_Holidays()\n {\n }", "function checkRepeatWeek($this_currentdate, $week_start, $week_end)\n\t{\n\t\t// builds and returns array\n\t\tif (!isset($this->eventDaysWeek))\n\t\t{\n\t\t\t$this->eventDaysWeek = array();\n\n\t\t\tif (is_null($week_start) || is_null($week_end))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlist($y, $m, $d) = explode(\":\", JevDate::strftime(\"%Y:%m:%d\", $week_end));\n\t\t\t$weekEndSecond = JevDate::mktime(23, 59, 59, $m, $d, $y);\n\n\t\t\t$this->eventDaysWeek = $this->getRepeatArray($week_start, $week_end, $weekEndSecond);\n\t\t}\n\n\t\treturn (array_key_exists($this_currentdate, $this->eventDaysWeek));\n\t}", "public function testConstitutionMemorialDayOnAfter1948()\n {\n $year = 1967;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-3\", new DateTimeZone(self::TIMEZONE)));\n $year = 2009;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-6\", new DateTimeZone(self::TIMEZONE))); // Substituted day\n }", "public function onTrial()\n {\n if (! is_null($this->trial_ends_at)) {\n return Carbon::today()->lt($this->trial_ends_at);\n } else {\n return false;\n }\n }", "public function pastDue()\n {\n return $this->razorpay_status === self::STATUS_PAST_DUE;\n }", "function test($entity_id,$date){\nglobal $adb,$log,$current_user;\n$paymentid=$entity_id;//$_REQUEST['paymentid']\n$datefrom=date('Y-m-d',strtotime($date));//$_REQUEST['start_date']\n$dat_fmt = $current_user->date_format;\n$dateFormat=($dat_fmt == 'dd-mm-yyyy') ? 'd-m-Y' : (($dat_fmt == 'mm-dd-yyyy') ? 'm-d-Y' : (($dat_fmt == 'yyyy-mm-dd') ? 'Y-m-d' : ''));\n\n$res = $adb->pquery(\"Select * from vtiger_payamentstype WHERE payamentstypeid=?\", array($paymentid));\n //$datefrom = $adb->query_result($res, 0, 'docdate_from');\n $diffdays = $adb->query_result($res, 0, 'differdays');\n $endofmonth = $adb->query_result($res, 0, 'endofmonth');\n $extradays = $adb->query_result($res, 0, 'extradays');\n\n $calc_date = $datefrom;\n if ($diffdays <> 0) {\n if ($diffdays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $diffdays day$s\"));\n }\n if ($endofmonth > 0) {\n $calc_date = date('Y-m-d', strtotime($calc_date));\n }\n if ($extradays <> 0) {\n if ($extradays == 1)\n $s = \"\";\n else\n $s = \"s\";\n $calc_date = date(\"Y-m-d\", strtotime($calc_date . \" + $extradays day$s\"));\n }\n $calc_date=date($dateFormat,strtotime($calc_date));\n return $calc_date;\n}", "public function evaluateWeekly($fulfillment)\n {\n $habitList = $fulfillment->lazyHabit->habitList;\n $daysBetween = (strtotime($fulfillment->day) - strtotime($habitList->since)) / 86400;\n $firstDayOffset = $daysBetween - ($daysBetween % 7);\n $firstDay = date('Y-m-d', strtotime($habitList->since . \" +$firstDayOffset days\"));\n $lastDay = date('Y-m-d', strtotime(\"$firstDay +6 days\"));\n //Yii::trace($firstDay . '-' . $lastDay);\n return $this->compare(\n Fulfillment::find()\n ->where(['habit_id' => $fulfillment->habit_id])\n ->andWhere(['between', 'day', $firstDay, $lastDay])\n ->sum('value'),\n floatval($this->limit)\n ) ? self::SATISFIED : ($lastDay > date('Y-m-d') ? self::EMPTY : self::DISSATISFIED);\n\n\n }", "public function test_should_calculate_sector_based_on_weekly_selector()\n {\n $request = $this->prepareSectorRequestData('weekly');\n\n $response = $this->post('calculateSectors', $request)->getOriginalContent();\n\n foreach ($response as $sector) {\n //This assertion check the every sector last date day must be the delivery day\n //If its match then assert true else false\n if (carbon::parse($sector['end_date'])->format('l') === $request['delivery_day']) {\n $this->assertTrue(true);\n } else {\n $this->assertFalse(false);\n }\n }\n //This assertion check the last sector end date must be the delivery end date\n $this->assertEquals(last($response)['end_date'], $request['overall_end_date']);\n }", "public function testGetEndDatetime()\n {\n $nextWeek = DateTime::today()->addDays(7);\n $period = new DatePeriod(DateTime::today(), DateInterval::day(), $nextWeek);\n $this->assertInstanceOf(DateTime::class, $period->getEndDatetime());\n $this->assertSame($nextWeek->getTimestamp(), $period->getEndDatetime()->getTimestamp());\n }", "public function test_is_due_returns_false_when_within_window_and_rlastcron_today() {\n global $DB;\n $DB = m::mock('moodle_database')->shouldIgnoreMissing();\n $DB->shouldReceive('get_field')\n ->once()\n ->with('config_plugins', 'value', array(\n 'plugin' => 'mod_vocabcards',\n 'name' => 'rlastcron',\n ))\n ->andReturn(date('d/m/Y', mktime(1, 5, 0, 7, 23, 2014))); // before 9 am\n $container = new Pimple(array(\n 'now' => mktime(5, 0, 0, 7, 23, 2014),\n 'window_after_hour' => 1,\n 'window_before_hour' => 7,\n ));\n $this->_cut = new mod_vocabcards_cron_manager($container);\n $this->assertFalse($this->_cut->is_due());\n }", "public function checkNotifyForEndOfMonth()\n {\n $hFunction = new \\Hfunction();\n $currentDay = $hFunction->currentDay();\n $totalDayInMonth = $hFunction->totalDayInMonth($hFunction->currentMonth(), $hFunction->currentYear());\n return (($totalDayInMonth - $currentDay) <= 3) ? true : false;\n }", "function check_paid_record($insdate=null,$paydate=null,$tmz_id=null,$paydays=null) {\n\t $status = 0;\t\n\t $today = date('Y-m-d');\t\n $tmz = isset($tmz_id) ? $tmz_id : $this->tmz_id;\t \n\t //echo $insdate,'>>',$paydate,'>>',$tmz_id,'>>';\n\t $tmz_today = $this->make_gmt_date(null,$tmz); \n\t $paydays = $paydays?intval($paydays):0;\n\t\n\t if ($paydate)\n $expres = $this->date_diff($tmz_today,$paydate) + $this->freedays + $paydays;\n\t elseif ($insdate) \t \n\t $expres = $this->date_diff($tmz_today,$insdate) + $this->freedays + $paydays;\n\t else\n\t return ;\t \n\t //echo '>',$expres,'>';\n\t\t\t \n\t if ($expres>0) {\n\t //not expired yes\n\t\t $status = 0;\n\t }\n\t else {\n\t if (($this->gracedays) && ($this->gracedays>abs($expres))) {\n\t\t //into grace period..days left\n\t\t $status = ($this->gracedays - abs($expres)) * 1;//plus 1... when 1-1=0\n\t\t\t\t //echo $status,'gin>';\n\t\t\t\t $this->grace_records += 1;\t\n\t\t }\n\t /*elseif (($gracedays) && ($gracedays==abs($expres))) {\n\t\t\t //into grace period..days left,,zero problem\n\t\t\t $status = 1;\n\t\t\t\t //echo $status,'giso>';\n\t\t\t\t $this->grace_records += 1;\t\t\t\t \t\t\t\t \t\t\t\t\t \n\t\t }*/\t\t \n\t\t else {\n\t\t\t //out of grace period or no grace period\n \t\t $status = -1;\n\t\t\t\t //echo $status,'gout>';\n\t\t\t\t $this->expired_records += 1;\t\t\t\t\t \n\t\t } \n }\n\t //echo '+',$status,'+';\n\t return ($status);\t\n\t}", "public function Set_Pay_Date_Calc() { \n\t\t$this->pdc = new Pay_Date_Calc_3($this->holidays); \n\t\t$this->next_bus_day \t= date('m/d/Y', strtotime($this->pdc->Get_Business_Days_Forward(date('Y-m-d'), 1)));\n\t}", "function trialProductsCalcDate($relid) {\n\n // get free period value\n $days = trialProductsGetFreePeriod($relid);\n\n $date = new \\DateTime();\n\n // calc next duedate\n $date->modify('+' . $days . ' days');\n\n $date = $date->format('Y-m-d');\n\n return $date;\n\n}", "public function test_is_due_returns_true_when_within_window_and_lastcron_empty() {\n $container = new Pimple(array(\n 'now' => mktime(3, 0, 0, 7, 23, 2014),\n 'window_after_hour' => 1,\n 'window_before_hour' => 7,\n ));\n $this->_cut = new mod_vocabcards_cron_manager($container);\n $this->assertTrue($this->_cut->is_due());\n }", "public function testWorkingDays()\n {\n $this->assertEquals(23, $this->testTraitClass->getWorkingDays(5, 1, 2019));\n $this->assertEquals(20, $this->testTraitClass->getWorkingDays(5, 2, 2019));\n $this->assertEquals(23, $this->testTraitClass->getWorkingDays(5, 7, 2019));\n $this->assertEquals(19, $this->testTraitClass->getWorkingDays(4, 7, 2019));\n $this->assertEquals(5, $this->testTraitClass->getWorkingDays(1, 7, 2019));\n $this->assertEquals(10, $this->testTraitClass->getWorkingDays(2, 7, 2019));\n $this->assertEquals(15, $this->testTraitClass->getWorkingDays(3, 7, 2019));\n $this->assertEquals(19, $this->testTraitClass->getWorkingDays(4, 7, 2019));\n }" ]
[ "0.7694026", "0.72604024", "0.6877772", "0.6814921", "0.6787215", "0.67868114", "0.67749035", "0.6750778", "0.65563595", "0.65120786", "0.64559674", "0.6449108", "0.63861835", "0.63854855", "0.63477325", "0.62746984", "0.624864", "0.62062687", "0.61847675", "0.6183857", "0.6175065", "0.6155599", "0.6092425", "0.60663915", "0.60500395", "0.6035124", "0.60333353", "0.60299486", "0.59836197", "0.5957002", "0.5942974", "0.59407294", "0.5932862", "0.59282947", "0.5922617", "0.58733153", "0.5847418", "0.58321416", "0.5821204", "0.58204514", "0.58151966", "0.5806347", "0.5801733", "0.57871425", "0.5760551", "0.5757554", "0.5748282", "0.57368726", "0.5724766", "0.57214856", "0.5706171", "0.56967384", "0.5673552", "0.56700104", "0.5656905", "0.565371", "0.5649483", "0.56465805", "0.5641503", "0.56134903", "0.5612844", "0.56123334", "0.5603748", "0.56029207", "0.5600598", "0.55854255", "0.5575043", "0.5552934", "0.55527323", "0.554043", "0.55381805", "0.5526916", "0.5521516", "0.55179703", "0.55023915", "0.54998875", "0.5495091", "0.54808086", "0.5473478", "0.54685545", "0.5461268", "0.5455576", "0.54542005", "0.54479986", "0.5445551", "0.5440555", "0.5439329", "0.543548", "0.5429039", "0.5427486", "0.54272324", "0.54266083", "0.5422163", "0.54166824", "0.5412809", "0.54072887", "0.54066646", "0.5405739", "0.5399473", "0.53872335" ]
0.78335625
0
Test months until new year
Тестирование месяцев до нового года
public function testMonthsUntilNewYear(): void { $midNight = new \DateTime('01-02-2019 00:00:00'); $this->dateTimeMock->shouldReceive('modify') ->once() ->with('midnight') ->andReturn($midNight); $dayCalculatorService = new DateCalculatorService($this->dateTimeMock); $result = $dayCalculatorService->getMonthsUntilNewYear(); $this->assertCount(10, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function monthsInYear() {\n\t\treturn 12;\n\t}", "static function nextMonth($month,$year){\r\n \r\n $month++;\r\n if($month > 12){\r\n \r\n $month = $month - 12;\r\n $year++;\r\n \r\n }//if\r\n \r\n return array($month,$year);\r\n \r\n }", "public abstract function get_months();", "public function test_adding_13_days_to_31_jan_returns_13_feb(): void\n {\n $this->assertEquals(\n new DateTime('2019-02-13'),\n Date::addPeriod(new DateTime('2019-01-31'), Date::PERIOD_DAY, 13)\n );\n }", "public function is_month()\n {\n }", "public function getLastTwelveMonths()\n\t{\n\t\t// Get current date\n\t\t$currentDate = date('Y-m-d');\n\n\t\t// Get one year back date\n\t\t$lastYearDate = date('Y-m-d', strtotime(date(\"Y-m-d\", time()) . \" - 365 day\"));\n\n\t\t// Convert dates to UNIX timestamp\n\t\t$lastYearTime = strtotime($lastYearDate);\n\t\t$CurrentDateTime = strtotime($currentDate);\n\t\t$tmp = date('mY', $CurrentDateTime);\n\t\t$year = date('Y', $lastYearTime);\n\n\t\t// $months[] = array(\"month\" => date('F', $lastYearTime), \"year\" => date('Y', $lastYearTime));\n\n\t\twhile ($lastYearTime < $CurrentDateTime)\n\t\t{\n\t\t\t// Array to store months with 30 and 31 days\n\t\t\t$month31 = array(1,3,5,7,8,10,12);\n\t\t\t$month30 = array(4,6,9,11);\n\n\t\t\t$month = date('m', $lastYearTime);\n\n\t\t\tif (array_search($month, $month31))\n\t\t\t{\n\t\t\t\t$lastYearTime = strtotime(date('Y-m-d', $lastYearTime) . ' +31 days');\n\t\t\t}\n\t\t\telseif (array_search($month, $month30))\n\t\t\t{\n\t\t\t\t$lastYearTime = strtotime(date('Y-m-d', $lastYearTime) . ' +30 days');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ((0 == $year % 4) && (0 != $year % 100)) || (0 == $year % 400))\n\t\t\t\t{\n\t\t\t\t\t$lastYearTime = strtotime(date('Y-m-d', $lastYearTime) . ' +29 days');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$lastYearTime = strtotime(date('Y-m-d', $lastYearTime) . ' +28 days');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (date('mY', $lastYearTime) != $tmp && ($lastYearTime < $CurrentDateTime))\n\t\t\t{\n\t\t\t\t$months[] = array(\n\t\t\t\t\t\"month\" => date('F', $lastYearTime),\n\t\t\t\t\t\"year\" => date('Y', $lastYearTime)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$months[] = array(\"month\" => date('F', $CurrentDateTime),\"year\" => date('Y', $CurrentDateTime));\n\n\t\treturn $months;\n\t}", "function isSameMonth(){\r\n \r\n $ret_bool = false;\r\n $start_map = $this->start();\r\n $stop_map = $this->stop();\r\n \r\n if($this->isSameYear()){\r\n $ret_bool = ($start_map['mon'] == $stop_map['mon']);\r\n }//if\r\n \r\n if(!$ret_bool){\r\n if(($start_map['mday'] === 1) && $this->isMidnight($stop_map)){\r\n \r\n $start_month = $start_map['mon'];\r\n $start_year = $start_map['year'];\r\n \r\n list($start_month,$start_year) = parse_date_get::nextMonth($start_map['mon'],$start_map['year']); \r\n $ret_bool = ($start_month == $stop_map['mon']) && ($start_year == $stop_map['year']);\r\n \r\n }//if\r\n }//if\r\n \r\n return $ret_bool;\r\n \r\n }", "function adjustDate($month, $year)\n {\n $a = array(); \n $a[0] = $month;\n $a[1] = $year;\n \n while ($a[0] > 12)\n {\n $a[0] -= 12;\n $a[1]++;\n }\n \n while ($a[0] <= 0)\n {\n $a[0] += 12;\n $a[1]--;\n }\n \n return $a;\n }", "public function testNextMonth()\n\t{\n\t\t$dates = array(\n\t\t\t'2010-01-01' => '2010-02-01',\n\t\t\t'2010-01-31' => '2010-02-28',\n\t\t\t'2012-01-31' => '2012-02-29',\n\t\t\t'2010-12-31' => '2011-01-31',\n\t\t\t'2010-08-31' => '2010-09-30'\n\t\t);\n\n\t\tforeach ($dates as $current => $expected) {\n\t\t\t$time = new Jyxo_Time_Time($current);\n\t\t\t$next = Jyxo_Time_Util::nextMonth($time);\n\n\t\t\t$this->assertEquals($expected . ' 00:00:00', $next->format('Y-m-d H:i:s'));\n\t\t}\n\n\t}", "public function isCurrentMonth(): bool;", "function adjustDate($month, $year)\n {\n $a = array();\n $a[0] = $month;\n $a[1] = $year;\n\n while ($a[0] > 12)\n {\n $a[0] -= 12;\n $a[1]++;\n }\n\n while ($a[0] <= 0)\n {\n $a[0] += 12;\n $a[1]--;\n }\n\n return $a;\n }", "public function nextMonth() {\r\n\t\tif($this->pointer < 12) $this->pointer++;\r\n\t}", "function isAvailableMonth($m,$y) {\n\t$available = FALSE;\n\t$month = date(\"n\",time());\n\t$year = date(\"Y\",time());\n\tfor ($i=-1;$i<=4;$i++) {\n\t\t$aMonth=$month+$i;\n\t\t$aYear=$year;\n\t\tif ($aMonth > 12) { $aMonth = $aMonth - 12 ; $aYear = $year + 1;}\n\t\tif ($aMonth < 1) { $aMonth = $aMonth + 12 ; $aYear = $year - 1;}\n\t\tif ( ( $m == $aMonth ) && ( $y == $aYear ) ) { $available = TRUE; }\n\t}\n\treturn $available;\n}", "static function months_this_season() {\n\t\treturn D_month % 3 + 1;\n\t}", "function is_valid_date($month, $day, $year, $is_later_date)\r\n{\r\n // depending on the year, calculate the number of days in the month\r\n if ($year % 4 == 0) // LEAP YEAR \r\n $days_in_month = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n else\r\n $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n\r\n\r\n // first, check the incoming month and year are valid. \r\n if (!$month || !$day || !$year) return false;\r\n if (1 > $month || $month > 12) return false;\r\n if ($year < 0) return false;\r\n if (1 > $day || $day > $days_in_month[$month-1]) return false;\r\n\r\n\r\n // if required, verify the incoming date is LATER than the current date.\r\n if ($is_later_date)\r\n { \r\n // get current date\r\n $today = date(\"U\");\r\n $date = mktime(0, 0, 0, $month, $day, $year);\r\n if ($date < $today)\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function bad_days_in_month($month, $year){\n // calculate number of days in a month\n return ($month==2) ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) \n : ( ($month - 1) % 7 % 2 ? 30 : 31 );\n }", "public static function validateExpirationDate(string $month, string $year) : bool {\n if ($month < 1 || $month > 12) {\n return FALSE;\n }\n if ($year < date('Y')) {\n return FALSE;\n }\n elseif ($year == date('Y') && $month < date('n')) {\n return FALSE;\n }\n\n return TRUE;\n }", "function testForwardToDayOfMonth()\n {\n $date = new DateTime('2020-01-30');\n $monthFromDate = new DateTime('2020-02-29'); // last day of the month\n $modifiedDate = (clone $date)->modify('+1 month');\n $this->assertNotEquals($monthFromDate, $modifiedDate);\n\n $lastDayOfNextMonth = (clone $date)->modify('last day of next month');\n $this->assertEquals($monthFromDate, min($lastDayOfNextMonth, $modifiedDate));\n }", "function leap_islamic($year)\n{\n return ((($year * 11) + 14) % 30) < 11;\n}", "function dtlIsValidMonth($year, $month, $countOct1582 = false) {\n // * by default the earliest valid month is November 1582,\n // as this was the first full month of the Gregorian calendar\n // * if $countOct1582 is true then October 1582 counted as valid\n // * the latest valid Gregorian month (as far as the DTL is concerned) is December 9999\n // * returns false for invalid input\n if (!dtlIsInt($year) || !dtlIsInt($month)) {\n return false;\n }\n if ($year < 1582 || $month < 1 || $month > 12) {\n return false;\n }\n // 1582 is a special case:\n if ($year == 1582) {\n return $month >= ($countOct1582 ? 10 : 11);\n }\n return true;\n}", "private function monthsSince(): int\n {\n return \\absint($this->secondsSince() / (DAY_IN_SECONDS * (365 / 12)));\n }", "function commercegimuemoa_validate_bank_card_exp_date($month, $year) {\n if ($month < 1 || $month > 12) {\n return 'month';\n }\n\n if ($year < date('Y')) {\n return 'year';\n }\n elseif ($year == date('Y')) {\n if ($month < date('n')) {\n return 'month';\n }\n }\n\n return TRUE;\n}", "public function splitByMonth();", "static function getMonthRange ()\r\n\t{\r\n\t\treturn range(1,12);\r\n\t}", "private function nextMonth( $month, $year ) {\n\t\t$year = (($month + 1) >= 1)? $year : ($year + 1); // Check if the year is the same\n\t\t$month = (($month + 1) >= 1)? ($month + 1) : 12; // Check if we're on the first month already, if so go to december\n\t\treturn [\n\t\t\t'month' => $month,\n\t\t\t'year' => $year\n\t\t];\n\t}", "public function testYearToDate(): void\n {\n // and second do not take place in same day.\n do {\n $sheet = $this->getSpreadsheet()->createSheet();\n $dtStart = new DateTimeImmutable();\n $startDay = (int) $dtStart->format('d');\n $startMonth = (int) $dtStart->format('m');\n $sheet->getCell('A1')->setValue('Date');\n $sheet->getCell('A2')->setValue('=TODAY()');\n // cache result for consistency in later calculations\n $sheet->getCell('A2')->getCalculatedValue();\n $sheet->getCell('A3')->setValue('=DATE(YEAR(A2), 12, 31)');\n $sheet->getCell('A4')->setValue('=A3 + 1');\n $sheet->getCell('A5')->setValue('=DATE(YEAR(A2), 1, 1)');\n $sheet->getCell('A6')->setValue('=A5 - 1');\n\n $this->maxRow = $maxRow = 6;\n $autoFilter = $sheet->getAutoFilter();\n $autoFilter->setRange(\"A1:A$maxRow\");\n $columnFilter = $autoFilter->getColumn('A');\n $columnFilter->setFilterType(Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);\n $columnFilter->createRule()\n ->setRule(\n Rule::AUTOFILTER_COLUMN_RULE_EQUAL,\n '',\n Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE\n )\n ->setRuleType(Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);\n $autoFilter->showHideRows();\n $dtEnd = new DateTimeImmutable();\n $endDay = (int) $dtEnd->format('d');\n } while ($startDay !== $endDay);\n\n $expected = ($startMonth === 12 && $startDay === 31) ? [2, 3, 5] : [2, 5];\n self::assertEquals($expected, $this->getVisibleSheet($sheet));\n }", "public function test_year_method()\n {\n $this->assertTrue(Validation::year(2017));\n $this->assertTrue(Validation::year(1917));\n $this->assertFalse(Validation::year(0));\n $this->assertFalse(Validation::year(20018));\n $this->assertFalse(Validation::year('nothing'));\n }", "public function finish_month ($month, $year)\n {\n }", "function isAllMonth(){\r\n \r\n $start_map = $this->start();\r\n $stop_map = $this->stop();\r\n \r\n $ret_bool = false;\r\n if($start_map['mday'] == 1){\r\n \r\n if($start_map['mon'] == $stop_map['mon']){\r\n $ret_bool = ($stop_map['mday'] == $start_map['dim'])\r\n && ($start_map['year'] == $stop_map['year']);\r\n }else{\r\n \r\n if($this->isMidnight($stop_map)){\r\n \r\n list($start_month,$start_year) = parse_date_get::nextMonth($start_map['mon'],$start_map['year']);\r\n $ret_bool = ($start_month == $stop_map['mon'])\r\n && ($start_year == $stop_map['year']);\r\n \r\n }//if\r\n \r\n }//if/else if\r\n \r\n }//if/else\r\n\r\n return $ret_bool;\r\n\r\n }", "public function test_leap_adding_1_day_to_28_feb_returns_29_feb(): void\n {\n $this->assertEquals(\n new DateTime('2020-02-29'),\n Date::addPeriod(new DateTime('2020-02-28'), Date::PERIOD_DAY, 1)\n );\n }", "public function set_period($y, $m) {\n // 3. fix wrong values \n if ( ($y < $this-year) || ($m < 1) || ($m > 12)) {\n $this->year= $this->this_year;\n $this->month= $this->this_month;\n } else {\n $this->year = $y;\n $this->month = $m;\n }\n // Get the previous period\n if ($this->month == 1) {\n $this->prev_month = 12;\n $this->prev_year = $this->year - 1;\n } else {\n $this->prev_month = $this->month - 1;\n $this->prev_year = $this->year;\n }\n // Get the next period\n if ($this->month == 12) {\n $this->next_month = 1;\n $this->next_year = $this->year + 1;\n } else {\n $this->next_month = $this->month + 1;\n $this->next_year = $this->year;\n }\n $this->month_start = strtotime($this->year.\"-\".$this->month.\"-01 00:00:00\"); \n $this->days_in_month = strftime('%d', strtotime($this->next_year.\"-\".$this->next_month.\"-01 00:00:00\")-1);\n }", "public function testAddMonths()\n {\n $this->assertEquals('2013-07-01', $this->date->addMonths(2)->toDateString());\n }", "function days_in_month($month, $year) {\r\n return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\r\n }", "function add_months($date,$months){\n\n $init=clone $date;\n $modifier=$months.' months';\n $back_modifier =-$months.' months';\n\n $date->modify($modifier);\n $back_to_init= clone $date;\n $back_to_init->modify($back_modifier);\n\n while($init->format('m')!=$back_to_init->format('m')){\n $date->modify('-1 day') ;\n $back_to_init= clone $date;\n $back_to_init->modify($back_modifier);\n }\n return $init;\n}", "public function minusMonth() {\r\n\t\t\tif ($this->month == 1) {\r\n\t\t\t\t$this->year--;\r\n\t\t\t\t$this->month = 12;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->month--;\r\n\t\t\t}\r\n\t\t}", "function preload_days_in_month( $year = false, $month = false ) {\n\tif ( $year && $month ) {\n\t\treturn \\cal_days_in_month( CAL_GREGORIAN, (int) $month, (int) $year );\n\t}\n\n\treturn 31;\n}", "public function addMonth() {\r\n\t\t\tif ($this->month == 12) {\r\n\t\t\t\t$this->year++;\r\n\t\t\t\t$this->month = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->month++;\r\n\t\t\t}\r\n\t\t}", "function addMonths( $n ) {\n\t\t$an = abs( $n );\n\t\t$years = floor( $an / 12 );\n\t\t$months = $an % 12;\n\n\t\tif ($n < 0) {\n\t\t\t$this->year -= $years;\n\t\t\t$this->month -= $months;\n\t\t\tif ($this->month < 1) {\n\t\t\t\t$this->year--;\n\t\t\t\t$this->month = 12 - $this->month;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->year += $years;\n\t\t\t$this->month += $months;\n\t\t\tif ($this->month > 12) {\n\t\t\t\t$this->year++;\n\t\t\t\t$this->month -= 12;\n\t\t\t}\n\t\t}\n\t}", "public function check_schedule_months_of_year($schedule_months_of_year) {\n\t\t$now = $this->getCurrentDate ();\n\t\tif ($schedule_months_of_year != \"\") {\n\t\t\t$liste_mois = explode ( \",\", $schedule_months_of_year );\n\t\t\tif ($liste_mois === false) {\n\t\t\t\t$this->onWarning ( \"Explode en erreur avec : \" . $schedule_months_of_year );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach ( $liste_mois as $mois_a_valider ) {\n\t\t\t\tif ($mois_a_valider == \"\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ($now [\"month\"] == $mois_a_valider) {\n\t\t\t\t\t$this->onDebug ( \"Il y a un Mois qui correspond\",1 );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->onWarning ( \"Pas de mois valide dans le champ : \" . $schedule_months_of_year );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->onDebug ( \"Pas de Mois correspondant\",1 );\n\t\treturn false;\n\t}", "public function testGetMonth()\n {\n $this->assertSame(1, DateTime::createFromFormat('Y-m-d', '2020-01-01')->getMonth());\n $this->assertSame(2, DateTime::createFromFormat('Y-m-d', '2020-02-01')->getMonth());\n $this->assertSame(3, DateTime::createFromFormat('Y-m-d', '2020-03-01')->getMonth());\n $this->assertSame(4, DateTime::createFromFormat('Y-m-d', '2020-04-01')->getMonth());\n $this->assertSame(5, DateTime::createFromFormat('Y-m-d', '2020-05-01')->getMonth());\n $this->assertSame(6, DateTime::createFromFormat('Y-m-d', '2020-06-01')->getMonth());\n $this->assertSame(7, DateTime::createFromFormat('Y-m-d', '2020-07-01')->getMonth());\n $this->assertSame(8, DateTime::createFromFormat('Y-m-d', '2020-08-01')->getMonth());\n $this->assertSame(9, DateTime::createFromFormat('Y-m-d', '2020-09-01')->getMonth());\n $this->assertSame(10, DateTime::createFromFormat('Y-m-d', '2020-10-01')->getMonth());\n $this->assertSame(11, DateTime::createFromFormat('Y-m-d', '2020-11-01')->getMonth());\n $this->assertSame(12, DateTime::createFromFormat('Y-m-d', '2020-12-01')->getMonth());\n }", "function days_in_month($month, $year) \n\t{\n\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); \n\t}", "public function jumpMonths(int $months): Date;", "public function testSubMonth()\n {\n $this->assertEquals('2013-03-01', $this->date->subMonths(2)->toDateString());\n }", "protected function monthIsValid()\n {\n return $this->month && is_numeric($this->month) && $this->month > 0;\n }", "function GetDaysInMonth($month, $year) \n{\nreturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); \n}", "function list_period($until) {\n $month = date(\"m\")*1;\n $year = date(\"Y\")*1;\n\n //TODO: get the earliest entry. Assign to $last_year & $last_month\n // or, assign $last_year & $last_month as param\n $last_year = substr($until,0,4)*1;\n $last_month = substr($until,4,2)*1;\n\n do {\n $period = \"$year-\".str_pad($month,2,'0',STR_PAD_LEFT);\n $result[$period] = date(\"Y M\", strtotime($period.'-01'));\n $month--;\n if($month==0) {\n $month = 12;\n $year--;\n }\n }while($year>=$last_year && $month>=$last_month);\n\n return $result;\n}", "function commercegimuemoa_validate_bank_card_start_date($month, $year) {\n if (empty($month) && empty($year)) {\n return TRUE;\n }\n\n if (empty($month) || empty($year)) {\n return empty($month) ? 'month' : 'year';\n }\n\n if ($month < 1 || $month > 12) {\n return 'month';\n }\n\n if ($year > date('Y')) {\n return 'year';\n }\n elseif ($year == date('Y')) {\n if ($month > date('n')) {\n return 'month';\n }\n }\n\n return TRUE;\n}", "public function getMonth(): int;", "public function testGetDaysInMonth()\n {\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-01-01')->getDaysInMonth());\n $this->assertSame(28, DateTime::createFromFormat('Y-m-d', '2001-02-01')->getDaysInMonth());\n $this->assertSame(29, DateTime::createFromFormat('Y-m-d', '2000-02-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-03-01')->getDaysInMonth());\n $this->assertSame(30, DateTime::createFromFormat('Y-m-d', '2001-04-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-05-01')->getDaysInMonth());\n $this->assertSame(30, DateTime::createFromFormat('Y-m-d', '2001-06-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-07-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-08-01')->getDaysInMonth());\n $this->assertSame(30, DateTime::createFromFormat('Y-m-d', '2001-09-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-10-01')->getDaysInMonth());\n $this->assertSame(30, DateTime::createFromFormat('Y-m-d', '2001-11-01')->getDaysInMonth());\n $this->assertSame(31, DateTime::createFromFormat('Y-m-d', '2001-12-01')->getDaysInMonth());\n }", "function nextExpirationMonth($today)\r\n{\r\n\treturn nextExpiration_($today, 1);\r\n}", "public static function checkMonthYear($year,$month)\n\t{\n\t\tif(($year < date('Y')) || ($year == date('Y') && $month < date('m')) || ($month < 1 || $month > 12)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function month($year_or_datepoint, int $month = 1): Period\n{\n if (is_int($year_or_datepoint)) {\n return Period::fromMonth($year_or_datepoint, $month);\n }\n\n return Datepoint::create($year_or_datepoint)->getMonth();\n}", "function days_in_month($month, $year) \n{ \n\t// calculate number of days in a month \n\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); \n}", "function next_month($date,$offset = 1){\n if($offset<1){\n $offset = abs($offset);\n $month = date(\"m\",$date)-$offset;\n $year = date(\"Y\",$date);\n while($offset > 12){\n $year = $year -1;\n $month = $month+12;\n $offset = $offset - 12;\n }\n } else {\n $month = date(\"m\",$date)+$offset;\n $year = date(\"Y\",$date);\n while($offset > 12){\n $year = $year +1;\n $month = $month-12;\n $offset = $offset - 12;\n }\n }\n if($month > 12){\n while($month >12){\n $year = $year + 1;\n $month = $month - 12;\n }\n }else if($month < 1){\n while($month >12){\n $year = $year - 1;\n $month = $month + 12;\n }\n }\n\n /*jrh 12/21/06 ID004 Handle Month additions during the last few days of a month */\n $orig_month =date(\"m\",$date);\n $orig_year = date(\"Y\",$date);\n $orig_days_in_month = daysinmonth($orig_month,$orig_year);\n $day = date(\"d\",$date);\n $days_in_month = daysinmonth($month,$year);\n if($day>$days_in_month){\n $diff = daysinmonth($orig_month,$orig_year)-$day;\n $day = $days_in_month - $diff;\n }else if($days_in_month>$orig_days_in_month){\n $diff = $days_in_month - $orig_days_in_month;\n if($day >= $days_in_month - $diff){\n $day = $day + $diff;\n }\n }\n return mktime(date('H',$date), date('i',$date), date('s',$date), $month, $day, $year);\n}", "function endMonth($date, $nbre){\n $date = format_dateDate($date); \n \n\n $day = explode('/',$date)[0];\n $month=explode('/',$date)[1];\n $year=explode('/',$date)[2];\n for ($i=1; $i <=$nbre ; $i++) { \n $month++;\n if($month==13){\n $month=1;\n $year++; \n }\n }\n $datefin= date('Y-m-d', strtotime(''.$day.'-'.$month.'-'.$year.''));\n\n return $datefin;\n }", "function days($month, $from = 1970) {\n static $num = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\n\n\n if (($month < 1) OR ($month > 12)) {\n return FALSE;\n } elseif ( ! is_num($year) OR (strlen($year) <> 4)) {\n $year = date('Y');\n }\n\n if ($month == 2) {\n if ((($year % 400) == 0) OR ((($year % 4) == 0) AND (($year % 100) <> 0))) {\n return 29;\n }\n }\n\n return $num[$month - 1];\n}", "public abstract function get_min_year();", "public function isCurrentMonth() : bool\n {\n return date('Ym', $this->getTimestamp()) == date('Ym');\n }", "function checkExpiry($expDate){\n $currMonth = intval(date(\"m\"));\n $currYear = intval(date(\"Y\"));\n $expMonth = intval(substr($expDate, 5));\n $expYear = intval(substr($expDate, 0, 4));\n \n if ($expYear > $currYear) {\n return true;\n } else if (($expYear >= $currYear) && ($expMonth >= $currMonth )) {\n return true;\n } else {\n return false;\n }\n}", "function getrenewtime($renew_year, $currentyear) {\n\t//\tmktime(0, 0, 0, date('n'), date('j'), date('Y')) <= mktime(23, 59, 59, 3, 31, $renew_year));\n\treturn true;\n}", "public function isNextMonth()\n {\n return $this->month === static::now($this->getTimezone())->addMonth()->month;\n }", "function month($date_start, $date_end)\r\n\t\t\t{\r\n\t\t\t\t//must add 1 to the month\r\n\t\t\t\t$y = $this->db->query(\"SELECT PERIOD_DIFF(EXTRACT(YEAR_MONTH FROM '$date_end'), EXTRACT(YEAR_MONTH FROM '$date_start')) AS month\");\r\n\t\t\t\treturn $y;\r\n\t\t\t}", "public function testGetSalesWithValidPromotorTokenMarchMonthLeapYear()\n { \n $knownDate = Carbon::parse('2016-03-31');\n Carbon::setTestNow($knownDate); \n \n // Set time\n $dateObject = Carbon::now();\n \n // Set time\n $time = $dateObject->format('Y-m');\n $thisMonth = $dateObject->format('Y-m-d');\n \n // Substract date by 1 month\n $dateObject = Carbon::parse('2016-02-20');\n \n $timeLastMonth = $dateObject->format('Y-m');\n $lastMonth = $dateObject->format('Y-m-d');\n\n // Populate data\n $panasonicID = $this->_populatePanasonic();\n $arcoID = $this->_populateArco($panasonicID);\n $tlID = $this->_populateTL($arcoID);\n $promotorID = $this->_populatePromotor($tlID);\n $branchID = $this->_populateBranch($tlID);\n $dealerID = $this->_populateDealer();\n $dealerAccountID = $this->_populateDealerAccount($tlID);\n\n // Populate product data\n $productCategoryID = $this->_populateProductCategory();\n $productID = $this->_populateProduct($productCategoryID);\n \n // Populate target\n $currentTargetValue = 100000;\n $lastTargetValue = 500000;\n \n $currentTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $currentTargetValue, \n 'month' => $time\n ];\n \n $lastTarget = [\n 'promotorID' => $promotorID, \n 'dealerID' => $dealerID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'total' => $lastTargetValue, \n 'month' => $timeLastMonth\n ];\n \n $this->_populatePromotorTarget($currentTarget);\n $this->_populatePromotorTarget($lastTarget);\n \n \n // Populate Report\n $priceThisMonth = 90000;\n $priceLastMonth = 100000;\n $quantityThisMonth = 1;\n $quantityLastMonth = 1;\n \n $reportThisMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceThisMonth, \n 'quantity' => $quantityThisMonth, \n 'date' => $thisMonth\n ];\n \n $reportLastMonth = [\n 'dealerID' => $dealerID, \n 'promotorID' => $promotorID, \n 'dealerAccountID' => $dealerAccountID, \n 'TLID' => $tlID, \n 'arcoID' => $arcoID, \n 'productID' => $productID, \n 'customName' => '', \n 'price' => $priceLastMonth, \n 'quantity' => $quantityLastMonth, \n 'date' => $lastMonth\n ];\n \n $this->_populateReport($reportThisMonth);\n $this->_populateReport($reportLastMonth);\n\n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $response = $this->call('GET', '/api/1.5.0/report-sales', ['token' => $encryptedToken]);\n $result = json_decode($response->getContent(), true);\n \n // Verify\n $this->assertTrue(array_key_exists('result', $result));\n $this->assertEquals($result['result']['targetPromotorProduct'][$productID]['product_ID'], $productID);\n $this->assertEquals($result['result']['targetPromotor'], $currentTargetValue);\n $this->assertEquals($result['result']['targetPromotorData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['targetDealer'], $currentTargetValue);\n $this->assertEquals($result['result']['targetDealerData'], $priceThisMonth*$quantityThisMonth);\n $this->assertEquals($result['result']['comparison'], $lastTargetValue);\n $this->assertEquals($result['result']['comparisonData'], $priceLastMonth*$quantityLastMonth);\n }", "public function payout_month_year() {\n\n $date = $this->get_datetime();\n $date->modify( \"+6 months\" );\n\n return $date->format( 'm-Y' );\n }", "public function is_year()\n {\n }", "function nextExpirationYear($today)\r\n{\r\n\treturn nextExpiration_($today, 12);\r\n}", "public function __construct($month, $year)\n {\n $this->startDate = new \\DateTime();\n $this->startDate->setDate($year, $month, 1);\n $this->startDate->setTime(0, 0, 0);\n\n $interval = new \\DateInterval('P1M');\n\n $this->endDate = clone $this->startDate;\n $this->endDate->add($interval);\n }", "public function testCardValidTillExpiryMonth()\n {\n $card = new Card(99999, '123', new DateTime('@'.strtotime(\"midnight UTC\")));\n $this->assertInstanceOf('Namshi\\Innovate\\Payment\\Card', $card);\n }", "function addmonths($numberofmonths)\n {\n do{\n if(($this->c_Month + $numberofmonths) <= 12){\n $this->c_Month += $numberofmonths;\n\t\t\t\t\tif($this->c_Month <= 9)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->c_Month = \"0\" . $this->c_Month;\n\t\t\t\t\t}\n $numberofmonths = 0;\n } else {\n $numberofmonths -= (12 - $this->c_Month);\n $numberofmonths = 1;\n $this->addyears(1);\n }\n }while($numberofmonths>0);\n }", "public function months_since_epoch()\n {\n\n $epoch = Configure::read('epoch');\n $sdate = new DateTime(\"@$epoch\");\n $edate = new DateTime();\n $startMonth = $sdate->format('m');\n $startYear = $sdate->format('Y');\n\n $endMonth = $edate->format('m');\n $endYear = $edate->format('Y');\n\n $endmonth = (($endYear - $startYear) * 12 + ($endMonth - $startMonth) + 1)-1;\n return $endmonth;\n }", "public function isNextYear()\n {\n return $this->year === static::now($this->getTimezone())->addYear()->year;\n }", "public function get_total_premium_last_year_same_month(){\n $agent_result_set=$this->read_selective_agent(\"WHERE branch_manager_id=\".$_SESSION['id']);\n //generating the agent id constraint\n if($agent_result_set){\n $constraint_id=\" AND (\";\n while($agent_result=$agent_result_set->fetch_assoc()){\n $constraint_id=$constraint_id.\" agent_id=\".$agent_result['id'].\" OR\";\n }\n $constraint_id=substr($constraint_id,0,-2);\n $constraint_id=$constraint_id.\")\";\n }else{\n $constraint_id=\" AND FALSE\";\n }\n\n $year = date(\"Y\");\n $month=date('m');\n $date1=($year-1).'-'.$month.'-01';\n $date2=($year-1).'-'.($month).'-30';\n $policy_result_set=$this->read_selective_policy(\"WHERE (NOT comission_percentage=0) AND (od_policy_start_date BETWEEN '\".$date1.\"' AND '\".$date2.\"')\".$constraint_id);\n $premium=0;\n if($policy_result_set){\n while($policy_result=$policy_result_set->fetch_assoc()){\n $premium+=$policy_result['total_premium'];\n }\n }\n return $premium;\n }", "public function isCurrentMonth(): bool {\n $currentMonth = date('Y-m');\n $thisMonth = $this->getDateTime()->format('Y-m');\n return $currentMonth === $thisMonth;\n }", "function tep_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n }", "public function isMonthly()\n {\n return $this->interval === 'monthly';\n }", "function months($return=null,$set=null,$year=null){\n // firts make the month and classified according to given year\n // this is going to define section\n $translate = array(\n\t\t'1'=>'Enero',\n\t\t'2'=>'Febrero',\n\t\t'3'=>'Marzo',\n\t\t'4'=>'Abril',\n\t\t'5'=>'Mayo',\n\t\t'6'=>'Junio',\n\t\t'7'=>'Julio',\n\t\t'8'=>'Agosto',\n\t\t'9'=>'Septiembre',\n\t\t'10'=>'Octubre',\n\t\t'11'=>'Noviembre',\n\t\t'12'=>'Diciembre'\n );\n for($i=1;$i<=12;$i++){\n \t$months[$i]['spanish'] = $translate[$i];\n\t\t$months[$i]['large'] = date('F',mktime('0','0','0',$i,'01',$year));\n\t\t$months[$i]['short'] = date('M',mktime('0','0','0',$i,'01',$year));\n\t\t$months[$i]['numeric'] = date('m',mktime('0','0','0',$i,'01',$year));\n\t\t$months[$i]['num'] = date('n',mktime('0','0','0',$i,'01',$year));\n\t\t$months[$i]['days'] = date('t',mktime('0','0','0',$i,'01',$year));\n\t\t$months[$i]['leap'] = date('L',mktime('0','0','0',$i,'01',$year));\n }\n // Now select if set the vars to the view or return the vars to the controller\n if($return == false && $set == true){\n\t $this->set('months',$months);\n }elseif($return == true && $set == false){\n\t return $months;\n }\n }", "public function forecastYearMonths()\n {\n $thisMonth = (int) $this->currentYearMonth();\n $array = [];\n $range = $this->array;\n sort($range);\n foreach ($range as $r) {\n if ((int) $r >= $thisMonth && count($range) > 1) {\n array_push($array, $r);\n }\n }\n return $array;\n }", "public function month($date);", "function add_months($date, $months) {\n global $ci;\n if( !$date ) $date = Today();\n $date_timestamp = date_convert_timestamp($date);\n /*\n $day_old = date('d',$date_timestamp);\n $month_old = date('m',$date_timestamp);\n $year_old = date('Y',$date_timestamp);\n\n $month_new = $month_old + $months;\n\n return date($ci->dateformatPHP,strtotime(\"$year_old-$month_new-$day_old\"));\n */\n $date = date('d-m-Y',$date_timestamp);\n $date = new DateTime($date);\n\n $months = intval($months);\n if( $months > 0 ){\n $months = \"+ $months\";\n }\n $date->modify(\"$months months\");\n\n return $date->format($ci->dateformatPHP);\n// if( $date->format('m')-$months <= 12 AND $date->format('m') - $months > date('m',$date_timestamp)-$months ){\n// $date->modify('first day of this month');\n// $date->modify(\"-1 months\");\n// $date->modify('last day of this month');\n\n// return $date->format($ci->dateformatPHP);\n// } else{\n// // $date->modify('last day of this month');\n// return $date->format($ci->dateformatPHP);\n// }\n\n}", "function checkCardDate($cardMonth, $cardYear) {\n\t$year = (int) date('Y');\n\t$month = (int) date('n');\n\t$cardYear = (int) $cardYear;\n\t$cardMonth = (int) $cardMonth;\n\n\tif ($year > $cardYear) {\n\t\treturn false;\n\t} elseif ($year === $cardYear && $month >= $cardMonth) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function twelveMonths($startYear, $startMonth)\n\t{\n\t\tif($startYear == \"\"){$startYear = $this->startFinancialYear;}\n\t\tif($startMonth == \"\"){$startMonth = $this->startMonth;}\n\t\t\n\t\t$listofMonths = array();\n\t\t//echo date(\"Y-M\" . \"-01\");\n\t\tfor ($x=0; $x < 12; $x++) \n\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$time = strtotime(\"+\" . $x . \" months\", strtotime( $startYear . \"-\" . $startMonth . \"-01\"));\n\t\t\t\n\t\t\t$key = date('m', $time);\n\t\t\t$name = date('M Y', $time);\n\t\t\t$months[$key] = $name;\n\t\n\t\t\t$listofMonths[$x] = $months[$key];\n\t\t}\n\t\treturn $listofMonths;\n\t}", "private function getMonth($tz_offset){\r\n \r\n $ret_map_list = array();\r\n $timestamp = parse_date_get::timestamp($tz_offset);\r\n $time_map = parse_date_get::dateMap($timestamp);\r\n $start_i = 0;\r\n $stop_i = 1;\r\n \r\n $month_start = $this->val_map['month_list'][$start_i]->month();\r\n $month_stop = isset($this->val_map['month_list'][$stop_i]) ? $this->val_map['month_list'][$stop_i]->month() : $month_start;\r\n ///if($month_start > $month_stop){ $month_stop = $month_start; }//if\r\n \r\n $day_start = isset($this->val_map['day_list'][$start_i]) ? $this->val_map['day_list'][$start_i]->get() : 1;\r\n \r\n // get the year, if automatically set, compensate for this month being bigger than the found one...\r\n $year_start = 0;\r\n if(isset($this->val_map['year_list'][$start_i])){\r\n \r\n $year_start = $this->val_map['year_list'][$start_i]->year();\r\n \r\n }else{\r\n \r\n $year_start = parse_date_get::year(0,$tz_offset,$timestamp);\r\n \r\n // get current month index...\r\n $month_current = $time_map['mon'];\r\n if($month_current > $month_start){\r\n $year_start++;\r\n }else if($month_current == $month_start){\r\n $day_current = $time_map['mday'];\r\n if($day_current > $day_start){\r\n $year_start++;\r\n }//if\r\n }//if/else\r\n \r\n }//if/else \r\n \r\n $year_stop = isset($this->val_map['year_list'][$stop_i]) \r\n ? $this->val_map['year_list'][$stop_i]->year()\r\n : $year_start;\r\n \r\n if($year_start > $year_stop){ $year_stop = $year_start; }//if\r\n \r\n // compensate for cross year dates (eg, december 3 - january 5)...\r\n if($month_start > $month_stop){ $year_stop++; }//if\r\n \r\n $day_stop = isset($this->val_map['day_list'][$stop_i]) \r\n ? $this->val_map['day_list'][$stop_i]->get() \r\n : (isset($this->val_map['day_list'][$start_i]) ? $day_start : parse_date_get::daysInMonth($month_stop,$year_stop,$tz_offset));\r\n if(($month_start == $month_stop) && ($day_start > $day_stop)){ $day_stop = $day_start; }//if\r\n \r\n ///out::e($month_start,$month_stop,$year_start,$year_stop,$day_start,$day_stop);\r\n \r\n $time_list = $this->getTime();\r\n \r\n $ret_map_list = $this->getTimestamps(\r\n array($year_start,$year_stop),\r\n array($month_start,$month_stop),\r\n array($day_start,$day_stop),\r\n $time_list\r\n );\r\n \r\n ///out::e($ret_map_list,$time_list);\r\n \r\n return $ret_map_list;\r\n \r\n }", "private function buildMonthYear($month, $year, $min_max, $expression)\n\t{\n\t\tif (!(int)$month && !(int)$year) {\n\t\t\t$date = Func::isNull();\n\t\t}\n\t\telse {\n\t\t\t$month_has_joker = $this->hasJoker($month);\n\t\t\t$year_has_joker = $this->hasJoker($year);\n\t\t\tif (!$month_has_joker && !$year_has_joker) {\n\t\t\t\t$date_begin = date('Y-m-d H:i:s', mktime(0, 0, 0, $month, 1, $year));\n\t\t\t\t$date_end = date('Y-m-d H:i:s', mktime(0, 0, -1, $month + 1, 1, $year));\n\t\t\t\t$date = $this->buildDateOrPeriod($date_begin, $date_end, $min_max);\n\t\t\t}\n\t\t\telseif (!$year_has_joker) {\n\t\t\t\t// month has wildcard, year may be computed\n\t\t\t\tlist($day, $month, $year) = $this->padDateParts('__', $month, $year);\n\t\t\t\t$date = Func::like(\"$year-$month-$day __:__:__\");\n\t\t\t}\n\t\t\telseif (!$month_has_joker) {\n\t\t\t\t// year has wildcard but not month that may be computed.\n\t\t\t\t// So we should take care if month is <1 or >12\n\t\t\t\tif ($month < 1 || $month > 12) {\n\t\t\t\t\tthrow new Data_List_Exception(\n\t\t\t\t\t\t$expression, Loc::tr('You can not put a formula on month when year has wildcard')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlist($day, $month, $year) = $this->padDateParts('__', $month, $year);\n\t\t\t\t$date = Func::like(\"$year-$month-$day __:__:__\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// both year and month have wildcards\n\t\t\t\tlist($day, $month, $year) = $this->padDateParts('__', $month, $year);\n\t\t\t\t$date = Func::like(\"$year-$month-$day __:__:__\");\n\t\t\t}\n\t\t}\n\t\treturn $date;\n\t}", "public function years($start = false, $end = false);", "function isSameYear(){\r\n $start_map = $this->start();\r\n $stop_map = $this->stop();\r\n $ret_bool = false;\r\n \r\n if($start_map['year'] == $stop_map['year']){\r\n \r\n $ret_bool = true;\r\n \r\n }else{\r\n \r\n if(($stop_map['mon'] == 1) && ($stop_map['mday'] == 1) && $this->isMidnight($stop_map)){\r\n \r\n $ret_bool = ($start_map['year'] + 1) == $stop_map['year'];\r\n \r\n }//if\r\n \r\n }//if/else\r\n \r\n \r\n return $ret_bool;\r\n }", "function month($year = '', $month = '', $id = '')\r\n\t{\r\n\t\t$this->day_list = $this->getdayslist();\r\n\t\t$item_id = $id;\r\n\t\t//to make the separation of date display with available and unavailable count\r\n $days = array();\r\n $monthly_start_date = $year . '-' . $month . '-1';\r\n $month_start_date = date('Y-m-d', strtotime($monthly_start_date));\r\n $temmp = explode('-', $monthly_start_date);\r\n $month_end_date = date('Y-m-d', mktime(0, 0, 0, $temmp[1]+1, $temmp[2]-1, $temmp[0]));\r\n\t\t\r\n\t\tif (strtotime(date('Y-m-d')) < strtotime($month_start_date)) {\r\n\t $monthly_color = '#98CF67';\r\n\t\t} else {\r\n\t $monthly_color = '#FFFFFF';\r\n\t\t}\r\n if (is_array($days)) {\r\n ksort($days);\r\n }\r\n $str = '';\r\n $day = 1;\r\n $today = 0;\r\n $month = $this->month_list[$month-1];\r\n\t\t\r\n if ($year == '' || $month == '') { // just use current year & month\r\n $year = date('Y');\r\n $month = date('m');\r\n }\r\n $flag = 0;\r\n for ($i = 0; $i < 12; $i++) {\r\n if (strtolower($month) == $this->month_list[$i]) {\r\n if (intval($year) != 0) {\r\n $flag = 1;\r\n $month_num = $i+1;\r\n break;\r\n }\r\n }\r\n }\r\n $temp = array_flip($this->month_list);\r\n if ($flag == 0) {\r\n $year = date('Y');\r\n $month = date('F');\r\n $month_num = date('m');\r\n }\r\n $next_year = $year;\r\n $prev_year = $year;\r\n $next_month = intval($month_num) +1;\r\n $prev_month = intval($month_num) -1;\r\n\t\t\r\n if ($next_month == 13) {\r\n $next_month = 'january';\r\n $next_year = intval($year) +1;\r\n } else {\r\n $next_month = $this->month_list[$next_month-1];\r\n }\r\n if ($prev_month == 0) {\r\n $prev_month = 'december';\r\n $prev_year = intval($year) -1;\r\n } else {\r\n $prev_month = $this->month_list[$prev_month-1];\r\n }\r\n if ($year == date('Y') && strtolower($month) == strtolower(date('F'))) {\r\n // set the flag that shows todays date but only in the current month - not past or future...\r\n $today = date('j');\r\n }\r\n $calType = 'big-calendar dc';\r\n $action = 'calendar';\r\n $days_in_month = date(\"t\", mktime(0, 0, 0, $month_num, 1, $year));\r\n $first_day_in_month = date('D', mktime(0, 0, 0, $month_num, 1, $year));\r\n $prev_num = $month_num-1;\r\n $next_num = $month_num-1;\r\n $str.= '<div class=\"js-bookit-calendar-block\"><div class=\"hasDatepicker js-calender-permonth js-calender-form-calender\" id=\"datepicker\">';\r\n $str.= '<div class=\"' . $calType . '\">';\r\n $str.= '<div class=\"calendar-month no-pad pr dc tb tab-pane active span calendar pull-right no-mar graydarkc bot-space sep-bot\">';\r\n $temp = array_flip($this->month_list);\r\n $prev_month_mod = $temp[$prev_month]+1;\r\n $prev_url = Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'calendar',\r\n 'guest',\r\n 'month' => $prev_month_mod,\r\n 'year' => $prev_year,\r\n 'item_id' => $item_id,\r\n ) , true);\r\n if ($monthly_color == '#98CF67') {\r\n $monthly_title = 'Available';\r\n } elseif ($monthly_color == '#FFA2B7') {\r\n $monthly_title = 'Booked';\r\n } else {\r\n $monthly_title = 'Not available';\r\n }\r\n\t\t$str.= ' <div class=\"monthly-info show text-14 sep-top sep-bot bot-mspace no-round space dc\" title=\"' . $monthly_title . '\">';\r\n\t\t$str.= \"<span class='prev {\\\"url\\\":\\\"$prev_url\\\"} js-calender-prev ui-datepicker-prev ui-corner-all pull-left'>\";\r\n $str.= '</span>';\r\n $str.= ' <span class=\"ui-datepicker-month\">' . ucfirst($month) . '</span> <span class=\"ui-datepicker-year \">' . $year . '</span>' . '<span class=\"js-monthstart-date\" style=\"display:none;\">' . $month_start_date . '</span><span class=\"js-monthend-date\" style=\"display:none;\">' . $month_end_date . '</span>';\r\n $next_month_mod = $temp[$next_month]+1;\r\n $next_url = Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'calendar',\r\n 'guest',\r\n 'month' => $next_month_mod,\r\n 'year' => $next_year,\r\n 'item_id' => $item_id,\r\n ) , true);\r\n $str.= \" <span class='next {\\\"url\\\":\\\"$next_url\\\"} js-calender-next ui-datepicker-next ui-corner-all pull-right'>\";\r\n $str.= '</span>';\r\n $str.= '</div>';\r\n\t\t$table_class = ' class=\"datepicker-night-mode sfont mspace\"';\r\n $str.= '<table' . $table_class . '>';\r\n $str.= '<thead>';\r\n $str.= '<tr>';\r\n for ($i = 0; $i < 7; $i++) {\r\n $str.= '<th class=\"calendar-head dc textn ver-smspace\">' . substr($this->day_list[$i], 0, 3) . '</th>';\r\n }\r\n $str.= '</tr>';\r\n $str.= '</thead>';\r\n\t\t$str.= '<tbody>';\r\n\t\t$cnt = 0;\r\n $current_date = strtotime(date('M d,Y', mktime(0, 0, 0, date(\"m\") , date(\"d\") , date(\"Y\"))));\r\n\t\t$calender_start_date = date('M d,Y', mktime(0, 0, 0, date($month_num) , date($day) , date($year)));\r\n\t\t$calender_end_date = date('M d,Y', mktime(0, 0, 0, date($month_num) , date($days_in_month) , date($year)));\r\n\t\t$availbilties = $this->Html->checkCustomNightAvailability($calender_start_date, $calender_end_date, $item_id);\r\n\t\twhile ($day <= $days_in_month) {\r\n\t\t\t$cnt++;\r\n $str.= '<tr>';\r\n\t\t\tfor ($i = 0; $i < 7; $i++) {\r\n\t\t\t\t$calender_date = strtotime(date('M d,Y', mktime(0, 0, 0, date($month_num) , date($day) , date($year))));\r\n\t\t\t\t$calender_format_date = date('Y-m-d', mktime(0, 0, 0, date($month_num) , date($day) , date($year)));\r\n\t\t\t\t$available_class = '';\r\n\t\t\t\t$title = '';\r\n\t\t\t\t$data_id_attr = 0;\r\n\t\t\t\tif($current_date < $calender_date) {\r\n\t\t\t\t\tif (array_key_exists($calender_format_date, $availbilties)) {\r\n\t\t\t\t\t\t$is_avaliable = false;\r\n\t\t\t\t\t\tif(!empty($availbilties[$calender_format_date])) {\r\n\t\t\t\t\t\t\tforeach($availbilties[$calender_format_date] As $availability) {\r\n\t\t\t\t\t\t\t\t$avaialbility_class = 'js-select-day-calendar';\r\n\t\t\t\t\t\t\t\tif($availability['CustomPricePerNight']['is_available'] == 1) {\r\n\t\t\t\t\t\t\t\t\t$is_avaliable = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(isset($availability['is_custom_available'])){\r\n\t\t\t\t\t\t\t\t\t$avaialbility_class = 'js-select-custom-price-per-night';\r\n\t\t\t\t\t\t\t\t\t$data_id_attr = $availability['CustomPricePerNight']['id'];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($is_avaliable) {\r\n\t\t\t\t\t\t\t$available_class = $avaialbility_class.' cur';\r\n\t\t\t\t\t\t\t$style = 'border-left-color: rgb(151, 206, 104); border-bottom-color: rgb(151, 206, 104); color: rgb(255, 255, 255);'; // Available\r\n\t\t\t\t\t\t\t$title = 'title=' . __l(\"Available\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$style = 'border-left-color:#F38015;border-bottom-color:#F38015 ;color:#FFFFFF;'; // Not Available\r\n\t\t\t\t\t\t\t$title = 'title=' . __l(\"Sold\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$style = 'border-left-color:#FFFFFF;border-bottom-color:#FFFFFF;'; // Default\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$style = 'border-left-color:#FFFFFF;border-bottom-color:#FFFFFF;'; // Default\r\n\t\t\t\t}\r\n\t\t\t\tif (($first_day_in_month == $this->day_list[$i] || $day > 1) && ($day <= $days_in_month)) {\r\n\t\t\t\t\t$show_date = $year . \"-\" . $month_num . \"-\" . $day;\r\n\t\t\t\t\t$str.= '<td class=\"big-calendar dc\" id=\"cell-' . $day . '\">';\r\n\t\t\t\t\t$str .= '<span class=\"datepicker-days-block ' . $available_class . '\" data-item_id=\"' . $item_id . '\" data-date=\"' . $calender_format_date . '\" style=\"' . $style . '\" data-custom_id =\"'. $data_id_attr.'\"><span '. $title . '>' . $day . '</span></span>';\r\n\t\t\t\t\t$str.= '</td>';\r\n\t\t\t\t\t$day++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$str.= '<td class=\"big-calendar dc\">&nbsp;</td>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$str.= '</tr>';\r\n }\r\n\t\t$str.= '</tbody>';\r\n\t\t$str.= '</table>';\r\n $str.= '</div>';\r\n $str.= '</div>';\r\n $str.= '</div>';\r\n\t\t$str .= '<div class=\"space clearfix\"><div class=\"pull-right\"><span class=\"label label-success\"><span>&nbsp;&nbsp;</span></span>&nbsp;<span class=\"text-14\">' . __l('Available') . '</span><span class=\"left-mspace label label-warning\"><span>&nbsp;&nbsp;</span></span>&nbsp;<span class=\"text-14\">'. __l('Sold out') . '</span></div></div></div>';\r\n\t\t$str .= '<div class=\"js-bookit-calendar-list-block hide\">';\r\n\t\tif(!empty($availbilties)) {\r\n\t\t\tforeach($availbilties As $key => $availbilty) {\r\n\t\t\t\tif(!empty($availbilty)) {\r\n\t\t\t\t\t$str .= '<div class=\"js-cal-list-on js-calendar-list-on-'. $key .' hide\">';\r\n\t\t\t\t\t$str .= '<ul id=\"calander-block\" class=\"js-custom-night-block unstyled scheduled-list\">';\r\n\t\t\t\t\tforeach($availbilty As $custom_price_per_night) {\r\n\t\t\t\t\t\t$start_time = explode(':', $custom_price_per_night['CustomPricePerNight']['start_time']);\r\n\t\t\t\t\t\t$end_time = explode(':', $custom_price_per_night['CustomPricePerNight']['end_time']);\r\n\t\t\t\t\t\t$start_date = explode('-', $custom_price_per_night['CustomPricePerNight']['start_date']);\r\n\t\t\t\t\t\t$end_date = explode('-', $custom_price_per_night['CustomPricePerNight']['end_date']);\r\n\t\t\t\t\t\t$month = date('M', mktime(0, 0, 0, $start_date[1], $start_date[2], $start_date[0]));\r\n\t\t\t\t\t\t$day_char = date('D', mktime(0, 0, 0, $start_date[1], $start_date[2], $start_date[0]));\r\n\t\t\t\t\t\t$day_num = date('d', mktime(0, 0, 0, $start_date[1], $start_date[2], $start_date[0]));\r\n\t\t\t\t\t\tif(!empty($start_time[0])){\r\n\t\t\t\t\t\t\t$s_time = date('h:i A', mktime($start_time[0], $start_time[1], $start_time[2], 0, 0, 0));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!empty($end_time[0])){\r\n\t\t\t\t\t\t\t$e_time = date('h:i A', mktime($end_time[0], $end_time[1], $end_time[2], 0, 0, 0));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$str .= '<li class=\"space row no-mar sep-top sep-bot\">';\r\n\t\t\t\t\t\t$option_value = '';\r\n\t\t\t\t\t\t$option_value .= '<span class=\"img-rounded sep calendar-list hor-smspace pull-left graydarkc dc\">\r\n\t\t\t\t\t\t\t<span class=\"show well no-mar hor-space\">'. $month . '</span>\r\n\t\t\t\t\t\t\t<span class=\"show textb text-24\"> '. $day_num . ' </span>';\r\n\t\t\t\t\t\tif(!empty($custom_price_per_night['CustomPricePerNight']['total_available_count'])) { \r\n\t\t\t\t\t\t\t$total_booked_percentage = ($custom_price_per_night['CustomPricePerNight']['total_booked_count'] * 100) / $custom_price_per_night['CustomPricePerNight']['total_available_count'];\t\r\n\t\t\t\t\t\t\t$option_value .= '<span class=\"progress show\"> <span class=\"bar\" style=\"width: '. $total_booked_percentage .'%;\"></span> </span>';\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t$option_value .= '<span class=\"show sep-top\">' . $day_char . '</span>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t<span class=\"timing-details span no-mar clearfix\"> \r\n\t\t\t\t\t\t\t<span class=\"pull-left dl grayc text-11\"> \r\n\t\t\t\t\t\t\t\t<span class=\"show ver-smspace clearfix\">' . date('M j, Y', mktime(0, 0, 0, $start_date[1], $start_date[2], $start_date[0])) . ' ' . __l('to') . ' ' . date('M j, Y', mktime(0, 0, 0, $end_date[1], $end_date[2], $end_date[0])) .'</span>';\r\n\t\t\t\t\t\t\t\tif(isPluginEnabled('Seats') && !empty($custom_price_per_night['Hall']['name'])) { \r\n\t\t\t\t\t\t\t\t\t$option_value .='<span class=\"show ver-smspace\">';\r\n\t\t\t\t\t\t\t\t\t$option_value .= __l('Venue') . ': ' . $custom_price_per_night['Hall']['name'];\r\n\t\t\t\t\t\t\t\t\t$option_value .= '</span>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(!empty($s_time) || !empty($e_time)){\r\n\t\t\t\t\t\t\t\t\t$option_value .= '<span class=\"show ver-smspace clearfix\">';\r\n\t\t\t\t\t\t\t\t\tif(!empty($s_time)){\r\n\t\t\t\t\t\t\t\t\t\t$option_value .= $s_time;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif(!empty($s_time) && !empty($e_time)){\r\n\t\t\t\t\t\t\t\t\t\t$option_value .= ' - ';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif(!empty($e_time)){\r\n\t\t\t\t\t\t\t\t\t\t$option_value .= $e_time;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$option_value .= ' </span> ';\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t/*$option_value .= '<span class=\"show ver-smspace\">';\r\n\t\t\t\t\t\tif(!empty($custom_price_per_night['CustomPricePerNight']['total_available_count'])) { \r\n\t\t\t\t\t\t\t$option_value .= __l('Spots left') . ' ' . ($custom_price_per_night['CustomPricePerNight']['total_available_count'] - $custom_price_per_night['CustomPricePerNight']['total_booked_count']);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$option_value .= __l('Spots left Unlimited');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$option_value .= '</span> */\r\n\t\t\t\t\t\t$option_value .= '\t</span> \r\n\t\t\t\t\t\t\t<span class=\"pull-right ver-mspace ver-space dr\"> \r\n\t\t\t\t\t\t\t\t<span class=\"textb text-14\">';\r\n\t\t\t\t\t\tif(!empty($custom_price_per_night['CustomPricePerNight']['minimum_price'])) {\r\n\t\t\t\t\t\t\t$option_value .= $this->Html->siteCurrencyFormat($custom_price_per_night['CustomPricePerNight']['minimum_price']);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$option_value .= __l('Free');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$option_value .= '</span> \r\n\t\t\t\t\t\t\t</span> \r\n\t\t\t\t\t\t</span>';\r\n\t\t\t\t\t\tif(!empty($custom_price_per_night['CustomPricePerNight']['id'])) {\r\n\t\t\t\t\t\t\t$options = array($custom_price_per_night['CustomPricePerNight']['id'] => $option_value);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$options = array($custom_price_per_night['CustomPricePerNight']['parent_id'] .'-'. $key => $option_value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$str .= $this->Form->input('ItemUser.custom_price_per_night_id', array('id' => 'CustomPricePerNightId', 'legend' => false, 'label'=> true, 'type' => 'radio', 'options' => $options, 'hiddenField' => false, 'div' => 'input radio no-mar', 'class' => 'show ver-mspace js-select-custom-price-per-night'));\r\n\t\t\t\t\t\t$str .= '</ll>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$str .= '</ul>';\r\n\t\t\t\t\t$str .= '</div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$str .= '</div>';\r\n return $str;\r\n\t\t\r\n\t}", "function setInc(){\n\t\tif($this->period==\"monthly\")\n\t\t\t$this->inc=1;\n\t\tif($this->period==\"quarterly\")\n\t\t\t$this->inc=3;\n\t\treturn $this->from_year;\n\t}", "protected function computeDaysInMonth()\n {\n $this->daysInMonth = $this->month === 13 ? ($this->leapYear ? 6 : 5) : 30;\n }", "function checkdate($month, $day, $year)\n{\n return false;\n}", "function monthlength($year, $mon)\n\t{\n\t\t$l = 28;\n\t\twhile (checkdate($mon, $l+1, $year))\n\t\t{\n\t\t\t$l++;\n\t\t}\n\t\treturn $l;\n\t}", "function whole_months_diff($d1, $d2){\n\t$date1 = new DateTime($d1);\n\t$date2 = new DateTime($d2);\n\t$diff = $date1->diff($date2);\n\treturn (($diff->format('%y') * 12) + $diff->format('%m'));\n}", "function Leap_year(int $year) {\n if ($year <= 0) return;\n if ($year % 4 == 0) {\n if ($year % 100 > 0) return true;\n if ($year % 400 > 0) return;\n return true;\n }\n return;\n}", "function checkValidDate($d, $m, $y)\n{\n\tglobal $months , $monthLength;\n\tglobal $error;\n \n\t if($d > $monthLength[$m] )\n\t {\n\t\t \n\t\t if ($d == 29 and $m == 2 and checkLeapYear($y)){\n\t\t \t\t// Special case for leap years to use 29th Feb\n\t\t\t return true;\n\t\t }\n\t\t else\n\t\t {\n\t\t\t \n\t\t\t $message = 'Date is not valid';\n\t\t\t $error->addFlag($message);\n\t\t\t return false;\n\t\t \t}\n\t }\treturn true;\n}", "public function testGetYear()\n {\n $this->assertSame(2000, DateTime::createFromFormat('Y-m-d', '2000-01-01')->getYear());\n $this->assertSame(3000, DateTime::createFromFormat('Y-m-d', '3000-01-01')->getYear());\n }", "public function get_next_month($year, $month) {\n if ($month == 12) {\n return array(1, $year + 1);\n } else {\n return array($month + 1, $year);\n }\n }", "public function checkNotifyForEndOfMonth()\n {\n $hFunction = new \\Hfunction();\n $currentDay = $hFunction->currentDay();\n $totalDayInMonth = $hFunction->totalDayInMonth($hFunction->currentMonth(), $hFunction->currentYear());\n return (($totalDayInMonth - $currentDay) <= 3) ? true : false;\n }", "public function attribute_right_period_with_first_three_month() : void\n {\n // Etant donner que je suis connecter en tant que admin\n $user = User::factory()->create([\n 'created_at' => Carbon::createFromDate(Carbon::now()->year, 10, 1),\n ]);\n\n $this->assertDatabaseHas('history_users', [\n 'original_id' => $user->id,\n 'period' => Carbon::now()->year . '-' . (Carbon::now()->year + 1)\n ]);\n }", "function osc_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n }", "public function testHolidayBeforeYear(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::YEAR - 1)\n );\n }", "public function testHolidayAfterYear(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(self::YEAR + 1)\n );\n }" ]
[ "0.67345834", "0.66384786", "0.6528282", "0.6509791", "0.64754933", "0.6432649", "0.63654053", "0.62885773", "0.624339", "0.62025905", "0.6198101", "0.61834997", "0.6170893", "0.6158566", "0.6138721", "0.6074686", "0.6061783", "0.6054529", "0.6047847", "0.6028165", "0.6024933", "0.6024547", "0.60110897", "0.60085905", "0.6006968", "0.5977714", "0.59585524", "0.59487534", "0.5943598", "0.59359676", "0.59313923", "0.5920892", "0.59202605", "0.5913362", "0.5910057", "0.59020185", "0.58740824", "0.5872945", "0.586371", "0.58628047", "0.58621126", "0.58613396", "0.5860408", "0.5852872", "0.58483386", "0.5845085", "0.58346146", "0.5833578", "0.5812583", "0.5806158", "0.57941926", "0.5787902", "0.5780351", "0.5772481", "0.57701236", "0.5764446", "0.5758596", "0.5742744", "0.57327217", "0.57281375", "0.5714429", "0.5703962", "0.5695959", "0.56955767", "0.5683682", "0.56727296", "0.5671067", "0.56542975", "0.56470585", "0.56454307", "0.5645414", "0.56418085", "0.563655", "0.5635351", "0.5623457", "0.56209266", "0.5617977", "0.561477", "0.56101173", "0.5609595", "0.56041265", "0.560374", "0.5596526", "0.5591728", "0.55797714", "0.55655605", "0.5562573", "0.5553037", "0.5549601", "0.5548802", "0.55460495", "0.554508", "0.5544711", "0.5537779", "0.55303353", "0.5529656", "0.55250925", "0.55122924", "0.55052674", "0.5500365" ]
0.74693584
0
Test to get formatted month
Тест для получения отформатированного месяца
public function testGetFormattedMonth(): void { $month = 'February'; $this->dateTimeMock->shouldReceive('format') ->once() ->with('F') ->andReturn($month); $dayCalculatorService = new DateCalculatorService($this->dateTimeMock); $result = $dayCalculatorService->getFormattedMonth(); $this->assertEquals($month, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMonthName(): string;", "public function months($format = null);", "public function month()\n\t{\n\t\treturn static::$dateTime->format(\"n\");\n\t}", "function getMonthAsString($inLong = false) {\n\t\treturn ($inLong) ? $this->format('F') : $this->format('M');\n\t}", "public function is_month()\n {\n }", "function get_month_shortname($m=\"\") {\n \tif ($m==\"\") {\n \t\t$m = $this->mdate(\"m\");\n \t\t}\n\t\t$dt = \\DateTime::createFromFormat('!m', $m);\n\t\treturn $dt->format('M');\n \t}", "public function testGetMonthName()\n {\n $this->assertSame('January', DateTime::createFromFormat('Y-m-d', '2020-01-01')->getMonthName());\n $this->assertSame('February', DateTime::createFromFormat('Y-m-d', '2020-02-01')->getMonthName());\n $this->assertSame('March', DateTime::createFromFormat('Y-m-d', '2020-03-01')->getMonthName());\n $this->assertSame('April', DateTime::createFromFormat('Y-m-d', '2020-04-01')->getMonthName());\n $this->assertSame('May', DateTime::createFromFormat('Y-m-d', '2020-05-01')->getMonthName());\n $this->assertSame('June', DateTime::createFromFormat('Y-m-d', '2020-06-01')->getMonthName());\n $this->assertSame('July', DateTime::createFromFormat('Y-m-d', '2020-07-01')->getMonthName());\n $this->assertSame('August', DateTime::createFromFormat('Y-m-d', '2020-08-01')->getMonthName());\n $this->assertSame('September', DateTime::createFromFormat('Y-m-d', '2020-09-01')->getMonthName());\n $this->assertSame('October', DateTime::createFromFormat('Y-m-d', '2020-10-01')->getMonthName());\n $this->assertSame('November', DateTime::createFromFormat('Y-m-d', '2020-11-01')->getMonthName());\n $this->assertSame('December', DateTime::createFromFormat('Y-m-d', '2020-12-01')->getMonthName());\n }", "public function getMonths($format = 'Y-m');", "function pickmonth($month) {\n if ($month==\"01\") return \"Januari\";\n else if ($month==\"02\") return \"Februari\";\n else if ($month==\"03\") return \"Maret\";\n else if ($month==\"04\") return \"April\";\n else if ($month==\"05\") return \"Mei\";\n else if ($month==\"06\") return \"Juni\";\n else if ($month==\"07\") return \"Juli\";\n else if ($month==\"08\") return \"Agustus\";\n else if ($month==\"09\") return \"September\";\n else if ($month==\"10\") return \"Oktober\";\n else if ($month==\"11\") return \"November\";\n else if ($month==\"12\") return \"Desember\";\n }", "public function getMonth() : string\n {\n return date('m', $this->time);\n }", "public function testGetMonth()\n {\n $this->assertSame(1, DateTime::createFromFormat('Y-m-d', '2020-01-01')->getMonth());\n $this->assertSame(2, DateTime::createFromFormat('Y-m-d', '2020-02-01')->getMonth());\n $this->assertSame(3, DateTime::createFromFormat('Y-m-d', '2020-03-01')->getMonth());\n $this->assertSame(4, DateTime::createFromFormat('Y-m-d', '2020-04-01')->getMonth());\n $this->assertSame(5, DateTime::createFromFormat('Y-m-d', '2020-05-01')->getMonth());\n $this->assertSame(6, DateTime::createFromFormat('Y-m-d', '2020-06-01')->getMonth());\n $this->assertSame(7, DateTime::createFromFormat('Y-m-d', '2020-07-01')->getMonth());\n $this->assertSame(8, DateTime::createFromFormat('Y-m-d', '2020-08-01')->getMonth());\n $this->assertSame(9, DateTime::createFromFormat('Y-m-d', '2020-09-01')->getMonth());\n $this->assertSame(10, DateTime::createFromFormat('Y-m-d', '2020-10-01')->getMonth());\n $this->assertSame(11, DateTime::createFromFormat('Y-m-d', '2020-11-01')->getMonth());\n $this->assertSame(12, DateTime::createFromFormat('Y-m-d', '2020-12-01')->getMonth());\n }", "function getMonth() {\n\t\treturn $this->format('m');\n\t}", "function getMonth($month) {\n if($month==1) {\n $date=\"January\";\n }\n else if($month==2) {\n $date=\"February\";\n }\n else if($month==3) {\n $date=\"March\";\n }\n else if($month==4) {\n $date=\"April\";\n }\n else if($month==5) {\n $date=\"May\";\n }\n else if($month==6) {\n $date=\"June\";\n }\n else if($month==7) {\n $date=\"July\";\n }\n else if($month==8) {\n $date=\"August\";\n }\n else if($month==9) {\n $date=\"September\";\n }\n else if($month==10) {\n $date=\"October\";\n }\n else if($month==11) {\n $date=\"November\";\n }\n else if($month==12) {\n $date=\"December\";\n }\n else {\n $date=\"\";\n }\n return $date;\n }", "function getMonth($month) {\n if($month==1) {\n $date=\"January\";\n }\n else if($month==2) {\n $date=\"February\";\n }\n else if($month==3) {\n $date=\"March\";\n }\n else if($month==4) {\n $date=\"April\";\n }\n else if($month==5) {\n $date=\"May\";\n }\n else if($month==6) {\n $date=\"June\";\n }\n else if($month==7) {\n $date=\"July\";\n }\n else if($month==8) {\n $date=\"August\";\n }\n else if($month==9) {\n $date=\"September\";\n }\n else if($month==10) {\n $date=\"October\";\n }\n else if($month==11) {\n $date=\"November\";\n }\n else if($month==12) {\n $date=\"December\";\n }\n else {\n $date=\"\";\n }\n return $date;\n }", "function localize_month($month = '')\n\t{\n\t\t$months = array(\n\t\t\t'01' => array('Jan', 'January'),\n\t\t\t'02' => array('Feb', 'February'),\n\t\t\t'03' => array('Mar', 'March'),\n\t\t\t'04' => array('Apr', 'April'),\n\t\t\t'05' => array('May', 'May_l'),\n\t\t\t'06' => array('Jun', 'June'),\n\t\t\t'07' => array('Jul', 'July'),\n\t\t\t'08' => array('Aug', 'August'),\n\t\t\t'09' => array('Sep', 'September'),\n\t\t\t'10' => array('Oct', 'October'),\n\t\t\t'11' => array('Nov', 'November'),\n\t\t\t'12' => array('Dec', 'December')\n\t\t);\n\n\t\tif (isset($months[$month]))\n\t\t{\n\t\t\treturn $months[$month];\n\t\t}\n\t}", "public function monthName() {\n\t\t// note that the day name by itself will be translated\n\t\t// so no need to use our wrapper \"format\" method\n\t\treturn Factory::getText(parent::format('F'));\n\t}", "public function month($int = true) {\n\t\t$month = (int) parent::format('n');\n\t\treturn $int ? $month : str_pad($month, 2, '0', STR_PAD_LEFT);\n\t}", "function edd_paylane_sanitize_month( $month ) {\n if( strlen( $month ) == 1 ) {\n $month = '0' . $month;\n }\n\n return $month;\n}", "public function renderMonth($year, $month);", "function mes( $month ){\n\tif($month == \"Jan\")\n\t\treturn \"Enero\";\n\tif($month == \"Feb\")\n\t\treturn \"Febrero\";\n\tif($month == \"Mar\")\n\t\treturn \"Marzo\";\n\tif($month == \"Apr\")\n\t\treturn \"Abril\";\n\tif($month == \"May\")\n\t\treturn \"Mayo\";\n\tif($month == \"Jun\")\n\t\treturn \"Junio\";\n\tif($month == \"Jul\")\n\t\treturn \"Julio\";\n\tif($month == \"Aug\")\n\t\treturn \"Agosto\";\n\tif($month == \"Sep\")\n\t\treturn \"Septiembre\";\n\tif($month == \"Oct\")\n\t\treturn \"Octubre\";\n\tif($month == \"Nov\")\n\t\treturn \"Noviembre\";\n\tif($month == \"Dec\")\n\t\treturn \"Diciembre\";\n}", "public function get_month($month_number)\n {\n }", "public function getMonth()\n {\n return $this->format('n');\n }", "public function getMonth()\n {\n return isset($this->month) ? $this->month : '';\n }", "function get_month_longname($m=\"\") {\n \tif ($m==\"\") {\n \t\t$m = $this->mdate(\"m\");\n \t\t}\n\t\t$dt = \\DateTime::createFromFormat('!m', $m);\n\t\treturn $dt->format('F');\n \t}", "public function CheckMonth($month) {\n\n \t \tswitch ($month) {\n\t\t case 'January':\n\t\t $month = '01';\n\t\t break;\n\t\t case 'February':\n\t\t $month = '02';\n\t\t break;\n\t\t case 'March':\n\t\t $month = '03';\n\t\t break;\n\t\t case 'April':\n\t\t $month = '04';\n\t\t break;\n\t\t case 'May':\n\t\t $month = '05';\n\t\t break;\n\t\t case 'June':\n\t\t $month = '06';\n\t\t break;\n\t\t case 'July':\n\t\t $month = '07';\n\t\t break;\n\t\t case 'August':\n\t\t $month = '08';\n\t\t break;\n\t\t case 'September':\n\t\t $month = '09';\n\t\t break;\n\t\t case 'October':\n\t\t $month = '10';\n\t\t break;\n\t\t case 'November':\n\t\t $month = '11';\n\t\t break;\n\t\t case 'December':\n\t\t $month = '12';\n\t\t break;\n\t\t}\n\n\t\treturn $month;\n \t}", "function fine_get_month($month) {\r\n\t$month = (int)$month;\r\n\t\r\n\treturn fine_get_common_service(\"month.\".$month);\r\n}", "protected static function month()\n {\n return str_pad(Carbon::today()->month, 2, \"0\", STR_PAD_LEFT);\n }", "function is_month($month){\n\n\tif (preg_match('/^(?:J(anuary|u(ne|ly))|February|Ma(rch|y)|A(pril|ugust)|(((Sept|Nov|Dec)em)|Octo)ber)$/', $month ) ){\n\t\t\n\t\treturn true;\t\n\t}\n\telse{\n\t\n\t\treturn false;\n\t}\n}", "public function getMonth(): int;", "public function getMonth()\n {\n return str_pad($this->release_date->month, 2, '0', STR_PAD_LEFT);\n }", "function getMonth($value) {\n\tswitch ($value) {\n\t\tcase '1':\n\t\t\treturn \"Jan\";\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\treturn \"Feb\";\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\treturn \"Mar\";\n\t\t\tbreak;\t\n\t\tcase '4':\n\t\t\treturn \"Apr\";\n\t\t\tbreak;\n\t\tcase '5':\n\t\t\treturn \"May\";\n\t\t\tbreak;\n\t\tcase '6':\n\t\t\treturn \"Jun\";\n\t\t\tbreak;\n\t\tcase '7':\n\t\t\treturn \"Jul\";\n\t\t\tbreak;\n\t\tcase '8':\n\t\t\treturn \"Aug\";\n\t\t\tbreak;\n\t\tcase '9':\n\t\t\treturn \"Sep\";\n\t\t\tbreak;\t\n\t\tcase '10':\n\t\t\treturn \"Oct\";\n\t\t\tbreak;\n\t\tcase '11':\n\t\t\treturn \"Nov\";\n\t\t\tbreak;\n\t\tcase '12':\n\t\t\treturn \"Dec\";\n\t\t\tbreak;\t\n\t\tdefault:\n\t\t\treturn \"MthError\";\n\t\t\tbreak;\n\t}\n}", "protected function _month_string( $m ) {\n\t\t$ap_months = [\n\t\t\t'01' => 'Jan.',\n\t\t\t'02' => 'Feb.',\n\t\t\t'03' => 'March',\n\t\t\t'04' => 'April',\n\t\t\t'05' => 'May',\n\t\t\t'06' => 'June',\n\t\t\t'07' => 'July',\n\t\t\t'08' => 'Aug.',\n\t\t\t'09' => 'Sept.',\n\t\t\t'10' => 'Oct.',\n\t\t\t'11' => 'Nov.',\n\t\t\t'12' => 'Dec.',\n\t\t];\n\t\tif ( ! array_key_exists( $m, $ap_months ) ) {\n\t\t\t$m = '01';\n\t\t}\n\t\treturn $ap_months[ $m ];\n\t}", "function monthConvert($month){\n switch ($month){\n case 1:\n return \"Jan\";\n break;\n case 2:\n return \"Feb\";\n break;\n case 3:\n return \"Mar\";\n break;\n case 4:\n return \"Apr\";\n break;\n case 5:\n return \"May\";\n break;\n case 6:\n return \"Jun\";\n break;\n case 7:\n return \"Jul\";\n break;\n case 8:\n return \"Aug\";\n break;\n case 9:\n return \"Sep\";\n break;\n case 10:\n return \"Oct\";\n break;\n case 11:\n return \"Nov\";\n break;\n case 12:\n return \"Dec\";\n break;\n default:\n }\n}", "public function testGetMonthShortName()\n {\n $this->assertSame('Jan', DateTime::createFromFormat('Y-m-d', '2020-01-01')->getMonthShortName());\n $this->assertSame('Feb', DateTime::createFromFormat('Y-m-d', '2020-02-01')->getMonthShortName());\n $this->assertSame('Mar', DateTime::createFromFormat('Y-m-d', '2020-03-01')->getMonthShortName());\n $this->assertSame('Apr', DateTime::createFromFormat('Y-m-d', '2020-04-01')->getMonthShortName());\n $this->assertSame('May', DateTime::createFromFormat('Y-m-d', '2020-05-01')->getMonthShortName());\n $this->assertSame('Jun', DateTime::createFromFormat('Y-m-d', '2020-06-01')->getMonthShortName());\n $this->assertSame('Jul', DateTime::createFromFormat('Y-m-d', '2020-07-01')->getMonthShortName());\n $this->assertSame('Aug', DateTime::createFromFormat('Y-m-d', '2020-08-01')->getMonthShortName());\n $this->assertSame('Sep', DateTime::createFromFormat('Y-m-d', '2020-09-01')->getMonthShortName());\n $this->assertSame('Oct', DateTime::createFromFormat('Y-m-d', '2020-10-01')->getMonthShortName());\n $this->assertSame('Nov', DateTime::createFromFormat('Y-m-d', '2020-11-01')->getMonthShortName());\n $this->assertSame('Dec', DateTime::createFromFormat('Y-m-d', '2020-12-01')->getMonthShortName());\n }", "public function get_fullmonth($month){\n $dateObj = DateTime::createFromFormat('!m', $month);\n return $monthName = $dateObj->format('F');\n }", "public function testMonthTitle()\n {\n $month = new Month(new Year(2013), 3);\n\n $expected = '<thead>';\n $expected .= '<tr>';\n $expected .= '<th colspan=\"7\" class=\"bm-calendar-month-title\">March</th>';\n $expected .= '</tr><tr>';\n $expected .= '<th>Mon</th>';\n $expected .= '<th>Tue</th>';\n $expected .= '<th>Wed</th>';\n $expected .= '<th>Thu</th>';\n $expected .= '<th>Fri</th>';\n $expected .= '<th class=\"bm-calendar-weekend\">Sat</th>';\n $expected .= '<th class=\"bm-calendar-weekend\">Sun</th>';\n $expected .= '</tr>';\n $expected .= '</thead>';\n\n $this->assertEquals($expected, $this->renderer->monthTitle($month));\n }", "public function get_month_permastruct()\n {\n }", "static public function mes() {\r\n\t\treturn date ( \"m\" );\r\n\t}", "function getMonth($bln){\n switch ($bln){\n case 1: \n return \"Januari\";\n break;\n case 2:\n return \"Februari\";\n break;\n case 3:\n return \"Maret\";\n break;\n case 4:\n return \"April\";\n break;\n case 5:\n return \"Mei\";\n break;\n case 6:\n return \"Juni\";\n break;\n case 7:\n return \"Juli\";\n break;\n case 8:\n return \"Agustus\";\n break;\n case 9:\n return \"September\";\n break;\n case 10:\n return \"Oktober\";\n break;\n case 11:\n return \"November\";\n break;\n case 12:\n return \"Desember\";\n break;\n }\n}", "function formatDateMonth($dataSet, $i , $month){\n $yearAdd = explode('-',$dataSet[$i][\"date\"])[0];\n $oneMonthBefore = explode('-',$dataSet[$i][\"date\"])[1]-1;\n $monthAdd = formatDateMonthMoreNine($oneMonthBefore, $dataSet, $i, 1);\n if ($month == \"twoMonths\"){\n $twoMonthBefore= explode('-',$dataSet[$i][\"date\"])[1]-2;\n $twoMonthBefore = formatDateMonthMoreNine($twoMonthBefore, $dataSet, $i, 2);\n if ( $twoMonthBefore == 11)//si on est revenue en arrière on enlève une année\n $yearAdd --;\n\n $date = $yearAdd.\"-\".$twoMonthBefore.\"/\".$monthAdd;\n }\n if ($month==\"oneMonth\"){\n if (explode('-',$dataSet[$i][\"date\"])[1]-1== \"00\")\n $yearAdd--;\n $date = $yearAdd.\"-\".$monthAdd;\n }\n\n return $date;\n}", "public function month($date);", "public function getTwoDigitMonth(): string\n {\n return str_pad($this->month, 2, '0', STR_PAD_LEFT);\n }", "function dtlMonthName($month, $languageCode = '') {\n // * if $languageCode not specified then default language code is used\n // * returns false if invalid language code or month number\n if ($month < 1 || $month > 12) {\n return false;\n }\n dtlNormalizeLanguageCode($languageCode);\n if (!dtlIsSupportedLanguage($languageCode)) {\n return false;\n }\n\n global $dtlLanguages;\n return $dtlLanguages[$languageCode]['monthNames'][$month];\n}", "function numberToStringMonth($month){\n\t\t$result = \"\";\n\t\tswitch ($month) {\n\t\t\tcase '1':\n\t\t\t$result = 'January';\n\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t$result = 'February';\n\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t$result = 'March';\n\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t$result = 'April';\n\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t$result = 'May';\n\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t$result = 'June';\n\t\t\tbreak;\n\t\t\tcase '7':\n\t\t\t$result = 'July';\n\t\t\tbreak;\n\t\t\tcase '8':\n\t\t\t$result = 'August';\n\t\t\tbreak;\n\t\t\tcase '9':\n\t\t\t$result = 'September';\n\t\t\tbreak;\n\t\t\tcase '10':\n\t\t\t$result = 'October';\n\t\t\tbreak;\n\t\t\tcase '11':\n\t\t\t$result = 'November';\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t$result = 'December';\n\t\t\tbreak;\n\t\t}\n\t\treturn $result;\n\t}", "public function get_month()\n {\n return $this->month;\n }", "public function getPostMonth(): string\n {\n return $this->createdTime->format('F');\n }", "function alpha_month($month='')\n{\n if(!$month) return false;\n #switch numeric to full month\n switch($month):\n case 1:\n return 'January';\n break;\n case 2:\n return 'February';\n break;\n case 3:\n return 'March';\n break;\n case 4:\n return 'April';\n break;\n case 5:\n return 'May';\n break;\n case 6:\n return 'June';\n break;\n case 7:\n return 'July';\n break;\n case 8:\n return 'August';\n break;\n case 9:\n return 'September';\n break;\n case 10:\n return 'October';\n break;\n case 11:\n return 'November';\n break;\n case 12:\n return 'December';\n break;\n endswitch;\n}", "function get_eventon_cal_title_month($month_number, $year_number){\r\n\t\r\n\t$evopt = get_option('evcal_options_evcal_1');\r\n\t\r\n\t$string = ($evopt['evcal_header_format']!='')?$evopt['evcal_header_format']:'m, Y';\r\n\r\n\t$str = str_split($string, 1);\r\n\t$new_str = '';\r\n\t\r\n\t\r\n\t\r\n\tforeach($str as $st){\r\n\t\tswitch($st){\r\n\t\t\tcase 'm':\r\n\t\t\t\t$new_str.= eventon_returnmonth_name_by_num($month_number);\r\n\t\t\tbreak;\r\n\t\t\tcase 'Y':\r\n\t\t\t\t$new_str.= $year_number;\r\n\t\t\tbreak;\r\n\t\t\tcase 'y':\r\n\t\t\t\t$new_str.= substr($year_number, -2);\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$new_str.= $st;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $new_str;\r\n}", "public function getMonth()\n {\n return floor($this->convertToDateElement(Phpr_DateTime::elementMonth));\n }", "function getMonthAbrv( $month_number ) {\n switch( $month_number ) {\n case '01':\n $ret = _(\"Jan\");\n break;\n case '02':\n $ret = _(\"Feb\");\n break;\n case '03':\n $ret = _(\"Mar\");\n break;\n case '04':\n $ret = _(\"Apr\");\n break;\n case '05':\n $ret = _(\"Ma&#121;\");\n break;\n case '06':\n $ret = _(\"Jun\");\n break;\n case '07':\n $ret = _(\"Jul\");\n break;\n case '08':\n $ret = _(\"Aug\");\n break;\n case '09':\n $ret = _(\"Sep\");\n break;\n case '10':\n $ret = _(\"Oct\");\n break;\n case '11':\n $ret = _(\"Nov\");\n break;\n case '12':\n $ret = _(\"Dec\");\n break;\n default:\n $ret = '';\n }\n return( $ret );\n}", "public static function getMonth() {\n $date = self::toJalali();\n return $date['month'];\n }", "function num_to_month($monthNum){\n $dateObj = DateTime::createFromFormat('!m', $monthNum);\n return $dateObj->format('F'); // March\n\t}", "private function _get_english_month($m)\n {\n $eMonth = false;\n switch ($m) {\n case 1:\n $eMonth = 'January';\n break;\n case 2:\n $eMonth = 'February';\n break;\n case 3:\n $eMonth = 'March';\n break;\n case 4:\n $eMonth = 'April';\n break;\n case 5:\n $eMonth = 'May';\n break;\n case 6:\n $eMonth = 'June';\n break;\n case 7:\n $eMonth = 'July';\n break;\n case 8:\n $eMonth = 'August';\n break;\n case 9:\n $eMonth = 'September';\n break;\n case 10:\n $eMonth = 'October';\n break;\n case 11:\n $eMonth = 'November';\n break;\n case 12:\n $eMonth = 'December';\n }\n\n return $eMonth;\n }", "public function getMonth($time)\r\n {\r\n return __(date('F', $time));\r\n }", "public function getTwoDigitMonth()\n {\n return str_pad($this->month, 2, '0', STR_PAD_LEFT);\n }", "public function splitByMonth();", "public function monthText($abbrev = true) {\n\t\t$abbrev = ($abbrev) ? 'M' : 'F';\n\n\t\treturn $this->formatted($abbrev);\n\t}", "function month_from_date($date) {\n\t\t$date = explode(\"-\", $date);\n\t\t$month = $date[1];\n\t\t\n\t\t$string = '';\n\t\tswitch($month) {\n\t\t\tcase 01: $string = \"January\"; \tbreak;\n\t\t\tcase 02: $string = \"February\"; \tbreak;\n\t\t\tcase 03: $string = \"March\"; \t\tbreak;\n\t\t\tcase 04: $string = \"April\";\t\t break;\n\t\t\tcase 05: $string = \"May\"; \t\t\tbreak;\n\t\t\tcase 06: $string = \"June\"; \t\t\tbreak;\n\t\t\tcase 07: $string = \"July\"; \t\t\tbreak;\n\t\t\tcase 8: $string = \"August\";\t \tbreak;\n\t\t\tcase 9: $string = \"September\"; break;\n\t\t\tcase 10: $string = \"October\"; \tbreak; \n\t\t\tcase 11: $string = \"November\"; \tbreak;\n\t\t\tcase 12: $string = \"December\"; \tbreak;\n\t\t\tdefault: $string = \"\"; \t\t\t\t\tbreak;\n\t\t}\n\n\t\treturn ($string != '') ? $string : false;\n\t}", "function smarty_modifier_monthname($month = 1)\n{\n\t\tswitch ($month) {\n\t\t case \"1\":\n\t\t return(\"Январь\");\n\t\t break;\n\t\t case \"2\":\n\t\t return(\"Февраль\");\n\t\t break;\n\t\t case \"3\":\n\t\t return(\"Март\");\n\t\t break;\n\t\t case \"4\":\n\t\t return(\"Апрель\");\n\t\t break;\n\t\t case \"5\":\n\t\t return(\"Май\");\n\t\t break;\n\t\t case \"6\":\n\t\t return(\"Июнь\");\n\t\t break;\n\t\t case \"7\":\n\t\t return(\"Июль\");\n\t\t break;\n\t\t case \"8\":\n\t\t return(\"Август\");\n\t\t break;\n\t\t case \"9\":\n\t\t return(\"Сентябрь\");\n\t\t break;\n\t\t case \"10\":\n\t\t return(\"Октябрь\");\n\t\t break;\n\t\t case \"11\":\n\t\t return(\"Ноябрь\");\n\t\t break;\n\t\t case \"12\":\n\t\t return(\"Декабрь\");\n\t\t break;\n\t\t}\n}", "public static function checkValidMonth($month) {\r\n if (is_numeric($month)) {\r\n $month = $month+0; // convert it to numeric variable\r\n if (is_int($month)) { // make sure its not a float\r\n if ($month < 1 or $month > 12) {// make sure it is not out of range\r\n $month='';\r\n }\r\n } else {\r\n $month='';\r\n }\r\n } else {\r\n $month='';\r\n }\r\n // here it is either an empty string or a number between 1-12\r\n $month=$month.''; // make sure it ends up as a string\r\n return $month;\r\n }", "function testDatePrintsAll12Months() {\n\t\t//arrange\n\t\tglobal $wp_locale;\n\t\t$term = new \\StdClass;\n\t\t$term->name = '';\n\t\t$HTML = $this->getMockBuilder( '\\CFPB\\Utils\\MetaBox\\HTML' )\n\t\t\t\t\t ->setMethods( null )\n\t\t\t\t\t ->getMock();\n\t\t$wp_locale->expects( $this->exactly( 12 ) )\n\t\t\t\t ->method( 'get_month' )\n\t\t\t\t ->will( $this->returnValue( 'month' ) );\n\t\t\\WP_Mock::wpPassthruFunction( 'esc_attr' );\n\t\t\\WP_Mock::wpFunction( 'has_term', array( 'return' => true ) );\n\t\t\\WP_Mock::wpFunction( 'get_the_terms', array( 'return' => array( $term ) ) );\n\t\t$needle = '<option value=\"month\">month</option><option value=\"month\">month</option>';\n\t\t$needle .= '<option value=\"month\">month</option><option value=\"month\">month</option>';\n\t\t$needle .= '<option value=\"month\">month</option><option value=\"month\">month</option>';\n\t\t$needle .= '<option value=\"month\">month</option><option value=\"month\">month</option>';\n\t\t$needle .= '<option value=\"month\">month</option><option value=\"month\">month</option>';\n\t\t$needle .= '<option value=\"month\">month</option><option value=\"month\">month</option></select>';\n\n\t\t//act\n\t\tob_start();\n\t\t$HTML->date( 'tax', false ,false, '', 12 );\n\t\t$haystack = ob_get_flush();\n\n\t\t//assert\n\t\t$this->assertContains( $needle, $haystack );\n\t}", "function monthname($num) {\n\tswitch ($num) {\n\tcase \"01\":\n\t $month = \"January\";\n\t break;\n\tcase \"02\":\n\t $month = \"February\";\n\t break;\n\tcase \"03\":\n\t $month = \"March\";\n\t break;\n\tcase \"04\":\n\t $month = \"April\";\n\t break;\n\tcase \"05\":\n\t $month = \"May\";\n\t break;\n\tcase \"06\":\n\t $month = \"June\";\n\t break;\n\tcase \"07\":\n\t $month = \"July\";\n\t break;\n\tcase \"08\":\t\t\t\t//so weird!!!\n\t $month = \"August\";\n\t break;\n\tcase \"09\":\n\t $month = \"September\";\n\t break;\n\tcase \"10\":\n\t $month = \"October\";\n\t break;\n\tcase \"11\":\n\t $month = \"November\";\n\t break;\n\tcase \"12\":\n\t $month = \"December\";\n\t break;\n\t}\n\treturn $month;\n}", "public function month() \r\n {\r\n return $this->month;\r\n }", "function spell_month($tgl,$bln,$thn){\n\t\tif($bln==01){$nama=\"Januari\";}\n\t\telse if($bln==02){$nama=\"Februari\";}\n\t\telse if($bln==03){$nama=\"Maret\";}\n\t\telse if($bln==04){$nama=\"April\";}\n\t\telse if($bln==05){$nama=\"Mei\";}\n\t\telse if($bln==06){$nama=\"Juni\";}\n\t\telse if($bln==07){$nama=\"Juli\";}\n\t\telse if($bln==08){$nama=\"Agustus\";}\n\t\telse if($bln==09){$nama=\"September\";}\n\t\telse if($bln==10){$nama=\"Oktober\";}\n\t\telse if($bln==11){$nama=\"November\";}\n\t\telse if($bln==12){$nama=\"Desember\";}\n\t\techo $tgl.\" \".$nama.\" \".$thn;\n\t}", "public function getMonth()\r\n {\r\n return $this->month;\r\n }", "function getMonthName($var=false)\n\t{\n\t\tif (!$var) {\n\t\t\t$var=@$this->actmonth;\n\t\t}\n\t\tif ($this->monthNames) {\n\t\t\treturn $this->monthNames[$var-1];\n\t\t}\n\t\tswitch($var) {\n\t\t\tcase 1: return $this->jan;\n\t\t\tcase 2: return $this->feb;\n\t\t\tcase 3: return $this->mar;\n\t\t\tcase 4: return $this->apr;\n\t\t\tcase 5: return $this->may;\n\t\t\tcase 6: return $this->jun;\n\t\t\tcase 7: return $this->jul;\n\t\t\tcase 8: return $this->aug;\n\t\t\tcase 9: return $this->sep;\n\t\t\tcase 10: return $this->oct;\n\t\t\tcase 11: return $this->nov;\n\t\t\tcase 12: return $this->dec;\n\t\t}\n\t}", "function getMonthName($month = 1)\r\n {\r\n $month = $month - 1;\r\n if (empty($this->_lang_months)) $this->setLanguage();\r\n\r\n switch ($month) {\r\n case 0:\r\n return $this->_lang_months['january'];\r\n break;\r\n case 1:\r\n return $this->_lang_months['february'];\r\n break;\r\n case 2:\r\n return $this->_lang_months['march'];\r\n break;\r\n case 3:\r\n return $this->_lang_months['april'];\r\n break;\r\n case 4:\r\n return $this->_lang_months['may'];\r\n break;\r\n case 5:\r\n return $this->_lang_months['june'];\r\n break;\r\n case 6:\r\n return $this->_lang_months['july'];\r\n break;\r\n case 7:\r\n return $this->_lang_months['august'];\r\n break;\r\n case 8:\r\n return $this->_lang_months['september'];\r\n break;\r\n case 9:\r\n return $this->_lang_months['october'];\r\n break;\r\n case 10:\r\n return $this->_lang_months['november'];\r\n break;\r\n case 11:\r\n return $this->_lang_months['december'];\r\n break;\r\n default:\r\n return 0;\r\n break;\r\n }\r\n }", "function monthNames($month, $short = false){\n // day names\n $monthName = '';\n switch ($month){\n case 1:$monthName = \"januar\"; break;\n case 2:$monthName = \"februar\"; break;\n case 3:$monthName = \"marec\"; break;\n case 4:$monthName = \"april\"; break;\n case 5:$monthName = \"maj\"; break;\n case 6:$monthName = \"junij\"; break;\n case 7:$monthName = \"julij\"; break;\n case 8:$monthName = \"avgust\"; break;\n case 9:$monthName = \"september\"; break;\n case 10:$monthName = \"oktober\"; break;\n case 11:$monthName = \"november\"; break;\n case 12:$monthName = \"december\"; break;\n }\n if ($short) $monthName = mb_substr($monthName, 0, 3, \"UTF-8\");\n return $monthName;\n}", "function dtlCurrentMonth() {\n return date('m');\n}", "function getMonthName( $month_number ) {\n switch( $month_number ) {\n case '01':\n $ret = _(\"January\");\n break;\n case '02':\n $ret = _(\"February\");\n break;\n case '03':\n $ret = _(\"March\");\n break;\n case '04':\n $ret = _(\"April\");\n break;\n case '05':\n $ret = _(\"May\");\n break;\n case '06':\n $ret = _(\"June\");\n break;\n case '07':\n $ret = _(\"July\");\n break;\n case '08':\n $ret = _(\"August\");\n break;\n case '09':\n $ret = _(\"September\");\n break;\n case '10':\n $ret = _(\"October\");\n break;\n case '11':\n $ret = _(\"November\");\n break;\n case '12':\n $ret = _(\"December\");\n break;\n default:\n $ret = '';\n }\n return( $ret );\n}", "function getMonth() {\n return $this->month;\n }", "public function getMonth($time)\n {\n return __(date('F', $time));\n }", "function MonthName($intMonth, $flag) {\n\t\n\t$arShortMonth = array (1 => \"Jan\", 2 => \"Feb\", 3 => \"Mar\", 4 => \"Apr\", 5 => \"May\", 6 => \"Jun\", 7 => \"Jul\", 8 => \"Aug\", 9 => \"Sep\", 10 => \"Oct\", 11 => \"Nov\", 12 => \"Dec\" );\n\t$arLongMonth = array (1 => \"January\", 2 => \"February\", 3 => \"March\", 4 => \"April\", 5 => \"May\", 6 => \"June\", 7 => \"July\", 8 => \"August\", 9 => \"September\", 10 => \"October\", 11 => \"November\", 12 => \"December\" );\n\t\n\tif ($intMonth < 1 || $intMonth > 12)\n\t\t$intMonth = 1;\n\t\n\tif ($flag)\n\t\treturn $arShortMonth [$intMonth];\n\telse\n\t\treturn $arLongMonth [$intMonth];\n}", "public function month($bulan){\n\t\tswitch($bulan){\n\t\t\tcase 1:\n\t\t\techo \"Januari\";\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\techo \"Februari\";\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\techo \"Maret\";\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\techo \"April\";\n\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\techo \"Mei\";\n\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\techo \"Juni\";\n\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\techo \"Juli\";\n\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\techo \"Agustus\";\n\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\techo \"September\";\n\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\techo \"Oktober\";\n\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\techo \"November\";\n\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\techo \"Desember\";\n\t\t\tbreak;\n\t\t}\n\t}", "function numtomonth($nmonth)\n\t {\n\t if($nmonth==1){\n\t return \"January\";\n\t }elseif ($nmonth==2) {\n\t return \"February\";\n\t }elseif ($nmonth==3) {\n\t return \"March\";\n\t }elseif ($nmonth==4) {\n\t return \"April\";\n\t }elseif ($nmonth==5) {\n\t return \"May\";\n\t }elseif ($nmonth==6) {\n\t return \"Jun\";\n\t }elseif ($nmonth==7) {\n\t return \"July\";\n\t }elseif ($nmonth==8) {\n\t return \"August\";\n\t }elseif ($nmonth==9) {\n\t return \"September\";\n\t }elseif ($nmonth==10) {\n\t return \"October\";\n\t }elseif ($nmonth==11) {\n\t return \"November\";\n\t }elseif ($nmonth==12) {\n\t return \"December\";\n\t }else\n\t {\n\t $nmonth=$nmonth-12;\n\t return numtomonth($nmonth);\n\t }\n\t }", "function month_name($month_number)\n{\n return date('F', mktime(0, 0, 0, $month_number, 10));\n}", "function getMonthIndonesia($param){\n switch ($param){\n case 1: \n return \"Januari\";\n break;\n\n case 2:\n return \"Febuari\";\n break;\n\n case 3:\n return \"Maret\";\n break;\n\n case 4:\n return \"April\";\n break;\n\n case 5:\n return \"Mei\";\n break;\n\n case 6:\n return \"Juni\";\n break;\n\n case 7:\n return \"Juli\";\n break;\n\n case 8:\n return \"Agustus\";\n break;\n\n case 9:\n return \"September\";\n break;\n\n case 10:\n return \"Oktober\";\n break;\n\n case 11:\n return \"November\";\n break;\n\n case 12:\n return \"Desember\";\n break;\n }\n }", "public function monthConverter(){\n\t\t$month = array(\n\t\t\t'00'=>'asd', '01'=>'Januari','02'=>'Februari','03'=>'Maret','04'=>'April','05'=>'Mei',\n\t\t\t'06'=>'Juni','07'=>'Juli','08'=>'Agustus','09'=>'September','10'=>'Oktober',\n\t\t\t'11'=>'November','12'=>'Desember',\n\t\t);\n\t\treturn $month;\n\t}", "public function gMonth($fecha){\r\n\t\t$date = DateTime::createFromFormat(\"Y-m-d\", $fecha);\r\n\t\treturn $date->format(\"m\");\r\n\t}", "function month($int) {\n\t\t$month = array(\n \t\" \", \n \t\"January\", \n \t\"February\", \n \t\"March\", \n \t\"April\", \n \t\"May\", \n \t\"June\", \n \t\"July\", \n \t\"August\", \n \t\"September\", \n \t\"October\", \n \t\"November\", \n \t\"December\"\n );\n\n $result = $month[$int];\n return $result;\n\t}", "public function get_month_abbrev($month_name)\n {\n }", "public static function formatMonth( $date, $declension = false )\n\t{\n\t\t$replace = array();\n\t\tforeach ( self::$months as $source => $target )\n\t\t{\n\t\t\t$replace[ $source ] = $target[ $declension ? 1 : 0 ];\n\t\t}\n\t\treturn strtr( $date, $replace );\n\t}", "public function monthShortName() {\n\t\treturn $this->format('M');\n\t}", "public function month_num($leading = true) {\n\t\t$leading = ($leading) ? 'm' : 'n';\n\n\t\treturn $this->formatted($leading);\n\t}", "public function getMonth()\n {\n return $this->month;\n }", "public function getMonth()\n {\n return $this->month;\n }", "function mkMonthTitle()\n\t{\n\t\tif (!$this->monthNav) {\n\t\t\t$out = toba::output()->get('Calendario')->getMonthTitle($this->cssMonthTitle, 8, $this->getMonthName().$this->monthYearDivider.$this->actyear);\n\t\t} else {\n\t\t\t$contenido1 = '';\n\t\t\tif ($this->actmonth==1) {\n\t\t\t\t$contenido1 .= $this->mkUrl($this->actyear-1,'12');\n\t\t\t} else {\n\t\t\t\t$contenido1 .= $this->mkUrl($this->actyear,$this->actmonth-1);\n\t\t\t}\n\t\t\t$contenido1 .= $this->monthNavBack.'</a>';\n\t\t\t$out = toba::output()->get('Calendario')->getMonthSquare($this->cssMonthNav, 2 , $contenido1);\n\t\t\t$out .= toba::output()->get('Calendario')->getMonthSquare($this->cssMonthTitle, 3, $this->getMonthName().$this->monthYearDivider.$this->actyear);\n\t\t\t\n\t\t\t$contenido = '';\n\t\t\tif ($this->actmonth==12) {\n\t\t\t\t$contenido .= $this->mkUrl($this->actyear+1,'1');\n\t\t\t} else {\n\t\t\t\t$contenido .= $this->mkUrl($this->actyear,$this->actmonth+1);\n\t\t\t}\n\t\t\t$contenido .= $this->monthNavForw.'</a>';\t\t\t\n\t\t\t$out .= toba::output()->get('Calendario')->getMonthSquare($this->cssMonthNav, 2, $contenido);\n\t\t\t\n\t\t\t$out = toba::output()->get('Calendario')->getFila($out);\n\t\t}\n\t\treturn $out;\n\t}", "function testDateCallsGetMonth12Times() {\n\t\t//arrange\n\t\tglobal $wp_locale;\n\t\t$term = new \\StdClass;\n\t\t$term->name = '';\n\t\t$HTML = $this->getMockBuilder( '\\CFPB\\Utils\\MetaBox\\HTML' )\n\t\t\t\t\t ->setMethods( null )\n\t\t\t\t\t ->getMock();\n\t\t$wp_locale->expects( $this->exactly( 12 ) )\n\t\t\t\t ->method( 'get_month' )\n\t\t\t\t ->will( $this->returnValue( 'month' ) );\n\t\t\\WP_Mock::wpPassthruFunction( 'esc_attr' );\n\t\t\\WP_Mock::wpFunction( 'has_term', array( 'return' => true ) );\n\t\t\\WP_Mock::wpFunction( 'get_the_terms', array( 'return' => array( $term ) ) );\n\n\t\t//act\n\t\t$HTML->date( 'tax', false ,false, '' );\n\n\t\t//assert\n\t\t// passes when get month is called 12 times\n\t}", "public function formatMonth(TaskInterface $task);", "public function testGetMonth(): void\n {\n $model = Time::load([\n \"month\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getMonth());\n }", "public function monthname($month) {\n\n if ($month == \"01\")\n return \"&#1601;&#1585;&#1608;&#1585;&#1583;&#1610;&#1606;\";\n\n if ($month == \"02\")\n return \"&#1575;&#1585;&#1583;&#1610;&#1576;&#1607;&#1588;&#1578;\";\n\n if ($month == \"03\")\n return \"&#1582;&#1585;&#1583;&#1575;&#1583;\";\n\n if ($month == \"04\")\n return \"&#1578;&#1610;&#1585;\";\n\n if ($month == \"05\")\n return \"&#1605;&#1585;&#1583;&#1575;&#1583;\";\n\n if ($month == \"06\")\n return \"&#1588;&#1607;&#1585;&#1610;&#1608;&#1585;\";\n\n if ($month == \"07\")\n return \"&#1605;&#1607;&#1585;\";\n\n if ($month == \"08\")\n return \"&#1570;&#1576;&#1575;&#1606;\";\n\n if ($month == \"09\")\n return \"&#1570;&#1584;&#1585;\";\n\n if ($month == \"10\")\n return \"&#1583;&#1610;\";\n\n if ($month == \"11\")\n return \"&#1576;&#1607;&#1605;&#1606;\";\n\n if ($month == \"12\")\n return \"&#1575;&#1587;&#1601;&#1606;&#1583;\";\n }", "function dtlAbbrevMonthName($month, $languageCode = '', $nChars = 3) {\n // * returns false if invalid language code or month number or if $nChars not +ve\n if (!dtlIsInt($month) || $month < 0 || $month > 12 || !dtlIsInt($nChars) || $nChars <= 0) {\n return false;\n }\n dtlNormalizeLanguageCode($languageCode);\n if (!dtlIsSupportedLanguage($languageCode)) {\n return false;\n }\n\n global $dtlLanguages;\n $abbrevMonthNames = isset($dtlLanguages[$languageCode]['abbrevMonthNames'])\n ? $dtlLanguages[$languageCode]['abbrevMonthNames'] : null;\n if (!isset($abbrevMonthNames)) {\n return dtlAbbrev(dtlMonthName($month, $languageCode), $nChars);\n }\n else {\n if (is_int($abbrevMonthNames)) {\n return dtlAbbrev(dtlMonthName($month, $languageCode), $abbrevMonthNames);\n }\n else {\n if (is_array($abbrevMonthNames)) {\n return $abbrevMonthNames[$month];\n }\n }\n }\n return false;\n}", "public function monthName() {\n\t\treturn self::$names['month'][$this->DateArray['n']-1];\n\t}", "function out_months() {\n return qw('January February March April May June July August September October November December');\n}", "private function getMonthName($month){\n switch ($month){\n case '1':\n return 'Janvier';\n case '2':\n return 'Fevrier';\n case '3':\n return 'Mars';\n case '4':\n return 'Avril';\n case '5':\n return 'Mai';\n case '6':\n return 'Juin';\n case '7':\n return 'Juillet';\n case '8':\n return 'Aout';\n case '9':\n return 'Septembre';\n case '10':\n return 'Octobre';\n case '11':\n return 'Novembre';\n case '12':\n return 'Décembre';\n }\n return Null;\n }", "function getMonthName($monthIndex, $current_language='en')\n{\n\t#$current_language = get_current_language();\n\n\t\tif( $current_language == 'en') {\n\t\t\t\t$dateTime = new I18N_DateTime( 'en_GB' );\n\t\t}\n\t\telse if( $current_language == 'fr') {\n\t\t\t\t$dateTime = new I18N_DateTime( 'fr_FR' );\n\t\t}\n\n\t\t$myFormat = $dateTime->setFormat('F');\n\n\t\t$strTime = mktime(0,0,0,$monthIndex);\n\t\t$month_name = $dateTime->format($strTime);\n\n\t\t#return utf8_encode($month_name);\n\t\treturn $month_name;\n}", "public function changemonth()\n\t{\n// \t\techo date(\"Y\")+543;\n\n\t\t$str_month = date(\"m\");\n\t\t$str_year = intval(date(\"Y\")+543);\n\t\t$thaimonth=array('01'=>\"มกราคม\",'02'=>\"กุมภาพันธ์\",'03'=>\"มีนาคม\",'04'=>\"เมษายน\",'05'=>\"พฤษภาคม\",'06'=>\"มิถุนายน\",'07'=>\"กรกฎาคม\",'08'=>\"สิงหาคม\",'09'=>\"กันยายน\",'10'=>\"ตุลาคม\",'11'=>\"พฤศจิกายน\",'12'=>\"ธันวาคม\");\n\t\t$date_time = 'ข้อมูล ณ '. date(\" j \"). $thaimonth[$str_month] . \" พ.ศ. \".$str_year;\n\t\treturn $date_time;\n\t}", "function get_month_names() {\r\n\t\treturn array(\r\n\t\t\t\"janvier\",\r\n\t\t\t\"f&eacute;vrier\",\r\n\t\t\t\"mars\",\r\n\t\t\t\"avril\",\r\n\t\t\t\"mai\",\r\n\t\t\t\"juin\",\r\n\t\t\t\"juillet\",\r\n\t\t\t\"ao&ucirc;t\",\r\n\t\t\t\"septembre\",\r\n\t\t\t\"octobre\",\r\n\t\t\t\"novembre\",\r\n\t\t\t\"d&eacute;cembre\"\r\n\t\t);\r\n\t}", "function get_month($Date){\n return date('m', parse_date($Date));\n }", "public function getMonth($format = null)\n {\n return $this->getDateElement('month', $format);\n }" ]
[ "0.72995293", "0.7266784", "0.7241325", "0.71720624", "0.711044", "0.708068", "0.70777", "0.70590013", "0.7057145", "0.69853413", "0.6981508", "0.6972771", "0.69605345", "0.69605345", "0.6946436", "0.694245", "0.69180447", "0.6913187", "0.6906783", "0.6905309", "0.6898687", "0.68889433", "0.68756056", "0.68729913", "0.6856622", "0.68477535", "0.6841185", "0.68118024", "0.6810132", "0.67839587", "0.67634684", "0.6761082", "0.6755554", "0.6754623", "0.67191815", "0.6718358", "0.6693046", "0.66764593", "0.66738975", "0.6672371", "0.6657661", "0.66556853", "0.66377425", "0.6632219", "0.66157264", "0.6598494", "0.65966773", "0.65859276", "0.6559844", "0.6559707", "0.65484923", "0.6542964", "0.65423465", "0.6540181", "0.65382385", "0.65244067", "0.6519473", "0.651067", "0.65084445", "0.6490748", "0.647782", "0.64689595", "0.64609325", "0.6426199", "0.6424921", "0.64234436", "0.6416919", "0.6402768", "0.6381441", "0.6371846", "0.63701016", "0.6367396", "0.6360703", "0.6359008", "0.63509375", "0.6346412", "0.6341395", "0.63407844", "0.63386154", "0.6336592", "0.6326588", "0.6326008", "0.63155544", "0.63141143", "0.63134766", "0.63134766", "0.6293988", "0.62885326", "0.62833625", "0.6282433", "0.6282375", "0.6278029", "0.6270142", "0.6266952", "0.62541246", "0.6251009", "0.6249876", "0.6249436", "0.6243792", "0.6239636" ]
0.7542262
0
Funcao que valida um usuario e senha
Функция, проверяющая пользователя и пароль
function validaUsuario($usuario, $senha) { global $_SG; $cS = ($_SG['caseSensitive']) ? 'BINARY' : ''; // Usa a funcao addslashes para escapar as aspas $nusuario = addslashes($usuario); $nsenha = addslashes($senha); // Monta uma consulta SQL para procurar um usu�rio require 'conexao.php'; $sql = "SELECT `id`, `nome` FROM `".$_SG['tabela']."` WHERE ".$cS." `email` = '".$nusuario."' AND ".$cS." `senha` = '".$nsenha."' LIMIT 1"; $query = mysqli_query($conexao,$sql); $resultado = mysqli_fetch_assoc($query); // Verifica se encontrou algum registro if (empty($resultado)) { /* Nenhum registro foi encontrado => o usuario e invalido */ return false; } else { // Definimos dois valores na sessao com os dados do usuario $_SESSION['usuarioID'] = $resultado['id']; // Pega o valor da coluna 'id do registro encontrado no MySQL $_SESSION['usuarioNome'] = $resultado['nome']; // Pega o valor da coluna 'nome' do registro encontrado no MySQL // Verifica a opcao se sempre validar o login if ($_SG['validaSempre'] == true) { // Definimos dois valores na sessao com os dados do login $_SESSION['usuarioLogin'] = $usuario; $_SESSION['usuarioSenha'] = $senha; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validarLogin(){\n $Validacao=$this->validarUsuario($_POST['Usuario'],$_POST['Senha']);\n if($Validacao == true){\n echo \"Login efetuado!\";\n }else{\n echo \"Login não efetuado!\";\n }\n\n }", "public function validateUser($username,$password);", "public function validar(usuario $usuario);", "public function validar()\n {\n $sql = \" select * from dataset.tb_usuario where cpf = '$this->cpf' \";\n $resultado = mysqli_query($this->conn, $sql);\n if (mysqli_num_rows($resultado) > 0) {\n echo ' CPF já cadastrado, por favor acesse sua conta ou recupere sua senha!';\n return false;\n }\n \n //verificar se o e-mail ja existe\n \t\t$sql = \" select * from dataset.tb_usuario where email = '$this->email' \";\n \t\t$resultado = mysqli_query($this->conn, $sql);\n\t\t\tif (mysqli_num_rows($resultado) > 0){\n echo 'Esse Email já está em uso, por favor utilize outro!';\n return false;\n\t\t\t}\n \n if($this->get_idade() < 18){\n echo 'Idade insuficiente!';\n return false;\n }\n \n return true;\n }", "function user_data_validation($user, $pass){\r\n\t//Karakter yang diperbolehkan untuk nama pengguna\r\n\t//selain karakter alphanumeric\r\n\t$sValidUser = array('_', '@', '.'); \r\n\t//Karakter yang diperbolehkan untuk sandi\r\n\t//selain karakter alphanumeric\t\r\n\t$sValidPass = array('*', '!', '@', '#', '$', '%', '^', '&', '*');\r\n\r\n\t//Cek validitas nama pengguna\r\n\tif(ctype_alnum(str_replace($sValidUser, '', $user))) { \r\n\t\t//cek validitas sandi\r\n\t\tif(ctype_alnum(str_replace($sValidPass, '', $pass))) { \r\n\t\t\t//jika nama pengguna dan sandi aman, kembalikan true\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t//Jika satu atau dua-duanya tidak valid, kembalikan false\r\n\treturn false;\r\n}", "function es_valido($user, $pass);", "function validate_user($user, $password){\n\treturn false;\n}", "public function validateUser(){\n }", "private function vaildateUser()\n\t{\n\t\t$rules=['username'=>[\n\t\t\t\t\t'required',\n\t\t\t\t\t'unique:users,username',\n\t\t\t\t\t'Min:10',\n\t\t\t\t\t'Max:30'],\n\t\t\t\t'email'=>[\n\t\t\t\t'email']\n\t\t\t\t\t];\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn [\n \t'success' => false,\n \t'errors' => $validator->getMessageBag()->toArray()\n\t\t ];\n\n\t\t}\n\t\treturn ['success' =>true];\n\t}", "public static function validate_user($data) {\n\t\t//create input field from data\n\t\t$input = array(\n\t\t\t\t'username' => $data['username'],\n\t\t\t\t'password' => $data['password'],\n\t\t\t\t'phone' => $data['phone'],\n\t\t\t\t\n\t\t\t\t'u_name' => $data['u_name'],\n\t\t\t\t'u_email' => $data['u_email'],\n\t\t\t\t'u_phone' => $data['u_phone'],\n\t\t\t\t'u_title' => $data['u_title'],\n\t\t\t\t'u_address' => $data['u_address'],\n\t\t);\n\t\n\t\t$result = self::validate($input);\n\t\tif (true !== $result) {\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function validar(){\n\t\t$usuario = $this->User->findAllByNameAndPassword($this->data['User']['name'], $this->data['User']['password']);\n\t\tif(!empty($usuario))\n\t\t\treturn $usuario;\n\t\telse\n\t\t\treturn false;\n\t}", "function formValidate($nombre,$apellido1,$apellido2,$email,$password,$repetirPassword) {\n\t\t$return = array();\n\t\t$return['ok'] = '';\n\t\t$return['msg'] = '';\n\n //Body\n\t\tif(!$this->accesManagerDB->existeEmail($email)){\n\t\t\t$fecha_ingreso = date(\"Y-m-d h:i:s\");\n\t\t\t$password = md5($password);\n\t\t\t$this->accesManagerDB->insertarSocio($email,$nombre,$apellido1,$apellido2,$password,$fecha_ingreso);\n\t\t\t$return['msg'] = 'Usuario registrado correctamente';\n\t\t\t$return['ok'] = 'ok';\n\t\t}\n\t\telse\n\t\t\t$return['msg'] = 'Usuario existente';\n\t\t\n\t\t//Return json encoded results\n\t\treturn json_encode($return);\n\t}", "function senhaValida($senha) {\r\n return preg_match('/[a-z]/', $senha) // tem pelo menos uma letra minúscula\r\n && preg_match('/[A-Z]/', $senha) // tem pelo menos uma letra maiúscula\r\n && preg_match('/[0-9]/', $senha) // tem pelo menos um número\r\n && preg_match('/^[\\w$@]{6,}$/', $senha); // tem 6 ou mais caracteres\r\n }", "function validasiDaftar($name, $username, $email, $password, $confirm, $phone){\n if(strlen($password) < 8){\n return false;\n }\n if ($password != $confirm){\n return false;\n }\n return true;\n }", "public function validar_login(){\n\t\t// Guarda datos recibidos\n\t\t$email = isset($_POST['email']) ? $_POST['email'] : \"\";\n\t\t$contrasena = isset($_POST['contrasena']) ? $_POST['contrasena'] : \"\";\n\n\t\t// Arreglo con errores por campo\n\t\t$errores = [];\n\n\t\t// Validacion campos\n\t\tarray_push($errores, $this->validar_congruencia_email($email));\n\t\tarray_push($errores, $this->validar_cuenta($email, $contrasena));\n\n\t\t// Regresa TRUE o arreglo con errores\n\t\tif($errores[0] == NULL && $errores[1] == NULL)\n\t\t\treturn TRUE;\n\n\t\treturn $errores;\n\t}", "function createUser()\n{\n if (!verifyUser(htmlspecialchars($_POST['email']), htmlspecialchars($_POST['password'])))\n {\n addUser(htmlspecialchars($_POST['nom']), htmlspecialchars($_POST['prenom']), htmlspecialchars($_POST['district']), htmlspecialchars($_POST['email']), htmlspecialchars($_POST['password']));\n }\n else {\n throw new Exception(\"User already existing\");\n }\n}", "function verificarLogin($usuario, $senha) {\n $sql = \"SELECT senha, nivel_acesso FROM tbl_funcionarios WHERE login = :l\";\n $stmt = $this->con->prepare($sql);\n $stmt->bindParam(\":l\", $usuario);\n $stmt->execute();\n\n if ($stmt->rowCount() == 0) {\n return false;\n } else {\n // Verificar se a senha pertence ao usuario\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n $senha_valida = password_verify($senha, $result['senha']);\n if ($senha_valida) {\n $nivelAcesso = $result['nivel_acesso'];\n return $nivelAcesso;\n } else {\n return false;\n }\n }\n }", "function LoginValidation(){\n\t\t\t//Obtenemos el valor de la 'x' enviada por el SINTE, si esta no existe mostramos el login de la pagina.\n\t\t\t//Validamos si existe coneccion con el WebService en primer instante y estan todos sus datos setiados.\n\t\t\t//Luego validamos si el usuario existe en la base de datos.\n\t\t\t//Si existe procedemos a validar si el usuario tiene correctamente creada todas sus tablas dentro del sistema de compromiso academico.\n\t\t\t//Luego evaluamos si existen sus carpetas dentro del sistema.\n\t\t\t//Una vez esta todo correctamente setiado, procedemos a crear la sesion del usuario para que use el sistema de manera normal.\n\t\t}", "function validar_usuario(){\n\t\t\t\t$result = $this->users->user($_POST['email']);\n\t\t\tif ($result!=array()){\n\t\t\t\t$result = array(\"true\",\"\");\n\t\t\t}else{\n\t\t\t\t$result = array(\"false\",\"El Usuario no existe\");\n\t\t\t}\n\t\techo json_encode($result);\n\t\t}", "public function validar_usuario($a, $b){\n\t\t$this->error = \"false\";\n\t\tswitch (true) {\n\t\t\t\n\t\t\tcase ( (strlen($a['nombres']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa sus Nombres.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['appaterno']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Apellido Paterno.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['apmaterno']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Apellido Materno.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['correo']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Correo Electronico.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['usuario']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa nombre de Usuario.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['clave']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Clave.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['dni']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa DNI.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['tipo']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Tipo de Usuario.\";\n\t\t\t\tbreak;\n\t\t\tcase ( (strlen($a['saldo']) == 0)):\n\t\t\t\t$this->msj = \"Ingresa Saldo.\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\n\t\t\t\tif($b == 1) $this->CrearUsuario($a); \n\t\t\t\telse $this->ModificarUsuario($a);\n\n\t\t\t\t$this->error = \"true\";\n\t\t\t\t$this->msj = ($b == 1) ? \"Sucursal insertado con exito.\" : \"Sucursal editado con exito.\";\n\t\t\t\t\n\t\t}\n\t\treturn $this->res;\n\t}", "public function validacoesLogar() {\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules(\n\t\t\t'login',\n\t\t\t'login',\n\t\t\t'required|alpha_numeric',\n\t\t\tarray(\n\t\t\t\t'required' => 'Login é obrigatório',\n\t\t\t\t'alpha_numeric' => 'Apenas letras e números são aceitos.'\n\t\t\t)\n\t\t);\n\t\t$this->form_validation->set_rules('senha', 'senha', 'required', array('required' => 'Senha é obrigatória'));\n\t\t\n\t\treturn $this->form_validation->run();\n\t}", "function check_userData($firstName, $lastName, $password, $pseudo, $role, $active){\n // Tableau qui rassemble les erreurs\n $errors = [];\n\n // Vérification sur le firstname\n if ( empty( $firstName ) || !isset($firstName) ) {\n array_push($errors, \"First name is not defined\");\n } else if ( strlen($firstName) <= 1 ) {\n array_push($errors, \"First name with length 0 or 1 char is not valid\");\n }\n\n // Vérification sur le lastname\n if ( empty( $lastName ) )\n array_push($errors, \"Last name is not defined\");\n else if ( strlen($lastName) <= 1 )\n array_push($errors, \"Last Name with length 0 or 1 char is not valid\");\n\n // Vérification des mots de passes\n if ( empty( $password ) ) {\n array_push($errors, \"Password is not defined\");\n } else {\n // compris entre 8 et 16 caractère, Au minimun 1 maj, 1 charactère spécial, un chiffre\n if ( strlen( $password ) < 8 || strlen( $password ) > 16 )\n array_push($errors, \"Your password contains less than 8 char or more than 16 char.\");\n if (preg_match(mb_convert_encoding('/[A-Z]/', 'UTF-8'),$password) !== 1 )\n array_push($errors,\"Your Password must contain at least 1 uppercase!\");\n if( preg_match(mb_convert_encoding('/[#$%^&*()+=@\\-\\[\\]\\';,.\\/{}|\":<>?~\\\\\\\\]/', 'UTF-8'), $password) !== 1 )\n array_push($errors,\"Your password must contain at least 1 special character!\");\n if (preg_match(mb_convert_encoding('/[0-9]/', 'UTF-8'),$password) !== 1 )\n array_push($errors,\"Your password must contain at least 1 number!\");\n }\n // Vérification pseudo\n if( empty($pseudo) || !isset($pseudo) )\n array_push($errors,\"Pseudo is not defined!\");\n else if( preg_match(\"/[\\s]/\",$pseudo) === 1 )\n array_push($errors,\"Your pseudo cannot contain spaces!\");\n else if( strlen($pseudo) <= 1 )\n array_push($errors,\"Pseudo with length 0 or 1 is not valid!\");\n\n // Vérification user role\n if( strcasecmp($role ,\"user\" ) !== 0 )\n if ( strcasecmp($role ,\"admin\" ) !== 0 )\n array_push($errors,\"Role is neither user nor admin\");\n\n // Vérification is active\n if( !in_array($active, [0,1] ) )\n array_push($errors,\"Active is neither 0 nor 1\");\n\n if (sizeof($errors) === 0)\n return [\n 'res' => True,\n ];\n else\n return [\n 'res' => False,\n 'errors' => $errors\n ];\n }", "public function chkUser($username, $password);", "public static function registerValid($username,$password){\n $error = array();\n if (strlen($username) < 4 || strlen($username) > 15) {\n\t $error[\"username\"] = \"El nombre de usuario debe tener entre 4 y 10 caracteres.\";\n }\n if (strlen($password) < 5 || strlen($password) > 50) {\n\t $error[\"password\"] = \"La contraseña debe tener entre 8 y 15 caracteres.\";\t\n }\n if (sizeof($error)==0){\n return true;\n }else{\n return true;\n } \n }", "function existenErroresEdUsuario( $form )\n{\n $result = false;\n if (trim($form['login']) == '') {\n registrarError('Debe ingresar el nombre de usuario del sistema.');\n\t$result = true;\n }\n if (trim($form['nombre']) == '') {\n registrarError('Debe ingresar el nombre completo de usuario.');\n\t$result = true;\n } \n if( trim($form['oki']) == 'yes' ) //opcion para cambio de contraseña habilitado\n {\n if (trim($form['clave']) == '') {\n registrarError('Debe ingresar nueva contraseña.');\n $result = true;\n } \n }\n return $result;\n}", "function validate_username($username)\n{\n}", "function checkForm()\n{\n if (!empty($_POST)) :\n $validate = new Validate();\n if ($_POST['first-name'] && $_POST['last-name'] && $_POST['email'] && $_POST['password'] && $_POST['password-confirm']) :\n if ($validate->validatePassword($_POST['password'])) :\n if ($_POST['password'] === $_POST['password-confirm']) :\n if ($validate->email($_POST['email'])) :\n inscription();\n else :\n echo 'email non valide';\n endif;\n else :\n echo 'mot de passe pas identique';\n endif;\n else :\n echo 'mot de passe trop simple';\n endif;\n else :\n echo 'Veuillez remplir le formulaire';\n endif;\n endif;\n}", "function validateUser($user){\n\t\t$errors = array();\n\t\tif (empty($user['username'])) { //note that the post variable was change to user becaause thats what was used when creating the function\n\t\t\tarray_push($errors, \"Username is required\");\n\t\t}\n\n\t\tif (empty($user['email'])) {\n\t\t\tarray_push($errors, \"Email is required\");\t\n\t\t}\n\n\t\tif (empty($user['password'])) {\n\t\t\tarray_push($errors, \"Password is required\");\t\n\t\t}\n\n\t\tif ($user['passwordConf'] != $_POST['password']) {\n\t\t\tarray_push($errors, \"Passwords do not match\");\t\n\t\t}\n\n\t\t$existingUser = selectOne('users', ['email' => $user['email']]); //the function we created earlier\n\t\tif ($existingUser) { // we removed the isset method,becauss the isset method is just to check is a variable exists just the variable name will be enough to check if the user actually exist in the database\n\t\t\tarray_push($errors, \"Email already exist\");\n\t\t}\n\treturn $errors; \n}", "function validate_user_login(){\r\n if($_SERVER['REQUEST_METHOD'] == \"POST\"){\r\n\r\n $errors = [];\r\n $min = 2;\r\n $max = 40;\r\n\r\n $email = clean($_POST['email']);\r\n $password = clean($_POST['password']);\r\n $remember = isset($_POST['remember']);\r\n\r\n if(empty($email)){\r\n $errors[] = \" Az email cím nem lehet üres ! \";\r\n }\r\n if(empty($password)){\r\n $errors[] = \" A Jelszó nem lehet üres ! \";\r\n }\r\n\r\n if(!empty($errors)){\r\n foreach ($errors as $error) {\r\n echo validation_errors($error);\r\n }\r\n }else{\r\n if(login_user($email , $password , $remember)){\r\n redirect(\"index.php\");\r\n }else{\r\n echo validation_errors(\"Hibás email, vagy jelszó!\");\r\n }\r\n }\r\n }\r\n}", "function validaUsuario($usrTg){\n\t\t$o_bd = new bd($_SESSION['servidorBD'], $_SESSION['usuarioBD'], $_SESSION['pwdBD'], $_SESSION['nombreBD']);\n\t\t$o_bd->m_seleBD('ppw');\n\t\t$query = \"select * from usuario where usr='\". $usrTg .\"'\";\n\t\t$o_bd->m_consulta($query);\n\t\tif($o_bd->a_bandError)\n\t\t\techo \"<center><error>Error \" . $o_bd->a_mensError .\"</error></center>\";\n\t\telse{\n\t\t\tif($o_bd->a_numRegistros==1){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public static function validarDatosUsuario($nombre, $apellidos,$direccion, $provincia, $ciudad, $codPostal, $pais,$telefono, $email)\r\n {\r\n $errors=[];\r\n\r\n $nombreVal='/^[A-ZÑÁÉÍÓÚ\\s ].*/';\r\n $apellidosVal='/^[A-ZÑÁÉÍÓÚ\\s ].*/';\r\n $direccionVal='/^[A-ZÑÁÉÍÓÚ\\s ].*/';\r\n $ciudadVal='/^[A-ZÑÁÉÍÓÚ\\s ].*/';\r\n $codPostalVal='/[0-9]{5}/';\r\n $provinciaVal='/^[A-ZÑÁÉÍÓÚ\\s ].-?.*/';\r\n $paisVal='/^[A-ZÑÁÉÍÓÚ\\s ].*/';\r\n $emailVal='/[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,3}$/';\r\n $telefonoVal='/[0-9]*/';\r\n\r\n if(!preg_match($nombreVal,$nombre)) {\r\n $errors['nombre'] = true;\r\n }elseif(!preg_match($apellidosVal,$apellidos)) {\r\n $errors['apellidos'] = true;\r\n }elseif(!preg_match($direccionVal,$direccion)) {\r\n $errors['direccion'] = true;\r\n }elseif(!preg_match($ciudadVal,$ciudad)) {\r\n $errors['ciudad'] = true;\r\n }elseif(!preg_match($codPostalVal,$codPostal)) {\r\n $errors['codPostal'] = true;\r\n }elseif(!preg_match($provinciaVal,$provincia)) {\r\n $errors['provincia'] = true;\r\n }elseif(!preg_match($paisVal,$pais)) {\r\n $errors['pais'] = true;\r\n }elseif(!preg_match($emailVal,$email)) {\r\n $errors['email'] = true;\r\n }elseif(!preg_match($telefonoVal,$telefono)) {\r\n $errors['telefono'] = true;\r\n }\r\n\r\n return $errors;\r\n }", "function validate_user( $dni, $password ) {\n // based on the received username and password\n $this->db->from('usuarios');\n $this->db->where('dni',$dni );\n $this->db->where( 'password', sha1($password) );\n $login = $this->db->get()->result();\n\n // Los resultados de la consulta se guardan en $login.\n // Si existe un valor, entonces la cuenta del usuario existe y es valida\n if ( is_array( $login ) && count( $login ) == 1 ) {\n // Se guardan los datos del usuario en la variable de clase $details\n $this->details = $login[0];\n // Call set_session to set the user's session vars via CodeIgniter\n $this->set_session();\n return true;\n }\n\n return false;\n }", "public static function validateUsuario($usuario){\n return CAU_match('/^[A-Z0-9]{2,20}$/i', $usuario);\n }", "public function validacion(){\n\t\t/*\n\t\t$usuario = new User();\n\t\t$usuario->username = Input::get('usuario');\n\t\t$usuario->password = Hash::make(Input::get('contra'));\n\t\t$usuario->save();\n\t\treturn Redirect::back();\n\t\t*/\n\t\t$datos = array(\n\t\t\t'username' => Input::get('usuario'),\n\t\t\t'password' => Input::get('contra'));\n\t\tif (Auth::attempt($datos)) {\n\t\t\t//Auth::logout();\n\t\t\treturn Redirect::to('/raiz');\n\t\t}\n\t\telse{\n\t\t\t//return Redirect::back();\n\t\t\treturn Redirect::to('/');\n\t\t}\n\t}", "function validar($datos){\n\n $errores = [];\n\n if ($datos) {\n if (strlen($datos[\"nombre\"])==0) {\n $errores[] = \"El campo nombre se encuentra vacio\";\n }\n if (strlen($datos[\"apellido\"])==0) {\n $errores[] = \"El campo apellido se encuentra vacio\";\n }\n if (!filter_var($datos[\"email\"],FILTER_VALIDATE_EMAIL)) {\n $errores[] = \"El email tiene un formato incorrecto\";\n }\n if (strlen($datos[\"contrasenia\"])<=6) {\n $errores[] =\"La contraseña tiene menos de 6 caracteres\";\n }\n if ($datos[\"contrasenia\"] != $datos[\"contrasenia1\"]) {\n $errores[] = \"Las contraseñas no coinciden\";\n }\n }\n return $errores;\n}", "function validarusuario() {\r\n $PKUsuario = $this->ObjAcceso->getPKUsuario();\r\n $Password = $this->ObjAcceso->getPassword();\r\n //-------ARCHIVO PARA CONECTARNOS A LA BASE DE DATOS--------------------\r\n include(\"../conexion/conexion.php\");\r\n //---------CONSULTA PARA VALIDAR EL USUARIO-----------------------------\r\n $resultado = mysqli_query($conexion, \"call validarusuario('$PKUsuario','$Password')\");\r\n if (!$resultado) {\r\n return $conexion;\r\n } else {\r\n $this->resultado = $resultado;\r\n }\r\n }", "public function valida_usuario($usuario,$passwd) {\n $sqlvu = \"select us_id,us_login,us_passwd from users where us_login = '$usuario' and us_passwd = '$passwd' and us_activo = 1\";\n $resultvu = pg_query($this->conexion,$sqlvu) or die(\"Error vu: \". pg_last_error());//valida usuario\n if($rowvu = pg_fetch_array($resultvu)){\n if($usuario == $rowvu['us_login'] && $passwd == $rowvu['us_passwd']){\n $this->acceso='autorizado';\n $this->id = $rowvu['us_id'];\n }else{\n $this->acceso='no autorizado';\n }\n }else{\n $this->acceso='no autorizado';\n }\n }", "public function validacionLogin($usuario){\n $errores=array();\n \n $email = trim($usuario->getEmail());\n if(!filter_var($email, FILTER_VALIDATE_EMAIL)){\n $errores[\"email\"]=\"Email invalido !!!!!\";\n }\n $password= trim($usuario->getPassword());\n \n if(empty($password)){\n $errores[\"password\"]= \"El campo password es requerido\";\n }elseif (strlen($password)<6) {\n $errores[\"password\"]=\"La contraseña debe tener como mínimo 6 caracteres\";\n }\n \n return $errores;\n }", "function checkSignUp($username,$password1,$password2){\n $username=trim($username);\n if($username==\"\"){\n return 2;//\"Username can not be empty!\"\n }\n $password1=trim($password1);\n if($password1==\"\"){\n return 3;//\"Password can not be empty!\"\n }\n if($password1!=$password2){\n return 4;//\"Two passwords are not same!\"\n }\n if(!checkThisUsername($username))\n return 5;\n //5 represent username has existed\n return 6;//\"OK\";\n}", "public function valida($sesion, $username)\n\t{\n\t\t$this->sesion=$sesion;\n\t\t$this->username = $username;\n\n\t\t\t\t\t\t/*se extrae el id del usuario*/\n\t\t\t\t\t\t$dbC = Yii::app()->db->createCommand();\n\t\t\t\t\t\t$dbC->setFetchMode(PDO::FETCH_OBJ);//fetch each row as Object\n\n\t\t\t\t\t\t\t$dbC->select('*')\n\t\t\t\t\t\t\t->from('sapo_autentica.sapoat_usuario_t')\n\t\t\t\t\t\t\t->where('usuario=:usuario', array(':usuario'=>$this->username))\n\t\t\t\t\t\t\t->order ('id_usuario desc')\n\t\t\t\t\t\t\t->limit('1');\n\n\t\t\t\t\t\t\tforeach ($dbC->queryAll() as $row) {\n\t\t\t\t\t\t // es el id del usuario que esta logueado\n\t\t\t\t\t\t $this->id = $row->id_usuario;\n\t\t\t\t\t\t\t}\n\n\t\t$borrado = sesion::model()->findByAttributes(array('id_sesion_activa'=>$this->sesion, 'id_usuario'=>$this->id));\n\t\tif($borrado !==NULL){\n\n\n\t\t}else{\n\t\t// salir de sesion\n\t\t$this->Logout();\n\t\t}\n\t}", "function isNullLogin($usuario,$password){\n if(strlen(trim($usuario)) < 1 || strlen(trim($password)) < 1){\n return true;\n }\n else{\n return false;\n }\n}", "function validate($user, $pass=\"default\"){\n\t\n\t\tif(strlen($user) < 9 && strlen($pass) < 9){\n\t\t\n\t\t\tconectar();\n\t\t\n\t\t}else{\n\t\t\n\t\t\theader(\"Location:index.php?flag=1\");\n\t\t\n\t\t}\n\t\t\n\t}", "function validlogin($email, $password) {\r\n if (($email=='admin') && ($password=='sesame')) {\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n}", "public static function registrationOthersInputValidation($name, $user_surname1, $user_surname2, $user_address, $user_city, $user_province, $user_NIF, $user_phone, $user_contract_date)\n\t{\n return true;\n\n if (empty($name)) {\n Session::add('feedback_negative', 'El campo Nombre está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-záéíóúÁÉÍÓÚñÑ\\.\\s-]{2,64}/', $name)) {\n Session::add('feedback_negative', 'El campo Nombre no se ajusta al patrón: Sólo mayusculas y minusculas y espacios, de 2 a 64 caracteres');\n return false;\n }\n\n\t\t if (empty($user_surname1)) {\n Session::add('feedback_negative', 'El campo Primer Apellido está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-záéíóúÁÉÍÓÚñÑ\\.\\s-]{2,64}/', $user_surname1)) {\n Session::add('feedback_negative', 'El campo Primer Apellido no se ajusta al patrón: Sólo mayusculas y minusculas y espacios, de 2 a 64 caracteres');\n return false;\n }\n\n if (empty($user_surname2)) {\n Session::add('feedback_negative', 'El campo Segundo Apellido está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-záéíóúÁÉÍÓÚñÑ\\.\\s-]{2,64}/', $user_surname2)) {\n Session::add('feedback_negative', 'El campo Segundo Apellido no se ajusta al patrón: Sólo mayusculas y minusculas y espacios, de 2 a 64 caracteres');\n return false;\n }\n\n if (empty($user_address)) {\n Session::add('feedback_negative', 'El campo Direccion está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-z0-9áéíóúÁÉÍÓÚñÑ\\.\\/\\s,-]{2,64}/', $user_address)) {\n Session::add('feedback_negative', 'El campo Direccion no se ajusta al patrón: Sólo mayusculas, minusculas, numeros, espacios comas y guiones, de 2 a 64 caracteres');\n return false;\n }\n\n if (empty($user_city)) {\n Session::add('feedback_negative', 'El campo Poblacion está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-záéíóúÁÉÍÓÚñÑ\\.\\/\\s,-]{2,64}/', $user_city)) {\n Session::add('feedback_negative', 'El campo Poblacion no se ajusta al patrón: Sólo mayusculas y minusculas y espacios, de 2 a 64 caracteres');\n return false;\n }\n\n if (empty($user_province)) {\n Session::add('feedback_negative', 'El campo Provincia está vacío');\n return false;\n }\n // if name is too short (2), too long (64) or does not fit the pattern (aZ)\n if (!preg_match('/[A-Za-záéíóúÁÉÍÓÚñÑ\\.\\/\\s,-]{2,64}/', $user_province)) {\n Session::add('feedback_negative', 'El campo Provincia no se ajusta al patrón: Sólo mayusculas y minusculas y espacios, de 2 a 64 caracteres');\n return false;\n }\n // if NIF does not fit the pattern (12345678A) 8 digits and 1 character upercase.\n if (empty($user_NIF)) {\n Session::add('feedback_negative', 'El campo NIF está vacío');\n return false;\n }\n\n if (!preg_match('/^([0-9]{8,8})([A-Z])$/', $user_NIF)) {\n Session::add('feedback_negative', 'El campo NIF no se ajusta al patrón: 8 digitos y una letra mayuscula');\n return false;\n }\n\n if (empty($user_phone)) {\n Session::add('feedback_negative', 'El campo Telefono está vacío');\n return false;\n }\n // if phone does not fit the pattern (+34923456789 +34 923456789 923456789 +34623456789+34 623456789 623456789)\n if (!preg_match('/^([9|6][0-9]{8})$/', $user_phone)) {\n Session::add('feedback_negative', 'El campo Telefono no se ajusta al patrón: el nº telefono debe de empezar por 9 o por 6 hasta alcanzar 9 digitos.');\n return false;\n }\n if(!is_null($user_contract_date)){\n if (empty($user_contract_date)){\n Session::add('feedback_negative', 'El campo Fecha Contratacion está vacío');\n return false;\n }\n\n if (!preg_match('/(\\d{4})(-)([0][1-9]|[1][0-2])\\2([0][1-9]|[12][0-9]|3[01])/', $user_contract_date)) {\n Session::add('feedback_negative', 'El campo Fecha Contratacion no se ajusta al patrón de fecha DD/MM/AAAA');\n return false;\n }\n }\n\t}", "function validateUserAccount()\n\t{\n\t\t$message = \"Required Field Cannot be blank\";\n\t\t$this->Assign(\"txtFName\",trim($_POST['txtFName']),\"noempty\",$message);\n\n\t\t$message = \"Required Field Cannot be blank\";\n\t\t$this->Assign(\"txtLName\",trim($_POST['txtLName']),\"noempty\",$message);\n\n\t\t$message = \"Required Field Cannot be blank/Invalid Email\";\n\t\t$this->Assign(\"txtEmail\",trim($_POST['txtEmail']),\"noempty/emailcheck\",$message);\n\n\t\t\n\t\t$this->PerformValidation(''.$_SESSION['base_url'].'/index.php?do=accountinfo');\n\n\t}", "function register($name,$last_name,$email, $password, $password_ctrl, $gender,$birth){\n\n if(validateName($name, $last_name) && validatePass($password, $password_ctrl) && validateMail($email)){\n \n if (createUser($name,$last_name,$email, $password, $gender,$birth)){\n \n //mensaje alerta por artify ver porque me salen 2 \n echo \"<script>\n alertify.success('Se ha registrado correctamente');\n </script>\";\n \n require_once \"autentication.php\";\n }\n else{\n echo \"<script>\n alertify.error('Tuvo un error');\n </script>\";\n }\n }\n}", "public function isLogInValid(){\n $this->errors = array();\n\t\tif (!key_exists(\"username\", $this->data) || $this->data[\"username\"] === \"\"){\n\t\t\t$this->errors[\"username\"] = \"You must enter a username.\";\n }else if (mb_strlen($this->data[\"username\"], 'UTF-8') >= 25){\n $this->errors[\"username\"] = \"Username must be under 25 characters.\";\n }else if ($this->data[\"username\"] === NULL){\n $this->errors[\"username\"] = \"This account doesn't exist.\";\n }\n\n if (!key_exists(\"password\", $this->data) || $this->data[\"password\"] === \"\"){\n \t$this->errors[\"password\"] = \"You must enter a password.\";\n }\n return count($this->errors) === 0;\n }", "function validateSignUpForm($username, $passwordSha256, $realname, $passportIdOREmployeeID, $telephone, $region, $email) {\n if ($username == \"\" || !preg_match('/^[a-zA-Z0-9_]{1,15}$/', $username)) {\n return \"<b>Username</b> is empty or invalid\";\n }\n\n // sha256(\"\") = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n if ($passwordSha256 == \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\") {\n return \"<b>Password</b> is empty or invalid\";\n }\n\n if ($realname == \"\" || strlen($realname) > 255) {\n return \"<b>Real Name</b> is empty or invalid\";\n }\n\n if ($passportIdOREmployeeID == \"\" || strlen($passportIdOREmployeeID) > 20 ) {\n return \"<b>Passport</b> is empty or invalid\";\n }\n\n if ($telephone == \"\" || strlen($telephone) > 20 ) {\n return \"<b>Telephone Number</b> is empty or invalid\";\n }\n\n if ($email == \"\" || strlen($email) > 255 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return \"<b>Email Address</b> is empty or invalid\";\n }\n\n if ($region == \"\" || strlen($region) > 255) {\n return \"<b>Country or Region</b> is empty or invalid\";\n }\n return false;\n }", "function validarUsuario($data, $files){\n\t\t$errores = [];\n\n\t\tif (trim($data['name']) == '') {\n\t\t\t$errores['name'] = 'Escribí el nombre!';\n\t\t}\n\n\t\tif (trim($data['lastnameword']) == '') {\n\t\t\t$errores['lastname'] = 'Escribí el apellido!';\n\t\t}\n\n\t\tif (trim($data['email']) == '') {\n\t\t\t$errores['email'] = 'Escribí el email!';\n\t\t} elseif (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t$errores['email'] = 'El email ES INVALIDO';\n\t\t} elseif (comprobarEmail($data['email']) != false) {\n\t\t\t$errores['email'] = 'El email ya existe';\n\t\t}\n\n\t\tif (trim($data['username']) == '') {\n\t\t\t$errores['username'] = 'Escribí un nombre de usuario!';\n\t\t} elseif (comprobarUser($data['username']) != false) {\n\t\t\t$errores['username'] = 'El username ya existe';\n\t\t}\n\n\t\tif (trim($data['password']) == '') {\n\t\t\t$errores['password'] = 'Escribí la contraseña!';\n\t\t} elseif (strlen($data['password']) < 6) {\n\t\t\t$errores['password'] = \"La clave debe tener al menos 6 caracteres\";\n\t\t} elseif (strlen($data['password']) > 16) {\n\t\t\t$errores['password'] = \"La clave no puede tener más de 16 caracteres\";\n\t\t} elseif (!preg_match('`[a-z]`',$data['password'])) {\n\t\t\t$errores['password'] = \"La clave debe tener al menos una letra minúscula\";\n\t\t} elseif (!preg_match('`[A-Z]`',$data['password'])) {\n\t\t\t$errores['password'] = \"La clave debe tener al menos una letra mayúscula\";\n\t\t} elseif (!preg_match('`[0-9]`',$data['password'])) {\n\t\t\t$errores['password'] = \"La clave debe tener al menos un caracter numérico\";\n\t\t}\n\n\t\tif (trim($data['repass']) == '') {\n\t\t\t$errores['repass'] = 'Escribí la contraseña de nuevo!';\n\t\t} elseif (trim($data['pass']) != trim($data['repass'])) {\n\t\t\t$errores['repass'] = 'Las contraseñas no coinciden!';\n\t\t}\n\n\t\tif (trim($data['edad']) == '') {\n\t\t\t$errores['edad'] = 'Decinos tu edad!';\n\t\t}\n\n\t\tif ($files['avatar']['error'] != UPLOAD_ERR_OK) {\n\t\t\t$errores['imagen'] = 'Subí una imagen';\n\t\t}\n\n\t\treturn $errores;\n\t}", "function validateUser( $errors )\n\t{\n\t\n\t}", "function validate($firstName, $lastName, $username, $password) {\n $ret = 0;\n if($firstName == \"\") {\n $ret = 1;\n }\n if($lastName == \"\") {\n $ret = 1;\n }\n if($username == \"\") {\n $ret = 3;\n }\n if($password == \"\") {\n $ret = 3;\n }\n return $ret;\n}", "private function verify_register_user( $data ) {\n try {\n\n if ( ! $this->is_token_valid( $data['token'] ) )\n throw new Exception( 'invalid_submission' );\n\n if ( empty( $data['branch'] ) && ! $this->superUser ) {\n $this->errorInput['branch'] = TRUE;\n throw new Exception( 'empty_branch' );\n }\n\n if ( empty( $data['username'] ) ) {\n $this->errorInput['username'] = TRUE;\n throw new Exception( 'empty_username' );\n }\n\n if ( $this->username_exists( $data['username'] ) ) {\n $this->errorInput['username'] = TRUE;\n throw new Exception( 'username_exists' );\n }\n\n if ( empty( $data['password'] ) ) {\n $this->errorInput['password'] = TRUE;\n throw new Exception( 'empty_password' );\n }\n\n if ( empty( $data['confirm_password'] ) ) {\n $this->errorInput['confirm_password'] = TRUE;\n throw new Exception( 'empty_confirm_password' );\n }\n\n if ( ! $this->password_match( $data['password'], $data['confirm_password'] ) ) {\n $this->errorInput['password'] = TRUE;\n $this->errorInput['confirm_password'] = TRUE;\n return FALSE;\n }\n\n if ( empty( $data['firstname'] ) ) {\n $this->errorInput['firstname'] = TRUE;\n throw new Exception( 'empty_firstname' );\n }\n\n if ( empty( $data['lastname'] ) ) {\n $this->errorInput['lastname'] = TRUE;\n throw new Exception( 'empty_lastname' );\n }\n\n if ( empty( $data['email'] ) ) {\n $this->errorInput['email'] = TRUE;\n throw new Exception( 'empty_email' );\n }\n\n if ( $this->validate_input( $data['email'], 'email' ) ) {\n $this->errorInput['email'] = TRUE;\n throw new Exception( 'invalid_email' );\n }\n\n if ( $this->verify_user_accessname( $data['email'] ) ) {\n $this->errorInput['email'] = TRUE;\n throw new Exception( 'email_exists' );\n }\n\n return TRUE;\n\n } catch ( Exception $e ) {\n $this->errorMsg = $e->getMessage();\n return FALSE;\n }\n\n }", "public function validateSignUpFields()\n{\n\n if(empty($this->name) || strlen($this->name) < 3){\n $error = ['error_code' => 1, 'msg' => __('lang.fio_3_symbol')];\n return $error;\n }\n if(empty($this->role_id)){\n $error = ['error_code' => 1, 'msg' => __('lang.who')];\n return $error;\n }\n if(empty($this->email) || strlen($this->email) < 3){\n $error = ['error_code' => 1, 'msg' => __('lang.login_3_symbol')];\n return $error;\n }\n if($this->getByEmail($this->email)){\n $error = ['error_code' => 1, 'msg' => __('lang.user_already_exists')];\n return $error;\n }\n\n if (!preg_match(\"/^[\\w\\d\\s.,-]*$/\", $this->email)) {\n $error = ['error_code' => 1, 'msg' => __('lang.login_english_symbol')];\n return $error;\n }\n\n if(empty($this->password) || strlen($this->password) < 3){\n $error = ['error_code' => 1, 'msg' =>__('lang.pass_3_symbol')];\n return $error;\n }\n if($this->password != $this->confirm_password){\n $error = ['error_code' => 1, 'msg' => __('lang.passws_not')];\n return $error;\n }\n return ['error_code' => 0, 'msg' => ''];\n}", "public function isValidUserFromPost() {\n\n $data = json_decode($_POST['data']);\n if ((!$data->email) || (!$data->password)) {\n } else {\n echo $this->isValidUser($data->email, $data->password);\n }\n }", "function isNull($email,$nombre,$apellido,$telefono,$usuario,$password,$password_2){\n if (strlen(trim($email)) < 1 || strlen(trim($nombre)) < 1 || strlen(trim($apellido)) < 1 || \n strlen(trim($telefono)) < 1 || strlen(trim($usuario)) < 1 || strlen(trim($password)) < 1 || \n strlen(trim($password_2)) < 1 )\n {\n return true;\n } else{\n return false;\n }\n\n}", "public function validateUser()\n {\n $posted_data = Yii::$app->request->post();\n $username = $posted_data['username'];\n if (empty($posted_data['password']))\n {\n $password = '111';\n }\n else\n {\n $password = $posted_data['password'];\n }\n if (!empty($this->hashKorisnika($username)))\n {\n $hash = $this->hashKorisnika($username);\n } else {\n return false;\n }\n $provjera = Yii::$app->getSecurity()->validatePassword($password, $hash);\n // echo $hash;\n if ($provjera) {\n $cookie = new Cookie(\n [\n 'name' => 'id_korisnika',\n 'value' => $username,\n 'expire' => time() + 86400 * 7\n ],\n ['name' => 'sifra', 'value' => 'asdf', 'expire' => time() + 86400 * 7]\n );\n \\Yii::$app->getResponse()->getCookies()->add($cookie);\n $provjera = true;\n } else {\n $provjera = false;\n }\n\n return $provjera;\n }", "public function validate()\n\t{\n\t\tif(isset($_POST['uname']) && isset($_POST['pw'])) { \n \t\t$username = $_POST['uname'];\n\t\t\t$passwd = $_POST['pw'];\n\n\t\t\t$db = db::instance();\n\n\t\t\t$sql = \"SELECT * FROM users WHERE Username='$username'\";\n\t\t\t$result=$db->lookup($sql);\n\n\t\t\t// If result matched $username and $password, table row must be 1 row\n\t\t\tif($result->num_rows==1){\n \t\t\t \t$row = $result->fetch_assoc();\n \t\t\tif ($passwd == $row['Password']){\n \t\t\t$_SESSION['username'] = $username;\n \t\t\t$_SESSION['admin'] = $row['Admin'];\n\t\t\t\t\t$_SESSION['error'] = \"You are logged in as \".$username.\".\";\n \t\t\t}\n \t\t\telse {\n \t \t\t$_SESSION['error'] = \"Incorrect password.\";\n \t\t\t}\n\t\t\t}\n\t\t\telse{\n \t\t\t$_SESSION['error'] = \"Username does not exist\";\n\t\t\t}\n\t\t\tinclude_once SYSTEM_PATH.'/view/login.tpl';\n\t\t}\n\t}", "function isValidUser() {\n\tglobal $users;\n\tglobal $username;\n\tglobal $password;\n\tglobal $requestUUID;\n\t\t\n\tif (empty($username)) {\n\t\treturn false;\n\t}\n\n\tif ($users[$username] == $password) {\n\t\ttouch(userTokenFilename());\n\t\treturn true;\n\t}\n\telse if (file_exists(userTokenFilename())) {\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "function validateUserRegistration(){\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n\n // some property\n $errors = [];\n\n $min = 3;\n $max = 20;\n\n // grab form value\n $first_name = clean($_POST['first_name']);\n $last_name = clean($_POST['last_name']);\n $username = clean($_POST['username']);\n $email = clean($_POST['email']);\n $password = clean($_POST['password']);\n $confirm_password = clean($_POST['confirm_password']);\n\n\n // check first name less than 3 or not\n if(strlen($first_name) < $min){\n\n $errors[] = \"Your first name cannot be less than {$min} characters\";\n\n }\n\n // check first name more than 20 or not\n if(strlen($first_name) > $max){\n\n $errors[] = \"Your first name cannot be more than {$max} characters\";\n\n }\n\n // check last name less than 3 or not\n if(strlen($last_name) < $min){\n\n $errors[] = \"Your last name cannot be less than {$min} characters\";\n\n }\n\n // check first name more than 20 or not\n if(strlen($last_name) > $max){\n\n $errors[] = \"Your last name cannot be more than {$max} characters\";\n\n }\n\n // check usernfame lass than 3 or not\n if(strlen($username) < 3){\n\n $errors[] = \"Your username cannot be less than {$min} characters\";\n\n }\n\n // check username more than 20 or not\n if(strlen($username) > $max){\n\n $errors[] = \"Your username cannot be more than {$max} characters\";\n\n }\n\n // check username already has or not into database\n if(usernameExists($username)){\n\n $errors[] = \"Sorry that username already been taken!\";\n\n }\n\n // check email more than 20 or not\n if(strlen($email) < $min){\n\n $errors[] = \"Your email cannot be less than {$min} characters\";\n\n }\n\n // check username already has or not into database\n if(emailExists($email)){\n\n $errors[] = \"Sorry that email already is registered\";\n\n }\n\n // check password and confirm password is not match\n if($password !== $confirm_password){\n\n $errors[] = \"Your password and confirm password do not match\";\n\n }\n\n\n // check errors array variable has or not than loop the errors and show message\n if(!empty($errors)){\n\n foreach($errors as $error){\n \n // code refactor\n echo validationErrors($error);\n\n }\n\n }else {\n \n // call to register user function and pass the parameters\n if(registerUser($first_name, $last_name, $username, $email, $password)){\n \n setMessage('<p class=\"bg-success text-center p-3\">Please check your email inbox or span folder for activation link.</p>');\n redirect(\"index.php\");\n\n }\n\n }\n\n\n\n }\n\n }", "function checkExistUser() {\n\t\tglobal $db;\n\t\t$email = FSInput::get ( 'email' );\n\t\t$username = FSInput::get ( 'username' );\n\t\n\t}", "function validate_user() {\nif ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $loginName = test_input($_POST[\"loginName\"]);\n $password = test_input($_POST[\"password\"]);\n}\nif ((isset($loginName)) && (isset($password))){\n\n\tlogin($loginName, $password);}\n\telse {\n\t\techo \"Username Required\";\n\t}\n}", "function check_input($username, $password, $password_again, $email) {\n\t//if($password != $password_again || ! $username || ! $email) return false;\n\tif($password != $password_again || ! $username) return false;\n\treturn true;\n}", "private function checkLogin() { \n $required = array('email' => 'email', 'password' => 'password', 'token' => 'token');\n $this->_val->setRequired($required);\n $this->_val->isEmail('email');\n $this->_val->matches('password', '/^\\w{4,20}$/');\n $this->_val->removeTags('token');\n $this->checkValidation();\n }", "public function validacoesRegistrar() {\n\n\t\t$this->load->library('form_validation');\n\t\t\n\t\t// configurando regras de validacao\n\t\t$this->form_validation->set_rules(\n\t\t\t'login', \n\t\t\t'login', \n\t\t\t'trim|required|alpha_numeric|min_length[4]|is_unique[usuario.login]',\n\t\t\tarray(\n\t\t\t\t'is_unique' => 'Este usuário já existe.',\n\t\t\t\t'required' => 'Login é obrigatório',\n\t\t\t\t'min_length' => 'Login não pode possuir menos de 4 caracteres',\n\t\t\t\t'alpha_numeric' => 'Apenas letras e números são aceitos.'\n\t\t\t)\n\t\t);\n\t\t$this->form_validation->set_rules(\n\t\t\t'email',\n\t\t\t'Email',\n\t\t\t'trim|required|valid_email|is_unique[usuario.email]',\n\t\t\tarray(\n\t\t\t\t'is_unique' => 'E-mail já cadastrado. Por favor, escolha outro.',\n\t\t\t\t'valid_email' => 'Formato do e-mail inválido.',\n\t\t\t\t'required' => 'E-mail é obrigatório.'\n\t\t\t)\n\t\t);\n\t\t$this->form_validation->set_rules(\n\t\t\t'senha',\n\t\t\t'senha',\n\t\t\t'trim|required|min_length[6]',\n\t\t\tarray(\n\t\t\t\t'min_length' => 'Senha deve possuir no mínimo 6 caracteres.',\n\t\t\t\t'required' => 'Senha é obrigatória.'\n\t\t\t)\n\t\t);\n\t\t$this->form_validation->set_rules(\n\t\t\t'senha_confirm',\n\t\t\t'Confirm senha',\n\t\t\t'trim|required|min_length[6]|matches[senha]',\n\t\t\tarray(\n\t\t\t\t'matches' => 'Senha e Confimação de senha devem ser iguais.',\n\t\t\t\t'required' => 'Confimação de senha é obrigatória.'\n\t\t\t)\n\t\t);\n\n\t\treturn $this->form_validation->run();\n\t}", "public function validar($usuario){\n\t\t//implemente\r\n\t\treturn $usuario;\r\n\t}", "function check_user($post){\n if(isset($_SESSION[\"username\"])){\n set_user_id($_SESSION[\"username\"]);\n return \"success\";\n }\n if(isset($post[\"username\"]) && isset($post[\"password\"])){\n if(!csrf_valid($post)){\n return \"csrf-error\";\n }\n $username = (string) $post[\"username\"];\n $password = (string) $post[\"password\"];\n if($username===null || $password === null){\n return \"null-username-or-password\";\n }\n if(!username_valid($username)){\n return \"invalid-chars\";\n }\n return verify_user($username, $password);\n }\n }", "function validate($uname, $email, $pass, $vpass){\r\n\t\t$rnd = rand(-100000, 100000000);\t\r\n\t\t$data = file_get_contents(XORTIFY_JSON_API.'?xoops_user_validate='.urlencode(json_encode(array(\"username\"=> $this->json_xoops_username, \"password\"=> $this->json_xoops_password, \"validate\" => array('uname' => $uname, \"pass\" => $pass, \"vpass\" => $vpass, \"email\" => $email, \"time\" => time(), \"passhash\" => sha1((time()-$rnd).$uname.$pass), \"rand\"=>$rnd)))));\r\n\t\t\t$result = $this->obj2array(json_decode($data));\t\r\n\t\tif ($result['ERRNUM']==1){\r\n\t\t\treturn $result[\"RESULT\"];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t}", "function verificar()\n {\n\n $this->form_validation->set_rules('Usuario', 'Usuario', 'trim|required|xss_clean');\n $this->form_validation->set_rules('Clave', 'Clave', 'trim|required|xss_clean|callback_verificar_bd');\n if ($this->form_validation->run() == FALSE)\n {\n //Field validation failed.&nbsp; User redirected to login page\n $data['title'] = 'Loguearse';\n $data['errorlogin'] = \"error\";\n $this->load->view('users/login', $data);\n }\n else\n {\n $this->estadistica_dash();\n redirect(base_url() . 'users/dash/', 'refresh');\n }\n }", "public function validateUser($sender,$param)\r\n {\r\n \t$this->errorMessage->Text=\"\";\r\n \t$authManager=$this->Application->getModule('auth');\r\n \ttry\r\n \t{\r\n\t\t\tif($authManager->login($this->username->Text, $this->password->Text))\r\n\t\t\t{\r\n\t\t\t\t$this->Response->redirect('/admin/');\r\n\t\t\t}\r\n \t}\r\n \tcatch(AuthenticationException $ex)\r\n \t{\r\n\t \t$this->errorMessage->Text=\"Invalid User!\";\r\n \t}\r\n }", "public function validateLogin() {\r\n if ($this->input->post()) {\r\n $user_name = $this->input->post('email');\r\n $password = $this->input->post('password');\r\n if ($user_name !== '' && $password !== '') {\r\n $register = $this->Login_model->validateUserModel($user_name, md5($this->input->post('password')));\r\n //Si es cero no existe usuario \r\n if ($register == 0) {\r\n //$this->loadView('login');\r\n redirect($this->config->item('CONSTANT_LOADVIEW') . 'login' . '');\r\n } else {\r\n $user_id = $this->Api_model->getId('user_replacement', 'email', 'id_user', $user_name);\r\n $newdata = array(\r\n 'username' => $user_name,\r\n 'email' => $user_name,\r\n 'id_user' => $user_id,\r\n 'logged' => TRUE\r\n );\r\n $this->createSesion($newdata);\r\n redirect($this->config->item('CONSTANT_LOADVIEW') . 'index' . '');\r\n }\r\n } else {\r\n redirect($this->config->item('CONSTANT_LOADVIEW') . 'index' . '');\r\n }\r\n } else {\r\n if ($this->isLogin()) {\r\n echo 'ESTA LOGUEADO';\r\n } else {\r\n echo 'NO LOGUIN';\r\n }\r\n }\r\n $password = null;\r\n }", "function Verificar(){\n //admin@admin.com\n //pass: 123456\n if (isset($_POST['input_user']) && isset($_POST['input_password'])) {\n $user = $_POST['input_user'];\n $pass = $_POST['input_password'];\n $userFromDB = $this->loginModel->getUser($user);\n\n if (isset($userFromDB) && $userFromDB) {\n\n if(password_verify($pass, $userFromDB->password)){\n session_start();\n $_SESSION['EMAIL'] = $userFromDB->email;\n $_SESSION['ID']= $userFromDB->id;\n $_SESSION['NAME']= $userFromDB->nombre;\n\n header(\"Location: \" . BASE_URL . \"administrador\"); \n \n } else {\n $this->loginView->showLogin('Password incorrecto');\n }\n } else {\n $this->loginView->showLogin('El usuario no existe');\n }\n }\n }", "private function validate() {\n\t\t/*if(@$this->validSecure == false)\n\t\t{\n\t\t\t@$this->error['error_warning'] = @$this->language->get('error_warning');\n\t\t}*/\n\t\t\n\t\t//Kiem tra dang nhap\n\t\t\n\t\tif(@$this->request->post['username']==\"\")\n\t\t\t@$this->error['error_warning'] = @$this->language->get('error_warning');\n\t\telse\n\t\t{\n\t\t\t\t\n\t\t\tif (!@$this->login(@$this->request->post['username'], @$this->request->post['password'])) \n\t\t\t{\n\t\t\t\t\n\t\t\t\t@$this->error['error_warning'] = @$this->language->get('error_warning');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif (!@$this->error) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function validUser($data)\n {\n $result = mysqli_query(self::$db,\"SELECT * FROM user WHERE username='\" . $data[\"username\"] . \"' and password = '\". md5($data[\"password\"]) .\"'\");\n $count = mysqli_num_rows($result);\n if($count == 0){\n return false;\n }\n else {\n return true;\n }\n\n }", "private function registerNewUser()\n {\n if (empty($_POST['user_name'])) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Nome de Usuário Vazio</div>\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Senha Vazia</div>\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>As senhas repetidas não são as mesmas</div>\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>A senha tem um comprimento mínimo de 6 caracteres</div>\";\n } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>O nome de usuário não pode ser menor que 2 ou maior que 64 caracteres</div>\";\n } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>O nome de usuário não se ajusta ao esquema de nomes: somente a-Z e números são permitidos, 2 a 64 caracteres</div>\";\n } elseif (empty($_POST['user_email'])) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>E-mail não pode estar vazio</div>\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>O email não pode ter mais de 64 caracteres</div>\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Seu endereço de e-mail não está em um formato de e-mail válido</div>\";\n } elseif (!empty($_POST['user_name'])\n && strlen($_POST['user_name']) <= 64\n && strlen($_POST['user_name']) >= 2\n && preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])\n && !empty($_POST['user_email'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && !empty($_POST['user_password_new'])\n && !empty($_POST['user_password_repeat'])\n && ($_POST['user_password_new'] === $_POST['user_password_repeat'])\n ) {\n // create a database connection\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // change character set to utf8 and check it\n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n }\n\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n\n // escaping, additionally removing everything that could be (html/javascript-) code\n $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));\n $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n $user_password = $_POST['user_password_new'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM users WHERE user_name = '\" . $user_name . \"' OR user_email = '\" . $user_email . \"';\";\n $query_check_user_name = $this->db_connection->query($sql);\n\n if ($query_check_user_name->num_rows == 1) {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Desculpe, esse nome de usuário / endereço de e-mail já foi usado.</div>\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO users (user_name, user_password_hash, user_email)\n VALUES('\" . $user_name . \"', '\" . $user_password_hash . \"', '\" . $user_email . \"');\";\n $query_new_user_insert = $this->db_connection->query($sql);\n\n // if user has been added successfully\n if ($query_new_user_insert) {\n $this->messages[] = \"<div class='row justify-content-center mt-5' style='color:#006600;'>Sua conta foi criada com sucesso. Agora você pode fazer login.</div>\";\n } else {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Desculpe, seu registro falhou. Por favor tente novamente.</div>\";\n }\n }\n } else {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Desculpe, nenhuma conexão com o banco de dados.</div>\";\n }\n } else {\n $this->errors[] = \"<div class='row justify-content-center mt-5' style='color:#990000;'>Ocorreu um erro desconhecido.</div>\";\n }\n }", "function formValid($username, $password) {\r\n if (empty($username) || empty($password)) {\r\n global $usernameError;\r\n global $passwordError;\r\n if (empty($username)) {\r\n $usernameError = \"Username cannot be empty\";\r\n }\r\n if (empty($password)) {\r\n $passwordError = \"Password cannot be empty\";\r\n }\r\n return false;\r\n }\r\n return true;\r\n}", "function validate_user_signup()\n{\n}", "function validateUser($user, $pass){\n\t$dbConnection = connect(); //Run connect function \n\t/*\n\tDictionary:\n\t1 = User and password are a match\n\t2 = Username exists but the password is incorrect\n\t3 = Username doesn't exist. Meaning there is no account for this username\n\t\t- Future reference, I could use this and if an account doesn't exist then prompt the user to create a new one.\n\t*/\n\t$sqlCheck = \"select username, password from user where username = '$user'\";\n\t// $sqlCheck = \"selct username, passcode from users where passcode = \"\n\n\t//Run Query\n\t\ttry\n\t\t{\n\n\t\t\t$stmt=$dbConnection->query($sqlCheck);\n\n\t\t\t//If the rowcount is != 0 then there has been data returned\n\t\t\tif($stmt->rowcount() != 0){\n\t\t\t\t//Now we check if the username and the password are both correct\n\t\t\t\t$sqlCheck = \"select username, password from user where username = '$user' and password = '$pass'\";\n\t\t\t\t$stmt = $dbConnection->query($sqlCheck);\n\t\t\t\t\n\t\t\t\t//This means the entered details have been validated and the password is wrong\n\t\t\t\tif($stmt->rowcount() == 0)\n\t\t\t\t\treturn 2;\n\t\t\t\t//This means the entered details have been validated and are correct\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t//This means the entered details have been validated and the user doesn't exist\n\t\t\telse if($stmt->rowcount() == 0)\n\t\t\t\treturn 3;\n\t\t\t//Query was false or something has gone wrong\n\t\t\telse if($stmt === false)\n\t\t\t\tdie(\"Error executing the query: $sqlCheck\");\n\t\t}\n\t\tcatch(PDOException $error)\n\t\t{\n\t\t\t//Display error message if applicable\n\t\t\techo \"An error occured: \".$error->getMessage();\n\t\t}\n}", "function validateUser()\n{\n if(isUser('scoutmaster'))\n {\n\t\t\treturn 1;\n }\n return 0;\n}", "private function _userValidate( $username = null ) {\n \n if( is_null( $username ) || empty( $username ) ) {\n // Empty username\n return false;\n }\n return true;\n }", "public function checkIsValidForRegister() {\n\n $errors = array();\n \n\t\t//FIXME: Meter comprobación de dni correcto\n\t\tif (strlen($this->dni) < 5) {\n\t\t\t$errors[\"dni\"] = \"DNI must be at least 5 characters length\";\n }\n \n\t\tif (sizeof($errors)>0){\n\t\t\tthrow new ValidationException($errors, \"user is not valid\");\n\t\t}\n\t}", "function validarRegistracion($datos){\n $nombre = $datos[\"nombre\"];\n $apellido = $datos[\"apellido\"];\n $email = $datos[\"email\"];\n $pass = $datos[\"pass\"];\n $pass_hash = password_hash($pass, PASSWORD_DEFAULT);\n $pass_confirm = $datos[\"pass_confirm\"];\n $pass_verify = password_verify($pass, $pass_hash);\n $notificaciones = 0;\n if (isset($datos[\"notificaciones\"])){\n $notificaciones = 1;\n }\n\n if(strlen($nombre) < 5) {\n $errores []= \"El nombre debe teber al menos 4 caracteres\";\n }\n if(strlen($apellido) < 5) {\n $errores []= \"El apellido debe teber al menos 4 caracteres\";\n }\n if (filter_var($email, FILTER_VALIDATE_EMAIL) == false) {\n $errores[] =\"El mail no tiene el formato correcto <br>\";\n }\n if (strlen($pass) < 8) {\n $errores[] =\"La contraseña debe tener al menos 8 digitos\";\n }\n if (!preg_match('`[a-z]`', $pass)){\n $errores[] = \"La clave debe tener al menos una letra\";\n }\n if (!preg_match('`[0-9]`',$pass)){\n $errores[] = \"La clave debe tener al menos un caracter numérico\";\n }\n if ($pass !== $pass_confirm) {\n $errores[] = \"Las contranseñas no verifican\";\n }\n if(existeElEmail($email)){\n $errores[]= \"Este email ya existe\";\n }\n\n if(empty($errores)){\n //guardar los datos en un archivo\n //mover foto\n\n $miarchivo = dirname(_FILE_);\n $miarchivo = $miarchivo. \"/img/\";\n $miarchivo = $miarchivo. $pic_name;\n move_uploaded_file( $archivo , $miarchivo);\n\n save_registered_user($nombre, $email, $pass_hash, $id, $pic_name, $ext);\n\n header(\"location: home.php\");\n\n }else{\n return $errores;\n }\n }", "function validar_usuario()\n {\n //Se valida que la peticion venga mediante ajax y no mediante el navegador\n if($this->input->is_ajax_request()){\n // Si existe el usuario\n if ($this->sesion_model->validar_usuario($this->input->post('usuario'))) {\n // Se falso (Si hay un usuario)\n echo false;\n }else{\n // Verdadero (Disponible)\n echo true;\n }\n }else{\n //Si la peticion fue hecha mediante navegador, se redirecciona a la pagina de inicio\n redirect('');\n }\n }", "private function _validateForm(&$aVals, $aUser = array()){\n\t\tif(!isset($aVals['full_name']) || empty($aVals['full_name'])){\n\t\t\tPhpfox_Error::set('Bạn chưa nhập họ và tên');\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!isset($aVals['user_name']) || empty($aVals['user_name'])){\n\t\t\tPhpfox_Error::set('Bạn chưa nhập User Name');\n\t\t\treturn false;\n\t\t}\n\n\t\t$aVals['user_name'] = str_replace(' ', '-', $aVals['user_name']);\n\t\t$aVals['user_name'] = str_replace('_', '-', $aVals['user_name']);\n\t\t$aCoundExt = array();\n\t\tif($this->_bEdit && $aUser){\n\t\t\t$aCoundExt = array(\n\t\t\t\t'AND user_id <> ' . (int) $aUser['user_id'],\n\t\t\t);\n\t\t}\n\t\tif(!Phpfox::getService('user.validate')->user($aVals['user_name'], $aCoundExt)){\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!isset($aVals['email']) || empty($aVals['email'])){\n\t\t\tPhpfox_Error::set('Bạn chưa nhập Email');\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!Phpfox::getService('user.validate')->email($aVals['email'], $aCoundExt)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(!$this->_bCustomer){\n\t\t\tif(!$this->_bEdit){\t\t\n\t\t\t\tif(!isset($aVals['password']) || empty($aVals['password'])){\n\t\t\t\t\tPhpfox_Error::set('Bạn chưa nhập mật khẩu');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(!isset($aVals['re_password']) || empty($aVals['re_password'])){\n\t\t\t\t\tPhpfox_Error::set('Bạn chưa nhập lại mật khẩu');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif(isset($aVals['re_password']) && !empty($aVals['re_password'])){\n\t\t\t\t\tif($aVals['re_password'] != $aVals['password']){\n\t\t\t\t\t\tPhpfox_Error::set('Mật khẩu nhập lại không khớp');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!isset($aVals['phone']) || empty($aVals['phone'])){\n\t\t\tPhpfox_Error::set('Bạn chưa nhập số điện thoại');\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!Phpfox::getService('user.validate')->phone($aVals['phone'], $aCoundExt)){\n\t\t\treturn false;\n\t\t}\n\t\t// print_r($aVals); die();\n\t\tif(!isset($aVals['gender']) || empty($aVals['gender'])){\n\t\t\tPhpfox_Error::set('Bạn chưa chọn giới tính');\n\t\t\treturn false;\n\t\t}\n\n\t\tif($this->_bCustomer){\n\t\t\t$aVals['user_group_id'] = GUEST_USER_ID;\n\t\t}else{\n\t\t\tif(!isset($aVals['user_group_id']) || empty($aVals['user_group_id'])){\n\t\t\t\tPhpfox_Error::set('Bạn chưa chọn nhóm phòng ban');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif($this->_bCustomer){\n\t\t\t$aVals['view_id'] = 0;\n\t\t}else{\n\t\t\tif(!isset($aVals['view_id']) || $aVals['view_id'] == ''){\n\t\t\t\tPhpfox_Error::set('Bạn chưa chọn trạng thái');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "private function is_data_valid() {\n // $userPattern = \"/^[a-zA-z0-9._-]{6,15}$/\";\n // $passPattern = \"/^[a-zA-z0-9|{}().@$]{6,30}$/\";\n if ( preg_match( $this->userPattern, $this->username) && preg_match( $this->passPattern, $this->password ) )\n return TRUE;\n else\n return FALSE;\n }", "public function validateAccount()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n if ($user) {\n if (!$user->isConfirmed()) {\n $this->addError('username', Module::t('login', 'This account in not confirmed.'));\n } elseif (!$user->isActive()) {\n $this->addError('username', Module::t('login', 'This account in not activated.'));\n }\n }\n }\n }", "private function validateUser(){\n\n\t global $db;\n\n\t #check against the database to see if the username and password match.\n $db->SQL = \"SELECT id FROM ebb_users WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$validateUser = $db->affectedRows();\n\n\t\t#setup boolean return.\n\t\tif($validateUser == 0){\n\t\t return(false);\n\t\t}else{\n\t\t return(true);\n\t\t}\n\t}", "public function isPasswordValid($username, $password);", "public function validate(User $u)\n {\n }", "function VerificarUsuario(){\n $user = $_POST[\"input_user\"];\n $pass = $_POST[\"input_pass\"];\n if(isset($user)){\n $userFromDB = $this->model->GetUser($user);\n if(isset($userFromDB) && $userFromDB){\n $hash=$userFromDB->password;\n if(password_verify($pass, $hash)){\n session_start();\n $_SESSION['EMAIL'] = $userFromDB->email;\n $_SESSION[\"ID\"] = $userFromDB->id;\n $_SESSION[\"ADMIN\"] = $userFromDB->rol;\n //Si el Rol es uno, me lleva a las funciones de administrador\n if($_SESSION[\"ADMIN\"]==1){ \n header(\"Location: \".BASE_URL.\"adminProductos\");\n //Si el rol es cero, lo lleva la home\n }else if($_SESSION[\"ADMIN\"]==0){\n header(\"Location: \".BASE_URL.\"productos\");\n }\n }\n else{\n $this->view->ShowLogin(\"Contraseña incorrecta\");\n }\n }\n else{\n // No existe el user en la DB\n $this->view->ShowLogin(\"El usuario no existe\");\n }\n }\n }", "function user_login_validation($uname, $pass){\r\n\t//cek ke database\r\n\t$query = sprintf(\"SELECT * FROM tbl_user WHERE user_name = '%s' AND user_pass = '%s'\", \r\n\t\tmysql_real_escape_string($uname), mysql_real_escape_string($pass));\r\n\t$r = mysql_query($query);\r\n\t$r = mysql_num_rows($r);\r\n\tif($r == 1){\r\n\t\treturn true;\r\n\t} \r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "public function validateRegForm($name, $surname, $cf, $mail, $user, $pass1,$pass2){\n $FUtente= USingleton::getInstance('FUtente');\n \n $valid=true;\n if (preg_match('/[^A-Za-z\\s\\']/', $name)){\n $valid=false;\n $this->dataError(\"nome\");\n }\n \n if (preg_match('/[^A-Za-z\\s\\']/', $surname)){\n $valid=false;\n $this->dataError(\"cognome\");\n }\n \n if (strlen($cf)!=16 || preg_match('/[^A-Z\\d]/', $cf)|| !$FUtente->codiceFiscaleIsAvailable($cf)){\n $valid=false;\n $this->dataError(\"codice fiscale\");\n }\n \n if (!$FUtente->emailIsAvailable($mail)){\n $valid=false;\n $this->dataError(\"email\");\n }\n \n if (!$FUtente->usernameIsAvailable($user)){\n $valid=false;\n $this->dataError(\"username\");\n }\n \n if ($pass1!=$pass2 || strlen($pass1)<5){\n $valid=false;\n $this->dataError(\"password\");\n }\n return $valid;\n }", "function valid04 (){ \n\t\t$this->validate = array( \n\t\t\t\t\"username\" => array( \n\t\t\t\t\t\t'rule' => 'checkUsername', \n\t\t\t\t\t\t'message' => 'Username is not avaliable', \n\t\t\t\t\t\t), \n\t\t\t\t); \n\t\tif($this->validates($this->validate)) \n\t\t\treturn TRUE; \n\t\telse return FALSE; \n\t}", "function validateRegistration($dbConnexion) {\n\n // Variables declaration\n $isFormValid = true;\n\n // Checks the first name field\n if (!(preg_match('#^[a-z]+$#i', $_POST['reg_firstname']))) {\n $isFormValid = false;\n }\n\n // Checks the last name field\n if (!(preg_match('#^[a-z]+$#i', $_POST['reg_lastname']))) {\n $isFormValid = false;\n }\n\n // Checks if the username already exists\n if ($dbConnexion->isUsernameTaken($_POST['reg_username'])) {\n $isFormValid = false;\n }\n\n // Checks the username field\n if (!(preg_match('#^[a-z0-9_\\-.]+$#i', $_POST['reg_username']))) {\n $isFormValid = false;\n }\n\n // Checks the mail field\n if (!(preg_match('#^[a-z0-9.]{2,}@[a-z0-9]{2,}\\.([a-z]{2,4}){1}$#i', $_POST['reg_email']))) {\n $isFormValid = false;\n }\n\n // Checks the password\n if (!(preg_match('#^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,}$#i', $_POST['reg_password']))) {\n $isFormValid = false;\n }\n\n // Returns the validation state\n return $isFormValid;\n}", "function onValidate($credentials,&$result) {\n\n if ((isset($credentials[\"_domain\"])) && ($credentials[\"_domain\"] !== null)) {\n return false;\n }\n\n $result = true;\n \n $required = array(\"username\"=>\"username\",\"password\"=>\"password\",\"email\"=>\"email address\");\n $min_length = array(\n \"name\"=>5,\n \"username\"=>3,\n \"password\"=>5\n );\n\n $max_length = array( \n \"password\"=>32\n );\n \n foreach($required as $key=>$name) {\n if (!isset($credentials[$key])) {\n $result = VWP::raiseWarning(\"Missing \" . $name . \".\",get_class($this),null,false);\n } elseif (empty($credentials[$key])) {\n $result = VWP::raiseWarning(\"Missing \" . $name . \".\",get_class($this),null,false); \n }\n }\n\n foreach($min_length as $key=>$val) {\n if (strlen($credentials[$key]) < $val) {\n $result = VWP::raiseWarning(ucfirst($key) . \" must be at least $val characters!\",get_class($this),null,false);\n }\n }\n\n foreach($max_length as $key=>$val) {\n if (strlen($credentials[$key]) > $val) {\n $result = VWP::raiseWarning(ucfirst($key) . \" must be less than $val characters!\",get_class($this),null,false);\n }\n }\n\n $initial = substr($credentials[\"username\"],0,1);\n \n if (!preg_match('/[a-zA-Z]/',$initial)) {\n $result = VWP::raiseWarning(\"Username must start with a letter!\",get_class($this),false); \n }\n\n if (!preg_match('/^[a-zA-Z0-9_]+$/',$credentials[\"username\"])) {\n $result = VWP::raiseWarning(\"Invalid characters in username, Only [a-z, 0-9, and _ (underscore)] allowed!\",get_class($this),false); \n }\n \n return $result;\n }", "function validateUser($username,$password){\n // checking for injection\n $username=$this->check($username);\n $query=$this->getOne(\"SELECT * FROM users_info WHERE username='$username'\");\n // verifying user password\n $salt = $query['salt'];\n $encrypted_password = $query['password'];\n $hash = $this->checkhashSSHA($salt, $password);\n // check for password equality\n if ($encrypted_password == $hash) {\n // user authentication details are correct\n $_SESSION['username'] = $username;\n $_SESSION['user_id'] = $query['user_id']; \n return true;\n } else {\n // user authentication details are wrong\n return null;\n }\n }", "public function validateForm()\n {\n $fn = $this->firstname;\n $ln = $this->lastname;\n $city = $this->city;\n $username = $this->username;\n $password = $this->password;\n\n if ($fn == \"\" || $ln == \"\" || $city == \"\" || $username == \"\" || $password == \"\")\n {\n return false;\n }\n return true;\n }", "function registra_usuario() {\n\n\t\t// COMPROBACIONES DE SEGURIDAD\n\t\tarray_walk($_REQUEST, 'limpiarCadena');\t\n\n\t\t$nombre = htmlspecialchars(trim(strip_tags($_REQUEST[\"nombre\"])));\n\t\t$apellido1 = htmlspecialchars(trim(strip_tags($_REQUEST[\"ape1\"])));\n\t\t$apellido2 = htmlspecialchars(trim(strip_tags($_REQUEST[\"ape2\"])));\n\n\t\t$edad = htmlspecialchars(trim(strip_tags($_REQUEST[\"edad\"])));\n\t\t$email = htmlspecialchars(trim(strip_tags($_REQUEST[\"email\"])));\n\n\n\t\t$password = htmlspecialchars(trim(strip_tags($_REQUEST[\"pass\"])));\n\t\t// HASH\n\t\t$password_hased = password_hash($password, PASSWORD_DEFAULT);\n\n\n\t\tif(empty($nombre) || empty($edad) || empty($email) || empty($password) || empty($apellido1) || empty($apellido2) || !preg_match('/^[^@\\s]+@([a-z0-9]+\\.)+[a-z]{2,}$/i', $email) \t|| !is_numeric($edad) ||\n\t \t \t\t strlen($password) < 6 ){\n\n\t\t\techo \"<p> Se ha producido un error al enviar los datos del formulario. ¡Inténtalo de nuevo!</p>\";\n\n\t\t} else {\n\n\t\t\t// Comprobar si el email ya está registrado en la BD.\n\t\t\t$resultado = existe_email($email);\n\t\t\tif($resultado->num_rows != 0)\n\t\t\t\techo \"<p>El email introducido ya está registrado. Prueba con otro.</p>\";\n\t\t\telse {\n\t\t\t\t// Registrar el nuevo usuario en la BD.\n\t\t\t\tannadir_usuario($nombre, $apellido1, $apellido2, $email, $password_hased, $edad);\n\t\t\t\t// Iniciamos sesion\n\t\t\t\tsession_start();\n\t\t\t\t// Buscamos el usuario otra vez para obtener el id generado automaticamente\n\t\t\t\t$con = existe_email($email);\n\n\t\t\t\t$nFilas = n_filas($con);\n\n\t\t\t\tif($nFilas == 1){\n\t\t\t\t\t\n\t\t\t\t\t$filaUsuario = $con->fetch_object();\n\t\t\t\t\t$_SESSION['usuario_actual'] = $filaUsuario->id;\n\t\t\t\t\t$_SESSION['name'] = $filaUsuario->nombre;\n\t\t\t\t\t$_SESSION['rol'] = \"ESTUDIANTE\"; //Por defecto al registrarse el rol es estudiante. El administrador podrá cambiar el rol. No hace falta realizar consulta.\n\t\t\t\t\t\n\t\t\t\t\theader('Location: index.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function registerUsuario(){\n\t\t$sql = (\"SELECT * FROM usuario WHERE username = :username OR uemail = :uemail \");\n\t\t$query = $this->conx->prepare($sql);\n \t$query->bindParam(':username', $this->username);\n \t$query->bindParam(':uemail', $this->uemail);\n \t$query->execute();\n \t\n \tif ($query->rowCount() > 0){\n \t\techo\"<script language ='javascript'>alert('El usuario o Correo ya existen');</script>\";\n\t\t\t\treturn false;\n \t\t}\n\t\t\telse {\n\t\t\t\t $query2 = $this->conx->prepare(\"INSERT INTO usuario(username,uname,ulastname,upassword,uemail)\n \t\t VALUES (:username,:uname,:ulastname,:upassword,:uemail)\");\n \t\t\t$query2->bindParam(':username',$this->username);\n \t\t\t$query2->bindParam(':uname',$this->uname);\n\t\t \t$query2->bindParam(':ulastname',$this->ulastname);\n \t\t\t$query2->bindParam(':upassword',$this->upassword);\n \t\t\t$query2->bindParam(':uemail',$this->uemail);\n \t\t\t\n \t\tif($query2->execute()) {\n \t\t\t$rol= 'usuario';\n \t\t\t$nuevoUserId = $this->conx->lastInsertId();\n \t\t\t$nuevoRolId = $this->getIdRol($rol);\n\n \t\t\t\n \t\t\t$query3 = $this->conx->prepare(\"INSERT INTO usuariorol(idUsuario,idRoles) VALUES (:usuario,:rol)\");\n \t\t\t$query3->bindParam(':usuario',$nuevoUserId);\n \t\t\t$query3->bindParam(':rol',$nuevoRolId);\n \t\t\t$query3->execute();\n \t\t\treturn true;\n \t\t \n \t\t} else {\n \t\t\t\techo\"<script language ='javascript'>alert('NO');</script>\";\n \t\t\t\treturn false;\n \t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t}\t\n\t\t\treturn $nuevoUserid;\n\t}", "private function validateInformations(){ \n\n if(strlen($this->name) == 0){ //Vê se o campo \"Name\" está vazio\n $this->err[] = \"Preencha o nome.\";\n } else\n if(strlen($this->name) <= 4){ //Vê se o campo \"Name\" tem menos de 5 caracteres\n $this->err[] = \"Nome muito pequeno.\";\n }\n\n if(strlen($this->password) == 0){ //Vê se o campo \"Password\" está vazio\n $this->err[] = \"Preencha a senha.\";\n } else\n if(strlen($this->password) <= 5){ //Vê se o campo \"Password\" tem menos de 6 caracteres\n $this->err[] = \"Senha muito pequena.\";\n } else\n if(!($this->password === $this->confirmPassword)){ //Vê se a senha bate com a confirmação da senha\n $this->err[] = \"Senhas não correspondem\";\n }\n \n /**\n * Verifica se o usuário já está cadastrado\n */\n $cmd = $this->conn->query(' SELECT use_name \n FROM users \n WHERE use_name = \"'.$this->name.'\" \n ') or die ($this->conn->error);\n $data = $cmd->fetch_assoc();\n \n if(isset($data) && count($data) != 0){ //Vê se usuário já está cadastrado...\n $this->err[] = \"Usuário já cadastrado\";\n }\n\n /**\n * Visualiza se tem alguma falha nas informações do usuário\n */\n if(count($this->err) == 0){ //Vê se passou pela verificação...\n // $this->setUserInformations($this->name, $this->password, $this->avatar);\n return [true, $this->insertRegister()];\n } else {\n return [false, $this->err, 'previousPage' => 'register'];\n }\n }", "public function alta($datos){\n if(strcmp($datos['pass'] , $datos['passC'])){\n echo \"<li> Las constraseñas no coinciden\";\n return false;\n }\n unset($datos['passC']);\n $validation=Validator::validate($datos,\n ['nombre' => ['required','nombre'],\n 'apat' => ['required','nombre'],\n 'amat' => ['required','nombre'],\n 'usern' => ['required','alphanumeric'],\n 'pass' => ['required','texto'],\n 'mail' => ['required','mail']]);\n\n if($validation != false){\n echo $validation;\n return false;\n }\n /*\n $u = new Usuario($datos);\n print_r($u);\n $u->setRol(\"false\"); //no admin\n */\n $datos['rol'] = 'false';\n $info = $this->usuarioM->find($datos['usern'],'username');\n if(isset($info->username) === true){\n echo \"Usuario ya registrado\";\n return false;\n }\n return $this->usuarioM->alta($datos); \n }" ]
[ "0.7442168", "0.71509176", "0.7109765", "0.69002193", "0.68951654", "0.6879911", "0.68589026", "0.68342304", "0.6755333", "0.6740059", "0.6731604", "0.6725619", "0.67064434", "0.66824675", "0.6666806", "0.66533357", "0.6647487", "0.66131437", "0.6569928", "0.6561459", "0.6543715", "0.65413505", "0.6539938", "0.6527983", "0.65240234", "0.65227365", "0.650603", "0.6505476", "0.6495752", "0.64890873", "0.6481849", "0.64674515", "0.6467407", "0.6453361", "0.64503086", "0.6449068", "0.64397514", "0.6422883", "0.6419622", "0.6412469", "0.64026445", "0.64014024", "0.63938427", "0.63923025", "0.6391859", "0.6389693", "0.63886917", "0.6376353", "0.63754696", "0.6368732", "0.6362319", "0.6359571", "0.6337674", "0.63298726", "0.63283783", "0.6322656", "0.63162094", "0.6314382", "0.6313729", "0.63129336", "0.63117695", "0.6298991", "0.6297689", "0.629665", "0.6284525", "0.62844765", "0.62783825", "0.62719053", "0.62689394", "0.62641114", "0.6252564", "0.6248339", "0.6247367", "0.62426955", "0.62351805", "0.6224568", "0.621899", "0.62172425", "0.62139034", "0.6209808", "0.62094533", "0.6196958", "0.6194041", "0.61911666", "0.6190158", "0.6188603", "0.6186144", "0.6182032", "0.6172892", "0.6163754", "0.61617535", "0.61580396", "0.61574113", "0.6153511", "0.6152672", "0.61516285", "0.6143065", "0.6138445", "0.61382014", "0.6135922" ]
0.7241211
1
/ === Image Galleries ===
/ === Галереи изображений ===
function ohImageGallery() { if ( is_callable( 'twp_the_post_images' ) ) { $images = twp_the_post_images(); if ( $images ) { $galleryList = makeImageList( $images, 'page_gallery', 'thumbnail', 'thumbnail' ); $gallery = "<div class='gallery'><ul>$galleryList</ul></div>"; echo "<div class='images'>$gallery</div>"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cgalleries_images($item)\n\t{\n\t\t$gallery = mgalleries_read($item);\n\t\t$data['images'] = mgalleries_read_images($gallery['id']);\n\t\t$data['gal'] = $gallery;\n\t\tlloader_load_view('admin/subs/gallery_images', $data);\n\t}", "function get_post_galleries_images($post = 0)\n{\n}", "public function gallery()\n {\n $query = $this->model_image\n ->select('image');\n \n return $query->paginate(9);\n }", "static function read_gallery(): void {\n echo \"Reading gallery...\\n\";\n $directory = Settings::get_image_source_dir();\n $images = glob($directory . \"*\");\n foreach ($images as &$image) {\n $image = str_replace($directory, '', $image);\n }\n self::$images = $images;\n }", "function affinity_mikado_gallery_upload_get_images() {\n\t\t$ids = sanitize_text_field( $_POST['ids'] );\n\t\t$ids = explode(\",\", $ids);\n\t\tforeach ($ids as $id):\n\t\t\t$image = wp_get_attachment_image_src($id, 'thumbnail', true);\n\t\t\techo '<li class=\"mkd-gallery-image-holder\"><img src=\"' . esc_url($image[0]) . '\"/></li>';\n\t\tendforeach;\n\t\texit;\n\t}", "function jet_engine_get_gallery() {\n\tif ( ! class_exists( 'Jet_Engine_Img_Gallery' ) ) {\n\t\trequire_once jet_engine()->plugin_path( 'includes/classes/gallery.php' );\n\t}\n}", "function displayGalleries(){\n\t$sql = getGalleryIDs();\n\t$galleries = getGenericInfo($sql);\n\t\n\twhile ($row = $galleries->fetch()){\n\t outputCardNoImage($row[\"GalleryID\"], $row[\"GalleryName\"], $row[\"GalleryNativeName\"], $row[\"GalleryCity\"], $row[\"GalleryCountry\"]);\n\t}\n}", "function cot_files_gallery($source, $item, $field = '', $tpl = 'files.gallery', $limit = 0, $order = ''){\n return cot_files_display($source, $item, $field, $tpl, 'images', $limit, $order);\n}", "public function gallery(){\n\t\t$imageList = $this->image_model->getImageList(250,250);\n\t\t$data['imageList'] = $imageList;\n\t\t$this->load->view('Image/list',$data);\n\t}", "function add_gallery()\n{\n}", "function get_post_gallery_images($post = 0)\n{\n}", "function zuhaus_mikado_gallery_upload_get_images() {\n\t\t$ids = $_POST['ids'];\n\t\t$ids = explode( \",\", $ids );\n\t\t\n\t\tforeach ( $ids as $id ):\n\t\t\t$image = wp_get_attachment_image_src( $id, 'thumbnail', true );\n\t\t\techo '<li class=\"mkdf-gallery-image-holder\"><img src=\"' . esc_url( $image[0] ) . '\"/></li>';\n\t\tendforeach;\n\t\t\n\t\texit;\n\t}", "function fluid_edge_gallery_upload_get_images() {\n\t\t$ids = $_POST['ids'];\n\t\t$ids = explode(\",\", $ids);\n\t\tforeach($ids as $id):\n\t\t\t$image = wp_get_attachment_image_src($id, 'thumbnail', true);\n\t\t\techo '<li class=\"edgt-gallery-image-holder\"><img src=\"'.esc_url($image[0]).'\"/></li>';\n\t\tendforeach;\n\t\texit;\n\t}", "public function gallery()\n {\n return page('gallery');\n }", "function media_upload_gallery()\n{\n}", "public function Addgallery() {\n $this->_upload_file($this->_base_path .'/images/gallery/', array( '.png', '.jpg', '.jpeg', '.gif', '.svg' ), 'addgallery');\n }", "public function GalleryList()\n\t{\tob_start();\n\t\t$galleries = array();\n\t\tif ($raw_galleries = $this->GetGalleries())\n\t\t{\tforeach ($raw_galleries as $gallery_row)\n\t\t\t{\t$gallery = new Gallery($gallery_row);\n\t\t\t\tif ($gallery->photos)\n\t\t\t\t{\t$galleries[] = $gallery;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($galleries)\n\t\t{\t\n\t\t\techo '<script type=\"text/javascript\">courseID=', $this->id, '; $().ready(function(){$(\"body\").append($(\".jqmWindow\")); $(\"#gal_modal_popup\").jqm();});</script><!-- START gallery modal popup --><div id=\"gal_modal_popup\" class=\"jqmWindow\"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"galModalInner\"></div></div>',\n\t\t\t\t'<h3>', ucwords($this->content['ctype']), ' photos</h3>';\n\t\t\tforeach ($galleries as $gallery)\n\t\t\t{\t$title = $this->InputSafeString($gallery->details['title']);\n\t\t\t\t$count = 0;\n\t\t\t\techo '<div class=\"courseGalSelection\" onclick=\"OpenGalleryLightBox(', $gallery->id, ');\">';\n\t\t\t\tforeach ($gallery->photos as $photo_row)\n\t\t\t\t{\t$photo = new GalleryPhoto($photo_row);\n\t\t\t\t\tif ($img = $photo->HasImage('thumbnail'))\n\t\t\t\t\t{\techo '<img src=\"', $img, '\" alt=\"', $title = $this->InputSafeString($photo->details['title']), '\" title=\"', $title, '\" />';\n\t\t\t\t\t\tif (++$count >= 6)\n\t\t\t\t\t\t{\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t} else\n\t\t{\t//echo '<div id=\"galHolder\">Gallery to follow</div>';\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "function inkpro_simple_gallery( $images = array(), $link = 'attachment', $size = 'inkpro-thumb', $padding = 'no', $columns = 3, $hover_effect = 'default', $orderby = '', $inline_style = '', $class = '' ) {\r\n\r\n\t\tif ( 'rand' == $orderby ) {\r\n\t\t\tshuffle( $images );\r\n\t\t}\r\n\r\n\t\t$rand_id = rand( 0,999 );\r\n\t\t$selector = \"gallery-$rand_id\";\r\n\r\n\t\t$style = '';\r\n\t\t$class .= \" gallery wolf-images-gallery clearfix simple-gallery hover-$hover_effect\";\r\n\r\n\t\tif ( $inline_style ) {\r\n\t\t\t$style .= $inline_style;\r\n\t\t}\r\n\r\n\t\tif ( 'yes' == $padding ) {\r\n\t\t\t$class .= \" padding\";\r\n\t\t}\r\n\r\n\t\t$columns = absint( $columns );\r\n\r\n\t\t$output = '';\r\n\r\n\t\tif ( 1 == $columns ) {\r\n\t\t\t$size = 'inkpro-XL';\r\n\t\t}\r\n\r\n\t\t$class .= ' gallery-' . $columns . '-columns'; \r\n\r\n\t\t$output .= '<div class=\"' . wolf_sanitize_html_classes( $class ) . '\" id=\"' . esc_attr( $selector ) . '\" style=\"' . wolf_sanitize_style_attr( $style ) . '\">';\r\n\r\n\t\tif ( array() == $images ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tforeach ( $images as $image_id ) {\r\n\r\n\t\t\t$attachment = get_post( $image_id );\r\n\r\n\t\t\tif ( $attachment ) {\r\n\t\t\t\t$image_url = esc_url( wolf_get_url_from_attachment_id( $image_id, $size ) );\r\n\r\n\t\t\t\t$file = esc_url( wolf_get_url_from_attachment_id( $image_id, 'inkpro-XL' ) );\r\n\t\t\t\t$image_page = get_attachment_link( $image_id );\r\n\t\t\t\t$href = ( 'post' == $link || 'attachment' == $link ) ? $image_page : $file;\r\n\t\t\t\t$class = ( 'file' == $link ) ? 'lightbox image-item' : 'image-item';\r\n\r\n\t\t\t\t$title = wptexturize( $attachment->post_title );\r\n\t\t\t\t$post_excerpt = wolf_sample( wptexturize( $attachment->post_excerpt ), 88 );\r\n\t\t\t\t$title_attr = ( $post_excerpt ) ? $post_excerpt : '';\r\n\r\n\t\t\t\t$output .= \"<div class='block'>\";\r\n\r\n\t\t\t\tif ( 'none' != $link ) {\r\n\t\t\t\t\t$output .= '<a title=\"' . esc_attr( $title_attr ) . '\" href=\"' . esc_url( $href ) . '\" class=\"' . wolf_sanitize_html_classes( $class ) . '\" rel=\"' . esc_attr( $selector ) . '\">';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$output .= '<span class=\"' . wolf_sanitize_html_classes( $class ) . '\">';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$do_lazy_load = wolf_get_theme_mod( 'do_lazyload' );\r\n\t\t\t\t\r\n\t\t\t\t$src = ( $do_lazy_load ) ? WOLF_THEME_URI . '/assets/img/blank.gif' : $image_url;\r\n\t\t\t\t\r\n\t\t\t\t$lazy_load = ( $do_lazy_load ) ? ' class=\"lazy-hidden\" data-src=\"' . esc_url( $image_url ) . '\"' : '';\r\n\r\n\t\t\t\t$output .= '<img' . $lazy_load . ' src=\"' . esc_url( $src ) . '\" alt=\"' .esc_attr( $title ) . '\">';\r\n\r\n\t\t\t\tif ( 'none' != $link )\r\n\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\telse\r\n\t\t\t\t\t$output .= '</span>';\r\n\r\n\t\t\t\t$output .= '</div>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$output .= '</div>';\r\n\r\n\t\tif ( array() != $images )\r\n\t\t\treturn $output;\r\n\t}", "public function get_all_gallery_image()\n {\n echo $this->gallery_model->get_all_gallery_image();\n }", "function renderGalleries()\n\t{\n\t\tglobal $modx;\n\n\t\t// Retrieve chunks/default templates from disk\n\t\t$tpl = ($this->config['tpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.default.txt') : $modx->getChunk($this->config['tpl']);\n\t\t$item_tpl = ($this->config['itemTpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.default.txt') : $modx->getChunk($this->config['itemTpl']);\n\t\t$item_tpl_first = ($this->config['itemTplFirst'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.first.txt') : $modx->getChunk($this->config['itemTplFirst']);\n\t\t$item_tpl_alt = ($this->config['itemTplAlt'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.alt.txt') : $modx->getChunk($this->config['itemTplAlt']);\n\t\t$item_tpl_last = ($this->config['itemTplLast'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.last.txt') : $modx->getChunk($this->config['itemTplLast']);\n\n\t\t// Hide/show docs based on configuration\n\t\t$docSelect = '';\n\t\tif ($this->config['docId'] != '*' && !empty($this->config['docId']))\n\t\t{\n\t\t\tif (strpos($this->config['docId'], ',') !== false)\n\t\t\t{\n\t\t\t\t$docSelect = 'parent IN ('.$this->config['docId'].')';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$docSelect = 'parent = ' . $this->config['docId'];\n\t\t}\n\t\tif ($this->config['excludeDocs'] > 0)\n\t\t{\n\t\t\t$excludeDocs = '';\n\t\t\tif (strpos($this->config['excludeDocs'], ',') !== false)\n\t\t\t{\n\t\t\t\t$excludeDocs = 'parent NOT IN ('.$this->config['excludeDocs'].')';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$excludeDocs .= 'parent != ' . $this->config['excludeDocs'];\n\t\t\tif (!empty($docSelect))\n\t\t\t\t$docSelect.= ' AND ';\n\t\t\t$docSelect.= $excludeDocs;\n\t\t}\n\n\t\t$phx = new PHxParser(); // Instantiate PHx\n\n\t\t$items = '';\n\n\t\t// Retrieve list of documents under the requested id\n\t\t$filter = \" WHERE deleted = '0' AND published = '1' AND type = 'document' AND hidemenu <= '\" . $this->config['ignoreHidden'] . \"'\";\n\t\tif (!empty($docSelect))\n\t\t\t$filter.=' AND '.$docSelect;\n\t\n\t\tif ($this->config['paginate']) {\n\t\t\t//Retrieve total records\n\t\t\t$totalRows = $modx->db->getValue('select count(*) from '.$modx->getFullTableName('site_content').$filter);\n\t\t\tif (!empty($this->config['limit']) && $totalRows>$this->config['limit'])\n\t\t\t\t$totalRows = $this->config['limit'];\n\t\t\t$limit = $this->paginate($totalRows);\n\t\t\tif (!empty($limit))\n\t\t\t\t$limit = ' limit '.$limit;\n\t\t} else\n\t\t\t$limit = !empty($this->config['limit']) ? ' limit '.$this->config['limit'] : \"\";\n\t\t$result = $modx->db->query(\"select id, pagetitle, longtitle, description, alias, pub_date, introtext, editedby, editedon, publishedon, publishedby, menutitle from \" . $modx->getFullTableName('site_content') . $filter. ' order by '. $this->config['gallerySortBy'] . ' ' . $this->config['gallerySortDir'] . $limit);\n\t\t$recordCount = $modx->db->getRecordCount($result);\n\t\tif ($recordCount > 0)\n\t\t{\n\t\t $count = 1;\n\t\t\twhile ($row = $modx->fetchRow($result))\n\t\t\t{\n\t\t\t\t$item_phx = new PHxParser();\n\n\t\t\t\t// Get total number of images for total placeholder\n\t\t\t\t$total_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\");\n $total = $modx->db->getRecordCount($total_result);\n\n\t\t\t\t// Fetch first image for each gallery, using the image sort order/direction\n\t\t\t\t$image_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\", $this->config['sortBy'] . ' ' . $this->config['sortDir'], '1');\n\t\t\t\tif ($modx->db->getRecordCount($image_result) > 0)\n\t\t\t\t{\n\t\t\t\t\t$image = $modx->fetchRow($image_result);\n\t\t\t\t\tforeach ($image as $name => $value)\n\t\t\t\t\t\tif ($name=='filename')\n\t\t\t\t\t\t\t$item_phx->setPHxVariable($name, rawurlencode(trim($value)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\t\t\t\t\t$item_phx->setPHxVariable('images_dir', $this->config['galleriesUrl'] . $row['id'] . '/');\n\t\t\t\t\t$item_phx->setPHxVariable('thumbs_dir', $this->config['galleriesUrl'] . $row['id'] . '/thumbs/');\n\t\t\t\t\t$item_phx->setPHxVariable('original_dir', $this->config['galleriesUrl'] . $row['id'] . '/original/');\n\t\t\t\t\t$item_phx->setPHxVariable('plugin_dir', $this->config['snippetUrl'] . $this->config['type'] . '/');\n\n\t\t\t\t\tforeach ($row as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n \n // Get template variable output for row and set variables as needed\n $row_tvs = $modx->getTemplateVarOutput('*',$row['id']);\n\t\t\t\t\tforeach ($row_tvs as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\n\t\t\t\t\t$item_phx->setPHxVariable('total', $total);\n\n \t\t\t\tif(!empty($item_tpl_first) && $count == 1){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_first);\n \t\t\t\t} else if(!empty($item_tpl_last) && $count == $recordCount){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_last);\n \t\t\t\t} else if(!empty($item_tpl_alt) && $count % $this->config['itemAltNum'] == 0){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_alt);\n \t\t\t\t} else {\n \t\t\t\t$items .= $item_phx->Parse($item_tpl);\n \t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$phx->setPHxVariable('items', $items);\n\t\t$phx->setPHxVariable('plugin_dir', $this->config['snippetUrl'] . $this->config['type'] . '/');\n\n\t\treturn $phx->Parse($tpl); // Pass through PHx;\n\t}", "public function instagram_galleries() {\n require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');\n /* Array of IDs of instagram galleries.*/\n $response = array();\n $instagram_galleries = WDWLibraryEmbed::check_instagram_galleries();\n if ( !empty($instagram_galleries[0]) ) {\n foreach ( $instagram_galleries as $gallery ) {\n array_push($response, WDWLibraryEmbed::refresh_social_gallery($gallery));\n }\n }\n }", "function my_gallery()\n\t{\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_institute()) {\n\t\t\t$this->prepare_flashmessage(get_languageword('You dont have permission to access this page'), 1);\n\t\t\tredirect('auth/login', 'refresh');\n\t\t}\n\t\t$this->data['activemenu'] \t= \"account\";\n\t\t$this->data['activesubmenu'] = \"gallery\";\n\t\t$this->data['pagetitle'] = get_languageword('My Gallery');\n\t\t\t\t\n\t\t$this->load->library('Image_crud');\n\t\t$image_crud = new image_CRUD();\n\t\t$image_crud->unset_jquery(); //As we are using our jQuery bundle we need to unset default jQuery\n\t\t\n\t\t$image_crud->set_table($this->db->dbprefix('gallery'));\n\t\t$image_crud->set_relation_field('user_id');\n\t\t$image_crud->set_ordering_field('image_order');\n\t\t\n\t\t$image_crud->set_title_field('image_title');\n\t\t$image_crud->set_primary_key_field('image_id');\n\t\t$image_crud->set_url_field('image_name');\n\t\t$image_crud->set_image_path('assets/uploads/gallery');\n\t\t$output = $image_crud->render();\n\t\t$output->grocery = TRUE;\n\t\t$this->data['grocery_output'] = $output;\n\t\t$this->data['grocery'] = TRUE;\n\t\t$this->_render_page('template/site/institute-template-grocery',$this->data);\n\t}", "public function display_gallery() {\n\t\t\tglobal $post;\n\t\t\tif ( is_page_template( 'home_page.php' ) ) {\n\t\t\t\tif ( have_rows( 'linked_images' ) ) {\n\t\t\t\t\tprint( '<div class=\"flexbin\">' );\n\t\t\t\t\twhile ( have_rows( 'linked_images' ) ) {\n\t\t\t\t\t\tthe_row();\n\t\t\t\t\t\t$image = get_sub_field( 'image' );\n\t\t\t\t\t\t$caption = get_sub_field( 'caption' );\n\t\t\t\t\t\t$caption = $caption ? sprintf( '<span class=\"caption\">%s</span>', $caption ) : '';\n\t\t\t\t\t\t$page_id = get_sub_field( 'link' );\n\t\t\t\t\t\t$url = $page_id ? get_permalink( $page_id ) : esc_attr( $image['sizes']['large'] );\n\t\t\t\t\t\tprintf( '<a href=\"%s\"><img src=\"%s\">%s</a>', esc_url( $url ), esc_attr( $image['sizes']['medium'] ), $caption );\n\t\t\t\t\t}\n\t\t\t\t\tprint( '</div>' );\n\t\t\t\t}\n\t\t\t} elseif ( is_singular() ) {\n\t\t\t\t$images = get_field( 'page_images', $post->ID );\n\t\t\t\tif ( $images ) {\n\t\t\t\t\tprint( '<div class=\"flexbin\">' );\n\t\t\t\t\tforeach ( $images as $image ) {\n\t\t\t\t\t\t$caption = ( ! empty( $image['caption'] ) ) ? sprintf( '<span class=\"caption\">%s</span>', $image['caption'] ) : '';\n\t\t\t\t\t\tprintf( '<a href=\"%s\"><img src=\"%s\">%s</a>', esc_attr( $image['sizes']['large'] ), esc_attr( $image['sizes']['medium'] ), $caption );\n\t\t\t\t\t}\n\t\t\t\t\tprint( '</div>' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function load_images($page, $items_per_page, $items_total_count, $photos){\n\n for($i = ($page-1)*$items_per_page; $i<=(($items_per_page*$page)-1) && $i <=$items_total_count-1; $i++){\n echo \"\n <div class='col-xs-6 col-md-3'>\n <a class='thumbnail' href='gallery.php?id={$photos[$i]->id}'>\n <img src='admin/{$photos[$i]->picture_path()}' class='img-responsive home_page_photo'>\n </a>\n </div>\n \";\n }\n}", "public function mosaicImages () {}", "function tempera_get_gallery_images() { \n $images = array(); \n\n if ( function_exists( 'get_post_galleries' ) ) { \n $galleries = get_post_galleries( get_the_ID(), false ); \n if ( isset( $galleries[0]['ids'] ) ) \n $images = explode( ',', $galleries[0]['ids'] ); \n } else { \n $pattern = get_shortcode_regex(); \n preg_match( \"/$pattern/s\", get_the_content(), $match ); \n $atts = shortcode_parse_atts( $match[3] ); \n if ( isset( $atts['ids'] ) ) \n $images = explode( ',', $atts['ids'] ); \n } \n\n if ( ! $images ) { \n $images = get_posts( array( \n 'fields' => 'ids', \n 'numberposts' => 999, \n 'order' => 'ASC', \n 'orderby' => 'none', \n 'post_mime_type' => 'image', \n 'post_parent' => get_the_ID(), \n 'post_type' => 'attachment', \n ) ); \n } \n\n return $images; \n}", "public function GalleryList()\n\t{\tob_start();\n\t\tif ($gallery_row = $this->GetGallery())\n\t\t{\t$gallery = new Gallery($gallery_row);\n\t\t\techo '<script type=\"text/javascript\">courseID=', (int)$this->id, '; $().ready(function(){$(\"body\").append($(\".jqmWindow\")); $(\"#gal_modal_popup\").jqm();});</script><!-- START gallery modal popup --><div id=\"gal_modal_popup\" class=\"jqmWindow\"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"galModalInner\"></div></div><h3>', ucwords($this->ctype), ' photos</h3>';\n\t\t\t$title = $this->InputSafeString($gallery->details['title']);\n\t\t\t//echo '<div class=\"courseGalCover\"><img src=\"', $gallery->HasCoverImage('medium'), '\" alt=\"', $title, '\" title=\"', $title, '\" /><a onclick=\"OpenGallery(', $gallery->id, ');\">Photo Gallery Slideshow</a></div>';\n\t\t\t$count = 0;\n\t\t\techo '<div class=\"courseGalSelection\" onclick=\"OpenGallery(', $gallery->id, ');\">';\n\t\t\tforeach ($gallery->photos as $photo_row)\n\t\t\t{\t$photo = new GalleryPhoto($photo_row);\n\t\t\t\tif ($img = $photo->HasImage('thumbnail'))\n\t\t\t\t{\techo '<img src=\"', $img, '\" alt=\"', $title = $this->InputSafeString($photo->details['title']), '\" title=\"', $title, '\" />';\n\t\t\t\t\tif (++$count >= 6)\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\techo '</div>';\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "public function gallery()\n {\n $query = $this->model_image\n ->select('id', 'image');\n // ->orderBy('id', 'desc');\n // dd($query); \n return $query->get();\n }", "public function getImageThumbnails() {}", "function Gallery() {\n\t\t// Set our album directory\n\t\t$this->albumdir = ALBUM_FOLDER_SERVERPATH;\n\t\tif (GALLERY_DATA) {\n\t\t\t$this->data = unserialize(GALLERY_DATA);\n\t\t}\n\t\tif (isset($this->data['unprotected_pages'])) {\n\t\t\t$pages = @unserialize($this->data['unprotected_pages']);\n\t\t\tif (is_array($pages)) $this->unprotected_pages = $pages;\t//\tprotect against a failure\n\t\t}\n\n\t}", "function image($img_id, $size) {\n// Gibt das Bild selbst aus.\n require \"config.inc\";\n $myimg = myimg($img_id);\n $mygal = mygal(mysql_result($myimg,0,\"gallery\"));\n $gal_id = mysql_result($myimg,0,\"gallery\");\n $folder = mysql_result($mygal,0,\"folder\");\n $filename = mysql_result($myimg,0,\"filename\");\n $name = mysql_result($myimg,0,\"name\");\n list($width, $height) = getimagesize(\"galleries/$folder/images/$filename\");\n $sizename = $size;\n switch ($size) {\n case small: $size = $small; break;\n case medium: $size = $medium; break;\n case big: $size = $big; break;\n case original:\n if ($width>=$height) $size = $width;\n else $size = $height;\n break;\n }\n if (!file_exists(\"galleries/$folder/$sizename/$filename\")) {\n $size_w = $size_h = NULL;\n if ($width>=$height) $size_w = $size;\n else $size_h = $size;\n resize(\"galleries/$folder/images/$filename\", \"galleries/$folder/$sizename/\", $size_w, $size_h, \"no\", \"white\");\n }\n print \"<img src=\\\"galleries/$folder/$sizename/$filename\\\" alt=\\\"$name\\\" />\";\n}", "function Gallery($imageTool,$verbose, $cur_dir = 0){\n\t\t$this->verbose = $verbose;\n\t\t$this->current_dir = $cur_dir;\n\t\t$this->_imageTool = $imageTool;\n\t\t$this->loadDir();\n\t\t$this->getImages();\n\t}", "public function the_gallery() {\n\n\t\t$images = $this->getImages();\n\n\t\tif( !$images ) return false;\n\n\t\t$images = unserialize( $images );\n\n\t\tif( count($images) == 0 ) return false;\n\n\t\t$slides = $ol = array();\n\n\t\tif( count($images) == 1 ){\n\n\t\t\t$thumb \t= $this->getThumb( 'thumb' );\n\t\t\t$img \t= $this->getThumb( );\n\n\t\t\t$ol[] = '<li data-target=\"#thumb-view\" data-slide-to=\"0\" class=\"active\"><span><img src=\"' . $thumb . '\"></span></li>';\n\n\t\t\t$slides[] = '<div class=\"item clearfix active\"><img src=\"' . $img . '\"></div>';\n\t\t}\n\t\telse {\n\t\t\tforeach( $images as $key => $img ) {\n\n\t\t\t\t$thumb = $this->getSizeImg( $img, 'thumb' );\n\n\t\t\t\t$class = ( $key == 0 ) ? 'active' : '';\n\n\t\t\t\t$ol[] = '<li data-target=\"#thumb-view\" data-slide-to=\"' . $key . '\" class=\"' . $class . '\"><span><img src=\"' . $thumb . '\"></span></li>';\n\n\t\t\t\t$slides[] = '<div class=\"item clearfix ' . $class . '\"><img src=\"' . $img . '\"></div>';\n\t\t\t}\n\t\t}\n\n\t\t?>\n\t\t<div id=\"thumb-view\" class=\"carousel slide\" data-ride=\"carousel\">\n\n\t\t\t<div class=\"carousel-inner\">\n\t\t\t\t<?php echo implode(\"\", $slides) ?>\n\t\t\t</div>\n\t\t\t<ol class=\"carousel-indicators\">\n\t\t\t\t<?php echo implode(\"\", $ol) ?>\n\t\t\t</ol>\n\t\t</div>\n\t<?php\n\t}", "function sp_get_album_gallery( $post_id, $post_num = 10, $size = 'thumbnail', $cols ) {\n\n\t$album_location = get_post_meta($post_id, 'sp_album_location', true);\n\t$photos = explode( ',', get_post_meta( $post_id, 'sp_gallery', true ) );\n\t$out = '';\n\n\tif ( $photos[0] != '' ) :\n\t\t$out = '<div class=\"gallery sp-posts clearfix\">';\n\t\tforeach ( $photos as $image ) :\n\t\t\t$imageid = wp_get_attachment_image_src($image, $size);\n\t\t\t$out .= '<article class=\"post-' . $post_id . ' ' . $cols . '\">';\n\t\t\t$out .= '<a href=\"' . wp_get_attachment_url($image) . '\">';\n\t\t\t$out .= '<img class=\"attachment-medium wp-post-image\" src=\"' . $imageid[0] . '\">';\n\t\t\t$out .= '</a>';\n\t\t $out .= '</article>';\n\t\tendforeach; \n\t\t$out .= '</div>';\n\telse : \n\t\t$out .= '<h4>' . __( 'Sorry there is no image for this album.', SP_TEXT_DOMAIN ) . '</h4>';\t\n\tendif;\n\n\treturn $out;\n}", "function thumbs($img_id) {\n// Erzeugt die Übersicht mit Thumbnails.\n $myimg = myimg($img_id);\n $mygal = mygal(mysql_result($myimg,0,\"gallery\"));\n $org_id = $img_id;\n $img_id = mysql_result($mygal,0,\"first\");\n $folder = mysql_result($mygal,0,\"folder\");\n do {\n $myimg = myimg($img_id);\n $mycomm = mycomm($img_id);\n $filename = mysql_result($myimg,0,\"filename\");\n $name = mysql_result($myimg,0,\"name\");\n $file = \"galleries/$folder/thumbs/$filename\";\n if (!file_exists($file)||filesize(\"$file\")<1024) resize(\"galleries/$folder/images/$filename\",\"galleries/$folder/thumbs/\",\"100\",\"100\",\"yes\",\"white\");\n if ($img_id==$org_id) print \"<a href=\\\"index.php?img=$img_id\\\"><img src=\\\"$file\\\" alt=\\\"$name\\\" width=\\\"90\\\" height=\\\"90\\\" style=\\\"border: #a5a5a5 5px solid;\\\" hspace=\\\"3\\\" vspace=\\\"3\\\" /></a>\";\n elseif (mysql_num_rows($mycomm)>0) print \"<a href=\\\"index.php?img=$img_id\\\"><img src=\\\"$file\\\" alt=\\\"$name\\\" width=\\\"94\\\" height=\\\"94\\\" style=\\\"border: #a5a5a5 3px solid;\\\" hspace=\\\"3\\\" vspace=\\\"3\\\" /></a>\";\n else print \"<a href=\\\"index.php?img=$img_id\\\"><img src=\\\"$file\\\" alt=\\\"$name\\\" width=\\\"100\\\" height=\\\"100\\\" hspace=\\\"3\\\" vspace=\\\"3\\\" /></a>\";\n $img_id = mysql_result($myimg,0,\"next\");\n } while ($img_id != 0);\n}", "protected function populate_gallery() {\n\t\tif ( 'collaboration' === $this->container->type ) {\n\t\t\t$this->populate_gallery_from_uploads();\n\t\t} elseif ( 'story' === $this->container->type ) {\n\t\t\t$this->populate_gallery_from_sections();\n\t\t}\n\t\tif ( count( $this->container->gallery ) ) {\n\t\t\t$this->container->has_gallery = true;\n\t\t}\n\t}", "function getGalleries()\n\t{\n\t\t$db = new Database();\n\n\t\t$autoserice_id = getAutoservices()['aid'];\n\n\t\t//$db->join(\"termini\",\"avtoservis_termini\",\"termini.tid=avtoservis_termini.tid\",\"aid='$autoserice_id'\");\n\n\t\t$db->getWhere(\"*\",\"galerija\",\"aid='$autoserice_id'\");\n\n\t\tif($db->getRowsCount()>0)\n\t\t\t$galleries = $db->resultFromGet(true);\n\t\telse\n\t\t\t$galleries = 0;\n\n\t\t$db->closeConnection();\n\n\t\treturn $galleries;\n\t}", "public function galleryList()\n {\n $galleries = Gallery::all(); \n $images = Image::all(); \n return view(\"gallery.gallery\")->with('galleries',$galleries);\n }", "function wfMiniPreviewGetImageGalleries ( &$imagePage ) {\n\tglobal $wgMiniPreviewGalleryNamespace;\n\t$dbr = wfGetDB( DB_SLAVE );\n\t$res = $dbr->select(\n\t\tarray( 'page', 'imagelinks' ),\n\t\tarray( 'il_from' , 'page_title' ),\n\t\tarray(\n\t\t\t'page_id = il_from',\n\t\t\t'page_namespace' => $wgMiniPreviewGalleryNamespace,\n\t\t\t'il_to' => $imagePage->mTitle->getDBkey() )\n\t);\n\n\t$ret = array();\n\twhile( $x = $dbr->fetchObject ( $res ) ) {\n\t\t$ret[$x->il_from] = $x->page_title ;\n\t}\n\t$dbr->freeResult( $res );\n\treturn $ret;\n}", "public function light_image_gallery() {\r\n\t\t\t$labels = array(\r\n\t\t\t\t'name' => _x( 'New Photo Gallery', 'Post Type General Name', 'LGP_TXTDM' ),\r\n\t\t\t\t'singular_name' => _x( 'New Photo Gallery', 'Post Type Singular Name', 'LGP_TXTDM' ),\r\n\t\t\t\t'menu_name' => __( 'New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'name_admin_bar' => __( 'New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'parent_item_colon' => __( 'Parent Item:', 'LGP_TXTDM' ),\r\n\t\t\t\t'all_items' => __( 'All Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'add_new_item' => __( 'Add New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'add_new' => __( 'Add New Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'new_item' => __( 'New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'edit_item' => __( 'Edit New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'update_item' => __( 'Update New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'search_items' => __( 'Search New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'not_found' => __( 'Photo Gallery Not found', 'LGP_TXTDM' ),\r\n\t\t\t\t'not_found_in_trash' => __( 'Photo Gallery Not found in Trash', 'LGP_TXTDM' ),\r\n\t\t\t);\r\n\t\t\t$args = array(\r\n\t\t\t\t'label' => __( 'New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'label' => __( 'New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'description' => __( 'Custom Post Type For New Photo Gallery', 'LGP_TXTDM' ),\r\n\t\t\t\t'labels' => $labels,\r\n\t\t\t\t'supports' => array( 'title'),\r\n\t\t\t\t'taxonomies' => array(),\r\n\t\t\t\t'hierarchical' => false,\r\n\t\t\t\t'public' => true,\r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_menu' => true,\r\n\t\t\t\t'menu_position' => 65,\r\n\t\t\t\t'menu_icon' => 'dashicons-images-alt2',\r\n\t\t\t\t'show_in_admin_bar' => true,\r\n\t\t\t\t'show_in_nav_menus' => true,\r\n\t\t\t\t'can_export' => true,\r\n\t\t\t\t'has_archive' => true,\t\t\r\n\t\t\t\t'exclude_from_search' => false,\r\n\t\t\t\t'publicly_queryable' => true,\r\n\t\t\t\t'capability_type' => 'page',\r\n\t\t\t);\r\n\t\t\tregister_post_type( '_light_image_gallery', $args );\r\n\t\t\t\r\n\t\t}", "function inkpro_mosaic_gallery( $images = array(), $link = 'attachment', $hover_effect = 'default', $orderby = '', $carousel = true, $inline_style = '', $class = '' ) {\r\n\r\n\t\tif ( array() == $images ) return;\r\n\r\n\r\n\t\tif ( 'rand' == $orderby ) {\r\n\t\t\tshuffle( $images );\r\n\t\t}\r\n\r\n\t\t$rand_id = rand( 0,999 );\r\n\t\t$selector = \"gallery-$rand_id\";\r\n\r\n\t\t$style = '';\r\n\t\t$class .= \" gallery wolf-images-gallery clearfix hover-$hover_effect\";\r\n\r\n\t\tif ( $carousel ) {\r\n\t\t\t$class .= \" carousel-mosaic-gallery owl-carousel\";\r\n\t\t} else {\r\n\t\t\t$class .= \" mosaic-gallery\";\r\n\t\t}\r\n\r\n\t\tif ( $inline_style ) {\r\n\t\t\t$style .= $inline_style;\r\n\t\t}\r\n\r\n\r\n\t\t$output = '<div class=\"' . wolf_sanitize_html_classes( $class ) . '\" id=\"' . esc_attr( $selector ) . '\" style=\"' . wolf_sanitize_style_attr( $style ) . '\">';\r\n\r\n\t\t$i = 0;\r\n\r\n\t\tforeach ( $images as $image_id ) {\r\n\t\t\tif ( $i%6 == 0) {\r\n\t\t\t\tif ( $i == 0 ) {\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t\t$output .= '<div class=\"slide block\">';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t} elseif ( $i != count( $images ) ) {\r\n\t\t\t\t\t$output .= '</div><!--.block-->';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t\t$output .= '<div class=\"slide block\">';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$output .= '</div><!--.block-->';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/* Images sizes */\r\n\t\t\tif ( $i%6 == 1) {\r\n\t\t\t\t$size = 'inkpro-2x1';\r\n\r\n\t\t\t} elseif ($i%6 == 3 ) {\r\n\t\t\t\t$size = 'inkpro-1x2';\r\n\r\n\t\t\t} elseif( $i%6 == 5 ) {\r\n\t\t\t\t$size = 'inkpro-2x1';\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$size = 'inkpro-2x2';\r\n\t\t\t}\r\n\r\n\t\t\t$i++;\r\n\r\n\t\t\t$attachment = get_post( $image_id );\r\n\r\n\t\t\tif ( $attachment ) {\r\n\t\t\t\t$image_url = esc_url( wolf_get_url_from_attachment_id( $image_id, $size ) );\r\n\r\n\t\t\t\t$file = esc_url( wolf_get_url_from_attachment_id( $image_id, 'inkpro-XL' ) );\r\n\t\t\t\t$image_page = get_attachment_link( $image_id );\r\n\t\t\t\t$href = ( 'post' == $link || 'attachment' == $link ) ? $image_page : $file;\r\n\t\t\t\t$class = ( 'file' == $link ) ? 'lightbox image-item' : 'image-item';\r\n\r\n\t\t\t\t$title = wptexturize( $attachment->post_title );\r\n\t\t\t\t$post_excerpt = esc_attr( wolf_sample( wptexturize( $attachment->post_excerpt ), 88 ) );\r\n\t\t\t\t$title_attr = ( $post_excerpt ) ? \" title='$post_excerpt'\" : '';\r\n\r\n\t\t\t\tif ( 'none' != $link ) {\r\n\t\t\t\t\t$output .= '<a title=\"' . esc_attr( $post_excerpt ) . '\" href=\"' . esc_url( $href ) . '\" class=\"' . wolf_sanitize_html_classes( $class ) . '\" rel=\"' . esc_attr( $selector ) . '\">';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$output .= '<span class=\"' . wolf_sanitize_html_classes( $class ) . '\">';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$do_lazy_load = wolf_get_theme_mod( 'do_lazyload' );\r\n\t\t\t\t$src = ( $do_lazy_load ) ? WOLF_THEME_URI . '/assets/img/blank.gif' : $image_url;\r\n\t\t\t\t$lazy_load = ( $do_lazy_load ) ? ' class=\"lazy-hidden\" data-src=\"' . esc_url( $image_url ) . '\"' : '';\r\n\t\t\t\t$output .= '<img' . $lazy_load . ' src=\"' . esc_url( $src ) . '\" alt=\"' .esc_attr( $title ) . '\">';\r\n\r\n\t\t\t\t$output .= \"\\n\";\r\n\r\n\t\t\t\tif ( 'none' != $link ) {\r\n\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$output .= '</span>';\r\n\t\t\t\t\t$output .= \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} // end for each\r\n\r\n\t\t$output .= '</div><!--.block-->';\r\n\t\t$output .= \"\\n\";\r\n\t\t$output .= '</div><!--.wolf-images-gallery-->';\r\n\r\n\t\tif ( array() != $images ) {\r\n\t\t\treturn $output;\r\n\t\t}\r\n\t}", "private function GetGalleries()\n\t{\t$galleries = array();\n\t\t$sql = 'SELECT * FROM galleries ORDER BY gid';\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$galleries[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $galleries;\n\t}", "function set_dive_pictures(){\n global $_config, $t, $_lang, $globals; /*{{{*/\n $result = $this->result; \n $pic_class = new DivePictures;\n $pic_class->set_divegallery_info_direct($this->user_id);\n $pic_class->get_divegallery_info($result[0]['ID']);\n $divepics = $pic_class->get_image_link();\n $pics = count($divepics);\n\n if ($pics != 0) {\n if (isset($_config['divepics_preview'])) {\n $t->assign('pics2' , '1');\n $t->assign('image_link', $divepics);\n } else {\n $t->assign('pics' , '1');\n $globals['logid'] = $result[0]['ID'];\n $divepics = parse_mysql_query('divepics.sql');\n \n $t->assign('picpath_web', $_config['web_root'].\"/\".$_config['picpath_web'] . $divepics[0]['Path']);\n $t->assign('divepic_linktit', $_lang['divepic_linktitle_pt1']. \"1\". $_lang['divepic_linktitle_pt2']. $pics. $_lang['divepic_linktitle_pt3']. $result[0]['Number']);\n $divepic_pt = $_lang['divepic_pt1']. $pics;\n if ($pics == 1) {\n $divepic_pt .= $_lang['divepic_pt2s'];\n } else {\n $divepic_pt .= $_lang['divepic_pt2p'];\n }\n $divepic_pt .= $_lang['divepic_pt3'];\n $t->assign('divepic_pt', $divepic_pt);\n $image_link = array();\n for ($i=1; $i<$pics; $i++) {\n $image_link[$i-1] = \"<a href=\\\"\". $_config['web_root'].\"/\". $_config['picpath_web'] . $divepics[$i]['Path'];\n $image_link[$i-1] .= \"\\\" rel=\\\"lightbox[others]\\\"\\n\";\n $image_link[$i-1] .= \" title=\\\"\". $_lang['divepic_linktitle_pt1']. ($i + 1). $_lang['divepic_linktitle_pt2']. $pics;\n $image_link[$i-1] .= $_lang['divepic_linktitle_pt3']. $result[0]['Number'] .\"\\\"></a>\\n\";\n }\n $t->assign('image_link', $image_link);\n }\n }\n /*}}}*/\n }", "function generateGallery($repeater_field_name,$img_field_name,$id,$thumb_size) {\r\n\r\n\t$gallery_images = get_field($repeater_field_name,$id);\r\n\t\r\n\tif($gallery_images) {\r\n\t\r\n\t\techo '<div class=\"popup-gallery\"><div class=\"popup-gallery-container\"><h3>'.get_the_title($id).'</h3><ul class=\"gallery-images\">';\r\n\t\t$count = 1;\r\n\t\tfor($i=0,$size=count($gallery_images);$i<$size;$i++) {\r\n\t\t\t$thumbnail = wp_get_attachment_image_src($gallery_images[$i][$img_field_name], $thumb_size);\r\n\t\t\t$large = wp_get_attachment_image_src($gallery_images[$i][$img_field_name], 'large');\r\n\t\t\techo '<li'.($count > 1 ? ' class=\"hidden\"' : '').'><a href=\"'.$large[0].'\" title=\"'.get_the_title($gallery_images[$i][$img_field_name]).'\" rel=\"'.get_the_title($id).'\"><img src=\"'.$thumbnail[0].'\" /></a></li>';\r\n\t\t\t$count++;\r\n\t\t}\r\n\t\techo '</ul></div></div>';\r\n\t\t\r\n\t}\r\n\r\n\treturn $gallery_html;\r\n\t\r\n}", "function ciniki_gallery_imageList($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 'album_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Album'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n // \n // Check access to tnid as owner, or sys admin. \n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'gallery', 'private', 'checkAccess');\n $ac = ciniki_gallery_checkAccess($ciniki, $args['tnid'], 'ciniki.gallery.imageList');\n if( $ac['stat'] != 'ok' ) { \n return $ac;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n/* if( !isset($args['album']) ) {\n //\n // Load the list of albums and image counts\n //\n $strsql = \"SELECT IF(album='', 'Uncategorized', album) AS album, \"\n . \"COUNT(*) AS count \"\n . \"FROM ciniki_gallery \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"GROUP BY album \"\n . \"ORDER BY album \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.gallery', array(\n array('container'=>'albums', 'fname'=>'album', 'name'=>'album',\n 'fields'=>array('name'=>'album', 'count')), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['albums']) ) {\n return array('stat'=>'ok', 'album'=>'', 'images'=>array());\n }\n if( count($rc['albums']) > 1 ) {\n return array('stat'=>'ok', 'albums'=>$rc['albums']);\n }\n if( count($rc['albums']) == 0 ) {\n return array('stat'=>'ok', 'albums'=>array());\n }\n\n // \n // If there is only one album, go directly and list images\n //\n $args['album'] = $rc['albums'][0]['album']['name'];\n }\n*/\n //\n // Load the list of images for a album\n //\n $strsql = \"SELECT ciniki_gallery.id, \"\n . \"ciniki_gallery.name, \"\n . \"ciniki_gallery.webflags, \"\n . \"ciniki_gallery.image_id, \"\n . \"ciniki_gallery.description \"\n . \"FROM ciniki_gallery \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n if( isset($args['album_id']) && $args['album_id'] != '' ) {\n $strsql .= \"AND album_id = '\" . ciniki_core_dbQuote($ciniki, $args['album_id']) . \"' \";\n }\n/* if( $args['album'] == 'Uncategorized' ) {\n $strsql .= \"AND album = '' \";\n } else {\n $strsql .= \"AND album = '\" . ciniki_core_dbQuote($ciniki, $args['album']) . \"' \";\n } */\n $strsql .= \"ORDER BY ciniki_gallery.date_added DESC \";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.gallery', array(\n array('container'=>'images', 'fname'=>'id', 'name'=>'image',\n 'fields'=>array('id', 'name', 'webflags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['images']) ) {\n// return array('stat'=>'ok', 'album'=>$args['album'], 'images'=>array());\n return array('stat'=>'ok', 'images'=>array());\n }\n $images = $rc['images'];\n\n //\n // Add thumbnail information into list\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'loadCacheThumbnail');\n $image_ids = array();\n foreach($images as $inum => $image) {\n $image_ids[] = $image['image']['id'];\n if( isset($image['image']['image_id']) && $image['image']['image_id'] > 0 ) {\n $rc = ciniki_images_loadCacheThumbnail($ciniki, $args['tnid'], $image['image']['image_id'], 300);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.gallery.13', 'msg'=>'Unable to load image', 'err'=>$rc['err']));\n }\n $images[$inum]['image']['image_data'] = 'data:image/jpg;base64,' . base64_encode($rc['image']);\n }\n }\n\n// return array('stat'=>'ok', 'album'=>$args['album'], 'images'=>$images);\n return array('stat'=>'ok', 'images'=>$images, 'nplist'=>$image_ids);\n}", "public function gallery()\n {\n $photos = $this->photoService->all();\n $categories = $this->categoryService->all();\n $pages = $this->pageService->pages();\n return view('gallery')->with(['photos' => $photos , 'categories' => $categories , 'pages' => $pages ]);\n }", "function galleryImageThumbs( $source = 'product', $selector, $limit = 3 ) {\n\tif( $source == 'product' ) {\n\t\t// select the product from the database\n\t\t$getProduct = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$product = mysql_fetch_assoc( $getProduct );\n\t\t//check if it has an associated gallery video\n\t\t$hasGalVideo = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$rHasGalVideo = mysql_fetch_assoc($hasGalVideo);\n\t\t// get the products parent information\n\t\t$getParent = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $product['parent'] . \"'\" );\n\t\t$parent = mysql_fetch_assoc( $getParent );\n\t\t// set the path for the products gallery\n\t\tif($product['is_base'] == 1) {\n\t\t\t$path = './_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t\t$convPath2 = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t\t$thumbPath = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t\t} else {\n\t\t\t$path = './_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t\t$convPath2 = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t\t$thumbPath = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t\t}\n\t\t// check if the path exists\n\t\t$i = 0;\n\t\t$dir = opendir($path);\n\t\t$list = array();\n\t\twhile($file = readdir($dir)){\n\t\t\tif($file != \".\" and $file != \"..\" and $file != \"Thumbs.db\" and $file != \"_thumbnails\"){\n\t\t\t\t$ctime = filectime($data_path . $file) . \",\" . $file;\n\t\t\t\t$list[$ctime] = $file;\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t\tnatsort($list);\n\t\tforeach($list as $image){\n\t\t\t$i++;\n\t\t\t$dirCheck = BASE_THUMBNAIL . $thumbPath;\n\t\t\t//create directory if it doesn't exist\n\t\t\tif (!file_exists($dirCheck)) {\n \t\t\tmkdir($dirCheck, 0755, true);\n\t\t\t}\n\t\t\t//get sha1 hash of image\n\t\t\t$currentHash = (sha1_file($path . $image));\n\t\t\t//separate parts of image name\n\t\t\t$thumbImage = $image;\n\t\t\t$path_parts = pathinfo($thumbImage);\n\t\t\t$matchedImageName = $path_parts['filename'];\n\t\t\t//set rest of thumbnail conversion path\n\t\t\t$smallThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize 97x ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_sm' . '.' . $path_parts['extension'];\n\t\t\t$medThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize 265x ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_med' . '.' . $path_parts['extension'];\n\t\t\t$checkHash = mysql_query( \"SELECT * FROM xxxxxx WHERE thumbhash = '\" . $currentHash . \"' and imgname = '\" . $matchedImageName . \"' and selector = '\" . $selector . \"'\" );\n\t\t \tif(mysql_num_rows($checkHash)>0) {\n\t\t \t\t//matched with hash, do nothing\n\t\t \t} else {\n\t\t \t\t//convert image to thumbnails\n\t\t\texec($smallThumb);\n\t\t\texec($medThumb);\n\t\t\t$addHash = mysql_query(\"INSERT INTO xxxxxx (thumbhash, selector, imgname) VALUES ('$currentHash','$selector','$matchedImageName')\");\n\t\t\t}\n\t\t\tif($i <= $limit){\n\t\t\t\techo \"<a class='side-gallery-img dv-3'>\";\n\t\t\t\techo \"<div class='image animate'>\";\n\t\t\t\techo \"<img alt='\" . $product['meta_keywords'] . ' ' . $i . \"' title='\" . $product['meta_keywords'] . ' ' . $i . \"' class='animate lb magnific\";\n\t\t\t\tif( SET_LAZY_LOAD == 'true' ) {\n\t\t\t\t\techo \" lazy\";\n\t\t\t\t}\n\t\t\t\techo \"' data-group='\" . $selector . \"' data-id='\" . $i . \"' data-source='./serve.php?source=\".$path.\"&amp;image=\".$image.\"&amp;thumb=1' data-mfp-src='\".$path.$image.\"' itemprop='image' src='\" . $path . '_thumbnails/' . $path_parts['filename'] . '_med' . '.' . $path_parts['extension'] . '?' . filemtime($path . '_thumbnails/' . $path_parts['filename'] . '_med' . '.' . $path_parts['extension']) . \"' />\";\n\t\t\t\techo \"</div>\";\n\t\t\t\techo \"</a>\";\n\t\t\t} else { \n\t\t\t\techo \"<img alt='\" . $product['meta_keywords'] . ' ' . $i . \"' title='\" . $product['meta_keywords'] . ' ' . $i . \"' class='no-display magnific' data-mfp-src='\".$path.$image.\"' />\";\n\t\t\t}\n\t\t}\n\t\tif($i > $limit && $i > 0 || $rHasGalVideo !== false && mysql_num_rows($rHasGalVideo) > 0){\n\t\t\techo \"<div class='view-gallery-link'><a target='_blank' class='animate' href='\".DIR_ROOT.\"gallery/\".$selector.\"'>View Gallery</a></div>\";\n\t\t}\n\t\tif(empty($list)){ }\n\t}\n\t//use this function to check whether gallery button on item slider should be displayed\n\tif( $source == 'link' ) {\n\t\t// select the product from the database\n\t\t$getProduct = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$product = mysql_fetch_assoc( $getProduct );\n\t\t// get the products parent information\n\t\t$getParent = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $product['parent'] . \"'\" );\n\t\t$parent = mysql_fetch_assoc( $getParent );\n\t\t// set the path for the products gallery\n\t\tif($product['is_base'] == 1) {\n\t\t\t$path = './_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t} else {\n\t\t\t$path = './_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t}\n\t\t// check if the path exists\n\t\t$i = 0;\n\t\t$dir = opendir($path);\n\t\t$list = array();\n\t\twhile($file = readdir($dir)){\n\t\t\tif($file != \".\" and $file != \"..\" and $file != \"Thumbs.db\" and $file != \"_thumbnails\"){\n\t\t\t\t$ctime = filectime($data_path . $file) . \",\" . $file;\n\t\t\t\t$list[$ctime] = $file;\n\t\t\t}\n\t\t}\n\t\tif(!empty($list)){ ?>\n\t\t\t<a target=\"_blank\" class='product-slide-link gallery-link' href=\"<?php echo DIR_ROOT . 'gallery/' . $selector ?>\">View Gallery <i class='fa fa-angle-right'></i></a>\n\t\t<?php }\n\t}\n}", "public function getImageGalleries($img_id) {\n\t\t$params=array();\n\t\t$params[\"meta_id\"]=$img_id;\n\t\t$params[\"meta_type\"]='galitem';\n\t\t$params[\"post_type\"]='gal';\n\t\t$gals = $this->core->meta->getPostsByMeta($params);\n\t\t$gals->extend('rsExtGallery');\n\t\treturn $gals;\n\t}", "function inkpro_flexslider_gallery( $images = array(), $size = 'inkpro-2x1', $orderby, $inline_style = '', $class = '' ) {\r\n\r\n\t\tif ( 'rand' == $orderby ) {\r\n\t\t\tshuffle( $images );\r\n\t\t}\r\n\r\n\t\t$post_id = get_the_ID();\r\n\t\t$permalink = get_permalink();\r\n\t\t$selector = \"gallery-$post_id\";\r\n\r\n\t\t$style = '';\r\n\t\t$class .= ' gallery post-gallery-slider flexslider clearfix';\r\n\r\n\t\tif ( $inline_style ) {\r\n\t\t\t$style .= $inline_style;\r\n\t\t}\r\n\r\n\t\tif ( inkpro_is_blog() && 'masonry2' == inkpro_get_blog_display() ) {\r\n\t\t\t$class .= ' post-gallery-slider-slideshow';\r\n\t\t}\r\n\r\n\t\tif ( array() != $images ) {\r\n\t\t\t$output = '<div class=\"' . wolf_sanitize_html_classes( $class ) . '\" id=\"' . esc_attr( $selector ) . '\"><ul class=\"slides\">';\r\n\r\n\t\t\tforeach ( $images as $image_id ) {\r\n\t\t\t\t$attachment = get_post( $image_id );\r\n\r\n\t\t\t\tif ( $attachment ) {\r\n\t\t\t\t\t$image_url = esc_url( wolf_get_url_from_attachment_id( $image_id, $size ) );\r\n\t\t\t\t\t$title = wptexturize( $attachment->post_title );\r\n\t\t\t\t\t$alt = esc_attr( get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) );\r\n\t\t\t\t\t$alt = ( $alt ) ? $alt : $title;\r\n\t\t\t\t\t$post_excerpt = wolf_sample( wptexturize( $attachment->post_excerpt ), 88 );\r\n\t\t\t\t\t$title_attr = ( $post_excerpt ) ? $post_excerpt : '';\r\n\r\n\t\t\t\t\t$output .= '<li class=\"slide\">';\r\n\t\t\t\t\t$output .= '<img src=\"' . esc_url( $image_url ) . '\" alt=\"' .esc_attr( $alt ) . '\">';\r\n\r\n\t\t\t\t\t\tif ( $post_excerpt ) {\r\n\t\t\t\t\t\t\t$output .= '<p class=\"flex-caption\">' . sanitize_text_field( $post_excerpt ) . '</p>';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$output .= '</li>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$output .= '</ul></div>';\r\n\t\t}\r\n\r\n\t\treturn $output;\r\n\t}", "public function gallery()\n\t{\n\t\t$famosi = Famoso::orderBy('ID','asc')->get(array('ID','Nome','Foto'));\n\t\t\n\n\t\treturn View::make('famoso.gallery')\n\t\t\t\t\t->with('famosi',$famosi);\n\t}", "function phi_get_images_url() {\n\tglobal $post;\n\n\t$photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );\n\n\t$results = array();\n\n\tif ($photos) {\n\t\tforeach ($photos as $photo) {\n\t\t\t// get the correct image html for the selected size\n\t\t\n\t\t\t$results[] = wp_get_attachment_url($photo->ID);\n\t\t\t//$image_url[] = apply_filters('the_title', $photo->post_title);\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn $results;\n\t\n}", "public function index()\n {\n $images = Image::take(20)->get();\n return view('cms.pages.gallery.index')->with('images', $images);\n }", "function ListImages()\n\t{\t//echo \"<div id='stories'>\\n\";\n\t\t$images = new NewsImages();\n\t\t$images->AdminListImages();\n\t\t//echo \"</div>\\n\";\n\t}", "public function gallery() {\n $this->set('title_for_layout', 'Gallery');\n $this->render('gallery');\n }", "function getGalleries()\n {\n $dbMain = db_getDBObject(DEFAULT_DB, true);\n if (defined(\"SELECTED_DOMAIN_ID\")) {\n $dbObj = db_getDBObjectByDomainID(SELECTED_DOMAIN_ID, $dbMain);\n } else {\n $dbObj = db_getDBObject();\n }\n\n unset($dbMain);\n $sql = \"SELECT * FROM Gallery_Item WHERE item_type='article' AND item_id = $this->id ORDER BY gallery_id\";\n $r = $dbObj->query($sql);\n if ($this->id > 0) {\n while ($row = mysqli_fetch_array($r)) {\n $galleries[] = $row[\"gallery_id\"];\n }\n }\n\n return $galleries;\n }", "function gallery_divided()\n{\n\t\t\n\t\t$view = new View();\n\t\t$view->set('content', $this -> index->gallery_divided($_GET));\n\t\t$view->set('all', $this -> index->all());\n\t\t$view -> main_part = $view -> render2('gallery_divided_content');\n\t\t$view -> meta_tags = $view -> render2('gallery_meta_tags');\n\t\t$view -> render('layouts/layout');\t\n\n\n}", "function the_gallery_images( $ids ) {\n\t\t\n\t\t$image_array = explode( ',', trim( $ids ) );\n\t\t\n\t\t$class = 'redux-option-image';\n\n\t\t$image_string = \"\";\n\t\tforeach ( $image_array as $image_id ) {\n\t\t\t$image_url = wp_get_attachment_image_src( $image_id, 'thumbnail' );\n\t\t\t\n\t\t\t$image_string .= \"<img class='\".$class.\"' src='\".$image_url[0].\"' />\";\n\t\t}\n\t\t\n\t\treturn $image_string;\n\t}", "function get_images(){\n\t\t\t//in this case, the image folder INCLUDING the thubs folder\n\t\t\t$files = scandir($this->gallery_path);\n\t\t\t//Because the file URL's are going to have dots (nesting) we must substract these\n\t\t\t//once the data has been retrieved.\n\t\t\t$files = array_diff($files, array('.', '..', 'thumbs'));\n\t\t\t\n\t\t\t$images = array();\n\t\t\t\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$images[]= array (\n\t\t\t\t\t'url' => $this->gallery_path_url . $file,\n\t\t\t\t\t'thumb_url' => $this->gallery_path_url . 'thumbs/' . $file \n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $images;\t\t\t\n\t\t}", "public function getImages();", "function getAllGallerys() {\n $galleryList = db_select_all_gallerys();\n setValue('galleryList', $galleryList);\n}", "function load_gallery($id){\n\t\n\t$files = scandir('images/busesgallery/gallery/'.$id);\n\tunset($files[0]);\n\tunset($files[1]);\n\t\n\t$afterFirst = false;\n\t\n\tforeach($files as $file){\n\t \n\t if($afterFirst) echo '<a href=\"images/busesgallery/gallery/'.$id.'/'.$file.'\" rel=\"fancybox_'.$id.'\" class=\"fancy\"></a>';\n\t else{\n\t echo '<a href=\"images/busesgallery/gallery/'.$id.'/'.$file.'\" rel=\"fancybox_'.$id.'\" class=\"fancy\">zobacz galerie</a>'; \n\t $afterFirst = true;\n\t \n\t }\n\t \n\t\t\t\t \n\t \n\t}\n\t\n }", "function hys_photo_gallery($id = '') {\n\t\tglobal $post,$hys;\n\t\t\n\t\tif (!function_exists('attachments_get_attachments')) return;\n\t\t\n\t\t$id \t\t\t= (empty($id)) ? get_the_ID() : intval($id);\t\t\n\t\t$size \t\t\t= array(get_option('thumbnail_size_w'),get_option('thumbnail_size_h'));\n\t\t$attachments \t= attachments_get_attachments($id);\n\t\t$total_att \t\t= count($attachments);\n\t\t$return \t\t= '';\n\t\t\n\t\tif( $total_att > 1 ) {\n\t\t $return .= '<ul class=\"photo_gallery hys_gallery\" id=\"gallery_'.$id.'\">';\n\t\t for ($i=0; $i < $total_att; $i++) {\n\t\t\t\t\n\t\t\t\t// remove single quote to not break links\n\t\t \t$attachments[$i]['title'] \t = str_replace(array(\"'\"),'&rsquo;',$attachments[$i]['title']);\n\t\t \t$attachments[$i]['caption'] = str_replace(array(\"'\"),'&rsquo;',$attachments[$i]['caption']);\n\t\t \t\n\t\t \t//get image urls\n\t\t \t$thumbnail \t= wp_get_attachment_image_src($attachments[$i]['id'], 'thumbnail');\n\t\t\t\t$full \t\t= wp_get_attachment_image_src($attachments[$i]['id'], 'full');\n\t\t\t\t\n\t\t\t\t//construct the title(s)\n\t\t\t\t$title \t\t= (!empty($attachments[$i]['caption'])) ? $attachments[$i]['caption'] : '';\t\t\t\t\t\t\t\t\t\n\t\t\t\tif (@$hys['settings']['attach_use_titles'] == 1) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$title = $attachments[$i]['title'];\n\t\t\t\t\t$title .= \"</span><br /> <span>{$attachments[$i]['caption']}\"; //unbold caption\n\t\t\t\t}\n\t\t\t\t$txt_title = str_replace(\"'\",'&rsquo;',strip_tags($title)); //remove \"<br />\" from titles for alt=''s\n\t\t\t\t\n\t\t\t\tif (@$hys['settings']['attach_use_titles'] == 1 || !empty($attachments[$i]['caption'])) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$lbtitle = $attachments[$i]['title'];\n\t\t\t\t\t$lbtitle .= (!empty($attachments[$i]['caption'])) ? \" --- {$attachments[$i]['caption']}\" : ''; //unbold caption\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the thumbnail\n\t\t\t\t$return .= \"\\n<li><a rel='lightbox[{$post->ID}]' title=\\\"{$lbtitle}\\\" href='{$full[0]}'><img src='{$thumbnail[0]}' alt='{$txt_title}' style='width:{$size[0]}px;height:{$size[0]}px;' /></a>\";\n\t\t\t\t\n\t\t\t\t$opttitle = (@$hys['settings']['attach_use_titles'] == 1) ? \"<span class='hys_page_gallery_title'>{$attachments[$i]['title']}</span> \" : '';\n\t\t\t\t\n\t\t\t\tif (@$hys['hys_page_config']['show_pg_img_printlabel'] == 1) {\n\t\t\t\t\t$return .= \"<span class='hys_page_gallery_label hys_page_gallery_label_{$attachments[$i]['id']}'>\n\t\t\t\t\t\t\t\t\t{$opttitle}\n\t\t\t\t\t\t\t\t\t<span class='hys_page_gallery_caption'>{$attachments[$i]['caption']}</span>\n\t\t\t\t\t\t\t\t</span>\";\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$return .= \"</li>\\n\\n\";\n\t\t }\n\t\t $return .= '</ul>';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public function gallery_loop() {\n //make sure the query string is available\n global $query_string;\n\n $args = wp_parse_args($query_string);\n\n $query = array(\n 'tax_query' => array(\n 'relation' => 'OR',\n array(\n 'taxonomy' => 'post_format',\n 'terms' => array('post-format-gallery'),\n 'field' => 'slug',\n ),\n array(\n 'taxonomy' => 'category',\n 'terms' => array('gallery'),\n 'field' => 'slug',\n ),\n ),\n 'paged' => $args['paged'],\n 'post_type' => $this->post_type,\n );\n\n $this->set_query($query);\n\n $this->loop();\n }", "public static function featured_gallery( $size, $ajax ){\n\n if( get_post_gallery() ){\n\n $gallery = get_post_gallery( get_the_ID(), false );\n $ids = ( !empty( $gallery['ids'] ) ) ? explode( ',', $gallery['ids'] ) : null;\n\n ?>\n <div class=\"featured-image\">\n <?php if( parent::is_layout_list() || $ajax === 'ajax-list' ): ?>\n <div class=\"gallery-wrap\">\n <?php endif; ?>\n <div class=\"owl-gallery\">\n <div class=\"slider\">\n <?php\n\n if( is_array( $ids ) || is_object( $ids ) ){\n foreach( $ids as $id ){\n\n $image = wp_get_attachment_image( $id, $size );\n echo $image;\n\n }\n }\n\n ?>\n </div>\n <span class=\"prev\"><i class=\"fa fa-angle-left\"></i></span>\n <span class=\"next\"><i class=\"fa fa-angle-right\"></i></span>\n </div>\n <?php if( parent::is_layout_list() || $ajax === 'ajax-list' ): ?>\n </div>\n <?php endif; ?>\n </div>\n <?php\n\n }else{\n\n if( parent::is_layout_list() || $ajax === 'ajax-list' ){\n self::no_featured_media();\n }\n\n } // end if get_post_gallery()\n\n }", "function pr_gallery($attr) {\n $post = get_post();\n\n static $instance = 0;\n $instance++;\n\n if (!empty($attr['ids'])) {\n if (empty($attr['orderby'])) {\n $attr['orderby'] = 'post__in';\n }\n $attr['include'] = $attr['ids'];\n }\n\n $output = apply_filters('post_gallery', '', $attr);\n\n if ($output != '') {\n return $output;\n }\n\n if (isset($attr['orderby'])) {\n $attr['orderby'] = sanitize_sql_orderby($attr['orderby']);\n if (!$attr['orderby']) {\n unset($attr['orderby']);\n }\n }\n\n extract(shortcode_atts(array(\n 'order' => 'ASC',\n 'orderby' => 'menu_order ID',\n 'id' => $post->ID,\n 'itemtag' => '',\n 'icontag' => '',\n 'captiontag' => '',\n 'columns' => 4,\n 'size' => 'thumbnail',\n 'include' => '',\n 'exclude' => '',\n 'link' => ''\n ), $attr));\n\n $id = intval($id);\n // $columns = (12 % $columns == 0) ? $columns: 4;\n // $grid = sprintf('col-sm-%1$s col-lg-%1$s', 12/$columns);\n\n if ($order === 'RAND') {\n $orderby = 'none';\n }\n\n if (!empty($include)) {\n $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));\n\n $attachments = array();\n foreach ($_attachments as $key => $val) {\n $attachments[$val->ID] = $_attachments[$key];\n }\n } elseif (!empty($exclude)) {\n $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));\n } else {\n $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));\n }\n\n if (empty($attachments)) {\n return '';\n }\n\n if (is_feed()) {\n $output = \"\\n\";\n foreach ($attachments as $att_id => $attachment) {\n $output .= wp_get_attachment_link($att_id, $size, true) . \"\\n\";\n }\n return $output;\n }\n\n $unique = (get_query_var('page')) ? $instance . '-p' . get_query_var('page'): $instance;\n $output = '<div class=\"gallery gallery-' . $id . '-' . $unique . ' gallery--grid gallery--grid-'. $columns .'\">';\n\n foreach ($attachments as $id => $attachment) {\n\n $image_url_wide = wp_get_attachment_image_src( $id, 'full');\n // $image_url_large = wp_get_attachment_image_src( $id, 'large');\n // $image_url_medium = wp_get_attachment_image_src( $id, 'medium');\n $image_url_small = wp_get_attachment_image_src( $id, 'thumbnail');\n\n $output .= '<div class=\"grid-item\"><img class=\"\" src=\"'.$image_url_small[0].'\" width=\"'.$image_url_small[1].'\" height=\"'.$image_url_small[2].'\" alt=\"'.sanitize_text_field(trim($attachment->post_excerpt)).'\" /></div>';\n }\n\n $output .= '</div>';\n\n return $output;\n}", "function rhh_item_images($item,$index=1){\n $html=null;\n $captionID=1;\n $isFirst = true;\n foreach (loop('files', $item->Files) as $file){\n if ($isFirst) {\n // Skip first/main image.\n $isFirst = false;\n continue;\n }\n $img = array('image/jpeg','image/jpg','image/png','image/jpeg','image/gif');\n $mime = metadata($file,'MIME Type');\n if(in_array($mime,$img)) {\n\n $title=metadata($file, array('Dublin Core', 'Title')) ? metadata($file, array('Dublin Core', 'Title')) : 'Untitled';\n\n $title_formatted=link_to($file,'show','<strong>'.$title.'</strong>',array('title'=>'View File Record'));\n\n $desc=metadata($file, array('Dublin Core', 'Description'));\n\n $caption=rhh_file_caption($file);\n\n $src=WEB_ROOT.'/files/fullsize/'.str_replace( array('.JPG','.jpeg','.JPEG','.png','.PNG','.gif','.GIF'), '.jpg', $file->filename );\n\n $thumbsrc=WEB_ROOT.'/files/square_thumbnails/'.str_replace( array('.JPG','.jpeg','.JPEG','.png','.PNG','.gif','.GIF'), '.jpg', $file->filename );\n\n $html.= '<figure class=\"flex-image\" itemprop=\"associatedMedia\" itemscope itemtype=\"http://schema.org/ImageObject\" aria-label=\"'.$title.'\" aria-describedby=\"caption'.$captionID.'\">';\n\n $html.= '<a href=\"'.$src.'\" title=\"'.$title.'\" class=\"file flex\" style=\"background-image: url(\\''.$src.'\\');\" data-size=\"\">';\n\n $html.= '</a>';\n $html.= '<figcaption id=\"caption'.$captionID.'\" class=\"not-yet-defined;\"><h4>'.$title.'</h4>';\n $html.= '<p>'.$caption.'</p></figcaption>';\n\n $html.= '</figure>';\n $captionID++;\n } \n }\n if($html): ?>\n <h3><?php echo __('See Also');?></h3>\n <figure id=\"item-photos\" class=\"flex flex-wrap\" itemscope itemtype=\"http://schema.org/ImageGallery\">\n <?php echo $html;?>\n </figure> \n <!-- PhotoSwipe -->\n <div class=\"pswp\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"pswp__bg\"></div>\n <div class=\"pswp__scroll-wrap\">\n <div class=\"pswp__container\">\n <div class=\"pswp__item\"></div>\n <div class=\"pswp__item\"></div>\n <div class=\"pswp__item\"></div>\n </div>\n <div class=\"pswp__ui pswp__ui--hidden\">\n <div class=\"pswp__top-bar\">\n <div class=\"pswp__counter\"></div>\n <button class=\"pswp__button pswp__button--close\" title=\"Close (Esc)\"></button>\n <button class=\"pswp__button pswp__button--share\" title=\"Share\"></button>\n <button class=\"pswp__button pswp__button--fs\" title=\"Toggle fullscreen\"></button>\n <button class=\"pswp__button pswp__button--zoom\" title=\"Zoom in/out\"></button>\n <div class=\"pswp__preloader\">\n <div class=\"pswp__preloader__icn\">\n <div class=\"pswp__preloader__cut\">\n <div class=\"pswp__preloader__donut\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"pswp__share-modal pswp__share-modal--hidden pswp__single-tap\">\n <div class=\"pswp__share-tooltip\"></div> \n </div>\n <button class=\"pswp__button pswp__button--arrow--left\" title=\"Previous (arrow left)\">\n </button>\n <button class=\"pswp__button pswp__button--arrow--right\" title=\"Next (arrow right)\">\n </button>\n <div class=\"pswp__caption\">\n <div class=\"pswp__caption__center\"></div>\n </div>\n </div>\n </div>\n </div> \n <?php endif;\n}", "public function index()\n {\n $images = DB::table('gallery_imgs')->get();\n return view('admin.gallery_img.index',compact('images'));\n }", "public function imageGallery($path) {\n\t\t$files = scandir(WWW_ROOT . $path);\n\t\t$html=\"\";\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$html .= '<li class=\"span3\"><div class=\"thumbnail\"><div class=\"text-center\"><img src=\"' . $this->webroot . $path . '/' . $file . '\"/><p><strong>' . $file . '</strong></p>' . $this->actionButtons($path . DIRECTORY_SEPARATOR . $file) .'</div></div></li>';\n\t\t}\n\t\treturn '<ul class=\"thumbnails\">' . $html . '</ul>';\n }", "public function display_images_section() {\n\n\t\tinclude_once 'partials/rt-slideshow-admin-display-images.php';\n\n\t}", "function getImages() {\n\t\t$dir = $this->_dirs[$this->current_dir];\n\t\t$temps = IMAGE_PATH . $dir;\n\t\tif($this->verbose) echo \"$temps <br>\";\n\t\t//_images has to be reset to prevent problems created by refreshing the page.\n\t\t$this->_images = null;\t\t\t\t\t\n\t\t\n\t\tif (is_dir($temps)) {\n\t \tif ($dh = opendir($temps)) {\n\t \twhile (($file = readdir($dh))) {\n\t\t\t\t\tif(is_file($temps.$file)) {\n\t\t\t\t\t\tif (preg_match(\"/\\.jp(g|eg)$/i\",$file)) {\n\t\t\t\t\t\t $type = \"jpeg\";\n\t\t\t\t\t\t} elseif (preg_match(\"/\\.gif$/i\",$file)) {\n\t\t\t\t\t\t $type = \"gif\";\n\t\t\t\t\t\t} elseif (preg_match(\"/\\.png$/i\",$file)) {\n\t\t\t\t\t\t $type = \"png\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($type){\n\t\t\t\t\t\t\t$s = sizeof($this->_images);\n\t\t\t\t\t\t\t$this->_images[] = new GalleryImage(IMAGE_PATH,$dir,$file,$type,DESC_DIR);\n\t\t\t\t\t\t\t$this->_images[$s]->setImageTool($this->_imageTool);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$type = \"\";\n\t\t\t\t\t}\n\t \t}\n\t \tclosedir($dh);\n\t \t}\n\t\t}\n\t}", "function print_gallery($where, $what){\r\r\n \t\r\r\n \t//what directory to use\r\r\n\t$dirName = \"images/kim_clothes/$where/$what\";\r\r\n\t\r\r\n\t//opens the directory for reading\r\r\n\t$dp = opendir($dirName)\r\r\n\t\tor die(\"<br><font color=\\\"#FF0000\\\">Cannot Open The Directory \\\"images/kim_clothes/$where/$what\\\" Please make sure the URL was typed correctly. <br>If you think you are revieving this message in error, please e-mail <a href=\\\"mailto:caps@kpfanworld.com\\\">Caps@kpfanworld.com</a></font></center></body></html>\");\r\r\n\t\r\r\n\t//add all files in directory to $theFiles array\r\r\n\twhile ($currentFile !== false){\r\r\n \t\t$currentFile = readDir($dp);\r\r\n \t\t$theFiles[] = $currentFile;\r\r\n\t} // end while\r\r\n\t\r\r\n\t//because we opened the dir, we need to close it\r\r\n\tclosedir($dp);\r\r\n\t\r\r\n\t//sorts all the files\r\r\n\tsort ($theFiles);\r\r\n\t\r\r\n\t//extract gif and jpg images because that is all we wnt to display\r\r\n\t$imageFiles = preg_grep(\"/jpg$|JPG$|gif$/\", $theFiles);\r\r\n\t$last_image = end($imageFiles);\r\r\n\t//begins printing out the gallery\r\r\n\t$output = \"\";\r\r\n\t$picInRow = 0;\r\r\n\tforeach ($imageFiles as $currentFile){\r\r\n\t if ($picInRow == 0){\r\r\n $output .= <<<HERE\r\r\n<tr>\r\r\nHERE;\r\r\n\t}//end if\r\r\n \t\t$output .= <<<HERE\r\r\n<td align=\"center\"><a href = \"kim_clothes/$where/$currentFile\"><img border = \"0\" alt=\"$currentFile\" src = \"images/kim_clothes/$where/$what/$currentFile\" title=\"Click To View Full Sized Image\"></a></td>\t\r\r\nHERE;\r\r\n\t$picInRow++;\r\r\n if ($picInRow == 4){//this controls how many images are in each row, this being set to 5 makes 5 images be in each row\r\r\n $output .= <<<HERE\r\r\n</tr>\\n\r\r\nHERE;\r\r\n $picInRow = 0;\r\r\n }else{\r\r\n\t\t \tif ($currentFile == $last_image)\r\r\n\t\t\t{\r\r\n\t\t \t$output .= <<<HERE\r\r\n</tr>\\n\r\r\nHERE;\r\r\n\t\t\t}\r\r\n \t}//end if\r\r\n\t} // end foreach\r\r\n\treturn $output;\r\r\n}", "function list_Images($cat, $name, $postID) {\n global $post;\n $args = array(\n 'post_parent' => $postID,\n 'post_type' => 'attachment',\n 'posts_per_page' => -1,\n 'post_status' => 'inherit',\n 'post_mime_type' => 'image/jpeg,image/gif,image/jpg,image/png',\n 'orderby' => 'menu_order ID',\n 'order' => 'ASC',\n 'tax_query' => array(\n array(\n 'taxonomy' => 'image_type',\n 'field' => 'slug',\n 'terms' => $cat\n )\n )\n );\n $query = new WP_Query($args);\n if($query->have_posts()) {\n echo '<div class=\"pane active\" id=\"'.$cat.'\">';\n echo '<h3 class=\"termName\">// '.$name.'</h3>';\n echo '<div class=\"imageWrap\">';\n while ($query->have_posts()) {\n $query->the_post();\n echo '<a href=\"#photomodal\" data-toggle=\"modal\" class=\"singlephoto\" data-photo=\"'.$post->guid.'\">';\n $image_url = wp_get_attachment_image_src($post->id, 'large');\n echo '<img src=\"'.$image_url[0].'\" alt=\"\" />';\n echo '<div class=\"playwrap\"><span class=\"plus\"></span></div>';\n echo '</a>';\n }\n echo '</div>';\n echo '</div>';\n }\n wp_reset_query();\n}", "public function Getgallery() {\n $type = $_POST['type'];\n $base_path = $this->_base_path.'/images/gallery';\n $this->_images = scandir($base_path);\n\n unset($this->_images[0]);\n unset($this->_images[1]);\n\n $response = array();\n $response['general'] = array();\n\n foreach ($this->_images as $image) {\n if (preg_match('#\\.ds_store#i', $image)) {\n continue;\n }\n if (is_file($base_path. '/' .$image)) {\n if ($type === 'retina') {\n $size = getimagesize( $base_path . '/' . $image );\n $response['general'][] = array(\n 'name' => $image . '?t=' . time(),\n 'path' => './images/gallery/' . $image\n ,\t'width' => $size[0]\n ,\t'height' => $size[1]\n );\n } else if ($type === 'normal') {\n $size = getimagesize( $base_path . '/' . $image );\n $srcset = '';\n if (preg_match('/([^.]*)(\\..*)/', $image, $match)) {\n $srcset = $match[1] . '@2x' . $match[2];\n if (!is_file($base_path. '/' .$srcset))\n $srcset = '';\n }\n\n $response['general'][] = array(\n 'name' => $image . '?t=' . time(),\n 'path' => url('backend\\assets\\builder\\images\\gallery'.'/'.$image),\n 'srcset' => $srcset,\n 'width' => 111,\n 'height' => 111\n );\n\n }\n } else {\n $innerImage = scandir($base_path. '/' .$image);\n unset($innerImage[0]);\n unset($innerImage[1]);\n\n $response[$image] = array();\n\n foreach ($innerImage as $imageL2) {\n if (preg_match('#\\.ds_store#i', $imageL2)) {\n continue;\n }\n if (is_file($base_path. '/' . $image . '/' . $imageL2)) {\n if ($type === 'retina') {\n $size = getimagesize( $base_path . '/' . $image . '/' . $imageL2 );\n $response[$image][] = array(\n 'name' => $imageL2 . '?t=' . time(),\n 'path' => './images/gallery/' . $image . '/' . $imageL2\n ,\t'width' => $size[0]\n ,\t'height' => $size[1]\n );\n } else if ($type === 'normal') {\n\n }\n }\n }\n }\n }\n\n echo json_encode(array('gallery' => $response));\n exit();\n }", "public function get_images(){\n\t\t$images = array();\n\t\t$ret\t= array();\n\t\t$image = $this->get_val($this->params, array('layout', 'bg', 'image'));\n\t\t$a_url = $this->get_val($this->params, array('troubleshooting', 'alternateURL'));\n\t\t\n\t\tif($image != '') $images[$image] = true;\n\t\tif($a_url != '') $images[$a_url] = true;\n\t\t\n\t\tif(!empty($this->slides) && count($this->slides) > 0){\n\t\t\tforeach($this->slides as $key => $slide){\n\t\t\t\t$params = $slide->get_params();\n\t\t\t\t$layers = $slide->get_layers();\n\t\t\t\t$image\t= $this->get_val($params, array('bg', 'image'));\n\t\t\t\t$thumb\t= $this->get_val($params, array('thumb', 'customThumbSrc'));\n\t\t\t\t$a_thumb = $this->get_val($params, array('thumb', 'customAdminThumbSrc'));\n\t\t\t\t\n\t\t\t\tif($image != ''){\n\t\t\t\t\t$altOption\t = $this->get_val($params, array('attributes', 'altOption'), 'media_library');\n\t\t\t\t\t$titleOption = $this->get_val($params, array('attributes', 'titleOption'), 'media_library');\n\t\t\t\t\t$alt\t\t = '';\n\t\t\t\t\t$title\t\t = '';\n\t\t\t\t\tswitch($altOption){\n\t\t\t\t\t\tcase 'media_library';\n\t\t\t\t\t\t\t$id = attachment_url_to_postid($image);\n\t\t\t\t\t\t\tif($id > 0) $alt = get_post_meta($id, '_wp_attachment_image_alt', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'file_name';\n\t\t\t\t\t\t\t$alt = $image;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'custom';\n\t\t\t\t\t\t\t$alt = $this->get_val($params, array('attributes', 'alt'), '');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch($titleOption){\n\t\t\t\t\t\tcase 'media_library';\n\t\t\t\t\t\t\t$id = attachment_url_to_postid($image);\n\t\t\t\t\t\t\tif($id > 0) $title = get_the_title($id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'file_name';\n\t\t\t\t\t\t\t$title = $image;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'custom';\n\t\t\t\t\t\t\t$title = $this->get_val($params, array('attributes', 'title'), '');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$images[$image] = array(\n\t\t\t\t\t\t'src' => $image,\n\t\t\t\t\t\t'alt' => $alt,\n\t\t\t\t\t\t'title' => $title\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif($thumb != '' && !isset($images[$thumb])) $images[$thumb] = true;\n\t\t\t\tif($a_thumb != '' && !isset($images[$a_thumb])) $images[$a_thumb] = true;\n\t\t\t\t\n\t\t\t\tif(!empty($layers)){\n\t\t\t\t\tforeach($layers as $layer){\n\t\t\t\t\t\t$type\t\t= $this->get_val($layer, 'type', 'text');\n\t\t\t\t\t\t$image\t\t= $this->get_val($layer, array('media', 'imageUrl'));\n\t\t\t\t\t\t$bg_image\t= $this->get_val($layer, array('idle', 'backgroundImage'));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($image != '' && !isset($images[$image]))\t$images[$image] = true;\n\t\t\t\t\t\tif($bg_image != '' && !isset($images[$bg_image])) $images[$bg_image] = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array($type, array('video', 'audio'))){\n\t\t\t\t\t\t\t$poster = $this->get_val($layer, array('media', 'posterUrl'), '');\n\t\t\t\t\t\t\tif($poster != '' && !isset($images[$poster])) $images[$poster] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($type === 'video'){\n\t\t\t\t\t\t\t$very_big\t= $this->get_val($layer, array('media', 'thumbs', 'veryBig'));\n\t\t\t\t\t\t\t$big\t\t= $this->get_val($layer, array('media', 'thumbs', 'big'));\n\t\t\t\t\t\t\t$large\t\t= $this->get_val($layer, array('media', 'thumbs', 'large'));\n\t\t\t\t\t\t\t$medium\t\t= $this->get_val($layer, array('media', 'thumbs', 'medium'));\n\t\t\t\t\t\t\t$small\t\t= $this->get_val($layer, array('media', 'thumbs', 'small'));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$very_big\t= (is_array($very_big) && isset($very_big['url'])) ? $very_big['url'] : $very_big;\n\t\t\t\t\t\t\t$big\t\t= (is_array($big) && isset($big['url'])) ? $big['url'] : $big;\n\t\t\t\t\t\t\t$large\t\t= (is_array($large) && isset($large['url'])) ? $large['url'] : $large;\n\t\t\t\t\t\t\t$medium\t\t= (is_array($medium) && isset($medium['url'])) ? $medium['url'] : $medium;\n\t\t\t\t\t\t\t$small\t\t= (is_array($small) && isset($small['url'])) ? $small['url'] : $small;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($very_big != '' && !isset($images[$very_big])) $images[$very_big] = true;\n\t\t\t\t\t\t\tif($big != '' && !isset($images[$big]))\t\t\t $images[$big] = true;\n\t\t\t\t\t\t\tif($large != '' && !isset($images[$large]))\t\t $images[$large] = true;\n\t\t\t\t\t\t\tif($medium != '' && !isset($images[$medium]))\t $images[$medium] = true;\n\t\t\t\t\t\t\tif($small != '' && !isset($images[$small]))\t\t $images[$small] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!empty($images)){\n\t\t\tforeach($images as $img => $b){\n\t\t\t\tif(!is_bool($b)){\n\t\t\t\t\t$ret[] = $b;\n\t\t\t\t}else{\n\t\t\t\t\t$alt = '';\n\t\t\t\t\t$title = '';\n\t\t\t\t\t$id = attachment_url_to_postid($img);\n\t\t\t\t\tif($id > 0){\n\t\t\t\t\t\tif($id > 0) $alt = get_post_meta($id, '_wp_attachment_image_alt', true);\n\t\t\t\t\t\tif($id > 0) $title = get_the_title($id);\n\t\t\t\t\t}\n\t\t\t\t\t$ret[] = array(\n\t\t\t\t\t\t'src' => $img,\n\t\t\t\t\t\t'alt' => $alt,\n\t\t\t\t\t\t'title' => $title\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function snax_render_gallery_items() {\n\tsnax_get_template_part( 'posts/gallery-items' );\n}", "function Images( $name, &$active, $javascript=NULL, $directory=NULL ) {\r\n\t\tglobal $Config_absolute_path;\r\n\r\n\t\tif ( !$directory ) {\r\n\t\t\t$directory = '/images/stories';\r\n\t\t}\r\n\r\n\t\tif ( !$javascript ) {\r\n\t\t\t$javascript = \"onchange=\\\"javascript:if (document.forms[0].image.options[selectedIndex].value!='') {document.imagelib.src='..$directory/' + document.forms[0].image.options[selectedIndex].value} else {document.imagelib.src='../images/blank.png'}\\\"\";\r\n\t\t}\r\n\r\n\t\t$imageFiles = mosReadDirectory( $Config_absolute_path . $directory );\r\n\t\t$images \t= array( mosHTML::makeOption( '', '- Select Image -' ) );\r\n\t\tforeach ( $imageFiles as $file ) {\r\n\t\t\tif ( eregi( \"bmp|gif|jpg|png\", $file ) ) {\r\n\t\t\t\t$images[] = mosHTML::makeOption( $file );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$images = mosHTML::selectList( $images, $name, 'class=\"inputbox\" size=\"1\" '. $javascript, 'value', 'text', $active );\r\n\r\n\t\treturn $images;\r\n\t}", "function galleryThumbs( $source = 'product', $selector, $limit = 15 ) {\n\tif( $source == 'product' ) {\n\t\t// select the product from the database\n\t\t$getProduct = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$product = mysql_fetch_assoc( $getProduct );\n\t\t//check if it has an associated gallery video\n\t\t$hasGalVideo = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$rHasGalVideo = mysql_fetch_assoc($hasGalVideo);\n\t\t// get the products parent information\n\t\t$getParent = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $product['parent'] . \"'\" );\n\t\t$parent = mysql_fetch_assoc( $getParent );\n\t\t// set the path for the products gallery\n\t\tif($product['is_base'] == 1) {\n\t\t$path = './_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$convPath2 = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$thumbPath = '/_assets/_images/_products/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t\t} else {\n\t\t$path = './_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$convPath2 = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/';\n\t\t$thumbPath = '/_assets/_images/_products/' . $parent['parent'] . '/' . $product['parent'] . '/' . $selector . '/_gallery/_thumbnails/';\n\t\t}\n\t} else if ( $source = 'category' ) {\n\t\t// select the product from the database\n\t\t$getProduct = mysql_query( \"SELECT * FROM xxxxxx WHERE url = '\" . $selector . \"'\" );\n\t\t$product = mysql_fetch_assoc( $getProduct );\n\t\t// set the path for the products gallery\n\t\t$path = './_assets/_images/_products/' . $product['parent'] . '/' . $product['selector'] . '/_gallery/';\n\t\t$convPath2 = '/_assets/_images/_products/' . $product['parent'] . '/' . $product['selector'] . '/_gallery/';\n\t\t$thumbPath = '/_assets/_images/_products/' . $product['parent'] . '/' . $product['selector'] . '/_gallery/_thumbnails/';\n\t} else if ( $source = 'package' ) {\n\t\t// select the package from the database\n\t\t$getPackage = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$package = mysql_fetch_assoc( $getPackage );\n\t\t$path = './_assets/_images/_packages/' . $package['selector'] . '/_gallery/';\n\t} else if ( $source = 'custom' ) {\n\t\t// select the custom product from the database\n\t\t$getCustom = mysql_query( \"SELECT * FROM xxxxxx WHERE selector = '\" . $selector . \"'\" );\n\t\t$custom = mysql_fetch_assoc( $getCustom );\n\t\t$path = './_assets/_images/_products/custom/' . $custom['selector'] . '/_gallery/';\n\t}\n\t// check if the path exists\n\t$i = 0;\n\t$dir = opendir($path);\n\t$list = array();\n\twhile($file = readdir($dir)){\n\t\tif($file != \".\" and $file != \"..\" and $file != \"Thumbs.db\" and $file != \"_thumbnails\"){\n\t\t\t$ctime = filectime($data_path . $file) . \",\" . $file;\n\t\t\t$list[$ctime] = $file;\n\t\t}\n\t}\n\tclosedir($dir);\n\tnatsort($list);\n\tforeach($list as $image){\n\t\t$i++;\n\t\t$dirCheck = BASE_THUMBNAIL . $thumbPath;\n\t\t//create directory if it doesn't exist\n\t\tif (!file_exists($dirCheck)) {\n \t\tmkdir($dirCheck, 0755, true);\n\t\t\t}\n\t\t//get sha1 hash of image\n\t\t$currentHash = (sha1_file($path . $image));\n\t\t//separate parts of image name\n\t\t$thumbImage = $image;\n\t\t$path_parts = pathinfo($thumbImage);\n\t\t$matchedImageName = $path_parts['filename'];\n\t\t//set rest of thumbnail conversion path\n\t\t$smallThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize 97x ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_sm' . '.' . $path_parts['extension'];\n\t\t$medThumb = '/usr/bin/convert' . ' ' . BASE_THUMBNAIL . $convPath2 . $image . ' -resize 265x ' . BASE_THUMBNAIL . $thumbPath . $path_parts['filename'] . '_med' . '.' . $path_parts['extension'];\n\t\t$checkHash = mysql_query( \"SELECT * FROM xxxxxx WHERE thumbhash = '\" . $currentHash . \"' and imgname = '\" . $matchedImageName . \"' and selector = '\" . $selector . \"'\" );\n\t\t if(mysql_num_rows($checkHash)>0) {\n\t\t \t//matched with hash, do nothing\n\t\t } else {\n\t\t \t//convert image to thumbnails\n\t\t\texec($smallThumb);\n\t\t\texec($medThumb);\n\t\t\t$addHash = mysql_query(\"INSERT INTO xxxxxx (thumbhash, selector, imgname) VALUES ('$currentHash','$selector','$matchedImageName')\");\n\t\t}\n\t\tif($i <= $limit){\n\t\t\techo \"<a class='side-gallery-img dv-3'>\";\n\t\t\t\techo \"<div class='image animate'>\";\n\t\t\t\t\techo \"<img alt='\" . $product['meta_keywords'] . ' ' . $i . \"' title='\" . $product['meta_keywords'] . ' ' . $i . \"' class='animate lb magnific\";\n\t\t\t\t\tif( SET_LAZY_LOAD == 'true' ) {\n\t\t\t\t\t\techo \" lazy\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"' data-group='\" . $selector . \"' data-id='\" . $i . \"' data-source='./serve.php?source=\".$path.\"&amp;image=\".$image.\"&amp;thumb=1' data-mfp-src='\".$path.$image.\"' itemprop='image' src='\" . $path . '_thumbnails/' . $path_parts['filename'] . '_sm' . '.' . $path_parts['extension'] .\"' />\";\n\t\t\t\techo \"</div>\";\n\t\t\techo \"</a>\";\n\t\t} else { \n\t\t//limit reached \n\t\t}\n\t}\n\tif($i > $limit && $i > 0 || $rHasGalVideo !== false && mysql_num_rows($rHasGalVideo) > 0){\n\t\techo \"<span class='categories'><a class='animate' href='\".DIR_ROOT.\"gallery/\".$selector.\"'>View More Images</a></span>\";\n\t}\n\tif(empty($list)){\n\t\techo \"<span class='categories'><p>There are no gallery images at this time.</p></span>\";\n\t}\n}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\tglobal $tp;\r\r\n\tglobal $g1;\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = $PView -> getPView_config(\"pics_per_row\");\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = floor(100/$cols);\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr><td valign='top'><div id='gallery' class='content'><div id='controls' class='controls'></div><div class='slideshow-container'>\";\r\r\n\t\t$out_AllImages.= \"<div id='loading' class='loader'></div><div id='slideshow' class='slideshow'></div></div><div id='caption' class='caption-container'></div></div>\";\r\r\n\t\t$out_AllImages.= \"<div id='thumbs' class='navigation'><ul class='thumbs noscript'>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getThumbPath($dataset['imageId']);\r\r\n\t\t\t\t\t$resize = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\r\r\n\r\r\n\t\t\t\t\t$out_AllImages.= \"<li>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"<a class='thumb' name='\".preg_replace('![^0-9a-zA-Z]!is', '', $dataset['name']).\"' href='\".$resize.\"' title='\".$dataset['name'].\"'>\";\r\r\n $out_AllImages.= \"<img src='\".$thumb.\"' alt='\".$dataset['name'].\"' style='\".$g1['th_height'].$g1['th_width'].\"' />\";\r\r\n\t\t\t\t\t$out_AllImages.= \"</a>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"<div class='caption' style='border-top: 1px solid #ccc;'><div class='download'>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"<a href='pviewgallery.php?image=\".$dataset['imageId'].\"&view=\".$pv_Appl[0].\"'>\".LAN_IMAGE_54.\",<br/>\".LAN_IMAGE_4.LAN_IMAGE_55.\"<br/>\".LAN_IMAGE_23.\"</a></div>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"<div class='image-title'>\".$dataset['name'].\"</div>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"<div class='image-desc'>\".$dataset['description'].\"</div>\\n\";\r\r\n\t\t\t\t\t$out_AllImages.= \"</div>\";\r\r\n\t\t\t\t\t$out_AllImages.= \"</li>\";\t\t\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</ul>{pv_Pages}</div><div style='clear: both;'></div></td></tr>\";\r\r\n\r\r\n\t\t\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "private function prepareGallery()\n {\n // get gallery images and poster data\n $galleryPath = '/upload/gallery/' . Date::getYear($this->_content->created_at) . '/' . $this->_content->id;\n // check if gallery folder is exist\n if (Directory::exist($galleryPath)) {\n $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true);\n // generate poster data\n if (Arr::in($this->_content->poster, $originImages)) {\n // original poster\n $posterName = $this->_content->poster;\n $this->posterFull = $galleryPath . '/orig/' . $posterName;\n if (!File::exist($this->posterFull)) {\n $this->posterFull = null;\n }\n\n // thumb poster\n $posterSplit = explode('.', $posterName);\n array_pop($posterSplit);\n $posterCleanName = implode('.', $posterSplit);\n $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg';\n if (!File::exist($this->posterThumb)) {\n $this->posterThumb = null;\n }\n }\n\n // generate full gallery\n foreach ($originImages as $image) {\n $imageSplit = explode('.', $image);\n array_pop($imageSplit);\n $imageClearName = implode('.', $imageSplit);\n // skip image used in poster\n if (Str::startsWith($imageClearName, $this->_content->poster)) {\n continue;\n }\n\n $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg';\n if (File::exist($thumbPath)) {\n $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image;\n }\n }\n }\n }", "function foundation_q_get_gallery_images( $gallery_limit = 999, $post_gallery_id = null, $thumbnail_size = 'thumbnail') {\n $last_gallery_post = get_posts( array('post_type' => 'qd_gallery', 'numberpots' => 1) );\n if( !isset($post_gallery_id) ):\n $post_gallery_id = $last_gallery_post[0]->ID;\n endif;\n $gallery_images = get_post_meta( $post_gallery_id, 'foundation_q_vdw_gallery_id', true );\n\n if( $gallery_images ):\n $count = 1;\n foreach( $gallery_images as $image_id ):\n $image_thumb_data = wp_get_attachment_image_src($image_id, $thumbnail_size);\n $image_thumb_src = $image_thumb_data[0];\n $image_large_data = wp_get_attachment_image_src($image_id,'large');\n $image_large_src = $image_large_data[0];\n\n $image_custom_data = new stdClass;\n $image_custom_data->id = $image_id;\n $image_custom_data->image_thumbnail_src = $image_thumb_src;\n $image_custom_data->image_large_src = $image_large_src;\n\n //$gallery_merge[] = (object) array_merge((array)$gallery_images, (array)$image_custom_data);\n $gallery_object[] = (object) $image_custom_data;\n $count++;\n if( $count > $gallery_limit ){ break; }\n endforeach;\n return $gallery_object;\n else:\n return false;\n endif;\n}", "public function index()\n {\n $images = DB::table('gallery_images')->orderBy('updated_at', 'desc')->simplePaginate(12);\n\n return view('image-gallery',compact('images'));\n }", "function rmgsShowImages(){\r\n\tglobal $xoopsDB, $mc;\r\n\t\r\n\tinclude_once XOOPS_ROOT_PATH.'/modules/rmgs/class/table.class.php';\r\n\t\r\n\t$cat = isset($_GET['cat']) ? $_GET['cat'] : 0;\r\n\t\r\n\tif ($cat<=0){\r\n\t\tredirect_header('categos.php', 2, _AS_RMGS_NOCATEGO);\r\n\t\tdie();\r\n\t}\r\n\t\r\n\t$limit = 12;\r\n\t\r\n\t$pag = isset($_GET['pag']) ? $_GET['pag'] : 0;\r\n\tif ($pag > 0){ $pag -= 1; }\r\n\t$start = $pag * $limit;\r\n\t\r\n\t$catego = new GSCategory($cat);\r\n\tlist($num) = $xoopsDB->fetchRow($xoopsDB->query(\"SELECT COUNT(*) FROM \".$xoopsDB->prefix(\"rmgs_imglink\").\" WHERE id_cat='$cat'\"));\r\n\t$result = $xoopsDB->query(\"SELECT * FROM \".$xoopsDB->prefix(\"rmgs_imglink\").\" WHERE id_cat='$cat' LIMIT $start, $limit\");\r\n\t$title = sprintf(_AS_RMGS_LISTTILE, $catego->getVar('nombre'));\r\n\t\r\n\t$rtotal = $num; // Numero total de resultados\r\n\t$tpages = (int)($num / $limit);\r\n\tif (($num % $limit) > 0){ $tpages++; }\r\n\t\r\n\t$pactual = $pag + 1;\r\n\t\r\n\tif ($pactual>$tpages){\r\n\t\t$rest = $pactual - $tpages;\r\n\t\t$pactual = $pactual - $rest + 1;\r\n\t\t$start = ($pactual - 1) * $limit;\r\n\t}\r\n\t\r\n\txoops_cp_header();\r\n\techo makeNav();\r\n\t\r\n\techo \"<table width='100%' class='outer' cellspacing='1'>\r\n\t\t\t<tr class='odd'><td align='left'>\".sprintf(_AM_RMDP_PAGELOC, $pactual, $tpages).\"</td>\r\n\t\t\t<td align='right'>\"._AM_RMDP_GOPAGE;\r\n\t\t for ($i=1;$i<=$tpages;$i++){\r\n\t\t\t\techo \"<a href='images.php?pag=$i&amp;cat=$cat'>$i</a>&nbsp;\";\r\n\t\t }\r\n\techo \"</td></tr></table>\";\r\n\t\r\n\t$table = new GSTable(true);\r\n\t$table->setTableClass('outer');\r\n\t$table->setCellStyle(\"border-bottom: 1px solid #0066CC; border-right: 1px solid #0066CC; background: url(../images/bgth.jpg) repeat-x; height: 20px; color: #FFFFFF;\");\r\n\t$table->openTbl('100%','',1);\r\n\t$table->openRow('left');\r\n\t$table->addCell($title, 1, 6);\r\n\t$table->closeRow();\r\n\t$table->setRowClass('head');\r\n\t$table->setCellStyle(\"border-bottom: 1px solid #DBE691; border-right: 1px solid #DBE691; background: url(../images/bghead.jpg) repeat-x; height: 20px; color: #000000;\");\r\n\t$table->openRow('center');\r\n\t$table->addCell(_AS_RMGS_LIMAGE,0,'','center');\r\n\t$table->addCell(_AS_RMGS_LTITLE,0,'','center');\r\n\t$table->addCell(_AS_RMGS_LUSER,0,'','center');\r\n\t$table->addCell(_AS_RMGS_LACCES,0,'','center');\r\n\t$table->addCell(_AS_RMGS_LVOTES,0,'','center');\r\n\t$table->addCell(_AS_RMGS_LOPTIONS,0,'','center');\r\n\t$table->closeRow();\r\n\t$table->setRowClass('odd,even', true);\r\n\t$table->setCellStyle('');\r\n\t\r\n\twhile ($row = $xoopsDB->fetchArray($result)){\r\n\t\t$table->openRow();\r\n\t\t$image = new GSImage($row['id_img']);\r\n\t\t$dir = rmgsMakeUserDir($image->getVar('uid'));\r\n\t\t$dir = str_replace(XOOPS_ROOT_PATH, \"\", $dir);\r\n\t\t$table->addCell(\"<a href='$dir/\".$image->getVar('file').\"' target='_blank'><img width='60' src='$dir/ths/\".$image->getVar('file').\"' /></a>\",0,'','center');\r\n\t\t$table->addCell($image->getVar('title', 1),0,'','left');\r\n\t\t$xoopsUser = new XoopsUser($image->getVar('uid'));\r\n\t\t$table->addCell($xoopsUser->getVar('uname'));\r\n\t\t$table->addCell($image->getVar('downloads'));\r\n\t\t$table->addCell($image->getVar('votes'));\r\n\t\tif ($mc['othersizes']){\r\n\t\t\t$others = \"&nbsp;<a href='?op=sizes&amp;id=$row[id_img]&amp;cat=$cat' title='\"._AS_RMGS_FOTHERS.\"'><img src='../images/admin/sizes.png' border='0' alt='' /></a>\";\r\n\t\t}\r\n\t\t$table->addCell(\"<a href='?op=edit&amp;id=$row[id_img]&amp;cat=$cat' title='\"._AS_RMGS_EDIT.\"'><img src='../images/admin/edit.png' border='0' alt='' /></a>&nbsp;\r\n\t\t\t\t\t<a href='?op=del&amp;id=$row[id_img]&amp;cat=$cat' title='\"._AS_RMGS_DELETE.\"'><img src='../images/admin/delete.png' border='0' alt='' /></a>\" . $others,'0','','center');\r\n\t\t$table->closeRow();\r\n\t}\r\n\t\r\n\t$table->closeTbl();\r\n\techo makeFoot();\r\n\txoops_cp_footer();\r\n}", "public static function createImageGallery($result, $condition=\"\", $opt=\"gallery\", $current_id=0, $columns=5, $rows=5)\n {\n\t$counter = 0;\n\t$columns--;\n\t$maxItemsPerPage = ($columns+1) * $rows;\n\t$pointer = \"#\".$opt;\n\t$content = \"<a name='\".$opt.\"'></a><table>\";\n\t$total = db::num_rows($result);\n\t$i = 0;\n\tif(isset($_GET[\"current_grid_page_\".$opt]))\n\t $current = $_GET[\"current_grid_page_\".$opt];\n\telse\n\t $current = 1;\n\tif (db::num_rows($result) == 0)\n\t return \"\";\n\t$content = \"<div class='highslide-gallery' style='margin-left: 30px;'><ul>\";\n\twhile ($row = db::nextRowFromQuery($result))\n\t{\n\t if( !($i >= ($current-1) * $maxItemsPerPage && $i < $current * $maxItemsPerPage ) )\n\t {\n\t\t$i++;\n\t\tcontinue;\n\t }\n\t $i++;\n\t \n\t $imagePath = \"\";\n\n\t $table = $row[\"table_name\"];\n\t switch($table)\n\t {\n\t\tcase \"screenshot_group\":\n\t\t $imagePath_orig = $row[\"image\"];\n\t\t $dir = dirname($imagePath_orig).\"/\";\n\t\t $name = basename($imagePath_orig);\n\t\t $new_name = explode(\".\", $name);\n\t\t if ($new_name[0] == \"fullPreview\")\n\t\t\t$new_name = \"minimap.bmp\";\n\t\t else\n\t\t\t$new_name = $new_name[0] . \"_thumbnail.\" . $new_name[1];\n\t\t $imagePath = $dir.$new_name;\n\t\t break;\n\t }\n\t $content .= \"<li><a href='\".$imagePath_orig.\"' class='highslide' onclick='return hs.expand(this, config1 )'><img src='\" . $imagePath . \"' alt='' style='max-width:90px;max-height:90px;' border='0'/></a></li>\";\n\t}\n\t$content .= \"</ul><div style='clear:both'></div></div>\";\n\t//Print pages\n\t$nrOfPages = floor(($total-0.01) / $maxItemsPerPage) + 1;\n\t$pages = \"<table><tr><td>\";\n\t\n\t$gets = \"\";\n\t$keys = array_keys($_GET);\n\tforeach($keys as $key)\n\t{\n\t if($key != \"current_grid_page_\".$opt)\n\t\t$gets .= \"&\" . $key . \"=\" . $_GET[$key];\n\t}\n\tfor($i = 1; $i < $nrOfPages+1; $i++)\n\t{\n\t $pages .= misc::paging($nrOfPages, $i, $current, $gets, $opt, \"grid\", $pointer);\n\t}\n\t$pages .= \"</td></tr></table>\";\n\tif ($nrOfPages == 1)\n\t{ $pages = \"\"; }\n\n\t$content .= \"</table>\";\n\t$pages = preg_replace(\"/(\\.\\.\\.)+/\", \" ... \", $pages);\n\t$content .= $pages;\n\treturn $content;\n }", "function post_gallery_init()\n{\n\tif(__LOAD_GALLERY_)\n\t{\n\t\tglobal $post;\n\t\t\n\t\tif(is_loaded_post_object())\n\t\t\tif (strpos($post->post_content,'[gallery') !== false || strpos($post->post_content,'<img') !== false)\n\t\t\t\tprettyPhoto_init();\n\t}\n}", "function lightbox_list($picId) {\r\n \r\n\t################################################\r\n\t//Set max number of images\r\n\t$max = 100; \t\t\t//(-1 for all pics in album)\r\n\t################################################\r\n\r\n global $lang_display_image_php, $CONFIG;\r\n\t$i = 0;\r\n\t$pid = $picId['pid'];\r\n\t$aid = (empty($_GET['album']) || $_GET['album']=='random' || $_GET['album']=='lastup') ? $picId['aid'] : $_GET['album'];\r\n\r\n\t$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);\r\n\r\n\t$imax = 0;\t\t\t//counter\r\n\r\n\t$max = $max/2;\r\n\r\n\tforeach ($pic_data as $picture){\r\n\r\n\t\tif ($picture['pid'] == $pid) {\r\n\r\n\t\t//the number of the picture in order\r\n\r\n\t\t$picnumber = $imax;\r\n\r\n\t\t}\r\n\r\n\t$imax++;\r\n\r\n\t}\t\r\n\r\n\t//Check beginning and ending of album\r\n\r\n\tif(! ($max == ((-1)/2))){\r\n\r\n\t\tif ($imax > $max){\r\n\r\n\t\t\tif ($picnumber < $max || $picnumber == 0){\r\n\r\n\t\t\t\t$down = 0;\r\n\r\n\t\t\t\t$up = 0 + ($max*2);\r\n\r\n\t\t\t}elseif (($picnumber + $max) > $imax){\r\n\r\n\t\t\t\t$down = $imax - ($max*2);\r\n\r\n\t\t\t\t$up = $imax;\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$down = $picnumber - $max;\r\n\r\n\t\t\t\t$up = $picnumber + $max;\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$down = 0;\r\n\r\n\t\t\t$up = $imax;\r\n\r\n\t\t}\r\n\r\n\t}else{\r\n\r\n\t\t\t$down = 0;\r\n\r\n\t\t\t$up = $imax;\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t$pic_already_shown = false; //fix to remove duplicate entries\r\n\r\n\tforeach ($pic_data as $picture) {\r\n\r\n\t\tif ($i >= $down && $i <= $up){\r\n\r\n\t\t\tif($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){\r\n\r\n\t\t\t $condition = true;\r\n\r\n\t\t\t}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){\r\n\r\n\t\t\t $condition = true;\r\n\r\n\t\t\t}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){\r\n\r\n\t\t\t $condition = true;\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t$condition = false;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$picture_page = \"./displayimage.php?album=\".$picture['aid'].\"&pos=-\".$picture['pid'];\r\n\r\n\t\t\tif (is_image($picture['filename'])) {\r\n\r\n\t\t\t\tif ($CONFIG['make_intermediate'] && $condition ) {\r\n\r\n\t\t\t\t\t$picture_url = get_pic_url($picture, 'normal');\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$picture_url = get_pic_url($picture, 'fullsize');\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$picture_url_fullsize = get_pic_url($picture, 'fullsize');\r\n\r\n\t\t\t\t$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace(\"/(.+)\\..*?\\Z/\", \"\\\\1\", htmlspecialchars($picture['filename'])), \"_\", \" \"));\r\n\r\n\t\t\t\tif ($picture['pid'] == $pid && !$pic_already_shown ) {\r\n\r\n\t\t\t\t\t$picList .= \"<a href=\\\"$picture_url_fullsize\\\" picpage=\\\"$picture_page\\\" rel=\\\"lightbox[list]\\\" pid=\\\"$picture[pid]\\\" title=\\\"$pic_title\\\" >\";\r\n\r\n\t\t\t\t\t$picList .= \"<img src=\\\"$picture_url\\\" class=\\\"image\\\" border=\\\"0\\\" alt=\\\"$lang_display_image_php[view_fs]\\\" /><br />\";\r\n\r\n\t\t\t\t\t$picList .= \"</a>\\n\";\r\n\r\n\t\t\t\t\t$pic_already_shown = true; //fix to remove duplicate entries\r\n\r\n\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\t$picList .= \"<a href=\\\"$picture_url_fullsize\\\" picpage=\\\"$picture_page\\\" rel=\\\"lightbox[list]\\\" title=\\\"$pic_title\\\"></a>\\n\";\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t$i++;\r\n\r\n\t}\r\n\r\n\treturn $picList;\r\n\r\n}", "function get_images() \t{\n\t \t\treturn $this->getImages();\n\t \t}", "function aton_qodef_blog_gallery_types() {\n\n\t\t$types = array('gallery');\n\n\t\treturn $types;\n\n\t}", "public function all_gallery_images($id)\n\t{\n\t\t///////////////////////////////\n\t\t\t\t$id = strtr(\n $id,\n array(\n '.' => '+',\n '-' => '=',\n '~' => '/'\n )\n );\n\t\t\t$id=$this->encrypt->decode($id);\n\t\t\t/////////////////////////////////\n\t\t\t$this->load->model('user/Product_model');\n\t\t\t$data['gallery']=$this->Product_model->all_gallery_images($id);\n\t\t\t$data['product_name']=$this->db->query(\"SELECT product_name from product where product_id='\".$id.\"'\")->row();\n\t\t\t$this->load->view('all_gallery_images',$data);\n\t\t\n\t}", "public function getGalleries ($params=array(), $count_only=false) {\n\t\t$params['post_type']='gal';\n\t\t$rs= $this->core->blog->getPosts($params,$count_only);\n\t\t$rs->extend('rsExtGallery');\n\t\treturn $rs;\n\t}", "function galleryPicsPerPage() : int;", "private function display_images()\n\t{\n\t\tglobal $template, $user;\n\n\t\tif (!empty($this->recent_images))\n\t\t{\n\t\t\t$num = 0;\n\t\t\t$template->assign_block_vars($this->template_block_images, array(\n\t\t\t\t'U_BLOCK'\t\t\t=> phpbb_gallery_url::append_sid('search', 'search_id=recent'),\n\t\t\t\t'BLOCK_NAME'\t\t=> $user->lang['RECENT_IMAGES'],\n\t\t\t\t'S_COL_WIDTH'\t\t=> (100 / $this->num_columns) . '%',\n\t\t\t\t'S_COLS'\t\t\t=> $this->num_columns,\n\t\t\t));\n\t\t\tforeach ($this->recent_images as $image)\n\t\t\t{\n\t\t\t\tif (($num % $this->num_columns) == 0)\n\t\t\t\t{\n\t\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow', array());\n\t\t\t\t}\n\t\t\t\tphpbb_gallery_image::assign_block($this->template_block_images . '.imagerow.image', $this->images_data[$image], $this->images_data[$image]['album_status'], $this->get_display(), $this->images_data[$image]['album_user_id']);\n\t\t\t\t$num++;\n\t\t\t}\n\t\t\twhile (($num % $this->num_columns) > 0)\n\t\t\t{\n\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow.no_image', array());\n\t\t\t\t$num++;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->random_images))\n\t\t{\n\t\t\t$num = 0;\n\t\t\t$template->assign_block_vars($this->template_block_images, array(\n\t\t\t\t'U_BLOCK'\t\t\t=> phpbb_gallery_url::append_sid('search', 'search_id=random'),\n\t\t\t\t'BLOCK_NAME'\t\t=> $user->lang['RANDOM_IMAGES'],\n\t\t\t\t'S_COL_WIDTH'\t\t=> (100 / $this->num_columns) . '%',\n\t\t\t\t'S_COLS'\t\t\t=> $this->num_columns,\n\t\t\t));\n\t\t\tforeach ($this->random_images as $image)\n\t\t\t{\n\t\t\t\tif (($num % $this->num_columns) == 0)\n\t\t\t\t{\n\t\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow', array());\n\t\t\t\t}\n\t\t\t\tphpbb_gallery_image::assign_block($this->template_block_images . '.imagerow.image', $this->images_data[$image], $this->images_data[$image]['album_status'], $this->get_display(), $this->images_data[$image]['album_user_id']);\n\t\t\t\t$num++;\n\t\t\t}\n\t\t\twhile (($num % $this->num_columns) > 0)\n\t\t\t{\n\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow.no_image', array());\n\t\t\t\t$num++;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->contest_images))\n\t\t{\n\t\t\tforeach ($this->contest_images as $contest => $contest_data)\n\t\t\t{\n\t\t\t\t$num = 0;\n\t\t\t\t$template->assign_block_vars($this->template_block_images, array(\n\t\t\t\t\t'U_BLOCK'\t\t\t=> phpbb_gallery_url::append_sid('album', 'album_id=' . $contest_data['album_id'] . '&amp;sk=ra&amp;sd=d'),\n\t\t\t\t\t'BLOCK_NAME'\t\t=> sprintf($user->lang['CONTEST_WINNERS_OF'], $contest_data['album_name']),\n\t\t\t\t\t'S_CONTEST_BLOCK'\t=> true,\n\t\t\t\t\t'S_COL_WIDTH'\t\t=> '33%',\n\t\t\t\t\t'S_COLS'\t\t\t=> 3,\n\t\t\t\t));\n\t\t\t\tforeach ($contest_data['images'] as $image)\n\t\t\t\t{\n\t\t\t\t\tif (($num % phpbb_gallery_contest::NUM_IMAGES) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow', array());\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($this->images_data[$image]))\n\t\t\t\t\t{\n\t\t\t\t\t\tphpbb_gallery_image::assign_block($this->template_block_images . '.imagerow.image', $this->images_data[$image], $this->images_data[$image]['album_status'], $this->get_display(), $this->images_data[$image]['album_user_id']);\n\t\t\t\t\t\t$num++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile (($num % phpbb_gallery_contest::NUM_IMAGES) > 0)\n\t\t\t\t{\n\t\t\t\t\t$template->assign_block_vars($this->template_block_images . '.imagerow.no_image', array());\n\t\t\t\t\t$num++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$template->assign_vars(array(\n\t\t\t'S_THUMBNAIL_SIZE'\t=> phpbb_gallery_config::get('thumbnail_height') + 20 + ((phpbb_gallery_config::get('thumbnail_infoline')) ? phpbb_gallery_constants::THUMBNAIL_INFO_HEIGHT : 0),\n\t\t));\n\t}", "function et3_theme_framework_post_gallery(){\n global $opt_meta_options;\n\n /* no audio. */\n if(empty($opt_meta_options['opt-gallery'])) {\n et3_theme_framework_post_thumbnail();\n return;\n }\n\n $array_id = explode(\",\", $opt_meta_options['opt-gallery']);\n\n ?>\n <div id=\"carousel-example-generic\" class=\"carousel slide\" data-ride=\"carousel\">\n <div class=\"carousel-inner\">\n <?php $i = 0; ?>\n <?php foreach ($array_id as $image_id): ?>\n <?php\n $attachment_image = wp_get_attachment_image_src($image_id, 'full', false);\n if($attachment_image[0] != ''):?>\n <div class=\"item <?php if( $i == 0 ){ echo 'active'; } ?>\">\n <img style=\"width:100%;\" data-src=\"holder.js\" src=\"<?php echo esc_url($attachment_image[0]);?>\" alt=\"\" />\n </div>\n <?php $i++; endif; ?>\n <?php endforeach; ?>\n </div>\n <a class=\"left carousel-control\" href=\"#carousel-example-generic\" role=\"button\" data-slide=\"prev\">\n <span class=\"fa fa-angle-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#carousel-example-generic\" role=\"button\" data-slide=\"next\">\n <span class=\"fa fa-angle-right\"></span>\n </a>\n </div>\n <?php\n}", "public function gallery()\n {\n $client = Auth::User();\n// $galleries = $this->repository->scopeQuery(function($query) use($client){\n// return $query->whereRaw('clientID', $client->id)->whereRaw('status = \"published\" ');\n// })->all();\n\n $galleries = $this->repository->findWhere(['clientID' => $client->id, 'status' => 'published'])->all();\n\n return view('client.gallery', compact('galleries'));\n }", "function myphotos()\n\t{\t\t\n\t\n\t\t$document \t=& JFactory::getDocument();\n\t\t$viewType\t= $document->getType();\t\n \t\t$viewName\t= JRequest::getCmd( 'view', $this->getName() );\n \t\t$view\t\t=& $this->getView( $viewName , '' , $viewType );\n \n \t \tif($this->checkPhotoAccess())\t\n \t\t\techo $view->get( __FUNCTION__ );\n\t}", "function create_gallary(){\n return create_item(\"html_asset\", \"Gallery\" );\n }", "function get_gallery_image($gallery_id)\r\n\t{\r\n\t\treturn getField('SELECT v.image_filename FROM ('.create_sql_view_by_name_for_fields('image_filename, gallery_id, is_gallery_image', 'gallery_image').') v WHERE v.gallery_id = '.sqlValue($gallery_id).' AND v.is_gallery_image = 1');\r\n\t}", "public function funcGallery($request)\n {\n $query = $this->model_gallery\n ->select('id', 'image')\n ->orderBy('id', 'desc');\n return $query->get();\n }", "function jeg_get_image_gallery($id, $fieldname)\n{\n $imglist = get_post_meta($id, j_name($fieldname), true);\n $galleries = json_decode($imglist, true);\n\n if(!empty($galleries)) {\n $result = array();\n\n foreach ($galleries as $gallery) {\n $image = wp_get_attachment_image_src($gallery['id'], 'full');\n\n $result[] = array(\n 'file' \t\t=> $image[0],\n 'desc'\t\t=> $gallery['desc'],\n 'title'\t\t=> $gallery['title']\n );\n }\n\n return $result;\n } else {\n return false;\n }\n}", "function photo_galleries_init(){\r\n\t\t$labels = array(\r\n\t\t\t'name'\t\t\t\t\t=> __('Photo Gallery','arc'),\r\n\t\t\t'singular_name'\t\t=> __('photo_Gallery Name','arc'),\r\n\t\t\t'add_new'\t\t\t\t=> __('Add New','arc'),\r\n\t\t\t'add_new_item'\t\t\t=> __('Add New Photo Gallery','arc'),\r\n\t\t\t'edit_item'\t\t\t=> __('Edit photo_Gallery','arc'),\r\n\t\t\t'new_item'\t\t\t\t=> __('Add New photo_Gallery','arc'),\r\n\t\t\t'view_item'\t\t\t=> __('View photo_Gallery','arc'),\r\n\t\t\t'search_items'\t\t\t=> __('Search photo_gallery','arc'),\r\n\t\t\t'not_found'\t\t\t=> __('No photo_gallery items found','arc'),\r\n\t\t\t'not_found_in_trash'\t=> __('No photo_gallery found in trash','arc')\r\n\t\t);\r\n\t\t\r\n\t\t$args = array(\r\n\t\t 'labels' => $labels,\r\n\t\t\t'public' => true,\r\n\t\t\t'publicly_queryable' => true,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'menu_icon' => 'dashicons-format-gallery',\r\n\t\t\t'rewrite' => true,\t\t\t\r\n\t\t\t'map_meta_cap' => true,\r\n\t\t\t'hierarchical' => false,\r\n\t\t\t'menu_position' => 5,\r\n\t\t\t'supports' => array('title','editor','thumbnail','page-attributes')\r\n\t\t); \r\n\t\t$args = apply_filters('arc_photo_galleries_args',$args);\r\n\t\tregister_post_type('photo_galleries',$args);\r\n\t\t\r\n\t\t$labels_one = array(\r\n\t\t\t'name' => _x('Photo Gallery Types','taxonomy general name'),\r\n\t\t\t'singular_name' => _x('Photo Gallery Type','taxonomy singular name'),\r\n\t\t\t'search_items' => __('Search Photo Gallery Types'),\r\n\t\t\t'popular_items' => __('Popular Photo Gallery Types'),\r\n\t\t\t'all_items' => __('All Photo Gallery Types'),\r\n\t\t\t'parent_item' => null,\r\n\t\t\t'parent_item_colon' => null,\r\n\t\t\t'edit_item' => __('Edit Photo Gallery Type'),\r\n\t\t\t'update_item' => __('Update Photo Gallery Type'),\r\n\t\t\t'add_new_item' => __('Add New Photo Gallery Type'),\r\n\t\t\t'new_item_name' => __('New Photo Gallery Type Name'),\r\n\t\t\t'separate_items_with_commas' => __('Separate Photo Gallery types with commas'),\r\n\t\t\t'add_or_remove_items' => __('Add or remove Photo Gallery types'),\r\n\t\t\t'choose_from_most_used' => __('Choose from the most used Photo Gallery types'),\r\n\t\t\t'not_found' => __('No Photo Gallery types found.'),\r\n\t\t\t'menu_name' => __('Photo Gallery Types'),\r\n\t\t);\r\n\t\r\n\t\t$args_one = array(\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'labels' => $labels_one,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'show_admin_column' => true,\r\n\t\t\t'update_count_callback' => '_update_post_term_count',\r\n\t\t\t'query_var' => true,\r\n\t\t\t'rewrite' => array('slug' => 'photo_galleries_type'),\r\n\t\t);\r\n\r\n\t\tregister_taxonomy('photo_galleries_type','photo_galleries',$args_one);\t\r\n\t}", "public function gallery()\n {\n $photos = Gallery::get();\n\n return view('front.gallery', compact('photos'));\n }" ]
[ "0.7607697", "0.7467814", "0.73557836", "0.7135202", "0.70928967", "0.70561516", "0.7052949", "0.705284", "0.70303917", "0.702388", "0.70216", "0.700034", "0.6990929", "0.6983169", "0.69459164", "0.69415665", "0.69120294", "0.69066733", "0.69009286", "0.6882535", "0.68797827", "0.68696797", "0.68391037", "0.68283933", "0.6826741", "0.68211573", "0.6799514", "0.67769766", "0.6773913", "0.6755197", "0.6750432", "0.67476135", "0.67369574", "0.6728615", "0.67260647", "0.6717061", "0.66962695", "0.668849", "0.6688056", "0.6684805", "0.6682274", "0.668047", "0.66680104", "0.6666908", "0.6644662", "0.66406006", "0.6640412", "0.66403496", "0.66402096", "0.66364807", "0.65982276", "0.65936804", "0.659319", "0.6589638", "0.6588353", "0.65866834", "0.6583543", "0.65807444", "0.6580305", "0.6576115", "0.6572959", "0.6567268", "0.6565346", "0.65544635", "0.65539354", "0.6550356", "0.65434384", "0.65418357", "0.6539577", "0.65366524", "0.6524012", "0.6521885", "0.6503294", "0.6500096", "0.6486519", "0.64829904", "0.64803517", "0.64801884", "0.64730096", "0.6464276", "0.6455977", "0.6455204", "0.64467233", "0.64348316", "0.64292485", "0.6423214", "0.641705", "0.64129555", "0.6412819", "0.6410944", "0.63953584", "0.639175", "0.6391456", "0.63875073", "0.6385657", "0.6381575", "0.63814795", "0.6380462", "0.6378315", "0.63733816" ]
0.78039426
0
/ === Front Page News Ticker ===
/ === Новости на главной странице ===
function newsTicker() { $posts = get_posts( array( 'post_type' => 'ohnewsbulletin', 'post_status' => 'publish' ) ); if ($posts) { $items = ''; foreach ($posts as $post) { $items .= "<li>{$post->post_title}</li>"; } $atts = (count($posts) > 1) ? 'class="slider"' : 'class="slider single"'; echo "<div class='news'><div $atts><ul>$items</ul></div></div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wd_news() {\n\t\t\tinclude_once( ABSPATH . WPINC . '/feed.php' );\n\t\t\tif ( $rssobj = fetch_feed( 'https://webdesires.co.uk/feed/' ) ) {\n\t\t\t\t\n\t\t\t\t$content = '<ul>';\n\t\t\t\t$maxitems = $rssobj->get_item_quantity( 5 ); \n\n\t\t\t\t// Build an array of all the items, starting with element 0 (first element).\n\t\t\t\t$rss = $rssobj->get_items( 0, $maxitems );\n\t\t\t\t\n\t\t\t\tforeach ( $rss as $item ) {\n\t\t\t\t\t$content .= '<li class=\"schema\">';\n\t\t\t\t\t$content .= '<a class=\"rsswidget\" href=\"'.clean_url( $item->get_permalink(), $protocolls=null, 'display' ).'\">'. htmlentities($item->get_title()) .'</a> ';\n\t\t\t\t\t$content .= '</li>';\n\t\t\t\t}\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', $content);\n\t\t\t} else {\n\t\t\t\t$this->postbox('schemalatest', 'Latest from WebDesires Blog', 'Nothing to say...');\n\t\t\t}\n\t\t}", "function yiw_dashboard_news() {\n\t$args = array( 'show_author' => 1, 'show_date' => 1, 'show_summary' => 1, 'items'=>3 );\n\twp_widget_rss_output( YIW_RSS_URL, $args );\n}", "abstract protected function getNewsPage();", "function nova_rss_dashboard_widget_bbcnews_politics() {\r\r\n\tif ( function_exists( 'fetch_feed' ) ) {\r\r\n\t\tinclude_once( ABSPATH . WPINC . '/feed.php' ); \r\r\n\t\t$feed = fetch_feed( 'http://feeds.bbci.co.uk/news/politics/rss.xml' ); \r\r\n\t\t$limit = $feed->get_item_quantity(4); \r\r\n\t\t$items = $feed->get_items(0, $limit); \r\r\n\t}\r\r\n\tif ($limit == 0) echo '<div>The RSS Feed is either empty or unavailable.</div>'; \r\r\n\telse foreach ($items as $item) { ?>\r\r\n\r\r\n\t<h4 style=\"margin-bottom: 0;\">\r\r\n\t\t<a href=\"<?php echo $item->get_permalink(); ?>\" title=\"<?php echo mysql2date( __( 'j F Y @ g:i a', 'bbc-pol' ), $item->get_date( 'Y-m-d H:i:s' ) ); ?>\" target=\"_blank\">\r\r\n\t\t\t<?php echo $item->get_title(); ?>\r\r\n\t\t</a>\r\r\n\t</h4>\r\r\n\t<p style=\"margin-top: 0.5em;\">\r\r\n\t\t<?php echo substr($item->get_description(), 0, 200); ?>\r\r\n\t</p>\r\r\n\t<?php }\r\r\n}", "public function news() {\n\n\t\tself::init();\n\t\t\n\t\t$this->registry['layout']->sets(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'news',\n\t\t\t\t\t\t\t\t\t\t));\t\n\t\n\t\tparent::news();\n\t\t\t\t\t\n\t}", "function yiw_dashboard_forum_news() {\n\t$args = array( 'show_author' => 1, 'show_date' => 1, 'show_summary' => 0, 'items'=>10 );\n\twp_widget_rss_output( YIW_RSS_FORUM_URL, $args );\n}", "function get_news_ticker( $limit = 5, $direction = \"up\", $scrolldelay = \"100\", $news_page_url, $ticker)\n\t{\n\t\t$get_news = $this -> get_active_news( $limit );\n\t\tif( $get_news != false )\n\t\t{\n\t\t\t\n\t\t\tforeach( $get_news as $news )\n\t\t\t{\n\t\t\t\t$news_detail_url = $news_page_url.$news -> news_id;\n\t\t\t\t$display_news .= '<table width=\"340\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">';\n\t\t\t\t$news_desc = strlen( $news -> news_text ) > 200 ? substr($news -> news_text, 0, 200).\"...\" : $news -> news_text;\n\t\t\t\t$display_news .= '<tr>\n\t\t\t\t\t\t\t\t\t<td><a style=\"padding:0px;\" class=\"event-txt\" href=\"'.$news_detail_url.'\"><strong>'.date('d M, Y', strtotime($news -> addeddate)).'</strong></a><br />'.$news_desc.'</td>';\n\t\t\t\t$display_news .= '</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"event-bdr rd-more\"><a href=\"'.$news_detail_url.'\">read more</a></td>\n\t\t\t\t\t\t\t\t</tr>';\n\t\t\t$display_news .= '</table>';\n\t\t\t}\t//\tEnd of ForEaCh Looooooop\n\t\t\t\n\t\t\tif( $ticker == 1 )\n\t\t\t{\n\t\t\t\t$news_ticker .= '<marquee direction=\"'.$direction.'\" scrolldelay=\"'.$scrolldelay.'\" onmouseover=\"stop();\" onmouseout=\"start();\">'.$display_news.'</marquee>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$news_ticker = $display_news;\n\t\t\t}\n\t\t\t\n\t\t\treturn $news_ticker;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function getNewsFeed()\n {\n // Get RSS classes and add thickbox for images\n include_once(ABSPATH . WPINC . '/feed.php');\n // Add fancybox\n $fancybox = new SimpleFancybox();\n $fancybox->initialize(true);\n\n $html = '';\n $rss = fetch_feed(self::LBWP_NEWS_FEED);\n\n // Display the feed if it was available\n if ($rss instanceof \\SimplePie) {\n /** @var \\SimplePie_Item $item Display at most X items */\n foreach ($rss->get_items(0, self::NEWS_ITEMS) as $item) {\n $html .= '\n <li>\n <h4>' . $item->get_title() . self::getNewItemFlag($item) . '</h4>\n\n <p>\n ' . $item->get_date('d.m.Y') . ' - ' . strip_tags($item->get_content(true), '<a><strong><em>') . '\n <!--&raquo; <a href=\"' . $item->get_permalink() . '\">Weitere Informationen</a>-->\n </p>\n </li>\n ';\n }\n }\n\n // Output html\n echo '<ul>' . $html . '</ul>';\n }", "function refined_magazine_trending_news_item()\r\n {\r\n global $refined_magazine_theme_options;\r\n $trending_cat = absint($refined_magazine_theme_options['refined-magazine-trending-news-category']);\r\n $trending_title = esc_html($refined_magazine_theme_options['refined-magazine-enable-trending-news-text']);\r\n if (is_rtl()) {\r\n $marquee_class = 'trending-right';\r\n } else {\r\n $marquee_class = 'trending-left';\r\n }\r\n ?>\r\n <?php\r\n $query_args = array(\r\n 'post_type' => 'post',\r\n 'ignore_sticky_posts' => true,\r\n 'posts_per_page' => 10,\r\n 'cat' => $trending_cat\r\n );\r\n\r\n $query = new WP_Query($query_args);\r\n if ($query->have_posts()) :\r\n ?>\r\n\r\n <div class=\"trending-wrapper\">\r\n <?php\r\n if ($trending_title):\r\n ?>\r\n <strong class=\"trending-title\">\r\n <?php echo $trending_title; ?>\r\n </strong>\r\n <?php\r\n endif;\r\n ?>\r\n <div class=\"trending-content <?php echo $marquee_class; ?>\">\r\n <?php\r\n while ($query->have_posts()) :\r\n $query->the_post();\r\n ?>\r\n <a href=\"<?php the_permalink(); ?>\"\r\n title=\"<?php the_title(); ?>\">\r\n <span class=\"img-marq\">\r\n <?php the_post_thumbnail('thumbnail'); ?>\r\n </span>\r\n <?php the_title(); ?>\r\n </a>\r\n <?php\r\n endwhile;\r\n wp_reset_postdata();\r\n ?>\r\n\r\n </div>\r\n </div> <!-- .top-right-col -->\r\n <?php\r\n endif;\r\n ?>\r\n <?php\r\n\r\n\r\n }", "public function formateAsNews();", "function news_marquee_show($options)\n{\n\n $story_handler = xoops_getmodulehandler('story', 'news');\n $topic_handler = xoops_getmodulehandler('topic', 'news');\n $module_handler = xoops_gethandler('module');\n\n require_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';\n require_once XOOPS_ROOT_PATH . '/modules/news/class/perm.php';\n require_once XOOPS_ROOT_PATH . '/modules/news/class/utils.php';\n\n global $xoTheme;\n\n $block = [];\n $story_infos = [];\n $story_infos['story_limit'] = $options[1];\n $story_infos['title_lenght'] = $options[2];\n $block['show_date'] = $options[3];\n\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n\n $story_infos['topics'] = $topic_handler->getAll();\n $block['marquee'] = $story_handler->NewsStoryMarquee($story_infos, $options);\n\n $xoTheme->addScript(\"browse.php?Frameworks/jquery/jquery.js\");\n $xoTheme->addScript(XOOPS_URL . '/modules/news/js/marquee/marquee.js');\n $xoTheme->addScript(XOOPS_URL . '/modules/news/js/marquee/setting.js');\n $xoTheme->addStylesheet(XOOPS_URL . '/modules/news/css/marquee.css');\n\n return $block;\n}", "function dspHome() {\n\techo '<div id=\"myhome\"><div id=\"mynews\">';\n\t$TempResult=sql(\"select * from news where n_active=1 order by n_start desc limit 3\");\n\twhile($TempRow = mysql_fetch_row($TempResult)) {\n\n\t\techo $TempRow[4].\"<br />\";\n\t\techo \"<b>\".$TempRow[5].\"</b><br />\";\n\t\techo '<a href=\"?PR='.$TempRow[0].'\"><img src=\"readmore.png\" border=\"0\" alt=\"Læs mere\" /></a><br /><br />';\n\t}\n\t//\techo '<a style=\"position: absolute; left: 200px; top: 150px\" href=\"?SB=Yes\"><img src=\"big_spil.png\" border=\"0\" alt=\"Spil\" /></a>';\n\techo '<a style=\"position: absolute; left: 308px; top: 150px\" href=\"?RGM=Yes\"><img src=\"big_registrer.png\" border=\"0\" alt=\"Registrer\" /></a>';\n\t//\techo '<a style=\"position: absolute; left: 500px; top: 150px\" href=\"?TUR=Yes\"><img src=\"live01.gif\" border=\"0\" alt=\"Følg turneringen\" /></a>';\n\techo '</div></div>';\n\t//\techo '<img src=\"kk_home_sponsors.png\" border=\"0\" alt=\"\" height=\"140\" width=\"780\" />';\n}", "function news_autoriser(){}", "protected function getSystemNews() {}", "private function LatestNews(){\n\t\t$query = \"SELECT tid, ttitle, tpid, tfid, tdate FROM forums_threads WHERE tfid='1' OR tfid='2' OR tfid='9' ORDER BY tid DESC LIMIT 0, 5\";\n\t\t$result = mysqli_query($this->conn, $query);\n\t\t$i = 0;\n\t\twhile(list($tid, $ttitle, $tpid, $tfid, $tdate) = mysqli_fetch_array($result)) {\n\t\t\t$query1 = \"SELECT fseo FROM forums_forum WHERE fid='$tfid'\";\n\t\t\t$result1 = mysqli_query($this->conn, $query1);\n\t\t\t$row1 = mysqli_fetch_array($result1);\n\t\t\techo \"<a href='/forums/\".$row1['fseo'].\"/topic-\".$tid.\"/s-0' class='side'>\".stripslashes($ttitle).\"</a>\\n\";\n\t\t\techo \"<br />\\n\";\n\t\t\tif($i < 4){echo \"<div class='panel-line'></div>\\n\";}\n\t\t\t$i++;\n\t\t}\n\t}", "function newsFeed()\n\t{\n\t\ttry\n\t\t{\n\t\t\trequire_once(APP_DIR.'helpers/image_get_path.php');\n\n\t\t\t$storyModel = $this->loadModel(\"Story/StoryModel\");\n\t\t\t$searchResults = array();\n\n\t\t\t$searchResults = $storyModel->getNewsFeed($this->currentUser->UserId, MAX_STORIES_LISTS, isset($_POST[\"Page\"]) ? $_POST[\"Page\"] : 1);\n\n\t\t\tif (isset($searchResults)) {\n\t\t\t\tforeach ($searchResults as $feed)\n\t\t\t\t{\n\t\t\t\t\tinclude(APP_DIR . \"views/Account/_newsFeed.php\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $ex)\n\t\t{\n\t\t\tthrow $ex;\n\t\t}\n\t}", "function b_news_top_show($options) {\n\tglobal $xoopsConfig;\n include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';\n\t$myts =& MyTextSanitizer::getInstance();\n\t$block = array();\n\t$displayname=getmoduleoption('displayname');\n\t$tabskin=getmoduleoption('tabskin');\n\n\tif (file_exists(XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/main.php')) {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/main.php';\n\t} else {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/english/main.php';\n\t}\n\n\t$block['displayview']=$options[8];\n\t$block['tabskin']=$tabskin;\n\t$block['imagesurl']=XOOPS_URL.'/modules/news/images/';\n\n\t$restricted=getmoduleoption('restrictindex');\n\t$dateformat=getmoduleoption('dateformat');\n\t$infotips=getmoduleoption('infotips');\n\t$newsrating=getmoduleoption('ratenews');\n\tif($dateformat=='') {\n\t\t$dateformat='s';\n\t}\n\n\t// Is the spotlight visible ?\n\tif($options[4]==1 && $restricted && $options[5]==0) {\n\t\t$permittedtopics=MygetItemIds();\n\t\t$permstory = new NewsStory($options[6]);\n\t\tif(!in_array($permstory->topicid(),$permittedtopics)) {\n\t\t\t$usespotlight=false;\n\t\t\t$topicstitles=array();\n\t\t}\n\t\tunset($permstory);\n\t\t$options[4]==0;\n\t}\n\t// Try to see what tabs are visibles (if we are in restricted view of course)\n\tif($options[8]==2 && $restricted && $options[14] != 0) {\n\t\t$topics2=array();\n\t\t$permittedtopics=MygetItemIds();\n $topics = array_slice($options, 14);\n\t\tforeach($topics as $onetopic) {\n\t\t\tif(in_array($onetopic,$permittedtopics)) {\n\t\t\t\t$topics2[]=$onetopic;\n\t\t\t}\n\t\t}\n\t\t$before=array_slice($options, 0,14);\n\t\t$options=array_merge($before,$topics2);\n\t}\n\n\tif($options[8]==2)\t\t// Tabbed view ********************************************************************************************\n\t{\n\t\t$defcolors[1]=array('#F90','#FFFFFF','#F90','#C60','#999');\t\t// Bar Style\n\t\t$defcolors[2]=array('#F90','#FFFFFF','#F90','#AAA','#666');\t\t// Beveled\n\t\t$defcolors[3]=array('#F90','#FFFFFF','','#789','#789');\t\t\t// Classic\n\t\t$defcolors[4]=array('#F90','#FFFFFF','','','');\t\t\t\t\t// Folders\n\t\t$defcolors[5]=array('#F90','#FFFFFF','#CCC','inherit','#999');\t// MacOs\n\t\t$defcolors[6]=array('#F90','#FFFFFF','#FFF','#DDD','#999');\t\t// Plain\n\t\t$defcolors[7]=array('#F90','#FFFFFF','','','');\t\t\t\t\t// Rounded\n\t\t$defcolors[8]=array('#F90','#FFFFFF','#F90','#930','#C60');\t\t// ZDnet\n\n\t\t$myurl=$_SERVER[\"PHP_SELF\"];\n\t\tif(substr($myurl,strlen($myurl)-1,1)=='/') {\n\t\t\t$myurl.=\"index.php\";\n\t\t}\n\t\t$myurl.='?';\n\n\t\tforeach($_GET as $key => $value) {\n\t\t\tif($key!='NewsTab') {\n\t\t\t\t$myurl.=$key.'='.$value.'&';\n\t\t\t}\n\t\t}\n\t\t$block['url']=$myurl;\n\n\t\t$tabscount=0;\n\t\t$usespotlight=false;\n\n\t\tif(isset($_GET['NewsTab'])) {\n\t\t\t$_SESSION['NewsTab']=intval($_GET['NewsTab']);\n\t\t\t$currenttab = intval($_GET['NewsTab']);\n\t\t} elseif(isset($_SESSION['NewsTab'])) {\n\t\t\t$currenttab = intval($_SESSION['NewsTab']);\n\t\t} else {\n\t\t\t$currenttab=0;\n\t\t}\n\n\t\t$tmpstory = new NewsStory();\n\t\t$topic= new NewsTopic();\n\t\t$topicstitles=array();\n\t\tif($options[4]==1) {\t// Spotlight enabled\n\t\t\t$topicstitles[0]=_MB_NEWS_SPOTLIGHT_TITLE;\n\t\t\t$tabscount++;\n\t\t\t$usespotlight=true;\n\t\t}\n\n\t\tif($options[5]==0 && $restricted) {\t// Use a specific news and we are in restricted mode\n\t\t\t$permittedtopics=MygetItemIds();\n\t\t\t$permstory = new NewsStory($options[6]);\n\t\t\tif(!in_array($permstory->topicid(),$permittedtopics)) {\n\t\t\t\t$usespotlight=false;\n\t\t\t\t$topicstitles=array();\n\t\t\t}\n\t\t\tunset($permstory);\n\t\t}\n\n\t\t$block['use_spotlight']=$usespotlight;\n\n \tif (isset($options[14]) && $options[14] != 0) {\t\t// Topic to use\n\t $topics = array_slice($options, 14);\n \t$tabscount+=count($topics);\n\t\t\t$topicstitles=$topic->getTopicTitleFromId($topics,$topicstitles);\n \t}\n \t$tabs=array();\n \tif($usespotlight) {\n \t\t$tabs[]=array('id'=>0,'title'=>_MB_NEWS_SPOTLIGHT_TITLE);\n \t}\n \tif(count($topics)>0) {\n \t\tforeach($topics as $onetopic) {\n \t\t\tif(isset($topicstitles[$onetopic])) {\n\t \t\t\t$tabs[]=array('id'=>$onetopic, 'title'=>$topicstitles[$onetopic]['title'], 'picture'=>$topicstitles[$onetopic]['picture']);\n\t \t\t}\n \t\t}\n \t}\n \t$block['tabs']=$tabs;\n \t$block['current_is_spotlight']=false;\n \t$block['current_tab']=$currenttab;\n \t$block['use_rating']=$newsrating;\n\n\n\t\tif($currenttab==0 && $usespotlight) {\t// Spotlight or not ?\n\t\t\t$block['current_is_spotlight']=true;\n\t\t\tif($options[5]==0 && $options[6]==0) {\t// If the story to use was no selected then we switch to the \"recent news\" mode.\n\t\t\t\t$options[5]=1;\n\t\t\t}\n\n\t\t\tif($options[5]==0) {\t// Use a specific news\n\t\t\t\t$tmpstory->NewsStory(intval($options[6]));\n\t\t\t} else {\t\t\t\t// Use the most recent news\n\t\t\t\t$stories=array();\n\t\t\t\t$stories=$tmpstory->getAllPublished(1,0,$restricted,0,1,true,$options[0]);\n\t\t\t\tif(count($stories)>0)\n\t\t\t\t{\n \t$firststory=$stories[0];\n \t$tmpstory->NewsStory($firststory->storyid());\n\t\t\t\t} else {\n\t\t\t\t\t$block['use_spotlight']=false;\n\t\t\t\t}\n\t\t\t}\n \t$spotlight = array();\n\t\t\t$spotlight['title'] = $tmpstory->title();\n \t\tif ($options[7] != \"\") {\n\t \t$spotlight['image'] = sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),$myts->displayTarea($options[7], $tmpstory->nohtml));\n\t\t\t}\n \t\t$spotlight['text'] = $tmpstory->hometext();\n \t\t$spotlight['id'] = $tmpstory->storyid();\n \t\t$spotlight['date'] = formatTimestamp($tmpstory->published(), $dateformat);\n \t\t$spotlight['hits'] = $tmpstory->counter();\n \t\t$spotlight['rating'] = number_format($tmpstory->rating(), 2);\n \t\t$spotlight['votes'] = $tmpstory->votes();\n\t\t\tif(strlen(xoops_trim($tmpstory->bodytext()))>0) {\n\t\t\t\t$spotlight['read_more']=true;\n\t\t\t} else {\n\t\t\t\t$spotlight['read_more']=false;\n\t\t\t}\n\n \t\t$spotlight['readmore'] = sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),_MB_READMORE);\n \t\t$spotlight['title_with_link'] = sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),$tmpstory->title());\n \t\tif($tmpstory->votes()==1) {\n\t\t\t\t$spotlight['number_votes']=_NW_ONEVOTE;\n\t\t\t} else {\n\t\t\t\t$spotlight['number_votes']=sprintf(_NW_NUMVOTES,$tmpstory->votes());\n\t\t\t}\n\n \t\t$spotlight['votes_with_text']=sprintf(_NW_NUMVOTES,$tmpstory->votes());\n \t\t$spotlight['topicid'] = $tmpstory->topicid();\n \t\t$spotlight['topic_title'] = $tmpstory->topic_title();\n\t\t\t// Added, topic's image and description\n \t\t\t$spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$tmpstory->topic_imgurl();\n \t\t\t$spotlight['topic_description']=$myts->displayTarea($tmpstory->topic_description,1);\n\n \tif($displayname!=3) {\n \t\t$spotlight['author'] = sprintf(\"%s %s\",_POSTEDBY,$tmpstory->uname());\n \t\t\t$spotlight['author_with_link'] = sprintf(\"%s <a href='%s'>%s</a>\",_POSTEDBY,XOOPS_URL.'/userinfo.php?uid='.$tmpstory->uid(),$tmpstory->uname());\n \t\t} else {\n \t\t$spotlight['author'] = '';\n \t\t\t$spotlight['author_with_link'] = '';\n \t\t}\n \t\t$spotlight['author_id'] = $tmpstory->uid();\n\n\t\t\t// Create the summary table under the spotlight text\n\t\t\tif (isset($options[14]) && $options[14] == 0) {\t\t// Use all topics\n\t \t$stories = $tmpstory->getAllPublished($options[1],0,$restricted,0,1,true,$options[0]);\n \t\t\t} else {\t\t\t\t\t// Use some topics\n\t \t$topics = array_slice($options, 14);\n \t\t\t$stories = $tmpstory->getAllPublished($options[1],0,$restricted,$topics,1,true,$options[0]);\n \t\t\t}\n \t\t\tif(count($stories)>0) {\n \t\t\t\tforeach ($stories as $key => $story) {\n\t\t\t\t\t$news = array();\n\t \t\t\t$title = $story->title();\n\t\t\t\t\tif (strlen($title) > $options[2]) {\n\t\t\t\t\t\t$title = xoops_substr($title,0,$options[2]+3);\n\t\t\t\t\t}\n \t\t\t$news['title'] = $title;\n \t\t\t$news['id'] = $story->storyid();\n \t\t\t$news['date'] = formatTimestamp($story->published(), $dateformat);\n \t\t\t$news['hits'] = $story->counter();\n \t\t\t$news['rating'] = number_format($story->rating(), 2);\n \t\t\t$news['votes'] = $story->votes();\n \t\t\t$news['topicid'] = $story->topicid();\n \t\t\t$news['topic_title'] = $story->topic_title();\n \t\t\t$news['topic_color'] = '#'.$myts->displayTarea($story->topic_color);\n \t\t\tif($displayname!=3) {\n\t \t\t$news['author']= sprintf(\"%s %s\",_POSTEDBY,$story->uname());\n \t\t\t} else {\n\t \t\t$news['author']= '';\n \t\t\t}\n \t\tif ($options[3] > 0) {\n\t\t \t\t$news['teaser'] = xoops_substr(strip_tags($story->hometext()), 0, $options[3]+3);\n \t\t\t} else {\n\t\t\t \t$news['teaser'] = \"\";\n \t\t\t}\n\t\t\t\t\tif($infotips>0) {\n\t\t\t\t\t\t$news['infotips'] = ' title=\"'.xoops_substr(strip_tags($story->hometext()),0,$infotips).'\"';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$news['infotips'] = '';\n\t\t\t\t\t}\n\n \t\t\t$news['title_with_link'] = sprintf(\"<a href='%s'%s>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);\n \t\t\t$spotlight['news'][] = $news;\n \t\t}\n\t\t\t}\n\n\t\t\t$block['spotlight'] = $spotlight;\n\t\t} else {\n\t\t\tif($tabscount>0) {\n\t \t\t$topics = array_slice($options, 14);\n \t\t\t$thetopic=$currenttab;\n \t\t\t$stories = $tmpstory->getAllPublished($options[1],0,$restricted,$thetopic,1,true,$options[0]);\n\n \t\t\t$topic->getTopic($thetopic);\n \t\t\t// Added, topic's image and description\n \t\t\t$block['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$topic->topic_imgurl();\n \t\t\t$block['topic_description']=$topic->topic_description();\n\n \t\t\t$smallheader=array();\n \t\t\t$stats=$topic->getTopicMiniStats($thetopic);\n \t\t\t$smallheader[]=sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/index.php?storytopic='.$thetopic,_MB_READMORE);\n \t\t\t$smallheader[]=sprintf(\"%u %s\",$stats['count'],_NW_ARTICLES);\n \t\t\t$smallheader[]=sprintf(\"%u %s\",$stats['reads'],_READS);\n\t\t\t\tif(count($stories)>0) {\n \t\t\t\tforeach ($stories as $key => $story) {\n\t\t\t\t $news = array();\n\t\t \t\t$title = $story->title();\n\t\t\t\t\t\tif (strlen($title) > $options[2]) {\n\t\t\t\t\t\t\t$title = xoops_substr(strip_tags($title),0,$options[2]+3);\n\t\t\t\t\t\t}\n \t\t\tif ($options[7] != \"\") {\n\t\t\t $news['image'] = sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$myts->displayTarea($options[7], $story->nohtml));\n \t\t\t}\n \t\tif($options[3]>0) {\n\t\t \t$news['text'] = xoops_substr(strip_tags($story->hometext()), 0, $options[3]+3);\n \t\t} else {\n\t\t\t\t\t\t\t$news['text'] = '';\n \t\t}\n\n\t\t \tif($story->votes()==1) {\n\t\t\t\t\t\t\t$news['number_votes']=_NW_ONEVOTE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$news['number_votes']=sprintf(_NW_NUMVOTES,$story->votes());\n\t\t\t\t\t\t}\n \t\t\t\t$topic->getTopic($story->topicid());\n\t\t\t\t\t\tif($infotips>0) {\n\t\t\t\t\t\t\t$news['infotips'] = ' title=\"'.xoops_substr(strip_tags($story->hometext()),0,$infotips).'\"';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$news['infotips'] = '';\n\t\t\t\t\t\t}\n \t\t\t$news['title']=sprintf(\"<a href='%s' %s>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);\n \t\t\t$news['id'] = $story->storyid();\n \t\t\t$news['date'] = formatTimestamp($story->published(), $dateformat);\n \t\t\t$news['hits'] = $story->counter();\n \t\t\t$news['rating'] = number_format($story->rating(), 2);\n \t\t\t$news['votes'] = $story->votes();\n \t\t\t$news['topicid'] = $story->topicid();\n \t\t\t$news['topic_title'] = $story->topic_title();\n \t\t\t$news['topic_color'] = '#'.$topic->topic_color();\n\t\t\t\t\t\tif($displayname!=3) {\n\t \t\t\t$news['author'] = sprintf(\"%s %s\",_POSTEDBY,$story->uname());\n \t\t\t} else {\n\t \t\t\t$news['author'] = '';\n \t\t\t}\n \t\t\t$news['title_with_link'] = sprintf(\"<a href='%s'%s>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);\n \t\t\t$block['news'][] = $news;\n \t\t}\n \t\t$block['smallheader']=$smallheader;\n \t}\n\t\t\t}\n\t\t}\n \t$block['lang_on']=_ON;\t\t\t\t\t\t\t// on\n \t$block['lang_reads']=_READS;\t\t\t\t\t// reads\n \t// Default values\n \t$block['color1']=$defcolors[$tabskin][0];\n \t$block['color2']=$defcolors[$tabskin][1];\n \t$block['color3']=$defcolors[$tabskin][2];\n \t$block['color4']=$defcolors[$tabskin][3];\n \t$block['color5']=$defcolors[$tabskin][4];\n\n\t\tif(xoops_trim($options[9])!='') {\n\t\t\t$block['color1']=$options[9];\n\t\t}\n\t\tif(xoops_trim($options[10])!='') {\n\t\t\t$block['color2']=$options[10];\n\t\t}\n\t\tif(xoops_trim($options[11])!='') {\n\t\t\t$block['color3']=$options[11];\n\t\t}\n\t\tif(xoops_trim($options[12])!='') {\n\t\t\t$block['color4']=$options[12];\n\t\t}\n\t\tif(xoops_trim($options[13])!='') {\n\t\t\t$block['color5']=$options[13];\n\t\t}\n } else {\t\t// ************************ Classical view **************************************************************************************************************\n\t\t$tmpstory = new NewsStory;\n \tif (isset($options[14]) && $options[14] == 0) {\n\t $stories = $tmpstory->getAllPublished($options[1],0,$restricted,0,1,true,$options[0]);\n\t } else {\n \t$topics = array_slice($options, 14);\n \t$stories = $tmpstory->getAllPublished($options[1],0,$restricted,$topics,1,true,$options[0]);\n \t}\n\n \tif(!count($stories)) {\n\t \treturn '';\n\t }\n\t $topic= new NewsTopic();\n\n\t foreach ($stories as $key => $story) {\n \t$news = array();\n \t$title = $story->title();\n\t\t\tif (strlen($title) > $options[2]) {\n\t\t\t\t$title = xoops_substr($title,0,$options[2]+3);\n\t\t\t}\n \t$topic->getTopic($story->topicid());\n\n \t//if spotlight is enabled and this is either the first article or the selected one\n \tif (($options[5]==0) && ($options[4] == 1) && (($options[6] > 0 && $options[6] == $story->storyid()) || ($options[6] == 0 && $key == 0))) {\n \t\t$spotlight = array();\n\t\t\t\t$visible=true;\n \t\tif($restricted) {\n \t\t\t$permittedtopics=MygetItemIds();\n \t\t\tif(!in_array($story->topicid(),$permittedtopics)) {\n \t\t\t\t$visible=false;\n \t\t\t}\n \t\t}\n\n \t\tif($visible) {\n \t\t$spotlight['title'] = $title;\n \t\tif ($options[7] != \"\") {\n\t\t $spotlight['image']= sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$myts->displayTarea($options[7], $story->nohtml));\n \t\t}\n \t\t$spotlight['text'] = $story->hometext();\n \t\t$spotlight['id'] = $story->storyid();\n \t\t$spotlight['date'] = formatTimestamp($story->published(), $dateformat);\n \t\t$spotlight['hits'] = $story->counter();\n \t\t$spotlight['rating'] = $story->rating();\n \t\t$spotlight['votes'] = $story->votes();\n \t\t$spotlight['topicid'] = $story->topicid();\n \t\t$spotlight['topic_title'] = $story->topic_title();\n \t\t$spotlight['topic_color'] = '#'.$topic->topic_color();\n \t\t// Added, topic's image and description\n\t\t \t\t\t$spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$story->topic_imgurl();\n \t\t\t\t\t$spotlight['topic_description']=$myts->displayTarea($story->topic_description,1);\n \t\t\t\t\tif(strlen(xoops_trim($story->bodytext()))>0) {\n \t\t\t\t\t\t$spotlight['read_more']=true;\n \t\t\t\t\t} else {\n \t\t\t\t\t\t$spotlight['read_more']=false;\n \t\t\t\t\t}\n\n \t\tif($displayname!=3) {\n\t \t\t$spotlight['author'] = sprintf(\"%s %s\",_POSTEDBY,$story->uname());\n \t\t} else {\n\t \t\t$spotlight['author'] = '';\n \t\t}\n \t}\n \t$block['spotlight'] = $spotlight;\n \t} else {\n\t $news['title'] = $title;\n \t$news['id'] = $story->storyid();\n \t$news['date'] = formatTimestamp($story->published(), $dateformat);\n \t$news['hits'] = $story->counter();\n \t$news['rating'] = $story->rating();\n \t$news['votes'] = $story->votes();\n \t$news['topicid'] = $story->topicid();\n \t$news['topic_title'] = $story->topic_title();\n \t$news['topic_color'] = '#'.$topic->topic_color();\n \tif($displayname!=3) {\n \t\t$news['author']= sprintf(\"%s %s\",_POSTEDBY,$story->uname());\n \t} else {\n \t\t$news['author']= '';\n \t}\n \tif ($options[3] > 0) {\n\t $news['teaser'] = xoops_substr(strip_tags($story->hometext()), 0, $options[3]+3);\n \t$news['infotips'] = '';\n \t} else {\n\t $news['teaser'] = \"\";\n\t\t\t\t\tif($infotips>0) {\n\t\t\t\t\t\t$news['infotips'] = ' title=\"'.xoops_substr(strip_tags($story->hometext()),0,$infotips).'\"';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$news['infotips'] = '';\n\t\t\t\t\t}\n \t}\n \t$block['stories'][] = $news;\n \t}\n \t}\n\n\t // If spotlight article was not in the fetched stories\n\t if (!isset($spotlight) && $options[4]) {\n\t \t$block['use_spotlight']=true;\n\t \t$visible=true;\n\t\t\tif($options[5]==0 && $restricted) {\t// Use a specific news and we are in restricted mode\n \t\t\t$permittedtopics=MygetItemIds();\n \t\t\t$permstory = new NewsStory($options[6]);\n \t\t\tif(!in_array($permstory->topicid(),$permittedtopics)) {\n \t\t\t\t$visible=false;\n \t\t\t}\n \t\t\tunset($permstory);\n \t\t}\n\n\t\t\tif($options[5]==0) {\t// Use a specific news\n\t\t\t\tif($visible) {\n\t\t\t\t\t$spotlightArticle = new NewsStory($options[6]);\n\t\t\t\t} else {\n\t\t\t\t\t$block['use_spotlight']=false;\n\t\t\t\t}\n\t\t\t} else {\t\t\t\t// Use the most recent news\n\t\t\t\t$stories=array();\n\t\t\t\t$stories=$tmpstory->getAllPublished(1,0,$restricted,0,1,true,$options[0]);\n\t\t\t\tif(count($stories)>0) {\n \t$firststory=$stories[0];\n \t$spotlightArticle = new NewsStory($firststory->storyid());\n\t\t\t\t} else {\n\t\t\t\t\t$block['use_spotlight']=false;\n\t\t\t\t}\n\t\t\t}\n if($block['use_spotlight']==true) {\n \t\t$spotlight = array();\n \t\t$topic->getTopic($spotlightArticle->storyid());\n \t\t$spotlight['title'] = xoops_substr($spotlightArticle->title(),0,($options[2]-1));;\n \t\tif ($options[7] != \"\") {\n\t\t $spotlight['image'] = sprintf(\"<a href='%s'>%s</a>\", XOOPS_URL.'/modules/news/article.php?storyid='.$spotlightArticle->storyid(),$myts->displayTarea($options[7], $spotlightArticle->nohtml));\n \t\t}\n\t\t\t\t$spotlight['topicid'] = $spotlightArticle->topicid();\n \t\t$spotlight['topic_title'] = $spotlightArticle->topic_title();\n \t\t$spotlight['topic_color'] = '#'.$topic->topic_color();\n \t\t$spotlight['text'] = $spotlightArticle->hometext();\n \t\t$spotlight['id'] = $spotlightArticle->storyid();\n \t\t$spotlight['date'] = formatTimestamp($spotlightArticle->published(), $dateformat);\n \t\t$spotlight['hits'] = $spotlightArticle->counter();\n\t\t\t\t$spotlight['rating'] = $spotlightArticle->rating();\n\t\t\t\t$spotlight['votes'] = $spotlightArticle->votes();\n\t\t\t\t// Added, topic's image and description\n\t \t\t\t$spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$spotlightArticle->topic_imgurl();\n\t\t\t\t$spotlight['topic_description']=$myts->displayTarea($spotlightArticle->topic_description,1);\n\t\t\t\tif($displayname!=3) {\n\t \t\t$spotlight['author'] = sprintf(\"%s %s\",_POSTEDBY,$spotlightArticle->uname());\n \t\t} else {\n\t\t\t\t\t$spotlight['author'] = '';\n \t\t}\n \t\tif(strlen(xoops_trim($spotlightArticle->bodytext()))>0) {\n\t\t\t\t\t$spotlight['read_more']=true;\n\t\t\t\t} else {\n\t\t\t\t\t$spotlight['read_more']=false;\n\t\t\t\t}\n \t\t$block['spotlight'] = $spotlight;\n \t}\n \t}\n\t}\n \t$block['lang_read_more']=_MB_READMORE;\t\t\t// Read More...\n \t$block['lang_orderby']=_MB_NEWS_ORDER;\t\t\t// \"Order By\"\n \t$block['lang_orderby_date']=_MB_NEWS_DATE;\t\t// Published date\n \t$block['lang_orderby_hits']=_MB_NEWS_HITS;\t\t// Number of Hits\n \t$block['lang_orderby_rating']=_MB_NEWS_RATE;\t// Rating\n \t$block['sort']=$options[0];\t\t\t\t\t\t// \"published\" or \"counter\" or \"rating\"\n return $block;\n}", "public function renderNews()\n\t{\n $template = $this->template;\n $template->title = \"Aktuality\";\n\t\t$template->news = $this->news->getNewest(10);\n\t}", "public function news(){}", "public function newsAction()\n {\n $owFeed = null;\n $version = $this->_config->version;\n\n $translate = OntoWiki::getInstance()->translate;\n $this->view->placeholder('main.window.title')->set('Heloïse - European Workshop on academic Databases');\n\n try {\n $url = 'http://heloise.hypotheses.org/category/actualites-news/feed';\n\n $owFeed = Zend_Feed::import($url);\n\n $this->view->feed = $owFeed;\n $this->view->title = $owFeed->title();\n $this->view->link = $owFeed->link();\n $this->view->description = $owFeed->description();\n } catch (Exception $e) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Error loading feed: ' . $url, OntoWiki_Message::WARNING)\n );\n $this->view->feed = array();\n }\n\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n }", "public function display_news_dashboard_widget() {\n\t\n\t\t// Create two feeds, the first being just a leading article with data and summary, the second being a normal news feed\n\t\t$feeds = array(\n\t\t\t$first = array(\n\t\t\t\t'link' \t\t\t=> 'https://oxosolutions.com/blog/',\n\t\t\t\t'url' \t\t\t=> 'https://oxosolutions.com/feed/',\n\t\t\t\t'title' \t\t=> __( 'OXOSolutions News', 'Aione' ),\n\t\t\t\t'items' \t\t=> 1,\n\t\t\t\t'show_summary' \t=> 1,\n\t\t\t\t'show_author' \t=> 0,\n\t\t\t\t'show_date' \t=> 1\n\t\t\t),\n\n\t\t\t$news = array(\n\t\t\t\t'link' \t\t\t=> 'https://oxosolutions.com/blog/',\n\t\t\t\t'url' \t\t\t=> 'https://oxosolutions.com/feed/', \n\t\t\t\t'title' \t\t=> __( 'OXOSolutions News', 'Aione' ),\n\t\t\t\t'items' \t\t=> 4,\n\t\t\t\t'show_summary' \t=> 0,\n\t\t\t\t'show_author' \t=> 0,\n\t\t\t\t'show_date' \t=> 0\n\t\t\t)\n\t\t);\n\n\t\twp_dashboard_primary_output( 'themeoxo_news', $feeds );\n\t}", "public function index()\n\t{\n\t\t$articles = $this->get_articles($this->_settings['news.default_article_count']);\n\t\tTemplate::set('articles', $articles);\n\t\tTemplate::set('settings', $this->_settings);\n\t\tTemplate::set('single', false);\n\t\tTemplate::render();\n\t}", "function wp_dashboard_events_news() {\n\twp_print_community_events_markup();\n\n\t?>\n\n\t<div class=\"wordpress-news hide-if-no-js\">\n\t\t<?php wp_dashboard_primary(); ?>\n\t</div>\n\n\t<p class=\"community-events-footer\">\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t'https://make.wordpress.org/community/meetups-landing-page',\n\t\t\t\t__( 'Meetups' ),\n\t\t\t\t/* translators: accessibility text */\n\t\t\t\t__( '(opens in a new window)' )\n\t\t\t);\n\t\t?>\n\n\t\t|\n\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t'https://central.wordcamp.org/schedule/',\n\t\t\t\t__( 'WordCamps' ),\n\t\t\t\t/* translators: accessibility text */\n\t\t\t\t__( '(opens in a new window)' )\n\t\t\t);\n\t\t?>\n\n\t\t|\n\n\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<a href=\"%1$s\" target=\"_blank\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a>',\n\t\t\t\t/* translators: If a Rosetta site exists (e.g. https://es.wordpress.org/news/), then use that. Otherwise, leave untranslated. */\n\t\t\t\tesc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),\n\t\t\t\t__( 'News' ),\n\t\t\t\t/* translators: accessibility text */\n\t\t\t\t__( '(opens in a new window)' )\n\t\t\t);\n\t\t?>\n\t</p>\n\n\t<?php\n}", "function custom_dashboard_widget() {\n\t\t$rss = new DOMDocument();\n\t\t$rss->load('http://wpfolio.visitsteve.com/wiki/feed');\n\t\t$feed = array();\n\t\tforeach ($rss->getElementsByTagName('item') as $node) {\n\t\t\t$item = array ( \n\t\t\t\t'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,\n\t\t\t\t// 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,\n\t\t\t\t'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,\n\t\t\t\t'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,\n\t\t\t\t);\n\t\t\tarray_push($feed, $item);\n\t\t}\n\t\t$limit = 5; // change how many posts to display here\n\t\techo '<ul>'; // wrap in a ul\n\t\tfor($x=0;$x<$limit;$x++) {\n\t\t\t$title = str_replace(' & ', ' &amp; ', $feed[$x]['title']);\n\t\t\t$link = $feed[$x]['link'];\n\t\t\t// $description = $feed[$x]['desc'];\n\t\t\t$date = date('l F d, Y', strtotime($feed[$x]['date']));\n\t\t\techo '<li><p><strong><a href=\"'.$link.'\" title=\"'.$title.'\">'.$title.'</a></strong>';\n\t\t\techo ' - '.$date.'</p></li>';\n\t\t\t// echo '<p>'.$description.'</p>';\n\t\t}\n\t\techo '</ul>';\n\t\techo '<p class=\"textright\"><a href=\"http://wpfolio.visitsteve.com/wiki/category/news\" class=\"button\">View all</a></p>'; // link to site\t\n\t}", "static function showNewsList() {\n global $DB;\n\n $now = date('Y-m-d H:i:s');\n\n $restrict_visibility = \" AND (`glpi_reminders`.`begin_view_date` IS NULL\n OR `glpi_reminders`.`begin_view_date` < '$now')\n AND (`glpi_reminders`.`end_view_date` IS NULL\n OR `glpi_reminders`.`end_view_date` > '$now') \";\n\n // Show public reminders / not mines : need to have access to public reminders\n if (!Session::haveRight('reminder_public', READ)) {\n return false;\n }\n\n $restrict_user = '1';\n\n $query = \"SELECT `glpi_reminders`.*\n FROM `glpi_reminders`\n \" . self::addVisibilityJoins() . \"\n WHERE $restrict_user\n $restrict_visibility\n AND \" . Reminder::addVisibilityRestrict() . \"\n ORDER BY `glpi_reminders`.`name`\";\n\n $titre = _n('Public reminder', 'Public reminders', 2);\n\n $result = $DB->query($query);\n $nb = $DB->numrows($result);\n\n if ($nb) {\n echo \"<table class='treetable'>\";\n echo \"<thead><tr><th class='title'>\" . $titre . \"</th></tr></thead>\";\n echo \"</table>\";\n echo \"<div id='wrap-treetable3'>\";\n echo \"<div id='fibnews-div'>\";\n echo \"<ul>\";\n while ($data = $DB->fetchArray($result)) {\n echo \"<li>\";\n echo '<h1>' . $data[\"name\"] . '</h1>';\n echo Toolbox::unclean_html_cross_side_scripting_deep($data[\"text\"]);\n echo \"</li>\";\n }\n echo \"</ul>\";\n echo \"</div></div>\";\n\n echo \"<script type='text/javascript'>\n $(function() {\n $('#fibnews-div').vTicker({\n speed: 500,\n pause: 3000,\n showItems: 3,\n animation: 'fade',\n mousePause: true,\n height: 0,\n direction: 'up'\n });\n });\n </script>\";\n }\n }", "function js_dashboard_widget() {\n\t\t\t\tinclude_once(ABSPATH . WPINC . '/feed.php');\n\t\t\t\t$rss = fetch_feed('http://daily.makerfaire.com/rss.xml');\n\t\t\t\t$rss_items = $rss->get_items( 0, $rss->get_item_quantity(3) );\n\t\t\t\tif ( !$rss_items ) {\n\t\t\t\t\techo 'no items';\n\t\t\t\t} else {\n\t\t\t\t\t//echo '<h4>Recent Posts</h4>';\n\t\t\t\t\techo '<div class=\"news post\">';\n\t\t\t\t\tforeach ( $rss_items as $item ) {\n\t\t\t\t\t\techo '<h3><a class=\"rsswidget\" href=\"' . $item->get_permalink() . '\">' . $item->get_title() . '</a>';\n\t\t\t\t\t\techo ' <span>' . $item->get_date(($date_format = '(j F Y, g:i a)')) . '</span>';\n\t\t\t\t\t\techo '</h3>';\n\t\t\t\t\t\techo '<p>' . shorten($item->get_description(), 140). '</p>';\n\t\t\t\t\t\tif ($author = $item->get_author())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<cite>' .$author->get_name(). '</cite></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\techo '</div>';\n\t\t\t\t\techo '<div class=\"clear\"></div>';\n\t\t\t\t}", "public function actionIndex() {\n $datas = Feeds::find()->where(['status' => 1])->orderBy('created_time desc')->limit(20)->all();\n $profile = \"\";\n if (Yii::$app->user->identity) {\n $profile = UserProfile::find()->where(['user_id' => Yii::$app->user->identity->_id])->one();\n }\n return $this->render('_newsfeed', [\n 'datas' => $datas,\n 'profile' => $profile,\n ]);\n }", "function get_news_article_html( $article, $xml ){\n $ds = $xml->{'system-data-structure'};\n $imagePath = $ds->{'media'}->{'image'}->{'path'};\n $externalPath = $article['external-path'];\n if( $externalPath == \"\")\n $path = $article['path'];\n else\n $path = $externalPath;\n\n $date = $ds->{'publish-date'};\n\n $html = '<div class=\"grid\">';\n $html .= '<div class=\"grid-cell u-medium-1-3\">';\n $html .= '<div class=\"medium-grid-pad-1x\">';\n\n global $destinationName;\n $html .= '<a href=\"http://'.$destinationName.'.bethel.edu'.$path.'\">';\n $html .= render_image($imagePath, $article['description'], \"media-box-img delayed-image-load\", \"\", $destinationName);\n $html .= '</a>';\n $html .= '</div>';\n $html .= '</div>';\n\n $html .= '<div class=\"grid-cell u-medium-2-3\">';\n $html .= '<div class=\"medium-grid-pad-1x\">';\n $html .= '<h2 class=\"h5\"><a href=\"http://'.$destinationName.'.bethel.edu'.$path.'\">'.$article['title'].'</a></h2>';\n\n if( $date != \"\" && $date != \"null\" )\n {\n $formattedDate = format_featured_date_news_article($date);\n $html .= \"<p>\".$formattedDate.\"</p>\";\n }\n global $DisplayTeaser;\n if( $DisplayTeaser == \"Yes\" )\n {\n $html .= '<p>'.$article['teaser'].'</p>';\n }\n $html .= '</div>';\n\n $html .= '</div>';\n $html .= '</div>';\n\n return $html;\n}", "function arras_above_index_news_post() {\n\tdo_action('arras_above_index_news_post');\t\n}", "function put_ticker($show = true)\n{\n\t$ticker = get_ticker_content('ticker');\n\tif((!$show && !empty($ticker)) || $show) {\n\t\tprint(\"<div id='ticker'><strong>News</strong> <div class='ticker-div'>\");\n\t\techo $ticker;\n\t\tprint(\"</div></div>\");\n\t}\n}", "function wp_dashboard_events_news()\n{\n}", "public function news()\n\t{\n\t\t\t $this->load->view(\"news\", $this->data);\t\n\t}", "function carawebs_back_to_news() {\n\n\tif( get_option( 'show_on_front' ) == 'page' ) {\n\n\t\t$bloglink = get_permalink( get_option('page_for_posts' ) );\n\t\t$blogname = get_the_title( get_option('page_for_posts'));\n\n\t}\n\n\telse {\n\n\t\t$bloglink = bloginfo('url');\n\t\t$blogname = bloginfo('name');\n\n\t}\n\n\n\t?><p class=\"backarrow\"><a class =\"category_link\" href=\"<?php echo $bloglink; ?>\">Back to <?php echo $blogname ?></a></p><?php\n\n\n\n}", "function show () {\n global $txtf;\n\n // export articleid from user input\n $articleid = $this->vars['articleid'];\n\n if ($this->checkAccess() == false) return \"\";\n\n if ($articleid != \"\") {\n $this->articleid = addslashes($articleid);\n }\n if ($this->module_param[\"news\"] != \"\" && !$this->group) $this->setGroup($this->module_param[\"news\"]);\n if ($this->module_param[\"news1\"] != \"\" && $this->count == 0) $this->setCount($this->module_param[\"news1\"]);\n if ($this->module_param[\"news2\"] != \"\" && !$this->date1) $this->setDateSpan($this->module_param[\"news2\"], $this->module_param[\"news3\"]);\n\n if ($this->vars[\"article_archive\"] > 1900 && $this->vars[\"article_archive\"] < 3000) {\n $this->vars[\"article_date1\"] = $this->vars[\"article_archive\"] . \"-01-01\";\n $this->vars[\"article_date2\"] = $this->vars[\"article_archive\"] . \"-12-31\";\n }\n\n if ($this->vars[\"article_date1\"] != \"\") $this->setDateSpan($this->vars[\"article_date1\"], $this->vars[\"article_date2\"]);\n\n $sq = new sql;\n\n $txt = new Text($this->language, \"module_news\");\n\n // instantiate template class\n $tpl = new template;\n $tpl->tplfile = $this->tplfile;\n $tpl->setCacheLevel($this->cachelevel);\n $tpl->setCacheTtl($this->cachetime);\n $usecache = checkParameters();\n\n // creating correct url for news\n $sql = \"SELECT content, structure FROM content WHERE template = 4 AND language = '\" . addslashes($this->language) . \"' LIMIT 1\";\n $sq->query($this->dbc, $sql);\n if ($data = $sq->nextrow()) {\n $contact_url = $_SERVER[\"PHP_SELF\"] . \"?structure=\" . $data[\"structure\"];\n if ($data[\"content\"]) {\n $contact_url .= \"&content=\" . $data[\"content\"];\n }\n $tpl->addDataItem(\"NEWS_URL\", $contact_url);\n }\n\n\n if ($this->count == 0) $this->count = $this->full_count;\n\n if (!$this->template) {\n $this->template = \"module_news_full.html\";\n }\n\n if ($this->vars[\"archive\"] == true) {\n $this->template = \"module_news_full_archive.html\";\n $this->count = $this->archive_count;\n }\n\n if ($this->articleid && !$this->detail) $this->articleid = false;\n\n if ($this->articleid && $this->detail) {\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . $this->detail;\n }\n else {\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . $this->template;\n }\n\n\n $tpl->setInstance($_SERVER[\"PHP_SELF\"].\"?language=\".$this->language.\"&module=news&group=\".$this->group.\"&articleid=\".$this->articleid.\"&date1=\".addslashes($this->date1).\"&date2=\".addslashes($this->date2));\n $tpl->setTemplateFile($template);\n\n // PAGE CACHED\n if ($tpl->isCached($template) == true && $usecache == true) {\n $GLOBALS[\"caching\"][] = \"news\";\n if ($GLOBALS[\"modera_debug\"] == true) {\n return \"<!-- module news cached -->\\n\" . $tpl->parse();\n }\n else {\n return $tpl->parse();\n }\n\n }\n\n // #################################\n // find out the page to link the news to\n\n if ($this->url == \"\") {\n\n if ($this->group) {\n $sq->query($this->dbc, \"SELECT content, structure FROM content WHERE module LIKE '%news=\".addslashes($this->group).\"%' AND language = '\" . addslashes($this->language) . \"' LIMIT 1\");\n }\n else {\n $sq->query($this->dbc, \"SELECT content, structure FROM content WHERE template = 4 AND language = '\" . addslashes($this->language) . \"' LIMIT 1\");\n }\n if ($sq->numrows != 0) { $data = $sq->nextrow(); $general_url = $_SERVER[\"PHP_SELF\"].\"?structure=\" . $data[\"structure\"] . \"&content=\" . $data[\"content\"]; }\n else {\n //$general_url = \"#PLEASE_CREATE_NEWS_PAGE\";\n $general_url = $_SERVER[\"PHP_SELF\"] . \"?structure=\". $this->vars[\"structure\"] . \"&content=\".$this->vars[\"content\"];\n }\n $sq->free();\n\n }\n else {\n $general_url = $this->url;\n }\n\n // #################################\n\n if ($this->group) $grp = \"AND ngroup = '\".$this->group.\"'\";\n else { $grp = \"\"; }\n\n if ($this->date1) $datespan = \"AND module_news.entrydate >= '\".addslashes($this->date1).\"' AND module_news.entrydate <= '\".addslashes($this->date2).\"'\";\n else { $datespan = \"\"; }\n\n if ($this->group) {\n //$sq->query($this->dbc, \"SELECT name FROM module_news_groups WHERE language = '\".$this->language.\"' AND id = '\".$this->group.\"'\");\n // 08.09 language reference in groups removed\n $sq->query($this->dbc, \"SELECT name FROM module_news_groups WHERE id = '\".$this->group.\"'\");\n $group_name = $sq->column(0, \"name\");\n }\n\n // #################################\n\n if ($this->articleid) {\n\n $sq->query($this->dbc, \"SELECT id, unix_timestamp(entrydate) as date, pic, title, author, lead, content FROM module_news WHERE language = '\".$this->language.\"' $grp AND id = '\" . $this->articleid . \"'\");\n $data = $sq->nextrow();\n $tpl->addDataItem(\"ARTICLE.GROUP_NAME\", $group_name);\n $tpl->addDataItem(\"ARTICLE.DATE\", formatDate($this->date_format, $data[\"date\"]));\n $tpl->addDataItem(\"ARTICLE.TITLE\", $data[\"title\"]);\n $tpl->addDataItem(\"ARTICLE.AUTHOR\", $data[\"author\"]);\n $tpl->addDataItem(\"ARTICLE.LEAD\", $data[\"lead\"]);\n $tpl->addDataItem(\"ARTICLE.CONTENT\", $data[\"content\"]);\n $tpl->addDataItem(\"ARTICLE.PIC\", $data[\"pic\"]);\n $tpl->addDataItem(\"ARTICLE.BACKURL\", $general_url . \"&archive=\" . $this->vars[\"archive\"]);\n $tpl->addDataItem(\"ARTICLE.BACK\", $txt->display(\"back\"));\n $sq->free();\n $tpl->addDataItem(\"GROUP_NAME\", $group_name);\n\n }\n\n // #################################\n\n else {\n\n if ($this->vars[\"filter_year\"]) {\n $filt_year = \" AND YEAR(module_news.entrydate) = '\" . $this->vars[\"filter_year\"] . \"'\";\n }\n\n if ($this->vars[\"filter_category\"]) {\n $filt_category = \" AND module_news.ngroup = '\" . $this->vars[\"filter_category\"] . \"'\";\n }\n\n $start = 0;\n if ($this->vars[\"start\"]) {\n $start = $this->vars[\"start\"];\n }\n $nr = 1;\n $firstarticle = false;\n $sq->query($this->dbc, \"SELECT id, unix_timestamp(entrydate) as date, title, pic, author, lead, content FROM module_news WHERE language = '\".$this->language.\"' $grp $datespan $filt_year $filt_category ORDER BY entrydate DESC LIMIT \".$this->start_at.\",\".$this->count);\n while ($data = $sq->nextrow()) {\n if ($firstarticle == false) $firstarticle = $data[\"id\"];\n if ($style == $this->rowstyle[0]) $style = $this->rowstyle[1];\n else { $style = $this->rowstyle[0]; }\n\n $tpl->addDataItem(\"ARTICLE.STYLE\", $style);\n $tpl->addDataItem(\"ARTICLE.NR\", $nr);\n $tpl->addDataItem(\"ARTICLE.DATE\", formatDate($this->date_format, $data[\"date\"]));\n $tpl->addDataItem(\"ARTICLE.TITLE\", $data[\"title\"]);\n $tpl->addDataItem(\"ARTICLE.AUTHOR\", $data[\"author\"]);\n $tpl->addDataItem(\"ARTICLE.PIC\", $data[\"pic\"]);\n $tpl->addDataItem(\"ARTICLE.CONTENT\", $data[\"content\"]);\n $tpl->addDataItem(\"ARTICLE.LEAD\", $data[\"lead\"]);\n if ($this->vars[\"archive\"]) {\n $tpl->addDataItem(\"ARTICLE.URL\", $general_url . \"&articleid=\" . $data[\"id\"] . \"&archive=\" . $this->vars[\"archive\"]);\n }\n else{\n $tpl->addDataItem(\"ARTICLE.URL\", $general_url . \"&articleid=\" . $data[\"id\"]);\n }\n $tpl->addDataItem(\"ARTICLE.GROUP_NAME\", $group_name);\n $nr++;\n }\n $sq->free();\n\n $tpl->addDataItem(\"GROUP_NAME\", $group_name);\n\n $tpl->addDataItem(\"ALLNEWS\", $txt->display(\"allnews\"));\n $tpl->addDataItem(\"ALLURL\", $general_url);\n\n $tpl->addDataItem(\"ARCHIVE_URL\", $general_url . \"&archive=true\");\n $tpl->addDataItem(\"ARCHIVE_NAME\", $txt->display(\"archive\"));\n\n if ($this->vars[\"archive\"] == true) {\n // page listing\n $sql = \"SELECT COUNT(*) AS totalnews FROM module_news WHERE language = '\".$this->language.\"' $grp $datespan $filt_year $filt_category\";\n $sq->query($this->dbc, $sql);\n $data = $sq->nextrow();\n $total = $data[\"totalnews\"];\n $sq->free();\n\n// $disp = ereg_replace(\"{NR}\", \"$total\", $txt->display(\"results\"));\n if ($results >= $this->count) {\n $end = $start + $this->count;\n } else {\n $end = $start + $results;\n }\n if ($end == 0) $start0 = 0;\n else { $start0 = $start + 1; }\n// $disp = ereg_replace(\"{DISP}\", $start0 . \"-$end\", $disp);\n// $tpl->addDataItem(\"RESULTS\", $disp);\n\n $tpl->addDataItem(\"PAGES\", resultPages($start, $total, $general_url . \"&nocache=true&archive=true&filter_category=\".$this->vars[\"category\"].\"&filter_year=\" . $this->vars[\"filter_year\"], $this->count, $txt->display(\"prev\"), $txt->display(\"next\")));\n }\n/*\n // archive links\n $sq->query($this->dbc, \"SELECT date_format( entrydate, '%Y' ) AS year FROM module_news WHERE language = '\".$this->language.\"' GROUP BY year ORDER BY year DESC\");\n while ($data = $sq->nextrow()) {\n $tpl->addDataItem(\"ARCHIVE.URL\", $general_url . \"&article_archive=\" . $data[\"year\"]);\n $tpl->addDataItem(\"ARCHIVE.NAME\", $txt->display(\"archive\") . \" \" . $data[\"year\"]);\n }\n $sq->free();\n*/\n\n // ###############################\n // Filter fields\n\n $filter_fields = array(\n \"category\" => array(\"select\",0),\n \"year\" => array(\"select\",0)\n );\n\n // #################################\n // YEARS\n $list = array();\n $sql = \"SELECT DISTINCT(YEAR(module_news.entrydate)) AS news_year FROM module_news WHERE module_news.language = '\" . $this->language . \"' ORDER BY news_year DESC\";\n $sq->query($this->dbc, $sql);\n while ($data = $sq->nextrow()) {\n $list[$data[\"news_year\"]] = $data[\"news_year\"];\n }\n $sq->free();\n $list[0] = $txt->display(\"all_years\");\n $filter_fields[\"year\"][2] = $list;\n\n // #################################\n // categories\n $list = array();\n $sql = \"SELECT module_news_groups.* FROM module_news_groups WHERE module_news_groups.language = '\" . $this->language . \"' ORDER BY name ASC\";\n $sq->query($this->dbc, $sql);\n while ($data = $sq->nextrow()) {\n $list[$data[\"id\"]] = $data[\"name\"];\n }\n $sq->free();\n $list[0] = $txt->display(\"all_categories\");\n $filter_fields[\"category\"][2] = $list;\n\n while (list($key, $val) = each($filter_fields)) {\n $fdata[\"type\"] = $val[0];\n $fdata[\"size\"] = $val[1];\n $fdata[\"list\"] = $val[2];\n $f = new AdminFields(\"filter_$key\", $fdata);\n $field_data = $f->display($this->vars[\"filter_$key\"]);\n $tpl->addDataItem(\"FIELD_filter_$key\", $field_data);\n unset($fdata);\n }\n\n $tpl->addDataItem(\"SELF\", $general_url);\n $tpl->addDataItem(\"HIDDEN\", \"<input type=\\\"hidden\\\" name=\\\"archive\\\" value=\\\"true\\\">\");\n\n // get 1st article to show just in case\n if ($firstarticle) {\n $sq->query($this->dbc, \"SELECT id, unix_timestamp(entrydate) as date, pic, title, author, lead, content FROM module_news WHERE language = '\".$this->language.\"' $grp AND id = '\" . $firstarticle . \"'\");\n $data = $sq->nextrow();\n $tpl->addDataItem(\"FIRSTARTICLE.DATE\", formatDate($this->date_format, $data[\"date\"]));\n $tpl->addDataItem(\"FIRSTARTICLE.TIME\", $data[\"datetime\"]);\n $tpl->addDataItem(\"FIRSTARTICLE.TITLE\", $data[\"title\"]);\n $tpl->addDataItem(\"FIRSTARTICLE.CONTENT\", $data[\"content\"]);\n $tpl->addDataItem(\"FIRSTARTICLE.LEAD\", $data[\"lead\"]);\n $tpl->addDataItem(\"FIRSTARTICLE.PIC\", $data[\"pic\"]);\n $sq->free();\n }\n }\n\n // ####\n\n return $tpl->parse();\n\n }", "public function actionNews()\n\t{\n\t\t$friendIDList=Relation::model()->findFriendsByID(Yii::app()->user->id);\n\n\t $newsURLList=NewsIndex::model()->findNewsURLByIDList($friendIDList);\n\n\t $newsList = News::model()->findNewsByURL($newsURLList);\n\n\t //page\n\t $pageNum = Yii::app()->request->getQuery('page');\n\t if($pageNum==null)\n\t \t$pageNum = 1;\n\n\t $newsPerPage = 10;\n\t $itemCount = count($newsList);\n\t $pageSize = $newsPerPage;\n\n\t\t$pages =new CPagination($itemCount);\n\t $pages->setPageSize($pageSize);\n\n\t $this->render('news',array(\n 'newsList'=>array_slice($newsList, $newsPerPage*($pageNum-1), $newsPerPage),\n 'pages'=>$pages,\n ));\n\t}", "function zp_printLatestNews($number=2,$option='none', $category='') {\n\t$latest = getLatestNews($number,$option, $category);\n\tif(is_array($latest)) {\n\t\techo \"<ul>\";\n\t\tforeach($latest as $news) {\n\t\t\t$article = new ZenpageNews($news['titlelink']);\n\t\t\t?>\n\t\t\t<li>\n\t\t\t<a href=\"<?php echo html_encode(getNewsURL($news['titlelink'])); ?>\">\n\t\t\t<?php echo html_encode($article->getTitle()); ?>\n\t\t\t</a>\n\t\t\t<small> (<?php echo zpFormattedDate(getOption('date_format'),strtotime($article->getDatetime())); ?>)</small>\n\t\t\t</li>\n\t\t\t<?php\n\t\t}\n\t\techo '</ul>';\n\t}\n}", "function infomoz_dashboard_widget_function() {\r\n require_once(ABSPATH.WPINC.'/rss.php'); \r\n\t// Display whatever it is you want to show\r\n\techo \"Este widget indica que você está usando o plugin infomoz-glossário!<br>This Widget means that you are using infomoz-glossario plugin!\";\r\n\t\tif ( $rss == fetch_rss( 'http://feeds.feedburner.com/infomoz' ) ) {\r\n\t\t\techo '<div class=\"rss-widget\">';\r\n\t\t\tif ($image == 'normal') {\r\n\t\t\t\techo '<a href=\"http://yoast.com/\" title=\"visite o INFOmoz.net\"><img src=\"http://farm4.static.flickr.com/3117/3809231173_8f8508fa44_s.jpg\" class=\"alignright\" alt=\"INFOmoz\"/></a>';\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo '<a href=\"http://yoast.com/\" title=\"Visite o INFOmoz.net\"><img width=\"80\" src=\"http://farm4.static.flickr.com/3117/3809231173_8f8508fa44_s.jpg\" class=\"alignright\" alt=\"INFOmoz\"/></a>';\t\t\t\r\n\t\t\t}\r\n\t\t\techo '<ul>';\r\n\t\t\t$rss->items = array_slice( $rss->items, 0, 5 );\r\n\t\t\tforeach ( (array) $rss->items as $item ) {\r\n\t\t\t\techo '<li>';\r\n\t\t\t\techo '<a class=\"rsswidget\" href=\"'.clean_url( $item['link'], $protocolls=null, 'display' ).'\">'. wp_specialchars($item['title']) .'</a> ';\r\n\t\t\t\tif ($showdate)\r\n\t\t\t\t\techo '<span class=\"rss-date\">'. date('F j, Y', strtotime($item['pubdate'])) .'</span>';\r\n\t\t\t\t\r\n\t\t\t\techo '</li>';\r\n\t\t\t}\r\n\t\t\techo '</ul>';\r\n\t\t\techo '<div style=\"border-top: 1px solid #ddd; padding-top: 10px; text-align:center;\">';\r\n\t\t\techo '<a href=\"http://feeds.feedburner.com/infomoz\"><img src=\"'.get_bloginfo('wpurl').'/wp-includes/images/rss.png\" alt=\"\"/> Subscribe with RSS</a>';\r\n\t\t\tif ($image == 'normal') {\r\n\t\t\t\techo ' &nbsp; &nbsp; &nbsp; ';\r\n\t\t\t} else {\r\n\t\t\t\techo '<br/>';\r\n\t\t\t}\r\n\t\t\techo '<a href=\"http://infomoz.net/subscreva-ao-infomoz/\"><img src=\"http://cdn.yoast.com/email_sub.png\" alt=\"\"/> Subscribe by email</a>';\r\n\t\t\techo '</div>';\r\n\t\t\techo '</div>';\r\n\t\t}\r\n}", "function arras_below_index_news_post() {\n\tdo_action('arras_below_index_news_post');\t\n}", "public function index()\n{\n $news = $this->simplenews->get_news(10, 0); // Get 10 News in Order Descedante\n \n $page_content = $this->load->view('admin/news/news', array('newslist' => $news, 'is_archive' => false), true);\n $this->display_page('news', $page_content);\n}", "function index()\n\t{\n\t\t$data['feed_name'] = $this->init_model->get_setting('site_name');\n\t\t$data['feed_url'] = base_url();\n\t\t$data['page_description'] = $this->init_model->get_setting('site_description');\n\t\t$data['creator_email'] = $this->init_model->get_setting('site_email');\n\t\t$data['articles'] = $this->article_model->get_latest(); \n\t\t$this->show_feed($data);\n\t}", "function view_1( $atts )\n{\n\t$html = '<div class=\"front-custom-code block block-type-custom-code block-fluid-height\" data-alias=\"TourDates\">\n\t<div class=\"block-content\">\n\t\t<h3>Upcoming Shows:</h3>\n\t\t<!-- insert custom code -->\n\t\t<div class=\"rsslist\">\n\t\t\t<div class=\"header screen\">\n\t\t\t\t<span class=\"rssdate title\">Date</span><span class=\"rssvenue title\">Venue</span><span class=\"rsslocation title\">Location</span><span class=\"rssdetails title\">More Info</span><span class=\"rsstickets title\">Tickets</span>\n\t\t\t\t<div class=\"header mobile\"><span class=\"title\">Date / Venue</span></div>\n\t\t\t</div>';\n\n\t\t\t$the_query = new WP_Query(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type' => array('show'),\n\t\t\t\t\t'nopaging' => true,\n\t\t\t\t\t'meta_key' => 'date_of_show',\n\t\t\t\t\t'meta_value' => date(\"Ymd\"),\n\t\t\t\t\t'meta_compare' => '>',\n\t\t\t\t\t'orderby' => 'date_of_show',\n\t\t\t\t\t'order' => 'ASC'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tif ( $the_query->have_posts() )\n\t\t\t{\n\t\t\t\twhile ( $the_query->have_posts() ) {\n\t\t\t\t\t$the_query->the_post();\n\t\t\t//debug\n\t\t\t//echo get_the_title();\n\t\t\t//date\n\t\t\t\t\t$date = date(\"M dS\", strtotime(get_field('date_of_show')));\n\t\t\t//location\n\t\t\t\t\t$location = get_city_and_state(get_field(\"show_address\"));\n\t\t\t//more info link\n\t\t\t\t\t$id = get_the_id();\n\t\t\t\t\t$detail_link = get_permalink($id);\n\t\t\t//ticket link\n\t\t\t\t\t$ticket_link = get_field('ticket_link');\n\t\t\t\t\t$html .= '<div class=\"rssupcomingshows\"><span class=\"rssdate\">'.$date.'</span><span class=\"rssvenue\">'.get_field('venue').'</span><span class=\"rsslocation\">'.$location.'</span><span class=\"rssdetails\"><a href=\"'.$detail_link.'\">Details</a></span><span class=\"rsstickets\"><a href=\"'.$ticket_link.'\" target=\"_blank\">Tickets</a></span></div>';\n\t\t\t\t}\n\t\t\t\t/* Restore original Post Data */\n\t\t\t\twp_reset_postdata();\n\t\t\t}\n\n\t\t\t$html .= '</div>\n\t\t\t<div style=\"margin-top:15px;\">\n\t\t\t\t<h3>Past Shows:</h3>\n\t\t\t</div>\n\t\t\t<div class=\"rsslist\">\n\t\t\t\t<div class=\"header screen\">\n\t\t\t\t\t<span class=\"rssdate title\">Date</span><span class=\"rssvenue title\">Venue</span><span class=\"rsslocation title\">Location</span><span class=\"rssdetails title\">More Info</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"header mobile\"><span class=\"title\">Date / Venue</span></div>';\n\t\t////////////////////\n\t\t//\n\t\t// PAST SHOWS\n\t\t//\n\t\t////////////////////\n\t\t\t\t$the_query = new WP_Query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_type' => array('show'),\n\t\t\t\t\t\t'nopaging' => true,\n\t\t\t\t\t\t'meta_key' => 'date_of_show',\n\t\t\t\t\t\t'meta_value' => date(\"Ymd\"),\n\t\t\t\t\t\t'meta_compare' => '<',\n\t\t\t\t\t\t'orderby' => 'date_of_show',\n\t\t\t\t\t\t'order' => 'DESC'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\tif ( $the_query->have_posts() )\n\t\t\t\t{\n\t\t\t\t\twhile ( $the_query->have_posts() ) {\n\t\t\t\t\t\t$the_query->the_post();\n\t\t\t\t//debug\n\t\t\t\t//echo get_the_title();\n\t\t\t\t//date\n\t\t\t\t\t\t$date = date(\"M dS\", strtotime(get_field('date_of_show')));\n\t\t\t\t//location\n\t\t\t\t\t\t$show_address_field = get_field(\"show_address\");\n\t\t\t\t\t\t$location_split = explode(',', $show_address_field);\n\t\t\t\t\t\t$state_abbreviation = trim(end($location_split));\n\t\t\t\t\t\tarray_pop($location_split);\n\t\t\t\t\t\t$city = trim(end($location_split));\n\t\t\t\t\t\t$location = \"$city, $state_abbreviation\";\n\t\t\t\t//more info link\n\t\t\t\t\t\t$id = get_the_id();\n\t\t\t\t\t\t$detail_link = get_permalink($id);\n\t\t\t\t//ticket link\n\t\t\t\t\t\t$ticket_link = get_field('ticket_link');\n\t\t\t\t\t\t$html .= '<div class=\"rssupcomingshows\"><span class=\"rssdate\">'.$date.'</span><span class=\"rssvenue\">'.get_field('venue').'</span><span class=\"rsslocation\">'.$location.'</span><span class=\"rssdetails\"><a href=\"'.$detail_link.'\">Details</a></span><span class=\"rsstickets\"></span></div>';\n\t\t\t\t\t}\n\t\t\t\t\t/* Restore original Post Data */\n\t\t\t\t\twp_reset_postdata();\n\t\t\t\t}\n\t\t\t\t$html .= '</div></div></div>';\n\t\t\t\t?>\n\t\t\t\n\t<?php \n\treturn $html;\n}", "function process_news($card)\r\r\n{\r\r\n $showpicall = ($card['var']['showpic'] == 'all');\r\r\n $card = xigua_cards::block($card);\r\r\n\r\r\n $param = $card['var']['param'];\r\r\n// $param['titlelength'] = '32';\r\r\n if($card['var']['showpic'] == 'all'){\r\r\n $param['picrequired'] = '1';\r\r\n }\r\r\n $data = $card['block_class']->getdata(array('getpic' => 1), $param);\r\r\n unset($card['block_class']);\r\r\n $threads = xigua_cards::sort_by_tids($data, $param);\r\r\n\r\r\n $thumb = (boolean)$card['var']['thumb'];\r\r\n if($card['var']['themecolor']){\r\r\n $color = 'style=\"color:'.$card['var']['themecolor'].'\"';\r\r\n $bordercolor = 'style=\"border-top-color:'.$card['var']['themecolor'].'\"';\r\r\n }\r\r\n\r\r\n $title_link = $card['var']['title_link'] ? $card['var']['title_link'] : 'javascript:void(0);';\r\r\n $header = '<div class=\"news-t\" '.$bordercolor.'><h3>'.\r\r\n '<a '.$color.' href=\"'.$title_link.'\">'.$card['var']['title'].'</a></h3>';\r\r\n if($card['var']['subtitle']){\r\r\n $header .= '<nav class=\"tmore\">';\r\r\n foreach ($card['var']['subtitle'] as $i => $subtitle) {\r\r\n $header .= '<a '.$color.' href=\"'.$card['var']['subtitle_link'][$i].'\">'.$subtitle.'</a>';\r\r\n }\r\r\n $header .= '</nav>';\r\r\n }\r\r\n $header .= '</div>';\r\r\n\r\r\n if($card['var']['showpic'] != 'invisible'){\r\r\n $imglist = array();\r\r\n foreach ($threads as $k => $thread) {\r\r\n if($showpicall){\r\r\n $imglist[] = $thread;\r\r\n unset($threads[$k]);\r\r\n }else{\r\r\n if($thread['picflag']!=0 && count($imglist)<2){\r\r\n $imglist[] = $thread;\r\r\n unset($threads[$k]);\r\r\n }\r\r\n }\r\r\n }\r\r\n if($imglist){\r\r\n $image_navs = array();\r\r\n foreach ($imglist as $img_thread) {\r\r\n $link = xigua_cards::thread_link($img_thread['id']);\r\r\n $pic = xigua_cards::get_picurl($img_thread['pic'], $thumb);\r\r\n $image_navs[] = '<li><a href=\"'.$link.'\"><img src=\"'.$pic.'\"><span class=\"img-tit\">'.$img_thread['title'].'</span></a></li>';\r\r\n }\r\r\n $image_nav = '<ul class=\"news-pic-list\">'. implode('',$image_navs) .'</ul>';\r\r\n if($showpicall){\r\r\n $tmp = '';\r\r\n foreach ($image_navs as $key => $val) {\r\r\n if($key % 2 == 0){\r\r\n $tmp .= '<ul class=\"news-pic-list\">';\r\r\n }\r\r\n $tmp .= $val;\r\r\n if($key % 2 == 1){\r\r\n $tmp .= '</ul>';\r\r\n }\r\r\n }\r\r\n $image_nav = $tmp;\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n $showreply = in_array($card['var']['showreply'], array('replies', 'views')) ? $card['var']['showreply'] : 'views';\r\r\n if($showreply == 'views'){\r\r\n $class = 'news-num-view';\r\r\n }\r\r\n\r\r\n $list = '<div class=\"news-c\">';\r\r\n\r\r\n if($card['var']['showsubtop']){\r\r\n $first = array_shift($threads);\r\r\n $first_link = xigua_cards::thread_link($first['id']);\r\r\n $list .= '<h4><a '.$color.' href=\"'.$first_link.'\">'.$first['title'].'</a></h4>';\r\r\n }\r\r\n\r\r\n if($card['var']['showpic'] == 'top'){\r\r\n $list = $list . $image_nav;\r\r\n }\r\r\n $list .= '<div><ul class=\"news-list\">';\r\r\n foreach ($threads as $thread) {\r\r\n $link = xigua_cards::thread_link($thread['id']);\r\r\n\r\r\n $list .= '<li><a href=\"'.$link.'\">'.$thread['title'].'<span class=\"news-num '.$class.'\">'.$thread['fields'][$showreply].'</span></a></li>';\r\r\n }\r\r\n $list .= '</ul></div>';\r\r\n if($card['var']['showpic'] == 'bottom'){\r\r\n $list = $list . $image_nav;\r\r\n }\r\r\n\r\r\n if($showpicall){\r\r\n $list .= $image_nav;\r\r\n }\r\r\n\r\r\n if($card['var']['title_link']){\r\r\n $list .= '<a href=\"'.$card['var']['title_link'].'\" class=\"news-more\">'.xigua_cards::l('showmore',0).'</a>';\r\r\n }\r\r\n\r\r\n $card['var']['html'] = $header.$list;\r\r\n\r\r\n return $card;\r\r\n}", "function lesintegristes_dashboard_feedburner() {\n echo '<p>Blog : <a href=\"http://feeds.feedburner.com/lesintegristes\"><img src=\"http://feeds.feedburner.com/~fc/lesintegristes?bg=F9F9F9&amp;fg=333333&amp;anim=0\" height=\"26\" width=\"88\" style=\"border:0;vertical-align:middle;\" alt=\"\" /></a></p>';\n echo '<p>Veille : <a href=\"http://feeds.feedburner.com/lesintegristes/veille\"><img src=\"http://feeds.feedburner.com/~fc/lesintegristes/veille?bg=F9F9F9&amp;fg=333333&amp;anim=0\" height=\"26\" width=\"88\" style=\"border:0;vertical-align:middle;\" alt=\"\" /></a></p>';\n}", "function news_load_widget(){\n register_widget('news_widget');\n}", "static function showRSSView() {\n\n echo \"<table class='tab_cadre_central'>\";\n\n echo \"<tr class='noHover'><td class='top' width='50%'>\";\n RSSFeed::showListForCentral();\n echo \"</td><td class='top' width='50%'>\";\n if (RSSFeed::canView()) {\n RSSFeed::showListForCentral(false);\n } else {\n echo \"&nbsp;\";\n }\n echo \"</td></tr>\";\n echo \"</table>\";\n }", "function AdminNewsBody()\n\t{\t$this->ListStories();\n\t}", "function SocialFeedRecentFacebookWidget() {\r\n\t\tparent::__construct( false, 'Social Feed Recent Facebook Post' );\r\n\t}", "public function newsFront(){\n $newsFront = new \\Project\\models\\FrontManager();\n $articlesNews = $this->displayNews();\n require 'app/views/front/news.php';\n }", "public function render_widget_recent_entries($html) { ?>\n <div>\n <h3 class=\"vf-links__heading\">More posts</h3>\n <?php\n $recentloop = new WP_Query(array('posts_per_page' => 3, 'post__not_in' => array( get_the_ID() ) ));\n while ($recentloop->have_posts()) : $recentloop->the_post();?>\n <article class=\"vf-summary vf-summary--article | vf-u-margin__bottom--400\">\n <h2 class=\"vf-summary__title\">\n <a href=\"<?php the_permalink(); ?>\" class=\"vf-summary__link\" style=\"font-size: 19px;\"><?php echo esc_html(get_the_title()); ?></a>\n </h2>\n <span class=\"vf-summary__meta\">\n <a class=\"vf-summary__author vf-summary__link\" href=\"<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>\"><?php the_author(); ?></a>\n <time class=\"vf-summary__date\" title=\"<?php the_time('c'); ?>\" datetime=\"<?php the_time('c'); ?>\"><?php the_time(get_option('date_format')); ?></time>\n </span>\n </article>\n <?php endwhile; ?>\n <?php wp_reset_postdata(); ?>\n </div>\n\n <?php }", "function index($page = null)\n\t{\n\t\tunset($data);\n\t\t$data = $this->data;\n\t\t// get teaser\n\t\t$teasers = index_array(get_db_data(config('prefix').config('db_entries'), array('where' => array('type' => '2'), 'select' => '*')), 'language', TRUE);\n\t\t\n\t\tif(array_key_exists($this->config->item('lang_id'), $teasers))\n\t\t{\n\t\t\t$teasers = $teasers[$this->config->item('lang_id')];\n\t\t\t// sort teaser by position\n\t\t\t$teasers = sort_array($teasers, 'position', TRUE);\n\t\t\t//\n\t\t\t$data['teaser'] = '';\n\t\t\tforeach($teasers as $teaser)\n\t\t\t{\n\t\t\t\tif($teaser['status'] == 1)\n\t\t\t\t{\n\t\t\t\t\t$length = 150;\n\t\t\t\t\tif (strlen($teaser['text']) <= $length) \n\t\t\t\t\t{\n\t\t\t\t\t $teaser['text'] = $teaser['text'];\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($teaser['excerpt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$teaser['text'] = substr($teaser, 0, strpos($teaser, \"</h3>\")).'<p>'.$teaser['excerpt'].'</p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$teaser['text'] = substr($teaser, 0, strpos($teaser, \"</h3>\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data['teaser'] .= $this->load->view('custom/news',$teaser, TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// if teaser active\n\t\tif($variable = $this->navigation->active('variables'))\n\t\t{\n\t\t\t$news = 'false';\n\t\t\t$link = explode('/', $variable);\n\t\t\tif($link[1] == 'news')\n\t\t\t{\n\t\t\t\tif(count($link) >= 2)\n\t\t\t\t{\n\t\t\t\t\t$news = 'true';\n\t\t\t\t\tend($link);\n\t\t\t\t\t$link = $link[key($link)];\n\t\t\t\t\t$teaser = index_array($teasers, 'permalink');\n\t\t\t\t\t$teaser = $teaser[$link];\n\t\t\t\t\t//\n\t\t\t\t\t$data['title'] = $teaser['title'];\n\t\t\t\t\t$data['page'] = $this->load->view('default', array('text' => $teaser['text'], 'title' => $teaser['title']), true);\n\t\t\t\t\t// set title \n\t\t\t\t\t$this->config->set_item('title', $teaser['title']);\t\n\t\t\t\t\t// get header image\n\t\t\t\t\tif(isset($teaser['header']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['header'] = $teaser['header'];\n\t\t\t\t\t\t$data['slideshow'] = $teaser['slideshow'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['header'] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!isset($news) || $news == 'false')\n\t\t{\n\t\t\t//\n\t\t\t$data['page'] = $this->entries->get($this->navigation->current('id'), $this->data, TRUE);\n\t\t\t// set tags\n\t\t\tif($tags = $this->entries->get_element('tags', $this->navigation->current('id')))\n\t\t\t{\n\t\t\t \t$this->config->set_item('tags', $tags);\n\t\t\t}\n\t\t\t// set description\n\t\t\tif($desc = $this->entries->get_element('description', $this->navigation->current('id')))\n\t\t\t{\n\t\t\t \t$this->config->set_item('description', $desc);\n\t\t\t}\n\t\t\t$data['header'] = null;\n\t\t\t// get header image\n\t\t\tif($header = $this->entries->get_element('header', $this->navigation->current('id')))\n\t\t\t{\n\t\t\t\t$data['header'] = $header;\n\t\t\t}\n\t\t\t// set title \n\t\t\t$this->config->set_item('title', $this->entries->get_element('title', $this->navigation->current('id')));\n\t\t}\n\t\t// load view\n\t\tview('', $data);\n\t}", "public function getNews();", "function News($c1,$akt_hits = 'setup',$akt_next = true){\n\t\n\tglobal $db_news,$db_category,$db_comments,$db_comments_log,$db_admin,$db_setup;\n\tglobal $url_category;\n\t\n\t$_SESSION['loginid'] = AGet($_SESSION,'loginid');\n\t\n\t$showtime = formatTime(time(),\"YmdHis\");\n\t/* Zpracujeme promenne tak aby sly ulozit do dotazu */\n\t$pieces = explode (\":\", $c1);\n\t$num1 = count($pieces);\n\t\n\t/* Nacteni nastaveni */\n\t$res_setup = mysql_query(\"SELECT setup_news_number, setup_show_author_nick FROM $db_setup\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$ar_setup = mysql_fetch_array($res_setup);\n\t\n\t$i=0;\n\t$categories = FALSE;\n\twhile($num1 > $i){\n\t\t$act_category_pieces = $pieces[$i];\n\t\tif ($i>0){$divider = \",\";} else {$divider = \"\";}\n\t\t$categories .= $divider.(integer)$act_category_pieces;\n\t\t$i++;\n\t}\n\t\n\t$vysledek_num = mysql_query(\"SELECT COUNT(*) FROM $db_news AS act WHERE act.news_category_id IN ($categories) AND act.news_publish=1 AND $showtime BETWEEN act.news_date_on AND act.news_date_off\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$akt_num = mysql_fetch_array($vysledek_num);\n\t\n\t/* Nacteni nastaveni poctu zobrazovanych novinek */\n\tif($akt_hits == 'setup'){ $akt_hits = $ar_setup['setup_news_number'];}\n\t$m = 0;// nastaveni iterace\n\tif (empty($_GET['akt_page'])) {$_GET['akt_page'] = 1;} // i kdyz je promenna $_GET['page'] prazdna nastavi se pocet starnek na 1\n\tif ($akt_hits == 0){$akt_hits = 30;}\n\t$akt_stw2 = ($akt_num[0]/$akt_hits);\n\t$akt_stw2 = (integer) $akt_stw2;\n\tif ($akt_num[0]%$akt_hits > 0) {$akt_stw2++;}\n\t$akt_np = $_GET['akt_page']+1;\n\t$akt_pp = $_GET['akt_page']-1;\n\tif ($_GET['akt_page'] == 1) { $akt_pp=1; }\n\tif ($akt_np > $akt_stw2) { $akt_np = $akt_stw2;}\n\t$akt_sp = ($_GET['akt_page']-1)*$akt_hits;\n\t$akt_ep = ($_GET['akt_page']-1)*$akt_hits+$akt_hits;\n\t$limit = \"LIMIT \".(integer)$akt_sp.\", \".(integer)$akt_hits.\"\";\n\t$vysledek = mysql_query(\"\n\tSELECT act.news_id, act.news_text, act.news_headline, act.news_source, act.news_comments, act.news_date, act.news_date_on, act.news_category_id, c.category_name, c.category_image, a.admin_id, a.admin_firstname, a.admin_name, a.admin_nick, a.admin_email \n\tFROM $db_news AS act \n\tJOIN $db_admin AS a ON a.admin_id=act.news_author_id \n\tJOIN $db_category AS c ON c.category_id=act.news_category_id \n\tWHERE act.news_category_id IN ($categories) AND act.news_publish=1 AND $showtime BETWEEN act.news_date_on AND act.news_date_off \n\tORDER BY act.news_date_on DESC $limit\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\t$y = 0;\n\twhile ($ar = mysql_fetch_array($vysledek)){\n\t\t$m++;\n\t\t$vysledek6 = mysql_query(\"SELECT COUNT(*) FROM $db_comments WHERE comment_pid=\".(integer)$ar['news_id'].\" AND comment_modul='news'\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error()); // Nastaveni ukazatele na komentare v danem clanku\n\t\t$nc_num = mysql_fetch_array($vysledek6); // Zjisteni poctu prispevku k danemu clanku\n\t\t$num2 = $nc_num[0];\n\t\t$datum = FormatTimestamp($ar['news_date']);\n\t\t\n\t\t// Zjisteni datumu posledniho posledni navstevy uzivatele v danych komentarich\n\t\t$vysledek7 = mysql_query(\"SELECT comments_log_comments FROM $db_comments_log WHERE comments_log_admin_id=\".(integer)$_SESSION['loginid'].\" AND comments_log_item_id=\".(integer)$ar['news_id'].\" AND comments_log_modul='news'\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$ar7 = mysql_fetch_array($vysledek7);\n\t\t\n\t\t$admin_id = $ar['admin_id'];\n\t\t$admin_nick = $ar['admin_nick'];\n\t\t$admin_email = $ar['admin_email'];\n\t\tif ($ar_setup['setup_show_author_nick'] == 1){$admin_nickname = $ar['admin_nick'];} else {$admin_nickname = $ar['admin_firstname'].\" \".$ar['admin_name'];}\n\t\t\n\t\t$category_image = $ar['category_image'];\n\t\t$category_name = $ar['category_name'];\n\t\t$news_id = $ar['news_id'];\n\t\t$news_text = TreatText($ar['news_text'],0,1);\n\t\t$news_headline = TreatText($ar['news_headline'],50,1);\n\t\t$news_source = $ar['news_source'];\n\t\t$news_category_id = $ar['news_category_id'];\n\t\t$news_comments = $ar['news_comments'];\n\t\t$news_date_on = $ar['news_date_on'];\n\t\t\n\t\t$comments_log_comments = $ar7['comments_log_comments'];\n\t\t\n\t\t// Nastaveni datumu\n\t\t$datum_clanku = FormatTimestamp($ar['news_date_on'],\"l d.m.Y, H:i\");\n\t\t$cislo = $y;\n\t\tinclude \"templates/tpl.news.php\";\n\t\t$i++;\n\t\t$y++;\n\t}\n\t/* Pokud je novinek vice, nezli se vejde na 1 stranku zobrazi se jejich pocitani a prechazeni mezi nima */\n\tif ($akt_stw2 > 1 && $akt_next == true){\n\t\t// Nacteni sablony\n\t\tinclude \"templates/tpl.zobrazeni_akt.dalsi.php\";\n\t}\n}", "function showSimpleNews(){\n $array_news = get_news();\n $newsperrow = get_option('SimpleNewsperRow');\n $bootstrapwidth = 12/$newsperrow;\n $rows = ceil(get_option('SimpleNewsTotal')/get_option('SimpleNewsperRow'));\n echo '<div class=\"container newscontainer\">';\n echo '<div class=\"row\">';\n echo '<div class=\"col-xs-12\">';\n echo '<div class=\"newstitle\">';\n echo '<h3>Últimas noticias</h3>';\n echo '</div></div></div>';\n $j=0;\n $limite=get_option('SimpleNewsperRow');\n for($i=0; $i<$rows; $i++){\n echo '<div class=\"row\">';\n while(($j<$limite)&&($j<get_option('SimpleNewsTotal'))){\n echo '<div class=\"col-xs-12 col-sm-6 col-md-'.$bootstrapwidth.'\">';\n echo '<div class=\"row\">';\n echo '<div class=\"col-xs-12\">';\n echo '<img src=\"'.$array_news[$j][2].'\" class=\"img-responsive\">';\n echo '</div>';\n echo '</div>';\n echo '<div class=\"row\">';\n echo '<div class=\"col-xs-12 newtext\">';\n echo '<p>'.$array_news[$j][1].'</p>';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n $j++;}\n $limite=$limite+get_option('SimpleNewsperRow');\n echo '</div>';}}", "function bones_rss_dashboard_widget() {\n\tif ( function_exists( 'fetch_feed' ) ) {\n\t\tinclude_once( ABSPATH . WPINC . '/feed.php' ); // include the required file\n\t\t$feed = fetch_feed( 'http://themble.com/feed/rss/' ); // specify the source feed\n\t\t$limit = $feed->get_item_quantity(7); // specify number of items\n\t\t$items = $feed->get_items(0, $limit); // create an array of items\n\t}\n\tif ($limit == 0) echo '<div>The RSS Feed is either empty or unavailable.</div>'; // fallback message\n\telse foreach ($items as $item) { ?>\n\n\t<h4 style=\"margin-bottom: 0;\">\n\t\t<a href=\"<?php echo $item->get_permalink(); ?>\" title=\"<?php echo mysql2date( __( 'j F Y @ g:i a', 'bonestheme' ), $item->get_date( 'Y-m-d H:i:s' ) ); ?>\" target=\"_blank\">\n\t\t\t<?php echo $item->get_title(); ?>\n\t\t</a>\n\t</h4>\n\t<p style=\"margin-top: 0.5em;\">\n\t\t<?php echo substr($item->get_description(), 0, 200); ?>\n\t</p>\n\t<?php }\n}", "function teaser()\n\t{\n\t\t// get \n\t\t$post_data = index_array(get_db_data(config('prefix').config('db_entries'), array('where' => array('type' => '2'), 'select' => '*')), 'language', TRUE);\n\t\t// get news teaser\n\t\tif(count($post_data) > 0 && array_key_exists(config('lang_id'), $post_data) )\n\t\t{\n\t\t\t// sort posts\n\t\t\t$teaser = index_array($post_data[config('lang_id')], 'date', TRUE);\n\t\t\tarsort($teaser);\n\t\t\t// teaser count\n\t\t\t$c = 0;\n\t\t\t// loop through posts\n\t\t\t$output = array('');\n\t\t\tforeach($teaser as $k => $v) \n\t\t\t{\n\t\t\t\tif($c < 2)\n\t\t\t\t{\n\t\t\t\t\t$t = $v[key($v)];\n\t\t\t\t\tif(isset($t['excerpt']) && $t['excerpt'] != null )\n\t\t\t\t\t{\n\t\t\t\t\t\t// get image for teaser\n\t\t\t\t\t\tif(isset($t['news_image']) && $t['news_image'] != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$image = get_db_data(config('prefix').config('db_files'), array('where' => array('id' => $t['news_image']), 'select' => '*'));\n\t\t\t\t\t\t\t$t['news_img'] = $image[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// create teaer output\n\t\t\t\t\t\t$output[] = $this->load->view('custom/teaser', $t, true);\n\t\t\t\t\t\t$c++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// return\n\t\t\treturn '<div id=\"teaser_bar\">'.implode($output, '').'</div>';\n\t\t}\n\t}", "function the_bootstrap_feed_box() {\n\t$rss_items = _the_bootstrap_fetch_feed( 'http://en.wp.obenland.it/feed/' );\n\t?>\n\t<div id=\"formatdiv\" class=\"postbox\">\n\t\t<h3 class=\"hndle\"><span><?php esc_html_e( 'News from Konstantin', 'the-bootstrap' ); ?></span></h3>\n\t\t<div class=\"inside\">\n\t\t\t<ul>\n\t\t\t<?php if ( ! $rss_items ) : ?>\n\t\t\t<li><?php _e( 'No news items, feed might be broken...', 'the-bootstrap' ); ?></li>\n\t\t\t<?php else :\n\t\t\tforeach ( $rss_items as $item ) :\n\t\t\t\t$url = preg_replace( '/#.*/', '#utm_source=wordpress&utm_medium=sidebannerpostbox&utm_term=rssitem&utm_campaign=the-bootstrap', $item->get_permalink() ); ?>\n\t\t\t<li><a class=\"rsswidget\" href=\"<?php echo esc_url( $url ); ?>\"><?php echo esc_html( $item->get_title() ); ?></a></li>\n\t\t\t<?php endforeach; endif; ?>\n\t\t\t\t<li class=\"twitter\"><a href=\"http://twitter.com/obenland\"><?php _e( 'Follow Konstantin on Twitter', 'the-bootstrap' ); ?></a></li>\n\t\t\t\t<li class=\"rss\"><a href=\"http://en.wp.obenland.it/feed/\"><?php _e( 'Subscribe via RSS', 'the-bootstrap' ); ?></a></li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t<?php\n}", "function get_news($atts) {\n\t//if there are single quotes in the query, let's remove them. They'll break things, and they aren't necessary for performing a search\n\t$atts['query'] = str_replace(\"'\", \"\", $atts['query']);\n\t//we also need to replace any spaces with proper word separators\n\t$atts['query'] = str_replace(\" \", \"+\", $atts['query']);\n\t//call the build_feed_url function to construct the feed URL for us\n\t$newsUrl = build_feed_url($atts);\n\t\n\t//call the build_feed function to parse the feed and return the results to us\n\t$output = build_feed($atts, $newsUrl, $iswidget);\n\t\n\treturn $output;\n}", "public function action_news(){\n \n }", "function open_ended_section(){\n ?>\n <div class=\"open-ended__section front-page-inner-container\">\n <div class=\"first two-thirds\">\n <h1>Latest from My Blog:</h1>\n <div class=\"blog-preview\">\n <?php\n $args = array(\n 'posts_per_page' => 1,\n );\n $blogpost = new \\WP_Query($args);\n while ($blogpost -> have_posts()) {\n $blogpost->the_post();\n\n //check for thumbnail\n if(has_post_thumbnail()){\n ?>\n <div class=\"blog-preview__thumbnail-container\">\n <div class=\"blog-preview__thumbnail\"><img src=\"<?php the_post_thumbnail_url('medium'); ?>\"/></div>\n </div>\n <hr />\n <?php\n }\n ?>\n <div class=\"blog-preview__header\">\n <h1><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?> </a><span class=\"blog-preview__header__post-date\">| <?php echo get_the_date('F j, Y'); ?></span></h1>\n </div>\n\n <?php if (has_excerpt()) {\n echo get_the_excerpt();\n } else {\n echo wp_trim_words(get_the_content(), 36);\n }\n ?>\n <br />\n <br />\n <form action=\"<?php the_permalink(); ?>\"><button>Read More</button></form>\n </div>\n <?php\n }\n ?>\n </div>\n <div class=\"open-ended-section--small one-third\">\n <h1>Current Jams:</h1>\n <iframe src=\"https://open.spotify.com/embed/playlist/6UPB3v3OZlfwx4FKJETNWm\" width=\"400\" height=\"500\" frameborder=\"0\" allowtransparency=\"true\" allow=\"encrypted-media\"></iframe>\n </div>\n </div>\n<?php\n}", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\t$tops = Browser_Service_News::getTopNews();\n\t\t$tops['content'] = Util_String::substr(html_entity_decode($tops['content']), 0, 120);\n\t\t\n\t\tlist($total, $news) = Browser_Service_News::getList($page, $perpage);\n\t\t$this->assign('tops', $tops);\n\t\t$this->assign('news', $news);\n\t\t$this->assign('pageTitle','公司新闻');\n\t}", "public function display_news_dashboard_widget() {\n\t\t\t include( WPDM_PATH . 'inc/views/html-contact-form.php' );\n\t\t\t//wp_dashboard_primary_output( 'tista_foundation', $feeds );\n\t\t\t$this->tista_wp_dashboard_metabox_enqueue_scripts();\n\t\t}", "function bjorn_popularposts_slider_show() {\n\n $bjorn_theme_options = bjorn_get_theme_options();\n\n if(isset($bjorn_theme_options['blog_enable_homepage_popular_slider']) && $bjorn_theme_options['blog_enable_homepage_popular_slider']) {\n \n if(isset($bjorn_theme_options['blog_homepage_popular_slider_limit'])) {\n $popular_posts_limit = $bjorn_theme_options['blog_homepage_popular_slider_limit'];\n } else {\n $popular_posts_limit = 10;\n }\n\n if(isset($bjorn_theme_options['blog_homepage_popular_slider_category'])) {\n $popular_posts_category = $bjorn_theme_options['blog_homepage_popular_slider_category'];\n } else {\n $popular_posts_category = '';\n }\n\n $args = array(\n 'posts_per_page' => $popular_posts_limit,\n 'order' => 'DESC',\n 'category_name' => $popular_posts_category,\n 'orderby' => 'meta_value',\n 'meta_key' => 'post_views_count',\n 'post_type' => 'post',\n 'post_status' => 'publish',\n 'suppress_filters' => 0 \n );\n\n $posts = get_posts( $args );\n\n $total_posts = sizeof($posts);\n\n if($total_posts > 0) {\n\n echo '<div class=\"bjorn-popular-post-list-wrapper clearfix container bjorn-theme-block\">';\n \n if(isset($bjorn_theme_options['blog_homepage_popular_posts_subtitle']) && $bjorn_theme_options['blog_homepage_popular_posts_subtitle'] !== '') {\n echo '<h4 class=\"lined\">'.esc_html($bjorn_theme_options['blog_homepage_popular_posts_subtitle']).'</h4>';\n }\n\n if(isset($bjorn_theme_options['blog_homepage_popular_posts_title']) && $bjorn_theme_options['blog_homepage_popular_posts_title'] !== '') {\n echo '<h2 class=\"lined\">'.esc_html($bjorn_theme_options['blog_homepage_popular_posts_title']).'</h2>';\n }\n\n echo '<div class=\"row clearfix\">';\n echo '<div class=\"col-md-12\">';\n echo '<div class=\"bjorn-popular-post-list-nav\">';\n echo '<div class=\"bjorn-popular-post-list-nav-next\">';\n echo '</div>';\n echo '<div class=\"bjorn-popular-post-list-nav-prev\">';\n echo '</div>';\n echo '</div>';\n echo '<div class=\"bjorn-popular-post-list-content\">';\n echo '<div class=\"bjorn-popular-post-list-content-inner\">';\n echo '<div id=\"bjorn-popular-post-list\" class=\"bjorn-popular-post-list owl-carousel\">';\n\n foreach($posts as $post) {\n\n setup_postdata($post);\n \n $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'bjorn-blog-thumb');\n\n if(has_post_thumbnail( $post->ID )) {\n $image_bg ='background-image: url('.$image[0].');';\n $post_class = '';\n }\n else {\n $image_bg = '';\n $post_class = ' bjorn-popular-post-no-image';\n }\n\n $categories_list = get_the_category_list( ', ', 0, $post->ID );\n\n $post_comments = get_comments_number($post->ID);\n\n echo '<div class=\"bjorn-popular-post'.esc_attr($post_class).'\">';\n\n if(has_post_thumbnail( $post->ID )) {\n echo '<a href=\"'.esc_url(get_permalink($post->ID)).'\"><div class=\"bjorn-popular-post-image hover-effect-img\" data-style=\"'.esc_attr($image_bg).'\"></div></a>';\n }\n\n echo '<div class=\"bjorn-popular-post-details\">\n <div class=\"bjorn-popular-post-category\">'.wp_kses_post($categories_list).'</div>\n <div class=\"bjorn-popular-post-title\"><a href=\"'.esc_url(get_permalink($post->ID)).'\"><h5>'.esc_html($post->post_title).'</h5></a></div>\n <div class=\"bjorn-popular-post-date\">'.get_the_time( get_option( 'date_format' ), $post->ID ).'</div>\n </div>';\n\n echo '</div>';\n\n }\n\n wp_reset_postdata();\n\n echo '</div>';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n\n echo '</div>';\n\n $slider_slides = 4;\n\n if(isset($bjorn_theme_options['blog_homepage_popular_slider_autoplay'])) {\n $slider_autoplay = $bjorn_theme_options['blog_homepage_popular_slider_autoplay'];\n } else {\n $slider_autoplay = 3000;\n }\n\n if($slider_autoplay > 0) {\n $slider_autoplay_bool = 'true';\n } else {\n $slider_autoplay_bool = 'false';\n }\n\n wp_add_inline_script( 'bjorn-script', '(function($){\n $(document).ready(function() {\n var owl = $(\".bjorn-popular-post-list-wrapper .bjorn-popular-post-list\");\n\n owl.owlCarousel({\n loop: true,\n items:'.esc_js($slider_slides).',\n autoplay:'.esc_js($slider_autoplay_bool).',\n autowidth: false,\n autoplayTimeout:'.esc_js($slider_autoplay).',\n autoplaySpeed: 1000,\n navSpeed: 1000,\n dots: false,\n responsive: {\n 1199:{\n items:'.esc_js($slider_slides).'\n },\n 979:{\n items:2\n },\n 768:{\n items:2\n },\n 479:{\n items:1\n },\n 0:{\n items:1\n }\n }\n });\n\n $(\".bjorn-popular-post-list-wrapper .bjorn-popular-post-list-nav .bjorn-popular-post-list-nav-next\").click(function(){\n owl.trigger(\\'next.owl.carousel\\', [1000]);\n })\n $(\".bjorn-popular-post-list-wrapper .bjorn-popular-post-list-nav .bjorn-popular-post-list-nav-prev\").click(function(){\n owl.trigger(\\'prev.owl.carousel\\', [1000]);\n })\n\n });})(jQuery);');\n\n }\n\n }\n}", "function latest_articles_widget() {\n ob_start(); ?>\n <section class=\"widget latest-news-widget latest-news-widget-2\">\n <div class=\"wrapper\">\n <div class=\"wrapperbgcolor background-shade\">\n <div class=\"widgettext widget-content\">\n <div class=\"widget-title\"><h3>Latest Articles</h3></div>\n <ul class=\"list-unstyled\">\n <li class=\"headline-item\">\n <a href=\"#\">The Human Alzheimer Disease Project</a>\n <p class=\"small\">1 month ago</p>\n </li>\n <li class=\"headline-item\">\n <a href=\"#\">The Know, Do, and Quality Gaps in International Maternal and Child Health Care Interventions</a>\n <p class=\"small\">2 months ago</p>\n </li>\n <li class=\"headline-item\">\n <a href=\"#\">Considering the Potential Effect of Federal Policy on Childhood Obesity</a>\n <p class=\"small\">3 months ago</p>\n </li>\n <li class=\"headline-item\">\n <a href=\"#\">Is Lunch From Home Better Than the School Cafeteria?: A Look at the New School Lunch Criteria</a>\n <p class=\"small\">4 months ago</p>\n </li>\n <li class=\"headline-item\">\n <a href=\"#\">Surgical Delivery in Under-resourced Settings: Building Systems and Capacity Around the Corner and Far Away</a>\n <p class=\"small\">5 months ago</p>\n </li>\n </ul>\n <div class=\"read-more\"><a href=\"#\">MORE ▸</a></div>\n </div>\n </div>\n </div>\n </section>\n <?php\n $output = ob_get_contents();\n ob_end_clean ();\n return $output;\n}", "public static function front()\n {\n return News::where('show', 1)->orderBy('order', 'asc')->get();\n }", "function ajax_news_script_load_more($args) {\n //init ajax\n $ajax = false;\n //check ajax call or not\n if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&\n strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n $ajax = true;\n }\n //number of posts per page default\n $num = 2;\n //page number\n $paged = 1;\n if(isset($_POST['page']) && !empty($_POST['page'])){\n $paged = $_POST['page'] + $paged;\n }\n $query = new WP_Query(array( \n 'post_type'=> 'news',\n 'post_status' => 'publish',\n 'posts_per_page' =>$num,\n 'paged'=>$paged,\n 'orderby' => 'date',\n 'order'=> 'ASC',\n 'tax_query' => array(\n array(\n 'taxonomy' => 'news_cat',\n 'field' => 'slug',\n 'terms' => 'news',\n ),\n ),\n ) \n );\n if($query->have_posts()){\n $post_count = $query->found_posts;\n while($query->have_posts()): $query->the_post();\n $attach_id = get_post_thumbnail_id(get_the_ID());\n if( !empty($attach_id) )\n $event_src = cbv_get_image_src($attach_id);\n else\n $event_src = ''; \n $ninfo = get_field('news_info'); \n ?>\n <li>\n <div class=\"event-media-page-tab-con-row clearfix\">\n <div class=\"event-media-page-tab-con-fea-img\">\n <?php echo cbv_get_image_tag($attach_id); ?>\n </div>\n <div class=\"event-media-page-tab-con-des\">\n <h3 class=\"emptcd-title\"><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h3>\n <span><?php echo $ninfo; ?></span>\n <p><?php echo get_the_excerpt(); ?> <a href=\"<?php the_permalink(); ?>\">Continue Reading...</a> </p>\n </div>\n </div>\n </li>\n <?php\n endwhile;\n\n if( $post_count <= $num ){\n echo '<style>.fl-see-all-btn{display:none;}</style>';\n }\n \n }else{\n //echo '<div class=\"postnot-found\" style=\"text-align:center; padding:20px 0;\">No results!</div>';\n echo '<style>.fl-see-all-btn{display:none;}</style>';\n } \n \n wp_reset_postdata();\n \n //check ajax call\n if($ajax) wp_die();\n}", "public function viewNewContent()\n\t{\n\t\t$entryIds\t\t= $this->registry->getClass('classItemMarking')->fetchCookieData( 'blog', 'items' );\n\t\t$oldStamp\t\t= $this->registry->getClass('classItemMarking')->fetchOldestUnreadTimestamp( array(), 'blog' );\n\t\t$followedOnly\t= $this->memberData['member_id'] ? IPSSearchRegistry::get('in.vncFollowFilterOn' ) : false;\n\t\n\t\t/* Loop through the forums and build a list of forums we're allowed access to */\n\t\t$start\t\t= IPSSearchRegistry::get('in.start');\n\t\t$perPage\t= IPSSearchRegistry::get('opt.search_per_page');\n\t\t\n\t\tIPSSearchRegistry::set('in.search_sort_by' , 'date' );\n\t\tIPSSearchRegistry::set('in.search_sort_order', 'desc' );\n\t\tIPSSearchRegistry::set('opt.searchType' , 'titles' );\n\t\tIPSSearchRegistry::set('opt.noPostPreview' , true );\n\t\t\n\t\t/* Finalize times */\n\t\tif ( ! $oldStamp OR $oldStamp == IPS_UNIX_TIME_NOW )\n\t\t{\n\t\t\t$oldStamp = intval( $this->memberData['last_visit'] );\n\t\t}\n\t\t\n\t\tif ( $this->memberData['_cache']['gb_mark__blog'] && ( $this->memberData['_cache']['gb_mark__blog'] < $oldStamp ) )\n\t\t{\n\t\t\t$oldStamp = $this->memberData['_cache']['gb_mark__blog'];\n\t\t}\n\t\t\n\t\t/* Finalize times */\n\t\tif ( ! $oldStamp OR $oldStamp == IPS_UNIX_TIME_NOW )\n\t\t{\n\t\t\t$oldStamp = intval( $this->memberData['last_visit'] );\n\t\t}\n\t\t\n\t\t/* Set the timestamps */\n\t\t$this->sphinxClient->SetFilterRange( 'entry_date', $oldStamp, time() );\n\t\t$this->setDateRange( 0, 0 );\n\t\t\n\t\t/* Set up some vars */\n\t\tIPSSearchRegistry::set('set.resultCutToDate', $oldStamp );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Only content we are following?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $followedOnly )\n\t\t{\n\t\t\trequire_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/\n\t\t\t$like = classes_like::bootstrap( 'blog', 'entries' );\n\t\t\t\n\t\t\t$followedEvents\t= $like->getDataByMemberIdAndArea( $this->memberData['member_id'] );\n\t\t\t$followedEvents = ( $followedEvents === null ) ? array() : array_keys( $followedEvents );\n\t\t\t\n\t\t\tif( !count($followedEvents) )\n\t\t\t{\n\t\t\t\treturn array( 'count' => 0, 'resultSet' => array() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->sphinxClient->SetFilter( 'search_id', $followedEvents );\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Only content we have participated in?\n\t\t//-----------------------------------------\n\t\t\n\t\tif( IPSSearchRegistry::get('in.userMode') )\n\t\t{\n\t\t\tswitch( IPSSearchRegistry::get('in.userMode') )\n\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\tcase 'all': \n\t\t\t\t\t$_blogIds\t= $this->_getBlogIdsFromComments();\n\t\t\t\t\t\n\t\t\t\t\tif( count($_blogIds) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sphinxClient->SetFilter( 'entry_author_id', $this->memberData['member_id'] );\n\t\t\t\t\t\t$this->sphinxClient->SetFilter( 'search_id', $_blogIds );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sphinxClient->SetFilter( 'entry_author_id', $this->memberData['member_id'] );\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'title':\n\t\t\t\t\t$this->sphinxClient->SetFilter( 'entry_author_id', $this->memberData['member_id'] );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( IPSSearchRegistry::get('blog.searchInKey') == 'entries' )\n\t\t{\n\t\t\treturn $this->_entriesSearch();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_commentsSearch();\n\t\t}\n\t}", "function SocialFeedRecentTwitterWidget() {\r\n\t\tparent::__construct( false, 'Social Feed Recent Twitter Post' );\r\n\t}", "private function news() {\n//\t\t$thearray [2] = \"news_list.php?tag={$this->_tag}&theid={$this->_newsobj['sort']}\";\n//\t\treturn $thearray;\n\t\t//$this->_tpl->assign ( \"news\", bll_news::getlist( 14 , 20 ) ); //首页新闻动态\n\t\t$news = bll_news::getlist( 14 , 20 );\n\t\treturn $news;\n\t\tprint_r($news);\n\t}", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n\t\t\n\t\tglobal $post;\n\t\t$args = array(\n\t\t\t'numberposts' => 2\n\t\t );\n\t\t \n\t\t $latest_posts = get_posts( $args );\n\t\t foreach( $latest_posts as $post ){\n\n\t\t?>\n\n\t\t<div class=\"w3ls\">\n\t\t\t<div class=\"col-md-6 w3ls-left wow fadeInDown\" data-wow-duration=\".8s\" data-wow-delay=\".2s\">\n\t\t\t\t<div class=\"tc-ch\">\n\t\t\t\t\t<div class=\"tch-img\">\n\t\t\t\t\t\t<a href=\"<?php echo get_the_permalink(); ?>\"><?php the_post_thumbnail(get_the_id()); ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t<h3 class=\"title\" style=\"text-align: <?php echo $settings['title_alignment'] ?>; color: <?php echo $settings['title_color'] ?>; <?php echo $settings['title_background'] ?>; <?php echo $settings['title_border'] ?>\"><a href=\"<?php echo get_the_permalink(); ?>\"><font style=\"vertical-align: inherit;\"><font style=\"vertical-align: inherit;\"> <?php echo get_the_title(); ?> </font></font></a></h3>\n\n\t\t\t\t\t<h6><a href=\"singlepage.html\"><?php echo get_the_author(); ?></a> <?php echo the_date(); ?></h6>\n\n\t\t\t\t\t<p class=\"desc\" style=\"text-align: <?php echo $settings['desc_alignment'] ?>; color: <?php echo $settings['desc_color'] ?>; <?php echo $settings['desc_background'] ?>; <?php echo $settings['desc_border'] ?>\"><?php echo the_excerpt(); ?></p>\n\t\t\t\t\t<div class=\"bht1\">\n\t\t\t\t\t\t<a class=\"btn\" style=\"text-align: <?php echo $settings['btn_alignment'] ?>; color: <?php echo $settings['btn_color'] ?>; <?php echo $settings['btn_background'] ?>; <?php echo $settings['btn_border'] ?>\" href=\"<?php echo get_the_permalink(); ?>\"><?php echo $settings['btn_text'] ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"soci my-icon-wrapper\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"hvr-rectangle-out\"><a class=\"fb\" href=\"<?php echo $settings['fb_link']['url'] ?>\" style=\" text-align: <?php echo $settings['fb_icon_alignment'] ?>;\"><?php \\Elementor\\Icons_Manager::render_icon( $settings['fb_icon'], [ 'aria-hidden' => 'true' ] ); ?></a></li>\n\t\t\t\t\t\t<li class=\"hvr-rectangle-out\"><a class=\"twit\" href=\"<?php echo $settings['twit_link']['url'] ?>\" style=\" text-align: <?php echo $settings['twit_icon_alignment'] ?>;\"><?php \\Elementor\\Icons_Manager::render_icon( $settings['twit_icon'], [ 'aria-hidden' => 'true' ] ); ?></a></li>\n\t\t\t\t\t\t<li class=\"hvr-rectangle-out\"><a class=\"goog\" href=\"<?php echo $settings['goog_link']['url'] ?>\" style=\" text-align: <?php echo $settings['goog_icon_alignment'] ?>;\"><?php \\Elementor\\Icons_Manager::render_icon( $settings['goog_icon'], [ 'aria-hidden' => 'true' ] ); ?></a></li>\n\t\t\t\t\t\t<!-- <li class=\"hvr-rectangle-out\"><a class=\"pin\" href=\"#\"></a></li>\n\t\t\t\t\t\t<li class=\"hvr-rectangle-out\"><a class=\"drib\" href=\"#\"></a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clearfix\"></div>\n\t\t\t</div>\n\t\t</div>\n\n\n\n\t\t<?php\n\t\t\n\t\t}\n\t\twp_reset_postdata();\n\n\t}", "function ajan_activity_sitewide_feed() {\n?>\n\n\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"<?php bloginfo( 'name' ) ?> | <?php _e( 'Site Wide Activity RSS Feed', 'ajency-activity-and-notifications' ) ?>\" href=\"<?php ajan_sitewide_activity_feed_link() ?>\" />\n\n<?php\n}", "function news() {\n\n\t$labels = array(\n\t\t'name' => _x( 'News', 'Post Type General Name', 'knowl' ),\n\t\t'singular_name' => _x( 'News', 'Post Type Singular Name', 'knowl' ),\n\t\t'menu_name' => __( 'News', 'knowl' ),\n\t\t'name_admin_bar' => __( 'News', 'knowl' ),\n\t\t'archives' => __( 'Item Archives', 'knowl' ),\n\t\t'attributes' => __( 'Item Attributes', 'knowl' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'knowl' ),\n\t\t'all_items' => __( 'All Items', 'knowl' ),\n\t\t'add_new_item' => __( 'Add New Item', 'knowl' ),\n\t\t'add_new' => __( 'Add New New', 'knowl' ),\n\t\t'new_item' => __( 'New Item', 'knowl' ),\n\t\t'edit_item' => __( 'Edit Item', 'knowl' ),\n\t\t'update_item' => __( 'Update Item', 'knowl' ),\n\t\t'view_item' => __( 'View Item', 'knowl' ),\n\t\t'view_items' => __( 'View Items', 'knowl' ),\n\t\t'search_items' => __( 'Search Item', 'knowl' ),\n\t\t'not_found' => __( 'Not found', 'knowl' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'knowl' ),\n\t\t'featured_image' => __( 'Featured Image', 'knowl' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'knowl' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'knowl' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'knowl' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'knowl' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'knowl' ),\n\t\t'items_list' => __( 'Items list', 'knowl' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'knowl' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'knowl' ),\n\t);\n\t$rewrite = array(\n\t\t'slug' => 'news',\n\t\t'with_front' => true,\n\t\t'pages' => true,\n\t\t'feeds' => true,\n\t);\n\t$args = array(\n\t\t'label' => __( 'News', 'knowl' ),\n\t\t'description' => __( 'news Description', 'knowl' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'excerpt' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => $rewrite,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => false,\n\t);\n\tregister_post_type( 'news', $args );\n\n}", "function aw_load_widget() {\r\n\t\tregister_widget( 'AW_NewsFeed' );\r\n\t}", "function ZPDBRAND_dashboard_add_news_feed_widget(){\n wp_add_dashboard_widget('dashboard_zombie_feed', 'News from The Zombie Apocalypse Blog', 'ZPDBRAND_dashboard_zombie_rssfeed_output');\n}", "public function news()\n { \n \n $callback['news'] = News::where(['is_active' => 1])->offset(0)->limit(5)->orderBy('publish_at' , 'desc')->get(); \n $callback['related_news'] = News::select(\n [\n 'news.*' , \n DB::raw('(select count(*) from news_views as view where view.news_id = news.id) as viws')\n ])\n ->where(['is_active' => 1])\n ->offset(0)\n ->limit(6)->orderBy('viws' , 'desc')\n ->get(); \n \n $callback['hot_news'] = News::select(\n [\n 'news.*' , \n DB::raw('(select count(*) from news_views as view where view.news_id = news.id) as viws')\n ])\n ->where(['is_active' => 1])\n ->offset(0)\n ->limit(8)->orderBy('viws' , 'desc')\n ->get(); \n \n $callback['tags'] = NewsCategory::all(); \n \n return view('news' , $callback);\n }", "function register_LatestRecentPost() {\n register_widget( 'LatestRecentPost' );\n}", "function bigbluebutton_news() {\n\tglobal $db, $enrolled_courses, $system_courses;\n\t$news = array();\n\tif ($enrolled_courses == ''){\n\t\treturn $news;\n\t} \n\n\t$sql = 'SELECT * FROM '.TABLE_PREFIX.'bigbluebutton WHERE course_id IN '.$enrolled_courses;\n\t$result = mysql_query($sql, $db);\n\tif($result){\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$news[] = array('time'=>htmlentities_utf8($row['course_timing']), \n\t\t\t\t\t\t\t'object'=>$row, \n\t\t\t\t\t\t\t'alt'=>_AT('bigbluebutton'),\n\t\t\t\t\t\t\t'course'=>$system_courses[$row['course_id']]['title'],\n\t\t\t\t\t\t\t'thumb'=>'mods/bigbluebutton/bigbluebutton_sm.png',\n\t\t\t\t\t\t\t'link'=>htmlentities_utf8($row['message']));\n\t\t}\n\t}\n\treturn $news;\n}", "function woothemes_more_themes_page(){\n ?>\n <div class=\"wrap themes-page\">\n <h2>More WooThemes</h2>\n <div class=\"info\">\n <a href=\"http://www.woothemes.com/the-woothemes-club/\">Join the WooThemes Club</a>\n <a href=\"http://www.woothemes.com/themes\">Online Themes Gallery</a>\n <a href=\"http://showcase.woothemes.com/\">Theme Showcase</a>\n </div>\n \n \n <?php // Get RSS Feed(s)\n include_once(ABSPATH . WPINC . '/feed.php');\n $rss = fetch_feed('http://www.woothemes.com/?feed=more_themes');\n $maxitems = $rss->get_item_quantity(30); \n $items = $rss->get_items(0, 30);\n\t\t\t\n ?>\n <ul class=\"themes\">\n <?php if (empty($items)) echo '<li>No items</li>';\n else\n foreach ( $items as $item ) : ?>\n <li class=\"theme\">\n <?php echo $item->get_description();?>\n </li>\n <?php \n\t\t\tendforeach; ?>\n </ul>\n \n </div>\n \n <?php\n\n}", "function top_editor_latest_news() {\n\tregister_block_type(\n\t\t'news-blocks/editor-latest-news',\n\t\t[\n\t\t\t'editor_script' => 'news-blocks',\n\t\t]\n\t);\n}", "function news_script_load_more($args = array()) {\n echo '<ul class=\"clearfix reset-list\" id=\"news-content\">';\n ajax_news_script_load_more($args);\n echo '</ul>';\n echo '<div class=\"fl-see-all-btn\">\n <div class=\"ajaxloading\" id=\"newsajxaloader\" style=\"display:none\"><img src=\"'.THEME_URI.'/assets/images/loading.gif\" alt=\"loader\"></div>\n <a href=\"#\" id=\"newsLoadMore\" data-page=\"1\" data-url=\"'.admin_url(\"admin-ajax.php\").'\" >Load More</a>';\n echo '</div>';\n\n}", "public function indexAction()\n {\n $this->view->assign([\n 'latest' => $this->latestnews,\n ]);\n }", "public function widget( $args, $instance ) {\r\n\t\techo '<p><strong>RECENT NEWS</strong></p><br>';\r\n\t\t\r\n\t\t$args = array ( array ( 'category_name' => 'news, alumni-news, faculty-news, research-news, student-news' ), 'posts_per_page' => 4, 'order' => 'DESC' );\r\n\t\t$loop = new WP_Query( $args );\r\n\t\t\r\n\t\tif ( $loop->have_posts() ):\r\n\t\t\t$count = 0;\r\n\t\t\twhile ( $loop->have_posts() ): $loop->the_post();\r\n\t\t\t\tif ( $count == 0 ) {\r\n\t\t\t\t\techo '<div class=\"news-widget-item-featured\">';\r\n\t\t\t\t\techo \"\" . the_post_thumbnail( 'thumbnail' );\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo '<div class=\"news-widget-item\">';\r\n\t\t\t\t}\r\n\t\t\t\t\techo '<div class=\"news-widget-date\">';\r\n\t\t\t\t\t\techo get_the_date();\r\n\t\t\t\t\techo '';\r\n\t\t\t\t\techo '<div class=\"news-widget-title\">';\r\n\t\t\t\t\t\techo '<h4><a href=\"' . get_permalink() . '\">' . get_the_title() . '</a></h4>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<div class=\"news-widget-content\">';\r\n\t\t\t\t\t\techo get_the_content();\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<div class=\"news-widget-more\">';\r\n\t\t\t\t\t\t$excerpt = news_excerpt_read_more_link( $text );\r\n\t\t\t\t\t\techo $excerpt;\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t$count++;\r\n\t\t\tendwhile;\r\n\t\tendif;\r\n\t\twp_reset_query();\r\n\t}", "function recentPosts() {\r\n\t$rPosts = new WP_Query();\r\n\t$rPosts->query('showposts=4');\r\n\t\twhile ($rPosts->have_posts()) : $rPosts->the_post(); ?>\r\n\t\t\t <div class=\"col-md-3 prj-item col-sm-6\">\r\n <a href=\"<?php the_permalink();?>\">\r\n\t\t\t <?php the_post_thumbnail('recent-thumbnails'); ?>\r\n <div class=\"info\">\r\n\t\t <i class=\"fa fa-plus\"></i>\r\n \t\t <h5><?php the_title();?></h5>\r\n \t\t\t<!--<h6> cats </h6> -->\r\n\t\t \r\n\t\t\t</div>\r\n </a>\r\n </div>\t\r\n\t\t<?php endwhile; \r\n\twp_reset_query();\r\n}", "function news_from_xml($xml){\r\n\r\n\r\n$xml2=simplexml_load_file($xml) or die(\"Error: Cannot create object\");\r\n\r\nforeach($xml2->children() as $channel){\r\n\r\n\r\n//get and output \"<item>\" elements\r\nforeach($channel->item as $item){\r\n\r\n$item_link2 = $item->link;\r\n$item_desc2 = $item->description;\r\n$item_pubdate2=$item->pubDate;\r\n\r\n\r\n$Atime=array(\"year\",\"month\",\"day\",\"hour\",\"min\");\r\n$date = date('m/d/Y H:i', time()+3600);\r\n$date2 = strtotime($item_pubdate2);\r\n$date2 = date('m/d/Y H:i', $date2+3600);\r\n$datetime1 = new DateTime($date);\r\n$datetime2 = new DateTime($date2);\r\n$interval = $datetime2->diff($datetime1);\r\n$Atime[\"day\"]=$interval->format('%d');\r\n$Atime[\"hour\"]=$interval->format('%H');\r\n$Atime[\"min\"]=$interval->format('%i');\r\n$Atime[\"month\"]=$interval->format('%m');\r\n$Atime[\"year\"]=$interval->format('%Y');\r\n\r\nif($Atime[\"month\"]==0 and $Atime[\"year\"]==0 and $Atime[\"day\"]==0 and $Atime[\"hour\"]==0 and ($Atime[\"min\"]==1)){\r\n\r\n$ff=array(\"link\",\"description\");\r\n$ff[\"link\"]=$item_link2;\r\n$ff[\"description\"]=$item_desc2;\r\n\r\n //echo \"############################\";////APEL POP UP\r\n news($ff);\r\n\r\n\r\n\r\n\r\n}\r\n}\r\n}\r\n\r\n}", "function widget_spd_nav_nachrichten() {\n?>\n <ul class=\"news\">\n \t<h2>Nachrichten</h2>\n <?php \n\t\t\t\t\t\n\t\t\t\t\t\t$news_query = new WP_Query();\n\t\t\t\t\t\t$news_query->query(\"showposts=3&category_name=Nachrichten\");\n\t\t\t\t\n\t\t\t\t\t?>\n <?php if($news_query->have_posts()){ ?>\n <?php while ($news_query->have_posts()) : $news_query->the_post(); ?>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t$snip_title=60;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$the_title=get_the_title();\n\t\t\t\t\t\tif(strlen($the_title)>$snip_title){\n\t\t\t\t\t\t\t$the_title=substr($the_title,0,$snip_title).\" ...\";\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t?>\n \t<li><a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title(); ?>\"><?php echo $the_title; ?></a></li>\n <?php endwhile; ?>\n <?php }else{ ?>\n <li><a href=\"#\" title=\"Es wurde noch keine Nachricht ver&ouml;ffentlicht\">Es wurde noch keine Nachricht ver&ouml;ffentlicht</a></li>\n <?php } ?>\n\n </ul>\n <ul class=\"further\">\n <?php $catId = get_category_by_slug('Nachrichten'); ?>\n <?php if(isset($catId->term_id)){?>\n \t\t<li><a href=\"<?php echo get_category_link($catId->term_id); ?>\" title=\"Weitere Nachrichten\">Weitere Nachrichten</a></li>\n \t<?php } ?>\n </ul>\n \n \n\n<?php\n}", "public function index(){\n\t\t $this->newslist();\n\t\t}", "function ZPDBRAND_dashboard_zombie_rssfeed_output() {\n echo '<div class=\"rss-widget zombie\">';\n wp_widget_rss_output(array(\n 'url' => 'http://thezombieapocalypseblog.com/feed/',\n 'title' => 'Latest news from The Zombie Apocalypse Blog',\n 'items' => 3,\n 'show_summary' => 1,\n 'show_author' => 0,\n 'show_date' => 1\n ));\n echo \"</div>\";\n}", "function custom_front_page_loop () {\n about_me_section();\n featured_projects();\n open_ended_section();\n}", "public function newsAction()\n\t {\n\t \t$this->_helper->layout()->setLayout('layout_news');\n\t\t$this->view->loginStatus = $this->isLoggedIn(); \n \t \n\t $fitnessPages = new FitnessWebsitePages();\n \t$fitnessPagesMulti= new FitnessWebsitePagesMultilang();\t\t\n\t\t$fitnessNews = new FitnessNews();\n\t\t$fitnessNewsMulti = new FitnessNewsMultilang();\n\t\t\n\t\t$lang = $this->getDefaultLanguage();\n\t\tif($this->_request->getParam('category') != \"\")\n\t\t{\n\t\t\t$category = $this->_request->getParam('category');\n\t\t\t\n\t\t\t$getNews = $fitnessNews->getNewsByCategory($category);\n\t\t\t\n\t\t\tforeach($getNews as $catN)\n\t\t\t{\n\t\t\t\t$newsCatList[] = $fitnessNewsMulti->getNews($catN['id'],$lang);\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->view->newsList = $newsCatList;\n\t\t}\n\t\telse if($this->_request->getParam('date') != \"\")\n\t\t{\n\t\t\t$getNews = $fitnessNews->getNewsByDate($this->_request->getParam('date'));\n\t\t\t\n\t\t\tforeach($getNews as $catN)\n\t\t\t{\n\t\t\t\t$newsCatList[] = $fitnessNewsMulti->getNews($catN['id'],$lang);\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->view->newsList = $newsCatList;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->view->newsList = $fitnessNewsMulti->getAllInterests($lang);\n\t\t}\n\t\t\n\t\t//get the date range()\n\t\t\n\t\t\n\t\t$dateFirst = date('Y-m-d');\n\t\t$dateSecond = date('Y-m-d',strtotime('-2 month'));\n\t\t\n\t\t$this->view->dateRange = $this->get_months($dateSecond,$dateFirst);\n\t\t\n\t\t//get the news subtext\n\t\t$pageId = $fitnessPages->getPageByName('News');\n \t \n \t$pageContent = $fitnessPagesMulti->getPage($pageId['page_id'],$lang);\n\t\t\n\t\t$this->view->newsSub = $pageContent['page_content_sub'];\n\t\t$this->view->newsSub = $pageContent['page_content_sub'];\n\t\t$this->view->defaultLang = $lang;\n\t\t\n\t }", "function widget_grouptivity($args) {\r\n\t\t//Widget goes here\r\n\t\textract($args);\r\n\t\t$options = get_option('grouptivity_widget_options');\r\n\t\t$grouptivity_options = get_option('grouptivity_options');\r\n\t\t$gvPartnerId \t= $grouptivity_options['partnerId'];\r\n\t\tif ($options[\"title\"]){\r\n\t\t\t$title=$options[\"title\"];\r\n\t\t} else {\r\n\t\t\t$title=\"What's Hot!\";\r\n\t\t}\r\n\t\t$numArticles=$options[\"numArticles\"];\r\n\t\tif ($options[\"numDays\"]){\r\n\t\t\t$numDays=$options[\"numDays\"];\r\n\t\t} else {\r\n\t\t\t$numDays=30;\r\n\t\t}\r\n\t\tif ($options[\"showCount\"]){\r\n\t\t\t$showCount=$options[\"showCount\"];\r\n\t\t} else {\r\n\t\t\t$showCount=\"y\";\r\n\t\t}\r\n\t\t$ulstyle=$options[\"ulstyle\"];\r\n\t\t$listyle=$options[\"listyle\"];\r\n\t\t$astyle=$options[\"astyle\"];\r\n\t\techo $before_widget . $before_title . $title . $after_title;\r\n\t\t$url = \"http://www.grouptivity.com/main/api/mostShared/json.php?pId=\".rawurlencode($gvPartnerId).\"&lsize=$numArticles&start=0\";\r\n\t\t?>\r\n\t\t<ul class=\"grouptivity-newsItemList\" id=\"gtvtMostShared\"><li class=\"grouptivity-newsItem\">Loading...</li></ul>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t// Define object and functions\r\n\t\tvar gtvt_most_shared={\r\n\t\t\tdays: <?php echo $numDays;?>,\r\n\t\t\taddCss:function (cssCode) {\r\n\t\t\t\tvar styleElement = document.createElement(\"style\");\r\n\t\t\t\tstyleElement.type = \"text/css\";\r\n\t\t\t\tif (styleElement.styleSheet) {\r\n\t\t\t\t\tstyleElement.styleSheet.cssText = cssCode;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstyleElement.appendChild(document.createTextNode(cssCode));\r\n\t\t\t\t}\r\n\t\t\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(styleElement);\r\n\t\t\t},\r\n\t\t\tprocessResponse: function(data) {\r\n\t\t\t\tvar ul, li, a, i;\r\n\t\t\t\tvar ul=document.getElementById(\"gtvtMostShared\");\r\n\t\t\t\tif (data.listSize && data.listSize!==\"0\") {\r\n\t\t\t\t\tul.removeChild(ul.firstChild);\r\n\t\t\t\t\tfor (i=0;i<data.mostShared.length;i++) {\r\n\t\t\t\t\t\tli=document.createElement(\"li\"); li.className=\"grouptivity-newsItem\"; \r\n\t\t\t\t\t\ta=document.createElement(\"a\"); a.className=\"grouptivity-newsItemA\"; a.target=\"_blank\"; a.href=data.mostShared[i].url; \r\n\t\t\t\t\t\ta.appendChild(document.createTextNode(data.mostShared[i].title));\r\n\t\t\t\t\t\tli.appendChild(a);\r\n\t\t\t\t\t\t<?php if ($showCount==\"y\"){?>\r\n\t\t\t\t\t\tvar j, imgSrc, img, typeind, count, alt, span;\r\n\t\t\t\t\t\t// Show the couunts\r\n\t\t\t\t\t\tli.appendChild(document.createElement(\"br\"));\r\n\t\t\t\t\t\tspan=document.createElement(\"span\");\r\n\t\t\t\t\t\tfor (j=0;j<data.mostShared[i].shareStats.length;j++) {\r\n\t\t\t\t\t\t\ttypeind=data.mostShared[i].shareStats[j].typeind;\r\n\t\t\t\t\t\t\tcount=data.mostShared[i].shareStats[j].count;\r\n\t\t\t\t\t\t\talt=\"Shared \"+count+\" time\"+(count==1?\"\":\"s\");\r\n\t\t\t\t\t\t\t// Some need special treatment\r\n\t\t\t\t\t\t\tswitch (typeind.toLowerCase()) {\r\n\t\t\t\t\t\t\tcase \"sharing\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/email.gif\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"digg\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=\"Dugg \"+count+\" time\"+(count==1?\"\":\"s\")+\" on Digg\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"googlebookmarks\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/google.gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on Google Bookmarks\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"grouptivity\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=\"Saved \"+count+\" time\"+(count==1?\"\":\"s\")+\" on Grouptivity\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"misterwong\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on Mister Wong\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"stumbleupon\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=\"Stumbled \"+count+\" time\"+(count==1?\"\":\"s\")+\" on StumbleUpon\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"windowslive\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/windows.gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on Windows Live\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"yahooweb\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/yahoo.gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on Yahoo! MyWeb\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"yahoobookmarks\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/yahoobm.gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on Yahoo! Bookmarks\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"technocrati\":\r\n\t\t\t\t\t\t\t\t//Oops! embasassing spelling faux pas\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/technorati.gif\";\r\n\t\t\t\t\t\t\t\t// $bkmark->typeind=\"Technorati\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase \"twitter\":\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=count+\" tweet\"+(count==1?\"\":\"s\")+\" on Twitter\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\timgSrc=\"http://cdn.grouptivity.com/main/api/webjs/images/\"+typeind.toLowerCase()+\".gif\";\r\n\t\t\t\t\t\t\t\talt=alt+\" on \"+typeind;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\timg=document.createElement(\"img\"); img.align=\"bottom\"; img.border=\"0\"; img.title=alt; img.alt=alt; img.src=imgSrc;\r\n\t\t\t\t\t\t\tif (typeind===\"sharing\") {\r\n\t\t\t\t\t\t\t\tspan.insertBefore(document.createTextNode(\" \"+count+\" \"), span.firstChild);\r\n\t\t\t\t\t\t\t\tspan.insertBefore(img, span.firstChild);\r\n\r\n\t\t\t\t\t\t\t} else if (typeind!==\"reading\") {\r\n\t\t\t\t\t\t\t\tspan.appendChild(img); \r\n\t\t\t\t\t\t\t\tspan.appendChild(document.createTextNode(\" \"+count+\" \"));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tli.appendChild(span);\r\n\t\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t\tul.appendChild(li);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Append More link\r\n\t\t\t\t\tli=document.createElement(\"li\");\r\n\t\t\t\t\ta=document.createElement(\"a\"); a.className=\"grouptivity-newsItemA\"; a.target=\"_blank\"; a.href=\"<?php print \"http://apps.grouptivity.com/socialmail/mostShared.do?pId=\".rawurlencode($gvPartnerId); ?>\"; \r\n\t\t\t\t\ta.appendChild(document.createTextNode(\"More...\"));\r\n\t\t\t\t\tli.appendChild(a);\r\n\t\t\t\t\tul.appendChild(li);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (gtvt_most_shared.days===1) {\r\n\t\t\t\t\t\tgtvt_most_shared.days=7;\r\n\t\t\t\t\t\tjQuery.getJSON(\"<?php echo $url; ?>&day=\"+encodeURIComponent(gtvt_most_shared.days)+\"&jsonp=?\", gtvt_most_shared.processResponse);\t\r\n\t\t\t\t\t} else if (gtvt_most_shared.days===7) {\r\n\t\t\t\t\t\tgtvt_most_shared.days=30;\r\n\t\t\t\t\t\tjQuery.getJSON(\"<?php echo $url; ?>&day=\"+encodeURIComponent(gtvt_most_shared.days)+\"&jsonp=?\", gtvt_most_shared.processResponse);\t\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tul.removeChild(ul.firstChild);\r\n\t\t\t\t\t\tli=document.createElement(\"li\"); li.className=\"grouptivity-newsItem\"; \r\n\t\t\t\t\t\tli.appendChild(document.createTextNode(\"Nothing to see.\"));\r\n\t\t\t\t\t\tul.appendChild(li);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t};\r\n\t\t//Call for data\r\n\t\tjQuery.getJSON(\"<?php echo $url; ?>&day=\"+encodeURIComponent(gtvt_most_shared.days)+\"&jsonp=?\",\r\n \tgtvt_most_shared.processResponse\r\n \t\t );\r\n\t\t// Add CSS\r\n\t\tgtvt_most_shared.addCss(<?php print \"\\\".grouptivity-newsItemList{$ulstyle} .grouptivity-newsItem{$listyle} .grouptivity-newsItemA, .grouptivity-newsItemA:visited {$astyle}\\\"\"; ?>);\r\n\t\t</script>\r\n\t\t<?php\r\n\t\techo $after_widget;\r\n\t}", "function drush_newsfetcher_news_fetch() {\n // Define the id (machine name) of the importer you want to use.\n $importer_id = 'bbc_world_news';\n $source = feeds_source($importer_id);\n\n // Override to work with Drush.\n $config = array(\n 'process_in_background' => TRUE,\n );\n $source->importer->addConfig($config);\n\n // Set the import URL.\n $fetcher_config = $source->getConfigFor($source->importer->fetcher);\n $fetcher_config['source'] = 'http://feeds.bbci.co.uk/news/world/rss.xml';\n $source->setConfigFor($source->importer->fetcher, $fetcher_config);\n $source->save();\n\n // Execute the import.\n $source->startImport();\n}", "function show_recent_posts(){\r\n echo \"<h1 >&nbsp;&nbsp;Recent Posts</h1> \";\r\n global $connection;\r\n $query=\"SELECT * FROM posts WHERE assign_flag=0 ORDER BY id DESC LIMIT 5 \";\r\n $post_result=mysqli_query($connection,$query);\r\n confirm_query($post_result);\r\n echo \"<ul style=\\\"list-style-type:none\\\">\";\r\n while($post_data=mysqli_fetch_assoc($post_result))\r\n {\r\n echo \"<li><div id=\\\"post\\\">\"; \r\n $poster_data= get_data_by_id($post_data['poster_id'],$post_data['poster_designation']);//getting data using student or teacher table for designation, name etc.\r\n ?>\r\n <h2 scope=\"col\"><?php echo $post_data['post_title'].\" </h2>by <span class='poster'>\". $poster_data['first_name'].\" \".$poster_data['last_name'].\"</span>(\".$post_data['poster_designation'].\")\" ?>\r\n <p><?php echo $post_data['post_content'] ?></p>\r\n <?php\r\n echo \"</div></li>\";\r\n }\r\n echo \"</ul>\";\r\n echo_space(25);\r\n echo \"<a href=\\\"posts.php?page_id=1\\\" style=\\\"color:burlywood ;font-size:20px\\\">show all</a>\";\r\n mysqli_free_result($post_result);\r\n }", "function article($story, $reply) {\n include \"config.inc\";\n\n $story->timestamp = date(\"l, F d, Y - h:i:s A\", $story->timestamp);\n ?>\n <TABLE WIDTH=\"100%\" CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\">\n <TR>\n <TD ALIGN=\"right\" VALIGN=\"bottom\" WIDTH=\"20\" HEIGHT=\"20\">\n <? if (rand(0,1) == 0) $img = \"news1.gif\"; else $img = \"news3.gif\"; ?><IMG SRC=\"themes/Jeroen/images/<? echo $img; ?>\" WIDTH=\"20\" HEIGHT=\"20\" ALT=\"\"></TD>\n <TD colspan=\"3\" ALIGN=\"center\" VALIGN=\"center\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsmiddle.gif\">\n <IMG SRC=\"themes/Jeroen/images/newsmiddle.gif\" width=\"1\" height=\"1\" alt=\"\"><B><? echo $story->subject; ?></B></TD>\n <TD ALIGN=\"left\" VALIGN=\"bottom\" WIDTH=\"20\" HEIGHT=\"20\">\n <? if (rand(0,1) == 0) $img = \"news2.gif\"; else $img = \"news4.gif\"; ?><IMG SRC=\"themes/Jeroen/images/<? echo $img; ?>\" WIDTH=\"20\" HEIGHT=\"20\" ALT=\"\"></TD>\n </TR>\n <TR>\n <TD ALIGN=\"left\" VALIGN=\"bottom\" WIDTH=\"20\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsboxleft.gif\" >\n <IMG SRC=\"themes/Jeroen/images/newsboxleft.gif\" WIDTH=\"20\" HEIGHT=\"20\" alt=\"\">\n </TD>\n <TD COLSPAN=\"2\" ALIGN=\"left\" WIDTH=\"100%\" BGCOLOR=\"#6C6C6C\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/menutitle.gif\" NOWRAP>\n &nbsp;<FONT COLOR=\"<? echo $this->fgcolor2; ?>\">\n <?\n switch (rand(0,12)) {\n\t case 0: $how = \"Yelled at us\"; break;\n\t case 1: $how = \"Whispered\"; break;\n\t case 2: $how = \"Reported\"; break;\n\t case 3: $how = \"Posted\"; break;\n\t case 4: $how = \"Beamed through\"; break;\n\t case 5: $how = \"Faxed\"; break;\n\t case 6: $how = \"Tossed at us\"; break;\n\t case 7: $how = \"Morsed\"; break;\n\t case 8: $how = \"Flagged\"; break;\n\t case 9: $how = \"Written to us\"; break;\n\t case 10: $how = \"Made up\"; break;\n\t case 11: $how = \"Uploaded\"; break;\n\t default: $how = \"Sneaked through\";\n }\n\n if ($story->userid) {\n print \"<FONT SIZE=\\\"-1\\\">$how by <A HREF=\\\"account.php?op=userinfo&uname=$story->userid\\\">$story->userid</A> on $story->timestamp\"; ?><? print \"</FONT>\n </TD>\n <TD ALIGN=\\\"right\\\" WIDTH=\\\"80\\\" BGOLOR=\\\"6C6C6C\\\" BACKGROUND=\\\"themes/Jeroen/images/menutitle.gif\\\">\n <B><A HREF=\\\"search.php?category=$story->category\\\"><FONT COLOR=\\\"<? $this->fgcolor3; ?>\\\">$story->category</FONT></A></B>&nbsp;\";\n }\n else {\n print \"<FONT SIZE=\\\"-1\\\">Reported to us by $anonymous on $story->timestamp\"; ?><? print \"</FONT>\n </TD>\n <TD ALIGN=\\\"center\\\" WIDTH=\\\"80\\\" BGOLOR=\\\"6C6C6C\\\" BACKGROUND=\\\"themes/Jeroen/images/menutitle.gif\\\">\n <A HREF=\\\"search.php?category=$category\\\"><FONT COLOR=\\\"<? $this->fgcolor3; ?>\\\">$story->category</FONT></A>\";\n }\n ?></FONT>\n </TD>\n <TD ALIGN=\"right\" VALIGN=\"bottom\" WIDTH=\"20\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsboxright.gif\">\n <IMG SRC=\"themes/Jeroen/images/newsboxright.gif\" width=\"20\" height=\"20\" alt=\"\">\n </TD>\n </TR>\n <TR>\n <TD ALIGN=\"left\" BACKGROUND=\"themes/Jeroen/images/newsboxleft.gif\" WIDTH=\"20\">&nbsp;\n </TD>\n <TD COLSPAN=\"3\" VALIGN=\"top\" width=\"100%\" BGCOLOR=\"#E7E7E7\" BACKGROUND=\"themes/Jeroen/images/sketch.gif\">\n <TABLE WIDTH=\"100%\">\n <TR>\n <TD>\n <?\n if ($story->updates) {\n echo \"<P>$story->abstract</P><P><FONT COLOR=\\\"$this->hlcolor1\\\">Editor's note by <A HREF=\\\"account.php?op=userinfo&uname=$story->editor\\\">$story->editor</A>:</FONT>$story->updates</P>\";\n }\n else {\n echo $story->abstract;\n }\n\t if ($story->article) echo \"<P>$story->article</P>\";\n ?>\n <TR>\n <TD ALIGN=\"right\">\n <? echo $reply; ?>\n </TD>\n </TR>\n </TD>\n </TR>\n </TABLE>\n </TD>\n <TD ALIGN=\"right\" VALIGN=\"bottom\" WIDTH=\"20\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsboxright.gif\">\n <IMG SRC=\"themes/Jeroen/images/newsboxright.gif\" WIDTH=\"20\" HEIGHT=\"20\" ALT=\"\">\n </TD>\n </TR>\n <TR>\n <TD ALIGN=\"left\" VALIGN=\"top\" WIDTH=\"20\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsboxbottomleft.gif\">&nbsp;</TD>\n <TD COLSPAN=\"3\" ALIGN=\"center\" HEIGHT=\"20\" VALIGN=\"top\" BACKGROUND=\"themes/Jeroen/images/newsboxbottom.gif\">&nbsp;</TD>\n <TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"20\" HEIGHT=\"20\" BACKGROUND=\"themes/Jeroen/images/newsboxbottomright.gif\">&nbsp;</TD>\n </TR>\n </TABLE>\n <?\n }", "function site_news()\n{\n global $setting, $database;\n \n $news = NULL;\n \n // CACHING\n $cache_object = SECache::getInstance('serial');\n if( is_object($cache_object) )\n {\n $news = $cache_object->get('site_news');\n }\n \n // RETRIEVAL\n //if( !is_array($news) || empty($news) )\n if( !is_array($news) )\n {\n $sql = \"SELECT * FROM se_announcements ORDER BY announcement_order DESC LIMIT 20\";\n $resource = $database->database_query($sql);\n \n $news = array();\n while( $news_info = $database->database_fetch_assoc($resource) )\n {\n // CONVERT SUBJECT/BODY BACK TO HTML\n $news_info['announcement_body'] = htmlspecialchars_decode($news_info['announcement_body'], ENT_QUOTES);\n $news_info['announcement_subject'] = htmlspecialchars_decode($news_info['announcement_subject'], ENT_QUOTES);\n $news[] = $news_info;\n }\n \n // CACHE\n if( is_object($cache_object) )\n {\n $cache_object->store($news, 'site_news');\n }\n }\n \n return $news;\n}", "function _for_home_page($NUM_NEWEST_ARTICLE_POST = 4){\n\t\t$Q = db()->query(\"SELECT id AS article_id,author_name,add_date,title,summary,user_id \n\t\t\tFROM \".db('articles_texts').\" \n\t\t\tWHERE status = 'active' \n\t\t\tORDER BY add_date DESC \n\t\t\tLIMIT \".intval($NUM_NEWEST_ARTICLE_POST)\n\t\t);\n\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t$replace2 = array(\n\t\t\t\t\"title\"\t\t\t=> _prepare_html($A[\"title\"]),\n\t\t\t\t\"add_date\"\t\t=> _format_date($A['add_date'], \"long\"),\n\t\t\t\t\"summary\"\t\t=> nl2br(_prepare_html(_cut_bb_codes($A[\"summary\"]))),\n\t\t\t\t\"full_link\"\t\t=> \"./?object=\".'articles'.\"&action=view&id=\".$A[\"article_id\"],\n\t\t\t\t\"user_link\"\t\t=> \"./?object=user_profile&action=show&id=\".$A[\"user_id\"],\n\t\t\t\t\"user_name\"\t\t=> $A[\"author_name\"],\n\n\t\t\t);\n\t\t\t\n\t\t\t$items .= tpl()->parse('articles'.\"/home_page_item\", $replace2);\n\t\t}\n\t\t\n\t\t$replace = array(\n\t\t\t\"items\"\t\t=> $items,\n\t\t);\n\t\t\n\t\treturn tpl()->parse('articles'.\"/home_page_main\", $replace);\n\t}", "public function index()\n\t{\n\t\t$recent = json_decode(Redis::get ( \"recent\" ));\n\t\treturn view ( 'news', [ 'recent' => array_reverse($recent) ] );\n\t}", "function register_news_widget() {\r\n\t\tregister_widget( 'News_Widget' );\r\n\t}", "public function news()\n {\n // Get arguments\n $args = func_get_args();\n $category = isset($args[0]) && !is_numeric($args[0]) ? $args[0] : Config::get('site_news_category');\n $post = isset($args[1]) && is_numeric($args[1]) ? $args[1] : (\n isset($args[0]) && is_numeric($args[0]) ? $args[0] : 0\n );\n\n // Create news object\n $news = new News($category);\n\n // Set parse variables\n Template::vars([\n 'news' => $news,\n 'postsPerPage' => Config::get('news_posts_per_page'),\n 'viewPost' => $post != 0,\n 'postExists' => $news->postExists($post),\n ]);\n\n // Print page contents\n return Template::render('main/news');\n }", "function getTodayNews(){\n\n$arr = array('','','');\n$list = array();\n$link = \"https://newsapi.org/v2/top-headlines?country=it&apiKey=17c1953c3cc7450d958ff14f9e262c02\";\n$json = googleNewsQuery($link);\n$url = \"\";\n\nif(!isset($json['articles'] ))\n return \"\";\n\nforeach ($json['articles'] as $key => $value) {\n\t$url = $value['url'];\n\t$image = $value['urlToImage'];\n\t$title = $value['title'];\n if($url != \"\"){\n $arr[0] = $url;\n\t $arr[1] = $image;\n\t $arr[2] = $title;\n\t array_push($list, $arr);\n\n\t \n }\n\t if (count($list) == 30) {\n \t$i = rand(0,9);\n \t$arr = $list[$i];\n \treturn array('link' => $link,'url' => $arr[0],'image' => $arr[1], 'title' => $arr[2] );\n }\n}\n\nif(count($list) == 0){\n\treturn \"\";\n\n}else{\n\t\n $i = rand(0,count($list)-1);\n $arr = $list[$i];\n return array('link' => $link,'url' => $arr[0],'image' => $arr[1], 'title' => $arr[2] );\n}\n\n}", "public function index() \n {\n // Load a Welcome Model\n $this->load->model('News_Model');\n \n // Get news posts\n $data['news'] = $this->News_Model->get_news_posts(5);\n \n // Loop through each news post and add stamp\n foreach($data['news'] as $key => $value)\n {\n $data['news'][$key]['posted'] = date(\"F j, Y, g:i a\", $value['posted']);\n $data['news'][$key]['body'] = stripslashes($data['news'][$key]['body']);\n }\n \n // Load the page, and we are done :)\n $this->load->view('index', $data);\n }", "function renderOverview(){\r\n\t \tglobal $LANG;\r\n\r\n\t\t$ctrl=$this->loadControl();\r\n\t \t$content='';\r\n\r\n\t \tif ($ctrl['uid']!=0)\r\n\t \t{\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t\t'uid,title,datetime,starttime',\r\n\t\t\t\t\t'tt_news',\r\n\t\t\t\t\t'deleted=0 and hidden=0 and tx_auxnewsmailer_scanstate<2 and tt_news.pid in '.$ctrl['pages'],\r\n\t\t\t\t\t'',\r\n\t\t\t\t\t'datetime',\r\n\t\t\t\t\t''\r\n\t\t\t);\r\n\r\n\t\t\t$content.='</br><b>'.$LANG->getLL('unsendnews').'</b></br>';\r\n\t\t\t$content.='<br>'.$LANG->getLL('lastscan').strftime($ctrl['dateformat'].' '.$ctrl['timeformat'], $ctrl['lasttime']);\r\n\r\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {\r\n\r\n\t\t\t\t$urlinvoke='index.php?id='.$this->id.'&cmd=scan&ctrl='.$ctrl['uid'];\r\n\t\t\t\t$content.='<br><a href=\"'.$urlinvoke.'\">['.$LANG->getLL('createmsg').']</a></br>';\r\n\r\n\t\t\t\t$content.='<table class=\"typo3-dblist\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\r\n\t\t\t\t$content.='<tr class=\"t3-row-header\">';\r\n\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('datetime').'</td>';\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('starttime').'</td>';\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('catcount').'</td>';\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('newstitle').'</td>';\r\n\r\n\t\t\t\t$showcatmsg=false;\r\n\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$catcount=$this->getCatCount($row['uid']);\r\n\t\t\t\t\t\t$content.='<tr class=\"db_list_normal\">';\r\n\t\t\t\t\t$content.='<td>'.strftime($ctrl['dateformat'].' '.$ctrl['timeformat'], $row['datetime']).'</td>';\r\n\t\t\t\t\t$starttime='';\r\n\r\n\t\t\t\t\tif (($row['starttime'])&&($row['starttime']>time()))\r\n\t\t\t\t\t\t$starttime.=strftime($ctrl['dateformat'].' '.$ctrl['timeformat'], $row['starttime']);\r\n\t\t\t\t\tif (($ctrl['usecat'])&&($catcount==0)){\r\n\t\t\t\t\t\t$showcatmsg=true;\r\n\t\t\t\t\t\tif ($starttime) $starttime.='<br>';\r\n\t\t\t\t\t\t$starttime.='<font color=\"red\">'.$LANG->getLL('nocat').'</font>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$starttime)\r\n\t\t\t\t\t\t$starttime=\t$LANG->getLL('nextscan');\r\n\r\n\t\t\t\t\t$content.='<td>'.$starttime.'</td>';\r\n\t\t\t\t\t$content.='<td>'.$catcount.'</td>';\r\n\t\t\t\t\t$content.='<td>'.$row['title'].'</td>';\r\n\t\t\t\t\t$content.='</tr>';\r\n\r\n\t\t\t\t}\r\n\t\t\t\t$content.='</table>';\r\n\r\n\t\t\t\tif ($showcatmsg)\r\n\t\t\t\t\t$content.='<br>'.$LANG->getLL('catmsg').'<br>';\r\n\t\t\t} else\r\n\t\t\t\t$content.='</br>0 '.$LANG->getLL('unsendnews').'</br>';\r\n\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t\t'tx_auxnewsmailer_msglist.*',\r\n\t\t\t\t\t'tx_auxnewsmailer_msglist, fe_users, tx_auxnewsmailer_usrmsg',\r\n\t\t\t\t\t'tx_auxnewsmailer_msglist.state=0 ' .\r\n\t\t\t\t\t\t' and fe_users.disable = 0 ' .\r\n\t\t\t\t\t\t' and fe_users.deleted = 0 ' .\r\n\t\t\t\t\t\t' and tx_auxnewsmailer_usrmsg.idmsg=tx_auxnewsmailer_msglist.uid ' .\r\n\t\t\t\t\t\t' and tx_auxnewsmailer_usrmsg.iduser=fe_users.uid ' .\r\n\t\t\t\t\t\t' and idctrl='.$ctrl['uid'],\r\n\t\t\t\t\t'',\r\n\t\t\t\t\t'',\r\n\t\t\t\t\t''\r\n\t\t\t);\r\n\r\n\t\t \tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {\r\n\t\t\t\t$content.='<br><b>'.$LANG->getLL('pendingmsg').'</b>';\r\n\t\t\t\t$urlinvoke='index.php?id='.$this->id.'&cmd=invoke&msg=0&ctrl='.$ctrl['uid'];\r\n\t\t\t\t$imgurl='../res/sendmail.png';\r\n\t\t\t\t$content.='<br><a href=\"'.$urlinvoke.'\" title=\"'.$LANG->getLL('invoke').'\">[' . $LANG->getLL('invoke') . ']<img src=\"'.$imgurl.'\"/></a>';\r\n\r\n\t\t \t\t$content.='<table class=\"typo3-dblist\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\r\n\t\t\t\t$content.='<tr class=\"t3-row-header\">';\r\n\r\n\t\t\t\t$content.='<td>#</td>';\r\n\t\t\t\t//$content.='<td>'.$LANG->getLL('start').'</td>';\r\n\t\t\t\t//$content.='<td>'.$LANG->getLL('end').'</td>';\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('unsend').'</td>';\r\n\t\t\t\t$content.='<td>'.$LANG->getLL('send').'</td>';\r\n\r\n\t\t\t\t$content.='<td>&nbsp;</td>';\r\n\t\t\t\t$content.='</tr>';\r\n\r\n\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t\t \t$urlinvoke='index.php?id='.$this->id.'&cmd=markall&msg='.$row['uid'];\r\n\t\t\t\t\t$cnt=$this->getUsrMsgCount($row['uid']);\r\n\t\t\t\t\tif ($cnt['unsend']){\r\n\r\n\t\t\t\t\t\t$content.='<tr>';\r\n\t\t\t\t\t\t$content.='<td>'.$row[uid].'</td>';\r\n\t\t\t\t\t\t//$content.='<td>123456</td>';\r\n\t\t\t\t\t\t//$content.='<td>123456</td>';\r\n\t\t\t\t\t\t$content.='<td>'.$cnt['unsend'].'</td>';\r\n\t\t\t\t\t\t$content.='<td>'.$cnt['sendto'].'</td>';\r\n\t\t\t\t\t\t$content.='<td><a href=\"'.$urlinvoke.'\">['.$LANG->getLL('markall').']</a></td>';\r\n\t\t\t\t\t\t$content.='</tr>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$content.='</table>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$content.='no news are ready ';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$content .= $LANG->getLL('no_mail_control');\r\n\t \treturn $content;\r\n\t}" ]
[ "0.71119523", "0.68631846", "0.67503506", "0.67357945", "0.6733061", "0.6676018", "0.66156536", "0.66016906", "0.6581673", "0.65708756", "0.65697753", "0.65682083", "0.6545404", "0.65178704", "0.650925", "0.6495594", "0.64815795", "0.64769584", "0.6422107", "0.6416839", "0.6398935", "0.6391134", "0.6368934", "0.6319945", "0.63150954", "0.6307062", "0.6303646", "0.62758356", "0.6262396", "0.6247934", "0.6236403", "0.62115586", "0.61973464", "0.6194744", "0.61884713", "0.61748207", "0.6174072", "0.6165464", "0.6150415", "0.6145726", "0.6131389", "0.6130459", "0.6110258", "0.61041117", "0.6103901", "0.6092194", "0.60876346", "0.60854536", "0.60627115", "0.6048828", "0.60408694", "0.603076", "0.60146266", "0.60054576", "0.6003801", "0.59847575", "0.5974596", "0.5968831", "0.59625757", "0.5949394", "0.594754", "0.59471464", "0.594256", "0.59408444", "0.59230036", "0.591815", "0.5914741", "0.59145224", "0.5906684", "0.590194", "0.589504", "0.58949846", "0.58914727", "0.5889626", "0.588728", "0.58870137", "0.5884756", "0.58833003", "0.58821553", "0.5881766", "0.5880863", "0.58803624", "0.58803046", "0.587228", "0.5870633", "0.58701724", "0.5868041", "0.5862814", "0.5862201", "0.5860558", "0.58581954", "0.58579844", "0.58506966", "0.58431995", "0.58418405", "0.58414555", "0.584047", "0.58364093", "0.5829408", "0.58272696" ]
0.74947387
0
/ Global Page Custom Post Type
/ Глобальная страница пользовательского типа записей
function registerGlobalPagePostType() { $labels = array( 'name' => 'Global Pages', 'singular_name' => 'Global Page', 'menu_name' => 'Global Pages', 'name_admin_bar' => 'Global Pages', 'archives' => 'Item Archives', 'parent_item_colon' => 'Parent Item:', 'all_items' => 'All Items', 'add_new_item' => 'Add New Item', 'add_new' => 'Add New', 'new_item' => 'New Item', 'edit_item' => 'Edit Item', 'update_item' => 'Update Item', 'view_item' => 'View Item', 'search_items' => 'Search Item', 'not_found' => 'Not found', 'not_found_in_trash' => 'Not found in Trash', 'featured_image' => 'Featured Image', 'set_featured_image' => 'Set featured image', 'remove_featured_image' => 'Remove featured image', 'use_featured_image' => 'Use as featured image', 'insert_into_item' => 'Insert into item', 'uploaded_to_this_item' => 'Uploaded to this item', 'items_list' => 'Items list', 'items_list_navigation' => 'Items list navigation', 'filter_items_list' => 'Filter items list', ); $args = array( 'label' => 'Global Page', 'description' => 'Pages always displayed in the nav bar.', 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes', ), 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 20, 'menu_icon' => 'dashicons-admin-page', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ); register_post_type( 'ohGlobalPage', $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_custom_post_type() {\n\t\\do_action( 'gnist/register/custom_post_type' );\n}", "function init_custom_post_types() {\trequire 'inc/post_types.php'; }", "function custom_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Sites', 'Site General Name', 'ido_ang_wp' ),\n\t\t'singular_name' => _x( 'Site', 'Site Singular Name', 'ido_ang_wp' ),\n\t\t'menu_name' => __( 'Sites', 'ido_ang_wp' ),\n\t\t'name_admin_bar' => __( 'Site', 'ido_ang_wp' ),\n\t\t'archives' => __( 'Sites Archives', 'ido_ang_wp' ),\n\t\t'attributes' => __( 'Site Attributes', 'ido_ang_wp' ),\n\t\t'parent_item_colon' => __( 'Parent Site:', 'ido_ang_wp' ),\n\t\t'all_items' => __( 'All Sites', 'ido_ang_wp' ),\n\t\t'add_new_item' => __( 'Add New Site', 'ido_ang_wp' ),\n\t\t'add_new' => __( 'Add New', 'ido_ang_wp' ),\n\t\t'new_item' => __( 'New Site', 'ido_ang_wp' ),\n\t\t'edit_item' => __( 'Edit Site', 'ido_ang_wp' ),\n\t\t'update_item' => __( 'Update Site', 'ido_ang_wp' ),\n\t\t'view_item' => __( 'View Site', 'ido_ang_wp' ),\n\t\t'view_items' => __( 'View Sites', 'ido_ang_wp' ),\n\t\t'search_items' => __( 'Search Site', 'ido_ang_wp' ),\n\t\t'not_found' => __( 'Not found', 'ido_ang_wp' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'ido_ang_wp' ),\n\t\t'featured_image' => __( 'Featured Image', 'ido_ang_wp' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'ido_ang_wp' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'ido_ang_wp' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'ido_ang_wp' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'ido_ang_wp' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'ido_ang_wp' ),\n\t\t'items_list' => __( 'Items list', 'ido_ang_wp' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'ido_ang_wp' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'ido_ang_wp' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Sites', 'ido_ang_wp' ),\n\t\t'description' => __( 'All My Sites', 'ido_ang_wp' ),\n\t\t'labels' => $labels,\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n\t\t'supports' => array( 'title', 'thumbnail', 'editor' )\n\n\t);\n\tregister_post_type( 'sites', $args );\n\n}", "function settings_post_types_option() {\n\t\tglobal $edit_flow;\n\t\t$edit_flow->settings->helper_option_custom_post_type( $this->module );\n\t}", "public function post_types();", "function newType(){\n $labels = array(\n 'name' => 'Custom Post List',\n 'singular_name' => 'Custom',\n 'add_new' => 'Add new Custom Post',\n 'add_new_item' => 'Add new',\n 'edit_item' => 'Edit',\n 'new item' => 'Add new',\n 'view_item' => 'View',\n 'search_items' => 'Looking for',\n 'not_found'=> 'Not found',\n 'not_found_in_trash' => 'Empty trash',\n 'parent_item_colon' => '',\n 'menu_name' => 'Custom Posts'\n\n\n);\n\n$args = array( \n 'labels' => $labels, //Adiciona o array criado anteriormente.\n 'public' => true, //Se pode ser adicionado aos menus e exibido em buscas.\n 'hierarchical' => false, //Se pode ser hierarquico com as paginas\n 'menu_position' => 5, //a posicao dele no menu.\n 'supports' => array('title','editor','thumbnail','custom-fields','revisions')//Quais recursos usados no metabox. \n \n);\n\n\nregister_post_type('mine', $args); //aqui se registra um novo tipo de post no wordpress\nflush_rewrite_rules(); //reescreve as regras do wordpress\n\n}", "public static function register_post_type() {\n require('includes/custom/custom-post-type.php'); \n }", "static function register_post_type() {\n\t\tself::$post_type_args['taxonomies'] = self::$taxonomies;\n\n\t\tregister_post_type( self::SLUG, self::$post_type_args );\n\n\t\tregister_post_status('active', array(\n 'label' => __( 'Active', 'mycondo' ),\n 'protected' => true,\n 'label_count' => _n_noop( 'Visitors logged in <span class=\"count\">(%s)</span>', 'Visitors logged in <span class=\"count\">(%s)</span>' ),\n 'show_in_admin_status_list' => true,\n 'show_in_admin_all_list' => true,\n ));\n\n \tregister_post_status('inactive', array(\n 'label' => __( 'Inactive', 'mycondo' ),\n 'protected' => true,\n //'label_count' => _n_noop( 'Visitors logged out <span class=\"count\">(%s)</span>', 'Visitors logged out <span class=\"count\">(%s)</span>' ),\n 'show_in_admin_status_list' => true,\n ));\n\t}", "private function customPostType()\n {\n return [\n 'parent_slug' => 'alecaddd_plugin',\n 'page_title' => 'Custom Post Types',\n 'menu_title' => 'CPT',\n 'capability' => 'manage_options',\n 'menu_slug' => 'alecaddd_cpt',\n 'callback' => function(){echo '<h1>CPT</h1>';},\n ];\n }", "function register_post_types(){\r\n }", "public static function generate_post_type()\n\t\t{\n\t\t\tregister_post_type( 'avia_framework_post', array(\n\t\t\t'labels' => array('name' => 'Avia Framework' ),\n\t\t\t'show_ui' => false,\n\t\t\t'query_var' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => false,\n\t\t\t'supports' => array( 'editor', 'title' ), \n\t\t\t'can_export' => true,\n\t\t\t'public' => true,\n\t\t\t'show_in_nav_menus' => false\n\t\t) );\n\t\t}", "function create_post_type() {\n\n}", "function custom_post_type() {\r\n\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Вариации товаров', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Вариация товара', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'Вариации товаров', 'text_domain' ),\r\n\t\t'name_admin_bar' => __( 'Вариация товара', 'text_domain' ),\r\n\t\t'archives' => __( 'Архивы вариаций', 'text_domain' ),\r\n\t\t'attributes' => __( 'Аттрибуты', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Родительский товар:', 'text_domain' ),\r\n\t\t'all_items' => __( 'Все вариации', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Добавить вариацию', 'text_domain' ),\r\n\t\t'add_new' => __( 'Добавить новую', 'text_domain' ),\r\n\t\t'new_item' => __( 'Новая', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Редактировать', 'text_domain' ),\r\n\t\t'update_item' => __( 'Обновить', 'text_domain' ),\r\n\t\t'view_item' => __( 'Смотреть', 'text_domain' ),\r\n\t\t'view_items' => __( 'Смотреть', 'text_domain' ),\r\n\t\t'search_items' => __( 'Искать', 'text_domain' ),\r\n\t\t'not_found' => __( 'Не найдено', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Не найдено в корзине', 'text_domain' ),\r\n\t\t'featured_image' => __( 'Изображение', 'text_domain' ),\r\n\t\t'set_featured_image' => __( 'Установить изображение', 'text_domain' ),\r\n\t\t'remove_featured_image' => __( 'Удалить изображение', 'text_domain' ),\r\n\t\t'use_featured_image' => __( 'Использовать изображение', 'text_domain' ),\r\n\t\t'insert_into_item' => __( 'Вставить в вариацию', 'text_domain' ),\r\n\t\t'uploaded_to_this_item' => __( 'Загруженные для вариации', 'text_domain' ),\r\n\t\t'items_list' => __( 'Список', 'text_domain' ),\r\n\t\t'items_list_navigation' => __( 'Навигация', 'text_domain' ),\r\n\t\t'filter_items_list' => __( 'Фильтровать', 'text_domain' ),\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'Вариация товара', 'text_domain' ),\r\n\t\t'description' => __( 'Вариация товара', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),\r\n\t\t'taxonomies' => array( 'product' ),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'menu_icon' => 'dashicons-admin-post',\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => false,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'capability_type' => 'page',\r\n\t);\r\n\tregister_post_type( 'product_variation', $args );\r\n\r\n}", "function skwp_custom_post_type_init() {\n\t\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Custom Posts', 'post type general name', 'site-functions' ),\n\t\t\t'singular_name' => _x( 'Custom Post', 'post type singular name', 'site-functions' ),\n\t\t\t'menu_name' => _x( 'Custom Posts', 'admin menu', 'site-functions' ),\n\t\t\t'name_admin_bar' => _x( 'Custom Post', 'add new on admin bar', 'site-functions' ),\n\t\t\t'add_new' => _x( 'Add New', 'custom_post_type', 'site-functions' ),\n\t\t\t'add_new_item' => __( 'Add New Custom Post', 'site-functions' ),\n\t\t\t'new_item' => __( 'New Custom Post', 'site-functions' ),\n\t\t\t'edit_item' => __( 'Edit Custom Post', 'site-functions' ),\n\t\t\t'view_item' => __( 'View Custom Post', 'site-functions' ),\n\t\t\t'all_items' => __( 'All Custom Posts', 'site-functions' ),\n\t\t\t'search_items' => __( 'Search Custom Posts', 'site-functions' ),\n\t\t\t'parent_item_colon' => __( 'Parent Custom Posts:', 'site-functions' ),\n\t\t\t'not_found' => __( 'No Custom Posts found.', 'site-functions' ),\n\t\t\t'not_found_in_trash' => __( 'No Custom Posts found in Trash.', 'site-functions' )\n\t\t);\n\t\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'exclude_from_search'=> false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus'\t => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array('slug' => 'custom-post-type', 'with_front' => false),\n\t\t\t'capability_type' => 'post',\n\t\t\t'taxonomies'\t\t => array(),\n\t\t\t'has_archive' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'show_in_admin_bar'\t => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'menu_icon'\t\t\t => 'dashicons-admin-post',\n\t\t\t'supports' => array('title', 'editor', 'thumbnail')\n\t\t);\n\t\n\t\tregister_post_type('custom_post_type', $args);\n\t\t\n\t}", "static function register_post_type () {\n register_post_type(static::get_post_type(), array(\n 'labels' => array(\n 'name' => ___('External Menus'),\n 'singular_name' => ___('External Menu'),\n 'menu_name' => ___('External Menus'),\n 'name_admin_bar' => __x('External Menu', 'add new on admin bar'),\n\t\t'add_new' => ___('Add New External Menu'),\n\t\t'add_new_item' => ___('Add New External Menu'),\n 'view_item' => ___('View External Menu'),\n 'edit_item' => ___('Edit External Menu'),\n 'all_items' => ___('All External Menus'),\n 'not_found' => ___('No external menus found.'),\n ),\n 'supports' => array('title', 'custom-fields'),\n 'public' => false,\n 'show_ui' => true,\n 'show_in_nav_menus' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-list-view',\n 'capabilities' => static::capabilities_for_edit_but_not_create(),\n 'register_meta_box_cb' => array(get_called_class(),\n 'register_meta_boxes')\n ));\n }", "function postaplicacion(){\n $args = array(\n 'labels'=> array( 'name'=>'aplicacion',\n 'singular_name'=> 'aplicacion',\n 'menu_name'=>'aplicacion',\n 'name_admin_bar'=> 'aplicacion',\n 'all_items' =>'Ver todas las publicaciones',\n 'add_new'=> 'Añadir nueva publicación' ),\n 'description' =>\"Este tipo de post es para aplicacion\",\n 'public' => true,\n 'exclude_from_search'=>false,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_menu'=> true,\n 'show_in_admin_bar'=> true,\n 'menu_position'=>4,\n 'capability_type'=> 'page',\n 'supports'=> array( 'title'),\n 'taxonomies' => array('title', 'codigo', 'marca', 'modelo', 'año', 'motor', 'cilindros', 'caja', 'transmision', 'estilo'),\n 'query_var'=>true,\n );\n register_post_type( \"aplicacion\", $args );\n }", "function crm_post_type() {\t\n\n\t//MAGAZINE\n\t$labels_article = array(\n\t\t'name' => _x( 'Services', 'Post Type General Name', 'crm' ),\n\t\t'singular_name' => _x( 'Service', 'Post Type Singular Name', 'crm' ),\n\t\t'menu_name' => __( 'Services', 'crm' ),\n\t\t'parent_item_colon' => __( 'Page Parent:', 'crm' ),\n\t\t'all_items' => __( 'All Services', 'crm' ),\n\t\t'view_item' => __( 'View Service', 'crm' ),\n\t\t'add_new_item' => __( 'Add New Service', 'crm' ),\n\t\t'add_new' => __( 'Add New', 'crm' ),\n\t\t'edit_item' => __( 'Edit Service', 'crm' ),\n\t\t'update_item' => __( 'Update Service', 'crm' ),\n\t\t'search_items' => __( 'Search Service', 'crm' ),\n\t\t'not_found' => __( 'Not found', 'crm' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'crm' ),\n\t);\n\t$args_article = array(\n\t\t'label' => __( 'Service', 'crm' ),\n\t\t'description' => __( 'Service post type', 'crm' ),\n\t\t'labels' => $labels_article,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),\t\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 6,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\t\n\tregister_post_type( 'service', $args_article );\n\n}", "function register_post_types() {\n\n}", "function custom_post_type() {\n // see: https://codex.wordpress.org/Function_Reference/register_post_type#Usage\n $labels = array( // labels show up on the admin side\n 'name' => _x( 'Post Types', 'Post Type General Name', 'onceonatime' ),\n 'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'onceonatime' ),\n 'menu_name' => __( 'Post Types', 'onceonatime' ),\n 'name_admin_bar' => __( 'Post Type', 'onceonatime' ),\n 'archives' => __( 'Item Archives', 'onceonatime' ),\n 'attributes' => __( 'Item Attributes', 'onceonatime' ),\n 'parent_item_colon' => __( 'Parent Item:', 'onceonatime' ),\n 'all_items' => __( 'All Items', 'onceonatime' ),\n 'add_new_item' => __( 'Add New Item', 'onceonatime' ),\n 'add_new' => __( 'Add New', 'onceonatime' ),\n 'new_item' => __( 'New Item', 'onceonatime' ),\n 'edit_item' => __( 'Edit Item', 'onceonatime' ),\n 'update_item' => __( 'Update Item', 'onceonatime' ),\n 'view_item' => __( 'View Item', 'onceonatime' ),\n 'view_items' => __( 'View Items', 'onceonatime' ),\n 'search_items' => __( 'Search Item', 'onceonatime' ),\n 'not_found' => __( 'Not found', 'onceonatime' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'onceonatime' ),\n 'featured_image' => __( 'Featured Image', 'onceonatime' ),\n 'set_featured_image' => __( 'Set featured image', 'onceonatime' ),\n 'remove_featured_image' => __( 'Remove featured image', 'onceonatime' ),\n 'use_featured_image' => __( 'Use as featured image', 'onceonatime' ),\n 'insert_into_item' => __( 'Insert into item', 'onceonatime' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'onceonatime' ),\n 'items_list' => __( 'Items list', 'onceonatime' ),\n 'items_list_navigation' => __( 'Items list navigation', 'onceonatime' ),\n 'filter_items_list' => __( 'Filter items list', 'onceonatime' ),\n ); // 'onceonatime' or 'text_domain' from style.css\n\n $args = array(\n 'label' => __( 'Post Type', 'onceonatime' ),\n 'description' => __( 'Post Type Description', 'onceonatime' ),\n 'labels' => $labels,\n 'supports' => false,\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'rewrite' => array('slug' => 'custom-post-types'),\n 'supports' => array(\n 'title',\n 'editor',\n 'author',\n 'thumbnail',\n 'excerpt',\n 'comments'\n ),\n ); // slug becomes the URL, don't forget that \"-\" should be used instead of \"_\"\n\n register_post_type( 'post_type_vbs', $args );\n\n}", "function theme_post_type() {\n\t\t$labels_envio = array(\n\t\t\t\t'name' => _x( 'Envios', 'Post Type General Name', THEME_NAME ),\n\t\t\t\t'singular_name' => _x( 'Envio', 'Post Type Singular Name', THEME_NAME ),\n\t\t\t\t'menu_name' => __( 'Envios', THEME_NAME ),\n\t\t\t\t'parent_item_colon' => __( 'Parent Envio:', THEME_NAME ),\n\t\t\t\t'all_items' => __( 'All Envios', THEME_NAME ),\n\t\t\t\t'view_item' => __( 'View Envio', THEME_NAME ),\n\t\t\t\t'add_new_item' => __( 'Add New Envio', THEME_NAME ),\n\t\t\t\t'add_new' => __( 'Add New', THEME_NAME ),\n\t\t\t\t'edit_item' => __( 'Edit Envio', THEME_NAME ),\n\t\t\t\t'update_item' => __( 'Update Envio', THEME_NAME ),\n\t\t\t\t'search_items' => __( 'Search Envio', THEME_NAME ),\n\t\t\t\t'not_found' => __( 'Not found', THEME_NAME ),\n\t\t\t\t'not_found_in_trash' => __( 'Not found in Trash', THEME_NAME ),\n\t\t);\n\t\t$args_envio = array(\n\t\t\t\t'label' => __( 'envio', THEME_NAME ),\n\t\t\t\t'description' => __( 'Tipos de gastos de envio', THEME_NAME ),\n\t\t\t\t'labels' => $labels_envio,\n\t\t\t\t'supports' => array( 'title'),\n\t\t\t\t'taxonomies' => array( 'envio_type'),\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'menu_position' => 57,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'page',\n\t\t\t\t'menu_icon' => 'dashicons-location'\n\t\t);\n\t\tregister_post_type( 'envio', $args_envio );\n\n\n\t\t$labels_reparto = array(\n\t\t\t\t'name' => _x( 'Repartos', 'Post Type General Name', THEME_NAME ),\n\t\t\t\t'singular_name' => _x( 'Reparto', 'Post Type Singular Name', THEME_NAME ),\n\t\t\t\t'menu_name' => __( 'Repartos', THEME_NAME ),\n\t\t\t\t'parent_item_colon' => __( 'Parent reparto:', THEME_NAME ),\n\t\t\t\t'all_items' => __( 'All Repartos', THEME_NAME ),\n\t\t\t\t'view_item' => __( 'View reparto', THEME_NAME ),\n\t\t\t\t'add_new_item' => __( 'Add New reparto', THEME_NAME ),\n\t\t\t\t'add_new' => __( 'Add New', THEME_NAME ),\n\t\t\t\t'edit_item' => __( 'Edit reparto', THEME_NAME ),\n\t\t\t\t'update_item' => __( 'Update reparto', THEME_NAME ),\n\t\t\t\t'search_items' => __( 'Search reparto', THEME_NAME ),\n\t\t\t\t'not_found' => __( 'Not found', THEME_NAME ),\n\t\t\t\t'not_found_in_trash' => __( 'Not found in Trash', THEME_NAME ),\n\t\t);\n\t\t$args_reparto = array(\n\t\t\t\t'label' => __( 'Reparto', THEME_NAME ),\n\t\t\t\t'description' => __( 'Zonas de reparto', THEME_NAME ),\n\t\t\t\t'labels' => $labels_reparto,\n\t\t\t\t'supports' => array( 'title'),\n\t\t\t\t'taxonomies' => array( 'reparto_type'),\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'menu_position' => 57,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'page',\n\t\t\t\t'menu_icon' => 'dashicons-admin-site'\n\t\t);\n\t\tregister_post_type( 'reparto', $args_reparto );\n\t}", "function pluginprefix_setup_post_type()\n{\n register_post_type('ecommerce', ['public' => true]);\n}", "function wk_custom_post_type() {\n\n\t\t\t\t$ctp_name = 'paciente';\n\t\t\t\t$name = 'Paciente';\n\t\t\t\t$names = 'Pacientes';\n\n\t\t\t\t$labels = array(\n\t\t\t\t\t'name' => _x( $names, 'Post Type General Name', 'wpkit_text_domain' ),\n\t\t\t\t\t'singular_name' => _x( $name, 'Post Type Singular Name', 'wpkit_text_domain' ),\n\t\t\t\t\t'menu_name' => __( $names, 'wpkit_text_domain' ),\n\t\t\t\t\t'name_admin_bar' => __( $names, 'wpkit_text_domain' ),\n\t\t\t\t\t'archives' => __( $names, 'wpkit_text_domain' ),\n\t\t\t\t\t'attributes' => __( $names . ' Attributes', 'text_domain' ),\n\t\t\t\t\t// 'parent_item_colon' => __( 'Superior', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'all_items' => __( 'Todo', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'add_new_item' => __( 'Añadir', 'wpkit_text_domain' ),\n\t\t\t\t\t'add_new' => __( 'Nuevo testimonio', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'new_item' => __( 'Nuevo', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'edit_item' => __( 'Editar', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'update_item' => __( 'Actualizar', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'view_item' => __( 'Ver', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'search_items' => __( 'Buscar', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'not_found' => __( 'No se encontró', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'not_found_in_trash' => __( 'No se encontró en la papelera', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'featured_image' => __( 'Imagen destacada', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'set_featured_image' => __( 'Seleccionar como imagen destacada', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'remove_featured_image' => __( 'Quitar imagen destacada', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'use_featured_image' => __( 'Usar como imagen destacada', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'insert_into_item' => __( 'Insertar', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'uploaded_to_this_item' => __( 'Adjuntas a esta publicación', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'items_list' => __( 'Listado de elementos', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'items_list_navigation' => __( 'Navegación por items', 'wpkit_text_domain' ),\n\t\t\t\t\t// 'filter_items_list' => __( 'Filtrar por item en el listado', 'wpkit_text_domain' ),\n\t\t\t\t);\n\t\t\t\t$rewrite = array(\n\t\t\t\t\t'slug' => $ctp_name,\n\t\t\t\t\t'with_front' => true,\n\t\t\t\t\t'pages' => true,\n\t\t\t\t\t'feeds' => true,\n\t\t\t\t);\n\t\t\t\t// Requiere habilitar capabilities para el rol de usuario\n\t\t\t\t// $capabilities = array(\n\t\t\t\t// \t'edit_post' => 'edit_articulo',\n\t\t\t\t// \t'read_post' => 'read_articulo',\n\t\t\t\t// \t'delete_post' => 'delete_articulo',\n\t\t\t\t// \t'edit_posts' => 'edit_articulos',\n\t\t\t\t// \t'edit_others_posts' => 'edit_others_articulos',\n\t\t\t\t// \t'publish_posts' => 'publish_articulos',\n\t\t\t\t// \t'read_private_posts' => 'read_private_articulos',\n\t\t\t\t// \t'create_posts' => 'edit_articulos',\n\t\t\t\t// );\n\t\t\t\t$args = array(\n\t\t\t\t\t'label' => __( $name, 'wpkit_text_domain' ),\n\t\t\t\t\t'description' => __( 'Publicaciones en el sitio', 'wpkit_text_domain' ),\n\t\t\t\t\t'labels' => $labels,\n\t\t\t\t\t'supports' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'editor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'excerpt',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'thumbnail',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'comments',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'trackbacks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'revisions',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'custom-fields',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'page-attributes',\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 'post-formats',\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t// 'taxonomies' => array(\n\t\t\t\t\t// \t\t\t\t\t\t\t\t'post_tag',\n\t\t\t\t\t// \t\t\t\t\t\t\t\t'category'\n\t\t\t\t\t// \t\t\t\t\t\t\t),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t\t'public' => true,\n\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t'menu_position' => 5,\n\t\t\t\t\t'menu_icon' => 'dashicons-admin-post',\n\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t\t'can_export' => true,\n\t\t\t\t\t'has_archive' => true,\n\t\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t\t'rewrite' => $rewrite,\n\t\t\t\t\t// 'capabilities' => $capabilities,\n\t\t\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t\t);\n\t\t\t\tregister_post_type( $ctp_name, $args );\n\n\t\t\t}", "function mds_custom_post_register() {\n $args = array(\n /**\n * A short description of what your post type is. As far as I know, this isn't used anywhere\n * in core WordPress. However, themes may choose to display this on post type archives.\n */\n 'description' => __( 'This is a description for my post type.', 'mds_starter_theme' ), // string\n\n /**\n * Whether the post type should be used publicly via the admin or by front-end users. This\n * argument is sort of a catchall for many of the following arguments. I would focus more\n * on adjusting them to your liking than this argument.\n */\n 'public' => true, // bool (default is FALSE)\n\n /**\n * Whether queries can be performed on the front end as part of parse_request().\n */\n 'publicly_queryable' => true, // bool (defaults to 'public').\n\n /**\n * Whether to exclude posts with this post type from front end search results.\n */\n 'exclude_from_search' => false, // bool (defaults to 'public')\n\n /**\n * Whether individual post type items are available for selection in navigation menus.\n */\n 'show_in_nav_menus' => false, // bool (defaults to 'public')\n\n /**\n * Whether to generate a default UI for managing this post type in the admin. You'll have\n * more control over what's shown in the admin with the other arguments. To build your\n * own UI, set this to FALSE.\n */\n 'show_ui' => true, // bool (defaults to 'public')\n\n /**\n * Whether to show post type in the admin menu. 'show_ui' must be true for this to work.\n */\n 'show_in_menu' => true, // bool (defaults to 'show_ui')\n\n /**\n * Whether to make this post type available in the WordPress admin bar. The admin bar adds\n * a link to add a new post type item.\n */\n 'show_in_admin_bar' => true, // bool (defaults to 'show_in_menu')\n\n /**\n * The position in the menu order the post type should appear. 'show_in_menu' must be true\n * for this to work.\n */\n 'menu_position' => null, // int (defaults to 25 - below comments)\n\n /**\n * The URI to the icon to use for the admin menu item. There is no header icon argument, so\n * you'll need to use CSS to add one.\n */\n 'menu_icon' => null, // string (defaults to use the post icon)\n\n /**\n * Whether the posts of this post type can be exported via the WordPress import/export plugin\n * or a similar plugin.\n */\n 'can_export' => true, // bool (defaults to TRUE)\n\n /**\n * Whether to delete posts of this type when deleting a user who has written posts.\n */\n 'delete_with_user' => false, // bool (defaults to TRUE if the post type supports 'author')\n\n /**\n * Whether this post type should allow hierarchical (parent/child/grandchild/etc.) posts.\n */\n 'hierarchical' => false, // bool (defaults to FALSE)\n\n /**\n * Whether the post type has an index/archive/root page like the \"page for posts\" for regular\n * posts. If set to TRUE, the post type name will be used for the archive slug. You can also\n * set this to a string to control the exact name of the archive slug.\n */\n 'has_archive' => 'custom-post-type', // bool|string (defaults to FALSE)\n\n /**\n * Sets the query_var key for this post type. If set to TRUE, the post type name will be used.\n * You can also set this to a custom string to control the exact key.\n */\n 'query_var' => 'custom-post-type', // bool|string (defaults to TRUE - post type name)\n\n /**\n * A string used to build the edit, delete, and read capabilities for posts of this type. You\n * can use a string or an array (for singular and plural forms). The array is useful if the\n * plural form can't be made by simply adding an 's' to the end of the word. For example,\n * array( 'box', 'boxes' ).\n */\n 'capability_type' => 'post', // string|array (defaults to 'post')\n\n /**\n * Whether WordPress should map the meta capabilities (edit_post, read_post, delete_post) for\n * you. If set to FALSE, you'll need to roll your own handling of this by filtering the\n * 'map_meta_cap' hook.\n */\n 'map_meta_cap' => true, // bool (defaults to FALSE)\n\n /**\n * Provides more precise control over the capabilities than the defaults. By default, WordPress\n * will use the 'capability_type' argument to build these capabilities. More often than not,\n * this results in many extra capabilities that you probably don't need. \n */\n 'capabilities' => array( ),\n\n /**\n * How the URL structure should be handled with this post type. You can set this to an\n * array of specific arguments or true|false. If set to FALSE, it will prevent rewrite\n * rules from being created.\n */\n 'rewrite' => array(\n\n /* The slug to use for individual posts of this type. */\n 'slug' => 'custom-post-type', // string (defaults to the post type name)\n\n /* Whether to show the $wp_rewrite->front slug in the permalink. */\n 'with_front' => false, // bool (defaults to TRUE)\n\n /* Whether to allow single post pagination via the <!--nextpage--> quicktag. */\n 'pages' => true, // bool (defaults to TRUE)\n\n /* Whether to create feeds for this post type. */\n 'feeds' => true, // bool (defaults to the 'has_archive' argument)\n\n /* Assign an endpoint mask to this permalink. */\n 'ep_mask' => EP_PERMALINK, // const (defaults to EP_PERMALINK)\n ),\n\n /**\n * What WordPress features the post type supports. Many arguments are strictly useful on\n * the edit post screen in the admin. However, this will help other themes and plugins\n * decide what to do in certain situations. You can pass an array of specific features or\n * set it to FALSE to prevent any features from being added. You can use\n * add_post_type_support() to add features or remove_post_type_support() to remove features\n * later. The default features are 'title' and 'editor'.\n */\n 'supports' => array(\n\n /* Post titles ($post->post_title). */\n 'title',\n\n /* Post content ($post->post_content). */\n 'editor',\n\n /* Post excerpt ($post->post_excerpt). */\n 'excerpt',\n\n /* Post author ($post->post_author). */\n 'author',\n\n /* Featured images (the user's theme must support 'post-thumbnails'). */\n 'thumbnail',\n\n /* Displays comments meta box. If set, comments (any type) are allowed for the post. */\n 'comments',\n\n /* Displays meta box to send trackbacks from the edit post screen. */\n 'trackbacks',\n\n /* Displays the Custom Fields meta box. Post meta is supported regardless. */\n 'custom-fields',\n\n /* Displays the Revisions meta box. If set, stores post revisions in the database. */\n 'revisions',\n\n /* Displays the Attributes meta box with a parent selector and menu_order input box. */\n 'page-attributes',\n\n /* Displays the Format meta box and allows post formats to be used with the posts. */\n 'post-formats',\n ),\n\n /**\n * Labels used when displaying the posts in the admin and sometimes on the front end. These\n * labels do not cover post updated, error, and related messages. You'll need to filter the\n * 'post_updated_messages' hook to customize those.\n */\n 'labels' => array(\n 'name' => __( 'Custom Posts', 'mds_starter_theme' ),\n 'singular_name' => __( 'Custom Post', 'mds_starter_theme' ),\n 'menu_name' => __( 'Custom Posts', 'mds_starter_theme' ),\n 'name_admin_bar' => __( 'Custom Posts', 'mds_starter_theme' ),\n 'add_new' => __( 'Add New', 'mds_starter_theme' ),\n 'add_new_item' => __( 'Add New Custom Post', 'mds_starter_theme' ),\n 'edit_item' => __( 'Edit Custom Post', 'mds_starter_theme' ),\n 'new_item' => __( 'New Custom Post', 'mds_starter_theme' ),\n 'view_item' => __( 'View Custom Post', 'mds_starter_theme' ),\n 'search_items' => __( 'Search Custom Posts', 'mds_starter_theme' ),\n 'not_found' => __( 'No custom Posts found', 'mds_starter_theme' ),\n 'not_found_in_trash' => __( 'No custom Posts found in trash', 'mds_starter_theme' ),\n 'all_items' => __( 'All Custom Posts', 'mds_starter_theme' ),\n\n /* Labels for hierarchical post types only. */\n 'parent_item' => __( 'Parent Custom Post', 'mds_starter_theme' ),\n 'parent_item_colon' => __( 'Parent Custom Post:', 'mds_starter_theme' ),\n\n /* Custom archive label. Must filter 'post_type_archive_title' to use. */\n 'archive_title' => __( 'Custom Posts', 'mds_starter_theme' ),\n ),\n\n /**\n * Provide a callback function that will be called when setting up the meta boxes for the edit form.\n * The callback function takes one argument $post, which contains the WP_Post object for the currently edited post.\n * Do remove_meta_box() and add_meta_box() calls in the callback.\n */\n 'register_meta_box_cb' => '',\n\n /**\n * An array of registered taxonomies like category or post_tag that will be used with this post type.\n * This can be used in lieu of calling register_taxonomy_for_object_type() directly.\n * Custom taxonomies still need to be registered with register_taxonomy().\n */\n 'taxonomies' => array(\n /*Add Category taxonomy*/\n 'category',\n /*Add Tags taxonomy*/\n 'post_tag',\n /*Add Post Format taxonomy*/\n 'post_format'\n ),\n\n /**\n * Whether to expose this post type in the REST API.\n */\n 'show_in_rest' => false,\n\n /**\n * The base slug that this post type will use when accessed using the REST API.\n */\n 'rest_base' => 'custom-post-type',\n\n /**\n * An optional custom controller to use instead of WP_REST_Posts_Controller.\n * Must be a subclass of WP_REST_Controller.\n */\n 'rest_controller_class' => 'WP_REST_Posts_Controller'\n\n );\n\n /**\n * Register the post type. \n */\n register_post_type(\n 'custom-post-type', // Post type name. Max of 20 characters. Uppercase and spaces not allowed.\n $args // Arguments for post type.\n );\n}", "function postarticulos(){\n $args = array(\n 'labels'=> array( 'name'=>'articulos',\n 'singular_name'=> 'articulos',\n 'menu_name'=>'articulos',\n 'name_admin_bar'=> 'articulos',\n 'all_items' =>'Ver todas las publicaciones',\n 'add_new'=> 'Añadir nueva publicación' ),\n 'description' =>\"Este tipo de post es para articulos\",\n 'public' => true,\n 'exclude_from_search'=>false,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_menu'=> true,\n 'show_in_admin_bar'=> true,\n 'menu_position'=>4,\n 'capability_type'=> 'page',\n 'supports'=> array( 'title', 'excerpt'),\n 'taxonomies' => array( 'codigo', 'grupo', 'existencia', 'aplicacion1', 'aplicacion2', 'aplicacion3', 'precioa', 'preciob', 'precioc', 'preciod', 'codalt1', 'codalt2', 'codalt3', 'codalt4', 'codalt5', 'presentacion', 'procedencia', 'fabricacion', 'marca' ),\n 'query_var'=>true,\n );\n register_post_type( \"articulos\", $args );\n }", "function halim_custome_posts(){\n \tregister_post_type( 'sliders', array( \n \t\t'labels'=>array(\n \t\t\t'name' => __('Sliders','halim'),\n \t\t\t'singular_name' => __('Slider','halim')\n \t\t),\n \t\t'public' => true,\n \t\t'supports' => array('title','editor','thumbnail','custom-fields')\n\n ));\n//Customs posts for services\n register_post_type( 'services', array( \n \t\t'labels'=>array(\n \t\t\t'name' => __('Services','halim'),\n \t\t\t'singular_name' => __('Service','halim')\n \t\t),\n \t\t'public' => true,\n \t\t'supports' => array('title','editor','custom-fields')\n\n ));\n\n //Customs posts for team\n register_post_type( 'teams', array( \n \t\t'labels'=>array(\n \t\t\t'name' => __('Teams','halim'),\n \t\t\t'singular_name' => __('Team','halim')\n \t\t),\n \t\t'public' => true,\n \t\t'supports' => array('title','editor','thumbnail','custom-fields','page-attributes')\n\n ));\n\n //Customs posts for testimonials\n register_post_type( 'testimonials', array( \n \t\t'labels'=>array(\n \t\t\t'name' => __('Testimonials','halim'),\n \t\t\t'singular_name' => __('Testimonial','halim')\n \t\t),\n \t\t'public' => true,\n \t\t'supports' => array('title','thumbnail','custom-fields','page-attributes')\n\n ));\n }", "function myplugin_settings() {\r\nregister_taxonomy_for_object_type('post_tag', 'page'); \r\n// Add category metabox to page\r\nregister_taxonomy_for_object_type('category', 'page'); \r\n}", "public function register_custom_post_type() {\n $labels = array(\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Ping',\n 'edit_item' => 'Edit Ping',\n 'name' => 'Pings',\n 'new_item' => 'New Ping',\n 'not_found' => 'No pings found',\n 'not_found_in_trash' => 'No pings found in Trash',\n 'parent_item_colon' => '',\n 'search_items' => 'Search Pings',\n 'singular_name' => 'Ping',\n 'view_item' => 'View Ping',\n );\n\n $args = array(\n 'capability_type' => 'post',\n 'exclude_from_search' => false,\n 'hierarchical' => false,\n 'labels' => $labels,\n 'menu_icon' => PCUSU_HTTP_PATH . '/images/pingfm-logo-menu.png',\n 'menu_position' => null,\n 'publicly_queryable' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => self::CUSTOM_POST_TYPE, 'with_front' => false),\n 'show_in_nav_menus' => true,\n 'show_ui' => true,\n 'supports' => array('title', 'editor', 'author', 'thumbnail'),\n );\n\n register_post_type(self::CUSTOM_POST_TYPE, $args);\n }", "public function init()\n\t{\n\t\tadd_post_type_support( 'page', PB_POST_TYPE_FEATURE );\n\t}", "function service_custom_post_type() {\n $args['post-type-service'] = array(\n 'labels' => array(\n 'name' => __( 'Услуги', 'ggeugene' ),\n 'singular_name' => __( 'Услуга', 'ggeugene' ),\n 'all_items' => 'Все Услуги',\n 'add_new' => __( 'Добавить Новую', 'ggeugene' ),\n 'add_new_item' => __( 'Добавить новую Услугу', 'ggeugene' ),\n 'edit_item' => __( 'Изменить Услугу', 'ggeugene' ),\n 'new_item' => __( 'Новая Усулга', 'ggeugene' ),\n 'view_item' => __( 'Просмотреть Услугу', 'ggeugene' ),\n 'search_items' => __( 'Искать Услуги', 'ggeugene' ),\n 'not_found' => __( 'Услуги не найдены', 'ggeugene' ),\n 'not_found_in_trash' => __( 'Услуги не найдены в корзине', 'ggeugene' ),\n 'parent_item_colon' => __( 'Родительская Услуга:', 'ggeugene' ),\n 'menu_name' => __( 'Услуги', 'ggeugene' ),\n ),\n 'hierarchical' => true,\n 'description' => 'Добавьте Услуги',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'excerpt', 'page-attributes' ),\n 'taxonomies' => array('service_cats'),\n 'menu_icon' => 'dashicons-format-aside',\n 'show_ui' => true,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => false,\n 'capability_type' => 'post',\n 'query_var' => 'service',\n 'menu_position' => 20,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'uslugi', 'with_front' => true)\n );\n register_post_type('service', $args['post-type-service']);\n $taxonomies = array();\n $taxonomies['taxonomy-service_cats'] = array(\n 'labels' => array(\n 'name' => __( 'Категории Услуг', 'ggeugene' ),\n 'singular_name' => __( 'Категория Услуг', 'ggeugene' ),\n 'search_items' => __( 'Найти категории Услуг', 'ggeugene' ),\n 'all_items' => __( 'Все категории Услуг', 'ggeugene' ),\n 'parent_item' => __( 'Родительская категория Услуг', 'ggeugene' ),\n 'parent_item_colon' => __( 'Родительская категория Услуг:', 'ggeugene' ),\n 'edit_item' => __( 'Изменить категорию Услуг', 'ggeugene' ),\n 'update_item' => __( 'Обновить категорию Услуг', 'ggeugene' ),\n 'add_new_item' => __( 'Добавить новую ', 'ggeugene' ),\n 'new_item_name' => __( 'Новое имя категории Услуг', 'ggeugene' ),\n 'choose_from_most_used'\t=> __( 'Выберите категорию Услуг из самых популярных', 'ggeugene' )\n ),\n 'hierarchical' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => '' )\n );\n /* Register taxonomy: name, cpt, arguments */\n register_taxonomy('service_cats', array('service'), $taxonomies['taxonomy-service_cats']);\n register_taxonomy_for_object_type('service_cats', 'service');\n }", "public static function register_post_type() {\n\t\tregister_post_type( self::POST_TYPE_NAME, self::POST_TYPE_SETTINGS );\n\t}", "function suffusion_set_custom_post_type_globals() {\r\n\tglobal $suffusion_post_type_options, $suffusion_post_type_labels, $suffusion_post_type_args, $suffusion_post_type_supports;\r\n\t$suffusion_post_type_options = array(\r\n\t\tarray('name' => 'post_type', 'type' => 'text', 'desc' => 'Post Type (e.g. book)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'style_inherit', 'type' => 'select', 'desc' => 'Inherit styles from:', 'std' => 'post',\r\n\t\t\t'options' => array('post' => 'Post - will get styles for Posts', 'page' => 'Page - will get styles for Pages', 'custom' => 'Custom - define your own styles')),\r\n\t);\r\n\r\n\t$suffusion_post_type_labels = array(\r\n\t\tarray('name' => 'name', 'type' => 'text', 'desc' => 'Name (e.g. Books)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'singular_name', 'type' => 'text', 'desc' => 'Singular Name (e.g. Book)', 'std' => '', 'reqd' => true),\r\n\t\tarray('name' => 'add_new', 'type' => 'text', 'desc' => 'Text for \"Add New\" (e.g. Add New)', 'std' => ''),\r\n\t\tarray('name' => 'add_new_item', 'type' => 'text', 'desc' => 'Text for \"Add New Item\" (e.g. Add New Book)', 'std' => ''),\r\n\t\tarray('name' => 'edit_item', 'type' => 'text', 'desc' => 'Text for \"Edit Item\" (e.g. Edit Book)', 'std' => ''),\r\n\t\tarray('name' => 'new_item', 'type' => 'text', 'desc' => 'Text for \"New Item\" (e.g. New Book)', 'std' => ''),\r\n\t\tarray('name' => 'view_item', 'type' => 'text', 'desc' => 'Text for \"View Item\" (e.g. View Book)', 'std' => ''),\r\n\t\tarray('name' => 'search_items', 'type' => 'text', 'desc' => 'Text for \"Search Items\" (e.g. Search Books)', 'std' => ''),\r\n\t\tarray('name' => 'not_found', 'type' => 'text', 'desc' => 'Text for \"Not found\" (e.g. No Books Found)', 'std' => ''),\r\n\t\tarray('name' => 'not_found_in_trash', 'type' => 'text', 'desc' => 'Text for \"Not found in Trash\" (e.g. No Books Found in Trash)', 'std' => ''),\r\n\t\tarray('name' => 'parent_item_colon', 'type' => 'text', 'desc' => 'Parent Text with a colon (e.g. Book Series:)', 'std' => ''),\r\n\t);\r\n\r\n\t$suffusion_post_type_args = array(\r\n\t\tarray('name' => 'public', 'desc' => 'Public', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'publicly_queryable', 'desc' => 'Publicly Queriable', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'show_ui', 'desc' => 'Show UI', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'query_var', 'desc' => 'Query Variable', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'rewrite', 'desc' => 'Rewrite', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'hierarchical', 'desc' => 'Hierarchical', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'exclude_from_search', 'desc' => 'Exclude from Search', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'show_in_nav_menus', 'desc' => 'Show in Navigation menus', 'type' => 'checkbox', 'default' => true),\r\n\t\tarray('name' => 'menu_position', 'desc' => 'Menu Position', 'type' => 'text', 'default' => null),\r\n\t);\r\n\r\n\t$suffusion_post_type_supports = array(\r\n\t\tarray('name' => 'title', 'desc' => 'Title', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'editor', 'desc' => 'Editor', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'author', 'desc' => 'Author', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'thumbnail', 'desc' => 'Thumbnail', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'excerpt', 'desc' => 'Excerpt', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'trackbacks', 'desc' => 'Trackbacks', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'custom-fields', 'desc' => 'Custom Fields', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'comments', 'desc' => 'Comments', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'revisions', 'desc' => 'Revisions', 'type' => 'checkbox', 'default' => false),\r\n\t\tarray('name' => 'page-attributes', 'desc' => 'Page Attributes', 'type' => 'checkbox', 'default' => false),\r\n\t);\r\n}", "function WPseo_Metabox() {\n // get core post types\n $core_args = array(\n 'public' => true,\n '_builtin' => true\n );\n $core_pt = get_post_types( $core_args );\n // get custom post types\n $custom_args = array(\n 'public' => true,\n 'publicly_queryable' => true\n );\n $custom_pt = get_post_types( $custom_args );\n // merge & clean post types\n $post_types = array_merge($core_pt, $custom_pt);\n unset($post_types['attachment']);\n // register meta box for all selected post types\n foreach( $post_types as $post_type ){\n add_meta_box(\n 'WPseo_page_DataStructure',\n __( 'Add data structure', 'WPseo' ),\n array($this, 'WPtemplate_pageoptions'),\n $post_type,\n 'side',\n 'low'\n );\n }\n }", "function ga_events_post_type() {\n $labels = array(\n 'name' => _x( 'Events', 'Post Type General Name', 'gourmet-artist' ),\n 'singular_name' => _x( 'Event', 'Post Type Singular Name', 'gourmet-artist' ),\n 'menu_name' => __( 'Events', 'gourmet-artist' ),\n 'parent_item_colon' => __( 'Parent Event', 'gourmet-artist' ),\n 'all_items' => __( 'All Events', 'gourmet-artist' ),\n 'view_item' => __( 'View Event', 'gourmet-artist' ),\n 'add_new_item' => __( 'Add New Event', 'gourmet-artist' ),\n 'add_new' => __( 'Add New Event', 'gourmet-artist' ),\n 'edit_item' => __( 'Edit Event', 'gourmet-artist' ),\n 'update_item' => __( 'Update Event', 'gourmet-artist' ),\n 'search_items' => __( 'Search Event', 'gourmet-artist' ),\n 'not_found' => __( 'No events found', 'gourmet-artist' ),\n 'not_found_in_trash' => __( 'Not found in trash', 'gourmet-artist' ),\n );\n\n // Another Customizations\n $args = array(\n 'label' => __('Events','gourmet-artist' ),\n 'description' => __('Events for Gourmet Artistry', 'gourmet-artist'),\n 'labels' => $labels,\n 'supports' => array('title', 'editor',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menus' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 6,\n 'menu_icon' => 'dashicons-calendar-alt',\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'capability_type' => 'page',\n );\n\n // register the post Type\n register_post_type( 'events', $args);\n}", "function registerCustomPosts(){\r\n register_post_type('frontpage-post-1', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 1'),\r\n\t\t'description' => 'Primeiro post da página inicial',\r\n 'public' => true,\r\n 'menu_position' => 3,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n\tregister_post_type('frontpage-post-2', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 2'),\r\n\t\t'description' => 'Segundo post da página inicial',\r\n 'public' => true,\r\n 'menu_position' => 4,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n\tregister_post_type('frontpage-post-3', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 3'),\r\n\t\t'description' => 'Terceiro post da página inicial',\r\n 'public' => true,\r\n 'menu_position' => 5,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n\tregister_post_type('frontpage-post-4', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 4'),\r\n\t\t'description' => 'Quarto post da página inicial (carrosel)',\r\n 'public' => true,\r\n 'menu_position' => 6,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n register_post_type('frontpage-post-5', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 5'),\r\n\t\t'description' => 'Quinto post da página inicial',\r\n 'public' => true,\r\n 'menu_position' => 7,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n register_post_type('frontpage-post-6', array(\r\n 'labels' => array('name' => 'Pág. Inicial: Post 6'),\r\n\t\t'description' => 'Sexto post da página inicial',\r\n 'public' => true,\r\n 'menu_position' => 8,\r\n 'supports' => array('title', 'editor')\r\n ));\r\n register_post_type('innerpage-post-1', array(\r\n 'labels' => array('name' => 'Pág. Interna: Post 1'),\r\n\t\t'description' => 'Primeiro post da página interna',\r\n 'public' => true,\r\n 'menu_position' => 9,\r\n 'supports' => array('title', 'thumbnail')\r\n ));\r\n register_post_type('innerpage-post-2', array(\r\n 'labels' => array('name' => 'Pág. Interna: Post 2'),\r\n\t\t'description' => 'Segundo post da página interna',\r\n 'public' => true,\r\n 'menu_position' => 9,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n ));\r\n register_post_type('innerpage-post-3', array(\r\n 'labels' => array('name' => 'Pág. Interna: Post 3'),\r\n\t\t'description' => 'Terceiro post da página interna',\r\n 'public' => true,\r\n 'menu_position' => 10,\r\n 'supports' => array('title', 'editor')\r\n ));\r\n}", "function custom_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Portfolios', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Portfolio', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Portfolio', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Portfolio', 'text_domain' ),\n\t\t'archives' => __( 'Portfolio Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Portfolio Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Portfolio:', 'text_domain' ),\n\t\t'all_items' => __( 'All Portfolios', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add Portfolio', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Portfolio', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Portfolio', 'text_domain' ),\n\t\t'update_item' => __( 'Update Portfolio', 'text_domain' ),\n\t\t'view_item' => __( 'View Portfolio', 'text_domain' ),\n\t\t'view_items' => __( 'View Portfolio', 'text_domain' ),\n\t\t'search_items' => __( 'Search Portfolios', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Portfolio', 'text_domain' ),\n\t\t'description' => __( 'Post Type Description', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes', 'post-formats', 'excerpt' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'Portfolio', $args );\n\n}", "function themename_custom_post() {\n \n register_post_type( 'book', array(\n 'labels' => array(\n 'name' => 'Book',\n 'add_new_item' => __( 'Add New Book', 'textdomain' ),\n ),\n 'public' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'menu_position' => 7,\n 'menu_icon' => 'dashicons-welcome-widgets-menus',\n ) );\n \n}", "function register_post_types() {\n\n\n\t}", "public function adicionarCustomPostType(){\n $labels = array(\n 'name' => ucwords($this->nome_singular),\n 'nome_singular' => ucwords($this->nome_singular),\n 'menu_name' => ucwords($this->nome_plural),\n 'name_admin_bar' => ucwords($this->nome_singular),\n 'add_new' => ucwords($this->nome_singular),\n 'add_new_item' => 'Add New ' . ucwords($this->nome_singular),\n 'new_item' => 'New ' . ucwords($this->nome_singular),\n 'edit_item' => 'Edit ' . ucwords($this->nome_singular),\n 'view_item' => 'View ' . ucwords($this->nome_plural),\n 'all_items' => 'All ' . ucwords($this->nome_plural),\n 'search_items' => 'Search ' . ucwords($this->nome_plural),\n 'parent_item_colon' => 'Parent ' . ucwords($this->nome_plural) . ':', \n 'not_found' => 'No ' . ucwords($this->nome_plural) . ' found.', \n 'not_found_in_trash' => 'No ' . ucwords($this->nome_plural) . ' found in Trash.',\n );\n \n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_nav' => true,\n 'query_var' => true,\n 'hierarchical' => false,\n 'supports' => array('title','editor','thumbnail'), \n 'has_archive' => true,\n 'menu_position' => 20,\n 'show_in_admin_bar' => true,\n 'menu_icon' => 'dashicons-format-status'\n );\n \n register_post_type($this->post_slug, $args);\n \n }", "function sample_custom_post_type(){\n\n\t\t$labels\t=\tarray(\n\t\t'name'\t\t\t=>\t'portfolio',\n\t\t'singular_name'\t=>\t'Add portfolio',\n\t\t'add_new'\t\t=>\t'Add portfolio',\n\t\t'add_new_item'\t=>\t'Add New portfolio',\n\t\t'edit_item'\t\t=>\t'Edit Item',\n\t\t'new_item'\t\t=>\t'New Item',\n\t\t'view_item'\t\t=>\t'View Item',\n\t\t'search_item'\t=>\t'Search Portfolio',\n\t\t'not_found'\t\t=>\t'No Items Found',\n\t\t'not_found_in_trash'=>\t'No item found in trash',\n\t\t'parent_item_colon'\t=>\t'Parent Item'\n\t\t);\n\t\t$arg = array(\n\t\t\t'labels'\t\t\t\t=>\t$labels,\n\t\t\t'public'\t\t\t\t=>\ttrue,\n\t\t\t'has_archive'\t\t\t=>\ttrue,\n\t\t\t'publicly_queryable'\t=>\ttrue,\n\t\t\t'query_var'\t\t\t\t=>\ttrue,\n\t\t\t'rewrite'\t\t\t\t=>\ttrue,\n\t\t\t'capability_type'\t\t=>\t'post',\n\t\t\t'hierarchical'\t\t\t=>\tfalse,\n\t\t\t'supports'\t\t\t\t=>\tarray(\n\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'thumbnail',\n\t\t\t\t'revisions',\n\t\t\t\t),\n\t\t\t//'taxonomies'\t=>array('category','post_tag'),\n\t\t\t'menu_position'\t=>5,\n\t\t\t'exclude_form_search'=>false\n\t\t\t);\n\t\tregister_post_type('portfolio',$arg);\n\t\t\t\n\t}", "function orangepaper_posts_types() {\n register_post_type('orangepaper',\n array(\n 'labels' => array(\n 'name' => __('Orange Paper'),\n 'name_singular' => __('Orange Paper'),\n 'add_new_item' => __('Adicionar um Orange Paper || Utilize o botão Adicionar Mídia para subir o PDF e adicione a mídia'),\n 'edit_item' => __('Editar Orange Paper'),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-analytics',\n 'menu_position' => 7,\n 'supports' => array (\n 'title',\n 'editor',\n 'thumbnail',\n 'page-attributes',\n 'custom-fields'\n ),\n )\n );\n }", "public function create_post_type() {\n\n $labels = array(\n \n 'name' => __( 'Project Updates', WPG_TEXTDOMAIN ),\n 'singular_name' => __( 'Project Update', WPG_TEXTDOMAIN ), \n 'add_new' => __( 'Add New Project Update', WPG_TEXTDOMAIN ),\n 'add_new_item' => __( 'Add New Ovoid Project Update', WPG_TEXTDOMAIN ),\n 'edit_item' => __( 'Edit Ovoid Project Update', WPG_TEXTDOMAIN ),\n 'new_item' => __( 'Add New Ovoid Project Update', WPG_TEXTDOMAIN ),\n 'view_item' => __( 'View Ovoid Project Update', WPG_TEXTDOMAIN ),\n 'search_items' => __( 'Search Ovoid Project Updates', WPG_TEXTDOMAIN ),\n 'not_found' => __( 'No Ovoid Project Updates found', WPG_TEXTDOMAIN ),\n 'not_found_in_trash' => __( 'No Ovoid Project Updates found in trash', WPG_TEXTDOMAIN )\n );\n\n register_post_type( $this->custom_type,\n array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => $this->custom_type),\n 'supports' => array( 'title','editor','thumbnail' ),\n \n )\n );\n }", "function register_post_types() {\r\n }", "function register_types(){\r\n register_post_type(\r\n 'show',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Show Pages'),\r\n 'singular_name' => __('Show Pages'),\r\n 'name_admin_bar' => __('Show Pages'),\r\n 'edit_item' => __('Edit Show Pages'),\r\n 'add_new_item' => __('Add New Show Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page',\r\n \r\n \r\n )\r\n );\r\n\r\n register_post_type(\r\n 'attendees',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Attendees Pages'),\r\n 'singular_name' => __('Attendees Pages'),\r\n 'name_admin_bar' => __('Attendees Pages'),\r\n 'edit_item' => __('Edit Attendees Pages'),\r\n 'add_new_item' => __('Add New Attendees Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n register_post_type(\r\n 'exhibitors',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Exhibitors Pages'),\r\n 'singular_name' => __('Exhibitors Pages'),\r\n 'name_admin_bar' => __('Exhibitors Pages'),\r\n 'edit_item' => __('Edit Exhibitors Pages'),\r\n 'add_new_item' => __('Add New Exhibitors Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n register_post_type(\r\n 'conference',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Conference Pages'),\r\n 'singular_name' => __('Conference Pages'),\r\n 'name_admin_bar' => __('Conference Pages'),\r\n 'edit_item' => __('Edit Conference Pages'),\r\n 'add_new_item' => __('Add New Conference Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page',\r\n )\r\n );\r\n register_post_type(\r\n 'events',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Events Pages'),\r\n 'singular_name' => __('Events Pages'),\r\n 'name_admin_bar' => __('Events Pages'),\r\n 'edit_item' => __('Edit Events Pages'),\r\n 'add_new_item' => __('Add New Events Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page',\r\n )\r\n );\r\n register_post_type(\r\n 'hotel_travel',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Hotel & Travel Pages'),\r\n 'singular_name' => __('Hotel & Travel Pages'),\r\n 'name_admin_bar' => __('Hotel & Travel Pages'),\r\n 'edit_item' => __('Edit Hotel & Travel Pages'),\r\n 'add_new_item' => __('Add New Hotel & Travel Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, 'themes', 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n \r\n register_post_type(\r\n 'media',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Media Pages'),\r\n 'singular_name' => __('Media Pages'),\r\n 'name_admin_bar' => __('Media Pages'),\r\n 'edit_item' => __('Edit Media Pages'),\r\n 'add_new_item' => __('Add New Media Pages')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => true,\r\n 'supports' => array('thumbnail', title, editor, themes, 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n\r\n register_post_type(\r\n 'faq',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('FAQs'),\r\n 'singular_name' => __('FAQs'),\r\n 'name_admin_bar' => __('FAQs'),\r\n 'edit_item' => __('Edit FAQs'),\r\n 'add_new_item' => __('Add New FAQs')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, wps_subtitle, 'themes', 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n\r\n register_post_type(\r\n 'promo-opp',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Promotional Opportunities'),\r\n 'singular_name' => __('Promotional Opportunities'),\r\n 'name_admin_bar' => __('Promotional Opportunities'),\r\n 'edit_item' => __('Edit Promotional Opportunities'),\r\n 'add_new_item' => __('Add New Promotional Opportunities')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, wps_subtitle, 'themes', 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n register_post_type(\r\n 'partner-events',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Partner Events'),\r\n 'singular_name' => __('Partner Events'),\r\n 'name_admin_bar' => __('Partner Events'),\r\n 'edit_item' => __('Edit Partner Events'),\r\n 'add_new_item' => __('Add New Partner Events')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, wps_subtitle, 'themes', 'revisions'),\r\n 'capability_type' => 'page'\r\n )\r\n );\r\n register_post_type(\r\n 'press-release',\r\n // CPT Options\r\n array(\r\n 'labels' => array(\r\n 'name' => __('Press Releases'),\r\n 'singular_name' => __('Press Release'),\r\n 'name_admin_bar' => __('Press Release'),\r\n 'edit_item' => __('Edit Press Release'),\r\n 'add_new_item' => __('Add New Press Releases')\r\n ),\r\n 'public' => true,\r\n\t 'menu_icon' => '',\r\n 'has_archive' => false,\r\n 'supports' => array('thumbnail', title, editor, wps_subtitle, 'themes', 'revisions'),\r\n 'capability_type' => 'page',\r\n 'taxonomies' => array('category')\r\n )\r\n );\r\n\tflush_rewrite_rules();\r\n}", "private function registerPostType() {\n\n $menuPosition = 5;\n $menuIcon = 'dashicons-admin-post';\n $slug = $this->base;\n\n if ( klippe_core_theme_installed() ) {\n if ( klippe_mikado_options()->getOptionValue( 'event_single_slug' ) ) {\n $slug = klippe_mikado_options()->getOptionValue( 'event_single_slug' );\n }\n }\n\n register_post_type( $this->base,\n array(\n 'labels' => array(\n 'name' => esc_html__( 'Mikado Events', 'klippe-core' ),\n 'singular_name' => esc_html__( 'Mikado Event', 'klippe-core' ),\n 'add_item' => esc_html__( 'New Mikado Event', 'klippe-core' ),\n 'add_new_item' => esc_html__( 'Add New Event', 'klippe-core' ),\n 'edit_item' => esc_html__( 'Edit Event', 'klippe-core' )\n ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array( 'slug' => $slug ),\n 'menu_position' => $menuPosition,\n 'show_ui' => true,\n 'supports' => array(\n 'author',\n 'title',\n 'editor',\n 'thumbnail',\n 'excerpt',\n 'page-attributes',\n 'comments'\n ),\n 'menu_icon' => $menuIcon\n )\n );\n }", "function your_custom_post_type() { // rename function to reflect name of your post type\n\n\t$labels = array( // change array values to reflect custom post type\n\t\t'name'\t\t\t=> 'Post Type Name',\n\t\t'singular_name'\t=> 'Post Type Name Singular',\n\t\t'add_new'\t\t=> 'Add New',\n\t\t'add_new_item'\t=> 'Add New Item',\n\t\t'edit_item'\t\t=> 'Edit Item',\n\t\t'new_item'\t\t=> 'New Item',\n\t\t'all_items'\t\t=> 'All Items',\n\t\t'view_item'\t\t=> 'View Item',\n\t\t'search_items'\t\t=> 'Search Items',\n\t\t'not_round'\t\t=> 'Item Not Found',\n\t\t'not_found_in_trash'\t=> 'Item Not Found In Trash',\n\t\t'parent_item_colon'\t=> '', \n\t\t'menu_name'\t\t=> 'Post Type Name'\n\t\t);\n\n\n\t$supports = array( \n\t\t// list of Wordpress functions that appear in post type editing page - add or remove functions as needed\n\t\t'title',\n\t\t'editor',\n\t\t'thumbnail',\n\t\t'custom-fields',\n\t\t'page-attributes'\n\t\t);\n\n\t$args = array(\n\t\t'labels'\t\t\t=> $lables,\n\t\t'description'\t\t=> 'A description of your custom post type.',\n\t\t'public'\t\t\t=> true,\n\t\t'menu_position' \t=> 3,\n\t\t'supports'\t\t=> $supports,\n\t\t'has_archive'\t\t=> false\n\t\t);\n\n\tregister_post_type('post_type_slug', $args); // post_type_slug can not contain spaces or capital letters\n}", "function jmb_puppy_cpt() {\n $puppy_labels = array(\n 'name' => _x('Puppies', 'post type general name'),\n 'singular_name' => _x('Puppy', 'post type singular name'),\n 'all_items' => __('All Puppies'),\n 'add_new' => _x('Add new Puppy', 'Puppies'),\n 'add_new_item' => __('Add new Puppy'),\n 'edit_item' => __('Edit Puppy'),\n 'new_item' => __('New Puppy'),\n 'view_item' => __('View Puppy'),\n 'search_items' => __('Search in Puppies'),\n 'not_found' => __('No Puppies found'),\n 'not_found_in_trash' => __('No Puppies found in trash'),\n 'parent_item_colon' => ''\n );\n $args = array(\n 'labels' => $puppy_labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 6,\n 'rewrite' => array('slug' => 'puppies'),\n 'supports' => array('title','editor','thumbnail','excerpt','genesis-cpt-archives-settings'),\n 'has_archive' => 'puppies'\n );\n register_post_type( 'jmb_puppy', $args );\n}", "public function add_post_type_support() {\n\t\tadd_post_type_support( 'page', 'wsuwp-show-and-hide' );\n\t}", "function register_post_types() {\n\t\tinclude('functions/project.cpt.php');\n\t\tinclude('functions/sketchbook.cpt.php');\n\t}", "public function adicionarCustomPostType(){\n \n $labels = array(\n 'name' => ucwords($this->nome_singular),\n 'nome_singular' => ucwords($this->nome_singular),\n 'menu_name' => ucwords($this->nome_plural),\n 'name_admin_bar' => ucwords($this->nome_singular),\n 'add_new' => ucwords($this->nome_singular),\n 'add_new_item' => 'Add New ' . ucwords($this->nome_singular),\n 'new_item' => 'New ' . ucwords($this->nome_singular),\n 'edit_item' => 'Edit ' . ucwords($this->nome_singular),\n 'view_item' => 'View ' . ucwords($this->nome_plural),\n 'all_items' => 'All ' . ucwords($this->nome_plural),\n 'search_items' => 'Search ' . ucwords($this->nome_plural),\n 'parent_item_colon' => 'Parent ' . ucwords($this->nome_plural) . ':', \n 'not_found' => 'No ' . ucwords($this->nome_plural) . ' found.', \n 'not_found_in_trash' => 'No ' . ucwords($this->nome_plural) . ' found in Trash.',\n );\n \n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_nav' => true,\n 'query_var' => true,\n 'hierarchical' => false,\n 'supports' => array('title','editor','thumbnail'), \n 'has_archive' => true,\n 'menu_position' => 20,\n 'show_in_admin_bar' => true,\n 'menu_icon' => 'dashicons-format-status'\n );\n \n register_post_type($this->post_slug, $args);\n \n }", "public function register_post_type(){\n\tinclude_once 'libs/inflector.php';\n\t$class_name = $this->class_name;\n\t$human_class_name = Inflector::humanize( $class_name );\n\t$post_type_slug = $this->post_type_slug;\n\t\n\t$opts = array();\n\n\n\t$opts['labels']['name'] = (isset( $this->labels['name'] )) ? $this->labels['name'] : Inflector::pluralize( $human_class_name );\n\t$opts['labels']['singular_name'] = (isset( $this->labels['singular_name'] )) ? $this->labels['singular_name'] : Inflector::singularize( $human_class_name );\n\t$opts['labels']['add_new'] = (isset( $this->labels['add_new'] )) ? $this->labels['add_new'] : 'Add New ' . Inflector::singularize( $human_class_name );\n\t$opts['labels']['all_items'] = (isset( $this->labels['all_items'] )) ? $this->labels['all_items'] : 'View All ' . Inflector::pluralize( $human_class_name );\n\t$opts['labels']['add_new_item'] = (isset( $this->labels['add_new_item'] )) ? $this->labels['add_new_item'] : 'Add New ' . Inflector::singularize( $human_class_name );\n\t$opts['labels']['edit_item'] = (isset( $this->labels['edit_item'] )) ? $this->labels['edit_item'] : 'Edit ' . Inflector::singularize( $human_class_name );\n\t$opts['labels']['new_item'] = (isset( $this->labels['new_item'] )) ? $this->labels['new_item'] : 'New ' . Inflector::singularize( $human_class_name );\n\t$opts['labels']['view_item'] = (isset( $this->labels['view_item'] )) ? $this->labels['view_item'] : 'View ' . Inflector::singularize( $human_class_name );\n\t$opts['labels']['search_items'] = (isset( $this->labels['search_items'] )) ? $this->labels['search_items'] : 'Search ' . Inflector::pluralize( $human_class_name );\n\t$opts['labels']['not_found'] = (isset( $this->labels['not_found'] )) ? $this->labels['not_found'] : 'No ' . strtolower(Inflector::pluralize( $human_class_name )) . ' found.';\n\t$opts['labels']['not_found_in_trash'] = (isset( $this->labels['not_found_in_trash'] )) ? $this->labels['not_found_in_trash'] : 'No ' . strtolower(Inflector::pluralize( $human_class_name )) . ' found in Trash';\n\t$opts['labels']['parent_item_colon'] = (isset( $this->labels['parent_item_colon'] )) ? $this->labels['parent_item_colon'] : 'Parent ' . Inflector::singularize( $human_class_name ); \n\n\n\n\t\n\tif( isset( $this->labels )) $opts['labels'] = $this->labels;\n\tif( isset( $this->description )) $opts['description'] = $this->description;\n\tif( isset( $this->public )) $opts['public'] = $this->public;\n\tif( isset( $this->exclude_from_search )) $opts['exclude_from_search'] = $this->exclude_from_search;\n\tif( isset( $this->publicly_queryable )) $opts['publicly_queryable'] = $this->publicly_queryable;\n\tif( isset( $this->show_ui )) $opts['show_ui'] = $this->show_ui;\n\tif( isset( $this->show_in_nav_menus )) $opts['show_in_nav_menus'] = $this->show_in_nav_menus;\n\tif( isset( $this->show_in_menu )) $opts['show_in_menu'] = $this->show_in_menu;\n\tif( isset( $this->show_in_admin_bar )) $opts['show_in_admin_bar'];\n\tif( isset( $this->menu_position )) $opts['menu_position'] = $this->menu_position;\n\tif( isset( $this->menu_icon )) $opts['menu_icon'] = $this->menu_icon;\n\tif( isset( $this->capability_type )) $opts['capability_type'] = $this->capability_type;\n\tif( isset( $this->map_meta_cap )) $opts['map_meta_cap'] = $this->map_meta_cap;\n\tif( isset( $this->hierarchical )) $opts['hierarchical'] = $this->hierarchical;\n\tif( isset( $this->supports )) $opts['supports'] = $this->supports;\n\tif( isset( $this->metaboxes )) $opts['register_meta_box_cb'] = array($this, 'create_meta_boxes');\n\tif( isset( $this->taxonomies ) ) $opts['taxonomies'] = $this->taxonomies;\n\tif( isset( $this->capabilities )) $opts['capabilities'] = $this->capabilities;\n\tif( isset( $this->has_archive )) $opts['has_archive'] = $this->has_archive;\n\tif( isset( $this->permalink_epmask )) $opts['permalink_epmask'] = $this->permalink_epmask;\n\tif( isset( $this->rewrite )) $opts['rewrite'] = $this->rewrite;\n\tif( isset( $this->query_var )) $opts['query_var'] = $this->query_var;\n\tif( isset( $this->can_export )) $opts['can_export'] = $this->can_export;\n\t\n\n\tregister_post_type($post_type_slug, $opts);\n\t\n\t\n\t\n}", "function register_post_types()\n {\n }", "function register_post_types()\n {\n }", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "public function register_post_type() {\n\t\tregister_post_type( 'templatera' );\n\t}", "function register_post_type() {\n\t\t\n\t\t\n\t\t//\n\t\t// \tGet Options\n\t\t//\n\t\t\n\t\t$label = get_field( 'portfolio_label', 'option' );\n\t\t$label_singular = get_field( 'portfolio_label_singular', 'option' );\n\t\t$slug = get_field( 'portfolio_slug', 'option' );\n\t\t\n\t\t\n\t\t$label = ( empty( $label ) ) ? 'Portfolio' : $label;\n\t\t$slug = ( empty( $slug )) ? $this->slug : $slug;\n\t\t\n\t\t$taxonomies = get_field( 'portfolio_include_taxonomies', 'option' );\n\t\t\n\t\t\n\n\t\t$labels = array(\n\t\t\t'name' => _x( $label, 'Post Type General Name', 'text_domain' ),\n\t\t\t'singular_name' => _x( $label_singular, 'Post Type Singular Name', 'text_domain' ),\n\t\t\t'menu_name' => __( $label, 'text_domain' ),\n\t\t\t'name_admin_bar' => __( $label, 'text_domain' ),\n\t\t\t'archives' => __( $label, 'text_domain' ),\n\t\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t\t);\n\t\t$rewrite = array(\n\t\t\t'slug' => $slug,\n\t\t\t'with_front' => false,\n\t\t\t'pages' => true,\n\t\t\t'feeds' => true,\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( $label, 'text_domain' ),\n\t\t\t'description' => __( $label . ' area', 'text_domain' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions','page-attributes' ),\n\t\t\t'taxonomies' => $taxonomies,\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'menu_icon' => 'dashicons-portfolio',\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'rewrite' => $rewrite,\n\t\t\t'capability_type' => 'post',\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t);\n\t\tregister_post_type( $this->name, $args );\n\n\t}", "function the_post_type(){\n\t$args = array('public' => true, 'has-archive' => true, supports => array('title', 'editor', thumbnail), 'label' => \"Profile\");\n\tregister_post_type('profile', $args);\n}", "function philosophy_custom_post_types( $options ) {\n\n $page_id = 0;\n if ( isset( $_REQUEST['post'] ) || isset( $_REQUEST['post_ID'] ) ) {\n $page_id = empty( $_REQUEST['post_ID'] ) ? $_REQUEST['post'] : $_REQUEST['post_ID'];\n }\n\n\n $options[] = array(\n 'id' => 'page-custom_post_type',\n 'title' => __( 'Select Post Type', 'philosophy' ),\n 'post_type' => 'page',\n 'context' => 'normal',\n 'priority' => 'default',\n 'sections' => array(\n array(\n 'name' => 'page-section1',\n// 'title' => __( 'Post Type', 'philosophy' ),\n 'icon' => 'fa fa-image',\n 'fields' => array(\n array(\n 'id' => 'cpt_type',\n 'type' => 'select',\n 'title' => 'select a custom post type',\n 'options' => array(\n 'none' => 'None',\n 'book' => 'Book',\n 'chapter' => 'Chapter'\n )\n ),\n )\n )\n )\n );\n\n $page_meta_info = get_post_meta( $page_id, 'page-custom_post_type', true );\n\n if ( isset( $page_meta_info['cpt_type'] ) && $page_meta_info['cpt_type'] == 'book' ) {\n $options[] = array(\n 'id' => 'page-custom_post_type_book',\n 'title' => __( 'Options For Book', 'philosophy' ),\n 'post_type' => 'page',\n 'context' => 'normal',\n 'priority' => 'default',\n 'sections' => array(\n array(\n 'name' => 'page-section1',\n// 'title' => __( 'Post Type', 'philosophy' ),\n 'icon' => 'fa fa-image',\n 'fields' => array(\n array(\n 'id' => 'option_book_text',\n 'type' => 'text',\n 'title' => 'Some Book Info',\n ),\n )\n )\n )\n );\n }\n\n if ( isset( $page_meta_info['cpt_type'] ) && $page_meta_info['cpt_type'] == 'chapter' ) {\n $options[] = array(\n 'id' => 'page-custom_post_type_chapter',\n 'title' => __( 'Options For Chapter', 'philosophy' ),\n 'post_type' => 'page',\n 'context' => 'normal',\n 'priority' => 'default',\n 'sections' => array(\n array(\n 'name' => 'page-section1',\n// 'title' => __( 'Post Type', 'philosophy' ),\n 'icon' => 'fa fa-image',\n 'fields' => array(\n array(\n 'id' => 'option_chapter_text',\n 'type' => 'text',\n 'title' => 'Some chapter Info',\n ),\n )\n )\n )\n );\n }\n\n return $options;\n}", "public function register_post_types(){\n\t\tGroupPressGroup::register_post_type();\n\t\tGroupPressMember::register_post_type();\n\t}", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function greenland_post_type(){\n\n\t\t// register humic posts\n\t\tregister_post_type( 'humic', array(\n\t\t\t'show_in_rest'\t\t=> true,\n\t\t\t'supports'\t\t\t=> array('title', 'editor', 'thumbnail'),\n\t\t\t'rewrite'\t\t\t=> array('slug' => 'humics'),\n\t\t\t'has_archive'\t\t=> true,\n\t\t\t'public'\t\t\t=> true,\n\t\t\t'menu_icon'\t\t\t=> 'dashicons-admin-site-alt',\n\t\t\t'labels'\t\t\t=> array(\n\t\t\t\t'name'\t\t\t=> 'Humics',\n\t\t\t\t'add_new_item'\t=> 'Add New Humic',\n\t\t\t\t'edit_item'\t\t=> 'Edit Humic',\n\t\t\t\t'all_items'\t\t=> 'All Humics',\n\t\t\t\t'singular_name'\t=> 'Humic'\n\t\t\t)\n\t\t));\n\n\t\t// register pesticide posts\n\t\tregister_post_type( 'pesticide', array(\n\t\t\t'show_in_rest'\t\t=> true,\n\t\t\t'supports'\t\t\t=> array('title', 'editor', 'thumbnail'),\n\t\t\t'rewrite'\t\t\t=> array('slug' => 'pesticides'),\n\t\t\t'has_archive'\t\t=> true,\n\t\t\t'public'\t\t\t=> true,\n\t\t\t'menu_icon'\t\t\t=> 'dashicons-buddicons-replies',\n\t\t\t'labels'\t\t\t=> array(\n\t\t\t\t'name'\t\t\t=> 'Pesticides',\n\t\t\t\t'add_new_item'\t=> 'Add New Pesticide',\n\t\t\t\t'edit_item'\t\t=> 'Edit Pesticide',\n\t\t\t\t'all_items'\t\t=> 'All Pesticides',\n\t\t\t\t'singular_name'\t=> 'Pesticide'\n\t\t\t)\n\t\t));\n\n\t\t// register beans posts\n\t\tregister_post_type( 'bean', array(\n\t\t\t'show_in_rest'\t\t=> true,\n\t\t\t'supports'\t\t\t=> array('title', 'editor', 'thumbnail'),\n\t\t\t'rewrite'\t\t\t=> array('slug' => 'beans'),\n\t\t\t'has_archive'\t\t=> true,\n\t\t\t'public'\t\t\t=> true,\n\t\t\t'menu_icon'\t\t\t=> 'dashicons-calendar',\n\t\t\t'labels'\t\t\t=> array(\n\t\t\t\t'name'\t\t\t=> 'Beans',\n\t\t\t\t'add_new_item'\t=> 'Add New Bean',\n\t\t\t\t'edit_item'\t\t=> 'Edit Bean',\n\t\t\t\t'all_items'\t\t=> 'All Beans',\n\t\t\t\t'singular_name'\t=> 'Bean'\n\t\t\t)\n\t\t));\n\t}", "function post_type_team() {\n $labels = array(\n 'name' => 'team',\n 'singular_name' => 'teamlid',\n 'add_new' => 'Nieuw teamlid',\n 'all_items' => 'Alle team',\n 'add_new_item' => 'teamlid toevoegen',\n 'edit_item' => 'teamlid bewerken',\n 'new_item' => 'Nieuw teamlid',\n 'view_item' => 'Alle team',\n 'search_items' => 'Zoek teamlid',\n 'not_found' => 'Geen team Gevonden',\n 'not_found_in_trash' => 'Geen Teamlid Gevonden in Prullenbak',\n 'parent_item_colon' => 'Parent item'\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'publicly_queryable' => true,\n 'query_var'=> true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array(\n 'title',\n 'editor',\n // 'excerpt',\n 'thumbnail',\n 'revision',\n ),\n 'taxonomies' => array(\n 'category',\n 'post_tag'\n ),\n 'menu_position' => 8,\n 'exclude_from_search' => false\n );\n register_post_type('team', $args);\n }", "function create_custom_post() {\n global $cutom_post_types;\n foreach ($cutom_post_types as $key => $val) :\n\n $labels = array(\n 'name' => _x($key, 'post type general name'),\n 'singular_name' => _x($key, 'post type singular name'),\n 'add_new' => _x('Add New', $key),\n 'add_new_item' => __('Add New ' . $key),\n 'edit_item' => __('Edit ' . $key),\n 'new_item' => __('New ' . $key),\n 'all_items' => __('All ' . $key),\n 'view_item' => __('View ' . $key),\n 'search_items' => __('Search ' . $key),\n 'not_found' => __('No ' . $key . ' found'),\n 'not_found_in_trash' => __('No ' . $key . ' found in the Trash'),\n 'parent_item_colon' => '',\n 'menu_name' => $key,\n );\n\n if (!empty($val)):\n foreach ($labels as $keys => $vals) :\n if (array_key_exists($keys, $val))\n $labels[$keys] = $val[$keys];\n endforeach;\n endif;\n $args = array(\n 'labels' => $labels,\n 'description' => 'Holds our ' . $key . ' specific data',\n 'public' => true,\n 'menu_position' => $key,\n 'query_var' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => false,\n 'taxonomies' => array('post_tag','category'),\n 'supports' => array('title','editor', 'thumbnail', 'page-attributes'),\n 'has_archive' => true,\n );\n if (!empty($val)):\n foreach ($args as $keys => $vals) :\n if (array_key_exists($keys, $val))\n $args[$keys] = $val[$keys];\n endforeach;\n endif;\n register_post_type($key, $args);\n endforeach;\n}", "function register_post_types() {\n }", "function add_custom_post_types() {\n\n new_post_type(\"exhibitions\", array('title', 'editor'));\n new_post_type(\"biography\", array('title', 'editor'));\n new_post_type(\"works\", array('title', 'editor'));\n new_post_type(\"press\", array('title', 'editor'));\n new_post_type(\"publication\", array('title', 'editor', 'thumbnail'));\n}", "function fb_googlemap_post_type() {\n\t\n\t\t\t$labels = array(\n\t\t\t'name' => _x( 'Shop Locations', 'Post Type General Name', 'emilyfruitcrisps' ),\n\t\t\t'singular_name' => _x( 'Shop Location', 'Post Type Singular Name', 'emilyfruitcrisps' ),\n\t\t\t'menu_name' => __( 'Locations', 'emilyfruitcrisps' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'emilyfruitcrisps' ),\n\t\t\t'all_items' => __( 'All Locations', 'emilyfruitcrisps' ),\n\t\t\t'view_item' => __( 'View Location', 'emilyfruitcrisps' ),\n\t\t\t'add_new_item' => __( 'Add New Location', 'emilyfruitcrisps' ),\n\t\t\t'add_new' => __( 'Add New', 'emilyfruitcrisps' ),\n\t\t\t'edit_item' => __( 'Edit Location', 'emilyfruitcrisps' ),\n\t\t\t'update_item' => __( 'Update Location', 'emilyfruitcrisps' ),\n\t\t\t'search_items' => __( 'Search Locations', 'emilyfruitcrisps' ),\n\t\t\t'not_found' => __( 'Not found', 'emilyfruitcrisps' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'emilyfruitcrisps' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( 'wheretobuy', 'emilyfruitcrisps' ),\n\t\t\t'description' => __( 'Where to buy Emily Fruit Crisps', 'emilyfruitcrisps' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title','thumbnail' ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => false,\n\t\t\t'exclude_from_search' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'rewrite' => false,\n\t\t\t'capability_type' => 'page',\n\t\t);\n\t\tregister_post_type( 'wheretobuy', $args );\n\t\n\t}", "function moebius_register_cpt($typeName, $singular, $plural, $icon) {\n return register_post_type($typeName,\n array(\n 'labels' => array(\n 'name' => $plural,\n 'singular_name' => $singular,\n 'all_items' => 'Todos',\n 'add_new' => 'Agregar Nuevo',\n 'add_new_item' => 'Agregar Nuevo',\n 'edit' => 'Editar',\n 'edit_item' => 'Editar ' . $singular,\n 'new_item' => 'Nuevo ' . $singular,\n 'view_item' => 'Ver ' . $singular,\n 'search_items' => 'Buscar ' . $plural,\n 'not_found' => 'No hay resultados.',\n 'not_found_in_trash' => 'No hay nada en la basura',\n 'parent_item_colon' => ''\n ),\n\n 'description' => '',\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => false,\n 'show_ui' => true,\n 'query_var' => true,\n 'menu_position' => 7,\n 'menu_icon' => $icon,\n 'rewrite' => array( 'slug' => $typeName, 'with_front' => false ),\n 'has_archive' => $typeName,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array( 'title', 'publicize', 'thumbnail', 'comments', 'revisions', 'sticky' ),\n // 'taxonomies' => array( 'post_tag' )\n )\n );\n}", "function rdk_custom_post_type() {\n register_post_type('rdk_post',\n array('labels' => \n array(\n 'name' => __('Custom Roddick Post', 'textdomain'),\n 'singular_name' => __('Custom Roddick Post', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array( 'slug' => 'thrive_global'), //'thrive_global' slug - for branding\n 'show_in_rest' => true, //We want this available to the REST api \n 'supports' => array('editor', 'title'), //we want gutenberg editor, title field\n )\n );\n}", "public function register_post_types() {\n\n }", "function set_custom_post_types()\n{\n $post_types = array();\n\n /*\n *\n * Left empty : populate after examples library\n *\n */\n\n if ($post_types) {\n foreach ($post_types as $post_type) {\n // Register post type\n if ( $post_type['post_type_name'] && $post_type['post_type_args'] ) {\n register_post_type($post_type['post_type_name'], $post_type['post_type_args']);\n // Register taxonomy for post type\n if ($post_type['taxonomy_name'] && $post_type['taxonomy_args']) {\n register_taxonomy($post_type['taxonomy_name'], $post_type['post_type_name'], $post_type['taxonomy_args']);\n }\n }\n }\n }\n\n}", "function my_custom_portfolio_item() {\n $args = array();\n register_post_type( 'portfolio_item', $args );\n}", "function primary_category_create_custom_post_type(){\n\tregister_post_type('custom_post', \n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __('Custom posts'),\n\t\t\t\t'singular_name' => __('Custom post')\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'taxonomies' => array('category')\n\t\t)\n\t);\n}", "public \tfunction section_page_init() {\n\t\tregister_post_type( $this->page_name, $this->args);\n }", "static function on_init_custom_post_types(){\n\t\tCustomPost::on_init();\n\t}", "public function create_post_type() {\n\t\t\t$this->register_post_type( array(\n//\t\t\t'label' => __( 'Testimonials', 'wps' ),\n//\t\t\t'description' => __( 'For Testimonials', 'wps' ),\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'menu_position' => 6.9,\n\t\t\t\t'menu_icon' => 'dashicons-format-quote',\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'rewrite' => false,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'register_rating' => 'add_rating_metabox',\n\t\t\t\t'show_in_rest' => true,\n\t\t\t) );\n\t\t}", "function proyecto_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'proyectos', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'proyecto', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'proyectos', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'proyecto', 'text_domain' ),\n\t\t'description' => __( 'proyectos de trabajo', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-visibility',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'proyecto', $args );\n\n}", "function story_post_type() { \n\t// creating (registering) the custom type \n\tregister_post_type( 'story', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */\n\t\t// let's now add all the options for this post type\n\t\tarray( 'labels' => array(\n\t\t\t'name' => __( 'Stories', 'ptheme' ), /* This is the Title of the Group */\n\t\t\t'singular_name' => __( 'Story', 'ptheme' ), /* This is the individual type */\n\t\t\t'all_items' => __( 'All Stories', 'ptheme' ), /* the all items menu item */\n\t\t\t'add_new' => __( 'Add New', 'ptheme' ), /* The add new menu item */\n\t\t\t'add_new_item' => __( 'Add New Story', 'ptheme' ), /* Add New Display Title */\n\t\t\t'edit' => __( 'Edit', 'ptheme' ), /* Edit Dialog */\n\t\t\t'edit_item' => __( 'Edit Story', 'ptheme' ), /* Edit Display Title */\n\t\t\t'new_item' => __( 'New Story', 'ptheme' ), /* New Display Title */\n\t\t\t'view_item' => __( 'View Story', 'ptheme' ), /* View Display Title */\n\t\t\t'search_items' => __( 'Search Stories', 'ptheme' ), /* Search Custom Type Title */ \n\t\t\t'not_found' => __( 'Nothing found in the Database.', 'ptheme' ), /* This displays if there are no entries yet */ \n\t\t\t'not_found_in_trash' => __( 'Nothing found in Trash', 'ptheme' ), /* This displays if there is nothing in the trash */\n\t\t\t'parent_item_colon' => ''\n\t\t\t), /* end of arrays */\n\t\t\t'description' => __( 'Ripon stories of students or faculty members.', 'ptheme' ), /* Custom Type Description */\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t\t'menu_position' => 8, /* this is what order you want it to appear in on the left hand side menu */ \n\t\t\t'menu_icon' => get_stylesheet_directory_uri() . '/img/icon-book-small.png', /* the icon for the custom post type menu */\n\t\t\t'rewrite'\t=> array( 'slug' => 'story', 'with_front' => false ), /* you can specify its url slug */\n\t\t\t'has_archive' => 'stories', /* you can rename the slug here */\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t/* the next one is important, it tells what's enabled in the post editor */\n\t\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'revisions')\n\t\t) /* end of options */\n\t); /* end of register post type */\n\t\n}", "function custom_post_type() {\n \n // Set UI labels for Custom Post Type\n $labels = array(\n 'name' => _x( 'Projects', 'Post Type General Name', 'twentytwenty' ),\n 'singular_name' => _x( 'Project', 'Post Type Singular Name', 'twentytwenty' ),\n 'menu_name' => __( 'Projects', 'twentytwenty' ),\n 'parent_item_colon' => __( 'Parent Project', 'twentytwenty' ),\n 'all_items' => __( 'All Projects', 'twentytwenty' ),\n 'view_item' => __( 'View Project', 'twentytwenty' ),\n 'add_new_item' => __( 'Add New Project', 'twentytwenty' ),\n 'add_new' => __( 'Add New', 'twentytwenty' ),\n 'edit_item' => __( 'Edit Project', 'twentytwenty' ),\n 'update_item' => __( 'Update Project', 'twentytwenty' ),\n 'search_items' => __( 'Search Project', 'twentytwenty' ),\n 'not_found' => __( 'Not Found', 'twentytwenty' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentytwenty' ),\n );\n \n // Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'projects', 'twentytwenty' ),\n 'description' => __( 'Project news and reviews', 'twentytwenty' ),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'show_in_rest' => true,\n \n );\n \n // Registering your Custom Post Type\n register_post_type( 'projects', $args );\n \n }", "function employment_post() {\n register_post_type( 'employment',\n array(\n 'labels' => array(\n 'name' => __( 'Employment' ),\n 'singular_name' => __('Employment')\n ),\n 'public' => true,\n 'has_archive' => true,\n 'show_in_rest' => true,\n 'menu_position' => 20,\n 'with_front' => true,\n 'supports' => array('title', 'editor', 'page-attributes'),\n 'menu_icon' => 'dashicons-editor-paragraph',\n )\n );\n}", "function roofingtypes_create_post_type() {\n register_post_type( 'roofingtypes',\n [\n 'labels' => ['name' => __( 'Roofing Types' ), 'singular_name' => __( 'Roofing Type')],\n 'public' => true,\n 'has_archive' => true,\n 'show_ui' => true,\n 'menu_icon' => 'dashicons-admin-home',\n 'query_var' => true,\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'supports' => [\n 'title',\n 'editor',\n 'thumbnail',\n 'page-attributes',\n ],\n 'rewrite' => ['slug' => 'roofingtypes'],\n ]\n );\n}", "public function createPostType()\n {\n register_post_type( $this->postType,\n array(\n 'labels' => array(\n 'name' => __( $this->pluralName ),\n 'singular_name' => __( $this->singularName )\n ),\n 'supports' => ['title','custom-fields'],\n 'public' => $this->enabled,\n 'has_archive' => false,\n 'rewrite' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => false,\n 'show_in_menu' => $this->enabled,\n 'show_in_rest' => false,\n 'menu_icon' => 'dashicons-instagram',\n ));\n }", "public function _createPostTypes() {\n register_post_type( 'gallery', array(\n 'labels' => array(\n 'name' => __( 'Galerien' ),\n 'singular_name' => __( 'Galerie' )\n ),\n 'taxonomies' => array( 'category' ),\n 'menu_icon' => get_template_directory_uri() . '/includes/img/icons/galerie.png',\n 'public' => true,\n 'has_archiv' => true,\n 'show_ui' => true, // UI in admin panel\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'trackbacks', 'custom-fields', 'revisions' ),\n 'taxonomies' => array( 'category' ),\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'excerpt' => true\n )\n );\n\n add_post_type_support( 'page', 'excerpt', true );\n }", "function custom_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Review', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Post Type Review', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Reviews', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Reviews', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Reviews', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Review', 'text_domain' ),\n\t\t'add_new' => __( 'Add New Review', 'text_domain' ),\n\t\t'new_item' => __( 'New Review', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Review', 'text_domain' ),\n\t\t'update_item' => __( 'Update Review', 'text_domain' ),\n\t\t'view_item' => __( 'View Reviews', 'text_domain' ),\n\t\t'search_items' => __( 'Search Reviews', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Reviews list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Post Type Review', 'text_domain' ),\n\t\t'description' => __( 'Customer\\'s Review', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\t\t\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\tregister_post_type( 'review', $args );\n\n}", "function thulur_type() {\n $labels = array(\n 'name' => 'Þulur',\n 'singular_name' => 'Þula',\n 'add_new' => 'Bæta við þulu',\n 'add_new_item' => 'Bæata við nýrri þulu',\n 'edit_item' => 'Breyta þulu',\n 'new_item' => 'Þula',\n 'view_item' => 'Skoða þulu',\n 'search_items' => 'Finna þulu',\n 'not_found' => 'Not found',\n 'not_found_in_trash' => 'Not found in trash',\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array(\n 'slug' => 'thulur',\n 'with_front' => false,\n ),\n 'has_archive' => true,\n 'capability_type' => 'page',\n 'hierarchical' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-smiley',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ),\n );\n register_post_type( 'thulur', $args );\n }", "function register_custom_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Thingamajigs', 'post type general name', 'thingamajig' ),\n\t\t'singular_name' => _x( 'Thingamajig', 'post type singular name', 'thingamajig' ),\n\t\t'menu_name' => _x( 'Thingamajigs', 'admin menu', 'thingamajig' ),\n\t\t'name_admin_bar' => _x( 'Thingamajig', 'add new on admin bar', 'thingamajig' ),\n\t\t'add_new_item' => __( 'Add New Thingamajig', 'thingamajig' ),\n\t\t'new_item' => __( 'New Thingamajig', 'thingamajig' ),\n\t\t'edit_item' => __( 'Edit Thingamajig', 'thingamajig' ),\n\t\t'view_item' => __( 'View Thingamajig', 'thingamajig' ),\n\t\t'all_items' => __( 'All Thingamajigs', 'thingamajig' ),\n\t\t'search_items' => __( 'Search Thingamajigs', 'thingamajig' ),\n\t\t'parent_item_colon' => __( 'Parent Thingamajigs:', 'thingamajig' ),\n\t\t'not_found' => __( 'No thingamajigs found.', 'thingamajig' ),\n\t\t'not_found_in_trash' => __( 'No thingamajigs found in Trash.', 'thingamajig' ),\n\n\t\t'featured_image' \t\t => __( 'Profile image.', 'thingamajig' ),\n\t\t'set_featured_image' \t\t => __( 'Set profile image.', 'thingamajig' ),\n\t\t'remove_featured_image' \t\t => __( 'Remove profile image.', 'thingamajig' ),\n\t\t'use_featured_image' \t\t => __( 'Use profile image.', 'thingamajig' ),\n\t);\n\n\t$features = get_all_post_type_features( 'post', array(\n\t\t'excerpt',\n\t\t'comments',\n\t\t'trackbacks',\n\t\t'custom-fields',\n\t));\n\n\t$args = array(\n\t\t'label' => __( 'Thingamajigs', 'thingamajig' ),\n\t\t'labels' => $labels,\n\t\t'public' => true,\n\t\t'supports' => $features,\n\t\t'has_archive' => true,\n\t);\n\n\tregister_post_type( 'thingamajigs', $args );\n}", "public static function registerPostType()\n {\n $labels = array(\n 'name' => __('Testimonials', ProRMTheme::TEXTDOMAIN),\n 'singular_name' => __('Testimonial', ProRMTheme::TEXTDOMAIN),\n 'add_new' => __('Add New', ProRMTheme::TEXTDOMAIN),\n 'add_new_item' => __('Add New Testimonial', ProRMTheme::TEXTDOMAIN),\n 'edit_item' => __('Edit Testimonial', ProRMTheme::TEXTDOMAIN),\n 'new_item' => __('New Testimonial', ProRMTheme::TEXTDOMAIN),\n 'all_items' => __('All Testimonials', ProRMTheme::TEXTDOMAIN),\n 'view_item' => __('View Testimonial', ProRMTheme::TEXTDOMAIN),\n 'search_items' => __('Search Testimonials', ProRMTheme::TEXTDOMAIN),\n 'not_found' => __('No Testimonials found', ProRMTheme::TEXTDOMAIN),\n 'not_found_in_trash' => __('No Testimonials found in Trash', ProRMTheme::TEXTDOMAIN),\n 'parent_item_colon' => '',\n 'menu_name' => __('Testimonials', ProRMTheme::TEXTDOMAIN),\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => self::POST_TYPE),\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => true,\n 'menu_position' => null,\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes', 'parent')\n );\n\n register_post_type(self::POST_TYPE, $args);\n }", "function register_post_types() {\n }", "function custom_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Job Templates', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Job Template', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Job Templates', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Job Template', 'text_domain' ),\n\t\t'archives' => __( 'Job Template Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Job Template Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Job Template:', 'text_domain' ),\n\t\t'all_items' => __( 'All Job Templates', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Job Template', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Job Template', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Job Template', 'text_domain' ),\n\t\t'update_item' => __( 'Update Job Template', 'text_domain' ),\n\t\t'view_item' => __( 'View Job Template', 'text_domain' ),\n\t\t'view_items' => __( 'View Job Templates', 'text_domain' ),\n\t\t'search_items' => __( 'Search Job Template', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into Job Template', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Job Template', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Job Template', 'text_domain' ),\n\t\t'description' => __( 'Job Template Description', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'jobtemplate_category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'job_template', $args );\n\n}", "function custom_post_type() {\n\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\n \n// Set UI labels for Custom Post Type\n $labels = array(\n 'name' => _x( 'News', 'Post Type General Name', 'Theme' ),\n 'singular_name' => _x( 'News', 'Post Type Singular Name', 'Theme' ),\n 'menu_name' => __( 'News', 'Theme' ),\n 'parent_item_colon' => __( 'Parent News', 'Theme' ),\n 'all_items' => __( 'All News', 'Theme' ),\n 'view_item' => __( 'View News', 'Theme' ),\n 'add_new_item' => __( 'Add New News', 'Theme' ),\n 'add_new' => __( 'Add New', 'Theme' ),\n 'edit_item' => __( 'Edit News', 'Theme' ),\n 'update_item' => __( 'Update News', 'Theme' ),\n 'search_items' => __( 'Search News', 'Theme' ),\n 'not_found' => __( 'Not Found', 'Theme' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'Theme' ),\n );\n \n// Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'news', 'Theme' ),\n 'description' => __( 'News news and reviews', 'Theme' ),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields','page-attributes', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n // 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n \n // This is where we add taxonomies to our CPT\n 'taxonomies' => array('post_tag'),\n\n );\n \n // Registering your Custom Post Type\n register_post_type( 'news', $args );\n \n\n register_taxonomy(\"news_categories\", \"news\", array(\"hierarchical\" => true,\n \"label\" => \"Categories\",\n \"singular_label\" => \"Categories\",\n 'rewrite' => array('slug' => 'news_categories','with_front' => FALSE,),\n \"query_var\" => true,\n \"show_ui\" => true\n )\n );\n\n \n}", "public function register_post_types()\n {\n }", "function ga_event_post_type() {\r\n\r\n\t// Labels for the post type.\r\n\t$labels = [\r\n\t\t'name' => _x(\r\n\t\t\t'Events',\r\n\t\t\t'Post Type General Name',\r\n\t\t\t'gourmet-artist'\r\n\t\t),\r\n\t\t'singular_name' => _x(\r\n\t\t\t'Event',\r\n\t\t\t'Post Type Singular Name',\r\n\t\t\t'gourmet-artist'\r\n\t\t),\r\n\t\t'menu_name' => __( 'Events', 'gourmet-artist' ),\r\n\t\t'parent_item_colon' => __( 'Parent Event', 'gourmet-artist' ),\r\n\t\t'all_items' => __( 'All Events', 'gourmet-artist' ),\r\n\t\t'view_item' => __( 'View Event', 'gourmet-artist' ),\r\n\t\t'add_new_item' => __( 'Add New Event', 'gourmet-artist' ),\r\n\t\t'add_new' => __( 'Add New Event', 'gourmet-artist' ),\r\n\t\t'edit_item' => __( 'Edit Event', 'gourmet-artist' ),\r\n\t\t'update_item' => __( 'Update Event', 'gourmet-artist' ),\r\n\t\t'search_items' => __( 'Search Event', 'gourmet-artist' ),\r\n\t\t'not_found' => __( 'No Event Found', 'gourmet-artist' ),\r\n\t\t'not_found_in_trash' => __(\r\n\t\t\t'No Event Found In Trash',\r\n\t\t\t'gourmet-artist'\r\n\t\t),\r\n\t];\r\n\r\n\t// Another Customizations.\r\n\t$args = [\r\n\t\t'label' => __( 'Events', 'gourmet-artist' ),\r\n\t\t'description' => __(\r\n\t\t\t'Recipies for Gourmet Artistry',\r\n\t\t\t'gourmet-artist'\r\n\t\t),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => [\r\n\t\t\t'title',\r\n\t\t\t'editor',\r\n\t\t\t'author',\r\n\t\t\t'thumbnail',\r\n\t\t\t'comments',\r\n\t\t\t'revisions',\r\n\t\t\t'custom-fields',\r\n\t\t],\r\n\t\t'hierarchichal' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui_in_menus' => true,\r\n\t\t'show_ui_in_nav_menus' => true,\r\n\t\t'show_ui_in_admin_bar' => true,\r\n\t\t'menu_position' => 6,\r\n\t\t'menu_icon' => 'dashicons-calendar',\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'capability_type' => 'page',\r\n\t];\r\n\r\n\t// Register the post type.\r\n\tregister_post_type( 'events', $args );\r\n}", "function nap_init() {\n $args = array(\n 'label' => 'NAP',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'nap_location'),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-sticky',\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'trackbacks',\n 'comments',\n 'revisions',\n 'thumbnail',\n 'author',\n 'page-attributes',)\n );\n register_post_type('nap_location', $args);\n}", "function initPostType()\n {\n /**\n * Post Type: Action Monitor.\n */\n\n $labels = array(\n \"name\" => __(\"Action Monitor\", \"WP_Gatsby\"),\n \"singular_name\" => __(\"Action Monitor\", \"WP_Gatsby\"),\n );\n\n $args = array(\n \"label\" => __(\"Action Monitor\", \"WP_Gatsby\"),\n \"labels\" => $labels,\n \"description\" => \"Used to keep a log of actions in WordPress for cache invalidation in gatsby-source-wpgraphql.\",\n \"public\" => true,\n \"publicly_queryable\" => true,\n \"show_ui\" => true,\n \"delete_with_user\" => false,\n \"show_in_rest\" => true,\n \"rest_base\" => \"\",\n \"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n \"has_archive\" => false,\n \"show_in_menu\" => true,\n \"show_in_nav_menus\" => true,\n \"exclude_from_search\" => false,\n \"capability_type\" => \"post\",\n \"map_meta_cap\" => true,\n \"hierarchical\" => false,\n \"rewrite\" => array( \"slug\" => \"action_monitor\", \"with_front\" => true ),\n \"query_var\" => true,\n \"supports\" => array( \"title\" ),\n \"show_in_graphql\" => true,\n \"graphql_single_name\" => \"ActionMonitorAction\",\n \"graphql_plural_name\" => \"ActionMonitorActions\",\n );\n\n register_post_type(\"action_monitor\", $args);\n }", "function flotheme_get_post_types() {\n\treturn array(\n 'projects' => array(\n\t\t\t'config' => array(\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'supports'=> array(\n\t\t\t\t\t'title',\n 'editor',\n 'thumbnail',\n\t\t\t\t),\n\t\t\t\t'show_in_nav_menus'=> false,\n //'rewrite' => array('slug'=>'project', 'with_front'=>true),\n //'menu_icon' => THEME_URL . '/images/icons/project.png'\n\t\t\t),\n\t\t\t'singular' => 'Project',\n\t\t\t'multiple' => 'Projects',\n\t\t\t'columns'\t=> array(\n\t\t\t\t'first_image',\n\t\t\t)\n\t\t),\n 'team' => array(\n\t\t\t'config' => array(\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'supports'=> array(\n\t\t\t\t\t'title',\n 'editor',\n 'thumbnail',\n\t\t\t\t),\n\t\t\t\t'show_in_nav_menus'=> false,\n //'rewrite' => array('slug'=>'project', 'with_front'=>true),\n //'menu_icon' => THEME_URL . '/images/icons/project.png'\n\t\t\t),\n\t\t\t'singular' => 'Team Member',\n\t\t\t'multiple' => 'Team Members',\n\t\t\t'columns'\t=> array(\n\t\t\t\t'first_image',\n\t\t\t)\n\t\t),\n 'client' => array(\n\t\t\t'config' => array(\n\t\t\t\t'public' => false,\n 'show_ui' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'supports'=> array(\n\t\t\t\t\t'title',\n 'editor',\n 'thumbnail',\n\t\t\t\t),\n\t\t\t\t'show_in_nav_menus'=> false,\n //'rewrite' => array('slug'=>'project', 'with_front'=>false),\n //'menu_icon' => THEME_URL . '/images/icons/project.png'\n\t\t\t),\n\t\t\t'singular' => 'Client',\n\t\t\t'multiple' => 'Clients',\n\t\t\t'columns'\t=> array(\n\t\t\t\t'first_image',\n\t\t\t)\n\t\t),\n );\n}", "function create_post_type() {\n\t\tregister_post_type( 'corsi',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Corsi' ),\n\t\t\t\t\t'singular_name' => __( 'Corso' )\n\t\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'menu_position' => 20,\n\t\t\t'taxonomies' => array('category'), \n\t\t\t'supports' => array('title', 'editor', 'thumbnail'),\n\t\t\t)\n\t\t);\n\t\tregister_post_type( 'spettacoli',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Spettacoli' ),\n\t\t\t\t\t'singular_name' => __( 'Spettacolo' )\n\t\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'menu_position' => 20,\n\t\t\t'taxonomies' => array('category'), \n\t\t\t'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),\n\t\t\t)\n\t\t);\n\t\tregister_post_type( 'persone',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Persone' ),\n\t\t\t\t\t'singular_name' => __( 'Persona' )\n\t\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'menu_position' => 20,\n\t\t\t'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),\n\t\t\t)\n\t\t);\n\t\tregister_post_type( 'festival banner',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Festival banner' ),\n\t\t\t\t\t'singular_name' => __( 'Festival banner' )\n\t\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'menu_position' => 20, \n\t\t\t'supports' => array('title', 'editor', 'thumbnail'),\n\t\t\t)\n\t\t);\n\t\tflush_rewrite_rules();\n\t}", "function post_types(){\n\n\n register_post_type('Materiales', array(\n 'supports'=>array('title','editor' ,'thumbnail','excerpt','custom-fieled'),\n 'rewrite'=>array('slug'=>'Materiales'),\n 'has_archive'=>true,\n 'public'=>true,\n 'labels'=>array(\n 'name'=>'Materiales',\n 'add_new_item'=>'Agregar nuevo Material',\n 'edit_item' =>'Modificar Material',\n 'all_items'=> 'Ver todos los Materiales',\n 'singular_name'=>'Material'\n ),\n 'menu_icon'=>'dashicons-schedule',\n ));\n\n\n register_post_type('Inspiraciones', array(\n 'supports'=>array('title','editor' ,'thumbnail','excerpt','custom-fieled'),\n 'rewrite'=>array('slug'=>'Inspiraciones'),\n 'has_archive'=>true,\n 'public'=>true,\n 'labels'=>array(\n 'name'=>'Inspiraciones',\n 'add_new_item'=>'Agregar nueva Inspiracion',\n 'edit_item' =>'Modificar Inspiracion',\n 'all_items'=> 'Ver todos las Inspiraciones',\n 'singular_name'=>'Inspiracion'\n ),\n 'menu_icon'=>'dashicons-building',\n ));\n\n\n register_post_type('Servicios', array(\n 'supports'=>array('title','editor' ,'thumbnail','excerpt','custom-fieled'),\n 'rewrite'=>array('slug'=>'Servicios'),\n 'has_archive'=>true,\n 'public'=>true,\n 'labels'=>array(\n 'name'=>'Servicios',\n 'add_new_item'=>'Agregar nueva Servicio',\n 'edit_item' =>'Modificar Servicio',\n 'all_items'=> 'Ver todos las Servicios',\n 'singular_name'=>'Servicio'\n ),\n 'menu_icon'=>'dashicons-businessman',\n ));\n\n register_post_type('Sucursales', array(\n 'supports'=>array('title','editor' ,'thumbnail','excerpt','custom-fieled'),\n 'rewrite'=>array('slug'=>'Sucursales'),\n 'has_archive'=>true,\n 'public'=>true,\n 'labels'=>array(\n 'name'=>'Sucursales',\n 'add_new_item'=>'Agregar nueva Sucursal',\n 'edit_item' =>'Modificar Sucursal',\n 'all_items'=> 'Ver todos las Sucursales',\n 'singular_name'=>'Sucursal'\n ),\n 'menu_icon'=>'dashicons-location',\n ));\n}", "function air_custom_post_type()\n {\n\n $labels = array(\n 'name' => _x('Servicios', 'Post Type General Name', 'air'),\n 'singular_name' => _x('Servicio', 'Post Type Singular Name', 'air'),\n 'menu_name' => __('Servicios', 'air'),\n 'name_admin_bar' => __('Servicios', 'air'),\n 'archives' => __('Item Archives', 'air'),\n 'attributes' => __('Item Attributes', 'air'),\n 'parent_item_colon' => __('Parent Item:', 'air'),\n 'all_items' => __('Todos Los Servicios', 'air'),\n 'add_new_item' => __('Agregar Nuevo Servicio', 'air'),\n 'add_new' => __('Agregar Nuevo', 'air'),\n 'new_item' => __('Nuevo Servicio', 'air'),\n 'edit_item' => __('Editar Servicio', 'air'),\n 'update_item' => __('Actualizar Servicio', 'air'),\n 'view_item' => __('Ver Servicio', 'air'),\n 'view_items' => __('Ver Servicios', 'air'),\n 'search_items' => __('Buscar Servicio', 'air'),\n 'not_found' => __('No encontrado', 'air'),\n 'not_found_in_trash' => __('No encontrado en la papelera', 'air'),\n 'featured_image' => __('Imagen destacada', 'air'),\n 'set_featured_image' => __('Seleccionar imagen destacada', 'air'),\n 'remove_featured_image' => __('Eliminar Imagen destacada', 'air'),\n 'use_featured_image' => __('Use as featured image', 'air'),\n 'insert_into_item' => __('Insertar Servicio', 'air'),\n 'uploaded_to_this_item' => __('Uploaded to this item', 'air'),\n 'items_list' => __('Items list', 'air'),\n 'items_list_navigation' => __('Items list navigation', 'air'),\n 'filter_items_list' => __('Filter items list', 'air'),\n );\n $args = array(\n 'label' => __('Servicio', 'air'),\n 'description' => __('Agregar servicios en la home', 'air'),\n 'labels' => $labels,\n 'supports' => array('title', 'editor', 'thumbnail', 'revisions'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 20,\n 'menu_icon' => 'dashicons-portfolio',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => false,\n 'can_export' => true,\n 'has_archive' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'rewrite' => false,\n 'capability_type' => 'page'\n );\n register_post_type('services', $args);\n }", "function _register_post_type(){\r\n\t\t$labels = array(\r\n\t\t'name' => __( 'Invoices',WPIU_LANG),\r\n\t\t'singular_name' => __( 'Invoice',WPIU_LANG ),\r\n\t\t'add_new' => __('Add New',WPIU_LANG),\r\n\t\t'add_new_item' => __('Add New Invoice',WPIU_LANG),\r\n\t\t'edit_item' => __('Edit Invoice',WPIU_LANG),\r\n\t\t'new_item' => __('New Invoice',WPIU_LANG),\r\n\t\t'view_item' => __('View Invoice',WPIU_LANG),\r\n\t\t'search_items' => __('Search Invoice',WPIU_LANG),\r\n\t\t'not_found' => __('No Invoices found',WPIU_LANG),\r\n\t\t'not_found_in_trash' => __('No Invoices found in Trash',WPIU_LANG), \r\n\t\t'parent_item_colon' => ''\r\n\t );\r\n\t \r\n\t $args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'public' => true,\r\n\t\t'exclude_from_search' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'rewrite' => true, \r\n\t\t'query_var' => true,\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n\t\t'supports' => array('title','editor'),\r\n\t\t'menu_icon' => WPIU_IMG .'16/icon.png'\r\n\t ); \r\n\t \r\n\t register_post_type( __( 'wpiu-invoices' , WPIU_LANG), $args);\r\n\t\t\r\n\t}" ]
[ "0.76566994", "0.7492201", "0.7488478", "0.7483771", "0.7480958", "0.7425837", "0.74089557", "0.739667", "0.7395144", "0.7385094", "0.7383754", "0.7378702", "0.73785555", "0.73764503", "0.7374488", "0.73579264", "0.73568875", "0.73433954", "0.7342912", "0.7323041", "0.73130983", "0.73045313", "0.7304435", "0.7297118", "0.7283083", "0.7263966", "0.7262904", "0.7262646", "0.72577703", "0.7248596", "0.72343487", "0.7227676", "0.72169864", "0.7216786", "0.7212124", "0.72117275", "0.7209797", "0.7205667", "0.72009844", "0.71943116", "0.7170361", "0.71697694", "0.7169178", "0.7165621", "0.7134722", "0.7132626", "0.7123426", "0.7120286", "0.7119988", "0.7116796", "0.7114608", "0.7114608", "0.71015346", "0.71015346", "0.71015346", "0.71015346", "0.7096782", "0.7094606", "0.7094044", "0.70891225", "0.7086629", "0.7086396", "0.7075019", "0.7074327", "0.7071854", "0.70666414", "0.70650876", "0.70645297", "0.7062511", "0.7052288", "0.7051672", "0.70501965", "0.7047018", "0.704575", "0.7043711", "0.7042666", "0.70404243", "0.70359313", "0.7034198", "0.7030191", "0.7027663", "0.70261943", "0.7023686", "0.70203966", "0.7015724", "0.701532", "0.70124793", "0.7011413", "0.70074993", "0.70041764", "0.69949776", "0.6993807", "0.6992016", "0.6991889", "0.69900775", "0.69884694", "0.698639", "0.6982468", "0.69814754", "0.69773465" ]
0.78290594
0
/ === Hero Images ===
/ === Картинки героев ===
function heroImage($post) { $heroUrl = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); if ($heroUrl) { $position = get_post_meta($post->ID, '_ohHeroPosition')[0]; $position = ($position) ? $position . '%' : 0; $atts = "background-image:url('$heroUrl'); background-position:0 $position;"; echo "<div style=\"$atts\" class=\"header jumbotron\"></div>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hero_image()\n{\n return Hero_Customize::hero_image_partial();\n}", "function mw_do_hero()\n{\n ?>\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <img src=\"assets/images/hero-image.png\" alt=\"Hero Image\"/>\n </div>\n </div>\n <?php\n}", "private function renderHero() :string\n\t{\n\t\t$hero = '';\n\t\tif(isset($this->page->images[0])) {\n\t\t\t$imageUrl = $this->getBasePath().$this->page->images[0]->resize(1200, 0);\n\t\t\t$hero = $this->templateParser->render($this->tpls['hero'], [\n\t\t\t\t'SRC' => $imageUrl,\n\t\t\t\t'INFO' => $this->parsedown()->text($this->page->images[0]->title)\n\t\t\t]);\n\t\t}\n\t\treturn $hero;\n\t}", "function bb_get_hero_images($post = null, &$last_id = null) {\n $post = get_post($post);\n\n $transients = defined(WP_BB_ENV) && WP_BB_ENV == 'PRODUCTION'; // Set this to false to force all transients to refresh\n $transient = ns_.'hero_'.$post->ID.'_';\n if (false === $transients) {\n delete_transient($transient);\n }\n\n if ($post instanceof WP_Post) {\n $large_hero_meta = get_value_from_hierarchy('hero_image', $post->ID, $last_id);\n if (!empty($large_hero_meta)) {\n $large_image = wp_get_attachment_image_src($large_hero_meta, 'full');\n $large_hero = $large_image[0];\n }\n }\n if (empty($large_hero)) {\n $large_hero = get_value_from_hierarchy('featured_image', $post->ID, $last_id);\n }\n\n if ($post instanceof WP_Post) {\n $medium_hero_meta = get_value_from_hierarchy('hero_image_medium', $post->ID);\n if (!empty($medium_hero_meta)) {\n $medium_image = wp_get_attachment_image_src($medium_hero_meta, 'full');\n $medium_hero = $medium_image[0];\n }\n }\n if (empty($medium_hero)) {\n $medium_hero = $large_hero;\n }\n if ($post instanceof WP_Post) {\n $small_hero_meta = get_value_from_hierarchy('hero_image_small', $post->ID);\n if (!empty($small_hero_meta)) {\n $small_image = wp_get_attachment_image_src($small_hero_meta, 'full');\n $small_hero = $small_image[0];\n }\n }\n if (empty($small_hero)) {\n $small_hero = $large_hero;\n }\n\n $images = array(\n 'large' => $large_hero,\n 'medium' => $medium_hero,\n 'small' => $small_hero,\n );\n if (true === $transients) {\n set_transient($transient, $images, LONG_TERM);\n }\n unset($transient);\n\n return $images;\n}", "public function mosaicImages () {}", "public function hero()\n\t{\n\t\t$status = get_post_status();\n\t\t$title = $status !== 'auto-draft' ? get_the_title() : null;\n\n\t\t$hero = [\n\t\t\t'image_json' => get_field('hero_image_json') ?: get_post_thumbnail_id(),\n\t\t\t'title' => get_field('hero_title') ?: $title\n\t\t];\n\n\t\treturn \\App\\arr_to_obj($hero);\n\t}", "public static function viewImages(){\n //gets breed and sub breed from query string\n $breed = $_GET['breed'] ?? null;\n $subBreed = $_GET['subbreed'] ?? null;\n if(isset($breed)){ //checks if there's a breed\n $endpoint = file_get_contents(\"https://dog.ceo/api/breed/$breed/images\");\n $altText = \"Picture of $breed\";\n if(isset($subBreed)){ //changes $endpoint if there's a sub breed\n $endpoint = file_get_contents(\"https://dog.ceo/api/breed/$breed/$subBreed/images\");\n $altText .= \" $subBreed\";\n }\n $imageArray = json_decode($endpoint, true)['message'];\n foreach($imageArray as $image){\n echo \"<img src='$image' class='rounded' alt='$altText'>\";\n }\n }\n }", "function premix_hero_image($css = '')\n\t{\n\t\t$background_image_url = premix_option('premix_blog_header_image');\n\n\t\treturn $css . sprintf('.premix-welcome-section { background-image: url(%s); }', $background_image_url); \n\t}", "function getHeroes()\n {\n $result = [];\n $path = './assets/images/heroes/';\n foreach (scandir($path) as $file)\n {\n if(is_file($path . $file))\n {\n $result[] = (pathinfo($file))['filename'];\n }\n }\n return $result;\n }", "public function get_hero_image_css() {\n\t\t$theme_options_hero_url = $this->get_value( 'wpcr-header-hero-image' );\n\t\t$featured_image_uri = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );\n\n\t\tif ( $featured_image_uri[0] == '' ) {\n\t\t\tif ( ( $theme_options_hero_url != '' ) && is_front_page() ) {\n\t\t\t\t$url = $theme_options_hero_url; \n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t} \n\t\t} else {\n\t\t\t\t$url = $featured_image_uri[0];\n\t\t\t}\n\n\t\tif ( $url != '' ) {\n\t\t\treturn sprintf('%2$s.hero-image_background { background-image: url(\\'%1$s\\'); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\\'%1$s\\',sizingMethod=\\'scale\\');}',\n\t\t\t\t\tesc_url( $url ),\n\t\t\t\t\t( is_front_page() ) ? '.home ' : ''\n\t\t\t\t\t);\n\t\t}\n\t}", "public function teaserImages()\n {\n $this->initView('teaserImagesVP');\n\n $ras = $this->boxes->getRandomArticles(8, 'exclude', 'pages');\n $this->view->data = $this->boxes->articleObjs2Array($ras);\n\n $this->view->drawPage();\n }", "public function index()\n {\n \t$img = Image::make(public_path('/images/before/IMG_courthouse.jpg'));\n \t$img->save(public_path('/images/courthouse.jpg'));\n \n return view('/welcome', compact('img'));\n }", "public function getImage () {}", "private function get_hero() {\n $hero_data = [\n 'featured_title' => get_the_title(),\n ];\n\n $_hero = [\n 'classes' => 'hero hero--single-product',\n 'fields' => [\n 'hero__mobile_img' => get_field('product__mobile_img', $this->product_id),\n 'hero__desktop_img' => get_field('product__desktop_img', $this->product_id),\n ],\n 'extras' => [\n 'variant' => 'recipes',\n 'supplemental-data' => $hero_data,\n ],\n ];\n\n return $_hero;\n }", "function Header()\r\n{\n\t$this->Image(\"sfondo_mrp.jpg\",2,2,295,205);\r\n}", "public function image() {\n\t\tif ( ! Image::get()->has_images() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$image = current( Image::get()->get_images() );\n\t\t$this->tag( 'twitter:image', esc_url( $image['url'] ) );\n\t}", "public function run()\n {\n $images = ['https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRVeCaI9OnzB4_nJJB2z6K4Jmm4qISkVbFYKUdpkgs1h6XRQ7mY' ,'https://images.pexels.com/photos/356378/pexels-photo-356378.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', 'https://images.pexels.com/photos/356378/pexels-photo-356378.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', 'https://previews.123rf.com/images/leungchopan/leungchopan1110/leungchopan111000143/10765853-white-pomeranian-dog.jpg', 'https://images.pexels.com/photos/20787/pexels-photo.jpg?cs=srgb&dl=adorable-animal-cat-20787.jpg&fm=jpg', 'https://d17fnq9dkz9hgj.cloudfront.net/uploads/2012/11/101438745-cat-conjunctivitis-causes.jpg', 'https://wallpaperose.com/wp-content/uploads/2013/07/Kitten-Laughing-Pictures.jpg', 'https://www.rd.com/wp-content/uploads/2017/03/01-Sorry-But-Your-Cat-Might-Not-Be-Purring-Because-It%E2%80%99s-Happy-to-See-You_553563301-Sidarta-1024x683.jpg', 'https://cdn.pixabay.com/photo/2016/03/28/10/05/kitten-1285341__340.jpg', 'https://www.rover.com/blog/wp-content/uploads/2019/03/white-cat-4025572_1920-960x540.jpg', 'https://pbs.twimg.com/profile_images/378800000532546226/dbe5f0727b69487016ffd67a6689e75a_400x400.jpeg', 'https://catcaretips.net/wp-content/uploads/2019/03/hosico.jpg', 'https://cmeimg-a.akamaihd.net/640/clsd/getty/c64f76dc20c246ca88ee180fe4b4b781', 'https://cdn.pixabay.com/photo/2016/12/13/05/15/puppy-1903313__340.jpg', 'https://www.chicagoparent.com/downloads/21168/download/adorable-puppy.jpg?cb=ceb03b5cdefa3c132db18811980d0ee2&w=640', 'http://wallperio.com/data/out/377/puppy-pic_617570327.jpg', 'https://www.guidedogsvictoria.com.au/wp-content/uploads/2016/07/guide-dogs-mobility.jpg', 'https://upload.wikimedia.org/wikipedia/commons/2/2b/WelshCorgi.jpeg', 'https://a-z-animals.com/media/animals/images/470x370/dog5.jpg', 'https://media.mnn.com/assets/images/2017/01/puppy-held-in-womans-hands.jpg.653x0_q80_crop-smart.jpg', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSe90NBe2yPOgRsX9etQya23tinxc-lNdsncVO7pKUrWKgGMAx-', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRCP_RLcZ9pNoFXKZkypc61dF089l_hjitPjT-RJ2sebI3Ahifd'];\n\n foreach($images as $image_url) {\n $image = new Image();\n $image->image = $image_url;\n $image->pet_id = rand(1, 10);\n $image->save();\n }\n }", "public function image()\n {\n //return View::make('blog/index');\n return View::make('perchviews/gallery/example-b/image'); //new for 5.0\n }", "public function getImageScene () {}", "public function imagesAction(){\r\n //Magic in view\r\n }", "public function getImage() {}", "public function getImageCompose () {}", "public function index($slug){\n\n $this->view->title(trans('Header Images'));\n return $this->view->render('media/header_images',[\n 'slider_images' => collect(HeaderImage::all()),\n 'dirs' => array_slice(scandir('storage/images/header_images'),2),\n ]);\n }", "public function definition()\n {\n $images = [\n 'https://i.pinimg.com/564x/f5/1b/71/f51b71c5050e2f73c2d58fb5d384bd4d.jpg',\n 'https://i.pinimg.com/564x/bc/f0/af/bcf0afaf97e7d7e7182c50614f6512d0.jpg',\n 'https://i.pinimg.com/564x/84/5f/c8/845fc8c9906fd49dbbcf3f3632170ab2.jpg',\n 'https://i.pinimg.com/564x/b8/32/ea/b832ea7b638f5fc80a640229de340ffc.jpg',\n 'https://i.pinimg.com/564x/5b/8e/0c/5b8e0c970692323191a641b3e904e553.jpg',\n 'https://i.pinimg.com/564x/48/79/72/487972c5fbb09317fc0a61cb4457a9fb.jpg',\n 'https://i.pinimg.com/564x/c8/6d/e9/c86de9fef5e250e328a3940fbe0ee19d.jpg',\n 'https://i.pinimg.com/564x/20/65/70/206570e20a6094e991e5ff0edb47c81a.jpg',\n 'https://i.pinimg.com/564x/01/7f/e4/017fe4f78063730f3065bdbd093c4b8f.jpg',\n 'https://i.pinimg.com/564x/bc/f0/af/bcf0afaf97e7d7e7182c50614f6512d0.jpg',\n 'https://awsimages.detik.net.id/community/media/visual/2020/02/25/3b0eff5f-a1a2-4969-9ef5-006e3d886d07.jpeg',\n 'https://static.tripzilla.com/thumb/d/9/73689_700x.jpg',\n 'https://jejakpiknik.com/wp-content/uploads/2021/03/pemandangan-gunung-di-cirebon.jpg',\n 'https://httpbigdayamuliatrans.files.wordpress.com/2017/10/78ciremai446754427.jpg',\n 'https://www.yukpiknik.com/wp-content/uploads/2015/12/WP_20140512-4.jpg',\n 'https://asset.kompas.com/crops/SoV9Gbjt5lPyauSVwNduptwNjZk=/0x0:780x520/750x500/data/photo/2019/06/18/2282931801.jpg',\n 'http://www.adventuretravel.co.id/uploads/9/8/4/1/98413240/published/531522843.jpg?1490708475',\n 'https://cdn-image.hipwee.com/wp-content/uploads/2019/09/hipwee-4-4.jpg',\n 'https://cdn.idntimes.com/content-images/post/20180713/82258cecfdae1445e8f7ff8c8229107a.jpg',\n 'https://www.indonesia.go.id/assets/upload/headline//1546940840_gunung_krakatau_624x351.jpg',\n ];\n\n $categories = Category::all();\n\n return [\n 'category_id' => $categories[rand(0, $categories->count() - 1)]->id,\n 'image' => $images[rand(0, count($images) - 1)],\n ];\n }", "public function actionImages() {\n $url = WS_PHIS_APP_PATH . \"images?embed=true&token=\" . Yii::$app->session['access_token'] . \"&lang=\" . Yii::$app->language;\n return $this->render('images',[\n 'url'=>$url\n ]);\n }", "public function getImageMatte () {}", "public function flopImage () {}", "function createResizedImages(){\n\t\t$this->createLarge();\n\t\t$this->createMedium();\n\t\t$this->createSmall();\n\t\t$this->createThumbnail();\n\t\t$this->createSquare();\n\t}", "function mobiconnector_category_image($params = array(), $echo = false){\r\n bamobile_mobiconnector_category_image($params, $echo);\r\n}", "function mobiconnector_category_image_src($params = array(), $echo = false){\r\n bamobile_mobiconnector_category_image_src($params,$echo);\r\n}", "function gym_hero_image() {\n $front_page_id = get_option('page_on_front'); // located @ wp-admin/options.php\n $image_id = get_field('hero_image', $front_page_id); // located @ wp home page ACF hero image\n $image = $image_id['url'];\n\n // Create a false stylesheet\n wp_register_Style('custom', false);\n wp_enqueue_style('custom');\n\n $featured_image_css = \" \n body.home .site-header {\n background-image: linear-gradient( rgba(0,0,0, 0.75), rgba(0,0,0, 0.75) ), \n url( $image );\n background-size: cover; \n }\n \";\n // Dynamically add to front end\n wp_add_inline_style('custom', $featured_image_css);\n\n}", "public function testcode()\n {\n // open an image file\n\t\t$img = Image::make(public_path('saber.jpg'));\n\t\t// now you are able to resize the instance\n\t\t$img->resize(320, 240);\n\t\t\n\t\t// and insert a watermark for example\n\t\t$img->insert(public_path('watermarko.png'));\n\t\t\n\t\t// finally we save the image as a new file\n\t\t$img->save('saber-final.jpg');\n\t\t\n }", "public function getImage(){ }", "public function showImage() {\n \n $image = \"../Images/header.jpg\";\n\n return $this->render('base.html.twig', ['image' => $image]);\n }", "private static function get_available_homepage_images()\n {\n }", "public function testContactPageWithSpecificPic()\n {\n $this->visit($this->appurl . '/contacts/aaron')\n ->see('<img src=\"/assets/profile-images/aaronparecki.com/image\" alt=\"\" class=\"u-photo\">');\n }", "function hsk_talent_title_image($post_id, $img_width=\"150\", $img_height=\"150\"){\n if( hsk_talents_opt_data('disable_titlebar_talent_img', '0') != '1' ){\n echo '<div class=\"avathar\">';\n echo hsk_talent_featured_ribbon_img($post_id);\n $thumb = get_the_post_thumbnail_url(esc_attr($post_id));\n if( !empty($thumb) ){\n echo '<img class=\"wp-post-image\" alt=\"'.get_the_title().'\" src=\"'.hsk_image_crop($thumb, $img_width, $img_height, true, 'tc', false).'\" title=\"'.get_the_title().'\">';\n }else{\n echo hsk_talent_placeholder($img_width, $img_height);\n }\n echo '</div>';\n }\n}", "abstract public function getImage();", "static function headerPic() {\r\n ?>\r\n <!-- Header -->\r\n <header class=\"w3-display-container w3-content w3-wide w3-opacity-min\" style=\"max-width:1600px;min-width:500px\" id=\"home\">\r\n <img class=\"home-image\" src=\"img\\home.jpg\" alt=\"Home Pic\" >\r\n </header>\r\n\r\n <?php\r\n }", "function get_random_header_image()\n{\n}", "public static function getHeroImage($id, $full = true) {\n //We check if the heroes database has already been loaded on the session.\n $session = Session::instance();\n \n if($session->get('heroes') == null) {\n Helpers_Dota::getHeroesDatabase();\n }\n \n $heroes = $session->get('heroes');\n $name = null;\n \n foreach($heroes as $hero) {\n if($hero->id == $id) {\n $name = str_replace(\"npc_dota_hero_\", \"\", $hero->name);\n }\n }\n \n if($full) {\n return \"http://media.steampowered.com/apps/dota2/images/heroes/{$name}_full.png\";\n } else {\n return \"http://media.steampowered.com/apps/dota2/images/heroes/{$name}_sb.png\";\n }\n }", "function clanpress_the_logo_image( $size = 'thumbnail' ) {\n $settings = Clanpress_Settings::instance()->get_values( 'admin' );\n if ( !empty( $settings['logo'] ) ) {\n echo clanpress_get_image( (int) $settings['logo'], $size );\n }\n}", "public function show(Heroes $heroes)\n {\n //\n }", "public function getImagePage () {}", "public function testImages(FunctionalTester $I) {\n $I->logInWithRole('administrator');\n $I->amOnPage('/media/add');\n $I->click('Bulk Upload');\n $I->dropFileInDropzone(__DIR__ . '/logo.jpg');\n $I->click('Upload');\n $I->fillField('Name', 'Logo File');\n $I->click('.claro-details summary');\n $I->uncheckOption('Decorative Image');\n $I->fillField('Alternative text', 'Stanford Logo');\n $I->click('Save');\n $I->canSee('Saved 1 Media Items');\n $I->canSeeInCurrentUrl('/admin/content/media');\n $I->canSee('Logo File');\n }", "function image($id) {\n\t\t\t$image = $id;\n\t\t\tif ( -1 == $image ) {\n\t\t\t\t$image = get_template_directory_uri(). '/img/promo-placeholder.jpg';\n\t\t\t} else {\n\t\t\t\t$image = wp_get_attachment_url($id);\n\t\t\t}\n\t\t\techo($image);\n\t}", "function showImage($input, $file)\r\n{\r\n $title = $input[ 'title' ];\r\n $description = $input[ 'description' ];\r\n $image = $file[ 'name' ];\r\n echo <<<story12\r\n <div class=\"top10\">\r\n <h2>$title</h2>\r\n <img src=\"/assets/images/$image\" width=\"200\">\r\n <p>$description</p>\r\n </div>\r\nstory12;\r\n}", "public function run()\n {\n DB::table('image')->insert([\n 'name' => '/img/1.png',\n 'hero_id' => '1'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/2.png',\n 'hero_id' => '2'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/3.png',\n 'hero_id' => '3'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/4.png',\n 'hero_id' => '4'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/5.png',\n 'hero_id' => '5'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/6.png',\n 'hero_id' => '6'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/7.png',\n 'hero_id' => '7'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/8.png',\n 'hero_id' => '8'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/9.png',\n 'hero_id' => '9'\n ]);\n DB::table('image')->insert([\n 'name' => '/img/10.png',\n 'hero_id' => '10'\n ]);\n }", "function header_image()\n{\n}", "function cgalleries_images($item)\n\t{\n\t\t$gallery = mgalleries_read($item);\n\t\t$data['images'] = mgalleries_read_images($gallery['id']);\n\t\t$data['gal'] = $gallery;\n\t\tlloader_load_view('admin/subs/gallery_images', $data);\n\t}", "public function images($img_name=null){\n \n $userpath=$this->user->check_image_path();\n \n if(empty($img_name) || $img_name==\"null\"){\n \n echo file_get_contents(\"/public/image/noimage.jpg\");\n \n }else if($userpath!=\"\"){\n \n \n $immagine = $userpath.$img_name;\n echo file_get_contents($immagine);\n \n }\n \n \n exit;\n \n }", "public function index() {\n $this->manageImage();\n }", "public function logo();", "function clanpress_the_header_image( $size = 'thumbnail' ) {\n $settings = Clanpress_Settings::instance()->get_values( 'admin' );\n if ( !empty( $settings['header'] ) ) {\n echo clanpress_get_image( $settings['header'], $size );\n }\n}", "public function image(){\n $images = Image::all();\n return view('admin.contents.image-admin', compact('images'));\n }", "function gymfitness_hero_image(){\n\n $front_page_id = get_option('page_on_front');\n $image_id = get_field('hero_image', $front_page_id);\n $image = $image_id['url'];\n\n // Create a \"FALSE\" stylesheet\n wp_register_style('custom', false);\n wp_enqueue_style('custom');\n\n $featured_image_css = \"\n \n body.home .site-header{\n background-image: linear-gradient( rgba(0,0,0, 0.75), rgba(0,0,0, 0.75)), url( $image );\n background-size: cover;\n background-position: center;\n }\n \n \";\n wp_add_inline_style('custom', $featured_image_css);\n\n}", "function ufclas_emily_landing_hero($atts, $content = NULL ) {\n\n extract( shortcode_atts(\n array(\n 'headline' => '',\n 'subtitle' => '',\n 'hide_button' => 1,\n 'button_text' => '',\n 'button_link' => '#',\n 'image' => ''\n ), $atts )\n );\n\n // Support either image ID or image url\n $image = ( is_numeric( $image ) )? wp_get_attachment_image_src( $image, 'large' ) : array($image);\n $image_style = '';\n $subtitle = (!empty( $subtitle ))? $subtitle : '';\n\n\n\n // Add background and gradient class if image exists\n if ( !empty($image[0]) ){\n $image_class ='';\n $image_class .= ' gradient-bg';\n $image_style = 'style=\"background-image:url(\\'' . esc_url( $image[0] ) . '\\');\"';\n }\n\n // Shortcode callbacks must return content, so use output buffering\n ob_start();\n ?>\n <section class=\"landing-page-hero-full\" id=\"hero-image\" aria-label=\"top\">\n <div class=\"hero-img<?php echo $image_class; ?>\" <?php echo $image_style; ?>>\n <div class=\"hero-heading\">\n <?php\n echo '<h2>' . esc_html( $headline ) . '</h2>';\n\n if ( !empty($subtitle) ){\n echo '<h3>' . esc_html( $subtitle ) . '</h3>';\n }\n ?>\n </div>\n </div>\n\n <?php if ( !empty( $content ) ): ?>\n <div class=\"hero-text\">\n <div class=\"container\">\n <div class=\"col-sm-10 col-sm-offset-1\">\n <?php echo wpautop( wp_kses_post( $content ) ); ?>\n\n <?php if ( !empty($button_text) ){ ?>\n <a href=\"<?php echo esc_url( $button_link ); ?>\" class=\"btn\"><?php echo esc_html( $button_text ); ?> <span class=\"arw-right icon-svg\"><svg><use xlink:href=\"<?php echo get_stylesheet_directory_uri(); ?>/img/spritemap.svg#arw-right\"></use></svg></span></a>\n <?php } ?>\n </div>\n </div>\n </div>\n <?php endif; ?>\n </section>\n <?php\n return ob_get_clean();\n }", "public function get_image_title()\n {\n }", "function Images($httpReferer) {\n $this->connect = new Connection('pictunex');\n\n $_result = $this->connect->getDB()->prepare(\"SELECT id, COUNT(id) AS NUM_IMAGES FROM images\");\n\n if($_result->execute())\n $this->num_images_in_storage = $_result->fetch(PDO::FETCH_ASSOC)['NUM_IMAGES'];\n else die();\n\n //Reset path to storage imgs\n $this->pathIMG = preg_replace(\"/(api\\S)+(inc\\S)+(class)/i\", \"public\\\\img\\\\\", __DIR__);\n\n //Url Public to get access __defined__ http_host\n $this->urlPublicImg = preg_replace(\"/api\\/index.*/\", \"\", php_self) . \"public/img/\";\n\n //Categories\n $this->categories = [\"categories\" => [\n \"animals\",\n \"scenery\",\n \"nature\",\n \"fantasy\",\n \"technology\",\n \"science\",\n \"fashion\",\n \"architecture\",\n \"industry \"]];\n \n }", "public function run()\n {\n $hero = HeroMain::create([\n 'title' => 'Powerful Digital Solutions With Gp.',\n 'alias' => 'hero',\n 'text' => 'We are team of talented digital marketers',\n 'background_image' => 'hero-bg.jpg',\n 'status' => 1,\n ]);\n\n $hero->heroIconBoxes()->createMany([\n [\n 'title' => 'Lorem Ipsum',\n 'alias' => 'lorem-ipsum',\n 'icon' => 'ri-store-line',\n 'status' => 1,\n ],\n [\n 'title' => 'Dolor Sitema',\n 'alias' => 'dolor-sitema',\n 'icon' => 'ri-bar-chart-box-line',\n 'status' => 1,\n ],\n [\n 'title' => 'Sedare Perspiciatis',\n 'alias' => 'sedare-perspiciatis',\n 'icon' => 'ri-calendar-todo-line',\n 'status' => 1,\n ],\n [\n 'title' => 'Magni Dolores',\n 'alias' => 'magni-dolores',\n 'icon' => 'ri-paint-brush-line',\n 'status' => 1,\n ],\n [\n 'title' => 'Nemos Enimade',\n 'alias' => 'nemos-enimade',\n 'icon' => 'ri-database-2-line',\n 'status' => 1,\n ]\n ]);\n }", "public static function get($hero, $skill)\n {\n // Break out each step of the skill ID so it's an array.\n $steps = explode('_', $skill);\n\n // Grab the Hero, which we will use to get the skill details\n $selectedHero = Hero::where('name', $hero)->first();\n\n // Set the skill key and image URI. If the skill is a talent, it gets overriden below.\n $skillKey = strtoupper($steps[0]);\n $imageUri = \"/images/\" . preg_replace('/\\s+/', '', strtolower($hero)) . \"/\" . preg_replace('/\\s+/', '', strtolower($steps[0])) . \".png\";\n\n // Check if skill is primary, secondary, or tertiary\n if (!array_key_exists(1, $steps)) {\n // First we check if the skill follows the new way of making guides\n // by using the \"talentX\" name. This needs to get the image name\n // slightly differently.\n if ($steps[0] === 'talent1' || $steps[0] === 'talent2' || $steps[0] === 'talent3') {\n $talent = $steps[0];\n $selectedSkill = Skill::where('id', $selectedHero->$talent)->first();\n $skillKey = 'Talent';\n $imageUri = \"/images/\" . preg_replace('/\\s+/', '', strtolower($hero)) . \"/\" . preg_replace('/\\s+/', '', strtolower($selectedSkill->name)) . \".png\";\n // If it doesn't, it follows the old way with the actual skill name,\n // like \"Outgunned\". Here we make sure it's not a normal skill.\n } elseif ($steps[0] !== 'lmb' && $steps[0] !== 'rmb' && $steps[0] !== 'f' && $steps[0] !== 'q' && $steps[0] !== 'e') {\n $selectedSkill = Skill::where('name', $steps[0])->first();\n $skillKey = 'Talent';\n // Finally, if it's not either way of doing talents, it must\n // be a normal skill\n } else {\n $selectedSkill = $selectedHero->{$steps[0] . 'Ability'};\n }\n } elseif (!array_key_exists(2, $steps)) {\n // This means it's a secondary skill, like \"f_left\"\n $selectedSkill = $selectedHero->{$steps[0] . 'Ability'}->{$steps[1]};\n } else {\n // Here, it has to be a tertiary skill, like \"q_right_left\"\n $selectedSkill = $selectedHero->{$steps[0] . 'Ability'}->{$steps[1]}->{$steps[2]};\n }\n\n // Set each part of the finished skill\n $name = $selectedSkill->name;\n $description = $selectedSkill->description;\n\n // Finished object!\n $finishedSkill = collect([\n 'skillKey' => $skillKey,\n 'imageUri' => $imageUri,\n 'name' => $name,\n 'description' => $description,\n ]);\n\n return $finishedSkill;\n }", "function alienship_do_header_image() {\n\n\t$output = alienship_get_header_image();\n\tif ( $output )\n\t\techo apply_filters( 'alienship_header_image_output', $output['output'] );\n}", "public function getImageThumbnails() {}", "public function magnifyImage () {}", "function get_small_images($occasion){\n $images = [];\n foreach($occasion->algemeen->fotos as $foto){\n $images[$foto->alternatieven[0]->url] = $foto->url;\n }\n return $images;\n }", "function happy_admin_header_image() {\n\t?>\n\t<div id=\"headimg\">\n\t\t<?php $header_image = get_header_image();\n\t\tif ( ! empty( $header_image ) ) : ?>\n\t\t\t<img src=\"<?php echo esc_url( $header_image ); ?>\" class=\"header-image\" width=\"<?php echo get_custom_header()->width; ?>\" height=\"<?php echo get_custom_header()->height; ?>\" alt=\"\" />\n\t\t<?php endif; ?>\n\t</div>\n<?php }", "private static function draw_image_meta_tag() {\n if (in_array(ShareaholicUtilities::page_type(), array('page', 'post'))) {\n global $post;\n $thumbnail_src = '';\n \n if (function_exists('has_post_thumbnail') && has_post_thumbnail($post->ID)) {\n $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large');\n $thumbnail_src = esc_attr($thumbnail[0]);\n } \n if ($thumbnail_src == NULL) {\n $thumbnail_src = ShareaholicUtilities::post_first_image();\n }\n if ($thumbnail_src != NULL) {\n echo \"<meta name='shareaholic:image' content='\" . $thumbnail_src . \"' />\";\n }\n }\n }", "function carawebs_about_images( $size = 'full') {\n\nif(get_field('extra_images')):\n\n\t$i = 1;\n\n\twhile(has_sub_field('extra_images')):\n\n\t?><div class=\"box<?php echo ( $i > 2 ) ? ' topspace' : '' ;?>\"><?php\n\n\t$attachment_id = get_sub_field('about_image');\n\t//$size = \"medium\"; // (thumbnail, medium, large, full or custom size)\n \t$image = wp_get_attachment_image_src( $attachment_id, $size );\n\n\t\t// url = $image[0];\n\t\t// width = $image[1];\n\t\t// height = $image[2];\n\t\t?>\n\t\t\t<img src=\"<?php echo $image[0]; ?>\" />\n\t\t</div>\n\n\t\t<?php\n\t\t$i++;\n\n\tendwhile;\n\n\tendif;\n\n}", "function ufclas_emily_landing_double_image($atts, $content = NULL ) {\n\n\textract( shortcode_atts(\n\t\tarray(\n\t\t\t'headline' => '',\n\t\t\t'image1' => get_stylesheet_directory_uri() . '/img/_temp-landing-a-1.jpg',\n\t\t\t'image2' => get_stylesheet_directory_uri() . '/img/_temp-landing-a-2.jpg',\n\t\t), $atts )\n\t);\n\n\t// Support either image ID or image url\n\t$image1 = ( is_numeric( $image1 ) )? wp_get_attachment_image_src( $image1, 'large' ) : array($image1);\n\t$image2 = ( is_numeric( $image2 ) )? wp_get_attachment_image_src( $image2, 'large' ) : array($image2);\n\t$headline = (!empty( $headline ))? $headline : '';\n\n\t// Shortcode callbacks must return content, so use output buffering\n\tob_start();\n\t?>\n\t<div class=\"landing-page-hero\">\n \t<div class=\"container\">\n \t<div class=\"row\">\n <div class=\"col-sm-7 col-sm-pull-1\">\n <div class=\"img-hero\" style=\"background-image:url('<?php echo esc_url( $image1[0] ); ?>');\"></div>\n </div>\n <div class=\"col-sm-5 col-sm-offset-5 hero-content\">\n <h2><?php echo esc_html( $headline ); ?></h2>\n\t\t\t<?php echo wpautop( wp_kses_post( $content ) ); ?>\n </div>\n <div class=\"col-sm-7 secondary\">\n <div class=\"img-hero\" style=\"background-image:url('<?php echo esc_url( $image2[0] ); ?>');\"></div>\n </div>\n \t\t</div>\n \t</div>\n \t</div>\n\n <?php\n\treturn ob_get_clean();\n}", "function oniros_image_support(){\n\t// add as many as the project might require\n\t// smaller images do not get resized, but largeones will get cropped.\n\n\t// name width height crop?\n\tadd_image_size( 'logos-caja-cuadrada_1x', 320, 9999, false);\n\tadd_image_size( 'logos-caja-cuadrada_2x', 636, 9999, false);\n\tadd_image_size( 'logos-caja-cuadrada_3x', 954, 9999, false);\n\n\tadd_image_size( 'logos-pequeno-caja-echada_1x', 154, 9999, false);\n\tadd_image_size( 'logos-pequeno-caja-echada_2x', 308, 9999, false);\n\tadd_image_size( 'logos-pequeno-caja-echada_3x', 462, 9999, false);\n\n\tadd_image_size( 'logos-grande-caja-echada_1x', 250, 9999, false);\n\tadd_image_size( 'logos-grande-caja-echada_2x', 500, 9999, false);\n\tadd_image_size( 'logos-grande-caja-echada_3x', 750, 9999, false);\n\n\tadd_image_size( 'foto-principal-iniciativa_1x', 360, 270, true);\n\tadd_image_size( 'foto-principal-iniciativa_2x', 720, 540, true);\n\tadd_image_size( 'foto-principal-iniciativa_3x', 1080, 810, true);\n}", "function rovoko_ptitle_parallax_image() {\n\t$parallax_url = rovoko_get_opts( 'ptitle_parallax', [ 'url' => '' ] );\n\tif ( empty( $parallax_url['url'] ) ) {\n\t\treturn;\n\t}\n\t$titles = rovoko_get_page_titles();\n\techo '<div class=\"parallax\"><img src=\"' . esc_url( $parallax_url['url'] ) . '\" alt=\"' . esc_attr( $titles['title'] ) . '\" /></div>';\n}", "function image($img, $size)\n{\n\techo '<img src=\"//localhost/rute-master/application/public/img/'.$img.'\" width=\"'.$size.'\">';\n}", "public function get_uploaded_header_images()\n {\n }", "public function getLogo();", "public function getImages();", "public function image($guid)\n {\n $_directory = app_path('Testes');\n $_testfile = $_directory . DIRECTORY_SEPARATOR . $guid . '.php';\n\n if (!file_exists($_testfile)) {\n return redirect('/');\n }\n\n $instance = null;\n\n try {\n include_once $_testfile;\n $classes = get_declared_classes();\n $class = end($classes);\n $instance = new $class;\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n\n if ($instance === null) {\n die('Instancia não encontrada, verifique o nome do teste.');\n }\n\n if (!($instance instanceof TesteBase)) {\n die('A instância do teste deve extender para TesteBase.');\n }\n\n $user = new \\stdClass();\n $user->id = 1;\n $user->userid = '100000338520422';\n $user->name = 'Joseph Felix';\n $user->email = 'joseph0xfff@gmail.com';\n $user->gender = 'male';\n $user->birthday = '04/02/1994';\n $user->cover = 'https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/16797665_1385412144813390_2905649346573155634_o.jpg?oh=cda101f28263c0f285263b18f7ac153e&oe=59837AD8';\n $user->favorite_athletes = '[{\"id\":\"254448564717189\",\"name\":\"Daniel \\\\\"Kowuzo\\\\\" Chami\"},{\"id\":\"289579904475528\",\"name\":\"KamiKat\"},{\"id\":\"706706822675438\",\"name\":\"Jean \\\\\" Yu \\\\\" Escarabello\"},{\"id\":\"257692544257830\",\"name\":\"Diogo Silva\"}]';\n $user->favorite_teams = '[{\"id\":\"5985827589\",\"name\":\"Fnatic\"},{\"id\":\"193628340649726\",\"name\":\"Pain Gaming\"}]';\n\n $facebook = new FBLibrary($user);\n $instance->setFacebook($facebook);\n\n try {\n $image = $instance->render();\n } catch (\\Exception $e) {\n die($e->getTraceAsString());\n }\n\n if (!($image instanceof \\Intervention\\Image\\Image)) {\n die('$image precisa ser uma instância de \\Intervention\\Image\\Image');\n }\n\n $response = Response::make($image->encode('jpeg'));\n $response->header('Content-Type','image/jpeg');\n return $response;\n }", "public function getImagem()\n {\n }", "public function index( $hash = null, $size = '' ){\n \t\t$this->storage_path = storage_path() . '/uploads/' . $hash;\n \t\t$img = \\Image::cache( function( $image ) use ( $hash, $size ) {\n \t\t\tif ( $size ){\n \t\t\t\t$array_size = explode( 'x', $size );\n \t\t\t\tif ( !isset( $array_size[1] ) )\n \t\t\t\t\t$array_size[1] = $array_size[0];\n\n \t\t\t\treturn $image->make( $this->storage_path )->resize( $array_size[0], $array_size[1] );\n \t\t\t} else {\n \t\t\t\tlist( $width, $height ) = getimagesize( $this->storage_path );\n \t\t\t\tif ( $width > 1000 ){\n \t\t\t\t\treturn $image->make( $this->storage_path )->resize(1000, null, function( $constraint ){\n \t\t\t\t\t\t$constraint->aspectRatio();\n \t\t\t\t\t\t$constraint->upsize();\n \t\t\t\t\t});\n \t\t\t\t} else\n \t\t\t\t\treturn $image->make( $this->storage_path );\n \t\t\t}\n \t\t}, 10000, true );\n\n \t\treturn $img->response('jpg', 70 );\n \t}", "function mobibook_thumbnail($mobi) {\n\nglobal $dirindex_fugue_mobi;\n\n$title = USE_TITLE_SORT ? $mobi->get_title_sort() : $mobi->get_title();\n$authors_str = USE_AUTHOR_SORT ? $mobi->get_authors_sort_str() : $mobi->get_authors_str();\n$cover_url = $dirindex_fugue_mobi::cover_url($mobi);\n$filename = basename($mobi->filename);\n\n?>\n<!-- <?php echo $title; ?> -->\n<div class=\"mobibook_thumbnail\">\n<a title=\"<?php echo $filename; ?>\" href=\"<?php echo $filename; ?>\"><img class=\"mobibook_cover\" src=\"<?php echo $cover_url; ?>\" alt=\"[MOBI]\" /></a>\n\n<!-- Title -->\n<h1 class=\"mobibook_title\"><?php echo $title; ?></h1>\n<!-- END Title -->\n\n<!-- Author -->\n<h2 class=\"mobibook_author\"><?php echo $authors_str; ?></h2>\n<!-- END Author -->\n</div>\n<!-- END <?php echo $title; ?> -->\n<?php }", "function bamobile_mobiconnector_category_image_src($params = array(), $echo = false){\r\n if(class_exists('Mobiconnector_Categories_Avatar')){\r\n $image_header = BAMobile_Categories_Avatar::bamobile_get_category_image($params, true);\r\n \r\n if (!$echo) {\r\n return $image_header;\r\n }\r\n \r\n echo $image_header;\r\n }\r\n}", "function GetFotoProfileGuru(){\n\n if(!empty(Auth::user()->ugrFotoProfile)){\n $img = asset('storage/images/guru/original/'.Auth::user()->ugrFotoProfile);\n }\n else{\n $img = asset('image/noimage.png');\n } \n return $img;\n \n}", "public function getImageUrl();", "function display_post_pics($pic_array){\r\n $numb_pic= count($pic_array);\r\n if ($numb_pic !== 0) {\r\n $width = 100/$numb_pic;\r\n $height= 60/$numb_pic;\r\n echo \"<section class=\\\"main-post-img\\\">\";\r\n foreach ($pic_array as $name => $path) {\r\n $alt_name= explode(\".\", $name);\r\n echo \" <img style=\\\"margin: 0% auto; border-radius: 25px; height:$height%; width:$width%; width: auto\\9; /* ie8 */\\\" \r\n src=$path$name alt= $alt_name[0] >\";\r\n }\r\n echo \"</section>\";\r\n }\r\n }", "function loadSHUHUIImages($id) {\n $url='http://www.ishuhui.com/post/'.$id;\n $content=file_get_contents($url);\n preg_match_all(\"/<img src=\\\"(.*?)\\\" alt/\", $content, $output);\n $images=$output[1];\n array_shift($images);\n return $images;\n}", "function gymfitness_hero_image(){\n $front_page_id = get_option('page_on_front');\n $image_id = get_field('hero_image',$front_page_id);\n\n $image=$image_id['url'];\n\n wp_register_style('custom', false);\n wp_enqueue_style('custom');\n\n $featured_image_css =\"\n body.home .site-header{\n background-image: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)),url($image);\n }\n \";\n wp_add_inline_style('custom',$featured_image_css);\n }", "public function index()\n\t{\n\t\t$user = User::find(1);\n $user->imageUri = $user->images;\n \n\t\t$feats = Feat::all();\n foreach($feats as $feat)\n {\n \t$feat->imageUri = $feat->images;\n \t$feat->logo = Image::find($feat->logo);\n }\n\n\t\t$activities = Activity::all();\n\n $images = Image::all();\n\n // dd($user);\n\n\t\treturn view('about', compact('user', 'feats', 'activities', 'images'));\n\t}", "public function getImage() {\n //get the file type\n $fileType = substr(strrchr($this->URL, '.'), 1);\n \n //get the base path\n $basePath = Director::baseFolder() . DIRECTORY_SEPARATOR;\n //find or make a new folder\n $this->folder = Folder::find_or_make($this->folderName); // relative to assets\n //get the relative path to the file\n $this->relativeFilePath = $this->folder->Filename . $this->Title . '.' . $fileType;\n //get the full path\n $this->fullPath = $basePath . $this->relativeFilePath;\n \n //check to see if the file exist\n if (!file_exists($this->fullPath)){\n // download the file\n $fp = fopen($this->fullPath, 'w');\n $ch = curl_init($this->URL);\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 1000); // some large value to allow curl to run for a long time\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verifySSL);\n $data = curl_exec($ch);\n curl_close($ch);\n fwrite($fp, $data);\n fclose($fp);\n }\n }", "function image_for($img_name, $options=[]) {\n echo image_tag($img_name, $options);\n}", "public function getHeaderImage();", "public function index()\n {\n $image = Pic::getAllImage();\n $album = Album::getAlbums();\n return view('admin.image', ['image' => $image, 'album' => $album , 'title' => '图片管理']);\n }", "public function preview_image() : string\n {\n return 'header-area-style-05.png';\n }", "public function index()\n {\n \n \n $cover = Img::all(); \n \n \n \n \n return view('Img.index')\n ->with('cover',$cover)\n \n ;\n }", "function championLevel1($H_Level){\r\n if ($H_Level <= 7 && $H_Level >= 1 )\r\n {\r\n echo \" <img height='70' width='70' src='https://cdn.lols.gg/assets/images/champ-mastery/$H_Level.png'>\";\r\n }\r\n}", "function bundle_add_images() {\n}", "public function getImageUrl()\n {\n }", "function images()\n {\n //seoble, likeable, votable....\n return $this->morphMany(Image::class, 'imageble');\n }", "public function index()\n {\n /*\n * Retrieve all heroes using pagination\n */\n return Hero::paginate();\n\n }", "function show_sw_thumimg () {\n global $switem_defaults;\n $img_link = get_stylesheet_directory_uri().'/images/sw/thum/'.$switem_defaults['sw_image'];\n $img_options = '\" alt=\"\" class=\"switem-img-thum\" />';\n $line = '<img src=\"'.$img_link.$img_options;\n echo $line;\n}", "public function onStart(){\r\n // and get its absolute path and use it `getPath()`\r\n //$imagePath = 'https://yoursite/image.jpeg';\r\n $baseUrl = url(Config::get('cms.storage.media.path'));\r\n //$imagePath = getPath('app/media/glueup-membership.png');\r\n $imagePath = $baseUrl . '/meta/glueup-logo-meta.png';\r\n $this['fbImage'] = $imagePath; // image absolute path\r\n}", "function getImage();" ]
[ "0.72892505", "0.69429505", "0.6942891", "0.63616526", "0.62941504", "0.6212426", "0.6124036", "0.6012561", "0.5929538", "0.5897441", "0.58811164", "0.5847213", "0.5839608", "0.58218473", "0.58057725", "0.58054644", "0.57856125", "0.57641506", "0.57608724", "0.5754561", "0.57330537", "0.5723885", "0.5713596", "0.5709814", "0.5690499", "0.569036", "0.5688601", "0.5679224", "0.56786346", "0.5675114", "0.5668343", "0.5655227", "0.56512755", "0.5642838", "0.5634835", "0.56345636", "0.5613563", "0.56064075", "0.5592449", "0.55903846", "0.5583947", "0.55737287", "0.5562544", "0.5559849", "0.5543623", "0.55235255", "0.55064505", "0.54942405", "0.54818726", "0.54814", "0.54783845", "0.54725003", "0.54723084", "0.5465519", "0.5463809", "0.5447136", "0.5443772", "0.5438946", "0.54340535", "0.5428642", "0.54282814", "0.5427628", "0.5399602", "0.5399263", "0.53962404", "0.5384872", "0.5382343", "0.53783983", "0.5377577", "0.5371621", "0.53682613", "0.53642106", "0.5362191", "0.53587264", "0.53580225", "0.535534", "0.5354254", "0.53486377", "0.53482354", "0.5348099", "0.5337903", "0.53313524", "0.53304774", "0.5324952", "0.5316731", "0.53141505", "0.53136724", "0.5313278", "0.5308521", "0.53077686", "0.5306688", "0.52969986", "0.5296829", "0.52876914", "0.52852666", "0.5284618", "0.5280272", "0.52727497", "0.5270519", "0.5269783" ]
0.7193298
1
Sets the flag to collect pattern ids during this build
Устанавливает флаг для сбора идентификаторов шаблонов во время этого сбора
public function setCollectPatternIds(bool $value): void { $this->collectPatternIds = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setId($id){\r\n\t\t$this->patternId = $id;\r\n\t}", "function add_patterns($defined = true) {\n\t\t$this->add_timing_patterns($defined);\n\t\t$this->add_finder_patterns($defined);\n\t\t$this->add_separators($defined);\n\t\t$this->add_alignment_patterns($defined);\n\t\t$this->add_dark_module($defined);\n\t\t$this->add_format_information($defined);\n\t\t$this->add_version_information($defined);\n\t\t$this->log[] = $defined ? 'Patterns added to grid.' : 'Patterns prepared in grid.';\n\t}", "private function processReplacePattern () {\n $dataAttrName = Config::get('incutTemplate.dataAttrName');\n $dataAttrPatternName = Config::get('incutTemplate.dataAttrPatternName');\n $regexPattern = Config::get('incutTemplate.regex_extract_pattern');\n\n foreach ($this->findByAttributeName($dataAttrName) as $node) {\n if ($node->hasAttribute($dataAttrPatternName)) {\n $replacementValue = preg_replace_callback($regexPattern, function ($match) {\n if (array_key_exists(2, $match)) {\n switch ($match[2]) {\n case 'uniqueId':\n return $this->getUniqueId();\n }\n }\n }, $node->getAttribute($dataAttrPatternName));\n\n $node->setAttribute($node->getAttribute($dataAttrName), $replacementValue);\n }\n $node->removeAttribute($dataAttrName);\n $node->removeAttribute($dataAttrPatternName);\n }\n }", "public function resetFeedIds()\n {\n foreach ($this->options as $op=>$junk) {\n if (preg_match('#FeedSubmissionIdList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }", "function add_finder_patterns($defined = true) {\n\t\t$ar_pattern = $this->ar_pattern['finder'];\n\t\tif(!$defined) {\n\t\t\tforeach($ar_pattern as $k=>$v) {\n\t\t\t\tforeach($v as $vk => $vv) {\n\t\t\t\t\t$ar_pattern[$k][$vk] = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->_inject($ar_pattern, 0, 0);\n\t\t$this->_inject($ar_pattern, -7, 0);\n\t\t$this->_inject($ar_pattern, 0, -7);\n\t}", "public function setPattern($pattern);", "public function setPattern($pattern);", "public function getId(){\r\n\t\treturn $this->patternId;\r\n\t}", "public function setPattern($pattern) {\n $this->addOption('pattern', $pattern);\n return $this;\n }", "protected function pattern()\n { \n return str_replace('%keyword%', implode('|', $this->options['keyword']), $this->options['pattern']);\n }", "private function initDebugIds(bool $created = false): void\n {\n $this->debugIdAsString = (string)$this->id;\n $this->debugObjectHash = spl_object_hash($this);\n if (false === $created) {\n return;\n }\n static $increment = 0;\n $this->debugCreationIncrement = ++$increment;\n }", "protected function resetPackageIds()\n {\n foreach ($this->options as $op=>$junk) {\n if (preg_match('#PackageLabelsToPrint#', $op)) {\n unset($this->options[$op]);\n }\n }\n }", "function set_ids_to_ignore( $ids = array() ) {\n\t\tif ( ! is_array( $ids ) ) {\n\t\t\t$ids = preg_split( $this->regex['parameterSplitting'], $ids, -1, PREG_SPLIT_NO_EMPTY );\n\t\t}\n\t\t$this->settings['ignoreIDs'] = $ids;\n\t}", "public function pattern($pattern)\r\n {\r\n $this->pattern[] = $pattern;\r\n\r\n return $this;\r\n }", "public function setPattern( $regex ) {\n\t\t$this->owner->pattern = $regex;\n\t}", "public function setPattern($newPattern)\n {\n $this->pattern = $newPattern;\n }", "protected function rewriteFlags()\n {\n foreach (['anonymous', 'hr'] as $flag) {\n $config = config('torrent_upload.enable_' . $flag);\n if ($config == 2) { // if global config force enabled this flag\n $this->$flag = 1;\n } elseif ($config == 0) { // if global config disabled this flag\n $this->$flag = 0;\n } else { // check if user can use this flag\n if (!\\Rid\\Helpers\\ContainerHelper::getContainer()->get('auth')->getCurUser()->isPrivilege('upload_flag_' . $flag)) {\n $this->$flag = 0;\n }\n }\n }\n }", "protected function set_match_pattern( $query ) {\n\n\t\t$this->pattern = \"/\".$query.\"/i\";\n\t}", "public function distinct($flag) {\n $this->distinct = ($flag !== false);\n }", "public function init($pattern)\n\t{\n\t\t$this->pattern = (array) $pattern;\n\t}", "private function setTeamMemberIds()\n {\n foreach ($this->team as $teamMember) {\n \t$this->teamMemberIds[] = $teamMember->getId();\n } \n }", "private function importPatterns()\n\t{\n\t\tif (!empty($this->handlers)) {\n\t\t\t$types = array();\n\t\t\tforeach ($this->handlers as $key=>$value) {\n\t\t\t\t$types[] = \"'\".$value.\"'\";\t// When working on string, the values should be inside single quotes.\n\t\t\t}\n\t\t\t$types_str = implode(\",\", $types);\n\t\t\t$query = \"SELECT r.rewrite_name, p.pattern_type, p.pattern_source, p.pattern_target, p.pattern_cat FROM \".DB_PREFIX.\"permalinks_patterns p INNER JOIN \".DB_PREFIX.\"permalinks_rewrites r WHERE r.rewrite_id=p.pattern_type AND r.rewrite_name IN(\".$types_str.\") ORDER BY p.pattern_type\";\n\t\t\t$this->queries[] = $query;\n\t\t\t$result = dbquery($query);\n\t\t\tif (dbrows($result)) {\n\t\t\t\twhile ($data = dbarray($result)) {\n\t\t\t\t\tif ($data['pattern_cat'] == \"normal\") {\n\t\t\t\t\t\t$this->pattern_search[$data['rewrite_name']][] = $data['pattern_source'];\n\t\t\t\t\t\t$this->pattern_replace[$data['rewrite_name']][] = $data['pattern_target'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($data['pattern_cat'] == \"alias\") {\n\t\t\t\t\t\t$this->alias_pattern[$data['rewrite_name']][$data['pattern_source']] = $data['pattern_target'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addGlob ($pattern, $flags = 0, array $options = array()) {}", "public function setPattern($pattern)\r\r\n {\r\r\n $this->pattern = $pattern;\r\r\n\r\r\n return $this;\r\r\n }", "public function disableAutoIdentifierFields($flag) {\n $this->_disableAutoIdentifiedFields = (boolean)$flag;\n return $this;\n }", "protected function breakDownPattern(): void\r\n {\r\n $segments = explode('/', trim($this->pattern, '/'));\r\n foreach ($segments as $segment) {\r\n if (preg_match('/^{(?<key>\\w+)}(?:<(?<pattern>[\\w\\\\\\^\\(\\)+=<>?,.;:!£$%&*]+)>)?$/', $segment, $matches)) {\r\n if (! array_key_exists('pattern', $matches)) {\r\n $matches['pattern'] = '.+';\r\n }\r\n $this->segments[] = [\r\n 'key' => $matches['key'],\r\n 'pattern' => \"/{$matches['pattern']}/\",\r\n 'regex' => true,\r\n ];\r\n } else {\r\n $this->segments[] = [\r\n 'key' => '',\r\n 'pattern' => $segment,\r\n 'regex' => false,\r\n ];\r\n }\r\n }\r\n }", "public function setMultiple ($flag)\n {\n $this->_multiple = $flag;\n }", "public function setPattern($pattern)\n {\n $this->_pattern = (string) $pattern;\n return $this;\n }", "private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"/^\".$regex.\"$/\";\t// This REGEX will make finding exact match rather than subpatterns.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function SetFieldPattern($pattern, $dbupdate = true)\r\n\t{\r\n\t\treturn $this->UpdateValue('pattern', $pattern, $dbupdate);\r\n\t}", "public function setReplace($flag)\n {\n $this->replace = (bool) $flag;\n return $this;\n }", "public function setInjectUniqueIdentifier($value)\n {\n $this->injectUniqueIdentifier = (boolean) $value;\n }", "public function pattern()\n {\n $patterns = func_get_args();\n\n foreach (func_get_args() as $pattern) {\n $this->patterns[] = $this->pattern_to_regex($pattern);\n }\n\n return $this;\n }", "public function __construct($pattern) {\n\t\t$this->pattern = $pattern;\n\t}", "public function __construct($pattern)\n {\n $this->pattern = $pattern;\n }", "protected final function _runPatterns()\n {\n $this->_html = preg_replace(array_keys($this->_patterns), array_values($this->_patterns), $this->_html);\n }", "public function setRegexPattern(?string $value): void {\n $this->getBackingStore()->set('regexPattern', $value);\n }", "private function _add() {\n\t\t$arguments = func_get_args();\n\t\t$this->_patterns[] = $arguments;\n\t}", "private function parseFlags($pattern){\n\t\tforeach(self::$flags as $n => $r){\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\?/', '{0,}('.$r.'){0,}', $pattern);\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\b/', '('.$r.')', $pattern);\n\t\t}\n\n\t\tforeach($this->rules as $n => $r){\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\?/', '{0,}('.$r.'){0,}', $pattern);\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\b/', '('.$r.')', $pattern);\n\t\t}\n\n\t\tforeach(self::$patterns as $n => $r){\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\?/', '{0,}('.$r.'){0,}', $pattern);\n\t\t\t$pattern = preg_replace('/\\:'.$n.'\\b/', '('.$r.')', $pattern);\n\t\t}\n\n\t\treturn $pattern;\n\t}", "public function setPattern($pattern)\r\n {\r\n $this->pattern = $pattern;\r\n\r\n return $this;\r\n }", "public function setAutoSubordinateRoutes($flag);", "protected function adding() \n\t{\n\t\t$arguments = func_get_args();\n\t\t$this->patterns[] = $arguments;\n\t}", "public function patterns(array $patterns): void\n {\n $this->patterns = array_merge($this->patterns, $patterns);\n }", "public function SetPattern ($pattern) {\n\t\t$this->pattern = $pattern;\n\t\treturn $this;\n\t}", "public function pattern($key, $pattern)\n {\n $this->patterns[$key] = $pattern;\n }", "public function setRegexPattern($val)\n {\n $this->_propDict[\"regexPattern\"] = $val;\n return $this;\n }", "function set_ids_to_ignore($ids = array()) {\r\n\t\tif(!is_array($ids))\r\n\t\t\t$ids = preg_split(\"/[\\s,]+/\", $ids, -1, PREG_SPLIT_NO_EMPTY);\r\n\t\t$this->settings[\"ignoreIDs\"] = $ids;\r\n\t\treturn TRUE;\r\n\t}", "public static function define($name, $pattern = ''){\n\t\tif(is_array($name)){\n\t\t\tforeach($name as $n => $p) self::$patterns[$n] = $p;\n\t\t}else{\n\t\t\tself::$patterns[$name] = $pattern;\n\t\t}\n\t}", "public function setName($pattern) {\n $pattern = str_replace('\\\\', DIRECTORY_SEPARATOR, $pattern);\n $pattern = str_replace('/', DIRECTORY_SEPARATOR, $pattern);\n \n if (StringHelper::endsWith(DIRECTORY_SEPARATOR, $pattern)) {\n $pattern .= \"**\";\n }\n $this->pattern = $pattern;\n }", "public function setDetectorId($val)\n {\n $this->_propDict[\"detectorId\"] = $val;\n return $this;\n }", "public function reConfigure(string $pattern, $paths = null): void\n {\n }", "public function pattern($pattern)\n {\n return $this->setProperty('pattern', $pattern);\n }", "protected function setListIds()\r\n\t{\r\n\t\tif (!isset($this->listids))\r\n\t\t{\r\n\t\t\t$this->listids = array();\r\n\t\t}\r\n\t}", "public function setPattern(string $pattern): static\n {\n $this->pattern = $pattern;\n return $this;\n }", "protected function _replaceRejectPattern()\n {\n //get all old pattern ids\n $needToReplacePatternIds = $this->_getReadAdapter()->fetchCol('SELECT id FROM ' . $this->_getTableName('aw_hdu_rpattern'));\n $_patterns = array();\n if (array_key_exists('patterns', $this->_migrationData)) {\n //check already migrated patterns\n $oldPatternIds = $needToReplacePatternIds;\n $_patterns = $this->_migrationData['patterns'];\n foreach ($oldPatternIds as $key => $oldPatternId) {\n if (array_key_exists($oldPatternId, $_patterns)) {\n unset($needToReplacePatternIds[$key]);\n }\n }\n }\n if (count($needToReplacePatternIds) > 0) {\n //not all patterns migrated\n $this->_isCompleted = false;\n foreach ($needToReplacePatternIds as $oldPatternId) {\n //aw_hdu3_gateway_mail_reject_pattern\n $this->_getWriteAdapter()->exec('INSERT INTO '\n . $this->_getTableName('aw_hdu3_gateway_mail_reject_pattern')\n . ' (id, title, is_active, types, pattern)'\n . ' SELECT id, name, is_active, scope, pattern FROM '\n . $this->_getTableName('aw_hdu_rpattern') . ' as old_table WHERE old_table.id = ' . $oldPatternId\n . ' on duplicate key update title = old_table.name'\n . ', is_active = old_table.is_active, types = old_table.scope, pattern = old_table.pattern'\n );\n $_newPatternId = $this->_getWriteAdapter()->lastInsertId();\n\n //save oldPatternId => newPatternId\n $_patterns[$oldPatternId] = $_newPatternId;\n }\n $this->_setMigrationData('patterns', $_patterns);\n $this->_isCompleted = true;\n }\n $this->_log(Mage::helper('aw_hdu3')->__('(%d) from (%d) pattern(s) has been replaced', count($_patterns), count($_patterns)));\n return $this;\n }", "public function distinct(bool $flag = true);", "public function setFlag($flag) {\n if (!$this->hasFlag($flag))\n array_push($this->flags, $flag);\n }", "protected function initFlags()\n {\n $filename = strtolower(basename($this->fdt['input_file']));\n\n if ((strpos($filename, 'mono') !== false)\n || (strpos($filename, 'courier') !== false)\n || (strpos($filename, 'fixed') !== false)\n ) {\n $this->fdt['Flags'] |= 1;\n }\n\n if ((strpos($filename, 'symbol') !== false)\n || (strpos($filename, 'zapfdingbats') !== false)\n ) {\n $this->fdt['Flags'] |= 4;\n }\n\n if ((strpos($filename, 'italic') !== false)\n || (strpos($filename, 'oblique') !== false)\n ) {\n $this->fdt['Flags'] |= 64;\n }\n }", "public function setPatternSettings(array &$variables, array $settings) {\n $variables['#pattern_settings'] = $settings;\n return $this;\n }", "final private function set_group_ids($group_ids){\n if(is_array($group_ids)){\n $this->group_ids = array_unique($group_ids);\n }\n else if($group_ids===false){\n $this->group_ids = false;\n } \n }", "protected function setFormPattern () {\n\t\tif ($this->pattern && !isset($this->validators['Pattern']))\n\t\t\t$this->validators['Pattern'] = 'Pattern';\n\t}", "public function setExtractFlags($flags)\n\t\t{\n\t\t\t$this->extract_flags = $flags;\n\t\t}", "public function getIDs() {\r\n \r\n if ($this->resultIDs == false) {\r\n $this->resultIDs = get_restaurant_id_from_pattern($this->pattern);\r\n }\r\n return $this->resultIDs;\r\n }", "public function addPattern(Input\\Pattern $pattern)\n {\n $this->patterns[] = $pattern;\n }", "public function testMaskpatternID():void{\n\t\t$dataInterface = new Byte(new QROptions(['version' => 10]), 'test');\n\n\t\t$this::assertSame(4243, (new MaskPatternTester($dataInterface))->testPattern(3));\n\t}", "public function reset() {\n\t\t$this->_patterns = array();\n\t}", "public function distinct($flag = true)\n {\n if ($flag !== null) {\n $this->_parts['distinct'] = (bool) $flag;\n }\n return $this;\n }", "function setupBitArray() {\n\t\t\tfor($i = 0; $i <= $this->Length; $i++) {\n\t\t\t\t$this->BitString .= $this->bool2int(false);\n\t\t\t}\n\t\t}", "public function setGenerateMatchingId(bool $generateMatchingId): self\n {\n $this->options['generateMatchingId'] = $generateMatchingId;\n return $this;\n }", "public function extraAnalysisOfPattern(bool $add = true) : self\n {\n return $this->flag('S', $add);\n }", "protected function _filter_auto_id(&$id)\n {\n // convert some chars used as separators\n $id = str_replace(array(':', '=', ','), '_', $id);\n // convert the \"Smarty cache groups\" | to paths\n $id = str_replace('|', '/', $id);\n // and remove anything outside the acceptable range\n $id = preg_replace('#[^a-zA-Z0-9-_/]+#', '', $id);\n }", "function setExcludeIDs($_ids)\n {\n foreach($_ids as $key => $id)\n {\n $this->excludeIDs[] = intval($id);\n }\n \n $this->excludeIDs = array_unique($this->excludeIDs);\n }", "public function setPath($pattern);", "function _setFlags(){\n $this->bRunBefore = ($this->sRunBefore != '' && is_callable($this->sRunBefore,true));\n $this->bCondition = ($this->sCondition != '' && is_callable($this->sCondition,true));\n $this->bReplaceFile = ($this->sFile != $this->sFileReplace);\n $this->bReplaceBlock = ($this->sBlock != $this->sBlockReplace);\n $this->bBlockFile = ($this->sFileReplace == '');\n $this->bBlockBlock = ($this->bBlockFile || (!$this->bReplaceFile && $this->bReplaceBlock && $this->sBlockReplace == ''));\n $this->bAppend = (count($this->aAppend) > 0);\n }", "function setIDs(&$node) {\n\t//echo $node -> getNodePath() . \"<br/>\";\n\tif ($node->nodeType!=3 && $node->nodeType!=8 && $node->nodeName!='br'){ // 3 = testo, 8 = commento\n\t\t//echo XPathTofragID($node -> getNodePath()) . \"<br/>\";\n\t\t$node->setAttribute(\"id\", XPathTofragID($node -> getNodePath()));\n\t}\n\t$childlist = $node -> childNodes;\n\tforeach ($childlist as $child) {\n\t\tsetIDs($child, $url);\n\t}\n}", "public function setFlag($flag) {\n $this->flag = $flag;\n }", "private function initializeArchiveIdCache($doneFlag)\n {\n if (!isset($this->idarchives[$doneFlag])) {\n $this->idarchives[$doneFlag] = array();\n }\n }", "private function set_found_comments()\n {\n }", "public function setPatterns(?array $patterns) : self\n {\n $this->patterns = $patterns;\n\n return $this;\n }", "protected function resetGameIds() : void {\n\t\t$container = $this->group->getGameContainer();\n\t\tforeach ($this->games as $game) {\n\t\t\t$game->setId($container->getAutoIncrement());\n\t\t\t/** @noinspection DisconnectedForeachInstructionInspection */\n\t\t\t$container->incrementId();\n\t\t}\n\t}", "function load_remote_patterns() {\n\t// This is the core function that provides the same feature.\n\tif ( function_exists( '_load_remote_block_patterns' ) ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Filter to disable remote block patterns.\n\t *\n\t * @since 5.8.0\n\t *\n\t * @param bool $should_load_remote\n\t */\n\t$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );\n\n\tif ( $should_load_remote ) {\n\t\t$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );\n\t\t$core_keyword_id = 11; // 11 is the ID for \"core\".\n\t\t$request->set_param( 'keyword', $core_keyword_id );\n\t\t$response = rest_do_request( $request );\n\t\tif ( $response->is_error() ) {\n\t\t\treturn;\n\t\t}\n\t\t$patterns = $response->get_data();\n\n\t\tforeach ( $patterns as $settings ) {\n\t\t\t$pattern_name = 'core/' . sanitize_title( $settings['title'] );\n\t\t\tregister_block_pattern( $pattern_name, (array) $settings );\n\t\t}\n\t}\n}", "protected function _addNumberPattern()\n {\n $this->_addPattern('/(?<!\\w)(0x[\\da-f]+|\\d+)(?!\\w)/ix', '<span class=\"' . $this->_css_prefix . 'int\">$1</span>');\n }", "public function init(array &$variables) {\n // Ensure pattern settings.\n if (empty($variables['#pattern_settings'])) {\n $variables['#pattern_settings'] = [];\n }\n }", "protected function normalizePattern()\n {\n $this->pattern = '/' . $this->pattern . '/';\n }", "public function setFillPatternURL ($fill_url) {}", "public function setPattern( string $pattern ): self\n {\n $this->pattern = '/' . trim( $pattern, '/' );\n\n return $this;\n }", "public function setFinderPattern():QRMatrix{\n\n\t\t$pos = [\n\t\t\t[0, 0], // top left\n\t\t\t[$this->moduleCount - 7, 0], // bottom left\n\t\t\t[0, $this->moduleCount - 7], // top right\n\t\t];\n\n\t\tforeach($pos as $c){\n\t\t\tfor($y = 0; $y < 7; $y++){\n\t\t\t\tfor($x = 0; $x < 7; $x++){\n\t\t\t\t\t$this->set(\n\t\t\t\t\t\t$c[0] + $y,\n\t\t\t\t\t\t$c[1] + $x,\n\t\t\t\t\t\t!(($x > 0 && $x < 6 && ($y === 1 || $y === 5)) || ($y > 0 && $y < 6 && ($x === 1 || $x === 5))),\n\t\t\t\t\t\t$this::M_FINDER\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function add_alignment_patterns($defined = true) {\n\t\t$ar_pattern = $this->ar_pattern['align'];\n\t\tif(!$defined) {\n\t\t\tforeach($ar_pattern as $k=>$v) {\n\t\t\t\tforeach($v as $vk => $vv) {\n\t\t\t\t\t$ar_pattern[$k][$vk] = 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$check_to = array(\n\t\t\tarray(4,4),\n\t\t\tarray(4, $this->qr_size-9),\n\t\t\tarray($this->qr_size-9, 4)\n\t\t);\n\n\t\t$ar_alignment_positions = $this->ar_alignment_positions[$this->version];\n\n\t\tforeach($ar_alignment_positions as $position_x) {\n\t\t\tforeach($ar_alignment_positions as $position_y) {\n\t\t\t\t$offset_x = $position_x - 2;\n\t\t\t\t$offset_y = $position_y - 2;\n\n\t\t\t\t$check = array($offset_x, $offset_y);\n\t\t\t\tif( !in_array($check, $check_to)) {\n\t\t\t\t\t$this->_inject($ar_pattern, $offset_x, $offset_y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract function make($flag_int);", "public function setURLPattern($pattern);", "public function setInjectUniqueIdentifier($value);", "public function pattern(string $pattern)\n {\n $this->pattern = $pattern;\n\n return $this;\n }", "public function setNumberPattern(?string $numberPattern): static\n {\n \\Logger::getLogger(\\get_class($this))\n ->debug(\n \\sprintf(\n __METHOD__ . \" set to '%s'\",\n $this->numberPattern === null ? \"null\" : $this->numberPattern\n )\n );\n $this->numberPattern = $numberPattern;\n return $this;\n }", "public function setIgnorePatterns($ignorePatterns) {\n $this->ignorePatterns = array();\n $token = ' ,;';\n $pattern = strtok($ignorePatterns, $token);\n while ($pattern !== FALSE) {\n $this->ignorePatterns[] = $pattern;\n $pattern = strtok($token);\n }\n }", "function setScormRefId($a_val)\n {\n $this->scorm_ref_id = $a_val;\n }", "protected function flattenIds()\n {\n $this->groupedIds = array_map(function ($v) {\n return $v['id'];\n }, $this->groupedItems);\n }", "private function setSwrFlags($val)\n {\n $this->settings['flags'] = $val;\n }", "public function setFlag(string $flag, $numbers): bool\n {\n // TODO: Implement setFlag() method.\n }", "protected function registerPattern($pattern, $replacement = '')\n {\n // study the pattern, we'll execute it more than once\n $pattern .= 'S';\n $this->patterns[] = array($pattern, $replacement);\n }", "public function pattern(string $value): self\n {\n $new = clone $this;\n $new->attributes['pattern'] = $value;\n return $new;\n }" ]
[ "0.5841086", "0.51970536", "0.51672035", "0.5152262", "0.514192", "0.5137651", "0.5137651", "0.5013147", "0.4933405", "0.48965907", "0.48861778", "0.48595738", "0.48368633", "0.4831596", "0.48211503", "0.47928935", "0.47891453", "0.47783348", "0.4773024", "0.4756422", "0.47421452", "0.4733745", "0.4717128", "0.47005486", "0.469759", "0.46660036", "0.46375552", "0.46291283", "0.46290737", "0.46137482", "0.4595725", "0.4588514", "0.45848143", "0.45836604", "0.457771", "0.45697924", "0.456672", "0.4565751", "0.45373008", "0.4530811", "0.45292976", "0.45233938", "0.45217076", "0.45192966", "0.45178336", "0.45049253", "0.4498068", "0.4493645", "0.4490788", "0.44881546", "0.44877666", "0.44750655", "0.44710943", "0.44500017", "0.44406396", "0.44143435", "0.4402718", "0.44020247", "0.43954614", "0.43865004", "0.43837565", "0.4380918", "0.43804243", "0.4371436", "0.43684292", "0.43628582", "0.43575883", "0.43558416", "0.4351022", "0.43469068", "0.43351734", "0.43241936", "0.43183738", "0.4317443", "0.43147415", "0.43146855", "0.4304082", "0.4295127", "0.42900226", "0.4289404", "0.4288549", "0.42833817", "0.4283095", "0.42821705", "0.42701948", "0.42674038", "0.42659035", "0.4260522", "0.42429584", "0.4241598", "0.42371613", "0.4233617", "0.42291576", "0.42272526", "0.42261213", "0.42218125", "0.42191446", "0.42145315", "0.42121628", "0.42082483" ]
0.72699267
0
Returns a Editor_collection_type by id
Возвращает Editor_collection_type по идентификатору
public function find($id) { $query="SELECT id,". "name,". "entity_type,". "parent,". "child_order,". "description,". "gid ". "FROM editor_collection_type ". "WHERE id=".$id; return($this->selectDB($query, "Editor_collection_type")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id)\n {\n return $this->types->find($id);\n }", "public function getCollectionById($id)\n {\n return craft()->amSearch_collections->getCollectionById($id);\n }", "public function getType($id)\n {\n return $this->types->find($id);\n }", "function getCancerTypeById($id){\n return $this::find($id);\n }", "public function findCollectionById($id);", "public function find($id)\n {\n return $this->em->find(Type::class, $id);\n }", "public function findById($id) {\n $select = $this->prepareSelect();\n $select->where(\"c.collection_id = ?\", $id);\n \n return $this->_generateRow($select->query()->fetch());\n }", "public static function get_collection_by_id($id)\n {\n $collection = Collection::all()->find($id)->first()->toArray();\n\n $items = json_decode($collection['items']);\n\n $collection['items'] = [];\n foreach ($items as $key => $item) {\n $query = null;\n switch ($collection['table']) {\n case 'posts':\n $query = Post::all();\n break;\n case 'products':\n $query = Product::all();\n break;\n case 'classifieds':\n $query = Classified::all();\n break;\n default:\n break;\n }\n\n $collection['items'][] = $query->find($item)->first();\n }\n\n return $collection;\n }", "public function getContentType($id) {\n\t\t$model = $this->repository->getContentType($id);\n\t\treturn $model;\n\t}", "public function types($id){\n $types = DocumentType::select('id','type')\n ->where('entity_id','=',$id)\n ->orderBy('type')\n ->get();\n return $types;\n }", "public function findEditorById($id)\r\n\t{\r\n\t\t$this->set(array('id' => (int) $id));\r\n\t\treturn $this->find(\"editor\");\r\n\t}", "public static function FindById($id){\r\n\t\t$query = new Query();\r\n\t\t$query->createSelect(array('*'), 'boxes', array(), 'id = \"'.$id.'\"');\r\n\t\t$boxArray = $query->execute();\r\n\t\t$box = false;\r\n\t\tif(!empty($boxArray)){\r\n\t\t\t$box = self::CreateObjectFromArray($boxArray);\r\n\t\t}\r\n\t\treturn $box;\r\n\t}", "function readCaseType($id){\n $obj = new CaseType($id);\n if($obj->isNew()) return false; else return $obj;\n }", "public static function getSectionType($id)\n {\n return self::select('type')->where('id', $id)->first()['type'];\n }", "public function get_contracttype_by_id($id){\n\t\treturn $this->db->query('select * from '.db_prefix().'hr_staff_contract_type where id_contracttype = '.$id)->result_array();\n\t}", "public function getObjectType(string $id) {\n\t\t\treturn $this->parser->getObjectType($id);\n\t\t}", "public function delete($id)\n {\n $query=\"DELETE FROM editor_collection_type WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "private static function get_post_type($id)\n {\n }", "public function type($id){\n return $this->scopeQuery(function($scope) use ($id){\n return $scope->where('id_type', $id);\n })->paginate();\n }", "function get_doc_type_from_id($type_id)\n {\n $type_id = ($type_id == !null) ? $type_id : 1;\n //dd($cid);\n $doc_type = DB::table('doc_types')\n ->where('id', $type_id)\n ->select('name')->get()[0]->name;\n //dd($country);\n return (!empty($doc_type)) ? $doc_type : '';\n }", "function tour_type($id){\n\t\t$db = JFactory::getDbo();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\n\t\t$query->select($db->quoteName(array('title')));\n\t\t$query->from($db->quoteName('#__jdtoursshowcase_tour_type'));\n\t\t$query->where($db->quoteName('id') . ' = '. $db->quote($id));\n\t\t$query->order('ordering ASC');\n\n\t\t// Reset the query using our newly populated query object.\n\t\t$db->setQuery($query);\n\n\t\t\n\t\treturn $result = $db->loadResult();\n\t\t \n\n\t}", "public function findRoleCollectionById($id);", "public function getTypeId();", "public function types_get($id) {\n\t\tself::validate_access($id);\n\t\treturn Project::find($id)->get_types();\n\t}", "public function getCollection()\n {\n return $this->hasOne(Collections::className(), ['collection_id' => 'collection_id']);\n }", "public function get($id)\n {\n return Collection::make($this->client, $id);\n }", "public function getCollection($coll_id) {\n $this->db->select('*');\n $this->db->from('collections');\n $this->db->where('collection_id', $coll_id);\n $query = $this->db->get();\n return $query->row();\n }", "private function getCollection($type) {\n if ($this->collections[$type] === null) {\n try {\n $this->collections[$type] = $this->getMongoClient()->selectCollection(\n $this->params['database'],\n $this->params['collections'][$type]\n );\n } catch (MongoException $e) {\n throw new RuntimeException('Could not select collection', 500, $e);\n }\n }\n\n return $this->collections[$type];\n }", "public function id() {\n return $this->type;\n }", "public function getCollection($coll_id){\r\n \r\n\t//Fetch all Collections with a given coll_id\r\n $sql = \"SELECT `p`.`photoset_id` as id,`p`.`slug_id`, `p`.`title`,`p`.`n_pics`,`i`.`url_m`,`i`.`height_m`,`i`.`width_m`,`s_c`.`index`\r\n FROM `photoset` `p` NATURAL JOIN `set-has-col` `s_c` LEFT JOIN `images` `i`\r\n ON `p`.`gall_pic` = `i`.`pic_id`\r\n WHERE `s_c`.`collection_id` = '$coll_id'\r\n ORDER BY `index` DESC\";\r\n\r\n\t$coll_v = $this->_db->query(Database::SELECT, $sql, FALSE)->as_array();\r\n \r\n return array('id' => $coll_id,\r\n 'collection' => $coll_v \r\n );\r\n \r\n\t}", "function get_type() {\n\t\tglobal $db;\n\t\t$query = \" SELECT id, name \n\t\t\t\tFROM \" . $this->table_types;\n\t\tglobal $db;\n\t\t$sql = $db->query ( $query );\n\t\t$result = $db->getObjectList ();\n\t\treturn $result;\n\t}", "function retrieve_content_object($id, $type = null)\r\n {\r\n $rdm = RepositoryDataManager :: get_instance();\r\n return $rdm->retrieve_content_object($id, $type);\r\n }", "public function getTypeById($id)\n {\n $requestTypeRepo = new RequestTypeRepo();\n return $type = $requestTypeRepo->getByID($id);\n }", "function get_categoryType_for_edit($ctypeID){\n\t\t\t$query= $this->db->select('*')\n\t\t\t\t\t\t\t->from('tbl_category_type')\n\t\t\t\t\t\t\t->where('tbl_category_type.c_type_id',$ctypeID)\n\t\t\t\t\t\t\t->get();\n\t\t\t$data = $query->row_array();\n\t\t\treturn $data;\n\t\t}", "public function find($id) {\n $sql = \"select * from t_packtype where packtype_id=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new \\Exception(\"No PackType matching id \" . $id);\n }", "function getTypeId() {\r\n\t\treturn $this->_type_id;\r\n\t}", "public function getCategory($id)\n {\n if (!array_key_exists($id, self::$categories)) {\n $il = ObjectManager::getInstance();\n self::$categories[$id] = $il->create(Collection::class)\n ->addAttributeToSelect(['is_active', 'name'])\n ->addFieldToFilter('entity_id', $id)\n ->getFirstItem();\n }\n\n return self::$categories[$id];\n }", "public function type()\n {\n return $this->hasOne('App\\Entities\\Type', 'id', 'type_id');\n }", "public function insert2($editor_collection_type)\n {\n $query=\"INSERT INTO editor_collection_type ( \".\n\t \"id,\".\n \"name,\".\n \"entity_type,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \" \".$editor_collection_type->parent.\" ,\".\n \" \".$editor_collection_type->child_order.\" ,\".\n \"'\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n \")\"; \n\n $id = $this->executeInsert($query);\n\t $editor_collection_type->id = $id;\n\t return($editor_collection_type);\t\n }", "function viewDivisionTypeFromID($id) {\n $this->load->model('division_type/division_type_model');\n $fetchAllDivisionType = $this->division_type_model->fetchFromAnyTable(\"tbl_division_type\", null, null, null, 10000, 0, \"RESULTSET\", array('division_status' => 1, 'id_division_type' => $id), null);\n $pushdata = array('divisiontype' => $fetchAllDivisionType);\n $this->template->draw('division_type/divisionTypeManage', false, $pushdata);\n }", "public function get($id)\n {\n if (is_string($id) === false) {\n throw new Exception('Collection-Id must be a string');\n }\n\n if (is_array($this->_collections) === false) {\n $this->_collections = array();\n }\n\n if (isset($this->_collections[$id]) === false) {\n throw new Exception('The collection does not exist in the manager');\n }\n\n return $this->_collections[$id];\n }", "function getWithTypePersoon($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('typePersoon');\n return $query->row();\n }", "public function getTypeField($id){\n\t\tif($id=='1')\n\t\t\treturn 'Inteiro';\n\t\telse if($id =='2')\n\t\t\treturn 'Numérico';\n\t\telse if($id =='3')\n\t\t\treturn 'Texto';\n\t}", "protected static function getFieldNameAndType($id)\r\n\t{\r\n\t\t$db = JFactory::getDbo();\r\n\r\n\t\t// Create a new query object.\r\n\t\t$query = $db->getQuery(true);\r\n\r\n\t\t// Order it by the ordering field.\r\n\t\t$query->select($db->quoteName(array('a.name', 'a.xml')));\r\n\t\t$query->select($db->quoteName(array('c.name'), array('type_name')));\r\n\t\t$query->from('#__componentbuilder_field AS a');\r\n\t\t$query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'c') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('c.id') . ')');\r\n\t\t$query->where($db->quoteName('a.id') . ' = '. $db->quote($id));\r\n\r\n\t\t// Reset the query using our newly populated query object.\r\n\t\t$db->setQuery($query);\r\n\t\t$db->execute();\r\n\t\tif ($db->getNumRows())\r\n\t\t{\r\n\t\t\t// Load the results as a list of stdClass objects (see later for more options on retrieving data).\r\n\t\t\t$field = $db->loadObject();\r\n\t\t\t// load the values form params\r\n\t\t\t$field->xml = json_decode($field->xml);\r\n\t\t\t$field->type_name = self::safeString($field->type_name);\r\n\t\t\t$load = true;\r\n\t\t\t// if category then name must be catid (only one per view)\r\n\t\t\tif ($field->type_name == 'category')\r\n\t\t\t{\r\n\t\t\t\t$name = 'catid';\r\n\t\t\t}\r\n\t\t\t// if tag is set then enable all tag options for this view (only one per view)\r\n\t\t\telseif ($field->type_name == 'tag')\r\n\t\t\t{\r\n\t\t\t\t$name = 'tags';\r\n\t\t\t}\r\n\t\t\t// don't add spacers or notes\r\n\t\t\telseif ($field->type_name == 'spacer' || $field->type_name == 'note')\r\n\t\t\t{\r\n\t\t\t\t// make sure the name is unique\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\t$name = self::safeFieldName(self::getBetween($field->xml,'name=\"','\"'));\r\n\t\t\t}\r\n\r\n\t\t\t// use field core name only if not found in xml\r\n\t\t\tif (!self::checkString($name))\r\n\t\t\t{\r\n\t\t\t\t$name = self::safeFieldName($field->name);\r\n\t\t\t}\r\n\t\t\treturn array('name' => $name, 'type' => $field->type_name);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getDocumentType()\n {\n return $this->hasOne(DocumentType::className(), ['id' => 'document_type_id']);\n }", "public function getDocumentType()\n {\n return $this->hasOne(DocumentType::className(), ['id' => 'document_type_id']);\n }", "public function getRoomType($id)\n {\n $roomType = $this->with('user')->find($id);\n return $roomType;\n }", "public function getTypes()\n {\n return $this->hasOne(Types::className(), ['id' => 'types_id']);\n }", "function get($id,$type)\n\t{\n\t\t$list =$this->get_type($type);\n\t\tforeach ($list as $row)\n\t\t{\n\t\t\tif ($row->id == $id)\n\t\t\t{\n\t\t\t\treturn $row;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function getCommitteeTypeInfoByTypeId($type_id) {\n global $conn;\n // Get single post slug\n $sql = \"SELECT * FROM committee_type WHERE id =$type_id\";\n $result = mysqli_query($conn, $sql);\n\n // fetch query results as associative array.\n // $committee_typeList = mysqli_fetch_all($result, MYSQLI_ASSOC);\n $committeeTypeInfo = mysqli_fetch_assoc($result);\n // print_r($committeeTypeInfo);\n // if ($notice) {\n // // get the topic to which this post belongs\n // $post['topic'] = getPostTopic($post['id']);\n // }\n return $committeeTypeInfo;\n }", "function load($id) \n\t{\n\t\t$query = $this->db->get_where('collection',array('id'=>$id));\n\t\treturn $query->row_array();\n\t\t\n\t}", "public function id()\n { \n return $this->m_type; \n }", "public static function getScoreTypeById($id) {\n return ScoreType::all()->find($id);\n }", "public function findValueById($id)\n {\n $new_collection = $this->findValueByAttribute('id', $id);\n return $new_collection;\n }", "public function find($id)\n\t{\n\t\t$object_name = str_replace('_','o',get_class($this));\n\t\treturn new $object_name($id);\n\t}", "final public function getCollectionTypeHelper()\n\t{\n\t\treturn $this->query->getCollectionTypeHelper();\n\t}", "public function getCollectionID(){\n return $this->collection_id;\n }", "public static function getTypeById($id)\n {\n $all = self::all();\n\n $record = $all->find($id);\n if (!$record) {\n return null;\n }\n\n return $record->type;\n }", "public function update($editor_collection_type)\n {\n $query=\"UPDATE editor_collection_type \".\n\t \"SET \".\n \"id= \".$editor_collection_type->id.\" ,\".\n \"name='\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"entity_type='\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \"parent= \".$editor_collection_type->parent.\" ,\".\n \"child_order= \".$editor_collection_type->child_order.\" ,\".\n \"description='\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"gid='\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n\t \"WHERE id=\".$editor_collection_type->id;\n\n $this->executeQuery($query);\n }", "public function getByID( $collection, $id ){\n\t\tself::setCollection( $collection );\n\t\t$q = array( '_id'=>new MongoId($id) );\n\t\treturn $this->collection->findOne( $q );\n\t}", "public function getcategoryTypeByID($cat_type_id);", "function get($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('typePersoon');\n return $query->row(); // genereert een typepersoon object\n }", "public function find($id)\n {\n $query=\"SELECT id,\".\n \"parent,\".\n \"child_order,\".\n \"gid,\".\n \"entity_type0,\".\n \"entity_type1,\".\n \"name,\".\n \"description,\".\n \"link_phrase,\".\n \"reverse_link_phrase,\".\n \"long_link_phrase,\".\n \"priority,\".\n \"last_updated,\".\n \"is_deprecated,\".\n \"has_dates,\".\n \"entity0_cardinality,\".\n \"entity1_cardinality \". \t\t \n\t \"FROM link_type \".\n\t \"WHERE id=\".$id;\n\n return($this->selectDB($query, \"Link_type\"));\n }", "public function type()\n {\n return $this->hasOne(CourseType::class,'id','course_type_id');\n }", "function get_param_type($id = '')\n\t{\n\t\tglobal $wpdb;\n\t\n\t\tif ($id == '') {\n\t\t\t$arr = $wpdb->get_results('SELECT * FROM `'.$wpdb->prefix.'scat_types` ORDER BY `id`');\n\t\t}\n\t\telse {\n\t\t\t$arr = $wpdb->get_results('SELECT * FROM `'.$wpdb->prefix.'scat_types` WHERE `id`=\"'.$id.'\"');\n\t\t}\n\t\n\t\treturn $arr;\n\t}", "public function getEditorInterface(string $spaceId, string $environmentId, string $contentTypeId): ResourceClass\n {\n return $this->fetchResource(ResourceClass::class, [\n 'space' => $spaceId,\n 'environment' => $environmentId,\n 'contentType' => $contentTypeId,\n ]);\n }", "protected function getCollectionType()\n {\n return 'Didww\\API2\\CDR';\n }", "public function addFieldCollection($type) {\n $field_collection_item = entity_create('field_collection_item', array('field_name' => $type));\n\n $this->field_collections[] = $field_collection_item;\n\n return entity_metadata_wrapper('field_collection_item', $field_collection_item);\n }", "public function getTicketTypeById(int $id)\n {\n return $this->ticketTypeCollection->searchById($id);\n }", "public function show($id)\n {\n $user_type = UserType::find($id);\n\n return $user_type;\n }", "public static function getBoxByType($id, $type) {\n global $connect;\n $selectBox = \"SELECT * FROM $type WHERE id='$id' \";\n $resultBox = $connect->query($selectBox);\n if ($box_row = $resultBox->fetch_object()) {\n $selectShelf = \"SELECT * FROM occupated_shelves WHERE box_id='$id' AND box_type='$type' \";\n $resultShelf = $connect->query($selectShelf);\n $shelf_row = $resultShelf->fetch_object();\n switch ($type) {\n case 'black_box':\n $box['box'] = new BlackBox($box_row->ID, $box_row->HEIGHT, $box_row->WIDTH, $box_row->DEPTH, $box_row->REGISTER_DATE, $box_row->CHIP);\n break;\n case 'security_box':\n $box['box'] = new SecurityBox($box_row->ID, $box_row->HEIGHT, $box_row->WIDTH, $box_row->DEPTH, $box_row->COLOR, $box_row->REGISTER_DATE, $box_row->LOCK);\n break;\n case 'surprise_box':\n $box['box'] = new SurpriseBox($box_row->ID, $box_row->HEIGHT, $box_row->WIDTH, $box_row->DEPTH, $box_row->COLOR, $box_row->REGISTER_DATE, $box_row->CONTENT);\n break;\n }\n $box['shelf'] = new Shelf($shelf_row->shelves_id, $shelf_row->shelf_id, $shelf_row->box_id, $shelf_row->box_type);\n mysqli_free_result($resultBox);\n mysqli_free_result($resultShelf);\n return $box;\n } else {\n return false;\n }\n }", "public function getOne($type, $id)\n {\n $repo = $this->fetchRepo($type);\n\n // Actual fetching of objects\n $object = $repo->find($id);\n\n return $object;\n }", "function GetDocTypeID($id)\r\n\t{\r\n\t\t$sql = \"SELECT * FROM $this->table_Name WHERE $this->field_Id = $id;\";\r\n\t\r\n\t\t/*\r\n\t\t\tGet a list of records\r\n\t\t*/\r\n\t\t$records = $this->db->Select($sql);\r\n\t\tif(sizeof($records) > 0)\r\n\t\t{\r\n\t\t\treturn $records[0][$this->field_DocTypeId];\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t}", "public function load( $type, $id )\n\t{\n\t\treturn $this->repository->load( $type, $id );\n\t}", "public function getPluginType($id);", "public function getType()\n {\n return Type::findOne($this->type_id);\n }", "public function find($id)\n {\n $query=\"SELECT id,\".\n \"name,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \t\t \n\t \"FROM event_alias_type \".\n\t \"WHERE id=\".$id;\n\n return($this->selectDB($query, \"Event_alias_type\"));\n }", "public function getCollectionId($key, $type) {\n if ($type == 'single') {\n return $this->collectionId;\n } else if ($type == 'array') {\n return $this->collectionId [$key];\n } else {\n echo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identify Type String Or Array:getcollectionId ?\"));\n exit();\n }\n\t}", "public function getItemType($id)\n {\n if( isset($this->items) )\n {\n return $this->items->getItemType($id);\n }\n else\n {\n throw new E_OTS_NotLoaded();\n }\n }", "function get_available_item_type($id)\r\n\t{\r\n\t\t$debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;\r\n\t $sql = \"/* $debugMsg */ SELECT CFNT.field_id,CFNT.node_type_id \".\r\n// \t \t \" FROM {$this->tables['cfield_node_types']} CFNT, \" .\r\n// \t \t \" {$this->tables['nodes_types']} NT \" .\r\n\t \t \" FROM \".$this->db->get_table('cfield_node_types').\" CFNT, \" .\r\n\t \t \" \".$this->db->get_table('nodes_types').\" NT \" .\r\n\t \t \" WHERE NT.id=CFNT.node_type_id \" .\r\n\t \t \" CFNt.field_id=\" . $this->db->prepare_int($id);\r\n\r\n return($this->db->fetchRowsIntoMap($sql,'field_id'));\r\n\t}", "private function getACFGroupType($id) {\n $field = acf_get_field($id);\n if ($field) {\n return $field['type'];\n }\n return false;\n }", "function diy_metabox_assigned_post_types($id) {\r\n foreach ($this->metaboxes as $metabox) {\r\n if ($metabox['id'] == $id) {\r\n return (isset($metabox['post_type']) ? $metabox['post_type'] : false );\r\n }\r\n }\r\n return '';\r\n }", "function GetARequestTypeById($id)\n {\n require 'Model/Credentials.php';\n \n //Open connection and Select database\n $connection = mysqli_connect($host, $user, $passwd, $database);\n $result = mysqli_query($connection,\" SELECT * FROM requesttype WHERE id=$id ORDER BY name\") or die(mysql_error());\n \n $numrows = mysqli_num_rows($result);\n \n if($numrows != 0)\n {\n while ($row = mysqli_fetch_assoc($result))\n {\n $dbRequestTypeId= $row['id'];\n $dbName= $row['name'];\n \n $requestTypeEntities = new RequestTypeEntities($dbRequestTypeId,$dbName);\n }\n \n return $requestTypeEntities;\n }else\n {\n return 0;\n }\n }", "public function setId($collectionId);", "public function findFormActionTypeById($id) {\n try\n {\n $doc =\n $this->_em->getRepository('WF\\Lib\\Core\\WFormActionType')\n ->findOneBy(array('id' => $id));\n return $doc;\n }\n catch(Exception $err)\n {\n return null;\n }\n }", "public function edit($id)\n {\n $documentData = $this->documentTypeService->getDocumentTypeById($id);\n return view('admin.documentType',compact('documentData'));\n }", "public static function find( $id ) {\n \n $class = get_called_class();\n return new $class( $id );\n \n }", "public function getId()\n {\n return self::$TYPES[$this->name];\n }", "function get_expenseType($id)\n {\n return $this->db->get_where('acc_expense_types',array('id'=>$id))->row_array();\n }", "public function getCollectionId()\n {\n return $this->collection_id;\n }", "public function edit($id)\n\t{\n\t\tif (!Auth::user()->can('documenttype.edit')){\n\t\t\treturn response($response,500);\n\t\t}\n\t\t$data = DocumentTypes::where(\"FOLDER_ID\", $id)->first();\n\t\treturn response()->view('documenttypes.form', [\"data\" => $data, \n\t\t\t\t\t\t\t\t\t\t \"action\" => \"edit\"]);\n\t}", "public function getCollection(DocumentMetadata $class): CollectionInterface;", "public function getCollection($type=null)\n {\n if( $type ){\n $data = $this->xpath(sprintf(\"./%s[@type='%s']\", self::XML_COLLECTION_ELEMENT, $type, self::XML_COLLECTION_ITEM_ELEMENT));\n }\n else{\n $data = $this->xpath(sprintf('./%s[1]', self::XML_COLLECTION_ELEMENT, self::XML_COLLECTION_ITEM_ELEMENT));\n }\n return $data[0];\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getById(int $id)\n {\n return Collection::findorfail($id);\n }", "public function type()\n { \n return $this->hasOne('App\\Type','id', 'type_id'); \n }", "public static function getByID($id)\r\n\t{\r\n\t\tglobal $db;\r\n\r\n\t\tif(isset(static::$cache[$id]))\r\n\t\t\treturn static::$cache[$id];\r\n\r\n\t\t$class = false;\r\n\r\n\t\t$query = $db->simple_select(static::$table, \"*\", \"id='{$id}'\");\r\n\t\tif($db->num_rows($query) == 1)\r\n\t\t{\r\n\t\t\t$article = $db->fetch_array($query);\r\n\t\t\t$class = static::create($article);\r\n\t\t}\r\n\r\n\t\tstatic::$cache[$id] = $class;\r\n\r\n\t\treturn $class;\r\n\r\n\t}", "function get_by_id($id)\r\n\t{\r\n\t\t$debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;\r\n $sql = \"/* $debugMsg */ SELECT CF.*, CFNT.node_type_id\" .\r\n// \t \t \" FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT\" .\r\n\t \t \" FROM \".$this->db->get_table('custom_fields').\" CF, \".$this->db->get_table('cfield_node_types').\" CFNT\" .\r\n\t \t \" WHERE CF.id=CFNT.field_id \" .\r\n \" AND CF.id IN (\" . implode(',',(array)$id) . \")\";\r\n return($this->db->fetchRowsIntoMap($sql,'id'));\r\n\t}" ]
[ "0.6547328", "0.6345267", "0.6324793", "0.6264552", "0.6230371", "0.62290573", "0.61315113", "0.59639955", "0.5912922", "0.58875734", "0.58781296", "0.5866976", "0.58075196", "0.57928187", "0.57806313", "0.5740324", "0.5738443", "0.5709854", "0.56907815", "0.5672122", "0.5669888", "0.5641904", "0.5599318", "0.55798674", "0.5572347", "0.5547787", "0.5547153", "0.5507474", "0.54876006", "0.5472703", "0.5461504", "0.5420419", "0.54168594", "0.54122853", "0.5410421", "0.54098153", "0.5397392", "0.5376633", "0.53663397", "0.5358717", "0.5355657", "0.5355329", "0.53542596", "0.5352017", "0.5348654", "0.5348654", "0.53486395", "0.5347702", "0.5345626", "0.53433776", "0.5341013", "0.5338426", "0.5337741", "0.53372157", "0.53349197", "0.5313524", "0.531176", "0.53077114", "0.5304324", "0.5302363", "0.5302212", "0.5294713", "0.52758205", "0.52713895", "0.52707136", "0.52703184", "0.52695376", "0.5258941", "0.5242537", "0.52363235", "0.5235111", "0.5229832", "0.5222396", "0.52217233", "0.5220111", "0.52190137", "0.52167743", "0.5210844", "0.5200522", "0.51840013", "0.5180848", "0.5169799", "0.5166796", "0.5164011", "0.51626563", "0.5149926", "0.5148256", "0.5135291", "0.5128299", "0.5123685", "0.51224416", "0.5121425", "0.51115817", "0.51095974", "0.51095974", "0.51095974", "0.5101996", "0.50993913", "0.50954664", "0.5092917" ]
0.8097437
0
Insert a new Editor_collection_type into musicbrainz database
Вставить новый Editor_collection_type в базу данных musicbrainz
public function insert($editor_collection_type) { $query="INSERT INTO editor_collection_type ( ". "id,". "name,". "entity_type,". "parent,". "child_order,". "description,". "gid ". ")". "VALUES (". "null,". "'".$this->sqlSafe($editor_collection_type->name)."',". "'".$this->sqlSafe($editor_collection_type->entity_type)."',". " ".$editor_collection_type->parent." ,". " ".$editor_collection_type->child_order." ,". "'".$this->sqlSafe($editor_collection_type->description)."',". "'".$this->sqlSafe($editor_collection_type->gid)."' ". ")"; $this->executeQuery($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert2($editor_collection_type)\n {\n $query=\"INSERT INTO editor_collection_type ( \".\n\t \"id,\".\n \"name,\".\n \"entity_type,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \" \".$editor_collection_type->parent.\" ,\".\n \" \".$editor_collection_type->child_order.\" ,\".\n \"'\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n \")\"; \n\n $id = $this->executeInsert($query);\n\t $editor_collection_type->id = $id;\n\t return($editor_collection_type);\t\n }", "public function run()\n {\n DB::table('category_types')->insert([\n\t\t\t['title'=>'Төсөл','slug'=>'project'],\n\t\t\t['title'=>'Агуулга','slug'=>'content'],\n\t\t\t['title'=>'Блог','slug'=>'blog'],\n\t\t]);\n }", "function insertDocumentTypeAction(){\n\t\tif($this->getRequest()->isPost()){\n\t\t\t$data = $this->getRequest()->getPost();\n\t\t\t$data['status']=1;\n\t\t\t$data['display_by']=1;\n\t\t\t//$data['type']=24;\n\t\t\t\n\t\t\t$db = new Other_Model_DbTable_DbLoanType();\n\t\t\t$id = $db->addViewType($data);\n\t\t\tprint_r(Zend_Json::encode($id));\n\t\t\texit();\n\t\t}\n\t}", "public function update($editor_collection_type)\n {\n $query=\"UPDATE editor_collection_type \".\n\t \"SET \".\n \"id= \".$editor_collection_type->id.\" ,\".\n \"name='\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"entity_type='\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \"parent= \".$editor_collection_type->parent.\" ,\".\n \"child_order= \".$editor_collection_type->child_order.\" ,\".\n \"description='\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"gid='\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n\t \"WHERE id=\".$editor_collection_type->id;\n\n $this->executeQuery($query);\n }", "function addFileType($releaseType) {\r\n DB::query(\"INSERT INTO releaseTypes SET types=%s\", $releaseType);\r\n}", "protected function save()\n {\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = '';\n foreach($this->items as $key => $item)\n {\n $sql .= \"\n Insert Into \" . (string)$dbTable . \"\n (\". $this->baseClass . \"Id, \" . $this->collectionClass . \"Id)\n Values (\" . (int)$this->baseClassId . \", \" . (int)$key . \")\n Where Not Exists \n (\n Select * From \" . $dbTable . \" \n Where \" . $this->collectionClass . \"Id = \" . $key . \"\n And \" . $this->baseClass . \"Id = \" . $this->baseClassId . \"\n )\n \";\n }\n }", "public function run()\n {\n $data = [[\n 'name' => 'Discursiva',\n 'slug' => 'discursive',\n 'description' => 'Questão com linhas para preenchimento da resposta'\n ],[\n 'name' => 'Múltipla Escolha',\n 'slug' => 'multiple-choice',\n 'description' => 'Questão com respostas para serem escolhidas'\n ]];\n\n Type::insert($data);\n \n }", "function repec_add_association($content_type, $series_name, $field_content_type, $field_series) {\n db_insert('repec_assoc')\n ->fields(array(\n 'content_type' => $content_type,\n 'series_name' => $series_name,\n 'field_content_type' => $field_content_type,\n 'field_series' => $field_series,\n 'enabled' => 0\n ))\n ->execute();\n}", "private function insertCollectionModelRecord()\n {\n $this->collection->model()->create($this->model);\n }", "public function run()\n\t{\n\t DB::table('document_types')->insert(\n [\n [\n 'slug' => 'prakas', \n 'en_title' => 'Prakas', \n 'kh_title' => 'Prakas',\n ],\n [\n 'slug' => 'law', \n 'en_title' => 'Law', \n 'kh_title' => 'Law',\n ],\n [\n 'slug' => 'policy', \n 'en_title' => 'Policy', \n 'kh_title' => 'Policy',\n ],\n [\n 'slug' => 'agreement-mou', \n 'en_title' => 'Agreement & MOU', \n 'kh_title' => 'Agreement & MOU',\n ],\n [\n 'slug' => 'sub-decree', \n 'en_title' => 'Sub-decree', \n 'kh_title' => 'Sub-decree',\n ],\n [\n 'slug' => 'decree', \n 'en_title' => 'Decree', \n 'kh_title' => 'Decree',\n ],\n ]\n );\n\t}", "public function run()\n {\n $types = [];\n $types[] = ['label' => 'School', 'slug' => 'school'];\n $types[] = ['label' => 'University', 'slug' => 'university'];\n \\DB::table('organisation_types')->insert($types);\n }", "public function run()\n {\n $arr = [\n ['type'=>'Whiskey'],\n ['type'=>'Vodka'],\n ['type'=>'Rum'],\n ['type'=>'Wine'],\n ['type'=>'Beer'],\n ['type'=>'Beverage'],\n ['type'=>'Other'],\n ];\n \\App\\Category::insert($arr);\n }", "function saveCatalogType() {\n $data = array(\n 'catalogtype_title' => (string)$this->params['catalogtype_title'],\n 'catalogtype_name' => (string)$this->params['catalogtype_name'],\n 'catalogtype_loadlinks' => (int)$this->params['catalogtype_loadlinks'],\n 'catalogtype_loadteaser' => (int)$this->params['catalogtype_loadteaser']\n );\n return FALSE !== $this->databaseUpdateRecord(\n $this->tableCatalogTypes, $data, 'catalogtype_id', $this->params['type_id']\n );\n }", "public function run()\n {\n DB::table('type')->insert(array(\n array(\n 'name' => 'حضانة',\n 'description' => 'this is a type',\n ),\n array(\n 'name' => 'سنتر',\n 'description' => 'this is a type',\n ),\n array(\n 'name' => 'تحفيظ',\n 'description' => 'this is a type',\n ),\n array(\n 'name' => 'دار استضافة',\n 'description' => 'this is a type',\n ),\n array(\n 'name' => 'أخرى',\n 'description' => 'this is a type',\n ),\n ));\n }", "public function run()\n {\n \n\n \\DB::table('meta_types')->delete();\n \n \\DB::table('meta_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'catalog',\n 'title' => 'Справочник',\n 'ptitle' => 'Справочники',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'document',\n 'title' => 'Документ',\n 'ptitle' => 'Документы',\n ),\n ));\n \n \n }", "function addCatalogType() {\n $data = array(\n 'catalogtype_title' => (string)$this->params['catalogtype_title'],\n 'catalogtype_name' => (string)$this->params['catalogtype_name'],\n 'catalogtype_loadlinks' => (int)$this->params['catalogtype_loadlinks'],\n 'catalogtype_loadteaser' => (int)$this->params['catalogtype_loadteaser'],\n );\n return $this->databaseInsertRecord(\n $this->tableCatalogTypes, 'catalogtype_id', $data\n );\n }", "public function run()\n {\n //\n DB::table('borrower_types')->insert(array(\n array('type' => 'Teacher'),\n array('type' => 'Senior Student'),\n array('type' => 'Junior Student')\n ));\n }", "function add_id_type()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'New ID type has been added successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public function createTypes()\n {\n $configTypes = config('harvester.types');\n // loop through types and insert\n foreach ($configTypes as $keyType => $valueType) {\n foreach($valueType as $type) {\n $typeModel = $keyType . \"_types\";\n $typeName = $keyType . \"_type_name\";\n $typeDesc = $keyType . \"_type_desc\";\n \\DB::table($typeModel)->insert([\n $typeName => $type['name'],\n $typeDesc => $type['desc']\n ]);\n }\n }\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'candidatos',\n 'slug' => 'candidatos',\n 'display_name_singular' => 'Candidato',\n 'display_name_plural' => 'Candidatos',\n 'icon' => 'voyager-study',\n 'model_name' => 'App\\\\Candidato',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-12 04:54:10',\n 'updated_at' => '2018-05-17 04:03:33',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'edicoes',\n 'slug' => 'edicoes',\n 'display_name_singular' => 'Edição',\n 'display_name_plural' => 'Edições',\n 'icon' => 'voyager-settings',\n 'model_name' => 'App\\\\Edicao',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-12 04:55:49',\n 'updated_at' => '2018-05-12 04:55:49',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'campus',\n 'slug' => 'campus',\n 'display_name_singular' => 'Campus',\n 'display_name_plural' => 'Campi',\n 'icon' => 'voyager-company',\n 'model_name' => 'App\\\\Campus',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-17 00:24:21',\n 'updated_at' => '2018-05-17 00:24:21',\n ),\n ));\n \n \n }", "public function save()\n {\n AuthorizationModel::mustAuthorized(PERMISSION_CONTAINER_TYPE_CREATE);\n\n if ($this->validate()) {\n $containerType = $this->input->post('container_type');\n $description = $this->input->post('description');\n\n $save = $this->containerType->create([\n 'container_type' => $containerType,\n 'description' => $description\n ]);\n\n if ($save) {\n flash('success', \"Container type {$containerType} successfully created\", 'master/container-type');\n } else {\n flash('danger', 'Create container type failed, try again or contact administrator');\n }\n }\n $this->create();\n }", "public function run()\n {\n $temp = [];\n\n foreach (['整體運勢' , '愛情運勢' , '事業運勢' , '財運運勢'] as $value){\n $temp[] = [\n 'click108_type'=>$value\n ];\n }\n\n DB::table('click108_types')->insert($temp);\n }", "private function addToDatabase() {\n\t\t$scraperDAL = new scraperDAL();\n\n\t\t$scraperDAL->insertProducers($this->producers);\n\n\t}", "function insertToDatabase(){\r\n\t\t$id = $this->getSignupId();\r\n\t\t$questionString = $this->getQuestion();\r\n\t\t$type = $this->getType();\r\n\t\t$options = CommonTools::arrayToSql($this->getOptions());\r\n\t\t$public = CommonTools::booleanToSql($this->getPublic());\r\n\t\t$required = CommonTools::booleanToSql($this->getRequired());\r\n\r\n\t\t$sql = \"INSERT INTO ilmo_questions \" . \r\n\t \t\t\"(ilmo_id, question, type, options, public, required) \" . \r\n\t \t\t\"VALUES \" .\r\n\t \t\t\"($id, '$questionString', '$type', '$options', \" .\r\n\t \t\t\"$public, $required)\";\r\n\t \t\t\r\n\t \t// do query\r\n\t\t$this->database->doQuery($sql);\r\n\t}", "public function run()\n {\n //\n \\DB::table('type_cultures')->delete();\n\n \\DB::table('type_cultures')->insert(array(\n\n 1=> array(\n 'id_type_cultures'=>1,\n 'libelle_type_cultures' => 'CAFE'\n ),\n 2=> array(\n 'id_type_cultures'=>2,\n 'libelle_type_cultures' => 'CACAO'\n )\n ));\n }", "public function run()\n {\n $types = [\n ['name' => 'Системный'],\n ['name' => 'Пользовательский'],\n ];\n\n Type::insert($types);\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'news',\n 'slug' => 'news',\n 'display_name_singular' => 'News',\n 'display_name_plural' => 'News',\n 'icon' => NULL,\n 'model_name' => 'App\\\\News',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 01:39:23',\n 'updated_at' => '2019-10-09 05:29:15',\n ),\n 4 => \n array (\n 'id' => 5,\n 'name' => 'messages',\n 'slug' => 'messages',\n 'display_name_singular' => 'Message',\n 'display_name_plural' => 'Messages',\n 'icon' => 'voyager-mail',\n 'model_name' => 'App\\\\Message',\n 'policy_name' => 'App\\\\Policies\\\\MessagePolicy',\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 01:44:20',\n 'updated_at' => '2019-10-09 04:38:54',\n ),\n 5 => \n array (\n 'id' => 6,\n 'name' => 'clients',\n 'slug' => 'clients',\n 'display_name_singular' => 'Client',\n 'display_name_plural' => 'Clients',\n 'icon' => 'voyager-bubble-hear',\n 'model_name' => 'App\\\\Client',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-10-09 02:01:42',\n 'updated_at' => '2019-10-09 02:01:42',\n ),\n 6 => \n array (\n 'id' => 7,\n 'name' => 'portofolios',\n 'slug' => 'portofolios',\n 'display_name_singular' => 'Portofolio',\n 'display_name_plural' => 'Portofolios',\n 'icon' => 'voyager-wand',\n 'model_name' => 'App\\\\Portofolio',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:03:39',\n 'updated_at' => '2019-10-09 05:21:29',\n ),\n 7 => \n array (\n 'id' => 8,\n 'name' => 'services',\n 'slug' => 'services',\n 'display_name_singular' => 'Service',\n 'display_name_plural' => 'Services',\n 'icon' => 'voyager-lightbulb',\n 'model_name' => 'App\\\\Service',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:09:57',\n 'updated_at' => '2019-10-09 05:09:59',\n ),\n 8 => \n array (\n 'id' => 9,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:32:59',\n 'updated_at' => '2019-10-09 02:34:34',\n ),\n 9 => \n array (\n 'id' => 10,\n 'name' => 'testimonials',\n 'slug' => 'testimonials',\n 'display_name_singular' => 'Testimonial',\n 'display_name_plural' => 'Testimonials',\n 'icon' => 'voyager-star',\n 'model_name' => 'App\\\\Testimonial',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:37:39',\n 'updated_at' => '2019-10-09 05:30:13',\n ),\n ));\n \n \n }", "public function run()\n {\n DB::table('game_types')->insert([\n 'game_type_description' => 'Modalités de jeu'\n ]);\n }", "public function save() {\n\n\t\t$query = \"INSERT INTO \" . TB_EQUIPMENT_LIGHTING_BULB_TYPE . \"(name) VALUES ('\" . $this->db->sqltext($this->name) . \"')\";\n\t\t$this->db->query($query);\n\t\t\n\t}", "public function run()\n {\n $data = array(\n \t['name' => 'Consumer Care'],\n \t['name' => 'Connection'],\n \t['name' => 'Meter'],\n \t['name' => 'Reading'],\n \t['name' => 'Billing'],\n \t['name' => 'Collection'],\n \t['name' => 'Recovery'],\n \t['name' => 'Enforcement'],\n \t['name' => 'Grievances']\n );\n \n DB::table('document_types')->insert(\n \t$data\n );\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-08-13 08:45:36',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-03-07 21:36:16',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-03-07 21:36:16',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'students_projects',\n 'slug' => 'students-projects',\n 'display_name_singular' => 'Students Project',\n 'display_name_plural' => 'Students Projects',\n 'icon' => 'voyager-paper-plane',\n 'model_name' => 'App\\\\StudentsProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'about_us',\n 'slug' => 'about-us',\n 'display_name_singular' => 'About U',\n 'display_name_plural' => 'About Us',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutUs',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'contact_us',\n 'slug' => 'contact-us',\n 'display_name_singular' => 'Contact U',\n 'display_name_plural' => 'Contact Us',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ContactUs',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-08-11 16:38:29',\n ),\n 6 => \n array (\n 'id' => 8,\n 'name' => 'scholarship',\n 'slug' => 'scholarship',\n 'display_name_singular' => 'Scholarship',\n 'display_name_plural' => 'Scholarships',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Scholarship',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 7 => \n array (\n 'id' => 9,\n 'name' => 'contactus_message',\n 'slug' => 'contactus-message',\n 'display_name_singular' => 'Contactus Message',\n 'display_name_plural' => 'Contactus Messages',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ContactusMessage',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-04-03 12:18:54',\n 'updated_at' => '2019-07-07 23:24:19',\n ),\n 8 => \n array (\n 'id' => 10,\n 'name' => 'about_us_link',\n 'slug' => 'about-us-link',\n 'display_name_singular' => 'About Us Link',\n 'display_name_plural' => 'About Us Links',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutUsLink',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 9 => \n array (\n 'id' => 11,\n 'name' => 'partner_types',\n 'slug' => 'partner-types',\n 'display_name_singular' => 'Partner Type',\n 'display_name_plural' => 'Partner Types',\n 'icon' => 'voyager-documentation',\n 'model_name' => 'App\\\\PartnerType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-08 12:05:08',\n 'updated_at' => '2019-05-08 12:05:08',\n ),\n 10 => \n array (\n 'id' => 12,\n 'name' => 'partner2',\n 'slug' => 'partner2',\n 'display_name_singular' => 'Partner',\n 'display_name_plural' => 'Partners',\n 'icon' => 'voyager-group',\n 'model_name' => 'App\\\\Partner2',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":\"created_at\",\"order_display_column\":\"name\",\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-08 12:05:08',\n 'updated_at' => '2019-05-09 14:09:27',\n ),\n 11 => \n array (\n 'id' => 13,\n 'name' => 'slide_shows',\n 'slug' => 'slide-shows',\n 'display_name_singular' => 'Slide Show',\n 'display_name_plural' => 'Slide Shows',\n 'icon' => NULL,\n 'model_name' => 'App\\\\SlideShow',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-09 10:58:44',\n 'updated_at' => '2019-06-13 11:53:49',\n ),\n 12 => \n array (\n 'id' => 14,\n 'name' => 'events',\n 'slug' => 'events',\n 'display_name_singular' => 'Seminar',\n 'display_name_plural' => 'Seminars',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Event',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-09 14:13:33',\n 'updated_at' => '2019-05-09 15:27:34',\n ),\n 13 => \n array (\n 'id' => 16,\n 'name' => 'photo_albums',\n 'slug' => 'photo-albums',\n 'display_name_singular' => 'Photo Album',\n 'display_name_plural' => 'Photo Albums',\n 'icon' => 'voyager-photos',\n 'model_name' => 'App\\\\PhotoAlbum',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\Backend\\\\PhotoAlbumController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-10 12:01:46',\n 'updated_at' => '2019-05-16 08:30:15',\n ),\n 14 => \n array (\n 'id' => 17,\n 'name' => 'photos',\n 'slug' => 'photos',\n 'display_name_singular' => 'Photo',\n 'display_name_plural' => 'Photos',\n 'icon' => 'voyager-photo',\n 'model_name' => 'App\\\\Photo',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\Backend\\\\PhotoController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-10 12:01:46',\n 'updated_at' => '2019-05-19 14:37:09',\n ),\n 15 => \n array (\n 'id' => 18,\n 'name' => 'news',\n 'slug' => 'news',\n 'display_name_singular' => 'News',\n 'display_name_plural' => 'News',\n 'icon' => NULL,\n 'model_name' => 'App\\\\News',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-17 13:44:56',\n 'updated_at' => '2019-08-28 08:23:31',\n ),\n 16 => \n array (\n 'id' => 19,\n 'name' => 'about_gic',\n 'slug' => 'about-gic',\n 'display_name_singular' => 'About Gic',\n 'display_name_plural' => 'About Gics',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutGic',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-17 13:44:56',\n 'updated_at' => '2019-05-17 13:44:56',\n ),\n 17 => \n array (\n 'id' => 20,\n 'name' => 'student_message',\n 'slug' => 'student-message',\n 'display_name_singular' => 'Alumni/student\\'s Message',\n 'display_name_plural' => 'Student Messages',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentMessage',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-18 20:33:06',\n 'updated_at' => '2019-05-20 21:26:48',\n ),\n 18 => \n array (\n 'id' => 23,\n 'name' => 'scholarships',\n 'slug' => 'scholarships',\n 'display_name_singular' => 'Scholarships',\n 'display_name_plural' => 'Scholarships',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Scholarships',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-21 14:31:04',\n 'updated_at' => '2019-05-21 15:38:17',\n ),\n 19 => \n array (\n 'id' => 24,\n 'name' => 'important_link',\n 'slug' => 'important-link',\n 'display_name_singular' => 'Important Link',\n 'display_name_plural' => 'Important Links',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ImportantLink',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-24 16:18:32',\n 'updated_at' => '2019-05-24 16:18:32',\n ),\n 20 => \n array (\n 'id' => 25,\n 'name' => 'staffs',\n 'slug' => 'staffs',\n 'display_name_singular' => 'Staff',\n 'display_name_plural' => 'Staff',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Staff',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:19:49',\n 'updated_at' => '2019-07-24 06:19:09',\n ),\n 21 => \n array (\n 'id' => 26,\n 'name' => 'missions',\n 'slug' => 'missions',\n 'display_name_singular' => 'Mission',\n 'display_name_plural' => 'Missions',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Mission',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:20:08',\n 'updated_at' => '2019-06-07 16:07:07',\n ),\n 22 => \n array (\n 'id' => 27,\n 'name' => 'country',\n 'slug' => 'country',\n 'display_name_singular' => 'Country',\n 'display_name_plural' => 'Countries',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Country',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:20:17',\n 'updated_at' => '2019-05-31 16:21:34',\n ),\n 23 => \n array (\n 'id' => 28,\n 'name' => 'funders',\n 'slug' => 'funders',\n 'display_name_singular' => 'Funder',\n 'display_name_plural' => 'Funders',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Funder',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-29 22:20:27',\n 'updated_at' => '2019-05-29 22:20:27',\n ),\n 24 => \n array (\n 'id' => 30,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-31 13:49:35',\n 'updated_at' => '2019-05-31 13:49:35',\n ),\n 25 => \n array (\n 'id' => 32,\n 'name' => 'degrees',\n 'slug' => 'degrees',\n 'display_name_singular' => 'Degree',\n 'display_name_plural' => 'Degrees',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Degree',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 26 => \n array (\n 'id' => 33,\n 'name' => 'program_years',\n 'slug' => 'program-years',\n 'display_name_singular' => 'Program Year',\n 'display_name_plural' => 'Program Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ProgramYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 27 => \n array (\n 'id' => 34,\n 'name' => 'field_studies',\n 'slug' => 'field-studies',\n 'display_name_singular' => 'Field of Study/GIC\\'s Program',\n 'display_name_plural' => 'Field of Study/GIC\\'s Program',\n 'icon' => NULL,\n 'model_name' => 'App\\\\FieldStudy',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-13 21:10:20',\n ),\n 28 => \n array (\n 'id' => 35,\n 'name' => 'curriculums',\n 'slug' => 'curriculums',\n 'display_name_singular' => 'Curriculum',\n 'display_name_plural' => 'Curriculums',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Curriculum',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 29 => \n array (\n 'id' => 36,\n 'name' => 'academic_years',\n 'slug' => 'academic-years',\n 'display_name_singular' => 'Academic Year',\n 'display_name_plural' => 'Academic Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AcademicYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-07 16:41:49',\n 'updated_at' => '2019-06-22 22:56:55',\n ),\n 30 => \n array (\n 'id' => 37,\n 'name' => 'gic_projects',\n 'slug' => 'gic-projects',\n 'display_name_singular' => 'Gic Project',\n 'display_name_plural' => 'Gic Projects',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 15:04:33',\n 'updated_at' => '2019-08-14 07:53:21',\n ),\n 31 => \n array (\n 'id' => 38,\n 'name' => 'faq_types',\n 'slug' => 'faq-types',\n 'display_name_singular' => 'Faq Sub Type',\n 'display_name_plural' => 'Faq Sub Types',\n 'icon' => 'voyager-paperclip',\n 'model_name' => 'App\\\\FaqType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 20:15:34',\n 'updated_at' => '2019-08-29 06:47:38',\n ),\n 32 => \n array (\n 'id' => 39,\n 'name' => 'faqs2',\n 'slug' => 'faqs2',\n 'display_name_singular' => 'Faqs',\n 'display_name_plural' => 'Faqs',\n 'icon' => 'voyager-paper-plane',\n 'model_name' => 'App\\\\Faqs2',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 20:16:21',\n 'updated_at' => '2019-08-29 06:47:22',\n ),\n 33 => \n array (\n 'id' => 40,\n 'name' => 'staff_position',\n 'slug' => 'staff-position',\n 'display_name_singular' => 'Staff Position',\n 'display_name_plural' => 'Staff Positions',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StaffPosition',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 21:40:07',\n 'updated_at' => '2019-08-05 06:57:41',\n ),\n 34 => \n array (\n 'id' => 41,\n 'name' => 'posters',\n 'slug' => 'posters',\n 'display_name_singular' => 'Poster',\n 'display_name_plural' => 'Posters',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Poster',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-10 15:18:59',\n 'updated_at' => '2019-06-10 15:18:59',\n ),\n 35 => \n array (\n 'id' => 42,\n 'name' => 'awardee',\n 'slug' => 'awardee',\n 'display_name_singular' => 'Awardee',\n 'display_name_plural' => 'Awardees',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Awardee',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-13 01:58:54',\n 'updated_at' => '2019-06-22 23:30:07',\n ),\n 36 => \n array (\n 'id' => 43,\n 'name' => 'site_contents',\n 'slug' => 'site-contents',\n 'display_name_singular' => 'Content\\'s Section',\n 'display_name_plural' => 'Content\\'s Sections',\n 'icon' => NULL,\n 'model_name' => 'App\\\\SiteContent',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-13 11:25:43',\n 'updated_at' => '2019-06-22 14:45:31',\n ),\n 37 => \n array (\n 'id' => 45,\n 'name' => 'invited_professors',\n 'slug' => 'invited-professors',\n 'display_name_singular' => 'Invited Professor',\n 'display_name_plural' => 'Invited Professors',\n 'icon' => NULL,\n 'model_name' => 'App\\\\InvitedProfessor',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-16 19:19:23',\n 'updated_at' => '2019-06-22 21:31:23',\n ),\n 38 => \n array (\n 'id' => 46,\n 'name' => 'aluminus',\n 'slug' => 'aluminus',\n 'display_name_singular' => 'Aluminus',\n 'display_name_plural' => 'Aluminuses',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Aluminus',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-16 19:37:03',\n 'updated_at' => '2019-08-28 14:57:20',\n ),\n 39 => \n array (\n 'id' => 47,\n 'name' => 'gratuated_year',\n 'slug' => 'gratuated-year',\n 'display_name_singular' => 'Gratuated Year',\n 'display_name_plural' => 'Gratuated Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GratuatedYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-16 19:37:21',\n 'updated_at' => '2019-06-16 19:37:21',\n ),\n 40 => \n array (\n 'id' => 48,\n 'name' => 'videos',\n 'slug' => 'videos',\n 'display_name_singular' => 'Video',\n 'display_name_plural' => 'Videos',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Video',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 0,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-06-19 15:52:08',\n 'updated_at' => '2019-06-19 15:52:08',\n ),\n 41 => \n array (\n 'id' => 49,\n 'name' => 'calendar',\n 'slug' => 'calendar',\n 'display_name_singular' => 'Calendar',\n 'display_name_plural' => 'Calendars',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Calendar',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-11 15:44:06',\n 'updated_at' => '2019-08-11 15:44:55',\n ),\n 42 => \n array (\n 'id' => 50,\n 'name' => 'timetable',\n 'slug' => 'timetable',\n 'display_name_singular' => 'Timetable',\n 'display_name_plural' => 'Timetables',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Timetable',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-11 15:48:57',\n 'updated_at' => '2019-08-11 15:48:57',\n ),\n 43 => \n array (\n 'id' => 51,\n 'name' => 'report_slide',\n 'slug' => 'report-slide',\n 'display_name_singular' => 'Report Slide',\n 'display_name_plural' => 'Report Slides',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ReportSlide',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-11 15:50:02',\n 'updated_at' => '2019-08-11 15:50:02',\n ),\n 44 => \n array (\n 'id' => 52,\n 'name' => 'gic_service',\n 'slug' => 'gic-service',\n 'display_name_singular' => 'Gic Service',\n 'display_name_plural' => 'Gic Services',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicService',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-12 13:26:58',\n 'updated_at' => '2019-08-12 13:32:01',\n ),\n 45 => \n array (\n 'id' => 53,\n 'name' => 'gic_service_counter',\n 'slug' => 'gic-service-counter',\n 'display_name_singular' => 'Gic Service Counter',\n 'display_name_plural' => 'Gic Service Counters',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicServiceCounter',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-12 13:33:47',\n 'updated_at' => '2019-08-12 13:33:47',\n ),\n 46 => \n array (\n 'id' => 54,\n 'name' => 'promotion_years',\n 'slug' => 'promotion-years',\n 'display_name_singular' => 'Promotion Year',\n 'display_name_plural' => 'Promotion Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\PromotionYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-28 14:53:59',\n 'updated_at' => '2019-08-28 14:53:59',\n ),\n 47 => \n array (\n 'id' => 55,\n 'name' => 'student_project_type',\n 'slug' => 'student-project-type',\n 'display_name_singular' => 'Student Project Type',\n 'display_name_plural' => 'Student Project Types',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentProjectType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-29 02:04:58',\n 'updated_at' => '2019-08-29 02:04:58',\n ),\n 48 => \n array (\n 'id' => 56,\n 'name' => 'student_project',\n 'slug' => 'student-project',\n 'display_name_singular' => 'Student Project',\n 'display_name_plural' => 'Student Projects',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-29 02:06:01',\n 'updated_at' => '2019-08-29 02:07:34',\n ),\n 49 => \n array (\n 'id' => 57,\n 'name' => 'faq_parent_types',\n 'slug' => 'faq-parent-types',\n 'display_name_singular' => 'Faq Type',\n 'display_name_plural' => 'Faq Types',\n 'icon' => NULL,\n 'model_name' => 'App\\\\FaqParentType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-29 05:47:03',\n 'updated_at' => '2019-08-29 06:47:32',\n ),\n ));\n \n \n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Proizvod',\n 'display_name_plural' => 'Proizvodi',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-06 12:39:26',\n 'updated_at' => '2020-09-07 20:07:29',\n ),\n 4 => \n array (\n 'id' => 7,\n 'name' => 'orders',\n 'slug' => 'orders',\n 'display_name_singular' => 'Narudžbina',\n 'display_name_plural' => 'Narudžbine',\n 'icon' => 'voyager-file-text',\n 'model_name' => 'App\\\\Order',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:18:52',\n 'updated_at' => '2020-08-19 10:29:19',\n ),\n 5 => \n array (\n 'id' => 9,\n 'name' => 'order_product',\n 'slug' => 'order-product',\n 'display_name_singular' => 'Naručeni proizvodi',\n 'display_name_plural' => 'Naručeni proizvodi',\n 'icon' => 'voyager-window-list',\n 'model_name' => 'App\\\\OrderProduct',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2020-08-19 10:34:04',\n 'updated_at' => '2020-08-19 10:34:04',\n ),\n 6 => \n array (\n 'id' => 10,\n 'name' => 'sizes',\n 'slug' => 'sizes',\n 'display_name_singular' => 'Veličina',\n 'display_name_plural' => 'Veličine',\n 'icon' => 'voyager-tag',\n 'model_name' => 'App\\\\Size',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:49:18',\n 'updated_at' => '2020-08-28 12:12:31',\n ),\n 7 => \n array (\n 'id' => 11,\n 'name' => 'colors',\n 'slug' => 'colors',\n 'display_name_singular' => 'Boja',\n 'display_name_plural' => 'Boje',\n 'icon' => 'voyager-paint-bucket',\n 'model_name' => 'App\\\\Color',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2020-08-19 10:50:22',\n 'updated_at' => '2020-08-19 10:50:22',\n ),\n 8 => \n array (\n 'id' => 12,\n 'name' => 'categories',\n 'slug' => 'categories',\n 'display_name_singular' => 'Kategorija',\n 'display_name_plural' => 'Kategorije',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Category',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:53:57',\n 'updated_at' => '2020-08-25 09:43:08',\n ),\n 9 => \n array (\n 'id' => 13,\n 'name' => 'manufacturers',\n 'slug' => 'manufacturers',\n 'display_name_singular' => 'Manufacturer',\n 'display_name_plural' => 'Manufacturers',\n 'icon' => 'voyager-shop',\n 'model_name' => 'App\\\\Manufacturer',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-25 20:39:59',\n 'updated_at' => '2020-08-25 20:41:01',\n ),\n ));\n \n \n }", "function add_type()\n {\n $this->db->insert();\n return $this->db->insert_id();\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2019-05-01 23:54:05',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2018-11-26 03:07:00',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2018-11-26 03:07:00',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\ProductController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-15 18:36:06',\n 'updated_at' => '2019-05-28 01:00:51',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'categorias',\n 'slug' => 'categorias',\n 'display_name_singular' => 'Categoria',\n 'display_name_plural' => 'Categorias',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Categoria',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-12-24 11:53:48',\n 'updated_at' => '2018-12-24 11:55:35',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'cupoms',\n 'slug' => 'cupoms',\n 'display_name_singular' => 'Cupom',\n 'display_name_plural' => 'Cupoms',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Cupom',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\CupomController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-27 15:07:11',\n 'updated_at' => '2019-05-01 23:58:20',\n ),\n 6 => \n array (\n 'id' => 8,\n 'name' => 'clientes',\n 'slug' => 'clientes',\n 'display_name_singular' => 'Cliente',\n 'display_name_plural' => 'Clientes',\n 'icon' => 'voyager-person',\n 'model_name' => 'App\\\\Cliente',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-28 15:47:11',\n 'updated_at' => '2019-05-02 01:18:26',\n ),\n 7 => \n array (\n 'id' => 9,\n 'name' => 'pedidos',\n 'slug' => 'pedidos',\n 'display_name_singular' => 'Pedido',\n 'display_name_plural' => 'Pedidos',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Pedido',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-28 15:47:36',\n 'updated_at' => '2019-06-04 23:05:42',\n ),\n 8 => \n array (\n 'id' => 10,\n 'name' => 'flavors',\n 'slug' => 'flavors',\n 'display_name_singular' => 'Sabor',\n 'display_name_plural' => 'Sabores',\n 'icon' => 'voyager-pizza',\n 'model_name' => 'App\\\\Flavor',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-28 00:47:12',\n 'updated_at' => '2019-05-28 00:52:43',\n ),\n ));\n \n \n }", "public function insert_type()\n\t{\n\t\t$data = array(\n\t\t\t'typeTitle' => $this->input->post('typeTitle'),\n\t\t);\n\t\n\t\t// format as insert('table_name', values);\n\t\treturn $this->db->insert('Type', $data);\n\t}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:30',\n 'updated_at' => '2021-06-02 17:55:30',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:30',\n 'updated_at' => '2021-06-02 17:55:30',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:31',\n 'updated_at' => '2021-06-02 17:55:31',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'permissions',\n 'slug' => 'permissions',\n 'display_name_singular' => 'Permiso',\n 'display_name_plural' => 'Permisos',\n 'icon' => 'voyager-list',\n 'model_name' => 'App\\\\Models\\\\Permission',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":\"table_name\",\"order_display_column\":\"table_name\",\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2021-10-05 10:10:30',\n 'updated_at' => '2021-10-05 10:10:30',\n ),\n 4 => \n array (\n 'id' => 5,\n 'name' => 'publications_types',\n 'slug' => 'publications-types',\n 'display_name_singular' => 'Tipo de publicación',\n 'display_name_plural' => 'Tipos de publicación',\n 'icon' => 'voyager-list',\n 'model_name' => 'App\\\\Models\\\\PublicationsType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-06 12:29:38',\n 'updated_at' => '2021-10-06 14:36:48',\n ),\n 5 => \n array (\n 'id' => 6,\n 'name' => 'publications',\n 'slug' => 'publications',\n 'display_name_singular' => 'Publicación',\n 'display_name_plural' => 'Publicaciones',\n 'icon' => 'voyager-certificate',\n 'model_name' => 'App\\\\Models\\\\Publication',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-06 12:40:05',\n 'updated_at' => '2021-10-11 21:01:49',\n ),\n 6 => \n array (\n 'id' => 7,\n 'name' => 'officials',\n 'slug' => 'officials',\n 'display_name_singular' => 'Funcionario',\n 'display_name_plural' => 'Funcionarios',\n 'icon' => 'voyager-people',\n 'model_name' => 'App\\\\Models\\\\Official',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2021-10-11 11:31:09',\n 'updated_at' => '2021-10-11 11:31:09',\n ),\n 7 => \n array (\n 'id' => 8,\n 'name' => 'frequent_questions',\n 'slug' => 'frequent-questions',\n 'display_name_singular' => 'Pregunta frecuente',\n 'display_name_plural' => 'Preguntas frecuentes',\n 'icon' => 'voyager-question',\n 'model_name' => 'App\\\\Models\\\\FrequentQuestion',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-11 11:38:31',\n 'updated_at' => '2021-10-11 11:46:13',\n ),\n ));\n \n \n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'sections',\n 'slug' => 'sections',\n 'display_name_singular' => 'Section',\n 'display_name_plural' => 'Sections',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Models\\\\Section',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2022-11-29 13:07:23',\n 'updated_at' => '2022-11-29 14:35:11',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'contents',\n 'slug' => 'contents',\n 'display_name_singular' => 'Content',\n 'display_name_plural' => 'Contents',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Models\\\\Content',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2022-11-29 13:07:40',\n 'updated_at' => '2022-11-29 13:43:19',\n ),\n ));\n \n \n }", "public function collections() {\n $_POST = mswSafeImport($_POST, $this);\n // Pre-Checks..\n $enabled = (isset($_POST['enabled']) && in_array($_POST['enabled'], array(\n 'yes',\n 'no'\n )) ? $_POST['enabled'] : 'no');\n $social = (!empty($_POST['social']) ? mswSafeString(serialize($_POST['social']), $this) : '');\n $views = (int) $_POST['views'];\n $released = ($_POST['released'] ? $this->datetime->dateToTS($_POST['released']) : '0');\n $ts = $this->datetime->utcTime();\n $related = (!empty($_POST['related']) ? mswSafeString(serialize($_POST['related']), $this) : '');\n $covero = (!empty($_POST['coverother']) ? mswSafeString(serialize($_POST['coverother']), $this) : '');\n // Edit or add..\n if (isset($_POST['edit'])) {\n $ID = (int) $_POST['edit'];\n $Q = db::db_query(\"UPDATE `\" . DB_PREFIX . \"collections` SET\n `name` = '{$_POST['name']}',\n `title` = '{$_POST['title']}',\n `metakeys` = '{$_POST['metakeys']}',\n `metadesc` = '{$_POST['metadesc']}',\n `slug` = '{$_POST['slug']}',\n `information` = '{$_POST['information']}',\n `searchtags` = '{$_POST['searchtags']}',\n `social` = '{$social}',\n `coverart` = '{$_POST['coverart']}',\n `coverartother` = '{$covero}',\n `enabled` = '{$enabled}',\n `views` = '{$views}',\n `cost` = '{$_POST['cost']}',\n `costcd` = '{$_POST['costcd']}',\n `released` = '{$released}',\n `catnumber` = '{$_POST['catnumber']}',\n `updated` = '{$ts}',\n `related` = '{$related}',\n `length` = '{$_POST['length']}',\n `bitrate` = '{$_POST['bitrate']}'\n WHERE `id` = '{$ID}'\n \");\n } else {\n $Q = db::db_query(\"INSERT INTO `\" . DB_PREFIX . \"collections` (\n `name`,\n `title`,\n `metakeys`,\n `metadesc`,\n `slug`,\n `information`,\n `searchtags`,\n `social`,\n `coverart`,\n `coverartother`,\n `enabled`,\n `views`,\n `released`,\n `cost`,\n `costcd`,\n `catnumber`,\n `added`,\n `updated`,\n `related`,\n `length`,\n `bitrate`\n ) VALUES (\n '{$_POST['name']}',\n '{$_POST['title']}',\n '{$_POST['metakeys']}',\n '{$_POST['metadesc']}',\n '{$_POST['slug']}',\n '{$_POST['information']}',\n '{$_POST['searchtags']}',\n '{$social}',\n '{$_POST['coverart']}',\n '{$covero}',\n '{$enabled}',\n '{$views}',\n '{$released}',\n '{$_POST['cost']}',\n '{$_POST['costcd']}',\n '{$_POST['catnumber']}',\n '{$ts}',\n '{$ts}',\n '{$related}',\n '{$_POST['length']}',\n '{$_POST['bitrate']}'\n )\");\n $ID = db::db_last_insert_id();\n }\n // Update styles..\n db::db_query(\"DELETE FROM `\" . DB_PREFIX . \"collection_styles` WHERE `collection` = '{$ID}'\");\n mswTableTruncationRoutine(array(\n 'collection_styles'\n ), $this);\n if (!empty($_POST['styles'])) {\n foreach ($_POST['styles'] AS $styleID) {\n db::db_query(\"INSERT INTO `\" . DB_PREFIX . \"collection_styles` (\n `style`,`collection`\n ) VALUES (\n '{$styleID}','{$ID}'\n )\");\n }\n }\n return $Q;\n }", "public function run()\n {\n DB::table('project_types')->insert(array(\n array(\n 'type' => 'Disaster Relif'\n ),\n array(\n 'type' => 'Workshop'\n ),\n array(\n 'type' => 'Seminar'\n ),\n array(\n 'type' => 'Donation'\n ),\n ));\n }", "public function run()\n\t{\n\t\t\\DB::table('score_type')->delete();\n \n\t\t\\DB::table('score_type')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'name' => 'Best of Five',\n\t\t\t\t'name_short' => 'BO5',\n\t\t\t\t'created_at' => '0000-00-00 00:00:00',\n\t\t\t\t'updated_at' => '0000-00-00 00:00:00',\n\t\t\t),\n\t\t));\n\t}", "function SaveCollection($form_data) {\n\t\t$this -> db -> insert('collections', $form_data);\n\n\t\tif ($this -> db -> affected_rows() == '1') {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function run()\n {\n DB::table('form_types')->insert([\n\t\t\t['id' => 1, 'name' => 'General'],\n\t\t\t['id' => 2, 'name' => 'Analytical'],\n\t\t\t['id' => 3, 'name' => 'Evaluation'],\n\t\t\t['id' => 4, 'name' => 'Exp of Interest']\n\t\t]);\n\t}", "public abstract function saveCollection(array $collection);", "protected function saveMssql()\n {\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n foreach($this->items as $key => $item)\n {\n $sql = \"\n If Not Exists \n (\n Select * From \" . $dbTable . \" \n Where \" . $this->collectionClass . \"Id = \" . $key . \"\n )\n Insert Into \" . (string)$dbTable . \"\n (\". $this->baseClass . \"Id, \" . $this->collectionClass . \"Id)\n Values (\" . (int)$this->baseClassId . \", \" . (int)$key . \")\n \";\n }\n }", "public function run()\n {\n \\DB::table('contact_types')->insert($this->parseData($this->data));\n }", "function budget_type_save(budgetType $type) {\n $type->save();\n}", "public function run()\n {\n $type = new Type;\n \t$type->name = \"Photo gallery\"; // 1\n \t$type->save();\n\n \t$type = new Type;\n \t$type->name = \"iframe\"; // 2\n \t$type->save();\n\n $type = new Type;\n $type->name = \"Text\"; // 3\n $type->save();\n\n $type = new Type;\n $type->name = \"Notification\"; // 4\n $type->save();\n\n $type = new Type;\n $type->name = \"Web page\"; // 5\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 6\"; // 6\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 7\"; // 7\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 8\"; // 8\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 9\"; // 9\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 10\"; // 10\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 11\"; // 11\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 12\"; // 12\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 13\"; // 13\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 14\"; // 14\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 15\"; // 15\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 16\"; // 16\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 17\"; // 17\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 18\"; // 18\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 19\"; // 19\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 20\"; // 20\n $type->save();\n \t\n $type = new Type;\n $type->name = \"Catalog\"; // 21\n $type->save();\n\n $type = new Type;\n $type->name = \"Page\"; // 22\n $type->save();\n\n $type = new Type;\n $type->name = \"App\"; // 23\n $type->save(); \n\n $type = new Type;\n $type->name = \"User\"; // 24\n $type->save();\n\n $type = new Type;\n $type->name = \"Company\"; // 25\n $type->save();\n\n $type = new Type;\n $type->name = \"Offer\"; // 26\n $type->save();\n\n $type = new Type;\n $type->name = \"Custom\"; // 27\n $type->save();\n }", "private function categoryAdd()\n {\n $params = filter_input_array(INPUT_POST, [\n 'title' => filterOptions(0,'full_special_chars'),\n 'caption' => filterOptions(0,'full_special_chars'),\n 'description' => filterOptions(1,'boolean'),\n 'reproduce' => filterOptions(1,'boolean'),\n 'actual' => filterOptions(1,'boolean'),\n 'expected' => filterOptions(1,'boolean'),\n 'color' => filterOptions(1,'regexp',null,\n ['regexp'=>'/^[0-9a-f]{6}/i']),\n 'icon' => filterOptions(0,'full_special_chars')\n ]);\n $sql = \n 'INSERT INTO categories\n\n(id,title,caption,description,reproduce,expected,actual,color,icon)\n\n VALUES\n\n(\\'\\',:title,:caption,:description,:reproduce,:actual,:expected,:color,:icon)';\n\n if($this->_exec($sql,$params))\n $this->flash[] = 'Category added.';\n }", "public function run()\n {\n DB::table('types')->insert([\n [\n 'subid' => 0,\n 'name' => 'Internet',\n ],\n [\n 'subid' => 0,\n 'name' => 'print',\n ],\n ]);\n }", "public function addFieldCollection($type) {\n $field_collection_item = entity_create('field_collection_item', array('field_name' => $type));\n\n $this->field_collections[] = $field_collection_item;\n\n return entity_metadata_wrapper('field_collection_item', $field_collection_item);\n }", "public function run()\n {\n DB::table('storages_types')->insert([\n [\n 'label' => 'Ткань рулонная',\n 'category_table' => 'RollCategory',\n ],\n [\n 'label' => 'Ткань день-ночь',\n 'category_table' => 'ZebraCategory',\n ],\n [\n 'label' => 'Ткань вертикальная',\n 'category_table' => 'VertCategory',\n ],\n [\n 'label' => 'Лента горизонтальная',\n 'category_table' => 'GorizCategory',\n ],\n [\n 'label' => 'Метал',\n 'category_table' => '',\n ],\n [\n 'label' => 'Фурнитура',\n 'category_table' => '',\n ],\n ]);\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n ),\n \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n ),\n \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n ),\n \n array (\n 'id' => 4,\n 'name' => 'customers',\n 'slug' => 'customers',\n 'display_name_singular' => 'Customer',\n 'display_name_plural' => 'Customers',\n 'icon' => 'voyager-people',\n 'model_name' => 'App\\\\Customer',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n ),\n \n array (\n 'id' => 5,\n 'name' => 'specializations',\n 'slug' => 'specializations',\n 'display_name_singular' => 'Specialization',\n 'display_name_plural' => 'Specializations',\n 'icon' => 'voyager-window-list',\n 'model_name' => 'App\\\\Specialization',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n ),\n \n array (\n 'id' => 6,\n 'name' => 'doctors',\n 'slug' => 'doctors',\n 'display_name_singular' => 'Doctor',\n 'display_name_plural' => 'Doctors',\n 'icon' => 'voyager-people',\n 'model_name' => 'App\\\\Doctor',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n ),\n \n array (\n 'id' => 7,\n 'name' => 'appointments',\n 'slug' => 'appointments',\n 'display_name_singular' => 'Appointment',\n 'display_name_plural' => 'Appointments',\n 'icon' => 'voyager-credit-cards',\n 'model_name' => 'App\\\\Appointment',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n ),\n \n array (\n 'id' => 8,\n 'name' => 'patients',\n 'slug' => 'patients',\n 'display_name_singular' => 'Patient',\n 'display_name_plural' => 'Patients',\n 'icon' => 'voyager-group',\n 'model_name' => 'App\\\\Patient',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n ),\n \n array (\n 'id' => 9,\n 'name' => 'doctor_times',\n 'slug' => 'doctor-times',\n 'display_name_singular' => 'Doctor Time',\n 'display_name_plural' => 'Doctor Times',\n 'icon' => 'voyager-watch',\n 'model_name' => 'App\\\\DoctorTime',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n ),\n ));\n \n \n }", "public function run()\n {\n DB::table('book_site_types')->insert([\n 'type' => 'book_store',\n ]);\n DB::table('book_site_types')->insert([\n 'type' => 'library',\n ]);\n DB::table('book_site_types')->insert([\n 'type' => 'kiosk',\n ]);\n }", "public function run()\n {\n DB::table('content_types')->insert([\n 'name' => 'link',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('content_types')->insert([\n 'name' => 'text',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n\n DB::table('content_types')->insert([\n 'name' => 'img',\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n }", "protected function setCollection()\n {\n //TODO: Get the mapped table name.\n\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = \"\n Select \" . (string)$this->collectionClass . \"Id\n From \" . (string)$dbTable . \"\n Where \" . (string)$this->baseClass . \"Id = \" . (int)$this->baseClassId;\n $results = $this->db->query($sql);\n $data = $results->get(1);\n if($data->hasRows())\n {\n foreach($data->getAll() as $result)\n {\n $itemId = $result[$this->collectionClass . 'Id'];\n //$obj = new $this->collectionClass($itemId);\n $obj = ModelFactory::get($this->collectionClass, $itemId);\n $this->items[$itemId] = $obj;\n }\n $t=0;\n }\n }", "public function run()\n {\n DB::table('entry_types')->insert([\n \t'ent_name' => 'PPDB',\n ]);\n\n DB::table('entry_types')->insert([\n \t'ent_name' => 'Pindahan',\n ]);\n }", "public function run()\n {\n // TypeCom::truncate();\n\n $data = [\n ['slug' => 'bahan-pangan', 'title' => 'Bahan Pangan'],\n ['slug' => 'hewan-ternak', 'title' => 'Hewan Ternak']\n ];\n\n TypeCom::insert($data);\n }", "function addOvertimeType($uid, $kind, $name, $code, $rate, $rateAd, $dateCreated, $dateModified){\n $query = ORM::forTable(\"overtime_type\")->create();\n $query->overtime_type_uid = $uid;\n $query->overtime_kind = $kind;\n $query->overtime_type_name = $name;\n $query->overtime_type_code = $code;\n $query->rate = $rate;\n $query->additional_rate = $rateAd;\n $query->date_created = $dateCreated;\n $query->date_modified = $dateModified;\n $query->save();\n}", "function insert($type,$options)\t\r\n\t{\r\n\t\t//var_dump($options['idno']);\r\n\r\n\t\t//validate\r\n\t\tif ($this->validate_survey($options)){\t\t\t\t\t\t\r\n\t\t\t//create folder for survey\r\n\t\t\t$options['dirpath']=$this->setup_folder($repositoryid='central', $folder_name=md5($options['surveyid']));\r\n\t\t}\r\n\r\n\t\t//encode json fields\r\n\t\tforeach ($this->encoded_fields as $field){\r\n\t\t\tif(isset($options[$field])){\r\n\t\t\t\t$options[$field]=$this->encode_metadata($options[$field]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t$data=array();\r\n\t\t//default values, if no values are passed in $options\r\n\t\t$data['created']=date(\"U\");\r\n\t\t$data['changed']=date(\"U\");\r\n\r\n\t\tforeach($options as $key=>$value){\r\n\t\t\tif (in_array($key,$this->survey_fields) ){\r\n\t\t\t\t$data[$key]=$value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//create new study\r\n\t\t$result=$this->db->insert('surveys', $data); \r\n\r\n\t\tif ($result===false){\r\n\t\t\tthrow new Exception($this->db->error('message'));\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->db->insert_id();\r\n\t}", "public function run()\n {\n foreach ($this->data() as $types){\n Team::insert([\n 'title' => $types['title'],\n 'creator_id' => 1,\n ]);\n }\n }", "public function run()\n {\n DB::table('id_types')->insert([\n ['name' => 'هوية', 'type' => 0, 'number' => 9],\n ['name' => 'جواز سفر', 'type' => 0, 'number' => 7],\n ['name' => 'بطاقة تعريف', 'type' => 0, 'number' => 9],\n ]);\n }", "private function insertCollectionFieldRecord()\n {\n return $this->collection->fields()->create($this->field);\n }", "function create($title, $type, $content){\n\n $values['title'] = $title;\n $values['type'] = $type;\n $values['content'] = $content;\n\n $db = new db();\n $navigationId = $db->insert('widgets', $values);\n \n \n return $navigationId;\n\n }", "public function run()\n {\n DB::table('dp_types')->insert([\n \t['label' => \"Doesn't have\"],\n \t['label' => 'Basic'],\n \t['label' => 'Limited'],\n \t['label' => 'Unlimited'],\n \t['label' => 'Maintenance'],\n ]\n \t);\n }", "public function putCollection();", "public function run()\n {\n Language::insert([['id'=>1,'name'=>'Arabic'],['id'=>2,'name'=>'English']]);\n }", "public function run()\n {\n\t\t\\DB::table('types')->insert(array (\n 'id' \t\t=> '1',\n 'description' => 'Patrimonio Urbano, Arquitetonico y Artístico, museos y Manifestaciones Culturales',\n ));\n \\DB::table('types')->insert(array (\n 'id' \t\t=> '2',\n 'description' => 'Etnografia y folklore',\n ));\n \\DB::table('types')->insert(array (\n 'id' \t\t=> '3',\n 'description' => 'Realizaciones Tecnicas Cientificas',\n ));\n \\DB::table('types')->insert(array (\n 'id' \t\t=> '4',\n 'description' => 'Acontecimientos Programados',\n ));\n \n }", "function create()\n\t{\n\t\tglobal $rbacsystem;\n\n\t\t$new_type = $_POST[\"new_type\"] ? $_POST[\"new_type\"] : $_GET[\"new_type\"];\n\n\t\t// fill in saved values in case of error\n\t\t$data = array();\n\t\t$data[\"fields\"] = array();\n\t\t$data[\"fields\"][\"title\"] = $_SESSION[\"error_post_vars\"][\"Fobject\"][\"title\"];\n\t\t$data[\"fields\"][\"desc\"] = $_SESSION[\"error_post_vars\"][\"Fobject\"][\"desc\"];\n\n\t\t$this->getTemplateFile(\"edit\",$new_type);\n\n\t\tforeach ($data[\"fields\"] as $key => $val)\n\t\t{\n\t\t\t$this->tpl->setVariable(\"TXT_\".strtoupper($key), $this->lng->txt($key));\n\t\t\t$this->tpl->setVariable(strtoupper($key), $val);\n\n\t\t\tif ($this->prepare_output)\n\t\t\t{\n\t\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t}\n\t\t}\n\t\t$this->ctrl->setParameter($this, \"new_type\", $new_type);\n//echo \"<br>lmobjectgui_formaction\";\n//echo \":\".$this->ctrl->getFormAction($this, \"save\", \"bla\").\":\";\n\t\t$this->tpl->setVariable(\"FORMACTION\",\n\t\t\t$this->ctrl->getFormAction($this, \"save\"));\n\t\t$this->tpl->setVariable(\"TXT_HEADER\", $this->lng->txt($new_type.\"_new\"));\n\t\t$this->tpl->setVariable(\"TXT_CANCEL\", $this->lng->txt(\"cancel\"));\n\t\t$this->tpl->setVariable(\"TXT_SUBMIT\", $this->lng->txt($new_type.\"_add\"));\n\t\t$this->tpl->setVariable(\"CMD_SUBMIT\", \"save\");\n\t\t$this->tpl->setVariable(\"TARGET\", $this->getTargetFrame(\"save\"));\n\t\t$this->tpl->setVariable(\"TXT_REQUIRED_FLD\", $this->lng->txt(\"required_field\"));\n\n\t}", "public function save() {\n\n $query = DB::connection()->prepare('INSERT INTO BandGenre (band_id, genre_id) VALUES (:band, :genre)');\n\n $query->execute(array('band' => $this->band_id, 'genre' =>\n $this->genre_id));\n }", "public function run()\n {\n $types = [\n [\n 'type' => 'Standard',\n 'permissions' => '',\n ],\n [\n 'type' => 'Manager',\n 'permissions' => '',\n ],\n [\n 'type' => 'Owner',\n 'permissions' => '',\n ],\n ];\n\n DB::table('user_types')->insert($types);\n\n }", "public function run()\n {\n DB::table('vehicle_types')->insert([\n ['type' => 'Midibus'],\n ['type' => 'Minibus'],\n ['type' => 'Other'],\n ]);\n }", "public function run()\n {\n $data = array(\n array('name' => 'Personas'),\n array('name' => 'Aplicaciones (software)'),\n array('name' => 'Aplicaciones (hardware)'),\n array('name' => 'Servicios'),\n array('name' => 'Información'),\n array('name' => 'Datos'),\n array('name' => 'Comunicaciones'),\n array('name' => 'Recursos administrativos'),\n array('name' => 'Recursos físicos')\n );\n\n AssetType::insert($data);\n }", "public function run()\n {\n $typeBeers[] = ['title' => 'Светлое'];\n $typeBeers[] = ['title' => 'Темное'];\n $typeBeers[] = ['title' => 'Полутемное'];\n \\Illuminate\\Support\\Facades\\DB::table('type_beers')->insert($typeBeers);\n }", "protected function saveFieldCollections() {\n if ($this->field_collections) {\n foreach ($this->field_collections as $field_collection) {\n // Ensure the correct language is set for the field on the host entity.\n $langcode = entity_metadata_field_get_language($this->type(), $this->value(), $field_collection->fieldInfo());\n\n $field_collection->setHostEntity($this->type(), $this->value(), $langcode);\n $field_collection->save(TRUE);\n }\n }\n }", "public function test_save() {\n global $DB;\n // don't have much data as yet\n $data = array(\n 'mark' => 0\n );\n $this->_cut->save(45, $data, $this->_now);\n $this->assertTrue(\n $DB->record_exists('dragdrop_sentence', array(\n 'instanceid' => 45,\n 'timecreated' => $this->_now,\n 'timemodified' => $this->_now\n ))\n );\n }", "public function type()\n {\n if (isset($_POST['save'])) {\n if (!get_permission('attachment_type', 'is_add')) {\n access_denied();\n }\n $this->type_validation();\n if ($this->form_validation->run() !== false) {\n $arrayData = array(\n 'name' => $this->input->post('type_name'),\n 'branch_id' => $this->application_model->get_branch_id(),\n );\n $this->db->insert('attachments_type', $arrayData);\n set_alert('success', translate('information_has_been_saved_successfully'));\n redirect(current_url());\n }\n }\n\n $this->data['typelist'] = $this->app_lib->getTable('attachments_type');\n $this->data['title'] = translate('attachment_type');\n $this->data['sub_page'] = 'attachments/type';\n $this->data['main_menu'] = 'attachments';\n $this->load->view('layout/index', $this->data);\n }", "public function run()\n {\n $document_type = new Document_type();\n $document_type->name = 'Dossier d\\'ouvrage éxécutif (DOE)';\n $document_type->picture = 'doe.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Devis en cours';\n $document_type->picture = 'dec.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'PV';\n $document_type->picture = 'pv.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Permis de travail en hauteur';\n $document_type->picture = 'pth.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Relevé de réserves';\n $document_type->picture = 'rdr.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Relevé de compteur';\n $document_type->picture = 'rdc.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Environnement, Hygiène et sécurité (EHS)';\n $document_type->picture = 'ehs.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Références produits';\n $document_type->picture = 'rp.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Contrôle d\\'étanchéité';\n $document_type->picture = 'cde.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Gestion éclairage';\n $document_type->picture = 'ge.png';\n $document_type->save();\n\n $document_type = new Document_type();\n $document_type->name = 'Planning Annuel';\n $document_type->picture = 'pa.png';\n $document_type->save();\n }", "public function run()\n {\n TypeAnimal::insert([\n ['name' => 'Заяц'],\n ['name' => 'Волк']\n ]);\n }", "public function run()\n {\n DB::table('describes_customers_types')->insert([\n [\n 'id_customer'=> 3,\n 'id_customer_type'=>'2',\n ],\n [\n 'id_customer'=> 4,\n 'id_customer_type'=>'3',\n ],\n ]);\n }", "public function run()\n {\n $data =\t[\n \t['type' => 'Hindu'],\n \t['type' => 'Muslim'],\n \t['type' => 'Christian'],\n \t['type' => 'Sikh'],\n \t['type' => 'Buddhist'],\n \t['type' => 'Zoroastrian'],\n \t['type' => 'Jain']\n ];\n Religion::insert($data);\n }", "public function run()\n {\n foreach($this->types as $type) {\n $type['slug'] = Str::slug($type['name']);\n CategoryTypes::updateOrCreate($type);\n }\n }", "public function run()\n {\n $data = array(\n array(\n 'type' => 'album',\n 'name' => 'Miền Bắc',\n 'slug' => 'mien-bac'\n ),\n array(\n 'type' => 'album',\n 'name' => 'Miền Trung',\n 'slug' => 'mien-trung'\n ),\n array(\n 'type' => 'album',\n 'name' => 'Miền Nam',\n 'slug' => 'mien-nam'\n )\n );\n Category::insert($data);\n }", "public function run()\n {\n $field_types = [\n 'Text',\n 'Number',\n 'Select'\n ];\n\n FieldType::truncate();\n DB::beginTransaction();\n\n try {\n foreach ($field_types as $field_type) {\n $model_field_type = new FieldType;\n $model_field_type->name = $field_type;\n $model_field_type->slug = Str::slug($field_type , \"-\");\n $model_field_type->save();\n }\n DB::commit();\n $this->command->info('Field Types Successfully Inserted');\n } catch (Exception $e) {\n DB::rollBack();\n $this->command->info('Failed to Insert Field Types');\n }\n }", "public function run()\n {\n DB::table('staff_types')->insert([\n ['name' => 'Employee'],\n ['name' => 'Manager'],\n ]);\n }", "public function run()\n {\n //\n DB::table(\"property_types\")->insert([\n [\"name\" => \"Condo\"],\n [\"name\" => 'House'],\n [\"name\" => 'Land']\n ]);\n }", "public function addSpecializationToDb(){\r\n $sname = $_POST['sname'];\r\n $this->load->model('operator/ApplicationFormModel');\r\n $this->ApplicationFormModel->addNewSpecialization($sname);\r\n }", "public function run()\n {\n\t\t\\DB::table('liqueurs_types')->insert(array (\n \t'tipo_licor' => 'Ron'\n ));\n\n \\DB::table('liqueurs_types')->insert(array (\n \t'tipo_licor' => 'Vino'\n ));\n\n \t\\DB::table('liqueurs_types')->insert(array (\n \t'tipo_licor' => 'Vodka'\n ));\n\n \\DB::table('liqueurs_types')->insert(array (\n \t'tipo_licor' => 'Whiskey'\n ));\n\n \\DB::table('liqueurs_types')->insert(array (\n \t'tipo_licor' => 'Brandi'\n ));\n\n }", "public function run()\n {\n $data = [\n [\n 'name' => 'SQLite Database',\n 'maximum' => 5,\n 'internal_class' => 'SqliteDatabase',\n ],\n [\n 'name' => 'MySQL Database',\n 'maximum' => 5,\n 'internal_class' => 'MysqlDatabase',\n ],\n [\n 'name' => 'Virtual Machine',\n 'maximum' => 5,\n 'internal_class' => 'VirtualMachine',\n ],\n ];\n\n $this->table('resource_types')\n ->insert($data)\n ->save();\n }", "public function run()\n {\n CategoryType::create([\n 'name' => 'Курс'\n ]);\n\n CategoryType::create([\n 'name' => 'Медитация'\n ]);\n }", "public function run()\n {\n $types = [\n [\n 'name' => 'pizza'\n ],\n [\n 'name' => 'drinks'\n ],\n [\n 'name' => 'sweets'\n ]\n ];\n\n foreach ($types as $type) {\n DB::table('types')->insert($type);\n }\n }", "private function storeToDB(){\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `WriteBackSuggestion`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\n\t}", "public function insert_tag($name, $object_id, $collection_id) {\n $parent = get_term_by('name', 'socialdb_tag', 'socialdb_tag_type');\n $array = socialdb_insert_term($name, 'socialdb_tag_type', $parent->term_id, sanitize_title(remove_accent($name)) . \"_\" . $collection_id);\n socialdb_add_tax_terms($collection_id, array($array['term_id']), 'socialdb_tag_type');\n socialdb_add_tax_terms($object_id, array($array['term_id']), 'socialdb_tag_type');\n }", "public function createLichaamstype($lichaamstype){\n $sql=\"insert into lichaamstypes VALUES(:lichaamstype) \";\n $dbh=new PDO(DBCONFIG::$DB_CONNSTRING,DBCONFIG::$DB_USERNAME,DBCONFIG::$DB_PASSWORD);\n $stmt=$dbh->prepare($sql);\n $stmt->execute(array(\n ':lichaamstype'=>$lichaamstype\n ));\n $lichaamstypeId=$dbh->lastInsertId();\n $dbh=null;\n }", "public function run()\n {\n //\n DB::table('type')->insert([\n 'type_name' => 'Hub',\n ]);\n DB::table('type')->insert([\n 'type_name' => 'Branch',\n ]);\n DB::table('type')->insert([\n 'type_name' => 'Agent',\n ]);\n }", "public function actionRbacAuthItemCreate($type){\n\n\t\t$editor = new CrugeAuthItemEditor('insert');\n\t\t$editor->name = \"\";\n\t\t$editor->description = \"\";\n\t\t$editor->businessRule = \"\";\n\t\t$editor->categoria = Yii::app()->user->rbac->getAuthItemTypeName($type);\n\t\t$editor->isNewRecord = true;\n\n\n\t\tif(isset($_POST['CrugeAuthItemEditor']))\n\t\t{\n\t\t\tif(isset($_POST['volver'])){\n\t\t\t\tif($type == CAuthItem::TYPE_ROLE)\n\t\t\t\t\t$this->redirect(array('rbaclistroles'));\n\t\t\t\tif($type == CAuthItem::TYPE_TASK)\n\t\t\t\t\t$this->redirect(array('rbaclisttasks'));\n\t\t\t\tif($type == CAuthItem::TYPE_OPERATION)\n\t\t\t\t\t$this->redirect(array('rbaclistops'));\n\t\t\t}\n\n\t\t\t$editor->attributes=$_POST['CrugeAuthItemEditor'];\n\t\t\tif($editor->validate()){\n\n\n\t\t\t\t$newAi = Yii::app()->user->rbac->createAuthItem(\n\t\t\t\t\t\t$editor->name,\n\t\t\t\t\t\t$type,\n\t\t\t\t\t\t$editor->description,\n\t\t\t\t\t\t$editor->businessRule\n\t\t\t\t\t);\n\n\n\t\t\t\t// se va de vuelta a la lista de donde vino\n\t\t\t\tif($type == CAuthItem::TYPE_ROLE)\n\t\t\t\t\t$this->redirect(array('rbaclistroles'));\n\t\t\t\tif($type == CAuthItem::TYPE_TASK)\n\t\t\t\t\t$this->redirect(array('rbaclisttasks'));\n\t\t\t\tif($type == CAuthItem::TYPE_OPERATION)\n\t\t\t\t\t$this->redirect(array('rbaclistops'));\n\t\t\t}\n\t\t}\n\t\t$this->render('rbacauthitemcreate',array('model'=>$editor));\n\t}", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stylists (stylist_name,specialty) VALUES ('{$this->stylist_name}','{$this->specialty}');\");\n $this->id = $GLOBALS['DB']->lastInsertID();\n }", "public function change()\n {\n $sql = \"INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_s_to_n_img','Land image of south to north');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_n_to_s_img','Land image of north to south');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_e_to_w_img','Land image of east to west');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_w_to_e_img','Land image of west to east');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('vehicle_img','Vehicle Image');\";\n\n $this->execute($sql);\n }", "public function run()\n {\n DB::table('roletype')->insert([\n ['rolename'=>'User'],\n ['rolename'=>'Admin']\n ]);\n }", "function saveCategory($data)\n{\n\tglobal $db;\n\n\t$statement = $db->prepare('INSERT INTO categories(title) VALUES (:title)');\t\t\t\t\t\t\t \n\t\n\t$statement->execute(array('title' => $data['title']));\n}", "public static function _insert()\n\t{\n\t}" ]
[ "0.75470394", "0.6006212", "0.6005459", "0.59463096", "0.5942763", "0.59424794", "0.58310735", "0.5802149", "0.57609475", "0.5716219", "0.57087266", "0.56915665", "0.5677502", "0.56654066", "0.5652783", "0.5630663", "0.56266475", "0.56136495", "0.5605685", "0.5605537", "0.55909455", "0.557875", "0.5577806", "0.554898", "0.5542462", "0.5533239", "0.5518521", "0.55096006", "0.5502971", "0.54838955", "0.5478956", "0.5477596", "0.547051", "0.5466755", "0.5461037", "0.54555815", "0.5447743", "0.54472303", "0.5439381", "0.54233944", "0.54177445", "0.54132044", "0.5412782", "0.54065955", "0.5394405", "0.5383252", "0.53819543", "0.538181", "0.53795063", "0.53680605", "0.5363649", "0.53558594", "0.53415704", "0.5339275", "0.5329406", "0.53233886", "0.5317626", "0.53174734", "0.5314942", "0.5314381", "0.5305341", "0.53025687", "0.5282322", "0.5273547", "0.5268459", "0.5267422", "0.52576804", "0.52542436", "0.52527887", "0.52269804", "0.52260643", "0.5222104", "0.5222015", "0.5217343", "0.5213358", "0.5213033", "0.5211739", "0.5211022", "0.5195905", "0.5191195", "0.51888734", "0.518636", "0.5186348", "0.5185662", "0.5181211", "0.51792455", "0.51787853", "0.5172086", "0.5168161", "0.51617354", "0.51581377", "0.5157553", "0.5147477", "0.5144657", "0.5139384", "0.5139287", "0.51373786", "0.51331085", "0.51315707", "0.51312315" ]
0.79400957
0
Insert a new Editor_collection_type into musicbrainz database and return a Editor_collection_type with new autoincrement primary key
Вставить новый Editor_collection_type в базу данных musicbrainz и вернуть Editor_collection_type с новым автоинкрементным первичным ключом
public function insert2($editor_collection_type) { $query="INSERT INTO editor_collection_type ( ". "id,". "name,". "entity_type,". "parent,". "child_order,". "description,". "gid ". ")". "VALUES (". "null,". "'".$this->sqlSafe($editor_collection_type->name)."',". "'".$this->sqlSafe($editor_collection_type->entity_type)."',". " ".$editor_collection_type->parent." ,". " ".$editor_collection_type->child_order." ,". "'".$this->sqlSafe($editor_collection_type->description)."',". "'".$this->sqlSafe($editor_collection_type->gid)."' ". ")"; $id = $this->executeInsert($query); $editor_collection_type->id = $id; return($editor_collection_type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert($editor_collection_type)\n {\n $query=\"INSERT INTO editor_collection_type ( \".\n\t \"id,\".\n \"name,\".\n \"entity_type,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \" \".$editor_collection_type->parent.\" ,\".\n \" \".$editor_collection_type->child_order.\" ,\".\n \"'\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n \")\"; \n\n $this->executeQuery($query);\n }", "function add_type()\n {\n $this->db->insert();\n return $this->db->insert_id();\n }", "function getInsertTypeId() {\n\t\treturn $this->getInsertId('announcement_types', 'type_id');\n\t}", "function insertDocumentTypeAction(){\n\t\tif($this->getRequest()->isPost()){\n\t\t\t$data = $this->getRequest()->getPost();\n\t\t\t$data['status']=1;\n\t\t\t$data['display_by']=1;\n\t\t\t//$data['type']=24;\n\t\t\t\n\t\t\t$db = new Other_Model_DbTable_DbLoanType();\n\t\t\t$id = $db->addViewType($data);\n\t\t\tprint_r(Zend_Json::encode($id));\n\t\t\texit();\n\t\t}\n\t}", "public function __insert()\n {\n $this->created_at = date(\\DClass\\lib\\Util::dateformat);\n $dbal = new DBAL();\n DBAL::$id_lang_static = $this->dvid_lang;\n $id = $dbal->createDbal($this);\n return $id;\n }", "function addCatalogType() {\n $data = array(\n 'catalogtype_title' => (string)$this->params['catalogtype_title'],\n 'catalogtype_name' => (string)$this->params['catalogtype_name'],\n 'catalogtype_loadlinks' => (int)$this->params['catalogtype_loadlinks'],\n 'catalogtype_loadteaser' => (int)$this->params['catalogtype_loadteaser'],\n );\n return $this->databaseInsertRecord(\n $this->tableCatalogTypes, 'catalogtype_id', $data\n );\n }", "public function create()\n {\n $data = $this->data;\n $data = $this->before_db($data);\n $data = $this->clear_others($data);\n if ($this->unset_primary)\n unset($data[$this->primary_key]);\n\n $insert_id = $this->db->query($this->sql->insert('?a')->generate(), $data);\n $this->data[$this->primary_key] = $insert_id;\n return $insert_id;\n }", "function add_id_type()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'New ID type has been added successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "private function insertCollectionFieldRecord()\n {\n return $this->collection->fields()->create($this->field);\n }", "function save()\n\t{\n\t\t$this->apidata[\"object_type\"] = \"collection\";\n\n\t\t$o = new DOCMGR_OBJECT($this->apidata);\n\t\t$objId = $o->save();\t\n\n\t\t//toss and error if we have one\n\t\t$err = $o->getError();\n\n\t\tif ($err)\n\t\t{ \n\t\t\t$this->throwError($err);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $objId;\n\t\t}\n\t\t\n\t}", "protected function _insert() {\n\n\t\t// PHP does weird things when casting floats to strings, so do it manually it here.\n\t\t// @see https://github.com/nicolasff/phpredis/issues/217\n\t\t$this->_data['_created'] = number_format(microtime(true), 8, '.', '');\r\n\t\t$this->_adapter->save($this);\r\n\t\treturn $this->getId();\r\n\t}", "protected function save()\n {\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = '';\n foreach($this->items as $key => $item)\n {\n $sql .= \"\n Insert Into \" . (string)$dbTable . \"\n (\". $this->baseClass . \"Id, \" . $this->collectionClass . \"Id)\n Values (\" . (int)$this->baseClassId . \", \" . (int)$key . \")\n Where Not Exists \n (\n Select * From \" . $dbTable . \" \n Where \" . $this->collectionClass . \"Id = \" . $key . \"\n And \" . $this->baseClass . \"Id = \" . $this->baseClassId . \"\n )\n \";\n }\n }", "public function add(){\n\t\t$this->dao->connect();\n\t\t$table = get_class($this);\n\t\t$fields = $this->my_get_object_vars();\n\t\t\n\t\t$rs = $this->dao->db->AutoExecute($table, $fields, \"INSERT\") or $this->throwException($this->dao->db->ErrorMsg() . \"<br>CENAS SQL: \".var_export($fields,true). \" - Table: \".$table);\n\t\t$id = $this->dao->db->Insert_ID();\n\t\t\n\t\t$this->dao->disconnect();\n\t\treturn $id;\n\t}", "public function insert(){\n\t\t$arr = array('module_id' => $this->v_module_id\n\t\t\t\t\t,'module_pid' => $this->v_module_pid\n\t\t\t\t\t,'module_text' => $this->v_module_text\n\t\t\t\t\t,'module_key' => $this->v_module_key\n\t\t\t\t\t,'module_type' => $this->v_module_type\n\t\t\t\t\t,'module_role' => $this->v_module_role\n\t\t\t\t\t,'module_root' => $this->v_module_root\n\t\t\t\t\t,'module_dir' => $this->v_module_dir\n\t\t\t\t\t,'module_order' => $this->v_module_order\n\t\t\t\t\t,'module_rules' => $this->arr_module_rules\n\t\t\t\t\t,'module_index' => $this->v_module_index\n\t\t\t\t\t,'module_locked' => $this->v_module_locked\n\t\t\t\t\t,'module_time' => $this->v_module_time\n\t\t\t\t\t,'module_icon' => $this->v_module_icon\n\t\t\t\t\t,'module_category' => $this->v_module_category\n\t\t\t\t\t,'module_description' => $this->v_module_description\n ,'module_menu'=>$this->v_module_menu);\n\t\ttry{\n\t\t\t$this->collection->insert($arr, array('safe'=>true));\n\t\t\t$this->v_mongo_id = isset($arr['_id'])?$arr['_id']:'';\n\t\t\treturn $this->v_mongo_id;\n\t\t}catch(MongoCursorException $e){\n\t\t\t$this->v_error_code = $e->getCode();\n\t\t\t$this->v_error_message = $e->getMessage();\n\t\t\t$this->my_error();\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function update($editor_collection_type)\n {\n $query=\"UPDATE editor_collection_type \".\n\t \"SET \".\n \"id= \".$editor_collection_type->id.\" ,\".\n \"name='\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"entity_type='\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \"parent= \".$editor_collection_type->parent.\" ,\".\n \"child_order= \".$editor_collection_type->child_order.\" ,\".\n \"description='\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"gid='\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n\t \"WHERE id=\".$editor_collection_type->id;\n\n $this->executeQuery($query);\n }", "static function create(){\n\t\tif(self::validate()){\n\t\t\tself::$insert = Arrays::extract(self::$usedColumns,Page::$in);\n\t\t\tunset(self::$insert['id']);\n\t\t\t$id = Db::insert(PageTool::$model['table'],self::$insert);\n\t\t\treturn $id;\n\t\t}\n\t}", "function create($title, $type, $content){\n\n $values['title'] = $title;\n $values['type'] = $type;\n $values['content'] = $content;\n\n $db = new db();\n $navigationId = $db->insert('widgets', $values);\n \n \n return $navigationId;\n\n }", "public function create($data) {\n $this->log(__METHOD__);\n $collection = $this->collectionName;\n $this->log(\"CREATE RECORD in '$collection': \" . print_r($data, true));\n $data = $this->sanitize($data);\n \t$id = $this->db->insert($collection, $data);\n \n //$id = $this->db->insert_id(); //mysql compatible\n return $id;\n }", "public function save()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// sequence\n\t\t$this->setId($ilDB->nextId(\"adn_ta_expertise\"));\n\t\t$id = $this->getId();\n\n\t\t$fields = $this->propertiesToFields();\n\t\t$fields[\"id\"] = array(\"integer\", $id);\n\t\t\t\n\t\t$ilDB->insert(\"adn_ta_expertise\", $fields);\n\n\t\tparent::save($id, \"adn_ta_expertise\");\n\t\t\n\t\treturn $id;\n\t}", "abstract public function insert_id();", "public function add(){\n $sql = 'INSERT INTO type_instituciones(name) VALUES(:name)';\n\n $data =\n [\n 'name' => $this->name\n ];\n\n try{\n return ($this->id = parent::query($sql, $data)) ? $this->id : false;\n }catch(Exception $e){\n throw $e;\n }\n }", "function repec_add_association($content_type, $series_name, $field_content_type, $field_series) {\n db_insert('repec_assoc')\n ->fields(array(\n 'content_type' => $content_type,\n 'series_name' => $series_name,\n 'field_content_type' => $field_content_type,\n 'field_series' => $field_series,\n 'enabled' => 0\n ))\n ->execute();\n}", "public function setCollectionId($value, $key, $type) { \n if ($type == 'single') { \n $this->collectionId = $value;\n return $this;\n } else if ($type == 'array') {\n $this->collectionId[$key] = $value;\n return $this;\n } else {\n echo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identify Type String Or Array:setcollectionId?\"));\n exit(); \n }\n }", "function saveCatalogType() {\n $data = array(\n 'catalogtype_title' => (string)$this->params['catalogtype_title'],\n 'catalogtype_name' => (string)$this->params['catalogtype_name'],\n 'catalogtype_loadlinks' => (int)$this->params['catalogtype_loadlinks'],\n 'catalogtype_loadteaser' => (int)$this->params['catalogtype_loadteaser']\n );\n return FALSE !== $this->databaseUpdateRecord(\n $this->tableCatalogTypes, $data, 'catalogtype_id', $this->params['type_id']\n );\n }", "function insert($typepersoon) {\n $this->db->insert('typePersoon', $typepersoon);\n return $this->db->insert_id();\n }", "public function insert_type()\n\t{\n\t\t$data = array(\n\t\t\t'typeTitle' => $this->input->post('typeTitle'),\n\t\t);\n\t\n\t\t// format as insert('table_name', values);\n\t\treturn $this->db->insert('Type', $data);\n\t}", "function addCancerType($inputs){\n $obj = new $this($inputs);\n $obj->save();\n return $obj->id;\n }", "private function insertCollectionModelRecord()\n {\n $this->collection->model()->create($this->model);\n }", "public function createLichaamstype($lichaamstype){\n $sql=\"insert into lichaamstypes VALUES(:lichaamstype) \";\n $dbh=new PDO(DBCONFIG::$DB_CONNSTRING,DBCONFIG::$DB_USERNAME,DBCONFIG::$DB_PASSWORD);\n $stmt=$dbh->prepare($sql);\n $stmt->execute(array(\n ':lichaamstype'=>$lichaamstype\n ));\n $lichaamstypeId=$dbh->lastInsertId();\n $dbh=null;\n }", "public function create(){\n\t\tif ($this->isExists())\n\t\t\treturn;\n\t\t\n\t\t$query = \"INSERT INTO `\".$this->_getTableName().\"` \".\n\t\t\t\t\t$this->_prepareSqlToInsert();\n\t\t\n\t\tif (!M::q($query)){\n\t\t\tprint_r(M::e());\n\t\t\texit();\n\t\t}\n\t\t\n\t\t$this->id = M::lastId();\n\n\t\treturn intval($this->getId());\n\t}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-05-12 04:13:57',\n 'updated_at' => '2018-05-12 04:13:57',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'candidatos',\n 'slug' => 'candidatos',\n 'display_name_singular' => 'Candidato',\n 'display_name_plural' => 'Candidatos',\n 'icon' => 'voyager-study',\n 'model_name' => 'App\\\\Candidato',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-12 04:54:10',\n 'updated_at' => '2018-05-17 04:03:33',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'edicoes',\n 'slug' => 'edicoes',\n 'display_name_singular' => 'Edição',\n 'display_name_plural' => 'Edições',\n 'icon' => 'voyager-settings',\n 'model_name' => 'App\\\\Edicao',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-12 04:55:49',\n 'updated_at' => '2018-05-12 04:55:49',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'campus',\n 'slug' => 'campus',\n 'display_name_singular' => 'Campus',\n 'display_name_plural' => 'Campi',\n 'icon' => 'voyager-company',\n 'model_name' => 'App\\\\Campus',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-05-17 00:24:21',\n 'updated_at' => '2018-05-17 00:24:21',\n ),\n ));\n \n \n }", "final public function save()\r\n\t{\r\n\t\t\r\n\t\tif (null === ($this->id)) {\r\n\t\t\t$id = $this->insert($this->_data);\r\n\t\t} else {\r\n\t\t\t$this->update($this->_data, array('id = ?' => $this->id));\r\n\t\t\t$id = $this->id;\r\n\t\t}\r\n\r\n\t\treturn $id;\r\n\t}", "function save_meta($class_id, $name, $value, $type = 'text'){\n\t\tif($type == 'array')\n\t\t\t$value = json_encode($value);\n\t\t$this->db->insert('class_meta', array('class_id' => $class_id, 'field' => $name, 'value' => $value));\n\t\t$insert_id = $this->db->insert_id();\n\t\tif($insert_id){\n\t\t\treturn $insert_id;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function addFieldCollection($type) {\n $field_collection_item = entity_create('field_collection_item', array('field_name' => $type));\n\n $this->field_collections[] = $field_collection_item;\n\n return entity_metadata_wrapper('field_collection_item', $field_collection_item);\n }", "public function save()\n {\n AuthorizationModel::mustAuthorized(PERMISSION_CONTAINER_TYPE_CREATE);\n\n if ($this->validate()) {\n $containerType = $this->input->post('container_type');\n $description = $this->input->post('description');\n\n $save = $this->containerType->create([\n 'container_type' => $containerType,\n 'description' => $description\n ]);\n\n if ($save) {\n flash('success', \"Container type {$containerType} successfully created\", 'master/container-type');\n } else {\n flash('danger', 'Create container type failed, try again or contact administrator');\n }\n }\n $this->create();\n }", "function insert_new_question( $survey_id, $title, $type ) {\n $current_date = date('Y-m-d');\n $conn = connectionObject();\n $query = $conn->prepare( 'INSERT INTO survey_questions (surveyid,englishtitle,arabictitle,frenchtitle,creationdate,type) VALUES(?,?,?,?,?,?)' );\n $query->execute( array( $survey_id, $title['en'], $title['ar'], $title['fr'], $current_date, $type ) );\n return $conn->lastInsertId();\n}", "function insert($type,$options)\t\r\n\t{\r\n\t\t//var_dump($options['idno']);\r\n\r\n\t\t//validate\r\n\t\tif ($this->validate_survey($options)){\t\t\t\t\t\t\r\n\t\t\t//create folder for survey\r\n\t\t\t$options['dirpath']=$this->setup_folder($repositoryid='central', $folder_name=md5($options['surveyid']));\r\n\t\t}\r\n\r\n\t\t//encode json fields\r\n\t\tforeach ($this->encoded_fields as $field){\r\n\t\t\tif(isset($options[$field])){\r\n\t\t\t\t$options[$field]=$this->encode_metadata($options[$field]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t$data=array();\r\n\t\t//default values, if no values are passed in $options\r\n\t\t$data['created']=date(\"U\");\r\n\t\t$data['changed']=date(\"U\");\r\n\r\n\t\tforeach($options as $key=>$value){\r\n\t\t\tif (in_array($key,$this->survey_fields) ){\r\n\t\t\t\t$data[$key]=$value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//create new study\r\n\t\t$result=$this->db->insert('surveys', $data); \r\n\r\n\t\tif ($result===false){\r\n\t\t\tthrow new Exception($this->db->error('message'));\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->db->insert_id();\r\n\t}", "public function insertNewDefaultAlbum($title = 'New Album', $owner_type, $description = 'Default description', $type = 'wall_photos') {\n return $album_id = DB::table('albums')->insertGetId(\n [\n 'title' => $title,\n 'description' => $description,\n 'owner_type' => $owner_type,\n 'owner_id' => $this->user_id,\n 'category_id' => 0,\n 'type' => $type,\n 'photo_id' => 0,\n ]\n );\n }", "public function insert()\n {\n $id = self::createMapper()->insert($this);\n $this->setId($id); // Has to be here cause of private property\n return $id;\n }", "protected function setCollection()\n {\n //TODO: Get the mapped table name.\n\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = \"\n Select \" . (string)$this->collectionClass . \"Id\n From \" . (string)$dbTable . \"\n Where \" . (string)$this->baseClass . \"Id = \" . (int)$this->baseClassId;\n $results = $this->db->query($sql);\n $data = $results->get(1);\n if($data->hasRows())\n {\n foreach($data->getAll() as $result)\n {\n $itemId = $result[$this->collectionClass . 'Id'];\n //$obj = new $this->collectionClass($itemId);\n $obj = ModelFactory::get($this->collectionClass, $itemId);\n $this->items[$itemId] = $obj;\n }\n $t=0;\n }\n }", "function addFileType($releaseType) {\r\n DB::query(\"INSERT INTO releaseTypes SET types=%s\", $releaseType);\r\n}", "function _insertType($typename, $pluginname, $uniquecode, $paramname, $typeorder)\r\n\t{\r\n\t\t$query = \"INSERT \".$this->getTableType().\" (typename, pluginname, uniquecode, paramname, typeorder) \"\r\n\t\t\t\t.\"VALUES ('\".sql_real_escape_string($typename).\"', \"\r\n\t\t\t\t\t.\"'\".sql_real_escape_string($pluginname).\"', \"\r\n\t\t\t\t\t.\"'\".sql_real_escape_string($uniquecode).\"', \"\r\n\t\t\t\t\t.\"'\".sql_real_escape_string($paramname).\"', \"\r\n\t\t\t\t\t.$typeorder.\")\";\r\n\t\t\t\t\t\r\n\t\t$res = sql_query($query);\r\n\t\t\r\n\t\tif(!$res)\r\n\t\t{\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\t\t\r\n\t\t$typeid = sql_insert_id();\r\n\t\t\r\n\t\treturn $typeid;\r\n\t}", "function add_phrase_type($phrasegroup_name, $phrasegroup_title)\n{\n\tglobal $DB_site;\n\n\t// first lets check if it exists\n\tif ($check = $DB_site->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"phrasetype WHERE fieldname = '$phrasegroup_name'\"))\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{ // check max id\n\t\t$max_rows = $DB_site->query_first(\"SELECT MAX(phrasetypeid) + 1 AS max FROM \" . TABLE_PREFIX . \"phrasetype WHERE phrasetypeid < 1000\");\n\t\t$phrasetypeid = $max_rows['max'];\n\t\tif ($phrasetypeid)\n\t\t{\n\t\t\t$DB_site->query(\"INSERT INTO \" . TABLE_PREFIX . \"phrasetype (phrasetypeid, fieldname, title, editrows) VALUES ($phrasetypeid, '\" . addslashes($phrasegroup_name) . \"', '\" . addslashes($phrasegroup_title) . \"', 3)\");\n\t\t\t$DB_site->query(\"ALTER TABLE \" . TABLE_PREFIX . \"language ADD phrasegroup_\" . addslashes($phrasegroup_name) . \" MEDIUMTEXT NOT NULL\");\n\t\t\treturn $phrasetypeid;\n\t\t}\n\t}\n\treturn false;\n}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-10-09 01:36:14',\n 'updated_at' => '2019-10-09 01:36:14',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'news',\n 'slug' => 'news',\n 'display_name_singular' => 'News',\n 'display_name_plural' => 'News',\n 'icon' => NULL,\n 'model_name' => 'App\\\\News',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 01:39:23',\n 'updated_at' => '2019-10-09 05:29:15',\n ),\n 4 => \n array (\n 'id' => 5,\n 'name' => 'messages',\n 'slug' => 'messages',\n 'display_name_singular' => 'Message',\n 'display_name_plural' => 'Messages',\n 'icon' => 'voyager-mail',\n 'model_name' => 'App\\\\Message',\n 'policy_name' => 'App\\\\Policies\\\\MessagePolicy',\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 01:44:20',\n 'updated_at' => '2019-10-09 04:38:54',\n ),\n 5 => \n array (\n 'id' => 6,\n 'name' => 'clients',\n 'slug' => 'clients',\n 'display_name_singular' => 'Client',\n 'display_name_plural' => 'Clients',\n 'icon' => 'voyager-bubble-hear',\n 'model_name' => 'App\\\\Client',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-10-09 02:01:42',\n 'updated_at' => '2019-10-09 02:01:42',\n ),\n 6 => \n array (\n 'id' => 7,\n 'name' => 'portofolios',\n 'slug' => 'portofolios',\n 'display_name_singular' => 'Portofolio',\n 'display_name_plural' => 'Portofolios',\n 'icon' => 'voyager-wand',\n 'model_name' => 'App\\\\Portofolio',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:03:39',\n 'updated_at' => '2019-10-09 05:21:29',\n ),\n 7 => \n array (\n 'id' => 8,\n 'name' => 'services',\n 'slug' => 'services',\n 'display_name_singular' => 'Service',\n 'display_name_plural' => 'Services',\n 'icon' => 'voyager-lightbulb',\n 'model_name' => 'App\\\\Service',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:09:57',\n 'updated_at' => '2019-10-09 05:09:59',\n ),\n 8 => \n array (\n 'id' => 9,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:32:59',\n 'updated_at' => '2019-10-09 02:34:34',\n ),\n 9 => \n array (\n 'id' => 10,\n 'name' => 'testimonials',\n 'slug' => 'testimonials',\n 'display_name_singular' => 'Testimonial',\n 'display_name_plural' => 'Testimonials',\n 'icon' => 'voyager-star',\n 'model_name' => 'App\\\\Testimonial',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-10-09 02:37:39',\n 'updated_at' => '2019-10-09 05:30:13',\n ),\n ));\n \n \n }", "function addOvertimeType($uid, $kind, $name, $code, $rate, $rateAd, $dateCreated, $dateModified){\n $query = ORM::forTable(\"overtime_type\")->create();\n $query->overtime_type_uid = $uid;\n $query->overtime_kind = $kind;\n $query->overtime_type_name = $name;\n $query->overtime_type_code = $code;\n $query->rate = $rate;\n $query->additional_rate = $rateAd;\n $query->date_created = $dateCreated;\n $query->date_modified = $dateModified;\n $query->save();\n}", "protected function Insert()\n\t{\n\t $gCms = cmsms();\n\t global $sql_queries, $debug_errors;\n\t\t$db = $gCms->GetDb();\n\t\t$config = $gCms->GetConfig();\n\n\t\t$result = false;\n\n\t\t#Figure out the item_order\n\t\tif ($this->mItemOrder < 1)\n\t\t{\n\t\t\t$query = \"SELECT max(item_order) as new_order FROM \".cms_db_prefix().\"content WHERE parent_id = ?\";\n\t\t\t$row = $db->Getrow($query, array($this->mParentId));\n\n\t\t\tif ($row)\n\t\t\t{\n\t\t\t\tif ($row['new_order'] < 1)\n\t\t\t\t{\n\t\t\t\t\t$this->mItemOrder = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->mItemOrder = $row['new_order'] + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$newid = $db->GenID(cms_db_prefix().\"content_seq\");\n\t\t$this->mId = $newid;\n\n\t\t$this->mModifiedDate = $this->mCreationDate = trim($db->DBTimeStamp(time()), \"'\");\n\n\t\t$query = \"INSERT INTO \".$config[\"db_prefix\"].\"content (content_id, content_name, content_alias, type, owner_id, parent_id, template_id, item_order, hierarchy, id_hierarchy, active, default_content, show_in_menu, cachable, secure, page_url, menu_text, markup, metadata, titleattribute, accesskey, tabindex, last_modified_by, create_date, modified_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n\t\t$dbresult = $db->Execute($query, array(\n\t\t\t$newid,\n\t\t\t$this->mName,\n\t\t\t$this->mAlias,\n\t\t\tstrtolower($this->mType),\n\t\t\t$this->mOwner,\n\t\t\t$this->mParentId,\n\t\t\t$this->mTemplateId,\n\t\t\t$this->mItemOrder,\n\t\t\t$this->mHierarchy,\n\t\t\t$this->mIdHierarchy,\n\t\t\t($this->mActive == true ? 1 : 0),\n\t\t\t($this->mDefaultContent == true ? 1 : 0),\n\t\t\t($this->mShowInMenu == true ? 1 : 0),\n\t\t\t($this->mCachable == true ? 1 : 0),\n\t\t\t$this->mSecure,\n\t\t\t$this->mURL,\n\t\t\t$this->mMenuText,\n\t\t\t$this->mMarkup,\n\t\t\t$this->mMetadata,\n\t\t\t$this->mTitleAttribute,\n\t\t\t$this->mAccessKey,\n\t\t\t$this->mTabIndex,\n\t\t\t$this->mLastModifiedBy,\n\t\t\t$this->mModifiedDate,\n\t\t\t$this->mCreationDate\n\t\t\t));\n\n\t\tif (! $dbresult)\n\t\t{\n\t\t die($db->sql.'<br/>'.$db->ErrorMsg());\n\t\t\tif ($config[\"debug\"] == true)\n\t\t\t{\n\t\t\t\t# :TODO: Translate the error message\n\t\t\t\t$debug_errors .= \"<p>Error inserting content</p>\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif (NULL != $this->mProperties)\n\t\t{\n\t\t\t# :TODO: There might be some error checking there\n\t\t\tdebug_buffer('save from ' . __LINE__);\n\t\t\t$this->mProperties->Save($newid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (true == $config[\"debug\"])\n\t\t\t{\n\t\t\t\t# :TODO: Translate the error message\n\t\t\t\t$debug_errors .= \"<p>Error inserting : the content has no properties</p>\\n\";\n\t\t\t}\n\t\t}\n\t\tif (isset($this->mAdditionalEditors))\n\t\t{\n\t\t\tforeach ($this->mAdditionalEditors as $oneeditor)\n\t\t\t{\n\t\t\t\t$new_addt_id = $db->GenID(cms_db_prefix().\"additional_users_seq\");\n\t\t\t\t$query = \"INSERT INTO \".cms_db_prefix().\"additional_users (additional_users_id, user_id, content_id) VALUES (?,?,?)\";\n\t\t\t\t$db->Execute($query, array($new_addt_id, $oneeditor, $this->Id()));\n\t\t\t}\n\t\t}\n\t}", "function oUltimo(){\n //se utiliza despues que se haga un un insert into\n return mysqli_insert_id($this->enlace);//mysqli_insert_id devuelve directamente el identificador de la última inserción\n }", "public function SaveTypeTest() {\n\t\t\ttry {\n\t\t\t\t$this->UpdateTypeTest();\n\n\t\t\t\t// Save the TypeTest object\n\t\t\t\t$id = $this->objTypeTest->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\treturn $id;\n\t\t}", "public function insert_id() : int|string;", "public function insert()\n\t{\t\t\n\t\ttry\n\t\t{\n\t\t\t// Connection a la base.\n\t\n\t\t\t$bdd = Base::getConnection();\n\t\t\t\n\t\t\t// On gere si la designation ou le photopath n'est pas assignee.\n\t\t\t\n\t\t\tif (!isset($this->title))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Le morceau n'a pas pu etre insere dans la base de donnees car le titre n'a pas ete specifie et il s'agit d'un champ obligatoire.\");\n\t\t\t}\n\t\t\t\n\t\t\t// On prépare la requete\n\t\t\t\n\t\t\t$requete = $bdd -> prepare(self::$rq_Insertion);\n\t\t\t$requete -> execute(array\n\t\t\t(\n\t\t\t\t'id' => $this->artist_id,\n\t\t\t\t'title' => $this->title,\n\t\t\t\t'url' => $this->mp3_url\n\t\t\t));\n\t\t\t\n\t\t\t// On récupere l'identifiant du Membre inséré.\n\t\t\t\n\t\t\t$this->track_id = $bdd->LastInsertID('tracks');\n\t\t\t$requete->closeCursor();\n\t\t\treturn $this->track_id;\t\t\n\t\t}\n\t\tcatch(BaseException $e)\n\t\t{\n\t\t\tprint $e -> getMessage();\n\t\t}\n\t}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-08-13 08:45:36',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-03-07 21:36:16',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-03-07 21:36:16',\n 'updated_at' => '2019-03-07 21:36:16',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'students_projects',\n 'slug' => 'students-projects',\n 'display_name_singular' => 'Students Project',\n 'display_name_plural' => 'Students Projects',\n 'icon' => 'voyager-paper-plane',\n 'model_name' => 'App\\\\StudentsProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'about_us',\n 'slug' => 'about-us',\n 'display_name_singular' => 'About U',\n 'display_name_plural' => 'About Us',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutUs',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'contact_us',\n 'slug' => 'contact-us',\n 'display_name_singular' => 'Contact U',\n 'display_name_plural' => 'Contact Us',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ContactUs',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-08-11 16:38:29',\n ),\n 6 => \n array (\n 'id' => 8,\n 'name' => 'scholarship',\n 'slug' => 'scholarship',\n 'display_name_singular' => 'Scholarship',\n 'display_name_plural' => 'Scholarships',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Scholarship',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 7 => \n array (\n 'id' => 9,\n 'name' => 'contactus_message',\n 'slug' => 'contactus-message',\n 'display_name_singular' => 'Contactus Message',\n 'display_name_plural' => 'Contactus Messages',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ContactusMessage',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-04-03 12:18:54',\n 'updated_at' => '2019-07-07 23:24:19',\n ),\n 8 => \n array (\n 'id' => 10,\n 'name' => 'about_us_link',\n 'slug' => 'about-us-link',\n 'display_name_singular' => 'About Us Link',\n 'display_name_plural' => 'About Us Links',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutUsLink',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-03 19:41:14',\n 'updated_at' => '2019-05-03 19:41:14',\n ),\n 9 => \n array (\n 'id' => 11,\n 'name' => 'partner_types',\n 'slug' => 'partner-types',\n 'display_name_singular' => 'Partner Type',\n 'display_name_plural' => 'Partner Types',\n 'icon' => 'voyager-documentation',\n 'model_name' => 'App\\\\PartnerType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-08 12:05:08',\n 'updated_at' => '2019-05-08 12:05:08',\n ),\n 10 => \n array (\n 'id' => 12,\n 'name' => 'partner2',\n 'slug' => 'partner2',\n 'display_name_singular' => 'Partner',\n 'display_name_plural' => 'Partners',\n 'icon' => 'voyager-group',\n 'model_name' => 'App\\\\Partner2',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":\"created_at\",\"order_display_column\":\"name\",\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-08 12:05:08',\n 'updated_at' => '2019-05-09 14:09:27',\n ),\n 11 => \n array (\n 'id' => 13,\n 'name' => 'slide_shows',\n 'slug' => 'slide-shows',\n 'display_name_singular' => 'Slide Show',\n 'display_name_plural' => 'Slide Shows',\n 'icon' => NULL,\n 'model_name' => 'App\\\\SlideShow',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-09 10:58:44',\n 'updated_at' => '2019-06-13 11:53:49',\n ),\n 12 => \n array (\n 'id' => 14,\n 'name' => 'events',\n 'slug' => 'events',\n 'display_name_singular' => 'Seminar',\n 'display_name_plural' => 'Seminars',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Event',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-09 14:13:33',\n 'updated_at' => '2019-05-09 15:27:34',\n ),\n 13 => \n array (\n 'id' => 16,\n 'name' => 'photo_albums',\n 'slug' => 'photo-albums',\n 'display_name_singular' => 'Photo Album',\n 'display_name_plural' => 'Photo Albums',\n 'icon' => 'voyager-photos',\n 'model_name' => 'App\\\\PhotoAlbum',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\Backend\\\\PhotoAlbumController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-10 12:01:46',\n 'updated_at' => '2019-05-16 08:30:15',\n ),\n 14 => \n array (\n 'id' => 17,\n 'name' => 'photos',\n 'slug' => 'photos',\n 'display_name_singular' => 'Photo',\n 'display_name_plural' => 'Photos',\n 'icon' => 'voyager-photo',\n 'model_name' => 'App\\\\Photo',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\Backend\\\\PhotoController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-10 12:01:46',\n 'updated_at' => '2019-05-19 14:37:09',\n ),\n 15 => \n array (\n 'id' => 18,\n 'name' => 'news',\n 'slug' => 'news',\n 'display_name_singular' => 'News',\n 'display_name_plural' => 'News',\n 'icon' => NULL,\n 'model_name' => 'App\\\\News',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-17 13:44:56',\n 'updated_at' => '2019-08-28 08:23:31',\n ),\n 16 => \n array (\n 'id' => 19,\n 'name' => 'about_gic',\n 'slug' => 'about-gic',\n 'display_name_singular' => 'About Gic',\n 'display_name_plural' => 'About Gics',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AboutGic',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-17 13:44:56',\n 'updated_at' => '2019-05-17 13:44:56',\n ),\n 17 => \n array (\n 'id' => 20,\n 'name' => 'student_message',\n 'slug' => 'student-message',\n 'display_name_singular' => 'Alumni/student\\'s Message',\n 'display_name_plural' => 'Student Messages',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentMessage',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-18 20:33:06',\n 'updated_at' => '2019-05-20 21:26:48',\n ),\n 18 => \n array (\n 'id' => 23,\n 'name' => 'scholarships',\n 'slug' => 'scholarships',\n 'display_name_singular' => 'Scholarships',\n 'display_name_plural' => 'Scholarships',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Scholarships',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-21 14:31:04',\n 'updated_at' => '2019-05-21 15:38:17',\n ),\n 19 => \n array (\n 'id' => 24,\n 'name' => 'important_link',\n 'slug' => 'important-link',\n 'display_name_singular' => 'Important Link',\n 'display_name_plural' => 'Important Links',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ImportantLink',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-24 16:18:32',\n 'updated_at' => '2019-05-24 16:18:32',\n ),\n 20 => \n array (\n 'id' => 25,\n 'name' => 'staffs',\n 'slug' => 'staffs',\n 'display_name_singular' => 'Staff',\n 'display_name_plural' => 'Staff',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Staff',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:19:49',\n 'updated_at' => '2019-07-24 06:19:09',\n ),\n 21 => \n array (\n 'id' => 26,\n 'name' => 'missions',\n 'slug' => 'missions',\n 'display_name_singular' => 'Mission',\n 'display_name_plural' => 'Missions',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Mission',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:20:08',\n 'updated_at' => '2019-06-07 16:07:07',\n ),\n 22 => \n array (\n 'id' => 27,\n 'name' => 'country',\n 'slug' => 'country',\n 'display_name_singular' => 'Country',\n 'display_name_plural' => 'Countries',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Country',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-29 22:20:17',\n 'updated_at' => '2019-05-31 16:21:34',\n ),\n 23 => \n array (\n 'id' => 28,\n 'name' => 'funders',\n 'slug' => 'funders',\n 'display_name_singular' => 'Funder',\n 'display_name_plural' => 'Funders',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Funder',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-29 22:20:27',\n 'updated_at' => '2019-05-29 22:20:27',\n ),\n 24 => \n array (\n 'id' => 30,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-05-31 13:49:35',\n 'updated_at' => '2019-05-31 13:49:35',\n ),\n 25 => \n array (\n 'id' => 32,\n 'name' => 'degrees',\n 'slug' => 'degrees',\n 'display_name_singular' => 'Degree',\n 'display_name_plural' => 'Degrees',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Degree',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 26 => \n array (\n 'id' => 33,\n 'name' => 'program_years',\n 'slug' => 'program-years',\n 'display_name_singular' => 'Program Year',\n 'display_name_plural' => 'Program Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ProgramYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 27 => \n array (\n 'id' => 34,\n 'name' => 'field_studies',\n 'slug' => 'field-studies',\n 'display_name_singular' => 'Field of Study/GIC\\'s Program',\n 'display_name_plural' => 'Field of Study/GIC\\'s Program',\n 'icon' => NULL,\n 'model_name' => 'App\\\\FieldStudy',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-13 21:10:20',\n ),\n 28 => \n array (\n 'id' => 35,\n 'name' => 'curriculums',\n 'slug' => 'curriculums',\n 'display_name_singular' => 'Curriculum',\n 'display_name_plural' => 'Curriculums',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Curriculum',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-01 21:33:04',\n 'updated_at' => '2019-06-01 21:33:04',\n ),\n 29 => \n array (\n 'id' => 36,\n 'name' => 'academic_years',\n 'slug' => 'academic-years',\n 'display_name_singular' => 'Academic Year',\n 'display_name_plural' => 'Academic Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\AcademicYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-07 16:41:49',\n 'updated_at' => '2019-06-22 22:56:55',\n ),\n 30 => \n array (\n 'id' => 37,\n 'name' => 'gic_projects',\n 'slug' => 'gic-projects',\n 'display_name_singular' => 'Gic Project',\n 'display_name_plural' => 'Gic Projects',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 15:04:33',\n 'updated_at' => '2019-08-14 07:53:21',\n ),\n 31 => \n array (\n 'id' => 38,\n 'name' => 'faq_types',\n 'slug' => 'faq-types',\n 'display_name_singular' => 'Faq Sub Type',\n 'display_name_plural' => 'Faq Sub Types',\n 'icon' => 'voyager-paperclip',\n 'model_name' => 'App\\\\FaqType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 20:15:34',\n 'updated_at' => '2019-08-29 06:47:38',\n ),\n 32 => \n array (\n 'id' => 39,\n 'name' => 'faqs2',\n 'slug' => 'faqs2',\n 'display_name_singular' => 'Faqs',\n 'display_name_plural' => 'Faqs',\n 'icon' => 'voyager-paper-plane',\n 'model_name' => 'App\\\\Faqs2',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 20:16:21',\n 'updated_at' => '2019-08-29 06:47:22',\n ),\n 33 => \n array (\n 'id' => 40,\n 'name' => 'staff_position',\n 'slug' => 'staff-position',\n 'display_name_singular' => 'Staff Position',\n 'display_name_plural' => 'Staff Positions',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StaffPosition',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-09 21:40:07',\n 'updated_at' => '2019-08-05 06:57:41',\n ),\n 34 => \n array (\n 'id' => 41,\n 'name' => 'posters',\n 'slug' => 'posters',\n 'display_name_singular' => 'Poster',\n 'display_name_plural' => 'Posters',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Poster',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-10 15:18:59',\n 'updated_at' => '2019-06-10 15:18:59',\n ),\n 35 => \n array (\n 'id' => 42,\n 'name' => 'awardee',\n 'slug' => 'awardee',\n 'display_name_singular' => 'Awardee',\n 'display_name_plural' => 'Awardees',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Awardee',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-13 01:58:54',\n 'updated_at' => '2019-06-22 23:30:07',\n ),\n 36 => \n array (\n 'id' => 43,\n 'name' => 'site_contents',\n 'slug' => 'site-contents',\n 'display_name_singular' => 'Content\\'s Section',\n 'display_name_plural' => 'Content\\'s Sections',\n 'icon' => NULL,\n 'model_name' => 'App\\\\SiteContent',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-13 11:25:43',\n 'updated_at' => '2019-06-22 14:45:31',\n ),\n 37 => \n array (\n 'id' => 45,\n 'name' => 'invited_professors',\n 'slug' => 'invited-professors',\n 'display_name_singular' => 'Invited Professor',\n 'display_name_plural' => 'Invited Professors',\n 'icon' => NULL,\n 'model_name' => 'App\\\\InvitedProfessor',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-16 19:19:23',\n 'updated_at' => '2019-06-22 21:31:23',\n ),\n 38 => \n array (\n 'id' => 46,\n 'name' => 'aluminus',\n 'slug' => 'aluminus',\n 'display_name_singular' => 'Aluminus',\n 'display_name_plural' => 'Aluminuses',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Aluminus',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-06-16 19:37:03',\n 'updated_at' => '2019-08-28 14:57:20',\n ),\n 39 => \n array (\n 'id' => 47,\n 'name' => 'gratuated_year',\n 'slug' => 'gratuated-year',\n 'display_name_singular' => 'Gratuated Year',\n 'display_name_plural' => 'Gratuated Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GratuatedYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-06-16 19:37:21',\n 'updated_at' => '2019-06-16 19:37:21',\n ),\n 40 => \n array (\n 'id' => 48,\n 'name' => 'videos',\n 'slug' => 'videos',\n 'display_name_singular' => 'Video',\n 'display_name_plural' => 'Videos',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Video',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 0,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2019-06-19 15:52:08',\n 'updated_at' => '2019-06-19 15:52:08',\n ),\n 41 => \n array (\n 'id' => 49,\n 'name' => 'calendar',\n 'slug' => 'calendar',\n 'display_name_singular' => 'Calendar',\n 'display_name_plural' => 'Calendars',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Calendar',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-11 15:44:06',\n 'updated_at' => '2019-08-11 15:44:55',\n ),\n 42 => \n array (\n 'id' => 50,\n 'name' => 'timetable',\n 'slug' => 'timetable',\n 'display_name_singular' => 'Timetable',\n 'display_name_plural' => 'Timetables',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Timetable',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-11 15:48:57',\n 'updated_at' => '2019-08-11 15:48:57',\n ),\n 43 => \n array (\n 'id' => 51,\n 'name' => 'report_slide',\n 'slug' => 'report-slide',\n 'display_name_singular' => 'Report Slide',\n 'display_name_plural' => 'Report Slides',\n 'icon' => NULL,\n 'model_name' => 'App\\\\ReportSlide',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-11 15:50:02',\n 'updated_at' => '2019-08-11 15:50:02',\n ),\n 44 => \n array (\n 'id' => 52,\n 'name' => 'gic_service',\n 'slug' => 'gic-service',\n 'display_name_singular' => 'Gic Service',\n 'display_name_plural' => 'Gic Services',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicService',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-12 13:26:58',\n 'updated_at' => '2019-08-12 13:32:01',\n ),\n 45 => \n array (\n 'id' => 53,\n 'name' => 'gic_service_counter',\n 'slug' => 'gic-service-counter',\n 'display_name_singular' => 'Gic Service Counter',\n 'display_name_plural' => 'Gic Service Counters',\n 'icon' => NULL,\n 'model_name' => 'App\\\\GicServiceCounter',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-12 13:33:47',\n 'updated_at' => '2019-08-12 13:33:47',\n ),\n 46 => \n array (\n 'id' => 54,\n 'name' => 'promotion_years',\n 'slug' => 'promotion-years',\n 'display_name_singular' => 'Promotion Year',\n 'display_name_plural' => 'Promotion Years',\n 'icon' => NULL,\n 'model_name' => 'App\\\\PromotionYear',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-28 14:53:59',\n 'updated_at' => '2019-08-28 14:53:59',\n ),\n 47 => \n array (\n 'id' => 55,\n 'name' => 'student_project_type',\n 'slug' => 'student-project-type',\n 'display_name_singular' => 'Student Project Type',\n 'display_name_plural' => 'Student Project Types',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentProjectType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2019-08-29 02:04:58',\n 'updated_at' => '2019-08-29 02:04:58',\n ),\n 48 => \n array (\n 'id' => 56,\n 'name' => 'student_project',\n 'slug' => 'student-project',\n 'display_name_singular' => 'Student Project',\n 'display_name_plural' => 'Student Projects',\n 'icon' => NULL,\n 'model_name' => 'App\\\\StudentProject',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-29 02:06:01',\n 'updated_at' => '2019-08-29 02:07:34',\n ),\n 49 => \n array (\n 'id' => 57,\n 'name' => 'faq_parent_types',\n 'slug' => 'faq-parent-types',\n 'display_name_singular' => 'Faq Type',\n 'display_name_plural' => 'Faq Types',\n 'icon' => NULL,\n 'model_name' => 'App\\\\FaqParentType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-08-29 05:47:03',\n 'updated_at' => '2019-08-29 06:47:32',\n ),\n ));\n \n \n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2019-05-01 23:54:05',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2018-11-26 03:07:00',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2018-11-26 03:07:00',\n 'updated_at' => '2018-11-26 03:07:00',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Product',\n 'display_name_plural' => 'Products',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\ProductController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-15 18:36:06',\n 'updated_at' => '2019-05-28 01:00:51',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'categorias',\n 'slug' => 'categorias',\n 'display_name_singular' => 'Categoria',\n 'display_name_plural' => 'Categorias',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Categoria',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null}',\n 'created_at' => '2018-12-24 11:53:48',\n 'updated_at' => '2018-12-24 11:55:35',\n ),\n 5 => \n array (\n 'id' => 7,\n 'name' => 'cupoms',\n 'slug' => 'cupoms',\n 'display_name_singular' => 'Cupom',\n 'display_name_plural' => 'Cupoms',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Cupom',\n 'policy_name' => NULL,\n 'controller' => 'App\\\\Http\\\\Controllers\\\\CupomController',\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-27 15:07:11',\n 'updated_at' => '2019-05-01 23:58:20',\n ),\n 6 => \n array (\n 'id' => 8,\n 'name' => 'clientes',\n 'slug' => 'clientes',\n 'display_name_singular' => 'Cliente',\n 'display_name_plural' => 'Clientes',\n 'icon' => 'voyager-person',\n 'model_name' => 'App\\\\Cliente',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-28 15:47:11',\n 'updated_at' => '2019-05-02 01:18:26',\n ),\n 7 => \n array (\n 'id' => 9,\n 'name' => 'pedidos',\n 'slug' => 'pedidos',\n 'display_name_singular' => 'Pedido',\n 'display_name_plural' => 'Pedidos',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Pedido',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2018-12-28 15:47:36',\n 'updated_at' => '2019-06-04 23:05:42',\n ),\n 8 => \n array (\n 'id' => 10,\n 'name' => 'flavors',\n 'slug' => 'flavors',\n 'display_name_singular' => 'Sabor',\n 'display_name_plural' => 'Sabores',\n 'icon' => 'voyager-pizza',\n 'model_name' => 'App\\\\Flavor',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2019-05-28 00:47:12',\n 'updated_at' => '2019-05-28 00:52:43',\n ),\n ));\n \n \n }", "public function run()\n {\n $type = new Type;\n \t$type->name = \"Photo gallery\"; // 1\n \t$type->save();\n\n \t$type = new Type;\n \t$type->name = \"iframe\"; // 2\n \t$type->save();\n\n $type = new Type;\n $type->name = \"Text\"; // 3\n $type->save();\n\n $type = new Type;\n $type->name = \"Notification\"; // 4\n $type->save();\n\n $type = new Type;\n $type->name = \"Web page\"; // 5\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 6\"; // 6\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 7\"; // 7\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 8\"; // 8\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 9\"; // 9\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 10\"; // 10\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 11\"; // 11\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 12\"; // 12\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 13\"; // 13\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 14\"; // 14\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 15\"; // 15\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 16\"; // 16\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 17\"; // 17\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 18\"; // 18\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 19\"; // 19\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 20\"; // 20\n $type->save();\n \t\n $type = new Type;\n $type->name = \"Catalog\"; // 21\n $type->save();\n\n $type = new Type;\n $type->name = \"Page\"; // 22\n $type->save();\n\n $type = new Type;\n $type->name = \"App\"; // 23\n $type->save(); \n\n $type = new Type;\n $type->name = \"User\"; // 24\n $type->save();\n\n $type = new Type;\n $type->name = \"Company\"; // 25\n $type->save();\n\n $type = new Type;\n $type->name = \"Offer\"; // 26\n $type->save();\n\n $type = new Type;\n $type->name = \"Custom\"; // 27\n $type->save();\n }", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2020-08-06 12:33:42',\n 'updated_at' => '2020-08-06 12:33:42',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'products',\n 'slug' => 'products',\n 'display_name_singular' => 'Proizvod',\n 'display_name_plural' => 'Proizvodi',\n 'icon' => 'voyager-bag',\n 'model_name' => 'App\\\\Product',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-06 12:39:26',\n 'updated_at' => '2020-09-07 20:07:29',\n ),\n 4 => \n array (\n 'id' => 7,\n 'name' => 'orders',\n 'slug' => 'orders',\n 'display_name_singular' => 'Narudžbina',\n 'display_name_plural' => 'Narudžbine',\n 'icon' => 'voyager-file-text',\n 'model_name' => 'App\\\\Order',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:18:52',\n 'updated_at' => '2020-08-19 10:29:19',\n ),\n 5 => \n array (\n 'id' => 9,\n 'name' => 'order_product',\n 'slug' => 'order-product',\n 'display_name_singular' => 'Naručeni proizvodi',\n 'display_name_plural' => 'Naručeni proizvodi',\n 'icon' => 'voyager-window-list',\n 'model_name' => 'App\\\\OrderProduct',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2020-08-19 10:34:04',\n 'updated_at' => '2020-08-19 10:34:04',\n ),\n 6 => \n array (\n 'id' => 10,\n 'name' => 'sizes',\n 'slug' => 'sizes',\n 'display_name_singular' => 'Veličina',\n 'display_name_plural' => 'Veličine',\n 'icon' => 'voyager-tag',\n 'model_name' => 'App\\\\Size',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:49:18',\n 'updated_at' => '2020-08-28 12:12:31',\n ),\n 7 => \n array (\n 'id' => 11,\n 'name' => 'colors',\n 'slug' => 'colors',\n 'display_name_singular' => 'Boja',\n 'display_name_plural' => 'Boje',\n 'icon' => 'voyager-paint-bucket',\n 'model_name' => 'App\\\\Color',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2020-08-19 10:50:22',\n 'updated_at' => '2020-08-19 10:50:22',\n ),\n 8 => \n array (\n 'id' => 12,\n 'name' => 'categories',\n 'slug' => 'categories',\n 'display_name_singular' => 'Kategorija',\n 'display_name_plural' => 'Kategorije',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Category',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 1,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-19 10:53:57',\n 'updated_at' => '2020-08-25 09:43:08',\n ),\n 9 => \n array (\n 'id' => 13,\n 'name' => 'manufacturers',\n 'slug' => 'manufacturers',\n 'display_name_singular' => 'Manufacturer',\n 'display_name_plural' => 'Manufacturers',\n 'icon' => 'voyager-shop',\n 'model_name' => 'App\\\\Manufacturer',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2020-08-25 20:39:59',\n 'updated_at' => '2020-08-25 20:41:01',\n ),\n ));\n \n \n }", "public function store1(ECategoria $categoria){\n $sql = \"INSERT INTO \".static::getTables().\" VALUES \".static::getValues().\";\";\n $id = parent::store($sql,'FCategoria',$categoria);\n if($id) \n return $id;\n else \n return null;\n }", "protected function create()\n {\n $hData = $this->hData;\n unset($hData[$this->sIdColumn]);\n $iID = $this->getDatabase()->insert($this->sTable, $hData);\n \n if (empty($iID))\n {\n return false;\n }\n \n $this->hData[$this->sIdColumn] = $iID;\n return $iID;\n }", "public function getPrimaryKey()\n {\n return $this->getIdtype();\n }", "function saveNew()\n\t{\n\t\tglobal $sql;\n\t\t$name = sql::Escape($this->name);\n\t\t$link = sql::Escape($this->link);\n\t\t$image = sql::Escape($this->image);\n\t\t$sql->Query(\"INSERT INTO $this->tablename SET\n\t\t\t\t\tname = '$name',\n\t\t\t\t\ttype = '$this->type',\n\t\t\t\t\tlink = '$link',\n\t\t\t\t\timage = '$image',\n\t\t\t\t\tparent = '$this->parent'\n\t\t\t\t\t\");\n\t\t$this->id=$sql->GetLastId();\n\t}", "function create()\n { \n\t\t$datetime = date('Y-m-d H:i:s');\n\t\t\n $this->db->set('title', $this->title);\n if ($this->description!=''&&$this->description!=null) {\n \t$this->db->set('description', $this->description);\n }\n\t\t\n if ($this->pic_url!=''&&$this->pic_url!=null) {\n \t$this->db->set('pic_url',$this->pic_url);\n }\n\t\t$this->db->set('author_id', $this->author_id);\n\t\t$this->db->set('create_date', $datetime);\n $this->db->set('update_date', $datetime);\n \n return $this->db->insert('collection');\n\t}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:30',\n 'updated_at' => '2021-06-02 17:55:30',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:30',\n 'updated_at' => '2021-06-02 17:55:30',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2021-06-02 17:55:31',\n 'updated_at' => '2021-06-02 17:55:31',\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'permissions',\n 'slug' => 'permissions',\n 'display_name_singular' => 'Permiso',\n 'display_name_plural' => 'Permisos',\n 'icon' => 'voyager-list',\n 'model_name' => 'App\\\\Models\\\\Permission',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":\"table_name\",\"order_display_column\":\"table_name\",\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2021-10-05 10:10:30',\n 'updated_at' => '2021-10-05 10:10:30',\n ),\n 4 => \n array (\n 'id' => 5,\n 'name' => 'publications_types',\n 'slug' => 'publications-types',\n 'display_name_singular' => 'Tipo de publicación',\n 'display_name_plural' => 'Tipos de publicación',\n 'icon' => 'voyager-list',\n 'model_name' => 'App\\\\Models\\\\PublicationsType',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-06 12:29:38',\n 'updated_at' => '2021-10-06 14:36:48',\n ),\n 5 => \n array (\n 'id' => 6,\n 'name' => 'publications',\n 'slug' => 'publications',\n 'display_name_singular' => 'Publicación',\n 'display_name_plural' => 'Publicaciones',\n 'icon' => 'voyager-certificate',\n 'model_name' => 'App\\\\Models\\\\Publication',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-06 12:40:05',\n 'updated_at' => '2021-10-11 21:01:49',\n ),\n 6 => \n array (\n 'id' => 7,\n 'name' => 'officials',\n 'slug' => 'officials',\n 'display_name_singular' => 'Funcionario',\n 'display_name_plural' => 'Funcionarios',\n 'icon' => 'voyager-people',\n 'model_name' => 'App\\\\Models\\\\Official',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}',\n 'created_at' => '2021-10-11 11:31:09',\n 'updated_at' => '2021-10-11 11:31:09',\n ),\n 7 => \n array (\n 'id' => 8,\n 'name' => 'frequent_questions',\n 'slug' => 'frequent-questions',\n 'display_name_singular' => 'Pregunta frecuente',\n 'display_name_plural' => 'Preguntas frecuentes',\n 'icon' => 'voyager-question',\n 'model_name' => 'App\\\\Models\\\\FrequentQuestion',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2021-10-11 11:38:31',\n 'updated_at' => '2021-10-11 11:46:13',\n ),\n ));\n \n \n }", "function store() {\n\t\tglobal $mysql;\n\t\t// set timestamps\n\t\t$datenow = Date::now();\n\n\t\tif ($this->id == '') {\n\t\t\t$this->data['__createdon'] = $datenow;\n\t\t} else {\n\t\t\t$this->data['__changedon'] = $datenow;\n\t\t}\n\n\t\t// Seperate keys from values\n\t\t$keys = array_keys($this->data);\n\t\t$values = array_values($this->data);\n\t\tfor ($i = 0; $i < count($values); $i++) {\n\t\t\tif ($values[$i] === null) {\n\t\t\t\t$nextval = 'null';\n\t\t\t} else {\n\t\t\t\t$nextval = $this->escape($values[$i]);\n\t\t\t\t$nextval = \"'$nextval'\";\n\t\t\t}\n\t\t\t$values[$i] = $nextval;\n\t\t}\n\t\t// CREATE SQL Statement\n\t\t$tablename = $this->class_name();\n\t\tif ($this->id == '') {\n\t\t\t$query = \"INSERT INTO $tablename (\" . implode(\",\", $keys) . \") VALUES (\" . implode(\",\", $values) . \");\";\n\t\t\t$this->id = $mysql->insert($query, $this->sequence_name());\n\t\t} else {\n\t\t\t$query = \"UPDATE $tablename SET\";\n\t\t\t$query .= \" \" . $keys[0] . \"=\" . $values[0];\n\t\t\tfor ($i = 1; $i < count($values); $i++)\n\t\t\t\t$query .= \", \" . $keys[$i] . \"=\" . $values[$i];\n\t\t\t$query .= \" WHERE id=\" . $this->id . \";\";\n\t\t\t$mysql->update($query);\n\t\t}\n\t\treturn $this->id;\n\t}", "function neurok_add_instance(stdClass $neurok, mod_neurok_mod_form $mform = null) {\n global $DB;\n\n $neurok->timecreated = time();\n\n // You may have to add extra stuff in here.\n\n $neurok->id = $DB->insert_record('neurok', $neurok);\n\n // neurok_grade_item_update($neurok);\n\n return $neurok->id;\n}", "function getInsertId() {\n\t\treturn parent::getInsertId('object_for_review_assignments', 'assignment_id');\n\t}", "public function run()\n {\n \n\n \\DB::table('data_types')->delete();\n \n \\DB::table('data_types')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'users',\n 'slug' => 'users',\n 'display_name_singular' => 'User',\n 'display_name_plural' => 'Users',\n 'icon' => 'voyager-person',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\User',\n 'policy_name' => 'TCG\\\\Voyager\\\\Policies\\\\UserPolicy',\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerUserController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'menus',\n 'slug' => 'menus',\n 'display_name_singular' => 'Menu',\n 'display_name_plural' => 'Menus',\n 'icon' => 'voyager-list',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Menu',\n 'policy_name' => NULL,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'roles',\n 'slug' => 'roles',\n 'display_name_singular' => 'Role',\n 'display_name_plural' => 'Roles',\n 'icon' => 'voyager-lock',\n 'model_name' => 'TCG\\\\Voyager\\\\Models\\\\Role',\n 'policy_name' => NULL,\n 'controller' => 'TCG\\\\Voyager\\\\Http\\\\Controllers\\\\VoyagerRoleController',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => NULL,\n 'created_at' => '2022-11-29 13:04:51',\n 'updated_at' => '2022-11-29 13:04:51',\n ),\n 3 => \n array (\n 'id' => 5,\n 'name' => 'sections',\n 'slug' => 'sections',\n 'display_name_singular' => 'Section',\n 'display_name_plural' => 'Sections',\n 'icon' => 'voyager-categories',\n 'model_name' => 'App\\\\Models\\\\Section',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2022-11-29 13:07:23',\n 'updated_at' => '2022-11-29 14:35:11',\n ),\n 4 => \n array (\n 'id' => 6,\n 'name' => 'contents',\n 'slug' => 'contents',\n 'display_name_singular' => 'Content',\n 'display_name_plural' => 'Contents',\n 'icon' => NULL,\n 'model_name' => 'App\\\\Models\\\\Content',\n 'policy_name' => NULL,\n 'controller' => NULL,\n 'description' => NULL,\n 'generate_permissions' => 1,\n 'server_side' => 0,\n 'details' => '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}',\n 'created_at' => '2022-11-29 13:07:40',\n 'updated_at' => '2022-11-29 13:43:19',\n ),\n ));\n \n \n }", "public static function _insert()\n\t{\n\t}", "function save() {\n\n\t\t\t$statement = $GLOBALS['DB']->query(\"INSERT INTO stylists (name) VALUES ('{$this->getName()}') RETURNING id;\");\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setId($result['id']);\n\n\t\t}", "function newCategory($newCat) {\r\n global $modx;\r\n $useTable = $modx->getFullTableName('categories');\r\n $sql = 'insert into ' . $useTable . ' (category) values (\\''.$modx->db->escape($newCat).'\\')';\r\n $catrs = $modx->dbQuery($sql);\r\n if(!$catrs) {\r\n $categoryId = 0;\r\n } else {\r\n if(!$newCatid=mysql_insert_id()) {\r\n $categoryId = 0;\r\n\t\t} else {\r\n $categoryId = $newCatid;\r\n }\r\n }\r\n return $categoryId;\r\n}", "public function _dbInsert()\n\t{\n\t\t$user_data = array_keys($this->data);\n\t\t$table_set = implode(',',$user_data);\n\t\t$table_values = implode(',:',$user_data); $table_values = ':'.$table_values;\n\t\t$table_name = Config::$map_tables[$this->model_type];\n\t\t\n\t\t$stmt = $this->db->prepare(\"INSERT INTO $table_name ($table_set) VALUES ($table_values)\");\n\t\tforeach ($user_data as $v) $stmt->bindParam(':'.$v,$this->data[$v]);\n\t\t$stmt->execute();\n\t\t$id = $this->db->lastInsertId();\n\t\treturn (is_numeric($id))?$id:false;\n\t}", "abstract public function Insert_ID();", "public abstract function insert(): int;", "function addPreset($mysqli, $name,$parent) {\n\t$res = $mysqli->query(\"INSERT INTO `o_presets` (`parentFK`, `name`) VALUES ($parent, '$name')\");\n\tif (!$res) {\n\t\tpara(\"Query failed: \" . $mysqli->error);\n\t\treturn false;\n\t}\n\telse {\n\t\treturn $mysqli->insert_id;\n\t}\n}", "public function actionRbacAuthItemCreate($type){\n\n\t\t$editor = new CrugeAuthItemEditor('insert');\n\t\t$editor->name = \"\";\n\t\t$editor->description = \"\";\n\t\t$editor->businessRule = \"\";\n\t\t$editor->categoria = Yii::app()->user->rbac->getAuthItemTypeName($type);\n\t\t$editor->isNewRecord = true;\n\n\n\t\tif(isset($_POST['CrugeAuthItemEditor']))\n\t\t{\n\t\t\tif(isset($_POST['volver'])){\n\t\t\t\tif($type == CAuthItem::TYPE_ROLE)\n\t\t\t\t\t$this->redirect(array('rbaclistroles'));\n\t\t\t\tif($type == CAuthItem::TYPE_TASK)\n\t\t\t\t\t$this->redirect(array('rbaclisttasks'));\n\t\t\t\tif($type == CAuthItem::TYPE_OPERATION)\n\t\t\t\t\t$this->redirect(array('rbaclistops'));\n\t\t\t}\n\n\t\t\t$editor->attributes=$_POST['CrugeAuthItemEditor'];\n\t\t\tif($editor->validate()){\n\n\n\t\t\t\t$newAi = Yii::app()->user->rbac->createAuthItem(\n\t\t\t\t\t\t$editor->name,\n\t\t\t\t\t\t$type,\n\t\t\t\t\t\t$editor->description,\n\t\t\t\t\t\t$editor->businessRule\n\t\t\t\t\t);\n\n\n\t\t\t\t// se va de vuelta a la lista de donde vino\n\t\t\t\tif($type == CAuthItem::TYPE_ROLE)\n\t\t\t\t\t$this->redirect(array('rbaclistroles'));\n\t\t\t\tif($type == CAuthItem::TYPE_TASK)\n\t\t\t\t\t$this->redirect(array('rbaclisttasks'));\n\t\t\t\tif($type == CAuthItem::TYPE_OPERATION)\n\t\t\t\t\t$this->redirect(array('rbaclistops'));\n\t\t\t}\n\t\t}\n\t\t$this->render('rbacauthitemcreate',array('model'=>$editor));\n\t}", "protected function insert()\n {\n global $databaseHandler;\n\n // Crée une requête préparée permettant d'insérer un nouvel enregistrement\n // dans la table 'game'\n $statement = $databaseHandler->prepare('\n INSERT INTO `game` (\n `title`,\n `release_date`,\n `link`,\n `developer_id`,\n `platform_id`\n )\n VALUES (\n :title,\n :release_date,\n :link,\n :developer_id,\n :platform_id\n )\n ');\n // Exécute la requête préparée en remplaçant chaque champ précédé de ':' par la propriété\n // correspondnate de l'objet\n $statement->execute([\n ':title' => $this->title,\n ':release_date' => $this->releaseDate->format('Y-m-d'),\n ':link' => $this->link,\n ':developer_id' => $this->developerId,\n ':platform_id' => $this->platformId, \n ]);\n\n $this->id = $databaseHandler->lastInsertId();\n }", "public abstract function insert();", "function getInsertedID();", "public function add() {\n\n\t\t$query = \"INSERT INTO \" . TB_REMINDER . \"(name, date, facility_id)\n\t\t\t\tVALUES (\n\t\t\t\t'{$this->db->sqltext($this->name)}'\n\t\t\t\t, {$this->db->sqltext($this->date)}\n\t\t\t\t, {$this->db->sqltext($this->facility_id)}\n\t\t\t\t)\";\n\t\t$this->db->query($query);\n\t\t$id = $this->db->getLastInsertedID();\n\t\t$this->id = $id;\n\t\treturn $id;\n\t}", "private function insert()\n {\n $this->beforeInsert(); \n $sequenceId = $this->getSequenceNextValue();\n $autoincrementId = $this->dbConnection->insert(\n $this->table,\n array_intersect_key($this->activeRecord, array_flip($this->fields()))\n );\n $id = !empty($autoincrementId) ? $autoincrementId : $sequenceId;\n $this->loadRecordAfterInsert($id);\n $this->afterInsert($id);\n return $id;\n }", "function addEmpType($parentId, $employee_type, $emp_type_code, $remarks)\n\t{\n\t\t//get the var\n\t\t$emp_type_code \t\t= mysql_real_escape_string($emp_type_code);\n\t\t$remarks\t\t\t= mysql_real_escape_string($remarks);\n\t\t\n\t\t//statement\n\t\t$insert = \"INSERT INTO emp_type \n\t\t\t\t\t(parent_id, employee_type, emp_type_code, remarks, added_on)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('$parentId', '$employee_type', '$emp_type_code', '$remarks', now())\";\n\t\t\t\n\t\t//execute query\t\t\n\t\t$query = mysql_query($insert);\n\t\t//echo $insert.mysql_error(); exit;\n\t\t//get teh primary key\n\t\t$id = mysql_insert_id();\n\t\t\n\t\t//return the key value\n\t\treturn $id;\n\t\t\n\t}", "private function insert_question_type($type, $questionid)\n\t{\n\t\t$this->db->insert(db_prefix().'hr_p_t_form_question_box', [\n\t\t\t'boxtype' => $type,\n\t\t\t'questionid' => $questionid,\n\t\t]);\n\n\t\treturn $this->db->insert_id();\n\t}", "public function create() {\r\n $propsByName = $this->propertiesGetByName();\r\n $tableName = $this->table;\r\n $loop = 0;\r\n $queryNames = \"\"; $queryValues = \"\";\r\n $preparedTypes = array();\r\n foreach ($this->params as $param=>$value) {\r\n if ($loop) {\r\n $queryNames .= \", \";\r\n $queryValues .= \", \";\r\n }\r\n $queryNames .= \"`{$param}`\";\r\n $queryValues .= \":{$param}\";\r\n $preparedTypes[] = array(\":{$param}\", $value, $propsByName[$param]['type']);\r\n $loop++;\r\n }\r\n $query = \"INSERT INTO `{$tableName}` ({$queryNames}) VALUES ({$queryValues})\";\r\n $db = $this->dbConnect()->prepare($query);\r\n foreach ($preparedTypes as $prepared) {\r\n $db->bindValue($prepared[0], $prepared[1], $prepared[2]);\r\n }\r\n $db->execute();\r\n return $db->lastInsertId();\r\n }", "public function insertNew()\n {\n $news = R::dispense('news');\n\n $news->name = $this->_name;\n $news->content = $this->_content;\n $news->date = $this->_date;\n\n $id = R::store($news);\n\n $this->_id = $id;\n }", "public function createItem($data){\n\n $this->insert($data);\n\n return $this->getAdapter()->lastInsertId();\n\n }", "public function insert();", "public function insert();", "public function insert();", "public function insert();", "protected function insert_id()\n {\n if (!$this->meta) { \n return $this->result->insert_id; \n }\n else {return 0; }\n }", "private function insert(){\n $this->db->insert($this::DB_TABLE_NAME, $this);\n $this->{$this::DB_TABLE_PK_VALUE} = $this->db->insert_id();\n }", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stylists (stylist_name,specialty) VALUES ('{$this->stylist_name}','{$this->specialty}');\");\n $this->id = $GLOBALS['DB']->lastInsertID();\n }", "function lastInsertId ()\n {\n }", "public function save()\n {\n $changes = array();\n foreach( $this->saveable_fields as $field )\n {\n $changes[ $field ] = $this->$field;\n }\n $this->registry->getObject('db')->insertRecords( 'gamification_rules', $changes );\n $uid = $this->registry->getObject('db')->lastInsertID();\n return $uid; \n }", "function insertEditorSubmission(&$editorSubmission) {\n\t\t$this->update(\n\t\t\tsprintf('INSERT INTO edit_assignments\n\t\t\t\t(article_id, editor_id, date_notified, date_completed, date_acknowledged)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, %s, %s, %s)',\n\t\t\t\t$this->datetimeToDB($editorSubmission->getDateNotified()), $this->datetimeToDB($editorSubmission->getDateCompleted()), $this->datetimeToDB($editorSubmission->getDateAcknowledged())),\n\t\t\tarray(\n\t\t\t\t$editorSubmission->getId(),\n\t\t\t\t$editorSubmission->getEditorId()\n\t\t\t)\n\t\t);\n\n\t\t$editorSubmission->setEditId($this->getInsertEditId());\n\n\t\t// Insert review assignments.\n\t\t$reviewAssignments =& $editorSubmission->getReviewAssignments();\n\t\tfor ($i=0, $count=count($reviewAssignments); $i < $count; $i++) {\n\t\t\t$reviewAssignments[$i]->setArticleId($editorSubmission->getId());\n\t\t\t$this->reviewAssignmentDao->insertReviewAssignment($reviewAssignments[$i]);\n\t\t}\n\n\t\treturn $editorSubmission->getEditId();\n\t}", "function getLastInsertId()\n {\n return 0;\n }", "public function run()\n {\n DB::table('category_types')->insert([\n\t\t\t['title'=>'Төсөл','slug'=>'project'],\n\t\t\t['title'=>'Агуулга','slug'=>'content'],\n\t\t\t['title'=>'Блог','slug'=>'blog'],\n\t\t]);\n }", "public function GetInsertID();", "public function sql_insert_id() {}", "function newLanguage($language){\n\t$sql = \"INSERT INTO languages (language) VALUES ('$language')\";\n//\techo \"<hr> $sql <hr>\";\n\t$go = mysql_query($sql)or die (mysql_error());\n\t$ret = mysql_insert_id();\n\treturn $ret;\n}", "public function getCollectionTypeDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $collectionTypeId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `collectionTypeId`\n FROM \t`collectiontype`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [collectionTypeId],\n FROM [collectionType]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT COLLECTIONTYPEID AS \\\"collectionTypeId\\\",\n FROM COLLECTIONTYPE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $collectionTypeId = $row['collectionTypeId'];\n }\n return $collectionTypeId;\n }", "private function addToDatabase() {\n\t\t$scraperDAL = new scraperDAL();\n\n\t\t$scraperDAL->insertProducers($this->producers);\n\n\t}", "function insertAnnouncementType(&$announcementType) {\n\t\t$ret = $this->update(\n\t\t\tsprintf('INSERT INTO announcement_types\n\t\t\t\t(journal_id, type_name)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?)'),\n\t\t\tarray(\n\t\t\t\t$announcementType->getJournalId(),\n\t\t\t\t$announcementType->getTypeName()\n\t\t\t)\n\t\t);\n\t\t$announcementType->setTypeId($this->getInsertTypeId());\n\t\treturn $announcementType->getTypeId();\n\t}" ]
[ "0.7445945", "0.66474044", "0.59099406", "0.58721805", "0.5846397", "0.5841087", "0.5787031", "0.5748127", "0.5741491", "0.5720438", "0.5690369", "0.5687922", "0.5678994", "0.5622843", "0.5593411", "0.55853945", "0.548462", "0.5463202", "0.5445811", "0.5438357", "0.5438073", "0.5433063", "0.5429523", "0.53866607", "0.5381793", "0.536427", "0.5346414", "0.5329552", "0.5301062", "0.52998686", "0.5292019", "0.52751076", "0.5264614", "0.52608305", "0.5250108", "0.52461445", "0.5243301", "0.52285874", "0.5221241", "0.5217202", "0.52095205", "0.52093726", "0.52087903", "0.5205245", "0.5193527", "0.51766056", "0.5175131", "0.5173139", "0.5168718", "0.5168031", "0.5167002", "0.5157206", "0.51567715", "0.51560706", "0.51560485", "0.51465255", "0.5146444", "0.5144903", "0.51308835", "0.5129615", "0.5128748", "0.51284283", "0.5125247", "0.51248765", "0.51248556", "0.51162755", "0.51120263", "0.51111764", "0.5108292", "0.5105174", "0.5104951", "0.5100426", "0.50957096", "0.5090233", "0.50884926", "0.50836086", "0.5082569", "0.50812846", "0.507994", "0.5077243", "0.5075201", "0.5066791", "0.5056393", "0.5056393", "0.5056393", "0.5056393", "0.50562245", "0.50415754", "0.5040996", "0.50262576", "0.502338", "0.50130713", "0.50104904", "0.5008935", "0.50068027", "0.50006866", "0.49990994", "0.49979088", "0.49965507", "0.49958676" ]
0.7733494
0
Update a Editor_collection_type in musicbrainz database
Обновление Editor_collection_type в базе данных musicbrainz
public function update($editor_collection_type) { $query="UPDATE editor_collection_type ". "SET ". "id= ".$editor_collection_type->id." ,". "name='".$this->sqlSafe($editor_collection_type->name)."',". "entity_type='".$this->sqlSafe($editor_collection_type->entity_type)."',". "parent= ".$editor_collection_type->parent." ,". "child_order= ".$editor_collection_type->child_order." ,". "description='".$this->sqlSafe($editor_collection_type->description)."',". "gid='".$this->sqlSafe($editor_collection_type->gid)."' ". "WHERE id=".$editor_collection_type->id; $this->executeQuery($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdateTypeRessources(){\n\t\tif( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session[\"userId\"]) )){\n\t\t $ress=PHDB::find(Ressource::COLLECTION);\n\t\t $i=0;\n\t\t foreach($ress as $key => $data){\n\t\t\t $label=\"\";\n\t\t\t if(@$data[\"type\"]==\"compétence\")\n\t\t\t \t\t$label=\"competence\";\n\t\t\t else if(@$data[\"type\"]==\"matériel\")\n\t\t\t \t$label=\"material\";\n\t\t\t if($label!=\"\"){\n\t\t\t\t \t\techo '=>Ressoruce id : '.$key.\"<br/>last type : \".$data[\"type\"].\"///// New type : \".$label.\"<br/>\";\n\t\t\t\t \t\tPHDB::update(Ressource::COLLECTION,\n\t\t\t\t\t\t\tarray(\"_id\" => $data[\"_id\"]) , \n\t\t\t\t\t\t\tarray('$set' => array(\"type\" => $label))\t\t\t\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}\n\t\t\techo \"nombre de ressource updaté type to clé////////////// \".$i;\n\t\t}\n\t}", "public function insert2($editor_collection_type)\n {\n $query=\"INSERT INTO editor_collection_type ( \".\n\t \"id,\".\n \"name,\".\n \"entity_type,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \" \".$editor_collection_type->parent.\" ,\".\n \" \".$editor_collection_type->child_order.\" ,\".\n \"'\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n \")\"; \n\n $id = $this->executeInsert($query);\n\t $editor_collection_type->id = $id;\n\t return($editor_collection_type);\t\n }", "public function insert($editor_collection_type)\n {\n $query=\"INSERT INTO editor_collection_type ( \".\n\t \"id,\".\n \"name,\".\n \"entity_type,\".\n \"parent,\".\n \"child_order,\".\n \"description,\".\n \"gid \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \" \".$editor_collection_type->parent.\" ,\".\n \" \".$editor_collection_type->child_order.\" ,\".\n \"'\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"'\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n \")\"; \n\n $this->executeQuery($query);\n }", "function itg_save_update_field_collection($node, $collection, $fields = Array(), $index = 0) {\n if ($node && $collection && !empty($fields)) {\n // Get the field collection ID\n $eid = $node->{$collection}[LANGUAGE_NONE][$index]['value'];\n // Load the field collection with the ID from above.\n $entity = entity_load_single('field_collection_item', array($eid));\n // Wrap the loaded field collection which makes setting/getting much easier.\n $node_wrapper = entity_metadata_wrapper('field_collection_item', $entity);\n // Loop through our fields and set the values.\n foreach ($fields as $field => $data) {\n $node_wrapper->{$field}->set($data);\n }\n // Once we have added all the values we wish to change then we need to \n // save. This will modify the node and does not require node_save() so\n // at this point be sure it is all correct as this will save directly\n // to a published node.\n $node_wrapper->save(true);\n }\n }", "public function collections() {\n $_POST = mswSafeImport($_POST, $this);\n // Pre-Checks..\n $enabled = (isset($_POST['enabled']) && in_array($_POST['enabled'], array(\n 'yes',\n 'no'\n )) ? $_POST['enabled'] : 'no');\n $social = (!empty($_POST['social']) ? mswSafeString(serialize($_POST['social']), $this) : '');\n $views = (int) $_POST['views'];\n $released = ($_POST['released'] ? $this->datetime->dateToTS($_POST['released']) : '0');\n $ts = $this->datetime->utcTime();\n $related = (!empty($_POST['related']) ? mswSafeString(serialize($_POST['related']), $this) : '');\n $covero = (!empty($_POST['coverother']) ? mswSafeString(serialize($_POST['coverother']), $this) : '');\n // Edit or add..\n if (isset($_POST['edit'])) {\n $ID = (int) $_POST['edit'];\n $Q = db::db_query(\"UPDATE `\" . DB_PREFIX . \"collections` SET\n `name` = '{$_POST['name']}',\n `title` = '{$_POST['title']}',\n `metakeys` = '{$_POST['metakeys']}',\n `metadesc` = '{$_POST['metadesc']}',\n `slug` = '{$_POST['slug']}',\n `information` = '{$_POST['information']}',\n `searchtags` = '{$_POST['searchtags']}',\n `social` = '{$social}',\n `coverart` = '{$_POST['coverart']}',\n `coverartother` = '{$covero}',\n `enabled` = '{$enabled}',\n `views` = '{$views}',\n `cost` = '{$_POST['cost']}',\n `costcd` = '{$_POST['costcd']}',\n `released` = '{$released}',\n `catnumber` = '{$_POST['catnumber']}',\n `updated` = '{$ts}',\n `related` = '{$related}',\n `length` = '{$_POST['length']}',\n `bitrate` = '{$_POST['bitrate']}'\n WHERE `id` = '{$ID}'\n \");\n } else {\n $Q = db::db_query(\"INSERT INTO `\" . DB_PREFIX . \"collections` (\n `name`,\n `title`,\n `metakeys`,\n `metadesc`,\n `slug`,\n `information`,\n `searchtags`,\n `social`,\n `coverart`,\n `coverartother`,\n `enabled`,\n `views`,\n `released`,\n `cost`,\n `costcd`,\n `catnumber`,\n `added`,\n `updated`,\n `related`,\n `length`,\n `bitrate`\n ) VALUES (\n '{$_POST['name']}',\n '{$_POST['title']}',\n '{$_POST['metakeys']}',\n '{$_POST['metadesc']}',\n '{$_POST['slug']}',\n '{$_POST['information']}',\n '{$_POST['searchtags']}',\n '{$social}',\n '{$_POST['coverart']}',\n '{$covero}',\n '{$enabled}',\n '{$views}',\n '{$released}',\n '{$_POST['cost']}',\n '{$_POST['costcd']}',\n '{$_POST['catnumber']}',\n '{$ts}',\n '{$ts}',\n '{$related}',\n '{$_POST['length']}',\n '{$_POST['bitrate']}'\n )\");\n $ID = db::db_last_insert_id();\n }\n // Update styles..\n db::db_query(\"DELETE FROM `\" . DB_PREFIX . \"collection_styles` WHERE `collection` = '{$ID}'\");\n mswTableTruncationRoutine(array(\n 'collection_styles'\n ), $this);\n if (!empty($_POST['styles'])) {\n foreach ($_POST['styles'] AS $styleID) {\n db::db_query(\"INSERT INTO `\" . DB_PREFIX . \"collection_styles` (\n `style`,`collection`\n ) VALUES (\n '{$styleID}','{$ID}'\n )\");\n }\n }\n return $Q;\n }", "public function update(Collection $data);", "function set_type($val){\n\t\tif(is_object($this->_calendar)){\n\t\t\t$calendar = $this->_calendar;\n\t\t\tif($calendar->isRemoveable($this->field())){\n\t\t\t\t$tablename = $this->avalanche->PREFIX() . \"strongcal_cal_\" . $calendar->getId() . \"_fields\";\n\t\t\t\t$my_id = $this->getId();\n\t \t$sql = \"UPDATE $tablename SET type = '$val' WHERE id = '$my_id'\";\n\t\t\t\t$result = $this->avalanche->mysql_query($sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$this->_type = $val;\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\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function change()\n {\n $sql = \"INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_s_to_n_img','Land image of south to north');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_n_to_s_img','Land image of north to south');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_e_to_w_img','Land image of east to west');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('land_w_to_e_img','Land image of west to east');\n INSERT INTO public.document_types (\\\"name\\\",display_name)\n VALUES ('vehicle_img','Vehicle Image');\";\n\n $this->execute($sql);\n }", "public function testChangingFilterType()\n {\n $collections = new Horde_ActiveSync_Collections($this->_cache, $this->_as);\n $col = array(\n 'id' => 'INBOX',\n 'windowsize' => 5,\n 'truncation' => 0,\n 'mimesupport' => 0,\n 'mimetruncation' => 8,\n 'conflict' => 1,\n 'bodyprefs' => array(\n 'wanted' => 2,\n 2 => array(\n 'type' => 2,\n 'truncationsize' => 200000)\n ),\n 'synckey' => '{517541cc-b188-478d-9e1a-fa49c0a8015f}96',\n 'deletesasmoves' => 1,\n 'filtertype' => 4,\n );\n $collections->addCollection($col);\n $this->assertEquals(false, $collections->checkFilterType());\n }", "protected function _updateCollection(){\r\n\t\t$updated = false;\r\n\t\t$models = $this->getStorage()->getModels();\r\n\t\tforeach ($models as $model){\r\n\t\t\t$collection = modelCollection::getInstance($model);\r\n\t\t\t/** @var $collection modelCollection */\r\n\t\t\tif ($collection->exists()){\r\n\t\t\t\tif ($realFields = $this->getFieldNames($collection)){\r\n\t\t\t\t\t$collectionFields = $collection->getFieldNames();\r\n\t\t\t\t\tforeach ($collectionFields as $fieldName){\r\n\t\t\t\t\t\tif (!in_array($fieldName, $realFields)){\r\n\t\t\t\t\t\t\t$helper = $collection->getHelper();\r\n\t\t\t\t\t\t\t$fieldSql = $helper[$fieldName]->getCreateSql($this);\r\n\t\t\t\t\t\t\t// ALTER TABLE `sdf` ADD `sdfads` INT NOT NULL AFTER `id`\r\n\t\t\t\t\t\t\t$tableName = $collection->getTableName();\r\n\t\t\t\t\t\t\t// AFTER `id`\r\n\t\t\t\t\t\t\t// FIRST\r\n\t\t\t\t\t\t\t$sql = \"ALTER TABLE {$tableName} ADD \".$fieldSql;\r\n\t\t\t\t\t\t\tif ($collection->internalQuery($sql)){\r\n\t\t\t\t\t\t\t\t$updated = true;\r\n\t\t\t\t\t\t\t}\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}else{\r\n\t\t\t\t$this->_createCollection();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $updated;\r\n\t}", "function content_type_update($info) {\n if (!empty($info->old_type) && $info->old_type != $info->type) {\n // Rename the content type in all fields that use changed content type.\n db_query(\"UPDATE {\". content_instance_tablename() .\"} SET type_name='%s' WHERE type_name='%s'\", array($info->type, $info->old_type));\n\n // Rename the content fields table to match new content type name.\n $old_type = content_types($info->old_type);\n $old_name = _content_tablename($old_type['type'], CONTENT_DB_STORAGE_PER_CONTENT_TYPE);\n $new_name = _content_tablename($info->type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE);\n if (db_table_exists($old_name)) {\n $ret = array();\n db_rename_table($ret, $old_name, $new_name);\n watchdog('content', 'Content fields table %old_name has been renamed to %new_name and field instances have been updated.', array(\n '%old_name' => $old_name, '%new_name' => $new_name));\n }\n\n // Rename the variable storing weights for non-CCK fields.\n if ($extra = variable_get('content_extra_weights_'. $info->old_type, array())) {\n variable_set('content_extra_weights_'. $info->type, $extra);\n variable_del('content_extra_weights_'. $info->old_type);\n }\n }\n\n // Reset all content type info.\n // Menu needs to be rebuilt as well, but node types need to be rebuilt first.\n // node_type_form_submit() takes care of this.\n content_clear_type_cache(TRUE);\n}", "function saveCatalogType() {\n $data = array(\n 'catalogtype_title' => (string)$this->params['catalogtype_title'],\n 'catalogtype_name' => (string)$this->params['catalogtype_name'],\n 'catalogtype_loadlinks' => (int)$this->params['catalogtype_loadlinks'],\n 'catalogtype_loadteaser' => (int)$this->params['catalogtype_loadteaser']\n );\n return FALSE !== $this->databaseUpdateRecord(\n $this->tableCatalogTypes, $data, 'catalogtype_id', $this->params['type_id']\n );\n }", "public function actionUpdate_list_quality_type() { \n\t\n\t\t$list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_quality_type_id = isset($_POST['list_quality_type_id']) ? trim($_POST['list_quality_type_id']) : '';\n\t\t$list_quality_type_name = isset($_POST['list_quality_type_name']) ? trim($_POST['list_quality_type_name']) : '';\n\t\t\n\t\tif(! empty($list_quality_type_name)) {\n\t\t\n \t\t $model=ListQualityType::model()->findByPk($list_quality_type_id);\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_quality_type_name;\n\t\t\t$model->save();\n\t\t\n\t\t}\n\t}", "public function setCollectionId($value, $key, $type) { \n if ($type == 'single') { \n $this->collectionId = $value;\n return $this;\n } else if ($type == 'array') {\n $this->collectionId[$key] = $value;\n return $this;\n } else {\n echo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identify Type String Or Array:setcollectionId?\"));\n exit(); \n }\n }", "public function update_midrub() {\n \n // Verify if Midrub can be updated\n (new MidrubBaseAdminCollectionUpdateHelpers\\Midrub)->verify();\n \n }", "public function actionUpdate_list_side_type() { \n\t\n\t\t$list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_side_type_id = isset($_POST['list_side_type_id']) ? trim($_POST['list_side_type_id']) : '';\n\t\t$list_side_type_name = isset($_POST['list_side_type_name']) ? trim($_POST['list_side_type_name']) : '';\n\t\t\n\t\tif(! empty($list_side_type_name)) {\n\t\t\t$model= ListSideType::model()->findByPk($list_side_type_id);\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_side_type_name;\n\t\t\t$model->save();\n\t\t}\n\t}", "protected function saveFieldCollections() {\n if ($this->field_collections) {\n foreach ($this->field_collections as $field_collection) {\n // Ensure the correct language is set for the field on the host entity.\n $langcode = entity_metadata_field_get_language($this->type(), $this->value(), $field_collection->fieldInfo());\n\n $field_collection->setHostEntity($this->type(), $this->value(), $langcode);\n $field_collection->save(TRUE);\n }\n }\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set kind_id=\\\"$this->kind_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update($title, $type, $content){\n \n if(!empty($title))\n $values['title'] = $title;\n if(!empty($type))\n $values['type'] = $type;\n if(!empty($content))\n $values['content'] = $content;\n \n $db = new db();\n $db->update('widgets', $values, array('id',$this->widget_id));\n\n return true;\n\n }", "public function setCollection($collection_name);", "public function setType($type) {\n if($type == $this->type) {\n return true;\n }\n //Save\n $PDO =&DB::$PDO;\n $pre = $PDO->prepare('UPDATE challenges SET type=:type WHERE id=:cid');\n var_dump($pre->execute(array(':type' => $type, ':cid' => $this->cid)));\n $this->type = $type;\n return true;\n }", "function update_posting( $list_id, $type, $text ){\n\t\t$db = dblogin::dbconnect();\n\t\tswitch ($type){\n\t\t\tcase 'furniture':\n\t\t\t\t$cat = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'books':\n\t\t\t\t$cat = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'appliances':\n\t\t\t\t$cat = 3;\n\t\t\t\tbreak;\n\t\t\tcase 'electronics':\n\t\t\t\t$cat = 4;\n\t\t\t\tbreak;\n\t\t\tcase 'wanted':\n\t\t\t\t$cat = 5;\n\t\t\t\tbreak;\n\t\t\tcase 'other':\n\t\t\t\t$cat = 6;\n\t\t\t\tbreak;\n\t\t}\n\t\t$sql = \"UPDATE Listings\n\t\t\t\tSET type_id = $cat, description = '$text'\n\t\t\t\tWHERE list_id = $list_id\";\n\t\t\n\t\tif( $rows = $db->Execute( $sql ) ){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function updateType($type)\n {\n $this->type = $type;\n }", "public function delete($id)\n {\n $query=\"DELETE FROM editor_collection_type WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "function syncSeriesAssocType() {\n\t\t// Can be any DAO.\n\t\t$dao =& DAORegistry::getDAO('UserDAO'); /* @var $dao DAO */\n\t\t$tablesToUpdate = array(\n\t\t\t'announcements',\n\t\t\t'announcements_types',\n\t\t\t'user_settings',\n\t\t\t'notification',\n\t\t\t'email_templates',\n\t\t\t'email_templates_data',\n\t\t\t'controlled_vocabs',\n\t\t\t'gifts',\n\t\t\t'event_log',\n\t\t\t'email_log',\n\t\t\t'metadata_descriptions',\n\t\t\t'metrics',\n\t\t\t'notes',\n\t\t\t'item_views',\n\t\t\t'data_object_tombstone_oai_set_objects');\n\n\t\tforeach ($tablesToUpdate as $tableName) {\n\t\t\tif ($this->tableExists($tableName)) {\n\t\t\t\t$dao->update('UPDATE ' . $tableName . ' SET assoc_type = ' . ASSOC_TYPE_SECTION . ' WHERE assoc_type = ' . \"'526'\");\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function updateCollection()\n {\n\n $entity = new Person(['id' => 1, 'name' => 'test']);\n $collection = new EntityCollection(Person::class, [$entity]);\n $cid = 'SELECT people.* FROM people';\n $collection->setId($cid);\n // Collections map mock\n $collectionsMap = $this->getMockedCollectionMap();\n $collectionsMap->expects($this->once())\n ->method('set')\n ->with($cid, $collection)\n ->willReturn($collectionsMap);\n /** @var RepositoryInterface|MockObject $repository */\n $repository = $this->queryObject->getRepository();\n $repository->expects($this->once())\n ->method('getCollectionsMap')\n ->willReturn($collectionsMap);\n $event = new EntityRemoved($entity, ['collection' => $collection]);\n $this->queryObject->updateCollection($event);\n }", "function updateSimpleType($item_id, $typeObject) {\n\t\t$query = new Query();\n\n\t\t// make sure type tables exist\n\t\t$query->checkDbExistance($typeObject->db);\n\n\t\t$entities = $typeObject->data_entities;\n\t\t$names = array();\n\t\t$values = array();\n\n\t\tforeach($entities as $name => $entity) {\n\n\t\t\t// type files (simple type can handle one file)\n\t\t\t// TODO: file input can only be named \"files\" due to JS and upload names - needs to be more flexible\n\t\t\tif($entity[\"type\"] == \"files\") {\n\t\t\t\t$uploads = $this->upload($item_id, $entity);\n\t\t\t\tif($uploads) {\n\t\t\t\t\t$names[] = $name;\n\t\t\t\t\t$values[] = $name.\"='\".$uploads[0][\"format\"].\"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($entity[\"value\"] !== false && $name != \"published_at\" && $name != \"status\") {\n\n\t\t\t\t$names[] = $name;\n\t\t\t\t$values[] = $name.\"='\".$entity[\"value\"].\"'\";\n\t\t\t}\n\t\t}\n\n//\t\tprint_r($values);\n//\t\tprint_r($names);\n\n\t\tif($typeObject->validateList($names, $item_id)) {\n\t\t\tif($values) {\n\t\t\t\t$sql = \"UPDATE \".$typeObject->db.\" SET \".implode(\",\", $values).\" WHERE item_id = \".$item_id;\n//\t\t\t\tprint $sql;\n\t\t\t}\n\n\t\t\tif(!$values || $query->sql($sql)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract function saveCollection(array $collection);", "public function post_type_update_callback(){\n\n }", "public function update( $type = 'page' )\n \t{\n\n \t}", "public function testUpdateProductsVariationType()\n {\n }", "public function update($data, $type = '')\n {\n }", "function calendar_display_type_update()\n {\n\n $db = new DB;\n\t\t$sql = \"update event_type set name = '\".$_POST['name'].\"' where event_type_id = \".$_POST['id'];\n $error_num = $db->execute_statement($sql);\n\n\t\tinclude_once(SF_CLASS_PATH.'/calendar/calendar.inc');\n\t\t$calendar_obj = new Calendar ;\n\t $calendar_obj->cache_event_type_array();\n\t\t\t\t\t\t\n\n $new_event_type = \"display_type_edit.php?id=\" . $_POST[\"id\"];\n\n header(\"Location: $new_event_type\");\n exit;\n }", "public function update()\n {\n /*$art = Art::find(19);\n $art->name = '熊猫';\n $art->save();*/\n\n Art::where('id','>','14')->update(['name'=>'syd']);\n\n }", "public function actionUpdate_list_glass_type() { \n\t\n\t\t$list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_glass_type_id = isset($_POST['list_glass_type_id']) ? trim($_POST['list_glass_type_id']) : '';\n\t\t$list_glass_type_name = isset($_POST['list_glass_type_name']) ? trim($_POST['list_glass_type_name']) : '';\n\t\t\n\t\tif(! empty($list_glass_type_name)) {\n\t\n\t\t\t$model=ListGlassType::model()->findByPk($list_glass_type_id);\t\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_glass_type_name;\n\t\t\t$model->save();\n\t\t\n\t\t}\n\t}", "function modifierTypeIntervention($nomType,$listeElem,$montant){\n $connexion=getConnect();\n //addslashes permet d'accepter les apostrophes//\n $listeElem=addslashes($listeElem);\n $requete=\"UPDATE typeintervention SET nomType='$nomType', listeElem='$listeElem', montant='$montant' WHERE nomType='$nomType'\";\n $resultat=$connexion->query($requete);\n $resultat->closeCursor();\n}", "public function update()\n {\n $this->genreDAO->updateFromApi();\n\n }", "public function update(Request $request)\n {\n\n $request->validate([\n 'title' => 'required|max:191',\n ]);\n\n try{\n $postType = PostType::where('id', $request->post_type_id)->first();\n $postType->title = $request->title;\n $postType->description = $request->description;\n $postType->has_archive = $request->archive==\"on\"?1:0;\n $postType->position = $request->position;\n $postType->status = $request->status;\n $postType->icon = $request->icon;\n $postType->feature_image =$request->feature_image==\"on\"?1:0;\n $postType->editor = $request->editor==\"on\"?1:0;\n $response = $postType->update();\n if($response){\n return redirect()->back()->with('success', 'Post Type Successfully Updated.');\n }else{\n return redirect()->back()->with('error', 'Error while Updating Post Type');\n }\n }\n catch (\\Exception $e) {\n return redirect()->back()->with('error', 'Error while Updating Post Type');\n }\n }", "protected function setCollection()\n {\n //TODO: Get the mapped table name.\n\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = \"\n Select \" . (string)$this->collectionClass . \"Id\n From \" . (string)$dbTable . \"\n Where \" . (string)$this->baseClass . \"Id = \" . (int)$this->baseClassId;\n $results = $this->db->query($sql);\n $data = $results->get(1);\n if($data->hasRows())\n {\n foreach($data->getAll() as $result)\n {\n $itemId = $result[$this->collectionClass . 'Id'];\n //$obj = new $this->collectionClass($itemId);\n $obj = ModelFactory::get($this->collectionClass, $itemId);\n $this->items[$itemId] = $obj;\n }\n $t=0;\n }\n }", "function SetType($type, $dbupdate = true)\r\n\t{\r\n\t\treturn $this->UpdateValue('type', $type, $dbupdate);\r\n\t}", "public function testUpdateJobType()\n {\n }", "function &Set($type)\n\t\t{\n\t\t\t$this->currentDB = $this->databaseTypes[strtoupper($type)];\n\t\t}", "function addFileType($releaseType) {\r\n DB::query(\"INSERT INTO releaseTypes SET types=%s\", $releaseType);\r\n}", "public function set_type ($type) {}", "public function testType()\n {\n $type = InboxItem::class;\n $this->testCollection->setType($type);\n $this->assertNotEmpty($this->testCollection->getType());\n $this->assertEquals($type, $this->testCollection->getType());\n }", "public function actionUpdate()\n\t{\n if(F::loggedCommonVerify(true)){\n $public = F::getPublicData();\n $operation = F::getOperationData();\n\n $id = @$operation['id'];\n $name = @$operation['name'];\n $parent = @$operation['parent'];\n\n if(!$id){\n F::returnError(F::lang(('TYPE_ID_SPECIFY')));\n }else if(!is_numeric($id)){\n F::returnError(F::lang('TYPE_NO_EXIST'));\n }\n if(!$name){\n F::returnError(F::lang(('TYPE_NAME_SPECIFY')));\n }\n\n if($parent){//修改小分类名称\n if($parent === $id){\n F::returnError(F::lang('TYPE_PARENT_EQUAL_CHILD'));\n }\n if(!is_numeric($parent)){\n F::returnError(F::lang('TYPE_PARENT_FORMAT_ERROR'));\n }\n\n $nameIsExist = Types::model()->findByAttributes(array('user_id' => $public['userId'], 'parent_id' => $parent, 'name' => F::trimAll($name)));\n\n if($nameIsExist){\n return F::returnError(F::lang(\"TYPE_NAME__IN_USE\"));\n }\n\n $record = Types::model()->findByAttributes(array('id'=>$id, 'user_id' => $public['userId'], 'parent_id' => $parent));\n }else{\n\n $nameIsExist = Types::model()->findByAttributes(array('user_id' => $public['userId'], 'parent_id' => null, 'name' => F::trimAll($name)));\n\n if($nameIsExist){\n return F::returnError(F::lang(\"TYPE_NAME__IN_USE\"));\n }\n\n $record = Types::model()->findByAttributes(array('id'=>$id, 'user_id' => $public['userId'], 'parent_id'=>null));\n }\n\n if(!$record){\n F::returnError(F::lang('TYPE_NO_EXIST'));\n }else if($record->getAttribute('name') === F::trimAll($name)){\n F::returnError(F::lang('TYPE_NAME_NOTHING_TO_UPDATE'));\n }\n\n $model=$this->loadModel($id);\n $model->attributes=array(\n 'name' => $name,\n 'time' => F::getCurrentDatetime()\n );\n\n $this->performAjaxValidation($model);\n if($model->save(true, array('name', 'time'))){\n F::returnSuccess(F::lang('TYPE_UPDATE_SUCCESS'), array(\"id\" => $id, \"name\" => F::trimAll($name), \"parent\" => $model->getAttribute(\"parent_id\")));\n }else{\n F::returnError(F::lang('TYPE_UPDATE_ERROR'), $model->getErrors());\n }\n }\n\t}", "function wp_document_revisions_save_type( $post_id ) {\n \t\t\t\n \t\t\t//verify this is not an autosave\n \t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n \t\t\treturn;\n \t\t\n \t\t//verify nonce\n \t\tif ( !isset( $_POST['document_type_nonce'] ) ||\n \t\t\t !wp_verify_nonce( $_POST['document_type_nonce'], 'document_type' ) )\n \t\t\treturn;\n \t\t\n \t\t//verify permissions\n \t\tif ( !current_user_can( 'edit_post', $post_id ) )\n \t\t\treturn;\n \t\t\n \t\t//associate taxonomy with parent, not revision\n\t\t\tif ( wp_is_post_revision( $post_id ) )\n\t\t\t\t$post_id = wp_is_post_revision( $post_id );\n \t\t\n \t\t//store the data \t\t\t\n \t\twp_set_post_terms( $post_id, $_POST['document_type'], 'document_type', false);\n \t\t\n \t\t}", "function update($typepersoon) {\n $this->db->where('id', $typepersoon->id);\n $this->db->update('typePersoon', $typepersoon);\n }", "public function updateDocument($id, $data, $index, $type, array $options = array());", "private function setCollectionPosted($collectionId) {\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n UPDATE `collection`\n SET `isPost` = 1,\n `executeBy` = '\" . $this->getStaffId() . \"',\n `executeTime` = \" . $this->getExecuteTime() . \"\n WHERE `collectionId` IN (\" . $collectionId . \")\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n UPDATE [collection]\n SET [isPost] = 1,\n [executeBy] = '\" . $this->getStaffId() . \"',\n [executeTime] = \" . $this->getExecuteTime() . \"\n WHERE [collectionId] IN (\" . $collectionId . \")\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n UPDATE COLLECTION\n SET ISPOST = 1,\n EXECUTEBY = '\" . $this->getStaffId() . \"',\n EXECUTETIME = \" . $this->getExecuteTime() . \"\n WHERE COLLECTIONID IN (\" . $collectionId . \")\";\n }\n try {\n $this->q->update($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function updateDocuments($index, $type, array $data);", "function budget_type_save(budgetType $type) {\n $type->save();\n}", "function scope_edit_ads_post_type() {\r\n\tremove_post_type_support( 'ads', 'editor' );\r\n}", "function wp_document_revisions_register_type_metabox() {\n\t\t\n\t\t//remove default metabox \t\t\n \t\tremove_meta_box( 'document_typediv', 'document', 'side');\n\n\t\t//add custom metabox\n \t\tadd_meta_box( 'document_type', 'Type', 'wp_document_revisions_type_cb', 'document', 'side');\n \t\n \t}", "public function actionUpdate_list_tools_type() { \n\t\n\t\t$list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_tools_type_id = isset($_POST['list_tools_type_id']) ? trim($_POST['list_tools_type_id']) : '';\n\t\t$list_tools_type_name = isset($_POST['list_tools_type_name']) ? trim($_POST['list_tools_type_name']) : '';\n\t\t\n\t\tif(! empty($list_tools_type_name)) {\n\t\t\t$model= ListToolsType::model()->findByPk($list_tools_type_id);\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_tools_type_name;\n\t\t\t$model->save();\n\t\t}\n\t}", "public function putCollection();", "public static function update_340006() { \n\n\t\t$sql = \"DESCRIBE `album_data`\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\twhile ($row = Dba::fetch_assoc($db_results)) { \n\t\t\tif ($row['Field'] == 'art' AND $row['Type'] == 'blob') { \n\t\t\t\t$blob_needed = true; \n\t\t\t} \n\t\t} // end while \n\t\tif ($blob_needed) { \n\t\t\t$sql = \"ALTER TABLE `album_data` CHANGE `art` `art` MEDIUMBLOB NULL DEFAULT NULL\";\n\t\t\t$db_results = Dba::query($sql); \n\t\t} \n\n\t\t// No matter what remove that random method preference\n\t\t$sql = \"DELETE FROM `preference` WHERE `name`='random_method'\";\n\t\t$db_results = Dba::query($sql); \n\n $sql = \"SELECT `id` FROM `user`\";\n $db_results = Dba::query($sql);\n\n User::fix_preferences('-1');\n\n while ($r = Dba::fetch_assoc($db_results)) {\n User::fix_preferences($r['id']);\n }\n\n self::set_version('db_version','340006');\n\n return true;\n\n\n\t}", "function upgradePaperType() {\n\t\t$conferenceDao =& DAORegistry::getDAO('ConferenceDAO');\n\t\t$schedConfDao =& DAORegistry::getDAO('SchedConfDAO');\n\t\t$paperTypeDao =& DAORegistry::getDAO('PaperTypeDAO');\n\t\t$paperTypeEntryDao =& DAORegistry::getDAO('PaperTypeEntryDAO');\n\n\t\t$conferences =& $conferenceDao->getConferences();\n\n\t\twhile ($conference =& $conferences->next()) {\n\t\t\t$locales = array_keys($conference->getSupportedLocaleNames());\n\t\t\t$locales[] = $conference->getPrimaryLocale();\n\t\t\t$locales = array_unique($locales);\n\n\t\t\tforeach ($locales as $locale) AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_DEFAULT), $locale);\n\n\t\t\t$schedConfs =& $schedConfDao->getSchedConfsByConferenceId($conference->getId());\n\t\t\twhile ($schedConf =& $schedConfs->next()) {\n\t\t\t\t$allowIndividualSubmissions = $schedConf->getSetting('allowIndividualSubmissions');\n\t\t\t\t$allowPanelSubmissions = $schedConf->getSetting('allowPanelSubmissions');\n\t\t\t\tif ($allowIndividualSubmissions || $allowPanelSubmissions) {\n\t\t\t\t\t$paperType =& $paperTypeDao->build($schedConf->getId());\n\t\t\t\t}\n\t\t\t\tif ($allowIndividualSubmissions) {\n\t\t\t\t\t$paperTypeEntry =& $paperTypeEntryDao->newDataObject();\n\t\t\t\t\tforeach ($locales as $locale) {\n\t\t\t\t\t\t$paperTypeEntry->setName(__('default.paperType.individual.name', array(), $locale), $locale);\n\t\t\t\t\t\t$paperTypeEntry->setDescription(__('default.paperType.individual.description', array(), $locale), $locale);\n\t\t\t\t\t}\n\t\t\t\t\t$paperTypeEntry->setControlledVocabId($paperType->getId());\n\t\t\t\t\t$paperTypeEntryDao->insertObject($paperTypeEntry);\n\t\t\t\t\t$schedConfDao->update(\n\t\t\t\t\t\t'INSERT INTO paper_settings (setting_name, setting_type, paper_id, locale, setting_value) SELECT ?, ?, paper_id, ?, ? FROM papers WHERE sched_conf_id = ? AND paper_type = ?',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'sessionType',\n\t\t\t\t\t\t\t'int',\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t(int) $paperTypeEntry->getId(),\n\t\t\t\t\t\t\t(int) $schedConf->getId(),\n\t\t\t\t\t\t\t0 // SUBMISSION_TYPE_SINGLE (since removed)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tunset($paperTypeEntry);\n\t\t\t\t}\n\t\t\t\tif ($allowPanelSubmissions) {\n\t\t\t\t\t$paperTypeEntry =& $paperTypeEntryDao->newDataObject();\n\t\t\t\t\tforeach ($locales as $locale) {\n\t\t\t\t\t\t$paperTypeEntry->setName(__('default.paperType.panel.name', array(), $locale), $locale);\n\t\t\t\t\t\t$paperTypeEntry->setDescription(__('default.paperType.panel.description', array(), $locale), $locale);\n\t\t\t\t\t}\n\t\t\t\t\t$paperTypeEntry->setControlledVocabId($paperType->getId());\n\t\t\t\t\t$paperTypeEntryDao->insertObject($paperTypeEntry);\n\t\t\t\t\t$schedConfDao->update(\n\t\t\t\t\t\t'INSERT INTO paper_settings (setting_name, setting_type, paper_id, locale, setting_value) SELECT ?, ?, paper_id, ?, ? FROM papers WHERE sched_conf_id = ? AND paper_type = ?',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'sessionType',\n\t\t\t\t\t\t\t'int',\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t(int) $paperTypeEntry->getId(),\n\t\t\t\t\t\t\t(int) $schedConf->getId(),\n\t\t\t\t\t\t\t1 // SUBMISSION_TYPE_PANEL (since removed)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tunset($paperTypeEntry);\n\t\t\t\t}\n\t\t\t\tunset($schedConf, $paperType);\n\t\t\t}\n\t\t\tunset($schedConfs, $conference);\n\t\t}\n\n\t\treturn true;\n\t}", "public function updateLichaamstype($lichaamstype){\n $sql=\"update lichaamstypes set lichaamstype=:lichaamstype\n where lichaamstypeId=:id\";\n\n $dbh=new PDO(DBCONFIG::$DB_CONNSTRING,DBCONFIG::$DB_USERNAME,DBCONFIG::$DB_PASSWORD);\n $stmt=$dbh->prepare($sql);\n $stmt->execute(array(\n ':lichaamstype'=>$lichaamstype->getLichaamstype(),\n ':id'=>$lichaamstype->getLichaamsId()\n ));\n $dbh=null;\n }", "public function update($type) {\n if ($this->session->userdata('logged_in') === TRUE) {\n switch ($type) {\n case 'biography':\n // Load helpers\n $this->load->helper(array('genre_helper', 'lastfm_helper'));\n\n $_REQUEST += fetchTagBio($_REQUEST);\n echo addGenreBio($_REQUEST);\n break;\n default:\n break;\n }\n }\n else {\n show_404();\n }\n }", "public function onSaving()\n {\n $entry = $this->getFormEntry();\n $type = $this->getType();\n\n if ($type) {\n $entry->type_id = $type->getId();\n }\n }", "function search_api_solr_post_update_8204_replace_solr_4_field_types() {\n $storage = \\Drupal::entityTypeManager()->getStorage('solr_field_type');\n $storage->delete($storage->loadMultiple([\n 'm_text_und_5_2_0',\n 'text_und_4_5_0',\n 'm_text_de_5_2_0',\n 'm_text_en_5_2_0',\n 'm_text_nl_5_2_0',\n 'text_cs_5_0_0',\n 'text_de_4_5_0',\n 'text_de_5_0_0',\n 'text_de_scientific_5_0_0',\n 'text_el_4_5_0',\n 'text_en_4_5_0',\n 'text_es_4_5_0',\n 'text_fi_4_5_0',\n 'text_fr_4_5_0',\n 'text_it_4_5_0',\n 'text_nl_4_5_0',\n 'text_ru_4_5_0',\n 'text_uk_4_5_0',\n ]));\n}", "function my_epl_change_type( $field ) {\n\t$field['type'] = 'text';\n\treturn $field;\n}", "function omniture_content_type_admin_settings_submit($form, $form_state) {\n module_load_include('inc', 'omniture', 'inc/omniture.common');\n\n $content_types = _omniture_get_defined_content_types();\n \n $types = node_type_get_types();\n foreach ($types as $node_type) {\n if (isset($content_types[$node_type->type])) {\n $result = db_update('omniture')\n ->fields(array(\n 'source' => $form_state['values']['textarea_' . $node_type->type],\n ))\n ->condition('type', 'content_type', '=')\n ->condition('value', $node_type->type, '=')\n ->execute();\n }\n else {\n $entry = array(\n 'oid' => 0,\n 'value' => $node_type->type,\n 'type' => 'content_type',\n 'source' => $form_state['values']['textarea_' . $node_type->type],\n );\n \n _omniture_insert_new_entry($entry);\n }\n \n }\n \n}", "public function setType( $type ) {\n $this->db->update( $this->tables['users'], array( 'type' => $type ) , array('id' => $this->ID ) );\n }", "public static function modifyDataFrom($collection_name, $data, $id, $id_value) {\r\n\t\ttry {\r\n\t\t\t$connection = new Mongo($this::Host);\r\n\t\t\t$db = $connection->selectDB($this::DbName);\r\n\t\t\t$collection = $db->{$collection_name};\r\n\t\t\t\r\n\t\t\t$collection->update(array($id => $id_value), \r\n\t\t\t\t\tarray('$set' => $data));\r\n\t\t\t\r\n\t\t\t$connection->close();\r\n\t\t} catch (MongoConnectionException $e) {\r\n\t\t\tdie('Error connecting to MongoDB server');\r\n\t\t} catch (MongoException $e){\r\n\t\t\tdie('Error : ' . $e->getMessage());\r\n\t\t}\r\n\t}", "public function testUpdateQuestionsInBulk()\n {\n }", "function setArtworkType($type)\n {\n $this->_artwork->setArtworkIdentifier($type);\n $this->_artworkType = $type;\n }", "public function save_metabox( $post_id, $post ) {\r\n // Add nonce for security and authentication.\r\n $nonce_name = isset( $_POST['_themenonce'] ) ? $_POST['_themenonce'] : '';\r\n $nonce_action = 'save_type_editor';\r\n\r\n // Check if nonce is set and valid.\r\n if ( ! ( isset( $nonce_name ) && wp_verify_nonce( $nonce_name, $nonce_action ) ) ) {\r\n return;\r\n }\r\n\r\n // Check if user has permissions to save data.\r\n if ( ! current_user_can( 'edit_post', $post_id ) || wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) {\r\n return;\r\n }\r\n\r\n do_action( 'mylisting/admin/types/before-update', $post );\r\n\r\n // Fields TAB\r\n if ( ! empty( $_POST['case27_listing_type_fields'] ) ) {\r\n $decoded_fields = json_decode( stripslashes( $_POST['case27_listing_type_fields'] ), true );\r\n\r\n if ( json_last_error() === JSON_ERROR_NONE ) {\r\n // set field priorities to preserve order set in listing type editor through drag&drop.\r\n $updated_fields = [];\r\n foreach ( (array) $decoded_fields as $i => $field ) {\r\n $field['priority'] = ($i + 1);\r\n $updated_fields[ $field['slug'] ] = (array) $field;\r\n }\r\n update_post_meta( $post_id, 'case27_listing_type_fields', wp_slash( serialize( $updated_fields ) ) );\r\n }\r\n }\r\n\r\n // Single Page TAB\r\n if ( ! empty( $_POST['case27_listing_type_single_page_options'] ) ) {\r\n $options = (array) json_decode( stripslashes( $_POST['case27_listing_type_single_page_options'] ), true );\r\n if ( json_last_error() === JSON_ERROR_NONE ) {\r\n update_post_meta( $post_id, 'case27_listing_type_single_page_options', wp_slash( serialize( $options ) ) );\r\n }\r\n }\r\n\r\n // Result Template TAB\r\n if ( ! empty( $_POST['case27_listing_type_result_template'] ) ) {\r\n $result_template = (array) json_decode( stripslashes( $_POST['case27_listing_type_result_template'] ), true );\r\n if ( json_last_error() === JSON_ERROR_NONE ) {\r\n $cache_enabled = (bool) get_option( 'mylisting_cache_previews' );\r\n $old_result_template = get_post_meta( $post_id, 'case27_listing_type_result_template', true );\r\n if ( $cache_enabled && serialize( $result_template ) !== $old_result_template ) {\r\n add_filter( 'redirect_post_location', function( $location ) {\r\n return add_query_arg( [ 'regen_previews' => 1 ], $location );\r\n } );\r\n }\r\n\r\n update_post_meta( $post_id, 'case27_listing_type_result_template', wp_slash( serialize( $result_template ) ) );\r\n }\r\n }\r\n\r\n // Search Forms TAB\r\n if ( ! empty( $_POST['case27_listing_type_search_page'] ) ) {\r\n $search_forms = (array) json_decode( stripslashes( $_POST['case27_listing_type_search_page'] ), true );\r\n if ( json_last_error() === JSON_ERROR_NONE ) {\r\n update_post_meta( $post_id, 'case27_listing_type_search_page', wp_slash( serialize( $search_forms ) ) );\r\n }\r\n }\r\n\r\n // Settings TAB\r\n if ( ! empty( $_POST['case27_listing_type_settings_page'] ) ) {\r\n $settings_page = (array) json_decode( stripslashes( $_POST['case27_listing_type_settings_page'] ), true );\r\n if ( json_last_error() === JSON_ERROR_NONE ) {\r\n update_post_meta( $post_id, 'case27_listing_type_settings_page', wp_slash( serialize( $settings_page ) ) );\r\n }\r\n }\r\n\r\n do_action( 'mylisting/admin/types/after-update', $post );\r\n }", "public function afterUpgradeCollection(CollectionInterface $code, CodeChangeSet $changeset)\n {\n }", "public function action_update()\n\t{\n\n\t\t// Grab selected collection ID from URL\n\t\t$collection_id = $this->request->param('collection');\n\n\t\t// Grab $_POST array from submitted form\n\t\t$post = $this->request->post();\n\t\t\n\t\tif (isset($post['btnUpdate']))\n\t\t{\t\n\t\t\t\t \n\t\t\t// Update button was pressed\n\t\t\t\t \n\t\t\t$collection_updated_arr = Model::factory('Collection')->update_collection($post, $collection_id);\n\t\t\tif ($collection_updated_arr['Success'])\n\t\t\t{\n\t\t\t\t\t\n\t\t\t\t// Send message indicating successful collection update\n\t\t\t\tSession::instance()->set('message', \"You've updated collection \\\"\".$collection_updated_arr['Clean_Post_Data']['txtCollectionName'].\"\\\"!\");\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Redirect to edit action \n\t\t\t\t$this->redirect('Collection/edit/'.$collection_id);\t\n\t\t\t} // if ($collection_updated_arr['Success'])\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t \n\t\t\t\t// Validation failed, display form with custom error text\t\t\t\t\n\t\t\t\t$accordions_open = array(\n\t\t\t\t\t'add_item' => FALSE\n\t\t\t\t);\n\t\t\t\t$posts = array(\n\t\t\t\t\t'add_item' => NULL\n\t\t\t\t\t,'edit_collection' => $post\n\t\t\t\t);\n\t\t\t\t$this->template->content = ViewBuilder::factory('Page')->edit_collection($accordions_open, $collection_id, $this->template, $posts, $collection_updated_arr['Errors']);\n\t\t\t}\n\t\t} // if (isset($post['btnUpdate']))\n\t\telseif (isset($post['btnDelete']))\n\t\t{\n \t\t \n\t\t\t// Delete button was pressed\n\t\t\t\n\t\t\t$collection_deleted_arr = Model::factory('Collection')->delete_collection($collection_id, $to_delete = 1);\n\t\t\tif ($collection_deleted_arr['Success']) \n\t\t\t{\n \t\t\t \n\t\t\t\t// Send message indicating successful collection delete, giving option to Undo\n\t\t\t\tSession::instance()->set('warning', \"You've deleted collection \\\"\" \n\t\t\t\t\t.$post['txtCollectionName'].\"\\\" (and all of its items)! \" \n\t\t\t\t\t.HTML::anchor('Collection/undo_delete/'.$collection_id, 'Click here to Undo.')\n\t\t\t\t); \t\t\t \n\t\t\t} // if ($collection_deleted_arr['Success'])\n\t\t\t// else NOOP - This did not delete anything because of a bad URL\n\t\t\t\n\t\t\t// Redirect to view action\n\t\t\t$this->redirect('Collection/view');\t\t\t\t\t \n\t\t} // elseif (isset($post['btnDelete'])) \n\t\telse\n\t\t{\n \t\t \n\t\t\t// Bad URL (i.e. someone went to /Collection/update manually)\n\n\t\t\t// Redirect to view action\n\t\t\t$this->redirect('Collection/view');\n\t\t}\n\t\t\n\t}", "public function actionUpdate_list_access_type() { \n\t\n\t $list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_access_type_id = isset($_POST['list_access_type_id']) ? trim($_POST['list_access_type_id']) : '';\n\t\t$list_access_type_name = isset($_POST['list_access_type_name']) ? trim($_POST['list_access_type_name']) : '';\n\t\t$list_access_type_time_per_quantity = isset($_POST['list_access_type_time_per_quantity']) ? trim($_POST['list_access_type_time_per_quantity']) : '';\n\t\t$list_access_type_setup_time = isset($_POST['list_access_type_setup_time']) ? trim($_POST['list_access_type_setup_time']) : '';\n\t\tif(! empty($list_access_type_name)) {\n\t\n\t\t\t$model = ListAccessType::model()->findByPk($list_access_type_id);\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_access_type_name;\n\t\t\t$model->time_per_quantity = $list_access_type_time_per_quantity;\n\t\t\t$model->setup_time = $list_access_type_setup_time;\n\t\t\t$model->save();\n\t\t}\n\t}", "public function bulk_edit($column_name, $post_type)\n {\n }", "function set_document_type( $value ) {\n\t\t$this->set_mapped_property( 'document_type', $value );\n\t}", "public function addFieldCollection($type) {\n $field_collection_item = entity_create('field_collection_item', array('field_name' => $type));\n\n $this->field_collections[] = $field_collection_item;\n\n return entity_metadata_wrapper('field_collection_item', $field_collection_item);\n }", "public function actionUpdate_list_pane_size_type() { \n\t\n\t\t$list_item_id = isset($_POST['list_item_id']) ? $_POST['list_item_id'] : '';\n\t\t$list_pane_size_type_id = isset($_POST['list_pane_size_type_id']) ? trim($_POST['list_pane_size_type_id']) : '';\n\t\t$list_pane_size_type_name = isset($_POST['list_pane_size_type_name']) ? trim($_POST['list_pane_size_type_name']) : '';\n\t\t$list_pane_size_time_per_quantity = isset($_POST['list_pane_size_time_per_quantity']) ? trim($_POST['list_pane_size_time_per_quantity']) : '';\n\t\t$list_pane_size_setup_time = isset($_POST['list_pane_size_setup_time']) ? trim($_POST['list_pane_size_setup_time']) : '';\n\t\t\n\t\tif(! empty($list_pane_size_type_name)) {\n\t\t\t$model= ListPaneSizeType::model()->findByPk($list_pane_size_type_id);\n\t\t\t$model->list_item_id = $list_item_id;\n\t\t\t$model->status = '1';\n\t\t\t$model->name = $list_pane_size_type_name;\n\t\t\t$model->time_per_quantity = $list_pane_size_time_per_quantity;\n\t\t\t$model->setup_time = $list_pane_size_setup_time;\n\t\t\t$model->save();\n\t\t}\n\t}", "function updateEditorSubmission(&$editorSubmission) {\n\t\t// update edit assignments\n\t\t$editAssignments = $editorSubmission->getEditAssignments();\n\t\tforeach ($editAssignments as $editAssignment) {\n\t\t\tif ($editAssignment->getEditId() > 0) {\n\t\t\t\t$this->editAssignmentDao->updateEditAssignment($editAssignment);\n\t\t\t} else {\n\t\t\t\t$this->editAssignmentDao->insertEditAssignment($editAssignment);\n\t\t\t}\n\t\t}\n\t}", "function edit()\n {\n $ajax = (bool)array_ifnull($_REQUEST, 'ajax', 0);\n $snippet_type = trim(array_ifnull($_GET, 'snippet_type', '')); // snippet alias\n\n // Data container\n $data = array();\n $snippet_types = array();\n\n // Get data from query string\n $id = intval( array_ifnull($_REQUEST, 'id', 0) );\n\n try {\n if(count($_POST) > 0) {\n $errors = array();\n\n $data = $this->parseData($_POST, $snippet_type);\n\n $errors = $this->errorChecking($data, $snippet_type);\n \n // continue to process (successfully)\n if(count($errors) > 0) {\n throw new fieldsException($errors);\n } else {\n $this->conn->beginTransaction();\n \n $snippet_type_id = 0;\n $sql = 'SELECT id FROM snippets WHERE alias='.$this->kernel->db->escape($data['snippet_type']);\n $statement = $this->kernel->db->query( $sql );\n if ( !$statement )\n {\n $this->kernel->quit( 'DB Error: ' . array_pop($this->kernel->db->errorInfo()), $sql, __FILE__, __LINE__ );\n }\n if($record = $statement->fetch())\n $snippet_type_id = $record['id'];\n \n if ( $id )\n {\n // Update existing snippet\n $sql = 'UPDATE customize_snippets SET';\n $sql .= ' snippet_type_id = ' . $snippet_type_id . ',';\n $sql .= ' name = ' . $this->kernel->db->escape($data['snippet_name']) . ',';\n $sql .= ' general_para_value=';\n if(isset($data['general_para_value']))\n $sql .= $this->kernel->db->escape($data['general_para_value']) . ',';\n else\n $sql .= $this->kernel->db->escape(NULL) . ',';\n $sql .= ' updated_time = UTC_TIMESTAMP(),';\n $sql .= \" updater_id = {$this->user->getId()}\";\n $sql .= \" WHERE id = $id\";\n if ( $this->conn->exec($sql) > 0 )\n {\n $this->kernel->log( 'message', \"Customized snippet $id updated\", __FILE__, __LINE__ );\n }\n \n foreach($data['snippet_content'] as $alias=>$content)\n {\n $sql = 'DELETE FROM customize_snippet_locales WHERE snippet_id='.$id.' AND locale='.$this->conn->escape($alias);\n $this->conn->exec( $sql );\n \n $sql = 'INSERT INTO customize_snippet_locales (snippet_id, locale, parameter_values) VALUES (';\n $sql .= $id.', '.$this->conn->escape($alias).', '.$this->kernel->db->escape($content);\n $sql .= ')';\n $this->conn->exec( $sql );\n }\n }\n else\n {\n // Insert new snippet\n $sql = 'INSERT INTO customize_snippets(snippet_type_id, name, general_para_value,';\n $sql .= ' created_time, creator_id) VALUES(';\n $sql .= $snippet_type_id . ',';\n $sql .= $this->kernel->db->escape($data['snippet_name']) . ',';\n $sql .= isset($data['general_para_value']) ? $this->kernel->db->escape($data['general_para_value']) . ',' : $this->kernel->db->escape(NULL) . ',';\n $sql .= 'UTC_TIMESTAMP(),';\n $sql .= \"{$this->user->getId()})\";\n $this->conn->exec( $sql );\n $id = $this->conn->lastInsertId();\n $this->kernel->log( 'message', \"Customized snippet $id created\", __FILE__, __LINE__ );\n \n foreach($data['snippet_content'] as $alias=>$content)\n {\n $sql = 'INSERT INTO customize_snippet_locales (snippet_id, locale, parameter_values) VALUES (';\n $sql .= $id.', '.$this->conn->escape($alias).', '.$this->kernel->db->escape($content);\n $sql .= ')';\n $this->conn->exec( $sql );\n }\n }\n\n $this->conn->commit();\n }\n\n $redirect = $this->kernel->sets['paths']['mod_from_doc'] . '?' .\n http_build_query(array(\n 'bare' => $_GET['bare'],\n 'op' => 'dialog',\n 'type' => 'message',\n 'code' => 'DESCRIPTION_saved',\n 'redirect_url' => $this->kernel->sets['paths']['server_url']\n . $this->kernel->sets['paths']['mod_from_doc']\n . '?' . http_build_query( array(\n 'bare' => $_GET['bare'],\n 'op' => 'edit',\n 'id' => $id,\n 'snippet_type' => $snippet_type,\n 'referer_url' => array_ifnull( $_GET, 'referer_url', '' )\n ) )\n ));\n if($ajax) {\n $this->apply_template = FALSE;\n $this->kernel->response['mimetype'] = 'application/json';\n $this->kernel->response['content'] = json_encode( array(\n 'result' => 'success',\n 'redirect' => $redirect\n ));\n } else {\n $this->kernel->redirect($redirect);\n }\n return TRUE;\n }\n\n } catch(Exception $e) {\n $this->processException($e);\n }\n\n // continue to process if not ajax\n if(!$ajax) {\n // Get the list of snippet types\n $sql = \"SELECT * FROM snippets WHERE deleted=0 AND id NOT IN (\".implode(',', $this->exclude_snippet_ids).\") ORDER BY snippet_name\";\n $statement = $this->kernel->db->query( $sql );\n if ( !$statement )\n {\n $this->kernel->quit( 'DB Error: ' . array_pop($this->kernel->db->errorInfo()), $sql, __FILE__, __LINE__ );\n }\n for($i = 0; $record = $statement->fetch(); $i++)\n {\n if($i == 0)\n $default_type = $record['alias'];\n $snippet_types[$record['alias']] = $record['snippet_name'].' [#'.$record['id'].']';\n }\n\n if($snippet_type == '' || !isset($snippet_types[$snippet_type]))\n {\n $snippet_type = $default_type;\n }\n\n $this->kernel->smarty->assign( 'snippet_types', $snippet_types );\n\n // Get the requested snippet\n $sql = \"SELECT cs.*, s.alias AS snippet_type, CONVERT_TZ(cs.created_time, '+00:00', \";\n $sql .= \" {$this->kernel->conf['escaped_timezone']}) AS created_date,\";\n $sql .= \" CONVERT_TZ(cs.updated_time, '+00:00',\";\n $sql .= \" {$this->kernel->conf['escaped_timezone']}) AS updated_date,\";\n $sql .= ' creators.first_name AS creator_user_name,';\n $sql .= ' creators.email AS creator_email,';\n $sql .= ' updaters.first_name AS updater_user_name,';\n $sql .= ' updaters.email AS updater_email';\n $sql .= ' FROM customize_snippets cs';\n $sql .= ' LEFT OUTER JOIN users AS creators ON (cs.creator_id = creators.id)';\n $sql .= ' LEFT OUTER JOIN users AS updaters ON (cs.updater_id = updaters.id)';\n $sql .= ' LEFT JOIN snippets s on (s.id=cs.snippet_type_id)';\n $sql .= \" WHERE cs.id = $id\";\n $statement = $this->kernel->db->query( $sql );\n if ( !$statement )\n {\n $this->kernel->quit( 'DB Error: ' . array_pop($this->kernel->db->errorInfo()), $sql, __FILE__, __LINE__ );\n }\n $data = ($record = $statement->fetch()) ? array_merge($record, $data) : array();\n\n if ( count($data) == 0 )\n {\n // Set default values for new snippet\n $data['id'] = $id = 0;\n $data['snippet_type'] = $snippet_type;\n }\n else\n {\n if($record['general_para_value'] != '')\n $data['general_para_value'] = json_decode($record['general_para_value'], true);\n \n $snippet_type = $record['snippet_type'];\n\n // Group /para\\d/ into parameter groups\n if(isset($this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type]))\n {\n $data['group_paras'] = array();\n\t\t\t\t\tif(isset($data['general_para_value']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($data['general_para_value'] as $para=>$value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpreg_match('/^([a-zA-Z\\-_]+)(\\d+)$/i', $para, $matches);\n\t\t\t\t\t\t\tif(!empty($matches) && in_array($matches[1], $this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$data['group_paras'][$matches[2]][$matches[1]]=$value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n // Get locale values of snippet\n $parameter_locales = array();\n $sql = 'SELECT * FROM customize_snippet_locales WHERE snippet_id='.$id;\n $statement = $this->kernel->db->query( $sql );\n if ( !$statement )\n {\n $this->kernel->quit( 'DB Error: ' . array_pop($this->kernel->db->errorInfo()), $sql, __FILE__, __LINE__ );\n }\n while($record = $statement->fetch())\n {\n $data[$record['locale']] = json_decode($record['parameter_values'], true);\n $parameter_locales[] = $record['locale'];\n }\n\n // Group /para\\d/ into parameter groups\n if(isset($this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type]))\n {\n foreach($data as $locale=>&$paras)\n {\n if(in_array($locale, $parameter_locales))\n {\n $data[$locale]['group_paras'] = array();\n if(in_array($snippet_type, array('print_stories_whitepaper')))\n {\n foreach($this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type] as $group=>$items)\n {\n $data[$locale]['group_paras'][$group] = array();\n }\n\n foreach($paras as $para=>$value)\n {\n preg_match('/^([a-zA-Z\\-_]+)(\\d+)$/i', $para, $matches);\n if(!empty($matches))\n {\n foreach($this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type] as $group=>$items)\n {\n if(in_array($matches[1], $items))\n $data[$locale]['group_paras'][$group][$matches[2]][$matches[1]]=$value;\n }\n }\n }\n }\n else\n {\n foreach($paras as $para=>$value)\n {\n preg_match('/^([a-zA-Z\\-_]+)(\\d+)$/i', $para, $matches);\n if(!empty($matches) && in_array($matches[1], $this->kernel->dict['SET_snippet_parameter_groups'][$snippet_type]))\n {\n $data[$locale]['group_paras'][$matches[2]][$matches[1]]=$value;\n }\n }\n }\n }\n }\n }\n }\n $this->kernel->smarty->assign( 'snippet_type', $snippet_type );\n\n // BreadCrumb\n $this->_breadcrumb->push(new breadcrumbNode($this->kernel->dict[$id == 0 ? 'ACTION_new' : 'ACTION_edit']\n , $this->kernel->sets['paths']['mod_from_doc'] . '?op=edit' . ($id == 0 ? \"\" : (\"&id=\" . $id)))\n );\n\n // Assign data to view\n $this->kernel->smarty->assignByRef( 'data', $data );\n\n // Set page title\n if ( $id > 0 )\n {\n $this->kernel->dict['SET_operations']['edit'] = sprintf(\n $this->kernel->dict['SET_operations']['edit'],\n $data['name'].' [#'.$id.']'\n );\n $this->kernel->response['titles'][] = $this->kernel->dict['SET_operations']['edit'];\n }\n else\n {\n $this->kernel->dict['SET_operations']['new'] = sprintf(\n $this->kernel->dict['SET_operations']['new'],\n $this->kernel->dict['LABEL_new_snippet']\n );\n $this->kernel->response['titles'][] = $this->kernel->dict['SET_operations']['new'];\n }\n\n if($id > 0) {\n $info = array(\n 'created_date_message' => sprintf($this->kernel->dict['INFO_created_date'], '<b>' . $data['created_date'] . '</b>', '<b>' . $data['creator_user_name'] . '</b>', '<b>' . $data['creator_email'] . '</b>')\n );\n\n if($data['updated_date']) {\n $info['last_update_message'] = sprintf($this->kernel->dict['INFO_last_update'], '<b>' . $data['updated_date'] . '</b>', '<b>' . $data['updater_user_name'] . '</b>', '<b>' . $data['updater_email'] . '</b>');\n }\n\n $this->kernel->smarty->assign('info', $info);\n }\n\n $this->kernel->smarty->assign('default_locale', $this->kernel->default_public_locale);\n \n $this->kernel->smarty->assign('type_specific_form', $this->kernel->smarty->fetch( 'module/snippet_generator_admin/'.$snippet_type.'.html' ));\n $this->kernel->response['content'] = $this->kernel->smarty->fetch( 'module/snippet_generator_admin/edit.html' );\n }\n }", "function updateSmileyDisplayType($smileys, $display_type)\n{\n\t$db = database();\n\n\t$db->query('', '\n\t\tUPDATE {db_prefix}smileys\n\t\tSET \n\t\t\thidden = {int:display_type}\n\t\tWHERE id_smiley IN ({array_int:checked_smileys})',\n\t\t[\n\t\t\t'checked_smileys' => $smileys,\n\t\t\t'display_type' => $display_type,\n\t\t]\n\t);\n}", "private function updateToType($type, $id) {\n\t\t$data = array('type' => $type);\n\t\t$this->tipimail->putData($this->url . '/' . $id, $data);\n\t}", "public function testUpdateBundleItem()\n {\n }", "public function itg_save_remove_fcollection($c_type, &$inputs) {\n switch ($c_type) {\n case 'astro':\n if ($inputs['field_astro_type']['und'] == 224) {\n unset($inputs['field_astro_numerology_values']);\n unset($inputs['field_astro_zodiac']);\n }\n elseif ($inputs['field_astro_type']['und'] == 225) {\n unset($inputs['field_astro_zodiac']);\n }\n elseif ($inputs['field_astro_type']['und'] == 227) {\n unset($inputs['field_astro_numerology_values']);\n }\n else {\n unset($inputs['field_astro_numerology_values']);\n unset($inputs['field_astro_zodiac']);\n }\n break;\n }\n }", "function setCollectionClass($collectionClass);", "public function saveDocumentArray($collectionName,$criteria,$change_array){\n \n global $db;\n\n $collection = $db->$collectionName;\n \n $change_array = array('$set'=>$change_array); // set varible is imp to update only require field \n $collection->update($criteria,$change_array);\n \n }", "public function testUpdateJobTypeCustomFields()\n {\n }", "function learndash_course_extras_save_meta_box($post_id, $post, $update)\n{\n if (!in_array($post->post_type, array('sfwd-courses'))) {\n return;\n }\n\n if (wp_is_post_revision($post_id)) {\n return;\n }\n\n if (!isset($_POST['learndash_course_extra_nonce'])) {\n return;\n }\n\n if (!wp_verify_nonce($_POST['learndash_course_extra_nonce'], 'learndash_course_extra_save')) {\n wp_die(__('Cheatin\\' huh?'));\n }\n\n update_post_meta($post_id, '_learndash_course_cpe_credits', wp_filter_kses($_POST['learndash_course_cpe_credits']));\n update_post_meta($post_id, '_learndash_course_instructor', wp_filter_kses($_POST['learndash_course_instructor']));\n}", "function updateDivisionType1($data) {\n $id = $data['division_type_id'];\n $data = array(\n \"tbl_division_type_name\" => $data['division_type']\n );\n $where = array(\n \"id_division_type\" => $id\n );\n $this->db->__beginTransaction();\n $this->db->update(\"tbl_division_type\", $data, $where);\n $this->db->__endTransaction();\n return $this->db->status();\n }", "public static function updateContentType($modname=\"Content\")\n {\n $installerclass = $modname . \"_Installer\";\n $installer = new $installerclass;\n $legacyMap = $installer->LegacyContentTypeMap();\n\n $tables = DBUtil::getTables();\n $table = $tables['content_content'];\n $columns = $tables['content_content_column'];\n $where = \"WHERE \" . $columns['module'] . \"='\" . $modname . \"'\";\n $columnArray = array('id', 'module', 'type');\n $items = DBUtil::selectObjectArray($table, $where, '', -1, -1, '', null, null, $columnArray);\n\n foreach ($items as $item) {\n $newitem = $item;\n $newitem['type'] = in_array($item['type'], $legacyMap) ? $legacyMap($item['type']) : false;\n if ($newitem['type']) {\n DBUtil::updateObject($newitem, $table);\n }\n }\n return true;\n }", "function controller_change_column_type($column_id, $column_type){\n\t\tif($column_id!=NULL && $column_type!=NULL){\n\t\t\t$columnObj=new Column;\n\t\t\t$columnObj->column_id=$column_id;\n\t\t\t$columnObj->column_type=$column_type;\n\t\t\t$this->DB->db_column_set_type($columnObj);\n\t\t\techo \"Success!\";\n\t\t}else{\n\t\t\techo \"Error!\";\n\t\t}\n\t}", "public function testUpdateArtist()\n {\n }", "public function changeAdType(){\n\n if(!current_user_can('manage_options'))\n return;\n\n $new_type = $_GET['type'];\n if(isset($this->ad_types[$new_type]))\n $new_type = $this->ad_types[$new_type];\n\n $id = (int)$_GET['id'];\n\n $properties = array();\n parse_str($_GET['data'], $properties);\n\n foreach($new_type->getDefaults() as $field => $default)\n $properties[$field] = $default;\n\n $new_type->generateFormFields($id, $properties);\n exit;\n }", "function PostProcess_Type(&$item,&$updatedatas,$clot=array())\n {\n if (empty($clot)) { $clot=$this->LotsObj()->Lot_Current_Get();}\n\n if (empty($item[ \"Type\" ]) && !empty($clot))\n {\n $type=$this->LotsObj()->Lot_Default_Type_Get($clot);\n if ($type>0)\n {\n $item[ \"Type\" ]=$type;\n array_push($updatedatas,\"Type\");\n } \n }\n }", "public function run()\n {\n foreach($this->types as $type) {\n $type['slug'] = Str::slug($type['name']);\n CategoryTypes::updateOrCreate($type);\n }\n }", "function update()\n {\n\t$mtnWorkOrderType = Doctrine_Core::getTable('MtnWorkOrderType')->find($this->input->post('mtn_work_order_type_id'));\n\n\t$mtnWorkOrderType['mtn_work_order_type_name'] = $this->input->post('mtn_work_order_type_name');\n\t$mtnWorkOrderType['mtn_work_order_type_duration'] = $this->input->post('mtn_work_order_type_duration');\n\t$mtnWorkOrderType->save();\n\techo '{\"success\": true}';\n }", "public function setGameTypeId()\n {\n $draftGroupId = $this->getDraftGroupId();\n $gameTypeUrl = $this->buildDraftGroupUrl($draftGroupId, $this->gameTypeUrl);\n $client = new \\GuzzleHttp\\Client();\n $response = $client->request('GET', $gameTypeUrl);\n $gameTypeArray = json_decode($response->getBody(), true);\n\n $this->gameTypeId = $gameTypeArray['draftGroup']['gameTypeId'];\n }", "public function setRecordEditor($type, $id) {\n\t\t\t$this->recordEditor = $type;\n\t\t\t$this->recordEditorID = $id;\n\t\t}", "public function run()\n {\n $type = new Type;\n \t$type->name = \"Photo gallery\"; // 1\n \t$type->save();\n\n \t$type = new Type;\n \t$type->name = \"iframe\"; // 2\n \t$type->save();\n\n $type = new Type;\n $type->name = \"Text\"; // 3\n $type->save();\n\n $type = new Type;\n $type->name = \"Notification\"; // 4\n $type->save();\n\n $type = new Type;\n $type->name = \"Web page\"; // 5\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 6\"; // 6\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 7\"; // 7\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 8\"; // 8\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 9\"; // 9\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 10\"; // 10\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 11\"; // 11\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 12\"; // 12\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 13\"; // 13\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 14\"; // 14\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 15\"; // 15\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 16\"; // 16\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 17\"; // 17\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 18\"; // 18\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 19\"; // 19\n $type->save();\n\n $type = new Type;\n $type->name = \"Reserved 20\"; // 20\n $type->save();\n \t\n $type = new Type;\n $type->name = \"Catalog\"; // 21\n $type->save();\n\n $type = new Type;\n $type->name = \"Page\"; // 22\n $type->save();\n\n $type = new Type;\n $type->name = \"App\"; // 23\n $type->save(); \n\n $type = new Type;\n $type->name = \"User\"; // 24\n $type->save();\n\n $type = new Type;\n $type->name = \"Company\"; // 25\n $type->save();\n\n $type = new Type;\n $type->name = \"Offer\"; // 26\n $type->save();\n\n $type = new Type;\n $type->name = \"Custom\"; // 27\n $type->save();\n }", "public function update_language_content(){\n\t\tif ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } \n\t\t$language_content = $this->input->post('name_languages'); \n\t\t$document_id = $this->input->post('document_id');\n\t\t$updCond = array('_id' => MongoID($document_id ));\n\t\t$dataArr = array('name_languages' => $language_content); \n\t\t$this->documents_model->update_details(DOCUMENTS,$dataArr ,$updCond);\n\t\t$this->setErrorMessage('success', 'Language content updated successfully','language_content_updated_successfully');\n redirect(ADMIN_ENC_URL.'/documents/display_documents_list');\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set id_type=$this->id_type,description=\\\"$this->description\\\",password=\\\"$this->password\\\",product_id=$this->product_id where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update_id_type($id_type_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->update('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'ID type has been updated successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}" ]
[ "0.6039167", "0.5850399", "0.5827877", "0.56952924", "0.55846334", "0.5535978", "0.5497227", "0.5492172", "0.5417834", "0.54130733", "0.5401494", "0.5368614", "0.5304935", "0.528509", "0.5277902", "0.5277832", "0.52337044", "0.5228398", "0.52160525", "0.5214206", "0.5203051", "0.51777315", "0.5173601", "0.51693434", "0.512411", "0.5110668", "0.50978106", "0.50832176", "0.50704974", "0.5064775", "0.5029444", "0.5026161", "0.5016203", "0.501613", "0.5015094", "0.50107116", "0.49990544", "0.49875984", "0.498414", "0.4982229", "0.49804634", "0.49766347", "0.49764743", "0.49721462", "0.49711764", "0.4966923", "0.49621367", "0.49366102", "0.49340415", "0.492937", "0.4912204", "0.49111217", "0.4905989", "0.49056625", "0.4905016", "0.49047586", "0.4903676", "0.48960277", "0.4882064", "0.4881092", "0.48723885", "0.4862821", "0.4858708", "0.4836135", "0.4836028", "0.4834609", "0.4833324", "0.48293394", "0.4823083", "0.4820293", "0.48170155", "0.48143128", "0.4801933", "0.48015115", "0.47999585", "0.4799449", "0.47985953", "0.47930923", "0.47860575", "0.47853622", "0.47806942", "0.47718525", "0.47713086", "0.47710156", "0.4770741", "0.47699255", "0.47693816", "0.47589052", "0.47565085", "0.47535816", "0.47527948", "0.47487223", "0.47479814", "0.47439128", "0.4742811", "0.47413063", "0.47406504", "0.47367504", "0.47343734", "0.47285876" ]
0.79277724
0
Delete a Editor_collection_type by id
Удалить Editor_collection_type по id
public function delete($id) { $query="DELETE FROM editor_collection_type WHERE id=".$id; $this->executeQuery($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy($collection, $id)\n {\n //\n }", "public function deleteCollection();", "function custom_rules_delete_field_collection_item( $field_collection_item ){\n\t$field_collection_item->delete();\n}", "function budget_type_delete(budgetType $type) {\n $type->delete();\n}", "public function delete()\n\t{\n\t\tAuto_Modeler_ORM::factory('operation_type', $this->input->post('id'))->delete();\n\t\turl::redirect('operation_type/view_all');\n\t}", "public function deleteCollection(){ return $this->db->del( $this->collection, null, false); }", "public function type_delete($id)\n {\n if (get_permission('attachment_type', 'is_delete')) {\n if (!is_superadmin_loggedin()) {\n $this->db->where('branch_id', get_loggedin_branch_id());\n }\n $this->db->where('id', $id);\n $this->db->delete('attachments_type');\n }\n }", "public function deleteType($id) {\n $this->db->delete('types', array('id' => $id));\n }", "public function delete()\n\t{\n\t\tLMongo::collection($this->collection)->where('_id', $this->_id)->remove();\n\t}", "public function deleteAction($id, $type)\n { }", "public function delete($id) {\n \t//Delete the packType\n \t$this->getDb()->delete('t_packtype', array('packtype_id' => $id));\n }", "public function destroy($id)\n\t{\n\t\t$type = Type::find($id);\n $type->delete();\n return ['msg'=>'Type deleted successfully','success'=>true];\n\t}", "public function delete()\n {\n $this->call('admin/collections?action=DELETE&name='.$this->name);\n }", "public function collection_delete($obj) {\r\n\t\t$collections = new Collection();\r\n\t\t$collections->delete($obj->cusomter_id);\r\n\t}", "public function destroy($id)\n {\n //\n $collection_model = new \\App\\Models\\Collection;\n $collection_model = $collection_model::where('created_by', Auth::user()->id)->find($id);\n $collection_model->delete();\n\n Session::flash('success-message', \"Collection has been deleted successfully.\");\n return Redirect::to('/manage-collection');\n }", "function delDocument($id, $type, $typeID)\n {\n $select = \"DELETE FROM :documents WHERE :typeID = :id\";\n\t\t\t\n\t\t\t\n\t\t\tif ($type == 'c') {\n\t\t\t\t$select = \"DELETE FROM construction WHERE constructionID = :id\";\n\t\t\t} elseif ($type == 'd') {\n\t\t\t\t$select = \"DELETE FROM documents WHERE documentID = :id\";\n\t\t\t} elseif ($type == 's') {\n\t\t\t\t$select = \"DELETE FROM scheduling WHERE schedulingID = :id\";\n\t\t\t} else {\n\t\t\t\t$select = \"DELETE FROM punchlist WHERE punchID = :id\";\n\t\t\t}\n\t\t\t\n $statement = $this->_pdo->prepare($select);\n $statement->bindValue(':id', $typeID, PDO::PARAM_INT);\n $statement->execute();\n }", "public function actionDelete($id)\n {\n // $this->findModelCollection($id)->delete();\n $model = $this->findModelCollection($id);\n\n $modelcollectionloanitems = \\common\\models\\Collectionloanitems::find()->where(['CollectionLoan_id'=>$model->ID])->one();\n \n $modelcollections = \\common\\models\\Collections::findOne($modelcollectionloanitems->Collection_id);\n $modelcollections->Status_id = '1'; //Tersedia\n $modelcollections->JumlahEksemplar = '1';\n $modelcollections->IsVerified = '0';\n\n if ($modelcollections->save()) {\n $model->delete();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'info',\n 'duration' => 500,\n 'icon' => 'fa fa-info-circle',\n 'message' => Yii::t('app','Success Delete'),\n 'title' => 'Info',\n 'positonY' => Yii::$app->params['flashMessagePositionY'],\n 'positonX' => Yii::$app->params['flashMessagePositionX']\n ]);\n } \n \n return $this->redirect(['index']);\n\n }", "public function update($editor_collection_type)\n {\n $query=\"UPDATE editor_collection_type \".\n\t \"SET \".\n \"id= \".$editor_collection_type->id.\" ,\".\n \"name='\".$this->sqlSafe($editor_collection_type->name).\"',\".\n \"entity_type='\".$this->sqlSafe($editor_collection_type->entity_type).\"',\".\n \"parent= \".$editor_collection_type->parent.\" ,\".\n \"child_order= \".$editor_collection_type->child_order.\" ,\".\n \"description='\".$this->sqlSafe($editor_collection_type->description).\"',\".\n \"gid='\".$this->sqlSafe($editor_collection_type->gid).\"' \". \n\t \"WHERE id=\".$editor_collection_type->id;\n\n $this->executeQuery($query);\n }", "public function destroy($id)\n {\n Type::find($id)->delete();\n return redirect('admin/type');\n }", "public function destroy($type=\"\",$id=0)\n {\n if (\\Request::is('office/menu/delete/*')) {\n $param = explode('::',$type);\n if($param[1]==\"main\"){\n Navigation::where('slug',$param[0])->delete();\n }else{\n Navmenu::where('slug',$param[0])->delete();\n }\n }elseif (\\Request::is('office/resources/*/delete/*')) {\n DB::table($type)->where('id',$id)->delete();\n }\n return back()->with('success','Data deleted successfully!');\n }", "function delete($id) {\n $this->db->where('id', $id);\n $this->db->delete('typePersoon');\n }", "public function destroy($id)\n {\n $grouptype = GroupTypes::findOrFail($id);\n $grouptype->delete();\n\n return redirect()->route('admin.group_types.index')->with('success',\" تم حذف الفئة:$grouptype->name\");\n }", "public function delete($lichaamstypeId){\n $sql=\"delete from lichaamstypes where lichaamstypeId=:id\";\n $dbh=new PDO(DBCONFIG::$DB_CONNSTRING,DBCONFIG::$DB_USERNAME,DBCONFIG::$DB_PASSWORD);\n $stmt=$dbh->prepare($sql);\n $stmt->execute(array(':id'=>$lichaamstypeId));\n $dbh=null;\n\n }", "public function action_delete(){\n\t\t$id = $this->request->param('id');\n\t\tif($id){\n\t\t\t$supply_type = ORM::factory('SupplyType', $id)->where('delete_status','=','0');\n\t\t\tif ($supply_type->loaded()){\n\t\t\t\ttry{\n\t\t\t\t\t$supply_type->delete_status;\n\t\t\t\t\t$supply_type->save();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->_set_msg('Could not delete supply type because this would wipe their history!', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t\t$this->_set_content('supply_type_delete');\n\t}", "public function delete($id)\n {\n $query=\"DELETE FROM link_type WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "public function removeFromIndexByTypeAndId($type, $id);", "public static function delete(string $collection, string $id)\n {\n if (!array_key_exists($collection, self::$data)) {\n throw new \\Exception(\"Collection not found\", 1);\n }\n\n $items = self::$data[$collection];\n\n $key = array_search($id, array_column($items, 'id'));\n\n unset(self::$data[$collection][$key]);\n\n return self::$data[$collection];\n }", "public function destroy($id)\n\t{\n\t\t$type = Type::find($id);\n\n\t\tif( is_null($type) )\n\t\t{\n\t\t\treturn Redirect::to( 'type' );\n\t\t}\n\n\t\t$type->delete();\n\n\t\treturn Redirect::to( 'type' );\n\t}", "public function deleteCampaignsType($id){\n\t\t$Sql = \"DELETE FROM campaigns_types \n\t\t\t\tWHERE id_campaign_type=\".$id;\n\t\treturn connection::execute_query($Sql);\n\t}", "public function delete($id)\n {\n AuthorizationModel::mustAuthorized(PERMISSION_CONTAINER_TYPE_DELETE);\n\n $containerType = $this->containerType->getById($id);\n\n if ($this->containerType->delete($id, true)) {\n flash('warning', \"Container type {$containerType['container_type']} successfully deleted\");\n } else {\n flash('danger', 'Delete container type failed, try again or contact administrator');\n }\n redirect('master/container-type');\n }", "public function deleteCollection()\n {\n try {\n $response = $this->rekognition->deleteCollection(['CollectionId' => $this->faceCollectionId]);\n $this->echoVerbose($response);\n } catch (RekognitionException $e) {\n $this->echoVerbose( $e->getMessage() );\n exit(1);\n }\n }", "public function destroy($id)\n {\n $type = Expensetype::find($id);\n $type->delete();\n \n return redirect()->back()->with('success','Type List Delete Successfull');\n }", "public function delete_type_record($id){\r\n\t\t$this->db->where('tracking_type_id', $id);\r\n\t\t$this->db->delete('xin_goal_tracking_type');\r\n\t\t\r\n\t}", "public function destroy($id)\n {\n $type = Type::findOrFail($id);\n $type->estatud = 0;\n $type->save();\n }", "public function destroy($id, $type)\n {\n if($type == 'script'){\n $message = 'script';\n DB::table('orchardpools_scripts')->where('id', $id)->delete();\n }elseif($type == 'social'){// if second param is social\n $message = 'social media';\n DB::table('orchardpools_socials')->where('id', $id)->delete();\n }else{\n return back()->with('error', 'Something wrong.');\n }\n return back()->with('success', \"Succesfully delete $message.\");\n }", "public function destroy($id)\n {\n $posts = PostTypeRelation::where('type_id', $id)->first();\n if(isset($posts)) {\n return redirect()->route('admin.posttype.index')->with('warning', 'Không thể xóa vì có bài trong thể loại này!'); \n }\n $data = PostType::find($id);\n $data->delete();\n Cache::flush();\n return redirect()->route('admin.posttype.index')->with('success', 'Xóa thành công'); \n }", "public function destroy($id)\n {\n // //\n // $officeTypes = OfficeType::find($id);\n // $officeTypes->delete();\n\n // // redirect\n // Session::flash('message', 'Successfully deleted the nerd!');\n // return Redirect::to(route('officetypes.index'));\n }", "public function delete($entity_type_id, $bundle_id);", "public function destroy(CollectionLink $collectionLink, $id)\n {\n CollectionLink::where('id',$id)->delete();\n \n \\Session::flash('koleksi_delete','Data Koleksi Berhasil Dihapus');\n \n return redirect('/koleksi-link');\n }", "public function deleteById($id)\n {\n $this->type->deleteById($id);\n }", "private static function del_post($id) {\n $data = [\n \"tbl_posts\"=>[\n \"id\"=>$id\n ]\n ];\n return \\data\\collection::buildQuery(\"DELETE\", $data);\n }", "public function destroy($id)\n {\n if(!\\Auth::user()->can('type.delete'))\n return view('backend.partial.no-permission', ['title' => 'No-permission']);\n\n $delete = PropertyType::where(\"id\", $id)->first();\n\n if($delete->delete()){\n return redirect(route(\"administrator.property-type-listing\"))->with(\"success\", __(\"success-message\"));\n }\n\n return redirect()->back()->with(\"error\", __(\"error-message\"));\n }", "private function deleteMetadataType() {\n\t\t\n\t\t$metadataTypeId = $this->getParam('meta_id');\n\t\tif (!is_null($metadataTypeId) && is_numeric($metadataTypeId)) {\n\t\t\t// Verification of the request is done in the services.\n\t\t\tSettingsServices::deleteMetaDataType($metadataTypeId);\n\t\t}\n\t\t\n\t}", "public function DeleteTypeByID($id)\n {\n $sql = \"DELETE FROM `protypes` WHERE type_ID = $id\";\n // thuc thi cau truy van\n $result = self::$conn->query($sql);\n return $result;\n }", "function pf_delete_cpt( $id ) {\n \n if ( '' != $id ) { \n $cpts = pf_listar_cpt();\n if ( isset( $cpts[$id] ) ) {\n unset( $cpts[$id] );\n $send_json = json_encode( $cpts );\n update_option( PF_DB, $send_json );\n }\n\n }\n}", "public function destroyGeneral($type, $id)\n {\n $answersGeneral = AnswersGeneral::findOrFail($id);\n $questionsGeneral = QuestionsGeneral::findOrFail($answersGeneral->question_id);\n $qId = $answersGeneral->question_id;\n $qType = $answersGeneral->type;\n $answersGeneral->delete();\n $questionsGeneral->answers -= 1;\n $questionsGeneral->save();\n\n return redirect()->route('user.answers.index',[$qType, $qId]);\n }", "public function delete($id){\n\t\treturn parent::deleteBase($id,'code_language');\n\t}", "public function destroy($id)\n {\n //\n $document = DocumentType::findOrFail($id);\n\n $document->delete();\n\n Session::flash('deleted_document','The document type has been deleted');\n\n return redirect('/admin/lists/document');\n }", "function delete_expenseType($id)\n {\n return $this->db->delete('acc_expense_types',array('id'=>$id));\n }", "public function deleteSaleCollection($saleCollectionId)\n {\n if (isset($_POST[\"post\"])) {\n\n $data = json_decode($_POST[\"post\"],true);\n\n $model = new Model();\n\n /*deleting sale collection*/\n $stmt = $model->dbh->prepare(\"DELETE FROM tbl_sale_collections WHERE sale_collection_id=:sale_collection_id\");\n $response = $stmt->execute([\"sale_collection_id\"=>$saleCollectionId]);\n /*deleting sale collection*/\n\n $model = null;\n\n\n echo json_encode(array(\n \"response\"=>$response\n ));\n\n }\n }", "function LDAP_deleteID($type,$id)\n{\n\t$sql=\"DELETE FROM `$type\".\"IDs` WHERE $type\".\"ID=\\\"$id\\\"\";\n\tDB_query($sql);\n}", "public function destroy($id)\n {\n $memorialtype = MemorialType::find($id);\n $memorialtype->delete();\n }", "public function destroy($id)\n {\n Cancer_Type::find($id)->delete();\n return redirect()->route('cancer_types.index')\n ->with('success','Cancer Type deleted successfully');\n }", "public function deleteRoomType($id) {\n \n $query = \"DELETE \n FROM room_type\n WHERE roomTypeId=$id\";\n return SystemDatabaseManager::getInstance()->executeDelete($query,\"Query: $query\");\n }", "public function admin_delete_image($id, $type)\r\n\t{\r\n\t\t$validTypes = array('header', 'list');\r\n\t\t\r\n\t\tif (!in_array($type, $validTypes))\r\n\t\t{\r\n\t\t\t$this->redirect('/admin/categories/index/' . $id);\r\n\t\t}\r\n\t\t\r\n\t\t$record = $this->Category->findById($id);\r\n\t\t\r\n\t\t@unlink($record['Category'][$type . '_root_path']);\r\n\t\t\r\n\t\t$this->Category->id = $id;\r\n\t\t$this->Category->saveField('img_' . $type . '_ext', '', false);\r\n\t\t\r\n\t\t$this->Session->setFlash('Category ' . $type . ' image deleted.', 'default', array('class' => 'success'));\t\t\r\n\t\t$this->redirect('/admin/categories/index/' . $id);\r\n\t\t\r\n\t}", "private static function del_page($id) {\n $data = [\n \"tbl_pages\"=>[\n \"id\"=>$id\n ]\n ];\n return \\data\\collection::buildQuery(\"DELETE\", $data);\n }", "public function destroy($id)\n {\n $cuti = CutiType::findOrFail($id);\n\n $cuti->delete();\n\n return redirect()->route('admin.cuti-type.index'); \n \n }", "public function actionDelete($type, $id)\n {\n // try to get active record by type\n $record = null;\n switch ($type) {\n case 'post':\n $record = FeedbackPost::find($id);\n break;\n case 'answer':\n $record = FeedbackAnswer::find($id);\n break;\n }\n\n // check if we get the row\n if ($record === null || $record === false) {\n throw new NotFoundException(__('Feedback item is not founded'));\n }\n\n // if delete is submited\n if ($this->request->request->get('deleteFeedback')) {\n // remove all answers\n if ($type === 'post') {\n FeedbackAnswer::where('feedback_id', '=', $record->id)->delete();\n // remove item\n $record->delete();\n App::$Session->getFlashBag()->add('success', __('Feedback record is successful removed'));\n $this->response->redirect('feedback/index');\n } else {\n // its a answer, lets remove it and redirect back in post\n $postId = $record->feedback_id;\n $record->delete();\n $this->response->redirect('feedback/read/' . $postId);\n }\n }\n\n // render view\n return $this->view->render('delete', [\n 'type' => $type,\n 'record' => $record\n ]);\n }", "function DeleteType() {\n\t\t\n\t\tglobal $dbh;\n\t\t\n\t\t$sql=\"DELETE FROM fac_MediaTypes WHERE MediaID=\".intval($this->MediaID);\n\t\t\n\t\treturn $dbh->exec( $sql );\n\t}", "public function testRemoveCollection() {\r\n $this->initContext();\r\n $collection = new RestoCollection('Example', $this->context, $this->admin, array('autoload' => true));\r\n $collection->removeFromStore();\r\n \r\n $collection = new RestoCollection('Land', $this->context, $this->admin, array('autoload' => true));\r\n $collection->removeFromStore();\r\n }", "public function destroy($id)\n {\n $deleteType = Type::find($id);\n $deleteType->delete();\n return redirect()->back();\n }", "public static function deleteById($collection, $id)\n {\n $creteria = array('_id' => new \\MongoId($id));\n return MongoDao::deleteList($collection, $creteria);\n }", "function repec_delete_association($content_type, $series_name, $field_content_type = NULL, $field_series = NULL) {\n\n $query = db_delete('repec_assoc')\n ->condition('content_type', $content_type)\n ->condition('series_name', $series_name);\n\n if ($field_content_type != NULL) {\n $query->condition('field_content_type', $field_content_type);\n }\n if ($field_series != NULL) {\n $query->condition('field_series', $field_series);\n }\n\n $query->execute();\n}", "function remove($id) { \r\n $query = $this->db->prepare('DELETE FROM categoria WHERE id = ?');\r\n $query->execute([$id]);\r\n }", "function delete(){\n $db = new db();\n $db->delete('widgets', array('id',$this->widget_id));\n\n }", "public function deleteById($boxId);", "static function deleteForItemtype($itemtype) {\n global $DB;\n\n $DB->delete(\n self::getTable(), [\n 'itemtype' => ['LIKE', \"%Plugin$itemtype%\"]\n ]\n );\n }", "static function deleteForItemtype($itemtype) {\n global $DB;\n\n $DB->delete(\n self::getTable(), [\n 'itemtype' => ['LIKE', \"%Plugin$itemtype%\"]\n ]\n );\n }", "private function _del($id)\n {\n $jobtype = $this->job_type_model->get_info($id);\n if(!$jobtype)\n {\n //tạo ra nội dung thông báo\n $this->session->set_flashdata('message', 'không tồn tại sản phẩm này');\n redirect(admin_url('job_type'));\n }\n //thuc hien xoa san pham\n $this->job_type_model->deleteOne($id);\n }", "function delete($id)\r\n\t{\r\n // Before deleting definition I need to remove values\r\n if( $this->is_used($id) )\r\n {\r\n $this->remove_all_scopes_values($id);\r\n\t\t}\r\n\t\t$linked_tprojects = $this->get_linked_testprojects($id);\r\n\t\tif( !is_null($linked_tprojects) && count($linked_tprojects) > 0 )\r\n\t\t{\r\n\t\t $target=array_keys($linked_tprojects);\r\n\t\t foreach($target as $tproject_id)\r\n\t\t {\r\n $this->unlink_from_testproject($tproject_id,(array)$id);\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\t$sql=\"DELETE FROM \".$this->db->get_table('cfield_node_types').\" WHERE field_id={$id}\";\r\n\t\t$result=$this->db->exec_query($sql);\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t$sql=\"DELETE FROM \".$this->db->get_table('custom_fields').\" WHERE id={$id}\";\r\n\t\t\t$result=$this->db->exec_query($sql);\r\n\t\t}\r\n\t\treturn $result ? 1 : 0;\r\n\t}", "function delete_actualisation($id)\n\t{\n\t\tocf_delete_custom_field(intval($id));\n\t}", "public function deleteDocumentSettings($id) {\n $doc_type = DocType::find($id);\n $doc_type->delete();\n return redirect()->back();\n }", "public function delete($id)\n\t{\n\t\tif ($this->posttype->delete($id))\n\t\t{\n\t\t\t$message = Lang::get('ninjaparade/content::posttypes/message.success.delete');\n\n\t\t\treturn Redirect::toAdmin('content/posttypes')->withSuccess($message);\n\t\t}\n\n\t\t$message = Lang::get('ninjaparade/content::posttypes/message.error.delete');\n\n\t\treturn Redirect::toAdmin('content/posttypes')->withErrors($message);\n\t}", "public function destroy($id)\n {\n try {\n $typeDocument = TypeDocument::find($id);\n $typeDocument->delete();\n\n return redirect()->action('TypeDocumentController@index')\n ->with('success', trans('session.typedoc_delete_success'));\n } catch(Exception $e) {\n return redirect()->action('TypeDocumentController@index')\n ->with('errors', trans('session.typedoc_delete_fail'));\n }\n }", "function supprimerType($id)\n{\n\n\t$reussi = false;\n\t\n\t$pdo = connexion();\n\t\n\tif($pdo != false)\n\t{\n\t\n\t\t$id = $pdo -> quote($id);\n\t\t\n\t\t\n\t\t\n\t\t$req = \"\n\t\t\t\t\tDELETE FROM type\n\t\t\t\t\tWHERE IdType = $id\n\t\t\t\t\t\n\t\t\t\t\";\n\t\t\n\t\t$res = $pdo -> exec($req);\n\t\t\n\t\tif($res == 1)\n\t\t{\n\t\t\n\t\t\t$reussi = true;\n\t\t\n\t\t}\n\t\t\n\t}\n\n\treturn $reussi;\n\n}", "public function del( $id );", "function theme_delete_form ($type, $id) {\n return theme('form', delete_form($type, $id));\n}", "public function remove($id)\n {\n if (count($this->types) == 1) {\n $params = [\n 'index' => $this->getManager()->getConnection()->getIndexName(),\n 'type' => $this->types[0],\n 'id' => $id,\n ];\n\n $response = $this->getManager()->getConnection()->delete($params);\n\n return $response;\n } else {\n throw new \\LogicException('Only one type must be specified for the find() method');\n }\n }", "public static function Delete($id){\r\n\t\t$query = new Query();\r\n\t\t$query->createDelete('boxes', $id);\r\n\t\treturn $query->execute();\r\n\t}", "public function destroy($id)\n {\n //\n NewsType::find($id)->delete();\n return redirect('/admin/news_type');\n }", "public function destroy($id)\n {\n $pp = PropertyType::find($id);\n $pp->delete();\n return redirect('/property_type')->with('success', 'Property type has been deleted succesfully');\n }", "public function destroy($id)\n {\n DB::beginTransaction();\n\n try {\n Type::where('id', $id)->delete();\n DB::commit();\n return redirect()->route('sales.admin.types.index');\n\n\n } catch (\\Exception $e) {\n echo 'Process Failed';\n }\n }", "public function delete(){\n echo $this->del(set_value('id'));\n }", "function content_type_delete($info) {\n // Don't delete data for content-types defined by disabled modules.\n if (!empty($info->disabled)) {\n return;\n }\n\n // TODO : What about inactive fields ?\n // Currently, content_field_instance_delete doesn't work on those...\n $fields = content_field_instance_read(array('type_name' => $info->type));\n foreach ($fields as $field) {\n content_field_instance_delete($field['field_name'], $info->type, FALSE);\n }\n $table = _content_tablename($info->type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE);\n if (db_table_exists($table)) {\n $ret = array();\n db_drop_table($ret, $table);\n watchdog('content', 'The content fields table %name has been deleted.', array('%name' => $table));\n }\n // Menu needs to be rebuilt as well, but node types need to be rebuilt first.\n // node_type_form_submit() takes care of this.\n content_clear_type_cache(TRUE);\n}", "public function deleteItem(int|string $id): JsonApiResponse|Response|JsonApiObject|JsonApiCollection;", "public function destroy($id)\n\t{\n\t\t$this->pointtype->find($id)->delete();\n\n\t\treturn Redirect::route('admin.pointtypes.index');\n\t}", "public function delete(){\n $id = $_POST['id'];\n\n Fullcalendarevento::destroy($id);\n }", "public function testDELETE_collection() {\r\n $this->initContext();\r\n \r\n $restoRouteDELETE = new RestoRouteDELETE($this->context, $this->admin);\r\n $segments = array('collections', 'Landsat');\r\n $res = $restoRouteDELETE->route($segments);\r\n $this->assertEquals('success', $res['status']);\r\n }", "public function delete($id)\n {\n $query=\"DELETE FROM event_alias_type WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "public function action_delete() {\n $id = $this->request->param('id');\n $todelete = ORM::factory(\"Post\", $id)->find();\n if ($todelete->loaded()) {\n try {\n $todelete->delete();\n $this->redirect(\"/\");\n } catch (ORM_Validation_Exception $ex) {\n $this->render_error($ex->getMessage());\n }\n }\n }", "public function delete(Request $request){\n\n $this->validate($request,[\n 'id' => 'required|exists:types,id',\n ]);\n\n if(!$type = Type::find($request->id)){\n\n return response()->json([\n 'status' => false\n ]);\n }\n $type->delete();\n return response()->json([\n 'status' => true\n ]);\n\n }", "public function deleteCollection(Sunny_DataMapper_CollectionAbstract $collection)\n\t{\n\t\t$this->getDbTable()->delete($collection->getIdentifiers());\n\t}", "function Contact_TypesdeleteFromID($nID){\n\t//Our object declaration\n\t$oContact_Types = new Contact_Types();\n\t\n\t/* Don't forget to override to use $oAgent !!! */\n\t\n\t//if the set is possible : delete it !\n\tif($oContact_Types->setId_Contact_Types($nID))\n\t\treturn $oContact_Types->deleteMyselfId_Contact_Types($nID);\n\t//Failed end\n\treturn false;\n}", "public function destroy($id)\n {\n // Проверить - нет ли категорий, к которым привязан этот тип\n $existing_check = Modules\\Product\\Entities\\ProductCategory::where('category_type_id', $id)->get();\n\n $categoryType = CategoryType::find($id);\n $categoryType->delete();\n }", "function delete_expenseSubtype($id)\n {\n return $this->db->delete('acc_expense_sub_types',array('id'=>$id));\n }", "public function delete($id = null) {\n\t\t$this->LocationsType->id = $id;\n\t\t$this->autoRender = FALSE;\n\t\tif (!$this->LocationsType->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid locations type'));\n\t\t}\n\t\t\n\t\t$this->request->onlyAllow('post', 'delete');\n\t\t$result = array();\n\t\tif(is_numeric($id)){\n\t\t\t$result = $this->ApiClient->CallFunction('#configurations.location_type_delete',array('id'=>$id));\n\t\t}else{\n\t\t\techo \"<script>alert('Type of Locations was not deleted with not valid parameter.');</script>\";\n\t\t}\n\t\n\t\tif(!empty($result)){\n\t\t\tif($result[0] == \"Y\"){\n\t\t\t\t$this->redirect(array('action'=>'index'));\n\t\t\t}else{\n\t\t\t\techo \"<script>alert('{$result[\"0\"]}');</script>\";\n\t\t\t}\n\t\t}\n\t}", "public function destroy($id)\n {\n $newsType = NewsletterType::find($id);\n \n $type->deleted = 1;\n $type->active = 0; \n \n $newsType->save();\n \n return redirect()->route('newsletter-type.index');\n }", "public function del($id)\n {\n\n }", "function delete_post_type(){\nunregister_post_type( 'pet' );\n}", "function delete_post($post_ID) {\r\n\t\\ESWP\\Client::delete_doc($post_ID, new \\ESWP\\MyTypes\\Posts());\t\r\n}" ]
[ "0.6674343", "0.6525383", "0.6476703", "0.6467488", "0.63993686", "0.63451725", "0.63415605", "0.6330792", "0.6301027", "0.62986326", "0.626016", "0.62274694", "0.6217866", "0.61953366", "0.6131196", "0.60716736", "0.6017011", "0.60127836", "0.59595937", "0.59387547", "0.59260607", "0.591987", "0.5919813", "0.58932203", "0.5892383", "0.5890092", "0.5889134", "0.58657956", "0.58652985", "0.5847266", "0.5844155", "0.5838738", "0.58368945", "0.5827997", "0.5804073", "0.57988656", "0.57748914", "0.5766649", "0.57646984", "0.5748991", "0.573948", "0.57368785", "0.5735974", "0.57195175", "0.57169193", "0.5708332", "0.5707686", "0.5700058", "0.56897956", "0.56794834", "0.5678156", "0.5672135", "0.5663343", "0.56602556", "0.5658964", "0.5654064", "0.56516236", "0.564975", "0.5647148", "0.56404144", "0.56339407", "0.5631439", "0.56302786", "0.56290555", "0.56251997", "0.5624252", "0.5623904", "0.5623904", "0.5618342", "0.5615398", "0.56083524", "0.56049293", "0.5597217", "0.55966675", "0.55874205", "0.55871856", "0.5583756", "0.55759287", "0.55648077", "0.55613106", "0.5555824", "0.55521613", "0.5544828", "0.5537062", "0.55368143", "0.55317223", "0.5531178", "0.55304474", "0.55289656", "0.55278146", "0.5524201", "0.5523285", "0.552324", "0.5522544", "0.5515229", "0.55137235", "0.55099297", "0.5509181", "0.5506412", "0.5504467" ]
0.83106714
0
Returns a mapper instance identified by $identifier. $identifier is either a service ID of a service defined in the Symfony dependency container or a fully qualified class name. Implementations may also define additional types of identifiers.
Возвращает экземпляр маппера, идентифицированный $identifier. $identifier может быть либо идентификатором сервиса, определенного в контейнере зависимостей Symfony, либо полным именем класса. Реализации могут также определять дополнительные типы идентификаторов.
public function getMapper($identifier);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMapping($identifier)\n {\n return $this->getEntityRepository()->findBy(array('identifier' => $identifier));\n }", "public static function from($identifier);", "public function getInstance($identifier)\n {\n if (!array_key_exists($identifier, $this->instances)) {\n $this->instances[$identifier] = $this->createInstance($identifier);\n }\n\n return $this->instances[$identifier];\n }", "public function findByIdentifier($identifier)\n {\n return $this->get($identifier, $this->identifierBundle);\n }", "public static function service(string $identifier)\n {\n return static::$container->get($identifier);\n }", "public function retrieveByID( $identifier )\n\t{\n\t\treturn $this->_getMapper()->findById( $identifier );\n\t}", "public static function findByIdentifier($identifier)\n {\n return static::findOne(['identifier' => $identifier]);\n }", "public function get($identifier);", "public function findByIdentifier($identifier)\n {\n return $this->getConnection()->table($this->getTableName())\n ->where('identifier', $identifier)\n ->first();\n }", "public function identifier($identifier)\n {\n return $this->setProperty('identifier', $identifier);\n }", "public function identifier($identifier)\n {\n return $this->setProperty('identifier', $identifier);\n }", "abstract protected function instantiateMapper(ServiceLocator $locator, string $mapperClass): Mapper;", "public function getResolverClass($filesystem, $identifier);", "abstract protected function createInstance($identifier);", "public function retrieveById($identifier)\n {\n return $this->find($identifier);\n }", "public function retrieveById($identifier)\n {\n return $this->repository->find($identifier);\n }", "public function retrieveById($identifier)\n {\n return $this->getRepository()->find($identifier);\n }", "public static function find($identifier)\n {\n $params = [\n 'Identifier' => $identifier\n ];\n\n $full_class = get_called_class();\n $base_class = substr(get_called_class(), strrpos(get_called_class(), '\\\\') + 1);\n\n $data = self::sendRequest(strtolower($base_class), 'show', $params);\n\n if (!strcmp($data['status'], 'success')) {\n return new $full_class($data[strtolower($base_class)]);\n }\n\n return null;\n }", "public function get(string $identifier)\n {\n $streamName = $this->streamNameResolver->getStreamNameForAggregateTypeAndIdentifier($this->aggregateClassName, $identifier);\n $eventStore = $this->eventStoreManager->getEventStoreForStreamName($streamName);\n $eventStream = $eventStore->get(new StreamNameFilter($streamName));\n\n if (!class_exists($this->aggregateClassName)) {\n throw new AggregateRootNotFoundException(sprintf(\"Could not reconstitute the aggregate root %s because its class '%s' does not exist.\", $identifier, $this->aggregateClassName), 1474454928115);\n }\n if (!is_subclass_of($this->aggregateClassName, EventSourcedAggregateRootInterface::class)) {\n throw new AggregateRootNotFoundException(sprintf(\"Could not reconstitute the aggregate root '%s' with id '%s' because it does not implement the EventSourcedAggregateRootInterface.\", $this->aggregateClassName, $identifier, $this->aggregateClassName), 1474464335530);\n }\n\n return call_user_func($this->aggregateClassName . '::reconstituteFromEventStream', $identifier, $eventStream);\n }", "public function loadByIdentifier(string $identifier);", "public function findByIdentifier($identifier)\n {\n return $this->findBy('external_identifier', $identifier);\n }", "public function findById($identifier)\n {\n }", "protected static function getReader(?string $identifier): ReaderInterface\n {\n if (!isset(static::$identifiers[$identifier])) {\n throw new \\RuntimeException('Unknown identifier \"' . $identifier . '\" for a configuration file.');\n }\n\n $readerClass = static::$identifiers[$identifier];\n\n return new $readerClass();\n }", "public function retrieveById($identifier);", "public function retrieveById($identifier);", "public function GetByIdentifier($identifier)\t{\n\t\t// Load component by identifier\n\t\treturn FactoryDao::ComponentDao()->GetFilteredList(QueryParameter::Where('Identifier', $identifier))->Single();\n\t}", "public static function parse($identifier);", "protected function mappedTransformerClass(string $identifier)\n {\n return $this->availableRelations()[$identifier] ?? null;\n }", "public function __get($identifier)\n {\n if (isset($this->components[$identifier])) {\n return $this->components[$identifier];\n }\n }", "public function get ( $identifier );", "public function retrieveById($identifier) {\n $result = $this->createModel()->newQuery()->getQuery()\n ->r()->get($identifier)->run();\n\n $result = $this->hydrate($result);\n\n if( $result )\n $result = $result->first();\n\n return $result;\n }", "public function retrieveById($identifier)\n {\n }", "public function retrieveById($identifier)\n {\n }", "protected function findObjectByIdentifier($identifier)\n {\n return $this->plugins[$identifier];\n }", "public function make( $type, $identifier ) {\n\t\tforeach ( $this->factories as $factory ) {\n\t\t\tif ( $factory->get_slug() === $type ) {\n\t\t\t\treturn $factory->make( $identifier );\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function retrieveById( $identifier );", "public function get_mapper($slug) {\n\t\t\n\t\tif ( $this->mapper_exists($slug) ) {\n\n\t\t\t$mappers = $this->get_mappers();\n\n\t\t\t$className = $mappers[$slug];\n\n\t\t\treturn new $className();\n\n\t\t}\n\n\t\treturn false;\n\t}", "public static function name($identifier)\n {\n list($package, $element) = static::parse($identifier);\n return $package;\n }", "public function getService($identifier);", "public function retrieveById($identifier)\n {\n $driverName = Config::get('roycedb.driver.name');\n\n if ($driverName == \"adldap\") {\n return $this->fallback->retrieveById($identifier);\n }\n\n $model = $this->createModel();\n\n return $model->newQuery()\n ->where($model->getAuthIdentifierName(), $identifier)\n ->first();\n \n }", "public function find($identifier);", "public function retrieveById($identifier)\n {\n $model = $this->createModel();\n\n $key = $model->getAuthIdentifierName();\n if ($key &&\n is_array($key)\n ) {\n $key = $key[0];\n }\n\n return $this->newModelQuery($model)\n ->where($key, $identifier)\n ->first();\n }", "public function retrieveById($identifier)\n {\n return new User([\n 'id' => 1\n ]);\n }", "public function createParsedIdentifier(\n PositionInterface $position,\n SchemaIdentifierInterface $identifier\n ): ParserIdentifierInterface;", "public function get($identifier, $key = null)\n {\n if (! isset($this->map[$identifier])) {\n return null;\n }\n\n if ($key) {\n return $this->map[$identifier][$key];\n }\n\n return $this->map[$identifier];\n }", "public function getProxy(string $identifier): Proxy\n {\n return $this->proxies[$identifier];\n }", "public function set_identifier(string $identifier)\n {\n $this->identifier = $identifier;\n return $this;\n }", "public function identify($identifier) {\n\n\t\tif(!empty($this->_people_id)) {\n\t\t\treturn $this->_people_id;\n\t\t}\n\n\t\t$this->_transport->setEndpoint('people/identify');\n\n\t\t$data = [\n\t\t\t'identifier' => $identifier\n\t\t];\n\n\t\tif(!empty($this->_visitor_id)) {\n\t\t\t$data['visitor_id'] = $this->_visitor_id;\n\t\t}\n\n\t\t$response = $this->_transport->execute($data);\n\n\t\t$this->_people = $response['people'];\n\n\t\t$this->_type = 'people';\n\n\t\treturn $this->_people_id = $response['people_id'];\n\t}", "public function setIdentifier(string $identifier): ClassMetadataInterface\n {\n $this->identifier = $identifier;\n\n return $this;\n }", "public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n return $this;\n }", "public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n return $this;\n }", "public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n return $this;\n }", "public function __construct($identifier)\n {\n $this->identifier = $identifier;\n }", "public function __construct($identifier)\n {\n $this->identifier = $identifier;\n }", "public function __construct($identifier)\n {\n $this->identifier = $identifier;\n }", "public function setIdentifier($identifier) {\n $this->identifier = $identifier;\n return $this;\n }", "public function __construct($identifier)\r\n {\r\n $this->setIdentifier($identifier);\r\n }", "public function __construct($identifier)\n {\n $this->setIdentifier($identifier);\n }", "public function getProductByIdentifier(string $identifier);", "public function retrieveById($identifier)\n {\n\n \\Log::info('retrieveById START ... identifier: ' . $identifier);\n\n// $attributes = array(\n// 'id' => '359-k',\n// 'username' => '359-k',\n// 'password' => \\Hash::make('SuperSecret'),\n// 'name' => 'Dummy User 1',\n// );\n//\n// $user = new CustomUser($attributes);\n//\n// return $user;\n\n $user = MyUser::find($identifier);\n return $user;\n\n }", "public function getByIdentifier($identifier)\n {\n return Cache::rememberForever( config('surl.cache_prefix') . $identifier, function () use ($identifier) {\n return SurlModel::whereIdentifier($identifier)->first();\n });\n }", "public function retrieveById($identifier)\n {\n $model = $this->createModel();\n\n return $this->newModelQuery($model)\n ->where($model->getAuthIdentifierName(), $identifier)\n ->first();\n }", "public function getMapper( $className )\n { \n if ( ! array_key_exists( $className, $this->mapperRegistry ) )\n {\n throw new Exception('No mapper found for class ' . $className);\n }\n \n if ( ! class_exists( $className ) )\n {\n throw new Exception( $className . ' not declared' );\n }\n \n return $this->mapperRegistry[$className];\n }", "protected function __construct($identifier) {}", "public function parseIdentifier($identifier)\n {\n if (preg_match('/^([\\w]+)\\.(.*)$/', $identifier, $matches)) {\n return [\n 'model' => $matches[1],\n 'foreign_key' => $matches[2],\n ];\n }\n\n return $identifier;\n }", "public function getMapper($entity): MapperInterface;", "public static function findByLoginId($identifier) {\n\t\treturn self::where('email', '=', $identifier)->first();\n\t}", "public function retrieveById($identifier) {\n \t$m = $this->modelName;\n \treturn $m::findForAuth($identifier);\n }", "public function retrieveByID($identifier)\n\t{\n\t\tforeach ($this->getLoginPool() as $login) {\n\t\t\tif ($login[$this->identifier] == $identifier) {\n\t\t\t\treturn new GenericUser($login);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function create($identifier);", "public function retrieveById($identifier)\n {\n $user = User::query()->where(\"name\",\"=\",$identifier)->first();\n\n if($user==null){\n $user= $this->ldap->getDefaultProvider()->search()->users()->users($identifier);\n }\n return $user;\n }", "public function setIdentifier($identifier);", "public function setIdentifier($identifier);", "public function retrieveById($identifier)\n {\n return Account::where($this->identificator, $identifier)\n ->first();\n }", "public function getApiResourcePersisterInstance(string $identifier): ApiResourcePersisterInterface\n {\n throw new BadConfigurationException('This call is not supposed to be called');\n }", "protected function identifierOf($identifier)\n {\n $identifier = strtolower($identifier);\n \n if (preg_match('/^(.+) as (.+)$/', $identifier)) {\n return $this->identifierWithAsKeywordOf($identifier);\n }\n \n if (strpos($identifier, '.') !== false) {\n return $this->identifierWithDotOf($identifier);\n }\n \n return $this->insensitive . trim($identifier) . $this->insensitive;\n }", "public function setIdentifier(string $identifier): self\n {\n $this->identifier = $identifier;\n\n return $this;\n }", "protected function mapper($name)\n\t{\n\t\tif (!isset($this->mappers[$name])) {\n\t\t\tif (isset($this->params['relations'][$name])) {\n\t\t\t\t// create mapper\n\t\t\t\t$mapper = $this->mapperFactory->__invoke($this->params['relations'][$name][0]);\n\t\t\t\t// set origin\n\t\t\t\t$mapper->origin($this, $name);\n\t\t\t} else {\n\t\t\t\t$mapper = null;\n\t\t\t}\n\n\t\t\t// add it to the mappers\n\t\t\t$this->mappers[$name] = $mapper;\n\t\t}\n\t\treturn $this->mappers[$name];\n\t}", "public function __construct($identifier, $name);", "public function setIdentifier(?string $identifier): self\n {\n $this->identifier = $identifier;\n\n return $this;\n }", "public function instantiateAutoMapper($config) : AutoMapper\n {\n return new AutoMapper($config);\n }", "public function retrieveById($identifier)\n {\n // stored procedure name\n $findUserProcedure = $this->config->get(\n 'ytake-laravel-voltdb.default.auth.procedure.findUser', $this->findUserProcedure);\n $user = $this->connection->procedure($findUserProcedure, [$identifier]);\n\t\tif (!is_null($user)) {\n return new VoltDBUser((array) $user, $this->config);\n }\n }", "public function getMapper($typ)\n {\n switch (strtolower($typ)) {\n\n case self::LEAGUE_MAPPER:\n $repository = new Mapper\\LeagueMapper();\n break;\n\n case self::SEASON_MAPPER:\n $repository = new \\Season\\Mapper\\SeasonMapper();\n break;\n\n case self::SCHEDULE_MAPPER:\n $repository = new Mapper\\ScheduleMapper();\n break;\n\n case self::RESULT_MAPPER:\n $repository = new Mapper\\ResultMapper();\n break;\n\n default:\n throw new \\RuntimeException(\n sprintf('An unknown mapper type was provided.')\n );\n }\n\n $repository->setEntityManager($this->entityManager);\n return $repository;\n }", "public function __construct($identifier = null)\n {\n $this->identifier = $identifier;\n }", "public function mapper($suffix)\n\t{\n\t\t$class = $this->factory()->mapper($this->type(), $suffix);\n\n\t\tif ( ! isset($this->mappers[$class]))\n\t\t{\n\t\t\t$mapper = new $class;\n\n\t\t\tif ($mapper instanceOf ContainerSetGet)\n\t\t\t{\n\t\t\t\t$mapper->container($this);\n\t\t\t}\n\n\t\t\tif ($mapper instanceOf ConnectionSetGet)\n\t\t\t{\n\t\t\t\t$mapper->connection($this->connection());\n\t\t\t}\n\t\t\t\n\t\t\tif ($mapper instanceOf IdentitiesSetGet)\n\t\t\t{\n\t\t\t\t$mapper->identities($this->identities());\n\t\t\t}\n\t\t\t\n\t\t\tif ($mapper instanceOf ConfigSetGet)\n\t\t\t{\n\t\t\t\t$mapper->config($this->mapperConfig());\n\t\t\t}\n\n\t\t\tif ($mapper instanceOf FactorySetGet)\n\t\t\t{\n\t\t\t\t$mapper->factory($this->factory());\n\t\t\t}\n\n\t\t\t$this->mappers[$class] = $mapper;\n\t\t}\n\n\t\treturn $this->mappers[$class];\n\t}", "public static function ident($identifier) {\n return _QueryIdentifier::create($identifier);\n }", "public function retrieveById($identifier)\n {\n $class = $this->userClass;\n\n return $class::query(true)->find($identifier) ?: null;\n }", "static public function retrieveByIdentifier($identifier, PropelPDO $con = null)\n {\n $criteria = new Criteria();\n\n $criteria->add(self::IDENTIFIER, $identifier);\n\n return self::doSelectOne($criteria, $con);\n }", "public function retrieveById($identifier)\n {\n return User::find($identifier);\n }", "public function retrieveById($identifier)\n {\n return \\Cache::remember(\"users.$identifier\", 3600, function () use ($identifier) {\n \\Log::info($identifier);\n return parent::retrieveById($identifier);\n });\n }", "public function getTranslator($identifier, $config = array()) {\n if (is_string($identifier)) {\n $translator = new KServiceIdentifier($identifier);\n }\n elseif ($identifier instanceof KServiceIdentifierInterface) {\n $translator = clone $identifier;\n }\n else {\n throw new KTranslatorException('Invalid identifier');\n }\n \n // If you omit the path in modules KServiceLocatorModule assumes it's a view. Hence:\n if ($translator->type === 'mod') {\n $translator->path = array('translator');\n $translator->name = '';\n } else {\n $translator->path = array();\n $translator->name = 'translator';\n }\n \n \n \n return $this->getService($translator);\n }", "public function server(string $identifier = ''): Server\n\t{\n\t\tif(empty($identifier))\n\t\t{\n\t\t\treturn $this->_servers[$this->_active_server_id];\n\t\t}\n\t\telseif(isset($this->_servers[$identifier]))\n\t\t{\n\t\t\treturn $this->_servers[$identifier];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\Exception('Server with provided Identifier not found.', Codes::CACHE_IDENTIFIER_MISSING);\n\t\t}\n\t}", "public function createMapper(ServiceLocatorInterface $serviceLocator);", "public static function byId($identifier, $class = 'samson\\cms\\CMSMaterial')\n {\n // Convert id to array\n $identifier = is_array($identifier) ? $identifier : array($identifier);\n\n $result = array();\n\n // If we have passed any identifier\n if (sizeof($identifier)) {\n // Perform db request and get materials\n $result = dbQuery($class)\n ->cond('MaterialID', $identifier)\n ->exec();\n }\n\n return $result;\n }", "public function create(string $className): DataMapper\n {\n if (array_key_exists($className, $this->cache)) {\n return $this->cache[$className];\n }\n\n if (!class_exists($className)) {\n throw new RuntimeException(\"Mapper not found. Attempted to load '{$className}'.\");\n }\n\n $instance = new $className($this->connection, $this->configuration);\n $this->cache[$className] = $instance;\n\n return $instance;\n }", "public static function findByUnique($identifier)\n {\n $query = Movie::query();\n $query = $query->where(\"identifier\", \"=\", $identifier); \n return $query->get()->first();\n }", "public function getHandler($identifier) {\n\n foreach($this->cacheHandlers as $handler) {\n\n if($handler->getIdentifier() === $identifier) {\n\n return $handler;\n\n }\n\n }\n\n return null;\n\n }", "protected function getDynamicInjectionHandler(string $identifier): RealistDynamicInjectionHandlerInterface\n {\n if (array_key_exists($identifier, $this->dynamicInjectionHandlers)) {\n $handler = $this->dynamicInjectionHandlers[$identifier];\n if ($handler instanceof LightServiceContainerAwareInterface) {\n $handler->setContainer($this->container);\n }\n return $handler;\n }\n throw new LightRealistException(\"Dynamic injection handler not found with identifier $identifier.\");\n }", "public function retrieveById($identifier){\n\t\t$user = $this->model->where('id', '=', $identifier)->first();\n\t\treturn $user;\n\t}", "public function normalizeIdentifier($identifier)\n {\n foreach ($this->plugins as $id => $object) {\n if (strtolower($id) === strtolower($identifier)) {\n return $id;\n }\n }\n\n return $identifier;\n }" ]
[ "0.7319482", "0.63555616", "0.63416314", "0.63016945", "0.61506116", "0.6117006", "0.60162497", "0.57728297", "0.57666224", "0.5731567", "0.5731567", "0.57266545", "0.5724383", "0.57191926", "0.5709738", "0.5679724", "0.5678501", "0.56648535", "0.5659035", "0.56479365", "0.56461114", "0.56384414", "0.5590175", "0.5568587", "0.5568587", "0.556679", "0.55574995", "0.54973155", "0.5468662", "0.5448477", "0.54062855", "0.53839475", "0.53839475", "0.53826785", "0.5373502", "0.53608024", "0.5356937", "0.53504205", "0.5349718", "0.5342894", "0.5315659", "0.52608216", "0.523945", "0.52375865", "0.5212063", "0.5205719", "0.5179255", "0.5169218", "0.51621485", "0.5161564", "0.5161564", "0.5161564", "0.514558", "0.514558", "0.514558", "0.51427317", "0.51215065", "0.5098617", "0.5091054", "0.5077147", "0.5070508", "0.5070357", "0.5057939", "0.50573975", "0.50573736", "0.504778", "0.50451636", "0.50367814", "0.50130504", "0.50075924", "0.50029224", "0.49991152", "0.49991152", "0.49906743", "0.49862292", "0.49854186", "0.4967013", "0.49391022", "0.49278256", "0.49272177", "0.4922498", "0.49159145", "0.49153423", "0.4908929", "0.49012202", "0.48882446", "0.48801965", "0.4876768", "0.48767155", "0.48697358", "0.48659638", "0.48512858", "0.48490855", "0.48480082", "0.4847386", "0.4845427", "0.4832497", "0.48268646", "0.4826855", "0.48164436" ]
0.8184054
0
Constructor for the default theme handler.
Конструктор для обработчика темы по умолчанию.
public function __construct() { $this->setup_theme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct();\n $this->_theme = $this->settings->default_theme;\n }", "public function __construct()\n {\n // Setup the used Theme to default, if it is not already defined.\n if (! isset($this->theme)) {\n $this->theme = Config::get('app.theme');\n }\n }", "public function __construct()\n {\n $this->initTheme(); \n }", "public function __construct()\n\t{\n\t\t// Setup the used Theme to default, if it is not already defined.\n\t\tif (! isset($this->theme)) {\n\t\t\t$this->theme = Config::get('app.theme', 'Bootstrap');\n\t\t}\n\t}", "public function __construct() {\n do_action('vimeography/load-theme', __FILE__);\n }", "function __construct() {\n\t\t\tglobal $kili_theme;\n\t\t\t$this->kili_theme = $kili_theme;\n\n\t\t\t/**\n\t\t\t* Parent theme main Class Construct\n\t\t\t*/\n\t\t\tparent::__construct();\n\n\t\t\t/**\n\t\t\t* Filters\n\t\t\t*/\n\t\t\t$this->add_filters();\n\n\t\t}", "function __construct() { \n \n // Start WP\n $this->loadWordPressCore();\n \n // get warp\n $warp = require(WP_PLUGIN_DIR.'/tt-warp7/warp/warp.php');\n \n // Get Theme Name and version\n $xml = $warp['dom']->create($warp['path']->path('theme:theme.xml'), 'xml');\n if ($xml) {\n $this->theme_name = $xml->first(\"name\")->text(); // Current theme name\n $this->theme_version = $xml->first(\"version\")->text(); // Current theme version\n } else {\n echo '<div class=\"uk-alert uk-display-block uk-alert-danger\">Error. Something strange. Contact with support team via <strong>support@torbara.com</strong></div>';\n }\n }", "public function theme()\n {\n }", "public function __construct($args) {\n\t\tparent::__construct('theme', $args);\n\n\t\t$this->_layout = 'default';\n\t\t$this->_format = 'html';\n\t}", "public function setup_theme()\n {\n }", "public function __construct(ThemeHandlerInterface $theme_handler) {\n $this->themeHandler = $theme_handler;\n }", "public function __construct() {\n add_action('plugins_loaded', array($this, 'load_theme'));\n }", "public function __construct() {\n\n\t\t// Theme Specific Constants\n\t\tdefine( 'WPEX_THEME_NAME', 'GoPress' );\n\t\tdefine( 'WPEX_THEME_VERSION', '2.0.0' );\n\t\tdefine( 'WPEX_FRAMEWORK_DIR', get_template_directory() .'/inc/framework' );\n\t\tdefine( 'WPEX_FRAMEWORK_DIR_URI', get_template_directory_uri() .'/inc/framework' );\n\t\tdefine( 'WPEX_INC_DIR', get_template_directory() .'/inc' );\n\t\tdefine( 'WPEX_INC_DIR_URI', get_template_directory_uri() .'/inc' );\n\t\tdefine( 'WPEX_THEME_MAIN_STYLE_HANDLE', 'wpex-main' );\n\t\tdefine( 'WPEX_THEME_MAIN_JS_HANDLE', 'wpex-main' );\n\n\t\t// Updates\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( WPEX_INC_DIR .'/updates.php' );\n\t\t}\n\n\t\t// Include files (functions & classes )\n\t\tself::includes();\n\n\t}", "public function __construct()\n {\n add_action('plugins_loaded', array($this, 'load_theme'));\n }", "public function init() \r\n\t{\r\n\t\t$arrThemes = Utility::getCurrentTemplate('public');\r\n\t\tYii::app()->theme = $arrThemes['folder'];\r\n\t\t$this->layout = $arrThemes['layout'];\r\n\t}", "function __construct(/*Theme*/ $p_theme)\n {\n $this->theme=$p_theme; \n }", "public function __construct() {\n\t\tglobal $content_width;\n\t\t$content_width = 680;\n\n\t\tadd_action( 'after_setup_theme', array( $this, 'theme_setup' ) );\n\t\tadd_action( 'widgets_init', array( $this, 'widgets_init' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'stylesheet' ) );\n\t}", "public function __construct(Handler $handler, Theme $theme)\n {\n $this->handler = $handler;\n $this->theme = $theme;\n }", "public function __construct($theme)\n {\n $this->theme = $theme;\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid';\n\t}", "public function __construct( ) {\n add_action('after_setup_theme', array($this, 'init'), 20);\n }", "public function __construct()\n {\n $this->_sUI = LetPHP::getConfig('main.site_theme');\n $this->sDisplayView = 'start';\n \n }", "public function init(Theme $theme)\n {\n\n }", "public function init(Theme $theme)\n {\n\n }", "public static function unsupported_theme_init()\n {\n }", "abstract public function get_theme();", "public function __construct()\n {\n parent::__construct();\n $this->name = \"Generate:Theme\";\n $this->description = \"Generates a skeleton theme\";\n $this->help = \"Generate a blank theme\";\n }", "function init(){\n\t\t$theme = wp_get_theme();\n\t\t$this->theme_name = $theme->get_template();\n\t\t$this->defaults = apply_filters( 'siteorigin_settings_defaults', $this->defaults );\n\t}", "function __construct() {\n\t\tglobal $hybrid;\n\n\t\t/* Set up an empty class for the global $hybrid object. */\n\t\t$hybrid = new stdClass;\n\n\t\t/* Define framework, parent theme, and child theme constants. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'constants' ), 1 );\n\n\t\t/* Load the core functions required by the rest of the framework. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'core' ), 2 );\n\n\t\t/* Initialize the framework's default actions and filters. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'default_filters' ), 3 );\n\n\t\t/* Language functions and translations setup. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'i18n' ), 4 );\n\n\t\t/* Handle theme supported features. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'theme_support' ), 12 );\n\n\t\t/* Load the framework functions. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'functions' ), 13 );\n\n\t\t/* Load the framework extensions. */\n\t\tadd_action( 'after_setup_theme', array( &$this, 'extensions' ), 14 );\n\n\t\t/* Load admin files. */\n\t\tadd_action( 'wp_loaded', array( &$this, 'admin' ) );\n\t}", "protected function init_theme() {\n\t\tif ( false === $this->current_theme ) {\n\t\t\t$theme = $this->option( 'theme' );\n\t\t\t$theme = ( Themes::is_support( $theme, $this->module() ) ) ? $theme : wponion_default_theme();\n\t\t\t$return = Themes::callback( $theme, $this->theme_callback_args() );\n\t\t\t$this->current_theme = ( wpo_is( $return, 'theme' ) ) ? $return->uid() : false;\n\t\t}\n\t\treturn $this->theme();\n\t}", "public function __construct() {\n\t\tadd_action( 'apppresser_add_settings', array( $this, 'theme_options' ), 80 );\n\t\tadd_action( 'apppresser_tab_bottom_general', array( $this, 'add_row_text' ) );\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t// Comments is loaded\n\n\t\t/**\n\t\t * Fires after the Jetpack_Comments object has been instantiated\n\t\t *\n\t\t * @module comments\n\t\t *\n\t\t * @since 1.4.0\n\t\t *\n\t\t * @param array $jetpack_comments_loaded First element in array of type Jetpack_Comments\n\t\t **/\n\t\tdo_action_ref_array( 'jetpack_comments_loaded', array( $this ) );\n\t\tadd_action( 'after_setup_theme', array( $this, 'set_default_color_theme_based_on_theme_settings' ), 100 );\n\t}", "public function __construct(Theme $theme)\n {\n parent::__construct();\n $this->theme = $theme;\n }", "public function __construct() {\n\t\tadd_action( 'admin_menu', array( &$this, 'add_theme_options' ) );\t\t\t\t// Calling callback function to draw the settings page.\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_admin_styles' ));\t// Providing some backend CSS.\n\t}", "public function theme_installer()\n {\n }", "public function initialize() {\n\t\t$this->_themeArray = array('topMenu'=>true, 'menuSel'=>'','pcView'=>'', 'pcData'=>'', 'jsScript'=>'');\n\t}", "public static function get_core_default_theme()\n {\n }", "public function WebTheme($c) {\r\n parent::DefaultTheme($c); \r\n }", "public function init() {\n\n // Use the parent theme's unique plugin slug\n\t\t$this->setParent('defaultthemeplugin');\n\n\t\t// add style overrides for the backend\n\t\t// this doesn't work\n\t\t//$this->addStyle('backend-overrides', 'styles/backend.less', array( 'contexts' => 'backend' ));\n\n // Change the ID of this stylesheet slug to\n // `child-stylesheet`. This ensures that it\n // won't clash with the parent's stylesheet.\n\t\t$this->modifyStyle('stylesheet', array('addLess' => array('styles/index.less')));\n\t\t$this->addStyle('oslomet-custom-backend-styles', '../OsloMetParent/styles/backend.less', array( 'contexts' => 'backend' ));\n\t}", "protected function _construct()\n {\n parent::_construct();\n $this->setTemplate(self::TEMPLATE);\n }", "function theme_init() {\n global $conf, $base_path, $base_theme_name, $base_theme_info;\n\n $base_theme_name = !$GLOBALS['user']->theme ? $conf['default_theme'] : $GLOBALS['user']->theme;\n \n $base_theme_info = $conf['themes'][$base_theme_name];\n\n $conf['base_theme'] = $base_path . $base_theme_info['path'];\n $conf['base_logo'] = $base_path . ($base_theme_info['logo'] ? $base_theme_info['logo'] : 'misc/images/logo.png');\n $conf['base_favicon'] = $base_path . ($base_theme_info['favicon'] ? $base_theme_info['favicon'] : 'misc/images/favicon.ico');\n\n if (is_file(DIDA_ROOT .'/'. $base_theme_info['path'] . '/template.php')) {\n require_once DIDA_ROOT .'/'. $base_theme_info['path'] . '/template.php';\n }\n\n if (empty($base_theme_info['styles_remove']['misc/dida.css'])) {\n dd_add_css('misc/dida.css', 'theme');\n }\n \n if (empty($base_theme_info['styles'])) {\n dd_add_css($base_theme_info['path'].'/css/style.css', 'theme');\n } else {\n foreach ($base_theme_info['styles'] as $style) {\n dd_add_css($base_theme_info['path'].'/'. $style, 'theme');\n }\n }\n \n if ($base_theme_info['scripts']) {\n foreach ($base_theme_info['scripts'] as $script) {\n dd_add_js($base_theme_info['path'].'/'. $script, 'theme');\n }\n }\n\n dd_add_js('misc/jquery.js', 'core');\n dd_add_js('misc/dida.js', 'core');\n dd_add_js('misc/jquery.dida.js', 'core');\n}", "public static function theme(){ return self::$theme; }", "function __construct() {\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'default_theme_compat' ), 99 );\n\t\t\tadd_action( 'tm_theme_wizard_before_activation', array( $this, 'store_data_for_dashboard' ), 10, 2 );\n\t\t}", "function cwp_theme() {\n\tstatic $theme;\n\n\tif ( ! isset( $theme ) ) {\n\t\t$theme = new \\CWP\\Theme();\n\t}\n\n\treturn $theme;\n}", "public function themeSetup()\n {\n load_theme_textdomain('bdkh_kids', get_template_directory() . '/languages');\n\n // This theme styles the visual editor with editor-style.css to match the theme style.\n add_editor_style();\n\n // Adds RSS feed links to <head> for posts and comments.\n add_theme_support('automatic-feed-links');\n\n // This theme supports a variety of post formats.\n add_theme_support('post-formats', array( 'aside', 'image', 'link', 'quote', 'status'));\n\n // This theme uses wp_nav_menu() in one location.\n register_nav_menu('primary', __( 'Primary Menu', 'bdkh_kids' ));\n\n /*\n * This theme supports custom background color and image, and here\n * we also set up the default background color.\n */\n// add_theme_support( 'custom-background', array(\n// 'default-color' => 'e6e6e6',\n// ) );\n\n // This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n add_theme_support( 'post-thumbnails' );\n// set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop\n add_image_size('slider', 645, 410, true);\n add_image_size('loop-thumbnail', 88, 88, true);\n }", "public function action_init_theme()\n\t{\n\t\t// Apply Format::autop() to comment content...\n\t\tFormat::apply( 'autop', 'comment_content_out' );\n\t\t// Apply Format::tag_and_list() to post tags...\n\t\tFormat::apply( 'tag_and_list', 'post_tags_out' );\n\n\t\t// Remove the comment on the following line to limit post length on the home page to 1 paragraph or 100 characters\n\t\t//Format::apply_with_hook_params( 'more', 'post_content_out', _t('more'), 100, 1 );\n\t}", "public function init() {\r\n Yii::app()->theme = 'abound';\r\n //$this->layout = 'webroot.themes.abound.views.layouts.main';\r\n $this->layout = 'webroot.themes.abound.views.layouts.column2';\r\n }", "public function init() {\n\t\t$this->theme_settings = get_option( 'ecrannoir-settings-option' );\n\n\t\t/**\n * Loads our translations before loading anything else\n */\n if( is_dir( get_stylesheet_directory() . '/languages' ) ) {\n $path = get_stylesheet_directory() . '/languages';\n } else {\n $path = get_template_directory() . '/languages'; \n }\n\n\t\tload_theme_textdomain('ecrannoir', $path);\n\n\t\t// Load Utilities\n\t\trequire_once __DIR__ . '/helpers/assets.php';\n\t\trequire_once __DIR__ . '/helpers/config.php';\n\t\trequire_once __DIR__ . '/helpers/content.php';\n\t\trequire_once __DIR__ . '/helpers/meta.php';\n\t\trequire_once __DIR__ . '/helpers/svg-icons.php';\n\n\t\t$this->setup();\n\t\t$this->comment();\n\t\t$this->adminSetup();\n\n\t\t/**\n * Flush our rewrite rules for new posts\n */\n add_action('after_switch_theme', function() { \n flush_rewrite_rules(); \n });\n\n\t\t$this->generalActions();\n\n\t\t$this->actions();\n\t\t$this::filters();\n\n\t\t$this->view();\n\t}", "function __construct()\n {\n self::$theme_config_helper = Mage::helper('thememanager/themeConfig');\n parent::__construct();\n }", "public function __construct()\n {\n $this->lang = App::$Request->getLanguage();\n // get theme from config based on env_name global\n $theme = App::$Properties->get('theme')[env_name] ?? 'default';\n $env = ucfirst(Str::lowerCase(env_name));\n\n $this->path = root . DIRECTORY_SEPARATOR . 'Apps' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . $env . DIRECTORY_SEPARATOR . $theme;\n if (!Directory::exist($this->path)) {\n if (App::$Debug) {\n App::$Debug->addMessage('Template root directory is not exist: ' . $this->path, 'error');\n }\n return;\n }\n\n // initialize template engine with path and load default extensions\n parent::__construct($this->path);\n $this->loadDefaultExtensions();\n }", "public function init() {\n\t\tadd_action( 'after_setup_theme', array( &$this, 'init_callback' ) );\n\t}", "public function __construct()\n {\n $this->addDefaultColors();\n }", "public function initTheme()\n {\n $timber = new \\Timber\\Timber();\n if (!class_exists('Timber')) {\n add_action('admin_notices', function () {\n print '<div class=\"error\">';\n print '<p>' . __('Timber library is not activated. Be sure to install composer or install Timber Plugin', LANG_DOMAIN) . '</p>';\n print '</div>';\n });\n } else {\n // Start Website with TimberSite Configuration\n $starter = new Starter();\n // Override Templating hierarchy to use MVC pattern\n $currentController = $this->overrideTemplateHierarchy();\n if (is_object($currentController)) {\n // Render loaded controller\n $currentController->render();\n }\n }\n }", "public function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t $this->layout = \"layouts.\".CNF_THEME.\".index\";\n\t\t\n\t\t\n\t}", "function theme( $args, $assoc_args ) {\n list( $get_default ) = $args;\n\n $default_theme = 'twentyfourteen';\n if ( defined( 'WP_DEFAULT_THEME' ) ) {\n $default_theme = WP_DEFAULT_THEME;\n }\n\n WP_CLI::line( $default_theme );\n }", "function __construct() {\n\t\tadd_theme_support('soil-clean-up');\n\t\tadd_theme_support('soil-jquery-cdn');\n\t\tadd_theme_support('soil-nice-search');\n\n\t\t/**\n * Enable plugins to manage the document title\n * @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag\n */\n add_theme_support('title-tag');\n\n\t\t/**\n * Enable post thumbnails\n * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n * @link http://codex.wordpress.org/Post_Thumbnails\n * @link http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size\n * @link http://codex.wordpress.org/Function_Reference/add_image_size\n */\n add_theme_support('post-thumbnails');\n\n\t\t/**\n\t\t * Enable HTML5 markup support\n\t\t * @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5\n\t\t */\n\t\tadd_theme_support( 'html5', ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption'] );\n\n\t\t/**\n\t\t * Enable selective refresh for widgets in customizer\n\t\t * @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/#theme-support-in-sidebars\n\t\t */\n\t\t// add_theme_support('customize-selective-refresh-widgets');\n\n\t\t/**\n * Register navigation menus\n * @link https://developer.wordpress.org/reference/functions/register_nav_menus/\n */\n register_nav_menus([\n 'primary_navigation' => __('Primary Navigation', 'titishairart-theme')\n ]);\n\n\t\tadd_action( 'wp_enqueue_scripts', [$this, 'setup_scripts_styles'], 100 );\n\t\tadd_filter( 'timber_context', [$this, 'add_to_context'] );\n\t\tadd_filter( 'get_twig', [$this, 'add_to_twig'] );\n\t\tparent::__construct();\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t//$this->data_view = \\Dashboard\\DashboardController::get_instance()->getSetupThemes();\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->data_view['settings_index'] \t= $this->data_view['view_path'] . '.settings.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->modalClass = 'createTask';\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t//$this->data_view = \\Dashboard\\DashboardController::get_instance()->getSetupThemes();\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->data_view['settings_index'] \t= $this->data_view['view_path'] . '.settings.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->modalClass = 'createTask';\n\t}", "public function __construct()\n\t {\n\t\t parent::__construct();\n\t\t \n\n\t\t $this->layout->set_theme($this->theme);\n\t\t $this->data[\"activ_menu\"] \t= \t\"dashboard\";\n\t\t $this->data[\"page_title\"]\t=\t\"Votre tableau de bord\";\n\t\t \n\t }", "public function __construct()\n\t{\n\t\t$this->theme = Config::get('wardrobe.theme');\n\n\t\t// Redirect to /install if the db isn't setup.\n\t\tif (Config::get(\"wardrobe.installed\") !== true)\n\t\t{\n\t\t\theader('Location: install');\n\t\t\texit;\n\t\t}\n\t}", "function Mai_Theme_Engine() {\n\treturn Mai_Theme_Engine::instance();\n}", "public function __construct() {\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t/* Load the core functions required by the rest of the framework. */\n\t\tadd_action( 'after_setup_theme', array( $this, 'core' ), 2 );\n\n\t\t/* Load the framework functions. */\n\t\tadd_action( 'after_setup_theme', array( $this, 'functions' ), 13 );\n\t\t\n\t}", "public function __construct(){\n\t\tparent::__construct();\t\t\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->data_view['settings_index'] \t= $this->data_view['view_path'] . '.settings.index';\t\t\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->clientTagEntity = new \\ClientTag\\ClientTagEntity;\n\t\t$this->opportunityTagEntity = new \\OpportunityTag\\OpportunityTagEntity;\n\t}", "function init_theme() {\n $plugin = new \\Kimnatura\\Includes\\Main();\n $plugin->run();\n}", "function __construct() {\n\n\t\t$this->defaults = array(\n\t\t\t'title' => '',\n\t\t\t'twitter_id' => '',\n\t\t\t'twitter_num' => '',\n\t\t\t'twitter_duration' => '',\n\t\t\t'twitter_hide_replies' => 0,\n\t\t\t'follow_link_show' => 0,\n\t\t\t'follow_link_text' => '',\n\t\t);\n\n\t\t$widget_ops = array(\n\t\t\t'classname' => 'wpacc-latest-tweets',\n\t\t\t'description' => __( 'Display a list of your latest tweets.', 'genesis' ),\n\t\t);\n\n\t\t$control_ops = array(\n\t\t\t'id_base' => 'wpacc-latest-tweets',\n\t\t\t'width' => 200,\n\t\t\t'height' => 250,\n\t\t);\n\n\t\t$this->WP_Widget( 'wpacc-latest-tweets', __( 'WPACC - Latest Tweets', 'genesis' ), $widget_ops, $control_ops );\n\n\t}", "public function init( ) {\n // Adds post thumbnails support\n add_theme_support('post-thumbnails');\n\n // Creates the top nav menu location\n register_nav_menus(array(\n 'primary' => 'Main Navigation', \n ));\n\n // Loads required dependencies for the theme\n $bower_path = TEMPLATEPATH . '/bower_components';\n require_once $bower_path . '/wp-bootstrap-navwalker/wp_bootstrap_navwalker.php';\n\n // See http://codex.wordpress.org/Plugin_API/Action_Reference\n add_action('wp_head', array($this, 'header'));\n add_action('widgets_init', array($this, 'widgets'));\n add_action('wp_footer', array($this, 'footer'));\n add_action('admin_head', array($this, 'admin_head'));\n add_action('wp_enqueue_scripts', array($this, 'enqueue_assets'));\n\n // See http://codex.wordpress.org/Plugin_API/Filter_Reference\n add_filter('wp_title', array($this, 'filter_title'), 10, 2);\n add_filter('wp_trim_excerpt', array($this, 'trim_excerpt'));\n add_filter('excerpt_length', array($this, 'excerpt_length'), 10, 1);\n add_filter('get_the_excerpt', array($this, 'excerpt_more_link'));\n\n // Registers stylesheets and scripts for the theme\n add_action('hoverboard/header', array($this, 'add_ie_scripts'));\n\n // Removes unnecessary actions\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'rsd_link');\n\n // Allows for custom actions to be hooked into Hoverboard\n do_action('hoverboard/init');\n }", "function Custom_Theme() {\n\n return Custom_Theme::instance();\n}", "public function __construct(App $app)\n\t{\n\t\t$this->app = $app;\n\t\t$this->engine = new Templates;\n\n\t\t$theme = $this->get();\n\n\t\tparent::__construct($theme);\n\n\t\t$this->app->plugins->run('system_theme_construct', $this, $theme);\n\t}", "public function init()\n\t{\n\t\tYii::app()->theme = 'classic';\n\t\tYii::app()->name = 'Administration panel';\n\t}", "protected function initialize(): void {\n\t\tparent::initialize();\n\t\tif ($this->theme === '') {\n\t\t\t$this->theme = $this->optionString(self::OPTION_THEME, self::DEFAULT_THEME);\n\t\t}\n\t\t$this->auto_render = $this->optionBool(self::OPTION_AUTO_RENDER, $this->auto_render);\n\t}", "private function __construct()\n\t{\n\t\t// Setup framework default elements\n\t\t$this->set_core_elements();\n\n\t\t// Establish elements\n\t\tadd_action( 'after_setup_theme', array( $this, 'set_elements' ), 1000 );\n\n\t}", "public function _construct()\n {\n parent::_construct();\n $this->_blockGroup = 'Magento_Theme';\n $this->_controller = 'Adminhtml_System_Design_Theme';\n if (is_object($this->getLayout()->getBlock('page.title'))) {\n $this->getLayout()->getBlock('page.title')->setPageTitle('Themes');\n }\n\n $this->buttonList->remove('add');\n }", "function __construct() {\n\n\t\tload_plugin_textdomain( 'genesis-latest-tweets', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\n\t\tadd_action( 'widgets_init', array( $this, 'load_widget' ), 25 );\n\t\t\n\t\t// @todo Waiting on Nathan to determine activation/deactivation steps\n\t\tregister_activation_hook( __FILE__, array( $this, 'activate' ) );\n\t\t//register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );\n\t\t\n\t\tadd_action( 'init', array( $this, 'activate' ) );\n\n\t}", "private function set_theme()\n\t{\n\t\t$this->template_name = dirname( __FILE__ ) . '/themes/CAFSJ/theme.php';\n//\t\t$this->template_name = dirname( __FILE__ ) . '/themes/CAFStJu/simple.php';\n\t}", "abstract protected function _setThemeObjectBuilder();", "public function __construct()\n {\n add_action('customize_register', array($this, 'setup'));\n add_action('customize_preview_init', array($this, 'preview'));\n\n // Hook into wp_head to add custom CSS\n add_action('wp_head', array($this, 'header'));\n }", "public function __construct() {\n\n\n\t\t/**\n\t\t * Load Settings and Sidebars\n\t\t */\n\t\tif ( function_exists('get_fields') ) :\n\n\t\t\t$this->load_options();\n\t\t\t$this->register_sidebars();\n\t\t\t$this->set_sidebar();\n\t\t\t$this->user_custom_scripts();\n\t\tendif;\n\n\n /**\n * \n */\n $this->assets = new Assets\\Assets();\n\n\n\t\t/**\n\t\t * Actions\n\t\t */\n\n\t\t// Add Favicon to head\n\t\tadd_action('wp_head', [ $this, 'set_favicon']);\n\n\n\t\t// Load Theme Scripts\n\t\tadd_action('wp_enqueue_scripts', [$this, 'scripts_frontend'] , 100);\n\t\tadd_action('admin_enqueue_scripts', [$this, 'scripts_backend'] , 100);\n\n\n\n\t\t/**\n\t\t * Filters\n\t\t */\n\t\tadd_filter('body_class', [$this, 'body_class'], 20);\n\t}", "function __construct() {\r\n\t\t$plugin_location = $this->locate_plugin();\r\n\t\t$this->dir_path = $plugin_location['dir_path'];\r\n\t\t$this->dir_url = $plugin_location['dir_url'];\r\n\t\t$this->config = array();\r\n\r\n\t\tadd_action( 'wp_default_scripts', array( $this, 'register_scripts' ), 11 );\r\n\t\tadd_action( 'wp_default_styles', array( $this, 'register_styles' ), 11 );\r\n\t\tadd_action( 'init', array( $this, 'init' ) );\r\n\t\t$this->widgets = new WP_Customize_Partial_Refresh_Widgets( $this );\r\n\t}", "public function __construct(){\n $this->app = 'ResourceManager';\n $this->module = 'Resource';\n $theme = session()->get('theme');\n $this->componentName = 'themes.'.$theme.'.layouts.app';\n }", "public function __construct()\n {\n add_action( 'admin_menu', array( $this, 'addMenuItem' ) );\n add_action( 'admin_init', array( $this, 'registerSettings' ) );\n add_action( 'admin_head', array( $this, 'displayStyles' ) );\n }", "public function __construct()\n {\n $this->properties = new Properties(\"nl\", \"Default Page Title\", 1);\n $this->functions = new Functions();\n $this->Handler();\n }", "public function init() {\r\n\t\tparent::init();\r\n\t\t$this->addThemeCss('view');\r\n\t\t$this->addThemeLink('alternate', 'application/rss+xml', $this->objWidget->getRootLevelTitle() . ' - ' . $this->objWidget->getWidgetTitle() . ' RSS', '?do=rss');\r\n\t\t$this->view->setHelperPath(dirname(dirname(__FILE__)) . '/views/helpers/', 'Blog_View_Helper');\r\n $this->view->addHelperPath(dirname(dirname(__FILE__)) . '/views/helpers/', 'Blog_View_Helper'); \r\n\t}", "public function __construct() {\n\t\tadd_action( 'after_setup_theme', array( $this, 'setup_child_theme' ), 11 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'setup_header' ), 9 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'modify_header' ), 21 );\n\n\t\tadd_filter( 'the_content_more_link', array( $this, 'the_content_more_link' ), 10, 2 );\n\t}", "public function __construct(Theme $theme)\n {\n $this->theme = $theme;\n\n $this->allowedExtensions = self::getEditableExtensions();\n\n parent::__construct();\n }", "static function theme_setup( &$flawless ) {\n self::define_widget_area_sections( $flawless );\n }", "public function __construct(\n public bool $dark = true,\n public string $tile = '#da532c',\n public string $theme = '#ffffff',\n ) {\n }", "public static function get_themes()\n {\n }", "function __construct() {\n\t\t$widget_ops = array( 'classname' => 'simple_post_slider', 'description' => __( 'The most recent posts on your site' ) );\n\t\tparent::__construct( 'simple-post-slider', __( 'Simple Post Slider', 'wpnsw' ), $widget_ops );\n\t\t$this->alt_option_name = 'simple_post_slider';\n\n\t\tadd_action( 'save_post', array( &$this, 'flush_widget_cache' ) );\n\t\tadd_action( 'deleted_post', array( &$this, 'flush_widget_cache' ) );\n\t\tadd_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) );\n\n\t\t$loader = new Twig_Loader_Filesystem( __DIR__ . '/templates' );\n\t\t$twig_options = WP_DEBUG === true ? array() : array(\n\t\t\t'cache' => __DIR__ . '/compilation_cache'\n\t\t);\n\t\t$this->twig = new Twig_Environment( $loader, $twig_options );\n\t\t$this->twig->addExtension( Twig_WordPress_Widget::get_instance( $this ) );\n\n\t}", "public function __construct()\n {\n // Action: after_setup_theme\n // Configures `add_theme_support` settings\n ThemeSupport::register();\n\n // Action: init\n // Handles `register_post_type` calls for custom post types\n CustomPostTypes::register();\n\n // Action: init\n // Handles `register_taxonomy` calls for custom taxonomy items\n CustomTaxonomies::register();\n\n // Actions: admin_menu, login_enqueue_scripts\n // Configures Wordpress admin settings (login logo, visible menu items)\n AdminSettings::register();\n\n // Action: init\n // Handles `register_nav_menus` for menu setup\n MenuSettings::register();\n\n // Actions: post_type_labels_post, manage_post_posts_columns\n // Configure labels for default Post type\n // PostSettings::register();\n\n // Action: after_setup_theme\n // Registers `add_image_size` calls and sets image quality\n ImageSettings::register();\n\n // Filters: various acf/ prefixed filters\n // Fine-tunes ACF settings, including creating Options pages\n ACFSettings::register();\n\n // Filter: timber/twig\n // Adds filters, functions, and extensions to the Twig engine\n TwigSettings::register();\n\n // Filter: wp_enqueue_scripts\n // Enqueues assets, and generates versioned urls from the site manifest\n Assets::register();\n\n add_filter('timber/context', [$this, 'addToContext']);\n\n parent::__construct();\n }", "function childtheme_setup() {\n\t\n}", "public function __construct(array $defaultThemes = [])\n {\n $this->defaultThemes = $defaultThemes;\n }", "public function __construct()\n { \n \n parent::__construct();\n $jsFiles[]=\"\";\n $cssFiles[] = $this->url . '/theme/' . Config::get('app.theme') . '/assets/js/main.css';\n $cssFiles[] = $this->url . '/theme/' . Config::get('app.theme') . '/assets/js/scaffolds.css';\n $cssFiles[] = $this->url . '/theme/' . Config::get('app.theme') . '/assets/js/vacation_properties.css';\n $cssFiles[] = $this->url . '/theme/' . Config::get('app.theme') . '/assets/js/application.css';\n $this->loadJsCSS($jsFiles, $cssFiles);\n }", "public function changeTheme();", "public function __construct($default_lang) {\n\t\tparent::__construct($default_lang);\n\t\t\n\t\t# Declaration d'un hook (existant ou nouveau)\n\t\t$this->addHook('ThemeEndBody','ThemeEndBody');\t\t\n\t}", "public function track_initial_theme()\n {\n }", "public function __construct() {\n\n\t\t// Register widget scripts\n\t\t//add_action( 'elementor/frontend/after_register_scripts', [ $this, 'widget_scripts' ] );\n\n\t\t/* yohann */\n\t\t// Override widgets\n\t\tadd_action( 'elementor/widgets/widgets_registered', [ $this, 'override_widgets' ], 15 );\n\n\t\t// Register editor scripts\n\t\t//add_action( 'elementor/editor/after_enqueue_scripts', [ $this, 'editor_scripts' ] );\n\t\t\n\t}", "function __construct() {\n $this->transposh = &$GLOBALS['my_transposh_plugin'];\n\n // Widget control defenitions\n $widget_ops = array('classname' => 'widget_transposh', 'description' => __('Transposh language selection widget', TRANSPOSH_TEXT_DOMAIN));\n $control_ops = array('width' => 200, 'height' => 300);\n parent::__construct('transposh', __('Transposh'), $widget_ops, $control_ops);\n\n // PHP 5.3 and up...\n add_action('widgets_init', function() {\n register_widget(\"transposh_plugin_widget\");\n });\n// add_action('widgets_init', create_function('', 'register_widget(\"transposh_plugin_widget\");'));\n\n // We only need to add those actions once, makes life simpler\n if (is_active_widget(false, false, $this->id_base) && self::$first_init) {\n self::$first_init = false;\n if (!is_admin()) {\n add_action('wp_print_styles', array(&$this, 'add_transposh_widget_css'));\n add_action('wp_print_scripts', array(&$this, 'add_transposh_widget_js'));\n }\n }\n }", "private function __construct()\n\t{\n\t\t// Only front end\n\t\tif ( ! is_admin() ) {\n\t\t\t// Setup stylesheets from Framework and Custom API.\n\t\t\t// No enqueuing yet.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'set_framework_stylesheets' ), 1 );\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'set_custom_stylesheets' ), 1 );\n\n\t\t\t// Include stylesheets, framework and levels 1, 2, and 4\n\t\t\t// Note: Level 3 needs to be included at the theme level.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_framework_stylesheets' ), 5 );\n\t\t\tadd_action( 'wp_head', array( $this, 'closing_stylesheets' ), 11 );\n\t\t}\n\t}", "public static function load_theme() {\n do_action('vimeography/load-theme', __FILE__);\n }" ]
[ "0.780345", "0.7658238", "0.763762", "0.73666847", "0.72332793", "0.7204521", "0.7200291", "0.71727663", "0.71322066", "0.7124803", "0.7023983", "0.69555557", "0.69547695", "0.6943543", "0.6931371", "0.6893213", "0.6792869", "0.6789869", "0.6782772", "0.67532545", "0.6749174", "0.6735503", "0.6706832", "0.6677138", "0.6677138", "0.66182345", "0.6618193", "0.6615039", "0.66005564", "0.6574391", "0.6561407", "0.6536759", "0.65329325", "0.6528753", "0.6527379", "0.65214837", "0.6520457", "0.64905924", "0.64742976", "0.64717424", "0.6467163", "0.6439375", "0.6403752", "0.63942903", "0.6375619", "0.63705933", "0.6337646", "0.6333737", "0.63318276", "0.6323831", "0.6320652", "0.6309667", "0.6298383", "0.6294083", "0.62895375", "0.62829965", "0.62779796", "0.6270236", "0.6270236", "0.62630934", "0.6254155", "0.6252631", "0.62515825", "0.6250868", "0.6250445", "0.62272376", "0.6205938", "0.6200545", "0.619504", "0.6192086", "0.61877054", "0.6186151", "0.6180283", "0.617544", "0.6169244", "0.61677223", "0.6165348", "0.613162", "0.6114161", "0.61052597", "0.61044854", "0.60943335", "0.6088044", "0.60836285", "0.60804874", "0.6074561", "0.60636", "0.6056638", "0.60524315", "0.60395455", "0.60379773", "0.60296595", "0.6021725", "0.60107225", "0.60078704", "0.5995779", "0.59940934", "0.59934455", "0.59884", "0.59867597" ]
0.7734767
1
SPDXLicenseIdentifier: BSD3Clause !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !! !! NOTE this file does not need to be edited; see setup.php !! !! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //////////////////////////////////////////////////////////////////////////// Security Two functions contain filesystem calls (search for "FS" in this file): directory_data() cache_test() function path_security_check(string $victim, string $test) the resolved path of $victim must be below $test on the filesystem check only if victim exists; otherwise realpath cannot resolve path
SPDXLicenseIdentifier: BSD3Clause !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !! !! ЗАМЕЧАНИЕ: этот файл не нужно редактировать; см. setup.php !! !! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //////////////////////////////////////////////////////////////////////////// Безопасность Два функции содержат вызовы работы с файловой системой (поищите "FS" в этом файле): directory_data() cache_test() функция path_security_check(string $victim, string $test) разрешённый путь $victim должен находиться ниже $test в файловой системе проверять только в случае, если $victim существует; в противном случае realpath не может разрешить путь
function path_security_check($victim, $test) { if (!realpath($victim) || preg_match("/^" . rtrim('/', $test) . ".*/", rtrim('/', realpath($victim)))) { return true; } die("path security check failed: $victim - $test"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function met_filesystem_requirement()\n {\n }", "function securityCheck() {\n\t}", "public static function checkFilesystem()\n {\n // -------------------------- SCHREIBRECHTE\n $writables = [\n rex_path::media(),\n rex_path::assets(),\n rex_path::cache(),\n rex_path::data(),\n rex_path::src(),\n ];\n\n $func = function ($dir) use (&$func) {\n if (!rex_dir::isWritable($dir)) {\n return ['setup_304' => [$dir]];\n }\n $res = [];\n foreach (rex_finder::factory($dir) as $path => $file) {\n if ($file->isDir()) {\n $res = array_merge_recursive($res, $func($path));\n } elseif (!$file->isWritable()) {\n $res['setup_305'][] = $path;\n }\n }\n return $res;\n };\n\n $res = [];\n foreach ($writables as $dir) {\n if (@is_dir($dir)) {\n $res = array_merge_recursive($res, $func($dir));\n } else {\n $res['setup_306'][] = $dir;\n }\n }\n\n return $res;\n }", "function checkFileAccess($filepath) {\n\tglobal $root_directory;\n\t// Set the base directory to compare with\n\t$use_root_directory = $root_directory;\n\tif(empty($use_root_directory)) {\n\t\t$use_root_directory = realpath(dirname(__FILE__).'/../../.');\n\t}\n\n\t$realfilepath = realpath_nolinks($filepath);\n\tif (!$realfilepath) die($filepath);\n\n\t/** Replace all \\\\ with \\ first */\n\t$realfilepath = str_replace('\\\\\\\\', '\\\\', $realfilepath);\n\t$rootdirpath = str_replace('\\\\\\\\', '\\\\', $use_root_directory);\n\n\t/** Replace all \\ with / now */\n\t$realfilepath = str_replace('\\\\', '/', $realfilepath);\n\t$rootdirpath = str_replace('\\\\', '/', $rootdirpath);\n\tif(stripos($realfilepath, $rootdirpath) !== 0) {\n\t\tdie($filepath);\n\t}\n}", "function securityCheckPath($path) {\r\n\tif(substr($path, 0, 1) == \"/\") {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n\t\r\n\tif(strpos($path, \"\\\\\") !== false) {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n\r\n\tif(strpos($path, \"//\") !== false) {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n\r\n\tif(strpos($path, \"~\") !== false) {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n\r\n\tif(strpos($path, \"?\") !== false) {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n\r\n\tif(strpos($path, \":\") !== false) {\r\n\t\tthrow new Exception(\"invalid Path : \".$path);\r\n\t}\r\n}", "function security_procedure($basedir, $filename){\n\t\t\t//replace \" with \\\n\t\t\t$basedir = str_replace('\"', '\\\\', $basedir);\t\t\t\t\n\t\t\t$basedir_len = strlen($basedir);\n\t\n\t\t\t// compare the entered path with the basedir\n\t\t\t$path_parts = pathinfo($filename);\n\t\t\t$real_path = realpath($path_parts['dirname']);\n\t\t\tif (substr($real_path, 0, $basedir_len) != $basedir) {\n \t\t\t/* appropriate action against crack-attempt*/\n\t \t\tdie ('coding good - h4x1ng bad!');\n\t\t\t}\n\t\t\t//else\n\t\t\treturn $path_parts;\t\t\t\n\t\t}", "function security_procedure($basedir, $filename){\n\t\t\t$basedir = realpath(str_replace('\"', '\\\\', $basedir));\t\t\t\t\t\n\t\t\t$basedir_len = strlen($basedir);\n\t\n\t\t\t// compare the entered path with the basedir\n\t\t\t$path_parts = pathinfo($filename);\n\t\t\t$real_path = realpath($path_parts['dirname']);\n\t\t\tif (substr($real_path, 0, $basedir_len) != $basedir) {\n \t\t\t//appropriate action against crack-attempt\n\t \t\tdie ('coding good - h4x1ng bad!');\n\t\t\t}\n\t\t\t//else\n\t\t\treturn $path_parts;\t\t\t\n\t\t}", "function security_procedure($basedir, $filename){\n\t\t\t$basedir = realpath(str_replace('\"', '\\\\', $basedir));\t\t\t\t\n\t\t\t$basedir_len = strlen($basedir);\n\t\n\t\t\t// compare the entered path with the basedir\n\t\t\t$path_parts = pathinfo($filename);\n\t\t\t$real_path = realpath($path_parts['dirname']);\t\t\t\n\t\t\tif (substr($real_path, 0, $basedir_len) != $basedir) {\n \t\t\t/* appropriate action against crack-attempt*/\n\t \t\tdie ('coding good - h4x1ng bad!');\n\t\t\t}\n\t\t\t\n\t\t\t//else\n\t\t\treturn $path_parts;\t\t\t\n\t\t}", "function ImageSecurityCheck($imagename)\n{\n //SD362: legacy (e.g. p17); now uses SD_Media_Base\n require_once(SD_INCLUDE_PATH.'class_sd_media.php');\n return SD_Media_Base::ImageSecurityCheck(true,dirname($imagename).'/',basename($imagename));\n}", "function privDirCheck($p_dir, $p_is_dir = \\false)\n {\n }", "function test_silly_safe_mode()\r\n{\r\n global $DFLT;\r\n\r\n $test_file = \"{$DFLT['alb_d']}/{$DFLT['upl_d']}/dummy/dummy.txt\";\r\n @mkdir(dirname($test_file), 0755);\r\n $fd = @fopen($test_file, 'w');\r\n if (!$fd) {\r\n @rmdir(dirname($test_file));\r\n return true;\r\n }\r\n fclose($fd);\r\n @unlink($test_file);\r\n @rmdir(dirname($test_file));\r\n}", "function svn_fs_check_path($fsroot, $path)\n{\n}", "function cos_check_files_dir () {\n clearstatcache();\n $files_dir = conf::pathFilesBase() . \"/files\";\n $domain = conf::getMainIni('domain');\n $files_dir.=\"/$domain\";\n \n if (!is_writable($files_dir)) {\n echo \"dir: $files_dir is not writeable<br />\\n\";\n $user = getenv('APACHE_RUN_USER');\n echo \"server user is: $user<br />\\n\";\n echo \"On unix solution will be to:<br />\\n\";\n echo \"sudo chown -R www-data:www-data ./files\";\n die();\n } else {\n echo \"We can write to files dir.OK<br>\";\n }\n}", "function _checkPath( $path, $checkAdmin=1 ) {\n\t\tglobal $mosConfig_absolute_path;\n\n\t\t$file = $mosConfig_absolute_path . $path;\n\t\tif ($checkAdmin > -1 && file_exists( $file )) {\n\t\t\treturn $file;\n\t\t} else if ($checkAdmin != 0) {\n\t\t\t$file = $mosConfig_absolute_path . '/administrator' . $path;\n\t\t\tif (file_exists( $file )) {\n\t\t\t\treturn $file;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function CheckExisting()\n{\n\tif(isset($_REQUEST['secvalue']) === false)\n\t{\n\t\techo '<fail>No sec val param</fail>';\n\t\texit();\n\t}\n\t\n\t\n\t$sSecValue = '';\n\t$sSecValue = trim($_REQUEST['secvalue']);\n\t\n\tif(strcmp($sSecValue, __SEC_VALUE__) != 0)\n\t{\n\t\techo '<fail>Sec value dont match</fail>';\n\t\texit();\n\t}\n\n\t$sOldPath = '';\n\t$sOldPath = trim($_REQUEST['old-path']);\n\t\n\tif($sOldPath[0] === '/' || $sOldPath[0] === '\\\\')\n\t{\n\t\t$sOldPath = substr($sOldPath, 1);\n\t}\n\n\t$sFullPathToFile = '';\n\t$sFullPathToFile = __MAIN_DIRECTORY_PATH__.$sOldPath;\n\t\n\tif(file_exists($sFullPathToFile) === true)\n\t{\n\t\techo '<good>\\'file is exists\\'</good>';\n\t} else\n\t{\n\t\techo '<bad>\\'file not exist\\'</bad>';\n\t}\n\t\n\texit();\n}", "function jig_install_check_permissions(){\r\n\t\t\t$fixed = false;\r\n\t\t\tif(!$this->jig_cache_writable()){\r\n\t\t\t\t$plugin_chmod = chmod(dirname(__FILE__), 0755);\r\n\t\t\t\t$timthumb_chmod = chmod(dirname(__FILE__).\"/timthumb.php\", 0755);\r\n\t\t\t\t$cache_chmod = chmod(dirname(__FILE__).\"/cache\", 0755);\r\n\t\t\t\t$index_chmod = chmod(dirname(__FILE__).\"/cache/index.html\", 0755);\r\n\t\t\t\t$touch_chmod = chmod(dirname(__FILE__).\"/cache/timthumb_cacheLastCleanTime.touch\", 0755);\r\n\t\t\t\tif($plugin_chmod && $cache_chmod && $index_chmod && $touch_chmod && $timthumb_chmod){\r\n\t\t\t\t\t$fixed = true;\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tif(!$this->jig_cache_writable()){\r\n\t\t\t\tif($fixed){\r\n\t\t\t\t\tfunction timthumb_big_problem(){\r\n\t\t\t\t\t\techo \"<div class='error fade'><p>\".__('The thumbnails cache folder is not writable! <a href=\"options-general.php?page=justified-image-grid\">Click here to go to the settings where you can fix this.</a> Unless you do so your images might not appear and the plugin could only generate whitespace!', 'jig_td').\" \".__('The plugin was trying to fix it but the 0755 permission was not enough.', 'jig_td').\"</p></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tadd_action('admin_notices', 'timthumb_big_problem');\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunction timthumb_problem(){\r\n\t\t\t\t\t\techo \"<div class='error fade'><p> \".__('The thumbnails cache folder is not writable! <a href=\"options-general.php?page=justified-image-grid\">Click here to go to the settings where you can fix this.</a> Unless you do so your images might not appear and the plugin could only generate whitespace!', 'jig_td').\"</p></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tadd_action('admin_notices', 'timthumb_problem');\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif($fixed){\r\n\t\t\t\t\tfunction timthumb_fixed(){\r\n\t\t\t\t\t\techo \"<div class='updated fade'><p> \".__('The thumbnails cache folder was not writable! This was automatically fixed for you.', 'jig_td').\"</p></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tadd_action('admin_notices', 'timthumb_fixed');\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunction timthumb_perfect(){\r\n\t\t\t\t\t\techo \"<div class='updated fade'><p> \".__('The thumbnails cache folder was tested and it is writable!', 'jig_td').\"</p></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tadd_action('admin_notices', 'timthumb_perfect');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!function_exists('curl_version')){\r\n\t\t\t\tfunction jig_no_curl(){\r\n\t\t\t\t\t\techo \"<div class='updated fade'><p> \".__(\"The CURL library is missing on your server, this will affect the following features: Jetpack Photon, Download link!\", 'jig_td').\"</p></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\tadd_action('admin_notices', 'jig_no_curl');\r\n\t\t\t}\r\n\t\t}", "function FS_Allow_Access($path)\n{\n\t//Checks if it access the users local settings directory\n\treturn ((!FS_Contains_Path($path,$_SESSION[\"Novis_Root\"])&&FS_Is_Admin())||\n\t\t!FS_Is_Settings_Directory($path));\n}", "function checkAccess() ;", "function allowed($file, $dis_allowed_error, $dis_allowed_cont, $write_log){\n\n if(substr($file, 0, 1) != '/')\n if(substr($file, 0, 2) == './')\n $file = $GLOBALS['loc'] . substr($file, 2);\n else\n $file = $GLOBALS['loc'] . $file;\n\n if(!isset($GLOBALS['new_file']))\n $new_file = false;\n else\n $new_file = $GLOBALS['new_file'];\n\n if(isset($_POST['ren2'])\n || isset($_POST['cfname'])\n || isset($_FILES['userfile']))\n $new_file = true;\n\n if((is_file($GLOBALS['loc1'] . $file) || $new_file)\n && !strstr(strtolower($file), 'filelist') && !strstr($file, '..') && !strstr($file, '#') && $file != $GLOBALS['phpSelf'])\n if($GLOBALS['accept_all'])\n return true;\n else {\n foreach($GLOBALS['accept'] as $exts)\n if(strtolower($exts) == strtolower(substr($file, strlen($file) - strlen($exts), strlen($exts))))\n // get the heck out of the function\n return true;\n } // if(!$accept_all)\n\n if($dis_allowed_error)\n echo '<font color=\"red\">This file ('.$file.') is off limits. If you believe this is in error, please contact the administrator of this site immidiately.</font><br><br>';\n if($dis_allowed_cont)\n echo '<a href=\"' . $GLOBALS['phpSelf'] . '?loc=' . $GLOBALS['loc'] . '\">Click here to go back</a>';\n\n if($write_log)\n writelog('<font color=\"red\">User tried to access a forbidden file</font>', 'unknown', $file, 2);\n\n return false;\n\n}", "public function check_permissions ()\r\n\t{\r\n\t\t$dirs_to_check = array(\n\t\tROOT . DS . 'config.php', \n\t\tWWW_ROOT . 'version.txt', \n\t\tWWW_ROOT . 'sxd/', \n\t\tWWW_ROOT . 'sxd/backup', \n\t\tWWW_ROOT . 'sxd/ses.php', \n\t\tWWW_ROOT . 'sxd/cfg.php', \n\t\tWWW_ROOT . 'css/', \n\t\tWWW_ROOT . 'js/', \n\t\tWWW_ROOT . 'files/', \n\t\tWWW_ROOT . 'img/', \n\t\tWWW_ROOT . 'img/content/', \n\t\tWWW_ROOT . 'img/thumbs/', \n\t\tTMP, \n\t\tCACHE, \n\t\tCACHE . DS . 'catalog', \n\t\tCACHE . DS . 'smarty_cache', \n\t\tCACHE . DS . 'smarty_templates_c', \n\t\tTMP . 'updates', \n\t\tTMP . 'modules');\r\n\t\t$install_checks = array();\r\n\t\t\r\n\t\tforeach($dirs_to_check AS $dir)\r\n\t\t{\r\n\t\t\t$this_check = array();\r\n\t\t\tif(is_writable($dir))\r\n\t\t\t{\r\n\t\t\t\t$this_check['passed'] = 'passed';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this_check['passed'] = 'failed';\r\n\t\t\t\t$this->set('fatal_error','1');\r\n\t\t\t}\r\n\t\t\t$this_check['dir'] = $dir;\r\n\t\t\t\r\n\t\t\t$install_checks[] = $this_check;\r\n\t\t}\r\n\t\t\r\n\t\t$this->set('install_checks',$install_checks);\t\r\n\t}", "function testReadonlyDir() {\n\t\t// when a read-only directory is given\n\t\t// check the hosts file\n\t\t// for linux. use the /etc/\n\t\t// for windows, use C:\\Windows\\System32\n\t\t$hostsFile = '';\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n\t\t\t$hostsFile = 'C:\\Windows\\System32';\n\t\t}\n\t\telse {\n\t\t\t$hostsFile = '/etc';\n\t\t}\n\t\t$this->condition = new \n\t\t\t\\Chaperone4php\\Pre\\WritableFileSystemPreCondition($hostsFile);\n\t\t$this->assertFalse($this->condition->check());\n\t}", "public function testFilePathLooksCrawlableFilenameFilter() {\n // thumbs.db filenames are currently disallowed\n $expected = false;\n $actual = FilesHelper::filePathLooksCrawlable( '/path/to/thumbs.db' );\n $this->assertEquals( $expected, $actual );\n\n // Here we're changing which fil eextensions are no longer allowed.\n \\WP_Mock::onFilter( 'wp2static_filenames_to_ignore' )\n ->with(\n [\n '__MACOSX',\n '.babelrc',\n '.git',\n '.gitignore',\n '.gitkeep',\n '.htaccess',\n '.php',\n '.svn',\n '.travis.yml',\n 'backwpup',\n 'bower_components',\n 'bower.json',\n 'composer.json',\n 'composer.lock',\n 'config.rb',\n 'current-export',\n 'Dockerfile',\n 'gulpfile.js',\n 'latest-export',\n 'LICENSE',\n 'Makefile',\n 'node_modules',\n 'package.json',\n 'pb_backupbuddy',\n 'plugins/wp2static',\n 'previous-export',\n 'README',\n 'static-html-output-plugin',\n '/tests/',\n 'thumbs.db',\n 'tinymce',\n 'wc-logs',\n 'wpallexport',\n 'wpallimport',\n 'wp-static-html-output', // exclude earlier version exports\n 'wp2static-addon',\n 'wp2static-crawled-site',\n 'wp2static-processed-site',\n 'wp2static-working-files',\n 'yarn-error.log',\n 'yarn.lock',\n ]\n )\n ->reply( [ 'yarn.lock' ] );\n // We've disallowed yarn.lock - test it\n $expected = false;\n $actual = FilesHelper::filePathLooksCrawlable( '/path/to/yarn.lock' );\n $this->assertEquals( $expected, $actual );\n\n // thumbs.db filenames should now be allowed - test it\n $expected = true;\n $actual = FilesHelper::filePathLooksCrawlable( '/path/to/thumbs.db' );\n $this->assertEquals( $expected, $actual );\n }", "public function testDeprecatedFunctions() {\n $public = Settings::get('file_public_path') . '/test/public';\n \\Drupal::service('file_system')->prepareDirectory($public, FileSystemInterface::CREATE_DIRECTORY);\n $this->assertTrue(file_save_htaccess($public));\n file_ensure_htaccess();\n }", "function needsStorageDoubleAuthenticationCheck() ;", "function testSafeFile()\n {\n $config = ESAPI::getSecurityConfiguration();\n $file = $config->getResourceDirectory() . '/ESAPI.xml';\n\n $sf = null;\n try {\n $sf = new SafeFile($file);\n } catch (Exception $e) {\n $this->fail('SafeFile threw an exception during construction');\n }\n if ($sf && !$sf->isReadable()) {\n $this->fail(\"{$file} is not readable\");\n } \n \n $this->assertTrue($sf && $sf->isReadable());\n }", "public function invalidDirProvider() {}", "private static function safe(string $path): string\n\t{\n\t\t$parent = ROOT.static::DIR;\n\t\t$path = realpath($path);\n\t\tif( ! starts_with($parent, $path))\n\t\t{\n\t\t\tLog::warn(static::class, 'wanted', $path, 'outside of', $parent);\n\t\t\tthrow new PleaseNo(static::class.\" shouldn't be touching $path unless someone is messing with something...\");\n\t\t}\n\n\t\treturn $path;\n\t}", "function assertFileIsInResources($filename)\n{\n if (!$filename == realpath($filename)) {\n echo(\"File name issue, please try again.\");\n error_log(\"The real path of $filename didn't match, check for file trickery.\");\n exit;\n }\n}", "public function testPathchecker()\n {\n $this->assertTrue(MediaSourceManager::isVirtualPath('files/Movies'));\n $this->assertTrue(!MediaSourceManager::isVirtualPath(\n '/var/www/contrexx/images/content/Movies'\n )\n );\n }", "public function checkPageForMountpointRedirect() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public static function checkFileCache()\n {\n // Check the file cache.\n $strInitFilePath = '/system/config/initconfig.php';\n if (file_exists(TL_ROOT . $strInitFilePath)) {\n $strFile = new \\File($strInitFilePath);\n $arrFileContent = $strFile->getContentAsArray();\n foreach ($arrFileContent AS $strContent) {\n if (!preg_match(\"/(\\/\\*|\\*|\\*\\/|\\/\\/)/\", $strContent)) {\n //system/tmp.\n if (preg_match(\"/system\\/tmp/\", $strContent)) {\n // Set data.\n \\Message::addInfo($GLOBALS['TL_LANG']['MSC']['disabled_cache']);\n }\n }\n }\n }\n }", "function test_directories(): void {\n # Test if we can write to MAIN_DIR (needed for the .htaccess file).\n if (!is_writable(MAIN_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the installation directory to make it writable.\")\n );\n\n # Test if we can write to INCLUDES_DIR (needed for config.json.php).\n if (!is_writable(INCLUDES_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the <em>includes</em> directory to make it writable.\")\n );\n\n # Test if we can write to CACHES_DIR (needed by some extensions).\n if (!is_writable(CACHES_DIR))\n alert(\n __(\"Please CHMOD or CHOWN the <em>caches</em> directory to make it writable.\")\n );\n\n # Test if we can write to twig cache.\n if (!is_writable(CACHES_DIR.DIR.\"twig\"))\n alert(\n __(\"Please CHMOD or CHOWN the <em>twig</em> directory to make it writable.\")\n );\n\n # Test if we can write to thumbs cache.\n if (!is_writable(CACHES_DIR.DIR.\"thumbs\"))\n alert(\n __(\"Please CHMOD or CHOWN the <em>thumbs</em> directory to make it writable.\")\n );\n }", "function _checkPath( $path, $checkAdmin=1 )\n\t{\n\t\t$file = JPATH_SITE . $path;\n\t\tif ($checkAdmin > -1 && file_exists( $file )) {\n\t\t\treturn $file;\n\t\t} else if ($checkAdmin != 0) {\n\t\t\t$file = JPATH_ADMINISTRATOR . $path;\n\t\t\tif (file_exists( $file )) {\n\t\t\t\treturn $file;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function\t\tdo_path($path)\n{\n\t//\t&& mkdir($path) === FALSE)\n\t//\treturn (FALSE);\n\t//if (file_exists($path.\"/passwd\") === FALSE\n\tif(file_put_contents($path.\"/passwd\", NULL, FILE_APPEND) === FALSE)\n\t\treturn (FALSE);\n\treturn (TRUE);\n}", "private function pathSafetyCheck( $path )\n {\n // Duplication is intentional for belt-and-braces approach\n $path = Path::canonicalize( $path );\n if( ! file_exists( $path ) ){\n throw new \\Exception( \"{$path} doesn't exist.\" );\n }\n if( is_dir( $path ) ){\n // Path::canonicalize() leaves no trailing slash.\n $path .= '/';\n if( mb_substr_count( $path, '/', \"UTF-8\" ) < 3 ){\n throw new \\Exception(\"Can't use root level directories as recycle area or move or delete them: {$path}\");\n }\n }\n }", "protected function accessCheckHook()\n {\n }", "public function testGetRealPath() {\r\n $this->assertNotEquals('', $this->theme1->getRealPath(), 'test1');\r\n $this->assertEquals('', $this->theme2->getRealPath(), 'notexists');\r\n $this->assertEquals('', $this->theme3->getRealPath());\r\n $this->assertEquals('', $this->theme4->getRealPath(), '../../../../../../../etc/passwd%00');\r\n $this->assertEquals('', $this->theme5->getRealPath(), '<script>alert(document.cookie)</script>');\r\n }", "private static function\t\tinitcache_check_file(){\r\n\r\n\t\t//file : the cache directory + the page name + the closest group\r\n\t\t$group = null;\r\n\t\tif (WOME::$_page['properties']['user_cache'])\r\n\t\t\t$group = '_'.WOME::str_valid_dir(WOME::get_option('user.personal_group').WOME::$_user[get_option('user.id_index')]);\r\n\t\telse if (!empty(WOME::$_user['groups']))\r\n\t\t\t$group = '_'.WOME::str_valid_dir(WOME::$_user['groups'][0]);\r\n\r\n\t\tWOME::$cache_file = WOME::$_site['directory'].'cache/'.WOME::str_valid_dir(WOME::$_page['path']).$group;\r\n\r\n\t\tif (file_exists(WOME::$cache_file)\r\n\t\t&&\tfilemtime(WOME::$cache_file) > (time() - WOME::$_page['properties']['cache']))\r\n\t\t\treturn (true);\r\n\t\telse\r\n\t\t\treturn (false);\r\n\t}", "function fsck()\n\t{\n\t\tif ($_POST['cancel'])\n\t\t{\n\t\t\tegw_framework::redirect_link('/admin/index.php', null, 'admin');\n\t\t}\n\t\t$check_only = !isset($_POST['fix']);\n\n\t\tif (!($msgs = sqlfs_utils::fsck($check_only)))\n\t\t{\n\t\t\t$msgs = lang('Filesystem check reported no problems.');\n\t\t}\n\t\t$content = '<p>'.implode(\"</p>\\n<p>\", (array)$msgs).\"</p>\\n\";\n\n\t\t$content .= html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').\n\t\t\thtml::submit_button('cancel', lang('Cancel')).'</p>',\n\t\t\t'','/index.php',array('menuaction'=>'filemanager.filemanager_admin.fsck'));\n\n\t\t$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);\n\t}", "function testReadonlyFile() {\n\t\t// when a read-only file is given\n\t\t// check the hosts file\n\t\t// for linux. use the /etc/hosts\n\t\t// for windows, use C:\\Windows\\System32\\drivers\\etc\\hosts\n\t\t$hostsFile = '';\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n\t\t\t$hostsFile = 'C:\\Windows\\System32\\drivers\\etc\\hosts';\n\t\t}\n\t\telse {\n\t\t\t$hostsFile = '/etc/hosts';\n\t\t}\n\t\t$this->condition = new \n\t\t\t\\Chaperone4php\\Pre\\WritableFileSystemPreCondition($hostsFile);\n\t\t$this->assertFalse($this->condition->check());\n\t}", "function SecurityCleanPath($string)\n{\n global $cfg;\n \n if (empty($string)) {\n return $string;\n }\n \n $array = array(\n \"<\",\n \">\",\n \"\\\\\",\n \"//\",\n \"..\",\n \"'\"\n );\n foreach ($array as $char) {\n $string = str_replace($char, NULL, $string);\n }\n \n if ((strtolower(substr($string, - 4)) == \".txt\") || (strtolower(substr($string, - 4)) == \".nfo\")) {\n // we are good\n } else {\n $options = [\n 'user_id' => $cfg['user'],\n 'file' => 'Not a text or NFO: ' . $string,\n 'action' => $cfg[\"constants\"][\"error\"]\n ];\n $log = new \\Gratbrav\\Torrentbug\\Log\\Service();\n $log->save($options);\n \n die(\"Invalid file specified. Action has been logged.\");\n }\n return $string;\n}", "function testSafeFileLowByteInDirName()\n {\n $config = ESAPI::getSecurityConfiguration();\n $file = $config->getResourceDirectory() . chr(8) . \"/ESAPI.xml\";\n\n $this->setExpectedException('EnterpriseSecurityException');\n $sf = new SafeFile($file);\n }", "function taint_stat(){}", "private function initCheckDir()\n {\n// CHECK: Is directory for PDF available?\n if ( !is_dir( 'uploads/tx_caddy' ) )\n {\n $prompt = 'FATAL ERROR: uploads/tx_caddy not found!<br />\n ' . __METHOD__ . ' (' . __LINE__ . ')';\n die( $prompt );\n }\n }", "function enable_path($paso){\r\n\tif (($paso != \"\") && ((str_count_letra('/',$paso) > 0) || (str_count_letra('\\\\',$paso) > 0))) {\r\n\t\tif (SERVER_OS == \"linux\") {\r\n\t\t\t$ret = str_replace(\"\\\\\",\"/\",$paso);\r\n\t\t} elseif (SERVER_OS == \"windows\") {\r\n\t\t\t$ret = str_replace(\"/\",\"\\\\\",$paso);\r\n\t\t}\r\n\t} else $ret = $paso;\r\n\r\n\treturn $ret;\r\n}", "public function checkFilesAndFolders() {\n\t\t$configDir = $this->rootDir.'/conf';\n\t\tif(!is_dir($configDir)) {\n\t\t\tmkdir($configDir);\n\t\t}\n\t\t\n\t\t// Check if exists, if not create: .htaccess\n\t\t$htaccess = $this->rootDir.'/.htaccess';\n\t\tif(!file_exists($htaccess)) {\n\t\t\t$htaFile ='';\n\t\t\t$htaFile.=\"\\n\".'#AuthType Basic';\n\t\t\t$htaFile.=\"\\n\".'#AuthName \"Secured Environment\"';\n\t\t\t$htaFile.=\"\\n\".'#AuthUserFile '.$this->rootDir.'/.htpasswd';\n\t\t\t$htaFile.=\"\\n\".'#Require valid-user';\n\t\t\t$htaFile.=\"\\n\".'';\n\t\t\t$htaFile.=\"\\n\".'RewriteEngine On';\n\t\t\t$htaFile.=\"\\n\".'RewriteRule ^cnf /';\n\t\t\t$htaFile.=\"\\n\".'RewriteRule ^src /';\n\t\t\t$htaFile.=\"\\n\".'RewriteRule ^vendor /';\n\t\t\t$htaFile.=\"\\n\".'';\n\t\t\t$htaFile.=\"\\n\".'RewriteCond %{REQUEST_FILENAME} -s [OR]';\n\t\t\t$htaFile.=\"\\n\".'RewriteCond %{REQUEST_FILENAME} -l [OR]';\n\t\t\t$htaFile.=\"\\n\".'RewriteCond %{REQUEST_FILENAME} -d';\n\t\t\t$htaFile.=\"\\n\".'RewriteRule ^.*$ - [NC,L]';\n\t\t\t$htaFile.=\"\\n\".'RewriteRule ^.*$ /index.php [NC,L]';\n\t\t\t$htaFile.=\"\\n\".'';\n\t\t\t$htaFile.=\"\\n\".'';\n\t\t\tfile_put_contents($htaccess, $htaFile);\n\t\t}\n\n\t\t// Check if exists, if not create: /tmp\n\t\t$tmpDir = $this->rootDir.'/tmp';\n\t\tif(!is_dir($tmpDir)) {\n\t\t\tmkdir($tmpDir);\n\t\t}\n\t}", "function eio_realpath($path, $pri, $callback, $data = NULL)\n{\n}", "function is_scannable($filePath,\n $additionnalForbiddenDirNameList = array(),\n $additionnalForbiddenFileSuffixList = array() )\n{\n global $rootSys;\n\n $baseName = basename($filePath);\n $parentPath = str_replace('\\\\', '/', dirname($filePath));\n $parentPath = str_replace($rootSys, '', $parentPath);\n\n $forbiddenDirNameList = array_merge( array(),\n $additionnalForbiddenDirNameList);\n $forbiddenParentNameList = array('CVS');\n\n $forbiddenFileNameList = array('.', '..','CVS');\n\n $forbiddenBaseNameList = array_merge($forbiddenFileNameList,\n $forbiddenDirNameList);\n\n $forbiddenFileSuffixList = array_merge( array('.lang.php', '~'),\n $additionnalForbiddenFileSuffixList);\n\n $forbiddenFilePrefixList = array('~', '#', '\\\\.');\n\n // BASENAME CHECK\n\n if (is_file($filePath) && ! preg_match('/.php$/i',$baseName) ) return false;\n\n if (in_array($baseName, $forbiddenBaseNameList) ) return false;\n\n foreach($forbiddenFileSuffixList as $thisForbiddenSuffix)\n {\n if (preg_match('|'.$thisForbiddenSuffix.'^|', $baseName) ) return false;\n }\n\n foreach($forbiddenFilePrefixList as $thisForbiddenPrefix)\n {\n if (preg_match('|$'.$thisForbiddenPrefix.'|', $baseName) ) return false;\n }\n\n // DIRECTORY CHECK\n foreach($forbiddenDirNameList as $thisDirName)\n {\n if ( strpos($filePath, $thisDirName) !== FALSE )\n {\n return false;\n }\n }\n\n // PARENT PATH CHECK\n\n $pathComponentList = explode('/', $parentPath);\n\n foreach($pathComponentList as $thisPathComponent)\n {\n if (in_array($thisPathComponent, $forbiddenParentNameList) ) return false;\n }\n\n return true;\n}", "public function checkFolderPermissionsFilesystemPermissionsDataProvider() {}", "public static function check_download_folder_protection()\n {\n }", "function testSafeFileHighByteInDirName()\n {\n $config = ESAPI::getSecurityConfiguration();\n $file = $config->getResourceDirectory() . chr(200) . \"/ESAPI.xml\";\n\n $this->setExpectedException('EnterpriseSecurityException');\n $sf = new SafeFile($file);\n }", "function sed_file_check($path, $name, $ext)\r\n{\r\n\tglobal $L, $cfg;\r\n\tif($cfg['pfsfilecheck'])\r\n\t{\r\n\t\trequire('./datas/mimetype.php');\r\n\t\t$fcheck = FALSE;\r\n\t\tif(in_array($ext, array('jpg', 'jpeg', 'png', 'gif')))\r\n\t\t{\r\n\t\t\tswitch($ext)\r\n\t\t\t{\r\n\t\t\t\tcase 'gif':\r\n\t\t\t\t\t$fcheck = @imagecreatefromgif($path);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'png':\r\n\t\t\t\t\t$fcheck = @imagecreatefrompng($path);\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$fcheck = @imagecreatefromjpeg($path);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$fcheck = $fcheck !== FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!empty($mime_type[$ext]))\r\n\t\t\t{\r\n\t\t\t\tforeach($mime_type[$ext] as $mime)\r\n\t\t\t\t{\r\n\t\t\t\t\t$content = file_get_contents($path, 0, NULL, $mime[3], $mime[4]);\r\n\t\t\t\t\t$content = ($mime[2]) ? bin2hex($content) : $content;\r\n\t\t\t\t\t$mime[1] = ($mime[2]) ? strtolower($mime[1]) : $mime[1];\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t\tif ($content == $mime[1])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$fcheck = TRUE;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$fcheck = ($cfg['pfsnomimepass']) ? 1 : 2;\r\n\t\t\t\tsed_log(sprintf($L['pfs_filechecknomime'], $ext, $name), 'sec');\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!$fcheck)\r\n\t\t{\r\n\t\t\tsed_log(sprintf($L['pfs_filecheckfail'], $ext, $name), 'sec');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$fcheck = true;\r\n\t}\r\n\treturn($fcheck);\r\n}", "public function verifyAliasCache(){\n if( !file_exists(vibius_BASEPATH.$this->aliasCache) || !is_readable(vibius_BASEPATH.$this->aliasCache) || !is_writable(vibius_BASEPATH.$this->aliasCache)){\n throw new Exception('Alias folder does not exist or readable & writeable');\n }\n }", "function phpbb_realpath($path)\r{\r\tglobal $somCBT_root_path, $phpEx;\r\r\treturn (!@function_exists('realpath') || !@realpath($somCBT_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\r}", "function check_requirements() {\n // Check if GD is available\n //\n if (!function_exists('imagecreatetruecolor')) { \n die(\"No GD2 extension found. Check your PHP configuration\");\n };\n\n // Check if allow_url_fopen is available\n // \n if (!ini_get('allow_url_fopen')) {\n readfile('templates/missing_url_fopen.html');\n error_log(\"'allow_url_fopen' is disabled\");\n die();\n }\n\n // Check if image cache works.\n // if it doesn't, the check_cache_dir will not return, so we may not bother \n // with checking result value\n //\n Image::check_cache_dir();\n}", "protected function checkPathSafety($path) {\n $args = is_array($path) ? $path : array($path);\n\n foreach ($args as $path) {\n $isPathSafe = false;\n foreach ($this->safeLocations as $safe) {\n if (strpos($path, $safe) === 0) {\n $isPathSafe = true;\n break;\n }\n }\n\n if (!$isPathSafe) {\n $message = \"Unsafe path <$path>\";\n $this->log($message, \\CLogger::LEVEL_ERROR);\n throw new FSException($message);\n }\n }\n }", "function requireFileAccess()\r\n\t{\r\n\t\treturn 'UNKNOWN';\r\n\t}", "function\t\t\tneedPathFinal();", "function ValidatePath($path){\n\t//echo \"php.ValidatePath(\".$path.\")\\n\";\n\t//if($path && $path[0] === \"/\"){\n\t\t//echo $path.\" path has / as the first character \\n\";\n\t//\t$path = str_replace(\"/\", \"\", $path, 1);\n\t\t//echo \"AFTER: \".$path.\"\\n\";\n\t//}\n if(str_contains($path, \"\\\\\")){\n //echo $path.\" path contains \\\\ \\n\";\n \t$path = str_replace(\"\\\\\", \"/\", $path);\n \t//echo \"AFTER: \".$path.\"\\n\";\n }\n\tif(!str_contains($path, \"://\") && (substr_count($path, \"//\") > 0)){\n\t\t//echo $path.\" path contains // seperator\\n\";\n\t\t$path = str_replace(\"//\", \"/\", $path);\n\t\t//echo \"AFTER: \".$path.\"\\n\";\n\t}\n\tif(str_contains($path, \"://\") && (substr_count($path, \"//\") > 1)){\n\t\t//echo $path.\" path contains // seperator\\n\";\n\t\t$path = str_replace(\"//\", \"/\", $path);\n\t\t$path = str_replace(\":/\", \"://\", $path);\n\t\t//echo \"AFTER: \".$path.\"\\n\";\n\t}\n\tif(is_dir($path) && substr($path, -1) !== \"/\"){\n\t\t//echo $path.\" path is dirctory without trailing / \\n\";\n\t\t$path = $path.\"/\";\n\t\t//echo \"AFTER: \".$path.\"\\n\";\n\t}\n\treturn $path;\n}", "function wrapper_check() {\n\tglobal $_LANG;\n\tif( ! file_exists( ONAPP_WRAPPER_INIT ) ) {\n\t\treturn\n\t\t\tsprintf(\n\t\t\t\t\"%s \" . realpath( dirname( __FILE__ ) . '/../../../' ) . \"/includes ( %s )\",\n\t\t\t\t$_LANG[ 'onappwrappernotfound' ], $_LANG[ 'onappmakesuredirectoryisaccessible' ]\n\t\t\t);\n\t}\n\treturn null;\n}", "function gae_realpath($path)\n{\n\t$result = realpath($path);\n\tif ($result == false)\n\t{\n\t\tif (file_exists($path))\n\t\t{\n\t \t$result = $path;\n\t\t}\n\t}\n\n return $result;\n}", "function ImageProtection_userapi_FormatPaths ($args)\n{\n\tImageProtection_userapi_debug (\"Input ImageProtection_userapi_FormatPaths\");\n\tImageProtection_userapi_debug ($args);\n\n\t$ret = $args['ret'];\n\t$files = $ret['files'];\n\t$force = $ret['force'];\n\n\t$DocRoot \t= pnServerGetVar('DOCUMENT_ROOT');\n\t$http \t \t= pnServerGetProtocol();\n\t$host \t \t= pnServerGetVar('HTTP_HOST');\n\t$URL\t \t= $http.'://'.$host;\n\t$settings \t= pnModGetVar('ImageProtection');\n\n\t$lastchar = substr($URL,-1);\n\tif ($lastchar != \"/\") {\n\t\t$URL = $URL.\"/\";\n\t}\n\n\t$lastchar = substr($DocRoot,-1);\n\tif ($lastchar != \"/\") {\n\t\t$DocRoot = $DocRoot.\"/\";\n\t}\n\n\tforeach ($files as $file) {\n\n\t\tif (strpos($file,$DocRoot) !== false) {\n\t\t\t//Path over Document Root so we can use it\n\n\t\t\t$file = str_replace($DocRoot,$URL,$file);\n\t\t\t$Ffiles[] = $file;\n\t\t} else {\n\t\t\t// Path is outside Document Root so copy it to temp Dir\n\t\t\t$pathinfo\t=pathinfo($file);\n\t\t\t$filename \t= $pathinfo['basename'];\n\t\t\t$sufix \t\t= substr($filename,0,2);\n\t\t\t$tmpdir \t= $settings['path_CacheTemp'].$sufix.\"/\";\n\t\t\tif (!is_dir($tmpdir)) {\n\t\t\t\tmkdir($tmpdir);\n\t\t\t\t$fp=fopen($tmpdir.'index.html','w+');\n\t\t\t\tfclose($fp);\n\t\t\t}\n\t\t\t$dst = $tmpdir.$filename;\n\n\t\t\t$file_exists = file_exists($dst);\n\t\t\tif (!$file_exists || $force === true ) {\n\t\t\t\tcopy($file,$dst);\n\t\t\t}\n\n\t\t\t$file = str_replace($DocRoot,$URL,$dst);\n\t\t\t$Ffiles[] = $file;\n\t\t}\n\t}\n\n\t$ret['files'] = $Ffiles;\n\treturn $ret;\n}", "function testsfv($file) {\n\tif (!file_exists($file)) {\n\t\tfwrite(STDERR, \"ERROR: File $file does not exist.\\n\");\n\t\treturn;\n\t}\n\n\t$files_checked = array();\n\n\t$lines = file($file);\n\t$is_first_line = true;\n\t$force_utf8 = false;\n\tforeach ($lines as $line) {\n\t\tif ($is_first_line) {\n\t\t\t$tmp = 0;\n\t\t\t$line = str_replace(\"\\xEF\\xBB\\xBF\",'',$line,$tmp);\n\t\t\tif ($tmp > 0) $force_utf8 = true;\n\t\t\t$is_first_line = false;\n\t\t}\n\t\tif (!$force_utf8) $line = convertToUTF8($line);\n\n\t\tif (substr(trim($line),0,1) == ';') continue;\n\n\t\t$line = rtrim($line);\n\t\tif ($line == '') continue;\n\t\t$checksum = substr($line,-8);\n\t\t$origname = rtrim(substr($line,0,strlen($line)-8));\n\t\t$origname = dirname($file) . '/' . rtrim($origname);\n\t\tif (!file_exists($origname)) {\n\t\t\tfwrite(STDERR, \"WARNING: File vanished : $origname\\n\");\n\t\t} else {\n\t\t\tif (is_file($origname)) {\n\t\t\t\t$checksum2 = crc32_file($origname);\n\t\t\t\tif (strtolower($checksum) != strtolower($checksum2)) {\n\t\t\t\t\tfwrite(STDERR, \"CHECKSUM FAIL: $origname (expected $checksum, but is $checksum2)\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tglobal $show_verbose;\n\t\t\t\t\tif ($show_verbose) echo \"OK: $origname\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// For some reason, some files on a NTFS volume are \"FIFO\" pipe files?!\n\t\t\t\tfwrite(STDERR, \"Warning: $origname is not a regular file!\\n\");\n\t\t\t}\n\t\t}\n\n\t\t$origname = utf8_normalize(basename($origname));\n\t\t$files_checked[] = dirname($file) . '/' . $origname;\n\t}\n\n\t// Now check if files have vanished!\n\t$directory = dirname($file);\n\t$sd = @scandir($directory);\n\tif ($sd === false) {\n\t\tfwrite(STDERR, \"Error: Cannot scan directory $directory\\n\");\n\t} else {\n\t\tforeach ($sd as $file) {\n\t\t\tif ($file === '.') continue;\n\t\t\tif ($file === '..') continue;\n\t\t\tif (substr($file,0,1) === '.') continue;\n\t\t\tif (strtolower($file) === 'thumbs.db') continue;\n\t\t\tif (strtolower(substr($file, -4)) === '.md5') continue;\n\t\t\tif (strtolower(substr($file, -4)) === '.sfv') continue;\n\t\t\t$fullpath = $directory . '/' . $file;\n\t\t\tif (!is_dir($fullpath)) {\n\t\t\t\t$fullpath = utf8_normalize($fullpath);\n\t\t\t\tif (!in_array($fullpath,$files_checked)) {\n\t\t\t\t\tfwrite(STDERR, \"Warning: File not in SFV checksum file: $fullpath\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function fileIsValid($value)\n{\n return !in_array($value,array(\".\",\"..\",\".htaccess\",\"cache\",\"web.config\"));\n}", "public function isPrivate($path = '');", "function _checkFilesystem(){\n\t\t// Get the media component configuration settings\n\t\t$params =& JComponentHelper::getParams('com_media');\n\t\t// Set the path definitions\n\t\tdefine('JEVP_MEDIA_BASE', JPATH_ROOT.DS.$params->get('image_path', 'images'.DS.'stories'));\n\t\tdefine('JEVP_MEDIA_BASEURL', JURI::root(true).'/'.$params->get('image_path', 'images/stories'));\n\n\t\t$folder = \"jevents/jevpeople\";\n\t\t// ensure folder exists\n\t\tif (!JFolder::exists(JEVP_MEDIA_BASE.DS.$folder)) {\n\t\t\tJFolder::create(JEVP_MEDIA_BASE.DS.$folder,0777);\n\t\t}\n\t\t$folder = \"jevents/jevpeople/thumbnails\";\n\t\t// ensure folder exists\n\t\tif (!JFolder::exists(JEVP_MEDIA_BASE.DS.$folder)) {\n\t\t\tJFolder::create(JEVP_MEDIA_BASE.DS.$folder,0777);\n\t\t}\n\t}", "public function preflight() {\n\t\t/** @var \\Base $f3 */\n\t\t$f3 = \\Base::instance();\n\n\t\t$checkWriteableDirs = [\n\t\t\t$f3->TEMP,\n\t\t\t$f3->LOGS,\n\t\t\t$f3->UPLOADS,\n\t\t\t'res/',\n\t\t\t'app/data/',\n\t\t\t$f3->get('ASSETS.public_path'),\n\t\t];\n\n\t\t$preErr = [];\n\n\t\tforeach ($checkWriteableDirs as $dir)\n\t\t\tif (!is_dir($dir))\n\t\t\t\t$preErr[] = sprintf(\"Warning: '%s' does not exist!\", $dir);\n\t\t\telseif (!is_writable($dir))\n\t\t\t\t$preErr[] = sprintf(\"Warning:'%s' is not writable!\", $dir);\n\n\t\t$checkWriteableFiles = [\n\t\t\t'app/data/config.json'\n\t\t];\n\n\t\tforeach ($checkWriteableFiles as $file)\n\t\t\tif (!file_exists($file))\n\t\t\t\t$preErr[] = sprintf(\"Warning: '%s' does not exist!\", $file);\n\t\t\telseif (!is_writable($file))\n\t\t\t\t$preErr[] = sprintf(\"Warning:'%s' is not writable!\", $file);\n\n\t\treturn $preErr;\n\t}", "function setRealpath()\r\n{\r\n $__handle = Patchwork\\replace(\"Skully\\\\Application::getRealpath\", function($path)\r\n {\r\n if (substr($path, 0, 3) == 'vfs') {\r\n return $path;\r\n }\r\n else {\r\n $originalPath = realpath($path);\r\n $check = realpath(__DIR__.'/../../../');\r\n $check_r = explode(DIRECTORY_SEPARATOR, $check);\r\n if ($check_r[count($check_r)-1] == 'vendor') {\r\n $basePath = realpath(__DIR__.'/../../../../../');\r\n }\r\n else {\r\n $basePath = realpath(__DIR__.'/../../');\r\n }\r\n $newPath = str_replace($basePath, vfsStream::url('root'), $originalPath);\r\n return $newPath;\r\n }\r\n });\r\n}", "function security_prerequisite(){\n\t$defaultSalt = md5('lucidframe');\n\t$salt = trim(_cfg('securitySalt'));\n\tif(function_exists('mcrypt_encrypt') && strcmp($salt, $defaultSalt) === 0){\n\t\t$msg = 'Change your own security salt hash in the file \"/inc/security.salt\".';\n\t\t$msg .= 'Get your own hash string at <a href=\"http://phplucidframe.sithukyaw.com/hash-generator\" target=\"_blank\">phplucidframe.sithukyaw.com/hash-generator</a>.';\n\t\t_cfg('sitewideWarnings', function_exists('_t') ? _t($msg) : $msg);\n\t}\n}", "function hsf_secure_file($post_id) {\r\n\t$file = get_attached_file($post_id, true);\r\n\tif (is_dir($file)) {\r\n\t\t// get_attached_file returns the upload directory when there is no matching attachment\r\n\t\treturn true;\t\r\n\t}\r\n\t$dir = dirname($file);\r\n\t$htaccess_file = $dir . '/.htaccess';\r\n\t\r\n\tif (!is_dir($dir)) {\r\n\t\thsf_error('.htaccess file cannot be written to ' . $dir . ' because the directory does not exist');\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// Which files need to be secured?\r\n\t$files = array(basename($file));\r\n\tif ($related_files = hsf_get_related_files($post_id)) {\r\n\t\t$files = array_merge($files, $related_files);\t\r\n\t}\r\n\r\n\t// If the .htaccess file does not exist, create it\r\n\tif (!file_exists($htaccess_file)) {\r\n\t\thsf_append_htaccess($htaccess_file, $files);\r\n\t\thsf_notice('.htaccess file created to secure ' . basename($file));\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// Load .htaccess file\r\n\t$file_lines = file($htaccess_file);\r\n\r\n\t// Check to see if the .htaccess file is properly setup\r\n\t$line_numbers = array();\r\n\tfor ($i = 0; $i < count($file_lines); $i++) {\r\n\t\tswitch(hsf_trim($file_lines[$i])) {\r\n\t\t\tcase HSF_HTACCESS_NOTICE: $line_numbers['notice'] = $i; break;\r\n\t\t\tcase HSF_HTACCESS_ENTRIES_START: $line_numbers['start'] = $i; break;\r\n\t\t\tcase HSF_HTACCESS_ENTRIES_END: $line_numbers['end'] = $i; break;\r\n\t\t}\r\n\t}\r\n\tif (!isset($line_numbers['notice']) || !isset($line_numbers['start']) || !isset($line_numbers['end'])) {\r\n\t\t// The .htaccess file is not setup properly\r\n\t\thsf_append_htaccess($htaccess_file, $files);\r\n\t\thsf_notice('.htaccess file appended to secure ' . basename($file));\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// Create new .htaccess file\r\n\t$matched_files = array();\r\n\t$write_lines = array();\r\n\tfor ($i = 0; $i <= $line_numbers['start']; $i++) {\r\n\t\tif (preg_replace('/\\s+/', '', $file_lines[$i]) != '') {\r\n\t\t\t$write_lines[] = $file_lines[$i];\r\n\t\t}\r\n\t}\r\n\tfor ($i = $line_numbers['start'] + 1; $i < $line_numbers['end']; $i++) {\r\n\t\tif (preg_replace('/\\s+/', '', $file_lines[$i]) != '') {\r\n\t\t\tforeach($files as $file) {\r\n\t\t\t\tif (hsf_trim($file_lines[$i]) == 'RewriteRule ^(' . hsf_rewrite_escape_filename($file) . ') ' . hsf_get_dl_file() . '?f=$1 [L]') {\r\n\t\t\t\t\t$matched_files[] = $file;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$write_lines[] = $file_lines[$i];\r\n\t\t}\r\n\t}\r\n\tforeach($files as $file) {\r\n\t\tif (!in_array($file, $matched_files)) {\r\n\t\t\t$write_lines[] = 'RewriteRule ^(' . hsf_rewrite_escape_filename($file) . ') ' . hsf_get_dl_file() . '?f=$1 [L]' . \"\\n\";\r\n\t\t}\r\n\t}\r\n\tfor ($i = $line_numbers['end']; $i < count($file_lines); $i++) {\r\n\t\tif (preg_replace('/\\s+/', '', $file_lines[$i]) != '') {\r\n\t\t\t$write_lines[] = $file_lines[$i];\r\n\t\t}\r\n\t}\r\n\tif (!file_put_contents($htaccess_file, $write_lines)) {\r\n\t\thsf_error('could not write/replace ' . $htaccess_file);\r\n\t\treturn false;\r\n\t}\r\n\thsf_notice('.htaccess file modified to secure ' . basename($file));\r\n\treturn true;\r\n}", "public function check_paths() {\n\t\t// what CHMOD permissions should we use for the upload folders?\n\t\t$chmod = $this->config->item('tinycimm_asset_upload_chmod');\n\t\t\n\t\t// upload dir\n\t\tif (!file_exists($this->config->item('tinycimm_asset_path_full'))) {\n\t\t\t@mkdir($this->config->item('tinycimm_asset_path_full'), $chmod) or die('Error: Unable to create asset folder '.$this->config->item('tinycimm_asset_path_full').'<br/><strong>Please adjust permissions</strong>');\n\t\t}\n\t\t// cache dir\n\t\tif (!file_exists($this->config->item('tinycimm_asset_cache_path_full'))) {\n\t\t\t@mkdir($this->config->item('tinycimm_asset_cache_path_full'), $chmod) or die('Error: Unable to create asset cache folder '.$this->config->item('tinycimm_asset_cache_path_full').'<br/><strong>Please adjust permissions</strong>');\n\t\t}\n\t}", "public function testAccessControl()\n {\n $expectedContent = str_repeat('x', 1000000);\n $variantContent = str_repeat('y', 100);\n\n $result = $this->get('assets/FileTest.txt');\n $this->assertResponseEquals(200, $expectedContent, $result);\n $result = $this->get('assets/FileTest__variant.txt');\n $this->assertResponseEquals(200, $variantContent, $result);\n\n // Make this file protected\n $this->getAssetStore()->protect(\n 'FileTest.txt',\n '55b443b60176235ef09801153cca4e6da7494a0c'\n );\n\n // Should now return explicitly denied errors\n $result = $this->get('assets/55b443b601/FileTest.txt');\n $this->assertResponseEquals(403, null, $result);\n $result = $this->get('assets/55b443b601/FileTest__variant.txt');\n $this->assertResponseEquals(403, null, $result);\n\n // Other assets remain available\n $result = $this->get('assets/FileTest.pdf');\n $this->assertResponseEquals(200, $expectedContent, $result);\n $result = $this->get('assets/FileTest__variant.pdf');\n $this->assertResponseEquals(200, $variantContent, $result);\n\n // granting access will allow access\n $this->getAssetStore()->grant(\n 'FileTest.txt',\n '55b443b60176235ef09801153cca4e6da7494a0c'\n );\n $result = $this->get('assets/55b443b601/FileTest.txt');\n $this->assertResponseEquals(200, $expectedContent, $result);\n $result = $this->get('assets/55b443b601/FileTest__variant.txt');\n $this->assertResponseEquals(200, $variantContent, $result);\n\n // Revoking access will remove access again\n $this->getAssetStore()->revoke(\n 'FileTest.txt',\n '55b443b60176235ef09801153cca4e6da7494a0c'\n );\n $result = $this->get('assets/55b443b601/FileTest.txt');\n $this->assertResponseEquals(403, null, $result);\n $result = $this->get('assets/55b443b601/FileTest__variant.txt');\n $this->assertResponseEquals(403, null, $result);\n\n // Moving file back to public store restores access\n $this->getAssetStore()->publish(\n 'FileTest.txt',\n '55b443b60176235ef09801153cca4e6da7494a0c'\n );\n $result = $this->get('assets/FileTest.txt');\n $this->assertResponseEquals(200, $expectedContent, $result);\n $result = $this->get('assets/FileTest__variant.txt');\n $this->assertResponseEquals(200, $variantContent, $result);\n\n // Deleting the file will make the response 404\n $this->getAssetStore()->delete(\n 'FileTest.txt',\n '55b443b60176235ef09801153cca4e6da7494a0c'\n );\n $result = $this->get('assets/55b443b601/FileTest.txt');\n $this->assertResponseEquals(404, null, $result);\n $result = $this->get('assets/55b443b601/FileTest__variant.txt');\n $this->assertResponseEquals(404, null, $result);\n $result = $this->get('assets/FileTest.txt');\n $this->assertResponseEquals(404, null, $result);\n $result = $this->get('assets/FileTest__variant.txt');\n $this->assertResponseEquals(404, null, $result);\n }", "function check_filename($parentDir, $filename) {\n $realBase = realpath($parentDir);\n $realUserPath = realpath($parentDir . $filename);\n if ($realUserPath === false || strpos($realUserPath, $realBase) !== 0) {\n throw new Exception(\"Directory traversal attack detected!\");\n } else {\n return $realUserPath;\n }\n}", "public function testHtaccess24CreationGranted(): void\n {\n $domain = 'whatever.io';\n ConfigManager::addFile(__DIR__ . '/../resources/settings-apache24.json');\n $this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_THUMB));\n $this->assertFileEquals(__DIR__ . '/../resources/htaccess24_granted', self::$cache . '/thumb/.htaccess');\n }", "function installationCheck() {\n //file path is relative to the index.php that includes this\n if (@file_exists('config.ini.php')===false && @is_dir('installation')) {\n header(\"Location: installation/index.php\"); //Do new install\n } else if (@file_exists('config.ini.php')===true && @is_dir('installation')) {\n die('ERROR: Installation not complete. Please remove the \"installation\" directory and refresh. You can also visit us at http://brilaps.com and request support in our support forum.');\n } else if (!is_writable('includes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer')) {\n $message = 'ERROR: Installation not complete. Please review the HTMLPurifier section of the manual installation instructions found in';\n $message .= ' the \"/installation/manual_install/INSTALL.txt\" file for assistance with proper server permission configurations.';\n $message .= ' You can also visit us at http://brilaps.com and request support in our support forum.';\n die($message);\n }\n}", "function clientfiles_checkpass($client='', $hashpass='')\r\n{\r\n $clientfiles_dir = GSDATAOTHERPATH.'clientfiles/';\r\n if (($client != '') && (ctype_alnum($client)===TRUE) && (ctype_graph($hashpass)===TRUE)\r\n && (is_dir($clientfiles_dir . $client . '/')) && (is_file($clientfiles_dir . $client . '/.cfpassword')))\r\n {\r\n $passfile = $clientfiles_dir . $client . '/' . '.cfpassword';\r\n $fh = fopen($passfile, 'r') or die(\"can't read password file\");\r\n $filepass= fread($fh, filesize($passfile));\r\n fclose($fh);\r\n \r\n if ($hashpass == $filepass)\r\n {\r\n $_SESSION['cf_client'] = $client;\r\n $_SESSION['cf_password'] = $hashpass;\r\n return TRUE;\r\n }\r\n }\r\n return FALSE;\r\n}", "function is_writable_wrap($path)\n{\n\tif (strtoupper(substr(PHP_OS,0,3))!='WIN') return is_writable($path);\n\n\tif (!file_exists($path)) return false;\n\n\tif (is_dir($path))\n\t{\n\t\t/*if (false) // ideal, but too dangerous as sometimes you can write files but not delete again\n\t\t{\n\t\t\t$test=@fopen($path.'/ocp.delete.me','wt');\n\t\t\tif ($test!==false)\n\t\t\t{\n\t\t\t\tfclose($test);\n\t\t\t\tunlink($path.'/ocp.delete.me');\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t\treturn is_writable($path); // imperfect unfortunately; but unlikely to cause a problem\n\t} else\n\t{\n\t\t$test=@fopen($path,'ab');\n\t\tif ($test!==false)\n\t\t{\n\t\t\tfclose($test);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}", "function testSafeFileWithDevNull()\n {\n $file = null;\n if (substr(PHP_OS, 0, 3) == 'WIN') {\n $file = 'nul';\n } else {\n $file = '/dev/null';\n }\n\n $sf = new SafeFile($file);\n \n if (!$sf->isReadable()) {\n $this->fail(\"{$file} is not readable - %s\");\n } \n \n\t\t$this->assertTrue($sf->isReadable());\n }", "public function testHtaccess22CreationGranted(): void\n {\n $domain = 'whatever.io';\n ConfigManager::addFile(__DIR__ . '/../resources/settings-apache22.json');\n $this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_THUMB));\n $this->assertFileEquals(__DIR__ . '/../resources/htaccess22_granted', self::$cache . '/thumb/.htaccess');\n }", "function _check()\n\t{\n\t\t$prob = FALSE;\n\n\t\tif (version_compare(phpversion(), FOOL_REQUIREMENT_PHP) < 0)\n\t\t{\n\t\t\tset_notice('error',\n\t\t\t\t__('You need at least PHP version {{FOOL_REQUIREMENT_PHP}} to run {{FOOL_NAME}}. This means you have a many years old version. It is suggested to upgrade to a more recent version of PHP to avoid security issues with your server in general.'));\n\t\t\t$prob = TRUE;\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (!file_exists('assets/config.sample.php'))\n\t\t{\n\t\t\tset_notice('error',\n\t\t\t\tsprintf(__('The file %s was removed. The installation can\\'t continue without that file. You can find it in the {{FOOL_NAME}} download.'),\n\t\t\t\t\tFCPATH . 'config.sample.php'));\n\t\t\t$prob = TRUE;\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (!is_writable('content'))\n\t\t{\n\t\t\tset_notice('error',\n\t\t\t\tsprintf(__('The %s directory needs to be writable. Use this command in your shell if possible: %s or change its permissions recursively to 777 with your own FTP software. You won\\'t be able to install or run {{FOOL_NAME}} without this.'),\n\t\t\t\t\tFCPATH . 'content/',\n\t\t\t\t\t'<br/><b><code>chmod -R 777 ' . FCPATH . 'content/</code></b><br/>'));\n\t\t\t$prob = TRUE;\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (!is_writable('content/themes'))\n\t\t{\n\t\t\tset_notice('error',\n\t\t\t\tsprintf(__('The %s directory needs to be writable as well. Use this command in your shell if possible: %s or change its permissions recursively to 777 with your own FTP software. You won\\'t be able to install or run {{FOOL_NAME}} without this.'),\n\t\t\t\t\tFCPATH . 'content/themes',\n\t\t\t\t\t'<br/><b><code>chmod -R 777 ' . FCPATH . 'content/</code></b><br/>'));\n\t\t\t$prob = TRUE;\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// check if base folder is writable\n\t\tif (!is_writable('.'))\n\t\t{\n\t\t\t$whoami = FALSE;\n\n\t\t\t// if exec is enable, just check with whoami function who's running php\n\t\t\tif ($this->_exec_enabled())\n\t\t\t\t$whoami = exec('whoami');\n\n\t\t\t// if exec is not enabled, write a file and check who has the permissions on it\n\t\t\tif (!$whoami && is_writable('content') && function_exists('posix_getpwid'))\n\t\t\t{\n\t\t\t\twrite_file('content/testing_123.txt', 'testing_123');\n\t\t\t\t$whoami = posix_getpwuid(fileowner('content/testing_123.txt'));\n\t\t\t\t$whoami = $whoami['name'];\n\t\t\t\tunlink('content/testing_123.txt');\n\t\t\t}\n\n\t\t\t// if absolutely unable to tell who's the php user, just apologize\n\t\t\t// else, give a precise command for shell to enter\n\t\t\tif ($whoami != \"\")\n\t\t\t\tset_notice('warn',\n\t\t\t\t\tsprintf(__('The %s directory would be better if writable, in order to deliver automatic updates. Use this command in your shell if possible: %s'),\n\t\t\t\t\t\tFCPATH, '<br/><b><code>chown -R ' . $whoami . ' ' . FCPATH . '</code></b>'));\n\t\t\telse\n\t\t\t\tset_notice('warn',\n\t\t\t\t\tsprintf(__('The %s directory would be better if writable, in order to deliver automatic updates.<br/>It was impossible to determine the user running PHP. Use this command in your shell if possible: %s where www-data is an example (usually it\\'s www-data or Apache)'),\n\t\t\t\t\t\tFCPATH, '<br/><b><code>chown -R www-data ' . FCPATH . '</code></b><br/>'));\n\t\t\tset_notice('warn',\n\t\t\t\tsprintf(__('If you can\\'t do the above, after the installation you will be given a textfile to paste in config.php. More info after submitting.')));\n\t\t\t$prob = TRUE;\n\t\t}\n\n\t\t// there was an issue? suggest to refresh the page to check again\n\t\tif ($prob)\n\t\t{\n\t\t\tset_notice('notice',\n\t\t\t\t__('If you made any changes, just refresh this page to recheck the directory permissions.'));\n\t\t}\n\n\t\t// all good\n\t\treturn TRUE;\n\t}", "function testSafeFileWithDevNullAndPercentEncoding()\n {\n $file = null;\n if (substr(PHP_OS, 0, 3) == 'WIN') {\n $file = 'nul.%07';\n $this->setExpectedException('ValidationException');\n } else {\n $file = '/dev/null.%07';\n $this->setExpectedException('EnterpriseSecurityException');\n }\n\n $sf = new SafeFile($file);\n }", "public function testHtaccessCreationGranted(): void\n {\n $domain = 'whatever.io';\n $this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_THUMB));\n $this->assertFileEquals(__DIR__ . '/../resources/htaccess_granted', self::$cache . '/thumb/.htaccess');\n }", "function testSafeFileWithNullByteInDirName()\n {\n $config = ESAPI::getSecurityConfiguration();\n $file = $config->getResourceDirectory() . chr(0) . '/ESAPI.xml';\n\n $this->setExpectedException('EnterpriseSecurityException');\n $sf = new SafeFile($file);\n }", "public function testFileRefs() {}", "private function checkPath(): void\n {\n if ($this->collecting !== null) {\n $this->collecting = \\strpos($this->currentPath, $this->collectPath) === 0;\n }\n\n $this->extracting = \\strpos($this->currentPath, $this->extractPath) === 0;\n }", "public static function checkPublicDirectoryResourcesFilesystemOK()\n {\n if (!file_exists(public_path('favicon.ico')) && file_exists(base_path(\"public/img/synthesiscms-icon.svg\"))) {\n $pngPath = resource_path(\"assets/logos/dist/synthesiscms-icon.png\");\n $fSize = getimagesize($pngPath);\n $fW = $fSize[0];\n $fH = $fSize[1];\n $scale = min($fW, $fH) / max($fW, $fH);\n if ($fW > $fH) {\n $w = 180;\n $h = (180 * $scale);\n } else if ($fW < $fH) {\n $w = (180 * $scale);\n $h = 180;\n } else {\n $w = 180;\n $h = 180;\n }\n $icoLib = new \\PHP_ICO($pngPath, array(array($w, $h)));\n $icoLib->save_ico(public_path('favicon.ico'));\n }\n $mixManifestPath = public_path(\"/mix-manifest.json\");\n return file_exists($mixManifestPath);\n }", "private function assertPath() {\n\t\tif ( !file_exists( $this->fsPath ) ) {\n\t\t\tmkdir( $this->fsPath, 0755, true );\n\t\t}\n\t}", "public function request_filesystem_credentials($error = \\false, $context = '', $allow_relaxed_file_ownership = \\false)\n {\n }", "public function request_filesystem_credentials($error = \\false, $context = '', $allow_relaxed_file_ownership = \\false)\n {\n }", "public function sanitizeLocalUrlValidPathsDataProvider() {}", "function testLinkFile() {\n\t\t// when a read-only file is given\n\t\t// check the hosts file\n\t\t// for linux. use the /etc/hosts\n\t\t// for windows, use C:\\Windows\\System32\\drivers\\etc\\hosts\n\t\t$hostsFile = '';\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n\t\t\t$this->markTestSkipped(\"cannot test symbolic links on MSW\");\n\t\t}\n\t\t\n\t\t// create a symlink to a read-only file\n\t\t$linkFile = tempnam(sys_get_temp_dir(), 'temp_link');\n\t\t\n\t\t// tempnam() creates a file, but we just wanted the name\n\t\t// because ln command will create the file\n\t\tunlink($linkFile);\n\t\t\n\t\t$hostsFile = '/etc/hosts';\n\t\texec(sprintf(\n\t\t\t'ln -s %s %s', \n\t\t\tescapeshellarg($hostsFile), escapeshellarg($linkFile)\n\t\t));\n\t\t\n\t\t$this->assertFileExists($linkFile);\n\t\t\n\t\t// now check that the link is marked as \"not writable\"\n\t\t$this->condition = new \n\t\t\t\\Chaperone4php\\Pre\\WritableFileSystemPreCondition($hostsFile);\n\t\t$this->assertFalse($this->condition->check());\n\t\t\n\t\t// remove the one created by ln -s\n\t\tunlink($linkFile);\n\t}" ]
[ "0.6162832", "0.61566556", "0.61491203", "0.61159724", "0.6070737", "0.59994674", "0.5998058", "0.59928536", "0.59474295", "0.59018445", "0.5857511", "0.5727357", "0.5679545", "0.56793946", "0.56790173", "0.5671567", "0.56659484", "0.5660658", "0.5652361", "0.55883956", "0.55407625", "0.55328906", "0.55249405", "0.5522734", "0.5462968", "0.543361", "0.543033", "0.5424444", "0.5423387", "0.54209125", "0.5413856", "0.5413856", "0.5413856", "0.5413856", "0.5412522", "0.541215", "0.541215", "0.541215", "0.541215", "0.54109603", "0.5396882", "0.5394731", "0.53842545", "0.5360923", "0.535905", "0.53586817", "0.5347762", "0.5345726", "0.53423387", "0.5332714", "0.53276587", "0.5326343", "0.52771735", "0.52745867", "0.52730876", "0.52629435", "0.5261964", "0.5260072", "0.52559805", "0.5254703", "0.52533", "0.52529824", "0.5250932", "0.5250385", "0.52502847", "0.5249111", "0.52445245", "0.5232772", "0.52298003", "0.52191633", "0.5217759", "0.5215389", "0.52145845", "0.5191587", "0.51869345", "0.5176042", "0.5170119", "0.51686347", "0.51654834", "0.5161635", "0.5157583", "0.5152301", "0.51410013", "0.51395077", "0.5138391", "0.5132551", "0.5131366", "0.5130626", "0.5129024", "0.5128059", "0.51199234", "0.5116157", "0.51146984", "0.5103327", "0.50972724", "0.5089366", "0.50886583", "0.50886583", "0.5086556", "0.50827026" ]
0.7250315
0
function path_security_check function parse_resolution(string $res) converts a string dimension (800x600, 800X600, 800 x 600, 800 X 600) to a twoelement array
Функция path_security_check функция parse_resolution(string $res) преобразует строковое измерение (800x600, 800X600, 800 x 600, 800 X 600) в двухэлементный массив
function parse_resolution($res) { //return(explode('x', ereg_replace('[^0-9x]', '', strtolower($res)))); return(explode('x', preg_replace('/[^0-9x]/', '', strtolower($res)))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseScreenResolution( $fingerprint_Session ) {\n\t//in text format example \"1280x800\"\n\t//It outputs an associative array of integers containing the Width x Height\n\t$ScreenResolutionArray = explode( 'x', $fingerprint_Session['getCurrentResolution'] );\n\t$ScreenResolutionArray[0] = intval( $ScreenResolutionArray[0] );\n\t$ScreenResolutionArray[1] = intval( $ScreenResolutionArray[1] );\n\n\treturn $ScreenResolutionArray;\n}", "function elit_parse_dimensions( $filename ) {\n\n $re = '/\\d{3}x\\d{3}/';\n\n $match = preg_match( $re, $filename, $matches );\n\n if ( $match ) {\n $vals = explode( 'x', $matches[0] );\n $keys = array( 'width', 'height' );\n return array_combine( $keys, $vals );\n }\n\n return false;\n }", "public static function parse_path($url) {\n $p = parse_url($url);\n $path = preg_split('/[\\/x]/', trim($p['path'], '/'));\n \n $info = [];\n if (count($path) >= 2) {\n $info['width'] = $path[0];\n $info['height'] = $path[1];\n }\n\n return $info;\n }", "#[ArrayShape(['horizontal' => 'int', 'vertical' => 'int'])]\n public function getResolution() : array\n {\n $resolution = \\imageresolution($this->instance);\n if ($resolution === false) {\n throw new RuntimeException('Image could not to get resolution');\n }\n return [\n 'horizontal' => $resolution[0], // @phpstan-ignore-line\n // @phpstan-ignore-next-line\n 'vertical' => $resolution[1],\n ];\n }", "private function processDimensions($dimensions)\n\t{\n\t\tif (strpos($dimensions, 'x') !== FALSE) {\n\t\t\tlist($width, $height) = explode('x', $dimensions); // different dimensions, eg. \"210x150\"\n\t\t\t$width = intval($width);\n\t\t\t$height = intval($height);\n\t\t} else {\n\t\t\t$width = intval($dimensions); // same dimensions, eg. \"210\" => 210x210\n\t\t\t$height = $width;\n\t\t}\n\n\t\treturn array($width, $height);\n\t}", "protected function getPreferredResolution() {\n $field_definitions = $this->entityFieldManager->getFieldDefinitions('user', 'user');\n if (!isset($field_definitions['user_picture'])) {\n return FALSE;\n }\n\n $max_resolution = $field_definitions['user_picture']->getSetting('max_resolution');\n $min_resolution = $field_definitions['user_picture']->getSetting('min_resolution');\n\n // Return order: max resolution, min resolution, FALSE.\n if ($max_resolution) {\n $resolution = $max_resolution;\n }\n elseif ($min_resolution) {\n $resolution = $min_resolution;\n }\n else {\n return FALSE;\n }\n $dimensions = explode('x', $resolution);\n return array('width' => $dimensions[0], 'height' => $dimensions[1]);\n }", "protected function parseSize($string)\n {\n $size = explode('x', strtolower($string));\n if (sizeof($size) == 2) {\n return array(\n 'width' => ($size[0] > 0) ? $size[0] : null,\n 'heigth' => ($size[1] > 0) ? $size[1] : null,\n );\n }\n return false;\n }", "public function get_size(): array {\n $matches = [];\n $rows = 2;\n $cols = 50;\n if (null === $this->sizeparam) {\n return [$rows, $cols];\n }\n\n if (preg_match('/__([0-9]+)x([0-9]+)__/i', $this->sizeparam, $matches)) {\n $cols = $matches[1];\n $rows = $matches[2];\n } else {\n if (preg_match('/__([0-9]+)__/', $this->sizeparam, $matches)) {\n $cols = $matches[1];\n } else if (preg_match('/_____+/', $this->sizeparam, $matches)) {\n $cols = strlen($matches[0]);\n }\n }\n\n $rows = round($rows * 1.1);\n $cols = round($cols * 1.1);\n return [$rows, $cols];\n }", "public function dimensions(): ?array\n {\n if (null == $this->{'Page size'}) {\n return null;\n }\n\n preg_match_all(\"@([-+]?[0-9]*\\.?[0-9]+)@\", $this->{'Page size'}, $matches);\n\n [$width, $height] = $matches[0];\n\n return [self::pointsToMm((float) $width), self::pointsToMm((float) $height)];\n }", "private function parseDimensions($dimensions)\n {\n $sizes = array();\n\n $sizes = explode('x', $dimensions);\n $width = (int) isset($sizes[0]) ? $sizes[0] : env('IMAGES_DEFAULT_X', 600);\n $height = (int) isset($sizes[1]) ? $sizes[1] : env('IMAGES_DEFAULT_y', 400);\n\n if($width < 1 || $width > env('IMAGES_MAX_X', 600))\n {\n $width = env('IMAGES_DEFAULT_X', 600);\n }\n\n if($height < 1 || $height > env('IMAGES_MAX_Y', 600))\n {\n $height = env('IMAGES_DEFAULT_Y', 400);\n }\n\n return array(\n 'x' => $width,\n 'y' => $height\n );\n }", "function getImgs($s)\n{\n $len = strlen($s);\n $start = 0;\n $step = 0;\n $res = [];\n for ($i = 0; $i < $len; $i++) {\n\n if ($s[$i] == '<' && $s[$i + 1] == 'i' && $s[$i + 2] == 'm' && $s[$i + 3] == 'g') {\n $start = $i;\n while ($s[++$i] != '>' && $i < $len) {\n $step++;\n }\n// echo substr($s,$start,$step+2);\n $ipath = substr($s, $start, $step + 2);\n $ipath = substr_replace($ipath, \" width=\\\"400\\\" height=\\\"550\\\" \", 5, 0);\n// die($ipath);\n $res[] = $ipath;\n $step = 0;\n }\n }\n return $res;\n}", "public abstract function getResolution();", "private function readUrl() {\n if(!isset($_SERVER['PATH_INFO'])) return false;\n $info = $_SERVER['PATH_INFO'];\n if(strlen($info) <= 0) return false;\n $parts = explode(\"/\", $info);\n if(strlen($parts[1]) <= 0) return false;\n array_shift($parts);\n \n $output = array();\n \n if(count($parts) > 0) { \n foreach($parts as $part) {\n if(strlen($part) < 1) continue;\n $output[] = $part;\n }\n } else {\n return false;\n }\n\n return $output;\n }", "protected function _isValidPath($path) {\n $valid = false;\n\n list($width, $height, $quality) = $this->_getImageInfo();\n if ($width && $height && $quality) {\n $config = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $db = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb(\\OxidEsales\\Eshop\\Core\\DatabaseProvider::FETCH_MODE_ASSOC);\n\n // parameter names\n $names = [];\n foreach ($this->_aConfParamToPath as $paramName => $pathReg) {\n if (preg_match($pathReg, $path)) {\n $names[] = $db->quote($paramName);\n if ($paramName == \"sManufacturerIconsize\" || $paramName == \"sCatIconsize\") {\n $names[] = $db->quote(\"sIconsize\");\n }\n }\n }\n $names = implode(', ', $names);\n\n // any name matching path?\n if ($names) {\n $decodeField = $config->getDecodeValueQuery();\n\n // selecting shop which image quality matches user given\n $q = \"select oxshopid from oxconfig where (oxvarname = 'sDefaultImageQuality' or oxvarname = 'sDefaultImageQualityPhone') and\n {$decodeField} = \" . $db->quote($quality);\n\n $shopIdsArray = $db->getAll($q);\n\n // building query:\n // shop id\n $shopIds = implode(', ', array_map(function ($shopId) use ($db) {\n // probably here we can resolve and check shop id to shorten check?\n return $db->quote($shopId['oxshopid']);\n }, $shopIdsArray));\n\n\n // any shop matching quality\n if ($shopIds) {\n $checkSize1 = \"$width*$height\";\n $checkSize2 = intval($width/2).\"*\".intval($height/2); // for retina images = \"$width*$height\";\n\n // selecting config variables to check\n $q = \"select oxvartype, {$decodeField} as oxvarvalue from oxconfig\n where oxvarname in ( {$names} ) and oxshopid in ( {$shopIds} ) order by oxshopid\";\n $values = $db->getAll($q);\n foreach ($values as $value) {\n $confValues = (array) $config->decodeValue($value[\"oxvartype\"], $value[\"oxvarvalue\"]);\n foreach ($confValues as $confValue) {\n if (strcmp($checkSize1, $confValue) == 0) {\n $valid = true;\n break;\n }\n if (strcmp($checkSize2, $confValue) == 0) {\n $valid = true;\n break;\n }\n }\n }\n }\n }\n }\n return $valid;\n }", "function fn_mobile_app_resize_image($pair_data, $resolution)\n{\n $extension = 'png';\n\n if (empty($pair_data['detailed']['absolute_path'])\n || empty($resolution['width'])\n || empty($resolution['height'])\n ) {\n return [false, $extension];\n }\n\n $settings = fn_mobile_app_get_mobile_app_settings();\n $crop_when_resize = isset($settings['app_settings']['images']['crop_when_resize'])\n ? $settings['app_settings']['images']['crop_when_resize'] === 'Y'\n : false;\n\n if ($crop_when_resize) {\n list($content, $extension) = fn_mobile_app_resize_with_crop($pair_data, $resolution);\n } else {\n list($content, $extension) = fn_mobile_app_resize_with_borders($pair_data, $resolution);\n }\n\n return [$content, $extension];\n}", "protected function parseUri(): array\n\t{\n\t\t$uri = parse_url(\n\t\t\tfilter_input(INPUT_SERVER, 'REQUEST_URI'),\n\t\t\tPHP_URL_PATH\n\t\t);\n\n\t\t$parts = explode('/', $uri);\n\t\t$section = isset($parts[2]) ? $parts[1] : '';\n\n\t\treturn [$uri, $section];\n\t}", "function get_prodpic_wh($src){\n\tif (strpos($src, 'timthumb.php') !== false){\n\t\t$src_arr = explode(\"&\", $src);\n\t\tforeach ($src_arr as $x){\n\t\t\tif (substr($x, 0, 2)==\"w=\")\t\t$width = substr($x, 2);\n\t\t\tif (substr($x, 0, 2)==\"h=\")\t\t$height = substr($x, 2);\n\t\t}\n\t}\n\telse{\n\t\tlist($width, $height) = getimagesize($src);\n\t}\n\treturn array($width, $height);\n}", "private function proper_parse_str($str)\n {\n $arr = [];\n\n /*\n * TODO: Remove everything to the left of the initial query question mark, in case \"PROGRAM.pgm\" is\n * included with the query string\n *\n * if (criteria)\n * $str = substr,($str, '.pgm?');\n */\n\n $pairs = explode('&', $str);\n\n foreach ($pairs as $i) {\n list($name, $value) = explode('=', $i, 2);\n\n if (isset($arr[$name])) {\n if (is_array($arr[$name])) {\n $arr[$name][] = $value;\n }\n else {\n $arr[$name] = [$arr[$name], $value];\n }\n }\n else {\n $arr[$name] = $value;\n }\n }\n return $arr;\n }", "private function getDimensions()\n {\n $return = [];\n $dimensions = Config::get('image.dimensions');\n foreach ($dimensions as $key => $dimension) {\n $return[$key]['width'] = (int)$dimension[0];\n $return[$key]['height'] = isset($dimension[1]) ? (int)$dimension[1] : $return[$key]['width'];\n $return[$key]['crop'] = isset($dimension[2]) ? (bool)$dimension[2] : false;\n $return[$key]['quality'] = isset($dimension[3]) ? (int)$dimension[3] : Config::get('image.quality');\n }\n\n return $return;\n }", "protected function extractSvgImageSizes() {}", "public static function parseDimension($parameter)\n {\n if (is_array($parameter)) {\n $width = ArrayHelper::getValue($parameter, 0, null);\n $height = ArrayHelper::getValue($parameter, 1, $width);\n\n return [$width, $height];\n }\n\n return [$parameter, $parameter];\n }", "protected function parseStyleDimensions(string $style): array\n {\n if (is_callable($style) === true) {\n return [null, null, 'custom', false];\n }\n\n $enlarge = true;\n\n // Don't allow the package to enlarge an image\n if (str_contains($style, '?')) {\n $style = str_replace('?', '', $style);\n $enlarge = false;\n }\n\n if (str_contains($style, 'x') === false) {\n // Width given, height automatically selected to preserve aspect ratio (landscape).\n $width = $style;\n\n return [$width, null, 'landscape', $enlarge];\n }\n\n // Break out the dimensions\n @list($width, $height) = explode('x', $style, 2);\n\n // Height given, width automatically selected to preserve aspect ratio (portrait).\n if (empty($width)) {\n return [null, $height, 'portrait', $enlarge];\n }\n\n $resizing_option = substr($height, -1, 1);\n\n // Resize, then crop.\n if ($resizing_option == '#') {\n $height = rtrim($height, '#');\n\n return [$width, $height, 'crop', $enlarge];\n }\n\n // Resize by exact width/height (does not preserve aspect ratio).\n if ($resizing_option == '!') {\n $height = rtrim($height, '!');\n\n return [$width, $height, 'exact', $enlarge];\n }\n\n // Let the script decide the best way to resize.\n return [$width, $height, 'auto', $enlarge];\n }", "function composePoint2Array($point,$minx,$miny,$scale) {\n $point_teil=strrpos($point,'(')+1;\n $point_paar=substr($point,$point_teil,count($point_teil)-2);\n #echo '$point_paar: '.$point_paar;\n $point_xy=explode(' ',$point_paar);\n $pathx=round(($point_xy[0]-$minx)/$scale,2);\n $pathy=round(($point_xy[1]-$miny)/$scale,2);\n $ret['loc_x'] = $pathx;\n $ret['loc_y'] = $pathy;\n return $ret;\n }", "function si_exhibition_get_pid_path_to_concept_by_url($url) {\n $to_return = array();\n $url_info = parse_url($url);\n if ($url_info){\n $request_path = $url_info['path'];\n $fr_location = strpos($request_path,'/fedora/repository/');\n if ($fr_location !== FALSE) {\n $final_pid = urldecode(substr($request_path,$fr_location+19));\n if (strpos($final_pid,'/') > 0) {\n $final_pid = substr($final_pid,0,strpos($final_pid,'/'));\n }\n if (si_exhibition_check_valid_pid($final_pid)) {\n if (!empty($url_info['query'])) {\n parse_str($url_info['query'],$query_holder);\n if (array_key_exists('path',$query_holder)){\n //path=<blank> is valid\n if (!empty($query_holder['path'])){\n $check_pid_path = explode(',',$query_holder['path']);\n foreach($check_pid_path as $check_pid) {\n if (!si_exhibition_check_valid_pid(urldecode($check_pid))){\n print 'Invalid pid:'.$check_pid;\n return $to_return; //Invalid pid in path\n }\n }\n $to_return = $check_pid_path;\n }\n }\n }\n $to_return[] = $final_pid;\n } \n }\n }\n return $to_return;\n}", "public function getImageResolution () {}", "private function getPathInfo($path)\n {\n $regexp = '#^(.*)(' . $this->getSizeSuffixesRegexp() . ')\\.(' . $this->getExtensionsRegexp() . ')$#';\n if (preg_match($regexp, $path, $matches)) {\n return [\n 'size' => $this->getSizeFromSuffix($matches[2]),\n 'srcPath' => $this->sourcePath . '/' . $matches[1] . '.' . $matches[3],\n 'dstPath' => $this->thumbsPath . '/' . $path,\n 'extension' => $matches[3],\n ];\n } else if (preg_match('#^(.*)\\.(' . $this->getExtensionsRegexp() . ')$#', $path, $matches)) {\n return [\n 'size' => self::SIZE_FULL,\n 'srcPath' => $this->sourcePath . '/' . $matches[1] . '.' . $matches[2],\n 'dstPath' => $this->thumbsPath . '/' . $path,\n 'extension' => $matches[2],\n ];\n }\n }", "function _parsePathInfo($txt) \n { \t\n // check format\n }", "static private function analyzeRequestPath() {\n $glob = ConfigLoader::getGlobalConfig();\n //this coud also be done without regex, but im too lazy at the moment\n $reg = '/^' . preg_quote($glob['base_domain'], '/') . '/';\n $realPath = preg_replace($reg, '', $_SERVER['REQUEST_URI']); //get the real path\n return explode('/', preg_replace('/\\?.*/', '', $realPath)); //remove GET Parameters and split by /\n }", "protected function getTestImageInfo($uri) {\n $image_file = $this->container->get('image.factory')->get($uri);\n return [\n (int) $image_file->getWidth(),\n (int) $image_file->getHeight(),\n ];\n }", "protected function __getImageInfo($path) {\n\t\tif (!file_exists($path)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$fp = finfo_open(FILEINFO_MIME_TYPE);\n\t\t$mimeType = finfo_file($fp, $path);\n\n\t\tswitch ($mimeType) {\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/jpg':\n\t\t\tcase 'image/png':\n\t\t\tcase 'image/gif':\n\t\t\t\t$size = getimagesize($path);\n\t\t\t\tlist($width, $height) = $size;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$width = $height = null;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn compact('width', 'height', 'mimeType');\n\t}", "protected function extractSvgImageSizes()\n {\n $imagesSizes = [];\n\n $fileContent = file_get_contents($this->getPathname());\n // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept\n $previousValueOfEntityLoader = libxml_disable_entity_loader(true);\n $xml = simplexml_load_string($fileContent, 'SimpleXMLElement', LIBXML_NOERROR);\n\n // If something went wrong with simpleXml don't try to read information\n if ($xml === false) {\n return false;\n }\n\n libxml_disable_entity_loader($previousValueOfEntityLoader);\n $xmlAttributes = $xml->attributes();\n\n // First check if width+height are set\n if (!empty($xmlAttributes['width']) && !empty($xmlAttributes['height'])) {\n $imagesSizes = [(int)$xmlAttributes['width'], (int)$xmlAttributes['height']];\n } elseif (!empty($xmlAttributes['viewBox'])) {\n // Fallback to viewBox\n $viewBox = explode(' ', $xmlAttributes['viewBox']);\n $imagesSizes = [(int)$viewBox[2], (int)$viewBox[3]];\n }\n\n return $imagesSizes !== [] ? $imagesSizes : false;\n }", "public function parse($request) {\n if (!preg_match('#'.self::PATTERN.'#', $request, $matches)) return false;\n\n if (config('app.force_croppa_filters')) {\n $matches[4] = '-resize';\n }\n return [\n $this->relativePath($matches[1].'.'.$matches[5]), // Path\n $matches[2] == '_' ? null : (int) $matches[2], // Width\n $matches[3] == '_' ? null : (int) $matches[3], // Height\n $this->options($matches[4]), // Options\n ];\n }", "public static function getHeightWidthFromSize($size){\n if (preg_match('/^([0-9]{2,4})x([0-9]{2,4})/', $size, $matches)){\n return array('width'=>$matches[1], 'height'=>$matches[2]);\n } else if (preg_match('/^([0-9]{2,4})x\\*/', $size, $matches)){\n return array('width'=>$matches[1], 'height'=>'*');\n } else {\n return false;\n }\n }", "function getFromRealPathOEPages(){\n $a=array();\n if(isset($_GET['realurl'])){\n if($_GET['realurl']=='') return false;\n else{\n $_GET['realurl']=preg_replace('/(.+)\\?utm_.+/', '$1', $_GET['realurl']);\n $whatURL=explode('/', $_GET['realurl']);\n if(sizeof($whatURL)>0){\n \n $rec=$this->checkIsRealURLFromPages($whatURL[0]);\n if($rec!==false){\n $a['section']=$rec->id;\n if(true===array_key_exists(1, $whatURL)){\n $a[2]='id';\n $a[3]=$whatURL[1];\n if($a[1]==3){\n $a[2]='action';\n $a[3]=$whatURL[1];\n $a[4]='token';\n $a[5]=$whatURL[2];\n }elseif($a[1]==2){\n if(true!==array_key_exists(2, $whatURL)){\n $a[2]='id';\n $a[3]=$whatURL[1];\n }\n if(true===array_key_exists(2, $whatURL)){\n $a[2]=$whatURL[1];\n $a[3]=$whatURL[2];\n }\n if(true===array_key_exists(3, $whatURL)){\n $a[4]='id';\n $a[5]=$whatURL[3];\n }\n if(true===array_key_exists(4, $whatURL)){\n $a[6]='title';\n $a[7]=$whatURL[4];\n }\n }\n elseif($a[1]==4){\n $a[2]=$whatURL[1];\n $a[3]=$whatURL[2];\n }\n elseif($a[1]==5){\n $a[2]='vids';\n $a[3]=$whatURL[1];\n if(true===array_key_exists(2, $whatURL)){\n $a[4]='cat';\n $a[5]=$whatURL[2];\n }\n }elseif($a[1]==23){\n $a[2]='id';\n $a[3]=$whatURL[1];\n }\n }\n }else{\n if($whatURL[0]=='logout'){\n $a[0]='logout';\n $a[1]=1;\n }\n }\n }\n }\n }else{\n $a['section']=1;\n }\n return $a;\n }", "private function build_path_array($arg) {\n\t\tif(is_array($arg)) {\n\t\t\treturn $arg;\n\t\t} else {\n\t\t\tif(count($arg) > 0 && $arg[0] == \"/\") {\n\t\t\t\t$url = substr($arg, 1);\n\t\t\t} else {\n\t\t\t\t$url = \"{$this->name}/$arg\";\n\t\t\t}\n\t\t\treturn explode(\"/\", $url);\n\t\t}\n\t}", "private function build_path_array($arg) {\n\t\tif(is_array($arg)) {\n\t\t\treturn $arg;\n\t\t} else {\n\t\t\tif(count($arg) > 0 && $arg[0] == \"/\") {\n\t\t\t\t$url = substr($arg, 1);\n\t\t\t} else {\n\t\t\t\t$url = \"{$this->name}/$arg\";\n\t\t\t}\n\t\t\treturn explode(\"/\", $url);\n\t\t}\n\t}", "public function getGetSizePixelValues()\n {\n return [\n 'No unit' => ['1234.5', 1235],\n 'px' => ['1234.5px', 1235],\n 'em' => ['1em', 16],\n 'ex' => ['2ex', 16],\n 'pt' => ['12pt', 16],\n 'pc' => ['1pc', 16],\n 'in' => [(1 / 6).'in', 16],\n 'cm' => [(2.54 / 6).'cm', 16],\n 'mm' => [(25.4 / 6).'mm', 16],\n 'No unit with spacing' => [\" \\r \\n \\t 1234.5 \\r \\n \\t \", 1235],\n 'em with spacing' => [\" \\r \\n \\t 1234.5em \\r \\n \\t \", 19752],\n 'unknown' => ['100vw', 0],\n 'unknown mmm' => ['1mmm', 0],\n 'invalid' => ['abc', 0],\n 'invalid number' => ['12.34.5', 0],\n ];\n }", "public function getResolutionAllowableValues()\n {\n return [\n self::RESOLUTION__1X,\n self::RESOLUTION__2X,\n ];\n }", "function g2ic_get_img_info($img_path_name) {\r\n\tglobal $g2ic_rel_path;\r\n\r\n\t$src = '';\r\n\t$href = '';\r\n\t$width = '';\r\n\t$height = '';\r\n\t$alt = '';\r\n\r\n\t// Strip leading slash unless this is the root directory\r\n\t$img_path_name = (strlen($img_path_name) > 1) ? substr_replace($img_path_name, '', 0, 1) : $img_path_name;\r\n\r\n\t// Strip out %20 and replace with space\r\n\t$img_path_name = str_replace('%20', ' ', $img_path_name);\r\n\r\n\t$gallery_block_html = g2ic_imagebypathblock($img_path_name);\r\n\r\n\t// Parse out the results\r\n\tpreg_match('/src=\"[^\"]*\"/', $gallery_block_html, $src);\r\n\tpreg_match('/href=\"[^\"]*\"/', $gallery_block_html, $href);\r\n\tpreg_match('/width=\"[^\"]*\"/', $gallery_block_html, $width);\r\n\tpreg_match('/height=\"[^\"]*\"/', $gallery_block_html, $height);\r\n\tpreg_match('/alt=\"[^\"]*\"/', $gallery_block_html, $alt);\r\n\r\n\t$thumbnail_src = preg_replace('/src=\"/', '', $src[0]);\r\n\r\n\t$thumbnail_src = preg_replace('/\"/', '', $thumbnail_src);\r\n\r\n\t$thumbnail_width = $width[0];\r\n\r\n\t$thumbnail_height = $height[0];\r\n\r\n\t$thumbnail_alt_text = preg_replace('/alt=\"/', '', $alt[0]);\r\n\r\n\t$thumbnail_alt_text = preg_replace('/\"/', '', $thumbnail_alt_text );\r\n\r\n\t$image_url = preg_replace('/href=\"/', '', $href[0]);\r\n\t$image_url = preg_replace('/\"/', '', $image_url);\r\n\r\n\treturn array($thumbnail_src, $thumbnail_width, $thumbnail_height, $thumbnail_alt_text, $image_url);\r\n}", "public function Identify($sPath) {\n\n\t\t$aReturn = array(\n\t\t\t\t\t\t\t\"type\" => '',\n\t\t\t\t\t\t\t\"dimensions\" => '',\n\t\t\t\t\t\t\t\"width\" => '',\n\t\t\t\t\t\t\t\"height\" => '',\n\t\t\t\t\t\t\t\"aspect\" => ''\n\t\t\t\t\t\t);\n\t\t\n\t\tif (!file_exists($sPath)) return false;\n\t\t\n\t\t$sCmd = $this->GetPath2Identify() . \" \" . $sPath; \n\t\t\n\t\t\n\t\t$aOut = array();\n\t\t\n\t\texec($sCmd,$aOut);\n\t\t\n\t\t/* split the output from identify */\n\t\t$aBits = explode(\" \",$aOut[0]);\n\n\t\t$aReturn['type'] = $aBits[1];\n\t\t\n\t\tswitch($aReturn['type']) {\n\t\t\tcase \"GIF\" :\n\t\t\t\t$aReturn['ext'] = \".gif\";\n\t\t\t\tbreak; \n\t\t\tcase \"JPG\" :\n\t\t\tcase \"JPEG\" :\n\t\t\t\t$aReturn['ext'] = \".jpg\";\n\t\t\t\tbreak; \n\t\t\tcase \"PNG\" :\n\t\t\t\t$aReturn['ext'] = \".png\";\n\t\t\t\tbreak; \n\t\t\tdefault :\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$aReturn['dimensions'] = $aBits[2];\n\t\t\n\t\t$aBits2= explode(\"x\",$aBits[2]);\n\t\t$iWidth = (int) $aBits2[0];\n\t\t$iHeight = (int) $aBits2[1];\n\t\t$aReturn['width'] = $iWidth;\n\t\t$aReturn['height'] = $iHeight;\n\t\t$aReturn['aspect'] = ($iWidth > $iHeight) ? LANDSCAPE : PORTRAIT ;\n\t\t\n\t\treturn $aReturn;\n\n\t}", "public function getDimensions($psd_file)\n {\n $dirname = dirname($psd_file);\n $filename = basename($psd_file);\n exec(\"cd {$dirname}; identify {$filename}\", $psd_info_string);\n\n if (preg_match(\"/(PSD|PNG|JPEG) [\\d]{1,5}x[\\d]{1,5}/\", $psd_info_string[0], $result)) {\n $result = preg_split('/x/', $result[0]);\n return [\n 'width' => (int)preg_replace('/(PSD)|(PNG)|(JPEG) /', '', $result[0]),\n 'height' => (int)$result[1]\n ];\n } else {\n // The file possibly doesn't exist, or we don't have permissions to it\n throw new Exception(\"Unable to read PSD properties for ${filename}\");\n }\n }", "protected function getImageWH($path)\n {\n if($this->_type != 'image')\n return array('width' => 0, 'height' => 0);\n\n $info = @getimagesize($path);\n if(isset($info[0]) && isset($info[1]))\n return array('width' => $info[0], 'height' => $info[1]);\n\n return array('width' => 0, 'height' => 0);\n }", "private function getImageSizesFromCompactMetadata(ResourceEntity $resource, string $compactImageSizesMetadataName = ''): array {\n $sizes = [];\n if ($compactImageSizesMetadataName) {\n try {\n $metadata = $this->metadataRepository->findByNameOrId($compactImageSizesMetadataName);\n $map = $resource->getValuesWithoutSubmetadata($metadata)[0];\n $sizes = array_map(\n function (string $sizeSpec) {\n list($size, $untilPage) = explode(':', $sizeSpec);\n list($w, $h) = explode('x', $size);\n return ['untilPage' => $untilPage, 'width' => $w, 'height' => $h];\n },\n array_map('trim', explode(',', $map))\n );\n } catch (EntityNotFoundException $e) {\n }\n }\n return $sizes;\n }", "public function getThumbnailsSizes(): array\n {\n return [\n [\n [\n 'width' => 1024,\n 'height' => 768,\n ],\n true\n ],\n [\n [\n 'width' => 20,\n 'height' => 20,\n ],\n false\n ]\n ];\n }", "function check_content()\n{\n $filename = DOC_ROOT . \"/media_resource.tab\";\n // $filename = DOC_ROOT . \"/vernacular_name.tab\";\n $rec = array();\n foreach(new FileIterator($filename) as $line_number => $line) {\n if($line) {\n $values = explode(\"\\t\", trim($line));\n // [0] => map_1102231\n // [1] => 1102231\n // [2] => http://purl.org/dc/dcmitype/StillImage\n // [3] => Map\n // [4] => image/jpeg\n \n if(isset($rec[\"subtype\"][$values[3]])) $rec[\"subtype\"][$values[3]]++;\n else $rec[\"subtype\"][$values[3]] = 0;\n \n if(isset($rec[\"format\"][$values[4]])) $rec[\"format\"][$values[4]]++;\n else $rec[\"format\"][$values[4]] = 0;\n }\n }\n print_r($rec);\n}", "function affinity_mikado_get_image_dimensions($url) {\n\t\t$image_sizes = array();\n require_once(ABSPATH . 'wp-admin/includes/file.php');\n\n\t\t//is url passed?\n\t\tif ($url !== '') {\n\t\t\t//get image sizes from posts meta if attachment exists\n\t\t\t$image_sizes = affinity_mikado_get_attachment_meta_from_url($url, array('width', 'height'));\n\n\t\t\t//image does not exists in post table, we have to use PHP way of getting image size\n\t\t\tif (!count($image_sizes)) {\n\t\t\t\t//can we open file by url?\n\t\t\t\tif (ini_get('allow_url_fopen') == 1 && file_exists($url)) {\n\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($url);\n\t\t\t\t} else {\n\t\t\t\t\t//we can't open file directly, have to locate it with relative path.\n\t\t\t\t\t$image_obj = parse_url($url);\n $image_relative_path = rtrim(get_home_path(), '/') . $image_obj['path'];\n\n\t\t\t\t\tif (file_exists($image_relative_path)) {\n\t\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($image_relative_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we get width and height from some of above methods?\n\t\t\t\tif (isset($width) && isset($height)) {\n\t\t\t\t\t//set them to our image sizes array\n\t\t\t\t\t$image_sizes = array(\n\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t'height' => $height\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $image_sizes;\n\t}", "function GetFilePathArrayVer2()\n{\n\tif(!isset($_GET['MLS']))\n\t{\n\t\techo \"ERROR: You are trying to view a detailed listing without an MLS number in the URL.\";\n\t\texit();\n\t}\n\t$FilePathArray = null;\n\t$dir = \"photos/\" . $_GET['MLS'] . \"/\";\n\tif (is_dir($dir))\n\t{\n\t\tif ($dh = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif(!is_dir($dir . $file) && exif_imagetype($dir . $file))\n\t\t\t\t{\n\t\t\t\t\tif($FilePathArray == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$FilePathArray = array($dir . $file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_push($FilePathArray, $dir . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn $FilePathArray;\n\t\t}\n\t}\n}", "function amina_array_video($wr_6) {\r\n\t$set = array();\r\n\tlist($set[movie_url], $set[movie_w], $set[movie_h], $set[movie_auto]) = explode(\"|\", $wr_6);\r\n\t$set[movie_info] = $set[movie_url].\"|width={$set[movie_w]} height={$set[movie_h]} auto={$set[movie_auto]}\";\r\n\treturn $set;\r\n}", "public function parsePresentsDimensionsMultilineString(string $presentsDimensionsMultilineString): array\n {\n $presentsDimensions = preg_split('/\\n/', $presentsDimensionsMultilineString);\n foreach ($presentsDimensions as $index => $presentDimensions) {\n $presentDimensions = preg_split('/x/', $presentDimensions);\n $presentDimensions = array_map('intval', $presentDimensions);\n\n $presentsDimensions[$index] = $presentDimensions;\n }\n\n return $presentsDimensions;\n }", "public static function checkActualDimsThreaded($imgNodes){\n\t\t\n\t\t$loader = new PageLoad('ImageParserThread.php');\n\t\t$result = array();\n\t\tforeach($imgNodes as $node){\n\t\t\t$data = self::getWidthHeight($node);\n\n\t\t\t$width = $data[0];\n\t\t\t$height = $data[1];\n\t\t\t\n\t\t\t$url = $node->attributes['src'];\n\t\t\tif(!preg_match('@^https?://@i',$url) && !preg_match('/^data/',$url))\n\t\t\t\t$url = 'http://'.$node->host.'/'.ltrim($url,'/\\\\');\n\t\t\t\n\t\t\t$resp = new ImageLoadResponse();\n\t\t\t$resp->htmlWidth = $width;\n\t\t\t$resp->htmlHeight = $height;\n\t\t\t$resp->result = self::$BAD;\n\t\t\t$resp->url = $url;\n\t\t\t$resp->hash = $node->hash;\n\t\t\t$resp->actualWidth = -1;\n\t\t\t$resp->actualHeight = -1;\n\t\t\t$resp->time = -1;\n\t\t\t$result[$node->hash] = $resp;\n\t\t\t$resp->alt = (isset($node->attributes['alt'])) ? $node->attributes['alt'] : null;\n\t\t\t$resp->title = (isset($node->attributes['title'])) ? $node->attributes['title'] : null;\n\t\t\t\n\t\t\t//bad image dont need to bother checking\n\t\t\tif(empty($url) || $width === 0 || $height == 0){\n\t\t\t\t//do nothing\t\t\t\t\n\t\t\t\t\n\t\t\t//image had the entire http\n\t\t\t}elseif(preg_match('@^https?://@i',$url)){\n\t\t\t\t$loader->addPage($url, $node->hash, $width, $height);\n\t\t\t\t\t\t\t\t\n\t\t\t//data type of image\n\t\t\t}elseif(preg_match('/^data/',$url)){\n\t\t\t\t//data:[<MIME-type>][;charset=<encoding>][;base64],<data>\n\t\t\t\t$url = ltrim(strstr($url,','),',');\n\t\t\t\t$image = imagecreatefromstring($url);\n\t\t\t\t\n\t\t\t\t$x = imagesx($image);\n\t\t\t\t$y = imagesy($image);\n\t\t\t\t\n\t\t\t\t$resp->result = self::respond($image, $width, $height);\n\t\t\t\t$resp->actualWidth = $x;\n\t\t\t\t$resp->actualHeight = $y;\n\t\t\t\t\n\t\t\t//no host given\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$url = 'http://'.$node->host.'/'.ltrim($node->attributes['src'],'/\\\\');\n\t\t\t\t$loader->addPage($url, $node->hash, $width, $height);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//get the multithread request response\n\t\t$temp = $loader->exec();\n\t\t\n\t\tforeach($temp as $val){\n\t\t\tif(empty($val)) continue;\n\t\t\t\n\t\t\t$resp = new ImageLoadResponse();\n\t\t\t$resp->result = $val->result;\n\t\t\t$resp->url = $val->url;\n\t\t\t$resp->hash = $val->hash;\n\t\t\t$resp->htmlWidth = $val->htmlWidth;\n\t\t\t$resp->htmlHeight = $val->htmlHeight;\n\t\t\t$resp->actualWidth = $val->actualWidth;\n\t\t\t$resp->actualHeight = $val->actualHeight;\n\t\t\t$resp->time = $val->time;\n\t\t\t$resp->title = $result[$val->hash]->title;\n\t\t\t$resp->alt = $result[$val->hash]->alt;\n\t\t\t\n\t\t\t$result[$val->hash] = $resp;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function getiPlantID($inputFilename,$irodsPath){\n $result = new BisqueResult();\n $result->statusok = FALSE;\n // strip path, if any from filename\n $filename = preg_replace('/^.+[\\\\\\\\\\\\/]/', '', $inputFilename);\n // query bisque for a metadata document on the resource using the filename.\n $url = \"http://bovary.iplantcollaborative.org/data_service/image?tag_query=filename:\".$filename;\n $contents = @file_get_contents($url);\n if ($contents!==FALSE) { \n // parse the returned document\n if ($contents!=\"\") {\n $result->responsedocument = $contents; \n $result->statusok = FALSE;\n $xml = new SimpleXMLElement($contents);\n foreach ($xml->image as $entry) {\n if (preg_match( '/^'.$irodsPath.'$/', (string)$entry->attributes()->value) ){\n $result->resource_uniq = (string)$entry->attributes()->resource_uniq;\n $result->created = (string)$entry->attributes()->created;\n $result->name = (string)$entry->attributes()->name;\n $result->owner = (string)$entry->attributes()->owner;\n $result->permission = (string)$entry->attributes()->permission;\n $result->ts = (string)$entry->attributes()->ts;\n $result->uri = (string)$entry->attributes()->uri;\n $result->value = (string)$entry->attributes()->value;\n $result->statusok = TRUE;\n }\n }\n if ($result->statusok===FALSE) { \n $result->error = \"No match found for $irodsPath in response from $url.\";\n }\n } else { \n $result->error = \"Empty Response document from $url\";\n $result->statusok = FALSE;\n }\n } else { \n $result->error = \"No response from $url\";\n $result->statusok = FALSE;\n }\n return $result; \n}", "function get_version_detail_by_ver($ver_str)\n{\n\t// for version 1.23.456.789\n\tlogd(\"strip from: $ver_str\");\n\n\t$ver_info = array(0,0,0,0);\n\t$get_ver_str = $ver_str;\n\t$ver_num_count = 0;\n\tfor ($i0=0; $i0 <= 3; $i0++)\n\t{\n\t\t$ver_num_count ++;\n\t\t$current_pos = strpos($get_ver_str,'.');\n\t\t$ver_info[$i0] = substr($get_ver_str,0,$current_pos);\n\n\t\tif($current_pos < 1)\n\t\t{\n\t\t\t$ver_info[$i0] = $get_ver_str;\n\t\t\tbreak;\n\t\t}\n\t\t$get_ver_str = substr($get_ver_str,$current_pos+1);\n\t}\n\t// logd(\"get ver -------> $ver_info[0] -- $ver_info[1] -- $ver_info[2] -- $ver_info[3]. count: $ver_num_count\");\n\t$ret_ver = $ver_info[0];\n\tfor($i0 = 0; $i0 < $ver_num_count; $i0++)\n\t{\n\t}\n\tif($ver_num_count == 1)\n\t\treturn array( $ver_info[0]);\n\telse if($ver_num_count == 2)\n\t\treturn array( $ver_info[0], $ver_info[1]);\n\telse if($ver_num_count == 3)\n\t\treturn array( $ver_info[0], $ver_info[1],$ver_info[2]);\n\telse if($ver_num_count == 4)\n\t\treturn array( $ver_info[0], $ver_info[1],$ver_info[2],$ver_info[3]);\n\telse\n\t\treturn $ver_info;\n\t// **************** END OF Transfer version to int ********************* //\n}", "protected function _dimensions($path, $mime) {\n\t\treturn ($stat = $this->stat($path)) && isset($stat['width']) && isset($stat['height']) ? $stat['width'].'x'.$stat['height'] : '';\n\t}", "function getAllResources($problem) { \n $query = sprintf(\"SELECT * FROM data WHERE problem=%d AND user=0 AND k='resources'\", $problem);\n $result = mysql_query($query);\n $resources = mysql_fetch_array($result);\n if (!$resources || $resources == \"\") { return array(); }\n else {\n $resources = preg_split('[\\r\\n|\\n|\\r]', $resources['v']);\n $rows = array();\n foreach ($resources as $resource) {\n if ($resource == \"\") { continue; }\n $resource = preg_split('[::]', $resource);\n $rows[] = array('id' => $resource[0], 'name' => $resource[1]); \n }\n return $rows;\n }\n}", "function getResizedImageSize($image){\n\t\t$imageSize = array();\n\t\tlist($width, $height, $type, $attr) = getimagesize($image);\n\t\t//echo $width.\" width resized: \". $width/35 .\"<br/>\";\n\t\t//echo $height.\" height resized: \". $height/35 .\"<br/>\";\n\t\t//while($height>150){\n\t\t\t//$height = $height/7;\n\t\t\t//$width /= 7;\n\t\t//}\n\t\t\n\t\t//$imageSize[\"width\"] = $width/35;\n\t\t//$imageSize[\"height\"] = $height/35;\n\t\t\n\t\treturn $imageSize;\t\n\t}", "public function getDimension(): array\n {\n $fontInfo = $this->getFontInfo();\n $rotationAngle = $this->getRotationAngle();\n $width = $fontInfo->getWidth();\n $height = $fontInfo->getHeight();\n if ($rotationAngle === 90 || $rotationAngle === 270) {\n return array($height, $width);\n } else {\n return array($width, $height);\n }\n }", "public function getDimensionsList(): array;", "protected function _dimensions($path, $mime) {\n\t\treturn ($stat = $this->stat($path)) && $stat['width'] && $stat['height'] ? $stat['width'].'x'.$stat['height'] : '';\n\t}", "public static function matchPath($exp,$path){\n $exp = explode(\"/\",$exp);\n $path = explode(\"/\",$path);\n $variables = array();\n if(count($exp) == count($path)){\n for ($i = 0; $i < count($exp); $i++){\n if(!empty($exp[$i][0]) && $exp[$i][0] == \"%\"){\n $variables[substr($exp[$i],1,strlen($exp[$i]) - 1)] = $path[$i];\n } else {\n if($exp[$i] != $path[$i]){\n return false;\n }\n }\n }\n } else {\n return false;\n }\n return array(1,$variables);\n }", "function get_dimension($dimension, $widthorheight){\n if(isset($dimension) && isset($widthorheight)){\n $arr = explode('x',$dimension);\n if($widthorheight = 'w'){\n return $arr[0];\n }else{\n return $arr[count($arr)-1];\n }\n }else{\n return FALSE;\n }\n }", "public function get_dimensions($size = NULL, $width = NULL, $height = NULL) {\n $dimensions = array();\n if ($size == 'responsive') {\n $dimensions['width'] = '100%';\n $dimensions['height'] = '100%';\n }\n elseif ($size == 'custom') {\n $dimensions['width'] = (int) $width;\n $dimensions['height'] = (int) $height;\n }\n else {\n // Locate the 'x'.\n $strpos = strpos($size, 'x');\n // Width is the first dimension.\n $dimensions['width'] = substr($size, 0, $strpos);\n // Height is the second dimension.\n $dimensions['height'] = substr($size, $strpos + 1, strlen($size));\n }\n\n return $dimensions;\n }", "function imgix_extract_img_details($content) {\n\tpreg_match_all('/-([0-9]+)x([0-9]+)\\.([^\"\\']+)/', $content, $matches);\n\n\t$lookup = array('raw', 'w', 'h', 'type');\n\t$data = array();\n\tforeach ($matches as $k => $v) {\n\n\t\tforeach ($v as $ind => $val) {\n\t\t\tif (!array_key_exists($ind, $data)) {\n\t\t\t\t\t$data[$ind] = array();\n\t\t\t}\n\n\t\t\t$key = $lookup[$k];\n\t\t\tif ($key === 'type') {\n\t\t\t\tif (strpos($val, '?') !== false) {\n\t\t\t\t\t$parts = explode('?', $val);\n\t\t\t\t\t$data[$ind]['type'] = $parts[0];\n\t\t\t\t\t$data[$ind]['extra'] = $parts[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data[$ind]['type'] = $val;\n\t\t\t\t\t$data[$ind]['extra'] = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$data[$ind][$key] = $val;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $data;\n}", "function getResource() {\n # returns numerically indexed array of URI parts\n $resource_string = $_SERVER['REQUEST_URI'];\n if (strstr($resource_string, '?')) {\n $resource_string = substr($resource_string, 0, strpos($resource_string, '?'));\n }\n $resource = array();\n $resource = explode('/', $resource_string);\n array_shift($resource); \n return $resource;\n }", "protected function get_uri_from_server(): array\n {\n $this->full_uri = $this->root_uri ? explode($this->root_uri, $_SERVER['REQUEST_URI'])[1] : $_SERVER['REQUEST_URI'];//@phpstan-ignore-line\n\n // remove ? and after if exists\n $without_question = rtrim(explode('?', $this->full_uri)[0], '/');\n $request_parts = explode('/', $without_question);\n return $request_parts;\n }", "private function parseUrl():array {\n if (isset($_GET['url'])) {\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL);\n return $url = explode(\"/\", $url);\n }\n return [];\n }", "protected function explodeIdentifier()\n {\n $slashes = substr_count($this->identifier, '/');\n\n if ($slashes == 1)\n {\n // Only the solution and the report name are provided\n $path = null;\n list($solution, $name) = explode('/', $this->identifier, 2);\n }\n else if ($slashes >= 2)\n {\n // All members are provided\n $first_slash = strpos($this->identifier, '/');\n $last_slash = strrpos($this->identifier, '/');\n\n $solution = substr($this->identifier, 0, $first_slash);\n $path = substr($this->identifier, $first_slash + 1, $last_slash - $first_slash - 1);\n $name = substr($this->identifier, $last_slash + 1);\n }\n else\n {\n throw new RuntimeException(sprintf('Unable to identify report for the given string: \"%s\".', $this->identifier));\n }\n\n return array($solution, $path, $name);\n }", "public static function ExtractScheme($str) {\n $ret = array();\n $pos = strpos($str, '://');\n $scheme = null;\n if ($pos > 0) {\n\n $scheme = substr($str, 0, $pos);\n $str = substr($str, $pos + 3);\n }\n return array('scheme' => $scheme, 'remain' => $str);\n }", "function calculate_video_scaler($resx, $resy, $bbox) {\nglobal $jconf;\n\n\t$scaler = 1;\n\t$maxres = explode(\"x\", $bbox, 2);\n\n\t// Check if video is larger than bounding box\n\tif ( ( $resx > $maxres[0] ) || ( $resy > $maxres[1] ) ) {\n\t\t$scaler_x = $maxres[0] / $resx;\n\t\t$scaler_y = $maxres[1] / $resy;\n\t\t// Select minimal scaler to fit bounding box\n\t\t$scaler = min($scaler_x, $scaler_y);\n\t\t$resx_new = $jconf['video_res_modulo'] * floor(($resx * $scaler) / $jconf['video_res_modulo']);\n\t\t$resy_new = $jconf['video_res_modulo'] * floor(($resy * $scaler) / $jconf['video_res_modulo']);\n\t} else {\n\t\t// Recalculate resolution with codec modulo if needed (fix for odd resolutions)\n\t\t$resx_new = $resx;\n\t\t$resy_new = $resy;\n\t\tif ( ( ( $resx % $jconf['video_res_modulo'] ) > 0 ) || ( ( $resy % $jconf['video_res_modulo'] ) > 0 ) ) {\n\t\t\t$resx_new = $jconf['video_res_modulo'] * floor($resx / $jconf['video_res_modulo']);\n\t\t\t$resy_new = $jconf['video_res_modulo'] * floor($resy / $jconf['video_res_modulo']);\n\t\t}\n\t}\n\n\t$new_resolution = array (\n\t\t'scaler' => $scaler,\n\t\t'x'\t\t => $resx_new,\n\t\t'y'\t\t => $resy_new,\n\t);\n\n\treturn $new_resolution;\n}", "function get_image_size($name) {\n\t\t$file['site_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['email_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['site_favicon'] = array('width' => '50', 'height' => '50');\n\t\t$file['store_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['footer_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['app_logo'] = array('width' => '140', 'height' => '140');\n\t\t$file['driver_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['driver_white_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['home_slider'] = array('width' => '1300', 'height' => '500');\n\t\t$file['dietary_icon_size'] = array('width' => '256', 'height' => '256');\n\t\t$file['item_image_sizes'] = [\n\t\t\tarray('width' => '120', 'height' => '120'),\n\t\t\tarray('width' => '600', 'height' => '350'),\n\t\t\tarray('width' => '520', 'height' => '320'),\n\t\t];\n\t\t$file['category_image_size'] = array('width' => '250', 'height' => '140');\n\t\t$file['store_image_sizes'] = [\n\t\t\tarray('width' => '520', 'height' => '320'),\n\t\t\tarray('width' => '520', 'height' => '280'),\n\t\t\tarray('width' => '480', 'height' => '320'),\n\t\t\tarray('width' => '100', 'height' => '100'),\n\t\t];\n\n\t\treturn $file[$name];\n\t}", "private function extractMemoryInfo($memory_string) {\n\t\t\t// Extract memory info\t\t\t\t\n\t\t\tpreg_match('/contents={.*}/',$memory_string,$matches);\n\t\t\t\n\t\t\t$memory_string = substr($matches[0],10,-1);\t\t\t\n\t\t\t$memory_parts = explode(',',$memory_string);\n\t\t\t\n\t\t\t$memory_output = array();\n\t\t\tforeach ($memory_parts as $memory) {\n\t\t\t\tlist($name,$value) = array_map('trim',explode('=',$memory));\n\t\t\t\t$memory_output[$name] = $value;\n\t\t\t}\n\t\t\t\n\t\t\treturn $memory_output;\n\t\t}", "public static function getImageDimensions(\\DOMNode $img): ?array\n {\n\n $width = (int)($img->getAttribute('width') ?: null);\n $height = (int)($img->getAttribute('height') ?: null);\n\n if ($width && $height) {\n return [\n 'width' => $width,\n 'height' => $height,\n ];\n }\n\n $imageUrl = (string)static::parseRef($img->getAttribute('src'));\n if ($imageUrl === '' || $imageUrl === '0') {\n return null;\n }\n\n /** @var RetconSettings $settings */\n $settings = Retcon::$plugin->getSettings();\n $basePath = $settings->baseTransformPath;\n $siteUrl = UrlHelper::siteUrl();\n $host = \\parse_url($siteUrl, PHP_URL_HOST);\n\n $imageUrlInfo = \\parse_url($imageUrl);\n $imagePath = $imageUrlInfo['path'] ?? null;\n if (!$imagePath) {\n return null;\n }\n\n $imageIsLocal = !(isset($imageUrlInfo['host']) && $imageUrlInfo['host'] !== $host);\n if (!$imageIsLocal) {\n return null;\n }\n\n $imageAbsolutePath = static::fixSlashes($basePath . '/' . $imagePath);\n\n if (!\\file_exists($imageAbsolutePath) || \\is_dir($imageAbsolutePath)) {\n return null;\n }\n\n $imageSize = \\getimagesize($imageAbsolutePath) ?: [];\n\n if (empty($imageSize)) {\n return null;\n }\n\n $width = (int)($imageSize[0] ?? null);\n $height = (int)($imageSize[1] ?? null);\n\n if (!$width || !$height) {\n return null;\n }\n\n return [\n 'width' => $width,\n 'height' => $height,\n ];\n\n }", "function tripal_scidas_split_url(string $url) {\n\n // TODO: should this go into blend4php?\n // First check a URL with a port.\n $matches = [];\n if (preg_match('/^(.*)\\:\\/\\/(.+?)\\:(\\d+)\\/*$/', $url, $matches)) {\n $protocol = $matches[1];\n $host = $matches[2];\n $port = $matches[3];\n $use_https = FALSE;\n if ($protocol == 'https') {\n $use_https = TRUE;\n }\n }\n // Next check a URL without a port.\n else {\n if (preg_match('/^(.*)\\:\\/\\/(.+?)\\/*$/', $url, $matches)) {\n $protocol = $matches[1];\n $host = $matches[2];\n $use_https = FALSE;\n $port = 80;\n if ($protocol == 'https') {\n $use_https = TRUE;\n $port = 443;\n }\n }\n // For simple url w/port ie. localhost:8080.\n else {\n if (preg_match('/(.*)\\:(\\d+)\\/*$/', $url, $matches)) {\n $use_https = FALSE;\n $host = $matches[1];\n $port = $matches[2];\n }\n }\n }\n return [\n 'host' => $host,\n 'port' => $port,\n 'use_https' => $use_https,\n ];\n}", "function fluid_edge_get_image_dimensions($url) {\n\t\t$image_sizes = array();\n\n\t\t//is url passed?\n\t\tif($url !== '') {\n\t\t\t//get image sizes from posts meta if attachment exists\n\t\t\t$image_sizes = fluid_edge_get_attachment_meta_from_url($url, array('width', 'height'));\n\n\t\t\t//image does not exists in post table, we have to use PHP way of getting image size\n\t\t\tif(!count($image_sizes)) {\n\t\t\t\t//can we open file by url?\n\t\t\t\tif(ini_get('allow_url_fopen') == 1 && file_exists($url)) {\n\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($url);\n\t\t\t\t} else {\n\t\t\t\t\t//we can't open file directly, have to locate it with relative path.\n\t\t\t\t\t$image_obj = parse_url($url);\n\t\t\t\t\t$image_relative_path = $_SERVER['DOCUMENT_ROOT'].$image_obj['path'];\n\n\t\t\t\t\tif(file_exists($image_relative_path)) {\n\t\t\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($image_relative_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we get width and height from some of above methods?\n\t\t\t\tif(isset($width) && isset($height)) {\n\t\t\t\t\t//set them to our image sizes array\n\t\t\t\t\t$image_sizes = array(\n\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t'height' => $height\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $image_sizes;\n\t}", "function explode_uri($uri)\n{\n return preg_split('/\\//', $uri, -1, PREG_SPLIT_NO_EMPTY);\n}", "public static function ExtractHostAndPort($str,$hadScheme=false) {\n $ret = array();\n $pos = strpos($str, '/');\n if ($pos <= 0) {\n $pos = strpos($str, '?');\n\n if ($pos <= 0) {\n $pos = strpos($str, '#');\n if ($pos <= 0) {\n $pos = strlen($str);\n }\n }\n }\n $host = null;\n $port = null;\n $temp = $str;\n if ($pos > 0) {\n $temp = substr($str, 0, $pos);\n }\n if (strlen($temp) > 0) {\n $portPos = strpos($str, ':');\n \n if ($portPos > 0) {\n $hostAndPort = explode(':', $temp);\n $host = $hostAndPort[0];\n \n $port = intval($hostAndPort[1]);\n $str = substr($str, $pos == 0 ? strlen($str) : $pos);\n } else {\n if(strpos($temp,'.')>0 || $hadScheme){\n $host = $temp;\n $str = substr($str, $pos == 0 ? strlen($str) : $pos);\n }else{\n $host = '';\n \n }\n }\n }\n\n return array('host' => $host, 'port' => $port, 'remain' => $str);\n }", "private function getStreamArray(){\n parse_str($this->getVideoInfo(), $data);\n $stream_link = $data[\"url_encoded_fmt_stream_map\"];\n return explode(\",\", $stream_link); \n }", "private function getStreamArray(){\n parse_str($this->getVideoInfo(), $data);\n $stream_link = $data[\"url_encoded_fmt_stream_map\"];\n return explode(\",\", $stream_link); \n }", "public function getProbableResolution()\n {\n return Geometry::parseString($this->name);\n }", "function tep_parse_category_path($cPath) {\n// make sure the category IDs are integers\n $cPath_array = array_map('tep_string_to_int', explode('_', $cPath));\n\n// make sure no duplicate category IDs exist which could lock the server in a loop\n $tmp_array = array();\n $n = sizeof($cPath_array);\n for ($i=0; $i<$n; $i++) {\n if ($cPath_array[$i] == 0) continue;\n if (!in_array($cPath_array[$i], $tmp_array)) {\n $tmp_array[] = $cPath_array[$i];\n }\n }\n\n return $tmp_array;\n }", "function wms_formats ( $dom )\n{\n\t$xpath = new DOMXPath($dom);\n\t$query = '//WMT_MS_Capabilities/Capability/Request/GetMap/Format';\n\t$entries = $xpath->query($query);\n\tif($entries == FALSE || $entries->length == 0){\n\t\t$teste = $xpath->registerNamespace(\"tag\", \"http://www.opengis.net/wms\");\n\t\t$q = '/tag:WMS_Capabilities/tag:Capability/tag:Request/tag:GetMap/tag:Format';\n\t\t$entries = $xpath->query($q);\n\t}\n\t$arr = array();\n\tforeach ($entries as $entry)\n\t{\n\t\t$arr[] = $entry->nodeValue;\n\t}\n\treturn $arr;\n}", "public static function str2array($str)\r\n\t\t{\r\n\t\t\t$rest = array();\r\n\t\t\tif(strpos($str,'|')>0)\r\n\t\t\t{\r\n\t\t\t\t$array = explode('|',$str);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$array=array($str);\r\n\t\t\t}\r\n\t\t\tforeach($array as $token)\r\n\t\t\t{\r\n\t\t\t\tlist($key,$value) = explode('&',$token);\r\n\t\t\t\t$nkey=base64_decode($key);\r\n\t\t\t\t$nvalue = (substr($value,0,1) != '$' ? base64_decode($value) : str2array(base64_decode(substr($value,1))) );\r\n\t\t\t\t$rest[$nkey] = $nvalue;\r\n\t\t\t\t//printf(\"Decoded %s,%s to %s,%s\\n\",$key,$value,$nkey,$nvalue);\r\n\t\t\t}\r\n\t\t\treturn $rest;\r\n\t\t}", "function parseMimeType($str) {\n\n $parameters = [];\n // If no q= parameter appears, then quality = 1.\n $quality = 1;\n\n $parts = explode(';', $str);\n\n // The first part is the mime-type.\n $mimeType = array_shift($parts);\n\n $mimeType = explode('/', trim($mimeType));\n if (count($mimeType) !== 2) {\n // Illegal value\n return null;\n }\n list($type, $subType) = $mimeType;\n\n foreach ($parts as $part) {\n\n $part = trim($part);\n if (strpos($part, '=')) {\n list($partName, $partValue) =\n explode('=', $part, 2);\n } else {\n $partName = $part;\n $partValue = null;\n }\n\n // The quality parameter, if it appears, also marks the end of\n // the parameter list. Anything after the q= counts as an\n // 'accept extension' and could introduce new semantics in\n // content-negotation.\n if ($partName !== 'q') {\n $parameters[$partName] = $part;\n } else {\n $quality = (float)$partValue;\n break; // Stop parsing parts\n }\n\n }\n\n return [\n 'type' => $type,\n 'subType' => $subType,\n 'quality' => $quality,\n 'parameters' => $parameters,\n ];\n\n}", "public function validProvider(): array\n {\n return [\n // Format: version, expanded, alternate, condensed, hex, long, base64 encoded binary\n 'ipv4 localhost' => [4, '127.0.0.1', '127.0.0.1', '127.0.0.1', '0x7f000001', '2130706433', 'AAAAAAAAAAAAAAAAfwAAAQ=='],\n 'ipv4 class C' => [4, '192.168.1.4', '192.168.1.4', '192.168.1.4', '0xc0a80104', '3232235780', 'AAAAAAAAAAAAAAAAwKgBBA=='],\n 'ipv6 localhost' => [6, '0000:0000:0000:0000:0000:0000:0000:0001', '0:0:0:0:0:0:0:1', '::1', '0x00000000000000000000000000000001', '1', 'AAAAAAAAAAAAAAAAAAAAAQ=='],\n 'ipv6 google dns#1' => [\n 6,\n '2001:4860:4860:0000:0000:0000:0000:8888',\n '2001:4860:4860:0:0:0:0:8888',\n '2001:4860:4860::8888',\n '0x20014860486000000000000000008888',\n '42541956123769884636017138956568135816',\n 'IAFIYEhgAAAAAAAAAACIiA=='\n ],\n 'ipv6 google dns#2' => [\n 6,\n '2001:4860:4860:0000:0000:0000:0000:8844',\n '2001:4860:4860:0:0:0:0:8844',\n '2001:4860:4860::8844',\n '0x20014860486000000000000000008844',\n '42541956123769884636017138956568135748',\n 'IAFIYEhgAAAAAAAAAACIRA=='\n ],\n 'google #1' => [\n 6,\n '2A00:1450:4017:0805:0000:0000:0000:200E',\n '2a00:1450:4017:805:0:0:0:200e',\n '2a00:1450:4017:805::200e',\n '0x2a00145040170805000000000000200e',\n '55827987829246424630098187155429924878',\n 'KgAUUEAXCAUAAAAAAAAgDg=='\n ],\n 'yahoo #1' => [\n 6,\n '2a00:1288:0110:0002:0000:0000:0000:4001',\n '2a00:1288:110:2:0:0:0:4001',\n '2a00:1288:110:2::4001',\n '0x2a001288011000020000000000004001',\n '55827951681698262191806107587214065665',\n 'KgASiAEQAAIAAAAAAABAAQ=='\n ]\n ];\n }", "function osc_parse_category_path($cPath) {\n// make sure the category IDs are integers\n $cPath_array = array_map('osc_string_to_int', explode('_', $cPath));\n\n// make sure no duplicate category IDs exist which could lock the server in a loop\n $tmp_array = array();\n $n = sizeof($cPath_array);\n for ($i=0; $i<$n; $i++) {\n if (!in_array($cPath_array[$i], $tmp_array)) {\n $tmp_array[] = $cPath_array[$i];\n }\n }\n\n return $tmp_array;\n }", "public static function ExtractPath($str) {\n $ret = array();\n $pos = strpos($str, '?');\n if ($pos <= 0) {\n $pos = strpos($str, '#');\n\n if ($pos <= 0) {\n //$pos = strrpos($str, '/');\n $pos = strlen($str);\n //\n }\n } \n $path = null;\n\n $temp = $str;\n if ($pos > 0) {\n $temp = substr($str, 0, $pos);\n }\n if (strlen($temp) > 0) {\n\n $str = substr($str, $pos == 0 ? strlen($str) : $pos);\n $path = $temp;\n }\n\n return array('path' => $path, 'remain' => $str);\n }", "public function ShortStringType()\n{\n$sim['res'][0]=['base'=>'xsd:string'];\n$sim['res'][0]['mxl'][0]=['1024'];\nreturn $sim;\n}", "function wprichfeeds_process_image_url($image_url) {\n\t$i = array();\n\t\n\tif ($image_url != '' ) {\n\t\t$i['url'] \t= '';\n\t\t$i['path'] \t= '';\n\t\t$i['size'] \t= '';\n\t\t$i['type']\t= '';\n\t\t$i['width'] = '';\n\t\t$i['height']= '';\n\t\t$i['attr'] \t= '';\n\t\t$i['mime'] \t= '';\n\t\t\n\t\t$i['url'] \t= apply_filters('wprichfeeds_image_url',$image_url);\n\t\t$i['path'] = apply_filters('wprichfeeds_image_path',$image_url);\t\t\n\t\t\n\t\tif (trim($i['path']) != '')\n\t\t\tlist($i['width'], $i['height'], $i['type'], $i['attr'], $i['mime']) = getimagesize($i['path']);\t\t\t\n\t\t\t\n\t\tif (trim($i['type']) != '')\n\t\t\t$i['type'] = image_type_to_mime_type($i['type']);\n\t\telseif (version_compare( phpversion(), '4.3.0', '>=' ))\n\t\t\t$i['type'] = $i['mime'];\n\t\t\n\t\tif ( substr($i['url'],0,strlen(get_bloginfo('url')) == get_bloginfo('url') ) ) {\n\t\t\tif (version_compare( phpversion(), '5.0', '>=' )) {\n\t\t\t\ttry {\n\t\t\t\t $i['size']\t= filesize($i['path']);\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// \n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( filesize($i['path']) !== false) {\n\t\t\t\t\t$i['size']\t= filesize($i['path']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $i;\n}", "function parseURL($url){\n $urlExploded = explode('/', $url); //Separa la URL por '/' y la guarda en un arreglo para acceder las partes por posición.\n //REQUEST_METHOD devuelve el método usado, 'GET' 'POST' 'PUT' 'DELETE' etc.\n $arrayReturn[ConfigApi::$RESOURCE] = $urlExploded[0] . '#' . $_SERVER['REQUEST_METHOD']; //Guarda valor de la $urlExploded[0] (url # método), en la primera posicion de $arrayReturn.\n\n //Si están seteados los parámetros hace un array_slice (Agarra todo lo que haya desde la posición 1 en adelante, ($urlExploded,1)\n //osea todo lo que haya luego de la action, y lo pone junto). Si no están seteados pone null. (Guarda resultado en $arrayReturn como $PARAMS).\n $arrayReturn[ConfigApi::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded,1) : null;\n return $arrayReturn;\n}", "public static function validateUri()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 2000),\n\t\t);\n\t}", "function pathinfo($path)\n{\n return array();\n}", "public function getSpaceByNameFromResponse(string $name): array {\n\t\t$response = json_decode((string)$this->featureContext->getResponse()->getBody(), true, 512, JSON_THROW_ON_ERROR);\n\t\t$spaceAsArray = $response;\n\t\tif (isset($response['name']) && $response['name'] === $name) {\n\t\t\treturn $response;\n\t\t}\n\t\tif (isset($spaceAsArray[\"value\"])) {\n\t\t\tforeach ($spaceAsArray[\"value\"] as $spaceCandidate) {\n\t\t\t\tif ($spaceCandidate['name'] === $name) {\n\t\t\t\t\treturn $spaceCandidate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [];\n\t}", "function pathinfo($path)\n{\n\treturn array();\n}", "public function getDimensions($dim = \"string\") {\n\t\tif($this->getField('Filename')) {\n\n\t\t\t$imagefile = $this->getFullPath();\n\t\t\tif( $this->fileExists() ) {\n\t\t\t\t$size = getimagesize($imagefile);\n\t\t\t\treturn ($dim === \"string\") ? \"$size[0]x$size[1]\" : $size[$dim];\n\t\t\t} else {\n\t\t\t\treturn ($dim === \"string\") ? \"file '$imagefile' not found\" : null;\n\t\t\t}\n\t\t}\n\t}", "protected function getTilingDataZoomify($path): ?array\n {\n if ($this->hasAmazonS3) {\n $path = $this->store->getUri($path);\n }\n $xml = @simplexml_load_file($path, 'SimpleXMLElement', LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_PARSEHUGE);\n if (!$xml) {\n return null;\n }\n $properties = $xml->attributes();\n $properties = reset($properties);\n\n $tilingData = [];\n $tilingData['tile_type'] = 'zoomify';\n $tilingData['metadata_path'] = '';\n $tilingData['media_path'] = '';\n $tilingData['url_base'] = $this->tileBaseUrl;\n $tilingData['path_base'] = $this->hasAmazonS3 ? $this->tileBaseUrl : $this->tileBaseDir;\n $tilingData['url_query'] = $this->tileBaseQuery;\n $tilingData['size'] = (int) $properties['TILESIZE'];\n $tilingData['overlap'] = 0;\n $tilingData['total'] = (int) $properties['NUMTILES'];\n $tilingData['source']['width'] = (int) $properties['WIDTH'];\n $tilingData['source']['height'] = (int) $properties['HEIGHT'];\n $tilingData['format'] = $properties['FORMAT'] ?? 'jpg';\n return $tilingData;\n }", "function GetArrFromColonString ( $str )\r\n{\r\n\t$arr = array();\r\n\tif ( $str )\r\n\t\t$arr = explode ( '::', trim( $str, ':' ) );\r\n\t\t\r\n\treturn $arr;\r\n}", "function wms_formatsinfo ( $dom )\n{\n\t$xpath = new DOMXPath($dom);\n\t$query = '//WMT_MS_Capabilities/Capability/Request/GetFeatureInfo/Format';\n\t$entries = $xpath->query($query);\n\tif($entries == FALSE || $entries->length == 0){\n\t\t$teste = $xpath->registerNamespace(\"tag\", \"http://www.opengis.net/wms\");\n\t\t$q = '/tag:WMS_Capabilities/tag:Capability/tag:Request/tag:GetCapabilities/tag:Format';\n\t\t$entries = $xpath->query($q);\n\t}\n\t$arr = array();\n\tforeach ($entries as $entry)\n\t{\n\t\t$arr[] = $entry->nodeValue;\n\t}\n\treturn $arr;\n}", "function imgix_extract_imgs($content) {\n\tpreg_match_all('/src=[\"\\']http.+\\/([^\\s]+?)[\"\\']/', $content, $matches);\n\t$results = array();\n\n\tif (sizeof($matches) > 0) {\n\t\tforeach ($matches[1] as $k => $v) {\n\t\t\tif (strpos($v, '?') !== false) {\n\t\t\t\t$parts = explode('?', $v);\n\t\t\t\tarray_push($results, array('url' => $parts[0], 'params' => $parts[1]));\n\t\t\t} else {\n\t\t\t\tarray_push($results, array('url' => $v, 'params' => ''));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $results;\n}", "function _parseBinResult($result){\n\t\t\t\n\t\t\t$result = explode('&',$result);\n\t\t\t$parsed_result = array();\n\t\t\tforeach ($result as $param_value){\n\t\t\t\t\n\t\t\t\t$param_value = explode('=',$param_value,2);\n\t\t\t\t$parsed_result[$param_value[0]] = $param_value[1];\n\t\t\t}\n\t\t\treturn $parsed_result;\n\t\t}", "function _getThumbnailDimensions($parameters=array()) {\r\n\r\n\t\t\t\t\t$result = array();\r\n\r\n\t\t\t\t\t// First of all some minor performance tweaking\r\n\t\t\t\t\t// with a little help of an internal info cache\r\n\r\n\t\t\t\t\t$cacheKey = $this->_getUniqueThumbnailIdentifier($parameters);\r\n\t\t\t\t\tif (isset($this->_thumbInfoCache[$cacheKey])) {\r\n\r\n\t\t\t\t\t\t// We have a cachehit\r\n\t\t\t\t\t\t// That means we calculated the dimensions\r\n\t\t\t\t\t\t// before and just redeliver the result\r\n\t\t\t\t\t\t$result = $this->_thumbInfoCache[$cacheKey];\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// No cachehit - Let's do some fetching or calculation\r\n\t\t\t\t\t\t// to get that thumbnail dimensions\r\n\r\n\t\t\t\t\t\tif (file_exists($this->_getUniqueThumbnailPath($parameters))) {\r\n\r\n\t\t\t\t\t\t\t// Hehe, we have a file - Let's get the dimensions directly\r\n\t\t\t\t\t\t\t$size = getimagesize($this->_getUniqueThumbnailPath($parameters));\r\n\t\t\t\t\t\t\t$result['width'] = $size[0];\r\n\t\t\t\t\t\t\t$result['height'] = $size[1];\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t// Hmmm. no file generated yet. We have to do an calculation\r\n\t\t\t\t\t\t\t// based on the given parameters\r\n\r\n\t\t\t\t\t\t\t// Since i don't want to reverse engeneer phpThumb\r\n\t\t\t\t\t\t\t// (and i hope that future versions won't change that much)\r\n\t\t\t\t\t\t\t// i'll use internal methods of the phpThumb class for that\r\n\r\n\t\t\t\t\t\t\trequire_once realpath(dirname(__file__) . '/' . YAPB_PHPTHUMB_DIR . '/phpthumb.class.php');\r\n\t\t\t\t\t\t\t$phpThumb = new phpthumb();\r\n\r\n\t\t\t\t\t\t\t// Default value for jpg quality gets set right here before\r\n\t\t\t\t\t\t\t// going through the given parameters. If no option is set,\r\n\t\t\t\t\t\t\t// i do define 80 as a good balance between image quality and\r\n\t\t\t\t\t\t\t// file size.\r\n\r\n\t\t\t\t\t\t\t$phpThumb->q = get_option('yapb_phpthumb_jpeg_quality', 80);\r\n\r\n\t\t\t\t\t\t\t// First fetch and parse the parameters we need,\r\n\t\t\t\t\t\t\t// and give them to the phpThumb instance\r\n\r\n\t\t\t\t\t\t\t$parametersWeSearchFor = array('w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'zc', 'q');\r\n\t\t\t\t\t\t\tfor ($i=0, $len=count($parameters); $i<$len; $i++) {\r\n\t\t\t\t\t\t\t\tpreg_match('/([^=]+)=(.*)/', $parameters[$i], $matches);\r\n\t\t\t\t\t\t\t\t$key = $matches[1];\r\n\t\t\t\t\t\t\t\t$value = $matches[2];\r\n\t\t\t\t\t\t\t\tif (in_array($key, $parametersWeSearchFor)) {\r\n\t\t\t\t\t\t\t\t\t$phpThumb->$key = $value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// For the calculation phpThumb needs the size of the original image\r\n\t\t\t\t\t\t\t$phpThumb->source_width = $this->width;\r\n\t\t\t\t\t\t\t$phpThumb->source_height = $this->height;\r\n\r\n\t\t\t\t\t\t\t// Now let phpThumb calculate the size\r\n\t\t\t\t\t\t\t$phpThumb->CalculateThumbnailDimensions();\r\n\r\n\t\t\t\t\t\t\t// TODO: fetch the desired dimensions and return them\r\n\t\t\t\t\t\t\t$result['width'] = $phpThumb->thumbnail_width;\r\n\t\t\t\t\t\t\t$result['height'] = $phpThumb->thumbnail_height;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn $result;\r\n\r\n\t\t\t\t}", "function strToArray($str) {\n $data = array();\n // _ denotes layers, seperate these out\n $oneDimArray = explode('_', $str);\n foreach ($oneDimArray as $subArray) {\n // , denotes different settings inside layers\n $twoDimArray = explode(',', $subArray);\n foreach ($twoDimArray as $subSubArray) {\n $data = addToArrays($subSubArray, $data);\n $data = addToArrays(',', $data);\n }\n $data = addToArrays('_', $data);\n }\n return $data;\n}" ]
[ "0.6276697", "0.59274226", "0.58074224", "0.5711287", "0.54936117", "0.5467999", "0.53313935", "0.53169304", "0.5311156", "0.5302123", "0.525593", "0.5234757", "0.5148975", "0.50979227", "0.5064544", "0.50006115", "0.49814183", "0.49734387", "0.49665225", "0.4962763", "0.49171123", "0.49049637", "0.48883554", "0.4885176", "0.48667717", "0.48550063", "0.4849427", "0.48346916", "0.48201096", "0.4813108", "0.47945875", "0.47729027", "0.47596058", "0.47557205", "0.47089005", "0.47089005", "0.4700926", "0.469703", "0.46872044", "0.46748614", "0.46573555", "0.46449727", "0.4643815", "0.46431622", "0.4616721", "0.4614992", "0.4609636", "0.460566", "0.46019542", "0.46013686", "0.45982462", "0.45940602", "0.45918834", "0.45816958", "0.45768222", "0.4564286", "0.45557952", "0.4552426", "0.4544086", "0.45342684", "0.45290393", "0.4523751", "0.45183414", "0.45129114", "0.45106745", "0.45099664", "0.45060968", "0.45044333", "0.45002708", "0.4496746", "0.44943884", "0.4483707", "0.4482616", "0.44814324", "0.44803303", "0.4479557", "0.4474132", "0.44730285", "0.44721583", "0.44634452", "0.446232", "0.44473174", "0.4445089", "0.4444017", "0.44414902", "0.44385174", "0.4437501", "0.44367132", "0.4434041", "0.44307303", "0.44229633", "0.4420223", "0.44162863", "0.44160312", "0.44160193", "0.44142884", "0.44121033", "0.44076824", "0.4407022", "0.4405917" ]
0.7002989
0
function cache_test function directory_data(string $path, string $url_path) walks the specified directory and returns an array containing image file and directory details: array( files => array( name, index, path, thumb_url, image_url, view_url, raw_url ), directories => array( name, index, list_url ) ) note: only files with extensions matching $CFG_image_valid are included '.' and '..' are not referenced in the directory array
Функция cache_test функция directory_data(string $path, string $url_path) обходит указанную директорию и возвращает массив, содержащий детали файлов изображений и директорий: array( files => array( name, index, path, thumb_url, image_url, view_url, raw_url ), directories => array( name, index, list_url ) ) примечание: учитываются только файлы с расширениями, соответствующими $CFG_image_valid '.' и '..' не упоминаются в массиве директории
function directory_data($path, $url_path) { global $CFG_image_valid, $CFG_url_album, $CFG_thumb_width, $CFG_thumb_height, $CFG_image_width, $CFG_image_height, $CFG_path_images, $CFG_cache_outside_docroot; //compensate for switching away from eregi() $CFG_image_valid_i = array(); foreach ($CFG_image_valid as $e) { $CFG_image_valid_i[] = $e; $CFG_image_valid_i[] = strtoupper($e); } // put CFG_image_valid array into eregi() form $valid_extensions = '(.' . implode('|.', $CFG_image_valid_i) . ')$'; path_security_check($path, $CFG_path_images); // load raw directory first, sort, and reprocess // $files_raw = array(); $dirs_raw = array(); if ($h_dir = opendir($path)) { // FS READ while (false !== ($filename = readdir($h_dir))) { // FS READ if ($filename != '.' && $filename != '..') { // set complete url // if ($url_path == '') { $url = $filename; } else { $url = "$url_path/$filename"; } path_security_check("$path/$filename", $CFG_path_images); if (is_readable("$path/$filename") && // FS READ is_file("$path/$filename") && // FS READ preg_match("/{$valid_extensions}/", $filename)) { $files_raw[] = array('name' => $filename, 'url' => $url); } else if (is_readable("$path/$filename") && is_dir("$path/$filename") && substr($filename, 0, 1) != '_') { // FS READ $dirs_raw[] = array('name' => $filename, 'url' => $url); } // if ... else is_file or is_dir } // if } // while closedir($h_dir); // FS READ } // if opendir // sort directory arrays by filename // function cmp($a, $b) { return strcasecmp($a['name'], $b['name']); } // function cmp @usort($dirs_raw, 'cmp'); @usort($files_raw, 'cmp'); // reprocess arrays // $files = array(); $dirs = array(); $file_count = 0; $dir_count = 0; foreach ($files_raw as $k => $v) { // set thumbnail cached vs. not // $thumb = cache_test($v['url'], $CFG_thumb_width, $CFG_thumb_height); // FS FUNCTION $image = cache_test($v['url'], $CFG_image_width, $CFG_image_height); // FS FUNCTION if ($CFG_cache_outside_docroot || !$thumb['is_cached']) { $thumb_url = build_url('image', $CFG_thumb_width . 'x' . $CFG_thumb_height, $v['url']); } else { $thumb_url = $thumb['cache_url']; } if ($CFG_cache_outside_docroot || !$image['is_cached']) { $image_url = build_url('image', $CFG_image_width . 'x' . $CFG_image_height, $v['url']); } else { $image_url = $image['cache_url']; } path_security_check("$path/$v[name]", $CFG_path_images); $files[] = array('name' => $v['name'], 'index' => $file_count, 'path' => "$path/$v[name]", 'thumb_url' => $thumb_url, 'image_url' => $image_url, 'view_url' => build_url('view', $file_count, $v['url']), 'raw_url' => build_url('image', '0', $v['url'])); // 0 index for raw image $file_count++; } foreach ($dirs_raw as $k => $v) { $dirs[] = array('name' => $v['name'], 'index' => $dir_count, 'list_url' => build_url('list', '0', $v['url'])); $dir_count++; } return(array('files' => $files, 'directories' => $dirs)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCacheFromDir( $overwrite = FALSE) {\n\t\t// open the directory\n\t\t$dir = opendir ( $this->originalsdir () );\n\t\t$cachedFiles = array ();\n\t\t// loop through it, looking for any/all JPG files:\n\t\twhile ( false !== ($fname = readdir ( $dir )) ) {\n\t\t\t$original_fpath = $this->originalsdir () . \"/$fname\";\n\t\t\t$cacheFiles ['thumb'][] = cacheImage ( $original_fpath, TRUE, FALSE, $overwrite );\n\t\t\t$cacheFiles ['photo'][] = cacheImage ( $original_fpath, FALSE, FALSE, $overwrite );\t\t\t\n\t\t}\n\t\t// close the directory\n\t\tclosedir ( $dir );\n\t\treturn $cacheFiles;\n\t}", "function themify_get_cache_dir() {\n\t\tstatic $dir_info = null;\n\t\tif($dir_info===null){\n\t\t\t$upload_dir = themify_upload_dir();\n\n\t\t\t$dir_info = array(\n\t\t\t\t\t'path' => $upload_dir['basedir'] . '/themify/',\n\t\t\t\t\t'url' => $upload_dir['baseurl'] . '/themify/'\n\t\t\t);\n\n\t\t\tif( ! is_file( $dir_info['path'] ) ) {\n\t\t\t\t\twp_mkdir_p( $dir_info['path'] );\n\t\t\t}\n\t\t}\n\treturn $dir_info;\n}", "function get_images($path){\n\n\t//initialize an empty array to hold the result\n\t$results = array();\n\n\t//open the directory\n\t$handle = opendir($path);\n\t\n\twhile (true){\n\t\t$current_file = readdir($handle); //get the name of the next file in the directory\n\t\t\n\t\t//echo \"Next file:\" . $current_file . \"<br>\";\n\t\t\n\t\t//if there is a next file\n\t\tif ($current_file) {\n\t\t\n\t\t\t//construct the full path of the file relative to the base of the directory\n\t\t\t$full_relative_path = $path.\"/\".$current_file;\n\t\t\n\t\t\tif (is_file($full_relative_path) and \n\t\t\t\t( substr($current_file, -3) == \"png\" or \n\t\t\t\tsubstr($current_file, -3) == \"jpg\" or\n\t\t\t\tsubstr($current_file, -3) == \"gif\" or\n\t\t\t\tsubstr($current_file, -3) == \"mp4\" or \n\t\t\t\tsubstr($current_file, -3) == \"wmv\" or\n\t\t\t\tsubstr($current_file, -3) == \"mov\" or \n\t\t\t\tsubstr($current_file, -3) == \"flv\" ) )\n\t\t\t\t{\n\t\t\t\t\t$results[]=$full_relative_path;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t}\n\n\treturn $results;\n}", "public function testGetImagesInDir() {\n\t\t\n\t\t// Read.\n\t\t$files = explode(',', tx_aigallery_lib::getImagesInDir($this->tmpDirectory));\n\t\t\n\t\t// Make sure directory was read.\n\t\t$this->assertFalse(empty($files));\n\t\t$this->assertTrue(count($this->imageFiles) === count($files));\n\t\n\t // Make sure all files are present\n\t\tforeach ($this->imageFiles as $file) {\n\t\t\t$this->assertTrue(in_array($this->tmpDirectory . $file, $files));\n\t\t}\n\t\t\n\t\t// Make sure non of the invalid files are present \n\t\tforeach ($this->invalidFiles as $invalidFile) {\n $this->assertFalse(in_array($this->tmpDirectory . $invalidFile, $files));\n }\n\t}", "protected function _getGalleryFiles() {\n\t\t$galleryFiles = Cache::read('default', 'gallery_files');\n\t\tif($galleryFiles === false) {\n\t\t\t$iterator = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($this->_galleryPath));\n\t\t\t$filesIter = new \\RegexIterator($iterator, '/^.+\\.jpg$/i', \\RecursiveRegexIterator::GET_MATCH);\n\t\t\tforeach($filesIter as $file) {\n\t\t\t\t$this->_galleryFiles[] = str_replace(Libraries::get('app', 'path') . '/webroot', '', $file[0]);\n\t\t\t}\n\t\t\tCache::write('default', 'gallery_files', serialize($this->_galleryFiles));\n\t\t} else {\n\t\t\t$this->_galleryFiles = unserialize($galleryFiles);\n\t\t}\n\t}", "function loadTestData($dir = null)\n{\n $index = [];\n $items = array_diff(scandir($dir), ['..', '.']);\n\n foreach ($items as $item) {\n if (is_dir($dir . DIRECTORY_SEPARATOR . $item)) {\n $children = loadTestData($dir . DIRECTORY_SEPARATOR . $item);\n foreach ($children as $key => $data) {\n $index[$item . '.' . $key] = $data;\n }\n } else {\n $path = pathinfo($item);\n $index[$path['filename']] = file_get_contents($dir . DIRECTORY_SEPARATOR . $item);\n }\n }\n return $index;\n}", "function __get_gallery_images($path='../egypt/michael-magin'){\n $k='';\n $this->load->helper('directory');\n $map=directory_map($path);\n if (is_array($map)) {\n foreach($map as $key=>$value){\n $k[]=$value;\n } \n return($k);\n }\n else\n {\n return $k=array('');\n }\n \n}", "public function getCacheDirectory();", "function get_pics($image_name, $dir, $url = TRUE) {\n\n $image_url = \"/user/profile.png\";\n\n $image = [\n \"{$dir}/\" . strtoupper($image_name) . \".jpg\",\n \"{$dir}/\" . strtolower($image_name) . \".jpg\",\n \"{$dir}/\" . strtoupper($image_name) . \".jpeg\",\n \"{$dir}/\" . strtolower($image_name) . \".jpeg\",\n \"{$dir}/\" . strtoupper($image_name) . \".JPG\",\n \"{$dir}/\" . strtolower($image_name) . \".JPG\",\n \"{$dir}/\" . strtoupper($image_name) . \".JPEG\",\n \"{$dir}/\" . strtolower($image_name) . \".JPEG\",\n \"{$dir}/\" . strtoupper($image_name) . \".png\",\n \"{$dir}/\" . strtolower($image_name) . \".png\",\n \"{$dir}/\" . strtoupper($image_name) . \".PNG\",\n \"{$dir}/\" . strtolower($image_name) . \".PNG\",\n \"{$dir}/\" . strtoupper($image_name) . \".gif\",\n \"{$dir}/\" . strtolower($image_name) . \".gif\",\n \"{$dir}/\" . strtoupper($image_name) . \".GIF\",\n \"{$dir}/\" . strtolower($image_name) . \".GIF\"\n ];\n\n for ($idx = 0; $idx < count($image); $idx++) {\n if (realpath($image[$idx])) {\n $image_url = $image[$idx];\n break;\n }\n }\n\n if ($url) {\n $folder_path = explode('/', substr($image_url, strpos($image_url, 'img')));\n unset($folder_path[0]);\n $image_url = SITEIMGURL . '/' . implode('/', $folder_path);\n }\n\n return $image_url;\n }", "function scan_dir($path)\n\t{\n\t\tglobal $data_store;\n\t\t$dir = scandir($path);\n\t\t$tree = array(\n\t\t\t\t'name' => utf8_encode(array_slice(explode('\\\\', $path), -1)[0]),\n\t\t\t\t'path' => utf8_encode($path),\n\t\t\t\t'type' => 'directory',\n\t\t\t\t'contents' => array()\n\t\t\t);\n\t\t\n\n\t\t// temporary containers for each content type\n\t\t$dirs = [];\n\t\t$files = [];\n\n\n\t\tforeach ($dir as $key => $d) {\n\n\t\t\t// exclude \".\" and \"..\"\n\t\t\tif ( $d != \".\" && $d != \"..\" )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// add to the data store\n\t\t\t\t$data_store[] = array(\n\t\t\t\t\t'name' => utf8_encode($d),\n\t\t\t\t\t'path' => utf8_encode($path.'\\\\'.$d)\n\t\t\t\t);\n\n\t\t\t\t// if directory, perform recursive function\n\t\t\t\tif ( is_dir($path.'\\\\'.$d) )\n\t\t\t\t{\n\t\t\t\t\t$dirs[] = scan_dir($path.'\\\\'.$d);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t'name' => utf8_encode($d),\n\t\t\t\t\t\t'path' => utf8_encode($path.'\\\\'.$d),\n\t\t\t\t\t\t'type' => 'file'\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t}\t\n\n\t\t\t\t// sort according to type\n\t\t\t\t$tree['contents'] = array_merge($dirs,$files);\n\t\t\t}\t\t\t\t\n\t\t}\n\n\t\treturn $tree;\n\t}", "private function getFilesListUte2($dir)\n\t{\n\t\t$debug = false;\n\t\tif ($debug) print \"<h1>\".__METHOD__.\"</h1>\";\n\t\tif ($debug) print \"<pre>dir :[$dir]</pre>\";\n\t\tif ($debug) print \"<p>Reading raw entries from \" . $dir . \"</p>\";\n\t\t$list = [];\n\t\tif (! file_exists($dir))\n\t\t\treturn $list;\n\t\telseif (file_exists($dir) && ! is_dir($dir)) {\n\t\t\tthrow new Exception(__CLASS__.\"::\".__FUNCTION__.\" $dir is not a directory\");\n\t\t} else {\n\t\t\tif ($debug) print \"<p>inside is_dir</p>\";\n\t\t\tif ($dh = opendir($dir)) {\n\t\t\t\tif ($debug) echo \"<p>inside opendir</p>\";\n\t\t\t\t$a = scandir($dir);\n\t\t\t\tforeach ($a as $file) {\n\t\t\t\t\tif ($debug) echo \"<p>Get entry file: $file </p>\";\n\t\t\t\t\tif (($file != \".\") && ($file != \"..\") && ($file[0] != \".\"))\t{\n\t\t\t\t\t\tif ($debug) echo \"<p>create entry \" . $file . \"</p>\";\n\t\t\t\t\t\t$im = Image::create($this, $file);\n\t\t\t\t\t\t$list[] = $im;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($debug) print_r($list);\n\t\t\t} else {\n\t\t\t\t//print \"<p> dir: $dir could not open </p>\";\n\t\t\t}\n\t\t}\n\t\t//if (count($list) == 0) print \"getFileList - dir: $dir is empty\";\n\t\tif ($debug) echo '<p>Gallery_Object::getFileList return from getFileList</p>';\n\t\t//print \"<h2>getFileListUte Image list </h2>\";print_r($list);print \"<h2>end of list</h2>\";\n\t\treturn $list;\n\t}", "function get_image_directories($dirname)\n{\n\t$image_dir = array();\n\t$contents = glob($dirname.\"/*\");\n\tforeach ($contents as $filename)\n\t{\n\t\tif (is_dir($filename))\n\t\t{\n\t\t\tif (count(get_image_files($filename)) > 0)\n\t\t\t{\n\t\t\t\t$image_dir[] = $filename;\n\t\t\t}\n\t\t\telse if (get_image_directories($dirname.\"/\".basename($filename)))\n\t\t\t{\n\t\t\t\t$image_dir[] = $filename;\n\t\t\t}\t\t\t\t\n\t\t}\n\t}\n\tunset($filename);\n\treturn $image_dir;\n}", "function fetchImagesFromDir($dirname) {\n $imagespath = realpath($_SERVER['DOCUMENT_ROOT'] . \"/{$dirname}/\");\n $imglist = array();\n $dirh = opendir($imagespath);\n while (($txt = readdir($dirh)) !== false) {\n $info = pathinfo($txt);\n switch ( @strtolower($info['extension']) ) {\n case 'jpg' :\n case 'png' :\n case 'gif' :\n $imglist[] = array('path' => \"/{$dirname}/\" . $info['basename'], 'name' => $info['filename']);\n break;\n }\n }\n closedir($dirh);\n return $imglist;\n}", "private function cacheImages()\n {\n $prevArgs = $this->readRunfile();\n $fetchList = [];\n\n // Build a list of to be cached dates\n $baseDate = (new \\DateTime())->modify(sprintf('-%d day', $this->args['date'] - 1));\n for ($i = 0; $i < $this->args['n']; $i++) {\n $date = $baseDate->modify('-1 day')->format('Ymd');\n $fetchList[$date] = true;\n }\n\n // Check current cache\n $dirIterator = new \\DirectoryIterator($this->args['cacheDir']);\n foreach ($dirIterator as $image) {\n if ($image->isFile() && $image->getExtension() === 'jpg') {\n $imageShouldBeCached = in_array($image->getBasename('.jpg'), array_keys($fetchList));\n if ($prevArgs === $this->args && $imageShouldBeCached) {\n // Image already present - no need to download it again\n unset($fetchList[$image->getBasename('.jpg')]);\n $this->cachedImages[] = $image->getRealPath();\n } else {\n // Config changed or cache duration expired - remove the file\n unlink($image->getRealPath());\n }\n }\n }\n\n $this->fetchImageFiles($fetchList);\n\n if ($prevArgs !== $this->args) {\n $this->writeRunfile();\n }\n }", "function g2ic_get_gallery_dirs_and_files() {\r\n\tglobal $g2ic_rel_path, $g2ic_root_album_path, $g2ic_image_ext_regex, $g2ic_sortby, $lang;\r\n\r\n\t$image_files = $dirs = $titles = $ids = $filenames = $file_times = $file_titles = $file_ids = $dirs_titles = array();\r\n\r\n\t$current_dir = $file = $title = $name = $file_on_disk = '';\r\n\r\n\t// open current directory\r\n\tif (!$current_dir = opendir($g2ic_root_album_path . $g2ic_rel_path)) {\r\n\t\techo '<p>' . $lang['g2_directory_error'] . '</p>';\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// Get info on valid directories and files\r\n\twhile ($file = readdir($current_dir)) {\r\n\t\t$file_on_disk = $g2ic_root_album_path . $g2ic_rel_path . $file;\r\n\r\n\t\t//Reads the DirNames for navigation\r\n\t\tif (is_dir($file_on_disk)) {\r\n\t\t\tif ($file != '.' && $file != '..') {\r\n\t\t\t\tlist($id, $title) = g2ic_get_g2_id_title_by_path($g2ic_rel_path . $file);\r\n\t\t\t\tif (!empty($title)) {\r\n\t\t\t\t\t$dirs[] = $file;\r\n\t\t\t\t\t$titles[] = $title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (is_file($file_on_disk) && preg_match($g2ic_image_ext_regex , $file)) {\r\n\t\t\t$name = basename($file_on_disk);\r\n\t\t\tlist($id, $title) = g2ic_get_g2_id_title_by_path($g2ic_rel_path . $name);\r\n\t\t\tif (!empty($title)) {\r\n\t\t\t\t$filenames[] = $name;\r\n\t\t\t\t$file_titles[] = $title;\r\n\t\t\t\t$file_ids[] = $id;\r\n\t\t\t\tif ($temp = @filemtime($file_on_disk)) {\r\n\t\t\t\t\t$file_times[] = $temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclosedir($current_dir);\r\n\r\n\t// Sort directories and files\r\n\t$count_dirs = count($dirs);\r\n\t$count_files = count($filenames);\r\n\r\n\tif ($count_dirs > 0){\r\n\t\tarray_multisort($titles, $dirs);\r\n\r\n\t\tfor($i = 0; $i < $count_dirs; $i++) {\r\n\t\t\t$dirs_titles[$i] = array('directory' => $dirs[$i], 'title' => $titles[$i]);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($count_files > 0){\r\n\t\tswitch ($g2ic_sortby) {\r\n\t\t\tcase 'title_asc' :\r\n\t\t\t\tarray_multisort($file_titles, $filenames, $file_times, $file_ids);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'title_desc' :\r\n\t\t\t\tarray_multisort($file_titles, SORT_DESC, $filenames, SORT_DESC, $file_times, $file_ids);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'name_asc' :\r\n\t\t\t\tarray_multisort($filenames, $file_titles, $file_times, $file_ids);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'name_desc' :\r\n\t\t\t\tarray_multisort($filenames, SORT_DESC, $file_titles, SORT_DESC, $file_times, $file_ids);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mtime_asc' :\r\n\t\t\t\tarray_multisort($file_times, $file_titles, $filenames, $file_ids);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mtime_desc' :\r\n\t\t\t\tarray_multisort($file_times, SORT_DESC, $file_titles, $filenames, $file_ids);\r\n\t\t}\r\n\r\n\t\tfor($i = 0; $i < $count_files; $i++) {\r\n\t\t\t$image_files[$i] = array('filename' => $filenames[$i],'title' => $file_titles[$i],'id' => $file_ids[$i]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn array($dirs_titles, $image_files);\r\n\r\n}", "function scanDirectories($rootDir, $allData=array()) {\n $invisibleFileNames = array(\".\", \"..\", \".htaccess\", \".htpasswd\", 'index.php');\n // run through content of root directory\n $dirContent = scandir($rootDir);\n foreach($dirContent as $key => $content) {\n // filter all files not accessible\n $path = $rootDir.'/'.$content;\n if(!in_array($content, $invisibleFileNames)) {\n // if content is file & readable, add to array\n if(is_file($path) && is_readable($path)) {\n // save file name with path\n\n $fileContent = file_get_contents($path);\n if(strpos($fileContent, 'extends PHPUnit_Framework_TestCase')) {\n $allData[] = $path;\n }\n \n // if content is a directory and readable, add path and name\n }elseif(is_dir($path) && is_readable($path)) {\n // recursive callback to open new directory\n $allData = scanDirectories($path, $allData);\n }\n }\n }\n return $allData;\n}", "private function getCacheFiles()\n {\n if (!($files = @scandir($this->directory, 1))) {\n return false;\n }\n\n $negExtLen = -1 * strlen($this->extension);\n $return = array();\n foreach ($files as $file) {\n if (substr($file, $negExtLen) === $this->extension) {\n $return[] = $this->directory . '/' . $file;\n }\n }\n return $return;\n }", "private function getDirMeta($path)\n {\n try{\n clearstatcache();\n $stat = stat($path);\n\n $mtime = $stat['mtime']; // Time of last modification\n $atime = $stat['atime']; // Time of last access\n $ctime = $stat['ctime']; // TIme of last status change\n \n # convert times to utc for es, string in ios format\n $mtime_utc = gmdate('c', $mtime);\n $atime_utc = gmdate('c', $atime);\n $ctime_utc = gmdate('c', $ctime);\n\n # get user name\n $ownerObject = User::oneOrFail($this->userId);\n $owner = $ownerObject->name;\n\n # get group \n $group = $this->getGroups($this->userId);\n\n # get time\n $indextime_utc = gmdate('c', time());\n\n # get info from path\n $path_parts = pathinfo($path);\n\n # get relative paths for path and parent path\n $rootdir = $this->project_config['rootdir'];\n $relativePath = ltrim(str_replace($rootdir, '', $path), DS);\n $pathParent = $path_parts['dirname'];\n if ($pathParent == $rootdir) {\n $relativePathParent = '.';\n }\n else {\n $relativePathParent = ltrim(str_replace($rootdir, '', $pathParent), DS);\n }\n\n # get number of items and files in the directory\n list($filecount, $itemcount) = $this->getDirItemsCount($path);\n # create file metadata array\n $dirmeta = array(\n \"name\" =>$path_parts['basename'],\n \"path\" => $relativePath,\n \"path_parent\" => $relativePathParent,\n \"items\" => $itemcount,\n \"file_num_in_dir\" => $filecount,\n \"owner\" => $owner,\n \"group\" => $group,\n \"last_modified\" => $mtime_utc,\n \"last_access\" => $atime_utc,\n \"last_change\" => $ctime_utc,\n \"indexed_by\" => $owner,\n \"indexing_date\" => $indextime_utc,\n \"type\" => \"directory\",\n \"location\" => $this->config['location_id'],\n \"agent\" => $this->config['agent_id']\n );\n } catch (Exception $e) {\n $this->logger->error($e->getMessage());\n return null;\n }\n return $dirmeta;\n }", "function process_dir($dir)\r\n\t\t{\r\n\t\t\tif (is_dir($dir))\r\n\t\t\t{\r\n\t\t\t\tfor ($list = array(),$handle = opendir($dir); (FALSE !== ($file = readdir($handle)));)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (\t(\t$file != '.' && $file != '..')\r\n\t\t\t\t\t\t\t&& (file_exists($path = $dir.'/'.$file))\r\n\t\t\t\t\t\t\t&& (strtolower(end(explode(\".\",$file))) == 'url')\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (is_dir($path))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$list = array_merge($list, EdlUtils::process_dir($path));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$entry = array('filename' => $file, 'dirpath' => $dir);\r\n\t\t\t\t\t\t\t$entry['modtime'] = filemtime($path);\r\n\t\t\t\t\t\t\t$list[] = $entry;\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\tclosedir($handle);\r\n\t\t\t\treturn $list;\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}", "public function getFiles($path)\n {\n $results = array();\n\n $list = [];\n try {\n $list = $this->source->getObjectsInContainer($path);\n }\n catch (Exception $e) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, get_class($e) . ' while listing files in ' . $path . ': ' . $e->getMessage());\n }\n\n foreach ($list as $file) {\n $thumb = $src = $file['fullRelativeUrl'];\n\n // If requested with no type param, or if type=image, only show images\n $imageOnly = ($this->getProperty('type', 'image') === 'image');\n $imageExtensions = $this->redactor->getOption('upload_images');\n $imageExtensions = array_filter(\n array_map('trim',\n explode(',', $imageExtensions)\n )\n );\n\n $extension = strtolower(pathinfo($src, PATHINFO_EXTENSION));\n if ($imageOnly && !in_array($extension, $imageExtensions, true)) {\n continue;\n }\n\n // Handle dynamic thumbs\n $dynamicThumbs = $this->redactor->getBooleanOption('redactor.dynamicThumbs');\n if ($dynamicThumbs && in_array($extension, $imageExtensions)) {\n $token = $this->modx->user->getUserToken('mgr');\n if (substr($thumb, 0, 1) !== '/' && substr($thumb, 0, 4) !== 'http') {\n $thumb = '/' . $thumb;\n }\n $thumbQuery = http_build_query(array(\n 'src' => $thumb,\n 'w' => 180,\n 'h' => 135,\n 'HTTP_MODAUTH' => $token,\n 'q' => 70,\n 'wctx' => 'mgr',\n 'zc' => 1\n //'source' => $this->get('id'),\n ));\n $thumb = $this->modx->getOption('connectors_url') . 'system/phpthumb.php?'.urldecode($thumbQuery);\n }\n // Make sure we can show the image in the editor by prepending the base url if it's not added\n if (substr($src, 0, 1) !== '/' && substr($src, 0, 4) !== 'http') {\n $src = MODX_BASE_URL . $src;\n if (!$dynamicThumbs) {\n $thumb = MODX_BASE_URL . $thumb;\n }\n }\n\n $item = array(\n 'thumb' => $thumb,\n 'url' => $src,\n 'name' => $file['name'],\n 'dimensions' => array_key_exists('image_width', $file) ? $file['image_width'] . 'x' . $file['image_height'] . 'px' : '',\n 'filesize' => $this->formatBytes($file['size']),\n 'modified' => $file['lastmod'] > 0 ? date($this->redactor->getOption('manager_date_format'), $file['lastmod']) : '',\n );\n\n $results[] = $item;\n }\n\n // return the list of files within $path\n return $results;\n }", "function dirList ($directory) {\n\n // create an array to hold directory list\n $results = array();\n\n // create a handler for the directory\n $handler = opendir($directory);\n\n\n\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n\n // if $file isn't this directory or its parent,\n // add it to the results array\n if ( $file != '.' &&\n $file != '..'\n //&& ( strpos($file, '-'. get_option( 'wpdev_mc_icon_size_w' ) . 'x' . get_option( 'wpdev_mc_icon_size_h' ) ) !== false )\n )\n $results[] = $file;\n }\n\n // tidy up: close the handler\n closedir($handler);\n\n // done!\n return $results;\n\n }", "function get_all_directory_files($directory_path)\n{\n\n $scanned_directory = array_diff(scandir($directory_path), array('..', '.'));\n\n\n\n return custom_shuffle($scanned_directory);\n}", "function get_images(){\n\t\t\t//in this case, the image folder INCLUDING the thubs folder\n\t\t\t$files = scandir($this->gallery_path);\n\t\t\t//Because the file URL's are going to have dots (nesting) we must substract these\n\t\t\t//once the data has been retrieved.\n\t\t\t$files = array_diff($files, array('.', '..', 'thumbs'));\n\t\t\t\n\t\t\t$images = array();\n\t\t\t\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$images[]= array (\n\t\t\t\t\t'url' => $this->gallery_path_url . $file,\n\t\t\t\t\t'thumb_url' => $this->gallery_path_url . 'thumbs/' . $file \n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $images;\t\t\t\n\t\t}", "function show_files($url=null) {\n$data=array();\n$result=scandir($this->base.'/'.$url);\nfor ($i=0; $i<count($result); $i++)\n{\n$file=$this->base.'/'.$url.'/'.$result[$i];\n\nif ($result[$i]=='.' || $result[$i]=='..') {}\nelse {\n$type=(is_dir($file)?'folder':'file');\narray_push($data,array('name'=>$result[$i],'type'=>$type,'size'=>file_size($file)));\n}\n}\n\nreturn $data;\n}", "function files_list($dir) {\n\tglobal $cfg;\n\n\t// Make sure permission is allowed to this dir\n\tif (files_restrict($dir)) {\n\t\treturn FALSE;\n\t}\n\n\t$path = FILES_PATH.files_dir($dir).'/';\n\n\t$files = array();\n\t$s = $cfg['files']['secureurl'];\n\n\tforeach (glob($path.'*.*') AS $file) {\n\t\t$fn = basename($file);\n\n\t\t$files[] = array(\n\t\t\t'name' => $fn,\n\t\t\t'size' => filesize($file),\n\t\t\t'url' => $s ? '/files/cat:'.$dir.'/fn:'.$fn.'/'\n\t\t\t\t: FILES_URL.$dir.'/'.$fn\n\t\t);\n\t}\n\n\treturn $files;\n}", "function dirContent($dir, &$results = array()){\n $files = scandir($dir);\n $cwd = getcwd();\n\n foreach($files as $key => $value){\n $path = realpath($dir . DIRECTORY_SEPARATOR . $value);\n if(!is_dir($path)) {\n $results[] = $path;\n } else if(!in_array($value,array(\".\",\"..\"))) {\n dirContent($path, $results[$path]);\n }\n }\n\n return $results;\n}", "public function getImagesFromDir( $path, $type = 0 ) \n\t{\n\t\t$files = array();\n\t\t$filesCollection = array();\n\n\t\tif( is_dir( $path ) ) {\n\t\t\tif( $handle = opendir( $path ) ) {\n\t\t while( $file = readdir( $handle ) ) {\n\t\t if( $file != \".\" && $file != \"..\" && $file[0] != '.' ) {\n\t\t if( is_dir( $path . \"/\" . $file ) ) {\n\t\t $files = $this->getImagesFromDir( $path . \"/\" . $file );\n\t\t if( is_array( $files ) ) {\n\t\t \t$files = array_merge( $filesCollection, $files ); \n\t\t }\n\t\t } else {\n\t\t \tif( $type == 1 ) {\n\t\t \t\tif ( preg_match( '/_480/', $file, $match ) ) {\n\t\t \t\t\tpreg_match( '/\\d+/', $file, $match );\n\t\t\t\t array_push( $filesCollection, \n\t\t\t\t \tarray( \n\t\t\t\t\t\t\t\t\t\t\t'data-id' => (int)$match[0],\n\t\t\t\t\t\t\t\t\t\t\t'src' => $file,\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 \n\t\t \t} else if( $type == 2 ) {\n\t\t \t\tif ( preg_match( '/_120/', $file, $match ) ) {\n\t\t \t\t\tpreg_match( '/\\d+/', $file, $match );\n\t\t\t\t array_push( $filesCollection, \n\t\t\t\t \tarray( \n\t\t\t\t\t\t\t\t\t\t\t'data-id' => (int)$match[0],\n\t\t\t\t\t\t\t\t\t\t\t'src' => $file,\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\n\t\t \t} else {\n\t\t \t\treturn array('error' => 'something went wrong.');\n\t\t \t}\n\t\t }\n\t\t }\n\t\t }\n\t\t closedir( $handle );\n\t\t return $filesCollection;\n\t\t\t}\n\t\t}\t\n\t}", "function scandirectory($path, $result = ''){\n\tglobal $dirPath;\n\tglobal $startTime;\n\t$defaulFolder = scandir($dirPath.$path);\t\n\n\t/*if(time() - $startTime > 1){\n\t\treturn $result;\n\t\texit;\n\t}*/\n\t\n\tforeach($defaulFolder AS $val){\n\t\tif($val == '.' || $val == '..') continue;\n\t\t\n\t\tif(!is_file($dirPath.$path.'/'.$val)){\t\t\t\n\t\t$result = scandirectory($path.'/'.$val, $result);\n\t\t}else{\n\n\t\t\t$file = explode('.',$val);\n\t\t\t$fileExtension = array_pop($file);\n\t\t\tclearstatcache(true, $dirPath.$path.'/'.$val);\n\t\t\t$filesize = filesize($dirPath.$path.'/'.$val);\n\t\t\t$mime_type = mime_content_type($dirPath.$path.'/'.$val);\n\n\t\t\t$result[$mime_type]['filesize'] += $filesize;\n\t\t\t$result[$mime_type]['fileExtension'] = $fileExtension;\n\t\t\t$result[$mime_type]['count'] += 1;\n\t\t}\n\n\t}\n\treturn $result;\n}", "private function FetchImages($path='')\n\t{\n\t\t$images = array();\n\t\t$realPath = ISC_BASE_PATH.'/'.GetConfig('ImageDirectory').'/uploaded_images/'.$path;\n\t\tif(!is_dir($realPath)) {\n\t\t\treturn $images;\n\t\t}\n\n\t\t$files = scandir($realPath);\n\t\tforeach($files as $file) {\n\t\t\tif(substr($file, 0, 1) == '.' || (!is_dir($realPath.'/'.$file) && !$this->IsImageFile($file))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(is_dir($realPath.'/'.$file)) {\n\t\t\t\t$images = array_merge($images, $this->FetchImages($path.$file.'/'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$images[] = $path.$file;\n\t\t\t}\n\t\t}\n\n\t\treturn $images;\n\t}", "public function getImgs() {\n\n $config = Zend_Registry::get('config');\n\n $project_img_path = $config->srv_projects_img_path . '/' . $this->getName();\n\n// Zend_Debug::dump($project_img_path);\n// Zend_Debug::dump(realpath($project_img_path));\n//\n// die();\n\n\n\n if (is_dir($project_img_path)) {\n\n $loadfiles = scandir($project_img_path);\n\n $iter = 0;\n\n foreach($loadfiles as $file) {\n\n $ext = @substr($file, -4);\n\n //Zend_Debug::dump($file);\n\n\n if ($ext == '.jpg') {\n\n $img['thumb'] = $config->www_projects_img_path . '/' . $this->getName() . '/thumbs/' . $file;\n $img['big'] = $config->www_projects_img_path . '/' . $this->getName() . '/' . $file;\n\n $files[] = $img;\n\n $iter++;\n if($iter >= 25) break; //max 25 imgs\n\n }\n\n }\n\n //Zend_Debug::dump($files);\n\n\n\n if (@$files) {\n\n return $files;\n\n }\n\n return false;\n\n }\n\n }", "function getFiles($directory) {\n // Try to open the directory\n if($dir = opendir($directory)) {\n // Create an array for all files found\n $tmp = Array();\n // Add the files\n while($file = readdir($dir)) {\n // Make sure the file exists\n if($file != \".\" && $file != \"..\" && $file[0] != '.' && $file != 'Thumbs.db') {\n // If it's a directory, list all files within it\n if(is_dir($directory . \"/\" . $file)) {\n\n $folder = str_replace(IMPORT_DIR,'',$directory . \"/\" . $file);\n array_push($tmp, array('path' => $folder, 'dir' => basename($folder), 'file' => ''));\n\n $tmp2 = getFiles($directory . \"/\" . $file);\n if(is_array($tmp2)) {\n $tmp = array_merge($tmp, $tmp2);\n }\n } else {\n $folder = str_replace(IMPORT_DIR,'',$directory);\n array_push($tmp, array('path' => $folder, 'dir' => basename($folder), 'file' => $file));\n }\n }\n }\n // Finish off the function\n closedir($dir);\n return $tmp;\n }\n}", "function files_images($dir, $group = false)\n{\n $images = [];\n $files = files_list($dir);\n foreach ($files as $f => $file) {\n if (stristr($f, '.jp') !== false || stristr($f, '.png') !== false || stristr($f,\n '.gif') !== false) {\n if (preg_match('/^(?<id>[0-9]+)[-][^\\.]+\\..+/', $f, $matches)) {\n if ($group) {\n $images[$matches['id']][$f] = $file;\n continue;\n }\n }\n if (0 !== filesize($file)) {\n $images[$f] = $file;\n }\n }\n }\n\n return $images;\n}", "function directorylist($dir, $recurse=false)\n {\n \n if (!file_exists($dir)) { return false; }\n\n// array to hold return value\n\n $retval = array();\n\n// add trailing slash if missing\n\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n// open pointer to directory and read list of files\n\n $d = @dir($dir) or die();\n while(false !== ($entry = $d->read())) {\n\n// skip hidden files\n\n if($entry[0] == '.') continue;\n if(is_dir(\"$dir$entry\")) {\n $retval[] = array(\n \"name\" => \"$dir$entry/\",\n \"type\" => filetype(\"$dir$entry\"),\n \"size\" => 0,\n \"lastmod\" => filemtime(\"$dir$entry\")\n );\n\n if($recurse && is_readable(\"$dir$entry/\")) {\n $retval = array_merge($retval, directorylist(\"$dir$entry/\", true));\n }\n } elseif(is_readable(\"$dir$entry\")) {\n $retval[] = array(\n \"name\" => \"$dir$entry\",\n \"filename\" => \"$entry\",\n \"size\" => filesize(\"$dir$entry\"),\n \"lastmod\" => filemtime(\"$dir$entry\")\n );\n }\n }\n $d -> close();\n\n return $retval;\n }", "function getFileList($url) {\n $outputBuffer = array();\n//print \"<p>url: \" . $url;\n error_reporting(0); //404 reports a warning i dont want\n $var = file_get_contents($url);\n error_reporting(1);\n\n if ($var != \"\") {\n preg_match_all(\"/a[\\s]+[^>]*?href[\\s]?=[\\s\\\"\\']+\" .\n \"(.*?)[\\\"\\']+.*?>\" . \"([^<]+|.*?)?<\\/a>/\", $var, &$matches);\n\n $matches = $matches[1];\n\n foreach ($matches as $var) {\n $ext = pathinfo($var, PATHINFO_EXTENSION);\n if ($ext == \"jpg\" | $ext == \"png\" | $ext == \"gif\") {\n $outputBuffer[] = $var;\n }\n }\n }\n return $outputBuffer;\n}", "function getFileList($url) {\n $outputBuffer = array();\n//print \"<p>url: \" . $url;\n error_reporting(0); //404 reports a warning i dont want\n $var = file_get_contents($url);\n error_reporting(1);\n\n if ($var != \"\") {\n preg_match_all(\"/a[\\s]+[^>]*?href[\\s]?=[\\s\\\"\\']+\" .\n \"(.*?)[\\\"\\']+.*?>\" . \"([^<]+|.*?)?<\\/a>/\", $var, & $matches);\n\n $matches = $matches[1];\n\n foreach ($matches as $var) {\n $ext = pathinfo($var, PATHINFO_EXTENSION);\n if ($ext == \"jpg\" | $ext == \"png\" | $ext == \"gif\") {\n $outputBuffer[] = $var;\n }\n }\n }\n return $outputBuffer;\n}", "function getImages() {\n\t\t$dir = $this->_dirs[$this->current_dir];\n\t\t$temps = IMAGE_PATH . $dir;\n\t\tif($this->verbose) echo \"$temps <br>\";\n\t\t//_images has to be reset to prevent problems created by refreshing the page.\n\t\t$this->_images = null;\t\t\t\t\t\n\t\t\n\t\tif (is_dir($temps)) {\n\t \tif ($dh = opendir($temps)) {\n\t \twhile (($file = readdir($dh))) {\n\t\t\t\t\tif(is_file($temps.$file)) {\n\t\t\t\t\t\tif (preg_match(\"/\\.jp(g|eg)$/i\",$file)) {\n\t\t\t\t\t\t $type = \"jpeg\";\n\t\t\t\t\t\t} elseif (preg_match(\"/\\.gif$/i\",$file)) {\n\t\t\t\t\t\t $type = \"gif\";\n\t\t\t\t\t\t} elseif (preg_match(\"/\\.png$/i\",$file)) {\n\t\t\t\t\t\t $type = \"png\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($type){\n\t\t\t\t\t\t\t$s = sizeof($this->_images);\n\t\t\t\t\t\t\t$this->_images[] = new GalleryImage(IMAGE_PATH,$dir,$file,$type,DESC_DIR);\n\t\t\t\t\t\t\t$this->_images[$s]->setImageTool($this->_imageTool);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$type = \"\";\n\t\t\t\t\t}\n\t \t}\n\t \tclosedir($dh);\n\t \t}\n\t\t}\n\t}", "public function getCacheDirectory() {}", "public function getActualCacheDirectory();", "function path_list($path) {\n global $CFG_url_album, $CFG_album_name;\n\n $image_subdir_parts = array();\n if ($path != '') {\n $image_subdir_parts = explode('/', $path);\n }\n\n $path_list[] = array('url' => $CFG_url_album,\n 'name' => $CFG_album_name);\n\n for ($i = 0; $i < count($image_subdir_parts); $i++) {\n $k = key($image_subdir_parts);\n $v = current($image_subdir_parts);\n $path_list[] = array('url' => build_url('list', '0', implode('/', array_slice($image_subdir_parts, 0, $i + 1))),\n 'name' => $image_subdir_parts[$i]);\n } // for\n\n return $path_list;\n}", "function getDirectoryList(){\n\t$files = glob( CFBACKUPPATH.'*.zip' );\n\n// Sort files by modified time, latest to earliest\n// Use SORT_ASC in place of SORT_DESC for earliest to latest\n\tarray_multisort(\n\t\t\t\tarray_map( 'filemtime', $files ),\n\t\t\t\tSORT_NUMERIC,\n\t\t\t\tSORT_DESC,\n\t\t\t\t$files\n\t\t\t\t\t);\n\t$file_index['imgdb'] = array();\n\t$file_index['bandwidth'] = array();\n\tforeach( $files as $file){\n\t$file_name = basename($file);\n\t\t$file_type = explode(\"_\", $file_name);\n\t\t\tif($file_type[0]=='imgdb'){\n\t\t\t\t$file_index['imgdb'][] = $file_name;\n\t\t\t}elseif($file_type[0]=='bandwidth'){\n\t\t\t\t$file_index['bandwidth'][] =$file_name;\n\t\t\t}\n\t}\n\treturn $file_index;\n}", "public static function saveImageUrlToCache($url) {\r\n $ch = curl_init();\r\n curl_setopt ($ch, CURLOPT_URL, $url);\r\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\r\n $data = curl_exec($ch);\r\n curl_close($ch);\r\n $nameParts = explode('.', $url);\r\n $extension = $nameParts[count($nameParts)-1];\r\n $fileName = (time() + rand(1, 1000)).'.'.$extension; //add rand() to make duplicate name possibility smaller\r\n\r\n $filePath = self::$app->config(\"imagecachesPath\") . $fileName;\r\n $fileUrl = self::$app->config(\"imagecachesUrl\") . $fileName;\r\n\r\n $file = fopen($filePath, 'w+');\r\n fputs($file, $data);\r\n fclose($file);\r\n\r\n return array('path' => $filePath, 'url' => $fileUrl);\r\n }", "public function getCacheDir();", "protected static function readCacheFolder() {\n\t\t$list_of_elements = array();\t\t\t\t// we will be returning this\n\t\t$path = self::$upload_dir['basedir'] . '/';\n\t\t// go through all elements in the folder and store them in the array\n\t\tif ( is_dir( $path ) ) {\t\t\n\t\t if ( $dh = opendir( $path ) ) {\n\t\t while ( ( $file = readdir($dh) ) !== false) {\n\t\t \tif( $file == '.' || $file == '..')\tcontinue;\n\n\t\t \t$filetype = filetype( $path . $file );\n\t\t\t\t\tif( $filetype == 'file' ) {\n\t\t\t\t\t\t// store info about element into array, so we dont need to call filetype function again\n\t\t\t\t\t\t$one_element = array( 'path' => $path.$file, 'type' => $filetype, 'time'=>filemtime($path.$file) );\n\t\t\t\t\t\t$list_of_elements[] = $one_element;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t \t\t\n\t\t\t\t}\n\t\t closedir($dh);\n\t\t }\n\t\t}\n\t\t// sort the array A-Z\n\t\tsort($list_of_elements);\n\t\t// return sorted array\n\t\treturn $list_of_elements;\n\t}", "protected static function readCacheFolder() {\n\t\t$list_of_elements = array();\t\t\t\t// we will be returning this\n\t\t$path = self::$upload_dir['basedir'] . '/';\n\t\t// go through all elements in the folder and store them in the array\n\t\tif ( is_dir( $path ) ) {\t\t\n\t\t if ( $dh = opendir( $path ) ) {\n\t\t while ( ( $file = readdir($dh) ) !== false) {\n\t\t \tif( $file == '.' || $file == '..')\tcontinue;\n\n\t\t \t$filetype = filetype( $path . $file );\n\t\t\t\t\tif( $filetype == 'file' ) {\n\t\t\t\t\t\t// store info about element into array, so we dont need to call filetype function again\n\t\t\t\t\t\t$one_element = array( 'path' => $path.$file, 'type' => $filetype, 'time'=>filemtime($path.$file) );\n\t\t\t\t\t\t$list_of_elements[] = $one_element;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t \t\t\n\t\t\t\t}\n\t\t closedir($dh);\n\t\t }\n\t\t}\n\t\t// sort the array A-Z\n\t\tsort($list_of_elements);\n\t\t// return sorted array\n\t\treturn $list_of_elements;\n\t}", "function returnimages($dirname=\"./last_study_data/anger_autumn\") {\n\n\t\techo 'DDDDDDDDDDD'.$dirname;\n\n\t\t$pattern=\"(\\.jpg$)|(\\.png$)|(\\.jpeg$)|(\\.gif$)\"; //valid image extensions\n\t\t$files = array();\n\t\t$curimage=0;\n\t\tif($handle = opendir($dirname)) {\n\t\t\twhile(false !== ($file = readdir($handle))){\n\t\t\t\tif(eregi($pattern, $file)){ //if this file is a valid image\n\t\t\t\t\t//Output it as a JavaScript array element\n\t\t\t\t\techo ' galleryarray['.$curimage.']=\"'.$file .'\";';\n\t\t\t\t\t$curimage++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($handle);\n\t\t}\t\n\t\treturn($files);\n\t}", "function getPix($dir)\n{\n $handle = @opendir($dir);\n // reading all filenames\n while($file = @readdir($handle)){\n // skip directories\n if (!is_dir($file)){\n // if the file is not an image, getimagesize won't result (or error :-)\n $img = getimagesize($dir.\"/\".$file);\n // 1,2,3,5 = gif, jpg, png,wbmp;\n //if ($img[2]>0 && $img[2]<4 || $img[2]==5)\n if ($img){\n $filenames[] = $file;\n }else{\n $h = @opendir($dir.$file);\n if ($h) $filenames[] = \"[\".$file.\"]\";\n }\n }\n }// end while\n return $filenames;\n}", "function get_img_lists($dir){\n\t \n\t//get all image files with a .jpg extension.\n\t$images = glob($dir . \"*.jpg\");\n\t\n\treturn $images;\n}", "function get_image_files($dirname)\n{\n\t$image = array();\n\t$contents = glob($dirname.\"/*\");\n\tforeach ($contents as $filename)\n\t{\n\t\tif (is_image($filename))\n\t\t{\n\t\t\t$image[] = $filename;\n\t\t}\n\t}\n\tunset($filename);\n\treturn $image;\n}", "function getFileList($url) {\n $outputBuffer = array();\n\n error_reporting(0); //404 reports a warning i dont want\n $var = file_get_contents($url);\n error_reporting(1);\n\n if ($var != \"\") {\n preg_match_all(\"/a[\\s]+[^>]*?href[\\s]?=[\\s\\\"\\']+\" .\n \"(.*?)[\\\"\\']+.*?>\" . \"([^<]+|.*?)?<\\/a>/\", $var, &$matches);\n\n $matches = $matches[1];\n\n foreach ($matches as $var) {\n $ext = pathinfo($var, PATHINFO_EXTENSION);\n if ($ext == \"jpg\" | $ext == \"png\" | $ext == \"gif\") {\n $outputBuffer[] = $var;\n }\n }\n }\n return $outputBuffer;\n}", "function check_dirfile(){\n $dirList = [\n 'addons',\n 'config',\n 'template',\n 'uploads',\n 'runtime',\n 'application',\n 'public'\n ];\n $list = [];\n foreach ($dirList as $file) {\n $writeable = is_writeable(think\\facade\\Env::get('root_path') . $file);\n $list[] = [\n \"dir\" => $file,\n \"writeable\" => $writeable\n ];\n }\n return $list;\n}", "function image_derive_all_get_relevant_files($directory) {\n $extensions = ['jpeg', 'jpg', 'gif', 'png'];\n $mimetypes = ['image/jpeg', 'image/jpg', 'image/gif', 'image/png'];\n\n $dir = rtrim($directory, '/');\n if ($dir == 'public') {\n $file_pattern = \".*\";\n }\n else {\n $file_pattern = $dir ? $dir . \".+\" : \".+\";\n }\n\n $regex = \"^public:\\/\\/(\" . $file_pattern . \")\\.(\" . implode('|', $extensions) . \")$\";\n\n // Query the database for files that match this pattern.\n $query = Database::getConnection()\n ->select('file_managed', 'f');\n $andGroup = $query->andConditionGroup()\n ->condition('filemime', $mimetypes, 'IN')\n ->condition('uri', $regex, 'REGEXP');\n $query->condition($andGroup);\n\n $total_count = $query\n ->countQuery()\n ->execute()\n ->fetchField();\n\n drush_print(\\Drupal::translation()->formatPlural($total_count,\n '1 entry is to have its image derivatives created.',\n '@count entries are to have their image derivatives created.')\n );\n\n // Select the files to have derivatives created.\n return $query->fields('f', array('fid', 'filename', 'uri'))\n ->execute()\n ->fetchAll();\n}", "function listDirs() {\n\tglobal $base;\n\t$result = array();\n\t\n\t// if the Directory opens ...\n\tif(($dir = @opendir(IMAGE_DIR . $base))) {\n\t\t\n\t\t// ... while Files remain ...\n\t\twhile(FALSE !== ($file = readdir($dir))) {\n\t\t\t\n\t\t\t// ... if NOT hierarchy entries ...\n\t\t\tif($file != \".\" && $file != \"..\") {\n\t\t\t\t\n\t\t\t\t// ... if File is a Directory ...\n\t\t\t\tif(is_dir(IMAGE_DIR . basePath($file)))\n\t\t\t\t\n\t\t\t\t// ... return the Directory\n\t\t\t\t$result[] = $file;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// close the Directory\n\t\tclosedir($dir);\n\t}\n\t\n\t// return the Directories\n\treturn $result;\n}", "function liesdir($dir) {\n $dir = $_SESSION['crmpath'].\"/dokumente/$dir/\";\n if ( !file_exists($dir) ) return false;\n $cdir = dir($dir);\n while ( $entry = $cdir->read() ) {\n if ( !is_dir($entry) ) {\n $files[] = array(\"size\"=>filesize($dir.$entry),\"date\"=>date(\"d.m.Y H:i:s\",filemtime($dir.$entry)),\"name\"=>$entry);\n }\n }\n return $files;\n}", "function filelist_fn($startdir=\"./\", $searchSubdirs=1, $directoriesonly=0, $maxlevel=\"all\", $level=1, $reset = 1) {\n $ignoredDirectory[] = \".\";\n $ignoredDirectory[] = \"..\";\n $ignoredDirectory[] = \"_vti_cnf\";\n global $directorylist; //initialize global array\n \n if(substr($startdir, -1) != '/'){\n\t\t$startdir = $startdir.'/';\n\t}\n \n if (is_dir($startdir)) {\n if ($dh = opendir($startdir)) {\n while (($file = readdir($dh)) !== false) {\n if (!(array_search($file,$ignoredDirectory) > -1)) {\n if (@filetype($startdir . $file) == \"dir\") {\n \n\t\t\t\t\t //build your directory array however you choose;\n //add other file details that you want.\n\t\t\t\t\t \n $directorylist[$startdir . $file]['level'] = $level;\n $directorylist[$startdir . $file]['dir'] = 1;\n $directorylist[$startdir . $file]['name'] = $file;\n $directorylist[$startdir . $file]['path'] = $startdir;\n if ($searchSubdirs) {\n if ((($maxlevel) == \"all\") or ($maxlevel > $level)) {\n filelist_fn($startdir . $file . \"/\", $searchSubdirs, $directoriesonly, $maxlevel, ($level + 1), 0);\n }\n }\n\t\t\t\t\t \n\t\t\t\t\t \n } else {\n if (!$directoriesonly) {\n\t\t\t\t\t \n\t\t\t\t\t // echo substr(strrchr($file, \".\"), 1);\n //if you want to include files; build your file array \n //however you choose; add other file details that you want.\n $directorylist[$startdir . $file]['level'] = $level;\n $directorylist[$startdir . $file]['dir'] = 0;\n $directorylist[$startdir . $file]['name'] = $file;\n $directorylist[$startdir . $file]['path'] = $startdir;\n\t\t\t\t\t\t \n\t\t\t\t\t \n }}}}\n closedir($dh);\n}}\n\nif(!empty($reset)){\n\t$r = $directorylist;\n\t$directorylist = array();\n\treturn($r);\n}\n}", "function get_images( $dir ) {\n if( is_dir( $dir ) && is_readable( $dir ) ) {\n // Get an array of files and folders without the dot files\n $files = array_diff( scandir( $dir ), array( '.', '..' ) );\n }\n $images = array();\n $subdirs = array();\n foreach( $files as $file ) {\n // Add images and subdirectories to separate arrays\n if( preg_match( '/\\.(?:jpg|gif|png)$/i', $file ) ) {\n $images[] = $dir . '/' . $file;\n } elseif( is_dir( $dir . '/' . $file ) ) {\n $subdirs[] = $dir . '/' . $file;\n }\n }\n // Loop through subdirectories calling getImages() recursively\n foreach( $subdirs as $sub ) {\n $images = array_merge( $images, get_images( $sub ) );\n }\n return $images;\n}", "function scanDirectories($rootDir, $allData=array()) {\r\n $invisibleFileNames = array(\".\", \"..\", \".htaccess\", \".htpasswd\");\r\n // run through content of root directory\r\n $dirContent = scandir($rootDir);\r\n foreach($dirContent as $key => $content) {\r\n // filter all files not accessible\r\n $path = $rootDir.'/'.$content;\r\n if(!in_array($content, $invisibleFileNames)) {\r\n // if content is file & readable, add to array\r\n if(is_file($path) && is_readable($path)) {\r\n // save file name with path\r\n $allData[] = $path;\r\n // if content is a directory and readable, add path and name\r\n }elseif(is_dir($path) && is_readable($path)) {\r\n // recursive callback to open new directory\r\n $allData = scanDirectories($path, $allData);\r\n }\r\n }\r\n }\r\n return $allData;\r\n }", "function read_directory_files($directory, $return_data = true)\n{\n $file_list = array();\n $file_data = false;\n\n if ($handle = opendir($directory)) {\n while (false !== ($file = readdir($handle))) {\n // do something with the file\n // note that '.' and '..' is returned even\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n // collect the filenames & data\n if ($return_data == true) {\n $file_data = explode(\"\\n\", file_get_contents($directory . '/' . $file));\n }\n\n $file_list[$file] = $file_data;\n }\n }\n closedir($handle);\n }\n return $file_list;\n}", "function getImageList()\n{\n\tglobal $sourcedir;\n\n\t// Start with an empty array\n\t$imageList = array();\n\t// Try to open the images directory\n\tif ($handle = opendir($sourcedir . '/shop/item_images'))\n\t{\n\t\t// For each file in the directory...\n\t\twhile (false !== ($file = readdir($handle)))\n\t\t{\n\t\t\t// ...if it's a valid file, add it to the list\n\t\t\tif (!in_array($file, array('.', '..', 'blank.gif')))\n\t\t\t\t$imageList[] = $file;\n\t\t}\n\t\t// Sort the list\n\t\tsort($imageList);\n\t\treturn $imageList;\n\t}\n\t// Otherwise, if directory inaccessible, show an error\n\telse\n\t{\n\t\tfatal_lang_error('shop_cannot_open_images');\n\t}\n}", "protected function getFilesInDirCreateTestDirectory() {}", "function create_cache($dir, $depth = 0){\n\n // skip dir\n if(!is_readable($dir) || is_exclude($dir)) return 0;\n\n // dir cache path\n tasks::$folders_count ++;\n $cache = get_dir_cache_path($dir);\n $cache_exists = file_exists($cache);\n $cache_recreate = tasks::$force || !$cache_exists ? true : false;\n $get_dir = tasks::$images || $cache_recreate ? true : false;\n\n // get dir\n if($get_dir){\n\n // dir from cache or new\n $arr = $cache_recreate ? get_dir($dir, true) : json_decode(file_get_contents($cache), true);\n\n // resize images\n if(tasks::$images && config::$config['image_resize_enabled'] && config::$config['image_resize_cache'] && !empty($arr) && !empty($arr['files'])){\n\n //\n $dirs = array();\n $image_sizes = array(config::$config['image_resize_dimensions']);\n if(config::$image_resize_dimensions_retina) $image_sizes[] = config::$image_resize_dimensions_retina;\n foreach ($arr['files'] as $filename => $props) {\n if($props['filetype'] === 'dir'){\n $dirs[] = root_absolute($props['path']);\n continue;\n }\n\n // video thumb\n if(tasks::$video_thumbs && isset($props['ext']) && in_array(strtolower($props['ext']), tasks::$video_thumbs)){\n\n // get cache path\n $video_thumb_cache = get_image_cache_path(root_absolute($props['path']), 480, $props['filesize'], $props['mtime']);\n\n // attempt to create if video thumb does not exist\n if(!file_exists($video_thumb_cache)) {\n // ffmpeg command\n $cmd = escapeshellarg(config::$config['video_ffmpeg_path']) . ' -i ' . escapeshellarg(real_path(root_absolute($props['path']))) . ' -deinterlace -an -ss 1 -t 1 -vf \"thumbnail,scale=480:320:force_original_aspect_ratio=increase,crop=480:320\" -r 1 -y -f mjpeg ' . $video_thumb_cache . ' 2>&1';\n // try to execute command\n @exec($cmd, $output, $result_code);\n // fail if result_code is anything else than 0\n tasks::$output .= ($result_code ? 'failed to create thumbnail for video ' : 'Video thumbnail created for ') . $props['path'] . '<br>';\n }\n }\n\n // proceed if image\n if(!isset($props['image'])) continue;\n\n // exit if image type is not resize type\n if(!in_array(image_type_to_extension($props['image']['type'], false), tasks::$resize_types)) continue;\n\n // exif orientation\n $orientation = isset($props['image']['exif']['Orientation']) ? $props['image']['exif']['Orientation'] : 0;\n\n // original dimensions / get physical\n $original_width = $props['image'][($orientation > 4 && $orientation < 9 ? 'height' : 'width')];\n $original_height = $props['image'][($orientation > 4 && $orientation < 9 ? 'width' : 'height')];\n\n // image_resize_max_pixels early exit\n \t\t\t\t\tif(config::$config['image_resize_max_pixels'] && $original_width * $original_height > config::$config['image_resize_max_pixels']) continue;\n\n // vars\n $type = $props['image']['type'];\n $path = root_absolute($props['path']);\n\n // loop image sizes\n foreach ($image_sizes as $index => $image_size) {\n\n // ratio\n $ratio = max($original_width, $original_height) / $image_size;\n if($ratio < max(config::$config['image_resize_min_ratio'], 1)) continue;\n\n // cache path\n $image_cache = get_image_cache_path($path, $image_size, $props['filesize'], $props['mtime']);\n $image_cache_exists = file_exists($image_cache);\n\n // skip if cache exists\n if($image_cache_exists){\n tasks::$images_count ++;\n\n // create image acche\n } else {\n\n // image create\n $image = image_create_from($path, $type);\n if(!$image) break;\n\n // count\n tasks::$images_count ++;\n\n // Calculate new image dimensions.\n $new_width = round($original_width / $ratio);\n $new_height = round($original_height / $ratio);\n\n // new image\n $new_image = imagecreatetruecolor($new_width, $new_height);\n call_user_func(config::$config['image_resize_function'], $new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $original_width, $original_height);\n\n // destroy original $image resource\n \t\t\t\t\t\t\timagedestroy($image);\n\n \t\t\t\t\t\t\t// fix orientation according to exif\n \t\t\t\t\t\t\texif_orientation($orientation, $new_image);\n\n \t\t\t\t\t\t\t// sharpen resized image\n \t\t\t\t\t\t\tif(config::$config['image_resize_sharpen']) sharpen_image($new_image);\n\n // save as cache\n if(imagejpeg($new_image, $image_cache, config::$config['image_resize_quality'])) tasks::$images_processed ++;\n\n // detroy $new_image resource\n imagedestroy($new_image);\n }\n\n // add image resize cache direct to $arr\n if($cache_recreate && config::$image_resize_cache_direct) $arr['files'][$filename]['image']['resize' . $image_size] = get_url_path($image_cache);\n }\n }\n }\n\n // save json\n if($cache_recreate) {\n $json = empty($arr) ? '{}' : json_encode($arr, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_PARTIAL_OUTPUT_ON_ERROR);\n if(file_put_contents($cache, $json)) tasks::$folders_processed ++;\n }\n }\n\n // max depth\n if(!tasks::isset('ignore_max_depth') && config::$config['menu_max_depth'] && $depth >= config::$config['menu_max_depth']) return;\n\n // subdirs\n if($get_dir){\n if(!isset($dirs)){\n $dirs = array();\n if(isset($arr['files'])) foreach ($arr['files'] as $key => $val) if($val['filetype'] === 'dir') $dirs[] = root_absolute($val['path']);\n }\n\n // glob subdirs\n } else {\n $dirs = glob($dir . '/*', GLOB_NOSORT|GLOB_ONLYDIR);\n }\n\n // sub dirs\n if(!empty($dirs)) foreach($dirs as $dir) create_cache($dir, $depth + 1);\n }", "function CheckPicDirs()\n{\n global $config;\n $loc = \"piclib.php->CheckPicDirs\";\n $pt = $config[\"UploadDir\"];\n if(!file_exists($pt))\n {\n $result = @mkdir($pt, 0764);\n if($result === false)\n {\n DieWithMsg($loc, \"Unable to Create Folder: \" . $pt);\n }\n }\n \n $pt = $config[\"UploadDir\"] . 'pics/';\n if(!file_exists($pt))\n {\n $result = @mkdir($pt, 0764);\n if($result === false)\n {\n DieWithMsg($loc, \"Unable to Create Folder: \" . $pt);\n }\n }\n \n $folders = PicFolderList();\n foreach($folders as $f)\n {\n $p = $config[\"UploadDir\"] . 'pics/' . $f;\n if(!file_exists($p))\n {\n $result = mkdir($p, 0764);\n if($result == false)\n {\n DieWithMsg($loc, \"Unable to Create Folder: \" . $p);\n }\n }\n }\n}", "function listar_directorios_ruta($ruta,&$imgs){\n $img= array();\n if (is_dir($ruta)) { \n if ($dh = opendir($ruta)) { \n while (false !== ($file = readdir($dh)) ) { \n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio\n //mostraría tanto archivos como directorios \n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta.$file);\n\n if (is_dir($ruta . $file) && $file!=\".\" && $file!=\"..\"){ \n //solo si el archivo es un directorio, distinto que \".\" y \"..\" \n $imgs[\"$ruta$file\"] = listar_directorios_ruta($ruta.$file.\"/\",$imgs);\n }else{\n $img[]=$file;\n \n }\n } \n closedir($dh); \n } \n }else \n echo \"<br>No es ruta valida\";\n \n return $img;\n}", "public function testGetCachedFilepathSubDirs()\n {\n $this->smarty->caching = true;\n $this->smarty->cache_lifetime = 1000;\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n $this->assertEquals($this->buildCachedPath($tpl), $tpl->cached->filepath);\n }", "function referentiel_list_directories_and_files ($rootdir) {\r\n\r\n $results = null;\r\n\r\n if ($dir = opendir($rootdir)){\r\n while (false !== ($file=readdir($dir))) {\r\n if ($file==\".\" || $file==\"..\") {\r\n continue;\r\n }\r\n $results[$file] = $file;\r\n }\r\n closedir($dir);\r\n }\r\n return $results;\r\n }", "function getImageFiles($html='')\n {\n if ($html) {\n if (ini_get('magic_quotes_gpc')=='1')\n $html = str_replace(\"\\'\", \"'\", str_replace('\\\"', '\"', $html));\n $imgUrls = getImgUrls($html);\n if ($imgUrls) {\n foreach($imgUrls as $src) {\n if ($src) {\n $content = file_get_contents($src);\n if ($content)\n $files[] = ['src'=>$src, 'content'=>$content];\n }\n }\n if ($files)\n return $files;\n }\n }\n }", "private function _load_images_from_folder()\n {\n $this->_trace( 'Loading images from folder' );\n $this->_images = array();\n\n $dir_contents = $this->_rscandir( $this->_options->src_images_folder );\n\n foreach( $dir_contents as $file )\n {\n $info = getimagesize( $file );\n $this->_images[] = array\n (\n 'filename' => pathinfo( $file, PATHINFO_FILENAME ),\n 'path' => $file,\n 'width' => $info[0],\n 'height' => $info[1],\n 'mime' => $info[ 'mime' ],\n 'type' => end( explode( '/', $info[ 'mime' ] ) )\n );\n }\n }", "function gather_product_images() {\n $images = array();\n foreach ( new DirectoryIterator(\"public://product_images/\") as $image_file ) {\n if ( strpos($image_file->getFileName(), '.jpg') !== FALSE ) {\n $images[] = $image_file->getFileName();\n }\n }\n return $images;\n}", "function getDirImages( $dir) {\n\t\t$dirImages = array();\n\t\t\n\t\tif ( is_dir( $dir)) {\n\t\t\tif ( $handle = opendir( $dir)) {\n\t\t\t\twhile ( false !== ( $dir_item = readdir( $handle))) {\n\t\t\t\t\tif ( !in_array( $dir_item, $this->excludeDir)) {\n\t\t\t\t\t\tif ( !is_dir( $dir.'/'.$dir_item)) {\n\t\t\t\t\t\t\tif( $this->isImageFile( $dir_item)) {\n\t\t\t\t\t\t\t\t$dirImages[] = $dir.'/'.$dir_item;\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}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $dirImages;\n\t}", "public function getPictureDirectory();", "function get_all_directory_files($directory_path)\n{\n $scanned_directory = array_diff(scandir($directory_path), array(\n '..',\n '.'\n ));\n\n return custom_shuffle($scanned_directory);\n}", "public function provideCacheDirectories()\n {\n return [\n [null, ArrayCache::class],\n [sys_get_temp_dir(), FilesystemCache::class]\n ];\n }", "public function buildCache($path, $excluded_dir_arr);", "function buildFileArray($dir) {\n $return = array();\n $it = new DirectoryIterator($dir);\n foreach ($it as $fileinfo) {\n if ($found) break;\n if ($fileinfo->isFile()) {\n $return[$dir.'/'.$fileinfo->getFilename()] = true;\n } elseif ($fileinfo->isDir() && !$fileinfo->isDot()) {\n $array = buildFileArray($dir.'/'.$fileinfo->getFileName());\n foreach ($array as $_k => $_f) {\n $return[$_k] = true;\n }\n }\n }\n return $return;\n}", "function cs_user_images_custom_directory($dir) {\n global $plugin_user_images_directory;\n\n return array(\n 'path' => $dir['basedir'] . '/' . $plugin_user_images_directory,\n 'url' => $dir['baseurl'] . '/' . $plugin_user_images_directory,\n 'subdir' => '/' . $plugin_user_images_directory,\n ) + $dir;\n}", "function scan_dir($dirname,$recurse,$forbiddenDirList,$reset)\n{\n static $file_array=array();\n static $dir_array=array();\n static $ret_array=array();\n \n if ($reset === true)\n {\n $file_array = array();\n $dir_array = array();\n $ret_array = array(); \n }\n\n if($dirname[strlen($dirname)-1]!='/')\n {\n $dirname.='/';\n }\n\n $handle=opendir($dirname);\n\n while (false !== ($element = readdir($handle)))\n {\n if ( is_scannable($dirname.$element,$forbiddenDirList) )\n {\n if(is_dir($dirname.$element))\n {\n $dir_array[]=$dirname.$element;\n\n if($recurse)\n {\n scan_dir($dirname.$element.'/',$recurse,$forbiddenDirList,false);\n }\n }\n else\n {\n $file_array[]=$dirname.$element;\n }\n }\n }\n\n closedir($handle);\n\n $ret_array['files']=$file_array;\n $ret_array['directories']=$dir_array;\n\n return $ret_array;\n\n}", "function test_1() {\n\t\n\techo (\"yesss.\");\n\t\n\t/********************\n\t* vars\n\t********************/\n\t$msg\t= \"yeeeeees\";\n\t\n\tprintf(\"[%s : %d] %s\", basename(__FILE__), __LINE__, $msg);\n\t\n\t$dpath_Target\t= \"G:\\\\images\\\\2022\";\n\t\n\t$listOf_Entries\t= array_diff(scandir($dpath_Target), array('.', '..'));\n\t$listOf_Entries__Dir\t= array();\n\t\n// \tprint_r($listOf_Entries);\n\n\tforeach ($listOf_Entries as $entry) {\n\t\n\t\t//ref https://www.w3schools.com/php/func_filesystem_is_dir.asp\n\t\tif (is_dir($dpath_Target . \"\\\\\" . $entry)) {\n\t\t\t\n\t\t\t// push\n\t\t\tarray_push($listOf_Entries__Dir, $entry);\n\t\t\n// \t\t\t$msg\t= \"dir : $entry\";\n\t\t\t\n\t\t\t//ref https://www.w3schools.com/php/func_string_printf.asp\n// \t\t\tprintf(\"[%s : %d] %s\", \n// \t\t\t\t\t\t\t__FILE__, __LINE__, $msg);\n\t\t\t\n// \t\t\tprint (\"\\n\");\n\t\t\n\t\t} else {\n\t\t\n// \t\t\t$msg\t= \"file : $entry\";\n\t\t\t\t\n// \t\t\tprintf(\"[%s : %d] %s\",\n// \t\t\t\t\t__FILE__, __LINE__, $msg);\n\t\t\t\n// \t\t\tprint (\"\\n\");\n\t\t\t\n\t\t}//if (is_dir($dpath_Target . \"\\\\\" . $entry))\n\t\t\n\t\t/********************\n\t\t* show\n\t\t********************/\n\t\tforeach ($listOf_Entries__Dir as $dir) {\n\t\t\n\t\t\tprintf(\"[%s : %d] dir : %s\", \n// \t\t\t\t\t\t\t__FILE__, __LINE__, basename($dir));\n\t\t\t\t\t\t\t__FILE__, __LINE__, $dir);\n\t\t\t\n\t\t\tprint (\"\\n\");\n\t\t\t\n\t\t}//foreach ($listOf_Entries__Dir as $dir)\n\t\t\n\t\t\n\t\t\n\t}//foreach ($listOf_Entries as $entry)\n\t\n\t\n\t\n\t;\n}", "abstract protected function getDirectories(): array;", "public function retrieveYamlFilesFromStorageFolders() : array {}", "private function getFileLists($path)\n {\n\t\t$handle = @opendir($path);\n\n\t\tif ($handle) {\n\t\t\twhile (($file = readdir($handle)) !== false) {\n\n\t\t\t\tif ($file == '.' || $file == '..') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$fullPath = str_replace(\"\\\\\", '/', \"{$path}/{$file}\");\n\n\t\t\t\t// @todo: Don't leave it like this. Convert into an option on the package to not follow symbolic links\n\t\t\t\t// if (is_dir($fullPath) && (is_link($fullPath) == false))\n\t\t\t\tif (is_dir($fullPath)) {\n\n $add = true;\n if(!is_link($fullPath)){\n foreach ($this->tmpFilterDirsAll as $key => $val) {\n $trimmedFilterDir = rtrim($val, '/');\n if ($fullPath == $trimmedFilterDir || strpos($fullPath, $trimmedFilterDir . '/') !== false) {\n $add = false;\n unset($this->tmpFilterDirsAll[$key]);\n break;\n }\n }\n }else{\n //Convert relative path of link to absolute path\n chdir($fullPath);\n $link_path = realpath(readlink($fullPath));\n chdir(dirname(__FILE__));\n\n $link_pos = strpos($fullPath,$link_path);\n if($link_pos === 0 && (strlen($link_path) < strlen($fullPath))){\n $add = false;\n $this->RecursiveLinks[] = $fullPath;\n $this->FilterDirsAll[] = $fullPath;\n }\n }\n\n if ($add) {\n $this->getFileLists($fullPath);\n $this->Dirs[] = $fullPath;\n }\n\t\t\t\t} else {\n\t\t\t\t\tif ( ! (in_array(pathinfo($file, PATHINFO_EXTENSION), $this->FilterExtsAll)\n\t\t\t\t\t\t|| in_array($fullPath, $this->FilterFilesAll))) {\n\t\t\t\t\t\t$this->Files[] = $fullPath;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\treturn $this->Dirs;\n\t}", "function GorsyScanDirectory($scanurl,$badfilenames){\n\n $files1 = scandir($scanurl);\n unset($files1[0]);\n unset($files1[1]);\n if (!isset($foundfiles)){\n $foundfiles = array('1');\n }\n $extradirectorys = array('1');\n foreach ($files1 AS $dir){\n $pushthearray = 0;\n if (strpos($dir,\".\") !== false){\n foreach ($badfilenames AS $badfiles){\n if (strpos($dir, $badfiles)){\n $pushthearray = 1;\n }\n }\n if ($pushthearray < 1){\n array_push($foundfiles, $dir);\n }\n }else{\n array_push($extradirectorys, $dir);\n }\n }\n unset($extradirectorys[0]);\n $extradircount = count($extradirectorys);\n if ($extradircount > 0) {\n foreach ($extradirectorys AS $newscanurl){\n $usescanurl = \"$scanurl/$newscanurl\";\n GorsyScanDirectory($usescanurl,$badfilenames);\n }\n }\n unset($foundfiles[0]);\n //just for the comments code, remove for file retreival\n foreach ($foundfiles AS $removecomments){\n $commenturl = \"$scanurl/$removecomments\";\n //echo \"$commenturl<br>\";\n GorsyRemoveComments($commenturl);\n }\n}", "function d_filelist_cached($dir, $start, $length, $filter = '')\n{\n\t//sleep(1);\n\n\t$tmpdir = is_callable('get_tmp_dir') ? get_tmp_dir() : '/tmp';\n\t$cache_prefix = $tmpdir.'/dolphin'.md5(__FILE__);\n\t\n\t$cache_dat = $cache_prefix.'.dat';\n\t$cache_idx = $cache_prefix.'.idx';\n\t\n\t$new = false;\n\t\n\tif(!file_exists($cache_dat) || filemtime($dir) > filemtime($cache_dat))\n\t{\n\t\t$new = true;\n\t\t\n\t\t$fp = fopen($cache_dat, 'w+b');\n\t\t$ifp = fopen($cache_idx, 'w+b');\n\t}else\n\t{\n\t\t$fp = fopen($cache_dat, 'r+b');\n\t\t$ifp = fopen($cache_idx, 'r+b');\n\n\t\tlist(, $l) = unpack('n', fread($fp, 2));\n\t\t$cached_dir = fread($fp, $l);\n\t\t\n\t\tlist(, $l) = unpack('n', fread($fp, 2));\n\t\t$cached_filter = fread($fp, $l);\n\t\t\n\t\tif($cached_dir != $dir || $cached_filter != $filter)\n\t\t{\n\t\t\tftruncate($fp, 0);\n\t\t\tftruncate($ifp, 0);\n\t\t\t\n\t\t\tfseek($fp, 0, SEEK_SET);\n\t\t\tfseek($ifp, 0, SEEK_SET);\n\t\t\t\n\t\t\t$new = true;\n\t\t}\n\t}\n\t\n\t$items = array();\n\t$cnt = 0;\n\t\n\t$old_cwd = getcwd();\n\t\n\ttry\n\t{\n\t\tif(!@chdir($dir)) throw new Exception('Could not chdir to the folder');\n\n\t\tif($new)\n\t\t{\n\t\t\tfwrite($fp, pack('n', strlen($dir)).$dir);\n\t\t\tfwrite($fp, pack('n', strlen($filter)).$filter);\n\t\t\t\n\t\t\t$pos = ftell($fp);\n\t\t\t\n\t\t\t$dh = opendir('.');\n\n\t\t\tif(!$dh) throw new Exception('Could not open directory for reading');\n\t\t\t\n\t\t\t$filter = strtolower($filter);\n\t\t\t\n\t\t\twhile( false !== ($f = readdir($dh)) )\n\t\t\t{\n\t\t\t\tif($f == '.' || $f == '..') continue;\n\t\t\t\tif(strlen($filter) && !substr_count(strtolower($f), $filter)) continue;\n\t\t\t\t\n\t\t\t\tfwrite($ifp, pack('NN', $pos, strlen($f)));\n\t\t\t\tfwrite($fp, $f);\n\t\t\t\t\n\t\t\t\t$pos += strlen($f);\n\t\t\t\t\n\t\t\t\t// ftell is not as fast as it should be, sadly\n\t\t\t}\n\t\t\t\n\t\t\tfflush($ifp);\n\t\t\tfflush($fp);\n\t\t}\n\t\t\n\t\tfseek($ifp, $start * 8 /* length(pack('NN')) */);\n\t\t\n\t\t$first = true;\n\t\t$curr_idx = $start;\n\t\t\n\t\twhile( $curr_idx < $start + $length )\n\t\t{\n\t\t\tlist(, $pos, $l) = unpack('N2', fread($ifp, 8));\n\n\t\t\tif($first)\n\t\t\t{\n\t\t\t\tfseek($fp, $pos);\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\t\n\t\t\t$f = fread($fp, $l);\n\t\t\t\n\t\t\tif(!strlen($f)) break;\n\t\t\t\n\t\t\tif(strlen($f) != $l)\n\t\t\t{\n\t\t\t\tthrow new Exception('Consistency error');\n\t\t\t}\n\t\t\t\n\t\t\t$items[$curr_idx++] = array(\n\t\t\t\t'name' => $f,\n\t\t\t\t'size' => filesize($f),\n\t\t\t\t'is_dir' => is_dir($f),\n\t\t\t);\n\t\t}\n\t\t\n\t\t\n\t\t$cnt = filesize($cache_idx) / 8;\n\t\t\n\t\t\n\t}catch(Exception $e)\n\t{\n\t\tfclose($fp);\n\t\tfclose($ifp);\n\n\t\tunlink($cache_dat);\n\t\tunlink($cache_idx);\n\t\t\n\t\t@chdir($old_cwd);\n\n\t\treturn is_callable('d_error') ? d_error($e->getMessage()) : false;\n\t}\n\t\n\tif($cnt < 500 && $length >= 500)\n\t{\n\t\tusort($items, 'd_filelist_cached_usort_cmp');\n\t}\n\t\n\t@chdir($old_cwd);\n\t\n\treturn array( 'items' => $items, 'cnt' => $cnt );\n}", "private function getPictures($id) {\n $results = array();\n $directory = theme . \"images/catalog/\" . $id . \"/\";\n // create a handler for the directory\n $handler = opendir($directory);\n\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\" && $file != 'cache' && $file != 'thumb_medium' && $file != 'thumb_small') {\n $results[] = url . $directory . $file;\n }\n\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n }", "function getFiles() {\n $files = array();\n foreach (array_keys(module_rebuild_cache()) as $module) {\n $module_path = drupal_get_path('module', $module);\n $test = $module_path . \"/$module.test\";\n if (file_exists($test)) {\n $files[] = $test;\n }\n }\n return $files;\n }", "public function getImageCachePath();", "function GetFilePathArray()\n{\n\tif(!isset($_GET['MLS']))\n\t{\n\t\techo \"ERROR: You are trying to view a detailed listing without an MLS number in the URL.\";\n\t\texit();\n\t}\n\t$FilePathArray = null;\n\t$dir = \"Listing/photos/\" . $_GET['MLS'] . \"/\";\n\tif (is_dir($dir))\n\t{\n\t\tif ($dh = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif(!is_dir($dir . $file) && exif_imagetype($dir . $file))\n\t\t\t\t{\n\t\t\t\t\tif($FilePathArray == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$FilePathArray = array($dir . $file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_push($FilePathArray, $dir . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn $FilePathArray;\n\t\t}\n\t}\n}", "function getDirectoryList($directory, $pattern = '/./') \n{\n $results = array();\n $handler = opendir($directory);\n\n while ($fileName = readdir($handler)) {\n if(preg_match ($pattern, $fileName, $hits)) {\n $results[] = $fileName;\n }\n }\n\n closedir($handler);\n return $results;\n\n}", "function GetFilePathArrayVer2()\n{\n\tif(!isset($_GET['MLS']))\n\t{\n\t\techo \"ERROR: You are trying to view a detailed listing without an MLS number in the URL.\";\n\t\texit();\n\t}\n\t$FilePathArray = null;\n\t$dir = \"photos/\" . $_GET['MLS'] . \"/\";\n\tif (is_dir($dir))\n\t{\n\t\tif ($dh = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif(!is_dir($dir . $file) && exif_imagetype($dir . $file))\n\t\t\t\t{\n\t\t\t\t\tif($FilePathArray == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$FilePathArray = array($dir . $file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_push($FilePathArray, $dir . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn $FilePathArray;\n\t\t}\n\t}\n}", "function get_images($folder) {\n\t$files = array();\n\tif(!is_dir($folder)) return false;\n\tif ($handle = opendir($folder)) {\n\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\tif(strtolower(file_extension($file)) == 'jpg') {\n\t\t\t\t\t$files[] = \"$folder/$file\";\n\t\t\t\t}\n\t\t\t\tif(is_dir(\"$folder/$file\")) {\n\t\t\t\t\t$recursive = get_images(\"$folder/$file\");\n\t\t\t\t\tforeach($recursive as $rfile) $files[] = $rfile;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t}\n\treturn $files;\n}", "function rebuildDirectoriesCache()\n\t{\n\t\t//----------------------------------\n\t\t//\tSimply fetch it\n\t\t//----------------------------------\n\t\t\n\t\t$this->pearRegistry->db->query(\"SELECT d.* FROM pear_directories d ORDER BY directory_name ASC\");\n\t\t$directories = array();\n\t\t\n\t\twhile ( ($dir = $this->pearRegistry->db->fetchRow()) !== FALSE )\n\t\t{\n\t\t\t//----------------------------------\n\t\t\t//\tFix up directory path\n\t\t\t//----------------------------------\n\t\t\t\t\n\t\t\t$dir['directory_path']\t\t\t=\t'/' . trim($dir['directory_path'], '/');\n\t\t\t\t\n\t\t\t//----------------------------------\n\t\t\t//\tDisable root path override\n\t\t\t//----------------------------------\n\t\t\t\t\n\t\t\tif ( $dir['directory_path'] === $this->rootDirectoryPath )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t//----------------------------------\n\t\t\t//\tGet the parent route\n\t\t\t//----------------------------------\n\t\t\t$pathRoute\t\t\t\t\t\t\t\t=\texplode('/', rtrim($dir['directory_path'], '/'));\n\t\t\t$dir['directory_basename']\t\t\t\t=\t'/' . array_pop($pathRoute);\n\t\t\t$dir['parent_path']\t\t\t\t\t\t=\tstr_replace('//', '/', '/' . implode('/', $pathRoute));\n\t\t\t\t\n\t\t\t$directories[ $dir['directory_path'] ]\t=\t$dir;\n\t\n\t\t}\n\t\t\n\t\t$this->pearRegistry->cache->set('content_directories', $directories);\n\t}", "public static function get_cache_dir()\n {\n // Get Full path\n $path = WP_CLI_Helper::get_cache_dir(self::$cache_dir);\n\n // Check Exist dir\n if ( ! realpath($path)) {\n $make_dir = WP_CLI_FileSystem::create_dir(self::$cache_dir, WP_CLI_Helper::get_cache_dir());\n if ($make_dir['status'] === false) {\n return $make_dir;\n }\n }\n\n return array('status' => true, 'path' => $path);\n }", "function directoryScan($dir, $onlyfiles = false, $fullpath = false)\r\n{\r\n\r\n if (isset($dir) && is_readable($dir)) {\r\n $dlist = Array();\r\n $dir = realpath($dir);\r\n if ($onlyfiles) {\r\n $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));\r\n } else {\r\n $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::SELF_FIRST);\r\n }\r\n \r\n foreach($objects as $entry => $object){ \r\n if (!$fullpath) {\r\n $entry = str_replace($dir, '', $entry);\r\n }\r\n \r\n $dlist[] = $entry;\r\n }\r\n return $dlist;\r\n }\r\n}", "public static function assetsMap($source_dir, $directory_depth = 0, $hidden = FALSE)\n {\n if ($fp = @opendir($source_dir))\n {\n $filedata = array();\n $new_depth = $directory_depth - 1;\n $source_dir = rtrim($source_dir, '/').'/';\n\n while (FALSE !== ($file = readdir($fp)))\n {\n // Remove '.', '..', and hidden files [optional]\n if ( ! trim($file, '.') OR ($hidden == FALSE && $file[0] == '.'))\n {\n continue;\n }\n\n if (($directory_depth < 1 OR $new_depth > 0) && @is_dir($source_dir.$file))\n {\n $filedata[$file] = static::assetsMap($source_dir.$file.'/', $new_depth, $hidden);\n }\n else\n {\n $filedata[] = $file;\n }\n }\n\n closedir($fp);\n return $filedata;\n }\n echo 'can not open dir';\n return FALSE;\n }", "public function get()\r\n {\r\n $cacheFiles = [];\r\n foreach ($this->finder->getLocations() as $storagePath) {\r\n $cachePath = $storagePath . '/cache/';\r\n foreach ($this->finder->cacheImagesIn($cachePath) as $file) {\r\n $path = $cachePath . $file->getRelativePathname();\r\n\r\n $cacheFiles[] = str_replace('\\\\', '/', $path);\r\n }\r\n }\r\n\r\n $processed = $this->db->fetchAll('\r\n SELECT path \r\n FROM ImageOptimizerProcessedFiles\r\n WHERE path IS NOT NULL\r\n ');\r\n\r\n $cacheFilesProcessed = array_column($processed, 'path');\r\n\r\n return array_diff($cacheFiles, $cacheFilesProcessed);\r\n }", "public function getObjectsInContainer($path) {\n\t\t$res = false;\n\n\t\tif ($this->cached) {\n\t\t\t$key = 'webdav-' . $this->get('id') . '-oic-' . str_replace('/', '_', $path);\n\t\t\t$res = $this->xpdo->cacheManager->get($key);\n\t\t}\n\n\t\ttry {\n\t\t\tif ($res == false) {\n\t\t\t// Perform request\n\t\t\t$res = $this->client->dir($path);\n\t\t\tif ($res == false) throw new Exception('Bad data ' . $path);\n\n\t\t\tif ($this->cached)\n\t\t\t\t$this->xpdo->cacheManager->set($key, $res, $this->cacheTime);\n\t\t\t}\n\n\t\t\t$dirs = $res[0];\n\t\t\t$files = $res[1];\n\t\t} catch (Exception $e) {\n\t\t\t$this->xpdo->log(xPDO::LOG_LEVEL_ERROR, \"[DAV] Error opening dir $path: \" . $e->getMessage());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Initialize config\n\t\t$properties = $this->getPropertyList();\n\n\t\t$modAuth = $this->xpdo->user->getUserToken($this->xpdo->context->get('key'));\n\n\t\t$thumbnailType = $this->getOption('thumbnailType', $properties, 'png');\n\t\t$thumbnailQuality = $this->getOption('thumbnailQuality', $properties, 90);\n\t\t$thumbWidth = $this->xpdo->context->getOption('filemanager_thumb_width', 100);\n\t\t$thumbHeight = $this->xpdo->context->getOption('filemanager_thumb_height', 80);\n\n\t\t$thumb_default = $this->xpdo->context->getOption('manager_url', MODX_MANAGER_URL) . 'templates/default/images/restyle/nopreview.jpg';\n\t\t$thumbUrl = $this->xpdo->context->getOption('connectors_url', MODX_CONNECTORS_URL) . 'system/phpthumb.php?';\n\n\t\t$imagesExts = $this->getOption('imageExtensions', $properties, 'jpg,jpeg,png,gif');\n\t\t$imagesExts = explode(',', $imagesExts);\n\n\t\t$skipFiles = $this->getOption('skipFiles', $properties, '.svn,.git,_notes,.DS_Store,nbproject,.idea');\n\t\t$skipFiles = explode(',', $skipFiles);\n\t\tif ($this->xpdo->getParser()) {\n\t\t\t$this->xpdo->parser->processElementTags('', $skipFiles, true, true);\n\t\t}\n\n\t\t$allowedExtensions = $this->getOption('allowedFileTypes', $properties);\n\t\tif (is_string($allowedExtensions)) {\n\t\t\tif (empty($allowedExtensions)) {\n\t\t\t\t$allowedExtensions = array();\n\t\t\t} else {\n\t\t\t\t$allowedExtensions = explode(',', $allowedExtensions);\n\t\t\t}\n\t\t}\n\n\t\t$filelist = array();\n\t\t$filenames = array();\n\n\t\tforeach ($files as $file => $opts) {\n\t\t\tif (in_array($file, $skipFiles)) continue;\n\n\t\t\t$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\t\t\tif (!empty($allowedExtensions) && !in_array($ext, $allowedExtensions)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$filenames[] = strtoupper($file);\n\t\t\t$fileItem = array(\n\t\t\t\t\t'id' => $path . $file,\n\t\t\t\t\t'name' => $file,\n\t\t\t\t\t'ext' => $ext,\n\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t'lastmod' => strtotime($opts['getlastmodified']),\n\t\t\t\t\t'size' => $opts['getcontentlength'],\n\t\t\t\t\t'leaf' => true,\n\t\t\t\t\t'perms' => '',\n\t\t\t\t\t'thumb_width' => $thumbWidth,\n\t\t\t\t\t'thumb_height' => $thumbHeight,\n\t\t\t\t\t'disabled' => false,\n\t\t\t\t\t'menu' => array(\n\t\t\t\t\t\tarray('text' => $this->xpdo->lexicon('file_remove'), 'handler' => 'this.removeFile'),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t$fileItem['url']\t\t\t = $path . $file;\n\t\t\t$fileItem['relativeUrl']\t = $fileItem['url'];\n\t\t\t$fileItem['fullRelativeUrl'] = $fileItem['url'];\n\n\t\t\tif (!empty($this->baseUrl) && in_array($ext, $imagesExts) && $this->preview) {\n\t\t\t\t/* get thumbnail */\n\t\t\t\t$preview = 1;\n\n\t\t\t\t/* generate thumb/image URLs */\n\t\t\t\t$thumbQuery = http_build_query(array(\n\t\t\t\t\t'src' => $fileItem['url'],\n\t\t\t\t\t'w' => $thumbWidth,\n\t\t\t\t\t'h' => $thumbHeight,\n\t\t\t\t\t'f' => $thumbnailType,\n\t\t\t\t\t'q' => $thumbnailQuality,\n\t\t\t\t\t'far' => 'C',\n\t\t\t\t\t'HTTP_MODAUTH' => $modAuth,\n\t\t\t\t\t'wctx' => $this->xpdo->context->get('key'),\n\t\t\t\t\t'source' => $this->get('id'),\n\t\t\t\t));\n\n\t\t\t\t$thumb = $thumbUrl . urldecode($thumbQuery);\n\t\t\t\t$fileItem['image'] = $this->baseUrl . $path . $file;\n\t\t\t} else {\n\t\t\t\t$preview = 0;\n\t\t\t\t$thumb = $thumb_default;\n\t\t\t\t$fileItem['image'] = $thumb;\n\t\t\t}\n\n\t\t\t$fileItem['thumb'] = $thumb;\n\t\t\t$fileItem['preview'] = $preview;\n\n\t\t\t$filelist[] = $fileItem;\n \t\t}\n\n\t\t/* now sort files/directories */\n\t\tarray_multisort($filenames, SORT_ASC, SORT_STRING, $filelist);\n\n\t\treturn $filelist;\n\t}", "function fromDir(){\n\t\t$nodirs = $this->uri->segment(2);\n\t\t$nodirs = (($nodirs === '1') OR ($nodirs === 'true') OR ($nodirs === TRUE));\n\n\t\t//retrieve the version form the configuration to use in the names of the saved items in the cache\n\t\t$ver = FISHNET_VERSION;\n\t\t$group_name = '';\n\t\t$filePath = '';\n\t\t$show_most_downloaded = false;\n\n\t\t$groups_config = $this->config->item('groups_config');\n\t\t$groups = $groups_config['group_names'];\n\t\t$this->load->model('groups');\n\t\tforeach($groups as $group_name){\n\t\t\tif ($this->groups->is_memberOf($group_name)){\n\t\t\t\t$filePath = $groups_config[$group_name]['documents'];\n\t\t//\t\t$show_most_downloaded = $groups_config[$group_name]['show_most_downloaded'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));\n\t\tif ($this->cache->apc->is_supported()){\n\t\t\t$fileArray = $this->cache->apc->get(\"forms-fileArray-$nodirs-$group_name-$ver\");\n\t\t}else{\n\t\t\t$fileArray = $this->cache->file->get(\"forms-fileArray-$nodirs-$group_name-$ver\");\n\t\t}\n\n\t\tif (!$fileArray){\n\t\t\t$fileArray = array();\n\n\t\t\tif ($filePath){\n\t\t\t\t$filter = '#\\.(png|jpe?g|pdf|xlsx?|docx?|pptx?|url|dotx?)$#i';\n\t\t\t\t$this->arrayFromDir($filePath, $fileArray, $filter, $nodirs);\n\n\t\t\t\t//sort the long list of forms\n\t\t\t\tif ($nodirs){\n\t\t\t\t\tasort($fileArray, \"alphaForms\");\n\t\t\t\t}else{\n\t\t\t\t\tksort($fileArray);\n\t\t\t\t}\n\n\t\t\t\t$this->cache->save(\"forms-fileArray-$nodirs-$group_name-$ver\", $fileArray, 43200);\n\t\t\t}else{\n\t\t\t\tshow_error(\"There is a problem loading Forms Central, please try again later. If the problem persists call the Helpdesk at x4024\");\n\t\t\t}\n\t\t}\n\n\t\treturn array(\n\t\t\t'forms' => $fileArray,\n\t\t\t'nodirs' => $nodirs//,\n\t\t//\t'show_most_downloaded' => $show_most_downloaded\n\t\t);\n\t}", "function cache_image($url)\n{\n\t$imagepath = 'cache/'.basename($url);\n\tif (!file_exists($imagepath)) {\n\t\t$curl_handle = curl_init();\n\t\t$to = 20;\n\t\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handle, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl_handle, CURLOPT_BINARYTRANSFER, 1);\n\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');\n\t\t$data = curl_exec($curl_handle);\n\t\tif ($data !== FALSE || strcmp($data, 'Invalid Request') == 0) {\n\t\t\t$filepointer = fopen($imagepath, 'x');\n\t\t\tfwrite($filepointer, $data);\n\t\t\tfclose($filepointer);\n\t\t\treturn $imagepath;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn $imagepath;\n\t}\n}", "public function getExcludedImageDirectories()\n {\n $directories = array();\n\n // If we aren't compressing the resized images we need to exclude the directory\n if (!$this->compressCatalogResized()) {\n $directories[self::TYPE_CATALOG] = Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath() . DS . 'cache';\n }\n\n // Ignore the thumb directory, as it's not utilised on the front-end\n if ($this->compressCms()) {\n $directories[self::TYPE_CMS] = Mage::getBaseDir('media') . DS . 'wysiwyg' . DS . '.thumbs';\n }\n\n return $directories;\n }", "function imageList($q = \"\"){\r\n $directory = $this->directory;\r\n // put all files in an array\r\n $dir = glob($directory.'*'.$q.'*.jpg');\r\n // Return false if the directory is empty or somthing wrong in Getting the file list.\r\n if(! $dir) return false;\r\n // Lets short the file list by date.\r\n uasort($dir, function($a, $b) {\r\n return filemtime($a) < filemtime($b);\r\n });\r\n // print_r($out);\r\n return $dir;\r\n }", "function get_directory_file($path)\n{\n $path_id=opendir($path);\nwhile ($file_name=readdir($path_id))\n{\n if ($file_name!=\".\" and $file_name!=\"..\")\n {\n if (is_file($path.\"/\".$file_name))\n {\n $found_file[]=$file_name;\n\t\t}\n\t}\n}\nclosedir($path_id);\nif (!isset($found_file))\n$found_file=array();\nreturn $found_file;\n}", "function listaDir(){\n\t\t$base='public/images/';\n\t\t//$displaImg=\"images/\";\n\t\t\t$path = $_SERVER['DOCUMENT_ROOT'].$base;\n\t\t\t$dirs = array();\n\t\t\t// directory handle\n\t\t\t$dir = dir($path);\n\t\t\twhile (false !== ($entry = $dir->read())) {\n\t\t\t\tif ($entry != '.' && $entry != '..') {\n\t\t\t\t\tif (is_dir($path . '/' .$entry)) {\n\t\t\t\t\t\t//printVar($entry);\n\t\t\t\t\t\tif($entry!='cursos'){\n\t\t\t\t\t\t\t//printVar($entry);\n\t\t\t\t\t\t\t$dirs[] = $entry;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $dirs;\n\n\n\n\n\t}" ]
[ "0.64268523", "0.6311874", "0.6268394", "0.6145593", "0.606642", "0.6062669", "0.60555774", "0.6016393", "0.59882456", "0.59810066", "0.5976143", "0.59610915", "0.59591377", "0.5934436", "0.5930267", "0.59199756", "0.58881027", "0.58609444", "0.5859829", "0.58450824", "0.5843143", "0.5823204", "0.58091307", "0.5804107", "0.57897675", "0.57878447", "0.5785245", "0.578031", "0.57726645", "0.57695067", "0.5764378", "0.5760323", "0.5757593", "0.57570475", "0.57562524", "0.57503945", "0.5748062", "0.57320017", "0.5729776", "0.57205576", "0.57030696", "0.5699159", "0.5697196", "0.5697196", "0.5696463", "0.56895494", "0.566914", "0.5668958", "0.5664486", "0.56584287", "0.5657682", "0.5655935", "0.56550986", "0.56486803", "0.56428796", "0.5623305", "0.5617039", "0.56058794", "0.558794", "0.5586202", "0.55614746", "0.55610454", "0.5559923", "0.55478424", "0.55449885", "0.5544956", "0.5544232", "0.55400896", "0.5527023", "0.5522745", "0.5520165", "0.551891", "0.5516302", "0.5515896", "0.5509181", "0.5499729", "0.5495386", "0.5489331", "0.548684", "0.5485619", "0.5480893", "0.54783595", "0.54644036", "0.5464234", "0.5463565", "0.5459555", "0.54579586", "0.5455716", "0.5455567", "0.5454706", "0.5449934", "0.54442024", "0.5443099", "0.5436196", "0.5432449", "0.5422789", "0.5422568", "0.5416563", "0.54149455", "0.5408921" ]
0.82874465
0
function directory_data function path_list(string $path) return list of path parts and URLs in an array: array( url, name )
Функция directory_data функция path_list(string $path) возвращает список частей пути и URL в массиве: array( url, name )
function path_list($path) { global $CFG_url_album, $CFG_album_name; $image_subdir_parts = array(); if ($path != '') { $image_subdir_parts = explode('/', $path); } $path_list[] = array('url' => $CFG_url_album, 'name' => $CFG_album_name); for ($i = 0; $i < count($image_subdir_parts); $i++) { $k = key($image_subdir_parts); $v = current($image_subdir_parts); $path_list[] = array('url' => build_url('list', '0', implode('/', array_slice($image_subdir_parts, 0, $i + 1))), 'name' => $image_subdir_parts[$i]); } // for return $path_list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirList();", "public function list(string $path): array;", "public function listDirectory($path)\n {\n \t// Get all the directories\n $list = new ArrayObject();\n\t\ttry {\n\t if (!$this->getConnection()) {\n\t return array();\n\t }\n\t\n\t if (strpos($path, 'workspace://') === 0) {\n\t $id = str_replace('workspace://SpacesStore/', '', $path);\n\t $parent = $this->getNode($id);\n\t } else {\n\t $parent = $this->getNodeByPath($this->normalizePath($path));\n\t }\n\t\n\t if (!$parent) {\n\t return $list;\n\t // throw new Exception(\"Failed getting children for path $path\");\n\t }\n\t\n\t // list everything using the node->getChildren()\n\t $children = $parent->getChildren();\n\t foreach ($children as $childAssoc) {\n\t $child = $childAssoc->getChild();\n\t /* @var $child Node */\n\t if (strpos($child->getType(), 'folder')) {\n\t $list->append($child->cm_name);\n\t } else {\n\t // content\n\t $fileObject = $this->nodeToFile($child);\n\t if (za()->getUser()->getRole() == User::ROLE_EXTERNAL && $fileObject->isprivate) {\n\t continue;\n\t }\n\t $list->append($fileObject);\n\t }\n\t }\n\t\t} catch (Exception $e) {\n\t\t\t$this->log->err(\"Failed to load files from $path: \".$e->getMessage());\n\t\t}\n\n return $list;\n }", "function dirlist( &$list, $path ) {\n $dh = @opendir( $path ); \n\n while( false !== ( $file = readdir( $dh ) ) ) {\n\t\tif ( !is_dir( \"$path/$file\" ) && endswith( $file, \".txt\" ) && strpos($file, '#' ) !== 0 ) {\n\t\t\t$list[] = array( 'file' => $file, );\n\t\t}\n }\n\n closedir( $dh );\n}", "function dirlist($p) {\n return array( $p[0], \"$p[0]$p[1]\", \"$p[0]$p[1]$p[2]\", \"$p[0]$p[1]$p[2]$p[3]\", \"$p[0]$p[1]$p[2]$p[3]$p[4]\", $p );\n}", "function fileupload_filelist($path){\n\tif(!$dp = @opendir($path)){\n\t\t// echo \"err - \".__LINE__;\n\t} else while($d = @readdir($dp)){\n\t\tif(substr($d, 0, 1)=='.'){\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t$list[] = $path.\"/\".$d;\n\t\t}\n\t}\n\t\n\tif(sizeof($list)){\n\t\treturn $list;\n\t} else {\n\t\treturn false;\n\t}\n}", "private function getFileLists($path)\n {\n\t\t$handle = @opendir($path);\n\n\t\tif ($handle) {\n\t\t\twhile (($file = readdir($handle)) !== false) {\n\n\t\t\t\tif ($file == '.' || $file == '..') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$fullPath = str_replace(\"\\\\\", '/', \"{$path}/{$file}\");\n\n\t\t\t\t// @todo: Don't leave it like this. Convert into an option on the package to not follow symbolic links\n\t\t\t\t// if (is_dir($fullPath) && (is_link($fullPath) == false))\n\t\t\t\tif (is_dir($fullPath)) {\n\n $add = true;\n if(!is_link($fullPath)){\n foreach ($this->tmpFilterDirsAll as $key => $val) {\n $trimmedFilterDir = rtrim($val, '/');\n if ($fullPath == $trimmedFilterDir || strpos($fullPath, $trimmedFilterDir . '/') !== false) {\n $add = false;\n unset($this->tmpFilterDirsAll[$key]);\n break;\n }\n }\n }else{\n //Convert relative path of link to absolute path\n chdir($fullPath);\n $link_path = realpath(readlink($fullPath));\n chdir(dirname(__FILE__));\n\n $link_pos = strpos($fullPath,$link_path);\n if($link_pos === 0 && (strlen($link_path) < strlen($fullPath))){\n $add = false;\n $this->RecursiveLinks[] = $fullPath;\n $this->FilterDirsAll[] = $fullPath;\n }\n }\n\n if ($add) {\n $this->getFileLists($fullPath);\n $this->Dirs[] = $fullPath;\n }\n\t\t\t\t} else {\n\t\t\t\t\tif ( ! (in_array(pathinfo($file, PATHINFO_EXTENSION), $this->FilterExtsAll)\n\t\t\t\t\t\t|| in_array($fullPath, $this->FilterFilesAll))) {\n\t\t\t\t\t\t$this->Files[] = $fullPath;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\treturn $this->Dirs;\n\t}", "function directory_data($path, $url_path) {\n global $CFG_image_valid, $CFG_url_album, $CFG_thumb_width, $CFG_thumb_height, $CFG_image_width, $CFG_image_height, $CFG_path_images, $CFG_cache_outside_docroot;\n\n //compensate for switching away from eregi()\n $CFG_image_valid_i = array();\n foreach ($CFG_image_valid as $e) {\n $CFG_image_valid_i[] = $e;\n $CFG_image_valid_i[] = strtoupper($e);\n }\n // put CFG_image_valid array into eregi() form\n $valid_extensions = '(.' . implode('|.', $CFG_image_valid_i) . ')$';\n\n path_security_check($path, $CFG_path_images);\n\n // load raw directory first, sort, and reprocess\n //\n $files_raw = array();\n $dirs_raw = array();\n if ($h_dir = opendir($path)) { // FS READ\n while (false !== ($filename = readdir($h_dir))) { // FS READ\n if ($filename != '.' && $filename != '..') {\n // set complete url\n //\n if ($url_path == '') {\n $url = $filename;\n } else {\n $url = \"$url_path/$filename\";\n }\n\n path_security_check(\"$path/$filename\", $CFG_path_images);\n\n if (is_readable(\"$path/$filename\") && // FS READ\n is_file(\"$path/$filename\") && // FS READ\n preg_match(\"/{$valid_extensions}/\", $filename)) {\n $files_raw[] = array('name' => $filename,\n 'url' => $url);\n } else if (is_readable(\"$path/$filename\") &&\n is_dir(\"$path/$filename\") &&\n substr($filename, 0, 1) != '_') { // FS READ\n $dirs_raw[] = array('name' => $filename,\n 'url' => $url);\n } // if ... else is_file or is_dir\n } // if\n } // while\n closedir($h_dir); // FS READ\n } // if opendir\n\n // sort directory arrays by filename\n //\n function cmp($a, $b) {\n return strcasecmp($a['name'], $b['name']);\n } // function cmp\n @usort($dirs_raw, 'cmp');\n @usort($files_raw, 'cmp');\n\n // reprocess arrays\n //\n $files = array();\n $dirs = array();\n $file_count = 0;\n $dir_count = 0;\n foreach ($files_raw as $k => $v) {\n // set thumbnail cached vs. not\n //\n $thumb = cache_test($v['url'], $CFG_thumb_width, $CFG_thumb_height); // FS FUNCTION\n $image = cache_test($v['url'], $CFG_image_width, $CFG_image_height); // FS FUNCTION\n\n if ($CFG_cache_outside_docroot || !$thumb['is_cached']) {\n $thumb_url = build_url('image', $CFG_thumb_width . 'x' . $CFG_thumb_height, $v['url']);\n } else {\n $thumb_url = $thumb['cache_url'];\n }\n\n if ($CFG_cache_outside_docroot || !$image['is_cached']) {\n $image_url = build_url('image', $CFG_image_width . 'x' . $CFG_image_height, $v['url']);\n } else {\n $image_url = $image['cache_url'];\n }\n\n path_security_check(\"$path/$v[name]\", $CFG_path_images);\n\n $files[] = array('name' => $v['name'],\n 'index' => $file_count,\n 'path' => \"$path/$v[name]\",\n 'thumb_url' => $thumb_url,\n 'image_url' => $image_url,\n 'view_url' => build_url('view', $file_count, $v['url']),\n 'raw_url' => build_url('image', '0', $v['url'])); // 0 index for raw image\n $file_count++;\n }\n\n foreach ($dirs_raw as $k => $v) {\n $dirs[] = array('name' => $v['name'],\n 'index' => $dir_count,\n 'list_url' => build_url('list', '0', $v['url']));\n $dir_count++;\n }\n\n return(array('files' => $files, 'directories' => $dirs));\n}", "function files_list($dir) {\n\tglobal $cfg;\n\n\t// Make sure permission is allowed to this dir\n\tif (files_restrict($dir)) {\n\t\treturn FALSE;\n\t}\n\n\t$path = FILES_PATH.files_dir($dir).'/';\n\n\t$files = array();\n\t$s = $cfg['files']['secureurl'];\n\n\tforeach (glob($path.'*.*') AS $file) {\n\t\t$fn = basename($file);\n\n\t\t$files[] = array(\n\t\t\t'name' => $fn,\n\t\t\t'size' => filesize($file),\n\t\t\t'url' => $s ? '/files/cat:'.$dir.'/fn:'.$fn.'/'\n\t\t\t\t: FILES_URL.$dir.'/'.$fn\n\t\t);\n\t}\n\n\treturn $files;\n}", "public function dir(string $path): array;", "public function files_list();", "function dir2list($dir)\n{\n $return = array();\n $dir_listing = directory_map($dir, 1);\n \n sort($dir_listing);\n foreach($dir_listing as $dir_name)\n {\n $temp = array();\n\n $temp['path'] = $dir_name;\n\n $dir_name = str_replace(array('_'), \" \", $dir_name);\n $dir_name = ucwords($dir_name);\n $temp['title'] = $dir_name;\n\n $return[] = $temp;\n }\n\n return $return;\n}", "function get_file_list($path)\n{\n $list = array();\n if (substr($path, -1) != '/') {\n $path .= '/';\n }\n $handle = opendir($path);\n if (!$handle) {\n return false;\n }\n\n while (false !== ($file = readdir($handle))) {\n if (is_file($path . $file)) {\n $list[] = $file;\n }\n }\n\n closedir($handle);\n\n return $list;\n}", "private function listFiles($path)\n\t{\n\t\tforeach (new DirectoryIterator($path) as $file) \n\t\t{\n\t\t\t\tif($file->isDot() || $file->getFileName()==\"..\" || $file->getFileName()==\".git\" || $file->getFileName()==\".htaccess\") \n\t\t\t\t\tcontinue;\n\t\t\t\tif(is_dir($file)) $this->listFiles($file);\n\t\t\t\telse\n\t\t\t\t\tarray_push($this->arr,$path.\"/\".$file);\n\t\t}\n\t\treturn $this->arr;\n\t}", "function getFolderList($path = '')\n\t{\n\t\t$ret = array();\n\t\txoops_load(\"XoopsList\");\n\t\tforeach(XoopsList::getDirListAsArray($path) as $folder)\n\t\t\tforeach(getFolderList($path . DIRECTORY_SEPARATOR . $folder) as $key => $values)\n\t\t\t\t$ret[$key] = $values;\n\t\t$ret[sha1(_RESOURCES_SALT_BLOWFISH.$path)] = array('is' => 'folder', 'path' => $path, 'files' => count($files = XoopsList::getFileListAsArray($path)));\n\t\tforeach($files as $file)\n\t\t\t$ret[sha1(_RESOURCES_SALT_BLOWFISH.($md5 = md5_file($path . DIRECTORY_SEPARATOR . $file)))] = array('is' => 'file', 'file' => $file, 'path' => $path, 'bytes' => filesize($path . DIRECTORY_SEPARATOR . $file));\n\t\treturn $ret;\n\t}", "abstract public function paths(): array;", "function directorylist($dir, $recurse=false)\n {\n \n if (!file_exists($dir)) { return false; }\n\n// array to hold return value\n\n $retval = array();\n\n// add trailing slash if missing\n\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n// open pointer to directory and read list of files\n\n $d = @dir($dir) or die();\n while(false !== ($entry = $d->read())) {\n\n// skip hidden files\n\n if($entry[0] == '.') continue;\n if(is_dir(\"$dir$entry\")) {\n $retval[] = array(\n \"name\" => \"$dir$entry/\",\n \"type\" => filetype(\"$dir$entry\"),\n \"size\" => 0,\n \"lastmod\" => filemtime(\"$dir$entry\")\n );\n\n if($recurse && is_readable(\"$dir$entry/\")) {\n $retval = array_merge($retval, directorylist(\"$dir$entry/\", true));\n }\n } elseif(is_readable(\"$dir$entry\")) {\n $retval[] = array(\n \"name\" => \"$dir$entry\",\n \"filename\" => \"$entry\",\n \"size\" => filesize(\"$dir$entry\"),\n \"lastmod\" => filemtime(\"$dir$entry\")\n );\n }\n }\n $d -> close();\n\n return $retval;\n }", "public function getDirectories();", "public function getDirectories();", "function ListDir($path, $params)\n{\n\t$entries = array();\n\t$d = dir($path);\n\twhile (false !== ($entry = $d->read()))\n\t{\n\t\t$keep = 1;\n\t\tif(isset($params['extentions']))\n\t\t{\n\t\t\t$keep = 0;\n\t\t\t$extention = GetFileExtention($entry);\n\t\t\t\n\t\t\tif(in_array($extention, $params['extentions']))\n\t\t\t\t//echo $extention . \"\\n\";\n\t\t\t\t$keep = 1;\n\t\t}\n\t\t\n\t\tif($keep)\n\t\t\t$entries[] = $entry;\n\t}\n\t$d->close();\n\t\n\treturn $entries;\n}", "public function getFilePaths();", "public function getFilePaths();", "public function getDirectoryList($path)\n\t{\n\t\treturn $this->sftp->get_file_list($path);\n\t}", "static public function listDirectory($path)\n\t{\n\t\t$res = array();\n\t\t$dh = opendir($path);\n\t\tif (!$dh) {\n\t\t\tthrow new USVN_Exception(T_(\"Can't read directory %s.\", $path));\n\t\t}\n\t\twhile (($subDir = readdir($dh)) !== false) {\n if ($subDir != '.' && $subDir != '..' && $subDir != '.svn') {\n\t\t\t\tarray_push($res, $subDir);\n\t\t\t}\n }\n\t\treturn $res;\n\t}", "function opendir($path)\n{\n\treturn array();\n}", "function getDirectoryListing($basedir = \"\");", "function path_list($dir,$list_file=true,$check_children=false){\r\n\t$dir = rtrim($dir,'/').'/';\r\n\tif (!is_dir($dir) || !($dh = opendir($dir))){\r\n\t\treturn array('folderlist'=>array(),'filelist'=>array());\r\n\t}\r\n\t$folderlist = array();$filelist = array();//文件夹与文件\r\n\twhile (($file = readdir($dh)) !== false) {\r\n\t\tif ($file != \".\" && $file != \"..\" && $file != \".svn\" ) {\r\n\t\t\t$fullpath = $dir . $file;\r\n\t\t\tif (is_dir($fullpath)) {\r\n\t\t\t\t$info = folder_info($fullpath);\r\n\t\t\t\tif($check_children){\r\n\t\t\t\t\t$info['isParent'] = path_haschildren($fullpath,$list_file);\r\n\t\t\t\t}\r\n\t\t\t\t$folderlist[] = $info;\r\n\t\t\t} else if($list_file) {//是否列出文件\r\n\t\t\t\t$info = file_info($fullpath);\r\n\t\t\t\tif($check_children) $info['isParent'] = false;\r\n\t\t\t\t$filelist[] = $info;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tclosedir($dh);\r\n\treturn array('folderlist' => $folderlist,'filelist' => $filelist);\r\n}", "function page_list($path='content')\n{\n\t$unclean = scandir($path);\n\t$clean = array();\n\tforeach ($unclean as $dir) {\n\t\tif ($dir[0] != \".\") { // no hidden files\n\t\t\tarray_push($clean, $dir);\n\t\t} else {\n\t\t\tcontinue;\n\t\t}\n\t}\n\treturn array_reverse($clean);\n}", "function listDir($path) {\r\n return scandir(\"ssh2.sftp://\" . $this->ftp_resource . $path);\r\n }", "public function files_list($path = '') {\n\t\t$ret = array();\n\t\t$files = $this->sftp->nlist( (strlen($path) > 0 ? $path : $this->default_dir) );\n\t\tforeach ($files as $obj) {\n\t\t\tif($obj != \".\" && $obj != \"..\") {\n\t\t\t\tarray_push($ret, $obj);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "abstract protected function getDirectories(): array;", "public function directoryList($reversed = FALSE);", "public function ls($path);", "function getDirsList ( $path = '.' , $returnHidden = true )\n\t{\n\t\t$path = $this->getPath($path) ;\n\t\tif ( $path === false )\n\t\t{\n\t\t\t$this->errors[] = 1002 ;\n\t\t\treturn false ;\n\t\t}\n\t\t\n\t\t$array = array () ;\n\t\t$i = 0 ;\n\t\t$files = scandir ( $path ) ;\n\t\tforeach ( $files as $f )\n\t\t{\n\t\t\tif ($f != '.' && $f != '..' && @is_dir ( $path.DS.$f ) )\n\t\t\t{\n\t\t\t\tif ( $returnHidden == false && (substr($f, 0 , 1) == '.' || ( $this->CVSAsHidden && $f == 'CVS' ) ))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$array[$i] = array () ;\n\t\t\t\t$array[$i]['name'] = $f ;\n\t\t\t\t$array[$i]['path'] = $path.$f . DS ;\n\t\t\t\t$array[$i]['type'] = 'dir' ;\n\t\t\t\t$i ++ ;\n\t\t\t}\n\t\t}\n\t\treturn $array ;\n\t}", "public function ls(string $path): array {\n\t\t$data = $this->query('GET', sprintf('%s/folder', self::BASE_URL), [\n\t\t\t'home'\t => $path,\n\t\t\t'sort'\t => '{\"type\":\"name\",\"order\":\"asc\"}'\n\t\t]);\n\n\t\t$list = [];\n\t\tforeach ($data['body']['list'] as $item) {\n\t\t\tswitch ($item['type']) {\n\t\t\t\tcase \"file\":\n\t\t\t\t\t$object = new CloudFile($item['home']);\n\t\t\t\t\t$object->setMtime($item['mtime']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"folder\":\n\t\t\t\t\t$object = new CloudFolder($item['home']);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->warning(\"Unknown item type\", $item);\n\t\t\t\t\tcontinue 2;\n\t\t\t}\n\n\t\t\t$list[] = $object;\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getPaths();", "abstract public function ls($path);", "abstract public function dir($path);", "function collect_directories_and_files($path) {\n # Also, `scandir()` already sorts the directory entries.\n $entries = scandir($path);\n return array_partition($entries, function($entry) {\n return is_dir($entry);\n });\n }", "public function listFiles(string $path = ''): array;", "function listdir($path)\r\n {\r\n $this->checkExists($path);\r\n $this->checkIsDir($path);\r\n $return = scandir($this->root . $path);\r\n $return = array_filter($return, array($this, 'removeDirsFromList'));\r\n sort($return);\r\n return $return;\r\n }", "public static function\n\t\tlist_directories_in_directory($path)\n\t{\n\t\t$dirs = array();\n\t\t//$dir_handle = @opendir($path) or die(\"Unable to open $path\");\n\t\tif (!$dir_handle = opendir($path)) {\n\t\t\tthrow new Admin_FileException(\"Unable to open $path\");\n\t\t}\n\t\twhile ($file = readdir($dir_handle)) {\n\n\t\t\tif(\n\t\t\t\t$file == \".\" \n\t\t\t\t|| $file == \"..\" \n\t\t\t\t|| substr($file, 0, 1) == \".\" \n\t\t\t\t|| substr($file, -1) == \"~\"\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tif (is_dir($path . $file)) {\n\t\t\t\t$dirs[$file] = self::\n\t\t\t\t\tlist_directories_in_directory(\n\t\t\t\t\t\t$path . $file . '/'\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tclosedir($dir_handle);\n\t\tif (count($dirs) < 1) {\n\t\t\t$dirs = NULL;\n\t\t}\n\t\treturn $dirs;\n\t}", "function listdir($dirname=\"\"){\t\n\n\n$dir = opendir ($dirname);//打开目录返回资源给变量$dir\nreaddir($dir);//打开一次为当前目录\nreaddir($dir);//打开第二次才到指定目录下\n$arr=array();\n$arrname=array();\n$arrcname=array();\n$i=0;\nwhile($file = readdir($dir)){\t\n$filename=$dirname.'/'.$file; \n \t if(is_dir($filename)===true){\n\t //echo \"目录:\".$filename.\"<br />\";\t \n\t listdir($filename);//如果是目录用递归遍历\n\t}else{\n\t//echo \"文件:\".$filename.\"<br />\"; \n\t\n\t$i++;\n\t$arr[$i]= $filename;\n\t} }\t\n\tclosedir($dir);//关闭目录资源\n\treturn $arr;//返回数组\n\t}", "public function listRemote($path,$_base=''){\n\terror_log(\"listRemote path=\".$path);\n\t$_array = array();\n\t$_ls = svn_ls($path);\n\tforeach($_ls as $_key=>$_value){\n\t\tif(array_key_exists('type',$_value)){\n\t\t\tif($_value['type']==='dir'){\n\t\t\t\t$_subpath = $_base.$_value['name'].'/';\n\t\t\t\t$_array[] = $_subpath;\n\t\t\t\t$_array = array_merge($_array,$this->listRemote($path.\"/\".$_value['name'],$_subpath));\n\t\t\t}else if($_value['type']==='file'){\n\t\t\t\t$_array[] = $_base.$_value['name'];\n\t\t\t}\n\t\t}\n\t}\n\treturn $_array;\n }", "function buildList($path, $path_name = 'root') {\n global $app_path;\n \n $scanned = scandir($path);\n $list = array();\n \n // If $scanned is an actual directory...\n if ($scanned) {\n // Create new item to insert into the list\n $new_item = mapToItem($path_name);\n \n // Collect .less files, if any, and add them to the new item as 'children'\n $less_files = array_filter($scanned, 'filterLessFiles');\n $new_item['children'] = array_map('mapToItem', array_values($less_files));\n \n // For nested items, we include an additional 'path' attribute\n if ($app_path !== $path) {\n $len = count($new_item['children']);\n \n for ($i = 0; $i < $len; $i++) {\n $new_item['children'][$i]['path'] = str_replace($app_path . '/', '', $path);\n }\n }\n \n // Recursively create nested lists for nested directories\n $directories = array_filter($scanned, 'filterDirectories');\n \n foreach ($directories as $dir) {\n // Recursive calls need to remove the outer array by using [0]\n $new_dir = buildList($path . '/' . $dir, $dir)[0];\n \n if ($path_name === 'root') {\n array_push($list, $new_dir);\n } else {\n array_push($new_item['children'], $new_dir);\n }\n }\n \n // Push finalized new item into list\n array_push($list, $new_item);\n }\n \n return $list;\n}", "function dirList($directory) {\n $results = array();\n\n $handler = opendir($directory);\n\n while ($file = readdir($handler)) {\n //don't read current and parent!\n if ($file != '.' && $file != '..') {\n $results[] = $file;\n }\n }\n\n closedir($handler);\n return $results;\n}", "function getSubfolders() ;", "public function listDirectory($path)\n {\n $rs = $this->run(sprintf('find %s -maxdepth 1 -mindepth 1 -type d', $path));\n\n return explode(\"\\n\", trim($rs));\n }", "public function folderList ($path = '') {\n\n $param = [\n \"path\" => $path,\n \"recursive\" => false,\n \"include_media_info\" => false,\n \"include_deleted\" => false,\n \"include_mounted_folders\" => true,\n \"include_has_explicit_shared_members\" => false,\n \"include_non_downloadable_files\" => true\n ];\n\n $response = $this->sendRequest('files/list_folder', $param);\n $response = $this->parseResponse($response);\n\n dd($response);\n\n }", "function GetFilePathArray()\n{\n\tif(!isset($_GET['MLS']))\n\t{\n\t\techo \"ERROR: You are trying to view a detailed listing without an MLS number in the URL.\";\n\t\texit();\n\t}\n\t$FilePathArray = null;\n\t$dir = \"Listing/photos/\" . $_GET['MLS'] . \"/\";\n\tif (is_dir($dir))\n\t{\n\t\tif ($dh = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif(!is_dir($dir . $file) && exif_imagetype($dir . $file))\n\t\t\t\t{\n\t\t\t\t\tif($FilePathArray == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$FilePathArray = array($dir . $file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_push($FilePathArray, $dir . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn $FilePathArray;\n\t\t}\n\t}\n}", "function listaDir(){\n\t\t$base='public/images/';\n\t\t//$displaImg=\"images/\";\n\t\t\t$path = $_SERVER['DOCUMENT_ROOT'].$base;\n\t\t\t$dirs = array();\n\t\t\t// directory handle\n\t\t\t$dir = dir($path);\n\t\t\twhile (false !== ($entry = $dir->read())) {\n\t\t\t\tif ($entry != '.' && $entry != '..') {\n\t\t\t\t\tif (is_dir($path . '/' .$entry)) {\n\t\t\t\t\t\t//printVar($entry);\n\t\t\t\t\t\tif($entry!='cursos'){\n\t\t\t\t\t\t\t//printVar($entry);\n\t\t\t\t\t\t\t$dirs[] = $entry;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $dirs;\n\n\n\n\n\t}", "public function get_listing($path = '', $page = '')\n {\n global $CFG;\n $ret = array();\n $ret['nologin'] = true;\n $ret['nosearch'] = true;\n $ret['norefresh'] = true;\n $ret['list'] = array();\n $ret['dynload'] = false;\n $ret['upload'] = array('label' => get_string('attachment', 'repository'), 'id' => 'repo-form');\n $ret['allowcaching'] = false; // indicates that result of get_listing() can be cached in filepicker.js\n\n return $ret;\n }", "function dir_get($path = '.')\r\n{\r\n\t$ret = array();\r\n\t$dp = opendir($path);\r\n\twhile ($f = readdir($dp))\r\n\t{\r\n\t\tif ($f[0] == '.') continue;\r\n\t\tif (is_dir($path.'/'.$f)) $ret[] = $f;\r\n\t}\r\n\treturn $ret;\r\n}", "function listDirectoryByDate($path)\n {\n $dir = opendir($path);\n $list = array();\n while ($file = readdir($dir)) {\n if ($file != '.' && $file != '..' && !is_dir($file)) {\n $ctime = filectime($path . $file) . rand(1000, 9999);\n $list[$ctime] = $file;\n }\n }\n closedir($dir);\n krsort($list);\n\n return $list;\n }", "public static function packageList () {\n\t\t$dir = new DirectoryIterator(dirname(__DIR__)); \n\t\t$list = array();\n\n\t\tforeach ( $dir as $item ) {\n\t\t\tif ( !$item->isDir() || $item->isDot() || '.' === substr($item->getFilename(), 0, 1) )\n\t\t\t\tcontinue;\n\n\t\t\t$list[str_replace('/', '\\\\', Autoloader::parseToPath($item->getFilename(), 15))] = $item->getFilename();\n\t\t}\n\n\t\tunset( $dir );\n\n\t\treturn $list;\n\t}", "function read_directory_files($directory, $return_data = true)\n{\n $file_list = array();\n $file_data = false;\n\n if ($handle = opendir($directory)) {\n while (false !== ($file = readdir($handle))) {\n // do something with the file\n // note that '.' and '..' is returned even\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n // collect the filenames & data\n if ($return_data == true) {\n $file_data = explode(\"\\n\", file_get_contents($directory . '/' . $file));\n }\n\n $file_list[$file] = $file_data;\n }\n }\n closedir($handle);\n }\n return $file_list;\n}", "function listDirs() {\n\tglobal $base;\n\t$result = array();\n\t\n\t// if the Directory opens ...\n\tif(($dir = @opendir(IMAGE_DIR . $base))) {\n\t\t\n\t\t// ... while Files remain ...\n\t\twhile(FALSE !== ($file = readdir($dir))) {\n\t\t\t\n\t\t\t// ... if NOT hierarchy entries ...\n\t\t\tif($file != \".\" && $file != \"..\") {\n\t\t\t\t\n\t\t\t\t// ... if File is a Directory ...\n\t\t\t\tif(is_dir(IMAGE_DIR . basePath($file)))\n\t\t\t\t\n\t\t\t\t// ... return the Directory\n\t\t\t\t$result[] = $file;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// close the Directory\n\t\tclosedir($dir);\n\t}\n\t\n\t// return the Directories\n\treturn $result;\n}", "function get_file_list() {\n $f_list = array();\n $f_list[] = 'index.php;Web Page;Login Web Page';\n $f_list[] = 'password.png;PNG Image;Image for login page';\n return $f_list;\n }", "function referentiel_list_directories_and_files ($rootdir) {\r\n\r\n $results = null;\r\n\r\n if ($dir = opendir($rootdir)){\r\n while (false !== ($file=readdir($dir))) {\r\n if ($file==\".\" || $file==\"..\") {\r\n continue;\r\n }\r\n $results[$file] = $file;\r\n }\r\n closedir($dir);\r\n }\r\n return $results;\r\n }", "function LoadDirectoryFiles(string $dirPath): \\raylib\\FilePathList { return new \\raylib\\FilePathList; }", "function dirList ($directory) {\n\n // create an array to hold directory list\n $results = array();\n\n // create a handler for the directory\n $handler = opendir($directory);\n\n\n\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n\n // if $file isn't this directory or its parent,\n // add it to the results array\n if ( $file != '.' &&\n $file != '..'\n //&& ( strpos($file, '-'. get_option( 'wpdev_mc_icon_size_w' ) . 'x' . get_option( 'wpdev_mc_icon_size_h' ) ) !== false )\n )\n $results[] = $file;\n }\n\n // tidy up: close the handler\n closedir($handler);\n\n // done!\n return $results;\n\n }", "public function getDirectory(string $path): array\n {\n $response = $this->getHttpClient()->request('GET', sprintf('server/directory/%s', rawurlencode($path)));\n\n return json_decode($response->getBody());\n }", "function GetFilePathArrayVer2()\n{\n\tif(!isset($_GET['MLS']))\n\t{\n\t\techo \"ERROR: You are trying to view a detailed listing without an MLS number in the URL.\";\n\t\texit();\n\t}\n\t$FilePathArray = null;\n\t$dir = \"photos/\" . $_GET['MLS'] . \"/\";\n\tif (is_dir($dir))\n\t{\n\t\tif ($dh = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif(!is_dir($dir . $file) && exif_imagetype($dir . $file))\n\t\t\t\t{\n\t\t\t\t\tif($FilePathArray == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$FilePathArray = array($dir . $file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_push($FilePathArray, $dir . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t\treturn $FilePathArray;\n\t\t}\n\t}\n}", "public function getDirectoryListingSimple($directory);", "function getDirectories($path='', $str = ''){\n\n\n\tforeach (glob(\"*\") as $dirname ) {\n\tif( is_dir( $dirname ) )\n\techo \"<a target=\\\"_blank\\\" href=\\\"$dirname \\\">$dirname</a><br />\";}\n\t}", "function getPaths($path){\n\tchdir(getRootPath());\n\t$path = getPath($path);\n\t$aPath = getAbsolutePath($path);\n\t$root = getRootPath();\n\t$rPath = getRelativePath($aPath);\n\t$realpath = realpath($aPath);\n\t$realpath = ValidatePath($realpath);\n\t$pathParts = pathinfo($aPath);\n\t$dir = $pathParts['dirname'];\n\t$dir = ValidatePath($dir);\n $basename = $pathParts['basename'];\n $extension = \"\";\n if(isset($pathParts['extension']))\n $extension = $pathParts['extension'];\n $filename = $pathParts['filename'];\n $arr = array(\n \"path\" => $path,\n \"aPath\" => $aPath,\n \"root\" => $root,\n \"rPath\" => $rPath,\n \"realpath\" => $realpath,\n \"dir\" => $dir,\n \"basename\" => $basename,\n \"extention\" => $extension,\n \"filename\" => $filename, \n );\n //return json_encode($arr);\n\treturn $path.\",\".$aPath.\",\".$root.\",\".$rPath.\",\".$realpath.\",\".$dir.\",\".$basename.\",\".$extension.\",\".$filename;\n}", "public function listDirectory($directory = '.', $ref = 'HEAD');", "function return_simpledir_results($params = array()) {\n // Default parameters\n $params = array_merge(array(\n 'dirpath' => null,\n 'urlpath' => null,\n 'ignore' => array(),\n 'order' => '+name',\n ), $params);\n\n $dirpath = $params['dirpath'];\n $urlpath = $params['urlpath'];\n $ignore = $params['ignore'];\n\n // Copy the global $simpledir_conf\n $simpledir_conf = array_merge(array(), simpledir_loadconf());\n\n // Merge defaults\n if (!empty($dirpath)) {\n $simpledir_conf['dirpath'] .= $dirpath;\n }\n\n if (!empty($urlpath)) {\n $simpledir_conf['urlpath'] .= $urlpath;\n }\n\n $simpledir_conf['ignore'] = $ignore;\n\n $simpledir_dir = $simpledir_conf['dirpath'];\n\n // check for directory traversal attempt and scrub to base directory\n if (strpos(realpath($simpledir_dir),$simpledir_conf['dirpath']) !== 0) {\n $simpledir_dir = $simpledir_conf['dirpath'];\n }\n\n //rebuild clean param for links\n $currentdir = substr(realpath($simpledir_dir),strlen($simpledir_conf['dirpath']));\n if ($currentdir<>'') {\n $currentdir = $currentdir . '/';\n }\n\n // display list of files\n $dir_handle = @opendir($simpledir_dir) or exit('Unable to open the folder ' . $simpledir_dir . ', check the folder privileges.');\n $filearray = array();\n $subdirarray = array();\n\n // get files\n $filetot = 0;\n\n while ($filename = readdir($dir_handle)) {\n // ignore dot files.\n if (substr($filename,0,1) <> '.') {\n // if directory\n if (is_dir($simpledir_dir.$filename)) {\n $subdirarray[] = array(\n 'name' => $filename,\n 'date' => date(\"Y/m/d H:i:s\", filemtime($simpledir_dir.$filename)),\n 'size' => null,\n 'type' => 'directory'\n );\n } elseif (!in_array(strtolower(substr(strrchr($filename,'.'),1)), $simpledir_conf['ignore'])) {\n $filesize = filesize($simpledir_dir.$filename);\n $filearray[] = array(\n 'name' => $filename,\n 'date' => date(\"Y/m/d H:i:s\", filemtime($simpledir_dir.$filename)),\n 'size' => $filesize,\n 'type' => strtolower(substr(strrchr($filename,'.'),1))\n );\n $filetot += $filesize;\n }\n }\n }\n\n // Sort the files\n $order = $params['order'];\n $asc = substr($order, 0, 1);\n\n if ($asc == '+' || $asc == '-') {\n $order = substr($order, 1);\n } else {\n $asc = '+';\n }\n\n // Build a callback function to pass to usort\n if ($order == 'size') {\n $callback = 'return $a[\"size\"] - $b[\"size\"];';\n } elseif ($order == 'date') {\n $callback = 'return strtotime($a[\"date\"]) - strtotime($b[\"date\"]);';\n } else {\n $callback = 'return strcmp($a[\"name\"], $b[\"name\"]);';\n }\n\n $sortcallback = create_function(($asc == '+' ? '$a, $b' : '$b, $a'), $callback);\n usort($filearray, $sortcallback);\n usort($subdirarray, $sortcallback);\n\n return array(\n 'files' => $filearray,\n 'subdirs' => $subdirarray,\n 'total' => $filetot,\n );\n}", "public function getPath(): array\n {\n return $this->list;\n }", "public function getContainerList($path) {\n\t\t$res = false;\n\n\t\tif ($this->cached) {\n\t\t\t$key = 'webdav-' . $this->get('id') . '-cl-' . str_replace('/', '_', $path);\n\t\t\t$res = $this->xpdo->cacheManager->get($key);\n\t\t}\n\n\t\ttry {\n\t\t\tif ($res == false) {\n\t\t\t// Perform request\n\t\t\t$res = $this->client->dir($path);\n\t\t\tif ($res == false) throw new Exception('Bad data ' . $path);\n\n\t\t\tif ($this->cached)\n\t\t\t\t$this->xpdo->cacheManager->set($key, $res, $this->cacheTime);\n\t\t\t}\n\n\t\t\t$dirs = $res[0];\n\t\t\t$files = $res[1];\n\t\t} catch (Exception $e) {\n\t\t\t$this->xpdo->log(xPDO::LOG_LEVEL_ERROR, \"[DAV] Error opening dir $path: \" . $e->getMessage());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Initialize config\n\t\t$properties = $this->getPropertyList();\n\n\t\t// Get cls\n\t\t$canSave = $this->checkPolicy('save');\n\t\t$canRemove = $this->checkPolicy('remove');\n\t\t$canCreate = $this->checkPolicy('create');\n\n\t\t$cls = array('folder');\n\t\tif ($this->hasPermission('directory_chmod') && $canSave) $cls[] = 'pchmod';\n\t\tif ($this->hasPermission('directory_create') && $canCreate) $cls[] = 'pcreate';\n\t\tif ($this->hasPermission('directory_remove') && $canRemove) $cls[] = 'premove';\n\t\tif ($this->hasPermission('directory_update') && $canSave) $cls[] = 'pupdate';\n\t\tif ($this->hasPermission('file_upload') && $canCreate) $cls[] = 'pupload';\n\t\tif ($this->hasPermission('file_create') && $canCreate) $cls[] = 'pcreate';\n\t\t$folder_cls = implode(' ', $cls);\n\n\t\t$cls = array();\n\t\tif ($this->hasPermission('file_remove') && $canRemove) $cls[] = 'premove';\n\t\tif ($this->hasPermission('file_update') && $canSave) $cls[] = 'pupdate';\n\t\t$file_cls = implode(' ', $cls);\n\n\t\t// Get options\n\t\t$imagesExts = $this->getOption('imageExtensions', $properties, 'jpg,jpeg,png,gif');\n\t\t$imagesExts = explode(',', $imagesExts);\n\n\t\t$skipFiles = $this->getOption('skipFiles', $properties, '.svn,.git,_notes,.DS_Store,nbproject,.idea');\n\t\t$skipFiles = explode(',', $skipFiles);\n\n\t\tif ($this->xpdo->getParser()) {\n\t\t\t$this->xpdo->parser->processElementTags('', $skipFiles, true, true);\n\t\t}\n\t\t$allowedExtensions = $this->getOption('allowedFileTypes', $properties);\n\n\t\tif (is_string($allowedExtensions)) {\n\t\t\tif (empty($allowedExtensions)) {\n\t\t\t\t$allowedExtensions = array();\n\t\t\t} else {\n\t\t\t\t$allowedExtensions = explode(',', $allowedExtensions);\n\t\t\t}\n\t\t}\n\n\t\t$relpath = ltrim($path, '/');\n\n\t\t// Get menu items\n\t\t$menu1 = $this->getListContextMenu(true);\n\t\t$menu2 = $this->getListContextMenu(false);\n\n\t\t$editAction = $this->getEditActionId();\n\n\t\t$dirlist = array();\n\t\t$dirnames = array();\n\t\t$filelist = array();\n\t\t$filenames = array();\n\n\t\tforeach ($dirs as $dir => $opts) {\n\t\t\tif (in_array($dir, $skipFiles)) continue;\n\t\t\t$dirnames[] = strtoupper($dir);\n\n\t\t\t$dirlist[] = array(\n\t\t\t\t'id' => $relpath . $dir . '/',\n\t\t\t\t'text' => $dir,\n\t\t\t\t'cls' => $folder_cls,\n\t\t\t\t'type' => 'dir',\n\t\t\t\t'iconCls' => 'icon icon-folder',\n\t\t\t\t'leaf' => false,\n\t\t\t\t'path' => $relpath . $dir,\n\t\t\t\t'pathRelative' => $relpath . $dir,\n\t\t\t\t'menu' => array('items' => $menu2)\n\t\t\t);\n\t\t}\n\n\t\tforeach ($files as $file => $opts) {\n\t\t\tif (in_array($file, $skipFiles)) continue;\n\n\t\t\t$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\t\t\tif (!empty($allowedExtensions) && !in_array($ext, $allowedExtensions)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$page = null;\n\t\t\tif (explode('/', $opts['getcontenttype'])[0] == 'text') {\n\t\t\t\t$page = '?a=' . $editAction . '&file=' . $path . $file . '&wctx=' . $this->ctx->get('key') . '&source=' . $this->get('id');\n\t\t\t}\n\n\t\t\t$filenames[] = strtoupper($file);\n\n\t\t\t$fileItem = array(\n\t\t\t\t'id' => $relpath . $file,\n\t\t\t\t'text' => $file,\n\t\t\t\t'directory' => $this->basePath,\n\t\t\t\t'cls' => $file_cls,\n\t\t\t\t'iconCls' => 'icon icon-file icon-' . $ext,\n\t\t\t\t'type' => 'file',\n\t\t\t\t'leaf' => true,\n\t\t\t\t'perms' => '',\n\t\t\t\t'page' => $page,\n\t\t\t\t'pathRelative' => $relpath . $file,\n\t\t\t\t'url' => $path . $file,\n\t\t\t\t'urlAbsolute' => $path . $file,\n\t\t\t\t'menu' => array('items' => ($page)? array_merge($menu1[1], $menu1[0]) : $menu1[0])\n\t\t\t\t);\n\n\t\t\tif (!empty($this->baseUrl)) {\n\t\t\t\tif (in_array($ext, $imagesExts))\n\t\t\t\t\t$fileItem['qtip'] = '<img src=\"' . $this->baseUrl . $path . $file . '\" alt=\"' . $file . '\" />';\n\t\t\t}\n\n\t\t\t$filelist[] = $fileItem;\n\t\t}\n\n\t\t/* now sort files/directories */\n\t\tarray_multisort($dirnames, SORT_ASC, SORT_STRING, $dirlist);\n\t\tarray_multisort($filenames, SORT_ASC, SORT_STRING, $filelist);\n\n\t\treturn array_merge($dirlist, $filelist);\n\t}", "public function directoryListing($path) {\n\t\t$files = scandir(WWW_ROOT . $path);\n\t\t$html=\"\";\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$html .= '<tr><td>' . $file . '</td><td>' . $this->actionButtons($path . DIRECTORY_SEPARATOR . $file) .'</td></tr>';\n\t\t}\n\t\treturn '<table class=\"table table-striped\">' . $html . '</table>';\n }", "function process_dir($dir)\r\n\t\t{\r\n\t\t\tif (is_dir($dir))\r\n\t\t\t{\r\n\t\t\t\tfor ($list = array(),$handle = opendir($dir); (FALSE !== ($file = readdir($handle)));)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (\t(\t$file != '.' && $file != '..')\r\n\t\t\t\t\t\t\t&& (file_exists($path = $dir.'/'.$file))\r\n\t\t\t\t\t\t\t&& (strtolower(end(explode(\".\",$file))) == 'url')\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (is_dir($path))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$list = array_merge($list, EdlUtils::process_dir($path));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$entry = array('filename' => $file, 'dirpath' => $dir);\r\n\t\t\t\t\t\t\t$entry['modtime'] = filemtime($path);\r\n\t\t\t\t\t\t\t$list[] = $entry;\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\tclosedir($handle);\r\n\t\t\t\treturn $list;\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}", "function list_directories($directory, $exclude = array(), $full_path = TRUE, $is_writable = FALSE, $recursive = TRUE, $_first_time = TRUE)\n{\n\tstatic $orig_directory;\n\tstatic $dirs;\n\tif ($_first_time)\n\t{\n\t\t$orig_directory = rtrim($directory, '/');\n\t\t$dirs = NULL;\n\t}\n\n\tif ($handle = opendir($directory)) \n\t{\n\t\twhile (FALSE !== ($file = readdir($handle))) \n\t\t{\n\t\t\tif (strncmp($file, '.', 1) !== 0 AND \n\t\t\t\t((is_array($exclude) AND !in_array($file, $exclude)) OR (is_string($exclude) AND !empty($exclude) AND !preg_match($exclude, $file)))\n\t\t\t\t)\n\t\t\t{\n\t\t\t\t$file_path = $directory. \"/\" . $file;\n\n\t\t\t\tif (is_dir($file_path))\n\t\t\t\t{\n\t\t\t\t\tif ($is_writable AND !is_writable($file_path)) \n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!$full_path)\n\t\t\t\t\t{\n\t\t\t\t\t\t$dir_prefix = substr($directory, strlen($orig_directory));\n\t\t\t\t\t\t$dir = trim($dir_prefix.\"/\".$file, '/');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$dir_prefix = $directory;\n\t\t\t\t\t\t$dir = $dir_prefix.\"/\".$file;\n\t\t\t\t\t}\n\n\t\t\t\t\t$dir = str_replace(\"//\", \"/\", $dir); // replace double slash\n\n\n\t\t\t\t\tif (!isset($dirs))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dirs = array();\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($dir) AND !in_array($dir, $dirs)) \n\t\t\t\t\t{\n\t\t\t\t\t\t$dirs[] = $dir;\n\t\t\t\t\t}\n\t\t\t\t\tif ($recursive)\n\t\t\t\t\t{\n\t\t\t\t\t\tlist_directories($file_path, $exclude, $full_path, $is_writable, TRUE, FALSE);\t\n\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}\n\t\tclosedir($handle);\n\t}\n\treturn $dirs;\n}", "public function getFullPathFileList()\n {\n $list = [];\n foreach ($this->getFileList() as $file) {\n $list[] = $this->getPublicPath() . $file;\n }\n\n return $list;\n }", "function getPathChildren($path);", "function system_get_directory_content($directory){\n\t$res = array();\n\tif ($handle = opendir($directory)) {\n\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\tif($entry != \".\" && $entry != \"..\"){\n\t\t\t\t$res[] = $entry;\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t}\n\treturn $res;\n}", "private function ls($siafiles, $path) {\n\t\t$ret = array();\n\t\t$paths = $this->parsePaths($siafiles, $path . \"/\");\n\n\t\tforeach($paths as $siafile) {\n\t\t\t$filename = $siafile;\n\t\t\t$pathComponents = explode('/', $siafile);\n\t\t\t$isDir = count($pathComponents) > 1;\n\n\t\t\tif ($isDir) {\n\t\t\t\t$filename = $pathComponents[0];\n\t\t\t}\n\n\t\t\t$ret[$filename] = $filename;\n\t\t}\n\t\n\t\treturn array_values($ret);\n\t}", "function getFileList($dir)\n {\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n // open directory for reading\n $d = new DirectoryIterator($dir) or die(\"getFileList: Failed opening directory $dir for reading\");\n foreach($d as $fileinfo) {\n // skip hidden files\n if($fileinfo->isDot()) continue;\n $retval[] = array(\n 'name' => \"{$dir}{$fileinfo}\",\n 'type' => ($fileinfo->getType() == \"dir\"),\n 'size' => $fileinfo->getSize(),\n 'lastmod' => $fileinfo->getMTime()\n );\n }\n\n return $retval;\n }", "function PicFolderList()\n{\n return array(\"orig\", \"w1920\", \"w1024\", \"w640\", \"w320\", \"w80\");\n}", "function list_files($dirname) {\r\n if (!is_dir($dirname))\r\n echo \"Directory $dirname does not exists.\";\r\n elseif (!is_readable($dirname))\r\n echo \"Directory $dirname is not readable.\";\r\n else {\r\n $file_array = array();\r\n $i = 0;\r\n foreach (glob(\"$dirname/*.*\") as $filename) {\r\n $fields_array[i] = basename($filename);\r\n $i++;\r\n }\r\n }\r\n return $fields_array;\r\n}", "function getDirectoryList(){\n\t$files = glob( CFBACKUPPATH.'*.zip' );\n\n// Sort files by modified time, latest to earliest\n// Use SORT_ASC in place of SORT_DESC for earliest to latest\n\tarray_multisort(\n\t\t\t\tarray_map( 'filemtime', $files ),\n\t\t\t\tSORT_NUMERIC,\n\t\t\t\tSORT_DESC,\n\t\t\t\t$files\n\t\t\t\t\t);\n\t$file_index['imgdb'] = array();\n\t$file_index['bandwidth'] = array();\n\tforeach( $files as $file){\n\t$file_name = basename($file);\n\t\t$file_type = explode(\"_\", $file_name);\n\t\t\tif($file_type[0]=='imgdb'){\n\t\t\t\t$file_index['imgdb'][] = $file_name;\n\t\t\t}elseif($file_type[0]=='bandwidth'){\n\t\t\t\t$file_index['bandwidth'][] =$file_name;\n\t\t\t}\n\t}\n\treturn $file_index;\n}", "function directory_list($directory_path, $search_recursive = true)\n{\n\tif (file_exists($directory_path)) {\n\t\tforeach (array_diff(scandir($directory_path), ['.', '..']) as $directory) {\n\t\t\tif (is_dir($directory_path . '/' . $directory)) {\n\t\t\t\t$directory_list[] = pathinfo($directory, PATHINFO_FILENAME);\n\t\t\t\tif ($search_recursive) {\n\t\t\t\t\t$reucrsive_list = directory_list(($directory_path . '/' . $directory), $search_recursive);\n\t\t\t\t\tif (!empty($reucrsive_list)) {\n\t\t\t\t\t\tforeach ($reucrsive_list as $dir) {\n\t\t\t\t\t\t\t$directory_list[] = $directory . '/' . $dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $directory_list ?? null;\n}", "public function path() : array;", "function d_filelist_simple($dh)\n{\n\t$files = '';\n\twhile (false !== ($f = readdir($dh))) {\n if ($f === \".\" || $f === \"..\") continue;\n $files .= \"$f/\";\n }\n\treturn array('res' => $files, 'cnt' => substr_count($files, '/'));\n}", "function referentiel_list_directories ($rootdir) {\r\n\r\n $results = null;\r\n\r\n if ($dir = opendir($rootdir)){\r\n while (false !== ($file=readdir($dir))) {\r\n if ($file==\".\" || $file==\"..\") {\r\n continue;\r\n }\r\n if (is_dir($rootdir.\"/\".$file)) {\r\n $results[$file] = $file;\r\n }\r\n }\r\n closedir($dir);\r\n }\r\n return $results;\r\n }", "static function getDirectoryFiles($path, $supplyFullPath = true, callable $callBack = null){\n $all = [];\n foreach ( scandir( $path ) as $file ) {\n $pathName = $supplyFullPath? $path.DIRECTORY_SEPARATOR.$file: $file;\n if($callBack) {\n $allRaw = $callBack($pathName);\n if($allRaw) $all[] = $allRaw;\n }\n else $all[] = $pathName;\n }\n return $all;\n }", "function doList() {\n\tglobal $dirs;\n\t$exts = array(\"gif\", \"jpg\", \"jpeg\", \"png\");\n\t\n\t// initialize context\n\t$nodes = 0;\n\t$current = (count($dirs) + 1);\n\t\n\t// emit the HTML\n\techo \"<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" width=\\\"100%\\\">\\n\";\n\tdirTag(TEXT_ROOT, \"\", $nodes++, ICON_OPENED);\n\t\n\t// for ALL Directories in the Path ...\n\tforeach($dirs as $dir) {\n\t\t\n\t\t// ... if Directory is exists ...\n\t\tif(strlen($dir) > 0)\n\t\t\n\t\t// ... emit the HTML\n\t\tdirTag($dir, \"\", $nodes++, ICON_OPENED, ($nodes != $current));\n\t}\n\t\n\t// list Directories and emit the HTML\n\t$list = listDirs();\n\t@array_walk($list, dirTag, $nodes);\n\t\n\t// if BITMAP support is desired ...\n\tif(SUPPORT_BITMAP)\n\t\n\t// ... include BMP extensions\n\t$exts[] = \"bmp\";\n\t\n\t// if METAFILE support is desired ...\n\tif(SUPPORT_METAFILE)\n\t\n\t// ... include WMF extensions\n\t$exts[] = \"wmf\";\n\t\n\t// list Image files and emit the HTML\n\t$list = listFiles($exts);\n\t@array_walk($list, fileTag, $nodes);\n\t\n\t// emit the HTML\n\techo \"</table>\\n\";\n}", "public function dir_readdir();", "function getDirectoryList($directory) {\n\n // create an array to hold directory list\n $results = array();\n\n // create a handler for the directory\n $handler = opendir($directory);\n\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n $results[] = $file;\n }\n }\n\n // tidy up: close the handler\n closedir($handler);\n\n // done!\n return $results;\n}", "function scandir($directory)\n{\n return array();\n}", "function scan_dir($path)\n\t{\n\t\tglobal $data_store;\n\t\t$dir = scandir($path);\n\t\t$tree = array(\n\t\t\t\t'name' => utf8_encode(array_slice(explode('\\\\', $path), -1)[0]),\n\t\t\t\t'path' => utf8_encode($path),\n\t\t\t\t'type' => 'directory',\n\t\t\t\t'contents' => array()\n\t\t\t);\n\t\t\n\n\t\t// temporary containers for each content type\n\t\t$dirs = [];\n\t\t$files = [];\n\n\n\t\tforeach ($dir as $key => $d) {\n\n\t\t\t// exclude \".\" and \"..\"\n\t\t\tif ( $d != \".\" && $d != \"..\" )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// add to the data store\n\t\t\t\t$data_store[] = array(\n\t\t\t\t\t'name' => utf8_encode($d),\n\t\t\t\t\t'path' => utf8_encode($path.'\\\\'.$d)\n\t\t\t\t);\n\n\t\t\t\t// if directory, perform recursive function\n\t\t\t\tif ( is_dir($path.'\\\\'.$d) )\n\t\t\t\t{\n\t\t\t\t\t$dirs[] = scan_dir($path.'\\\\'.$d);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t'name' => utf8_encode($d),\n\t\t\t\t\t\t'path' => utf8_encode($path.'\\\\'.$d),\n\t\t\t\t\t\t'type' => 'file'\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t}\t\n\n\t\t\t\t// sort according to type\n\t\t\t\t$tree['contents'] = array_merge($dirs,$files);\n\t\t\t}\t\t\t\t\n\t\t}\n\n\t\treturn $tree;\n\t}", "function getList($path = \"\", $remove_extension = false){\n $files = @scandir($path);\n if(!$files) return null;\n $file_list = array();\n for($i = 0; $i < count($files); $i++){\n if($files[$i] != \".\" && $files[$i] != \"..\"){\n if($remove_extension){\n $files[$i] = explode(\".\", $files[$i]);\n $files[$i] = $files[$i][0];\n }\n array_push($file_list, $files[$i]);\n }\n }\n return $file_list;\n }", "function dir_list($dir) {\t\t\t// make list of directories\n\t// this list is used to copy/move items to a specific location\n\t$dir_list = array();\n\t$handle = @opendir(get_abs_dir($dir));\n\tif($handle===false) return;\t\t// unable to open dir\n\t\n\twhile(($new_item=readdir($handle))!==false) {\n\t\t//if(!@file_exists(get_abs_item($dir, $new_item))) continue;\n\t\t\n\t\tif(!get_show_item($dir, $new_item)) continue;\n\t\tif(!get_is_dir($dir,$new_item)) continue;\n\t\t$dir_list[$new_item] = $new_item;\n\t}\n\t\n\t// sort\n\tif(is_array($dir_list)) ksort($dir_list);\n\treturn $dir_list;\n}", "function getDirList($dir, $self = false)\n {\n if ($self) {\n $fileList = array('.');\n }\n else {\n $fileList = array();\n }\n\n if (!$this->loader->isInOpenBaseDir($dir)) {\n return $fileList;\n }\n\n if (PHP_OS != 'Linux' || ((is_link($dir) || is_dir($dir)) && is_readable($dir))) {\n if (($dh = @opendir($dir)) !== false) {\n while (($file = readdir($dh)) !== false) {\n if ($file === '.' || $file === '..') {\n continue;\n }\n\n if (!@is_link($dir . '/' . $file) && @is_dir($dir . '/' . $file)) {\n $fileList[] = $file;\n }\n }\n closedir($dh);\n }\n }\n\n return $fileList;\n }", "function __list($path, $suffix = false, $extension = false) {\n\t\tif (!class_exists('Folder')) {\n\t\t\trequire LIBS . 'folder.php';\n\t\t}\n\t\t$items = array();\n\t\t$Folder = new Folder($path);\n\t\t$contents = $Folder->read(false, true);\n\n\t\tif (is_array($contents)) {\n\t\t\tif (!$suffix) {\n\t\t\t\treturn $contents[0];\n\t\t\t} else {\n\t\t\t\tforeach ($contents[1] as $item) {\n\t\t\t\t\tif (substr($item, - strlen($suffix)) === $suffix) {\n\t\t\t\t\t\tif ($extension) {\n\t\t\t\t\t\t\t$items[] = $item;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$items[] = substr($item, 0, strlen($item) - strlen($suffix));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public static function listDir($path, $pathPrefix = '')\r\n\t{\r\n\t\t$fileList = array();\r\n\t\t$path = str_ireplace(DIRECTORY_SEPARATOR, '/', $path);\r\n\t\t$handle = opendir($path);\r\n\t\tif ($handle)\r\n\t\t{\r\n\t\t while (false !== ($file = readdir($handle)))\r\n\t\t {\r\n\t\t \tif ($file != '.' && $file != '..')\r\n\t\t \t{\r\n\t\t \t\t$fullPath = $path.'/'.$file;\r\n\t\t \t\t$tmpPrefix = $pathPrefix.$file;\r\n\t\t \t\t\r\n\t\t\t \tif (is_dir($fullPath))\r\n\t\t\t \t{\r\n\t\t\t \t\t$tmpPrefix = $tmpPrefix.'/';\r\n\t\t\t \t\t$fileList[] = array($tmpPrefix, 'dir', self::fileSize($fullPath));\r\n\t\t\t \t\t$fileList = array_merge($fileList, self::listDir($fullPath, $tmpPrefix));\r\n\t\t\t \t}\t\r\n\t\t\t \telse\r\n\t\t\t \t{\r\n\t\t\t \t\t$fileList[] = array($tmpPrefix, 'file', self::fileSize($fullPath));\r\n\t\t\t \t}\t \t\r\n\t\t \t}\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t}\r\n\t\treturn $fileList;\r\n\t}", "function _list_files() {\n return array();\n }", "abstract public function list( string$dir ):PictureList;", "static function getFiles($path) {\n return self::getItems($path, '*.*', 'getFileURL');\n }", "public function getDirectoryContent($path, $prefix)\n {\n $d = Storage::directories($path);\n $f = Storage::files($path);\n\n $files = [];\n foreach ($f as $key => $file) {\n $exp = explode('/', $file);\n $name = $exp[count($exp) - 1];\n\n $info = new \\SplFileInfo($name);\n if (!in_array($info->getExtension(), $this->availableExtension)) {\n continue;\n }\n\n if (isset($exp[0])) {\n unset($exp[0]);\n }\n\n $link = $prefix.'/'.implode('/', $exp);\n $files[] = [\n 'name' => explode('.', $name)[0],\n 'link' => $link,\n ];\n }\n\n $directories = [];\n foreach ($d as $key => $directory) {\n $exp = explode('/', $directory);\n $name = $exp[count($exp) - 1];\n\n if (isset($exp[0])) {\n unset($exp[0]);\n }\n\n $link = $prefix.'/'.implode('/', $exp);\n $directories[] = [\n 'name' => $name,\n 'link' => $link\n ];\n }\n\n return [\n 'files' => $files,\n 'directories' => $directories,\n ];\n }" ]
[ "0.7454453", "0.71520936", "0.68965554", "0.6893472", "0.6862096", "0.680388", "0.67844456", "0.6727586", "0.66933334", "0.6634372", "0.6619303", "0.65977913", "0.6595009", "0.6575524", "0.657358", "0.65730953", "0.65632707", "0.65383995", "0.65383995", "0.6537526", "0.652872", "0.652872", "0.6527611", "0.64981097", "0.6497924", "0.64878976", "0.6473683", "0.6473606", "0.64611703", "0.6418721", "0.64153093", "0.63854545", "0.63713706", "0.6363185", "0.636293", "0.63496304", "0.63380694", "0.6335532", "0.6330628", "0.6317965", "0.63054323", "0.6298407", "0.6295946", "0.6295866", "0.62916744", "0.6283913", "0.6269489", "0.62550324", "0.62467694", "0.62377834", "0.6236355", "0.62227666", "0.62149405", "0.6212165", "0.620617", "0.620327", "0.6200589", "0.61913955", "0.61880845", "0.6185418", "0.617567", "0.61753166", "0.6166925", "0.6165347", "0.61643165", "0.6148798", "0.6147373", "0.614332", "0.61407125", "0.61404556", "0.6130192", "0.6126564", "0.61252946", "0.6115345", "0.61146015", "0.61035335", "0.6096121", "0.60950595", "0.60820067", "0.6075243", "0.60588884", "0.6052775", "0.60385275", "0.6030086", "0.60221916", "0.6016081", "0.60160804", "0.60155874", "0.6007348", "0.59901917", "0.59840184", "0.59818006", "0.5978865", "0.59763587", "0.59680647", "0.5967373", "0.596634", "0.5965991", "0.5960624", "0.5959395" ]
0.7690214
0
function path_data function debug(string $type[, string $message]) sets an entry in global DEBUG_MESSAGES
Функция path_data функция debug(string $type[, string $message]) устанавливает запись в глобальный DEBUG_MESSAGES
function debug($type, $message = '') { global $DEBUG_MESSAGES; if ($message == '') { $message = $type; $type = 'debug'; } // if if (is_array($message) || is_object($message)) { ob_start(); var_dump($message); $message = ob_get_contents(); ob_end_clean(); } // if $DEBUG_MESSAGES[] = "[$type]: $message"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function debugMessage($message, string $type) : void;", "function debug($message) { Common::debug($message); }", "public function debug($message, $type = null) {\n\t\t$this->_notify(AppLogger::LEVEL_DEBUG, $message, $type);\n\t}", "static function debug() {\n }", "function debug( $msg ) {\n\t}", "public function debug()\n\t{\n\n\t\t$numargs = func_num_args();\n\t\t$arg_list = func_get_args();\n\n\t\tif($this->logLevel >= Logger::$LOG_DEBUG)\n\t\t{\n\t\t\n\t\t\t$msg = \"[DEBUG]\";\n\t\t\tfor ($i = 0; $i < $numargs; $i++)\n\t\t\t{\n\t\t\t\t$msg .= \" \".$this->toString($arg_list[$i]) ;\n\t\t\t}\n\t\t\t$this->save($msg);\n\t\t}\t\t \n\t}", "public static function d()\n {\n for ($message = \"\", $l = func_get_args(), $i = 1; $i < func_num_args(); $i++) {\n $message .= self::var_debug($l[$i]) . \"\\n\";\n };\n self::write($l[0], $message.'<br/>'.self::getBacktrace(), Logger::DEBUG);\n }", "protected function debug($msg) {\r\n }", "public function debug();", "function debug($message,$file='debug.log') {\n summon('logger')->log($message,$file);\n}", "public function debugf();", "function _debug($data)\n {\n $string = date('m-d-y h:i:s') . ' - (' . $this->_debugID . ') - [' . $this->_dnsService . '] - ' . $data . \"\\n\";\n $file = fopen($this->_debugFile, 'a');\n fwrite($file, $string);\n fclose($file);\n }", "function d($msg){\n $this->debug[] = array('object'=>'Application', 'message'=>$msg);\n }", "function debug($message, $type = '')\n {\n if (env('APP_DEBUG', false)) {\n if (empty($type)) {\n echo $message . \"\\n\";\n }\n else {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n switch ($type) {\n case 'info':\n $output->writeln(\"<info>$message</info>\");\n break;\n case 'comment':\n $output->writeln(\"<comment>$message</comment>\");\n break;\n case 'error':\n $output->writeln(\"<error>$message</error>\");\n break;\n case 'warning':\n $style = new \\Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle('yellow');\n $output->getFormatter()->setStyle('warning', $style);\n $output->writeln(\"<warning>$message</warning>\");\n break;\n default:\n break;\n }\n }\n }\n else {\n //\\Illuminate\\Support\\Facades\\Log::info($message);\n }\n }", "function debug($data)\n {\n if ( $this->_debugOn ) {\n print $data;\n }\n }", "public function stdWrap_debugData() {}", "public function Debug(){\n \n if(\\core\\config\\general::__DEBUG__)\n {\n $metodo = debug_backtrace();\n \n error_log(\"[Metodo: \".$metodo[1]['function'].\"] Mensaje: \".$this->getMensaje().\"<BR/>\");\n }\n }", "function _debug() {\n fwrite(STDERR, \"\\nSTART DEBUG\\n\");\n fwrite(STDERR, \"###########\\n\");\n $args = func_get_args();\n foreach ($args as $arg) {\n fwrite(STDERR, trim(var_export($arg, true)).\"\\n\");\n }\n fwrite(STDERR, \"###########\\n\");\n fwrite(STDERR, \"END DEBUG\\n\\n\");\n}", "public function debug($message, $context = array());", "function uga_debug($message) {\r\n global $uga_debug;\r\n $uga_debug .= \"$message\\n\";\r\n }", "function debug($debug, $label = '') {\n if (function_exists('watchdog')) {\n watchdog('civicrm', '!label: <pre>!debug</pre>', array('!label' => $label, '!debug' => htmlspecialchars(print_r($debug,1))), WATCHDOG_DEBUG);\n }\n if (function_exists('dpm')) {\n dpm($debug, $label);\n }\n }", "protected function debug_plugin( $data ){\n if( $data['debug'] )\n $this->template->write_view( 'debug', 'blog/plugin/debug', $data );\n }", "function debug($message,$debug_local = 0) {\n\t\t\t$debug = 0;\n\t\t\tif($debug_local) $debug = 1;\n\t\t\telse if($this->c['debug']) $debug = 1;\n\t\t\telse if($this->gateway) {\n\t\t\t\tif($this->gateway->c['debug']) $debug = 1;\t\n\t\t\t}\n\t\t\t\n\t\t\tif($debug) print $message.\"<br />\";\n\t\t}", "function debug_message($message) \n\t{\n\t\tglobal $CONFIG;\n\t\t\n\t\tif ($CONFIG->debug)\n\t\t\treturn messages_set($message, 'debug');\n\t\t\t\n\t\treturn false;\n\t}", "public function __debugInfo(){}", "function plog_debug() {\n $msg = _plog_msg(func_get_args());\n\t$firephp->fb($msg,FirePHP::LOG);\n\tLoggerFactory::getDefault()->logDebug( $msg );\n}", "function LOG_DEBUG( $message ) {\n $filename = LOGS_PATH . date(\"Y-m-d\") . \"_debug\";\n $msg_body = date(\"H:i:s\") . \": \" . $message . \"\\n\";\n $f = fopen($filename, \"a\") or die();\n fwrite($f, $msg_body);\n fclose($f);\n}", "public function set_path_log_debug ($path) {\n\n $this->debug_file_path = $path;\n }", "function Debug($message) {\n global $config;\n if($config->{'general'}->{'debug'}) {\n BCLog($message);\n }\n}", "public \r\n function debug() \r\n {\r\n $numArgs = func_num_args();\r\n $args = func_get_args();\r\n $printArgs = array();\r\n $level = array_pop($args);\r\n\t \r\n if ($level <= $this->level) \r\n {\r\n\r\n if ($numArgs > 2) \r\n {\r\n $format = array_shift($args);\r\n $format = preg_replace('/\\%s/', '<span class=\"debugstring\">%s</span>', $format);\r\n \r\n foreach($args as $arg) \r\n {\r\n if (is_object($arg) || is_array($arg) || is_resource($arg)) \r\n {\r\n ob_start();\r\n if ($this->output != \"plain\") \r\n {\r\n var_export($arg);\r\n $string = ob_get_contents();\r\n ob_end_clean();\r\n $string2 = highlight_string('<?' . $string . '?>', TRUE);\r\n $string = \"<b>[</b> <pre class=\\\"debugPre\\\">\" . str_replace(\"&nbsp;\", \" \", $string2) . \"</pre> <b>]</b>\";\r\n }\r\n else\r\n {\r\n var_export($arg);\r\n $string = ob_get_contents();\r\n ob_end_clean();\r\n }\r\n $printArgs[] = $string;\r\n }\r\n else\r\n {\r\n $printArgs[] = $arg;\r\n }\r\n }\r\n $output = vsprintf($format, $printArgs);\r\n }\r\n else\r\n {\r\n $output = $args[0];\r\n }\r\n $bt = debug_backtrace();\r\n if (strstr($bt[0]['file'], 'debug.inc')) \r\n {\r\n $btLine = 1;\r\n }\r\n else\r\n {\r\n $btLine = 0;\r\n }\r\n if (function_exists('memory_get_usage')) \r\n {\r\n $mem = memory_get_usage(TRUE);\r\n }\r\n else\r\n {\r\n $mem = '???';\r\n }\r\n\r\n\t \tif ($this->output == 'firebug') {\r\n $fileA = preg_split('#[/\\\\\\]#', $bt[$btLine]['file']);\r\n $file = $fileA[count($fileA) - 1];\r\n\t foreach ($args as $arg) {\r\n\t $this->firephp->fb($arg ,$level.\" F:\".$file.\" L:\".$bt[$btLine]['line'], FirePHP::LOG);\r\n\t }\r\n\t \r\n\t \r\n\t} else {\r\n\r\n $this->_debugData[] = array(\r\n 'time' => $this->_getmicrotime() ,\r\n 'string' => $output,\r\n 'level' => $level,\r\n 'mem' => $mem,\r\n 'type' => 'log',\r\n 'line' => $bt[$btLine]['line'],\r\n 'file' => $bt[$btLine]['file']\r\n );\r\n }\r\n $bt = array();\r\n }\r\n \r\n }", "function d($data = '')\n {\n if (Pi::service()->hasService('log')) {\n $output = Debug::render($data, 1);\n Pi::service('log')->debug($output);\n } else {\n echo Debug::render($data, 1);\n }\n }", "function debugMP($type,$hdr,$msg='') {\n\t\t\tif (($type === 'msg') && ($msg!=='')) {\n\t\t\t\t$msg = esc_html($msg);\n\t\t\t}\n\t\t\tif (($hdr!=='')) {\n\t\t\t\t$hdr = 'Admin: ' . $hdr;\n\t\t\t}\n\t\t\t$this->addon->debugMP($type,$hdr,$msg,NULL,NULL,true);\n\t\t}", "function debug($message) {\r\n\t\t\r\n\t\tif ($this->debug == true) {\r\n\t\t\techo \"<b>DEBUG:</b> $message\";\r\n\t\t}\r\n\t\t\r\n\t}", "function debug($data = null) {\r\n\techo '<pre class=\"debug\">';\r\n\tprint_r($data);\r\n\techo '</pre>';\r\n}", "public function __debugInfo() {\n }", "public function debug() {\n $args= func_get_args();\n $this->callAppenders(LogLevel::DEBUG, $args);\n }", "public function debug($message) {\n\t\t$this->logMessage('debug', $message);\n\t}", "function debug_msg($msg) {\n global $debug;\n \n if ($debug) {\n error_log($msg, 0);\n }\n}", "public static function debug()\n {\n if (self::isLoggableLevel('debug')) {\n $messages = func_get_args();\n foreach ($messages as $message) {\n self::writeLog('debug', $message);\n }\n }\n }", "function d($var, $quit = 0){\n\t$d = '';\n\tob_start();\n\t$info = debug_backtrace();\n\n\techo'<pre>';\n\techo $info[0]['file'];\n\techo ' :: '.$info[0]['line'].'<br>';\n/*\tif(is_array($var)){\n\t\tprint_r($var);\n\t}else{*/\n\t\tvar_dump($var);\n\t//}\n\techo'</pre>';\n\n\t$d .= ob_get_clean();\n\n\tif($f = fopen(LOG_PATH.'debug.log','a+')){\n\t\tfwrite($f,$d);\n\t\tfclose($f);\n\t}\n\n\tif($quit){\n\t\texit();\n\t}\n}", "public function debugf() {\n $args= func_get_args();\n $this->callAppenders(LogLevel::DEBUG, array(vsprintf($args[0], array_slice($args, 1))));\n }", "function Debug($config,$parms) {\r\n if(isset($config['general']['debug']) && $config['general']['debug']) {\r\n writeLog($config,$parms);\r\n }\r\n}", "function debug_msg($text) {\r\n\techo \"$text\\n\";\r\n}", "public function report_debug($msg){return $this->_r($msg, 3);}", "public function report_debug($msg){return $this->_r($msg, 3);}", "public function report_debug($msg){return $this->_r($msg, 3);}", "function debug($message) {\n if(!is_string($message)) {\n $message = var_export($message,true);\n }\n\n // break up message by line and prefix each one\n error_log( implode(\"\\n\", array_map(function($line) {\n return \"debug $line\";\n }, explode(\"\\n\", $message))));\n}", "function DebugLog($info = '')\n{\n\treturn;\n}", "static public function debug() {\n $args = func_get_args();\n static $buff=[];\n if(@self::$app->debug) {\n // flush the internal buffer\n if(!empty($buff)) {\n foreach($buff as $m) {\n call_user_func_array(array(self::$app->debug, \"info\"),$m);\n }\n $buff = [];\n }\n call_user_func_array(array(self::$app->debug, \"info\"),$args);\n return;\n }\n $buff[] = $args;\n }", "function debug($msg, $args = array())\n{\n if (!is_debug()) return false;\n $args = func_get_args();\n array_shift($args);\n return Error_Reporter::add_debug($msg, $args);\n}", "public static function debug($title,$data=false,$format='log') {\n\t\t\tdo_action('tribe_debug',$title,$data,$format);\n\t\t}", "public static function debug($message = null){\n if(self::$logLevel !== self::LEVEL_DEBUG || self::$logLevel !== self::LEVEL_TRACE){\n return;\n }\n\t\tarray_push(self::$debug, $message);\n self::writeMessage($message, self::LEVEL_DEBUG);\n\t}", "function debug($message, $logtype = 0, $level = 1)\n {\n global $_DB_DATAOBJECT;\n\n if (empty($_DB_DATAOBJECT['CONFIG']['debug']) || \n (is_numeric($_DB_DATAOBJECT['CONFIG']['debug']) && $_DB_DATAOBJECT['CONFIG']['debug'] < $level)) {\n return;\n }\n // this is a bit flaky due to php's wonderfull class passing around crap..\n // but it's about as good as it gets..\n $class = (isset($this) && is_a($this,'DB_DataObject')) ? get_class($this) : 'DB_DataObject';\n \n if (!is_string($message)) {\n $message = print_r($message,true);\n }\n if (!is_numeric( $_DB_DATAOBJECT['CONFIG']['debug']) && is_callable( $_DB_DATAOBJECT['CONFIG']['debug'])) {\n return call_user_func($_DB_DATAOBJECT['CONFIG']['debug'], $class, $message, $logtype, $level);\n }\n \n if (!ini_get('html_errors')) {\n echo \"$class : $logtype : $message\\n\";\n flush();\n return;\n }\n if (!is_string($message)) {\n $message = print_r($message,true);\n }\n $colorize = ($logtype == 'ERROR') ? '<font color=\"red\">' : '<font>';\n echo \"<code>{$colorize}<B>$class: $logtype:</B> \". nl2br(htmlspecialchars($message)) . \"</font></code><BR>\\n\";\n }", "public function getDebugData();", "public static function debug()\n {\n self::$debug = true;\n }", "public function debug(\\Stringable|string $message, array $context = []): void\n {\n }", "static function str_dbg($str)\n\t{\n\t\techo \"str = $str <br>\";\n\t\tfor($i = 0; $i < strlen($str); $i++)\n\t\t{\n\t\t\techo \"at pos $i: \".$str{$i}.\" nr = \".ord($str{$i}).\" <br>\";\n\t\t}\n\t\techo \"---<br>\";\n\t}\n\n\t/** prints the given message to the user, if $GLOBALS[\"DEBUG\"] is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\t**/\n\tstatic function p($msg)\n\t{\n\t\tif (aw_global_get(\"DEBUG\") == 1)\n\t\t{\n\t\t\techo $msg.\"<br />\\n\";\n\t\t}\n\t}\n\n\t/** prints the given message to the user, if a cookie with the name debug1 is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\n\t\t@comment\n\t\t\tUseful for printing debug data, so that just you can see it. cookiemonster class can be used for setting cookies\n\t**/\n\tstatic function p1($msg)\n\t{\n\t\tif (!empty($_COOKIE[\"debug1\"]))\n\t\t{\n\t\t\tarr($msg);\n\t\t}\n\t}\n\n\t/** prints the given message to the user, if a cookie with the name debug2 is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\n\t\t@comment\n\t\t\tUseful for printing debug data, so that just you can see it. cookiemonster class can be used for setting cookies\n\t**/\n\tstatic function p2($msg)\n\t{\n\t\tif (!empty($_COOKIE[\"debug2\"]))\n\t\t{\n\t\t\techo $msg.\"<br />\\n\";\n\t\t}\n\t}\n\n\t/** prints the given message to the user, if a cookie with the name debug3 is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\n\t\t@comment\n\t\t\tUseful for printing debug data, so that just you can see it. cookiemonster class can be used for setting cookies\n\t**/\n\tstatic function p3($msg)\n\t{\n\t\tif (!empty($_COOKIE[\"debug3\"]))\n\t\t{\n\t\t\techo $msg.\"<br />\\n\";\n\t\t}\n\t}\n\n\t/** prints the given message to the user, if a cookie with the name debug4 is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\n\t\t@comment\n\t\t\tUseful for printing debug data, so that just you can see it. cookiemonster class can be used for setting cookies\n\t**/\n\tstatic function p4($msg)\n\t{\n\t\tif (!empty($_COOKIE[\"debug4\"]))\n\t\t{\n\t\t\techo $msg.\"<br />\\n\";\n\t\t}\n\t}\n\n\t/** prints the given message to the user, if a cookie with the name debug5 is set\n\t\t@attrib api=1 params=pos\n\n\t\t@param msg required type=string\n\t\t\tThe message to print\n\n\t\t@comment\n\t\t\tUseful for printing debug data, so that just you can see it. cookiemonster class can be used for setting cookies\n\t**/\n\tstatic function p5($msg)\n\t{\n\t\tif (!empty($_COOKIE[\"debug5\"]))\n\t\t{\n\t\t\tprint \"<pre>\";\n\t\t\tvar_dump($msg);\n\t\t\tprint \"</pre>\";\n\t\t}\n\t}\n\n\t/** formats a given backtrace to a human-readable format\n\t\t@attrib api=1 params=pos\n\n\t\t@param bt type=array\n\t\t\tThe backtrace data to process\n\n\t\t@param skip type=int default=-1\n\t\t\tNumber of levels to skip from the end\n\n\t\t@param show_long_args type=bool default=FALSE\n\t\t\tTruncate long argument values or not\n\n\t\t@param html type=bool default=TRUE\n\t\t\tHtml or plain text output\n\n\t\t@param last_call_first type=bool default=FALSE\n\t\t\tCalls order, if true, last call info shown first\n\n\t\t@returns\n\t\t\thtml/text with the backtrace formatted to usr-readable format\n\n\t\t@examples\n\t\t\techo process_backtrace(debug_backtrace());\n\t**/\n\tpublic static function process_backtrace($bt, $skip = -1, $show_long_args = false, $html = true, $last_call_first = false)\n\t{\n\t\t$msg = array();\n\t\tfor ($i = count($bt)-1; $i > $skip; $i--)\n\t\t{\n\t\t\t$msg_item = \"\";\n\t\t\tif (!empty($bt[$i+1][\"class\"]))\n\t\t\t{\n\t\t\t\t$fnm = \"method <b>\".$bt[$i+1][\"class\"].\"::\".$bt[$i+1][\"function\"].\"</b>\";\n\t\t\t}\n\t\t\telseif (!empty($bt[$i+1][\"function\"]))\n\t\t\t{\n\t\t\t\t$fnm = \"function <b>\".$bt[$i+1][\"function\"].\"</b>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fnm = \"file \".$bt[$i][\"file\"];\n\t\t\t}\n\n\t\t\t$line = isset($bt[$i][\"line\"]) ? $bt[$i][\"line\"] : \"(unknown)\";\n\t\t\t$msg_item .= $fnm.\" on line {$line} called <br>\\n\";\n\n\t\t\tif (!empty($bt[$i][\"class\"]))\n\t\t\t{\n\t\t\t\t$fnm2 = \"method <b>\".$bt[$i][\"class\"].\"::\".$bt[$i][\"function\"].\"</b>\";\n\t\t\t}\n\t\t\telseif (!empty($bt[$i][\"function\"]))\n\t\t\t{\n\t\t\t\t$fnm2 = \"function <b>\".$bt[$i][\"function\"].\"</b>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fnm2 = \"file \".$bt[$i][\"file\"];\n\t\t\t}\n\n\t\t\t$msg_item .= $fnm2.\" with arguments \";\n\n\t\t\t$awa = isset($bt[$i][\"args\"]) ? new aw_array($bt[$i][\"args\"]) : new aw_array();\n\t\t\t$str = array();\n\t\t\tforeach($awa->get() as $e)\n\t\t\t{\n\t\t\t\tif (is_object($e))\n\t\t\t\t{\n\t\t\t\t\tif ($show_long_args)\n\t\t\t\t\t{\n\t\t\t\t\t\t$e = print_r($e, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$e = \"Object \".get_class($e);\n\t\t\t\t\t}\n\n\t\t\t\t\t$str[] = $e;\n\t\t\t\t}\n\t\t\t\telseif(is_array($e))\n\t\t\t\t{\n\t\t\t\t\tif ($show_long_args)\n\t\t\t\t\t{\n\t\t\t\t\t\t$e = print_r($e, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$e = \"Array (\".count($e).\")\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$str[] = $e;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!$show_long_args and strlen($e) > 200)\n\t\t\t\t\t{\n\t\t\t\t\t\t$e = substr($e, 0, 100).\"...\".substr($e, -100);\n\t\t\t\t\t}\n\t\t\t\t\t$str[] = \"\".$e;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$file = isset($bt[$i][\"file\"]) ? $bt[$i][\"file\"] : \"(unknown)\";\n\t\t\t$str = $html ? htmlentities(implode(\",\", $str)) : implode(\",\", $str);\n\t\t\t$msg_item .= \"<font size=\\\"-1\\\">({$str}) file: {$file}</font>\";\n\t\t\t$msg_item .= \" <br><br>\\n\\n\";\n\t\t\t$msg[] = $msg_item;\n\t\t}\n\n\t\tif ($last_call_first)\n\t\t{\n\t\t\t$msg = array_reverse($msg);\n\t\t}\n\n\t\tif ($html)\n\t\t{\n\t\t\t$msg = implode(\"\", $msg);\n\t\t\t$msg = \"<br><br> Backtrace: \\n\\n<br><br>{$msg}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = implode(\"\", $msg);\n\t\t\t$msg = strip_tags($msg);\n\t\t\t$msg = \"Backtrace:\\n\\n{$msg}\";\n\t\t}\n\n\t\treturn $msg;\n\t}\n\n\t/** Prints/returns html formatted detailed debug backtrace to client\n\t\t@attrib api=1 params=pos\n\t\t@param return type=bool default=FALSE\n\t\t\techo or return\n\t\t@param html type=bool default=TRUE\n\t\t\thtml or plain text\n\t\t@returns void\n\t**/\n\tpublic static function bt($return = false, $html = true)\n\t{\n\t\t$bt = self::process_backtrace(debug_backtrace(), -1, true, $html, true);\n\t\tif ($return)\n\t\t{\n\t\t\treturn $bt;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $bt;\n\t\t}\n\t}\n\n\t/** Prints html formatted detailed debug backtrace to client and terminates whole request (php exit)\n\t\t@attrib api=1 params=pos\n\t\t@returns void\n\t**/\n\tpublic static function btx()\n\t{\n\t\texit (self::process_backtrace(debug_backtrace(), -1, true, true, true));\n\t}\n\n\t/** formats a one-line user-readable string from the current backtrace\n\t\t@attrib api=1\n\n\t\t@returns\n\t\t\tOne-line string with a human-readable backtrace\n\t\t@comment\n\t\t\tExcludes all include construct calls\n\t**/\n\tpublic static function sbt()\n\t{\n\t\t$msg = array();\n\t\tif (function_exists(\"debug_backtrace\"))\n\t\t{\n\t\t\t$include_constructs = array(\"include\", \"include_once\", \"require\", \"require_once\");\n\t\t\t$bt = debug_backtrace();\n\t\t\tfor ($i = count($bt); $i >= 0; $i--)\n\t\t\t{\n\t\t\t\tif (!empty($bt[$i]))\n\t\t\t\t{\n\t\t\t\t\t$fnm = \"\";\n\t\t\t\t\tif (isset($bt[$i+1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!empty($bt[$i+1][\"class\"]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fnm = $bt[$i+1][\"class\"].\"::\".$bt[$i+1][\"function\"];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (!empty($bt[$i+1][\"function\"]) and !in_array($bt[$i+1][\"function\"], $include_constructs))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fnm = $bt[$i+1][\"function\"];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($fnm)\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg[] = $fnm . (isset($bt[$i][\"line\"]) ? (\":\" . $bt[$i][\"line\"]) : \"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn implode(\" > \", $msg);\n\t}\n\n\t/** prints the results of a database query\n\t\t@attrib api=1 params=pos\n\n\t\t@param q type=string\n\t\t\tThe sql query to perform\n\t**/\n\tpublic static function q($q)\n\t{\n\t\t$first = true;\n\t\t$db = new db_connector();\n\t\t$db->init();\n\t\t$db->db_query($q);\n\t\twhile ($row = $db->db_next())\n\t\t{\n\t\t\techo \"********** Row nr \".++$cnt.\" *****************\\n\";\n\t\t\tforeach($row as $k => $v)\n\t\t\t{\n\t\t\t\techo \"$k: $v\\n\";\n\t\t\t}\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t/** Prints message followed by variable dump of $value in html, inserts a colon between and quotes around value\n\t\t@attrib api=1 params=pos\n\t\t@param value type=mixed default=NULL\n\t\t\tValue to print. If message not specified, multiline detailed info printed\n\t\t@param msg type=string default=\"\"\n\t\t\tMessage to describe event/value. If message isn't specified then info about the variable $value is displayed instead\n\t\t@param level type=int default=0\n\t\t\tOutput indenting level. Has no meaning if $msg not specified\n\t\t@returns void\n\t\t@errors none\n\t**/\n\tpublic static function d($value = null, $msg = \"\", $level = 0)\n\t{\n\t\tif ($msg)\n\t\t{\n\t\t\techo str_repeat(\"&nbsp;&nbsp;&nbsp;&nbsp;\", $level) . $msg .\": '\". var_export($value, true) . \"'<br />\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tob_start();\n\t\t\tdebug_zval_dump($value);\n\t\t\t$msg = ob_get_clean();\n\t\t\techo nl2br(str_replace(\" \", \"&nbsp;\", $msg)) . \"<br />\\n<br />\\n\";\n\t\t}\n\t\tflush();\n\t}\n\n\t/** Prints and exits. See method d() documentation\n\t\t@attrib api=1 params=pos\n\t\t@param value type=mixed default=NULL\n\t\t@param msg type=string default=\"\"\n\t\t@param level type=int default=0\n\t\t@returns void\n\t\t@errors none\n\t**/\n\tpublic static function dx($value = null, $msg = \"\", $level = 0)\n\t{\n\t\tself::d($value, $msg, $level);\n\t\texit;\n\t}\n\n\tpublic static function log($msg = \"-\")\n\t{\n\t\tstatic $logfile = false;\n\t\tif (!$logfile)\n\t\t{\n\t\t\t$logfile = fopen(AW_DIR . \"files/debug.log\", \"a\");\n\t\t}\n\t\t$msg = date(\"M d Y H:i:s\") . \"\\t\" . get_caller_str(1) . \"\\t\" . $msg . \"\\n\";\n\t\tfwrite($logfile, $msg);\n\t}\n}", "public static function debug( $message, $values = null );", "public static function log_debug ( $message ) {\r\n\t\tif ( class_exists( 'GFLogging' ) ) {\r\n\t\t\tGFLogging::include_logger();\r\n\t\t\tGFLogging::log_message( self::$slug, $message, KLogger::DEBUG );\r\n\t\t}\r\n\t}", "public function debug($value='');", "function debug($message){\r\n\t$DEBUG_MODE = FALSE;\r\n\tif($DEBUG_MODE){\r\n\t\techo $message;\r\n\t}\r\n}", "function debug()\n{\n define('DEBUG_MODE', true);\n}", "function log($message = '', $type = 0, $path = null, $headers = null);", "function showDebug() {\n\n $params = ['action_type' => true,\n 'action_user' => getUserName(Session::getLoginUserID()),\n 'entities_id' => $_SESSION['glpiactive_entity'],\n 'itemtype' => get_class($this),\n 'date' => $_SESSION['glpi_currenttime'],\n 'refuse' => true,\n 'label' => ['name' => 'test'],\n 'field' => ['action_refuse' => true],\n 'double' => []];\n\n NotificationEvent::debugEvent($this, $params);\n }", "function debug($string){\n\t\t$this->debug_str .= get_class($this).\": $string\\n\";\n\t}", "public function getDebug(): string {}", "protected function debug($mixed) {\n $this->debugger->log($mixed);\n }", "public function isDebug();", "function d($str) {\n file_put_contents('debug.txt', $str . \"\\r\\n\", FILE_APPEND);\n}", "function get_debug_file() {\n\treturn apply_filters( Core\\HOOK_PREFIX . 'debug_file', Core\\DEBUG_FILE );\n}", "function debug($msg_or_obj) {\n if ((defined('DEV_DEBUG') && DEV_DEBUG) || !!get('devbug') || !!post('devbug')) {\n if (is_string($msg_or_obj))\n echo $msg_or_obj;\n else\n print_pre($msg_or_obj);\n }\n}", "function sloodle_debug($msg)\n {\n if (SLOODLE_DEBUG) echo $msg;\n }", "public static function debug( $msg, $file = false, $function = false, $line = false ) {\n\t\t\tstatic::add( 'debug', $msg, $file, $function, $line );\n\t\t}", "function log_debug($a) {\n\tglobal $logger, $config;\n\tif ($config['CAM_LOG_DEBUG']) {\n\t\t$logger->addDebug($a);\n\t}\n}", "function logDebug($str){\n\tglobal $debugging;\n\tglobal $log_ref;\n\tif($debugging){\n\t\tfwrite($log_ref, $str.\"\\n\\r\");\n\t\techo($str.'<br><br>');\n\t}\n}", "function debug($data)\n{\n echo '<pre>' . print_r($data, true) . '</pre>';\n}", "function debug($value = '', $tag = self::DEFAULT_TAG) {\r\n\t\r\n\t\tself::log('DEBUG', $value, $tag);\r\n\t}", "public function debug(string $msg, $type = '')\n {\n if ($this->logLevel < CLLogger::DEBUG) return;\n $this->log($msg, 'debug', $type);\n }", "function debug($f) {\n\t$smarty = &$this->hCtx->smarty;\n\t$hCtx = &$this->hCtx;\n\t$hSessionCtx = &$this->hSessionCtx;\n\n\tif ($f) {\n\t\t$smarty->define\t( array\t( \"debug\"\t=> \"templates/debug.tpl\") );\n\t\t$hCtx->aRequest[\"debug\"] = 1;\n\t\t$smarty->assign(\"LINGUA_IMPOSTATA_ID_DEBUG\", \"1\");\n\t\t$smarty->assign(\"LINGUA_IMPOSTATA_ABBREV_DEBUG\", \"IT\");\n\t\t//unset($hSessionCtx->urlIndietro);\n\t\t$smarty->assign(\"STACK_INDIETRO\", $hSessionCtx->debugMostraStack());\n\t\t$hCtx->aRequest[\"debug\"] = 1;\n\t\t$smarty->parse(\"internalDebug\", \"debug\");\n\t} else {\n\t\t$smarty->assign(\"internalDebug\", \"x\");\n\t}\n}", "function emDebug() {\n if ( $this->emLoggerDebugMode() && ($emLogger = $this->emLoggerInstance()) ) $emLogger->emLog($this->PREFIX, func_get_args(), \"DEBUG\");\n }", "function acf_dev_log() {}", "function log($message) {\n // DEBUG MESSAGE LOG\n DebMes($message, 'google_location'); \n}", "public function debug($message, $context = array())\n {\n }", "protected function send_debug_email()\n {\n }", "function emDebug()\n {\n if ($this->getSystemSetting('enable-system-debug-logging') || (!empty($_GET['pid']) && $this->getProjectSetting('enable-project-debug-logging'))) {\n $emLogger = ExternalModules::getModuleInstance('em_logger');\n $emLogger->emLog($this->PREFIX, func_get_args(), \"DEBUG\");\n }\n }", "function wfDebugLog( $method, $msg) {\n\techo \"[$method] $msg\\n\";\n}", "function _log($data){\n\n \\Yii::info(\\yii\\helpers\\VarDumper::dumpAsString($data, 5), '_');\n}", "function print_debug($message,$var = 'messageonly',$part = 'app', $level = 3)\n{\n\tunset($message, $var, $part, $level);\n}", "public static function set_debugging($path)\n {\n if (substr($path, -1) == \"/\") {\n $path = substr($path, 0, -1);\n }\n self::$debugging_path = $path;\n }", "function debug($var, $exit = 0)\n\t{\n\t\tglobal $app;\n\t\tif ($app[debug]){\n\t\t\techo \"<pre>\";\n\t\t\tprint_r($var);\n\t\t\techo \"</pre>\";\n\t\t}\n\t\tif ($exit){\n\t\t\texit;\n\t\t}\n\t}", "public static function debug($message) {\r\n self::writeLine('DEBUG | ' . $message);\r\n }", "function debug($debug = false)\n {\n $this->debug = $debug;\n }", "public static function log($data) {\n self::$debugLog->add($data);\n }", "function debugLog($str) {\r\n if(isset($_REQUEST['debug']) && $_REQUEST['debug'] == \"1\") {\r\n echo $str.\"<br>\\n\";\r\n }\r\n}", "function debugger_start_debug() {}", "function debug($txt) {\n if (DEBUG) {\n echo $txt, PHP_EOL;\n }\n}", "function debug($string = '', $data = [])\n{\n if (DEBUG) {\n output(trim('[D ' . get_memory_used() . '] ' . $string) . \"\\n\");\n if (!empty($data)) {\n output(print_r($data, 1));\n }\n return true;\n }\n return false;\n}", "public function debug()\n {\n die(call_user_func_array('var_dump', func_get_args()));\n }", "function wp_rml_debug($message, $methodOrFunction = null) {\n general\\Core::getInstance()->debug($message, $methodOrFunction);\n }", "function sdebug() {\n\t// TODO use the PHP 7 spread operator! :D\n debug(call_user_func_array('sprintf', func_get_args()));\n}" ]
[ "0.7151785", "0.70309347", "0.69458306", "0.6796882", "0.6664446", "0.6599889", "0.6570444", "0.6551761", "0.64970404", "0.6494125", "0.6473722", "0.6470016", "0.6446503", "0.6422305", "0.64152545", "0.64118695", "0.6403658", "0.637012", "0.6363091", "0.6321303", "0.6284565", "0.6283965", "0.6279535", "0.6234513", "0.6216353", "0.61970353", "0.6190027", "0.6189641", "0.61868316", "0.61854875", "0.61834407", "0.6165544", "0.61371183", "0.6134144", "0.6128224", "0.6113429", "0.6111239", "0.6110159", "0.60977685", "0.6091431", "0.60858047", "0.6062071", "0.60445696", "0.60417247", "0.60417247", "0.60417247", "0.6025974", "0.6019846", "0.60141534", "0.601147", "0.60108787", "0.6008113", "0.6007683", "0.6006973", "0.5983761", "0.5973443", "0.5953346", "0.5945473", "0.59410167", "0.5937284", "0.5930814", "0.5930368", "0.592746", "0.59273475", "0.5926106", "0.5923393", "0.5917019", "0.5899057", "0.5896583", "0.58941823", "0.58931494", "0.5889145", "0.588296", "0.5879389", "0.5873144", "0.5855139", "0.585204", "0.5851106", "0.583599", "0.583436", "0.5832542", "0.5830125", "0.5829316", "0.5827289", "0.5825605", "0.58242446", "0.5821275", "0.581967", "0.5819427", "0.58187044", "0.5814679", "0.58112216", "0.58083653", "0.58072805", "0.58072674", "0.58063674", "0.5806197", "0.58058274", "0.5805371", "0.5804993" ]
0.7190166
0
Display an iframe of the given url
Показать iframe с заданным url
public function iframe($url) { echo "<iframe style='display: block; width: 100%; height: 200px;' onload='resizeIframe(this)' src='$url'></iframe>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function iframeAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "function html_iframe($src, $w=600, $h=500, $options=array()) {\n $options['src'] = $src; \n $options['height'] = $h; \n $options['width'] = $w;\n if($srcdoc = $options['srcdoc'] ? htmlspecialchars($options['srcdoc']) : '') $options['srcdoc'] = $srcdoc;\n return html_tag('iframe', \"Sorry, your browser does not support frames\", 'foo', $options, ['srcdoc', 'height', 'width', 'src']);\n}", "public function display_view_page($url , $block_id ){\n global $USER , $PAGE;\n // get default block configuration\n $def_config = get_config('block_superiframe');\n\n // start output to browser\n echo $this->output->header();\n\n // check for capability to show user details\n if(has_capability('block/superiframe:seeuserdetail' , $PAGE->context )){\n // create a link to the user's list of entries in this glossary\n $userpicture = $this->output->user_picture($USER, array('size'=>65));\n $elementUrl = new moodle_url('/user/view.php', array('id' => $USER->id));\n $elementLink = html_writer::link($elementUrl,$userpicture);\n echo '<br/>' . fullname($USER);\n echo '<br/>' . $elementLink;\n }\n\n // show the heading\n echo $this->output->heading(get_string('pluginname', 'block_superiframe'),5);\n\n echo '<br/>';\n\n $sizes = array();\n $sizes['custom'] = ['width' => $def_config->width , 'height' => $def_config->height ] ;\n $sizes['small'] = ['width' => 300 , 'height' => 200 ] ;\n $sizes['medium'] = ['width' => 600 , 'height' => 400 ] ;\n $sizes['large'] = ['width' => 900 , 'height' => 600 ] ;\n\n // get the parameter if exists\n $size = optional_param('size','custom',PARAM_TEXT);\n\n // check if the parameter is within the array of predefined parameter sets\n if( ! array_key_exists( $size , $sizes ) ){\n $size = 'custom';\n }\n\n //fetch the size of the iframe\n $width = $sizes[$size]['width'];\n $height = $sizes[$size]['height'];\n\n echo $this->show_links( $sizes , $block_id );\n\n $iframe_attr = array();\n $iframe_attr['src'] = $url ;\n $iframe_attr['width'] = $width ;\n $iframe_attr['height'] = $height ;\n $iframe_attr['class'] = 'block_superiframe_iframe' ;\n $iframe = html_writer::tag('iframe','',$iframe_attr);\n echo '<br/><br/>' . $iframe ;\n \n // send footer out to browser\n echo $this->output->footer();\n }", "public function iframe($value) {\n return $this->setProperty('iframe', $value);\n }", "public function show( $url ) {\n\t\techo \\esc_url( $this->get( $url ) );\n\t}", "public function preview_iframe(SS_HTTPRequest $r)\n {\n return $this->customise(array(\n 'Presentation' => $this->presentation\n ))->renderWith('PresentationPage_previewiframe');\n }", "function uTube_video_iframe( $url )\n{\n\treturn preg_replace_callback('#(?:https?://\\S+)|(?:www.\\S+)|(?:\\S+\\.\\S+)#', function($arr)\n\t{\n\t $url = parse_url($arr[0]);\n\t // youtube\n\t if( in_array($url['host'], array('www.youtube.com', 'youtube.com')) )\n\t {\n\t \t unset($url['scheme']);\n\t if ( !isset($url['query'] ) )\n\t {\n\t $url['query'] = 'wmode=opaque&html5=1';\n\t }\n\t else\n\t {\n\t if( strstr($url['query'] , 'v=' ) == 0 )\n\t {\n\t $url['query'] = substr( $url['query'] , 2 );\n\t }\n\n\t if( strpos( strtolower ( $url['query'] ) , 'html5=true') == 0 )\n\t {\n\t $url['query'] = $url['query'].'/?html5=1';\n\t }\n\t }\n\t if( $url['path'] == '/watch' )\n\t {\n\t $url['path'] = 'embed';\n\t }\n\n\t return vsprintf('//%s/%s/%s' , $url );\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\n\t}, $url );\n}", "function dashboard_widget_function()\n{\n\n // Display whatever it is you want to show.\n echo '<iframe id=\"pixlr\" type=\"text/html\" width=\"100%\" height=\"740px\" src=\"http://pixlr.com/editor/\" frameborder=\"0\"></iframe>';\n}", "public function url2embed($url) {\n /** Get Video Id from getYoutubeIdFromUrl **/\n $video_id = $this->getYoutubeIdFromUrl($url);\n /** Chekc Iif video is truthey **/\n if ($video_id) {\n /** Return iframe **/\n return '<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/' . $video_id . '?autoplay=1&showinfo=0\" frameborder=\"0\" allowfullscreen></iframe>';\n }\n return '';\n }", "function cyon_iframe( $atts, $content = null ) {\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\twidth\t\t=> '500',\n\t\t\theight\t\t=> '350',\n\t\t\tscroll\t\t=> 'yes',\n\t\t\turl\t\t\t=> 'http://localhost/'\n\t\t), $atts);\n\treturn '<div style=\"width:'.$atts['width'].'px; max-width:100%; height:'.$atts['height'].'px; overflow:visible;\"><iframe style=\"max-width:100%;\" width=\"'.$atts['width'].'\" height=\"'.$atts['height'].'\" frameborder=\"0\" scrolling=\"'.$atts['scroll'].'\" marginheight=\"0\" marginwidth=\"0\" src=\"'.$atts['url'].'\"></iframe></div>';\n}", "function widget_IFrameless($args) {\r\n extract($args);\r\n \r\n $options = get_option(\"widget_IFrameless\");\r\n if (!is_array( $options ))\r\n {\r\n $options = array(\r\n 'title' => 'http://wordpressiframe.omadataobjects.com/now.php'\r\n );\r\n }\r\n \r\n\r\n$request = new WP_Http;\r\n\r\n$result = $request->request( htmlspecialchars_decode($options['URL']) );\r\n\r\n$contents = $result['body'];\r\n\r\n \r\n\r\n echo $before_widget;\r\n echo $before_title;\r\n echo $contents;\r\n echo $after_title;\r\n \r\n //Our Widget Content\r\n\techo '<br><a href=\"http://wordpressiframe.omadataobjects.com/\">Help</a>';\r\n echo $after_widget;\r\n}", "static function get_video_embed( $url, $width = '100%', $height = 450 ) {\n if ( strstr( $url, 'youtube' ) ){\n $parse_url = parse_url( $url );\n $output = array();\n parse_str( $parse_url['query'], $output );\n $id = $output['v'];\n $iframe = '<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$id.'\" frameborder=\"0\" allowfullscreen></iframe>';\n return $iframe;\n }\n if ( strstr( $url, 'youtu.be' ) ) {\n $parse_url = parse_url( $url );\n $id = array_pop( explode( '/', $parse_url ) );\n $iframe = '<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$id.'\" frameborder=\"0\" allowfullscreen></iframe>';\n return $iframe;\n }\n if ( strstr( $url, 'vimeo' ) ) {\n if ( !empty( $url ) ) {\n $id = array_pop( explode( '/', $url ) );\n $iframe='<iframe src=\"http://player.vimeo.com/video/'.$id.'\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n return $iframe;\n }\n }\n return false;\n\n }", "private function getIFrame($src, $width, $height) {\n\t\treturn \"<iframe src=\\\"{$src}\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" \".\n\t\t\t\"style=\\\"display: inline; border:none; overflow:hidden; \".\n\t\t\t\"width:{$width}; height:{$height};\\\" \".\n\t\t\t\"allowTransparency=\\\"true\\\"></iframe>\";\t\t\n\t}", "function newspack_blocks_get_iframe( $args ) {\n\t$defaults = array(\n\t\t'mode' => 'iframe',\n\t\t'src' => '',\n\t\t'height' => '600px',\n\t\t'width' => '100%',\n\t\t'isFullScreen' => false,\n\t\t'align' => '',\n\t);\n\t$args = wp_parse_args( $args, $defaults );\n\n\treturn newspack_blocks_get_iframe_html( $args['mode'], $args['src'], $args['height'], $args['width'], $args['isFullScreen'], $args['align'] );\n}", "function emp_direct_threeds_iframe() {\n\t\techo '<div class=\"emp-threeds-modal\"><iframe class=\"emp-threeds-iframe\" frameBorder=\"0\" style=\"border: none;\"></iframe></div>';\n\t}", "function boxembed( $url )\n {\n $boxdata = parse_url($url);\n if ($boxdata['host'] AND $boxdata['path']) {\n return 'https://' . $boxdata['host'] . '/embed_widget/' . $boxdata['path'] . '?theme=%1$s';\n } else {\n return '';\n }\n }", "public function add_background_iframe() {\n\t\tif ( Background::should_load_background_iframe() ) {\n\t\t\t?>\n\t\t\t\t<div id=\"leadin-iframe-container\" style=\"display: none\"></div>\n\t\t\t<?php\n\t\t}\n\t}", "public function urlCheckoutIframe();", "public function displayMarkupFromUrl($url)\n\t{\n\t\t$this->__displayMarkup($this->getMarkupFromUrl($url));\n\t}", "public function setIFrame() {\r\n\t\t$this->mUseIFrame = 1;\r\n\t}", "function wp_iframe($content_func)\n{\n}", "function youtube_embed($url)\n\t{\n\t\t//https://www.youtube.com/watch?v=3p4MZJsexEs\n\t\t//https://img.youtube.com/vi/3p4MZJsexEs/mqdefault.jpg\n\t\t$bodytag = str_replace(\"https://www.youtube.com/watch?v=\", \"//www.youtube.com/embed/\", $url);\n\t\treturn $bodytag.'/mqdefault.jpg';\n\t}", "public function display_iframe($kalvidres, $courseid) {\n $params = array(\n 'courseid' => $courseid,\n 'height' => $kalvidres->height,\n 'width' => $kalvidres->width,\n 'withblocks' => 0,\n 'source' => $kalvidres->source\n );\n $url = new moodle_url('/mod/kalvidres/lti_launch.php', $params);\n\n $attr = array(\n 'id' => 'contentframe',\n 'class' => 'kaltura-player-iframe',\n 'height' => '100%',\n 'width' => $kalvidres->width,\n 'src' => $url->out(false),\n 'allowfullscreen' => 'true',\n 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',\n );\n\n $iframe = html_writer::tag('iframe', '', $attr);\n $iframeContainer = html_writer::tag('div', $iframe, array(\n 'class' => 'kaltura-player-container'\n ));\n\n return $iframeContainer;\n }", "abstract protected function _embed($url, $options);", "function displayBoard($boardData)\n{\n head(\".\",\"Joint Whiteboards\");\n?>\n \n <?php\n $url = $videoData[\"url\"];\n $embedUrl = getYouTubeCode($url);\n ?>\n <iframe width=\"800\" height=\"450\" \n src=\"https://www.youtube.com/embed/<?php echo $embedUrl ?>\"\n frameborder=\"0\" allowfullscreen></iframe>\n \n \n <?php\n displayEditableData($embedUrl, $videoData);\n endcontent();\n footer();\n }", "function newspack_blocks_get_iframe_html( $mode, $src, $height, $width, $is_full_screen, $align ) {\n\t$is_document = 'document' === $mode;\n\t$height = $is_full_screen ? '100' : $height;\n\t$width = $is_full_screen ? '100' : $width;\n\t$style = \"height: $height; width: $width;\";\n\t$layout = 'responsive';\n\t$iframe_id = 'newspack-iframe-' . wp_generate_password( 12, false );\n\t$classes[] = 'wp-block-newspack-blocks-iframe';\n\n\tif ( empty( $src ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! empty( $align ) ) {\n\t\t$classes[] = 'align' . $align;\n\t}\n\n\tif ( $is_full_screen ) {\n\t\t$layout = 'fill';\n\t\t$style = 'height: 100vh; width: 100vw; max-width: 100vw; max-height: 100vh; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999999; margin-top: 0!important;';\n\t}\n\n\tif ( $is_document ) {\n\t\t$src = 'https://docs.google.com/gview?embedded=true&url=' . rawurlencode( $src );\n\t}\n\n\tob_start();\n\t?>\n\t<figure class='<?php echo esc_attr( implode( ' ', $classes ) ); ?>'>\n\t\t<div class='wp-block-embed__wrapper' style=\"height:<?php echo esc_attr( $height ); ?>; width:<?php echo esc_attr( $width ); ?>;\">\n\t\t\t<iframe\n\t\t\t\tid = '<?php echo esc_attr( $iframe_id ); ?>'\n\t\t\t\tlayout = '<?php echo esc_attr( $layout ); ?>'\n\t\t\t\theight = '100'\n\t\t\t\twidth = '100'\n\t\t\t\tsrc = '<?php echo esc_attr( $src ); ?>'\n\t\t\t\tstyle = '<?php echo esc_attr( $style ); ?>'\n\t\t\t\tframeborder = '0'\n\t\t\t\tallowfullscreen\n\t\t\t></iframe>\n\t\t</div>\n\t</figure>\n\n\t<?php if ( ! Newspack_Blocks::is_amp() ) : ?>\n\t\t<script>\n\t\t\tconst iframe = document.getElementById(\"<?php echo esc_attr( $iframe_id ); ?>\");\n\t\t\tconst timerId = setInterval( function() {\n\t\t\t\t\tiframe.src = iframe.src;\n\t\t\t\t}, 2000 );\n\n\t\t\tiframe.onload = function() {\n\t\t\t\tclearInterval(timerId);\n\t\t\t}\n\n\t\t</script>\n\t<?php endif; ?>\n\n\t<?php\n\treturn ob_get_clean();\n}", "public function display()\n\t{\n\t\tif ($this->getRequest()->getVar('raw') !== false)\n\t\t{\n\t\t\t$this->content();\n\t\t}\n\t\telse \n\t\t{\n\t\t\trequire_once './app/frame/frame.phtml';\n\t\t}\n\t}", "function spellcheck_iframe()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\t\t\n\t\tif ( ! class_exists('EE_Spellcheck'))\n\t\t{\n\t\t\trequire APPPATH.'libraries/Spellcheck'.EXT;\n\t\t}\n\n\t\treturn EE_Spellcheck::iframe($this->dsp->fetch_stylesheet());\n\t}", "function toursprung_iframe($webSpace, $webSpaceDesc, $tourSprungKey, $param) {\n\t\t// maptype = 1 : Satellit\n\t\t// maptype = 2 : Hybrid\n\t\t// maptype = 3 : Karte\n\t\t// maptype = 4 : OSM\n\t\t/* p = Gelaende, h = Hybrid, k = Satellit, m = Karte, o = OSM */\n\t\t$maptype = 0;\n\t\tswitch ($param['type']) {\n\t\t\tcase 'p' : $maptype = 0; break;\n\t\t\tcase 'k' : $maptype = 1; break;\n\t\t\tcase 'h' : $maptype = 2; break;\n\t\t\tcase 'm' : $maptype = 3; break;\n\t\t\tcase 'o' : $maptype = 4; break;\n\t\t\tdefault :\n\t\t\t$maptype = 0;\n\t\t}\n\t\t$w_width = str_replace(\"px\",\"\",$param['width']);\n\t\t$w_height = str_replace(\"px\",\"\",$param['height']);\n\t\t$w_height_desc = $w_height+150;\n\t\t$txt = '<div style=\"margin-top:2px;margin-bottom:2px;width:'.$w_width.'px;font-family:Arial,Helvetica,sans-serif;font-size:9px;color:#535353;background-color:#ffffff;border:2px solid #6db466;font-style:normal;text-align:right;padding:0px;padding-bottom:3px !important;\">';\n\t\t$txt .= '<iframe src=\"http://www.'.$webSpace.'.net/route/'.$param[$tourSprungKey].'/widget?width='.$w_width.'&amp;height='.$w_height.'&amp;maptype='.$maptype.'&amp;extended=true&amp;unit=km&amp;redirect=no\" width=\"'.$w_width.'\" height=\"'.$w_height_desc.'\" border=\"0\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\">'.$param['alt'].'</iframe>';\n\t\t$txt .= '<br />Route <a style=\"color:#6db466; text-decoration:underline;\" href=\"http://www.'.$webSpace.'.net/route/'.$param[$tourSprungKey].'\">'.$param[$tourSprungKey].'</a> - powered by <a style=\"color:#6db466; text-decoration:underline;\" href=\"http://www.'.$webSpace.'.net/\">'.$webSpaceDesc.'</a>&nbsp;';\n\t\t$txt .= '</div>';\n\t\tif ($param['qrcode'] != 'off') {\n\t\t\t$txt .= $this->makeQRCode('www.'.$webSpace.'.net/route/'.$param[$tourSprungKey].'/export.gpx',null,null);\n\t\t}\n\t\treturn $txt;\n\t}", "abstract protected function _embed( $url, array $options );", "public function step_switchToIframe($name) {\n $args = func_get_args();\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('switchToIframe', $args));\n }", "abstract protected function _embed( $url, $options );", "function embedWebfilezHtml($webfilezUrl, $folder = null) {\n\n $ds = DIRECTORY_SEPARATOR;\n require_once(__DIR__ . $ds . 'libs' . $ds . 'Webfilez.php');\n echo Webfilez::embed($webfilezUrl, $folder);\n}", "function get_video_iframe($video_url)\n{\n\n $iframe = $video_url;\n // use preg_match to find iframe src\n preg_match('/src=\"(.+?)\"/', $iframe, $matches);\n $src = $matches[1];\n $video = parse_video_uri($src);\n $video_id = $video['id'];\n\n // add extra params to iframe src\n $params = array(\n 'autoplay' => 0,\n 'fs' => 0,\n 'showinfo' => 0,\n 'rel' => 0,\n 'vq' => 'hd1080',\n 'controls' => 1,\n 'loop' => 0,\n 'playlist' => $video_id\n );\n\n $new_src = add_query_arg($params, $src);\n $iframe = str_replace($src, $new_src, $iframe);\n\n // add extra attributes to iframe html\n $attributes = 'frameborder=\"0\" scroll=\"no\" autoplay=\"0\" controls=\"1\" pm24sc-video=\"automute: false\" allow=\"autoplay; fullscreen\" allowfullscreen';\n $iframe = str_replace('></iframe>', ' ' . $attributes . '></iframe>', $iframe);\n\n $video_source = array();\n $video_source['iframe'] = $iframe;\n $video_source['id'] = $video_id;\n $video_source['type'] = $video['type'];\n $video_source['src'] = $src;\n\n return $video_source;\n}", "function ot_nlsignup_content() { ?>\n\t\t<iframe width=\"100%\" height=\"300\" src=\"http://outthinkgroup.com/nlsignup/\" scrolling=\"no\" frameborder=\"0\" overflow=\"0\"></iframe>\n\t<?php\n\t}", "protected function url_framed($url){\n\t\t$array=array(\"facebook.\",\"youtube.\",\"google.\",\"gmail.\",\"yahoo.\",\"github.\");\n\t\t$domain=Main::domain($url,TRUE,FALSE);\n\t\tforeach ($array as $u) {\n\t\t if (preg_match(\"!$u!\",$domain)) {\n\t\t \treturn FALSE;\n\t\t }\n\t\t}\n\t\treturn TRUE;\t\t\t\n\t}", "function youtube_preview($url)\n\t{\n\t\t//https://www.youtube.com/watch?v=3p4MZJsexEs\n\t\t//https://img.youtube.com/vi/3p4MZJsexEs/mqdefault.jpg\n\t\t$bodytag = str_replace(\"https://www.youtube.com/watch?v=\", \"https://img.youtube.com/vi/\", $url);\n\t\treturn $bodytag.'/mqdefault.jpg';\n\t}", "function soundtrackFrame($link)\n{\n // soundcloud\n // standard urls : soundcloud.com/{band}/{track} or api.soundcloud.com/tracks/{track_id}\n // embed url : https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/{track_id}\n // https://w.soundcloud.com/player/?url=https://soundcloud.com/{band}/{track}\n if (strpos($link, 'soundcloud.com') !== false) {\n return '<iframe width=\"100%\" height=\"166\" scrolling=\"no\" frameborder=\"no\" \n src=\"https://w.soundcloud.com/player/?url='.$link.'\"></iframe>';\n \n }\n\n // bandcamp\n // standard url is no good for embeding, need the album id\n // embed url : http://bandcamp.com/EmbeddedPlayer/v=2/album=4077462542/size=grande3/bgcol=FFFFFF/linkcol=4285BB/\n if (strpos($link, 'bandcamp.com') !== false) {\n return '<iframe width=\"300\" height=\"410\" style=\"position: relative; display: block; width: 300px; height: 410px;\" \n src=\"'.$link.'\" allowtransparency=\"true\" frameborder=\"0\"></iframe>';\n } \n\n return '<a href=\"'.$link.'\">'.$link.'</a>';\n}", "function add_youtube_iframe_args( $html, $url, $args ) {\n\n\t/* Modify video parameters. */\n\tif ( strstr( $html, 'youtube.com/embed/' ) && ! empty( $args['location'] ) ) {\n\t\tpreg_match_all( '|embed/(.*)\\?|', $html, $matches );\n\t\t$html = str_replace( '?feature=oembed', '?feature=oembed&enablejsapi=1&autoplay=1&mute=1&controls=0&loop=1&showinfo=0&rel=0&playlist=' . $matches[1][0], $html );\n\t\t$html = str_replace( '<iframe', '<iframe rel=\"0\" enablejsapi=\"1\" id=slide-' . get_the_ID(), $html );\n\t}\n\n\treturn $html;\n}", "function newspack_blocks_render_block_iframe( $attributes ) {\n\tNewspack_Blocks::enqueue_view_assets( 'iframe' );\n\n\treturn newspack_blocks_get_iframe( $attributes );\n}", "function handle_legacy_widget_preview_iframe() {\n\tif ( empty( $_GET['legacy-widget-preview'] ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! current_user_can( 'edit_theme_options' ) ) {\n\t\treturn;\n\t}\n\n\tdefine( 'IFRAME_REQUEST', true );\n\n\t?>\n\t<!doctype html>\n\t<html <?php language_attributes(); ?>>\n\t<head>\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t\t<link rel=\"profile\" href=\"https://gmpg.org/xfn/11\" />\n\t\t<?php wp_head(); ?>\n\t\t<style>\n\t\t\t/* Reset theme styles */\n\t\t\thtml, body, #page, #content {\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body <?php body_class(); ?>>\n\t\t<div id=\"page\" class=\"site\">\n\t\t\t<div id=\"content\" class=\"site-content\">\n\t\t\t\t<?php\n\t\t\t\t$registry = WP_Block_Type_Registry::get_instance();\n\t\t\t\t$block = $registry->get_registered( 'core/legacy-widget' );\n\t\t\t\techo $block->render( $_GET['legacy-widget-preview'] );\n\t\t\t\t?>\n\t\t\t</div><!-- #content -->\n\t\t</div><!-- #page -->\n\t\t<?php wp_footer(); ?>\n\t</body>\n\t</html>\n\t<?php\n\n\texit;\n}", "public function showEpisode($url)\n {\n $episode = Episode::where('url', $url)->first();\n if(empty($episode)){\n abort(404, 'Invalid URL');\n }\n $next = Episode::getNext($episode->number);\n $previous = Episode::getPrev($episode->number);\n return view('episode_detail', compact('episode', 'next', 'previous'));\n }", "public function iframe($height=400) {\n $this->cfi->json_object['fields'][$this->field]['type'] = 'iframe';\n $this->cfi->json_object['fields'][$this->field]['iframe_height'] = $height;\n return $this;}", "function is_iframe($video_url)\n\n\t{\n\n\t\t$iframe_embed\t=\ttrue;\n\n\t\tif (strpos($video_url, 'youtube.com')) {\n\n\t\t\t$iframe_embed = false;\n\n\t\t}\n\n\n\n\t\t$path_info \t\t=\tpathinfo($video_url);\n\n\t\t$extension\t\t=\t$path_info['extension'];\n\n\t\tif ($extension == 'mp4') {\n\n\t\t\t$iframe_embed = false;\n\n\t\t}\n\n\t\treturn $iframe_embed;\n\n\t}", "function iframe_wrapper( $content ) {\n\t// match any iframes\n\t$pattern = '~<iframe.*?<\\/iframe>|<embed.*?<\\/embed>~';\n\tpreg_match_all( $pattern, $content, $matches );\n\n\tforeach ( $matches[0] as $match ) {\n\t\t// Check if it is a video player iframe\n\t\tif ( strpos( $match, 'youtu' ) || strpos( $match, 'vimeo' ) ) {\n\t\t\t// wrap matched iframe with div\n\t\t\t$wrappedframe = '<div class=\"responsive-embed widescreen\">' . $match . '</div>';\n\t\t\t//replace original iframe with new in content\n\t\t\t$content = str_replace( $match, $wrappedframe, $content );\n\t\t}\n\t}\n\n\treturn $content;\n}", "private function getVideoCode($width, $height, $urlData = '') {\n\t\treturn \"<iframe class=\\\"preview\\\" src=\\\"//player.vimeo.com/video/\".$this->_v['vid'].\"?\".$urlData.\"\\\" width=\\\"\".$width.\"\\\" height=\\\"\".$height.\"\\\" style=\\\"border: 0;\\\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>\";\n\t}", "function launchurl($url) {\n $reponse = new XajaxResponse();\n\t$handle = fopen($url, \"r\");\n\t$reponse->script(\"$('#traitement').css('display', 'none')\");\n\treturn $reponse;\n }", "public static function echoUrl(string $url)\n\t{\n\t\techo self::url($url);\n\t}", "function forty_responsive_video( $html ) {\n\t//add http protocol\n $html = str_replace('<iframe src=\"//', '<iframe src=\"http://', $html);\n\n return '<div class=\"flex-video\">' . $html . '</div>';\n}", "function obtener_embed_youtube_url($url, $width, $height)\r\n\t{\r\n\t\t//var_dump($id);\r\n\t\t$embed = \"<object width=\\\"$width\\\" height=\\\"$height\\\"><param name=\\\"movie\\\" value=\\\"$url\\\"></param><param name=\\\"wmode\\\" value=\\\"window\\\"></param><embed src=\\\"$url\\\" type=\\\"application/x-shockwave-flash\\\" wmode=\\\"window\\\" width=\\\"$width\\\" height=\\\"$height\\\"></embed></object>\";\r\n\t\treturn $embed;\r\n\t}", "public function openUrl($url) {\n if (is_array($url)) {\n $path = $url[0];\n $options = $url[1];\n $options['absolute'] = TRUE;\n $full_url = url($path, $options);\n }\n else {\n $full_url = url($url, array('absolute' => TRUE));\n }\n\n $variables = array(\"url\" => $full_url);\n $this->execute(\"POST\", \"/session/:sessionId/url\", $variables);\n }", "public function render($url)\n {\n\n if(empty($url)){\n return Response::json([\"error\" => true,\"msg\" => \"no video url provided\"]);\n }\n\n $get_url = parse_url($url);\n\n $scheme = $get_url[\"scheme\"];\n $host = $get_url[\"host\"];\n $query = explode(\"v=\",$get_url[\"query\"]);\n\n $video_id = ($query[1]) ? $query[1] : null;\n\n $website_url = \"$scheme://$host\";\n\n\n $site_list = $this->sites($video_id);\n\n $get_site = array_search($website_url,array_column($site_list, \"website\",\"embed\"));\n\n print_r($get_site);\n\n //print_r($site_list[$get_site]);\n\n return false;\n }", "function cmail_contact_frame($attrib)\n {\n global $OUTPUT;\n\n if (!$attrib['id'])\n $attrib['id'] = 'rcmcontactframe';\n \n $attrib['name'] = $attrib['id'];\n\n $OUTPUT->set_env('contentframe', $attrib['name']);\n $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');\n\n return html::iframe($attrib);\n }", "public function preview($url = null) {\n }", "public function showdetails($data=null) {\n\t\t\n\t\t//\"javascript:$(\\\"#acal\\\").load(\\\"cpcrmplus.php?t=acalajax&projectid={id}&ptitle={title}&id={code}&date={start}\\\");\"\n\n\t $bodyurl = 'cpcrmplus.php?t=cpcrmshowgant&iframe=1&id='.$data; \n\t\t$frame = \"<iframe src =\\\"$bodyurl\\\" width=\\\"100%\\\" height=\\\"350px\\\"><p>Your browser does not support iframes</p></iframe>\"; \n\n\t\treturn ($frame);\t\t\n\t}", "public static function embed($url) {\n $embed = new Video_Youtube_Embed($url);\n return $embed;\n }", "function idaho_iframe_func( $atts, $content = '' ) {\n\n\t/** Returnable html string. */\n\t$iframe = (string) '';\n\n\t/** Convert $atts to $params. Merge with defaults. */\n\t$params = (array) shortcode_atts( array(\n\t\t'src' \t\t=> ''\n\t), $atts );\n\n\n\t$iframe .= sprintf('<iframe class=\"iframe-auto-height\" data-src=\"%1$s\" allowfullscreen width=\"100%%\" style=\"width:100%%\" scrolling=\"no\" frameborder=\"no\"></iframe>',\n\t\tesc_attr( $params['src'] )\n\t);\n\n\t/** Strip out new lines to avoid auto <p>s. */\n\treturn $iframe;\n}", "function fth_wrap_embed_with_div($html, $url, $attr)\n{\n if (strpos($url, 'vimeo.com') !== false || strpos($url, 'youtube.com') !== false) {\n return '<div class=\"video-container fitvidsignore\">' . $html . '</div>';\n } else {\n return $html;\n }\n}", "public function render($show_registered = FALSE) {\n\t\t\n\t\tif (!$show_registered) {\n\t\t\t\n\t\t\tif ($this->isRegistered()) {\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$src = $this->getLoadOnShow() ? NULL : $this->getSrc();\n\t\t$src = $src ? \"src='{$src}'\" : NULL;\n\n\t\t\n\t\t$result = \"<iframe id='bigmailer-iframe-{$this->id}' class='bigmailer-iframe' {$src} frameborder='0' scrolling='no' style='width: {$this->width}; height: {$this->height};' ></iframe>\";\n\t\t\n\t\tif ($this->getLoadOnShow()) {\n\t\t\t\n\t\t\t$result .= $this->getLoaderJS($this->getSrc());\n\t\t}\n\t\t\n//\t\techo \"<pre>\";\n//\t\techo htmlentities($result);\n//\t\techo \"</pre>---\";\n\n\t\treturn $result;\n\t\t\n\t}", "function smarty_function_iframe($params, &$smarty)\n{\n\tif (!count($params))\n\t{\n\t\t$smarty->trigger_error(\"iframe: missing parameters name, src, width, height\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (count($params) > 4)\n\t{\n\t\t$smarty->trigger_error(\"iframe: too few parameters\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!isset($params['src']) OR $params['src'] == \"\")\n\t{\n\t\t$smarty->trigger_error(\"iframe: missing parameter 'src'\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!isset($params['name']) OR $params['name'] == \"\")\n\t{\n\t\t$smarty->trigger_error(\"iframe: missing parameter 'name'\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!isset($params['width']))\n\t{\n\t\t$smarty->trigger_error(\"iframe: missing parameter 'width'\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!isset($params['height']))\n\t{\n\t\t$smarty->trigger_error(\"iframe: missing parameter 'height'\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!ctype_digit((string)($params['width'])))\n\t{\n\t\t$smarty->trigger_error(\"iframe: parameter 'width' not numeric\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telseif (!ctype_digit((string)($params['height'])))\n\t{\n\t\t$smarty->trigger_error(\"iframe: parameter 'height' not numeric\", E_USER_WARNING);\n\t\t$return = \"\";\n\t}\n\telse\n\t{\n\t\t$return = '<iframe scrolling=\"auto\" frameborder=\"0\" name=\"' . $params['name'];\n\t\t$return .= '\" width=\"' . $params['width'] . '\" height=\"' . $params['height'] . '\" src=\"' . $params['src'] . '\"><p><strong>Ihr Browser kann leider keine eingebetteten Frames anzeigen</strong></p></iframe>' . chr(13);\n\t}\n\treturn $return;\n}", "public function actionExternal($id)\n {\n //set theme file for showing external stories (story opened in iframe on source page)\n \\Yii::$app->view->theme = new \\yii\\base\\Theme([\n 'pathMap' => ['@frontend/views' => '@frontend/themes/iframe/views'],\n //'baseUrl' => '@frontend/themes/iframe',\n ]);\n\n //find current story\n $model = Story::findOne($id);\n\n //get url and headers\n $url = $model->link;\n $headers = get_headers($url, 1);\n\n //check if url is blocked to open in iframe\n if(array_key_exists('X-Frame-Options', $headers) || array_key_exists('x-frame-options', $headers) || array_key_exists('Content-Security-Policy', $headers) || array_key_exists('content-security-policy', $headers)) {\n \\Yii::$app->response->redirect($url);\n }\n //if not, open in iframe\n else {\n return $this->render('iframe', [\n 'model' => $model\n ]);\n }\n\n }", "function wrap_embed_with_div($html, $url, $attr) {\n return '<div class=\"video_container\">' . $html . '</div>';\n}", "function youtube_video($url) {\n\t\t$url = 'https://www.youtube.com/oembed?url='.$url.'&format=json';\n\t\t$data = json_decode(file_get_contents($url));\n\n\t\t$html = $data->html;\n\t\treturn $html;\n\t}", "protected function open($url) {\n\t\t$this->url($url);\n\t}", "function open($url) {\r\n\t\t\techo $this->__getRow('open', $url);\r\n\t\t}", "public static function popup_helper($controllername)\n {\n?>\n <div id=\"<?php echo $controllername?>Container\" style=\"display: none; overflow: auto;\">\n <iframe id=\"<?php echo $controllername?>Cont\" class=\"business_units_iframe\" frameborder=\"0\"></iframe>\n </div>\n<?php \t\n }", "function VideoID($url){\n\n if(strpos($url, \"vimeo.com\")){\n if(strpos($url, 'vimeo.com/')){\n $val = strrpos($url, 'vimeo.com/')+10;\n $str = substr($url, $val);\n return $str;\n //return '<iframe src=\"https://player.vimeo.com/video/'.$str.'\" width=\"854\" height=\"480\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';\n } \n }else if(strpos($url, \"youtube.com\")){\n if(strpos($url, '?v=')){\n $val = strrpos($url, '?v=')+3;\n $str = substr($url, $val);\n return $str;\n //return '<iframe width=\"854\" height=\"480\" src=\"https://www.youtube.com/embed/'.$str.'\" frameborder=\"0\" allowfullscreen></iframe>';\n } \n }\n }", "function widget_show_screen( $url_type, $code ){\n\t\t\t\tob_start();\n\t\t\t\t$this->ui->widget_js();\n\t\t\t\t$widget_js = ob_get_clean();\n\n\t\t\t\t$screen = $this->widget_get_screen( $url_type . '.html' );\n\t\t\t\t$js = $this->widget_get_screen( $url_type . '.js' );\n\n\t\t\t\techo <<<SCREEN\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/1999/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n<head>\n\t<title>Janrain Capture</title>\n\t{$widget_js}\n\t<script type=\"text/javascript\">\n\t\t{$js}\n\t</script>\n</head>\n<body>\n\t{$screen}\nSCREEN;\n\t\t}", "public function setEmbedUrl(UrlValue $url);", "public static function iframe_data( $twitter_card_url ) {\r\n $iframe_data = array();\r\n if( $twitter_card_url ){\r\n\r\n //Check whether it's a youtube video\r\n $youtube = stripos($twitter_card_url, 'youtube.com/watch');\r\n $youtu = stripos($twitter_card_url, 'youtu.be');\r\n $youtubeembed = stripos($twitter_card_url, 'youtube.com/embed');\r\n\r\n //Check whether it's a Vimeo video\r\n $vimeo = stripos($twitter_card_url, 'vimeo');\r\n\r\n //Check whether it's a Vine video\r\n $vine = stripos($twitter_card_url, 'vine.co');\r\n\r\n //Check whether it's a SoundCloud embed\r\n $soundcloud = stripos($twitter_card_url, 'soundcloud.com');\r\n\r\n //Check whether it's a Spotify embed\r\n $spotify = stripos($twitter_card_url, 'open.spotify.com');\r\n\r\n //YouTube\r\n if( $youtube || $youtubeembed || $youtu ){\r\n if ($youtube || $youtubeembed) {\r\n //Get the unique video id from the url by matching the pattern\r\n if (preg_match(\"/v=([^&]+)/i\", $twitter_card_url, $matches)) {\r\n $id = $matches[1];\r\n } elseif(preg_match(\"/\\/v\\/([^&]+)/i\", $twitter_card_url, $matches)) {\r\n $id = $matches[1];\r\n } elseif(preg_match(\"/\\/embed\\/([^&]+)/i\", $twitter_card_url, $matches)) {\r\n $id = $matches[1];\r\n }\r\n } else if ($youtu) {\r\n $id = explode('/', $twitter_card_url);\r\n $id = end($id);\r\n }\r\n if ( isset ( $id ) && ! is_array( $id ) ) {\r\n $id = explode(\"?\", $id);\r\n } else {\r\n $id = array();\r\n }\r\n if ( isset( $id[0] ) ) {\r\n $last = $id[0];\r\n } else {\r\n $last = '';\r\n }\r\n $iframe_src = 'https://www.youtube.com/embed/' . $last;\r\n\t $iframe_data['url'] = $iframe_src;\r\n }\r\n\r\n //Vimeo\r\n if ($vimeo) {\r\n $clip_id = '';\r\n\r\n //http://vimeo.com/moogaloop.swf?clip_id=101557016&autoplay=1\r\n $query = parse_url($twitter_card_url, PHP_URL_QUERY);\r\n parse_str($query, $params);\r\n if(isset($params['clip_id'])) $clip_id = $params['clip_id'];\r\n\r\n //https://player.vimeo.com/video/116446625?autoplay=1\r\n if( !isset($clip_id) || $clip_id == '' ){\r\n $vimeo_url = strtok($twitter_card_url,'?');\r\n $vimeo_pass = explode('/', $vimeo_url);\r\n $clip_id = end(($vimeo_pass));\r\n }\r\n\t if( !isset($clip_id) || $clip_id == '' ){\r\n\t\t $vimeo_url = strtok($twitter_card_url,'?');\r\n\t\t $vimeo_pass = explode('/', $vimeo_url);\r\n\t\t $clip_id = end(($vimeo_pass));\r\n\t }\r\n if (!preg_match('([a-zA-Z])', $clip_id)) {\r\n $iframe_src = 'https://player.vimeo.com/video/'.$clip_id;\r\n\t $iframe_data['url'] = $iframe_src;\r\n } else {\r\n $iframe_src = '';\r\n $vimeo = false;\r\n }\r\n\r\n }\r\n\r\n //Vine\r\n if ($vine) {\r\n //https://vine.co/v/hu77ljU6OOF/embed/simple\r\n $twitter_card_url = explode(\"?\", $twitter_card_url);\r\n $iframe_src = $twitter_card_url[0] . '/embed/simple';\r\n\t $iframe_data['url'] = $iframe_src;\r\n }\r\n\r\n //SoundCloud\r\n if ($soundcloud){\r\n $twitter_card_url = explode(\"/s-\", $twitter_card_url);\r\n $iframe_src = 'https://w.soundcloud.com/player/?url=' . $twitter_card_url[0] . '/&amp;auto_play=false&amp;hide_related=true&amp;show_comments=false&amp;show_user=true&amp;show_reposts=false&amp;visual=false';\r\n\t $iframe_data['iframe_type'] = 'audio';\r\n\t $iframe_data['url'] = $iframe_src;\r\n }\r\n\r\n //Spotify\r\n /*\r\n * https://open.spotify.com/track/5H0kIgpWNZm9HF6VkU4dow?si=KvuO3MAuQmCxq8AI2QdhCw\r\n * <iframe src=\"https://open.spotify.com/embed/album/1DFixLWuPkv3KT3TnV35m3\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\" allow=\"encrypted-media\"></iframe>\r\n<iframe src=\"https://open.spotify.com/embed/track/5H0kIgpWNZm9HF6VkU4dow?si=KvuO3MAuQmCxq8AI2QdhCw\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\" allow=\"encrypted-media\"></iframe>\r\n */\r\n if ($spotify){\r\n $type = strpos( $twitter_card_url, 'track/' ) !== false ? 'track' : 'album';\r\n $url_pieces = $type === 'track' ? explode('track', $twitter_card_url ) : explode('album', $twitter_card_url );\r\n if ( isset( $url_pieces[1] ) ) {\r\n $iframe_src = 'https://open.spotify.com/embed/' . $type . $url_pieces[1];\r\n\t $iframe_data['iframe_class'] = ' ctf-spotify';\r\n\t $iframe_data['iframe_type'] = 'audio';\r\n\r\n\t $iframe_data['url'] = $iframe_src;\r\n } else {\r\n $spotify = false;\r\n }\r\n }\r\n\r\n //If the link is for an embedded video then add to media object\r\n if($youtube || $youtu || $youtubeembed || $vimeo || $vine || $soundcloud || $spotify){\r\n\t $iframe_data['type'] = 'iframe';\r\n return $iframe_data;\r\n }\r\n\r\n } // if( $twitter_card_url )\r\n\r\n return array();\r\n }", "public function load($url);", "function ctrl_dashboard_videos() { ?>\n\t\t<p>NAME_OF_VIDEO</p>\n <iframe class=\"vimeo\" src=\"http://player.vimeo.com/video/XXXXXXXXX?title=0&amp;byline=0&amp;portrait=0\" width=\"460\" height=\"281\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>\n\t<?php }", "public function goToUrl($url)\n {\n echo \"<script type='text/javascript'>window.location ='$url'; </script>\";\n }", "function div_wrapper_video($content) {\n // match any iframes\n /*$pattern = '~<iframe.*</iframe>|<embed.*</embed>~'; // Add it if all iframe*/\n $pattern = '~<iframe.*src=\".*(youtube.com|youtu.be).*</iframe>|<embed.*</embed>~'; //only iframe youtube\n preg_match_all($pattern, $content, $matches);\n foreach ($matches[0] as $match) {\n // wrap matched iframe with div\n $wrappedframe = '<div class=\"embed-responsive embed-responsive-16by9\">' . $match . '</div>';\n //replace original iframe with new in content\n $content = str_replace($match, $wrappedframe, $content);\n }\n return $content; \n}", "public static function isIframe()\n {\n self::parseRequest();\n return self::$isIframe;\n }", "function getVideoFromIframe( $iframe ){\n $iframeValues = explode(\" \", $iframe);\n\n $videoLink = \"\";\n\n /** Loop through iframe Values **/\n foreach( $iframeValues as $item ){\n\n /** Explode $item on '=' **/\n $keyValue = explode(\"=\", $item );\n\n /** See if keyValue has more than one value **/\n if( sizeof( $keyValue ) > 1 ){\n /** See if key is 'src' **/\n if( $keyValue[0] == \"src\" ){\n /** Return Url **/\n return( str_replace('\"', \"\", $keyValue[1] ) );\n }\n }\n }\n /** Return False when not found **/\n return FALSE;\n }", "public function show($url) {\n $data = $this->model->getPostByUrl($url);\n $comments = $this->model->getCommentsByUrl($url);\n $category=$this->model->getPostCategory();\n\n # Passing it into the view\n $this->view->data = $data;\n $this->view->comments = $comments;\n $this->view->category=$category;\n\n $this->view->render('home/show');\n }", "public static function get_embed( $url )\n\t{\n\t\t/**\n\t\t * Set arguments for getting embeded HTML.\n\t\t * Without arguments, default width will be taken from global $content_width, which can break UI in the admin\n\t\t * @link https://github.com/rilwis/meta-box/issues/801\n\t\t * @see WP_oEmbed::fetch()\n\t\t * @see WP_Embed::shortcode()\n\t\t * @see wp_embed_defaults()\n\t\t */\n\t\t$args = array();\n\t\tif ( is_admin() )\n\t\t{\n\t\t\t$args['width'] = 360;\n\t\t}\n\n\t\t// Try oembed first\n\t\t$embed = wp_oembed_get( $url, $args );\n\n\t\t// If no oembed provides found, try WordPress auto embed\n\t\tif ( ! $embed )\n\t\t{\n\t\t\t$embed = $GLOBALS['wp_embed']->shortcode( $args, $url );\n\t\t}\n\n\t\treturn $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );\n\t}", "public function xframe($mode = 'DENY', array $urls = array())\n {\n header('X-Frame-Options: '.$mode.' '.implode(' ', $urls));\n }", "function add_iframe_button($context) {\n $img = plugins_url( 'bug.png' , __FILE__ );\n \n //the url to use. \n //we use this URL so our plugin picks up the request \n //we handle the request within the method: output_iframe_page\n $url = get_bloginfo( 'url' ) . '/?editor-popup-iframe=' . $this->slug;\n \n //our popup's title\n $title = 'An Iframe Popup!';\n\n //append the icon\n $context .= \"<a href='{$url}&TB_iframe=1' class='thickbox' \n onclick='return false;' title='{$title}'><img src='{$img}' />\";\n \n return $context;\n }", "function pdf_function($attr, $url) {\n extract(shortcode_atts(array(\n 'width' => '640',\n 'height' => '480'\n ), $attr));\n return '<iframe src=\"http://docs.google.com/viewer?url=' . $url . '&embedded=true\" style=\"width:' .$width. '; height:' .$height. ';\">Your browser does not support iframes</iframe>';\n}", "function ncg_embed_html($html, $url, $attr, $post_id) {\n\t\treturn '<div class=\"embed-container\">' . $html . '</div>';\n\t}", "function wpcom_vimeo_embed_url( $matches, $attr, $url ) {\n\treturn vimeo_shortcode( array( $url ) );\n}", "protected function iframe($callback, array $data)\n {\n $this->getLayout()\n ->setRendered()\n ->setBody('<script type=\"text/javascript\">window.parent.' . $callback . '(' . json_encode($data) . ');</script>');\n }", "function wpg_rwd_video_container($html, $url='') {\n\t\n\t$wrapped = '<div class=\"fluid-width-video-wrapper\">' . $html . '</div>';\n\t\n\tif ( empty( $url ) && 'video_embed_html' == current_filter() ) { // Jetpack\n\t\t$html = $wrapped;\n\t} elseif ( !empty( $url ) ) {\n\t\t$players = array( 'youtube', 'youtu.be', 'vimeo', 'dailymotion', 'hulu', 'blip.tv', 'wordpress.tv', 'viddler', 'revision3' );\n\t\tforeach ( $players as $player ) {\n\t\t\tif ( false !== strpos( $url, $player ) ) {\n\t\t\t\t$html = $wrapped;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn $html;\n}", "function embed( $id, $width ) {\n\t\t\t$height\t= round($width / 1.32) + 34;\n\n\t\t\treturn '<iframe src=\"http://www.slideshare.net/slideshow/embed_code/'.$id.'\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe><br/><br/>';\n\t\t}", "function OpenURL(string $url): void { }", "public function pre_output_sample_html_iframe()\n\t{\n\t\t$mapping = new email_template_mapping(array('id' => $this->mid));\n\t\t$account = product::get_account($mapping->department, $this->aid);\n\t\t$external_data = array(\n\t\t\t'[first_month_charge]' => util::format_dollars(sbs_lib::get_recurring_amount($account))\n\t\t);\n\t\t$fields = $this->tpl->apply($account, $mapping, $external_data, true);\n\t\techo $fields['html'];\n\t\texit;\n\t}", "public function url($value) {\n if($this->cfi->json_object['fields'][$this->field]['type'] = 'iframe') {\n $this->cfi->json_object['fields'][$this->field]['iframe_url'] =$value;\n } else {\n $this->cfi->json_object['fields'][$this->field]['url'] =$value;\n }\n return $this;\n }", "public function render($pid, $dsid) {\n $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $pid . '/ilives:viewerSdef/getViewer?dsid=' . $dsid;\n return '<iframe src=\"' . $viewer_url . '\" frameborder=\"0\" style=\"width: 100%; height: 835px;\" scrolling=\"no\">Errors: unable to load viewer</iframe>';\n }", "public function showIframe($id){\n\n $iframe = Iframe::where('id', $id)->get();\n foreach ($iframe as $value) { \n $jsoniframe['id'] = $value->id; /*Titulo del Iframe */\n $jsoniframe['iframeid'] = $value->iframeid; /*Titulo del Iframe */\n $jsoniframe['iframe'] = $value->iframe; /* Iframe en codigo */\n }\n return Response::json($jsoniframe); \n\n // echo json_encode($jsoniframe);\n \n }", "public function showSeason($url)\n {\n $season = Season::where('url', $url)->first();\n if(empty($season)){\n abort(404, 'Invalid URL');\n }\n $episodes = $season->episodes;\n $episodes_list = view('partials.episodes_list', compact('episodes'));\n return view('season_detail', compact('season', 'episodes_list'));\n }", "public function getIframeUrl()\n {\n\n if (!($quote = Mage::getSingleton('checkout/session')->getQuote()) \n or !($payment = $quote->getPayment())\n or !($paymentMethod = $payment->getMethod())\n or ($paymentMethod !== 'bitpay')\n or (Mage::getStoreConfig('payment/bitpay/fullscreen')))\n {\n return 'notbitpay';\n }\n\n \\Mage::helper('bitpay')->registerAutoloader();\n\n // fullscreen disabled?\n if (Mage::getStoreConfig('payment/bitpay/fullscreen'))\n {\n return 'disabled';\n }\n\n if (\\Mage::getModel('bitpay/ipn')->getQuotePaid($this->getQuote()->getId())) {\n return 'paid'; // quote's already paid, so don't show the iframe\n }\n\n /*** @var Bitpay_Core_Model_PaymentMethod ***/\n $method = $this->getQuote()->getPayment()->getMethodInstance();\n\n $amount = $this->getQuote()->getGrandTotal();\n\n if (false === isset($method) || true === empty($method)) {\n \\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');\n throw new \\Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');\n }\n\n $bitcoinMethod = \\Mage::getModel('bitpay/method_bitcoin');\n\n try {\n $bitcoinMethod->authorize($payment, $amount, true);\n } catch (\\Exception $e) {\n \\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): failed with the message: ' . $e->getMessage());\n \\Mage::throwException(\"Error creating BitPay invoice. Please try again or use another payment option.\");\n return false;\n }\n\n return $bitcoinMethod->getOrderPlaceRedirectUrl();\n }", "public function render($url) {\n \treturn file_get_contents($url);\n }", "function fa_iframe_admin_page_url( $slug, $args = array(), $echo = true ){\n\t\n\t$args = array_merge( array(\n\t\t'fapro_inline' => 'true'\n\t), $args );\n\t\n\t$page_url = menu_page_url( $slug, false );\n\tif( defined('DOING_AJAX') && DOING_AJAX ){\n\t\t$page_url = 'admin.php?page=' . $slug;\t\t\n\t}\n\t\n\t$url = add_query_arg( $args, $page_url);\n\t\n\tif( $echo ){\n\t\techo $url;\n\t}\t\n\treturn $url;\n\t\n}", "function oembed_video_container( $html, $url, $attr, $post_id ) {\n return '<div class=\"embed__container\">' . $html . '</div>';\n}", "function createTranspage($langlink) {\r\n\t//$gourl = \"?file=\".$langlink.\"&redirect=\".$pageurl;\r\n\t$gourl = \"?file=\".$langlink;\r\n\t$gourl = KT_BLOGURL.\"/wp-content/plugins/kish-translate-ajax/createp.php\".$gourl;\r\n\tprint \"<iframe src=\\\"\".$gourl.\"\\\" width=\\\"0\\\" height=\\\"0\\\" border=\\\"0\\\"></iframe>\";\r\n}", "function jumpoff_vid_embed($html, $url, $attr, $post_id) {\n return '<div class=\"flex-vid\">' . $html . '</div>';\n}", "function RAS_chatWindow()\n{\n\t$user = RAS_getChatUser();\n\t$httpPass = RAS_gethttpPassword();\n\t$chatPass = HELPER_md5x5($httpPass);\n\t\n\techo('<iframe src=\"https://'.$user.':'.$httpPass.'@ras.goos-habermann.de:777/chat/?user='.$user.'&pass='.$chatPass.'\" width=\"90%\" height=\"450\"></iframe>');\n}", "public function webInfo(string $url)\n {\n try {\n $info = (new Embed())->get($url);\n $webInfo = $info->code->html;\n } catch (\\Exception $e) {\n return;\n }\n\n if ($webInfo == null) {\n return '<div style=\"max-width:80%;\">'.$info->description.'</div>';\n }\n\n return $webInfo;\n }" ]
[ "0.6545039", "0.63437", "0.63339585", "0.62844926", "0.62663734", "0.62196755", "0.6153432", "0.61122406", "0.6076539", "0.5976733", "0.59069717", "0.5892645", "0.58755964", "0.58519477", "0.577701", "0.572977", "0.57201195", "0.57175493", "0.5717422", "0.56886274", "0.56617117", "0.5650353", "0.56340855", "0.5604407", "0.5595554", "0.5592107", "0.5583373", "0.55414003", "0.55191547", "0.5489775", "0.548075", "0.54796606", "0.5479256", "0.5476924", "0.5473746", "0.5469748", "0.54513466", "0.54493237", "0.54191357", "0.5416509", "0.53891563", "0.5343662", "0.5340554", "0.5338111", "0.53331465", "0.5316638", "0.5304712", "0.529782", "0.5297521", "0.5283387", "0.52789587", "0.52738506", "0.526546", "0.5264838", "0.5247291", "0.5222155", "0.52177477", "0.520318", "0.5196096", "0.51823556", "0.5182177", "0.5178156", "0.5174083", "0.51656383", "0.51630074", "0.5155757", "0.51527697", "0.51441514", "0.51424426", "0.5140035", "0.5135459", "0.51277465", "0.5127525", "0.5111056", "0.5109788", "0.51087207", "0.51067674", "0.50999117", "0.50938", "0.50903803", "0.5081375", "0.50800717", "0.5079583", "0.50762653", "0.50719833", "0.50662935", "0.5066036", "0.50627536", "0.5060535", "0.5053202", "0.50480723", "0.5047139", "0.50448614", "0.5032876", "0.50254077", "0.50249755", "0.50100815", "0.5001983", "0.49993882", "0.49965188" ]
0.82807416
0
Before rendering, set the language to the global post lang
До рендеринга установите язык в глобальный язык поста
public static function setLang() { if (function_exists("pll_is_translated_post_type") && isset($GLOBALS["post"]->post_type) && pll_is_translated_post_type($GLOBALS["post"]->post_type)) { Lang::switchTo(Lang::ofPost($GLOBALS["post"]->ID)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function settingLanguage() {}", "protected function setLangCode()\n {\n $this->page->setVar('langCode', $this->text->getLanguage());\n }", "private function _set_lang() {\n\t\t$this->language = $this->config->item('language');\n\t\t$this->session->set_userdata('language', $this->language);\n\t\t$this->lang->load('template', $this->session->userdata('language'));\n\t}", "public function setLanguage();", "function set_language()\n{\n if (count($GLOBALS['url_parts']))\n {\n if (array_key_exists($GLOBALS['url_parts'][0], $_SESSION['translations']))\n {\n $GLOBALS['lang'] = array_shift($GLOBALS['url_parts']);\n return;\n }\n }\n $GLOBALS['lang'] = 'en';\n}", "function init(){\n if( Yii::$app->user->isGuest ){\n Yii::$app->getResponse()->redirect(array('/df/logout',302));\n Yii::$app->end();\n }\n parent::init();\n\n\n \n if( isset($_REQUEST['_lang']) ){\n Yii::$app->language = $_REQUEST['_lang'];\n Yii::$app->session['_lang'] = Yii::$app->language;\n }else if( isset(Yii::$app->session['_lang']) ){\n Yii::$app->language = Yii::$app->session['_lang'];\n }else{\n Yii::$app->language = 'es_ve';\n Yii::$app->session['_lang'] = Yii::$app->language;\n }\n }", "function init(){\n parent::init();\n if( isset($_REQUEST['_lang']) ){\n Yii::$app->language = $_REQUEST['_lang'];\n Yii::$app->session['_lang'] = Yii::$app->language;\n }else if( isset(Yii::$app->session['_lang']) ){\n Yii::$app->language = Yii::$app->session['_lang'];\n }else{\n Yii::$app->language = 'es_ve';\n Yii::$app->session['_lang'] = Yii::$app->language;\n }\n }", "public function set_locale( $locale ) {\n\t\tglobal $wp_rewrite, $bbl_languages;\n\t\t\n\t\t// Deal with the special case of wp-comments-post.php\n\t\tif ( false !== stristr( $_SERVER[ 'REQUEST_URI' ], 'wp-comments-post.php' ) ) {\n\t\t\tif ( $comment_post_ID = ( isset( $_POST[ 'comment_post_ID' ] ) ) ? (int) $_POST[ 'comment_post_ID' ] : false ) {\n\t\t\t\t$this->set_lang( bbl_get_post_lang_code( $comment_post_ID ) );\n\t\t\t\treturn $this->lang;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( isset( $this->lang ) )\n\t\t\treturn $this->lang;\n\t\tif ( is_admin() ) {\n\t\t\t// @FIXME: At this point a mischievous XSS \"attack\" could set a user's admin area language for them\n\t\t\tif ( isset( $_GET[ 'lang' ] ) ) {\n\t\t\t\t$this->set_lang( $_GET[ 'lang' ] );\n\t\t\t} else {\n\t\t\t\t// $current_user = wp_get_current_user();\n\t\t\t\tif ( $lang = $this->get_cookie_lang() )\n\t\t\t\t\t$this->set_lang( $lang );\n\t\t\t}\n\t\t} else { // Front end\n\t\t\t// @FIXME: Should probably check the available languages here\n\t\t\tif ( preg_match( $this->lang_regex, $this->get_request_string(), $matches ) )\n\t\t\t\t$this->set_lang_from_prefix( $matches[ 0 ] );\n\t\t}\n\t\tif ( ! isset( $this->lang ) || ! $this->lang )\n\t\t\t$this->set_lang( bbl_get_default_lang_code() );\n\t\treturn $this->lang;\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Plus_admin_i18n();\n\n\t\t$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "protected function set_locale() {\n\n\t\t$this->plugin_i18n = new WP_Masonry_Grid_i18n();\n\t\t$this->plugin_i18n->set_domain( $this->get_plugin_name() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $this->plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Dsm_Supreme_Modules_Pro_For_Divi_i18n();\n\n\t\t$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "protected function _setupLanguage()\n\t{\n\t\t$Translation = ClassRegistry::init('Translations.Translation');\n\n\t\t// read active translation from cookies\n\t\t$translationId = $this->Cookie->read('Config.translation_id');\n\n\t\t// if we have not active translation read default translation from settings\n\t\tif (empty($translationId)) {\n\t\t\t$translationId = Configure::read('Eramba.Settings.DEFAULT_TRANSLATION');\n\t\t}\n\n\t\t$translation = $Translation->getTranslation($translationId);\n\n\t\tif (!empty($translation) && $translation['Translation']['status'] == Translation::STATUS_ENABLED) {\n\t\t\t$translation = $Translation->getItemDataEntity($translation);\n\n\t\t\t$translationId = $translation->getPrimary();\n\t\t\t$lang = $translation->getTranslationName();\n\t\t}\n\t\telse {\n\t\t\t// fallback\n\t\t\t$translationId = Translation::DEFAULT_TRANSLATION_ID;\n\t\t\t$lang = Translation::DEFAULT_TRANSLATION_NAME;\n\t\t}\n\n\t\t// extend translation cookie if its not an api request\n\t\tif (!$this->controller->request->is('api')) {\n\t\t\t$this->writeTranslationToCookies($translationId);\n\t\t}\n\n\t\tConfigure::write('Config.translation_id', $translationId);\n\t\tConfigure::write('Config.language', $lang);\n\n\t\t// translation is not in l10n catalog (i18n in using this l10n class) so we need to rewrite default fallback\n\t\tI18n::getInstance()->l10n->default = $lang;\n\t}", "private function _setLanguage() {\n\t\tif (Configure::read('Config.language') != $this->params['language']) {\n\t\t\tConfigure::write('Config.language', $this->params['language']);\n\t\t}\n\t\tif(!$this->Session->read('Config.language')) {\n\t\t\t$this->Session->write('Config.language', $this->params['language']);\n\t\t}\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Conductor_i18n();\n\t\t$plugin_i18n->set_domain( $this->get_plugin_name() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "function set_lang(string $lang) {\n global $default_language;\n $default_language = $lang;\n}", "function getDefaultLanguage(){\n return 'en';\n }", "public function detectLanguage()\n {\n\tif(!isset(Yii::$app->translang)) {\n\t Yii::$app->set('translang', 'en');\n\t}\n }", "public function setLanguage($lang = ''){\n $this->_pageTpl->setVar('LANG', $lang);\n }", "public function setLang(){\n\t\t\tif(array_key_exists($_SERVER['HTTP_HOST'],$this->_aParams['lang'])){\n\t\t\t\t$this->_sLang = $this->_aParams['lang'][$_SERVER['HTTP_HOST']];\n\t\t\t}else $this->_sLang = $this->_aParams['lang']['default'];\n\t\t\t$this->_oSession->addToSession('lang',$this->_sLang);\n\t\t}", "protected function setTranslation() {\n $application = $this->step->chain->page->application;\n $application_language = ApplicationLanguage::find()->where([\n 'application_id' => $application->id\n ])->one();\n\n if (empty($application_language)) {\n return;\n }\n\n $step_part_language = StepPartLanguage::find()->where([\n 'step_part_id' => $this->id,\n 'application_language_id' => $application_language->id\n ])->one();\n\n if (empty($step_part_language)) {\n $step_part_language = new StepPartLanguage();\n $step_part_language->step_part_id = $this->id;\n $step_part_language->application_language_id = $application_language->id;\n }\n\n $this->step_part_language = $step_part_language;\n }", "function the_language_locale($return = false) {\r\n\tglobal $post;\r\n\r\n\tif ($return) return $post->locale;\r\n\telse echo $post->locale;\r\n}", "public function setup_locale()\n {\n }", "public function init()\n {\n parent::init(); // TODO: Change the autogenerated stub\n Yii::$app->language = Yii::$app->request->get('lang');\n\n }", "protected function setLanguageKeys() {}", "public function init()\n {\n Yii::$app->language = Yii::$app->sourceLanguage; // Force the language back to the source language.\n \n parent::init();\n }", "public static function setLanguage() {\n $lang = new Lanugage_Change();\n $ci = & get_instance();\n $ci->language = $lang->getLanguage();\n $ci->config->set_item('language', $ci->language);\n $ci->lang->load('admin/admin', $ci->language);\n }", "private function set_locale()\n\t{\n\n\t\t$plugin_i18n = new JiangQie_API_i18n();\n\n\t\t$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');\n\t}", "function setLang($lang)\n{\n}", "function setLang ($lang);", "protected static function setLanguageKeys() {}", "private function setLocale()\n {\n $this->file->setLocale(\n session('statamic.cp.selected-site') ?\n Site::get(session('statamic.cp.selected-site'))->locale() :\n Site::current()->locale());\n }", "function wp_set_lang_dir()\n{\n}", "function set_lang($newlang) {\n $this->lang = $newlang;\n }", "function sb_language( $page =\"\") {\n\t\tglobal $lang_string;\n\t\t\t\n\t\t// Language: Malay\n\t\t$lang_string['language'] = 'malay';\n\t\t\n\t\t$lang_string[ 'locale' ] = array('ms_MY','malay');\n\t\t$lang_string['rss_locale'] = 'ms-MY'; // New 0.4.8\n\t\t\n\t\t// ISO Charset: ISO-8859-1\n\t\t$lang_string['html_charset'] = 'ISO-8859-1';\n\t\t$lang_string['php_charset'] = 'ISO-8859-1';\n\t\t\n\t\tsetlocale(LC_TIME, $lang_string['locale'] ); // <-- New 0.3.7\n\t\t\n\t}", "function setLanguage( $lang )\n\t{\n\t\t//Set the language in the class\n\t\t$conf =& JFactory::getConfig();\n\t\t$conf->setValue('config.language', $lang);\n\n\t\t//set language debug\n\t\t$lang =& JFactory::getLanguage();\n\t\t$lang->setDebug($this->getCfg('debug_lang'));\n\n\t\t//define date formats\n\t\tdefine('DATE_FORMAT_LC' , JText::_('DATE_FORMAT_LC' ));\n\t\tdefine('DATE_FORMAT_LC2', JText::_('DATE_FORMAT_LC2'));\n\t\tdefine('DATE_FORMAT_LC3', JText::_('DATE_FORMAT_LC3'));\n\t\tdefine('DATE_FORMAT_LC4', JText::_('DATE_FORMAT_LC4'));\n\n\t\t// create the backward compatible language value for old 3PD components\n\t\t$GLOBALS['mosConfig_lang'] = $lang->getBackwardLang();\n\t}", "protected function _assignLanguage() {\n // Assign language from host.\n if(!$this->Cookie->check('language')) {\n if($this->request->env('HTTP_HOST') == \"dev.habbomotel.com\") {\n $this->Cookie->write('language', 'dev');\n } else if(strpos($this->request->env('HTTP_HOST'), \"habbomotel.com\")) {\n $this->Cookie->write('language', 'fr');\n } else if(strpos($this->request->env('HTTP_HOST'), \"habbomotel.in\")) {\n $this->Cookie->write('language', 'pt');\n } else {\n $this->Cookie->write('language', 'fr');\n }\n }\n\n // Display language and set timezone.\n if($this->Cookie->read('language') == \"fr\") {\n I18n::setLocale('fr_FR');\n\n // User have french language but it's on habbomotel.in\n if(!strpos($this->request->env('HTTP_HOST'), \"habbomotel.com\")) {\n $this->Cookie->delete('language');\n die(header(\"location: http://habbomotel.com\"));\n }\n\n } else if($this->Cookie->read('language') == \"pt\") {\n I18n::setLocale('pt_PT');\n //$this->Cookie->write('language', 'fr');\n\n // User have french language but it's on habbomotel.com\n if(!strpos($this->request->env('HTTP_HOST'), \"habbomotel.in\")) {\n $this->Cookie->delete('language');\n die(header(\"location: http://habbomotel.in\"));\n }\n } else if($this->Cookie->read('language') == \"dev\") {\n I18n::setLocale('tr_TR');\n } else {\n I18n::setLocale('fr_FR');\n }\n }", "function initLanguage(){\r\t\t$currentLocale = get_locale();\r\t\tif(!empty($currentLocale)) {\r\t\t\t$moFile = dirname(__FILE__) . \"/language/\" . $currentLocale . \".mo\";\r\t\t\tif(@file_exists($moFile) && is_readable($moFile)) load_textdomain('simple-tracking', $moFile);\r\t\t}\r\t}", "private function setLang() {\n\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') :\n\t\t\t$charset = \"\";\n\t\t\t$this->lang = $this->langWIN;\n\t\telse :\n\t\t\t$charset = \".UTF8\";\n\t\tendif;\n\n\t\tputenv(\"LC_ALL=\" . $this->lang . $charset);\n\t\tsetlocale(LC_ALL, $this->lang . \".utf8\",\n $this->lang . \".UTF8\",\n $this->lang . \".utf-8\",\n $this->lang . \".UTF-8\",\n $this->lang);\n\n\t\tbindtextdomain(\"phplogin\", str_replace(\"classes\",\"languages\",dirname(__FILE__)));\n\t\ttextdomain(\"phplogin\");\n\n\t}", "public function loadLocale()\n {\n\n $user = User::getCurrentUser();\n\n if (!$user)\n {\n $locale = Request::header('Locale');\n\n \\Config::set('translatable.locale', $locale);\n }\n else\n {\n if(Request::hasHeader('Locale'))\n {\n $locale = Request::header('Locale');\n }\n else\n {\n $lang = UserLang::Where('user_id', $user->id)->first();\n\n if ($lang) {\n $locale = $lang->lang ? $lang->lang : config('translatable.locale');\n }\n }\n \\Config::set('translatable.locale', @$locale);\n }\n }", "protected function setupMultilingual() {\n // Add a new language.\n ConfigurableLanguage::createFromLangcode('fr')->save();\n }", "public function restore_lang() {\n\t\t$this->set_lang( array_pop( $this->lang_stack ) );\n\t\tset_query_var( 'lang', $this->lang );\n\t}", "function InitModuleLanguage()\n {\n }", "function set_default($lang_default){\r\r\n $this->default_language = $_SESSION[\"translate\"]->default_language = $update[\"default_language\"] = $lang_default;\r\r\n $GLOBALS[\"core\"]->sqlUpdate($update, \"mod_language_settings\");\r\r\n }", "function setUserLanguage($language){\r\r\n $this->current_language = $language;\r\r\n $_SESSION[\"OBJ_user\"]->cookie_write(\"language\", \"current_language\", $language);\r\r\n $this->createDictionary();\r\r\n $GLOBALS[\"CNT_lang\"][\"title\"] = $_SESSION[\"translate\"]->it(\"Your Default Language is Saved\");\r\r\n $GLOBALS[\"CNT_lang\"][\"content\"] = PHPWS_Text::link(\"index.php\", $_SESSION[\"translate\"]->it(\"Return to the user menu\"), \"index\", array(\"module\"=>\"language\",\"lng_usr_op\"=>\"user_admin\"));\r\r\n }", "public function translate_post_action() {\n\t\t?>\n\t\t<label for=\"translate_post_global\">\n\t\t\t<input type=\"checkbox\" name=\"_translate_post_global\" value=\"1\" id=\"translate_post_global\" />\n\t\t\t<?php esc_html_e( 'Translate post', 'shiro-admin' ); ?>\n\t\t</label>\n\t\t<?php\n\t}", "public function setLanguage($value);", "function the_language($return = false) {\r\n\tglobal $post;\r\n\r\n\tif ($return) return $post->language;\r\n\telse echo $post->language;\r\n}", "function init()\n\t{\n\t\tparent::init();\n\n\t\t// TODO: Change this to a DB model which will take into account additional languages rather than just the preferred. E.g. en-US -> en\n\t\tif (isset($_POST['_lang']))\n\t\t{\n\t\t\tYii::app()->session['_lang'] = $_POST['_lang'];\n\t\t}\n\t\tYii::app()->language = isset(Yii::app()->session['_lang']) ? Yii::app()->session['_lang'] : Yii::app()->request->getPreferredLanguage();\n\t}", "function init_locale() {\n \n // Used when application is initialized from command line (we don't have\n // all the classes available)\n if(!class_exists('ConfigOptions') || !class_exists('UserConfigOptions')) {\n return true;\n } // if\n \n $logged_user =& get_logged_user();\n \n $language_id = null;\n if(instance_of($logged_user, 'User')) {\n if(LOCALIZATION_ENABLED) {\n $language_id = UserConfigOptions::getValue('language', $logged_user);\n } // if\n \n $format_date = UserConfigOptions::getValue('format_date', $logged_user);\n $format_time = UserConfigOptions::getValue('format_time', $logged_user);\n } else {\n if(LOCALIZATION_ENABLED) {\n $language_id = ConfigOptions::getValue('language');\n } // if\n \n $format_date = ConfigOptions::getValue('format_date');\n $format_time = ConfigOptions::getValue('format_time');\n } // if\n \n $language = new Language();\n \n // Now load languages\n if(LOCALIZATION_ENABLED && $language_id) {\n $language = Languages::findById($language_id);\n if(instance_of($language, 'Language')) {\n $current_locale = $language->getLocale();\n \n $GLOBALS['current_locale'] = $current_locale;\n $GLOBALS['current_locale_translations'] = array();\n \n if($current_locale != BUILT_IN_LOCALE) {\n setlocale(LC_ALL, $current_locale); // Set locale\n $GLOBALS['current_locale_translations'][$current_locale] = array();\n \n $language->loadTranslations($current_locale);\n } // if\n } // if\n } // if\n \n $this->smarty->assign('current_language', $language);\n \n define('USER_FORMAT_DATETIME', \"$format_date $format_time\");\n define('USER_FORMAT_DATE', $format_date);\n define('USER_FORMAT_TIME', $format_time);\n \n return true;\n }", "function setlanguageAction()\n {\n \t$this->view->loginStatus = $this->isLoggedIn();\n \t\n \t$langcode = $this->_request->getParam('lang');\n\t\t$params = str_replace(\",\",\"/\",$this->_request->getParam('params'));\n\t\t\n\t\tif($this->_request->getParam('page') == 'playvideo')\n\t\t{\n\t\t\t$redirectPage = '/'.$this->_request->getParam('contr').'/'.$this->_request->getParam('page').\"/\".$params;\n\t\t} \n \telse\n\t\t{\n\t\t\t$redirectPage = '/'.$this->_request->getParam('contr').'/'.$this->_request->getParam('page');\n\t\t}\n \t\n \t $sess = new Zend_Session_Namespace('UserLanguage');\n\t\t if($sess->isLocked())\n\t\t $sess->unlock();\n\t\t $sess->lang = $langcode;\n\t\t $this->_redirect($redirectPage);\n }", "function GetDefaultLanguage()\n {\n return \"en_US\";\n }", "public function setTemplateVars() {\n $default_source = \"de\";\n $default_target = \"es\";\n $max_time = 0;\n $msg = \"\";\n global $data_dir;\n if ($handle = opendir($data_dir)) {\n while (false !== ($file = readdir($handle))) {\n if (preg_match(\"/([a-z]{2})-([a-z]{2})/\",$file,$match) && filectime(\"$data_dir/$file\") > $max_time) {\n $max_time = filectime(\"$data_dir/$file\");\n $default_source = $match[1];\n $default_target = $match[2];\n }\n }\n }\n \n global $language;\n foreach($language as $code => $name) {\n $lang_info = array(\"code\" => $code, \"name\" => $name);\n $lang_info[\"default_source\"] = ($code == $default_source);\n $lang_info[\"default_target\"] = ($code == $default_target);\n $lang_display[] = $lang_info;\n }\n function cmp($a,$b) {\n return strcmp($a[\"name\"], $b[\"name\"]);\n }\n usort($lang_display, 'cmp');\n $this->template->languages = $lang_display;\n }", "function thistle_set_wp_lang_attrs( $mceInit ) {\n $lang = get_locale();\n $lang = str_replace( '_', '-', $lang );\n\n $mceInit['wp_lang_attr'] = $lang;\n $mceInit['wp_user_lang_attr'] = get_bloginfo( 'language' );\n $mceInit['setup'] = <<<JS\nfunction( editor ) {\n editor.on( 'init', function() {\n var doc = editor.getDoc();\n var dom = editor.dom;\n\n dom.setAttrib( doc.documentElement, 'data-user-lang', editor.getParam( 'wp_user_lang_attr' ) );\n } );\n}\nJS;\n\n return $mceInit;\n }", "function set_default_language($val) {\n if (!transposh_consts::$languages[$val]) {\n $val = \"en\";\n }\n $this->set_value($val, $this->options[DEFAULT_LANG]);\n }", "function initLanguage() {\n\t\t// Set the language\n\t\t// You can set the language like this: plugin.tx_<pluginname>_pi1.language = de\n\t\t// or with the global Setup: config.language = de\n\t\n\t\t// sys_language_mode defines what to do if the requested translation is not found\n\t\t$this->sys_language_mode = $this->conf['sys_language_mode'] ? $this->conf['sys_language_mode'] : $GLOBALS['TSFE']->sys_language_mode;\n\n\t\t$defaultLanguage = ($GLOBALS['TSFE']->config['config']['language'] ? $GLOBALS['TSFE']->config['config']['language'] : $this->sys_language_mode); // Fr�her: 'default';\n\n\t\t$this->LLkey = ($this->conf[\"language\"] ? $this->conf[\"language\"] : $defaultLanguage);\n\t\t//$this->altLLkey = $this->LLkey;\n\n\t\n\t\t\n\t\t// Fills the internal array '$this->langArr' with the available syslanguages\n\t\t$lres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'sys_language',\n\t\t\t'1=1' . $this->cObj->enableFields('sys_language'));\n\n\t\t$this->langArr = array();\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($lres)) {\n\t\t\t$this->langArr[$row['uid']] = $row;\n\t\t}\n\n\t\t// Load Backend-Lables\n\t\t// check if the $GLOBALS[\"LANG\"]-object is available - if not, load it\n\t\t// You can get the BackendLable with $this->getBL(...)\n\t\tif (!is_callable($this->internal['BACKEND_LANG']->sL))\n\t\t{\n\t\t\trequire_once(t3lib_extMgm::extPath('lang').'lang.php');\n\n\t\t\t$this->internal['BACKEND_LANG'] = t3lib_div::makeInstance('language');\n\t\t\t$this->internal['BACKEND_LANG']->lang = $this->LLkey;\n\t\t\t//debug($this->internal['BACKEND_LANG']->sL('LLL:EXT:mm_propman/locallang_db.php:tx_mmpropman_data.previewimage'));\n\t\t}\n\n\t\t// Loads local-language values by looking for a \"locallang.php\" file in the plugin class directory ($this->scriptRelPath) and if found includes it.\n\t\t// Also locallang values set in the TypoScript property \"_LOCAL_LANG\" are merged onto the values found in the \"locallang.php\" file.\n\t\t$this->pi_loadLL();\n\t\t\n\t\t/*\t\t\n\t\tt3lib_div::debug($this->LOCAL_LANG,\"LOCAL_LANG=\");\n\t\t//t3lib_div::debug($this->conf,\"\\$this->conf=\");\n\t\t\n\t\t$basePath = t3lib_extMgm::extPath($this->extKey).dirname($this->scriptRelPath).'/locallang.php';\n\t\t$file = t3lib_div::getFileAbsFileName($basePath);\n\t\t$baseFile = ereg_replace('\\.(php|xml)$', '', $file);\n\t\tt3lib_div::debug($baseFile,\"\\$baseFile=\");\n\t\t$filename = $baseFile . '.xml';\n\t\tt3lib_div::debug(t3lib_div::readLLXMLfile($filename,'default'),\"$baseFile.xml=\");\n\t\t$xmlString = t3lib_div::getUrl($filename);\n\t\tt3lib_div::debug($xmlString,\"\\$xmlString=\");\n\t\t$xmlContent = t3lib_div::xml2array($xmlString);\n\t\tt3lib_div::debug($xmlContent['data']['de'],\"\\$xmlContent['data']['de']=\");\n\t\t$langKey = 'de';\n\t\tt3lib_div::debug(is_string($LOCAL_LANG[$langKey]) && strlen($LOCAL_LANG[$langKey]),\"is_string=\");\n\t\tt3lib_div::debug($this->conf['_LOCAL_LANG.'],\"\\$this->conf['_LOCAL_LANG.']=\");\n\t\tt3lib_div::debug($this->altLLkey,\"\\$this->altLLkey=\");\n\t\tt3lib_div::debug($this->LLkey,\"\\$this->LLkey=\");\n\t\t//typo3conf/l10n/de/mm_hutinfo/pi1/de.locallang.xml\n\t\t*/\n\t\t\n\t\t/*\t\t\n\t\tt3lib_div::debug($this->sys_language_mode,1);\n\t\tt3lib_div::debug($this->LLkey,1);\n\t\tt3lib_div::debug($this->LOCAL_LANG,\"LOCAL_LANG=\");\n\t\tt3lib_div::debug($this->scriptRelPath,1);\n\t\t\n\t\t$basePath = t3lib_extMgm::extPath($this->extKey).dirname($this->scriptRelPath).'/locallang.php';\n\t\t$tempLOCAL_LANG = t3lib_div::readLLfile($basePath,$this->altLLkey);\n\t\tt3lib_div::debug($basePath,1);\n\t\tt3lib_div::debug($tempLOCAL_LANG,1);\n\t\t*/\n\t}", "function init(){\r\r\n if ($cookie_language = $_SESSION[\"OBJ_user\"]->cookie_read(\"language\", \"current_language\")){\r\r\n $test_lang = $this->getRegularLanguages();\r\r\n if ($test_lang[$cookie_language])\r\r\n\t$this->current_language = $cookie_language;\r\r\n else\r\r\n\t$this->current_language = $this->default_language;\r\r\n } else\r\r\n $this->current_language = $this->default_language;\r\r\n }", "protected function before() {\n if ($this->app->param('lang')) {\n $_SESSION['lang'] = $this->param('lang');\n }\n $this->lang = $_SESSION['lang'] ?? $this->app['i18n'];\n\n // theme chooser only for demo\n if ($this->app->param('theme')) {\n $_SESSION['theme'] = $this->param('theme');\n }\n\n }", "private static function draw_language_meta_tag() {\n $blog_language = get_bloginfo('language');\n if (!empty($blog_language)) {\n echo \"<meta name='shareaholic:language' content='\" . $blog_language . \"' />\\n\";\n }\n }", "public function settingLocale() {}", "public function incLocalLang() {}", "public function init()\r\n {\r\n \theader('content-type: text/html; charset=utf8');\r\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n \t$this->tr = Application_Form_FrmLanguages::getCurrentlanguage();\r\n\t}", "public static function getDefaultLanguage() {}", "public function init(){\r\n $this->langs = Yii::app()->params->langs;\r\n }", "function setLangParams()\n\t{\n\t}", "function setLangParams()\n\t{\n\t}", "public function setLocale()\n {\n\n }", "public function lang() {\n\t\tload_plugin_textdomain( 'motopress-cherryframework4', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t}", "protected function setLang($lang) {\n $this->Session->write('Config.language', $lang); // write our language to session\n $this->setCookieLanguage($lang);\n Configure::write('Config.language', $lang); // tell CakePHP that we're using this language \n }", "public function language($lng = null)\n {\n // autorender off for view\n $this->autoRender = false;\n //--------- Post request -----------\n if ($this->request->is('post')) {\n $this->Setting->id = 1;\n $this->request->data['Setting']['language'] = $lng;\n //save settings\n if ($this->Setting->save($this->request->data)) {\n $this->Session->write('Auth.User.language', $this->request->data['Setting']['language']);\n }\n }\n }", "protected function maybe_set_cookie_lang() {\n\t\t// $current_lang = $this->get_lang();\n\t\t// $requested_lang = ( isset( $_GET[ 'lang' ] ) ) ? $_GET[ 'lang' ] : '';\n\t\t// $cookie_lang = $this->get_cookie_lang();\n\t\tif ( $requested_lang = ( isset( $_GET[ 'lang' ] ) ) ? $_GET[ 'lang' ] : false )\n\t\t\tsetcookie( $this->admin_lang_cookie, $requested_lang, time() + 31536000, COOKIEPATH, COOKIE_DOMAIN);\n\t}", "public function init()\r\n {\r\n \theader('content-type: text/html; charset=utf8');\r\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n \t $this->tr = Application_Form_FrmLanguages::getCurrentlanguage();\r\n\t}", "function tandem_set_languages(){\n load_theme_textdomain( 'tandem', get_template_directory() . '/assets/translation' );\n}", "function set_laguage() {\n if(!function_exists(\"gettext\")) die(\"gettext is not enable\");\n \n $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);\n // Processes \\r\\n's first so they aren't converted twice.\n $lang = str_replace(\"-\", \"_\", $lang);\n $lang= trim($lang);\n \n $directory = dirname(__FILE__).'/locale';\n $domain = 'svxportal';\n\n $locale =$lang; //like pt_BR.utf8\";\n if($_SESSION['languge'])\n {\n $locale = $_SESSION['languge'];\n\n }\n \n \n putenv(\"LANG=\".$locale); //not needed for my tests, but people say it's useful for windows\n \n setlocale( LC_MESSAGES, $locale);\n bindtextdomain($domain, $directory);\n textdomain($domain);\n bind_textdomain_codeset($domain, 'UTF-8');\n \n \n}", "public function initializeLanguages() {}", "function roma_header_language() {\n do_action('wpml_add_language_selector');\n}", "protected function _initLanguage()\n\t{\n\t\t$locale = new Zend_Locale();\n\t\t// if locale is 'de_AT' then 'de' will be returned as language\n\t\t$language = $locale->getLanguage();\n\t\t\n\t\t$session = new Zend_Session_Namespace('Default');\n\t\tZend_Registry::set('session', $session);\n\t\tZend_Registry::set('locale', $locale);\n\n\t\tif (isset($session->language)) {} else {\n\t\t\tif (($language == 'fr') || ($language == 'en')) {\n\t\t\t\t//$session->language = $language;\t\t// in the future.....\n\t\t\t\t$session->language = 'fr';\t\t// default language is French\n\t\t\t} else {\n\t\t\t\t$session->language = 'fr';\t\t// default language is French\n\t\t\t}\n\t\t}\n\t}", "private function setLanguage()\n {\n $langs = $this->Admin_model->getLanguages();\n $have = 0;\n $def_lang = $this->config->item('language');\n $def_lang_abbr = $this->def_lang = $this->config->item('language_abbr');\n $this->currency = $this->config->item('currency');\n $this->currencyKey = $this->config->item('currencyKey');\n if ($this->uri->segment(1) == $def_lang_abbr) {\n redirect(base_url());\n }\n foreach ($langs->result() as $lang) {\n $this->all_langs[$lang->abbr]['name'] = $lang->name;\n $this->all_langs[$lang->abbr]['flag'] = $lang->flag;\n if ($lang->abbr == $this->uri->segment(1)) {\n $this->session->set_userdata('lang', $lang->name);\n $this->session->set_userdata('lang_abbr', $lang->abbr);\n $this->currency = $lang->currency;\n $this->currencyKey = $lang->currencyKey;\n $have = 1;\n }\n }\n if ($have == 0)\n $this->session->unset_userdata('lang');\n\n if ($this->session->userdata('lang') !== NULL) {\n $this->lang->load(\"site\", $this->session->userdata('lang'));\n } else {\n $this->session->set_userdata('lang', $def_lang);\n $this->session->set_userdata('lang_abbr', $def_lang_abbr);\n $this->lang->load(\"site\", $def_lang);\n }\n $this->my_lang = $this->session->userdata('lang_abbr');\n $this->my_lang_full = $this->session->userdata('lang');\n\n $this->my_lang != $this->def_lang ? $this->lang_link = $this->my_lang . '/' : $this->lang_link = '';\n }", "function porg_lang_init() {\n global $lang;\n\n /* we need some strings for time_since (Piwigo should have these strings in common.lang.php) */\n if (!isset($lang['%s ago']))\n {\n load_language('admin.lang');\n }\n\n /* Load en_UK translation */\n load_language('plugin.lang', PORG_PATH, array('language' => 'en_UK', 'no_fallback' => true));\n /* Load user language translation */\n load_language('plugin.lang', PORG_PATH);\n\n load_language('urls.lang', PORG_PATH, array('language' => 'en_UK', 'no_fallback' => true));\n load_language('urls.lang', PORG_PATH);\n}", "function set_acf_default_language($set = true)\n {\n global $sitepress;\n\n if ($set === true) {\n if ($sitepress) {\n add_filter(\n 'acf/settings/current_language',\n function ($sitepress) {\n return $sitepress->get_default_language();\n },\n 100\n );\n } elseif (function_exists('pll_current_language')) {\n add_filter(\n 'acf/settings/current_language',\n function () {\n return pll_default_language();\n },\n 100\n );\n } else {\n add_filter('acf/settings/current_language', '__return_false');\n }\n } else {\n if ($sitepress) {\n remove_filter(\n 'acf/settings/current_language',\n function ($sitepress) {\n return $sitepress->get_default_language();\n },\n 100\n );\n } elseif (function_exists('pll_current_language')) {\n remove_filter(\n 'acf/settings/current_language',\n function () {\n return pll_default_language();\n },\n 100\n );\n } else {\n remove_filter('acf/settings/current_language', '__return_false');\n }\n }\n }", "function preset($lang)\n {\n parent::preset($lang);\n // Set top menu\n $data_menu = array();\n $menu = $this->Nodcms_general_model->get_menu();\n $i=0;\n foreach($menu as $item)\n {\n $data_menu[$i] = array(\n 'id'\t=> $item['page_id'],\n 'name' =>$item['title_caption'],\n 'icon' =>$item['menu_icon'],\n 'url' =>substr($item['menu_url'],0,4)==\"http\"?$item['menu_url']:base_url().$lang.\"/\".$item['menu_url'],\n );\n $i++;\n }\n $this->data['data_menu'] = $data_menu;\n\n $this->data['link_contact'] = base_url().$lang.\"/contact\";\n\n $this->data['description'] = isset($this->_website_info[\"options\"][\"site_description\"])?$this->_website_info[\"options\"][\"site_description\"]:\"\";\n }", "function MyApp_Login_Set_User_Language()\n {\n if (method_exists($this,\"FriendsObj\"))\n {\n $this->FriendsObj()->ItemData();\n if (!empty($this->FriendsObj()->ItemData[ \"Language\" ]))\n {\n $clang=$this->CGI_GET(\"Lang\");\n\n if (!empty($clang))\n {\n if ($this->LoginData[ \"Language\" ]!=$clang)\n {\n if (!empty($this->Languages[ $clang ]))\n {\n $this->LoginData[ \"Language\" ]=$clang;\n $this->FriendsObj()->Sql_Update_Item_Value_Set\n (\n $this->LoginData(\"ID\"),\n \"Language\",\n $clang\n );\n }\n }\n }\n \n //Take user language settings.\n if (!empty($this->LoginData[ \"Language\" ]))\n {\n $this->MyLanguage_Set($this->LoginData[ \"Language\" ]);\n }\n }\n }\n }", "function thb_load_admin_translation() {\n\t\t/**\n\t\t * Framework translation\n\t\t */\n\t\tif( defined('QT_SUPPORTED_WP_VERSION') ) {\n\t\t\t// qTranslate\n\t\t\tglobal $q_config;\n\t\t\t$thb_admin_language = $q_config['locale'][$q_config['language']];\n\t\t}\n\t\telse if( defined('ICL_LANGUAGE_CODE') ) {\n\t\t\t// WPML\n\t\t\t$thb_admin_language = get_locale();\n\t\t}\n\t\telse {\n\t\t\t$thb_admin_language = defined( 'WPLANG' ) ? WPLANG : 'en_US';\n\t\t}\n\n\t\t$thb_admin_default_language = 'en_US';\n\n\t\t$thb_admin = thb_theme()->getAdmin();\n\t\t$thb_admin->setLanguage($thb_admin_language);\n\t\t$thb_admin->setDefaultLanguage($thb_admin_default_language);\n\t}", "function get_lang() {\n global $default_language;\n return $default_language;\n}", "public function setLocale()\n {\n // Initialize Locale if set and configured.\n if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {\n $language = $this['language']->getLanguage();\n setlocale(LC_ALL, strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);\n } elseif ($this['config']->get('system.default_locale')) {\n setlocale(LC_ALL, $this['config']->get('system.default_locale'));\n }\n }", "function language(){\n\t\t$locale = get_locale();\n\t\t//echo $locale;\n\t\tload_theme_textdomain( 'ultimatum', THEME_DIR . '/languages' );\n\t\t$locale_file = THEME_DIR . \"/languages/$locale.php\";\n\t\tif ( is_readable( $locale_file ) ){\n\t\t\trequire_once( $locale_file );\n\t\t}\n\t}", "public function page_default_lang()\n\t{\n\t\tFsb::$tpl->set_switch('lang_list');\n\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'LIST_LANG' =>\t\tHtml::list_langs('language', $this->language),\n\t\t\t'INTERVAL' =>\t\t$this->interval,\n\t\t\t'SEARCH' =>\t\t\t$this->search,\n\t\t\t'SEARCH_TYPE_K' =>\t($this->search_type == 'key') ? 'checked=\"checked\"' : '',\n\t\t\t'SEARCH_TYPE_V' =>\t($this->search_type == 'value') ? 'checked=\"checked\"' : '',\n\t\t\t'USE_FTP' =>\t\t(Fsb::$cfg->get('ftp_default')) ? true : false,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=general_lang'),\n\t\t));\n\n\t\t$this->page_print_lang();\n\t}", "function _set_language($language)\n {\n session_name(\"ADM_LANG_SID\");\n session_set_cookie_params(0, $this->_engine_url(), '.' . COOKIE_URL, COOKIE_SECURE);\n\t\tsession_start();\n\n if (empty($_SESSION['alanguage']) && empty($language)\n && !empty($GLOBALS['site_settings']['lang']))\n {\n // get default site language\n $language = $GLOBALS['site_settings']['lang'];\n\n } else if (!empty($language)) {\n // process input language\n $language = $this->_process_language($language);\n\n } else if (!empty($_SESSION['alanguage'])) {\n // get language from session\n $language = $_SESSION['alanguage'];\n\n } else {\n // default language (seems that this core is never executed because default\n // site language always is retrived...)\n $language = $this->_process_language('EN');\n }\n\n $_SESSION['alanguage'] = $language;\n $this->_language = $language;\n }", "function wc_switch_to_site_locale()\n {\n }", "function restore_original_language() {\n\tglobal $post, $translation_flag, $original_object;\n\n\tif ( $translation_flag === true ) {\n\t\t$post = $original_object;\n\t\tsetup_postdata( $post );\n\t\t$translation_flag = false;\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function mwm_wpml_translate_post( $post_id, $post_translated_args, $post_type, $lang ){\r\r\n\r\r\n // Include WPML API\r\r\n include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms-2/inc/wpml-api.php' );\r\r\n\r\r\n\r\r\n // Insert translated post\r\r\n\t$post_translated_args['post_type'] = $post_type;\r\r\n $post_translated_id = wp_insert_post( $post_translated_args );\r\r\n\r\r\n // Get trid of original post\r\r\n $trid = wpml_get_content_trid( 'post_' . $post_type, $post_id );\r\r\n\r\r\n // Get default language\r\r\n $default_lang = wpml_get_default_language();\r\r\n\r\r\n\t$updates = array(\r\r\n\t 'trid' => $trid,\r\r\n\t 'language_code' => $lang,\r\r\n\t 'source_language_code' => $default_lang\r\r\n\t);\r\r\n\t$where = array(\r\r\n\t 'element_type' => 'post_' . $post_type,\r\r\n\t 'element_id' => $post_translated_id\r\r\n\t);\r\r\n\r\r\n // Associate original post and translated post\r\r\n global $wpdb;\r\r\n\t$wpdb->update($wpdb->prefix . 'icl_translations', $updates, $where);\r\r\n\r\r\n // Return translated post ID\r\r\n return $post_translated_id;\r\r\n\r\r\n}", "function getLang(){global $currentLangage;return $currentLangage;}", "function related_post_shortcode_init() {\n\n load_plugin_textdomain('related-post-shortcode', false, basename( dirname( __FILE__ ) ) . '/i18n' );\n}", "private function getLanguage() {\n if (isset($this->params['lang'])) {\n Configure::write('Config.lang', $this->params['lang']);\n $this->set('lang', $this->params['lang']);\n } else {\n $value = $this->request->action;\n if ($value == 'home')\n $this->redirect('/en');\n }\n // cargamos el archivo que contiene las traducciones segun el idioma\n App::import('Vendor', 'language/' . Configure::read('Config.lang'));\n }", "public function init()\r\n\t{\r\n\t\tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\r\n\t\t$tr = Application_Form_FrmLanguages::getCurrentlanguage();\r\n\t}", "public static function wp_switch_locale( $locale ){\n\t\tself::$current_language = $locale;\n\t}", "final protected function syncLang():void\n {\n $lang = $this->db()->lang();\n $current = $this->lang();\n $current = ($lang->isLang($current))? $current:$lang->defaultLang();\n $this->setLang($current);\n }", "public function setLanguage($lang) {\n $this->lang = $lang;\n }", "public function init_lang()\n {\n ZU::load_class('zuizz.lang', 'core');\n $this->lang = new ZULANG ();\n if (isset ($_REQUEST ['ZU_set_lang'])) {\n $this->lang->set_lang($_REQUEST ['ZU_set_lang']);\n\n }\n }", "function i18n() {\n\t$locale = apply_filters( 'plugin_locale', get_locale(), 'tenup-primary-category' );\n\tload_textdomain( 'tenup-primary-category', WP_LANG_DIR . '/tenup-primary-category/tenup-primary-category-' . $locale . '.mo' );\n\tload_plugin_textdomain( 'tenup-primary-category', false, plugin_basename( TENUP_PRIMARY_CATEGORY_PATH ) . '/languages/' );\n}", "public function setLanguage($language) { $this->language = $language ; }" ]
[ "0.76702595", "0.71579987", "0.71208465", "0.70475656", "0.67769945", "0.67394775", "0.6736823", "0.67212933", "0.67091745", "0.67026824", "0.6683688", "0.6585177", "0.6578581", "0.6536657", "0.65187883", "0.6511418", "0.65055555", "0.65040624", "0.64747244", "0.6449866", "0.6418169", "0.63921374", "0.6362112", "0.6355182", "0.633936", "0.6315898", "0.6309623", "0.6296639", "0.6288345", "0.6260582", "0.6235328", "0.62247145", "0.6217333", "0.6209874", "0.62042505", "0.62004757", "0.61894447", "0.61844456", "0.61806333", "0.6176667", "0.616684", "0.6162733", "0.6159555", "0.61585975", "0.6157176", "0.6152347", "0.6142537", "0.61209154", "0.61164343", "0.6114099", "0.610982", "0.6108617", "0.61027634", "0.60973233", "0.60952014", "0.60928375", "0.60906416", "0.6086819", "0.6076908", "0.6064657", "0.6057371", "0.60546637", "0.60541564", "0.6053629", "0.6053629", "0.60480493", "0.6039322", "0.6037809", "0.60265666", "0.6026105", "0.60226095", "0.60195416", "0.6019362", "0.60162145", "0.6012509", "0.6001364", "0.59966826", "0.5995864", "0.598809", "0.598327", "0.5981644", "0.5980445", "0.5976571", "0.597646", "0.59739053", "0.59718615", "0.59582424", "0.5950859", "0.5948393", "0.5943743", "0.594106", "0.5938487", "0.59364265", "0.5934468", "0.5913657", "0.5912794", "0.59014535", "0.58889025", "0.5885737", "0.58845806" ]
0.8047393
0
If this Boolean attribute is set, this option is not checkable. Often browsers grey out such control and it won't receive any browsing event, like mouse clicks or focusrelated ones. If this attribute is not set, the element can still be disabled if one its ancestors is a disabled element.
Если этот булевский атрибут установлен, этот вариант не может быть выбран. Часто браузеры выделяют такой элемент серым цветом, и он не получает никаких событий веб-обозревания, таких как щелчок мышью или события, связанные с фокусом. Если этот атрибут не установлен, элемент всё равно может быть отключен, если один из его предков является отключённым элементом.
public function setDisabledYes() { $this->setAttribute( "disabled"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_disabled();", "public function getDisabledValue() {\n return FALSE;\n }", "public function is_disabled()\n {\n }", "public function is_disabled()\n {\n }", "public function setDisabled($value = TRUE)\n\t{\n\t\t$this->attributes['data-disabled'] = $value ? 'true' : 'false';\n\t\t$this->setReadOnly($value);\n\t\treturn parent::setDisabled($value);\n\t}", "public function isDisabled(): bool\n {\n return false;\n }", "public function isDisabled() {}", "public function isDisabled();", "public function isDisabled();", "public function isDisabled();", "protected function canBeDisabled() : bool {}", "public function disabled(): bool {\n\t\treturn null !== $this->attribute(\"disabled\");\n\t}", "public function isDisabled(): bool\n {\n return $this->isDisabled;\n }", "public function isDisabled()\r\n\t{\r\n\t \treturn (bool) $this->disabled;\r\n\t}", "public function is_disabled()\n {\n }", "public function setIsDisableCapable($flag);", "public function is_disabled()\n\t{\n\t\treturn $this->disabled;\n\t}", "public function isEnabled() {\n return !$this->attrs()->exists(\"disabled\");\n }", "public function isDisabled()\n\t{\n\t\treturn $this->hasAttribute('disabled');\n\t}", "public function isDisableCapable();", "public function getIsDisabled() {}", "public function getDisabled() : bool\n {\n return $this->disabled;\n }", "public function allowDisable()\n {\n return true;\n }", "public function isDisabled(): bool\n {\n return $this->disabled;\n }", "public function isDisabled(): bool\n {\n return $this->disabled;\n }", "public function canDisableField() {\n return false;\n }", "public function getEnabledValue() {\n return TRUE;\n }", "public function isDisabled(): bool;", "public function isDisabled()\n {\n return false; // Always false for user defined functions\n }", "public function isDisabled()\n {\n return $this->disabled;\n }", "public function isDisabled()\n {\n return $this->disabled;\n }", "public function isDisabled()\n {\n return $this->disabled;\n }", "public function disabled(): bool\n {\n return !$this->get('enabled', false);\n }", "public function canDisableField() {\n return true;\n }", "public function isDisabled()\n {\n return intval($this->getProperty('disable')) > 0;\n }", "public function getIsDisabled()\n {\n return $this->isDisabled;\n }", "public function getIsDisabled()\n {\n return $this->isDisabled;\n }", "public function isDisabled()\n {\n return (bool) oxRegistry::getConfig()->getConfigParam(\"blVatIdCheckDisabled\");\n }", "static public function isDisabled();", "public function getDisabled()\n {\n return isset($this->disabled) ? $this->disabled : false;\n }", "public function isActiveOptionDisabled(): bool\n\t{\n\t\treturn 0 === (int) $this->get('presence') || 306 === (int) $this->get('uitype') || $this->isMandatoryOptionDisabled();\n\t}", "public function disabled();", "public function isDisabled()\n {\n return $this->disabled !== 'nej';\n }", "public function get_disabled(){return $this->_disabled; }", "public function isDisabled(): bool\n {\n return (bool)$this->rawData['parameterArray']['fieldConf']['config']['readOnly'];\n }", "public function isMandatoryOptionDisabled(): bool\n\t{\n\t\t$focus = $this->getModule()->getEntityInstance();\n\t\t$compulsoryMandatoryFieldList = $focus->mandatory_fields ?? [];\n\n\t\treturn \\in_array($this->getName(), $compulsoryMandatoryFieldList) || \\in_array($this->get('uitype'), ['4', '70']);\n\t}", "public function disabled(): bool\n {\n return ! $this->enabled();\n }", "function isDisabled() {\n return ($this->version == 'disabled');\n }", "public function canBeDisabledAndEnabled() {}", "public function disabled()\n {\n return ! $this->enabled();\n }", "public function isDisabled(): bool\n {\n if (parent::isDisabled() && 'select' === $this->type) {\n return true;\n }\n\n foreach ($this->options as $option) {\n if ($option['value'] == $this->value && $option['disabled']) {\n return true;\n }\n }\n\n return false;\n }", "public function isDisabled()\n {\n // Disable (if no enabled icons):\n \n if (!$this->getEnabledIcons()->exists()) {\n return true;\n }\n \n // Disable (if no current page):\n \n if (!($page = $this->getCurrentPage(Page::class))) {\n return true;\n }\n \n // Disable (if disabled for page class):\n \n if (in_array(get_class($page), $this->config()->disabled_on)) {\n return true;\n }\n \n // Enable (if sharing is not disabled for page):\n \n return !$page->isSharingDisabled() ? parent::isDisabled() : true;\n }", "protected function canBeEnabled() : bool {}", "public function disabled(bool $value = true): self\n {\n $new = clone $this;\n $new->options['disabled'] = $value;\n return $new;\n }", "public function disabled(bool $value = true): self\n {\n $new = clone $this;\n $new->options['disabled'] = $value;\n return $new;\n }", "public function GetDisabled ();", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function getDisabled()\n {\n return $this->disabled;\n }", "public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }", "public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }", "public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }", "public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }", "public function isPermissionableDisabled() {\n\n return $this->_disabled;\n\n }", "public function SetDisabled ($disabled);", "public function canDisable()\n {\n return !(bool)$this->getDependentModules();\n }", "private function __validate_enabled() {\n if ($this->initial_data[\"enabled\"] !== false) {\n $this->validated_data[\"enabled\"] = \"on\";\n }\n }", "public function setIsDisabled($isDisabled);", "public function is_enabled()\n {\n }", "public function is_enabled()\n {\n }", "public function enabled()\n {\n return(TRUE);\n }", "public function options_disable_xmlrpc() {\n\t\t?>\n\t\t<label for=\"disable_xmlrpc\">\n\t\t\t<input type=\"checkbox\" name=\"disable_xmlrpc\" id=\"disable_xmlrpc\" <?php if(get_option('disable_xmlrpc')) { echo 'checked'; } ?>>\n\t\t\t<?php esc_html_e( 'Disable the XML-RPC standard', HTWP_TEXTDOMAIN ) ?>\n\t\t</label>\n\t\t<p class=\"description\"><?php esc_html_e(\"XML-RPC is a protocol to communicate WordPress with third party services, but also can be a security issue. If you can, we definitely encourage you to deactivate it.\"); ?></p>\n\t\t<?php\n\t}", "public function isDisabled()\n\t{\n\t\tif ($this->_id===null)\n\t\t\treturn false;\n\t\tif (($record=User::model()->findByPk($this->_id))!==null) {\n\t\t\treturn (bool)$record->is_disabled;\n\t\t}\n\t\treturn false;\n\t}", "public function isDisabled()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED;\n }", "public function get_run_if_component_disabled() {\n return true;\n }", "public function is_disabled() {\n\t\treturn $this->status == Notifications::STATUS_READ;\n\t}", "public function is_enabled() {\n\t\treturn true;\n\t}", "public function checkbox_enabled()\n {\n return $this->m_checkbox;\n }", "protected function is_enabled()\n {\n }", "public function setDisabled(?bool $disabled): void {\n\t\t$this->setAttribute(\"disabled\", ($disabled ? \"disabled\" : null));\n\t}", "public function enabled();", "public function enabled();", "public function isDisabled(): ?bool\n {\n return $this->disabled;\n }", "public function is_enabled() {\n return (bool) get_option( $this->field_names['enabled'], false );\n }", "public function shouldRequireEnabledUser() {\n return false;\n }", "public function disabled( $is_disabled = true ) {\n\t\treturn $this->__set( 'disabled', $is_disabled );\n\t}", "public function setEnabledAttribute($value)\n\t{\n\t\tif (empty($value)) {\n\t\t\t$this->attributes['enabled'] = 0;\n\t\t} else {\n\t\t\t$this->attributes['enabled'] = $value;\n\t\t}\n\t}", "function wct_setting_disabled_option( $option = '' ) {\n\tif( ! get_option( $option, false ) ) {\n\t\treturn;\n\t}\n\n\tdisabled( true );\n}", "public function isEnabled() {\n return !($this->hasUAC(DirectoryUAC::ADS_UF_ACCOUNT_DISABLE));\n }", "public function is_enabled()\n {\n }", "public static function disabled()\r\n {\r\n return self::$_disabled;\r\n }", "public function disabled ($key) {\n return (isset($this->conf[$key]) && !$this->conf[$key]['enabled']);\n }", "function _disabledValue($aItem)\n {\n if ($this->_optionType == 'account-settings') {\n $aConf = $GLOBALS['_MAX']['CONF'];\n if ((OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED) && isset($aItem['name']))\n {\n $aNameExploded = explode('_', $aItem['name']);\n $aSettingSection = isset($aNameExploded[0]) ? $aNameExploded[0] : null;\n $aSettingKey = isset($aNameExploded[1]) ? $aNameExploded[1] : null;\n if (isset($aConf[$aSettingSection][$aSettingKey]) && (!OA_Admin_Settings::isConfigWritable())) {\n return true;\n }\n }\n }\n return false;\n }", "protected function _isDisabled(DataObject $row)\n {\n return false;\n }", "public abstract function is_enabled(): bool;", "public static function disable()\n {\n update_option( static::getPrefix() . 'enabled', 0 );\n }", "public function canToggle() {\n return false;\n }" ]
[ "0.71258044", "0.7108483", "0.7097515", "0.70963585", "0.70055336", "0.7002804", "0.6938496", "0.68823326", "0.68823326", "0.68823326", "0.68665457", "0.6839956", "0.6797833", "0.6797533", "0.67964244", "0.67962795", "0.6795166", "0.6781899", "0.67650634", "0.67620367", "0.67608744", "0.6753962", "0.6702446", "0.6691603", "0.6691603", "0.66818184", "0.6677147", "0.6636293", "0.6619519", "0.6608659", "0.6608659", "0.6608659", "0.6598556", "0.6594121", "0.6588265", "0.65875864", "0.65875864", "0.6580048", "0.6567849", "0.64681894", "0.6463056", "0.64603", "0.64222574", "0.64220566", "0.64114726", "0.6378061", "0.6364457", "0.6286589", "0.62621", "0.6257829", "0.6253586", "0.6211157", "0.619266", "0.61916727", "0.61916727", "0.61898947", "0.6187973", "0.6187973", "0.6187973", "0.6187973", "0.6187973", "0.6187973", "0.6180535", "0.6180535", "0.6180535", "0.6180535", "0.6176625", "0.6137905", "0.6127156", "0.6117477", "0.61091083", "0.6074315", "0.6073353", "0.6066403", "0.6052197", "0.6041527", "0.60216224", "0.6015657", "0.59818906", "0.5952813", "0.59525275", "0.59258544", "0.5924042", "0.5921181", "0.5921181", "0.5886587", "0.5884261", "0.58665127", "0.5858511", "0.58438003", "0.58237535", "0.58219594", "0.5819257", "0.581634", "0.5812541", "0.5812213", "0.57958806", "0.57924914", "0.57894635", "0.5785663" ]
0.72373825
0
Add all required services for a provided facility (vet center).
Добавить все необходимые службы для указанного объекта (ветеринарный центр).
public function addRequiredServicesByFacility(EntityInterface $facility_node) { /** @var \Drupal\node\NodeInterface $facility_node */ if ($facility_node->bundle() == 'vet_center' && is_null($facility_node->original)) { // Be sure a given facility has all required services. $required_services = $this->getRequiredServices(); $log_message = 'Created from new parent facility.'; foreach ($required_services as $required_service) { $this->addService($required_service, $facility_node, $log_message); } $vars = [ '%count' => count($required_services), '%title' => $facility_node->getTitle(), ]; // This will be done during migration so log it. $message = $this->t('%count services were queued to be added to %title', $vars); $this->loggerChannelFactory->get('va_gov_vet_center')->info($message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function _initServices();", "abstract public function servicemain();", "public function addservices() {\n\n\n/*\n\tforeach($service as $data) {\n\t\tServices::create()->save($data);\n\t}\n\treturn 'Services Installed';\n*/\n\treturn 'Method not active. See controller for details.';\n\n\t}", "private function registerServices()\n {\n }", "public function addRequiredServicesByTerm(EntityInterface $service_term) {\n /** @var \\Drupal\\taxonomy\\TermInterface $service_term */\n if ($service_term->bundle() === 'health_care_service_taxonomy'\n && $service_term->hasField('field_vet_center_required_servic')) {\n $previously_required = isset($service_term->original) ? $service_term->original->get('field_vet_center_required_servic')->value : 0;\n if ($service_term->get('field_vet_center_required_servic')->value && !$previously_required) {\n $node_storage = $this->entityTypeManager->getStorage('node');\n\n // Get all the vet center node ids.\n $vet_center_query = $node_storage->getQuery();\n $vet_center_nids = $vet_center_query\n ->condition('type', 'vet_center')\n ->execute();\n\n // Get all the facility health service node ids using this term.\n $term_id = $service_term->id();\n $service_query = $node_storage->getQuery();\n $facility_service_nids = $service_query\n ->condition('type', 'vet_center_facility_health_servi')\n ->condition('field_service_name_and_descripti.target_id', $term_id)\n ->execute();\n\n // Load all the facility health service nodes.\n $facility_services = $node_storage->loadMultiple($facility_service_nids);\n $serviced_nids = [];\n\n // Get the id for the vet center referenced in each facility service.\n foreach ($facility_services as $facility_service) {\n /** @var \\Drupal\\node\\NodeInterface $facility_service */\n if ($facility_service->hasField('field_office') && isset($facility_service->get('field_office')->entity)) {\n $serviced_nids[] = $facility_service->get('field_office')->entity->id();\n }\n }\n\n // Remove the vet centers where this service is already present.\n $missing_nids = array_diff($vet_center_nids, $serviced_nids);\n $log_message = 'Created from required VHA health service term.';\n\n // Add each item to the queue for creation.\n $vet_centers = $node_storage->loadMultiple($missing_nids);\n foreach ($vet_centers as $vet_center) {\n $this->addService($service_term, $vet_center, $log_message);\n }\n\n $vars = [\n '%count' => count($vet_centers),\n '%name' => $service_term->get('name')->value,\n ];\n $message = $this->t('%count %name services were queued to be added to Vet Centers.', $vars);\n $this->loggerChannelFactory->get('va_gov_vet_center')->info($message);\n $this->messenger->addStatus($message);\n }\n }\n }", "function ossn_services_init() {\n\t\tossn_register_com_panel('OssnServices', 'settings');\n\t\tossn_register_page('api', 'ossn_services_handler');\n\t\tif(ossn_isAdminLoggedin()) {\n\t\t\t\tossn_register_action('services/admin/settings', OssnServices . 'actions/settings.php');\n\t\t}\n\t\tossn_add_hook('services', 'wall:list:home:item', 'wall_post_album_photos_services');\n\t\tossn_add_hook('services', 'wall:list:home:item', 'wall_post_profile_cphoto_services');\n\t\tossn_add_hook('services', 'wall:list:home:item', 'wall_post_likes_services');\n\t\tossn_add_hook('services', 'wall:list:home:item', 'wall_post_friends_services');\n\t\tossn_add_hook('services', 'wall:list:home:item', 'wall_post_total_comments');\n\t\tif(!ossn_isLoggedin()) {\n\t\t\t\tossn_add_hook('private:network', 'allowed:pages', 'ossn_services_extend_prviatenetwork_pages');\n\t\t}\n}", "public static function services();", "public static function register_services(){\r\n\t\tforeach(self::get_services() as $clases){\r\n\t\t\t$service=self::instantiate($clases);\r\n\t\t\tif(method_exists($service, 'register')){\r\n\t\t\t\t$service->register();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function register_services()\n\t\t{\n\t\t\tif( $this->registered_services )\n\t\t\t\treturn;\n\t\t\t\n\t\t\trequire_once untrailingslashit( dirname( __FILE__ ) ) . '/modules/service.php';\n\t\t\t\n\t\t\t$integration = WPCF7_Integration::get_instance();\n\t\t\t$integration->add_category( 'pdf_forms', __('PDF Forms', 'wpcf7-pdf-forms') );\n\t\t\t\n\t\t\t$this->registered_services = true;\n\t\t\t\n\t\t\t$pdf_ninja_service = $this->load_pdf_ninja_service();\n\t\t\tif( $pdf_ninja_service )\n\t\t\t\t$integration->add_service( $pdf_ninja_service->get_service_name(), $pdf_ninja_service );\n\t\t\t\n\t\t\tdo_action( 'wpcf7_pdf_forms_register_services' );\n\t\t}", "public function addPurchaseService() {\n\t\t$this->dataSource->data = array_merge(array(\n\t\t\t'ccAuthService' => array('run' => 'true'),\n\t\t\t'ccCaptureService' => array('run' => 'true'),\n\t\t), $this->dataSource->data);\n\t}", "protected static function initServices()\n {\n ServiceRegister::registerService(\n TimeProvider::CLASS_NAME,\n function () {\n return TimeProvider::getInstance();\n }\n );\n ServiceRegister::registerService(\n GuidProvider::CLASS_NAME,\n function () {\n return GuidProvider::getInstance();\n }\n );\n ServiceRegister::registerService(\n EventBus::CLASS_NAME,\n function () {\n return EventBus::getInstance();\n }\n );\n ServiceRegister::registerService(\n AsyncProcessService::CLASS_NAME,\n function () {\n return AsyncProcessStarterService::getInstance();\n }\n );\n ServiceRegister::registerService(\n QueueService::CLASS_NAME,\n function () {\n return new QueueService();\n }\n );\n ServiceRegister::registerService(\n TaskRunnerWakeup::CLASS_NAME,\n function () {\n return new TaskRunnerWakeupService();\n }\n );\n ServiceRegister::registerService(\n TaskRunner::CLASS_NAME,\n function () {\n return new TaskRunner();\n }\n );\n ServiceRegister::registerService(\n TaskRunnerStatusStorage::CLASS_NAME,\n function () {\n return new RunnerStatusStorage();\n }\n );\n }", "public function servicios()\r\n\t{\r\n\t}", "protected function defineServices()\n {\n $services = [\n RegistrarContract::class => Registrar::class,\n InvoiceNotifier::class => EmailInvoiceNotifier::class,\n UserRepositoryContract::class => UserRepository::class,\n TeamRepositoryContract::class => TeamRepository::class,\n ];\n\n foreach ($services as $key => $value) {\n $this->app->bindIf($key, $value);\n }\n }", "function wpvr_load_services_init() {\n\t\trequire_once( 'definitions/wpvr.globals.php' );\n\n\t\t/* Wrapping up definitions */\n\t\trequire_once( 'definitions/wpvr.set.before.php' );\n\n\n\t\t/* Including Services definitons */\n\t\trequire_once( 'definitions/wpvr.services.php' );\n\n\t\t/* Definings the plugin default options values */\n\t\trequire_once( 'definitions/wpvr.defaults.php' );\n\n\t\t/* Loading dataFillers presets */\n\t\trequire_once( 'definitions/wpvr.presets.php' );\n\n\t\t/* Wrapping up definitions */\n\t\trequire_once( 'definitions/wpvr.set.after.php' );\n\n\t}", "public static function register_services(){\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate($class);\n if( \\method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "protected function registerServices()\n\t{\n\t\tforeach($this->config->get('application.services') as $service)\n\t\t{\n\t\t\t(new $service($this->container))->register();\n\t\t}\n\t}", "public static function register_services() {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public static function register_services(){\n foreach (self::get_services() as $class ) {\n $service = self::instantiante( $class );\n\n if ( method_exists($service ,'register')) {\n $service->register();\n }\n }\n }", "public function run()\n {\n\n \t$services = array(\n \t\tarray(\n \t\t\t'name' => 'Per Query', \n \t\t\t'fee' => 1500.00,\n \t\t),\n \t\tarray(\n \t\t\t'name' => 'Video Conference', \n \t\t\t'fee' => 2000.00,\n \t\t),\n \t\tarray(\n \t\t\t'name' => 'Office Conference', \n \t\t\t'fee' => 2000.00,\n \t\t),\n \t\tarray(\n \t\t\t'name' => 'Monthly Retainer', \n \t\t\t'fee' => 00.00,\n \t\t),\n \t\tarray(\n \t\t\t'name' => 'Case/Project Retainer', \n \t\t\t'fee' => 00.00,\n \t\t),\n \t);\n\n foreach ($services as $service) {\n \tLegalService::create($service);\n }\n }", "public function taskProjectSetupServices();", "protected static function initServices()\n {\n parent::initServices();\n\n ServiceRegister::registerService(\n Serializer::CLASS_NAME,\n function () {\n return new NativeSerializer();\n }\n );\n\n ServiceRegister::registerService(\n ShopLoggerAdapter::CLASS_NAME,\n function () {\n return LoggerService::getInstance();\n }\n );\n\n ServiceRegister::registerService(\n Configuration::CLASS_NAME,\n function () {\n return ConfigurationService::getInstance();\n }\n );\n\n ServiceRegister::registerService(\n BrandConfigurationService::CLASS_NAME,\n function () {\n return new PacklinkConfigurationService();\n }\n );\n\n ServiceRegister::registerService(\n ShopShippingMethodService::CLASS_NAME,\n function () {\n return new CarrierService();\n }\n );\n\n ServiceRegister::registerService(\n HttpClient::CLASS_NAME,\n function () {\n return new CurlHttpClient();\n }\n );\n\n ServiceRegister::registerService(\n ShopOrderServiceInterface::CLASS_NAME,\n function () {\n return new ShopOrderService();\n }\n );\n\n ServiceRegister::registerService(\n RegistrationInfoServiceInterface::CLASS_NAME,\n function () {\n return new RegistrationInfoService();\n }\n );\n\n ServiceRegister::registerService(\n SystemInfoInterface::CLASS_NAME,\n function () {\n return new SystemInfoService();\n }\n );\n\n ServiceRegister::registerService(\n FileResolverService::CLASS_NAME,\n function () {\n return new FileResolverService(array(\n dirname(__FILE__) . '/../views/brand/countries',\n dirname(__FILE__) . '/../views/countries',\n ));\n }\n );\n }", "protected function registerServices()\n {\n // For standalone package, laravel container does not exist.\n // And cache manager uses container to get the settings.\n // Get the container instance.\n $this->container = Container::getInstance();\n\n // Lumen does not exist. Basic setup require to bootstrap cache.\n // For testing, we only using array driver.\n // The CacheManager creates the cache \"repository\" based on config values\n // which are loaded from the config class in the container.\n $this->container['config'] = [\n 'cache.default' => 'array',\n 'cache.stores.array' => [\n 'driver' => 'array',\n ],\n ];\n\n // Bind Services to IoC container\n $this->bindServicesToContainer();\n\n // Register Cache and Log facades\n $this->registerFacades();\n }", "public function addAuthService() {\n\t\t$this->dataSource->data = array_merge(array(\n\t\t\t'ccAuthService' => array('run' => 'true'),\n\t\t), $this->dataSource->data);\n\t}", "public static function register_services() {\r\n\t\tforeach ( self::get_services() as $class) {\r\n\t\t\t$service = self::instantiate( $class );\r\n\t\t\tif ( method_exists( $service, 'register' ) ) {\r\n\t\t\t\t$service->register();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function register_services(){\n foreach (self::get_services() as $class){\n $service=self::instantiate($class);\n if(method_exists($service,'register')){\n $service->register();\n }\n }\n }", "public function startServices() {\n $services = $this->host->services;\n if ( $services['debug']['active'] ) {\n Debug::$debug = true;\n $this->debug = new Debug( $this->request );\n $this->debug->timer = new Timer( \"total\" );\n $this->debug->timer->start();\n }\n else $this->debug = false;\n\n if ( isset( $services['logger'] ) && $services['logger']['active'] == true ) {\n $this->logger = new Logger( $this->host->domain );\n $this->logger->logEvent( 'Logging service started.' );\n }\n }", "public static function register_services() \n {\n foreach( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public function setServiceData() {\n\t\tswitch ($this->carrierName) {\n\t\t\tcase 'FedEx':\n\t\t\t\tswitch ($this->serviceName) {\n\t\t\t\t\tcase 'FedEx Economy':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx Second Day AM':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx First Overnight':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx Standard Overnight':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx Priority Overnight':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx 1-Day Freight':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx Ground':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('CA','US','ALL'); // Domestic & Intl\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx International First':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx International Economy':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FedEx International Priority':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DHL INTL':\n\t\t\t\tswitch ($this->serviceName) {\n\t\t\t\t\tcase 'EXPRESS 10:30':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express 10:30AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'EXPRESS 12:00':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express 12PM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'EXPRESS 9:00':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express 9AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'EXPRESS WORLDWIDE':\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express Worldwide';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->originCountries = array('CA','US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Canpar':\n\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\tbreak;\n\t\t\tcase 'Canada Post':\n\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\tbreak;\n\t\t\tcase 'Purolator':\n\t\t\t\tswitch ($this->serviceName) {\n\t\t\t\t\tcase 'Purolator Express Envelope U.S.':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope U.S.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Pack':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Pack';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express 10:30AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express 10:30AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Pack 9AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Pack 9AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Envelope International':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope International';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Envelope 9AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope 9AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Ground':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Ground';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Pack U.S.':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Express Pack U.S.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express 9AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express 9AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express International':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express International';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Ground U.S.':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Ground U.S.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Envelope 10:30AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope 10:30AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express U.S.':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Express U.S.';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Envelope':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Pack 10:30AM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Pack 10:30AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express 12PM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Express 12PM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Purolator Express Envelope 12PM':\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\t$this->displayName = 'Express Envelope 12PM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Dicom':\n\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\tbreak;\n\t\t\tcase 'Loomis':\n\t\t\t\t$this->originCountries = array('CA');\n\t\t\t\t$this->destCountries = array('CA');\n\t\t\t\tbreak;\n\t\t\tcase 'USPS':\n\t\t\t\tswitch ($this->serviceName) {\n\t\t\t\t\t// EasyPost integration\n\t\t\t\t\tcase 'Express_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Express';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Priority';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ParcelSelect_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Parcel Select';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ExpressMailInternational_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Express International';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'PriorityMailInternational_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\t$this->displayName = 'Priority International';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// Direct integration\n\t\t\t\t\tcase 'Priority Mail Express':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Large Flat Rate Box':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Medium Flat Rate Box':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Small Flat Rate Box':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Express Legal Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Express Padded Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Legal Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Padded Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Small Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Priority Mail Window Flat Rate Envelope':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('ALL');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UPS':\n\t\t\t\tswitch ($this->serviceName) {\n\t\t\t\t\t// EasyPost integration\n\t\t\t\t\tcase 'Ground_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Ground';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '3DaySelect_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = '3 Day Select';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '2ndDayAirAM_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = '2nd Day Air AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '2ndDayAir_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = '2nd Day Air';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NextDayAirSaver_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Next Day Air Saver';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NextDayAirEarlyAM_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Next Day Air Early AM';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NextDayAir_EP':\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\t$this->displayName = 'Next Day Air';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->originCountries = array('US');\n\t\t\t\t\t\t$this->destCountries = array('US');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->originCountries = array('NONE');\n\t\t\t\t$this->destCountries = array('NONE');\n\t\t\t\tbreak;\n\t\t}\n\t}", "function mainlib_magellan_add_default_services() {\n $services = array(\n array(\"title\" => \"Printing\", \"slug\" => \"printing\", \"default\" => true, \"order\" => 1, \"icon\" => \"fas fa-print\", \"description\" => \"Traditional 8.5×11 document to color photo printing\"),\n array(\"title\" => \"Scanning\", \"slug\" => \"scanning\", \"default\" => true, \"order\" => 4, \"icon\" => \"fas fa-file-pdf\", \"description\" => \"Providing patrons with the ability to scan documents\"),\n array(\"title\" => \"WiFi\", \"slug\" => \"wifi\", \"default\" => true, \"order\" => 3, \"icon\" => \"fas fa-wifi\", \"description\" => \"Free high speed wifi access to the world wide web\"),\n array(\"title\" => \"Faxing\", \"slug\" => \"faxing\", \"default\" => true, \"order\" => 2, \"icon\" => \"fas fa-fax\", \"description\" => \"Sending documents to phone numbers, the old way\")\n );\n\n foreach($services as $service) {\n mainlib_magellan_populate_library_service_term($service);\n }\n}", "protected function registerServices()\r\n\t{\r\n /*\r\n $this->addService('cache', 'snb\\cache\\MemcachedCache')->setArguments(array(\r\n '::config::snb.cache.host',\r\n '::config::snb.cache.port',\r\n '::config::snb.cache.prefix'\r\n ));\r\n\r\n $this->addService('config', 'snb\\config\\CachedConfigSettings')\r\n ->setArguments(array('::service::kernel'))\r\n ->addCall('load', array($this->getConfigName()));\r\n */\r\n\t}", "function __construct(){\r\n \t$this->name = 'Admincenter';\r\n \t//$this->config_file = $GLOBALS['config']['root'].'_services/Admincenter/config.Admincenter.php';\r\n \t$this->ini_file = $GLOBALS['to_root'].'_services/Admincenter/Admincenter.ini';\r\n \tparent::__construct();\r\n // if(isset($this->_setting('loc_file'))) $this->sp->run('Localization', array('load'=>$this->_setting('loc_file')));\r\n \r\n /* -- till db service management works -- */\r\n\t\t\t$this->config['activated_services'] = array('gallery', 'efiling', 'shop', 'user');\r\n\t\t\t$this->config['setup_services'] = array('gallery', 'efiling', 'tags', 'category', 'shop');\r\n\t\t\treturn $this->config['services'] = array(\r\n\t\t\t\t\tarray('id'=>1, 'display'=>'Blog', 'name'=>'blog', 'image'=>'blog_big.png', 'class'=>'Blog', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>2, 'display'=>'Galerie', 'name'=>'gallery', 'image'=>'gallery_big_1.png', 'class'=>'Gallery', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>5, 'display'=>'G&auml;stebuch', 'name'=>'guestbook', 'image'=>'guestbook_big.png', 'class'=>'Guestbook', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>6, 'display'=>'Kommentare', 'name'=>'comments', 'image'=>'comments_big.png', 'class'=>'Comment', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>7, 'display'=>'Rating', 'name'=>'rating', 'image'=>'rating_big.png', 'class'=>'Rating', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>9, 'display'=>'eFiling', 'name'=>'efiling', 'image'=>'efiling_big.png', 'class'=>'eFiling', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>11, 'display'=>'Tags', 'name'=>'tags', 'image'=>'tags_big.png', 'class'=>'Tags', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>12, 'display'=>'Category', 'name'=>'category', 'image'=>'category_big.png', 'class'=>'Category', 'config_hash'=>''),\r\n\t\t\t\t\tarray('id'=>10, 'display'=>'Shop', 'name'=>'shop', 'image'=>'shop_big.png', 'class'=>'Shop', 'config_hash'=>'6177c69fdafd48052b385b0057639bf0'),\r\n\t\t\t\t\tarray('id'=>4, 'display'=>'User', 'name'=>'user', 'image'=>'user_big.png', 'class'=>'User', 'config_hash'=>''));\r\n }", "private function loadServices()\n {\n $this->emailBuilder = $this->container->get('mollie_shopware.components.support.email_builder');\n $this->logger = $this->container->get('mollie_shopware.components.logger');\n $this->mailTransport = $this->container->get('shopware.mail_transport');\n }", "protected function defineServices()\n {\n $services = [\n UserRepositoryContract::class => UserRepository::class,\n TeamRepositoryContract::class => TeamRepository::class,\n ];\n\n foreach ($services as $key => $value) {\n $this->app->bindIf($key, $value);\n }\n }", "private function registerServices()\n {\n //register service providers\n $this->app->register(BackupServiceProvider::class);\n $this->app->register(HtmlServiceProvider::class);\n $this->app->register(JsValidationServiceProvider::class);\n $this->app->register(MediaManagerServiceProvider::class);\n $this->app->register(ScoutServiceProvider::class);\n $this->app->register(TNTSearchScoutServiceProvider::class);\n\n //load facades\n $loader = AliasLoader::getInstance();\n $loader->alias('JsValidator', JsValidatorFacade::class);\n $loader->alias('Form', FormFacade::class);\n $loader->alias('Html', HtmlFacade::class);\n }", "private function registerServices()\n {\n $services = [\n 'array' => PhpArray::class,\n 'central_bank_of_czech_republic' => CentralBankOfCzechRepublic::class,\n 'central_bank_of_republic_turkey' => CentralBankOfRepublicTurkey::class,\n 'currency_converter' => CurrencyConverterApi::class,\n 'currency_layer' => CurrencyLayer::class,\n 'currency_data_feed' => CurrencyDataFeed::class,\n 'cryptonator' => Cryptonator::class,\n 'european_central_bank' => EuropeanCentralBank::class,\n 'fixer' => Fixer::class,\n 'forge' => Forge::class,\n 'google' => Google::class,\n 'national_bank_of_romania' => NationalBankOfRomania::class,\n 'open_exchange_rates' => OpenExchangeRates::class,\n 'russian_central_bank' => RussianCentralBank::class,\n 'webservicex' => WebserviceX::class,\n 'xignite' => Xignite::class,\n 'yahoo' => Yahoo::class,\n ];\n\n foreach ($services as $name => $class) {\n self::register($name, $class);\n }\n }", "public static function registerServices() {\n foreach (self::getServices() as $class) {\n $service = self::instantiate($class);\n $class_methods = get_class_methods($service);\n foreach ($class_methods as $method_name) {\n add_action(\"wp_ajax_$method_name\", array($service, $method_name));\n add_action(\"wp_ajax_nopriv_$method_name\", array($service, $method_name));\n }\n }\n }", "public function addServices($services,$extensions)\n {\n #\n # Login options: Requested services\n #\n if (is_array($services))\n {\n $svcs = $this->createElement('svcs');\n foreach ($services as $service=>$extra)\n {\n $svcs->appendChild($this->createElement('objURI',$service));\n }\n if ((is_array($extensions)) && (count($extensions)>0))\n {\n $svcextension=$this->createElement('svcExtension');\n foreach ($extensions as $extension=>$extra)\n {\n $svcextension->appendChild($this->createElement('extURI',$extension));\n }\n $svcs->appendChild($svcextension);\n }\n $this->login->appendChild($svcs); \n } \n }", "protected static function initServices() {\n\t\tparent::initServices();\n\n\t\tServiceRegister::registerService(\n\t\t\tSerializer::CLASS_NAME,\n\t\t\tfunction () {\n\t\t\t\treturn new NativeSerializer();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tConfiguration::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Config_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopLoggerAdapter::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Logger_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopShippingMethodService::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Shop_Shipping_Method_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopOrderService::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Shop_Order_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tHttpClient::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn new CurlHttpClient();\n\t\t\t}\n\t\t);\n\t}", "public function bindServices()\n\t{\n\t\t// first bind the core services\n\t\tparent::bindServices();\n\n\t\t// Bind extensions / plugins etc...\n\t\t// > Don't leave this empty or the entire\n\t\t// > architecturial (is that even a word?) work \n\t\t// > would be entirely usless :(\n\t}", "public function getServices();", "public function getServices();", "public static function Start()\n {\n\n foreach ( self::get_services() as $class)\n {\n\n $service = self::instantiate( $class );\n\n if ( method_exists( $service , 'register' ) ){\n $service->register();\n }\n\n }\n\n }", "public static function add_features_section($sections)\n {\n }", "protected function registerCoreServices()\n {\n $this['app'] = $this;\n }", "public function facility_add($facility) {\n $facility = json_encode($facility);\n\n $ch = $this->api_connect($this->url . \"facility/add/\");\n $ch = $this->api_options($ch, \"POST\", $facility);\n $response = curl_exec($ch);\n }", "function addFormSvcEntry($defaultjobid, $defaultorgid, &$formsvc) {\n $temparr = array();\n // These were '_raw' prior to 3.0.0.5\n $temparr['districtdb_service___jobid'] = $defaultorgid;\n $temparr['districtdb_service___orgid'] = $defaultjobid;\n $formsvc[] = $temparr;\n}", "public function registerServices() {\n array_walk($this->services, function ( $service ) {\n if ( ! class_exists( $service[0] ) ) {\n throw new Exception( sprintf( 'Service class \\'%s\\' does not exist', $service[0] ));\n }\n\n $class = new \\ReflectionClass( $service[0] );\n\n if ( ! $class->implementsInterface( 'Service' ) ) {\n throw new Exception( sprintf( 'Service class \\'%s\\' does not implement Service interface', $service[0] ));\n }\n\n $class->newInstance( ...$service[1] );\n });\n }", "public function run()\n {\n $services = [\n ['name' => 'HD Live Streaming'],\n ['name' => 'Automatic Archiving'],\n ['name' => 'Ad Free Playback'],\n ['name' => '100 Simultaneous Viewers'],\n ['name' => '500 Simultaneous Viewers'],\n ['name' => 'Unlimited Simultaneous Viewers'],\n ['name' => 'Custom Branded Players'],\n ['name' => 'Real-time Analytics'],\n ['name' => 'Technical Support'],\n ['name' => 'Tons of Features'],\n ['name' => 'Large viewing audiences (5,000+ live viewers)'],\n ['name' => 'High-Throughput Encoding (10Mbps + )'],\n ['name' => '1 Camera + Decoder'],\n ['name' => '4 Cameras + Decoder'],\n ['name' => 'Decoder without Camera'],\n ['name' => 'Full Equipment'],\n ['name' => 'Customized Package'],\n ];\n\n foreach ($services as $key => $service)\n {\n Service::create($service);\n }\n }", "protected function putServices()\n {\n \\lib\\DebugConsole::stampAction( $this->restler );\n\n $services = $this->model->loadServices();\n\n \\lib\\DebugConsole::end();\n\n return new Response( Response::SUCCESS, $services );\n }", "public function run()\n {\n\n\t\t$services= [\n\t\t\t[\n\t 'titre' => 'Installation Prise',\n\t 'categorie' => 'electricite',\n\t 'type' => 'installation',\n\t 'description' => \"Demander une nouvelle installation d'un prise\",\n\t 'prix' => 30,\n\t 'image' => 'reparationPrise.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n\t [\n\t 'titre' => 'Réparation Prise',\n\t 'categorie' => 'electricite',\n\t 'type' => 'depannage',\n\t 'description' => \"Demander une nouvelle installation d'un prise\",\n\t 'prix' => 20,\n\t 'image' => 'reparationPrise.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n\t [\n\t 'titre' => 'Entretien Chaudière ',\n\t 'categorie' => 'chauffage',\n\t 'type' => 'depannage',\n\t 'description' => \"Un entretien régulier garanti votre sécurité\",\n\t 'prix' => 60,\n\t 'image' => 'entretienChaudiere.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n\t [\n\t 'titre' => 'Installation Lampe ',\n\t 'categorie' => 'electricite',\n\t 'type' => 'installation',\n\t 'description' => \"Demander une nouvelle installation d'une lampe\",\n\t 'prix' => 20,\n\t 'image' => 'installerLampe.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n\t [\n\t 'titre' => 'Recharge Gaz ',\n\t 'categorie' => 'climatisation',\n\t 'type' => 'depannage',\n\t 'description' => \"Recharger votre climatiseur en gaz\",\n\t 'prix' => 60,\n\t 'image' => 'recharge_Gaz.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n\t [\n\t 'titre' => 'Réparation Robinet ',\n\t 'categorie' => 'plomberie',\n\t 'type' => 'depannage',\n\t 'description' => \"Demander une intervention pour votre robinet\",\n\t 'prix' => 60,\n\t 'image' => 'réparationRobinet.jpg',\n\t 'created_at' => date(\"Y-m-d H:i:s\"),\n\t 'updated_at' => date(\"Y-m-d H:i:s\")\n\t ],\n \t];\n\n \tforeach($services as $service){\n \t\t// DB::table('services')->insert($service);\n \t\tService::create($service);\n \t}\n\n\n\n\n\n\n\n }", "protected function registerServices()\n {\n foreach (self::$diMap as $serviceKey => $serviceClass) {\n if (is_int($serviceKey)) {\n $this->registerServiceProvider($serviceClass);\n } else {\n $this->registerService($serviceKey, $serviceClass);\n }\n }\n }", "protected function getInstalledServices() {}", "public function load_services()\n {\n $services_dir = dirname(__FILE__).'/lib/services/';\n\n foreach(scandir($services_dir) as $file) {\n\n $class_name = ucfirst(str_replace('.php', '', $file));\n\n if ($class_name == 'Base') continue;\n\n try {\n $result = @include_once($services_dir . $file);\n if ( $result == false ) continue;\n $this->services[$class_name] = false;\n } catch(Exception $e) {}\n\n\n }\n\n }", "public function services($org_id) {\r\n $data['is_admin'] = $this->members_model->is_admin($org_id);\r\n\r\n $data['organisation'] = $this->organisation_model->getorganisationDetails($org_id);\r\n $data['is_admin'] = $this->members_model->is_admin($org_id);\r\n $data['is_member'] = $this->members_model->is_member($org_id);\r\n $this->load->view(\"app/services_list\", $data);\r\n }", "public function useServices() {\n }", "public function run()\n {\n $networking = Service::create([\n 'header' => 'Business card design',\n 'description' => 'We will design and print business cards for your staff.',\n ]);\n $server_maintenance = Service::create([\n 'header' => 'Bulk Printing',\n 'description' => 'We privide bulk printing both in black and color',\n ]);\n $pbx_installation = Service::create([\n 'header' => 'Business Branding',\n 'description' => 'We guide you through branding your business for better exposure',\n ]);\n $supplies = Service::create([\n 'header' => 'Web design',\n 'description' => 'We build websites that match your business needs',\n ]);\n }", "protected function registerBaseServiceProviders()\n {\n $logger = new Logger('system');\n $logger->pushHandler(new StreamHandler($this->getSystemLogPath(), Logger::DEBUG));\n $this->instance(Logger::class,$logger);\n $this->instance('log',$logger);\n $router = new Router($this,new RouteCollection());\n $this->instance(Router::class,$router);\n $this->instance('router',$router);\n }", "function servicesAction()\n {\n $pageTitle = 'Service';\n $servicesLinkStyle = 'selected';\n\n if (isset($_SESSION['user_id'])) {\n $servicesAvailable = Serv::getProducts();\n } else {\n $servicesAvailable = Serv::getProductsIfNotLogger();\n }\n\n require_once __DIR__ . '/../templates/services.php';\n }", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->services[ Injector::class ] = $this->injector;\n\n\t\tforeach ( $this->get_service_classes() as $class ) {\n\t\t\t$this->services[ $class ] = $this->instantiate_service( $class );\n\t\t}\n\n\t\tforeach ( $this->services as $service ) {\n\t\t\tif ( $service instanceof Registerable ) {\n\t\t\t\t$service->register();\n\t\t\t}\n\t\t}\n\t}", "public static function services()\n {\n $service['service1'] = [\n 'title' => [\n 'field_type' => 'text',\n 'value' => null,\n ],\n 'sub_title' => [\n 'field_type' => 'text',\n 'value' => null,\n ],\n 'sub_title3' => [\n 'field_type' => 'text',\n 'value' => null,\n ],\n 'description' => [\n 'field_type' => 'text',\n 'value' => null,\n ],\n 'icon' => [\n 'field_type' => 'text',\n 'value' => null,\n ],\n ];\n return $service;\n }", "public function getServices()\n {\n $domesticArr = $international = $surePost = [];\n if ($this->serviceType == 'domestic' || $this->serviceType == 'Cdomestic' || $this->serviceType == 'both') {\n $hazourdous = $this->dataHelper->checkHazardousShipment();\n if (count($hazourdous) > 0 && $this->getConfigData('groundHazardous')) {\n $domesticArr = [\n 'ups_small_pkg_Ground' => $this->isServiceActive('03'),\n ];\n } else {\n $domesticArr = [\n // Domestic Services //\n 'ups_small_pkg_3_Day_Select' => $this->isServiceActive('12'),\n 'ups_small_pkg_Ground' => $this->isServiceActive('03'),\n 'ups_small_pkg_2nd_Day_Air' => $this->isServiceActive('02'),\n 'ups_small_pkg_2nd_Day_Air_AM' => $this->isServiceActive('59'),\n 'ups_small_pkg_Next_Day_Air' => $this->isServiceActive('01'),\n 'ups_small_pkg_Next_Day_Air_Saver' => $this->isServiceActive('13'),\n 'ups_small_pkg_Next_Day_Air_Early_AM' => $this->isServiceActive('14')\n ];\n }\n if ($this->serviceType == 'Cdomestic') {\n $domesticArr['ups_small_pkg_Standard'] = $this->isServiceActive('11');\n }\n }\n\n if ($this->serviceType == 'international' || $this->serviceType == 'both') {\n $international = [\n //International Services //\n 'ups_small_pkg_3_Day_Select' => $this->isServiceActive('12'),\n 'ups_small_pkg_Standard' => $this->isServiceActive('11'),\n 'ups_small_pkg_Worldwide_Express' => $this->isServiceActive('07'),\n 'ups_small_pkg_Worldwide_Express_Plus' => $this->isServiceActive('54'),\n 'ups_small_pkg_Worldwide_Expedited' => $this->isServiceActive('08'),\n 'ups_small_pkg_Saver' => $this->isServiceActive('65'),\n ];\n }\n\n $planInfo = $this->dataHelper->planName();\n if ($planInfo['planNumber'] != 0 || $planInfo['planNumber'] != 1) {\n $surePost = [\n 'ups_small_surepost_less_than_1LB' => $this->isServiceActive('92'),\n 'ups_small_surepost_1LB_or_greater' => $this->isServiceActive('93'),\n 'ups_small_surepost_bpm' => $this->isServiceActive('94'),\n 'ups_small_surepost_media_mail' => $this->isServiceActive('95'),\n ];\n }\n\n $servicesArr = array_merge($domesticArr, $international, $surePost);\n\n if ((int) $this->getConfigData('UPSGndwithFreight')) {\n $servicesArr['ups_small_pkg_Ground_Freight_Pricing'] = 'yes';\n }\n\n $servicesArr['ups_small_pkg_aditional_handling'] = 'N';\n\n\n return $servicesArr;\n }", "static public function adminServiceAdd() {\n Render::admin_page(\"admin_service_add.php\");\n }", "protected function registerServices()\n {\n // Register IoC bind aliases and singletons\n #$this->app->alias(\\Mrcore\\Components\\Components::class, \\Mrcore\\Components::class)\n #$this->app->singleton(\\Mrcore\\Components\\Components::class, \\Mrcore\\Components::class)\n\n // Register other service providers\n #$this->app->register(\\Mrcore\\Components\\Providers\\OtherServiceProvider::class);\n }", "public function bindServicesIntoContainer()\n {\n $this->app['users.service'] = $this->app->share(function () {\n\n return new Services\\UsersService($this->app[\"db\"],$this->app[\"log\"],array_get($this->app,\"requestUserID\",0 ), array_get($this->app,'token',null));\n });\n\n //Here you can add more sevice instantiations like the user.service above\n\n }", "public function addService()\n {\n // if we have POST data to create a new song entry\n if (isset($_POST[\"submit_add_service\"])) {\n // load model, perform an action on the model\n $services_model = $this->loadModel('ServicesModel');\n $add_service = $services_model->addService( $_POST[\"service_type\"], $_POST[\"service_name\"] ); \n }\n\n // load views. within the views we can echo out $users and $amount_of_users easily\n require 'application/views/_templates/header.php';\n require 'application/views/services/alerts.php';\n require 'application/views/_templates/footer.php';\n\n // where to go after song has been added\n //header('location: ' . ADMIN_URL . '/users/');\n }", "public function addServices(Request $request)\n {\n $response = [];\n\n // first unset all services\n $user = Auth::user();\n\n // then add the new ones, if any\n try {\n if ($request->has('services')) {\n foreach ($request->input('services') as $serviceId) {\n $service = EntityManager::getRepository(Service::class)->find((int) $serviceId);\n $offeredService = new OfferedService($user, $service);\n\n $user->addService($offeredService);\n }\n }\n\n $this->usersRepository->persist($user);\n\n $response['status'] = 'success';\n $response['html'] = view('service_provider.services_list')->render();\n return response()->json($response);\n\n } catch (Exception $e) {\n $response['status'] = 'error';\n $response['error'] = $e->getMessage();\n return response()->json($response);\n }\n }", "public function add_services_meta_boxes() {\n add_meta_box( \"wpwa-services-meta\", \"Service Details\", array( $this, 'display_services_meta_boxes' ), $this->post_type );\n }", "protected function getExtractionServices() {}", "function dispatch() {\r\n \r\n if (PHP_SAPI != 'cli') {\r\n die('Service only callable using CLI');\r\n }\r\n\r\n if (PHP_OS == 'WINNT') {\r\n $lCli = 'php-win.exe %s > nul';\r\n $lExecFunc = function($aCmd) {\r\n if (class_exists('COM')) {\r\n $lShell = new COM('WScript.Shell');\r\n $lShell->Run($aCmd, 0, false);\r\n } else {\r\n exec('start /B '.$aCmd);\r\n }\r\n };\r\n } else {\r\n $lCli = 'php %s > /dev/null';\r\n $lExecFunc = function($aCmd) {\r\n exec($aCmd);\r\n };\r\n }\r\n\r\n define('DS', '/');\r\n define('PS', PATH_SEPARATOR);\r\n \r\n define('CUST_ID', 76); // Enter Customer ID for this installation\r\n define('LANGUAGE', 'en'); // Enter Default Language Code\r\n define('CUST_PATH', 'cust'.DS);\r\n \r\n session_start();\r\n require_once 'inc/cor/include.php';\r\n \r\n $lNow = date('H:i:s');\r\n \r\n $lDat = new CCor_Date();\r\n $lDow = $lDat -> getDow();\r\n $lDowFlag = 1 << $lDow;\r\n \r\n $lSql = 'SELECT DISTINCT(s.mand) FROM al_sys_svc s, al_sys_mand m ';\r\n $lSql.= 'WHERE (s.mand=m.id OR s.mand=0) ';\r\n $lSql.= 'AND (flags &1) ';\r\n $lSql.= 'AND (dow & '.$lDowFlag.') ';\r\n $lSql.= 'AND (running=\"N\") ';\r\n $lSql.= 'AND (from_time<=\"'.$lNow.'\") ';\r\n $lSql.= 'AND (to_time>=\"'.$lNow.'\") ';\r\n $lSql.= 'ORDER BY s.mand';\r\n \r\n $lQry = new CCor_Qry($lSql);\r\n foreach ($lQry as $lRow) {\r\n $lMand = $lRow['mand'];\r\n $lCmd = sprintf($lCli, ' -f cli.php act=svc.run mid='.$lMand);\r\n $lExecFunc($lCmd);\r\n }\r\n exit;\r\n}", "public function makeServices()\n {\n $this->registrars = $this->get('config')->get('registrars');\n\n $instances = array();\n\n foreach ($this->registrars as $provider)\n {\n $instance = new $provider;\n\n $instance->register($this);\n\n $instances[] = $instance;\n }\n\n \n foreach ($instances as $instance) {\n $instance->booted();\n }\n }", "public function getServices()\n {\n $domesticArr = $international = [];\n if ($this->serviceType == 'domestic' || $this->serviceType == 'both') {\n $domesticArr = [\n // Domestic Services //\n 'fedex_small_pkg_3_Day_Select' => $this->isServiceActive('12'),\n 'fedex_small_pkg_Ground' => $this->isServiceActive('03'),\n 'fedex_small_pkg_2nd_Day_Air' => $this->isServiceActive('02'),\n 'fedex_small_pkg_2nd_Day_Air_AM' => $this->isServiceActive('59'),\n 'fedex_small_pkg_Next_Day_Air' => $this->isServiceActive('01'),\n 'fedex_small_pkg_Next_Day_Air_Saver' => $this->isServiceActive('13'),\n 'fedex_small_pkg_Next_Day_Air_Early_AM' => $this->isServiceActive('14')\n ];\n }\n\n if ($this->serviceType == 'international' || $this->serviceType == 'both') {\n $international = [\n //International Services //\n 'fedex_small_pkg_Standard' => $this->isServiceActive('11'),\n 'fedex_small_pkg_Worldwide_Express' => $this->isServiceActive('07'),\n 'fedex_small_pkg_Worldwide_Express_Plus' => $this->isServiceActive('54'),\n 'fedex_small_pkg_Worldwide_Expedited' => $this->isServiceActive('08'),\n 'fedex_small_pkg_Saver' => $this->isServiceActive('65'),\n ];\n }\n\n $servicesArr = array_merge($domesticArr, $international);\n $servicesArr['fedex_small_pkg_aditional_handling'] = 'N';\n return $servicesArr;\n }", "public function addService(EntityInterface $service_term, EntityInterface $facility_node, string $log_message = '') {\n // Add a queue item to be processed on next cron run.\n $service_queue = $this->queueFactory->get('cron_required_service');\n\n $item = new \\stdClass();\n // Unique queue id to use for deduping.\n $item->quid = \"{$service_term->id()}-{$facility_node->id()}\";\n $item->facility_id = $facility_node->id();\n /** @var \\Drupal\\node\\NodeInterface $facility_node */\n $item->published = $facility_node->isPublished();\n $item->section_id = $facility_node->field_administration->target_id;\n $item->moderation_state = $facility_node->get('moderation_state')->value;\n $item->term_id = $service_term->id();\n $item->log_message = $log_message;\n $this->dedupeQueue($service_queue, $item->quid);\n $service_queue->createItem($item);\n }", "protected function getServicesList() {}", "private function addUpdateFacilities(Request $request, $user, $u)\n {\n Log::info('hello' .'facilities ' .$u->id);\n\n //$uf = UserFacility::where('user_id',$u->id)->pluck('id');\n $uf = UserFacility::where('user_id',$u->id)->first();\n Log::info($uf);\n if ($uf) { UserFacility::destroy($uf->id); }\n \n\n // add Primary\n $u->facility()->create([ 'team_id' => $user->current_team_id, \n 'facility_id'=>$request->primary_facility, \n 'primary'=>1, 'supervised'=>1,\n 'modified_by'=>$user->id\n ]);\n \n // add Supervised facility\n if (count($request->supervised_facility)>0) {\n foreach($request->supervised_facility as $f) {\n if ($f['id'] != $request->primary_facility) {\n $u->facility()->create([ \n 'team_id' => $user->current_team_id, \n 'facility_id'=>$f['id'], \n 'primary'=>0, 'supervised'=>1,\n 'modified_by'=>$user->id\n ]);\n } \n }\n }\n }", "public function index() {\n $content = $this->lservice->service_add_form();\n $this->template->full_admin_html_view($content);\n }", "private function registerIntrospectionServices() {\n $this->registerIntrospectionService(self::SERVICE_LIST_METHODS, Value::TYPE_ARRAY, null, self::DESCRIPTION_LIST_METHODS);\n $this->registerIntrospectionService(self::SERVICE_METHOD_SIGNATURE, Value::TYPE_ARRAY, array(Value::TYPE_STRING), self::DESCRIPTION_METHOD_SIGNATURE);\n $this->registerIntrospectionService(self::SERVICE_METHOD_HELP, Value::TYPE_STRING, array(Value::TYPE_STRING), self::DESCRIPTION_METHOD_HELP);\n $this->registerIntrospectionService(self::SERVICE_MULTICALL, Value::TYPE_ARRAY, array(Value::TYPE_ARRAY), self::DESCRIPTION_MULTICALL);\n }", "public function initializeServices(\\Framework\\Base\\CApplication $application)\n\t{\n\t\t//Get arbitrage2 config\n\t\t$config = $application->getConfig();\n\t\tif($config->arbitrage2 && $config->arbitrage2->services)\n\t\t{\n\t\t\t$services = $config->arbitrage2->services;\n\t\t\tforeach($services as $service => $value)\n\t\t\t{\n\t\t\t\tforeach($value as $namespace => $lconfig)\n\t\t\t\t\t$this->createService($application, $service, $namespace, \\Framework\\Config\\CArbitrageConfigProperty::instantiate($lconfig)); //Create service with configuration\n\t\t\t}\n\t\t}\n\t}", "public function addService($package, array $vars=null, $parent_package=null, $parent_service=null, $status='pending')\n {\n if ($vars['use_module'] == 'true') {\n $ptype = $package->meta->producttype;\n\n if ($ptype == 'dedicated-manual') {\n if (!empty($vars['ip'])) {\n $ip = $vars['ip'];\n $this->connect();\n if (!$this->_api->getServerByIP($vars['ip'])) {\n $this->addError('ip', $this->l('error.ip_not_in_db'));\n\n return;\n }\n $this->logInfo(\"Created new service. IP-address of server added: $ip\");\n } else {\n return;\n }\n } elseif ($ptype == 'dedicated-auto') {\n $this->connect();\n $mac = $this->_api->popFromPool((int) ($package->meta->poolfrom), (int) ($package->meta->poolto));\n if (!$mac) {\n $err = 'Automatic provisioning failed: No available servers in pool';\n $this->addError('pool', $err);\n $this->logError($err);\n\n return;\n }\n $hostinfo = $this->_api->getHost($mac);\n $ip = $hostinfo['ip'];\n\n $this->logInfo(\"Created new service. Server $ip moved from pool id: \" . $package->meta->poolfrom . ' to pool id: ' . $package->meta->poolto);\n } elseif ($ptype == 'vps') {\n $this->connect();\n $ip = $this->_api->getFirstAvailableIP($package->meta->subnet);\n if (!$ip) {\n $err = 'Automatic VPS provisioning failed: No IP-addressses available in subnet';\n $this->addError('ip', $err);\n $this->logError($err);\n\n return;\n }\n\n if ($this->_api->ping($ip)) {\n $err = \"Automatic VPS provisioing failed safety check: IP $ip is free according to the database, but responds to ping\";\n $this->addError('ip', $err);\n $this->logError($err);\n\n return;\n }\n\n try {\n $result = $this->_api->addVM([\n 'subnet' => $package->meta->subnet,\n 'ip' => $ip,\n 'hostname' => 'h' . str_replace('.', '-', $ip),\n 'description' => 'Created by Blesta',\n 'module' => (int) ($package->meta->node),\n 'numips' => 1,\n 'datastore' => $package->meta->datastore,\n 'network' => $package->meta->network,\n 'vcpu' => $package->meta->vcpu,\n 'memory' => $package->meta->memory,\n 'disk' => $package->meta->disk\n ]);\n\n if ($result['success']) {\n $this->logInfo(\"Created new VPS with IP-address $ip\");\n } else {\n $err = 'Automatic VPS provisioning failed: ' . print_r($result['errors'], true);\n $this->addError('api', $err);\n $this->logError($err);\n\n return;\n }\n } catch (Exception $e) {\n $err = 'Automatic VPS provisioning failed: ' . $e->getMessage();\n $this->addError('api', $err);\n $this->logError($err);\n\n return;\n }\n }\n\n return [\n [\n 'key' => 'ip',\n 'value' => $ip,\n 'encrypted' => 0\n ]\n ];\n }\n }", "public function addDAW() : void\n\t{\n\t\t$s = new Service('DAW');\n\t\t$this->ServiceList[] = $s;\n\t}", "public static function addService($extKey, $serviceType, $serviceKey, $info)\n {\n if ($serviceType && is_array($info)) {\n $info['priority'] = max(0, min(100, $info['priority']));\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey] = $info;\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['extKey'] = $extKey;\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['serviceKey'] = $serviceKey;\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['serviceType'] = $serviceType;\n // Change the priority (and other values) from $GLOBALS['TYPO3_CONF_VARS']\n // $GLOBALS['TYPO3_CONF_VARS']['T3_SERVICES'][$serviceType][$serviceKey]['priority']\n // even the activation is possible (a unix service might be possible on windows for some reasons)\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['T3_SERVICES'][$serviceType][$serviceKey])) {\n // No check is done here - there might be configuration values only the service type knows about, so\n // we pass everything\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey] = array_merge($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey], $GLOBALS['TYPO3_CONF_VARS']['T3_SERVICES'][$serviceType][$serviceKey]);\n }\n // OS check\n // Empty $os means 'not limited to one OS', therefore a check is not needed\n if ($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['available'] && $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os'] != '') {\n $os_type = TYPO3_OS === 'WIN' ? 'WIN' : 'UNIX';\n $os = GeneralUtility::trimExplode(',', strtoupper($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os']));\n if (!in_array($os_type, $os, true)) {\n self::deactivateService($serviceType, $serviceKey);\n }\n }\n // Convert subtype list to array for quicker access\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['serviceSubTypes'] = [];\n $serviceSubTypes = GeneralUtility::trimExplode(',', $info['subtype']);\n foreach ($serviceSubTypes as $subtype) {\n $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['serviceSubTypes'][$subtype] = $subtype;\n }\n }\n }", "private function getServicesAndModules()\n {\n foreach ($this->sysSb->autoLoadedServices as $className => $fqClassName)\n { \n $this->services[$className] = $this->sysSb->getService($className);\n } \n \n // Instantiate Sys module classes, sessions, caching etc.\n foreach (Ini::$autoLoadedClasses as $className => $fqClassName)\n { \n $this->modules[$className] = new $fqClassName($this->sysSb);\n } \n }", "static public function apiServiceAdd() {\n $status = Validate::parameters($_POST, [\n \"name\" => [\"required\" => true, \"type\" => \"string\"],\n \"short_description\" => [\"required\" => false, \"type\" => \"string\"],\n \"full_description\" => [\"required\" => true, \"type\" => \"string\"],\n \"image\" => [\"required\" => false, \"type\" => \"string\"],\n \"link\" => [\"required\" => false, \"type\" => \"string\"]\n ]);\n \n if($status === true) {\n ServiceAPI::insertService(\n $_POST[\"name\"], \n $_POST[\"short_description\"], \n $_POST[\"full_description\"],\n $_POST[\"image\"],\n $_POST[\"link\"]\n );\n Route::redirect(\"/services/list\");\n } else {\n error_log(\"Failed to create service.\");\n Route::redirect(\"/services/add?error=$status\");\n }\n }", "public function run()\n {\n $services = [\n [ 'name' => 'cucina',\n 'icon_class' => 'fas fa-utensils' \n ],\n\n [ 'name' => 'aria condizionata',\n 'icon_class' => 'fas fa-fan' \n ],\n\n [ 'name' => 'asciugatrice',\n 'icon_class' => 'fas fa-wind' \n ],\n [\n 'name' => 'seggiolone',\n 'icon_class' => 'fas fa-baby'\n ],\n [\n 'name' => 'colazione',\n 'icon_class' => 'fas fa-coffee'\n ],\n [\n 'name' => 'ferro da stiro',\n 'icon_class' => 'fas fa-tshirt'\n ],\n [\n 'name' => 'spazio di lavoro dedicato',\n 'icon_class' => 'fas fa-briefcase'\n ],\n [\n 'name' => 'culla',\n 'icon_class' => 'fas fa-baby-carriage'\n ],\n [\n 'name' => 'self check-in',\n 'icon_class' => 'fas fa-key'\n ],\n [\n 'name' => 'tv',\n 'icon_class' => 'fas fa-tv'\n ],\n [\n 'name' => 'lavatrice',\n 'icon_class' => 'fas fa-soap'\n ],\n [\n 'name' => 'wi-fi',\n 'icon_class' => 'fas fa-wifi'\n ],\n [\n 'name' => 'riscaldamento',\n 'icon_class' => 'fas fa-thermometer-full'\n ],\n [\n 'name' => 'asciugacapelli',\n 'icon_class' => 'fas fa-bell'\n ],\n [\n 'name' => 'allarme antincendio',\n 'icon_class' => 'fab fa-free-code-camp'\n ],\n [\n 'name' => 'bagno privato',\n 'icon_class' => 'fas fa-bath'\n ],\n \n ];\n\n\n $category = [\n ''\n ];\n\n $icon_class = [\n 'fas fa-utensils',//cucina\n 'fas fa-fan' ,//aria condizionata\n 'fas fa-wind',// asciugatrice\n 'fas fa-baby',// seggiolone\n 'fas fa-coffee', // colazione\n 'fas fa-tshirt',// ferro da stiro?? (ho usato una maglietta)\n 'fas fa-briefcase', // spazio di lavoro dedicato\n 'fas fa-baby-carriage', // culla\n 'fas fa-key',// self check-in\n 'fas fa-tv', // tv\n 'fas fa-soap', // lavatrice\n 'fas fa-wifi', //wifi\n 'fas fa-thermometer-full',// riscaldamento\n 'fas fa-bell', //asciugacapelli\n 'fab fa-free-code-camp', //allarme antincendio\n 'fas fa-bath'// bagno privato\n ];\n\n\n\n foreach ($services as $service) {\n\n $newService = new Service();\n\n $newService->name = $service['name'];\n $newService->icon_class = $service['icon_class'];\n\n $newService->save();\n\n }\n \n }", "public function services(){\n $this->View(\"services\");\n }", "public function registerAllComponents(){\n if(!$this->inCLIMode()){ \n $this->instances['Logger'] = Logger::createInstance();\n $this->instances['System'] = System::createInstance();\n $this->instances['Session'] = Session::createInstance($this->envservice->getConfig('session_driver'));\n $this->instances['Response'] = Response::createInstance();\n \t $this->instances['Request'] = Request::createInstance();\n $this->instances['Cache'] = Cache::createInstance($this->envservice->getConfig('app_cache'));\n $this->instances['Router'] = Router::createInstance();\n $this->instances['Validator'] = Validator::createInstance();\n \t $this->instances['File'] = File::createInstance();\n \t $this->instances['Auth'] = Auth::createInstance($this->envservice->getConfig('app_auth'));\n $this->instances['Helpers'] = Helpers::createInstance();\n $this->instances['Mail'] = Mail::createInstance($this->envservice->getConfig('app_mails'));\n $this->instances['TextStream'] = TextStream::createInstance();\n } \n }", "private function add_services_to_context() {\n foreach ($this->services as $class => $info) {\n $injects = $info['props'];\n $this->context .= <<< IF_START\n if (\\$id === \"$class\") {\n \\$proxy = new Proxy{$class}();\n \\$this->objects[\"$class\"] = \\$proxy;\n \\$actual = new $class();\n\nIF_START;\n foreach ($injects as $prop => $id) {\n $this->context .=\n \" \\$actual->$prop = \"\n . \"\\$this->get(\\\"$id\\\");\\n\";\n }\n $this->context .= \" \\$proxy->actual = \\$actual;\";\n $this->context .= \" }\\n\"; // close if statement\n }\n }", "public function run()\n {\n Service::insert([\n 'name' => 'wi-fi'\n ]);\n Service::insert([\n 'name' => 'parcheggio'\n ]);\n Service::insert([\n 'name' => 'lavatrice'\n ]);\n Service::insert([\n 'name' => 'televisore'\n ]);\n Service::insert([\n 'name' => 'aria condizionata'\n ]);\n Service::insert([\n 'name' => 'fumatori'\n ]);\n Service::insert([\n 'name' => 'macchina del caffè'\n ]);\n Service::insert([\n 'name' => 'giardino'\n ]);\n Service::insert([\n 'name' => 'piscina'\n ]);\n Service::insert([\n 'name' => 'animali'\n ]);\n }", "function ossn_services_handler($requests) {\n\t\t(new \\Ossn\\Component\\OssnServices())->handle($requests);\n}", "public function getServices() : array {}", "function af4_service_landing_page() {\n\n\t$sections = get_field( 'sections' );\n\t$output = '<div class=\"service-landing\">';\n\n\tif ( is_array( $sections ) ) {\n\n\t\tforeach ( $sections as $section ) {\n\n\t\t\tif ( array_key_exists( 'acf_fc_layout', $section ) ) {\n\t\t\t\t$type = $section['acf_fc_layout'];\n\t\t\t} else {\n\t\t\t\t$type = '';\n\t\t\t}\n\n\t\t\t// Create classes for section.\n\t\t\t$section_type_class = str_replace( '_', '-', $type );\n\t\t\t$classes = array(\n\t\t\t\t'section',\n\t\t\t\t$section_type_class,\n\t\t\t\t\"columns-{$section['columns']}\",\n\t\t\t);\n\n\t\t\tif ( 'none' !== $section['background_color'] ) {\n\t\t\t\t$classes[] = 'bg-' . $section['background_color'];\n\t\t\t}\n\n\t\t\tif ( true === $section['arrow_group']['show'] ) {\n\t\t\t\t$classes[] = 'flow-arrow';\n\t\t\t\tif ( 'none' !== $section['arrow_group']['border_color'] ) {\n\t\t\t\t\t$classes[] = 'flow-arrow-bdr-' . $section['arrow_group']['border_color'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create section title.\n\t\t\t$title_output = '';\n\t\t\tif ( ! empty( $section['title']['text'] ) ) {\n\t\t\t\t$title_class = '';\n\t\t\t\t$title_output = '<h2%s>%s</h2>';\n\t\t\t\tif ( 'none' !== $section['title']['underline_color'] ) {\n\t\t\t\t\t$title_class = \" class=\\\"underline underline-{$section['title']['underline_color']}\\\"\";\n\t\t\t\t}\n\t\t\t\t$title_output = sprintf(\n\t\t\t\t\t$title_output,\n\t\t\t\t\t$title_class,\n\t\t\t\t\t$section['title']['text']\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Create row output.\n\t\t\t$repeater_output = '';\n\n\t\t\t// Item section specific output.\n\t\t\tif ( 'item_section' === $type ) {\n\n\t\t\t\t$type = $section['items_group']['type'];\n\t\t\t\t// Remove empty items.\n\t\t\t\t$items = array();\n\t\t\t\tforeach ( $section['items_group'][ $type ] as $item ) {\n\t\t\t\t\t$filtered = array_filter( $item );\n\t\t\t\t\tif ( ! empty( $filtered ) ) {\n\t\t\t\t\t\t$items[] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( 'card' === $type ) {\n\t\t\t\t\t// Create cards items.\n\t\t\t\t\tforeach ( $items as $key => $item ) {\n\t\t\t\t\t\t// Image.\n\t\t\t\t\t\t$image = '';\n\t\t\t\t\t\tif ( ! empty( $item['image'] ) ) {\n\t\t\t\t\t\t\t$image = sprintf(\n\t\t\t\t\t\t\t\t'<div class=\"image\"><img src=\"%s\" alt=\"%s\"></div>',\n\t\t\t\t\t\t\t\t$item['image']['sizes']['medium_large'],\n\t\t\t\t\t\t\t\t$item['image']['alt']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Title.\n\t\t\t\t\t\t$title = '';\n\t\t\t\t\t\tif ( ! empty( $item['title'] ) ) {\n\t\t\t\t\t\t\t$title = \"<h3 class=\\\"underline underline-lightgreen\\\">{$item['title']}</h3>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Description.\n\t\t\t\t\t\t$desc = '';\n\t\t\t\t\t\tif ( ! empty( $item['description'] ) ) {\n\t\t\t\t\t\t\t$desc = \"<div class=\\\"description\\\">{$item['description']}</div>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Button.\n\t\t\t\t\t\t$button = '';\n\t\t\t\t\t\tif ( ! empty( $item['button'] ) ) {\n\t\t\t\t\t\t\t$button = sprintf(\n\t\t\t\t\t\t\t\t'<a class=\"item-button\" href=\"%s\" target=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t$item['button']['url'],\n\t\t\t\t\t\t\t\t$item['button']['target'],\n\t\t\t\t\t\t\t\t$item['button']['title']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Assemble item.\n\t\t\t\t\t\t$repeater_output .= sprintf(\n\t\t\t\t\t\t\t'<div class=\"cell card\">%s<div class=\"wrap\">%s%s%s</div></div>',\n\t\t\t\t\t\t\t$image,\n\t\t\t\t\t\t\t$title,\n\t\t\t\t\t\t\t$desc,\n\t\t\t\t\t\t\t$button\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} elseif ( 'flowchart' === $type ) {\n\t\t\t\t\t// Create flowchart items.\n\t\t\t\t\tforeach ( $items as $key => $item ) {\n\t\t\t\t\t\t// Heading.\n\t\t\t\t\t\t$heading = '';\n\t\t\t\t\t\t$hfields = $item['heading_group'];\n\t\t\t\t\t\tif ( ! empty( $hfields ) ) {\n\t\t\t\t\t\t\t$htype = $hfields['type'];\n\t\t\t\t\t\t\t$hchoice = $hfields[ $htype ];\n\t\t\t\t\t\t\t$hinside = '';\n\t\t\t\t\t\t\tif ( ! empty( $hchoice ) ) {\n\t\t\t\t\t\t\t\tswitch ( $htype ) {\n\t\t\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\t\t\t$hinside = sprintf(\n\t\t\t\t\t\t\t\t\t\t\t'<span class=\"text\">%s</span>',\n\t\t\t\t\t\t\t\t\t\t\t$hfields['text']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\t\t\t$hinside = sprintf(\n\t\t\t\t\t\t\t\t\t\t\t'<img src=\"%s\" alt=\"%s\">',\n\t\t\t\t\t\t\t\t\t\t\t$hfields['image']['sizes']['medium_large'],\n\t\t\t\t\t\t\t\t\t\t\t$hfields['image']['alt']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'logo':\n\t\t\t\t\t\t\t\t\t\t$logo_nicename = array(\n\t\t\t\t\t\t\t\t\t\t\t'agrilife' => 'AgriLife',\n\t\t\t\t\t\t\t\t\t\t\t'extension' => 'AgriLife Extension',\n\t\t\t\t\t\t\t\t\t\t\t'research' => 'AgriLife Research',\n\t\t\t\t\t\t\t\t\t\t\t'coals' => 'College of Agriculture & Life Sciences',\n\t\t\t\t\t\t\t\t\t\t\t'tvmdl' => 'TVMDL',\n\t\t\t\t\t\t\t\t\t\t\t'forest' => 'Forest Service',\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$hinside = sprintf(\n\t\t\t\t\t\t\t\t\t\t\t'<img class=\"logo\" src=\"%s/images/logos/%s-%s.png\" alt=\"%s\">',\n\t\t\t\t\t\t\t\t\t\t\tAF_THEME_DIRURL,\n\t\t\t\t\t\t\t\t\t\t\t$hfields['logo'],\n\t\t\t\t\t\t\t\t\t\t\t$hfields['logo_color'],\n\t\t\t\t\t\t\t\t\t\t\t$logo_nicename[ $hfields['logo'] ]\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$heading = sprintf(\n\t\t\t\t\t\t\t\t\t'<div class=\"heading center-line line-%s\">%s</div>',\n\t\t\t\t\t\t\t\t\t$item['line_color'],\n\t\t\t\t\t\t\t\t\t$hinside\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Button.\n\t\t\t\t\t\t$button = '';\n\t\t\t\t\t\tif ( ! empty( $item['button'] ) ) {\n\t\t\t\t\t\t\t$button = sprintf(\n\t\t\t\t\t\t\t\t'<a class=\"item-button\" href=\"%s\" target=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t$item['button']['url'],\n\t\t\t\t\t\t\t\t$item['button']['target'],\n\t\t\t\t\t\t\t\t$item['button']['title']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Assemble item.\n\t\t\t\t\t\t$repeater_output .= sprintf(\n\t\t\t\t\t\t\t'<div class=\"cell flowchart-item\">%s%s</div>',\n\t\t\t\t\t\t\t$heading,\n\t\t\t\t\t\t\t$button\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output .= sprintf(\n\t\t\t\t'<div class=\"%s\"><div class=\"grid-container\">%s<div class=\"cells %s\">%s</div></div></div>',\n\t\t\t\timplode( ' ', $classes ),\n\t\t\t\t$title_output,\n\t\t\t\t$section['items_group']['align'],\n\t\t\t\t$repeater_output\n\t\t\t);\n\t\t}\n\t}\n\n\t$output .= '</div>';\n\n\techo wp_kses_post( $output );\n}", "public function run()\n {\n $servicesNames = [\"Desktop, Web & Mobile Apps\", \"Digital Marketing\", \"Academic Research & Writing\", \"Market & Customer Research\", \"Office Process Automation\"];\n $servicesShortDescription = [\"Desktop, Web &amp; Mobile Apps description\", \"Rank your page ahead of your competitors\", \"Get market, business, technical & academic researc...\", \"IT & business training for increased productivity\", \" Automate your mundane repetitive task\"];\n $servicesMetaTitle = [\"Desktop, Web &amp; Mobile Apps meta title\", \"Rank your page ahead of your competitors\", \"Get market, business, technical & academic researc...\", \"IT & business training for increased productivity\", \" Automate your mundane repetitive task\"];\n $servicesMetaDescription = [\"Desktop, Web &amp; Mobile Apps meta description\", \"Rank your page ahead of your competitors\", \"Get market, business, technical & academic researc...\", \"IT & business training for increased productivity\", \" Automate your mundane repetitive task\"];\n $servicesDetails = [\"Desktop, Web & Mobile Apps description\", \"Digital Marketing description\", \"Academic Research & Writing description\", \"Market & Customer Research description\", \"Office Process Automation description\"];\n $servicesSlugs = [\"Desktop-Web-Mobile-Apps\", \"Digital-Marketing\", \"Academic-Research-Writing\", \"Market-Customer-Research\", \"Office-Process-Automation\"];\n foreach($servicesNames as $index => $serviceName){\n $service = new Service;\n $service->name = $serviceName;\n $service->short_description = $servicesShortDescription[$index];\n $service->meta_title = $servicesMetaTitle[$index];\n $service->meta_description = $servicesMetaDescription[$index];\n $service->details = $servicesDetails[$index];\n $service->slug = $servicesSlugs[$index];\n $service->save();\n }\n }", "public function run()\n {\n //\n $services_names = [\"Market & Customer Research\", \"Business Research & Writing\", \"Process & Product Evaluation\"];\n $services_short_descriptions = [\"Anim consequat Lorem cillum elit laborum voluptate tempor consectetur cupidatat eiusmod.\", \"Anim consequat Lorem cillum elit laborum voluptate tempor consectetur cupidatat eiusmod 2.\", \"Anim consequat Lorem cillum elit laborum voluptate tempor consectetur cupidatat eiusmod 3.\"];\n $services_full_descriptions = [\"Dolor sit pariatur ipsum duis pariatur. Id anim mollit cillum nulla ad sunt. Est cillum sunt tempor deserunt aliquip. Et irure enim sint enim est eu ipsum nulla dolor deserunt id nostrud duis irure. Deserunt do nisi nulla ut cillum id cillum id esse exercitation non. Dolor est exercitation exercitation aute mollit nostrud 1.\", \"Dolor sit pariatur ipsum duis pariatur. Id anim mollit cillum nulla ad sunt. Est cillum sunt tempor deserunt aliquip. Et irure enim sint enim est eu ipsum nulla dolor deserunt id nostrud duis irure. Deserunt do nisi nulla ut cillum id cillum id esse exercitation non. Dolor est exercitation exercitation aute mollit nostrud 2.\", \"Dolor sit pariatur ipsum duis pariatur. Id anim mollit cillum nulla ad sunt. Est cillum sunt tempor deserunt aliquip. Et irure enim sint enim est eu ipsum nulla dolor deserunt id nostrud duis irure. Deserunt do nisi nulla ut cillum id cillum id esse exercitation non. Dolor est exercitation exercitation aute mollit nostrud 3.\"];\n $services_slugs = [\"Market-Customer-Research\", \"Business-Research-Writing\", \"Process-Product-Evaluation\"];\n $services_meta_titles = [\"Title: Market-Customer-Research\", \"Title: Business-Research-Writing\", \"Title: Process-Product-Evaluation\"];\n $services_meta_descriptions = [\"Description: Market-Customer-Research\", \"Description: Business-Research-Writing\", \"Description: Process-Product-Evaluation\"];\n\n for($i = 0; $i < count($services_names); $i++){\n $service = new Service;\n $service->name = $services_names[$i];\n $service->short_description = $services_short_descriptions[$i];\n $service->full_description = $services_full_descriptions[$i];\n $service->slug = $services_slugs[$i];\n $service->meta_title = $services_meta_titles[$i];\n $service->meta_description = $services_meta_descriptions[$i];\n $service->save();\n }\n\n }", "private function loadServices()\n {\n $this->messageQueueService = $this->getContainer()->get('ktio_worker.message_queue_service');\n $this->urlService = $this->getContainer()->get('ktio_worker.url_service');\n $this->timerService = $this->getContainer()->get('ktio_worker.timer_service');\n }", "public function general_services()\n {\n return [\n [\n 'name' => 'Plumbing',\n 'description' => 'Plumbing / Piping Services',\n 'icon' => 'fas fa-shower'\n ],\n [\n 'name' => 'Construction',\n 'description' => 'Construction / Building Services',\n 'icon' => 'fas fa-hard-hat'\n ],\n [\n 'name' => 'Paint',\n 'description' => 'Paint Services',\n 'icon' => 'fas fa-paint-roller'\n ],\n [\n 'name' => 'Carpentry',\n 'description' => 'Internal fixing services',\n 'icon' => 'fas fa-hammer'\n ],\n [\n 'name' => 'Car',\n 'description' => 'Mechanic services',\n 'icon' => 'fas fa-car-crash'\n ],\n [\n 'name' => 'Electric',\n 'description' => 'Electric services',\n 'icon' => 'fas fa-plug'\n ],\n [\n 'name' => 'Internal Designs',\n 'description' => 'Design Services',\n 'icon' => 'fas fa-pencil-ruler'\n ],\n [\n 'name' => 'Exterior',\n 'description' => 'Exterior Design Services',\n 'icon' => 'fas fa-drafting-compass'\n ],\n [\n 'name' => 'Gardening',\n 'description' => 'Exterior Maintenance Services',\n 'icon' => 'fas fa-seedling'\n ],\n [\n 'name' => 'Security',\n 'description' => 'Locks and Security Services',\n 'icon' => 'fas fa-lock'\n ],\n [\n 'name' => 'Connectivity',\n 'description' => 'Network Services',\n 'icon' => 'fas fa-wifi'\n ],\n\n ];\n }", "protected function selectService()\r\n {\r\n $this->add(array(\r\n 'name' => 'availableServices',\r\n 'type' => 'select',\r\n 'options' => array(),\r\n 'attributes' => array(\r\n 'data-ng-change' => 'selecteService()'\r\n )\r\n ));\r\n }", "abstract public function setService();", "public function __construct() {\n self::registerServices();\n }", "public function registrarServicesProviders(string ... $services_providers): void;", "protected function api_classic_services_view() {\n\t\t$services = $this->exec( array(\n\t\t\t'opcode' => 'taxonomy_terms',\n\t\t\t'taxonomy' => 'service',\n\t\t\t'hide_empty' => false,\n\t\t) );\n\t\t# sdv_dbg('services',$services);\n\t\t/* Render html using $services */\n\t\tob_start();\n\t\tclassic_services( $services );\n\t\t/* end of html rendering */\n\t\t$result = array( 'html' => ob_get_clean() );\n\t\treturn $result;\n\t}", "static function getServices(){\n $result = array();\n $result[] = new dpdService( array(\n \"parentId\" => self::UID\n ,\"label\" => \"Home With Predict\"\n ,\"description\" => \"Get your parcel delivered at your place, we'll notify you in the morning when we are commming by.\"\n ,\"name\" => \"home_predict\" \n ,\"type\" => dpdService::classic\n ,\"validate\" => function($order){return true;}\n ));\n $result[] = new dpdService( array(\n \"parentId\" => self::UID\n ,\"label\" => \"Pickup\"\n ,\"description\" => \"Can't be home? Let us delivery your parcel in one of our Pickup points.\"\n ,\"name\" => \"pickup\" \n ,\"type\" => dpdService::parcelshop\n ,\"validate\" => function($order){return true;}\n ));\n $result[] = new dpdService( array(\n \"parentId\" => self::UID\n ,\"label\" => \"Pickup Return\"\n ,\"description\" => \"Something wrong? Not what you hoped for? Return in via one of our Pickup points\"\n ,\"name\" => \"retour\" \n ,\"type\" => dpdService::retour\n ,\"validate\" => function($order){return true;}\n ));\n return $result;\n }" ]
[ "0.61035675", "0.5988899", "0.58949", "0.5842708", "0.57928705", "0.5781313", "0.5714487", "0.57004905", "0.5669872", "0.56414235", "0.56327534", "0.56156695", "0.56037915", "0.5598906", "0.5546726", "0.55259204", "0.54920185", "0.5476157", "0.5472884", "0.54615325", "0.54601854", "0.5459744", "0.54573274", "0.5456494", "0.54338133", "0.54314625", "0.54085517", "0.53892756", "0.53810424", "0.53415513", "0.532681", "0.53097796", "0.53086907", "0.5304736", "0.5290605", "0.52834755", "0.5273464", "0.52717525", "0.5270189", "0.52671325", "0.52671325", "0.5254636", "0.5252705", "0.5231574", "0.5226547", "0.5222663", "0.52226096", "0.52160156", "0.51960385", "0.51952994", "0.5185665", "0.51708037", "0.51680094", "0.51675564", "0.5165773", "0.5162862", "0.5159204", "0.5151808", "0.51463675", "0.51448697", "0.5143936", "0.51438427", "0.514084", "0.5134234", "0.5133988", "0.5129989", "0.511284", "0.51090324", "0.50875306", "0.50854725", "0.50848186", "0.50814086", "0.5067456", "0.5064784", "0.50622815", "0.50605214", "0.50601166", "0.50336677", "0.50323457", "0.50300354", "0.5008293", "0.4997745", "0.49967596", "0.49953824", "0.4993059", "0.49899292", "0.4988093", "0.4974073", "0.49718013", "0.4961424", "0.49513146", "0.49506488", "0.49486908", "0.49421394", "0.49341115", "0.4932837", "0.49255002", "0.49168321", "0.49150577", "0.49100798" ]
0.7070378
0
Determine whether a provided service term is required or not.
Определите, требуется ли предоставленный срок обслуживания.
public function isRequiredService(TermInterface $service_term) { // Check a service to see if it is required. $required = $service_term->get('field_vet_center_required_servic')->value; return $required; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isServiceRequest() {\n return $this->isWorkerRequest() || $this->isWarmupRequest() || $this->isLighthouseRequest();\n }", "public static function isTerm()\n {\n\t//$timeslot = self::getCurrentTimeslot($time, $filter);\n return true;\n return (!empty(self::getTerms(true)));\n }", "public function hasAcceptedTerms();", "function check_requirements()\n\t{\n\t\tif (!$this->obj_customer->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested customer (\". $this->obj_customer->id .\") does not exist - possibly the customer has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\n\t\t// verify that the service-customer entry exists\n\t\tif ($this->ob_customer->id_service_customer)\n\t\t{\n\t\t\tif (!$this->obj_customer->verify_id_service_customer())\n\t\t\t{\n\t\t\t\tlog_write(\"error\", \"page_output\", \"The requested service (\". $this->obj_customer->id_service_customer .\") was not found and/or does not match the selected customer\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\n\t\t// verify the options IDs\n\t\tif (!$this->obj_cdr_rate_table->verify_id_override())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service does not have a valid CDR rate table\");\n\t\t}\n\n\t\t// check if the option override rate id is valid (if supplied)\n\t\tif (!$this->obj_cdr_rate_table->verify_id_rate_override())\n\t\t{\n\t\t\t$this->obj_cdr_rate_table->id_rate_override = 0;\n\t\t}\n\n\t\t// verify that this is a phone service\n\t\tif ($this->obj_customer->obj_service->data[\"typeid_string\"] != (\"phone_single\" || \"phone_trunk\" || \"phone_tollfree\"))\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service is not a phone service.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "public static function enforcesAcceptingTerms()\n {\n return static::enabled('must-accept-terms');\n }", "public static function mustAcceptTerms()\n {\n return 'must-accept-terms';\n }", "public function hasTerm(){\r\n return $this->_has(1);\r\n }", "public function addRequiredServicesByTerm(EntityInterface $service_term) {\n /** @var \\Drupal\\taxonomy\\TermInterface $service_term */\n if ($service_term->bundle() === 'health_care_service_taxonomy'\n && $service_term->hasField('field_vet_center_required_servic')) {\n $previously_required = isset($service_term->original) ? $service_term->original->get('field_vet_center_required_servic')->value : 0;\n if ($service_term->get('field_vet_center_required_servic')->value && !$previously_required) {\n $node_storage = $this->entityTypeManager->getStorage('node');\n\n // Get all the vet center node ids.\n $vet_center_query = $node_storage->getQuery();\n $vet_center_nids = $vet_center_query\n ->condition('type', 'vet_center')\n ->execute();\n\n // Get all the facility health service node ids using this term.\n $term_id = $service_term->id();\n $service_query = $node_storage->getQuery();\n $facility_service_nids = $service_query\n ->condition('type', 'vet_center_facility_health_servi')\n ->condition('field_service_name_and_descripti.target_id', $term_id)\n ->execute();\n\n // Load all the facility health service nodes.\n $facility_services = $node_storage->loadMultiple($facility_service_nids);\n $serviced_nids = [];\n\n // Get the id for the vet center referenced in each facility service.\n foreach ($facility_services as $facility_service) {\n /** @var \\Drupal\\node\\NodeInterface $facility_service */\n if ($facility_service->hasField('field_office') && isset($facility_service->get('field_office')->entity)) {\n $serviced_nids[] = $facility_service->get('field_office')->entity->id();\n }\n }\n\n // Remove the vet centers where this service is already present.\n $missing_nids = array_diff($vet_center_nids, $serviced_nids);\n $log_message = 'Created from required VHA health service term.';\n\n // Add each item to the queue for creation.\n $vet_centers = $node_storage->loadMultiple($missing_nids);\n foreach ($vet_centers as $vet_center) {\n $this->addService($service_term, $vet_center, $log_message);\n }\n\n $vars = [\n '%count' => count($vet_centers),\n '%name' => $service_term->get('name')->value,\n ];\n $message = $this->t('%count %name services were queued to be added to Vet Centers.', $vars);\n $this->loggerChannelFactory->get('va_gov_vet_center')->info($message);\n $this->messenger->addStatus($message);\n }\n }\n }", "public function hasService(EntityInterface $service_term, EntityInterface $facility_node) {\n $node_storage = $this->entityTypeManager->getStorage('node');\n $node_query = $node_storage->getQuery();\n\n // Check to see if a given facility has a given service.\n $term_id = $service_term->id();\n $facility_id = $facility_node->id();\n $facility_service_nids = $node_query\n ->condition('type', 'vet_center_facility_health_servi')\n ->condition('field_office.target_id', $facility_id)\n ->condition('field_service_name_and_descripti.target_id', $term_id)\n ->execute();\n\n $has_service = (count($facility_service_nids) > 0 ? TRUE : FALSE);\n\n return $has_service;\n }", "protected function haveRequiredOptions()\n {\n foreach ($this->product->bundle_options as $option) {\n if ($option->is_required) {\n return true;\n }\n }\n\n return false;\n }", "public function is_required()\n\t{\n\t\treturn !empty($this->required);\n\t}", "public function is_not_featured_service($service)\n {\n }", "function has_term($term = '', $taxonomy = '', $post = \\null)\n{\n}", "function agreement_is_installed()\n{\n global $db;\n\n if ($db->field_exists(\"new_terms\", \"users\") && $db->field_exists(\"new_terms_date\", \"users\")) {\n return true;\n } else {\n return false;\n }\n}", "function isRequired() : bool ;", "public function isReq($field){\n\t\treturn isset($field) && !empty($field);\n\t}", "function checkMandatory () {\r\n if ((IdealRequest::checkMandatory() == true)\r\n && (strlen( $this->issuerID ) > 0)\r\n && (strlen( $this->merchantReturnURL ) > 0)\r\n && (strlen( $this->purchaseID ) > 0)\r\n && (strlen( $this->amount ) > 0)\r\n && (strlen( $this->currency ) > 0)\r\n && (strlen( $this->expirationPeriod ) > 0)\r\n && (strlen( $this->language ) > 0)\r\n && (strlen( $this->entranceCode ) > 0)\r\n && (strlen( $this->description ) > 0)\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function isRequiredSearchRunning() \n\t{\n\t\tif( !$this->searchClauseObj )\n\t\t\treturn false;\n\t\t\t\n\t\treturn $this->searchClauseObj->isRequiredSearchRunning();\n\t}", "private function is_required($name){\n\t\t$requiredFields=$this->get_required();\n\t\tif (in_array($name, $requiredFields)){\n\t\t\treturn true;\n\t\t\t}\n\t\telse return false;\t\n\t\t}", "public function is_featured_service($service)\n {\n }", "function snax_is_category_required() {\n\treturn 'standard' === apply_filters( 'snax_category_required', get_option( 'snax_category_required', 'none' ) );\n}", "public function hasRequiredOptions() {\n return $this->getProduct ()->getTypeInstance ( true )->hasRequiredOptions ( $this->getProduct () );\n }", "public function hasRequiredOptions()\n {\n return $this->getProduct()->getTypeInstance(true)->hasRequiredOptions($this->getProduct());\n }", "private function requirements_met() {\n foreach ( $this->requirements() as $requirement ) {\n if ( !function_exists( $requirement ) ) {\n return FALSE;\n }\n }\n\n return TRUE;\n }", "public function isRequired()\n {\n return !empty($this->_required);\n }", "function isValidTerm($term){\r\n $query =\"select * from academic_term where academic_term.academic_term = ?\";\r\n return ($this->makeParamExecute($query,array( $term))==1?'true':'false');\r\n }", "public function isRequired(): bool;", "public function isRequired(): bool;", "public function isRequired()\n {\n return !empty($this->required);\n }", "public function is_required( $label ){\n $cluster = $this->cluster;\n if( !empty($cluster[$label.'.'.'required']) ){\n return true;\n }\n }", "protected function _isServiceAvailable()\n {\n if ($this->_blServiceIsOn === null) {\n $this->_blServiceIsOn = class_exists('SoapClient') ? true : false;\n if ($this->_blServiceIsOn) {\n $rFp = @fopen($this->getWsdlUrl(), 'r');\n $this->_blServiceIsOn = $rFp !== false;\n if ($this->_blServiceIsOn) {\n $sWsdl = '';\n while (!feof($rFp)) {\n $sWsdl .= fread($rFp, 8192);\n }\n fclose($rFp);\n\n // validating wsdl file\n try {\n $oDomDocument = new DOMDocument();\n $oDomDocument->loadXML($sWsdl);\n } catch (Exception $oExcp) {\n // invalid xml\n $this->_blServiceIsOn = false;\n }\n }\n }\n }\n\n return $this->_blServiceIsOn;\n }", "public function getTerms(): bool {}", "public function getTerms(): bool {}", "public function isRequired(){\n\n return in_array($this->_getCountry(), $this->getCountriesRequired());\n }", "public function isRequired(){\n return (isset( $this->required )? (bool)$this->required : false );\n }", "function isRequired() {\n\t\treturn $this->data_array['is_required'];\n\t}", "public function isRequired() {\r\n if(isset($this->options['required'])) {\r\n return filter_var($this->options['required'], FILTER_VALIDATE_BOOLEAN);\r\n }else{\r\n return false;\r\n }\r\n }", "function zen_check_url_get_terms() {\n global $db;\n $zp_sql = \"select * from \" . TABLE_GET_TERMS_TO_FILTER;\n $zp_filter_terms = $db->Execute($zp_sql);\n $zp_result = false;\n while (!$zp_filter_terms->EOF) {\n if (isset($_GET[$zp_filter_terms->fields['get_term_name']]) && zen_not_null($_GET[$zp_filter_terms->fields['get_term_name']])) $zp_result = true;\n $zp_filter_terms->MoveNext();\n }\n return $zp_result;\n }", "function fw_has( $source, $term ) {\n\treturn \n\t( empty( $source ) || empty( $term ) ) ? \n\t\tfalse : ( false !== \\strpos( $source, $term ) );\n}", "public static function is_service_active() {\n\t\treturn ! is_wp_error( tribe( 'events-aggregator.service' )->api() );\n\t}", "public function isMissingPrerequisite(ServerRequestInterface $request): bool\n {\n if ($this->state($request)->needsCleansing) {\n return $this->state($request)->actorUid === null; // isMissing equals false if actorUid present\n }\n\n $required = parent::isMissingPrerequisite($request)\n || ($this->state($request)->actorAddress1 === null && $this->state($request)->actorAbroadAddress === null)\n || $this->state($request)->getActorRole() === null;\n\n if ($this->state($request)->getActorRole() === RequestActivationKey::ACTOR_TYPE_ATTORNEY) {\n return $required\n || $this->state($request)->donorFirstNames === null\n || $this->state($request)->donorLastName === null\n || $this->state($request)->donorDob === null;\n }\n\n return $required;\n }", "public function isDeferredService(string $service): bool\n {\n return isset($this->deferredServices[$service]);\n }", "public function isRequired()\n {\n return $this->_getAttribute('taxvat') ? (bool)$this->_getAttribute('taxvat')->isRequired() : false;\n }", "public function verify_service($service)\n {\n $apps = md\\App::find_all();\n return in_array($service, $apps->name->oa);\n }", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "protected final function getServiceAvailability($area, $service)\n\t{\n\t\treturn true;\n\t}", "public function isRequired(): bool\n {\n return $this->required ?? false;\n }", "public static function termsOfServiceComponent()\n {\n return Features::getOption(Features::registration(), 'terms_of_service');\n }", "public function isRequired() : bool {}", "public function isRequired() : bool {}", "abstract protected function checkRequirements();", "public function required_if_payment($var) {\n\n\t\t// trim\n\t\t$amount = floatval($this->input->post('amount'));\n\t\t$method = trim($var);\n\n\t\t// check\n\t\tif ($amount > 0 && empty($method)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public static function test_requirements()\n\t{\n\t\t// Look for ACF\n\t\tif (! class_exists('Acf') ) return false;\n\t\treturn true;\n\t}", "function yd_requirements_met() {\n\tglobal $wp_version;\n\n\tif ( version_compare( PHP_VERSION, YD_REQUIRED_PHP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( version_compare( $wp_version, YD_REQUIRED_WP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\n\t// Dependency https://github.com/WP-API/WP-API/tree/1.2.2\n\tif ( ! class_exists( 'WP_JSON_Server' ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function required (string $str)\n {\n return empty($str) ? true : false;\n }", "function is_product_category($term = '')\n {\n }", "public function has($key)\n {\n return \\Phpfox::param('services', $key) != null;\n }", "public function shouldRequestFacetValueForMissing()\n {\n return $this->context->shouldRequestFacetValueForMissing();\n }", "public function isDeferredService($service)\n {\n return isset($this->deferredServices[$service]);\n }", "public function is_required() {\n\t\treturn $this->required;\n\t}", "public function isRequired() {}", "public function isRequired() {}", "private function hasRequiredOption($bundleProduct)\n {\n $options = array_filter(\n $this->getBundleOptions($bundleProduct),\n function ($item) {\n return $item->getRequired();\n }\n );\n return !empty($options);\n }", "public function isService() {\n\t\treturn false;\n\t}", "private function termsInit()\n {\n $termsInit = null;\n\n// Get the caddy session\n $sesArray = $GLOBALS[ 'TSFE' ]->fe_user->getKey( 'ses', $this->extKey . '_' . $GLOBALS[ \"TSFE\" ]->id );\n\n// RETURN : any pdf is requested\n switch ( true )\n {\n case(!empty( $sesArray[ 'sendCustomerTerms' ] ) ):\n case(!empty( $sesArray[ 'sendVendorTerms' ] ) ):\n $termsInit = true;\n break;\n default:\n $termsInit = false;\n break;\n }\n unset( $sesArray );\n\n if ( !$termsInit )\n {\n// DRS\n if ( $this->pObj->drsUserfunc )\n {\n $prompt = __METHOD__ . ' returns null.';\n t3lib_div::devlog( '[INFO/USERFUNC] ' . $prompt, $this->extKey, 0 );\n }\n// DRS\n }\n// RETURN : any pdf is requested\n\n return $termsInit;\n }", "public function isRequired()\n {\n return self::REQUIRED === (self::REQUIRED & $this->mode);\n }", "function is_msp_licensed($item_id){\n $product_id = $item->get_product_id();\n return has_term('Annual Products', 'product_cat', $product_id);\n}", "private function askService()\n {\n return $this->confirm('Do you wish to create a Service for this skeleton? (add --service to skip this question)', 'yes');\n }", "public function isRequired()\n {\n return self::REQUIRED === (self::REQUIRED & $this->mode);\n }", "public function is_required()\n\t{\n\t\treturn $this->required;\n\t}", "public function getRequiredServices() {\n if (empty($this->requiredServices)) {\n $term_storage = $this->entityTypeManager->getStorage('taxonomy_term');\n $term_query = $term_storage->getQuery();\n\n // Return an array of all VHA health service terms.\n $term_ids = $term_query\n ->condition('vid', 'health_care_service_taxonomy')\n ->execute();\n $service_terms = $term_storage->loadMultiple($term_ids);\n $required_services = [];\n\n // Create a filtered array containing only required services.\n foreach ($service_terms as $service_term) {\n if ($this->isRequiredService($service_term)) {\n $required_services[] = $service_term;\n }\n }\n\n $this->requiredServices = $required_services;\n }\n\n return $this->requiredServices;\n }", "public static function required($t)\n\t{\n\t\treturn ! in_array($t, array(null, false, '', array()), true);\n\t}", "public function hasService($name) {\n if (isset($this->services[$name])) {\n return true;\n } else return $this->check('service-'.$name);\n }", "public static function hasTermsAndPrivacyPolicyFeature()\n {\n return Features::hasTermsAndPrivacyPolicyFeature();\n }", "function wpps_requirements_met() {\n\tglobal $wp_version;\n\t//require_once( ABSPATH . '/wp-admin/includes/plugin.php' );\t\t// to get is_plugin_active() early\n\n\tif ( version_compare( PHP_VERSION, WPPS_REQUIRED_PHP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( version_compare( $wp_version, WPPS_REQUIRED_WP_VERSION, '<' ) ) {\n\t\treturn false;\n\t}\n\n\n\treturn true;\n}", "private function checkIsRequired(): bool\n {\n return ! empty($this->reflectionProperty->getAttributes(Attributes\\Required::class));\n }", "public function requirementsAreInstalled(): bool\n {\n }", "public function requiresUserDoc($type, $system = false)\n {\n // Doc types\n // 1 WC - White Card\n // 3 CL - Contractors Licence\n // 4 SL - Supervisors Licence\n // 8 AP - Aprentice Document\n // 9 AS - Asbestos Removal Training\n // 10 HI - High Risk Work Licence\n //\n // Categories | WC | CL | SL | AP |\n // 0 Unallocated / Offsite |_____|_____|_____|_____|\n // 1 On Site Non-Trade |__X__|_____|_____|_____|\n // 2 On Site Trade (Sole Trader) |__X__|__X__|_____|_____|\n // 3 On Site Trade (Partner/Company) |__X__|_____|_____|_____|\n // 4 On Site Apprentice |__X__|_____|_____|_____|\n\n // If System == False then check for any Compliance Overrides\n if (!$system) {\n $override = ComplianceOverride::where('type', \"ud$type\")->where('user_id', $this->id)->where('status', 1)->first();\n if ($override)\n return ($override->required) ? true : false;\n }\n\n // White Card\n if ($type == 1 && $this->onsite) return true; // If you Onsite MUST have a WC (White Card)\n\n // Contractor Licence\n if (in_array($this->company->business_entity, ['3', 'Sole Trader'])) {\n if ($type == 3) return true; // Contractor Licence Required for ALL Sole Traders\n } else {\n // Contractor or Supervisor Licence Required if user is nominated by own company as licence holder/supervisor of their CL\n // - current users not making users non-compliant if they don't have CL / Super because company nominated them - just a notification\n //if (in_array($type, [3, 4]) && $this->company->activeCompanyDoc(7) && $this->company->activeCompanyDoc(7)->status == 1\n // && $this->requiredContractorLicences()\n //) return true;\n }\n\n return false;\n }", "public function isRequired() : bool;", "public function hasCSRFState(string $service = null):bool;", "public function isRequestSetted(): bool\n {\n if (empty($this->request)) {\n throw new Error('This Service must have a request => use $this->setRequest before calling any method !');\n } else {\n return true;\n }\n }", "public function getServiceAvailable(string $service)\n {\n return (bool) $this->getServiceEnabled($service) && $this->getServiceKey($service) && $this->getServiceSecret($service);\n }", "public function isRequired()\n\t{\n\t\treturn $this->required;\n\t}", "function check_requirements()\n\t{\n\t\tif (!$this->obj_domain->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested domain (\". $this->obj_domain->id .\") does not exist - possibly it has been deleted?\");\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "function is_pie_request() {\n\treturn isset( $_REQUEST['pie_name'] );\n}", "private function meets_requirements() {\n\n\t\tif ( class_exists('IT_Exchange') && version_compare( $GLOBALS['it_exchange']['version'], '1.7.1', '>=') )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\n\t}", "function check_requirements()\n\t{\n\t\tif (!$this->obj_domain->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested domain (\". $this->obj_domain->id .\") does not exist - possibly the domain has been deleted?\");\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "public function hasToolSettingsService()\n {\n\n $url = $this->getSetting('custom_context_setting_url');\n\n return !empty($url);\n\n }", "function checkServices($aService) {\n if (null == $aService) {\n return null;\n } else {\n $myService = null;\n switch ($aService) {\n case \"1\":\n $myService = \"No Selection\";\n break;\n case \"2\":\n $myService = \"Internet and Phone\";\n break;\n case \"3\":\n $myService = \"Internet Only\";\n break;\n case \"4\":\n $myService = \"Phone Only\";\n break;\n default:\n $myService = \"Mo Match Found\";\n break;\n }\n return $myService;\n }\n}", "public function hasProductAndService($productAndServiceTypeID) {\n\t\treturn parent::hasAction($productAndServiceTypeID);\n\t}", "protected function checkRequired(){\n $missing = array();\n foreach ($this->validFields as $field=>$params){\n if(isset($params['required']) && $params['required']){\n if($params['type'] == \"single\"){\n if(!isset($this->formData[$field])){\n $missing[] = $field;\n }\n } else if($params['type'] == \"product\"){\n foreach ($this->products as $prod){\n $paramName = $params['paramName'];\n if(!isset($prod->$paramName)){\n $missing[] = $field;\n }\n }\n }\n }\n }\n\n if($missing != array()){\n return $missing;\n }\n\n return true;\n }", "function isSearchFAApplication(){\n\tglobal $nric,$name,$handphoneNum,$minAmount,$maxAmount,$startDate,$endDate;\n\t\n\tif($startDate!=\"\" || $endDate!=\"\" || $minAmount!=\"\" || $maxAmount!=\"\"){\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n}", "public function checkServiceAvailability()\n {\n $request = new Request('GET', \\Atticlab\\Libface\\Configs\\Kairos::STATUS_URL, []);\n\n $is_available = false;\n\n try {\n $http = new HTTP(['http_errors' => false]);\n $response = $http->send($request);\n //api must return 403 code for not auth requests\n $is_available = $response->getStatusCode() == 403;\n } catch (\\Exception $e) {\n $this->lerror('Error while try to check service availability status', [\n 'service' => $this->getServiceName(),\n get_class($e),\n $e->getCode(),\n $e->getMessage(),\n $e->getFile(),\n $e->getLine()\n ]);\n }\n\n return $is_available;\n }", "public function isRequired() {\n\t\treturn $this->required;\n\t}" ]
[ "0.6519015", "0.61753213", "0.6150166", "0.60992116", "0.6005254", "0.5991871", "0.5922252", "0.5913434", "0.58303046", "0.5817268", "0.57914156", "0.5738514", "0.5720257", "0.57112116", "0.5674738", "0.5673223", "0.56713516", "0.5663049", "0.5639295", "0.5622628", "0.5618482", "0.56099194", "0.56089664", "0.5605221", "0.5569205", "0.55649847", "0.55620325", "0.55620325", "0.5548234", "0.5546279", "0.5540718", "0.5537851", "0.5537851", "0.55130434", "0.54815716", "0.5478783", "0.5470204", "0.5462931", "0.5462566", "0.5459359", "0.54446363", "0.5443539", "0.54417133", "0.54292727", "0.5428749", "0.5428749", "0.5428749", "0.5428749", "0.5428749", "0.5428749", "0.5428749", "0.54202855", "0.5418562", "0.5416722", "0.54161745", "0.54161745", "0.54130876", "0.5407544", "0.54050875", "0.5394051", "0.5379193", "0.53725654", "0.5367898", "0.5367278", "0.53661066", "0.536604", "0.5351665", "0.5351665", "0.5350624", "0.53488004", "0.53301495", "0.5313698", "0.53015816", "0.5295057", "0.52874047", "0.5285501", "0.52778864", "0.52742887", "0.5263777", "0.52594566", "0.5248951", "0.5243803", "0.5243379", "0.5242611", "0.52418506", "0.52378166", "0.5236652", "0.5235164", "0.5233152", "0.52311045", "0.5226535", "0.5222932", "0.5217839", "0.5214857", "0.5214666", "0.520481", "0.52047515", "0.52035666", "0.5200503", "0.51948375" ]
0.80377203
0
Remove Edit from bulk actions
Удалить "Редактировать" из массовых действий
function edd_incentives_bulk_actions( $actions ) { unset( $actions['edit'] ); return $actions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_quick_edit( $actions ) {\n unset($actions['inline hide-if-no-js']);\n return $actions;\n}", "function get_bulk_actions() {\n $actions = array(\n\t\t\t\t\t\t\t'delete' => __('Delete', 'blog-designer-pack')\n\t\t\t\t\t\t);\n return apply_filters('bdpp_shrt_tmpl_list_bulk_act', $actions);\n\t}", "public static function remove_actions()\n {\n }", "public function __actionEdit() {\n\t\t\tif(isset($_POST['action']['delete']) && isset($_POST['fields']['id'])) {\n\t\t\t\t$_POST['with-selected'] = 'delete';\n\t\t\t\t$_POST['items'] = array($_POST['fields']['id'] => '');\n\t\t\t\treturn $this->__actionIndex();\n\t\t\t}\n\n\t\t\treturn $this->__actionNew();\n\t\t}", "function get_bulk_actions( ) {\r\n\t\t$actions = array();\r\n\r\n\t\t$actions['edit'] = __( 'Edit', 'media-library-assistant' );\r\n\t\t$actions['delete'] = __( 'Delete/Revert Custom', 'media-library-assistant' );\r\n\r\n\t\treturn $actions;\r\n\t}", "public function isEditAction() {}", "public function maybe_unload_for_bulk_edit() {\n\t\tif ( isset( $_REQUEST['bulk_edit'] ) && $this->is_posting_enabled() ) {\n\t\t\t$this->unload_markdown_for_posts();\n\t\t}\n\t}", "function process_bulk_action()\n {\n global $wpdb;\n $table_name = $wpdb->prefix . 'cte'; // tables prefix\n\n if ('delete' === $this->current_action()) {\n $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n if (is_array($ids)) $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() {\r\n if( 'delete'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n \r\n }", "function remove_row_actions( $actions, $post )\n{\n global $current_screen;\n //if( $current_screen->post_type != 'libro'&& $current_screen->post_type != 'revista' && $current_screen->post_type != 'hemeroteca' ) return $actions;\n //unset( $actions['edit'] );\n //unset( $actions['view'] );\n //unset( $actions['trash'] );\n unset( $actions['inline hide-if-no-js'] );//Edicion Rapida\n //$actions['inline hide-if-no-js'] .= __( 'Quick&nbsp;Edit' );\n\n return $actions;\n}", "function wptent_remove_quick_edit($actions)\n{\n global $typenow;\n if ($typenow == 'tentit') {\n unset($actions['inline hide-if-no-js']);\n }\n \n return $actions;\n}", "public function editAction() {}", "function get_bulk_actions() {\n\t\t$actions = array(\n\t\t\t'delete' => 'Delete'\n\t\t);\n\t\treturn $actions;\n\t}", "function process_bulk_action() {\n\n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n wp_die('Items deleted (or they would be if we had items to delete)!');\n }\n\n }", "function process_bulk_action() {\n \n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n #wp_die('Items deleted (or they would be if we had items to delete)!');\n }\n \n }", "function listBox_Action($row, $actions) {\r\n $cNip= $this->user->gNIP;\r\n if ($row->iSubmit==1) {\r\n if($row->iApproval_ats_inisiator==0 or empty($row->iApproval_ats_inisiator)){\r\n if($this->upperInisiator($row->cInisiator_export,$cNip)==0){\r\n unset($actions['edit']);\r\n }\r\n } else{\r\n unset($actions['edit']);\r\n }\r\n \r\n }\r\n return $actions;\r\n }", "public function get_bulk_actions() {\r\n $actions = array(\r\n 'bulk-delete' => __( 'Delete', 'opalmembership' )\r\n );\r\n\r\n return apply_filters( 'opalmembership_member_user_bulk_actions', $actions );\r\n }", "function process_bulk_action() {\n if ('delete' === $this->current_action()) {\n $deleteIds = esc_sql($_REQUEST['bulk-delete']);\n foreach ($deleteIds as $id) {\n $this->deleteUser($id);\n }\n }\n }", "public function remove_quick_edit_action( $actions ) {\n\n\t\tif ( !get_current_screen() or ( $this->post_type != get_current_screen()->post_type ) )\n\t\t\treturn $actions;\n\n\t\tunset( $actions['inline'], $actions['inline hide-if-no-js'] );\n\t\treturn $actions;\n\n\t}", "protected function get_bulk_actions()\n {\n }", "protected function get_bulk_actions()\n {\n }", "function majal_alumni_column_remove_quickedit( $actions ) {\n\t\t\tif( is_admin() ) {\n\t\t\t\tglobal $post;\n\t\t\t if( $post->post_type == 'majal_alumni' ) {\n\t\t\t\t\tunset( $actions['inline hide-if-no-js'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $actions;\n\t\t}", "function get_bulk_actions() {\r\n $actions = array(\r\n 'delete' => 'Xóa'\r\n );\r\n return $actions;\r\n }", "protected function bulk_actions($which = '')\n {\n }", "function wprss_remove_row_actions( $actions, $post )\n {\n\n $page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';\n if ( get_post_type($post) === 'wprss_feed_item' ) {\n unset( $actions[ 'edit' ] );\n unset( $actions[ 'view' ] );\n //unset( $actions[ 'trash' ] );\n unset( $actions[ 'inline hide-if-no-js' ] );\n }\n elseif ( get_post_type($post) === 'wprss_feed' ) {\n \t\t$actions = array_reverse( $actions );\n \t\t$actions['id'] = '<span class=\"wprss-row-id\">' . sprintf( __( 'ID: %1$s', WPRSS_TEXT_DOMAIN ), $post->ID ) . '</span>';\n \t\t$actions = array_reverse( $actions );\n\n unset( $actions[ 'view'] );\n unset( $actions[ 'inline hide-if-no-js'] );\n if ( get_post_status( $post->ID ) !== 'trash' ) {\n $trash = $actions['trash'];\n unset( $actions['trash'] );\n\n $view_items_link = apply_filters(\n 'wprss_view_feed_items_row_action_link',\n admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . $post->ID ),\n $post->ID\n );\n $view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', __( 'View Items', WPRSS_TEXT_DOMAIN ) );\n $actions['view-items'] = '<a href=\"' . $view_items_link . '\">' . $view_items_text . '</a>';\n\n $fetch_items_row_action_text = apply_filters( 'wprss_fetch_items_row_action_text', __( 'Fetch Items', WPRSS_TEXT_DOMAIN ) );\n $actions[ 'fetch' ] = '<a href=\"javascript:;\" class=\"wprss_ajax_action\" pid=\"'. $post->ID .'\" purl=\"'.home_url().'/wp-admin/admin-ajax.php\">' . $fetch_items_row_action_text . '</a>';\n\n $purge_feeds_row_action_text = apply_filters( 'wprss_purge_feeds_row_action_text', __( 'Delete Items', WPRSS_TEXT_DOMAIN ) );\n $purge_feeds_row_action_title = apply_filters( 'wprss_purge_feeds_row_action_title', __( 'Delete feed items imported by this feed source', WPRSS_TEXT_DOMAIN ) );\n $actions['purge-posts'] = \"<a href='\".admin_url(\"edit.php?post_type=wprss_feed&purge-feed-items=\" . $post->ID . $page ) . \"' title='\" . $purge_feeds_row_action_title . \"' >\" . __( $purge_feeds_row_action_text, WPRSS_TEXT_DOMAIN ) . \"</a>\";\n\n $actions['trash'] = $trash;\n }\n }\n return apply_filters( 'wprss_remove_row_actions', $actions );\n }", "function get_bulk_actions()\n {\n $actions = array(\n 'delete' => 'Delete'\n );\n return $actions;\n }", "public function clear_actions()\n {\n }", "public function get_bulk_actions() {\n\n\t\t$actions = array(\n\t\t\t'delete' => esc_html__( 'Delete', 'wpforms-lite' ),\n\t\t);\n\n\t\treturn $actions;\n\t}", "public function RemoveAllAndEditLink();", "function jd_bulk_actions ( $actions ) {\n\n\t$actions['Duplicate'] = __('Duplicate', 'duplicate');\n\treturn $actions;\n\n}", "public function doEditAction(){\n\n }", "public function updateActions()\n {\n ee()->db->where('class', 'Store')\n ->where_in('method', array('act_field_stock', 'act_add_to_cart'))\n ->delete('actions');\n }", "public function getEditActionName();", "public function remove_quick_edit_menu( $actions ) {\n\n\t\tif ( !get_current_screen() or ( $this->post_type != get_current_screen()->post_type ) )\n\t\t\treturn $actions;\n\n\t\tunset( $actions['edit'] );\n\t\treturn $actions;\n\n\t}", "public function get_bulk_actions() {\n\t\t$actions = array(\n\t\t\t'delete' => __( 'Delete', 'edd-pup' )\n\t\t);\n\n\t\treturn $actions;\n\t}", "function process_bulk_action() {\n global $wbdb;\n \n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n #wp_die('Items deleted (or they would be if we had items to delete)!');\n #$wpdb->query(\"DELETE FROM {$wpdb->prefix}amazon_auctions WHERE id = ''\",)\n }\n\n if( 'update'===$this->current_action() ) {\n\t\t\t#echo \"<br>verify handler<br>\";\t\t\t\n }\n \n }", "function get_bulk_actions() {\n $actions = array(\n 'delete' => __( 'Delete', 'wp-lister-for-amazon' )\n );\n return $actions;\n }", "function eh_bulk_edit_deactivate_work() {\n\t\tupdate_option( 'eh_bulk_edit_pack', '' );\n\t}", "public function getEditActionType(): string {\n return '';\n }", "public function actions()\n {\n $actions = parent::actions();\n unset($actions['create']);\n unset($actions['update']);\n // unset($actions['delete']);\n // unset($actions['view']);\n // unset($actions['index']);\n return $actions;\n }", "function get_bulk_actions() {\n $actions = array(\n 'trash' => __( 'Move to Trash', 'wp-erp' ),\n );\n return $actions;\n }", "public function action_edit()\n\t{\n\t\t\n\t}", "protected function process_action() {\n\t\t// Detect when a bulk action is being triggered.\n\t\tif ( 'delete' === $this->current_action() ) {\n\t\t\t$ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n\n\t\t\tif (!is_array($ids)) \n\t\t\t\t$ids = array($ids);\n\n\t\t\tforeach($ids as $id)\n\t\t\t\t$this->repository->deleteForm($id);\n\t\t}\n\t}", "public function bulk_delete()\n\t\t{\n\t\t\tglobal $wpdb;\n\n\t\t\t$action = $this->current_action();\n\n\t\t\tif( 'delete' !== $action ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//more\n\t\t}", "public function editAction()\n\t{\n\t}", "public function editAction() {\n\n }", "protected function beforeEdit() {}", "public function get_bulk_actions() {\n\t\t$actions = array(\n\t\t'bulk-delete' => __('Delete', 'font-organizer'),\n\t\t);\n\n\t\treturn $actions;\n\t}", "protected function get_bulk_actions() {\n\t\t$actions = array(\n\t\t\t'delete' => _x( 'Delete', 'List table bulk action', 'evercate-signup-wordpress-plugin' ),\n\t\t);\n\n\t\treturn $actions;\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function editAction()\n {\n //...\n }", "function process_bulk_action($redirect_to, $doaction, $ids) {\r\n\r\n if( 'delete'===$this->current_action() ) {\r\n\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n\r\n }\r\n\r\n\r\n\t\t\t\r\n\t\t\r\n\r\n }", "function process_bulk_action() {\r\n\r\n if( 'delete' === $this->current_action() ) {\r\n\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$items\t= $_GET['pdonation'];\r\n\r\n\t\t\tif( is_array( $items ) && $items ) {\r\n\t\t\t\tforeach( $items as $single_item ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//$wpdb->delete( $wpdb->prefix . \"donation_form_user\", array( 'id' => $single_item ) );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tglobal $is_donation_deleted;\r\n\t\t\t\t$is_donation_deleted\t= true;\t\r\n\t\t\t}\t\t\r\n\r\n\t\t\t//wp_die('Items deleted (or they would be if we had items to delete)!');\r\n } \r\n }", "function process_bulk_action() {\n\t\tglobal $wpdb;\n\t\tif('delete' === $this->current_action()) {\n\t\t\tparse_str($_SERVER['QUERY_STRING'], $output);\n\t\t\tforeach($output['checkbox'] as $k=>$v) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t$wpdb->prefix.'basalcart_orders',\n\t\t\t\t\tarray('deleted'=>1),\n\t\t\t\t\tarray('ID'=>$v),\n\t\t\t\t\tarray('%d')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function get_bulk_actions() {\n $actions = array(\n 'trash' => __( 'انتقال به سطل زباله', 'barhanmedia' ),\n );\n return $actions;\n }", "public function process_bulk_action() \n {\n \n if( 'bulk-delete' === $this->current_action() ) {\n \n if( isset( $_POST['mpr_points_ids'] ) && !empty( $_POST['mpr_points_ids'] ))\n {\n $all_id = $_POST['mpr_points_ids'];\n foreach ($all_id as $key => $value) {\n \n delete_user_meta($value,'mwb_wpr_points');\n }\n }\n }\n }", "public function executeEdit()\n {\n }", "public function editAction()\n {\n\n }", "public function removeAction()\n {\n }", "public function process_bulk_action() {\n if (( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' ) ||\n ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )) {\n // If sponsor_id array not empty\n if(isset($_POST['sponsor_id']) && !empty($_POST['sponsor_id'])) { \n $delete_ids = esc_sql( $_POST['sponsor_id'] );\n foreach ( $delete_ids as $id ) {\n self::delete_season( $id );\n }\n }\n }\n }", "function dmt_remove_message_row_actions( $actions, $post )\n{\n \tglobal $current_screen;\n\t\n\tif( $current_screen->post_type != 'dmt_messages' ) return $actions;\n\t{\n\t\tunset( $actions['view'] );\n\t\tunset( $actions['preview'] );\n\t}\n\treturn $actions;\n}", "public function getEditActionId() {\n\t\treturn 'system/file/edit';\n\t}", "public function edit(Action $action)\n {\n //\n }", "public function edit(Action $action)\n {\n //\n }", "function pprs_newsletter_action_row($actions, $post){\n if ($post->post_type ==\"newsletter\"){\n\n unset($actions['inline hide-if-no-js']); //Remove Quick Edit\n unset($actions['trash']); //Remove Trash\n }\n return $actions;\n}", "function bulk_actions( $which = '' ) {\n\t\tgive_log_views();\n\t}", "public function can_do_action_edit() {\n return true;\n }", "public function get_bulk_actions() {\r\n\t\t$actions = [\r\n\t\t\t'bulk-delete' => 'Delete'\r\n\t\t];\r\n\r\n\t\treturn $actions;\r\n\t}", "public function designation_bulk_action() {\n if ( ! $this->verify_current_page_screen( 'erp-hr', 'bulk-designations' ) ) {\n return;\n }\n\n // Check permission if not hr manager then go out from here\n if ( ! current_user_can( erp_hr_get_manager_role() ) ) {\n wp_die( esc_html__( 'You do not have sufficient permissions to do this action', 'erp' ) );\n }\n\n $employee_table = new \\WeDevs\\ERP\\HRM\\Designation_List_Table();\n $action = $employee_table->current_action();\n\n if ( $action ) {\n\n $req_uri_bulk = ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';\n $redirect = remove_query_arg( array(\n '_wp_http_referer',\n '_wpnonce',\n 'action',\n 'action2'\n ), $req_uri_bulk );\n\n switch ( $action ) {\n\n case 'designation_delete' :\n\n if ( isset( $_GET['desig'] ) && ! empty( $_GET['desig'] ) ) {\n $not_deleted_item = erp_hr_delete_designation( array_map( 'sanitize_text_field', wp_unslash( $_GET['desig'] ) ) );\n }\n\n if ( ! empty ( $not_deleted_item ) ) {\n $redirect = add_query_arg( array( 'desig_delete' => implode( ',', $not_deleted_item ) ), $redirect );\n }\n\n wp_redirect( $redirect );\n exit();\n }\n }\n }", "function content_lifecycle_delete_user_bulk_action(\\Elgg\\Hook $hook) {\r\n\t\r\n\treturn true;\r\n}", "protected function get_bulk_actions() {\n\t\treturn array();\n\t}", "public function entitlement_bulk_action() {\n if ( ! $this->verify_current_page_screen( 'erp-hr', 'bulk-entitlements' ) ) {\n return;\n }\n\n // Check permission\n if ( ! current_user_can( 'erp_leave_manage' ) ) {\n wp_die( esc_html__( 'You do not have sufficient permissions to do this action', 'erp' ) );\n }\n\n $employee_table = new \\WeDevs\\ERP\\HRM\\Entitlement_List_Table();\n $action = $employee_table->current_action();\n\n if ( $action ) {\n\n $req_uri = ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';\n\n $redirect = remove_query_arg( array(\n '_wp_http_referer',\n '_wpnonce',\n 'filter_entitlement'\n ), $req_uri );\n\n if ( $action == 'filter_entitlement' ) {\n wp_redirect( $redirect );\n exit();\n }\n\n if ( $action == 'entitlement_delete' ) {\n if ( isset( $_GET['entitlement_id'] ) && ! empty( $_GET['entitlement_id'] ) ) {\n $array = array_map( 'sanitize_text_field', wp_unslash( $_GET['entitlement_id'] ) );\n foreach ( $array as $key => $ent_id ) {\n erp_hr_delete_entitlement( $ent_id, 0, $ent_id );\n }\n }\n\n wp_redirect( $redirect );\n exit();\n\n }\n }\n }", "public function actionBulk()\n {\n $action = Yii::$app->request->post('action');\n $selection = (array)Yii::$app->request->post('selection');//typecasting\n switch ($action) {\n case 'd':\n if ($this->deleteAll($selection)) $message = Module::t('blog', 'Successfully delete');\n break;\n case 'c':\n if ($this->confirmAll($selection)) $message = Module::t('blog', 'Successfully confirm');\n break;\n default:\n $message = Module::t('blog', 'Action not found');\n }\n\n Yii::$app->session->setFlash('warning', $message);\n\n return $this->redirect('index');\n }", "public function get_bulk_actions() {\n $actions = [\n 'bulk-delete' => __('Delete', MWB_WPR_Domain)\n ];\n return $actions;\n }", "function wprss_custom_feed_item_bulk_actions( $actions ){\n return apply_filters( 'wprss_custom_feed_item_bulk_actions', $actions );\n }", "public function process_bulk_action() {\n\t\tif ( 'delete' === $this->current_action() ) {\n\t\t\t$this->delete_from_database( absint( $_GET['custom_element'] ) );\n\t\t}\n\n\t\t// If the delete bulk action is triggered\n\t\tif ( ( isset( $_GET['action'] ) && $_GET['action'] == 'bulk-delete' )\n\t\t\t|| ( isset( $_GET['action2'] ) && $_GET['action2'] == 'bulk-delete' )\n\t\t) {\n\t\t\t$delete_ids = esc_sql( $_GET['custom_element'] );\n\n\t\t\tif(empty($delete_ids))\n\t\t\t\treturn;\n\n\t\t\t// loop over the array of record IDs and delete them\n\t\t\tforeach ( $delete_ids as $id ) {\n\t\t\t\t$this->delete_from_database( absint( $id ) );\n\t\t\t}\n\t\t}\n\t}", "public function actionBulkUpdate() {\r\n\t\t\r\n\t}", "function action_links( $actions, $plugin_file, $plugin_data, $context ) {\n\t\tif ( isset( $actions['edit'] ) ) {\n\t\t\tunset( $actions['edit'] );\n\t\t}\n\n\t\treturn $actions;\n\t}", "public function bulkEditForm()\n {\n $crumbs = $this->Breadcrumbs();\n if ($crumbs && $crumbs->count() >= 2) {\n $one_level_up = $crumbs->offsetGet($crumbs->count() - 2);\n }\n\n $actions = new FieldList();\n\n $actions->push(\n FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all'))\n ->setAttribute('id', 'bulkEditingSaveBtn')\n ->addExtraClass('btn btn-success')\n ->setAttribute('data-icon', 'accept')\n ->setUseButtonTag(true)\n );\n\n $actions->push(\n FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel'))\n ->setAttribute('id', 'bulkEditingUpdateCancelBtn')\n ->addExtraClass('btn btn-danger cms-panel-link')\n ->setAttribute('data-icon', 'decline')\n ->setAttribute('href', $one_level_up->Link)\n ->setUseButtonTag(true)\n ->setAttribute('src', '')//changes type to image so isn't hooked by default actions handlers\n );\n\n $recordList = $this->getRecordIDList();\n $recordsFieldList = new FieldList();\n $config = $this->component->getConfig();\n\n $editingCount = count($recordList ?? []);\n $modelClass = $this->gridField->getModelClass();\n $singleton = singleton($modelClass);\n $titleModelClass = (($editingCount > 1) ? $singleton->i18n_plural_name() : $singleton->i18n_singular_name());\n\n //some cosmetics\n $headerText = _t(\n 'GRIDFIELD_BULKMANAGER_EDIT_HANDLER.HEADER_TEXT',\n 'Editing {count} {class}',\n array(\n 'count' => $editingCount,\n 'class' => $titleModelClass,\n )\n );\n $header = LiteralField::create(\n 'bulkEditHeader',\n '<h1 id=\"bulkEditHeader\">'.$headerText.'</h1>'\n );\n $recordsFieldList->push($header);\n\n $toggle = LiteralField::create(\n 'bulkEditToggle',\n '<span id=\"bulkEditToggle\">' . _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.TOGGLE_ALL_LINK', 'Show/Hide all') . '</span>'\n );\n $recordsFieldList->push($toggle);\n\n //fetch fields for each record and push to fieldList\n foreach ($recordList as $id) {\n $record = DataObject::get_by_id($modelClass, $id);\n $recordEditingFields = $this->getRecordEditingFields($record);\n\n $toggleField = ToggleCompositeField::create(\n 'RecordFields_' . $id,\n $record->getTitle(),\n $recordEditingFields\n )\n ->setHeadingLevel(4)\n ->setAttribute('data-id', $id)\n ->addExtraClass('bulkEditingFieldHolder');\n\n $recordsFieldList->push($toggleField);\n }\n\n $bulkEditForm = Form::create(\n $this,\n 'recordEditForm', //recordEditForm name is here to trick SS to pass all subform request to recordEditForm()\n $recordsFieldList,\n $actions\n );\n\n if ($crumbs && $crumbs->count() >= 2) {\n $bulkEditForm->Backlink = $one_level_up->Link;\n }\n\n //override form action URL back to bulkEditForm\n //and add record ids GET var\n $bulkEditForm->setAttribute(\n 'action',\n $this->Link('bulkEditForm?records[]='.implode('&', $recordList))\n );\n\n return $bulkEditForm;\n }", "public function process_bulk_actions() {\n\n\t\t$ids = isset( $_GET['form_id'] ) ? $_GET['form_id'] : array();\n\n\t\tif ( ! is_array( $ids ) ) {\n\t\t\t$ids = array( $ids );\n\t\t}\n\n\t\t$ids = array_map( 'absint', $ids );\n\t\t$action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; // phpcs:ignore\n\n\t\t// Checking the sortable column link.\n\t\t$is_orderby_link = ! empty( $_REQUEST['orderby'] ) && ! empty( $_REQUEST['order'] );\n\n\t\tif ( empty( $ids ) || empty( $action ) || $is_orderby_link ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Delete one or multiple forms - both delete links and bulk actions.\n\t\tif ( 'delete' === $this->current_action() ) {\n\n\t\t\tif (\n\t\t\t\twp_verify_nonce( $_GET['_wpnonce'], 'bulk-forms' ) ||\n\t\t\t\twp_verify_nonce( $_GET['_wpnonce'], 'wpforms_delete_form_nonce' )\n\t\t\t) {\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\twpforms()->form->delete( $id );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div class=\"notice updated\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( count( $ids ) === 1 ) {\n\t\t\t\t\t\t\tesc_html_e( 'Form was successfully deleted.', 'wpforms-lite' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tesc_html_e( 'Forms were successfully deleted.', 'wpforms-lite' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<div class=\"notice updated\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php esc_html_e( 'Security check failed. Please try again.', 'wpforms-lite' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\n\t\t// Duplicate form - currently just delete links (no bulk action at the moment).\n\t\tif ( 'duplicate' === $this->current_action() ) {\n\n\t\t\tif ( wp_verify_nonce( $_GET['_wpnonce'], 'wpforms_duplicate_form_nonce' ) ) {\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\twpforms()->form->duplicate( $id );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div class=\"notice updated\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( count( $ids ) === 1 ) {\n\t\t\t\t\t\t\tesc_html_e( 'Form was successfully duplicated.', 'wpforms-lite' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tesc_html_e( 'Forms were successfully duplicated.', 'wpforms-lite' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<div class=\"notice updated\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<?php esc_html_e( 'Security check failed. Please try again.', 'wpforms-lite' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}", "protected function afterEdit()\n {\n }", "function edit_actions(&$action,&$parent,&$content,$child_id)\n\t{\n\t\tswitch ($action)\n\t\t{\n\t\t\tcase 'paste':\n\t\t\tcase 'swap':\n\t\t\t\t$clipboard = $GLOBALS['egw']->session->appsession('clipboard','etemplate');\n\t\t\t\tif (!is_array($clipboard))\n\t\t\t\t{\n\t\t\t\t\treturn lang('nothing in clipboard to paste !!!');\n\t\t\t\t}\n\t\t\t\tif ($action == 'swap')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['egw']->session->appsession('clipboard','etemplate',$content['cell']);\n\t\t\t\t}\n\t\t\t\t$content['cell'] = $clipboard;\n\t\t\t\tbreak;\n\n\t\t\tcase 'copy':\n\t\t\tcase 'cut':\n\t\t\t\t$GLOBALS['egw']->session->appsession('clipboard','etemplate',$content['cell']);\n\t\t\t\tif ($action != 'cut')\n\t\t\t\t{\n\t\t\t\t\treturn lang('widget copied into clipboard');\n\t\t\t\t}\n\t\t\t\t// fall-through\n\t\t\tcase 'delete':\n\t\t\t\tif ($parent['type'] != 'grid')\n\t\t\t\t{\n\t\t\t\t\t// delete widget from parent\n\t\t\t\t\tif ($parent['type'])\t// box\n\t\t\t\t\t{\n\t\t\t\t\t\tlist($num,$options) = explode(',',$parent['size'],2);\n\t\t\t\t\t\tif ($num <= 1)\t// cant delete last child --> only empty it\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$parent[$num=1] = boetemplate::empty_cell();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor($n = $child_id; $n < $num; ++$n)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$parent[$n] = $parent[1+$n];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($parent[$num--]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parent['size'] = $num . ($options ? ','.$options : '');\n\t\t\t\t\t}\n\t\t\t\t\telse\t// template itself\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count($this->etemplate->children) <= 1)\t// cant delete last child\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->etemplate->children[0] = boetemplate::empty_cell();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($parent[$child_id]);\n\t\t\t\t\t\t\t$this->etemplate->children = array_values($this->etemplate->children);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$action = 'save-no-merge';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content['cell'] = boetemplate::empty_cell();\n\t\t\t\t\treturn lang('cant delete a single widget from a grid !!!');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn '';\n\t}", "public function delete_and_edit() {\n\t\t$get = $this->input->get(array(\n\t\t\t'id' => '',\t\t\t\n\t\t));\n\t\tif ( ! empty($get['id']) ) {\n\t\t\t$import = new PMXI_Import_Record();\n\t\t\t$import->getById($get['id']);\n\t\t\tif ( ! $import->isEmpty() ) {\n\t\t\t\t$import->deletePosts(false);\n\t\t\t\t$options = $import->options;\n\t\t\t\tif ( empty($import->options['custom_type']) || $import->options['custom_type'] != 'shop_order') {\n\t\t\t\t\t$options['unique_key'] = '';\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t$import->set(array(\n\t\t\t\t\t'options' => $options,\n\t\t\t\t\t'imported' => 0,\n\t\t\t\t\t'created' => 0,\n\t\t\t\t\t'updated' => 0,\n\t\t\t\t\t'skipped' => 0,\n\t\t\t\t\t'deleted' => 0\n\t\t\t\t))->save();\t\n\t\t\t}\n\t\t}\n\t\tif ( ! empty($import->options['custom_type']) && $import->options['custom_type'] == 'shop_order') {\n\t\t\twp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'edit'), $this->baseUrl)); die();\n\t\t} else {\n\t\t\twp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'options'), $this->baseUrl)); die();\n\t\t}\t\t\n\t}", "public function get_bulk_actions()\n\t{\n\t\t$actions = [\n\t\t\t'bulk-delete' => 'Delete'\n\t\t];\n\n\t\treturn $actions;\n\t}", "public function process_bulk_action() {\r\n\r\n if ( 'delete' === $this->current_action() ) {\r\n\r\n $nonce = esc_attr( $_REQUEST['_wpnonce'] );\r\n\r\n if ( ! wp_verify_nonce( $nonce, 'opalmembership-delete-user' ) ) {\r\n wp_die( __( 'System could not delete user.', 'opalmembership' ) );\r\n } else {\r\n $this->delete_user( absint( $_GET['user'] ) );\r\n }\r\n }\r\n\r\n /**\r\n * delete multi users\r\n */\r\n if ( ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'bulk-delete' ) || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-delete' ) ) {\r\n\r\n $delete_ids = esc_sql( $_REQUEST['bulk-delete'] );\r\n\r\n foreach ( $delete_ids as $id ) {\r\n $this->delete_user( $id );\r\n }\r\n\r\n }\r\n }", "public function gp_modify_actions() {\n\t\t\tremove_action( 'generate_before_content', 'generate_featured_page_header_inside_single', 10 );\n\t\t}", "function get_bulk_actions() {\n $actions = array(\n 'update_amazon_feed' => __( 'Update feed status from Amazon', 'wp-lister-for-amazon' ),\n 'cancel_amazon_feed' => __( 'Cancel submitted feeds', 'wp-lister-for-amazon' ),\n 'delete_amazon_feed' => __( 'Delete selected feeds', 'wp-lister-for-amazon' )\n );\n return $actions;\n }", "public function remove_page_list_edit_link( $actions, $post ) {\n /**\n * If:\n * -The limited user is logged in\n * -The page is not in the allowed list\n * ...Remove the \"Edit\", \"Quick Edit\", and \"Trash\" quick links.\n */\n if ( \n $this->is_user_limited() &&\n !$this->is_page_allowed( $post->ID )\n ) {\n unset( $actions['edit'] );\n unset( $actions['inline hide-if-no-js']);\n unset( $actions['trash'] );\n }\n return $actions;\n }", "function get_bulk_actions( ) {\r\n\t\t$actions = array();\r\n\r\n\t\t$actions['select'] = __( 'Select these entries', 'media-library-assistant' );\r\n\r\n\t\treturn $actions;\r\n\t}", "public function excluirAction(){}", "public function employee_bulk_action() {\n // Nonce validation\n if ( ! $this->verify_current_page_screen( 'erp-hr', 'bulk-employees' ) ) {\n return;\n }\n\n // Check permission if not hr manager then go out from here\n if ( ! current_user_can( 'erp_view_list' ) ) {\n wp_die( esc_html__( 'You do not have sufficient permissions to do this action', 'erp' ) );\n }\n\n $employee_table = new \\WeDevs\\ERP\\HRM\\Employee_List_Table();\n $action = $employee_table->current_action();\n\n if ( $action ) {\n\n $req_uri_bulk = ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';\n\n $redirect = remove_query_arg( array(\n '_wp_http_referer',\n '_wpnonce',\n 'filter_employee'\n ), $req_uri_bulk );\n\n switch ( $action ) {\n\n case 'delete' :\n\n if ( isset( $_GET['employee_id'] ) && ! empty( $_GET['employee_id'] ) ) {\n erp_employee_delete( array_map( 'sanitize_text_field', wp_unslash( $_GET['employee_id'] ) ), false );\n }\n\n wp_redirect( $redirect );\n exit();\n\n case 'permanent_delete' :\n if ( isset( $_GET['employee_id'] ) && ! empty( $_GET['employee_id'] ) ) {\n erp_employee_delete( array_map( 'sanitize_text_field', wp_unslash( $_GET['employee_id'] ) ), true );\n }\n\n wp_redirect( $redirect );\n exit();\n\n case 'restore' :\n if ( isset( $_GET['employee_id'] ) && ! empty( $_GET['employee_id'] ) ) {\n erp_employee_restore( array_map( 'sanitize_text_field', wp_unslash( $_GET['employee_id'] ) ) );\n }\n\n wp_redirect( $redirect );\n exit();\n\n case 'filter_employee':\n wp_redirect( $redirect );\n exit();\n\n case 'employee_search':\n $redirect = remove_query_arg( array( 'employee_search' ), $redirect );\n wp_redirect( $redirect );\n exit();\n }\n }\n }", "function recordActions(&$record, &$actions, &$mraactions)\n\t{\n\t\t// remove all actions for main 3 initial records\n\t\tif (is_numeric($record['id']) && $record['id']<=1002)\n\t\t{\n\t\t\t//$actions[\"view\"] = '';\n\t\t\t//$actions[\"edit\"] = '';\n\t\t\t$actions[\"delete\"] = '';\n\t\t}\n\t}", "function recordActions(&$record, &$actions, &$mraactions)\n\t{\n\t\t// remove all actions for main initial record\n\t\tif (is_numeric($record['id']) && $record['id']<=1000)\n\t\t{\n\t\t\t$actions[\"view\"] = '';\t // because of doctype_main\n\t\t\t$actions[\"edit\"] = '';\t // because of doctype_main\t\n\t\t\t$actions[\"delete\"] = '';\n\t\t}\n\t}", "public function editAction()\r\n {\r\n $this->_forward('add');\r\n }", "public function customer_bulk_actions() {\n if ( ! isset( $_GET['page'] ) || $_GET['page'] !== JPID_Admin_Page_Customer_List::SLUG ) {\n return;\n }\n\n $wp_list_table = new WP_List_Table;\n $current_action = $wp_list_table->current_action();\n\n if ( $current_action === false ) {\n return;\n }\n\n switch ( $current_action ) {\n case 'delete_customers':\n break;\n }\n }", "public function getBatchActions()\n {\n $actions = parent::getBatchActions();\n unset($actions['delete']);\n\n return $actions;\n }" ]
[ "0.70732254", "0.7068604", "0.7001062", "0.69290143", "0.6867184", "0.6829638", "0.68172467", "0.6808969", "0.6802888", "0.6777958", "0.67661995", "0.6739401", "0.667798", "0.66235363", "0.66135955", "0.6605803", "0.658333", "0.65452486", "0.65304226", "0.6527191", "0.6527191", "0.65170497", "0.6505348", "0.6496171", "0.6491928", "0.6487247", "0.6467053", "0.64623266", "0.64432746", "0.64389235", "0.64350146", "0.6425273", "0.6410418", "0.6409268", "0.63890356", "0.6385458", "0.6384404", "0.63740236", "0.63697636", "0.6363193", "0.6361028", "0.63335717", "0.63288397", "0.62983346", "0.62951285", "0.6281805", "0.6254564", "0.625215", "0.62475204", "0.62367135", "0.62367135", "0.62367135", "0.62367135", "0.62367135", "0.6213599", "0.62047565", "0.6202325", "0.6188257", "0.6181007", "0.61745435", "0.6143323", "0.6134528", "0.6125509", "0.611352", "0.60845745", "0.6080111", "0.6078795", "0.6078795", "0.6075054", "0.60691535", "0.6054434", "0.60519224", "0.6046361", "0.60387224", "0.6034521", "0.6026257", "0.6018936", "0.5999308", "0.5997069", "0.5983303", "0.5980676", "0.5977261", "0.5969826", "0.596011", "0.5941201", "0.5938866", "0.59351003", "0.5928238", "0.5915391", "0.5914096", "0.59127903", "0.590978", "0.5889632", "0.588411", "0.58800673", "0.5869032", "0.5867329", "0.5855966", "0.5855025", "0.5854563" ]
0.80539167
0
Login customer and open Order page.
Авторизуйтесь как клиент и откройте страницу Заказа.
protected function loginCustomerAndOpenOrderPage(Customer $customer) { $this->cmsIndex->open(); $loginCustomerOnFrontendStep = $this->objectManager->create( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $customer] ); $loginCustomerOnFrontendStep->run(); $this->cmsIndex->getLinksBlock()->openLink('My Account'); $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logInCustomer()\r\n {\r\n\r\n // validate credentials\r\n $user = $this->model->check(Input::post('username'), Input::post('password'));\r\n\r\n // get customer name by email\r\n $customer_name = Elements::call('Customers/CustomersController')\r\n ->model->where('email', $user->username)->first()->name;\r\n\r\n if ($user === FALSE) {\r\n\r\n Redirect::withNotice('Invalid Username or Password', 'error')\r\n ->toDefault();\r\n } elseif ($user->enabled != 'yes') {\r\n\r\n Redirect::withNotice('Your account has been disabled. '\r\n . 'Please contact the administrator', 'error')\r\n ->to(Input::post('destination'));\r\n } else {\r\n\r\n Session::delete('step_feed');\r\n $attributes = [\r\n 'id' => $user->id,\r\n 'user_id' => $user->id,\r\n 'customer_name' => $customer_name,\r\n 'customer_id' => $user->customers_id,\r\n 'acl' => $user->acl,\r\n 'loggedin' => time()\r\n ];\r\n\r\n $this->user()->mapAttributes($attributes);\r\n\r\n //attach role to user\r\n $role = $this->auth->getRoleByAlias($user->acl);\r\n $this->user()->attachRole($role);\r\n\r\n $this->user()->addPermissions($user->permissions);\r\n\r\n Session::set('user_id', $user->id);\r\n Session::set('customer_name', $customer_name);\r\n Session::set('accesslevels_id', $user->accesslevels_id);\r\n Session::set('customer_id', $user->customers_id);\r\n Session::add('logid', Session::id());\r\n\r\n // redirect user to step two\r\n Redirect::withNotice('You have been successfully logged in.', 'success')\r\n ->to(Input::post('destination'));\r\n }\r\n }", "public function loginAction() {\n\n $username = $this->getRequest()->getParam('username');\n $password = $this->getRequest()->getParam('password');\n\n $websiteId = Mage::app()->getWebsite()->getId();\n $store = Mage::app()->getStore();\n\n $customer = Mage::getModel(\"customer/customer\");\n\n $customer->setWebsiteId($websiteId)\n ->setStore($store);\n\n if($customer->authenticate($username,$password)){\n echo 'yoo';\n }\n else{\n echo 'wuu';\n }\n }", "public function customerLogin(Varien_Event_Observer $observer)\n { \n \t\tif (Mage::helper('redirection')->isEnabled()){\t\n \t\t\t$lasturl = Mage::getSingleton('core/session')->getLastUrl();\n\t \tif (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout') === false){\n\t\t \tif (! preg_match(\"#customer/account/create#\", $lasturl) && Mage::helper('redirection')->isoptionEnabled('login_redirection')) {\n\t\t\t\t \t\tif($this->_CustomerGroup()) {\n\t\t\t\t \t\t$_session = $this->_getSession();\n\t\t\t\t \t\t$_session->setBeforeAuthUrl(Mage::helper('redirection')->setRedirectOnLogin());\n\t\t\t \t\t\t}\n\t\t\t\t}\n\t\t\t}\n \t}\n }", "public function goToLogin() {\n $loginValues = [\"formHeader\" => \"Login\", \"formAction\" => \"tryToLogin\"];\n require('view/frontend/loginForm.php');\n }", "public function login() {\n\t\treturn view('customer.Logincustomer');\n\t}", "public function login()\n {\n $this->_rootElement->find($this->loginButton)->click();\n }", "public function login_customer(){\n $customer_id = '';\n $customer = OsAuthHelper::login_customer($this->params['email'], $this->params['password']);\n if($customer){\n $this->booking = new OsBookingModel();\n $this->booking->customer = $customer;\n $this->booking->customer_id = $customer->id;\n $this->vars['booking'] = $this->booking;\n $this->vars['no_params'] = true;\n $this->vars['custom_fields_for_customer'] = OsCustomFieldsHelper::get_custom_fields_arr('customer');\n $response_html = $this->render($this->get_view_uri('steps/_contact'), 'none');\n $status = LATEPOINT_STATUS_SUCCESS;\n $customer_id = $customer->id;\n }else{\n $status = LATEPOINT_STATUS_ERROR;\n $response_html = __('Lo sentimos algo anda mal con los datos ingresados.', 'latepoint');\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html, 'customer_id' => $customer_id));\n }\n }", "public function login()\n {\n //todo Data::__call() doesn't work on $this-data\n $data = $this->data;\n\n // Set view templates.\n $this->view->set('login_template', $data, ['login_form']);\n\n // Get page's specific data.\n $data('title', 'Авторизация');\n $data('login.form', $this->model->processForm());\n\n //todo Better session handling. Move to router, create method redirect; for generate too?\n if ($this->model->isLogged()) {\n $this->router->redirect('plan.index');\n }\n\n $this->view->render();\n }", "public function login()\n {\n //Display Login Form\n return view('fornt.customer.login');\n }", "public function doLogin()\n\t{\n\t\t/*\t $do=$_GET['do'];\n\t\t$action=$_GET['action'];\n\t\t$this->page->assign(\"do\",$do);\n\t\t$this->page->assign(\"action\",$action); */\n\t\t$res = $this->businessFacade->businessLogin($_POST);\n\t\tif($res['result'] && getSession('client_access') == \"Business\" && (getSession(\"status\")!=\"I\"))\n\t\t{\n\t\t\t$this->request->redirect(\"Business\",\"showhomePageBusiness\");\n\t\t}else{\n\t\t\t$this->request->setAttribute(\"message\", $res['message']);\n\t\t\t$this->login();\n\t\t}\n\t}", "public function login() {\n $view = new Login();\n $view->display();\n }", "public function doLoginAction() {\n $this->AuthenticationService->doLogin();\n header('Location: /' . $this->Configuration->get(\"www.uri\"));\n die;\n }", "public function login(){\r\n\t\t$returnTo = $this->input->get('returnTo');\r\n\t\t$re = !$returnTo ? site_url() . \"/page/overview\" : $returnTo;\r\n\r\n\t\t//SSO starts here\r\n\r\n\t\t$this->auth->login($re);\r\n\t}", "public function execute()\r\n {\r\n if ($this->_objectManager->get('Magento\\Customer\\Model\\Session')->isLoggedIn()) {\r\n return $this->resultRedirectFactory->create()->setPath('customer/account/');\r\n }\r\n $resultPage = $this->resultPageFactory->create();\r\n $resultPage->getConfig()->getTitle()->set(__('Orders'));\r\n $this->_objectManager->get('Magento\\Sales\\Helper\\Guest')->getBreadcrumbs($resultPage);\r\n return $resultPage;\r\n }", "public function checkout()\n\t{\n\t\t\n\t\t$this->user_order->checkout();\n\t\t$this->load->view('User_view_order');\n\t}", "public function login_customer() {\n\t\t\t$input = $this->input->post();\n\t\t\t$isValid = $this->Customer->login($input, \"customer\");\n\t\t\tif ($isValid) {\n\t\t\t\tredirect(\"/\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->session->set_flashdata(\"is_login_register\",\"login\");\n\t\t\t\tredirect(\"customers/to_login_register\");\n\t\t\t}\n\t\t}", "public function loginAction()\n {\n $pageTitle = 'Login';\n $loginLinkStyle = 'current_page';\n\n require_once __DIR__ . '/../templates/login.php';\n }", "public function frontLoginCustomer(array $loginData)\n {\n $this->logoutCustomer();\n $this->clickControl('link', 'log_in');\n $this->fillForm($loginData);\n $this->clickButton('login');\n }", "public function orders ()\n {\n if (User::isLoggedIn()) {\n \n // Wenn ja, User aus DB abfragen\n $user = User::getLoggedInUser();\n\n // Alle Orders vom User laden\n $orders = Order::findByUser($user->id);\n\n // Passenden View laden\n View::load('account-orders', [\n 'orders' => $orders\n ]);\n } else {\n \n // Wenn User nicht eingeloggt ist, auf Login Seite leiten\n header(\"Location: login\");\n }\n }", "public function testViewOrderAsLoggedIn()\n {\n $this->login(1);\n $this->getRequest()->setMethod(Request::METHOD_POST);\n $this->dispatch('sales/guest/view/');\n $this->assertRedirect($this->stringContains('sales/order/history/'));\n }", "public function login(){\n\t\t/// Send the user to this view\n\t\t$this->render(\"login\");\n\t}", "protected function loginUser() {\n\t\tif ($this->verifyUserCredentials() == true) {\n\t\t\t/**\n\t\t\t * Load User Session\n\t\t\t */\n\t\t\t$this->loadUserSession($this->_userInputUid, $this->_userInputPwd);\n\t\t\t/**\n\t\t\t * Load the form if the package selected by user is a print package else redirect to payment gateway\n\t\t\t */\n\t\t\t$this->_queryResult = $this->getSubscriptionPackages($this->_pkgId);\n\t\t\tif ($this->_queryResult['subscription_type'] == 'magazine') {\n\t\t\t\t$this->_details['data'] = $this->getMagazineDeliveryForm();\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * if the verification is complete redirect the form to the payment gateway\n\t\t\t\t */\n\t\t\t\t$this->_details['data'] = 'redirect';\n\t\t\t}\n\t\t\techo json_encode($this->_details);\n\t\t} else {\n\t\t\techo json_encode(array('error' => 'generic'));\n\t\t}\n\t}", "public function customerLogin() {\n global $lang;\n if ($this->hasCart) {\n $this->request->vars = $this->cart;\n $this->request->type = 'post';\n $this->request->method = '/rest/cart/login';\n $this->doCall();\n $this->setCart();\n return true;\n } else {\n throw new Exception($lang['ultracart']['cart']['notReady'], 2000);\n }\n }", "public function vieworderAction(){\n \t/**\n \t * check license key\n \t */\n \tMage::helper('marketplace')->checkMarketplaceKey();\n \t\n \t/**\n \t * Initilize customer and seller group id\n \t*/\n \t$customerGroupId = $sellerGroupId = $customerStatus = '';\n \t$customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();\n \t$sellerGroupId = Mage::helper('marketplace')->getGroupId();\n \t$customerStatus = Mage::getSingleton('customer/session')->getCustomer()->getCustomerstatus();\n \t\n \tif (!Mage::getSingleton('customer/session')->isLoggedIn() && $customerGroupId != $sellerGroupId) {\n \t\tMage::getSingleton('core/session')->addError($this->__('You must have a Seller Account to access this page'));\n \t\t$this->_redirect('marketplace/seller/login');\n \t\treturn false;\n \t}\n \t/**\n \t * Checking whether customer approved or not\n \t */\n \tif ($customerStatus != 1) {\n \t\tMage::getSingleton('core/session')->addError($this->__('Admin Approval is required. Please wait until admin confirms your Seller Account'));\n \t\t$this->_redirect('marketplace/seller/login');\n \t\treturn false;\n \t}\t\n \t\n \t$orderId = $this->getRequest()->getParam('orderid');\n \t\n \t$orderPrdouctIds = Mage::helper('marketplace/vieworder')->getOrderProductIds(Mage::getSingleton('customer/session')->getId(),$orderId);\n \tif(count($orderPrdouctIds) <= 0){\n \t$this->_redirect('marketplace/order/manage');\n \treturn false;\n \t}\n\n \t$collection = Mage::getModel('marketplace/commission')->getCollection()\n \t->addFieldToFilter('seller_id',Mage::getSingleton('customer/session')->getId())\n \t->addFieldToFilter('order_id',$orderId) \n \t->getFirstItem();\n \t\n \tif(count($collection) >=1 && $collection->getOrderId() == $orderId){ \n $this->loadLayout();\n $this->renderLayout(); \n \t }else{\n \t Mage::getSingleton('core/session')->addError($this->__('You do not have permission to access this page'));\n \t $this->_redirect('marketplace/order/manage');\n \t return false;\n } \n }", "public function loginAction() {\n\t\t//figure out where the user came from\n\t\t$session = Mage::getSingleton('customer/session');\n\t\tif (!$session->getData('fbc_refer') && isset($_SERVER['HTTP_REFERER'])) {\n\t\t\t$session->setData('fbc_refer', $_SERVER['HTTP_REFERER']);\n\t\t}\n\t\t//get SSL aware attributes\n\t\tif ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) {\n\t\t\t$forceSecure = TRUE;\n\t\t} else {\n\t\t\t$forceSecure = FALSE;\n\t\t}\n\t\t$locale = Mage::getStoreConfig('general/locale/code');\n\t\t$urlParams = array();\n\t\t$urlParts = array();\n\t\t$urlParams['return_session'] = 1;\n\t\t$urlParams['fbconnect'] = 1;\n\t\t$urlParams['extern'] = 2;\n\t\t$urlParams['display'] = 'popup';\n\t\t$urlParams['api_key'] = urlencode(Mage::getStoreConfig('metrof_fbc/fbconnect/apikey'));\n\t\t$urlParams['next'] = urlencode(Mage::getUrl('fbc/index/xdreceiver', array('_forced_secure'=>$forceSecure)));\n\t\t$urlParams['cancel_url'] = urlencode(Mage::getUrl('*'));\n\t\t$urlParams['fname'] = '_opener';\n\t\t$urlParams['locale'] = $locale;\n\t\t$urlParams['channel_url'] = urlencode(Mage::getUrl('fbc/index/xdreceiver', array('_forced_secure'=>$forceSecure)));\n\t\t$url = 'http://www.facebook.com/login.php?';\n\n\t\tforeach ($urlParams as $_k => $_v) {\n\t\t\t$urlParts[] = $_k.'='.$_v;\n\t\t}\n\t\t$url .= implode('&', $urlParts);\n\t\theader('Location: '.$url);\n\t\texit();\n\n\t}", "private function doCentralLogin()\n {\n //echo \"<hr>\" . __FUNCTION__ . '<br>';\n $this->EXTconnect();\n $this->token_username = $this->token['username'];\n $this->token_password = $this->token['password'];\n //$this->token_password = $this->token['password'];\n $tabella = '`dr_customers`';\n $campi = '*';\n $where = 'WHERE cod_cli = \"' . $this->token_username . '\" AND\n password = \"' . $this->token_password . '\"';\n $order = '';\n $limit = '';\n $num_record = 0;\n $riga = array();\n utils::SelectTabelle($tabella, $campi, $where, $order, $limit, $num_record, $riga, false);\n //utils::trace($riga);\n if (!empty($riga[0]['id'])) {\n // check expiration date\n $date = new DateTime();\n $date2 = new DateTime($riga['expiration_date']);\n $expirationTS = $date2->getTimestamp();\n //$check = $this->checkExpirationDate($expirationTS);\n $todayTS = $date->getTimestamp();\n // check expiration of licence\n if ($expirationTS < $todayTS):\n extractor::writeXML('<error><![CDATA[ko | Licenza scaduta]]></error>');\n\n endif;\n $_SESSION['customer']['user_id'] = $riga[0]['id'];\n $_SESSION['customer']['login_date'] = $date->getTimestamp();\n $_SESSION['customer']['customerName'] = $riga[0]['customer_name'];\n $_SESSION['customer']['login'] = $riga[0]['cod_cli'];\n $_SESSION['customer']['auth'] = true;\n $_SESSION['customer']['IP'] = $_SERVER['REMOTE_ADDR'];\n\n //$this->updateStatusLicences('+1');\n //extractor::trace($_SESSION);\n extractor::writeXML('<result_login><![CDATA[ok]]></result_login>');\n exit();\n } else {\n extractor::writeXML('<result_login><![CDATA[ko | Errore di autenticazione]]></result_login>');\n exit();\n }\n $this->EXTdisconnect();\n }", "public function login(){\n\t\t//incluimos un arreglo que contendra toda la informacion que se enviara al home\n\t\t$data['page_title'] = \"Login\";\n\t\t$data['page_userImg'] = \"usuario/default.png\";\n\t\t$data['page_userNomb'] = \"William Enrique\";\n\t\t$data['page_userRol'] = \"Administrador\";\n\t\t$data['page_name'] = \"login\";\n\t\t$data['page_functions'] = \"functionLogin.js\";\n\t\t$this->views->getViews($this, \"login\", $data);\n\t}", "public function loginAction()\n\t{\n\t\t$autoLogin = Mage::getSingleton('wordpress/system_config_backend_autologin');\n\n\t\t$username = $autoLogin->getUsername();\n\t\t$password = $autoLogin->getPassword();\n\t\t\n\t\ttry {\n\t\t\tif (!$username || !$password) {\n\t\t\t\tthrow new Exception($this->__('WordPress Admin details not set.'));\n\t\t\t}\n\t\t\t\n\t\t\tMage::helper('wordpress/system')->loginToWordPress($username, $password, Mage::helper('wordpress')->getAdminUrl());\n\t\t\texit;\n\n\t\t\t$this->_redirectUrl(Mage::helper('wordpress')->getAdminUrl('index.php'));\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tMage::helper('wordpress')->log($e);\n\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n\t\t\t\n\t\t\t$this->_redirect('adminhtml/system_config/edit', array('section' => 'wordpress'));\n\t\t}\n\t}", "public function login(){\n\t\t$this->load->view(\"admin/super/header\");\n\t\t$this->load->view(\"admin/super/modallogin\");\n\t\t$this->load->view(\"admin/super/footer\");\n\t}", "public function showLogin()\n {\n if (App::loggedIn()) {\n App::redirect(URL_BASE.'community');\n }\n $app = App::getInstance();\n\n $app->template->addValidation();\n $app->template->addRequiredJs('pages/account/login.js');\n $app->template->render('Account/Login.php');\n }", "public function loginAction () \n\t{\n\t\t$this->di->theme->setTitle('Login');\n\n\t\t\n\t\t$form = new \\Anax\\Users\\CFormLogin($this->users);\n\t\t$form->setDI($this->di);\n\t\t$form->check(); \n\t\t\n\t\t\n // Prepare the page content\n\n $this->views->add('users/login', [\n 'content' => $form->getHTML(),\n ]);\n\t\t\n\t\t\n\n\t\t\t\n\t\t\n\t}", "public function index()\n\t{\n\t\t//if($this->session->userdata('user_id'))\n\t\t\t//return redirect('admin/dashboard');\n\t\t$id=$this->session->userdata('user_id');\n\n\t\t$this->load->view('customer/public_login.php',['id'=>$id]);\n\t}", "protected function loginAction() {\n\t\t$oSession = $this->getRequest()->getSession();\n\t\tif ( $oSession->isLoggedIn() ) {\n\t\t\t$this->setAction(self::ACTION_AUTHORISED);\n\t\t\t$this->loggedInAction();\n\t\t} else {\n\t\t\t$oView = new accountView($this);\n\t\t\t$oView->showLoginPage();\n\t\t}\n\t}", "public function actionLogin()\n {\n if ((isset( $_COOKIE[\"name\"])) && (isset( $_COOKIE[\"id\"]))){\n $this->redirect('index.php');\n }\n $this->layout = false;\n $model = new Customers();\n\n if ((isset($_POST['Username'])) && (isset($_POST['Password']) && !$_POST['identity'])){\n $customer = Customers::findOne(['UserName' => $_POST['Username'], 'Passport' => $_POST['Password']]);\n if ($customer) {\n setcookie(\"name\", $customer->UserName);\n setcookie(\"id\", $customer->CustomerId);\n setcookie(\"type\", 0);\n $this->redirect('index.php');\n } else {\n $this->redirect('index.php?r=customers/login');\n }\n }\n\n if ((isset($_POST['Username'])) && (isset($_POST['Password']) && $_POST['identity'])){\n\n $stuff = Stuffs::findOne(['UserName' => $_POST['Username'], 'Passort' => $_POST['Password']]);\n if ($stuff) {\n setcookie(\"name\", $stuff->UserName);\n setcookie(\"id\", $stuff->StuffId);\n setcookie(\"type\", 1);\n $this->redirect('index.php?r=stuff/update&id=' . $stuff->StuffId);\n } else {\n $this->redirect('index.php?r=customers/login');\n }\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->CustomerId]);\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "function ExecuteCustomerLogin(){\n\t\t\n\t\t# check for customer credentials based on $_POST[] fields\n \t$Result=DBi::$conn->prepare(\"SELECT \t\t\t\t `tblCustomer`.`CustomerID`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t `tblCustomer`.`CustomerFullNAME` \n\t\t\t\t\t \t\t\t FROM\t \t`\"._DB_NAME.\"`.`tblCustomer` \n\t\t\t\t\t \t\t\t WHERE\t\t\t\t\t `tblCustomer`.`CustomerLoginID` \t= ?\n AND \t\t \t\t\t `tblCustomer`.`CustomerPASSWORD`\t= md5(?)\n AND \t\t \t\t\t `tblCustomer`.`CustomerSTATUS` = 1\");\n\t\t\t\n\t\t$Result->bind_param(\"ss\",$_POST['txtUserID'],$_POST['txtPass']);\n\t\t$Result->execute();\n $Result->store_result();\n\n # check for valid return and set $VARS to session\n if ($Result->num_rows == 1 ){\n\n\t \t$Result->bind_result($this->CUSTOMER_ID,$this->CUSTOMER_FULL_NAME);\n \n while ($Result->fetch()){\t\n\t\t\t\n\t $_SESSION['customerid'] \t\t= $this->CUSTOMER_ID;\n\t $_SESSION['customername']\t\t= $this->CUSTOMER_FULL_NAME;\n\t\t\t\t$_SESSION['GLOBAL_ACCESS'] = True;\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\n\t\t\t# redirect to user page after process is completed \n header('location: ' . _BASE_URL . '/warranty/ViewCustomersClaims.php');\n\n\t\t}else{\n\n\t\t\t# redirect with a error mesg if invalid login\n\t\t\theader('location: '._BASE_URL.'/home/Login.php?errorMssg='._SHOWALERT_INVALID_LOGIN.'');\n\t\t}\n\t}", "public function login()\n {\n $this -> load -> view('common/login');\n }", "public function login()\n\t{\n\t\t$vendor_info['username'] = $this->input->post('username');\n\t\t$vendor_info['password'] = $this->input->post('password');\n\t\tif (!$this->vendor->get_vendor($vendor_info)) \n\t\t{\n\t\t\techo 'Something went wrong';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$current_vendor['info'] = $this->vendor->get_vendor($vendor_info);\n\t\t\t$this->session->set_userdata($current_vendor['info']);\n\t\t\tredirect('/vendor/dashboard');\n\t\t}\n\t}", "protected function login(){\n $this->browser->visit($this->defaults['domain'] . $this->defaults['page']['login']);\n $this->page = $this->browser->getPage();\n $this->page->findById('edit-email')->setValue($this->email);\n $this->page->findById('edit-password')->setValue($this->pass);\n $this->page->findById('account-api-form')->submit();\n }", "public function loginAction()\n\t\t{\n\t\t\tZend_Layout::getMvcInstance()->setLayout( 'admin-login' );\n\t\t\t$config = Config::getInstance();\n\t\t\t// Process a form request.\n\t\t\tif ( $this->getRequest()->isPost() ) {\n\t\t\t\t// Get an admin.\n\t\t\t\t$admin = Table::_( 'admins' )->getAdmin(\n\t\t\t\t\t$this->_getParam( 'nickname' )\n\t\t\t\t);\n\t\t\t\tif ( $admin ) {\n\t\t\t\t\t// Check password.\n\t\t\t\t\t$password = trim( mcrypt_decrypt( MCRYPT_DES, $config->crypt->key, $admin->password, MCRYPT_MODE_ECB ) );\n\t\t\t\t\tif ( $password == $this->_getParam( 'password' ) ) {\n\t\t\t\t\t\t// Log in and go to dashboard.\n\t\t\t\t\t\t$session = new Zend_Session_Namespace( 'pc.admin' );\n\t\t\t\t\t\t$session->admin = $admin;\n\t\t\t\t\t\treturn $this->getHelper( 'Redirector' )\n\t\t\t\t\t\t\t->gotoSimple( 'index' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->view->password = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->view->nickname = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function action_login()\n {\n $referrer = Request::$referrer;\n\n $this->template->view = View::factory('account/login')\n ->bind('user', $user)\n ->bind('referrer', $referrer)\n ->bind('errors', $errors);\n\n\n if ($_POST)\n {\n $username = $_POST['username'];\n $password = $_POST['password'];\n\n $user = new Model_User;\n $loggeduser = $user->login($username, $password);\n\n $admin = new Model_Administrator;\n $loggedadmin = $admin->login ($username,$password);\n\n if ($loggeduser) {\n foreach ($loggeduser as $user) {\n $session = Session::instance();\n $session->set('username', $user['username']);\n }\n //redirect to user profile i.e login as user\n $this->request->redirect('user_profile/index/');\n }\n elseif ($loggedadmin) {\n foreach ($loggedadmin as $admin) {\n $session = Session::instance();\n $session->set('username', $admin['username']);\n }\n //redirect to user profile i.e login as admin\n $this->request->redirect('welcome');\n }\n\n }\n }", "public function loginAction(): void\n {\n $vars = array();\n if ($_POST) {\n $login = new Login($_POST);\n $errors = $login->login($this->auth, $this->user);\n $vars = [\n 'errors' => $errors,\n 'data' => $this->auth->getData(),\n ];\n }\n $this->view->render('Login Page', $vars, true);\n }", "public function action_login() {\n $username = Arr::get($_POST,'bz_username');\n $password = Arr::get($_POST,'bz_password');\n if($_POST) {\n $post = new Validate($_POST);\n $post->filter(true, 'trim');\n $post\n ->rule('bz_username', 'not_empty')\n ->rule('bz_password', 'not_empty');\n\n if($post->check()) {\n if($this->bugzilla_client->login($username,$password)) {\n $this->request->redirect('/');\n } else {\n client::messageSend($this->bugzilla_client->error_message(), E_USER_WARNING);\n }\n } else {\n client::validation_results($post->errors('authentication'));\n client::messageSend(\"There were errors in some fields\", E_USER_WARNING);\n }\n }\n $this->template->content = View::factory('pages/bz_login');\n $this->template->content->bz_username = $username;\n $this->template->content->bz_password = $password;\n $this->template->logout_link = '';\n $this->template->title = 'WebTools :: Login';\n\n }", "public function loginAction()\n\t{\n $session = $this->_getSession();\n $response = array();\n\n if ($this->getRequest()->isPost()){\n $login = $this->getRequest()->getPost('login');\n if (!empty($login['username']) && !empty($login['password'])){\n try {\n $session->login($login['username'], $login['password']);\n $response = array('success' => true, 'message' => '');\n }catch(Mage_Core_Exception $e){\n switch ($e->getCode()) {\n case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:\n $value = Mage::helper('customer')->getEmailConfirmationUrl($login['username']);\n $message = Mage::helper('customer')->__('This account is not confirmed. <a href=\"%s\">Click here</a> to resend confirmation email.', $value);\n break;\n case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:\n $message = $e->getMessage();\n break;\n default:\n $message = $e->getMessage();\n }\n $response = array('success' => false, 'message' => $message);\n $session->setUsername($login['username']);\n }catch(Exception $e){\n }\n } else {\n \t$response = array('success' => false, 'message' => $this->__('Login and password are required.'));\n }\n }\n $this->getResponse()->setBody(\n \tMage::helper('core')->jsonEncode($response)\n );\n\t}", "public function loginPage()\n {\n $this->render( 'auth.login' );\n }", "public function showLoginAction()\n {\n $user = App_User_Factory::getSessionUser();\n\n $this->view->isLoggedIn = $user !== null;\n if ($user !== null) {\n $this->view->login = $user->getLogin();\n } else {\n \t$form = new App_Form_Auth_Login($this->_helper->url('login', 'auth'));\n $this->view->form = $form;\n }\n }", "public function loginAction() {\n $this->Layout->pagetitle = 'Login screen';\n $this->Layout->viewtitle = 'Please log in';\n\n $params = $this->DispatcherController->getPostParams();\n $this->Smarty->assign('login', $params['login']);\n $this->Smarty->display('authenticate/login.html');\n }", "public function customerLogin()\n {\n Mage::getSingleton('core/session')->setGuestloginvalue('');\n return;\n }", "public function login() {\n\t\t$this->logOut();\n\t}", "function Login(){\n \n if($this->isLogged()){\n header(\"Location: \" . BASE_URL . \"administrador\");\n }else{\n $this->loginView->showLogin();\n }\n }", "public function loginAction()\n {\n Vfr_Auth_Advertiser::getInstance()->clearIdentity();\n\n $advertiserModel = new Common_Model_Advertiser();\n\n $advertiserRow = $advertiserModel->getAdvertiserById(\n $this->getRequest()->getParam('idAdvertiser')\n );\n\n $advertiserAuth = Vfr_Auth_Advertiser::getInstance();\n $advertiserAuth->getStorage()->write($advertiserRow);\n\n $this->_helper->redirector->gotoSimple(\n 'home',\n 'account',\n 'controlpanel'\n );\n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// In wireless? If so, use the correct sub template.\n\tif (WIRELESS)\n\t\t$context['sub_template'] = WIRELESS_PROTOCOL . '_login';\n\t// Otherwise, we need to load the Login template/language file.\n\telse\n\t{\n\t\tloadLanguage('Login');\n\t\tloadTemplate('Login');\n\t\t$context['sub_template'] = 'login';\n\t}\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt[34];\n\t$context['default_username'] = &$_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\n\t// Set the login URL - will be used when the login process is done.\n\tif (isset($_SESSION['old_url']) && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0)\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "function log_in_customer($customer){\r\n\t\t session_regenerate_id();\r\n\t\t $_SESSION['customer_id']=$customer['id'];\r\n\t\t $_SESSION['last_login']= time();\r\n\t\t $_SESSION['username']= $customer['username'];\r\n\t\treturn true;\r\n\t }", "public function login()\n {\n redirect($this->get_loginURL());\n }", "public function openForOrders();", "public function index()\n {\n \n $this->xredirect('/did/orders/browse');\n }", "public function checkout()\n {\n // authenticate user\n m_authenticate_and_redirect(\"login?nextPage=cart/checkout\");\n $this -> data['title'] = \"Checkout\";\n if(isset($_SESSION['cart']))\n $this -> data['cart'] = $this -> model -> getCartData($_SESSION['cart']);\n\n $this -> loadView(\"checkout\", $this -> data);\n\n }", "function loginAction()\n {\n $pageTitle = 'Login';\n $loginLinkStyle = 'selected';\n require_once __DIR__ . '/../templates/login.php';\n }", "public function LoginPage(){\n \\Hybrid_Auth::logoutAllProviders(); \n $loginPage = $this->getconfig('loginPage');\n if( $loginPage !== null){\n \\Hybrid_Auth::redirect($loginPage,\"PHP\");\n }\n //!TODO Make an alternative with loginList\n $this->loginList();\n exit;\n }", "public function login()\n {\n $this->show('user/login');\n }", "public function login()\n {\n url::site('auth/login', Kohana::config('auth.proto'));\n\n $this->sensitivePageHTTPSorRedirectAndDie('/auth/login');\n\t $this->_setReferrerButIgnore('auth/login');\n\t if (Auth::instance()->logged_in()) {\n\t client::messageSend(Kohana::lang('auth_already_logged_in'), E_USER_WARNING);\n\t url::redirect($this->_getReferrerOrUse('home/dashboard'));\n\t } else {\n\t // LDAP driver will prompt for username, password. remember feature isn't supported\n\t if (Auth::instance()->login('not_used','not_used')) {\n\t\t client::messageSend(Kohana::lang('auth.auth_login_success'), E_USER_NOTICE);\n\t\t url::redirect($this->_getReferrerOrUse('home/dashboard'));\n\t }\n\t }\n }", "public function login(){\n\n\t\tinclude \"views/login.php\";\n\n\t}", "public function login()\n {\n $controller = new Controller();\n\n if ($controller->getSession('app_id_user')) {\n $controller->response() -> redirect('home');\n } else {\n $controller->loadTemplate('Auth\\login', null);\n }\n }", "public function login(){\r\n $this->returnView(null, 'login', true);\r\n }", "public function loginPage()\n {\n $this->view->show('loginView', 0);\n }", "protected function processLoggedCustomer()\n {\n // Set default redirect URL for logged in customer\n if (!empty($this->_coreRegistry->registry('is_new_account'))) {\n $this->applyRedirect($this->url->getUrl('sandbox/box'));\n }\n $this->applyRedirect($this->customerUrl->getAccountUrl());\n\n\n if (!$this->scopeConfig->isSetFlag(\n CustomerUrl::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD,\n ScopeInterface::SCOPE_STORE\n )\n ) {\n $referer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME);\n if ($referer) {\n $referer = $this->urlDecoder->decode($referer);\n if ($this->url->isOwnOriginUrl()) {\n $this->applyRedirect($referer);\n }\n }\n } elseif ($this->session->getAfterAuthUrl()) {\n $this->applyRedirect($this->session->getAfterAuthUrl(true));\n }\n }", "public function ordersAction(){\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('user'));\n //check if user is logged in\n if ($auth->hasIdentity()) {\n $session = new Zend_Session_Namespace('userObj');\n $userObj = $session->__get('userObj');\n // This page only visible to operator\n if($userObj['user_type'] == 'operator'){\n \n $forms = Zend_Registry::get('forms');\n $form = new Zend_Form($forms->orders->adduser);\n $this->view->form = $form;\n \n $testObj = new Application_Model_Test();\n $tests = $testObj->getAll();\n $this->view->tests = $tests;\n \n \n }else{\n $this->_redirect('patient/orders');\n }\n }else{\n $this->_redirect('patient/orders');\n }\n }", "public function login(){\n add_breadcrumb(get_config_value('brand'), url('/'));\n add_breadcrumb(t('strings.login'), url('login'));\n \\Session::forget('gridsrun');\n $this->loadLayout(false,false,'users_login');\n $this->setPageTitle(t('strings.login'));\n }", "public function showLogin() {\n require VIEWS . 'Auth/login.php';\n }", "public function actionLogin()\n {\n //Redirect if user already logged in\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n \n //check for post values, if return user status to show otp if pending state\n if(!empty($_POST))\n {\n $userstatus = LoginForm::user_login($_POST);\n if($userstatus == 1)\n {\n $otp = User::create_otp();\n User::send_otp_to_user($_POST['email'],'',$otp);\n }\n return $userstatus;\n }\n else\n {\n return $this->render('//login');\n } \n \n }", "function login() {\n\n $admin_model = $this->loadModel('admin');\n\n $loginsuccessful = $admin_model->login();\n\n if ($loginsuccessful) {\n //if YES, move to the dashboard\n header('location:' . URL . 'dashboard/index');\n } else {\n //if NO, move the user to login again.\n header('location:' . URL . 'admin/index');\n }\n }", "public function show(CustomerOrder $customerOrder)\n {\n //\n }", "private function display_login() {\n library::show_debug(\"<!-- switch to login view -->\");\n require_once (dirname(__FILE__) . '/view/view_login.php');\n $this->_o_view = new view_login();\n echo $this->_o_view->create_output();\n }", "public function login() {\n\n # Set up the view\n $this->template->content = View::instance('v_users_login');\n $this->template->title = \"Login\";\n\n # Set the body background color\n $this->template->middle_color = \"honeydew\";\n\n # Render the view\n echo $this->template;\n }", "public function login(Mage_Customer_Model_Customer $customer)\n {\n try {\n $this->_eventType = 'login';\n $data = array(\n 'id' => $customer->getEmail(),\n 'key' => 'email',\n 'fields' => array(\n 'keys' => 1,\n 'engagement' => 1,\n 'activity' => 1,\n 'email' => $customer->getEmail(),\n 'extid' => $customer->getEntityId()\n ),\n 'login' => array(\n 'site' => Mage::helper('core/url')->getHomeUrl(),\n 'ip' => Mage::helper('core/http')->getRemoteAddr(true),\n 'user_agent' => Mage::helper('core/http')->getHttpUserAgent(true)\n )\n );\n\n if ($response = $this->apiPost('user',$data)) {\n return $this->setCookie($response);\n } else {\n throw new Sailthru_Email_Model_Client_Exception(\"Response: {$response} is not a valid JSON\");\n }\n } catch(Sailthru_Email_Model_Client_Exception $e) {\n Mage::logException($e);\n } catch(Exception $e) {\n Mage::logException($e);\n }\n }", "public static function login()\n {\n $record = new account();\n $record = accounts::findUserbyUsername($_POST['login']);\n \n if ($record == FALSE) {\n print_r(\"<h1>'Sorry! User not found,Please enter correct Login credentials....!'</h1>\");\n } else {\n if($record->checkPassword($_POST['psw']) == TRUE) {\n session_start();\n $_SESSION[\"userID\"] = $record->id;\n $_SESSION[\"userEmail\"] = $record->email;\n print_r($_SESSION);\n header('Location: index.php?page=tasks&action=allOneUser&id='.$record->id);\n } else {\n //header('Location: index.php');\n print_r(\"<h1>'Sorry! You have entered wrong password....!'</h1>\");\n }\n }\n }", "public function actionLogin()\n\t{\n\t\tif(!Yii::app()->user->isGuest){\n\t\t if(Yii::app()->user->type == 'super'){\n\t\t \t$this->redirect(array('admin/index'));\n\t\t } else {\n\t\t \t$this->redirect(array('client/index'));\n\t\t }\n\t }\n\t\t\n\t\t//Login\t\t \n\t\t$this->pageTitle = 'Zeunic - Client Login';\n\t\t$model = new LoginForm;\n\t\t$error = '';\n\t\tif(isset($_POST['LoginForm'])){\n\t\t\t$model->attributes = $_POST['LoginForm'];\n\t\t\tif($model->validate()){\n\t\t\t\t$identity=new UserIdentity($model->attributes['username'],$model->attributes['password']);\n\t\t\t\tif($identity->authenticate()){\n\t\t\t\t Yii::app()->user->login($identity);\n\t\t\t\t if(Yii::app()->user->type == 'super'){\n\t\t\t\t \t$this->redirect(array('admin/index'));\n\t\t\t\t } else {\n\t\t\t\t \t$this->redirect(array('client/index'));\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t\t$error = 'Username/Password combination is incorrect';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->render('login',array('model'=>$model, 'error'=>$error, 'ajax'=>false));\n\t}", "public function login()\n\t{\n\t\tif( $this->uri->uri_string() == 'examples/login')\n\t\t\tshow_404();\n\n\t\tif( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' )\n\t\t\t$this->require_min_level(1);\n\n\t\t$this->setup_login_form();\n\n\t\t$html = $this->load->view('examples/page_header', '', TRUE);\n\t\t$html .= $this->load->view('examples/login_form', '', TRUE);\n\t\t$html .= $this->load->view('examples/page_footer', '', TRUE);\n\n\t\techo $html;\n\t}", "public function actionLogin()\r\n {\r\n $totalPrice = Cart::getPrice();\r\n $totalQuantity = Cart::countItems();\r\n \r\n // List of the categories for the left menu\r\n $categories = Category::getCategoriesList();\r\n \r\n // List of the subcategories for the left menu\r\n $subCategories = Category::getSubCategoriesList(1);\r\n \r\n // Variables for form\r\n $email = false;\r\n $password = false;\r\n $result = false;\r\n \r\n if (isset($_POST['submit'])) {\r\n // If there are no errors\r\n // Get the form data from the form\r\n $email = $_POST['email'];\r\n $password = md5($_POST['password']);\r\n \r\n // Flag of errors\r\n $errors = false;\r\n \r\n // Validation fields\r\n if (!User::checkEmail($email)) {\r\n $errors[] = 'Email is wrong';\r\n }\r\n \r\n if (!User::checkPassword($password)) {\r\n $errors[] = 'Password must be at least 6 characters';\r\n }\r\n \r\n // Check if user exists\r\n $userId = User::checkUserData($email, $password);\r\n \r\n if ($userId == false) {\r\n // If the data is incorrect - show the error\r\n $errors[] = 'Incorrect login details';\r\n } else {\r\n // If the data is correct, remember the user (session)\r\n User::auth($userId);\r\n \r\n // We redirect the user to the closed part - home page\r\n header(\"Location: /\");\r\n }\r\n } \r\n \r\n require_once(ROOT . '/views/user/login.php');\r\n return true;\r\n }", "public function actionLogin()\n {\n $this->layout = 'unify/registration';\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n $cart = new HybrizyCartForm();\n $cart->dumpSessionToDb(true);\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "protected function loggedInAction() {\n\t\t$oView = new accountView($this);\n\t\t$oView->showLoggedInPage();\n\t}", "public function index()\n\t{\n\t\tif(!in_array('viewOrder', $this->permission)) {\n redirect('dashboard', 'refresh');\n }\n\n\t\t$this->data['page_title'] = 'Manage Orders';\n\t\t$this->render_template('orders/index', $this->data);\t\t\n\t}", "public function index()\r\n\t{\r\n\t\tif(!in_array('viewOrder', $this->permission)) {\r\n redirect('dashboard', 'refresh');\r\n }\r\n\r\n\t\t$this->render_template('orders/index', $this->data);\t\t\r\n\t}", "public function login()\r\n\t{\r\n\t\t$reslt = $this->model->getlogin();\r\n\t\tif(empty($reslt))\r\n\t\t{\r\n\t\t\techo \"<p style='color:red'>Login failed</p>\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsession_start();\r\n\t\t\t$_SESSION['login_user'] = $reslt;\r\n\t\t\t$data = $this->isAdmin($reslt);\r\n\t\t\tif($data == \"1\" || $data == \"2\"){\r\n\t\t\t\t$_SESSION['admin'] = true;\r\n\t\t\t\t$_SESSION['user'] = true;\r\n\t\t\t\theader('Location: ../views/v_backofficeDashboard.php');\r\n\t\t\t}else{\r\n\t\t\t\t$_SESSION['user'] = true;\r\n\t\t\t\theader('Location: ../views/v_accueil.php');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function loginAction()\n {\n $this->view->render('front/auth', 'login');\n }", "public function login( )\n \t{\n \t\t$data = OS_Controller::load_shop(); \n \t\t$params = $this->read_input();\n \t\tif( isset($params['email']) and isset($params['password']) )\n \t\t{\n \t\t\t//actually attempt to login\n\t\t\t$user = $this->shop_user->get_by_email( $params['email'] );\n\t\t\tif( ! empty( $user ) )\n\t\t\t{\n\t\t\t\t//now check password\n\t\t\t\tif( isset($user['user_id']) and $this->shop_user->is_password( $user , $params['password'] ) and $user['shop_id'] == $data['shop']['shop_id'] )\n\t\t\t\t{\n\t\t\t\t\t//sweet\n\t\t\t\t\t$user['last_active'] = time();\n\t\t\t\t\t$this->php_session->set('user' , $user );\n\t\t\t\t\t//record login\n\t\t\t\t\t$this->shop_log->auth($user['fullname'] . ' logged in at ' . date('r') . 'from ' . $this->input->ip_address() );\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$status = array('status' =>'success');\n\t\t\t\t\t$this->render('login' , $status );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Failed to login user - Check if provided details are correct.');\n\t\t\t\t}\n\t\t\t}\n \t\t}\n \t\t$this->output->set_status_header('401');\n \t\t//failed to login\n \t}", "public function iLogInToDAS()\n {\n\n $session = $this->getSession();\n $page = $session->getPage();\n $usern = $this->params['DAS']['user'];\n $passw = $this->params['DAS']['pass'];\n $page->fillField(\"edit-name\", $usern);\n $page->fillField(\"edit-pass\", $passw);\n $page->pressButton(\"edit-submit\");\n }", "public function login()\n\t{\n\t$error= \t\"\";\n\t$email= \t\"\";\n\t$username= \t\"\";\n\t$password_confirm = \"\";\n\n\t\tif (!empty($_POST)){\n\t\t\tforeach($_POST as $k => $v){\n\t\t\t\t//creer une variable $username$email $password etc...\n\t\t\t\t$$k = trim(strip_tags($v));\n\n\t\t\t}\n\t\t\tif (strlen($username) < 4){\n\t\t\t\t$error = \"pseudo trop court\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\t\t$dataToPassToTheView =[\n\t\t'error' => $error,\n\t\t\"username\" => $username,\n\t\t\"email\" => $email\n\t\t];\n\t\t\n\t$this->show('login/login',$dataToPassToTheView);\n\t$this->redirectToRoute('show_all_terms');\n\t\n\t}", "function invoke()\n {\n $user = $this->model->getlogin();\n if (isset($user['user_id'])) {\n session_start();\n $_SESSION['user_id'] = $user[\"user_id\"];\n $_SESSION['name'] = $user[\"name\"];\n $_SESSION['loginTime'] = time();\n $_SESSION['timer'] = 600;\n header(\"Location: \" . URL . \"Dashboard/render\");\n } else{\n header(\"Location: \" . URL . \"login/renderError/$user\");\n }\n }", "public function RedirectCustomer() {\n\n\t\t$currentCustomerGroup = $this->_customerSession->getCustomer()->getGroupId();\n\t\t$customerGroupB2B = $this->getCustomerGroupB2B();\n\n\t\tif ( ! $this->_customerSession->isLoggedIn() ) {\n\n\t\t\t$this->redirectToLoginPage();\n\n\t\t} else if ( $currentCustomerGroup !== $customerGroupB2B ) {\n\n\t\t\t$this->redirectToRootStore();\n\n\t\t}\n\n\t}", "public function action_login()\n {\n // check logined\n if (\\Auth::check())\n {\n \\Response::redirect(\\Router::get('dashboard'));\n }\n $data['title'] = 'Đăng nhập';\n $data['cms_name'] = \\Config::get('cms_name');\n return \\View_Smarty::forge('backend/admin/login.tpl', $data);\n }", "public function getLogin()\n {\n if(Sentinel::check()){\n return redirect()->route('customer.index')->with('error', 'You Already Login');\n }\n\n return view('ecomm.customer.login');\n }", "public function login()\n {\n if (!empty($_POST)) {\n try {\n $user = User::login($_POST);\n UsersAuthService::saveCookie($user);\n header('Location: /');\n exit();\n } catch (InvalidArgumentException $e) {\n $this->view->renderHtml('users/login.php', ['error' => $e->getMessage()]);\n return;\n }\n }\n $this->view->renderHtml('users/login.php');\n }", "public function handleLogin()\n {\n $this->userModel->validateLoginForm();\n //redirect to the login page\n $view = new Login_Doc($this->userModel);\n //check if data is valid after validation step\n if($this->userModel->valid)\n {\n $this->userModel->authenticateUser();\n if($this->userModel->valid)\n {\n $this->userModel->name=Database_Model::findUserByEmail($this->userModel->email)['name'];\n Session_Model::login($this->userModel->name);\n $view = new Home_Doc($this->userModel);\n $this->userModel->generateMenu();\n }\n }\n $view->show();\n }", "public function customerLogin($observer)\n {\n if (Mage::registry('customer_enrolled_fhf') == true) return;\n\n $customer = $observer->getEvent()->getCustomer();\n $is_rewards_enrolled = Mage::app()->getRequest()->getParam('is_rewards_enrolled') === null ? false : true;\n if ($is_rewards_enrolled) {\n // enroll customer\n $api = Mage::helper('alliance_fivehundredfriends/api');\n $request_parameters = array(\n 'email' => $customer->getEmail(),\n 'first_name' => $customer->getFirstname(),\n 'last_name' => $customer->getLastname(),\n );\n $api->enroll($request_parameters);\n }\n }", "public function login_customer()\n {\n return view('fornt.customer.login_register_customer');\n }", "function login(){\n\n \t//调用view视图\n \t$this->display();//展现视图与当前操作名一样\n \t// $this->display('register');//访问其他名字模板文件\n // $this->display('Goods/detail');//访问其他控制器下的模板文件\n }", "public function login()\n\t{\n\t\tif($this->session->userlogged_in == '*#loggedin@Yes')\n\t\t{\n\t\t\tredirect(base_url().'dashboard/');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'page_title' => 'Login'\n\t\t);\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('login_view');\n\t\t$this->load->view('templates/footer');\n\t}", "public function login() {\n\t\n\t\tif($this->input->server(\"REQUEST_METHOD\") == \"POST\") {\n\t\n\t\t\t$u = $this->input->post('user_name');\n\t\t\t$p = $this->input->post('user_pass');\n\t\t\t\n\t\t\t//hardkodiramo podatke\n\t\t\t$admins = array(\n\t\t\t\t\t'test'\t\t=> 'test'\n\t\t\t);\n\t\t\t\n\t\t\t//temp fake user database\n\t\t\t$user = (array_key_exists( (string) $u, $admins) && in_array( (string) $p, $admins)) ? TRUE : FALSE;\n\t\t\t\n\t\t\tif($user) {\n\t\t\t\t$status = $this->load_user($u);\n\t\t\t\tif($status) redirect('main/parser');\n\t\t\t\telse $this->output('main/login', lang('admin_login'), array('error' => 'Could not load customer information.'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->output('main/login', lang('admin_login'), array('error' => lang('wrong_credentials')));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->output('main/login', lang('admin_login'));\n\t\n\t\t}\n\t}", "public function loginPostAction()\n {\n if (!$this->_validateFormKey()) {\n $this->_redirect('*/*/');\n return;\n }\n\n if ($this->_getSession()->isLoggedIn()) {\n $this->_redirect('*/*/');\n return;\n }\n $session = $this->_getSession();\n\n if ($this->getRequest()->isPost()) {\n $login = $this->getRequest()->getPost('login');\n if (!empty($login['username']) && !empty($login['password'])) {\n $this->loadLayout();\n $this->getLayout()->getBlock('hukmedia.wso2.customer.login.redirect')->setLogin($login);\n $this->renderLayout();\n return;\n } else {\n $session->addError($this->__('Login and password are required.'));\n }\n }\n\n $this->_loginPostRedirect();\n }", "public function Login()\n {\n $this->render(\"login/login\");\n }" ]
[ "0.68125874", "0.6662411", "0.6655717", "0.66371536", "0.6635286", "0.66299534", "0.658739", "0.65509963", "0.6526782", "0.6474375", "0.6435764", "0.6408987", "0.6403123", "0.6402433", "0.6399806", "0.639899", "0.63877964", "0.6379597", "0.6376329", "0.63699305", "0.6369897", "0.6363628", "0.6349729", "0.63359845", "0.62989247", "0.6295609", "0.62864107", "0.62681013", "0.6267846", "0.62524885", "0.62439543", "0.62409514", "0.62384504", "0.6229766", "0.6222764", "0.6219329", "0.62150997", "0.62090266", "0.61927634", "0.6186908", "0.6185385", "0.61842096", "0.6183541", "0.6176802", "0.61740476", "0.6170167", "0.61643517", "0.61625946", "0.61556405", "0.61512005", "0.6125681", "0.6125518", "0.6122319", "0.6120981", "0.61139596", "0.6110355", "0.6096318", "0.6092834", "0.6088873", "0.6085973", "0.60848194", "0.608047", "0.6079268", "0.6068329", "0.6063714", "0.60615605", "0.6061513", "0.6048522", "0.604796", "0.6046954", "0.6045243", "0.60415417", "0.6040262", "0.60399294", "0.60397226", "0.60351974", "0.6031817", "0.601135", "0.60103863", "0.60074514", "0.6007433", "0.60074025", "0.60024154", "0.6001848", "0.599965", "0.59941953", "0.59930724", "0.59888756", "0.59878945", "0.5986552", "0.59858704", "0.59856784", "0.5982724", "0.5982306", "0.59813863", "0.59792566", "0.59700626", "0.59644586", "0.5962413", "0.5961539" ]
0.7829191
0
Find all committee_role nodes, and append them to the $groups hash, adding a recipient email for both $groups_admin_address, and all of the addresses listed in the field_copy_emails_to field.
Найдите все узлы committee_role и добавьте их в хеш $groups, добавляя адрес электронной почты получателя для обоих $groups_admin_address и всех адресов, указанных в поле field_copy_emails_to.
function _eltmc_googlesync_create_recipient_map($group_admin_addresses) { $groups = array(); // Get all the committee_role nodes $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'node') ->entityCondition('bundle', 'committee_role'); $result = $query->execute(); if (!isset($result['node'])) { return null; } $roles_nids = array_keys($result['node']); $roles = entity_load('node', $roles_nids); // For each committee_role foreach($roles as $role) { // Get the role's email address $items = field_get_items('node', $role, 'field_email_address'); if (!$items || count($items) == 0) continue; // Mark the $groups_admin_address as a recipient $email_address = strtolower($items[0]['email']); foreach($group_admin_addresses as $admin_address) { $groups[$email_address][$admin_address] = true; } // Get all the CC To field addresses $items = field_get_items('node', $role, 'field_copy_emails_to'); if (!$items) continue; foreach($items as $cc_address) { // Add this CC To address as another recipient $groups[$email_address][strtolower($cc_address['email'])] = true; } } return $groups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eltmc_googlesync_sync_groups_to_committee() {\n Zend_Loader::loadClass('Zend_Gdata');\n\n $config = _eltmc_googlesync_config();\n if (!$config) {\n\twatchdog('eltmc_googlesync', \"<p>Not yet configured, skipping group sync</p>\");\n return;\n }\n\n $gapps = _eltmc_googlesync_oauth_client($config);\n $domain = strtolower(variable_get('eltmc_googlesync_domain', ''));\n \n // Create an array $group_admins whose keys are the group admin(s).\n // For now, we just allow a single (optional) shared group admin.\n $groups_admin = strtolower(variable_get('eltmc_googlesync_groups_admin', ''));\n $group_admins = array();\n if ($groups_admin) $group_admins[$groups_admin] = true;\n\n $groups = _eltmc_googlesync_create_recipient_map(array_keys($group_admins));\n\n\n // Get the Committee's UIDs \n $uids = _eltmc_googlesync_uids_with_role('committee');\n $errors = array();\n\n // Add their email addresses and comittee roles into the hash-of-hashes $groups\n foreach ($uids as $uid) {\n $user = user_load($uid);\n $profile = profile2_load_by_user($uid, 'committee_profile');\n if (!$profile) continue;\n \n $items = field_get_items('profile2', $profile, 'field_committee_roles');\n if (!$items) continue;\n\n foreach($items as $c_role) {\n $node = node_load($c_role['target_id']);\n $items2 = field_get_items('node', $node, 'field_email_address');\n if (!$items2) continue;\n\n $group_name = $long_group_name = strtolower($items2[0]['email']);\n $groups[$group_name][strtolower($user->mail)] = true;\n\n\t // FIXME we should probably check the domain of the group email is our domain\n\t if (!_eltmc_googlesync_endswith($group_name, \"@$domain\")) {\n\t\t$errors[] = \"<li>Group $group_name does not end with your Google Apps domain!</li>\";\n\t }\n }\n }\n\n if (count($errors) > 0) {\n\t$message = t(\"<p>Update of Google group emails aborted because of problems detected:</p><ul>!errors</ul>\",\n\t\t array('!errors' => implode($errors, \"\\n\")));\n\treturn $message;\n }\t\n\n\n // Get the user accounts and aliases\n // These require extra acccess rights, hence the aliases and users scopes added\n // to the oauth request above.\n $gapps_emails = array();\n $gapps_user_list = $gapps->retrieveAllUsers();\n foreach ($gapps_user_list as $user) {\n $addr = strtolower($user->login->username);\n $gapps_emails[\"$addr@$domain\"] = $addr;\n }\n $gapps_alias_list = $gapps->retrieveAllNicknames();\n foreach ($gapps_alias_list as $alias) {\n $addr = strtolower($alias->nickname->name);\n $gapps_emails[\"$addr@$domain\"] = $addr;\n }\n\n // Get the groups and membership information from Google Apps into a hash of hashes $gapps_groups\n $gapps_group_list = $gapps->retrieveAllGroups();\n $gapps_groups = array();\n foreach($gapps_group_list->entry as $group) {\n $group_id = '';\n foreach($group->property as $prop) {\n switch ($prop->name) {\n case 'groupId':\n $group_id = strtolower($prop->value);\n $gapps_groups[$group_id] = array();\n break;\n }\n }\n\n $member_list = $gapps->retrieveAllMembers($group_id);\n //dpm(\"group id $group_id: \".print_r($member_list, true)); // DEBUG\n foreach($member_list as $member) {\n $member_email = '';\n foreach($member->property as $prop) {\n switch ($prop->name) {\n case 'memberId':\n $member_email = strtolower($prop->value);\n $gapps_groups[$group_id][$member_email] = true;\n break;\n }\n }\n }\n }\n// dpm(print_r($gapps_groups, true)); // DEBUG\n\n// dpm(print_r($groups, true)); // DEBUG\n $dryrun = variable_get('eltmc_googlesync_dryrun');\n\n $delta = array();\n\n // Add any new groups/memberships into Google\n foreach ($groups as $group => $users) {\n\n // Skip groups which have the same name as a user account\n // (we can't define a group for those)\n if (array_key_exists($group, $gapps_emails)) {\n $delta[$group]['MODIFICATION'] = 'not created as it is in use by a user account or alias';\n continue;\n }\n\n\t$group_name = _eltmc_googlesync_get_email_name($group);\n\n if (!array_key_exists($group, $gapps_groups)) {\n $delta[$group]['MODIFICATION'] = 'created';\n $gapps_groups[$group] = array();\n\t try {\n\t\tif (!$dryrun) $gapps->createGroup($group_name, ucfirst($group_name), '', 'Anyone');\n\t }\n\t catch (Exception $ex) {\n\t\t$delta[$group]['MODIFICATION'] .= \" - failed: \".$ex->getMessage();\n\t }\n }\n\n foreach ($users as $user => $ignored) {\n if (array_key_exists($user, $gapps_groups[$group]))\n continue;\n\n if (!array_key_exists($group, $delta) || !array_key_exists('MODIFICATION', $delta[$group]))\n $delta[$group]['MODIFICATION'] = 'modified';\n\n\t try {\n\t\t// If the user is in the $groups_admin array, make them an owner\n\t\tif (array_key_exists($user, $group_admins)) {\n\t\t $delta[$group][$user] = 'added as an owner';\n\t\t\n\t\t if (!$dryrun) $gapps->addOwnerToGroup($user, $group_name);\n\t\t}\n\t\telse {\n\t\t // Just make them a normal member\n\t\t $delta[$group][$user] = 'added as a member';\n\t\t \n\t\t if (!$dryrun) $gapps->addMemberToGroup($user, $group_name);\n// if (!$dryrun) $gapps->addRecipientToEmailList($user, $group_name);\n\t\t}\n\t }\n\t catch (Exception $ex) {\n\t\t$delta[$group][$user] .= \" - failed: \".$ex->getMessage();\n\t }\n }\n }\n\n // Delete groups/memberships which no longer exist from Google\n foreach ($gapps_groups as $group => $users) {\n\n // Skip groups which have the same name as a user account\n // (we can't delete a group for those)\n if (array_key_exists($group, $gapps_emails)) {\n $delta[$group]['MODIFICATION'] = 'not deleted as it is in use by a user account or alias';\n continue;\n }\n\n\t$group_name = _eltmc_googlesync_get_email_name($group);\n\n\tif (!array_key_exists($group, $groups)) {\n\t $delta[$group]['MODIFICATION'] = 'removed';\n\n\t try {\n\t\tif (!$dryrun) $gapps->deleteGroup($group_name);\n\t }\n\t catch (Exception $ex) {\n\t\t$delta[$group]['MODIFICATION'] .= \" - failed: \".$ex->getMessage();\n\t }\n\n\t continue;\n\t}\n\n foreach ($users as $user => $ignored) {\n\t try {\n\t\tif (!array_key_exists($user, $groups[$group])) { \n\t\t $delta[$group][$user] = 'removed';\n\t\t \n\t\t if (!$dryrun) $gapps->removeMemberFromGroup($user, $group_name);\n\t\t}\n\t\telseif (array_key_exists($user, $group_admins) && !$gapps->isOwner($user, $group_name)) {\n\t\t // Promote user to owner\n\t\t $delta[$group][$user] = 'promoted to owner';\n\t\t if (!$dryrun) $gapps->addOwnerToGroup($user, $group_name);\n\t\t}\n\t\telseif(!array_key_exists($user, $group_admins) && $gapps->isOwner($user, $group_name)) {\n\t\t // Demote user from owner\n\t\t $delta[$group][$user] = 'demoted to ordinary member';\n\t\t if (!$dryrun) $gapps->removeOwnerFromGroup($user, $group_name);\n\t\t}\n\t\telse {\n\t\t // Skip the rest of this loop body\n\t\t continue;\n\t\t}\n\t }\n\t catch (Exception $ex) {\n\t\t$delta[$group][$user] .= \" - failed: \".$ex->getMessage();\n\t }\n\n if (!array_key_exists($group, $delta) || !array_key_exists('MODIFICATION', $delta[$group]))\n $delta[$group]['MODIFICATION'] = 'modified';\n }\n }\n\n # HTMLise the $delta entries. Report the changes.\n ksort($delta);\n $log = '<ul>';\n foreach($delta as $group => $groupdelta) {\n $group = t($group);\n $modification = array_key_exists('MODIFICATION', $groupdelta)?\n $groupdelta['MODIFICATION'] : '';\n unset($groupdelta['MODIFICATION']);\n \n $log .= \"<li> Group $group $modification</li>\";\n\n if (count($groupdelta) > 0) {\n $log .= '<ul>';\n foreach($groupdelta as $user => $modification) {\n $user = t($user);\n\n $log .= \"<li> User $user $modification</li>\"; \n }\n $log .= '</ul>';\n }\n }\n $log .= '</ul>';\n\n $message = t(\"<p>!modified Google Group configurations:</p><ul>!actions</ul>\",\n\t\t array('!actions' => $log,\n\t\t '!modified' => $dryrun? \"<i>Dry-run</i>: would have modified\" : \"Modified\"));\n\n return $message;\n}", "function _content_reminder_prepare_nodes($nodes, $mailtype) {\n\n $email_nodes = [];\n foreach ($nodes as $node) {\n $send_to_author = variable_get('content_reminder_types_' . $node->type . '_send_to_author', 1);\n\n if ($send_to_author) {\n if (!isset($email_nodes[$node->mail])) {\n $email_nodes[$node->mail] = [];\n }\n $node->url = l($node->title, 'node/' . $node->nid, ['absolute' => TRUE]);\n $email_nodes[$node->mail][] = $node;\n }\n }\n\n $loaded_node = [];\n foreach ($nodes as $node) {\n $loaded_node[$node->nid] = node_load($node->nid);\n }\n\n $emailremindernodes = [];\n foreach ($loaded_node as $node) {\n $emails = [];\n if (!empty($node->field_reminder_email) || !empty(variable_get('content_reminder_types_' . $node->type . '_email'))) {\n // Add the email addresses to the node.\n if (!empty($node->field_reminder_email)) {\n foreach ($node->field_reminder_email[LANGUAGE_NONE] as $mail_list) {\n foreach ($mail_list as $value) {\n $emails[] = $value;\n }\n }\n }\n if (!empty(variable_get('content_reminder_types_' . $node->type . '_email'))) {\n $emails[] = variable_get('content_reminder_types_' . $node->type . '_email');\n }\n $id = implode(',', $emails);\n $emailremindernodes[$id][$node->nid] = new stdClass();\n $emailremindernodes[$id][$node->nid]->nid = $node->nid;\n $emailremindernodes[$id][$node->nid]->title = $node->title;\n $emailremindernodes[$id][$node->nid]->changed = $node->changed;\n $emailremindernodes[$id][$node->nid]->type = $node->type;\n $emailremindernodes[$id][$node->nid]->mail = implode(', ', $emails);\n $emailremindernodes[$id][$node->nid]->status = $node->status;\n $emailremindernodes[$id][$node->nid]->url = l($node->title, 'node/' . $node->nid, ['absolute' => TRUE]);\n }\n }\n\n if (!empty($email_nodes)) {\n // Mail the node author (user).\n _content_reminder_send_mails($email_nodes, $mailtype);\n }\n // Mail the people defined in the node's \"reminder email field\".\n _content_reminder_send_mails($emailremindernodes, $mailtype);\n}", "function migrateUserRoles() {\n\n\t\t// if there are any user_groups created, then this has already run. Return immediately in that case.\n\n\t\t$userGroupDao = DAORegistry::getDAO('UserGroupDAO');\n\t\t$userGroupTest = $userGroupDao->retrieve('SELECT count(*) AS total FROM user_groups');\n\t\t$testRow = $userGroupTest->GetRowAssoc(false);\n\t\tif ($testRow['total'] > 0) return true;\n\n\t\t// First, do Admins.\n\t\t// create the admin user group.\n\t\t$userGroupDao->update('INSERT INTO user_groups (user_group_id, context_id, role_id, path, is_default) VALUES (?, ?, ?, ?, ?)', array(1, CONTEXT_SITE, ROLE_ID_SITE_ADMIN, 'admin', 1));\n\t\t$userResult = $userGroupDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array(CONTEXT_SITE, ROLE_ID_SITE_ADMIN));\n\t\twhile (!$userResult->EOF) {\n\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t$userGroupDao->update('INSERT INTO user_user_groups (user_group_id, user_id) VALUES (?, ?)', array(1, (int) $row['user_id']));\n\t\t\t$userResult->MoveNext();\n\t\t}\n\n\t\t// iterate through all journals and assign remaining users to their respective groups.\n\t\t$journalDao = DAORegistry::getDAO('JournalDAO');\n\t\t$journals = $journalDao->getAll();\n\n\t\tAppLocale::requireComponents(LOCALE_COMPONENT_APP_DEFAULT, LOCALE_COMPONENT_PKP_DEFAULT);\n\n\t\twhile ($journal = $journals->next()) {\n\t\t\t// Install default user groups so we can assign users to them.\n\t\t\t$userGroupDao->installSettings($journal->getId(), 'registry/userGroups.xml');\n\n\t\t\t// Readers.\n\t\t\t$group = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_READER);\n\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_READER));\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// Subscription Managers.\n\t\t\t$group = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_SUBSCRIPTION_MANAGER);\n\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_SUBSCRIPTION_MANAGER));\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// Managers.\n\t\t\t$group = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_MANAGER);\n\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_MANAGER));\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// Authors.\n\t\t\t$group = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_AUTHOR);\n\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_AUTHOR));\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// update the user_group_id colun in the authors table.\n\t\t\t$userGroupDao->update('UPDATE authors SET user_group_id = ?', array((int) $group->getId()));\n\n\t\t\t// Reviewers. All existing OJS reviewers get mapped to external reviewers.\n\t\t\t// There should only be one user group with ROLE_ID_REVIEWER in the external review stage.\n\t\t\t$userGroups = $userGroupDao->getUserGroupsByStage($journal->getId(), WORKFLOW_STAGE_ID_EXTERNAL_REVIEW, true, false, ROLE_ID_REVIEWER);\n\t\t\t$reviewerUserGroup = null; // keep this in scope for later.\n\n\t\t\twhile ($group = $userGroups->next()) {\n\t\t\t\t// make sure.\n\t\t\t\tif ($group->getRoleId() != ROLE_ID_REVIEWER) continue;\n\t\t\t\t$reviewerUserGroup = $group;\n\n\t\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_REVIEWER));\n\t\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t\t$userResult->MoveNext();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fix stage id assignments for reviews. OJS hard coded *all* of these to '1' initially. Consider OJS reviews as external reviews.\n\t\t\t$userGroupDao->update('UPDATE review_assignments SET stage_id = ?', array(WORKFLOW_STAGE_ID_EXTERNAL_REVIEW));\n\n\t\t\t// Guest editors.\n\t\t\t$userGroupIds = $userGroupDao->getUserGroupIdsByRoleId(ROLE_ID_GUEST_EDITOR, $journal->getId());\n\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_GUEST_EDITOR));\n\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t// there should only be one guest editor group id.\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $userGroupIds[0]);\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// regular Editors. NOTE: this involves a role id change from 0x100 to 0x10 (old OJS _EDITOR to PKP-lib _MANAGER).\n\t\t\t$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_MANAGER);\n\t\t\t$editorUserGroup = null;\n\t\t\twhile ($group = $userGroups->next()) {\n\t\t\t\tif ($group->getData('nameLocaleKey') == 'default.groups.name.editor') {\n\t\t\t\t\t$editorUserGroup = $group; // stash for later.\n\t\t\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_EDITOR));\n\t\t\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t\t\t$userResult->MoveNext();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Section Editors.\n\t\t\t$sectionEditorGroup = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_SECTION_EDITOR);\n\t\t\t$userResult = $journalDao->retrieve('SELECT DISTINCT user_id FROM section_editors WHERE journal_id = ?', array((int) $journal->getId()));;\n\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $sectionEditorGroup->getId());\n\t\t\t\t$userResult->MoveNext();\n\t\t\t}\n\n\t\t\t// Layout Editors. NOTE: this involves a role id change from 0x300 to 0x1001 (old OJS _LAYOUT_EDITOR to PKP-lib _ASSISTANT).\n\t\t\t$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_ASSISTANT);\n\t\t\tdefine('ROLE_ID_LAYOUT_EDITOR',\t0x00000300);\n\t\t\t$layoutEditorGroup = null;\n\t\t\twhile ($group = $userGroups->next()) {\n\t\t\t\tif ($group->getData('nameLocaleKey') == 'default.groups.name.layoutEditor') {\n\t\t\t\t\t$layoutEditorGroup = $group;\n\t\t\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_LAYOUT_EDITOR));\n\t\t\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t\t\t$userResult->MoveNext();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copyeditors. NOTE: this involves a role id change from 0x2000 to 0x1001 (old OJS _COPYEDITOR to PKP-lib _ASSISTANT).\n\t\t\t$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_ASSISTANT);\n\t\t\tdefine('ROLE_ID_COPYEDITOR', 0x00002000);\n\t\t\t$copyEditorGroup = null;\n\t\t\twhile ($group = $userGroups->next()) {\n\t\t\t\tif ($group->getData('nameLocaleKey') == 'default.groups.name.copyeditor') {\n\t\t\t\t\t$copyEditorGroup = $group;\n\t\t\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_COPYEDITOR));\n\t\t\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t\t\t$userResult->MoveNext();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Proofreaders. NOTE: this involves a role id change from 0x3000 to 0x1001 (old OJS _PROOFREADER to PKP-lib _ASSISTANT).\n\t\t\tdefine('ROLE_ID_PROOFREADER', 0x00003000);\n\t\t\t$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_ASSISTANT);\n\t\t\t$proofreaderGroup = null;\n\t\t\twhile ($group = $userGroups->next()) {\n\t\t\t\tif ($group->getData('nameLocaleKey') == 'default.groups.name.proofreader') {\n\t\t\t\t\t$proofreaderGroup = $group;\n\t\t\t\t\t$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_PROOFREADER));\n\t\t\t\t\twhile (!$userResult->EOF) {\n\t\t\t\t\t\t$row = $userResult->GetRowAssoc(false);\n\t\t\t\t\t\t$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());\n\t\t\t\t\t\t$userResult->MoveNext();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Now, migrate stage assignments. This code is based on the default stage assignments outlined in registry/userGroups.xml\n\t\t\t$submissionDao = Application::getSubmissionDAO();\n\t\t\t$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');\n\t\t\t$submissionResult = $submissionDao->retrieve('SELECT submission_id, user_id FROM submissions');\n\t\t\t$authorGroup = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_AUTHOR);\n\t\t\twhile (!$submissionResult->EOF) {\n\t\t\t\t$submissionRow = $submissionResult->GetRowAssoc(false);\n\t\t\t\t$submissionId = $submissionRow['submission_id'];\n\t\t\t\t$submissionUserId = $submissionRow['user_id'];\n\t\t\t\tunset($submissionRow);\n\n\t\t\t\t// Authors get access to all stages.\n\t\t\t\t$stageAssignmentDao->build($submissionId, $authorGroup->getId(), $submissionUserId);\n\n\t\t\t\t// Reviewers get access to the external review stage.\n\t\t\t\t$reviewersResult = $stageAssignmentDao->retrieve('SELECT reviewer_id FROM review_assignments WHERE submission_id = ?', array($submissionId));\n\t\t\t\twhile (!$reviewersResult->EOF) {\n\t\t\t\t\t$reviewerRow = $reviewersResult->GetRowAssoc(false);\n\t\t\t\t\t$stageAssignmentDao->build($submissionId, $reviewerUserGroup->getId(), $reviewerRow['reviewer_id']);\n\t\t\t\t\t$reviewersResult->MoveNext();\n\t\t\t\t}\n\t\t\t\tunset($reviewersResult);\n\n\t\t\t\t// Journal Editors\n\t\t\t\t// First, full editors.\n\t\t\t\t$editorsResult = $stageAssignmentDao->retrieve('SELECT e.* FROM submissions s, edit_assignments e, users u, roles r WHERE r.user_id = e.editor_id AND r.role_id = ' .\n\t\t\t\t\t\t\tROLE_ID_EDITOR . ' AND e.article_id = ? AND r.journal_id = s.context_id AND s.submission_id = e.article_id AND e.editor_id = u.user_id', array($submissionId));\n\t\t\t\twhile (!$editorsResult->EOF) {\n\t\t\t\t\t$editorRow = $editorsResult->GetRowAssoc(false);\n\t\t\t\t\t$stageAssignmentDao->build($submissionId, $editorUserGroup->getId(), $editorRow['editor_id']);\n\t\t\t\t\t$editorsResult->MoveNext();\n\t\t\t\t}\n\t\t\t\tunset($editorsResult);\n\n\t\t\t\t// Section Editors.\n\t\t\t\t$editorsResult = $stageAssignmentDao->retrieve('SELECT e.* FROM submissions s LEFT JOIN edit_assignments e ON (s.submission_id = e.article_id) LEFT JOIN users u ON (e.editor_id = u.user_id)\n\t\t\t\t\t\t\tLEFT JOIN roles r ON (r.user_id = e.editor_id AND r.role_id = ' . ROLE_ID_EDITOR . ' AND r.journal_id = s.context_id) WHERE e.article_id = ? AND s.submission_id = e.article_id\n\t\t\t\t\t\t\tAND r.role_id IS NULL AND (e.can_review = 1 OR e.can_edit = 1)', array($submissionId));\n\t\t\t\twhile (!$editorsResult->EOF) {\n\t\t\t\t\t$editorRow = $editorsResult->GetRowAssoc(false);\n\t\t\t\t\t$stageAssignmentDao->build($submissionId, $sectionEditorGroup->getId(), $editorRow['editor_id']);\n\t\t\t\t\t$editorsResult->MoveNext();\n\t\t\t\t}\n\t\t\t\tunset($editorsResult);\n\n\t\t\t\t// Copyeditors. Pull from the signoffs for SIGNOFF_COPYEDITING_INITIAL.\n\t\t\t\t// there should only be one (or no) copyeditor for each submission.\n\t\t\t\t// 257 === 0x0000101 (the old assoc type for ASSOC_TYPE_ARTICLE)\n\n\t\t\t\t$copyEditorResult = $stageAssignmentDao->retrieve('SELECT user_id FROM signoffs WHERE assoc_type = ? AND assoc_id = ? AND symbolic = ?',\n\t\t\t\t\t\t\t\tarray(257, $submissionId, 'SIGNOFF_COPYEDITING_INITIAL'));\n\n\t\t\t\tif ($copyEditorResult->NumRows() == 1) { // the signoff exists.\n\t\t\t\t\t$copyEditorRow = $copyEditorResult->GetRowAssoc(false);\n\t\t\t\t\t$copyEditorId = (int) $copyEditorRow['user_id'];\n\t\t\t\t\tif ($copyEditorId > 0) { // there is a user assigned.\n\t\t\t\t\t\t$stageAssignmentDao->build($submissionId, $copyEditorGroup->getId(), $copyEditorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Layout editors. Pull from the signoffs for SIGNOFF_LAYOUT.\n\t\t\t\t// there should only be one (or no) layout editor for each submission.\n\t\t\t\t// 257 === 0x0000101 (the old assoc type for ASSOC_TYPE_ARTICLE)\n\n\t\t\t\t$layoutEditorResult = $stageAssignmentDao->retrieve('SELECT user_id FROM signoffs WHERE assoc_type = ? AND assoc_id = ? AND symbolic = ?',\n\t\t\t\t\t\tarray(257, $submissionId, 'SIGNOFF_LAYOUT'));\n\n\t\t\t\tif ($layoutEditorResult->NumRows() == 1) { // the signoff exists.\n\t\t\t\t\t$layoutEditorRow = $layoutEditorResult->GetRowAssoc(false);\n\t\t\t\t\t$layoutEditorId = (int) $layoutEditorRow['user_id'];\n\t\t\t\t\tif ($layoutEditorId > 0) { // there is a user assigned.\n\t\t\t\t\t\t$stageAssignmentDao->build($submissionId, $layoutEditorGroup->getId(), $layoutEditorId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Proofreaders. Pull from the signoffs for SIGNOFF_PROOFREADING_PROOFREADER.\n\t\t\t\t// there should only be one (or no) layout editor for each submission.\n\t\t\t\t// 257 === 0x0000101 (the old assoc type for ASSOC_TYPE_ARTICLE)\n\n\t\t\t\t$proofreaderResult = $stageAssignmentDao->retrieve('SELECT user_id FROM signoffs WHERE assoc_type = ? AND assoc_id = ? AND symbolic = ?',\n\t\t\t\t\t\tarray(257, $submissionId, 'SIGNOFF_PROOFREADING_PROOFREADER'));\n\n\t\t\t\tif ($proofreaderResult->NumRows() == 1) { // the signoff exists.\n\t\t\t\t\t$proofreaderRow = $proofreaderResult->GetRowAssoc(false);\n\t\t\t\t\t$proofreaderId = (int) $proofreaderRow['user_id'];\n\t\t\t\t\tif ($proofreaderId > 0) { // there is a user assigned.\n\t\t\t\t\t\t$stageAssignmentDao->build($submissionId, $proofreaderGroup->getId(), $proofreaderId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$submissionResult->MoveNext();\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function eltmc_googlesync_sync_groups_to_committee_action() {\n $message = eltmc_googlesync_sync_groups_to_committee();\n watchdog('eltmc_googlesync', $message);\n}", "function bmt_add_hostgroups_to_hosts($hostgroups, $hosts, &$msg)\n{\n $errors = 0;\n\n foreach ($hostgroups as $hg_id) {\n\n if (!empty($hosts)) {\n $new_vals = array();\n foreach ($hosts as $host_id) {\n $new_vals[] = \" (\" . intval($host_id) . \", \" . intval($hg_id) . \")\";\n exec_sql_query(DB_NAGIOSQL, \"UPDATE `tbl_host` SET `hostgroups` = 1, `last_modified` = NOW() WHERE `id` = \" . intval($host_id), false);\n }\n\n # Do actual insert\n if (count($new_vals > 1)) {\n $values = implode(\", \", $new_vals);\n } else {\n $values = $new_vals[0];\n }\n\n exec_sql_query(DB_NAGIOSQL, \"INSERT INTO `tbl_lnkHostToHostgroup` (`idMaster`, `idSlave`) VALUES \" . $values, false);\n }\n\n }\n\n return $errors;\n}", "function add_role_to_admin_body($classes) {\n global $current_user;\n $user_role = array_shift($current_user->roles);\n $classes .= 'role-'. $user_role;\n return $classes;\n}", "public function attachRoles($roles);", "public function attachRoles($roles = [], $team = null);", "private function prepareRecipients(Envelope $envelope)\n {\n $templateRoles = [];\n\n $recipients = $envelope->getRecipients();\n if (is_array($recipients) && count($recipients)) {\n foreach ($recipients as $recipient) {\n if ($recipient instanceof RecipientInterface) {\n $templateRole = [\n 'name' => $recipient->getName(),\n 'email' => $recipient->getEmail(),\n 'roleName' => $recipient->getRoleName(),\n /*'requireIdLookup' => true,\n \"idCheckConfigurationName\" => \"ID Check $\"\n \"idCheckInformationInput\" => array(\n \"addressInformationInput\" => array(\n \"addressInformation\" => array(\n \"street1\" => \"trertert\",\n \"city\" => \"fasdfsdf\",\n \"state\" => \"AK\",\n \"zip\" => \"555555\",\n ),\n \"displayLevelCode\" => \"ReadOnly\",\n \"receiveInResponse\" => false\n ),\n \"dobInformationInput\" => array(\n \"dateOfBirth\" => \"03-03-1990\",\n \"displayLevelCode\" => \"ReadOnly\",\n \"receiveInResponse\" => false\n ),\n \"ssn4InformationInput\" => array(\n \"ssn4\" => \"6789\",\n \"displayLevelCode\" => \"ReadOnly\",\n \"receiveInResponse\" => false\n )\n )*/\n ];\n\n $tabs = $recipient->getTabs();\n if ($tabs->count()) {\n $templateRole['tabs'] = $tabs->toArray();\n }\n\n if ($recipient->getClientUserId()) {\n $templateRole['clientUserId'] = $recipient->getClientUserId();\n }\n\n $templateRoles[] = $templateRole;\n }\n }\n }\n\n return $templateRoles;\n }", "public function register_email_group($groups)\n {\n }", "public function testEmailGroupMembersOnCommit()\n {\n $services = $this->getApplication()->getServiceManager();\n $queue = $services->get('queue');\n $p4 = $this->p4;\n $p4Foo = $this->connectWithAccess('foo', array('//depot/...' => 'write'));\n\n // we create 3 groups:\n // - group g1 containing user 'foo' and configured for emailing about commits\n // - group g2 also containing user 'foo' but not configured for emailing about commits\n // - group g3 not containing user 'foo' but configured for emailing about commits\n // - group g4 containing user 'foo' and configured for emailing about commits\n // when foo commits a change, only users from groups g1 and g4 should get notification\n $group = new Group($this->superP4);\n $group->getConfig()->setEmailFlags(array('commits' => 1));\n $group->setId('g1')\n ->setUsers(array('foo', 'bar', 'baz'))\n ->save();\n\n $group = new Group($this->superP4);\n $group->getConfig()->setEmailFlags(array('commits' => 0));\n $group->setId('g2')\n ->setUsers(array('foo', 'bar', 'joe'))\n ->save();\n\n $group = new Group($this->superP4);\n $group->getConfig()->setEmailFlags(array('commits' => 1));\n $group->setId('g3')\n ->setUsers(array('a', 'b'))\n ->save();\n\n $group = new Group($this->superP4);\n $group->getConfig()->setEmailFlags(array('commits' => 1));\n $group->setId('g4')\n ->setUsers(array('foo', 'x', 'y'))\n ->save();\n\n // create users with valid-looking emails to pass the email validator\n User::fetch('foo', $p4)->setEmail('foo@test.com')->save();\n foreach (array('bar', 'baz', 'joe', 'a', 'b', 'x', 'y') as $userId) {\n $user = new User($this->p4);\n $user->setId($userId)\n ->setEmail($userId . '@test.com')\n ->setFullName('Mr ' . $userId)\n ->save();\n }\n\n // commit a change as 'foo'\n $pool = $this->superP4->getService('clients');\n $pool->setConnection($p4Foo)->grab();\n $pool->reset();\n\n $change = new Change($p4Foo);\n $change->setDescription('test')->save();\n\n $file = new File($p4Foo);\n $file->setFilespec('//depot/test1');\n $file->setLocalContents('some file contents');\n $file->add($change->getId());\n $change->submit();\n\n // push into queue and process\n $queue->addTask('commit', $change->getId());\n $this->processQueue();\n\n // verify that commit email has been sent to the expected users\n $mailer = $this->getApplication()->getServiceManager()->get('mailer');\n $emailFile = $mailer->getLastFile();\n\n $this->assertNotNull($emailFile, \"Expected commit email was sent.\");\n $content = file_get_contents($emailFile);\n $this->assertTrue(strpos($content, 'foo@test.com') !== false);\n $this->assertTrue(strpos($content, 'bar@test.com') !== false);\n $this->assertTrue(strpos($content, 'baz@test.com') !== false);\n $this->assertTrue(strpos($content, 'x@test.com') !== false);\n $this->assertTrue(strpos($content, 'y@test.com') !== false);\n $this->assertFalse(strpos($content, 'joe@test.com'));\n $this->assertFalse(strpos($content, 'a@test.com'));\n $this->assertFalse(strpos($content, 'b@test.com'));\n }", "public function attachRoles(...$roles) : void\n {\n if (is_array($roles[0])) {\n foreach ($roles[0] as $role) {\n $this->attachRole($role);\n }\n\n return;\n }\n\n foreach ($roles as $role) {\n $this->attachRole($role);\n }\n }", "public function run()\n {\n $role_admin = Role::where('name', 'Admin')->first();\n $role_professor = Role::where('name', 'Professor')->first();\n // $faker = Faker::create('App\\User');\n // for($i =0; $i < 30; $i++){\n // DB::table('users')->insert([\n // 'name' => $faker->name,\n // 'email' => $faker->unique()->freeEmail, \n // 'password' => bcrypt(str_random(10)),\n // ]);\n // }\n //<------------------ADMIN----------------------------> \n $admin = new User();\n $admin->name = 'Administrador1';\n $admin->email = 'admin1@ufop.com';\n $admin->password = bcrypt('1234');\n $admin->save();\n $admin->roles()->attach($role_admin);\n $admin->roles()->attach($role_professor);\n \n $admin2 = new User();\n $admin2->name = 'Administrador2';\n $admin2->email = 'admin2@ufop.com';\n $admin2->password = bcrypt('1234');\n $admin2->save();\n $admin2->roles()->attach($role_admin);\n $admin2->roles()->attach($role_professor);\n\n $admin3 = new User();\n $admin3->name = 'Administrador3';\n $admin3->email = 'admin3@ufop.com';\n $admin3->password = bcrypt('1234');\n $admin3->save();\n $admin3->roles()->attach($role_admin);\n $admin3->roles()->attach($role_professor);\n\n $admin4 = new User();\n $admin4->name = 'Administrador4';\n $admin4->email = 'admin4@ufop.com';\n $admin4->password = bcrypt('1234');\n $admin4->save();\n $admin4->roles()->attach($role_admin);\n $admin4->roles()->attach($role_professor);\n\n $admin5 = new User();\n $admin5->name = 'Administrador5';\n $admin5->email = 'admin5@ufop.com';\n $admin5->password = bcrypt('1234');\n $admin5->save();\n $admin5->roles()->attach($role_admin);\n $admin5->roles()->attach($role_professor);\n \n //<------------------PROFESSOR----------------------------> \n\n $professor = new User();\n $professor->name = 'Professor1';\n $professor->email = 'professor1@ufop.com';\n $professor->password = bcrypt('1234');\n $professor->save();\n $professor->roles()->attach($role_professor);\n\n $professor2 = new User();\n $professor2->name = 'Professor2';\n $professor2->email = 'professor2@ufop.com';\n $professor2->password = bcrypt('1234');\n $professor2->save();\n $professor2->roles()->attach($role_professor);\n\n $professor3 = new User();\n $professor3->name = 'Professor3';\n $professor3->email = 'professor3@ufop.com';\n $professor3->password = bcrypt('1234');\n $professor3->save();\n $professor3->roles()->attach($role_professor);\n\n $professor4 = new User();\n $professor4->name = 'Professor4';\n $professor4->email = 'professor4@ufop.com';\n $professor4->password = bcrypt('1234');\n $professor4->save();\n $professor4->roles()->attach($role_professor);\n\n $professor5 = new User();\n $professor5->name = 'Professor5';\n $professor5->email = 'professor5@ufop.com';\n $professor5->password = bcrypt('1234');\n $professor5->save();\n $professor5->roles()->attach($role_professor);\n\n $professor6 = new User();\n $professor6->name = 'Professor6';\n $professor6->email = 'professor6@ufop.com';\n $professor6->password = bcrypt('1234');\n $professor6->save();\n $professor6->roles()->attach($role_professor);\n\n $professor7 = new User();\n $professor7->name = 'Professor7';\n $professor7->email = 'professor7@ufop.com';\n $professor7->password = bcrypt('1234');\n $professor7->save();\n $professor7->roles()->attach($role_professor);\n\n $professor8 = new User();\n $professor8->name = 'Professor8';\n $professor8->email = 'professor8@ufop.com';\n $professor8->password = bcrypt('1234');\n $professor8->save();\n $professor8->roles()->attach($role_professor);\n\n $professor9 = new User();\n $professor9->name = 'Professor9';\n $professor9->email = 'professor9@ufop.com';\n $professor9->password = bcrypt('1234');\n $professor9->save();\n $professor9->roles()->attach($role_professor);\n\n $professor10 = new User();\n $professor10->name = 'Professor10';\n $professor10->email = 'professor10@ufop.com';\n $professor10->password = bcrypt('1234');\n $professor10->save();\n $professor10->roles()->attach($role_professor);\n \n $professor11 = new User();\n $professor11->name = 'Professor11';\n $professor11->email = 'professor11@ufop.com';\n $professor11->password = bcrypt('1234');\n $professor11->save();\n $professor11->roles()->attach($role_professor);\n\n $professor12 = new User();\n $professor12->name = 'Professor12';\n $professor12->email = 'professor12@ufop.com';\n $professor12->password = bcrypt('1234');\n $professor12->save();\n $professor12->roles()->attach($role_professor);\n\n $professor13 = new User();\n $professor13->name = 'Professor13';\n $professor13->email = 'professor13@ufop.com';\n $professor13->password = bcrypt('1234');\n $professor13->save();\n $professor13->roles()->attach($role_professor);\n\n $professor14 = new User();\n $professor14->name = 'Professor14';\n $professor14->email = 'professor14@ufop.com';\n $professor14->password = bcrypt('1234');\n $professor14->save();\n $professor14->roles()->attach($role_professor);\n\n $professor15 = new User();\n $professor15->name = 'Professor15';\n $professor15->email = 'professor15@ufop.com';\n $professor15->password = bcrypt('1234');\n $professor15->save();\n $professor15->roles()->attach($role_professor);\n\n $professor16 = new User();\n $professor16->name = 'Professor16';\n $professor16->email = 'professor16@ufop.com';\n $professor16->password = bcrypt('1234');\n $professor16->save();\n $professor16->roles()->attach($role_professor);\n\n $professor17 = new User();\n $professor17->name = 'Professor17';\n $professor17->email = 'professor17@ufop.com';\n $professor17->password = bcrypt('1234');\n $professor17->save();\n $professor17->roles()->attach($role_professor);\n\n $professor18 = new User();\n $professor18->name = 'Professor18';\n $professor18->email = 'professor18@ufop.com';\n $professor18->password = bcrypt('1234');\n $professor18->save();\n $professor18->roles()->attach($role_professor);\n\n $professor19 = new User();\n $professor19->name = 'Professor19';\n $professor19->email = 'professor19@ufop.com';\n $professor19->password = bcrypt('1234');\n $professor19->save();\n $professor19->roles()->attach($role_professor);\n\n $professor20 = new User();\n $professor20->name = 'Professor20';\n $professor20->email = 'professor20@ufop.com';\n $professor20->password = bcrypt('1234');\n $professor20->save();\n $professor20->roles()->attach($role_professor);\n\n }", "function changeUMPAdminEmail( $adminEmails ) {\n return array( 'tribaldatabase@ncjtc.org' );\n}", "function send_pending_email( $pages, $op, $is_child_affected = false )\n {\n $recipients = array();\n $page_ids = array();\n\n /** @var page $page */\n $page = null;\n\n foreach($pages as $page) {\n $page_ids[] = $page->getId();\n }\n\n if(count($page_ids) > 0)\n {\n\n /** @var roleNode $ExpApproveRole */\n $ExpApproveRole = $this->roleTree->findById($this->user->getRole()->getId());\n\n while($ExpApproveRole->getLevel() >= 0 && $ExpApproveRole = $ExpApproveRole->getParent()) {\n if($ExpApproveRole->hasRights('webpage_admin', array(Right::APPROVE))) {\n $sql = sprintf('SELECT * FROM role_webpage_rights WHERE role_id = %d'\n . ' AND webpage_id IN(%s) AND `right`=%d'\n , $ExpApproveRole->getItem()->getId()\n , implode(', ', array_map('intval', $page_ids)), Right::APPROVE);\n $statement = $this->conn->query($sql);\n\n if($statement->fetch())\n break;\n }\n }\n\n if($ExpApproveRole->getItem()->getId() != $this->user->getRole()->getId()) {\n $id = $ExpApproveRole->getItem()->getId();\n\n //$sql = sprintf('SELECT * FROM users u WHERE role_id = %d AND enabled = 1', $id);\n //Only send email to users have the same language access rights\n $sql = sprintf('SELECT * FROM users u WHERE role_id = %d AND enabled = 1 AND id IN (SELECT user_id FROM (SELECT user_id, GROUP_CONCAT(locale ORDER BY locale ASC SEPARATOR \",\") AS acc_locales FROM user_locale_rights ulr GROUP BY user_id HAVING acc_locales = %s) AS ulr)',\n $id,\n $this->conn->escape(implode(',', $this->user->getAccessibleLocales())));\n $statement = $this->conn->query($sql);\n $recipients = $statement->fetchAll();\n }\n\n $ids = array();\n if(count($recipients)) {\n $tmp = $recipients;\n $recipients = array();\n\n foreach($tmp as $u) {\n $ids[] = $u['id'];\n $recipients[$u['id']] = $u;\n }\n\n // has same number of requested webpage email sent to avoid sending again\n $sql = sprintf('SELECT target_user, COUNT(DISTINCT target_id) AS w_count'\n . ' FROM approval_requests'\n . ' WHERE `type` = \"webpage\" AND requested_by = %d AND target_id IN(%s)'\n . ' AND target_user IN(%s) GROUP BY target_user HAVING w_count = %d'\n , $this->user->getId()\n , implode(', ', $page_ids)\n , implode(', ', $ids)\n , count($page_ids));\n $statement = $this->conn->query($sql);\n while($row = $statement->fetch()) {\n unset($recipients[$row['target_user']]);\n }\n }\n }\n\n // Found\n if ( count($recipients) > 0 )\n {\n $sub_sqls = array();\n\n // Data container\n $user = array();\n $data = compact( 'pages', 'op', 'is_child_affected' );\n $user['first_name'] = $this->user->getFirstname();\n $user['email'] = $this->user->getEmail();\n $this->kernel->smarty->assignByRef( 'data', $data );\n $this->kernel->smarty->assignByRef( 'user', $user );\n\n // Try to send email one by one\n $success = FALSE;\n $lines = explode( \"\\n\", $this->kernel->smarty->fetch(\"module/webpage_admin/locale/{$this->kernel->request['locale']}_pending_email.html\") );\n $this->kernel->mailer->isHTML( TRUE );\n $this->kernel->mailer->ContentType = 'text/html';\n $this->kernel->mailer->Subject = trim( array_shift($lines) );\n $this->kernel->mailer->Body = implode( \"\\n\", $lines );\n\n foreach ( $recipients as $recipient )\n {\n $data['recipient_email'] = $recipient['email'];\n $data['recipient_name'] = $recipient['first_name'];\n\n $this->kernel->mailer->addAddress(\n $data['recipient_email'],\n $data['recipient_name']\n );\n\n foreach($page_ids as $pid) {\n\n $sub_sqls[] = sprintf('(%s, %d, %d, %d, UTC_TIMESTAMP())', '\"webpage\"', $pid, $this->user->getId(), $recipient['id']);\n }\n }\n\n if(count($sub_sqls)) {\n $sql = sprintf('REPLACE INTO approval_requests(type, target_id, requested_by, target_user, requested_time)'\n . ' VALUES %s', implode(', ', $sub_sqls));\n $this->conn->exec($sql);\n }\n\n try {\n $success = $this->kernel->mailer->send();\n } catch(Exception $e) {\n $this->kernel->log('error', sprintf(\"User %d <%s> experienced failure in sending mail: %s\\n\"\n , $this->user->getId(), $this->user->getEmail(), $e->getTraceAsString()), __FILE__, __LINE__);\n }\n $this->kernel->mailer->ClearAllRecipients();\n\n return $success;\n }\n\n return FALSE;\n }", "public function assertGroupRole($group_role, $group_node_type, $group_node_title)\n {\n throw new NotUpdatedException('Method not yet updated for Drupal 8.');\n\n $this->drupalContext->assertAuthenticatedByRole('authenticated user');\n\n $group_node = $this->getNodeByTitle($group_node_type, $group_node_title);\n\n // Add the logged-in user to the group.\n og_group(\n 'node',\n $group_node->nid,\n array(\n 'entity_type' => 'user',\n 'entity' => $this->getAccount(),\n )\n );\n\n $og_roles = og_get_user_roles_name();\n $og_rid = array_search($group_role, $og_roles);\n if ($og_rid === false) {\n throw new \\Exception(sprintf('Organic Groups role \"%s\" does not exist.', $group_role));\n }\n\n // Grant the group role to the logged-in user.\n og_role_grant('node', $group_node->nid, $this->getAccount()->uid, $og_rid);\n\n // Make sure it all worked.\n $this->assertHasGroupRole($group_role, $group_node_type, $group_node_title);\n\n }", "public function attachRoles($roles)\n {\n foreach ($roles as $role) {\n $this->attachRole($role);\n }\n }", "public function adminEmails()\n\t{\n\t\t\n\t\treturn $this->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'User.active' => true,\n\t\t\t\t'User.role' => 'admin',\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'User.email',\n\t\t\t),\n\t\t));\n\t}", "private function sendEmails()\n {\n // get emails of administrators\n $adminEmails = array();\n $this->model->action('user','getUsers',\n array('result' => & $adminEmails,\n 'role' => array('=',20),\n 'status' => array('=',2),\n 'fields' => array('email') )); \n\n $adminBody = 'Hi,<br>A new comment was added to the following article:'; \n $adminBody .= '<a href=\"http://'.$this->router->getBase().'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->config->getModuleVar('article','title').'</a>';\n \n if($this->config->getModuleVar('article','default_comment_status') == 1)\n {\n $adminBody .= '<br><br>You have to validate new comments!'; \n }\n \n $this->model->action('common', 'sendMail',\n array('toEmail' => & $adminEmails,\n 'fromEmail' => '',\n 'subject' => 'New comment added',\n 'body' => (string)$adminBody)); \n \n }", "static function makeRoleOptionList($role) {\n\t\t$usersEmail = db_query(\"SELECT u.uid, mail FROM users_roles r\n INNER JOIN users u ON u.uid = r.uid\n WHERE r.rid = :role\", array(':role' => $role))->fetchAllKeyed();\n\t\treturn $usersEmail;\n\t}", "function os2intra_user_import_add_user_to_parent_departments($account, $department_nid) {\n //$og_department_node = node_load(field_get_items('user', $account, variable_get('os2intra_user_organisation_field'))[0]['target_id']);\n $og_department_node = node_load($department_nid);\n if (empty($og_department_node)) {\n return;\n }\n $group_organisation_field = variable_get('os2intra_groups_organisation_connection_field');\n $group_organisation_reference = variable_get('os2intra_groups_organisation_connection_reference');\n $organisation_tid = field_get_items('node', $og_department_node, $group_organisation_field)[0][$group_organisation_reference];\n\n // Add user to their primary department and give them the 'medarbejder' role\n $values = array(\n 'entity' => $account,\n 'field_name' => variable_get('os2intra_user_primary_og_role_reference_field'),\n );\n og_group('node', $og_department_node->nid, $values);\n og_role_grant('node', $og_department_node->nid, $account->uid, variable_get('os2intra_user_import_og_role_id_primary', 16));\n // Add user to all parent departments and give 'organisatorisk' role on them.\n $parent_terms = taxonomy_get_parents_all($organisation_tid);\n if (isset($parent_terms)) {\n foreach ($parent_terms as $parent_term) {\n if ($parent_term->tid != $organisation_tid) {\n $parent_tids[] = $parent_term->tid;\n }\n }\n if (isset($parent_tids)) {\n // Find the node ID for each department in parent terms.\n $query = new EntityFieldQuery;\n $query->entityCondition('entity_type', 'node');\n $query->entityCondition('bundle', variable_get('os2intra_groups_node_type'));\n $query->fieldCondition($group_organisation_field, $group_organisation_reference, $parent_tids, 'IN');\n // Additional condition when there are few types of groups.\n if (field_info_instance('node', 'field_os2intra_grouptype', variable_get('os2intra_groups_node_type'))) {\n $query->fieldCondition('field_os2intra_grouptype', 'tid', variable_get('os2intra_groups_organisation_tid'));\n }\n\n // Added membership only for real department.\n if (field_info_instance('node', 'field_os2intra_department_id', variable_get('os2intra_groups_node_type'))) {\n $query->fieldCondition('field_os2intra_department_id', 'value', 'NULL', '!=');\n }\n $results = $query->execute();\n if (isset($results['node'])) {\n foreach ($results['node'] as $result) {\n $og_group_node_ids[] = $result->nid;\n }\n\n $values = array(\n 'entity' => $account,\n 'field_name' => variable_get('os2intra_user_parent_og_role_reference_field'),\n );\n foreach ($og_group_node_ids as $nid) {\n // Add the user to the group and set role.\n og_group('node', $nid, $values);\n if (os2intra_user_import_is_user_department_manager($account->uid, $nid)) {\n og_role_grant('node', $nid, $account->uid, variable_get('os2intra_user_import_og_role_id_manager', 15));\n }\n else {\n og_role_grant('node', $nid, $account->uid, variable_get('os2intra_user_import_og_role_id_parent', 14));\n }\n // og_role_grant('node', $nid, $account->uid, variable_get('os2intra_user_import_og_role_id_parent', 14));\n }\n }\n }\n }\n}", "function regenerate_email_arrays() {\r\n\t\t// Initialize the address array\r\n\t\t$this->to_addrs_arr = array();\r\n // Regenerate the to address array\r\n $arAddresses = $this->remove_empty_fields(explode(\";\", $this->to_addrs));\r\n // Regenerate the to names address array\r\n $arNames = $this->remove_empty_fields(explode(\";\", $this->to_addrs_names));\r\n \t// Loop through the email addresses\r\n \tfor ($i=0; $i<count($arAddresses); $i++) {\r\n // Don't add empry strings\r\n if ($arAddresses[$i] != '') {\r\n \t// Do we have a matching name?\r\n \tif (count($arNames) > $i) {\r\n \t// Add the email address and name\r\n \t$this->to_addrs_arr[] = array (\r\n \t'email' => $arAddresses[$i],\r\n \t\t'display' => $arNames[$i],\r\n \t);\r\n\t\t\t\t} else {\r\n // Add the email address only\r\n \t$this->to_addrs_arr[] = array (\r\n \t'email' => $arAddresses[$i],\r\n \t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function addDelAdmins() {\n\t\tglobal $wtcDB, $query;\n\n\t\t// query for freshest groups\n\t\t$usergroups = new Query($query['usergroups']['get_groups']);\n\n\t\twhile($group = $wtcDB->fetchArray($usergroups)) {\n\t\t\t$groups[$group['usergroupid']] = new Usergroup('', $group);\n\t\t}\n\n\t\t// Initialize Admin Groups\n\t\t$adminGroups = Array();\n\n\t\tforeach($groups as $groupid => $obj) {\n\t\t\tif($obj->isAdmin()) {\n\t\t\t\t$adminGroups[] = $groupid;\n\t\t\t}\n\t\t}\n\n\t\t// Get all admins\n\t\t$getAdmins = new Query($query['admin']['get_admins']);\n\t\t$admins = Array();\n\n\t\tif($wtcDB->numRows($getAdmins)) {\n\t\t\twhile($admin = $wtcDB->fetchArray($getAdmins)) {\n\t\t\t\t$admins[$admin['userid']] = $admin;\n\t\t\t}\n\t\t}\n\n\t\t$get = new Query($query['user']['all_users_admin']);\n\n\t\tif($wtcDB->numRows($get)) {\n\t\t\twhile($admin = $wtcDB->fetchArray($get)) {\n\t\t\t\tif(in_array($admin['usergroupid'], $adminGroups) OR searchArray($adminGroups, unserialize($admin['secgroupids']))) {\n\t\t\t\t\t$sAdmins[$admin['userid']] = $admin;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add in un-added admins\n\t\tif(is_array($sAdmins)) {\n\t\t\tforeach($sAdmins as $userid => $info) {\n\t\t\t\tif(!isset($admins[$userid])) {\n\t\t\t\t\tif($userid == 1) {\n\t\t\t\t\t\t$insert = Array(1 => $userid, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$insert = Array(1 => $userid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\t\t\t\t}\n\n\t\t\t\t\tnew Query($query['admin']['insert_admin'], $insert);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delete admins\n\t\tif(is_array($admins)) {\n\t\t\tforeach($admins as $userid => $info) {\n\t\t\t\tif(!isset($sAdmins[$userid])) {\n\t\t\t\t\tnew Delete('admins', 'adminid', $info['adminid'], '', false, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function sendEmails()\n {\n // get emails of administrators\n $adminEmails = array();\n $this->model->action('user','getUsers',\n array('result' => & $adminEmails,\n 'role' => array('=',20),\n 'status' => array('=',2),\n 'fields' => array('email') )); \n\n $adminBody = 'Hi,<br>A new comment was added to the following article:'; \n $adminBody .= '<a href=\"'.$this->config['site_url'].'?id_article='.$this->tplVar['article']['id_article'].'\">'.$this->tplVar['article']['title'].'</a>';\n \n if($this->config['article']['default_comment_status'] == 1)\n {\n $adminBody .= '<br><br>You have to validate new comments!'; \n }\n \n $this->model->action('common', 'sendMail',\n array('toEmail' => & $adminEmails,\n 'fromEmail' => '',\n 'subject' => 'New comment added',\n 'body' => (string)$adminBody)); \n \n }", "public function addEmailNode(EmailInterface $node);", "private function _sendNewProjectEmailToAdministrators()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n // Load the category and set the recipient to this category's email address\n\t\t\t// $category = $this->category;\n\t\t\t// $emails = explode(',', $category->email);\n\t\t\t$user = \\JFactory::getUser('admin');\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Development Project Submission...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$name = $this->recordData['name'];\n\t\t\t$owner = $this->recordData['owner'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('title');\n\t\t\t$query->from($db->quoteName('#__usergroups'));\n\t\t\t$query->where($db->quoteName('id').\" = \". $owner);\n\t\t\t$db->setQuery($query)->loadObject();\n\t\t\t$ownerName = $db->loadResult();\n\t\t\t$ownerName = ltrim($ownerName, \"hsgrp_\");\n\t\t\t\n\t\t\t$submitter = \\JFactory::getUser();\n\t\t\t$submitterName = $submitter->name;\n\t\t\t\n\t\t\t$body = \"A new development project named: \\\"\" . $name . \"\\\" has been submitted by \" . $submitterName . \"@\" . $ownerName . \" to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "function groups_to_users ( ) {\n\t\tforeach ($this->all_grps as $grp => $members) {\n\t\t\t$members = array_unique($members);\t\t// no duplicate members in a grp\n\t\t\tforeach ($members as $m) {\n\t\t\t\tif ( !array_key_exists($m, $this->users) ) {\n\t\t\t\t\t$this->users[$m] = array();\n\t\t\t\t}\n\t\t\t\t$this->users[$m][] = $grp;\n\t\t\t}\n\t\t}\n\t}", "function edit_role_permissions($role, $changed_role_permissions) {\n global $conn;\n\n $role = (int)$role;\n if ($role === 0) {\n return null;\n }\n\n $query = <<<SQL\nSELECT r.thread, r.permissions, t.visibility_rules\nFROM roles r\nLEFT JOIN threads t ON t.id = r.thread\nWHERE r.id = {$role}\nSQL;\n $result = $conn->query($query);\n $row = $result->fetch_assoc();\n if (!$row) {\n return null;\n }\n $thread_id = (int)$row['thread'];\n $vis_rules = (int)$row['visibility_rules'];\n $new_role_permissions = array_filter(array_merge(\n json_decode($row['permissions'], true),\n $changed_role_permissions\n ));\n\n $encoded_role_permissions =\n $conn->real_escape_string(json_encode($new_role_permissions));\n $query = <<<SQL\nUPDATE roles\nSET permissions = '{$encoded_role_permissions}'\nWHERE id = {$role}\nSQL;\n $conn->query($query);\n\n $query = <<<SQL\nSELECT m.user, m.permissions, m.permissions_for_children,\n pm.permissions_for_children AS permissions_from_parent\nFROM memberships m\nLEFT JOIN threads t ON t.id = m.thread\nLEFT JOIN memberships pm ON pm.thread = t.parent_thread_id AND pm.user = m.user\nWHERE m.role = {$role}\nSQL;\n $result = $conn->query($query);\n\n $to_save = array();\n $to_delete = array();\n $to_update_descendants = array();\n while ($row = $result->fetch_assoc()) {\n $user_id = (int)$row['user'];\n $permissions_from_parent = $row['permissions_from_parent']\n ? json_decode($row['permissions_from_parent'], true)\n : null;\n $old_permissions = json_decode($row['permissions'], true);\n $old_permissions_for_children = $row['permissions_for_children']\n ? json_decode($row['permissions_for_children'], true)\n : null;\n\n $permissions = make_permissions_blob(\n $new_role_permissions,\n $permissions_from_parent,\n $thread_id,\n $vis_rules\n );\n if ($permissions == $old_permissions) {\n // This thread and all of its children need no updates, since its\n // permissions are unchanged by this operation\n continue;\n }\n\n $permissions_for_children = permissions_for_children($permissions);\n if ($permissions !== null) {\n $to_save[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n \"permissions\" => $permissions,\n \"permissions_for_children\" => $permissions_for_children,\n \"role\" => $role,\n );\n } else {\n $to_delete[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n );\n }\n\n if ($permissions_for_children != $old_permissions_for_children) {\n $to_update_descendants[$user_id] = $permissions_for_children;\n }\n }\n\n if ($to_update_descendants) {\n $descendant_results =\n update_descendant_permissions($thread_id, $to_update_descendants);\n $to_save = array_merge($to_save, $descendant_results['to_save']);\n $to_delete = array_merge($to_delete, $descendant_results['to_delete']);\n }\n\n return array(\"to_save\" => $to_save, \"to_delete\" => $to_delete);\n}", "public function attachRoles($roles)\n {\n $roles = collect((array) $roles)->map(function ($role, $index){\n return (is_int($role) or is_numeric($role))\n ? (int) $role\n : (is_object($role)\n ? $role->getKey()\n : (is_array($role)\n ? $role['id']\n : (is_string($role)\n ? Role::getByName($role)->getKey()\n : -1\n )));\n })->filter(function($role, $index) {\n return $role != -1 and ! $this->hasRoles(Role::find($role)->name);\n })->toArray();\n\n $this->roles()->attach($roles);\n }", "function bmt_add_contactgroup_relationships($contactgroups, $hosts, $services, $hostopt, $serviceopt, &$msg)\n{\n $errors = 0;\n\n foreach ($contactgroups as $contactgroup) {\n\n // Add to hosts\n if (!empty($hosts)) {\n $hoststring = implode(',', $hosts);\n $query = \"UPDATE tbl_host SET `contact_groups`='1', `last_modified` = NOW(), `contact_groups_tploptions` = '\".intval($hostopt).\"' WHERE `id` IN ({$hoststring})\";\n exec_sql_query(DB_NAGIOSQL, $query, true);\n\n // Add host relations\n foreach ($hosts as $host) {\n $query = \"INSERT INTO tbl_lnkHostToContactgroup SET `idMaster`='{$host}',`idSlave`='{$contactgroup}'\n ON DUPLICATE KEY UPDATE `idMaster`='{$host}',`idSlave`='{$contactgroup}'\";\n exec_sql_query(DB_NAGIOSQL, $query, true);\n }\n }\n\n // Add to services\n if (!empty($services)) {\n $servicestring = implode(',', $services);\n $query = \"UPDATE tbl_service SET `contact_groups`='1', `last_modified` = NOW(), `contact_groups_tploptions` = '\".intval($serviceopt).\"' WHERE `id` IN ({$servicestring})\";\n exec_sql_query(DB_NAGIOSQL, $query, true);\n\n // Add service relations\n foreach ($services as $service) {\n $query = \"INSERT INTO tbl_lnkServiceToContactgroup SET `idMaster`='$service',`idSlave`='{$contactgroup}'\n ON DUPLICATE KEY UPDATE `idMaster`='$service',`idSlave`='{$contactgroup}';\";\n exec_sql_query(DB_NAGIOSQL, $query, true);\n }\n }\n }\n\n return $errors;\n}", "function send_temporary_enrolments_email($assignerid, $assigneeid, $courseid, $raid, $which, $sendto='assigneeid') {\n global $DB;\n\n // Build 'from' object.\n $noreplyuser = \\core_user::get_noreply_user();\n $from = new stdClass();\n $from->customheaders = 'Auto-Submitted: auto-generated';\n $from->maildisplay = true; // Required to prevent Notice.\n $from->email = $noreplyuser->email; // Required to prevent Notice.\n\n // Get related data.\n $course = $DB->get_record('course', array('id' => $courseid));\n $student = $DB->get_record('user', array('id' => $assigneeid));\n $teacher = $DB->get_record('user', array('id' => $assignerid));\n if ($DB->record_exists('local_temporary_enrolments', array('roleassignid' => $raid))) {\n $expiration = $DB->get_record('local_temporary_enrolments', array('roleassignid' => $raid));\n } else {\n $expiration = new stdClass();\n $expiration->timeend = 0;\n }\n\n $replace = array(\n '/\\{TEACHER\\}/' => $teacher->firstname,\n '/\\{STUDENTFIRST\\}/' => $student->firstname,\n '/\\{STUDENTLAST\\}/' => $student->lastname,\n '/\\{STUDENTFULL\\}/' => fullname($student),\n '/\\{COURSE\\}/' => $course->fullname,\n '/\\{TIMELEFT\\}/' => round(($expiration->timeend - time()) / 86400),\n '/\\{SUBJECT: (.*)\\}\\s+/' => '',\n );\n\n // Get raw email content.\n $message = get_config('local_temporary_enrolments', $which . '_content');\n\n // Subject.\n $subject = array();\n preg_match(\"/\\{SUBJECT: (.*)\\}\\s+/\", $message, $subject); // Pull SUBJECT line out of message content.\n\n // Build final email body and subject and to address.\n $subject = preg_replace(array_keys($replace), array_values($replace), $subject[1]);\n $message = preg_replace(array_keys($replace), array_values($replace), $message);\n $to = $DB->get_record('user', array('id' => $$sendto));\n\n // Send email.\n email_to_user($to, $from, $subject, $message);\n}", "final private function add_user_groups($groups){\n $new_groups = account_user_groups::customize($this->get_id(),$groups);\n $unsorted = array_merge($this->get_user_groups(),$new_groups);\n uasort($unsorted, function ($a,$b) {\n return $a->get_value('group_id')-$b->get_value('group_id');\n });\n $this->user_groups = $unsorted;\n }", "function add_role_to_body($classes) {\n global $current_user;\n $user_role = array_shift($current_user->roles);\n $classes[] = 'role-'. $user_role;\n return $classes;\n}", "public function actionSyncronize()\n {\n $module = $this->module;\n $client = $module->client;\n\n $service = new \\Google_Service_Directory($client);\n\n foreach ($module->groups as $group) {\n $model = Yii::createObject($group['model']);\n $query = $model::find();\n $list = $service->members->listMembers($group['groupKey']);\n $members = $list->getMembers();\n\n if (isset($group['scope']) && is_callable($group['scope'])) {\n call_user_func($group['scope'], $query);\n }\n\n $googleGroupEmails = ArrayHelper::getColumn($members, 'email');\n $ownEmails = $query->column();\n\n $delete = array_diff($googleGroupEmails, $ownEmails);\n $insert = array_diff($ownEmails, $googleGroupEmails);\n\n if ($delete) {\n foreach ($delete as $email) {\n $this->stdout('Delete email address from Google Group (' . $group['groupKey'] . '): ' . $email . PHP_EOL, Console::FG_RED);\n\n try {\n $service->members->delete($group['groupKey'], $email);\n } catch (\\Google_Service_Exception $e) {\n $this->stdout('Something went wrong when tried to delete a member: ' . $e->getMessage() . PHP_EOL, Console::FG_RED);\n }\n }\n }\n\n if ($insert) {\n foreach ($insert as $email) {\n $this->stdout('Insert email address into Google Group (' . $group['groupKey'] . '): ' . $email . PHP_EOL, Console::FG_GREEN);\n $member = new \\Google_Service_Directory_Member();\n $member->email = $email;\n $member->deliverySettings = 'ALL_MAIL';\n $member->role = 'MEMBER';\n $member->status = 'ACTIVE';\n\n try {\n $service->members->insert($group['groupKey'], $member);\n } catch (\\Google_Service_Exception $e) {\n $this->stdout('Something went wrong when tried to insert a new member: ' . $e->getMessage() . PHP_EOL, Console::FG_RED);\n }\n }\n }\n }\n }", "public function run()\n {\n $groups = [\n [ 'name' => 'Administrator' ],\n [ 'name' => 'Users' ],\n ];\n\n foreach ($groups as $group)\n {\n Group::create($group);\n }\n\n $group = Group::find(1);\n\n $roles = Role::all()\n ->pluck('id')\n ->toArray();\n\n $group->roles()->attach($roles);\n }", "function add() {\n $user_group_id = $this->input->post('user_group_id');\n $permissionsToGroup = explode(',', $this->input->post('permissionsToGroup'));\n $nodes = $this->input->post('nodes');\n $branches = $this->input->post('branches');\n $module_id = $this->input->post('module_id');\n $language_id = $this->session->userdata('language_id');\n\n $nodes = (!empty($nodes)) ? array_combine(array_values($nodes), array_values($nodes)) : array();\n\n if (empty($branches)) {\n $branches = array();\n }\n\n try {\n //Obtenemos la conexión actual\n $conn = Doctrine_Manager::getInstance()->getCurrentConnection();\n\n //Iniciar transacción\n $conn->beginTransaction();\n\n //se busca la información del grupo\n $group = Doctrine::getTable('UserGroup')->retrieveById($user_group_id);\n\n //se busca la informacion del modulo:\n $module = Doctrine::getTable('Module')->find($module_id);\n // print_r($module->module_name); exit;\n // Se buscan los permisos originales del grupo asociado al modulo\n $permissionsGroup = Doctrine_Core :: getTable('UserGroupAction')->permissionsGroupInModule($user_group_id, $module_id, $language_id)->toArray();\n\n $permission = array();\n $permissionDelete = array();\n $permissionAdd = array();\n\n foreach ($permissionsGroup as $key => $value) {\n\n array_push($permission, $value['module_action_id']);\n }\n\n // permisos agregados al grupo\n $permissionA = array_diff($permissionsToGroup, $permission);\n\n //Se busca la información del modulo.\n foreach ($permissionA as $value) {\n $language_id = $this->session->userdata('language_id');\n $nameModule = Doctrine_Core::getTable('ModuleAction')->retrieveModule($module_id, $user_group_id, $value, $language_id);\n if ((!empty($nameModule)) && (!is_null($nameModule))) {\n if ($nameModule->LanguageTag->language_tag_value) {\n array_push($permissionAdd, $nameModule->LanguageTag->language_tag_value);\n }\n }\n }\n\n $permissionAdd = implode(',', $permissionAdd);\n\n //permisos eliminados al grupo\n $permissionD = array_diff($permission, $permissionsToGroup);\n foreach ($permissionD as $value) {\n $language_id = $this->session->userdata('language_id');\n $nameModule = Doctrine_Core::getTable('ModuleAction')->retrieveModule($module_id, $user_group_id, $value, $language_id);\n if ((!empty($nameModule)) && (!is_null($nameModule))) {\n if ($nameModule->LanguageTag->language_tag_value) {\n array_push($permissionDelete, $nameModule->LanguageTag->language_tag_value);\n }\n }\n }\n\n $permissionDelete = implode(',', $permissionDelete);\n \n\n //Eliminamos la config actual\n Doctrine_Core::getTable('UserGroupAction')->deleteCurrentPermissionsGroup($user_group_id, $module_id);\n \n \n //Insert de los nodos asociados al grupo\n if (!empty($permissionsToGroup[0])) {\n foreach ($permissionsToGroup as $module_action_id) {\n $userGroupAction = new UserGroupAction();\n $userGroupAction->user_group_id = $user_group_id;\n $userGroupAction->module_action_id = $module_action_id;\n $userGroupAction->save();\n }\n }\n\n //Se verifica si el modulo es de activos y se almacena a que nodos tienen permiso las acciones\n \n //Eliminamos la config actual asociada al grupo\n Doctrine_Core::getTable('GroupAssetNode')->deletePermissionsGroupAsset($user_group_id,$module_id);\n \n //Insert de los fields en la configuración para el tipo de nodo\n if (count($nodes) > 0) {\n foreach ($nodes as $node) {\n $groupAssetNode = new GroupAssetNode();\n $groupAssetNode->user_group_id = $user_group_id;\n $groupAssetNode->node_id = $node;\n $groupAssetNode->module_id = $module_id;\n $groupAssetNode->save();\n }\n }\n\n if (count($branches) > 0) {\n //Sacamos los nodos de cada rama seleccionada\n $treeObject = Doctrine_Core::getTable('Node')->getTree();\n foreach ($branches as $branch) {\n //Nodos de la rama\n $nodes_branch = $treeObject->fetchBranch($branch);\n\n //Insert de los nodos id de la rama que no son insertados en el each anterior.\n foreach ($nodes_branch as $node) {\n //Si el node id no fue insertado en el each de los nodos\n if (empty($nodes[$node->node_id]) && !Doctrine_Core::getTable('GroupAssetNode')->findOneByUserGroupIdAndNodeId($user_group_id, $node->node_id, $module_id)) {\n $groupAssetNodeB = new GroupAssetNode();\n $groupAssetNodeB->user_group_id = $user_group_id;\n $groupAssetNodeB->node_id = $node->node_id;\n $groupAssetNodeB->module_id = $module_id;\n @$groupAssetNodeB->save();\n }\n }\n }\n }\n \n\n //Commit de la transacción\n $conn->commit();\n $success = true;\n $msg = $this->translateTag('General', 'successfully_assigned_permission');\n\n if (!empty($permissionAdd)) {\n $this->syslog->register('add_permissions_group', array($permissionAdd, $module->module_name, $group->user_group_name));\n }\n if (!empty($permissionDelete)) {\n $this->syslog->register('delete_permissions_group', array($permissionDelete, $module->module_name, $group->user_group_name));\n }\n } catch (Exception $e) {\n //Rollback de la transacción\n $conn->rollback();\n $success = false;\n $msg = $e->getMessage();\n }\n $json_data = $this->json->encode(array('success' => $success, 'msg' => $msg));\n echo $json_data;\n }", "protected function populate_roles_0951() {\n $roles = array( 'administrator', 'editor' );\n foreach ( $roles as $role ) {\n $role = get_role( $role );\n if ( empty( $role ) ) {\n continue;\n }\n $role->add_cap( 'laterpay_read_post_statistics' );\n $role->add_cap( 'laterpay_edit_individual_price' );\n $role->add_cap( 'laterpay_edit_teaser_content' );\n $role->add_cap( 'laterpay_has_full_access_to_content' );\n }\n\n $roles = array( 'author', 'contributor' );\n foreach ( $roles as $role ) {\n $role = get_role( $role );\n if ( empty( $role ) ) {\n continue;\n }\n $role->add_cap( 'laterpay_read_post_statistics' );\n $role->add_cap( 'laterpay_edit_teaser_content' );\n }\n\n $role = get_role( 'author' );\n if ( ! empty( $role ) ) {\n $role->add_cap( 'laterpay_edit_individual_price' );\n }\n }", "public function P001_11_addUsersToCoursegroups(\\Step\\Acceptance\\Dozent $I, Codeception\\Example $users_to_coursegroup) {\r\n\r\n $cgaddpage = new AddMemberToCoursegroupPage($I, $this->getCurrentContextNid());\r\n $cgaddpage->addMultipleStudentsToCoursegroup($users_to_coursegroup['users'], $users_to_coursegroup['coursegroup_title']);\r\n }", "function savemailtoes($parsedData, $user, $hash)\n{\n //for simpler and faster grouping, all references are push in elasticsearch to all email in group\n if (empty($parsedData['references']) === false)\n updateOthersRefs($parsedData['references'],$user,$parsedData['messageid']);\n \n $parsedData['references'] = updateOwnRefs($parsedData['references'], $user, $parsedData['messageid']);\n \n $elasticReq = curl_init();\n \n curl_setopt_array($elasticReq, array(\n CURLOPT_URL => \"localhost:9200/\".$user.\"/email/\".$hash.\"?pretty\",\n CURLOPT_CUSTOMREQUEST => \"PUT\",\n CURLOPT_POSTFIELDS => json_encode($parsedData),\n CURLOPT_HTTPHEADER => array( \"content-type: application/json\"),\n CURLOPT_RETURNTRANSFER => true,\n ));\n\n curl_exec($elasticReq);\n curl_close($elasticReq);\n}", "public function toAdmin(){\n $this->clearRecipients();\n $this->addTo(Am_Di::getInstance()->config->get('admin_email'), Am_Di::getInstance()->config->get('site_title') . ' Admin');\n if (Am_Di::getInstance()->config->get('copy_admin_email'))\n foreach (preg_split(\"/[,;]/\",Am_Di::getInstance()->config->get('copy_admin_email')) as $email)\n if ($email) $this->addBcc($email);\n return $this;\n }", "public function testMembershipAdd() {\n $loop = 0;\n $random_name = $this->randomMachineName();\n /** @var \\Drupal\\Core\\Entity\\EntityTypeManagerInterface $entity_type_manger */\n $entity_type_manger = $this->container->get('entity_type.manager');\n /** @var \\Drupal\\og\\MembershipManager $membership_manager */\n $membership_manager = $this->container->get('og.membership_manager');\n foreach ($this->membershipAddScenarios() as $scenario) {\n [$account] = $scenario;\n $this->drupalLogin($account);\n $group_data = [\n [$this->groupNode, $this->anotherNodeMembership],\n [$this->groupTestEntity, $this->anotherTestEntityMembership],\n ];\n\n foreach ($group_data as $data) {\n [$group, $membership] = $data;\n /** @var \\Drupal\\og\\OgMembershipInterface $membership */\n $exiting_member = $membership->getOwner();\n $this->drupalGet($this->groupMemberAddFormUrl($group));\n $value = $exiting_member->getDisplayName() . ' (' . $exiting_member->id() . ')';\n $this->submitForm(['Username' => $value], 'Save');\n $this->assertSession()->pageTextMatches('/The user .+ is already a member in this group/');\n $match = 'adminz';\n // Test entity query match.\n $found = $entity_type_manger->getStorage('user')\n ->getQuery()\n ->accessCheck()\n ->condition('uid', 0, '<>')\n ->condition('name', $match, 'CONTAINS')\n ->execute();\n $this->assertCount(3, $found, print_r($found, TRUE));\n // Two of the three possible matches are already members.\n $this->assertAutoCompleteMatches($group, $match, 1);\n // Verify that we can add a new user after matching.\n $new_user = $this->createUser([], $random_name . $loop++);\n $json_data = $this->assertAutoCompleteMatches($group, $new_user->getDisplayName(), 1);\n $this->drupalGet($this->groupMemberAddFormUrl($group));\n $this->submitForm(['Username' => $json_data[0]['value']], 'Save');\n $this->assertSession()->pageTextMatches('/Added .+ to .+/');\n $this->assertTrue($membership_manager->isMember($group, $new_user->id()));\n $new_membership = $membership_manager->getMembership($group, $new_user->id());\n $this->drupalGet($new_membership->toUrl('edit-form'));\n $this->submitForm(['state' => OgMembershipInterface::STATE_BLOCKED], 'Save');\n $new_membership = $entity_type_manger\n ->getStorage('og_membership')\n ->loadUnchanged($new_membership->id());\n $this->assertSame(OgMembershipInterface::STATE_BLOCKED, $new_membership->getState());\n $this->drupalGet($new_membership->toUrl('delete-form'));\n $this->submitForm([], 'Delete');\n $new_membership = $entity_type_manger\n ->getStorage('og_membership')\n ->loadUnchanged($new_membership->id());\n $this->assertNull($new_membership);\n }\n }\n }", "function getAllEmailAddrs()\r\n{\r\n\tinclude_once(\"phpAD.inc.php\");\r\n\r\n\t// parse the config file\r\n \t$config = parse_ini_file(\"Config.ini\", 1);\r\n\r\n\t// create and connect to the AD\r\n\t$ad = new phpAD($config['Security']['ADServer'], $config['Security']['ADPort']);\r\n\r\n\t// validate the user\r\n\t$retVal = $ad->bind($config['Security']['ADServiceName'] . $config['Security']['DomainSuffix'], $config['Security']['ADServicePassword']);\r\n\r\n\t// if the user authenticated\r\n\tif($retVal)\r\n\t{\r\n\t\t// include the lookup object\r\n\t\tinclude_once(\"Lookups.php\");\r\n\r\n\t\t// get a lookup object\r\n\t\t$lus = new Lookups();\r\n\r\n\t\t// get the items for the pull down\r\n\t\t$lus->getLookupByName(\"RoleLU\");\r\n\r\n\t\t// get the list\r\n\t\t$items = $lus->getLookupList();\r\n\r\n\t\t// init the return value\r\n\t\t$addrs = \"\";\r\n\r\n\t\t// for each AD group\r\n\t\tforeach($items as $item)\r\n\t\t{\r\n\t\t\t// get the items for the role\r\n\t\t\t$name = \"RENCI_\" . $lus->getItemNameByID($item->getID());\r\n\r\n\t\t\t// get the members of the group\r\n\t\t\t$groupMembers = $ad->getGroupMembers($name);\r\n\r\n\t\t\t// did we get any group members\r\n\t\t\tif(!empty($groupMembers))\r\n\t\t\t{\r\n\t\t\t\t// for each member retrieved\r\n\t\t\t\tforeach($groupMembers as $groupMember)\r\n\t\t\t\t{\r\n\t\t\t\t\t// get the email address\r\n\t\t\t\t\tif(isset($groupMember['mail'][0]))\r\n\t\t\t\t\t\t$email = $groupMember['mail'][0];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$email = null;\r\n\r\n\t\t\t\t\t// did we get an email address back\r\n\t\t\t\t\tif(!empty($email))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// force mine to be something else\r\n\t\t\t\t\t\tif($email == \"ptowen@unc.edu\")\r\n\t\t\t\t\t\t\t$email = \"powen@renci.org\";\r\n\r\n\t\t\t\t\t\t// if we dont have this string already, save the email address\r\n\t\t\t\t\t\tif(strpos($addrs, $email) === false)\r\n\t\t\t\t\t\t\t$addrs = $addrs . $email . \",\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t$addrs = substr($addrs, 0, strlen($addrs) - 1);\r\n\r\n\t// return to the caller\r\n\treturn $addrs;\r\n}", "public function scrape()\n {\n // Get and store the node set we will work on.\n $this->crawler = $this->getCrawler();\n\n $committee = [\n 'identifier' => (string) $this->getOption('identifier'),\n ];\n\n // Get the French and Dutch name of the committee.\n $committee += $this->getNames();\n\n // Add the list of MPs, categorized by role.\n $committee += $this->getRoles();\n\n return $committee;\n }", "function fillSmartyAndRights() \n\t{\n\t\tforeach($this->groupsArr as $g)\n\t\t{\n\t\t\t$sg = array();\n\t\t\t$sg[\"group_attrs\"] = \"value=\\\"\".$g[0].\"\\\"\";\n\t\t\t$sg[\"groupname\"] = htmlspecialchars($g[1]);\n\t\t\tif($g[0] == $_SESSION[\"hgroup\"])\n\t\t\t\t$sg[\"group_attrs\"].=\" selected\";\n\t\t\t$this->smartyGroups[] = $sg;\n\t\t\tforeach($this->nonAdminTablesArr as $t)\n\t\t\t\t$this->nonAdminTablesRightsArr[$t[0]][$g[0]] = \"\";\n\t\t}\n\t}", "function islandora_workflow_preprocess_permissions_role_table(&$vars) {\n module_load_include('inc', 'islandora_workflow', 'islandora_workflow.permissions');\n module_load_include('inc', 'islandora_workflow', 'fedora_object_functions');\n\n $vars['roles'] = islandora_workflow_get_roles_with_module_permissions();\n $vars['list']['collection_selector'] = drupal_render($vars['list']['collection_selector']);\n $vars['list']['collection_submit'] = drupal_render($vars['list']['collection_submit']);\n\n $active_collection_pid = $_SESSION['workflow_permissions_page']['active_collection'];\n $vars['list']['active_collection_pid'] = $active_collection_pid;\n $vars['list']['active_collection_label'] = islandora_workflow_get_object_label($active_collection_pid);\n\n // Render each form element.\n foreach ($vars['roles'] as $role_id => $role_name) {\n $vars['list'][$role_id][$active_collection_pid] = drupal_render($vars['list'][$role_id][$active_collection_pid]);\n }\n}", "private function attachRbacElements(array $roles, array $permissions): void\n {\n $auth = \\Yii::$app->authManager;\n\n $auth->addChild($permissions[Permissions::MANAGE_OWN_CATALOG], $permissions[Permissions::MANAGE_CATALOG]);\n\n $user = $roles[Roles::USER];\n $auth->addChild($user, $permissions[Permissions::ADD_CATALOG]);\n $auth->addChild($user, $permissions[Permissions::MANAGE_OWN_CATALOG]);\n\n $moderator = $roles[Roles::MODERATOR];\n $auth->addChild($moderator, $user);\n $auth->addChild($moderator, $permissions[Permissions::MANAGE_CATALOG]);\n $auth->addChild($moderator, $permissions[Permissions::MODERATE_CATALOG]);\n $auth->addChild($moderator, $permissions[Permissions::BAN_USER]);\n\n $admin = $roles[Roles::ADMIN];\n $auth->addChild($admin, $moderator);\n $auth->addChild($admin, $permissions[Permissions::GRANT_ROLE]);\n $auth->addChild($admin, $permissions[Permissions::CREATE_TAG]);\n }", "protected function addAllRoles()\n {\n $this->addRole('ROLE_PATIENT');\n $this->addRole('ROLE_ADMIN');\n $this->addRole('ROLE_DOCTOR');\n $this->addRole('ROLE_ASSISTANT');\n }", "private function syncRoles()\n {\n foreach ($this->roles as $roleName => $role) {\n if ($roleEntity = $this->roleRepository->findOneByName($roleName)) {\n $roleEntity->stripPermissions();\n if (count($role['permissions']) == 1 && $role['permissions'][0] == '*') {\n foreach ($this->permissions as $permission) {\n $roleEntity->addPermission($permission);\n }\n } else {\n foreach ($role['permissions'] as $permission) {\n if (array_key_exists($permission, $this->permissions)\n && $this->permissions[$permission]) {\n $roleEntity->addPermission($this->permissions[$permission]);\n } else {\n $this->warning($roleName . ' has unknown permission: ' . $permission);\n }\n }\n }\n $this->info('Updated role: ' . $roleName);\n } else {\n $this->createRole($roleName, $role);\n }\n }\n }", "protected function AddMoreAplUsrWithinRoles() {\r\n }", "function addUserToManyGroups($ldap_conn, $userDistinguishedName, $groupList)\n{\n foreach ($groupList as $group) {\n addUserToGroup($ldap_conn, $userDistinguishedName, $group);\n }\n\n}", "public function UpdateAutoAssignAllUsers()\n {\n // get all users that no longer apply\n $query = \"DELETE FROM `data_extranet_user_data_extranet_group_mlt` WHERE `data_extranet_user_data_extranet_group_mlt`.`target_id` = '\".MySqlLegacySupport::getInstance()->real_escape_string($this->id).\"'\";\n MySqlLegacySupport::getInstance()->query($query);\n\n // now add group to every one with the corrseponding value\n $query = \"SELECT `data_extranet_user`.`id` AS source_id, '\".MySqlLegacySupport::getInstance()->real_escape_string($this->id).\"' AS target_id\n FROM `data_extranet_user`\n LEFT JOIN `shop_order` ON `data_extranet_user`.`id` = `shop_order`.`data_extranet_user_id`\n AND (`shop_order`.`id` IS NULL OR `shop_order`.`canceled` = '0')\n GROUP BY `data_extranet_user` .`id`\n HAVING\n (SUM(`shop_order`.`value_total`) >= {$this->fieldAutoAssignOrderValueStart}\n \";\n if ($this->fieldAutoAssignOrderValueEnd > 0) {\n $query .= \"AND SUM(`shop_order`.`value_total`) < {$this->fieldAutoAssignOrderValueEnd}\";\n }\n $query .= ')';\n if (0.01 == $this->fieldAutoAssignOrderValueEnd) {\n $query .= ' OR SUM( `shop_order`.`value_total` ) IS NULL';\n } // allow users that have no orders\n $query = 'INSERT INTO `data_extranet_user_data_extranet_group_mlt` (`source_id`,`target_id`) '.$query;\n MySqlLegacySupport::getInstance()->query($query);\n\n return MySqlLegacySupport::getInstance()->affected_rows();\n }", "public function setDestAddressGroups($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->dest_address_groups = $arr;\n\n return $this;\n }", "public function mailing_function($sess_values,$role_name,$save_type,$roles_model)\n {\n $group_ids = MANAGEMENT_GROUP.\",\".SYSTEMADMIN_GROUP;\n $object_id = ROLES;\n \n $emp_arr = $roles_model->getEmpForRoleMail($group_ids,$object_id);\n unset($emp_arr[$sess_values->id]);\n if($save_type == 'add') \n {\n $hr_arr = $roles_model->getEmpForRoleMail(HR_GROUP,EMPLOYEE);\n unset($hr_arr[$sess_values->id]);\n $emp_arr = $emp_arr + $hr_arr;\n }\n \n if($save_type == 'add')\n \t$headerText = 'created';\n else\n \t$headerText = 'updated';\t\n foreach($emp_arr as $empdata)\n {\n $base_url = 'http://'.$this->getRequest()->getHttpHost() . $this->getRequest()->getBaseUrl();\n \n $view = $this->getHelper('ViewRenderer')->view;\n $this->view->emp_name = $empdata['userfullname']; \n $this->view->base_url=$base_url;\n $this->view->type = $save_type;\n $this->view->created_by = $sess_values->userfullname;\n $this->view->role_name = $role_name;\n \n $text = $view->render('mailtemplates/role.phtml');\n $options['subject'] = APPLICATION_NAME.': Role is '.$headerText.'';\n $options['header'] = 'Role is '.$headerText.'';\n $options['toEmail'] = $empdata['emailaddress']; \n $options['toName'] = $empdata['userfullname'];\n $options['message'] = $text;\n\n $options['cron'] = 'yes';\n sapp_Global::_sendEmail($options);\n } \n }", "public function run()\n {\n if(DB::table('admin_users')->get()->count() == 0){\n DB::table('admin_users')->insert([\n [\n 'name' => 'Loquare Admin',\n 'email' => 'admin@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 1\n ],\n [\n 'name' => 'Jordi Agent',\n 'email' => 'jordi@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [\n 'name' => 'Nacho Agent',\n 'email' => 'nacho@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'Ana Agent',\n 'email' => 'ana@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'Carlos Agent',\n 'email' => 'carlos@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'Paula Agent',\n 'email' => 'paula@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'Cristian Agent',\n 'email' => 'cristian@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'Eduardo Agent',\n 'email' => 'eduardo@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n [ \n 'name' => 'David Agent',\n 'email' => 'david@loquare.com',\n 'password' => bcrypt('loquare@password'),\n 'role_id' => 2\n ],\n\n ]);\n }\n }", "function getEmailAddrs($roleID)\r\n{\r\n\tinclude_once(\"phpAD.inc.php\");\r\n\r\n\t// parse the config file\r\n \t$config = parse_ini_file(\"Config.ini\", 1);\r\n\r\n\t// create and connect to the AD\r\n\t$ad = new phpAD($config['Security']['ADServer'], $config['Security']['ADPort']);\r\n\r\n\t// validate the user\r\n\t$retVal = $ad->bind($config['Security']['ADServiceName'] . $config['Security']['DomainSuffix'], $config['Security']['ADServicePassword']);\r\n\r\n\t// init the return value\r\n\t$addrs = \"\";\r\n\r\n\t// if the user authenticated\r\n\tif($retVal)\r\n\t{\r\n\t\t// include the lookup object\r\n\t\tinclude_once(\"Lookups.php\");\r\n\r\n\t\t// get a lookup object\r\n\t\t$lus = new Lookups();\r\n\r\n\t\t// get the items for the pull down\r\n\t\t$lus->getLookupByName(\"RoleLU\");\r\n\r\n\t\t// get the items for the role\r\n\t\t$name = \"RENCI_\" . $lus->getItemNameByID($roleID);\r\n\r\n\t\t// get the members of the group\r\n\t\t$groupMembers = $ad->getGroupMembers($name);\r\n\r\n\t\t// did we get any group members\r\n\t\tif(!empty($groupMembers))\r\n\t\t{\r\n\t\t\t// for each member retrieved\r\n\t\t\tforeach($groupMembers as $groupMember)\r\n\t\t\t{\r\n\t\t\t\t// get the email address\r\n\t\t\t\tif(isset($groupMember['mail'][0]))\r\n\t\t\t\t\t$email = $groupMember['mail'][0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$email = null;\r\n\r\n\t\t\t\t// did we get an email address back\r\n\t\t\t\tif(!empty($email))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($email == \"ptowen@unc.edu\")\r\n\t\t\t\t\t\t$email = \"powen@renci.org\";\r\n\r\n\t\t\t\t\t// save the email address\r\n\t\t\t\t\t$addrs = $addrs . $email . \",\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// get the deliver all email address and append\r\n if(!empty($config['Debug']['DeliverAll']))\r\n \t$addrs = $addrs . $config['Debug']['DeliverAll'];\r\n else if(!empty($addrs))\r\n\t\t$addrs = substr($addrs, 0, strlen($addrs) - 1);\r\n\r\n\t// return to the caller\r\n\treturn $addrs;\r\n}", "public function sendBulkEmailsMembers($members, $emailSubject, $emailBody, $replyTo, $request)\n {\n\n $results = NULL;\n $i = 0;\n foreach ($members as $member){\n\n $newMail = $this->replacePlaceholdersMembers($emailSubject, $emailBody, $member, $request);\n $template = $this->twig->loadTemplate('email/bulkEmail.html.twig');\n $htmlMail = $template->render(array('mailSubject' => $newMail['subject'],\n 'mailBody' => $newMail['body'],\n 'nameOfOrganization' => $this->settings->getNameOfOrganization(),\n 'orgWebsite' => $this->settings->getOrgWebsite()));\n\n $this->message\n ->setSubject($newMail['subject'])\n ->setFrom(array( $this->settings->getEmail() => $this->from));\n\n try{\n $this->message->setTo(array($member->user->email_1 => $member->user->first_name.' '.$member->user->last_name));\n $this->message->setBody($htmlMail, 'text/html');\n $this->message->setReplyTo($replyTo);\n\n $result = array('exception' => false,\n 'userId' => $member->user->id,\n 'membershipId' => $member->membership->id,\n 'memberId' => $member->membership->memberId,\n 'sent' => $this->mailer->send($this->message),\n 'message' => 'Email successfully sent to '.$member->user->email_1);\n }\n catch (\\Exception $e){\n\n $result = array('exception' => true,\n 'userId' => $member->user->id,\n 'membershipId' => $member->membership->id,\n 'memberId' => $member->membership->memberId,\n 'sent' => $this->mailer->send($this->message),\n 'message' => $e->getMessage());\n }\n $results[$i] = $result;\n $i++;\n }\n return $results;\n }", "public function send_to_mentor_users() {\n $mentorusers = $this->get_recipient_mentors();\n\n foreach ($mentorusers as $mentoruser) {\n $this->send_email_to_mentor_user($mentoruser, $this->message_params->userto);\n }\n }", "function change_role($thread_id, $user_ids, $role) {\n global $conn;\n\n // The code in the blocks below needs to determine three variables:\n // - $new_role, the actual $role value we're saving\n // - $role_permissions, the permissions column of the $new_role\n // - $vis_rules, the visibility rules of $thread_id\n if ($role === 0) {\n $new_role = 0;\n $role_permissions = null;\n $query = <<<SQL\nSELECT visibility_rules FROM threads WHERE id = {$thread_id}\nSQL;\n $result = $conn->query($query);\n $row = $result->fetch_assoc();\n if (!$row) {\n return null;\n }\n $vis_rules = (int)$row['visibility_rules'];\n } else if ($role !== null) {\n $new_role = (int)$role;\n $query = <<<SQL\nSELECT t.visibility_rules, r.permissions\nFROM threads t\nLEFT JOIN roles r ON r.id = {$new_role}\nWHERE t.id = {$thread_id}\nSQL;\n $result = $conn->query($query);\n $row = $result->fetch_assoc();\n if (!$row) {\n return null;\n }\n $role_permissions = json_decode($row['permissions'], true);\n $vis_rules = (int)$row['visibility_rules'];\n } else {\n $query = <<<SQL\nSELECT t.visibility_rules, t.default_role, r.permissions\nFROM threads t\nLEFT JOIN roles r ON r.id = t.default_role\nWHERE t.id = {$thread_id}\nSQL;\n $result = $conn->query($query);\n $row = $result->fetch_assoc();\n if (!$row) {\n return null;\n }\n $new_role = (int)$row['default_role'];\n $role_permissions = json_decode($row['permissions'], true);\n $vis_rules = (int)$row['visibility_rules'];\n }\n\n $user_id_sql_string = implode(\", \", $user_ids);\n $query = <<<SQL\nSELECT m.user, m.role, m.permissions_for_children,\n pm.permissions_for_children AS permissions_from_parent\nFROM memberships m\nLEFT JOIN threads t ON t.id = m.thread\nLEFT JOIN memberships pm ON pm.thread = t.parent_thread_id AND pm.user = m.user\nWHERE m.thread = {$thread_id} AND m.user IN ({$user_id_sql_string})\nSQL;\n $result = $conn->query($query);\n\n $role_info = array();\n while ($row = $result->fetch_assoc()) {\n $user_id = (int)$row['user'];\n $old_permissions_for_children = $row['permissions_for_children']\n ? json_decode($row['permissions_for_children'], true)\n : null;\n $permissions_from_parent = $row['permissions_from_parent']\n ? json_decode($row['permissions_from_parent'], true)\n : null;\n $role_info[$user_id] = array(\n \"old_role\" => (int)$row['role'],\n \"old_permissions_for_children\" => $old_permissions_for_children,\n \"permissions_from_parent\" => $permissions_from_parent,\n );\n }\n\n $to_save = array();\n $to_delete = array();\n $to_update_descendants = array();\n foreach ($user_ids as $user_id) {\n $old_permissions_for_children = null;\n $permissions_from_parent = null;\n if (isset($role_info[$user_id])) {\n $old_role = $role_info[$user_id]['old_role'];\n if ($old_role === $new_role) {\n // If the old role is the same as the new one, we have nothing to update\n continue;\n } else if ($old_role !== 0 && $role === null) {\n // In the case where we're just trying to add somebody to a thread, if\n // they already have a role with a nonzero role then we don't need to do\n // anything\n continue;\n }\n $old_permissions_for_children =\n $role_info[$user_id]['old_permissions_for_children'];\n $permissions_from_parent =\n $role_info[$user_id]['permissions_from_parent'];\n }\n\n $permissions = make_permissions_blob(\n $role_permissions,\n $permissions_from_parent,\n $thread_id,\n $vis_rules\n );\n $permissions_for_children = permissions_for_children($permissions);\n\n if ($permissions === null) {\n $to_delete[] = array(\"user_id\" => $user_id, \"thread_id\" => $thread_id);\n } else {\n $to_save[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n \"permissions\" => $permissions,\n \"permissions_for_children\" => $permissions_for_children,\n \"role\" => $new_role,\n );\n }\n\n if ($permissions_for_children != $old_permissions_for_children) {\n $to_update_descendants[$user_id] = $permissions_for_children;\n }\n }\n\n if ($to_update_descendants) {\n $descendant_results =\n update_descendant_permissions($thread_id, $to_update_descendants);\n $to_save = array_merge($to_save, $descendant_results['to_save']);\n $to_delete = array_merge($to_delete, $descendant_results['to_delete']);\n }\n \n return array(\"to_save\" => $to_save, \"to_delete\" => $to_delete);\n}", "public function run()\n {\n $users = array(\n [\n 'email' => 'parent1@admin.pl',\n 'password' => 'admin',\n 'status' => 1,\n 'role_admin' => 0,\n 'role_teacher' => 0,\n 'role_student' => 0,\n 'role_parent' => 1,\n 'role_director' => 0,\n 'meta' => [\n 'name' => 'Mateusz',\n 'surname' => 'Dziedzic',\n 'phone' => '512849338',\n 'birth_date' => '1980-02-15',\n 'PESEL' => '80021533934',\n ]\n ],\n [\n 'email' => 'parent2@admin.pl',\n 'password' => 'admin',\n 'status' => 1,\n 'role_admin' => 0,\n 'role_teacher' => 0,\n 'role_student' => 0,\n 'role_parent' => 1,\n 'role_director' => 0,\n 'meta' => [\n 'name' => 'Wiktor',\n 'surname' => 'Wilczyński',\n 'phone' => '758374843',\n 'birth_date' => '1978-11-09',\n 'PESEL' => '78110938473',\n ]\n ],\n [\n 'email' => 'parent3@admin.pl',\n 'password' => 'admin',\n 'status' => 1,\n 'role_admin' => 0,\n 'role_teacher' => 0,\n 'role_student' => 0,\n 'role_parent' => 1,\n 'role_director' => 0,\n 'meta' => [\n 'name' => 'Barbara',\n 'surname' => 'Grabowska',\n 'phone' => '755940393',\n 'birth_date' => '1981-03-19',\n 'PESEL' => '81031929203',\n ]\n ],\n [\n 'email' => 'parent4@admin.pl',\n 'password' => 'admin',\n 'status' => 1,\n 'role_admin' => 0,\n 'role_teacher' => 0,\n 'role_student' => 0,\n 'role_parent' => 1,\n 'role_director' => 0,\n 'meta' => [\n 'name' => 'Jan',\n 'surname' => 'Cebulak',\n 'phone' => '550494383',\n 'birth_date' => '1977-09-10',\n 'PESEL' => '77091029393',\n ]\n ],\n [\n 'email' => 'parent5admin.pl',\n 'password' => 'admin',\n 'status' => 1,\n 'role_admin' => 0,\n 'role_teacher' => 0,\n 'role_student' => 0,\n 'role_parent' => 1,\n 'role_director' => 0,\n 'meta' => [\n 'name' => 'Maria',\n 'surname' => 'Rutkowska',\n 'phone' => '757496383',\n 'birth_date' => '1982-10-21',\n 'PESEL' => '82102129392',\n ]\n ],\n );\n\n $parents = array(\n [\n 'parent_id' => 33,\n 'student_id' => 32,\n ],\n [\n 'parent_id' => 34,\n 'student_id' => 29,\n ],\n [\n 'parent_id' => 35,\n 'student_id' => 28,\n ],\n [\n 'parent_id' => 36,\n 'student_id' => 24,\n ],\n [\n 'parent_id' => 37,\n 'student_id' => 27,\n ],\n );\n\n foreach($users as $user) {\n $row = new User();\n $row->class_id = $user['class_id'] ?? null;\n $row->email = $user['email'];\n $row->password = Hash::make($user['password']);\n $row->status = $user['status'];\n $row->role_admin = $user['role_admin'];\n $row->role_teacher = $user['role_teacher'];\n $row->role_student = $user['role_student'];\n $row->role_parent = $user['role_parent'];\n $row->role_director = $user['role_director'];\n\n $row->save();\n\n $row->meta()->create([\n 'name' => $user['meta']['name'],\n 'surname' => $user['meta']['surname'],\n 'phone' => $user['meta']['phone'],\n 'birth_date' => $user['meta']['birth_date'],\n 'PESEL' => $user['meta']['PESEL'],\n 'avatar' => 'user.png',\n ]);\n }\n foreach($parents as $parent) {\n \\App\\Parents::create($parent);\n }\n }", "function insertEditorsEmails($hookName, $params) {\n\t\tif ($this->getEnabled()) {\n\t\t\t$smarty =& $params[1];\n\t\t\t$output =& $params[2];\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t$currentJournal = $templateMgr->get_template_vars('currentJournal');\n\n\t\t\tif (!empty($currentJournal)) {\n\t\t\t\t$journal =& Request::getJournal();\n\t\t\t\t$journalId = $journal->getJournalId();\n\t\t\t\t$roleDao = &DAORegistry::getDAO('RoleDAO');\n\t\t\t\t$editors = $roleDao->getUsersByRoleId)(ROLE_ID_EDITOR,$journalId);\n\t\t\t\twhile (!$editors->eof() {\n\t\t\t\t\t$editor = &editors->next();\n\t\t\t\t\t$editorAddresses[$editor->getEmail()] = $editor->getFullName();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\tif ($trackingCode == \"ga\") {\n\t\t\t\t\t\t$output .= $templateMgr->fetch($this->getTemplatePath() . 'pageTagGa.tpl'); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= $templateMgr->fetch($this->getTemplatePath() . 'pageTagUrchin.tpl'); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function get_assigned_records($filter) {\n if (has_capability('block/curr_admin:cluster:role_assign_cluster_users', $this->get_context(), NULL, false)) {\n global $CURMAN, $CFG;\n\n $context = $this->get_context();\n $roleid = required_param('role', PARAM_INT);\n\n $pagenum = optional_param('page', 0, PARAM_INT);\n $perpage = 30;\n\n $sort = optional_param('sort', 'name', PARAM_ACTION);\n $order = optional_param('dir', 'ASC', PARAM_ACTION);\n if ($order != 'DESC') {\n $order = 'ASC';\n }\n\n static $sortfields = array(\n 'name' => array('lastname', 'firstname'),\n 'idnumber' => 'idnumber',\n );\n if (!array_key_exists($sort, $sortfields)) {\n $sort = key($sortfields);\n }\n if (is_array($sortfields[$sort])) {\n $sortclause = implode(', ', array_map(create_function('$x', \"return \\\"\\$x $order\\\";\"), $sortfields[$sort]));\n } else {\n $sortclause = \"{$sortfields[$sort]} $order\";\n }\n\n $where = \"idnumber IN (SELECT mu.idnumber\n FROM {$CURMAN->db->prefix_table('user')} mu\n JOIN {$CURMAN->db->prefix_table('role_assignments')} ra\n ON ra.userid = mu.id\n WHERE ra.contextid = $context->id\n AND ra.roleid = $roleid\n AND mu.mnethostid = {$CFG->mnet_localhost_id})\n AND id IN (SELECT userid\n FROM {$CURMAN->db->prefix_table('crlm_usercluster')} uc\n WHERE uc.clusterid = {$context->instanceid})\";\n\n $extrasql = $filter->get_sql_filter();\n if ($extrasql) {\n $where .= \" AND $extrasql\";\n }\n\n $count = $CURMAN->db->count_records_select('crlm_user usr', $where);\n $users = $CURMAN->db->get_records_select('crlm_user usr', $where, $sortclause, '*', $pagenum*$perpage, $perpage);\n\n return array($users, $count);\n } else {\n return parent::get_assigned_records($filter);\n }\n }", "function update_descendant_permissions(\n $initial_parent_thread_id,\n $initial_users_to_permissions_from_parent\n) {\n global $conn;\n\n $stack = array(array(\n $initial_parent_thread_id,\n $initial_users_to_permissions_from_parent,\n ));\n $to_save = array();\n $to_delete = array();\n while ($stack) {\n list($parent_thread_id, $users_to_permissions_from_parent)\n = array_shift($stack);\n\n $user_ids = array_keys($users_to_permissions_from_parent);\n $user_id_sql_string = implode(\", \", $user_ids);\n $query = <<<SQL\nSELECT t.id, m.user, t.visibility_rules, r.permissions AS role_permissions,\n m.permissions, m.permissions_for_children, m.role\nFROM threads t \nLEFT JOIN memberships m ON m.thread = t.id AND m.user IN ({$user_id_sql_string})\nLEFT JOIN roles r ON r.id = m.role\nWHERE t.parent_thread_id = {$parent_thread_id}\nSQL;\n $result = $conn->query($query);\n\n $child_thread_infos = array();\n while ($row = $result->fetch_assoc()) {\n $thread_id = (int)$row['id'];\n if (!isset($child_thread_infos[$thread_id])) {\n $child_thread_infos[$thread_id] = array(\n \"visibility_rules\" => (int)$row['visibility_rules'],\n \"user_infos\" => array(),\n );\n }\n if (!$row['user']) {\n continue;\n }\n $user_id = (int)$row['user'];\n $child_thread_infos[$thread_id][\"user_infos\"][$user_id] = array(\n \"role\" => (int)$row['role'],\n \"role_permissions\" =>\n json_decode($row['role_permissions'], true),\n \"permissions\" =>\n json_decode($row['permissions'], true),\n \"permissions_for_children\" =>\n json_decode($row['permissions_for_children'], true),\n );\n }\n\n foreach ($child_thread_infos as $thread_id => $child_thread_info) {\n $user_infos = $child_thread_info['user_infos'];\n $users_for_next_layer = array();\n foreach (\n $users_to_permissions_from_parent as\n $user_id => $permissions_from_parent\n ) {\n $role = 0;\n $role_permissions = null;\n $old_permissions = null;\n $old_permissions_for_children = null;\n if (isset($user_infos[$user_id])) {\n $role = $user_infos[$user_id]['role'];\n $role_permissions = $user_infos[$user_id]['role_permissions'];\n $old_permissions = $user_infos[$user_id]['permissions'];\n $old_permissions_for_children =\n $user_infos[$user_id]['permissions_for_children'];\n }\n $permissions = make_permissions_blob(\n $role_permissions,\n $permissions_from_parent,\n $thread_id,\n $child_thread_info['visibility_rules']\n );\n if ($permissions == $old_permissions) {\n // This thread and all of its children need no updates, since its\n // permissions are unchanged by this operation\n continue;\n }\n $permissions_for_children = permissions_for_children($permissions);\n if ($permissions !== null) {\n $to_save[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n \"permissions\" => $permissions,\n \"permissions_for_children\" => $permissions_for_children,\n \"role\" => $role,\n );\n } else {\n $to_delete[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n );\n }\n if ($permissions_for_children != $old_permissions_for_children) {\n // Our children only need updates if permissions_for_children changed\n $users_for_next_layer[$user_id] = $permissions_for_children;\n }\n }\n if ($users_for_next_layer) {\n $stack[] = array($thread_id, $users_for_next_layer);\n }\n }\n }\n return array(\"to_save\" => $to_save, \"to_delete\" => $to_delete);\n}", "private function executeEdit(): array\n {\n $groupid = input_get('groupid');\n $nonce = $this->create_nonce();\n $tobj = TableGroups::findByID($groupid);\n $no = [];\n $yes = [];\n $nodata = [];\n $yesdata = [];\n if (BC_GROUP_SELECT == $tobj->type) {\n $jobj = new JoinMembersUsersGroupMembers();\n $jobj->loopMembersForGroup($groupid);\n while ($jobj->fetch()) {\n if ($jobj->isMember()) {\n $yes[] = [\n 'id' => $jobj->member_id,\n 'name' => $jobj->fullname,\n 'active' => $jobj->active\n ];\n $yesdata[] = $jobj->member_id;\n } else {\n $no[] = [\n 'id' => $jobj->member_id,\n 'name' => $jobj->fullname,\n 'active' => $jobj->active\n ];\n $nodata[] = $jobj->member_id;\n }\n }\n }\n if ((BC_GROUP_WORDPRESS == $tobj->type) ||\n (BC_GROUP_ANNOUNCEMENTS == $tobj->type)) {\n $users = \\get_users();\n foreach ($users as $user) {\n $item = [\n 'id' => $user->id,\n 'name' => $user->first_name . ' ' . $user->last_name,\n 'active' => true\n ];\n if (!trim($item['name'])) {\n $item['name'] = $user->user_login;\n }\n if (TableGroupUsers::isUser($groupid, $user->id)) {\n $yes[] = $item;\n $yesdata[] = $user->id;\n } else {\n $no[] = $item;\n $nodata[] = $user->id;\n }\n }\n }\n $json = [\n 'nonce' => $nonce,\n 'admin_url' => url_admin_post(),\n 'referer' => url_menu('bc_groups'),\n 'title' => \\get_admin_page_title(),\n 'images' => url_images(),\n 'mode' => 'edit',\n 'group_id' => $groupid,\n 'groups' => getGroups(),\n 'yes' => $yes,\n 'no' => $no,\n 'yes_data' => join(',', $yesdata),\n 'no_data' => join(',', $nodata),\n 'tag' => $tobj->tag,\n 'type' => $tobj->type,\n 'description' => $tobj->description,\n 'url' => $tobj->url,\n 't_event_id' => $tobj->t_event_id,\n 't_max_attend' => $tobj->t_max_attend,\n 't_starttime' => $tobj->t_starttime,\n 't_endtime' => $tobj->t_endtime,\n 't_summary' => $tobj->t_summary,\n 't_description' => $tobj->t_description,\n 't_include' => $tobj->t_include\n ];\n return $json;\n }", "function cmd_compileMailGroup_postProcess($id_lists, &$parentObject, $mailGroup) {\n global $TYPO3_DB;\n /**\n * Do only for custom sys_dmail_group type == 5 (additional type)\n * Here a special solution, because of bug: http://forge.typo3.org/issues/36467\n */\n // mod3: Reciepientlist\n if ($parentObject->MCONF['name'] == 'DirectMailNavFrame_RecipientList') { // mod3: Reciepientlist - define reciepient mail groups\n if ($mailGroup['type'] == 5 && !empty($mailGroup['query'])) {\n $mails = $this->getUniqueMails($mailGroup['query']);\n }\n }\n // mod2: Direct Mail\n // Since there is called a further method getSingleMailGroup($group_uid), we need this workaround\n if ($parentObject->MCONF['name'] == 'DirectMailNavFrame_DirectMail') { // mod2: Direct Mail - prepair sending newsletter\n if ($mailGroup[0])\n $mailGroup = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('sys_dmail_group', $mailGroup[0]);\n // for additional types\n if ($mailGroup['type'] == 5 && !empty($mailGroup['query'])) {\n $mails = $this->getUniqueMails($mailGroup['query']); \n } \n }\n // merge mails with existing list\n if (empty($id_lists['PLAINLIST']))\n $id_lists['PLAINLIST'] = array();\n if (!empty($mails))\n $id_lists['PLAINLIST'] = array_merge($id_lists['PLAINLIST'], $mails);\n return $id_lists;\n }", "public function run()\n {\n DB::table('user_roles')->insert([\n [\n 'user_id' => 1,\n 'role_id' => 1,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n ]);\n\n DB::table('role_permissions')->insert([\n [\n 'role_id' => 1,\n 'permission_id' => 1,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 2,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 3,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 4,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 5,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 6,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 7,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 8,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 9,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 10,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 11,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 12,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 13,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'role_id' => 1,\n 'permission_id' => 14,\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n ]);\n\n DB::table('roles')->insert([\n [\n 'name' => 'admin',\n 'description' => 'Admin',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'operator',\n 'description' => 'Operator',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n ],\n [\n 'name' => 'sales',\n 'description' => 'Sales',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n ],\n ]);\n\n DB::table('permissions')->insert([\n [\n 'name' => 'access.inventory',\n 'description' => 'Access Inventory',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.order',\n 'description' => 'Access Order',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.product',\n 'description' => 'Access Product',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.customer',\n 'description' => 'Access Customer',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.report',\n 'description' => 'Access Report',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.setting',\n 'description' => 'Access Setting',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.template',\n 'description' => 'Access Template',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.category',\n 'description' => 'Access Category',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.ordertype',\n 'description' => 'Access Order Type',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.country',\n 'description' => 'Access Country',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.currency',\n 'description' => 'Access Currency',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.user',\n 'description' => 'Access User',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.dashboard',\n 'description' => 'Access Dashboard',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n [\n 'name' => 'access.role',\n 'description' => 'Access Role',\n 'created_by' => 'system',\n 'updated_by' => 'system',\n\n ],\n ]);\n }", "public function run()\n {\n $role_employee = Role::where('name', 'admin')->first();\n $role_manager = Role::where('name', 'manager')->first();\n $employee = new User();\n $employee->login= 'admin';\n $employee->name = 'Admin Name';\n $employee->email = 'emp@e';\n $employee->password = bcrypt('735700');\n $employee->save();\n $employee->roles()->attach($role_employee);\n $employee->roles()->attach($role_manager);\n\n $manager = new User();\n $manager->login = 'cashier1';\n $manager->name = 'manger Name';\n $manager->email = 'manager@example.com';\n $manager->password = bcrypt('735701');\n $manager->save();\n $manager->roles()->attach($role_manager);\n\n $manager = new User();\n $manager->login = 'cashier2';\n $manager->name = 'manger Name';\n $manager->email = 'manager2@example.com';\n $manager->password = bcrypt('735702');\n $manager->save();\n $manager->roles()->attach($role_manager);\n\n $manager = new User();\n $manager->login = 'cashier3';\n $manager->name = 'manger Name';\n $manager->email = 'manager3@example.com';\n $manager->password = bcrypt('735703');\n $manager->save();\n $manager->roles()->attach($role_manager);\n\n $manager = new User();\n $manager->login = 'cashier4';\n $manager->name = 'manger Name';\n $manager->email = 'manager4@example.com';\n $manager->password = bcrypt('735704');\n $manager->save();\n $manager->roles()->attach($role_manager);\n\n\n //\n }", "protected function addChangeEmailFields()\n {\n $this->form->add([\n 'name' => 'newEmail',\n 'type' => 'Zend\\Form\\Element\\Email',\n 'attributes' => [\n 'type' => 'email',\n 'required' => 'true',\n ],\n ]);\n\n $this->form->add([\n 'name' => 'newEmailVerify',\n 'type' => 'Zend\\Form\\Element\\Email',\n 'attributes' => [\n 'type' => 'email',\n 'required' => 'true',\n ],\n ]);\n\n $this->form->add([\n 'name' => 'currentPassword',\n 'type' => 'Zend\\Form\\Element\\Password',\n 'attributes' => [\n 'type' => 'password',\n 'required' => 'true',\n ],\n ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n $users = 10;\n $nodes = [\n ['tree_id'=>1, 'name'=>'root', 'numer'=>0, 'denom'=>1, 'interval_l'=>0, 'interval_r'=>PHP_INT_MAX],\n ];\n\n foreach ($nodes as $node)\n {\n if('root' == $node['name']) {\n $node = new Group($node);\n $node->save();\n } else {\n $parent = Group::where('name', $node['parent'])->firstOrFail();\n $parent->insertChild($node['name']);\n }\n }\n\n $root = Group::where('name', 'root')->firstOrFail();\n\n for($i = 0; $i < 2; $i++) {\n $node = $root->insertChild('group' . $i);\n for ($j = 0; $j < 2; $j++) {\n $node2 = $node->insertChild('group' . $i . '_' . $j);\n for ($k = 0; $k < 2; $k++) {\n $node3 = $node2->insertChild('group' . $i . '_' . $j . '_' . $k);\n }\n }\n echo $i . PHP_EOL;\n }\n\n\n for ($i = 0; $i < $users; $i++)\n {\n $user = User::create([\n 'name' => $faker->userName,\n 'email' => $faker->email,\n 'password' => $faker->word\n ]);\n $groupId = (0 === $i % 5) ? 2 : ((1 === $i % 2) ? 3 : 4);\n $user->groups()->attach($groupId);\n }\n\n }", "public function run()\n {\n for ($i = 2; $i <= 6; ++$i) {\n $permission_ids = Permission::where('group_id', '<=', $i)->get()->pluck('id')->toArray();\n $role = Role::where('project_id', null)->where('level', $i)->first();\n $role->permissions()->attach($permission_ids);\n }\n }", "function populate_roles()\n{\n}", "public function testAssignRolesWithMultipleRolesAssigned()\n {\n $userId = 1;\n $companyId = 1;\n $role = $this->getMockBuilder(\\Magento\\Company\\Api\\Data\\RoleInterface::class)\n ->disableOriginalConstructor()\n ->setMethods(['getId'])\n ->getMockForAbstractClass();\n $role->expects($this->atLeastOnce())\n ->method('getId')\n ->willReturnOnConsecutiveCalls(1, 1, 3, 5);\n $this->roleManagement->expects($this->once())\n ->method('getRolesByCompanyId')\n ->with($companyId)\n ->willReturn([$role, $role]);\n\n $extensionAttributes = $this->getMockBuilder(\\Magento\\Customer\\Api\\Data\\CustomerExtensionInterface::class)\n ->disableOriginalConstructor()\n ->setMethods(['getCompanyAttributes', 'getCompanyId'])\n ->getMockForAbstractClass();\n $extensionAttributes->expects($this->once())\n ->method('getCompanyAttributes')\n ->willReturnSelf();\n $extensionAttributes->expects($this->once())\n ->method('getCompanyId')\n ->willReturn($companyId);\n $customer = $this->getMockBuilder(\\Magento\\Customer\\Api\\Data\\CustomerInterface::class)\n ->disableOriginalConstructor()\n ->setMethods(['getExtensionAttributes'])\n ->getMockForAbstractClass();\n $customer->expects($this->once())\n ->method('getExtensionAttributes')\n ->willReturn($extensionAttributes);\n $this->customerRepository->expects($this->once())\n ->method('getById')\n ->with($userId)\n ->willReturn($customer);\n\n $this->userRoleManagement->assignRoles($userId, [$role, $role, $role]);\n }", "public function synchroUserGroups(){}", "function getEmailsOfRecipients($a_rcp)\n\t{\n\t\tglobal $rbacreview;\n\t\t\n\t\t$addresses = array();\n\n\t\t$this->validatePear($a_rcp);\n\t\tif (ilMail::_usePearMail() && $this->getUsePear())\n\t\t{\n\t\t\t$tmp_rcp = $this->explodeRecipients($a_rcp);\n\t\t\tif (! is_a($tmp_rcp, 'PEAR_Error'))\n\t\t\t{\n\t\t\t\tforeach ($tmp_rcp as $rcp)\n\t\t\t\t{\n\t\t\t\t\t// NO GROUP\n\t\t\t\t\tif (substr($rcp->mailbox,0,1) != '#' && substr($rcp->mailbox,0, 2) != '\"#')\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strtolower($rcp->host) != self::ILIAS_HOST)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$addresses[] = $rcp->mailbox.'@'.$rcp->host;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($id = ilObjUser::getUserIdByLogin(addslashes($rcp->mailbox)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tmp_user = self::getCachedUserInstance($id);\n\t\t\t\t\t\t\t$addresses[] = $tmp_user->getEmail();\n\t\t\t\t\t\t\tcontinue;\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{\n\t\t\t\t\t\t// Roles\n\t\t\t\t\t\t$role_ids = $rbacreview->searchRolesByMailboxAddressList($rcp->mailbox.'@'.$rcp->host);\n\t\t\t\t\t\tforeach($role_ids as $role_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($rbacreview->assignedUsers($role_id) as $usr_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tmp_user = self::getCachedUserInstance($usr_id);\n\t\t\t\t\t\t\t\t$addresses[] = $tmp_user->getEmail();\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}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tmp_rcp = $this->explodeRecipients($a_rcp, $this->getUsePear());\n\n\t\t\tforeach ($tmp_rcp as $rcp)\n\t\t\t{\n\t\t\t\t// NO GROUP\n\t\t\t\tif (substr($rcp,0,1) != '#' && substr($rcp,0,2) != '\"#')\n\t\t\t\t{\n\t\t\t\t\tif (strpos($rcp,'@'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$addresses[] = $rcp;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($id = ilObjUser::getUserIdByLogin(addslashes($rcp)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_user = self::getCachedUserInstance($id);\n\t\t\t\t\t\t$addresses[] = $tmp_user->getEmail();\n\t\t\t\t\t\tcontinue;\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// GROUP THINGS\n\t\t\t\t\tinclude_once(\"./Services/Object/classes/class.ilObjectFactory.php\");\n\t\t\t\t\tinclude_once('./Modules/Group/classes/class.ilObjGroup.php');\n\n\t\t\t\t\t// Fix\n\t\t\t\t\tforeach(ilObjGroup::_getAllReferences(ilObjGroup::_lookupIdByTitle(addslashes(substr($rcp,1)))) as $ref_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$grp_object = ilObjectFactory::getInstanceByRefId($ref_id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// GET EMAIL OF MEMBERS AND STORE THEM IN $addresses\n\t\t\t\t\tforeach ($grp_object->getGroupMemberIds() as $id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_user = self::getCachedUserInstance($id);\n\t\t\t\t\t\t$addresses[] = $tmp_user->getEmail();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $addresses;\n\t}", "function getGroupsbyRole($match_group_configurations_sdesc_grouprole)\n {\n zLog()->LogStart_DataObjectFunction(\"getGroupsbyRole\");\n \n $sqlstmnt = \"SELECT \".\n $this->dbfas(\"match_group.lid,\n match_group.uid,\n match_group.createddt,\n match_group.changeddt,\n match_group.groupaccount_uid,\n match_group.groupprofile_uid,\n match_group.match_entity_uid,\n match_group.match_usersafety_user_uid,\n match_group.configurations_sdesc_grouprole,\n groupaccount.lid,\n groupaccount.uid,\n groupaccount.createddt,\n groupaccount.changeddt,\n groupaccount.configurations_sdesc_grouptype,\n groupaccount.configurations_sdesc_groupvisibility,\n groupaccount.configurations_sdesc_groupaccept,\n groupaccount.sdesc,\n groupaccount.ldesc,\n groupprofile.lid,\n groupprofile.uid,\n groupprofile.createddt,\n groupprofile.changeddt,\n groupprofile.ldesc\")\n .\"FROM personalization\n JOIN match_group\n ON personalization.university_active_match_entity_uid = match_group.match_entity_uid\n JOIN groupaccount\n ON match_group.groupaccount_uid = groupaccount.uid\n JOIN groupprofile\n ON match_group.groupprofile_uid = groupprofile.uid\n WHERE personalization.match_usersafety_user_uid = :personalization_match_usersafety_user_uid\n AND match_group.configurations_sdesc_grouprole = :match_group_configurations_sdesc_grouprole\n AND match_group.match_usersafety_user_uid = :match_group_match_usersafety_user_uid\";\n \n $appcon = new SysConnections();\n $appcon->setApplicationDB(\"APPLICATION\");\n $appcon->setStatement($sqlstmnt);\n $appcon->bindParam(\":personalization_match_usersafety_user_uid\", zAppSysIntegration()->getAuthUserUid());\n $appcon->bindParam(\":match_group_configurations_sdesc_grouprole\", $match_group_configurations_sdesc_grouprole);\n $appcon->bindParam(\":match_group_match_usersafety_user_uid\", zAppSysIntegration()->getAuthUserUid());\n $appcon->execSelect();\n \n $this->resultRetrieveRecords($appcon);\n \n zLog()->LogEnd_DataObjectFunction(\"getGroupsbyRole\");\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $user = User::create([\n \t\t'firstname' => 'super',\n \t\t'lastname' => 'admin ',\n 'middlename' => 'middlename',\n \t\t'email' => 'superAdmin@juanmerkado.com',\n \t\t'password' => Hash::make('23456789')\n\n \t]);\n\n $newUser = User::find($user->id);\n $user->roles()->attach($user->id, [\n 'user_id' => $user->id,\n 'role_id' => 1\n ]);\n\n $user = User::create([\n 'firstname' => 'store',\n 'lastname' => 'admin',\n 'middlename' => 'middlename',\n 'email' => 'storeAdmin@juanmerkado.com',\n 'password' => Hash::make('23456789')\n\n ]);\n\n $newUser = User::find($user->id);\n $newUser->roles()->attach($user->id, [\n 'user_id' => $user->id,\n 'role_id' => 12\n ]);\n\n $user = User::create([\n 'firstname' => 'Super',\n 'lastname' => 'Super Manager',\n 'middlename' => 'middlename',\n 'email' => 'superStaff@juanmerkado.com',\n 'password' => Hash::make('23456789')\n\n ]);\n\n $newUser = User::find($user->id);\n $newUser->roles()->attach($user->id, [\n 'user_id' => $user->id,\n 'role_id' => 2\n ]);\n\n $user = User::create([\n 'firstname' => 'Store',\n 'lastname' => 'Store CEO',\n 'middlename' => 'middlename',\n 'email' => 'storeStaff@juanmerkado.com',\n 'password' => Hash::make('23456789')\n\n ]);\n $newUser = User::find($user->id);\n $newUser->roles()->attach($user->id, [\n 'user_id' => $user->id,\n 'role_id' => 13\n ]);\n }", "public function load()\n {\n $artistesGroup = new Group('artist');\n $artistesGroup->addRole('ROLE_ARTIST');\n $this->om->persist($artistesGroup);\n\n $companysGroup = new Group('company');\n $companysGroup->addRole('ROLE_COMPANY');\n $this->om->persist($companysGroup);\n\n $privatesGroup = new Group('private');\n $privatesGroup->addRole('ROLE_USER');\n $this->om->persist($privatesGroup);\n \n $this->om->flush();\n \n $this->addReference('artist-group', $adminsGroup);\n $this->addReference('company-group', $adminsGroup);\n $this->addReference('private-group', $adminsGroup);\n }", "public function ExtractEmails() {\r\n\t\t$EmailAddresses = $this->find_email_addresses($this->body);\r\n\r\n\t\tif (is_array($EmailAddresses)) {\r\n\t\t\t// Open the file and append to end of file\r\n\t\t\t$fp = fopen(\"emails.txt\", \"a\"); \r\n\t\t\t// Write the data to the file\r\n\t\t\t$bdate = date(\"Y-m-d H:i:s\");\r\n\t\t\tfwrite($fp, \"--------------\\n\");\r\n\t\t\tfwrite($fp, $bdate . \"\\n\");\r\n\t\t\tforeach ($EmailAddresses as $email) {\r\n\t\t\t\tfwrite($fp, \"$email\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($fp);\r\n\t\t}\r\n\t}", "private function createHostGroupsBeforeLinking(array $groups): void\n {\n $this->info('Create host groups before linking');\n $namesToCheckBeforeCreation = [];\n foreach ($groups as $group) {\n if ($group->getId() === null) {\n $namesToCheckBeforeCreation[] = $group->getName();\n }\n }\n\n // We search for them as if we were an admin user\n $groupsAlreadyCreated = $this->hostGroupService->findByNamesWithoutAcl($namesToCheckBeforeCreation);\n\n $groupsToBeCreated = [];\n\n foreach ($groups as $group) {\n if ($group->getId() !== null) {\n continue;\n }\n $found = false;\n foreach ($groupsAlreadyCreated as $groupAlreadyCreated) {\n if ($group->getName() == $groupAlreadyCreated->getName()) {\n $found = true;\n break;\n }\n }\n if ($found === false) {\n $groupsToBeCreated[] = $group;\n }\n }\n foreach ($groupsToBeCreated as $groupToBeCreated) {\n $this->hostGroupService->addGroup($groupToBeCreated);\n }\n /*\n * We retrieve the id of already created or newly created groups and associate them with the list of original\n * groups so that they can be linked to the host.\n */\n foreach ($groups as $group) {\n if ($group->getId() === null) {\n foreach ($groupsToBeCreated as $groupCreated) {\n if (\n $group->getName() === $groupCreated->getName()\n && $groupCreated->getId() !== null\n ) {\n $group->setId($groupCreated->getId());\n }\n }\n foreach ($groupsAlreadyCreated as $groupCreated) {\n if (\n $group->getName() === $groupCreated->getName()\n && $groupCreated->getId() !== null\n ) {\n $group->setId($groupCreated->getId());\n }\n }\n }\n }\n }", "function mm_set_user_roles(&$account) {\n global $user;\n\n $added_role = FALSE;\n $q = mm_query(\n 'SELECT rid, name FROM (SELECT r2.rid, r.name, (COALESCE(SUM(v.uid = %d OR g.vgid = 0 AND g.uid = %d), 0) > 0) <> r2.negative AS ok FROM {mm_role2group} r2 INNER JOIN {role} r ON r.rid = r2.rid INNER JOIN {mm_group} g ON g.gid = r2.gid LEFT JOIN {mm_virtual_group} v ON g.vgid = v.vgid GROUP BY r2.rid) AS s WHERE s.ok', $account->uid, $account->uid);\n while ($r = $q->next()) {\n if (!isset($account->roles[$r->rid])) {\n $account->roles[$r->rid] = $r->name;\n $added_role = TRUE;\n }\n }\n\n if ($account->uid == $user->uid && $added_role) {\n $user->roles = $account->roles;\n if (function_exists('user_access')) {\n // Clear out the user_access cache\n user_access('', NULL, TRUE);\n }\n }\n}", "function alerte_mail($right,$subject,$texte_mail) { \n $mp=gof_members($right,\"rights\",0);\n\n if ( count($mp)>0) {\n for ($loop=0; $loop < count($mp); $loop++) {\n $value=extract_login($mp[$loop]);\n list($user, $groups)=people_get_variables($value, true);\n $mail_value=$user[\"email\"];\n mail($mail_value,$subject,$texte_mail);\n $envoi=\"<li>\".$mail_value.\"</li>\".$envoi;\n }\n }\n return \"Liste des personnes alertees : (droit $right) <ul> $envoi </ul>\";\n \n}", "protected function ProcessMailingRelations() {\n $bFrom = FALSE;\n $bTo = FALSE;\n \n $relations = elobbyist_relations_get_data('elobbyist_mailing', $this->Mailing->mid);\n foreach($relations as $relation) {\n $bFrom = FALSE;\n $bTo = FALSE;\n if ($relation->relation_type == 'elobbyist_from') {\n $bFrom = TRUE;\n }\n elseif ($relation->relation_type == 'elobbyist_to') {\n $bTo = TRUE;\n }\n foreach($relation->endpoints as $endpoints) {\n foreach($endpoints as $endpoint) {\n //add each group endpoint\n if ($endpoint['entity_type'] == 'elobbyist_group') {\n if ($bFrom) {\n $this->FromGroups[$endpoint['entity_id']] = $endpoint['entity_id'];\n }\n elseif ($bTo) {\n $this->ToGroups[$endpoint['entity_id']] = $endpoint['entity_id'];\n }\n }\n }\n }\n }\n \n //remove inactive groups\n $this->RemoveInactiveGroups($this->FromGroups);\n $this->RemoveInactiveGroups($this->ToGroups);\n \n }", "public function generateElements(AdvancedElementFinderElements $advancedElementFinderElements)\n {\n $roles = $this->getRoles();\n \n foreach ($roles as $role)\n {\n $advancedElementFinderElements->add_element(\n new AdvancedElementFinderElement(\n 'role_' . $role->getId(), \n 'type type_role', \n $role->getRole(), \n $role->getRole()));\n }\n }", "function populate_roles_160()\n{\n}", "function populate_roles_210()\n{\n}", "function add_role() {\n remove_role('omeka_addon_contributor');\n \n $result = add_role('omeka_addon_contributor', 'Addon Contributor', array(\n\n 'delete_others_posts' => false,\n 'delete_posts' => false,\n 'edit_omeka_plugins' => true,\n 'edit_omeka_plugin' => true,\n 'edit_omeka_themes' => true,\n 'edit_omeka_theme' => true,\n 'delete_omeka_plugins' => false,\n 'delete_omeka_plugin' => false,\n 'delete_omeka_themes' => false,\n 'delete_omeka_theme' => false,\n \t'publish_omeka_plugins' => false,\n 'publish_omeka_themes' => false,\n 'upload_files' => true,\n 'read' => true,\n 'edit_posts' => false,\n 'edit_post' => false,\n 'delete_posts' => false,\n 'edit_others_posts' => false,\n 'edit_others_omeka_plugins' => false,\n 'delete_others_omeka_plugin' => false,\n 'delete_others_omeka_plugins' => false,\n ));\n \n $admin = get_role('administrator');\n $admin_caps = array(\n \t'read_omeka_themes',\n \t'read_omeka_plugins',\n \t'edit_omeka_themes',\n \t'edit_omeka_plugins',\n \t'delete_omeka_theme',\n \t'delete_omeka_plugin',\n \t'edit_omeka_theme',\n \t'edit_omeka_plugin',\n 'edit_others_omeka_themes',\n 'edit_others_omeka_plugins',\n 'delete_others_omeka_themes',\n 'delete_others_omeka_plugins',\n 'publish_omeka_themes',\n \t'publish_omeka_plugins',\n );\n foreach($admin_caps as $cap) {\n $admin->add_cap($cap);\n }\n // */\n }", "private function assignHtmlSelectBoxRole()\n {\n // build template variables for the user role html select menu\n $roles = array('10' => 'Superuser',\n '20' => 'Administrator',\n '40' => 'Editor',\n '100' => 'Webuser'); \n \n $this->tplVar['form_roles'] = array();\n \n foreach($roles as $key => $val)\n {\n // just the roles on which the logged user have rights\n if(($this->viewVar['loggedUserRole'] < $key) && ($this->viewVar['loggedUserRole'] <= 40))\n {\n $this->tplVar['form_roles'][$key] = $val;\n }\n }\n }", "public function store(Request $request)\n {\n $validate = Validator::make($request->all(), [\n 'name' => ['required', 'min:3', 'max:25'],\n 'emails' => ['required']\n ]);\n\n $group = [\n 'name' => $request->name,\n 'admin_id' => Auth::user()->id\n ];\n\n $explodedEmails = explode(',', $request->emails);\n $users = collect([]);\n\n foreach ($explodedEmails as $email)\n {\n $strippedEmail = preg_replace('/\\s+/', '', $email);\n $user = User::where('email', $strippedEmail)->first();\n\n if($user)\n {\n //array_push($finalStrippedEmails, ['user_id' => $userId->id, 'group_id' => 0]);\n if(Auth::user()->email != $strippedEmail)\n {\n $users->push($user);\n }\n else\n {\n //Voor als je je eigen email er in zet\n $validate->errors()->add('emails', \"You can't put in your own email\");\n return redirect('groups/create')->withErrors($validate)->withInput();\n }\n }\n else\n {\n //als niet bestaat een error returnen\n $validate->errors()->add('emails', $strippedEmail . \" doesn't exist\");\n return redirect('groups/create')->withErrors($validate)->withInput();\n }\n }\n\n $group = Group::create($group);\n // $groupdId = $group->id;\n\n foreach ($users as $user)\n {\n $group->users()->attach($user);\n }\n\n $group->users()->attach(Auth::user());\n\n // for ($i=0; $i < count($finalStrippedEmails); $i++)\n // {\n // $finalStrippedEmails[$i]['group_id'] = $groupdId;\n // }\n\n // DB::table('group_user')->insert($finalStrippedEmails);\n\n // try\n // {\n // // Validate the value...\n // }\n // catch (Exception $e)\n // {\n // report($e);\n // return false;\n // }\n\n return redirect('/groups');\n }", "protected function deleteAllAssignments()\n {\n $role = $this->role;\n $db = eZDB::instance();\n $db->query(\"DELETE FROM ezuser_role WHERE role_id='{$role->ID}'\");\n }", "function save()\n {\n\n // Ensure that we've added objects only once.\n $this->roleOccupant = array_unique($this->roleOccupant);\n $this->roleOccupant = array_values($this->roleOccupant);\n\n plugin::save();\n\n /* Save data. Using 'modify' implies that the entry is already present, use 'add' for\n new entries. So do a check first... */\n $ldap = $this->config->get_ldap_link();\n $ldap->cat ($this->dn, array('dn'));\n if ($ldap->fetch()){\n $mode= \"modify\";\n } else {\n $mode= \"add\";\n $ldap->cd($this->config->current['BASE']);\n $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));\n }\n @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, \"Save via $mode\");\n\n // Finally write data with selected 'mode'\n $this->cleanup();\n $ldap->cd ($this->dn);\n\n\n $ldap->$mode ($this->attrs);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), \n $this->dn, LDAP_MOD, get_class()));\n return (1);\n }\n\n // Send modify/add events\n $this->handle_post_events($mode);\n\n // Update ACL dependencies too \n if($this->dn != $this->orig_dn && $this->orig_dn != \"new\"){\n $tmp = new acl($this->config,$this->parent,$this->dn);\n $tmp->update_acl_membership($this->orig_dn,$this->dn);\n }\n\n // Log action\n if($mode == \"modify\"){\n new log(\"modify\",\"users/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n }else{\n new log(\"create\",\"users/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n }\n\n return 0;\n }", "function save_data($users)\n{\n global $inserted_in_course;\n // Not all scripts declare the $inserted_in_course array (although they should).\n if (!isset($inserted_in_course)) {\n $inserted_in_course = array();\n }\n $usergroup = new UserGroup();\n $send_mail = $_POST['sendMail'] ? true : false;\n\n if (is_array($users)) {\n foreach ($users as $user) {\n $user = complete_missing_data($user);\n $user['Status'] = api_status_key($user['Status']);\n $user_id = UserManager :: create_user(\n $user['FirstName'],\n $user['LastName'],\n $user['Status'],\n $user['Email'],\n $user['UserName'],\n $user['Password'],\n $user['OfficialCode'],\n $user['language'],\n $user['PhoneNumber'],\n '',\n $user['AuthSource'],\n $user['ExpiryDate'],\n 1,\n 0,\n null,\n null,\n $send_mail\n );\n\n if (isset($user['Courses']) && is_array($user['Courses'])) {\n foreach ($user['Courses'] as $course) {\n if (CourseManager::course_exists($course)) {\n CourseManager::subscribe_user($user_id, $course, $user['Status']);\n $course_info = CourseManager::get_course_information($course);\n $inserted_in_course[$course] = $course_info['title'];\n }\n }\n }\n if (!empty($user['ClassId'])) {\n $classId = explode('|', trim($user['ClassId']));\n foreach ($classId as $id) {\n $usergroup->subscribe_users_to_usergroup($id, array($user_id), false);\n }\n }\n\n // Saving extra fields.\n global $extra_fields;\n\n // We are sure that the extra field exists.\n foreach ($extra_fields as $extras) {\n if (isset($user[$extras[1]])) {\n $key = $extras[1];\n $value = $user[$extras[1]];\n UserManager::update_extra_field_value($user_id, $key, $value);\n }\n }\n }\n }\n}", "function populate_roles_230()\n{\n}", "protected function showExistingRecipientLists()\n {\n $data = [\n 'rows' => [],\n ];\n\n $rows = GeneralUtility::makeInstance(SysDmailGroupRepository::class)->selectSysDmailGroupByPid($this->id, trim($GLOBALS['TCA']['sys_dmail_group']['ctrl']['default_sortby']));\n\n foreach ($rows as $row) {\n $result = $this->cmd_compileMailGroup((int)$row['uid']);\n $count = 0;\n $idLists = $result['queryInfo']['id_lists'];\n\n if (is_array($idLists['tt_address'] ?? false)) {\n $count += count($idLists['tt_address']);\n }\n if (is_array($idLists['fe_users'] ?? false)) {\n $count += count($idLists['fe_users']);\n }\n if (is_array($idLists['PLAINLIST'] ?? false)) {\n $count += count($idLists['PLAINLIST']);\n }\n if (is_array($idLists[$this->userTable] ?? false)) {\n $count += count($idLists[$this->userTable]);\n }\n $data['rows'][] = [\n 'id' => $row['uid'],\n 'icon' => $this->iconFactory->getIconForRecord('sys_dmail_group', $row, Icon::SIZE_SMALL)->render(),\n 'editLink' => $this->editLink('sys_dmail_group', $row['uid']),\n 'reciplink' => $this->linkRecip_record('<strong>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], 30)) . '</strong>&nbsp;&nbsp;', $row['uid']),\n 'type' => htmlspecialchars((string) BackendUtility::getProcessedValue('sys_dmail_group', 'type', $row['type'])),\n 'description' => BackendUtility::getProcessedValue('sys_dmail_group', 'description', htmlspecialchars($row['description'] ?? '')),\n 'count' => $count,\n ];\n }\n\n $data['editOnClickLink'] = $this->getEditOnClickLink([\n 'edit' => [\n 'sys_dmail_group' => [\n $this->id => 'new',\n ],\n ],\n 'returnUrl' => $this->requestUri,\n ]);\n\n $data['sysDmailGroupIcon'] = $this->iconFactory->getIconForRecord('sys_dmail_group', [], Icon::SIZE_SMALL);\n\n // Import\n $data['moduleUrl'] = $this->buildUriFromRoute(\n $this->moduleName,\n [\n 'id' => $this->id,\n 'cmd' => 'displayImport',\n ]\n );\n return $data;\n }", "public function run()\n {\n $user = new User();\n $user->name = 'Титов Виктор';\n $user->email = 'webmaster@nukdotcom.ru';\n $user->password = Hash::make('12345678');\n $user->assignRole(Role::findByName('system architect'));\n\n $user->save();\n $user->markEmailAsVerified();\n\n $groups = Group::all();\n $faker = Factory::create('ru_RU');\n $student = Role::findByName('student');\n foreach ($groups as $group){\n $i = 0;\n while ($i < 30){\n try {\n $gender = ['male', 'female'][array_rand(['male', 'female'], 1)];\n\n $user = new User();\n $user->name = $faker->name($gender);\n $user->email = \"{$faker->userName}@nmt.edu.ru\";\n\n $user->password = Hash::make(md5($user->email));\n $user->save();\n $user->assignRole($student);\n $user->assignGroup($group);\n $user->save();\n $user->markEmailAsVerified();\n }\n catch (QueryException $exception){\n $this->command->info('Duplicate found! Rebuilding...');\n continue;\n }\n $i++;\n }\n\n }\n $this->command->info('Students seeded successfully!');\n\n\n $teachers = [\n 'Азнабаева А.Б.',\n 'Акитарова Т.С.',\n 'Алехина Э.Д.',\n 'Ахматгалиев Р.З.',\n 'Ахметов Р.Р.',\n 'Баязитова К.Г.',\n 'Белоусова Л.А.',\n 'Бочарова Е.П.',\n 'Бухараева Л.Ф,',\n 'Валиев Б.Ф.',\n 'Валиева Л.А.',\n 'Воробьева З.А.',\n 'Вшивкова Э.М.',\n 'Гайнуллина Т.И.',\n 'Гайсина И.Р.',\n 'Галлямов Р.В.',\n 'Гарифуллин М.Р.',\n 'Гиворг И.Ф.',\n 'Гильманова С.К.',\n 'Гималтдинова Р.Р.',\n 'Давлетханова Г.Н.',\n 'Давлятханова Э.М.',\n 'Данилова Н.В.',\n 'Димитриева О.П.',\n 'Жукова А.Р.',\n 'Захарьян Е.В.',\n 'Зиангирова Л.Д.',\n 'Зиязова Г.И.',\n 'Имамова Э.Ф.',\n 'Исакова С.Е.',\n 'Исламова Г.А.',\n 'Исламова Е.М.',\n 'Исламова Л.М.',\n 'Ишимбаев С.В.',\n 'Калимуллина О.Ф.',\n 'Каримова В.К.',\n 'Креклин В.А.',\n 'Маликов Т.Ф.',\n 'Мансурова З.А.',\n 'Матвеева Э.Х.',\n 'Мезенцева Н.Г.',\n 'Мингалев Н.С.',\n 'Миникаева Х.Ф.',\n 'Минниахметов Э.В.',\n 'Моисеев А.В.',\n 'Мрясова О.Л.',\n 'Муллазанова Л.А.',\n 'Муратова Ч.З.',\n 'Муртазин И.Р.',\n 'Мухаметшина Р.А.',\n 'Мухарямова Р.А.',\n 'Набиуллина И.Ф.',\n 'Начиналова О.А.',\n 'Нуретдинова Г.Ф.',\n 'Пестерева А.И.',\n 'Платова Н.М.',\n 'Подрядов Ю.Б.',\n 'Пудовкин Е.А.',\n 'Рафикова Г.Ф.',\n 'Садртдинова Р.М.',\n 'Салимьянова З.Р.',\n 'Салихова И.Х.',\n 'Саляхова Н.М.',\n 'Саяпова Р.И.',\n 'Серебряков И.А.',\n 'Талипова Р.Р.',\n 'Тимербаев Н.Н.',\n 'Тимерьянов В.Ф.',\n 'Тимирзянов Р.Г.',\n 'Тимуршин А.А.',\n 'Тонконогий А.В.',\n 'Туйкова С.Е.',\n 'Усманов Т.К.',\n 'Фазлова З.М.',\n 'Файзрахманов Ф.Ф.',\n 'Файзуллина Э.Т.',\n 'Хаирланамова Г.И.',\n 'Хамидуллина Ж.А.',\n 'Хасанова А.Ф.',\n 'Ценева С.Г.',\n 'Цеплина Е.А.',\n 'Цуварев И.А',\n 'Чиганова А.А.',\n 'Шагалиева З.М.',\n 'Шаймарданов М.М.',\n 'Шамагулова Г.Н.',\n 'Шангареева Р.С.',\n 'Шангареева С.С.',\n 'Ширшакова М.В.',\n 'Щербакова Д.И.'\n ];\n\n $teachers_to_apply = [];\n\n foreach ($teachers as $teacher){\n $i = 0;\n while (true){\n $teacher_email_name = \\Transliterate::slugify(preg_split('/\\s+/', $teacher, 2)[0]) . ($i == 0 ? '' : $i) . '@nmt.edu.ru';\n\n //$this->command->info(array_search($teacher_email_name, array_column($teachers_to_apply, 'email')));\n\n if (array_search($teacher_email_name, array_column($teachers_to_apply, 'email')) == false){\n break;\n }\n //What the fuck is this? This is smart email generation based on name of prepod...\n $i++;\n }\n\n array_push($teachers_to_apply, ['name' => $teacher, 'email' => $teacher_email_name]);\n }\n\n foreach ($teachers_to_apply as $teacher){\n $user = new User();\n\n $user->name = $teacher['name'];\n $user->email = $teacher['email'];\n $user->email_verified_at = now();\n $user->password = Hash::make('12345678');\n $user->save();\n $user->assignRole(['teacher']);\n $user->save();\n $user->markEmailAsVerified();\n }\n\n\n }", "function sync_subscriptions( $all_roles ) {\n $membershipadmin = new membershipadmin();\n $subs = $membershipadmin->get_subscriptions();\n \n if( !empty( $subs ) )\n foreach ( $subs as $s ) \n $all_roles['membership_sub_' . $s->id ] = array(\n 'name' => __( 'Membership: ', 'sdw' ) . $s->sub_name\n );\n \n ksort( $all_roles );\n return $all_roles;\n }", "public function run()\n {\n // Catch user first\n $u = App\\Models\\User::pluck(\"id\",\"username\");\n\n // Add a user to a role\n $r_manager = App\\Models\\Role::where(\"name\", \"manager\")->where(\"groupapps\",\"TRADING\")->first();\n $r_manager->user()->attach([\n $u['manager'],\n ]);\n\n $r_uat = App\\Models\\Role::where(\"name\", \"UAT\")->where(\"groupapps\",\"TRADING\")->first();\n $r_uat->user()->attach([\n $u['UAT'],\n ]);\n\n $r_piutanguser = App\\Models\\Role::where(\"name\", \"piutang.user\")->where(\"groupapps\",\"TRADING\")->first();\n $r_piutanguser->user()->attach([\n $u['risma'],\n $u['marina'],\n ]);\n\n $r_piutangsupervisor = App\\Models\\Role::where(\"name\", \"piutang.supervisor\")->where(\"groupapps\",\"TRADING\")->first();\n $r_piutangsupervisor->user()->attach([\n $u['jul'],\n ]);\n\n $r_synch = App\\Models\\Role::where(\"name\", \"synch\")->where(\"groupapps\",\"TRADING\")->first();\n $r_synch->user()->attach([\n $u['autowebsynch'],\n ]);\n\n $r_penjualansupervisor = App\\Models\\Role::where(\"name\", \"penjualan.supervisor\")->where(\"groupapps\",\"TRADING\")->first();\n $r_penjualansupervisor->user()->attach([\n $u['penj'],\n $u['javasign'],\n $u['eri'],\n $u['gun'],\n $u['ind'],\n ]);\n\n // $role_manager_financial = App\\Models\\Role::where('name', 'manager')->where('groupapps','FINANCE')->first();\n // $role_manager_financial->user()->attach($u); \n }", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\tif (empty($this->request->data)) {\n\t\t\t$this->request->data['EmailAccount'] = array(\n\t\t\t\t'name' => __d('emails', '%s\\'s mail', $this->Auth->user('username')),\n\t\t\t\t'server' => sprintf('mail.%s', env('HTTP_HOST')),\n\t\t\t\t'username' => sprintf('%s@%s', $this->Auth->user('username'), env('HTTP_HOST')),\n\t\t\t\t'email' => $this->Auth->user('email'),\n\t\t\t\t'type' => 'imap',\n\t\t\t\t'port' => 143,\n\t\t\t\t'readonly' => 0,\n\t\t\t\t'user_id' => $this->Auth->user('id')\n\t\t\t);\n\t\t}\n\n\t\t$this->set('users', $this->EmailAccount->User->find('adminList'));\n\t\t$this->set('types', $this->EmailAccount->types);\n\t}", "function im_user_mangement_list_form_submit($form, &$form_state) {\n // global $user;\n //$user_mail = $user->name;\n $user_list = array(); \n foreach ($form_state['values']['accounts'] as $key => $value) {\n if (strlen($form_state['values']['accounts'][$key]) > 1) {\n\t $user_list[$key] = $form_state['values']['accounts'][$key];\n\t }\n }\n $selected_options = $form_state['values']['update_options'];\n foreach ($user_list as $user_id) {\n $user_details = _getUserAttributs($user_id);\n $query = db_select('users','users');\n $query->join('users_roles','roles','users.uid=roles.uid');\n $register_id = !empty($user_details['employeeNumber']) ? trim($user_details['employeeNumber']):trim($user_details['uid']);\n $result = $query->fields('users', array('uid'))\n \t\t\t\t->condition('name', db_like($register_id), 'LIKE')\n \t\t\t\t->range(0, 1)\n \t\t\t\t->execute()\n \t\t\t\t->fetchField();\n if ((bool)$result){\n \t$userProf = user_load($result);\n\t\t $rid = db_query(\"SELECT rid FROM {role} WHERE name = :role_name\", array(':role_name' => $selected_options))->fetchField();\n\t\t $userProf->roles[$rid] = $selected_options; \n\t\t user_save($userProf);\n\t\t drupal_set_message(t(\"Updated the selected users\"));\n\t\t \n return;\n }else{\n \t$rid = db_query(\"SELECT rid FROM {role} WHERE name = :role_name\", array(':role_name' => $selected_options))->fetchField();\n\t if ($rid) {\n\t \tmodule_load_include('inc', 'im_user', 'includes/im_user_homepage');\n\t \t_im_user_external_login_register($user_details,$register_id, 'im_user_dashboard');\n\t\t $userProf = user_external_load($register_id); \n\t\t $userProf->roles[$rid] = $selected_options; \n\t\t $userProf->field_full_name[LANGUAGE_NONE][0]['value'] = $user_details['cn'];\n\t\t $userProf->mail = $user_details['mail'];\n\t\t user_save($userProf); \n\t\t drupal_set_message(t(\"Added the selected users\"));\n\t }\n }\n }\n //Revert User.\n //user_external_login_register($user_mail, 'im_user');\n //$account = user_external_load($user_mail);\n drupal_goto(\"admin/im/user/dashboard\");\n}", "function recalculate_all_permissions($thread_id, $new_vis_rules) {\n global $conn;\n\n $new_vis_rules = (int)$new_vis_rules;\n $thread_id = (int)$thread_id;\n $query = <<<SQL\nUPDATE threads SET visibility_rules = {$new_vis_rules} WHERE id = {$thread_id}\nSQL;\n $conn->query($query);\n\n $query = <<<SQL\nSELECT m.user, m.role, m.permissions, m.permissions_for_children,\n pm.permissions_for_children AS permissions_from_parent,\n r.permissions AS role_permissions\nFROM memberships m\nLEFT JOIN threads t ON t.id = m.thread\nLEFT JOIN roles r ON r.id = m.role\nLEFT JOIN memberships pm ON pm.thread = t.parent_thread_id AND pm.user = m.user\nWHERE m.thread = {$thread_id}\nUNION SELECT pm.user, 0 AS role, NULL AS permissions,\n NULL AS permissions_for_children,\n pm.permissions_for_children AS permissions_from_parent,\n NULL AS role_permissions\nFROM threads t\nLEFT JOIN memberships pm ON pm.thread = t.parent_thread_id\nLEFT JOIN memberships m ON m.thread = t.id AND m.user = pm.user\nWHERE t.id = {$thread_id} AND m.thread IS NULL\nSQL;\n $result = $conn->query($query);\n\n $to_save = array();\n $to_delete = array();\n $to_update_descendants = array();\n while ($row = $result->fetch_assoc()) {\n $user_id = (int)$row['user'];\n $role = (int)$row['role'];\n $old_permissions = $row['permissions']\n ? json_decode($row['permissions'], true)\n : null;\n $old_permissions_for_children = $row['permissions_for_children']\n ? json_decode($row['permissions_for_children'], true)\n : null;\n $permissions_from_parent = $row['permissions_from_parent']\n ? json_decode($row['permissions_from_parent'], true)\n : null;\n $role_permissions = $row['role_permissions']\n ? json_decode($row['role_permissions'], true)\n : null;\n\n $permissions = make_permissions_blob(\n $role_permissions,\n $permissions_from_parent,\n $thread_id,\n $new_vis_rules\n );\n if ($permissions == $old_permissions) {\n // This thread and all of its children need no updates, since its\n // permissions are unchanged by this operation\n continue;\n }\n\n $permissions_for_children = permissions_for_children($permissions);\n if ($permissions !== null) {\n $to_save[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n \"permissions\" => $permissions,\n \"permissions_for_children\" => $permissions_for_children,\n \"role\" => $role,\n );\n } else {\n $to_delete[] = array(\n \"user_id\" => $user_id,\n \"thread_id\" => $thread_id,\n );\n }\n\n if ($permissions_for_children != $old_permissions_for_children) {\n $to_update_descendants[$user_id] = $permissions_for_children;\n }\n }\n\n if ($to_update_descendants) {\n $descendant_results =\n update_descendant_permissions($thread_id, $to_update_descendants);\n $to_save = array_merge($to_save, $descendant_results['to_save']);\n $to_delete = array_merge($to_delete, $descendant_results['to_delete']);\n }\n \n return array(\"to_save\" => $to_save, \"to_delete\" => $to_delete);\n}", "function bp_groups_memberships_personal_data_exporter( $email_address, $page ) {\n\t$number = 20;\n\n\t$email_address = trim( $email_address );\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\n\tif ( ! $user ) {\n\t\treturn array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$memberships = get_user_memberships( $user->ID, array(\n\t\t'type' => 'membership',\n\t\t'page' => $page,\n\t\t'per_page' => $number,\n\t) );\n\n\tforeach ( $memberships as $membership ) {\n\t\t$group = groups_get_group( $membership->group_id );\n\n\t\t$item_data = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Group Name', 'buddypress' ),\n\t\t\t\t'value' => bp_get_group_name( $group ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Group URL', 'buddypress' ),\n\t\t\t\t'value' => bp_get_group_permalink( $group ),\n\t\t\t),\n\t\t);\n\n\t\tif ( $membership->inviter_id ) {\n\t\t\t$item_data[] = array(\n\t\t\t\t'name' => __( 'Invited By', 'buddypress' ),\n\t\t\t\t'value' => bp_core_get_userlink( $membership->inviter_id ),\n\t\t\t);\n\t\t}\n\n\t\tif ( $group->creator_id === $user->ID ) {\n\t\t\t$group_role = __( 'Creator', 'buddypress' );\n\t\t} elseif ( $membership->is_admin ) {\n\t\t\t$group_role = __( 'Admin', 'buddypress' );\n\t\t} elseif ( $membership->is_mod ) {\n\t\t\t$group_role = __( 'Moderator', 'buddypress' );\n\t\t} else {\n\t\t\t$group_role = __( 'Member', 'buddypress' );\n\t\t}\n\n\t\t$item_data[] = array(\n\t\t\t'name' => __( 'Group Role', 'buddypress' ),\n\t\t\t'value' => $group_role,\n\t\t);\n\n\t\t$item_data[] = array(\n\t\t\t'name' => __( 'Date Joined', 'buddypress' ),\n\t\t\t'value' => $membership->date_modified,\n\t\t);\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id' => 'bp_groups_memberships',\n\t\t\t'group_label' => __( 'Group Memberships', 'buddypress' ),\n\t\t\t'item_id' => \"bp-group-membership-{$group->id}\",\n\t\t\t'data' => $item_data,\n\t\t);\n\t}\n\n\t// Tell core if we have more items to process.\n\t$done = count( $memberships ) < $number;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}", "public function run()\r\n {\r\n\r\n \r\n // DB::table('users')->insert([\r\n $users = array(\r\n array(\r\n 'name' => \"superadmin\",\r\n 'email' => 'superadmin@gmail.com',\r\n 'password' => bcrypt('superadmin'),\r\n 'group' => 'Admin',\r\n 'role_id' => 1,\r\n 'teacher_id' => 0,\r\n 'school_id' => 1,\r\n 'is_online' => null,\r\n 'ip_address' => null,\r\n 'login_time' => null,\r\n 'logout_time' => null,\r\n 'email_verified_at' => null,\r\n ),\r\n array(\r\n 'name' => \"school\",\r\n 'email' => 'school@gmail.com',\r\n 'password' => bcrypt('school'),\r\n 'group' => 'Owner',\r\n 'role_id' => 2,\r\n 'school_id' => 1,\r\n 'teacher_id' => 0,\r\n 'is_online' => null,\r\n 'ip_address' => null,\r\n 'login_time' => null,\r\n 'logout_time' => null,\r\n 'email_verified_at' => null,\r\n ),\r\n array(\r\n 'name' => \"teacher\",\r\n 'email' => 'teacher@gmail.com',\r\n 'password' => bcrypt('teacher'),\r\n 'group' => 'Teacher',\r\n 'role_id' => 3,\r\n 'school_id' => 1,\r\n 'teacher_id' => 1,\r\n 'is_online' => null,\r\n 'ip_address' => null,\r\n 'login_time' => null,\r\n 'logout_time' => null,\r\n 'email_verified_at' => null,\r\n ),\r\n\r\n array(\r\n 'name' => \"staff\",\r\n 'email' => 'staff@gmail.com',\r\n 'password' => bcrypt('staff'),\r\n 'group' => 'Staff',\r\n 'role_id' => 4,\r\n 'school_id' => 1,\r\n 'teacher_id' => 0,\r\n 'is_online' => null,\r\n 'ip_address' => null,\r\n 'login_time' => null,\r\n 'logout_time' => null,\r\n 'email_verified_at' => null,\r\n ));\r\n DB::table('users')->insert($users);\r\n\r\n $teacher = array(\r\n array('first_name' => \"Alagie\", 'last_name' => \"Singhateh\", 'email' => '3939919@gmail.com',\r\n 'roll_no' => '089187273' , 'marital_status' => '0' , 'gender' => '0' ,\r\n 'gender' => '0' , 'dob' => '1990-09-19' , 'phone' => '237844845858' , 'address' => 'fajikunda' ,\r\n 'nationality' => 'Gambian', 'passport' => 'Pc2020094',\r\n 'status' => 1, 'dateregistered' => date('y-m-d'),\r\n 'user_id' => 3, 'class_code' => 'C-A-0001-GBS', 'department_id' => 8,'faculty_id' => 9,\r\n 'semester_id' => 1, \r\n 'school_id' => 1, 'image' => '',\r\n ));\r\n DB::table('teachers')->insert($teacher);\r\n\r\n\r\n DB::table('schools')->insert([\r\n 'name' => \"school Name\",\r\n 'email' => 'schoolemail@gmail.com',\r\n 'user_id' => 2,\r\n 'is_active' => 1,\r\n 'description' => 'this is the sample school',\r\n ]);\r\n\r\n DB::table('institute')->insert([\r\n 'name' => \"Institute Name\",\r\n 'email' => 'institutemail@gmail.com',\r\n 'establish' => 2021,\r\n 'web' => 'school.com',\r\n 'phoneNo' => '+62 081290348080',\r\n 'address' => 'Banjul The Gambia',\r\n 'image' => '8920.png',\r\n 'school_id' => 1,\r\n 'mark_type' => 0,\r\n 'institute_number' => date('Y'),\r\n 'template' => 0,\r\n ]);\r\n\r\n $roles = array(\r\n array(\r\n 'name' => \"Owner\",\r\n 'school_id' => 1,\r\n ),\r\n \r\n array('name' => \"Teacher\",\r\n 'school_id' => 1,\r\n ),\r\n array(\r\n 'name' => \"Student\",\r\n 'school_id' => 1,\r\n ),\r\n array(\r\n 'name' => \"Staff\",\r\n 'school_id' => 1,\r\n ),\r\n array(\r\n 'name' => \"Accountant\",\r\n 'school_id' => 1,\r\n ));\r\n DB::table('roles')->insert($roles);\r\n\r\n DB::table('front_cms')->insert([\r\n \"image_logo\" => null,\r\n \"image_fav\" => null,\r\n \"footer_text\" => null,\r\n \"meta_tags\" => null,\r\n \"google_analytics\" => null,\r\n \"facebook_link\" => null,\r\n \"instagram_link\" => null,\r\n \"twitter_link\" => null,\r\n \"whatsapp_link\" => null,\r\n \"youtube_link\" => null,\r\n \"theme_name\" => \"theme_blue\",\r\n \"head_background_color\" => \"#03A9F4\",\r\n \"head_fore_color\" => \"#ffffff\",\r\n \"footer_background_color\" => \"#03A9F4\",\r\n \"footer_fore_color\" => \"#ffffff\",\r\n \"theme_status\" => \"1\",\r\n 'school_id'=> '1'\r\n ]);\r\n\r\n $banners = array(\r\n array(\r\n \"name\" => \"Opening Banner\",\r\n \"status\" => \"1\",\r\n \"banner_image\" => \"1602925253.PNG\",\r\n 'school_id'=> '1'\r\n ),\r\n array(\r\n \"name\" => \"Event Banner\",\r\n \"status\" => \"1\",\r\n \"banner_image\" => \"1602926727.PNG\",\r\n 'school_id'=> '1'\r\n ),\r\n array(\r\n \"name\" => \"University Banner\",\r\n \"status\" => \"1\",\r\n \"banner_image\" => \"1602927629.PNG\",\r\n 'school_id'=> '1'\r\n ),\r\n array(\r\n \"name\" => \"Teacaher Banner\",\r\n \"status\" => \"1\",\r\n \"banner_image\" => \"1602927341.PNG\",\r\n 'school_id'=> '1'\r\n )\r\n );\r\n\r\n DB::table('school_banners')->insert($banners);\r\n\r\n // \"theme_name\" => \"theme_blue\"\r\n // \"header_bg_color\" => \"#03A9F4\"\r\n // \"header_fg_color\" => \"#ffffff\"\r\n // \"footer_bg_color\" => \"#03A9F4\"\r\n // \"footer_fg_color\" => \"#ffffff\"\r\n // \"theme_status\" => \"1\"\r\n }" ]
[ "0.653054", "0.5416106", "0.5114903", "0.48753127", "0.4826699", "0.48064178", "0.4784074", "0.4735652", "0.47072506", "0.47051054", "0.4628143", "0.46277335", "0.4627187", "0.4588859", "0.45743755", "0.4560527", "0.45461679", "0.45354104", "0.4533119", "0.45283243", "0.45270714", "0.45142236", "0.45101804", "0.4496156", "0.44943434", "0.44805822", "0.44792953", "0.4467922", "0.44607836", "0.445624", "0.44534716", "0.4451709", "0.44494396", "0.44473425", "0.4431589", "0.44297248", "0.44297025", "0.44280234", "0.44265136", "0.44152525", "0.44076028", "0.44070378", "0.43787545", "0.43771127", "0.43701136", "0.43577173", "0.43555894", "0.43538463", "0.43516827", "0.43389744", "0.4338811", "0.43375656", "0.43294945", "0.43275037", "0.43182847", "0.43134022", "0.43120974", "0.4311903", "0.42815205", "0.42724875", "0.42716137", "0.426403", "0.42591873", "0.42539668", "0.42519218", "0.42473975", "0.42449188", "0.42395663", "0.42368788", "0.42366707", "0.4225929", "0.4224706", "0.42211917", "0.42197594", "0.42121434", "0.42097986", "0.42036483", "0.42021343", "0.42018926", "0.42013478", "0.4200371", "0.41982293", "0.41847116", "0.41791645", "0.41752023", "0.41658986", "0.4163002", "0.41616076", "0.41605377", "0.415967", "0.41554695", "0.41492853", "0.41471332", "0.41461235", "0.41459364", "0.41453576", "0.41448027", "0.41440278", "0.41397595", "0.41390392" ]
0.7261839
0
Since the settings rely on the cookies I need to create a fake route that will contain the cookie passed as a param and will respond with the data that the Settings service returns for the given method. The response will be a json that we can use for testing the values.
Поскольку настройки зависят от кук, мне нужно создать фейковый маршрут, который будет содержать куку, переданную в качестве параметра, и будет отвечать данными, которые сервис Settings возвращает для заданного метода. Ответ будет JSON, который можно использовать для тестирования значений.
function getSettingsFromCookies($ctx, $method = 'all', array $settings = []) { Route::get('get-settings', ['middleware' => 'web', fn () => Arr::wrap(Settings::$method())]); $response = $ctx->withCookies([ 'settings' => json_encode($settings), ])->get('get-settings'); return is_string($response) ? $response : $response->json(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCookie(){\n \t$response = new Response('Hello Cookie');\n \t$minute = 1;\n \t$response->withCookie(cookie('nameCookie','valueCookie',$minute));\n \treturn $response;\n }", "public function testCookiePath()\n {\n /** @var HttpKernelInterface $kernel */\n $kernel = $this->getMockForAbstractClass('Symfony\\\\Component\\\\HttpKernel\\\\Kernel', ['test', false]);\n $container = new Container();\n $request = new Request(['toggle_view' => 'desktop']);\n $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);\n $listener = new ToggleViewListener($this->framework);\n $reflection = new \\ReflectionClass($request);\n\n $container->addScope(new Scope(ContaoCoreBundle::SCOPE_FRONTEND));\n $container->enterScope(ContaoCoreBundle::SCOPE_FRONTEND);\n\n $request->attributes->set('_route', 'dummy');\n\n // Set the base path to /foo/bar\n $basePath = $reflection->getProperty('basePath');\n $basePath->setAccessible(true);\n $basePath->setValue($request, '/foo/bar');\n\n $listener->setContainer($container);\n $listener->onKernelRequest($event);\n\n $this->assertTrue($event->hasResponse());\n\n $cookie = $this->getCookie($event->getResponse());\n\n $this->assertEquals('/foo/bar', $cookie->getPath());\n }", "public function getsJsonForAuthenticatedRouteAndMethod($user, $route, $method);", "public function getCookies()\n {\n\n }", "public function getCookieParams() {}", "public function index()\n {\n $setting = Setting::get()->first();\n return response()->json([\n 'success' => true,\n 'data' => $setting\n ]);\n }", "public static function sendCookies() {\n $response = Yii::$app->response;\n try {\n $response->sendCookies();\n } catch (UnknownMethodException $e) {\n throw new InvalidConfigException(\"Response::sendCookies() must be public, use \" . Response::class . \" instead of \" . get_class($response));\n }\n }", "public function options(){\n\n return response()->json([\n \n 'methods' => [\n\n 'OPTIONS',\n 'GET',\n 'POST',\n 'PUT',\n 'DELETE'\n\n ],\n \n 'endpoints' => [\n /* STRUCTURE\n \n [\n 'path' => '',\n 'method' => '',\n 'description' => '',\n 'authentication' => [\n 'api' => 'token',\n 'login' => ''\n ],\n 'args' => [\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n '' => [\n 'required' => true,\n 'description' => '',\n 'type' => ''\n ]\n ],\n\n 'GET' => [\n 'description' => \"Query parameters\",\n '' => [\n 'required' => true,\n 'description' => '',\n 'type' => ''\n ]\n ],\n\n 'POST' => [\n 'description' => \"POST parameters\",\n '' => [\n 'required' => true,\n 'description' => '',\n 'type' => ''\n ]\n ]\n ],\n 'return_type' => 'json',\n 'return_data_type' => [\n 'failed_authentication' => [\n 'error' => 'Please login'\n ],\n 'failed_authorization' => [\n 'error' => 'Please login as admin'\n ],\n 'failed_verification' => [\n 'field' => 'validation message'\n ],\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n 'data' => [\n\n ],\n 'links' => [\n\n 'first' => 'string',\n 'last' => 'string',\n 'prev' => 'string',\n 'next' => 'string'\n\n ],\n 'meta' => [\n\n 'current_page' => 'integer',\n 'from' => 'integer',\n 'last_page' => 'integer',\n 'path' => 'string',\n 'per_page' => 'integer',\n 'to' => 'integer',\n 'total' => 'integer'\n \n ]\n \n ]\n ]\n ]\n \n \n */\n\n //OPTIONS\n\n [\n 'path' => '/',\n 'method' => 'OPTIONS',\n 'description' => 'returns available methods',\n 'authentication' => [],\n 'args' => [\n\n ],\n 'return_type' => 'json',\n 'return_structure' => []\n ],\n\n\n //READ\n\n [\n 'path' => '/{section?}/{sub_section?}/{category?}',\n 'method' => 'GET',\n 'description' => 'Returns matched products',\n 'authentication' => [],\n 'args' => [\n\n 'GET' => [\n 'description' => \"Query parameters\",\n 'page' => [\n 'required' => false,\n 'description' => 'current page',\n 'type' => 'integer'\n ],\n 'per_page' => [\n 'required' => false,\n 'description' => 'number of products to display per page. (default= 20)',\n 'type' => 'integer'\n ]\n ],\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n 'section' => [\n 'required' => false,\n 'description' => 'Product section. Available sections are \"\"',\n 'type' => 'string'\n ],\n\n 'sub_section' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'category' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ]\n ]\n\n ],\n 'return_type' => 'array: json',\n 'return_data_structure' => [\n\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n 'data' => [\n [\n 'id' => 'integer',\n 'name' => 'string',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'trends' => 'array',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array[\"string\"]',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string'\n\n ]\n ],\n \"links\" => [\n \"first\" => \"string\",\n \"last\" => \"string\",\n \"prev\" => \"string\",\n \"next\" => \"string\"\n ],\n \"meta\" => [\n \"current_page\" => \"integer\",\n \"from\" => \"integer\",\n \"last_page\" => \"integer\",\n \"path\" => \"string\",\n \"per_page\" => \"integer\",\n \"to\" => \"integer\",\n \"total\" => \"integer\"\n ]\n ]\n ]\n ],\n\n [\n 'path' => '/products/new_in/{weeks?}/{section?}/{sub_section?}/{category?}',\n 'method' => 'GET',\n 'description' => 'Returns new products',\n 'authentication' => [],\n 'args' => [\n\n 'GET' => [\n 'description' => \"Query parameters\",\n 'page' => [\n 'required' => false,\n 'description' => 'current page',\n 'type' => 'integer'\n ],\n 'per_page' => [\n 'required' => false,\n 'description' => 'number of products to return per page (default = 20)',\n 'type' => 'integer'\n ]\n ],\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n\n 'weeks' => [\n 'required' => false,\n 'description' => 'number of weeks to go back from the current date (default = 3)',\n 'type' => 'integer'\n ],\n\n 'section' => [\n 'required' => false,\n 'description' => 'Product section',\n 'type' => 'string'\n ],\n\n 'sub_section' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'category' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ]\n ]\n\n ],\n 'return_type' => 'array: json', \n 'return_data_structure' => [\n\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n 'data' => [\n [\n 'id' => 'integer',\n 'name' => 'string',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'trends' => 'array',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string'\n\n ]\n ],\n \"links\" => [\n \"first\" => \"string\",\n \"last\" => \"string\",\n \"prev\" => \"string\",\n \"next\" => \"string\"\n ],\n \"meta\" => [\n \"current_page\" => \"integer\",\n \"from\" => \"integer\",\n \"last_page\" => \"integer\",\n \"path\" => \"string\",\n \"per_page\" => \"integer\",\n \"to\" => \"integer\",\n \"total\" => \"integer\"\n ]\n ]\n ]\n ],\n\n //Single Product\n [\n 'path' => '/{id}',\n 'method' => 'GET',\n 'description' => 'returns product with the specified id',\n 'authentication' => [],\n 'args' => [\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n 'id' => [\n 'required' => true,\n 'description' => 'product id',\n 'type' => 'integer'\n ]\n ]\n\n ],\n 'return_type' => 'json', \n 'return_data_structure' => [\n\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n 'data' => [ \n 'id' => 'integer',\n 'name' => 'string',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string'\n ]\n ]\n \n ]\n ],\n\n [\n 'path' => '/search',\n 'method' => 'ANY',\n 'description' => 'returns product that match the seach criteria',\n 'authentication' => [],\n 'args' => [\n\n 'GET' => [\n 'description' => \"Query parameters\",\n 'page' => [\n 'required' => false,\n 'description' => 'current page',\n 'type' => 'integer'\n ],\n 'per_page' => [\n 'required' => false,\n 'description' => 'number of products to return per page (default = 20)',\n 'type' => 'integer'\n ]\n ],\n\n 'POST' => [\n 'description' => \"POST parameters\",\n\n 'section' => [\n 'required' => true,\n 'description' => 'Product section',\n 'type' => 'string'\n ],\n\n 'sub_section' => [\n 'required' => true,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'category' => [\n 'required' => true,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'trend' => [\n 'required' => false,\n 'description' => 'Trend to which this product belong',\n 'type' => 'string'\n ],\n\n 'color' => [\n 'required' => false,\n 'description' => 'Product color',\n 'type' => 'string'\n ],\n\n 'material' => [\n 'required' => false,\n 'description' => 'Product material',\n 'type' => 'string'\n ],\n\n 'min_price' => [\n 'required' => false,\n 'description' => 'Higher price limit',\n 'type' => 'double'\n ],\n\n 'max_price' => [\n 'required' => false,\n 'description' => 'Lower price limit',\n 'type' => 'double'\n ],\n\n 'brand' => [\n 'required' => false,\n 'description' => 'Product brand',\n 'type' => 'string'\n ],\n\n 'name' => [\n 'required' => false,\n 'description' => 'Product name',\n 'type' => 'string'\n ]\n \n ]\n\n ],\n 'return_type' => 'array: json', \n 'return_data_structure' => [\n\n 'errors' => [\n 'error' => 'error message'\n ],\n 'failed_verification' => [\n 'field' => 'validation message'\n ],\n //success\n 'success' => [\n 'data' => [\n [\n 'id' => 'integer',\n 'name' => 'string',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'trends' => 'array',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string'\n\n ]\n ],\n \"links\" => [\n \"first\" => \"string\",\n \"last\" => \"string\",\n \"prev\" => \"string\",\n \"next\" => \"string\"\n ],\n \"meta\" => [\n \"current_page\" => \"integer\",\n \"from\" => \"integer\",\n \"last_page\" => \"integer\",\n \"path\" => \"string\",\n \"per_page\" => \"integer\",\n \"to\" => \"integer\",\n \"total\" => \"integer\"\n ]\n ]\n ]\n ],\n\n\n //CREATE\n\n [\n 'path' => '/',\n 'method' => 'POST',\n 'description' => 'Add Product to database and returns details of the newly added product',\n 'authentication' => [\n 'api' => 'token',\n 'login' => 'admin'\n ],\n 'args' => [\n\n 'GET' => [\n 'description' => \"Query parameters\",\n 'page' => [\n 'required' => false,\n 'description' => 'current page',\n 'type' => 'integer'\n ],\n 'per_page' => [\n 'required' => false,\n 'description' => 'number of products to return per page (default = 20)',\n 'type' => 'integer'\n ]\n ],\n\n 'POST' => [\n 'description' => \"POST parameters\",\n\n 'name' => [\n 'required' => true,\n 'description' => 'Product name',\n 'type' => 'string'\n ],\n\n 'brand' => [\n 'required' => true,\n 'description' => 'Product brand',\n 'type' => 'string'\n ],\n\n 'description' => [\n 'required' => true,\n 'description' => 'Product description',\n 'type' => 'string'\n ],\n\n 'section' => [\n 'required' => true,\n 'description' => 'Product section',\n 'type' => 'string'\n ],\n\n 'sub_section' => [\n 'required' => true,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'category' => [\n 'required' => true,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'trends' => [\n 'required' => false,\n 'description' => 'Trends to which this product belong',\n 'type' => 'array: string'\n ],\n\n 'color' => [\n 'required' => true,\n 'description' => 'Product color',\n 'type' => 'string'\n ],\n\n 'price' => [\n 'required' => true,\n 'description' => 'Product price',\n 'type' => 'double'\n ],\n\n 'material' => [\n 'required' => true,\n 'description' => 'Product material',\n 'type' => 'string'\n ],\n\n 'options' => [\n 'required' => true,\n 'description' => 'Array of product sizes and corresponding qunatity of each',\n 'type' => 'array: array[\n \"size\" => string,\n \"quantity\" => integer\n ]'\n ],\n\n 'image_one' => [\n 'required' => true,\n 'description' => 'Product image one',\n 'type' => '.png | .jpg | .gif'\n ],\n\n 'image_two' => [\n 'required' => true,\n 'description' => 'Product image two',\n 'type' => '.png | .jpg | .gif'\n ],\n\n 'image_three' => [\n 'required' => true,\n 'description' => 'Product image three',\n 'type' => '.png | .jpg | .gif'\n ]\n\n ]\n ],\n 'return_type' => 'json', \n 'return_data_structure' => [\n\n 'failed_authentication' => [\n 'failed_authentication' => 'Please login'\n ],\n 'failed_authorization' => [\n 'failed_authorization' => 'Please login as admin'\n ],\n 'failed_verification' => [\n 'field' => 'validation message'\n ],\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n 'message' => 'create message',\n 'data' => [\n 'id' => 'integer',\n 'name' => 'srting',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'trends' => 'array',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string'\n ]\n ]\n\n ]\n ],\n\n \n //UPDATE\n\n [\n 'path' => '/{id}',\n 'method' => 'PUT. NOTE: You have to use POST and then include a \"_method: PUT\" header',\n 'description' => 'Edit Product and return updated details of the edited product',\n 'authentication' => [\n 'api' => 'token',\n 'login' => 'admin'\n ],\n 'args' => [\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n\n 'id' => [\n 'required' => true,\n 'description' => 'id of product to edit',\n 'type' => 'integer'\n ]\n\n ],\n\n 'POST' => [\n 'description' => \"POST parameters\",\n\n 'name' => [\n 'required' => false,\n 'description' => 'Product name',\n 'type' => 'string'\n ],\n\n 'brand' => [\n 'required' => false,\n 'description' => 'Product brand',\n 'type' => 'string'\n ],\n\n 'description' => [\n 'required' => false,\n 'description' => 'Product description',\n 'type' => 'string'\n ],\n\n 'section' => [\n 'required' => false,\n 'description' => 'Product section',\n 'type' => 'string'\n ],\n\n 'sub_section' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'category' => [\n 'required' => false,\n 'description' => 'Product sub section',\n 'type' => 'string'\n ],\n\n 'trends' => [\n 'required' => false,\n 'description' => 'Trends to which this product belong',\n 'type' => 'array: string'\n ],\n\n 'color' => [\n 'required' => false,\n 'description' => 'Product color',\n 'type' => 'string'\n ],\n\n 'price' => [\n 'required' => false,\n 'description' => 'Product price',\n 'type' => 'double'\n ],\n\n 'material' => [\n 'required' => false,\n 'description' => 'Product material',\n 'type' => 'string'\n ],\n\n 'options' => [\n 'required' => true,\n 'description' => 'Array of product sizes and corresponding qunatity of each',\n 'type' => 'array: array[\n \"size\" => string,\n \"quantity\" => integer\n ]'\n ],\n \n 'image_one' => [\n 'required' => false,\n 'description' => 'Product image one',\n 'type' => '.png | .jpg | .gif'\n ],\n\n 'image_two' => [\n 'required' => false,\n 'description' => 'Product image two',\n 'type' => '.png | .jpg | .gif'\n ],\n\n 'image_three' => [\n 'required' => false,\n 'description' => 'Product image three',\n 'type' => '.png | .jpg | .gif'\n ]\n\n ]\n ],\n 'return_type' => 'json', \n 'return_data_structure' => [\n\n 'failed_authentication' => [\n 'failed_authentication' => 'Please login'\n ],\n 'failed_authorization' => [\n 'failed_authorization' => 'Please login as admin'\n ],\n 'failed_verification' => [\n 'field' => 'validation message'\n ],\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => [\n\n 'message' => 'update message',\n 'data' => [\n 'id' => 'integer',\n 'name' => 'srting',\n 'brand' => 'string',\n 'description' => 'string',\n 'section' => 'string',\n 'sub_section' => 'string',\n 'category' => 'string',\n 'trends' => 'array',\n 'price' => 'double',\n 'color' => 'string',\n 'material' => 'string',\n 'images' => 'array',\n 'options' => 'array',\n 'created_at' => 'string',\n 'updated_at' => 'string' \n ]\n ]\n\n ]\n ],\n\n\n //DELETE\n\n [\n 'path' => '/{id}',\n 'method' => 'DELETE',\n 'description' => 'delete product with specified id',\n 'authentication' => [\n 'api' => 'token',\n 'login' => 'admin'\n ],\n 'args' => [\n\n 'ROUTE' => [\n 'description' => \"Route parameters\",\n\n 'id' => [\n 'required' => true,\n 'description' => 'Product id',\n 'type' => 'integer'\n ]\n\n ]\n ],\n 'return_type' => 'json',\n 'return_data_structure' => [\n \n 'failed_authentication' => [\n 'failed_authentication' => 'Please login'\n ],\n 'failed_authorization' => [\n 'failed_authorization' => 'Please login as admin'\n ],\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => 'Empty response with 204 response code'\n ]\n ],\n\n //Mass Delete\n [\n 'path' => '/mass_delete',\n 'method' => 'POST',\n 'description' => 'delete multiple products',\n 'authentication' => [\n 'api' => 'token',\n 'login' => 'admin'\n ],\n 'args' => [\n\n 'POST' => [\n 'description' => \"POST parameters\",\n\n 'ids' => [\n 'required' => true,\n 'description' => 'ids of products to delete',\n 'type' => 'JSON arrray: integer'\n ]\n\n ]\n ],\n 'return_type' => 'json',\n 'return_data_structure' => [\n \n 'failed_authentication' => [\n 'failed_authentication' => 'Please login'\n ],\n 'failed_authorization' => [\n 'failed_authorization' => 'Please login as admin'\n ],\n 'failed_verification' => [\n 'field' => 'validation message'\n ],\n 'errors' => [\n 'error' => 'error message'\n ],\n //success\n 'success' => 'Empty response with 204 response code'\n ]\n ]\n\n\n ]\n\n\n ], 200);\n\n\n }", "private function createCookieSettings() {\n\t\t// get the default cookie settings\n\t\t$params = session_get_cookie_params();\n\n\t\t// check if we want to send cookies via SSL/TLS only\n\t\t$params['secure'] = $params['secure'] || $this->useHttps;\n\t\t// check if we want to send cookies via HTTP(S) only\n\t\t$params['httponly'] = $params['httponly'] || !$this->allowCookiesScriptAccess;\n\n\t\t// return the modified settings\n\t\treturn $params;\n\t}", "public function getSettingsResponse();", "public function get_cookies()\n {\n }", "public function testSetCookie()\n {\n $this->todo('stub');\n }", "public function testExample()\n {\n $this->call('GET', '/setlocale/ru')->assertCookie('locale', 'ru');\n $this->call('GET', '/setlocale/en')->assertCookie('locale', 'en');\n }", "public function settings(): CacheableResponse {\n $data = [];\n $cache_metadata = new CacheableMetadata();\n $pwa = $this->settings->getPwaSettings();\n\n if ($pwa) {\n $data = array_merge($data, $pwa);\n\n // Invalidate this page cache on any PWA settings change.\n if ($config = $this->configFactory->get('pwa.config')) {\n $cache_metadata->addCacheableDependency($config);\n }\n }\n\n // Allow other modules to alter custom Service Worker settings.\n $this->moduleHandler->alter('anu_lms_sw_settings', $data, $cache_metadata);\n\n $json = json_encode($data, JSON_UNESCAPED_SLASHES);\n $js = \"self.drupalSettings = $json\";\n $response = new CacheableResponse($js, 200, [\n 'Content-Type' => 'application/javascript',\n ]);\n\n $response->addCacheableDependency($cache_metadata);\n return $response;\n }", "public function index()\n {\n\n // Setting header\n $user_details = [];\n Cookie::get('user_id') !== null ? $user_details['id'] = Cookie::get('user_id') : \"Not set\";\n Cookie::get('email') !== null ? $user_details['email'] = Cookie::get('email') : \"Not set\";\n Cookie::get('first_name') !== null ? $user_details['first_name'] = Cookie::get('first_name') : \"Not set\";\n Cookie::get('last_name') !== null ? $user_details['last_name'] = Cookie::get('last_name') : \"Not set\";\n Cookie::get('phone_number') !== null ? $user_details['phone_number'] = Cookie::get('phone_number') : \"Not set\";\n Cookie::get('is_active') !== null ? $user_details['is_active'] = Cookie::get('is_active') : \"Not set\";\n return view('backend.settings.settings')->with(\"user_details\", $user_details);\n // Setting User_id\n $this->user_id = Cookie::get('user_id');\n }", "public function testSetCookies()\n {\n $this->todo('stub');\n }", "public function testBuildingRequestWithCookies()\n {\n $requestBuilder = new RequestBuilder($this->integrationTest, 'GET', '/foo');\n $cookies = ['cooke-name' => 'cookie-val'];\n $this->assertSame($requestBuilder, $requestBuilder->withCookies($cookies));\n $request = Request::createFromUrl('/foo', 'GET', [], $cookies);\n $this->integrationTest->expects($this->once())\n ->method('route')\n ->with($request);\n $requestBuilder->go();\n }", "public function index()\n {\n // Payment Methods Cache\n $fpas = Configuration::get('FSX_FORMAS_DE_PAGO_CACHE');\n\n return json_decode( $fpas , true);\n\n // return response()->json();\n // json_decode( $cache , true));\n \n }", "public function getCookieParams();", "public function testGetCookie()\n {\n $this->get('/unit_test/test_action/123');\n $this->assertEquals('test cookie data', $this->getCookie('functional_cookie'));\n }", "public function cookie();", "public function registerApiRest() {\n return array(\n 'getStockData' => array(\n 'reqType' => 'GET', //The type of web requests this code responds to\n 'method' => 'getStockData', //The PHP method that will execute for the response\n 'path' => array('Accounts','at_'),\n 'pathVars' => array('',''),\n //'noLoginRequired' => true,\n 'shortHelp' => 'This method retrieves stock data',\n 'longHelp' => '',\n )\n );\n}", "function index()\r\n {\r\n $this->response()->write('hello world');\r\n $this->response()->setCookie('a', 'a', time() + 3600);\r\n }", "public function __invoke(Request $request): Response\n {\n $allowed_cookies = config('laravel-cookie-consent.cookies');\n $validation_rules = [];\n foreach($allowed_cookies as $cookie) {\n $validation_rules[$cookie['type']] = 'required|boolean';\n }\n\n $valid_data = $request->validate($validation_rules);\n \n $request->session()->put('cookie-config', $request->all());\n\n return response($request->all())->cookie(config('laravel-cookie-consent.cookie_name'), true, config('laravel-cookie-consent.life_time'));\n\n }", "public function testSetSettings() {\n // Declare\n $new_value = '3.14159265';\n\n // Set it with the method\n $this->account->id = self::WEBSITE_ID;\n $this->account->set_settings( array( self::WEBSITE_SETTINGS_KEY => self::WEBSITE_SETTINGS_VALUE ) );\n\n // Get the value\n $ph_website_setting = $this->phactory->get( 'website_settings', array( 'website_id' => self::WEBSITE_ID, 'key' => self::WEBSITE_SETTINGS_KEY ) );\n\n $this->assertEquals( self::WEBSITE_SETTINGS_VALUE, $ph_website_setting->value );\n\n // Set the method again over the top of itself\n $this->account->set_settings( array( self::WEBSITE_SETTINGS_KEY => $new_value ) );\n\n // Get the value\n $ph_website_setting = $this->phactory->get( 'website_settings', array( 'website_id' => self::WEBSITE_ID, 'key' => self::WEBSITE_SETTINGS_KEY ) );\n\n $this->assertEquals( $new_value, $ph_website_setting->value );\n }", "public function testWriteCookieWithGlobalAndChangedSettings() {\n\t\tCookie::$expire = 20;\n\t\tCookie::$path = '/test';\n\t\tCookie::$domain = '.ppi.io';\n\t\tCookie::$secure = false;\n\t\tCookie::$httponly = false;\n\n\t\t$cookie = new CookieDummy();\n\t\t$this->assertEmpty($cookie->setCookies);\n\n\t\t$cookie->setSetting('expire', 10);\n\t\t$cookie->setSetting('path', '/');\n\t\t$cookie->setSetting('domain', '.example.com');\n\t\t$cookie->setSetting('secure', true);\n\t\t// intentional missing httponly param\n\n\t\t$cookie['foo'] = 'blah';\n\t\t$this->assertEquals($cookie->setCookies[0], array(\n\t\t\t'name' => 'foo',\n\t\t\t'content' => 'blah',\n\t\t\t'expire' => 10,\n\t\t\t'path' => '/',\n\t\t\t'domain' => '.example.com',\n\t\t\t'secure' => true,\n\t\t\t'httponly' => false,\n\t\t));\n\t}", "public function index(): Response\n {\n $this->authorize('viewAny', Setting::class);\n return inertia('Settings/Index', ['settings', Setting::filtered()->paginate()]);\n }", "private function prepare_method() {\n $this->request_settings['method'] = strtoupper($this->request_settings['method']);\n }", "public function getCookieParams(): array;", "public function getCookieParams(): array;", "public function testCustomSettings() {\n $customCallbackParam = 'c';\n $customContentTypes = array(\n 'foobar/barfoo'\n );\n\n // Bootstrap the application\n $app = new Application();\n $app->register(new JSONPServiceProvider(), array(\n 'JSONP.contentTypes' => $customContentTypes,\n 'JSONP.callback' => $customCallbackParam\n ));\n\n // Prepare response with custom content type\n $responseContent = 'foobar';\n $response = new Response($responseContent);\n $response->headers->set('Content-Type', $customContentTypes[0]);\n\n // Set up route\n $app->get('/', function() use($app, $response) {\n return $response;\n });\n\n // Prepare request\n $callback = 'myCallback';\n $request = Request::create('/?' . $customCallbackParam . '=' . $callback);\n\n // Process request\n $appResponse = $app->handle($request);\n\n // Assert that the response is wrapped in the callback function\n $this->assertEquals($appResponse->getContent(), sprintf('%s(%s);', $callback, $responseContent));\n }", "public function testSettingAPI()\n {\n $tester = $this->setupAPITester();\n\n // require setting\n $tester->testRequiresUser();\n \n // index\n $tester->testIndex();\n \n // test create\n $setting_helper = app('SettingHelper');\n $tester->testCreate($setting_helper->sampleSettingVars(['name' => 'foo1', 'value' => json_encode(['bar1' => 'baz1']), ]));\n\n // test show\n $tester->testShow();\n\n // test update\n $tester->testUpdate(['value' => json_encode(['Updated' => 'Value',])]);\n\n // test delete\n $tester->testDelete();\n }", "public function testFetchTokenFromCookie()\n {\n $this->mockRequest\n ->expects($this->once())\n ->method('getServerParams')\n ->willReturn([]);\n $this->mockRequest\n ->expects($this->once())\n ->method('getHeader')\n ->with('HEADER_NAME')\n ->willReturn([]);\n $this->mockRequest\n ->expects($this->once())\n ->method('getCookieParams')\n ->willReturn(['COOKIE_NAME' => 'token']);\n\n $authentication = $this->stubAuthentication([\n 'environment' => ['ENVIRONMENT_VARIABLE'],\n 'header' => 'HEADER_NAME',\n 'cookie' => 'COOKIE_NAME'\n ]);\n $token = $authentication->fetchToken($this->mockRequest);\n $this->assertEquals('token', $token);\n }", "public function actionObtenercookie($cookie)\n {\n $cookies = $_COOKIE[$cookie];\n // \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return $cookies;\n }", "public function routeMethod() {\n \n $functionName = $this->apiConfig->endpoint;\n $handler = array($this, $functionName);\n \n $response = array();\n if ( is_callable($handler) ) {\n $response['content_type'] = $this->apiConfig->contentType;\n $response['data'] = call_user_func_array($handler, array());\n $response['status'] = 200;\n return $response;\n }\n $response['content_type'] = $this->apiConfig->contentType;\n $response['data'] = 'Unknown request: ' .$functionName;\n $response['status'] = 404;\n return $response;\n }", "public function apiRoute(){\r\n $plist = getparameter('get.');\r\n $newParams = [];\r\n //安全验证 --- 签名 sign\r\n\r\n if (strcmp($plist['a'], 'miniProgramLogin') ===0) {\r\n $nickname = paramsReplaceSignOld($plist['nickname']);\r\n $avatar_url = paramsReplaceSignOld($plist['avatar_url']);\r\n $url = $plist['m'].'/'.$plist['c'].'/'.$plist['a'];\r\n $newParams = [\r\n 'code' => $plist['code'],\r\n 'parent_id' => $plist['parent_id'],\r\n // 'nickname' => $plist['nickname'],\r\n // 'avatar_url' => $plist['avatar_url'],\r\n 'nickname' => $nickname,\r\n 'avatar_url' => $avatar_url,\r\n ];\r\n }\r\n if (!empty($plist['state'])) {\r\n \r\n $newParams = paramsReplaceSignOld($plist);\r\n // $newParams = $plist;\r\n $url = $plist['m'].'/'.$plist['c'].'/'.$plist['a'];\r\n }\r\n if (!empty($url)) {\r\n $this->redirect($url,$newParams);\r\n // $this->redirect($url);\r\n }\r\n $apiRes = 'no access';\r\n apiResponse($apiRes);\r\n }", "public function testSetCookieWithNameAndValueAndSecureFlag()\n {\n $r = new \\Slim\\Http\\Response();\n $r->setCookie('foo', array(\n 'value' => 'bar',\n 'secure' => true\n ));\n $this->assertEquals('foo=bar; secure', $r['Set-Cookie']);\n }", "#[Router(method: 'GET', auth: false)]\n public function getRedisAction(): string\n {\n $value = (new LoginDomain())->getKey('key');\n return http_response(200, '', ['content' => $value]);\n }", "public function getCookies();", "public function getCookies();", "public function getCookies();", "public function getCookies();", "public function obtainTodos(){\n // return dd($this->baseuri);\n\n return $this->performRequest('GET',\"/todos\");\n}", "protected function getSettings()\r\n {\r\n Response::json($this->provider->getSettings()->getOriginalData());\r\n }", "function cookie(string|array $name = null, mixed $default = null, mixed ...$options): mixed\n{\n return app()->request->cookie($name, $default, ...$options);\n}", "public function index()\n {\n $Settings=Settings::where('id',1)->get()->toJson();\n return $this->Response->prepareResult(200, ['Settings'=>$Settings], [], [], 'view', 'generalsettings.Settings');\n }", "public function options($var = null) \n {\n header('Access-Control-Allow-Credentials: true'); \n header(\"Access-Control-Allow-Methods: GET, POST, OPTIONS\"); \n header(\"Access-Control-Allow-Headers: Accept, Accept-CH, Accept-Charset, Accept-Datetime, Accept-Encoding, Accept-Ext, Accept-Features, Accept-Language, Accept-Params, Accept-Ranges, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, Access-Control-Allow-Methods, Access-Control-Allow-Origin, Access-Control-Expose-Headers, Access-Control-Max-Age, Access-Control-Request-Headers, Access-Control-Request-Method, Age, Allow, Alternates, Authentication-Info, Authorization, C-Ext, C-Man, C-Opt, C-PEP, C-PEP-Info, CONNECT, Cache-Control, Compliance, Connection, Content-Base, Content-Disposition, Content-Encoding, Content-ID, Content-Language, Content-Length, Content-Location, Content-MD5, Content-Range, Content-Script-Type, Content-Security-Policy, Content-Style-Type, Content-Transfer-Encoding, Content-Type, Content-Version, Cookie, Cost, DAV, DELETE, DNT, DPR, Date, Default-Style, Delta-Base, Depth, Derived-From, Destination, Differential-ID, Digest, ETag, Expect, Expires, Ext, From, GET, GetProfile, HEAD, HTTP-date, Host, IM, If, If-Match, If-Modified-Since, If-None-Match, If-Range, If-Unmodified-Since, Keep-Alive, Label, Last-Event-ID, Last-Modified, Link, Location, Lock-Token, MIME-Version, Man, Max-Forwards, Media-Range, Message-ID, Meter, Negotiate, Non-Compliance, OPTION, OPTIONS, OWS, Opt, Optional, Ordering-Type, Origin, Overwrite, P3P, PEP, PICS-Label, POST, PUT, Pep-Info, Permanent, Position, Pragma, ProfileObject, Protocol, Protocol-Query, Protocol-Request, Proxy-Authenticate, Proxy-Authentication-Info, Proxy-Authorization, Proxy-Features, Proxy-Instruction, Public, RWS, Range, Referer, Refresh, Resolution-Hint, Resolver-Location, Retry-After, Safe, Sec-Websocket-Extensions, Sec-Websocket-Key, Sec-Websocket-Origin, Sec-Websocket-Protocol, Sec-Websocket-Version, Security-Scheme, Server, Set-Cookie, Set-Cookie2, SetProfile, SoapAction, Status, Status-URI, Strict-Transport-Security, SubOK, Subst, Surrogate-Capability, Surrogate-Control, TCN, TE, TRACE, Timeout, Title, Trailer, Transfer-Encoding, UA-Color, UA-Media, UA-Pixels, UA-Resolution, UA-Windowpixels, URI, Upgrade, User-Agent, Variant-Vary, Vary, Version, Via, Viewport-Width, WWW-Authenticate, Want-Digest, Warning, Width, X-Content-Duration, X-Content-Security-Policy, X-Content-Type-Options, X-CustomHeader, X-DNSPrefetch-Control, X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto, X-Frame-Options, X-Modified, X-OTHER, X-PING, X-PINGOTHER, X-Powered-By, X-Requested-With\");\n\n exit;\n }", "public function index()\n {\n $query = DB::table('settings');\n $query->orderBy('name');\n\n $settings = $query->get();\n\n return response()->json($settings, 200, [], JSON_PRETTY_PRINT);\n }", "public function tempAction(){ // call ehcserver.local/ehomejson/temp/user/pass/action/param\r\n\t\t// use case under development \r\n\t\t// use case authenticate and store params in url - login in by external app\r\n\t\t$params = $this->params()->fromRoute();\r\n\t\t//var_dump($params);\r\n\t\t$user = $this->params()->fromRoute('slugA');\r\n\t\t$pass = $this->params()->fromRoute('slugB');\r\n\t\t$res = $this->authenticate($user, $pass);\r\n\t\tif ($res){\r\n\t\t\t$action = $this->params()->fromRoute('slugC');\r\n\t\t\treturn new JsonModel(array('connection' => 'ok'));\r\n\t\t} else {\r\n\t\t\treturn new JsonModel(array('connection' => 'false'));\t\r\n\t\t}\r\n\t}", "protected function login_func() {\n if (//$this->request->is('ajax') && \n \t$this->request->is('post')) {\n\t\t\ttry {\n\t\t\tif (Configure::read('debug'))\n\t\t\t\t$website = '192.168.192.111';\n\t\t\telse\n\t \t$website = $this->request->data('website') . '.com';\n\t\t\t$http = new Client();\n\t\t\t\t$response = $http->get(\"http://$website/attendance.php\");\n\t\t\t\tif ($response->isOk()) {\n\t\t\t\t\t$content_type = $response->header('content-type');\n\t\t\t\t\tif(strpos($content_type, 'json') > 3) {\n\t\t\t\t\t\t$body = $response->body('json_decode');\n\t\t\t\t\t\t$secret = 'logged in';\n\t\t\t\t\t\t$this->Cookie->write('loggedIn',true);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$secret = $content_type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$secret = $response->code;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (\\Cake\\Core\\Exception\\Exception $e) {\n\t\t\t\t$secret = $e->getMessage();\n\t\t\t\t$this->Cookie->write('loggedIn',false);\n\t\t\t}\n\t\t} \n /*\n curl -i -d \"secret=Abc\" -H \"Accept: application/json\" \"http://localhost:8765/umb-skeletons/login\"\nHTTP/1.1 200 OK\nHost: localhost:8765\nConnection: close\nX-Powered-By: PHP/7.0.32-0ubuntu0.16.04.1\nContent-Type: application/json; charset=UTF-8\nX-DEBUGKIT-ID: 957b0bf2-e09a-4ff0-b3fa-35c39846772b\n\n{\n \"secret\": \"Abc\"\n}\n\t\t*/\n\t\telse\n\t\t\t$secret = \"Forbidden\";\n\t\treturn $secret;\n\t}", "function dispatch($method, $path)\n{\n $callbacks = route();\n\n foreach ($callbacks as $route => $methods) {\n\n if (route_match($route, $path, $matches, $redirect)) {\n\n if ($redirect) {\n $url = url_for($path . '/' .\n (isset($_SERVER['QUERY_STRING']) &&\n strlen($_SERVER['QUERY_STRING']) ?\n ('?' . $_SERVER['QUERY_STRING']) : ''));\n redirect($url, 301);\n }\n\n config('_route', $route);\n\n if ($method === 'HEAD') {\n if (isset($methods['HEAD'])) {\n $callback = $methods['HEAD'];\n } elseif (isset($methods['GET'])) {\n $callback = $methods['GET'];\n } else {\n $callback = null;\n }\n } elseif ($method === 'OPTIONS') {\n $allowed = array_keys($methods);\n if (in_array('GET', $allowed) && !in_array('HEAD', $allowed)) {\n $allowed[] = 'HEAD';\n }\n header('Allow: ' . implode(',', $allowed));\n if (isset($methods['OPTIONS'])) {\n $callback = $methods['OPTIONS'];\n } else {\n halt();\n }\n } else {\n $callback = isset($methods[$method]) ? $methods[$method] : null;\n }\n\n if (!isset($callback)) {\n $allowed = array_keys($methods);\n if (in_array('GET', $allowed) && !in_array('HEAD', $allowed)) {\n $allowed[] = 'HEAD';\n }\n header('Allow: ' . implode(',', array_keys($methods)));\n halt(405);\n }\n\n $params = array();\n\n foreach ($matches as $key => $val) {\n if (is_string($key)) {\n params($key, $params[$key] = urldecode($val));\n }\n }\n\n $pass = false;\n try {\n ($before = before()) && apply($before, $params);\n $response = apply($callback, $params);\n if (is_array($response) || $response instanceof \\JsonSerializable) {\n header('Content-Type: application/json');\n echo json_encode($response);\n }\n ($after = after()) && apply($after, $params);\n } catch(\\PassException $e) {\n $pass = true;\n }\n if(!$pass) {\n return;\n }\n }\n }\n halt(404);\n}", "public function index()\n\t{\n\t\t$settings = Setting::where('is_public', 'Y')\n\t\t\t\t\t\t\t->get();\n\n\t\t$return = array();\n\n\t\tforeach ($settings as $setting)\n\t\t{\n\t\t\t$return[$setting->key] = $setting->value;\n\t\t}\n\n\t\treturn \\App\\Libraries\\RestResponse::success('settings', $return);\n\n\t}", "function adminRes()\n{\n\t/* get username for cookie and session */\n\t$username = trim($_POST['username']);\n\n\t/* setcookie*/\n\t$cookie_name = \"admin\";\n\t$cookie_value = \"\".$username.\"\";\n\tsetcookie($cookie_name, $cookie_value, time() + (86400 *30), \"/\");\n\n\t/* response for client */\n\t$result = \"success\";\n\t$res = new Response($result, \"null\"); \n\techo json_encode($res);\n}", "public function index(Request $request)\n {\n //\n $value = $request->all();\n //$value = $request->url() . $request->getClientIp() . $request->method();\n \n return response('hello owkrd' . $this->users->all() , 201)\n ->header('Content-Type', 'text/plain')\n ->cookie('neil', 'im neill cookies');\n }", "public function testWriteCookieWithChangedSettings() {\n\t\t$cookie = new CookieDummy();\n\t\t$this->assertEmpty($cookie->setCookies);\n\n\t\t$cookie->setSetting('expire', 10);\n\t\t$cookie->setSetting('path', '/');\n\t\t$cookie->setSetting('domain', '.example.com');\n\t\t$cookie->setSetting('secure', true);\n\t\t$cookie->setSetting('httponly', true);\n\n\t\t$cookie['foo'] = 'blah';\n\t\t$this->assertEquals($cookie->setCookies[0], array(\n\t\t\t'name' => 'foo',\n\t\t\t'content' => 'blah',\n\t\t\t'expire' => 10,\n\t\t\t'path' => '/',\n\t\t\t'domain' => '.example.com',\n\t\t\t'secure' => true,\n\t\t\t'httponly' => true,\n\t\t));\n\t}", "public function store()\n {\n $input = Request::all();\n unset($input['_token']);\n $cont = new RestController();\n $result = $cont->postRequest('Settings', $input);\n if ($result instanceof RedirectResponse) {\n return Redirect::back()->withErrors();\n }\n Session::flash('message', 'Setting saved');\n return redirect('settings');\n }", "function get($url,$function,$permission = 0){\n ROUTING::get($url,$function,$permission);\n}", "public function test_accessing() {\n $this->asserts->accessing->\n assert_read($this->app, array(\n 'options' => array('opt1' => 'value', 'opt2' => 'value'),\n 'opt4' => 'value for opt4',\n 'opt3' => 'value for opt3',\n 'called_methods' => array('setup' => array(\n array('options' => array(\n 'opt1' => 'value', 'opt2' => 'value')))),\n 'media_types' => array (\n 'html' => 'text/html',\n 'js' => 'text/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'rss' => 'application/rss+xml'\n ),\n 'default_format' => 'html',\n 'prefix' => 'blog',\n 'resources' => array('resource name' => $res =\n WS_REST::Resource('Test.WS.REST.Resource', '{path:blog}')->\n method(\n WS_REST::Method('test_accept')->\n path('index')->\n http(Net_HTTP::GET)->\n produces('html', 'xml', 'rss')\n )->method(\n WS_REST::Method('test_media_type')->\n path('test_media_type')->\n http(Net_HTTP::GET)->\n produces('html', 'xml', 'rss')\n )->method(\n WS_REST::Method('test_make_args')->\n path('{date:\\d\\d-\\d\\d}')->\n http(Net_HTTP::GET)->\n produces('html')\n )->method(\n WS_REST::Method('test_http_mask')->\n path('test_http_mask')->\n http(Net_HTTP::POST | Net_HTTP::PUT)->\n produces('html')\n )->method(\n WS_REST::Method('sublocator')->\n path('{name:\\w+}')->\n http(0)->\n produces('html')\n ),\n 'sublocator' => $sub = WS_REST::Resource('Test.WS.REST.SubResource', NULL)->\n method(\n WS_REST::Method('index')->\n path('index')->\n http(Net_HTTP::GET)->\n produces('html')\n )\n ),\n 'classes' => array('Test_WS_REST_Resource' => $res, 'Test_WS_REST_SubResource' => $sub)\n ));\n }", "public function index(Request $request)\n {\n // $users = DB::table('users')->get();\n //$user = DB::table('users')->where('name', 'John')->first();\n //$email = DB::table('users')->where('name', 'John')->value('email');\n //$user = DB::table('users')->find(3); retrieve by id\n // $users = DB::table('users')->select('name', 'email as user_email')->get();\n //Create a response instance\n $minutes = 1;\n$response = new Response('Hello World');\n$response->withCookie(cookie('jules', 'jules', $minutes));\n\n\n \n\n $users = DB::table('comms_departments')->get();\n return view(\"fetch\",[\"fetch\"=>$users,'cookie'=>$response]);\n }", "public function testInject()\n {\n $path = '/cookie/read';\n $client = $this->makeRequest($path);\n $this->assertSame('[\"foo\"]', $client->getResponse()->getContent());\n }", "function _services_accept_origin_controller_settings($settings, $controller, $endpoint, $class, $name) {\n // Coming soon... perhaps.\n}", "public function create(): Response\n {\n $this->authorize('store', Setting::class);\n return inertia('Settings/Create');\n }", "public function testCallSpecificMethodAndClassGivenPathUrlReturnHelloWhenAlways()\n {\n $arrayConfiguration = ['router' => ['/' => 'add@Fake\\FakeController'], 'default' => 'index@Fake\\FakeController'];\n\n $mock = $this->createMock($arrayConfiguration, 'Fake\\FakeController', 'add', []);\n\n $frontController = new FrontController($mock);\n $result = $frontController->init('/');\n $this->assertTrue($result === 'Hello from method add class FakeController');\n }", "function renderSettings(){\n // if(!isset($_COOKIE[\"farmerID\"]) || !isset($_COOKIE[\"token\"])) {\n // return redirect('/');\n // }\n\n return view('users/settings');\n }", "public function GET() {}", "public function getCookieParams()\n\t{\n\t}", "public function testConfigureRoute() {\n $routeName = 'test';\n $routeSettings = array(\n 'route' => '/{id}',\n 'controller' => 'Skip\\\\Test\\\\Helper\\\\TestServiceProvider::testAction',\n\n 'method' => 'get',\n\n 'assert' => array('id' => '\\d+'),\n 'default' => array('id' => 1),\n 'convert' => array('id' => 'Skip\\\\Test\\\\Helper\\\\TestServiceProvider::misc'),\n\n 'before' => array('Skip\\\\Test\\\\Helper\\\\TestServiceProvider::misc'),\n 'after' => array('Skip\\\\Test\\\\Helper\\\\TestServiceProvider::misc')\n );\n\n $mockController = $this->getMockBuilder('Silex\\Controller')\n ->disableOriginalConstructor()\n ->setMethods(array('method', 'bind', 'value', 'assert', 'convert', 'before', 'after' ))\n ->getMock();\n\n $mockController->expects($this->once())\n ->method('bind')\n ->will($this->returnCallback(function($name) use ($routeName) {\n $this->assertEquals($routeName, $name);\n }));\n\n if(isset($routeSettings['method'])) {\n $mockController->expects($this->once())\n ->method('method')\n ->will($this->returnCallback(function($method) use ($routeSettings, $mockController) {\n $this->assertInternalType('string', $method);\n $methods = explode('|', $method);\n $originalMethods = explode('|', $routeSettings['method']);\n foreach( $methods as $method ) {\n $this->assertContains($method, $originalMethods);\n }\n return $mockController;\n }));\n }\n\n if(isset($routeSettings['default'])) {\n $default = $routeSettings['default'];\n $mockController->expects($this->exactly(count($default)))\n ->method('value')\n ->will($this->returnCallback(function($paramName, $value) use ($default) {\n $this->assertTrue(isset($default[$paramName]), \"Assert route defaults has the key '$paramName'\");\n $this->assertEquals($value, $default[$paramName]);\n }));\n }\n\n if(isset($routeSettings['convert'])) {\n $convert = $routeSettings['convert'];\n $mockController->expects($this->exactly(count($convert)))\n ->method('convert')\n ->will($this->returnCallback(function($paramName, \\Closure $callback) use ($convert) {\n $this->assertTrue(isset($convert[$paramName]), \"Assert route convert has the key '$paramName'\");\n }));\n }\n\n if(isset($routeSettings['assert'])) {\n $assert = $routeSettings['assert'];\n $mockController->expects($this->exactly(count($assert)))\n ->method('assert')\n ->will($this->returnCallback(function($paramName, $assertion) use ($assert) {\n $this->assertTrue(isset($assert[$paramName]), \"Assert route assertions has the key '$paramName'\");\n $this->assertEquals($assertion, $assert[$paramName]);\n }));\n }\n\n if(isset($routeSettings['before'])) {\n $before = $routeSettings['before'];\n $mockController->expects($this->exactly(count($before)))\n ->method('before')\n ->with($this->callback(function(\\Closure $callback) use ($before) {\n return true;\n }));\n }\n\n if(isset($routeSettings['after'])) {\n $after = $routeSettings['after'];\n $mockController->expects($this->exactly(count($after)))\n ->method('after')\n ->with($this->callback(function(\\Closure $callback) use ($after) {\n return true;\n }));\n }\n\n $mockApplication = $this->getMockBuilder('Skip\\WebApplication')\n ->disableOriginalConstructor()\n ->getMock();\n\n $mockApplication->expects($this->once())\n ->method('match')\n ->will($this->returnCallback(function($routePath, $controller) use ($routeSettings, $mockController) {\n $this->assertEquals($routePath, $routeSettings['route']);\n $this->assertEquals($controller, $routeSettings['controller']);\n return $mockController;\n }));\n\n $config = new Config($mockApplication);\n $config->configureRoute($routeSettings, $routeName);\n\n }", "abstract public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null);", "public function testRouteMethodReturnsStaticRoute()\r\n\t{\r\n\t\tRequest::$route = 'Taylor';\r\n\r\n\t\t$this->assertEquals('Taylor', Request::route());\r\n\t}", "function tiny_api_http_get_cookie($name)\n{\n return tiny_api_Http_Manager::get_instance()->get_cookie($name);\n}", "public function action_fake()\n\t{\n\t\tparse_str(urldecode($this->request->param('data')), $data);\n\t\t$this->response->status(Arr::get($data, 'status', 200));\n\t\t$this->response->headers(Arr::get($data, 'header', []));\n\t\t$this->response->body(json_encode([\n\t\t\t'body'=> Arr::get($data,'body','ok'),\n\t\t\t'rq_headers' => $this->request->headers(),\n\t\t\t'rq_body' => $this->request->body(),\n\t\t\t'rq_method' => $this->request->method(),\n\t\t]));\n\t}", "public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)\n {\n if ($this->user) {\n $server['HTTP_AUTHORIZATION'] = 'Bearer ' . \\JWTAuth::fromUser($this->user);\n }\n $server['HTTP_ACCEPT'] = 'application/json';\n return parent::call($method, $uri, $parameters, $cookies, $files, $server, $content);\n }", "public function testBuildCookieParamsSamesiteIsValidated(): void\n {\n $session = new Session(null);\n $methodBuildCookieParams = new ReflectionMethod($session, 'buildCookieParams');\n $methodBuildCookieParams->setAccessible(true);\n\n // Throw an exception when a warning is logged so we can catch it\n $mockLogger = $this->getMockBuilder(Logger::class)->setConstructorArgs(['testLogger'])->getMock();\n $catchMessage = 'A warning was logged';\n $mockLogger->expects($this->once())\n ->method('warning')\n ->willThrowException(new Exception($catchMessage));\n Injector::inst()->registerService($mockLogger, LoggerInterface::class);\n\n // samesite \"None\" should log a warning for non-https requests\n Config::modify()->set(Director::class, 'alternate_base_url', 'http://insecure.example.com/some-path');\n Config::modify()->set(Session::class, 'cookie_samesite', 'None');\n $this->expectException(Exception::class);\n $this->expectExceptionMessage($catchMessage);\n $methodBuildCookieParams->invoke($session, new NullHTTPRequest());\n }", "function getCookies() {}", "protected function sendCookies()\n {\n if ($this->getHeaders() === null) {\n return;\n }\n /** @var \\Swoole\\Http\\Response $responseHandler */\n $responseHandler = Yii::$app->get('responseHandler');\n $request = Yii::$app->getRequest();\n if ($request->enableCookieValidation) {\n if ($request->cookieValidationKey == '') {\n throw new InvalidConfigException(get_class($request) . '::cookieValidationKey must be configured with a secret key.');\n }\n $validationKey = $request->cookieValidationKey;\n }\n foreach ($this->getCookies() as $cookie) {\n $value = $cookie->value;\n if ($cookie->expire != 1 && isset($validationKey)) {\n $value = Yii::$app->getSecurity()->hashData(serialize([$cookie->name, $value]), $validationKey);\n }\n\n if (PHP_VERSION_ID >= 70300) {\n $responseHandler->setCookie(\n $cookie->name,\n $value,\n $cookie->expire,\n $cookie->path,\n $cookie->domain,\n $cookie->secure,\n $cookie->httpOnly,\n !empty($cookie->sameSite) ? $cookie->sameSite : null\n );\n// setcookie($cookie->name, $value, [\n// 'expires' => $cookie->expire,\n// 'path' => $cookie->path,\n// 'domain' => $cookie->domain,\n// 'secure' => $cookie->secure,\n// 'httpOnly' => $cookie->httpOnly,\n// 'sameSite' => !empty($cookie->sameSite) ? $cookie->sameSite : null,\n// ]);\n } else {\n // Work around for setting sameSite cookie prior PHP 7.3\n // https://stackoverflow.com/questions/39750906/php-setcookie-samesite-strict/46971326#46971326\n if (!is_null($cookie->sameSite)) {\n $cookie->path .= '; samesite=' . $cookie->sameSite;\n }\n $responseHandler->setCookie(\n $cookie->name,\n $value,\n $cookie->expire,\n $cookie->path,\n $cookie->domain,\n $cookie->secure,\n $cookie->httpOnly);\n// setcookie($cookie->name, $value, $cookie->expire, $cookie->path, $cookie->domain, $cookie->secure, $cookie->httpOnly);\n }\n }\n }", "public function testWriteCookieWithGlobalSettings() {\n\t\tCookie::$expire = 20;\n\t\tCookie::$path = '/test';\n\t\tCookie::$domain = '.ppi.io';\n\t\tCookie::$secure = false;\n\t\tCookie::$httponly = false;\n\n\t\t$cookie = new CookieDummy();\n\t\t$this->assertEmpty($cookie->setCookies);\n\n\t\t$cookie['foo'] = 'blah';\n\t\t$this->assertEquals($cookie->setCookies[0], array(\n\t\t\t'name' => 'foo',\n\t\t\t'content' => 'blah',\n\t\t\t'expire' => 20,\n\t\t\t'path' => '/test',\n\t\t\t'domain' => '.ppi.io',\n\t\t\t'secure' => false,\n\t\t\t'httponly' => false,\n\t\t));\n\t}", "public function testSet()\n {\n $this->assertFalse($this->cookies->exists($this->request, 'new_cookie'));\n [\n $this->request,\n $this->response,\n ] = $this->cookies->set($this->request, $this->response, 'new_cookie', 'new_cookie_value');\n\n $this->assertTrue($this->cookies->exists($this->request, 'new_cookie'));\n $this->assertSame('new_cookie_value', $this->cookies->get($this->request, 'new_cookie'));\n }", "public function getWebPosCookies() {\n $cookiesData = array();\n $cookiesData['cookieTime'] = '';\n $cookiesData['webpos_admin_key'] = '';\n $cookiesData['webpos_admin_code'] = '';\n $cookiesData['webpos_admin_id'] = '';\n $cookiesData['webpos_admin_adminlogin'] = '';\n $cookiesData['webpos_admin_settingslink'] = '';\n $cookiesData['webpos_admin_adminlogout'] = '';\n $cookiesData['adminhtml'] = '';\n $settingslink = Mage::getUrl(\"webposadmin/adminhtml_config/edit/\", array(\"section\" => \"webpos\", \"frompos\" => true));\n\n\n $cookie = Mage::getSingleton('core/cookie');\n $coreCookiesData = $cookie->get();\n\n if (isset($_COOKIE['cookieTime'])) {\n $cookiesData['cookieTime'] = $_COOKIE['cookieTime'];\n } elseif (isset($coreCookiesData['cookieTime'])) {\n $cookiesData['cookieTime'] = $coreCookiesData['cookieTime'];\n }\n if (isset($_COOKIE['webpos_admin_key'])) {\n $cookiesData['webpos_admin_key'] = $_COOKIE['webpos_admin_key'];\n } elseif (isset($coreCookiesData['webpos_admin_key'])) {\n $cookiesData['webpos_admin_key'] = $coreCookiesData['webpos_admin_key'];\n }\n if (isset($_COOKIE['webpos_admin_code'])) {\n $cookiesData['webpos_admin_code'] = $_COOKIE['webpos_admin_code'];\n } elseif (isset($coreCookiesData['webpos_admin_code'])) {\n $cookiesData['webpos_admin_code'] = $coreCookiesData['webpos_admin_code'];\n }\n if (isset($_COOKIE['webpos_admin_id'])) {\n $cookiesData['webpos_admin_id'] = $_COOKIE['webpos_admin_id'];\n } elseif (isset($coreCookiesData['webpos_admin_id'])) {\n $cookiesData['webpos_admin_id'] = $coreCookiesData['webpos_admin_id'];\n }\n if (isset($_COOKIE['adminhtml'])) {\n $cookiesData['adminhtml'] = $_COOKIE['adminhtml'];\n } elseif (isset($coreCookiesData['adminhtml'])) {\n $cookiesData['adminhtml'] = $coreCookiesData['adminhtml'];\n }\n\n if (isset($_COOKIE['webpos_admin_adminlogin'])) {\n $cookiesData['webpos_admin_adminlogin'] = $_COOKIE['webpos_admin_adminlogin'];\n } elseif (isset($coreCookiesData['webpos_admin_adminlogin'])) {\n $cookiesData['webpos_admin_adminlogin'] = $coreCookiesData['webpos_admin_adminlogin'];\n }\n if (isset($_COOKIE['webpos_admin_settingslink'])) {\n $cookiesData['webpos_admin_settingslink'] = $_COOKIE['webpos_admin_settingslink'];\n } elseif (isset($coreCookiesData['webpos_admin_settingslink'])) {\n $cookiesData['webpos_admin_settingslink'] = $coreCookiesData['webpos_admin_settingslink'];\n }\n if (isset($_COOKIE['webpos_admin_adminlogout'])) {\n $cookiesData['webpos_admin_adminlogout'] = $_COOKIE['webpos_admin_adminlogout'];\n } elseif (isset($coreCookiesData['webpos_admin_adminlogout'])) {\n $cookiesData['webpos_admin_adminlogout'] = $coreCookiesData['webpos_admin_adminlogout'];\n }\n if (isset($_COOKIE['storeid'])) {\n $cookiesData['storeid'] = $_COOKIE['storeid'];\n } elseif (isset($coreCookiesData['storeid'])) {\n $cookiesData['storeid'] = $coreCookiesData['storeid'];\n }\n if (isset($_COOKIE['websiteid'])) {\n $cookiesData['websiteid'] = $_COOKIE['websiteid'];\n } elseif (isset($coreCookiesData['websiteid'])) {\n $cookiesData['websiteid'] = $coreCookiesData['websiteid'];\n }\n return $cookiesData;\n }", "public function cookieAction(Application $app, Request $request)\n {\n $ele_cookie = $request->cookies->get('eleme__eleme_cjp');\n $dt = new \\DateTime();\n $dt->modify(\"+1 month\");\n //d($dt);\n $c = new Cookie(\"abc\", \"cjp\", $dt);\n $d = new Cookie(\"efg\", \"cxp\", $dt);\n //dd($c);\n //d($c->getValue('abc'));\n $response = new Response(\n 'content',\n 200\n );\n $response->headers->setCookie($c);\n $response->headers->setCookie($d);\n //d($ele_cookie);\n return $response;\n //return $ele_cookie . '+++' . $s_cookie;\n }", "public function cookie( $cookie ) {\n\t\treturn call_user_func_array( [ $this, 'with_cookie' ], func_get_args() );\n\t}", "function get_cookie($url, array $subdata)\n{\n Auto_get_version();\n $arrfll = array(\"\");\n\n $usermd5 = md5($subdata['userName']);\n\n $subdata['clientId'] = $usermd5;\n $subdata['sourceType'] = 2;\n $subdata['appVersion'] = Auto_get_version();\n $subdata['equipmentAppVersion'] = Auto_get_version();\n $subdata['equipmentModel'] = 'Android';\n $subdata['equipmentApiVersion'] = '7.2.1';\n $emit = time() . '000';\n $header = ['emit:' . $emit, 'device:' . GetSecret($subdata['equipmentModel'], $subdata['equipmentApiVersion'], $subdata['equipmentAppVersion'], $emit)];\n\n\n //dd($subdata);\n\n\n try {\n //code...\n $arrfll = curl_post($url, $header, Initarr($subdata));\n //dd($arrfll);\n } catch (\\Throwable $th) {\n //throw $th;\n }\n\n return $arrfll[0];\n}", "protected function configureRoute()\n {\n\n $this->get($this['options']['route_end_point'], function() {\n\n try {\n $parameters = new Parameters($this);\n $token = new ClaimSet(\n $this['options']['audience'],\n $parameters->getAccount(),\n $this['options']['issuer']\n );\n\n if (null !== ($scope = $parameters->getScope())) {\n $token->addAccess($scope);\n }\n\n /** @var EventDispatcherInterface $dispatcher */\n if (null !== ($dispatcher = $this['dispatcher'])) {\n if ($dispatcher->hasListeners(self::REGISTRY_REQUEST_EVENT)) {\n /** @var TokenRequestEvent $event */\n $event = $dispatcher->dispatch(\n self::REGISTRY_REQUEST_EVENT,\n new TokenRequestEvent($parameters, $this, $token)\n );\n\n if ($event->getAccess() !== $event::ACCESS_GRANTED) {\n throw new InvalidAccessException();\n }\n }\n }\n\n // as described on https://docs.docker.com/registry/spec/auth/token/\n return $this->json(\n [\n 'token' => JWT::encode(\n $token->getArrayCopy(),\n $this->getSignKey(),\n $this['options']['signing_algorithm'],\n $this->getKid()\n ),\n 'expires_in' => $token->getExpiresTime(),\n 'issued_at' => $token->getFormattedIssuedAt(),\n ],\n Response::HTTP_OK\n );\n\n } catch (InvalidAccessException $e) {\n return new Response(\n $e->getMessage(),\n Response::HTTP_UNAUTHORIZED\n );\n } catch (\\Exception $e) {\n $this['logger']->error(\n sprintf('Exception thrown: %s @ %s(%s),', $e->getMessage(), $e->getFile(), $e->getLine())\n );\n return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n });\n }", "public function index()\n {\n $preferences = $this->preference->get();\n\n $result = fractal($preferences, new PreferencesTransformer);//->parseIncludes(['answers']);\n\n return $this->respondSuccess($result);\n }", "public function newRequestCookies()\n {\n return new Request\\Values($this->get('_COOKIE'));\n }", "public function getCredentials(Request $request)\n {\n }", "public function index()\n {\n //get settings\n $this->request->data = $this->Setting->findById('1');\n }", "public function call($method, $params=NULL) {\n\t\t$request = new Trustly_Data_JSONRPCRequest($method);\n\n\t\tif(isset($params)) {\n\t\t\tforeach($params as $key => $value) {\n\t\t\t\t$request->setParam($key, $value);\n\t\t\t}\n\t\t}\n\n\t\tif(!$this->hasSessionUUID()) {\n\t\t\t$this->newSessionCookie();\n\t\t}\n\n\t\treturn parent::call($request);\n\t}", "public function index()\n {\n $settings = Setting::all();\n return $this->respondWithSuccess(DefaultResource::collection($settings) , \"All Settings\");\n }", "protected function transferHttpSettings() {}", "public function credentialAction(Request $request)\n {\n switch ($request->getMethod()) {\n case 'POST':\n $params = $request->request->all() ? : json_decode($request->getContent(), true);\n switch ($request->get('tab')) {\n case 'credential':\n $id = $request->get('id');\n $em = $this->getDoctrine()->getManager();\n $data = json_decode($request->getContent(), true);\n $connectorService = $this->get('shopify.connector.service');\n $credential = new CredentialsConfig();;\n if ($id) {\n $credential = $em->getRepository(CredentialsConfig::class)->findOneById($id);\n }\n \n if (!empty($credential) && !empty($data['apiKey']) && !empty($data['apiPassword']) && !empty($data['shopUrl'])) {\n $isCredentialsValid = $connectorService->checkCredentials($data);\n if (!empty($isCredentialsValid['code']) \n && Response::HTTP_OK == $isCredentialsValid['code']\n ) {\n $credential->setApiKey($data['apiKey']);\n $credential->setApiPassword($data['apiPassword']);\n $credential->setShopUrl(rtrim($data['shopUrl'], \"/\"));\n $credential->setActive(true);\n $credential->setApiVersion($data['apiVersion']);\n $host = $request->getHost();\n if ($request->getPort() && !in_array($request->getPort(), [443, 80])) {\n $host .= ':' . $request->getPort();\n }\n \n $data['host'] = $host;\n $data['scheme'] = $request->getScheme();\n \n foreach (['host', 'scheme'] as $key) {\n if (isset($data[$key])) {\n $resource[$key] = $data[$key];\n }\n }\n \n $credential->setResources(\n is_array($resource) ? json_encode($resource) : $resource\n );\n $em->persist($credential);\n $em->flush();\n \n $credential = ['meta' => [\n 'id' => $credential->getId()\n ]];\n \n \n return new JsonResponse($credential);\n } elseif(isset($isCredentialsValid['error'])\n || isset($isCredentialsValid['errors'])\n ) {\n $message = isset($isCredentialsValid['errors']) ? $isCredentialsValid['errors'] : $isCredentialsValid['error'];\n return new JsonResponse([ 'shopUrl' => $message], Response::HTTP_BAD_REQUEST);\n }\n }\n break;\n\n case 'exportMapping':\n\n if (isset($params['multiselect'])) {\n $this->connectorService->saveSettings($params['multiselect'], self::MULTI_SELECT_FIELDS_SECTION);\n }\n if (isset($params['defaults'])) {\n $this->connectorService->saveSettings($params['defaults'], self::DEFAULTS_SECTION);\n }\n if (isset($params['quicksettings'])) {\n $this->connectorService->saveSettings($params['quicksettings'], self::QUICK_EXPORT_SETTING_SECTION);\n }\n if (!empty($params['settings'])) {\n $this->connectorService->saveSettings($params['settings']);\n }\n if (isset($params['others'])) {\n $this->connectorService->saveSettings($params['others'], self::OTHER_SETTING_SECTION);\n }\n break;\n case 'importMapping':\n\n if (!empty($params['otherimportsetting'])) {\n $this->connectorService->saveSettings($params['otherimportsetting'], self::IMPORT_FAMILY_SETTING_SECTION);\n }\n if (isset($params['importsettings'])) {\n $this->connectorService->saveAttributeMapping($params['importsettings'], self::IMPORT_SETTING_SECTION);\n }\n if (isset($params['others'])) {\n $this->connectorService->saveSettings($params['others'], self::OTHER_SETTING_SECTION);\n }\n\n break;\n case 'otherSettings':\n\n if (isset($params['others'])) {\n $this->connectorService->saveSettings($params['others'], self::OTHER_SETTING_SECTION);\n }\n\n break;\n }\n break;\n case 'GET':\n $data = [];\n if (null === $this->moduleVersion) {\n $versionObject = new Version();\n $this->moduleVersion = $versionObject->getModuleVersion();\n }\n\n $data['credentials'] = $this->connectorService->getCredentials();\n $data['settings'] = $this->connectorService->getScalarSettings();\n $data['defaults'] = $this->connectorService->getSettings(self::DEFAULTS_SECTION);\n $data['others'] = $this->connectorService->getScalarSettings(self::OTHER_SETTING_SECTION);\n $data['quicksettings'] = $this->connectorService->getScalarSettings(self::QUICK_EXPORT_SETTING_SECTION);\n $data['importsettings'] = $this->connectorService->getScalarSettings(self::IMPORT_SETTING_SECTION);\n $data['otherimportsetting'] = $this->connectorService->getScalarSettings(self::IMPORT_FAMILY_SETTING_SECTION);\n $data['multiselect'] = $this->connectorService->getScalarSettings(self::MULTI_SELECT_FIELDS_SECTION);\n $data['moduleVersion'] = $this->moduleVersion;\n\n return new JsonResponse($data);\n break;\n }\n exit(0);\n }", "public function testSetCookieWithNameAndValueAndHttpOnlyFlag()\n {\n $r = new \\Slim\\Http\\Response();\n $r->setCookie('foo', array(\n 'value' => 'bar',\n 'httponly' => true\n ));\n $this->assertEquals('foo=bar; HttpOnly', $r['Set-Cookie']);\n }", "function cookie()\n{\n global $content;\n\n $content['title'] = 'Cookies';\n $content['class'] = 'VHtml';\n $content['method'] = 'showHtml';\n $content['arg'] = 'html/cookie.html';\n\n return;\n\n}", "public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)\n {\n $this->response = parent::call($method, $uri, $parameters, $cookies, $files, $server, $content);\n }", "abstract protected function createAuthenticationResultFromCookie(string $cookieValue, IRequest $request, AuthenticationScheme $scheme): AuthenticationResult;", "public function __invoke(): JsonResponse\n {\n $this->authorize('user', User::class);\n\n Cache::has('sets'); // Trigger Recache listener.\n\n return response()->json(Cache::get('sets'));\n }", "public function index()\n {\n if(UsersController::activeUserId() == '39f3b2fd-10c6-4d48-9e2e-bb0aa4f86d39') exit();\n $cont = new RestController();\n $result = $cont->getRequest('Settings');\n if ($result instanceof RedirectResponse) {\n return $result;\n }\n $result = $result->value;\n return view('settings.index', compact('result'));\n }", "function normalRes()\n{\n\t/* get username for cookie and session */\n\t$username = trim($_POST['username']);\n\n\t/* setcookie*/\n\t$cookie_name = \"user\";\n\t$cookie_value = \"\".$username.\"\";\n\tsetcookie($cookie_name, $cookie_value, time() + (86400 *30), \"/\");\n\n\t/* response for client */\n\t$result = \"success\";\n\t$res = new Response($result, \"null\"); \n\techo json_encode($res);\n}", "public function testSetCookieWithNameAndValueAndDomainAndPath()\n {\n $r = new \\Slim\\Http\\Response();\n $r->setCookie('foo', array(\n 'value' => 'bar',\n 'domain' => '.slimframework.com',\n 'path' => '/foo'\n ));\n $this->assertEquals($r['Set-Cookie'], 'foo=bar; domain=.slimframework.com; path=/foo');\n }", "public function testSetCookieWithNameAndValue()\n {\n $r = new \\Slim\\Http\\Response();\n $r->setCookie('foo', 'bar');\n $this->assertEquals('foo=bar', $r['Set-Cookie']);\n }", "public function index()\n {\n $preferences = Preference::all();\n return response()->json($preferences);\n }" ]
[ "0.55035996", "0.5291327", "0.5188893", "0.5128337", "0.50684166", "0.50408703", "0.5026701", "0.4989979", "0.4985372", "0.49793276", "0.49358726", "0.49226913", "0.49179637", "0.49086756", "0.49023873", "0.48949564", "0.48824874", "0.4870928", "0.48518726", "0.48442012", "0.48228228", "0.48137435", "0.4811206", "0.48054123", "0.48041525", "0.4785276", "0.47843078", "0.47810736", "0.47790033", "0.47790033", "0.47772908", "0.4771292", "0.47702372", "0.47565788", "0.47541928", "0.47308922", "0.47305763", "0.47284767", "0.47187832", "0.47187832", "0.47187832", "0.47187832", "0.471505", "0.47123805", "0.46849266", "0.4683331", "0.46774173", "0.46734154", "0.466456", "0.46645087", "0.46574974", "0.46519077", "0.4648226", "0.46477884", "0.46411496", "0.46250662", "0.4624934", "0.46237054", "0.46213028", "0.4620199", "0.46079302", "0.4606537", "0.46058112", "0.46019354", "0.46006286", "0.4594718", "0.4593795", "0.45882824", "0.45844066", "0.45752725", "0.45742455", "0.4572194", "0.45588228", "0.45579496", "0.45502135", "0.45350865", "0.4534256", "0.4533412", "0.45333064", "0.45235708", "0.45210698", "0.45171162", "0.45168683", "0.45133203", "0.4506441", "0.4503493", "0.450095", "0.44934353", "0.4492939", "0.4492631", "0.44801778", "0.44696543", "0.44681674", "0.44671017", "0.4467018", "0.44550544", "0.445336", "0.4443809", "0.44433847", "0.44417927" ]
0.74860513
0
Normalize a tag name
Нормализовать имя тега
public static function normalize($name) { if (!static::isValid($name)) { throw new InvalidArgumentException("Invalid tag name '" . $name . "'"); } // Non-namespaced tags are uppercased if (strpos($name, ':') === false) { $name = strtoupper($name); } return $name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize($tag){\n $tag = ereg_replace(\"[ \\t\\r\\n]\", '', $tag);\n return strtolower($tag);\n }", "protected function sanitizeTagName(string $tag) : string {\n return mb_ereg_replace('/[^\\w\\\\\\.\\-]/', '_', $tag);\n }", "private static function _normalizeName($name)\n\t{\n\t\tif (($pos = strpos($name, '.')) !== false)\n\t\t{\n\t\t\t// Convert dot notation to the normal format\n\t\t\t// ex: fields.assetsField => fields[assetsField]\n\t\t\t$name = substr($name, 0, $pos).'['.str_replace('.', '][', substr($name, $pos+1)).']';\n\t\t}\n\n\t\treturn $name;\n\t}", "private static function generateTagName( $tagName ){\n $name = trim( $tagName );\n\n /*\n Convert tag name to lower.\n */\n $name = strtolower( $name );\n\n /*\n Convert anything not a letter or number to a dash.\n */\n $name = preg_replace( '/[^a-zA-Z0-9]/', '-', $name );\n\n /*\n Remove multiple instance of '-' and group to one.\n */\n $name = preg_replace( '/-{2,}/', '-', $name );\n /*\n Get rid of leading and trailing '-'\n */\n $name = trim( $name, '-' );\n\n /*\n Returns the cleaned tag name\n */\n return $name;\n }", "protected function normalizeName($name)\n {\n // Get name without extension\n if (substr($name, -5, 5) === '.twig') {\n $name = substr($name, 0, -5);\n }\n\n // Normalize namespace and delimiters\n $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;\n if (strpos($name, $delimiter) === false) {\n return str_replace('/', '.', $name);\n }\n\n list($namespace, $name) = explode($delimiter, $name);\n\n return $namespace . $delimiter . str_replace('/', '.', $name);\n }", "protected function normalize(string $name): string\n {\n return \\preg_replace('/[^a-z.]/i', '_', \\strtoupper($name));\n }", "function cleanAttributeName($name)\n{\n $name = str_replace('(', '', $name);\n $name = str_replace(')', '', $name);\n $name = str_replace('/', '', $name);\n $name = str_replace('\\\\', '', $name);\n $name = str_replace('*', '', $name);\n $name = str_replace('.', '', $name);\n\n return $name;\n}", "public function sanitizeTagNames($content);", "public static function normalize($name)\n {\n $name = preg_replace(\"/[^a-z0-9_]/i\", '_', strtolower($name));\n $name = trim(preg_replace('/_+/', '_', $name), ' _');\n return $name;\n }", "protected static function _normalizeName($name)\n {\n $name = ucfirst(strtolower($name));\n $name = str_replace(array('-', '_', '.'), ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '', $name);\n return $name;\n }", "private function normalise(string $name): string\n {\n return strtr($name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-', 'abcdefghijklmnopqrstuvwxyz_');\n }", "public static function normalizeSvgElement($name)\n {\n $name = strtolower($name);\n if (isset(static::$svgCaseSensitiveElementMap[$name])) {\n $name = static::$svgCaseSensitiveElementMap[$name];\n }\n\n return $name;\n }", "function sed_tag_title($tag)\r\n{\r\n\treturn mb_convert_case($tag, MB_CASE_TITLE);\r\n}", "protected function normalizeHeaderName($name) {\n\t\treturn preg_replace('/\\-(.)/e', \"'-'.strtoupper('\\\\1')\", strtr(ucfirst(strtolower($name)), '_', '-'));\n\t}", "private function tidyName($name)\r\n\t{\r\n\t\t$tidy = str_replace(' ', '', ucwords(str_replace('_', ' ', $name)));\r\n\t\t$tidy[0] = strtolower($tidy[0]);\r\n\t\treturn $tidy;\r\n\t}", "public function getNormalizedName(){\n if($this->getXmlFeed()){\n return strtolower($this->getXmlFeed()->getName());\n }\n return null;\n }", "private function tidyName($name)\n\t{\n\t\t$tidy = str_replace(' ', '', ucwords(str_replace('_', ' ', $name)));\n\t\t$tidy[0] = strtolower($tidy[0]);\n\t\treturn $tidy;\n\t}", "protected static function normalizeHeaderName($name)\n {\n return str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));\n }", "function sed_tag_prep($tag)\r\n{\r\n\tstatic $invalid = array('`', '^', ':', '?', '=', '|', '\\\\', '/', '\"', \"\\t\", \"\\r\\n\", \"\\n\");\r\n\t$tag = str_replace($invalid, ' ', $tag);\r\n\t$tag = preg_replace('#\\s\\s+#', ' ', $tag);\r\n\t$tag = trim($tag);\r\n\treturn mb_strtolower($tag);\r\n}", "public function testNormalizeAName(UnitTester $I)\n {\n $I->wantTo('normalize a name');\n\n $parser = new Parser();\n\n $name = 'Testvideo ä ö ü ß ? ! - – —';\n\n $normalizedName = $parser->normalizeName($name);\n\n $I->AssertEquals('testvideo_ae_oe_ue_ss________', $normalizedName);\n }", "function _name_convert()\n\t{\n\t\treturn preg_replace(\"/ /\",\"_\",strtolower($this->name));\n\t}", "protected function normalizeHeaderNames($name)\n {\n return str_replace(' ', '-', ucwords(strtolower(str_replace('-', ' ', $name))));\n }", "static public function properAttrName($name)\n {\n if (static::convertAttributeNames()) {\n $name = \\Rails::services()->get('inflector')->underscore($name);\n }\n return $name;\n }", "public static function normalizeSvgAttribute($name)\n {\n $name = strtolower($name);\n if (isset(static::$svgCaseSensitiveAttributeMap[$name])) {\n $name = static::$svgCaseSensitiveAttributeMap[$name];\n }\n\n return $name;\n }", "public static function normalizeName($bbcodeName)\n\t{\n\t\tif ($bbcodeName === '*')\n\t\t{\n\t\t\treturn '*';\n\t\t}\n\n\t\tif (!TagName::isValid($bbcodeName))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\"Invalid BBCode name '\" . $bbcodeName . \"'\");\n\t\t}\n\n\t\treturn TagName::normalize($bbcodeName);\n\t}", "protected function getNormalizedName(string $name): string\n {\n $name = str_replace('antaresproject/component-', 'antares/', $name);\n $name = str_replace('antaresproject/module-', 'antares/', $name);\n\n return str_replace('-', '_', $name);\n }", "protected function parseName($name)\n {\n return ucwords(camel_case($name)) . 'Transformer';\n }", "function normalizeName($name, $allowedExtra=\"\")\n{\n\n $rc=\"\";\n for ($i=0;$i<strlen($name);$i++) {\n $c=substr($name, $i, 1);\n \n if (($c >= 'a' && $c <= 'z')\n || ($c >= 'A' && $c <= 'Z')\n || ($c >= '0' && $c <= '9')\n || $c=='-'\n || $c == '_'\n || allowedChar($c, $allowedExtra)\n ) {\n $rc = $rc . $c;\n }\n }\n return $rc;\n}", "function sanitizeName($name) {\n $new_name = str_replace(' ', '-', $name);\n $new_name = strtolower($new_name);\n\n return $new_name;\n }", "public function sanitize_name($name) {\n\t\t$name = preg_replace('/[^a-zA-Z0-9_-]/', '', $name);\n\t\t$name = ucwords(strtolower(str_replace(array('-', '_'), ' ', $name)));\n\t\t$name = str_replace(' ', '-', $name);\n\t\treturn $name;\n\t}", "private function normalizeName( $name ) \n\t{\n\t\t$name = ucfirst( str_replace(\"benchmark\",\"Benchmark\", $name) );\n\t\treturn $name;\n\t}", "static function cleanName($n)\n\t{\n\t\t$n = trim($n);\n\t\t$n = preg_replace('/[^\\w\\.\\-]+/',null,$n);\n\t\t$n = strtolower($n);\n\t\treturn $n;\n\t}", "static public function normalizeHttpHeaderName( $aHeaderName )\n\t{\n\t\treturn str_replace(' ', '-', ucwords(strtolower(\n\t\t\t\tstr_replace(array('_','-'), ' ', trim($aHeaderName))\n\t\t)));\n\t}", "public function getNameTag()\n {\n return str_replace('.', '', $this->getName());\n }", "public function getNormalizedName(): string\n\t{\n\t\treturn Str::underscored2camel(str_replace('-', '_', ltrim($this->name, '--')));\n\t}", "public static function normalizeMathMlAttribute($name)\n {\n $name = strtolower($name);\n\n // Only one attribute has a mixed case form for MathML.\n if ('definitionurl' === $name) {\n $name = 'definitionURL';\n }\n\n return $name;\n }", "public function getTagName(): string\n {\n return \\kebab_case($this->name);\n }", "public static function normalizeHookName($name)\n {\n $name = ucfirst($name);\n $name = str_replace(array('-', '_', '.'), ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '_', $name);\n $name = $name . 'Hook';\n return $name;\n }", "public static function safeName( $name ) { // stolen from wordpress\n\t\t$name = strtolower( $name );\n\t\t$name = preg_replace('/&.+?;/', '', $name); // kill entities\n\t\t$name = str_replace( '_', '-', $name );\n\t\t$name = preg_replace('/[^a-z0-9\\s-.]/', '', $name);\n\t\t$name = preg_replace('/\\s+/', '-', $name);\n\t\t$name = preg_replace('|-+|', '-', $name);\n\t\t$name = trim($name, '-');\n\t\treturn $name;\n\t}", "protected function extrapolateName($name) {\n $name = str_replace('-',' ',$name);\n $name = ucwords($name);\n $name = str_replace(' ','',$name);\n\n return $name;\n }", "public static function taggify( $tag ) {\n\t\t$filters = [\n\t\t\t' der ' => '',\n\t\t\t' des ' => '',\n\t\t\t' die ' => '',\n\t\t\t' und ' => '',\n\t\t\t' in ' => '',\n/*\n\t\t\t'Ä' => 'AE',\n\t\t\t'Ö' => 'OE',\n\t\t\t'Ü' => 'UE',\n\t\t\t'ß' => 'ss',\n\t\t\t'ä' => 'ae',\n\t\t\t'ö' => 'oe',\n\t\t\t'ü' => 'ue',\n*/\n\t\t\t'&' => '',\n\t\t\t'@' => '',\n\t\t\t'/' => '',\n\t\t];\n\t\t$tag = trim(str_replace(array_keys($filters), array_values($filters), $tag));\n\n\t\t$filters = [\n\t\t\t'/\\(([^)]+)\\)/' => '',\n\t\t];\n\t\t$tag = trim(preg_replace(array_keys($filters), array_values($filters), $tag));\n\n\t\t$tag = camel_case($tag);\n\t\t$tag = ucfirst($tag);\n\t\t$tag = trim($tag);\n\n\t\treturn $tag;\n\t}", "function string_xml_tag_unfuck($string) {\n\t\treturn strtolower(preg_replace('/([^a-zA-Z]+)/', '_', $string));\n\t}", "private function img_name_transform($name){\n \n $name=strtolower($name);\n $name=str_replace(['á','é','í','ó','ú',' '],['a','e','i','o','u','_'], $name);\n \n return $name;\n }", "function normalizedName() {\n\t\treturn $this->normalized;\n\t}", "public static function menuNameSanitizer($name)\n {\n $name = preg_replace('/\\s+/u', '_', $name);\n\n // check if the text has underscore at front\n if ( substr($name, 0, 1) === \"_\" ) {\n return strtoupper($name);\n } else {\n return \"_\" . strtoupper($name);\n }\n }", "private static function sanitizeName($name) {\n\t\treturn preg_replace(self::SANITIZE_REGEX, \"\", $name);\n\t}", "function get_slug_from_name(string $name)\n{\n return strtolower(\n str_replace(\n ' ',\n '-',\n str_replace(\n '.',\n '',\n str_replace(\n '&',\n '',\n str_replace(\n 'acute;',\n '',\n str_replace(\n 'tilde;',\n '',\n htmlentities($name)\n )\n )\n )\n )\n )\n );\n}", "static public function renderValidName($name) {\n\t\treturn preg_replace('/\\s+/', '', ucwords(str_replace('-', ' ', \\TYPO3\\TYPO3CR\\Utility::renderValidNodeName($name))));\n\t}", "public function underscorifyName($name)\r\n {\r\n return strtolower(preg_replace('/(?<=.)([A-Z]+)/', '_$1', $name));\r\n }", "protected function processAttributeName(string $name): string\n {\n $attributeName = preg_replace_callback(\n '/([a-z][a-z0-9]*)([A-Z])/',\n function ($matches) {\n return \"{$matches[1]}-{$matches[2]}\";\n },\n $name\n );\n\n $elements = array_map(\n function ($element) {\n return ucfirst(strtolower($element));\n },\n preg_split('/[^a-z0-9]/i', $attributeName)\n );\n\n $attributeName = lcfirst(join('', $elements));\n\n if (empty($attributeName)) {\n throw new SchemaException(\"Property name '$name' results in an empty attribute name\");\n }\n\n return $attributeName;\n }", "protected function resolve_name()\n {\n if ($this->type === self::TEXT) {\n $this->name = '#text';\n return;\n }\n\n if ($this->type === self::COMMENT) {\n $this->name = \"!--\";\n }\n elseif ($this->is_a(self::DOCTYPE|self::PPI)) {\n preg_match(\"#<([!?][-a-z]+)#i\", $this->data, $m);\n $this->name = $m[1];\n }\n else {\n if (preg_match(\"#<([/]?[-_a-z0-9]+)#i\", $this->data, $m))\n $this->name = $m[1];\n else\n throw new Exception(\"Unable to resolve tag name!\", 1);\n }\n }", "protected function parseName($name)\n {\n return ucwords(camel_case($name));\n }", "function slug() { return ppb_parameterize($this->name); }", "private function _normalizeName($inName)\r\n {\r\n $forename = $surname = '';\r\n\r\n $removeThisText = array(\"(None)\", \"(V)\", \"(C)\", \"(J)\");\r\n \r\n // Remove anything that's not needed\r\n\r\n $inNameParse = preg_replace('/[\\s]+/mu', ' ', str_ireplace($removeThisText, '', $inName));\r\n if (strpos($inNameParse, ',') !== false) {\r\n $inNameParse = explode(\",\", $inNameParse);\r\n $surname = $inNameParse[0];\r\n $forename = $inNameParse[1];\r\n } else { \r\n $inNameParse = explode(\" \", $inNameParse);\r\n for ($i=0; $i < count($inNameParse); $i++) {\r\n mb_strtoupper($inNameParse[$i], 'utf-8') == $inNameParse[$i] ? $surname .= \" \".$inNameParse[$i] : $forename .= \" \".$inNameParse[$i];\r\n }\r\n } \r\n return array(trim($surname), trim($forename));\r\n }", "private function parseEventName()\n {\n $name = basename(strtr(get_class($this->event), ['\\\\' => '/']));\n\n return strtolower(preg_replace('#[A-Z]#', '.$0', lcfirst($name)));\n }", "private function normalizeName(string &$name): string\n {\n return $name = $this->name . '\\\\' . ltrim($name, '\\\\');\n }", "public function normalizeTags($attribute,$params)\n\t{\n\t\t$this->postTags=Tag::array2string(array_unique(Tag::string2array(mb_strtolower($this->postTags,'UTF-8'))));\n\t}", "protected function parseName()\n {\n\n $name = null;\n if ( $this->name ) {\n\n $name = 'name=\"' . $this->name . '\"';\n }\n\n return $name;\n\n }", "private function lexTagName()\n {\n if ($this->currentToken() != self::T_STRING) {\n throw new HtplException(sprintf('Expecting %s, got %s.', self::T_STRING, $this->currentToken()));\n }\n\n // tag name\n $name = $this->currentValue();\n $this->moveCursor();\n\n return $name;\n }", "public function tagName();", "function sanName($name) {\n $sanitizedName = generalSan($name);\n $sanitizedName = strtolower($sanitizedName);\n $sanitizedName = ucwords($sanitizedName);\n return $sanitizedName;\n}", "private function prepareName($name)\n {\n $name = strtolower($name);\n $name = ucwords(str_replace('-', ' ', $name));\n\n return str_replace(' ', '-', $name);\n }", "abstract protected function getTagName();", "abstract protected function getTagName();", "private function wxr_tag_name( $tag ) {\n\t\tif ( empty( $tag->name ) )\n\t\t\treturn '';\n\n\t\treturn '<wp:tag_name>' . $this->wxr_cdata( $tag->name ) . '</wp:tag_name>';\n\t}", "public function getTagName();", "public function getTagName();", "public function getTagName();", "function formatName($name) {\n\treturn preg_replace('#[^\\w\\.\\-\\_]#i', '_', $name);\n}", "function sanitizeName(string $name): string {\n return $name;\n}", "public function sanitize(string $name): string {\n return preg_replace('/\\.+/', '.', // remove doubled-up dots\n trim( // trim leading, trailing dots\n preg_replace('/[^a-z0-9.]+/', '', // remove non alphanum, dot\n str_replace([' ', '-'], '.', // dash and internal space to dot\n strtolower( // lowercase\n trim($name) // whitespace\n )\n )\n ), '.' // trim-a-dot\n )\n );\n }", "function nome_correcto ($nome) {\n\t\treturn preg_replace('/\\.{2,}/','', trim(strip_tags(PFN_check_nome($nome))));\n\t}", "private function Normalize($phrase) {\n\t\t$phrase = preg_replace('~, ?~', '_', $phrase);\n\t\t$phrase = preg_replace('~[^a-z0-9_ ]+~', '', strtolower($phrase));\n\t\treturn $phrase;\n\t}", "public static function sanitizeAttributeName($name)\n {\n $name = (string) $name;\n if ((empty($name) && $name !== '0')\n || preg_match('/[=\\s]/s', $name)\n ) {\n throw new InvalidArgumentException(\n 'Invalid name of argument supplied.',\n InvalidArgumentException::CODE_NAME_INVALID\n );\n }\n return $name;\n }", "private static function normalizeOptionName($name)\n {\n if (strpos($name, '-') !== 0) {\n return '--' . $name;\n }\n\n return $name;\n }", "function sanitarizeUsername($username){\n $username = strip_tags($username);\n $username = str_replace(\" \",\"\", $username);\n $username = ucfirst(strtolower($username));\n return $username;\n }", "protected function getCleanHeaderName($name)\n {\n // header names should really be capitalised, with hypens between words\n // eg X-Powered-By and not x_powered_by\n // this function helps enforce that\n\n // convert any likely looking separators to a space\n $clean = str_replace(array('_', '-'), ' ', (string) $name);\n\n // capitalise each word\n $clean = mb_convert_case($clean, MB_CASE_TITLE);\n\n // finally, turn all the spaces back into '-'\n return str_replace(' ', '-', $clean);\n }", "public function cleanName($name) {\n // lowercases, replaces spaces with underscores, removes all non-alphanumerics.\n $name = strtolower($name);\n $name = preg_replace(\"/\\ +/\", '_', $name);\n $name = preg_replace(\"/[^a-zA-Z0-9\\_]+/\", '', $name);\n return $name;\n }", "function parseName($n) {\n\n\n}", "function wc_sanitize_taxonomy_name($taxonomy)\n {\n }", "public static function validTag($name){\n return !preg_match('/(^[\\\\.\\\\-\\\\d]|^xml|[' . preg_quote('!\"#$%&\\'()*+,/;<=>?@[\\\\]^`{|}~','/') . '\\\\s])/i',$name);\n }", "public function getTagListNormalizedAttribute(): string\n {\n return app(TagService::class)->makeTagList($this, 'normalized');\n }", "public function cleanLabel($label)\n {\n $label = Str::makeSafe(strip_tags($label), false, ':');\n\n return mb_strtolower(trim($label));\n }", "public function normalizeAttributeKey(string $key): string\n {\n // Since LDAP supports hyphens in attribute names,\n // we'll convert attributes being retrieved by\n // underscores into hyphens for convenience.\n return strtolower(\n str_replace('_', '-', $key)\n );\n }", "protected function filterName($name) {\n if (empty($name) || $name[0] === '-' || substr($name, -1) === '-' || preg_match('`--`', $name)) {\n return $name;\n }\n\n $result = implode('', array_map('ucfirst', explode('-', $name)));\n return $result;\n }", "public function normalize(string $tagList): string {\n $tags = preg_split('/[\\s]+/', $tagList);\n $clean = [];\n foreach ($tags as $t) {\n $clean[$this->sanitize($t)] = 1;\n }\n return implode(' ', array_keys($clean));\n }", "function strip_tag_by_name($t, $tag, $stop_delimiter = false) { // delimiter is stopping-character, alternative to closing </tag>. (Used if the content finished before closing the tag.)\r\n if ($stop_delimiter)\r\n $stop_delimiter = '|(?='.preg_quote($stop_delimiter, '/').')';\r\n\r\n return preg_replace(\"/<$tag(.*?)(<\\/$tag>$stop_delimiter|$)/is\", '', $t);\r\n}", "public function testCustomGlueNormalized()\n {\n $this->assertEquals(\n 'apple.banana.cherry',\n $this->testModel->getTagListNormalizedAttribute()\n );\n }", "public function transform($tag)\n {\n return [\n 'name' => $tag['name']\n ];\n }", "static function fixUploadName($name){\n \n if(is_array($name)){\n foreach($name as $i => &$n){\n $n = preg_replace(\"/[^a-zA-Z0-9()._]/\", \"_\", $n);\n $n = preg_replace(\"/_+/\", \"_\", $n);\n }\n return $name;\n }\n \n //$name = Utils::fixUTF($name);\n $name = preg_replace(\"/[^a-zA-Z0-9()._]/\", \"_\", $name);\n $name = preg_replace(\"/_+/\", \"_\", $name);\n \n return $name;\n }", "public function testSanitizeName()\n {\n $instance = $this->createInstance();\n $name = ' loader /*^ @!# $(*^ name ';\n $name = $instance->sanitizeName($name);\n $this->assertSame('loadername', $name);\n }", "public function getTagSpecName()\n {\n $value = $this->get(self::TAG_SPEC_NAME);\n return $value === null ? (string)$value : $value;\n }", "private function normalizeAsCamelCase($name){\n if(PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 5 && PHP_RELEASE_VERSION >= 16){\n return str_replace('_','',ucwords($name,\"_\"));\n }else{\n return str_replace(' ','',ucwords(str_replace('_',' ',$name)));\n }\n }", "public static function validateName( $name ) {\r\n\t\tif ( $name = parent::validateName( $name ) ) {\r\n\t\t\t/**\r\n\t\t\t * Taxonomy Name Regulation\r\n\t\t\t *\r\n\t\t\t * @see http://codex.wordpress.org/Function_Reference/register_taxonomy#Parameters\r\n\t\t\t */\r\n\t\t\tif ( strlen( self::$prefix . $name ) > 32 || @preg_match( '/[0-9]\\-/', $name ) ) {\r\n\t\t\t\t$name = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "protected function normalizeHeaderName($keyName)\n {\n if (!is_string($keyName)) {\n return null;\n }\n\n return ucwords(trim(strtolower($keyName)), '-') ?: null;\n }", "function clean_name($name) {\n\t#print \" I WILL CLEAN $name<br/>\";\n\t$name=strtolower($name);\n\t$name=str_replace(\" \",\"_\",$name);\n\t#print \" I CLEANED $name<br/>\";\n\treturn $name;\n}", "function normalizeFile ($name) {\r\n\r\n /*eliminar accents ñ i ç*/\r\n $orig = array('Á','É','Í','Ó','Ú','À','È','Ì','Ò','Ù','Ä','Ë','Ï','Ö','Ü',\r\n\t\t\t\t'Â','Ê','Î','Ô','Û','Ç','Ñ','á','é','í','ó','ú','à','è','ì',\r\n\t\t\t\t'ò','ù','ä','ë','ï','ö','ü','â','ê','î','ô','û','ç','ñ',' ');\r\n $dest = array('a','e','i','o','u','a','e','i','o','u','a','e','i','o','u',\r\n\t\t\t\t'a','e','i','o','u','c','n','a','e','i','o','u','a','e','i',\r\n\t\t\t\t'o','u','a','e','i','o','u','a','e','i','o','u','c','n','_');\r\n\r\n $name = str_replace($orig, $dest, $name);\r\n\r\n $name = strtolower($name);\r\n /*eliminar qualsevol caracter no alfanumeric punt o subrallat*/\r\n $name = preg_replace('#[^[:alnum:]._-]#', '', $name);\r\n return $name;\r\n}", "public static function formatFriendlyName( $name )\n {\n // if there's an underscore in the name, assume it's in physical name\n if( preg_match( '@_@', $name ) )\n {\n $physicalWords = explode( '_', strtolower($name) );\n return ucwords( implode( ' ', $physicalWords ) );\n }\n \n // if there's a space in the name, assume it's already in friendly format\n if( preg_match( '@ @', $name ) )\n {\n return $name;\n }\n \n // otherwise, assume it's in logical format\n $logicalWords = preg_split( '@([[:upper:]][[:lower:]]+)@', $name, null,\n PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY ); // identify Word as delimiter, capture words\n return ucwords( strtolower( implode( ' ', $logicalWords ) ) );\n }", "public function site_name($tag)\n\t{\n\t\treturn $this->CI->mojomotor_parser->site->site_name($tag);\n\t}", "function mb_normalise($string)\n{\n $string = html_entity_decode(\n preg_replace(\n '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i',\n '$1',\n htmlentities($string)\n ),\n ENT_QUOTES,\n 'UTF-8'\n );\n return preg_replace('/[^A-z0-9]/', '_', mb_strtolower($string));\n}" ]
[ "0.7384978", "0.71194977", "0.689103", "0.6835322", "0.65384024", "0.65279305", "0.6445475", "0.63721716", "0.63603824", "0.63602597", "0.6315328", "0.6309616", "0.6304217", "0.6304213", "0.62464756", "0.62402844", "0.62333465", "0.62332577", "0.6211902", "0.61440504", "0.61394316", "0.6114254", "0.61070234", "0.61007446", "0.60602105", "0.6053252", "0.604391", "0.60313994", "0.6003663", "0.59888715", "0.5986315", "0.59658426", "0.5962993", "0.5920669", "0.59190077", "0.5911452", "0.5883323", "0.5863435", "0.5861487", "0.5856516", "0.58538646", "0.5829713", "0.5828397", "0.5767287", "0.5765468", "0.57542855", "0.5746322", "0.5744961", "0.57425207", "0.5727273", "0.572544", "0.57181", "0.57176", "0.5717302", "0.5703014", "0.5678935", "0.567572", "0.5668269", "0.5664714", "0.5653962", "0.56402034", "0.56370044", "0.5634142", "0.5634142", "0.56245035", "0.562182", "0.562182", "0.562182", "0.5617933", "0.5607014", "0.5602719", "0.5589838", "0.55875915", "0.5584625", "0.5568118", "0.5559484", "0.5544284", "0.5538791", "0.5535835", "0.55125654", "0.5497795", "0.54944384", "0.54928887", "0.5484953", "0.5484206", "0.5480272", "0.5474152", "0.5473734", "0.546842", "0.54653496", "0.5444867", "0.5434254", "0.54323083", "0.5429194", "0.5428365", "0.5425877", "0.54235786", "0.53944063", "0.53924614", "0.5392009" ]
0.7860452
0
Pushes $this to ContextFactoryStack.
Пушит $this в ContextFactoryStack.
public function enterContext() { ContextFactoryStack::getInstance()->push($this); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function pushContext($context)\n {\n // Ensure we have an array\n if ($context==null || !is_array($context)) $context = array();\n\n // Note: when a context is pushed, it overload the existing one\n // we have to retrieve the current one and overload with new one\n $newContext = $this->getContext();\n foreach($context as $key => $val)\n {\n $newContext[$key] = $val;\n }\n\n // Push context and update current context variable\n $this->contextStack[] = $newContext;\n $this->currentContext = $this->getContext();\n\n $this->logger->logVerbose('Pushed context: ' . print_r($this->currentContext, true));\n }", "public function pushScope()\n {\n $newLocalIndex = count($this->itemStack ?? []) - 1;\n\n $this->popIndex = $this->itemStack[$newLocalIndex][SSViewer_Scope::POP_INDEX] = $this->localIndex;\n $this->localIndex = $newLocalIndex;\n\n // $Up now becomes the parent scope - the parent of the current <% loop %> or <% with %>\n $this->upIndex = $this->itemStack[$newLocalIndex][SSViewer_Scope::UP_INDEX] = $this->popIndex;\n\n // We normally keep any previous itemIterator around, so local $Up calls reference the right element. But\n // once we enter a new global scope, we need to make sure we use a new one\n $this->itemIterator = $this->itemStack[$newLocalIndex][SSViewer_Scope::ITEM_ITERATOR] = null;\n\n return $this;\n }", "public function context() {\n\t\tContext::set();\n\t\treturn $this;\n\t}", "function stackPush()\n {\n if ('T_COLOR_DEFAULT' == $this->token() && !$this->thereIsAColorTagOpen()) {\n return;\n }\n\n $this->debug('pushing to stack ' . $this->token());\n switch ($this->token()) {\n case 'T_ITALICS_START':\n $this->converted_html .= '<i>';\n break;\n case 'T_UNDERLINE_START':\n $this->converted_html .= '<u>';\n break;\n case 'T_BOLD_START':\n $this->converted_html .= '<b>';\n break;\n case 'T_COLOR':\n $color = $this->colorHexForToken($this->matchedToken['match']);\n $this->converted_html .= \"<span style=\\\"color:#$color\\\">\";\n break;\n }\n array_push($this->stack, $this->token());\n $this->debug('Currently the stack is: ' . implode($this->stack, ', '));\n }", "private function popContext()\n {\n if (count($this->contextStack) > 0)\n {\n // Pop context and update current context variable\n array_pop($this->contextStack);\n $this->currentContext = $this->getContext();\n\n $this->logger->logVerbose('Popped context: ' . print_r($this->currentContext, true));\n }\n else\n {\n $this->logger->logError('Unexpected POP context as contextStack is empty!');\n }\n }", "public function createContext()\n {\n return new FactoryContext($this);\n }", "public function __invoke() {\n return $this->stack;\n }", "public function switchContext() {\n\t\tif ( $this->timezone ) {\n\t\t\t//Date::setDefaultTimezone( $this->timezone );\n\t\t}\n\n\t\tLocale::clearDefault();\n\t\tif ( $this->defaultLocale ) {\n\t\t\tLocale::setDefault( $this->defaultLocale );\n\t\t}\n\n\t\tLoggerFactory::clearLoggers();\n\t\tforeach( $this->loggers as $logger ) {\n\t\t\tif ( strtoupper( $logger->getName() ) == 'DEFAULT' ) {\n\t\t\t\tLoggerFactory::setDefault( $logger );\n\t\t\t} else {\n\t\t\t\tLoggerFactory::addLogger( $logger );\n\t\t\t}\n\t\t}\n\t\tFactory::clear();\n\t\tforeach( $this->factories as $f ) {\n\t\t\tFactory::register( $f );\n\t\t}\n\n\t\tConnectionFactory::clearConnections();\n\t\tforeach( $this->connections as $conn ) {\n\t\t\tif ( $conn->getName() == 'DEFAULT' ) {\n\t\t\t\tConnectionFactory::setDefault( $conn );\n\t\t\t} else {\n\t\t\t\tConnectionFactory::addConnection( $conn );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->handler !== null ) {\n\t\t\tSession::setHandler( $this->handler );\n\t\t}\n\n\t\t$this->loadSessionValues();\n\n\t\treturn $this;\n\t}", "public function makeCurrentContext()\n\t{\t\n\t\tif (static::$currentContext !== $this) \n\t\t{\n\t\t\t$this->needsWindowContext();\n\n\t\t\tglfwMakeContextCurrent($this->context); \n\t\t\tstatic::$currentContext = $this;\n\t\t}\n\t}", "public function create_context() {\n $this->generate_security_array();\n $this->generate_routing_arrays();\n $this->generate_service_proxies();\n $path = join(PATH_SEPARATOR, $this->inc_path);\n\n $this->context .= <<< HEADER\nset_include_path(get_include_path() . PATH_SEPARATOR . \"$path\");\nclass Context {\n private \\$objects = array();\n \n public function Context() {\n global \\$DB;\n \\$this->objects[\"DB\"] = \\$DB;\n }\n\n public function get(\\$id) {\n if (isset(\\$this->objects[\\$id])) {\n return \\$this->objects[\\$id];\n }\n\nHEADER;\n\n $this->add_classes_to_context($this->repositories);\n $this->add_classes_to_context($this->controllers);\n $this->add_services_to_context();\n\n $this->context .= <<< FOOTER\n return \\$this->objects[\\$id];\n } // close get method\n} // close Context class\nFOOTER;\n\n return $this;\n }", "public function __construct() {\n $this->stack = array();\n }", "public function attention(): self\n {\n self::$stacking[] = $this;\n\n return $this;\n }", "function __construct() {\n $this->stack = [];\n }", "public function anaContext()\n {\n if ($this->prev->isNewline()) {\n $this->setContext('scalar');\n } else {\n $this->setContext($this->getPrevSiblingUpTree()->context);\n }\n }", "protected function stack()\n {\n if (!isset($this->stack[$this->parser->tagName])) {\n $this->stack[$this->parser->tagName] = array();\n }\n array_push($this->stack[$this->parser->tagName], $this->parser->tagAttributes);\n }", "public function push() {\n $this->shell('git push');\n return $this;\n }", "public function refresh(){\r\n\t\t$this->doSetContext($this->getContext());\r\n\t}", "protected function factoryStack()\n {\n return factory(Stack::class)->create();\n }", "public function store()\n { \n $this->collector::perform('storeBatch', $this->bag);\n\n $this->logger->info($this->log::DONE, ['in' => __METHOD__ .':'.__LINE__]);\n\n return $this;\n }", "public static function addToContext()\n\t{\n\t\tforeach (func_get_args() as $name)\n\t\t{\n\t\t\tself::getInstance()->context[] = $name;\n\t\t}\n\t}", "public function pop() {\n $this->id = array_pop($this->id_stack);\n $this->cur_context = array_pop($this->data_stack);\n $this->cur_context_xml = '';\n }", "function register(){\n\t\techo \" >> registered\";\n\t\treturn $this;\n\t}", "public function push( $stack )\n {\n if ( $this->stack ) {\n return $this->stack->push( $stack );\n }\n $this->stack = Stack::makeStack( $stack );\n return $this->stack;\n }", "public function evaluate($stack)\n {\n $stack[] = $this;\n\n return $stack;\n }", "public function get_context()\n\t{\n\t\t$container = $this->container();\n\t\t\n\t\treturn $container ? $container : $this;\n\t}", "public function push()\n {\n }", "private function pushState($state, $result = '')\n {\n $context = new stdClass();\n $context->state = $state;\n $context->buffer = '';\n $context->result = $result;\n $context->nextKey = null;\n $context->expectedSize = null;\n $context->definition = null;\n\n $this->stack->push($context);\n\n if (is_object($result)) {\n $this->references->pushBack($result);\n }\n\n $this->currentContext = $context;\n }", "public static function forgetPushed()\n {\n /** @var \\Illuminate\\Events\\Dispatcher $instance */\n $instance->forgetPushed();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "public function formSubmitAddContext(array $form, FormStateInterface $form_state) {\n $context = $form_state->get('context');\n\n $values = $form_state->getValue(['context', '_add_new']);\n\n $new_context = ContextDefinition::createFromArray($values);\n $context[$values['key']] = $new_context;\n $this->entity->addContextDefinition($values['key'], $new_context);\n\n $form_state->set('context', $context);\n $form_state->setRebuild(TRUE);\n\n $this->tempstoreRepository->set($this->entity);\n\n $user_input = &$form_state->getUserInput();\n unset($user_input['context']['_add_new']);\n }", "public function pushEnv() {\n\t\tarray_push($this->envStack, array('workDir' => getcwd(), 'BE_USER' => $GLOBALS['BE_USER'], 'TCA' => $GLOBALS['TCA']));\n\t}", "function add_to_context( $context ) {\n\t\t$context['menu'] = new TimberMenu();\n\t\t$context['site'] = $this;\n\t\treturn $context;\n\t}", "function push() {\n return $this->op('$push', func_get_args());\n }", "private function popState()\n {\n $this->stack->pop();\n $this->currentContext = $this->stack->next();\n\n }", "public static function flushStacks()\n {\n /** @var \\Illuminate\\View\\Factory $instance */\n $instance->flushStacks();\n }", "public function startChain(){\n\t\treturn $this;\n\t}", "public function startChain(){\n\t\treturn $this;\n\t}", "final private function transferContext(array $parentContext){\n$this->context+=$parentContext;\n}", "function push()\n {\n if ($this->branch) {\n $this->adapter->exec('push', 'origin', $this->branch);\n } else {\n $this->adapter->exec('push');\n }\n }", "function _setCurrentContext(Context $context) {\n\t\t//removeAllRolesForContext should always be called when exiting the context,\n\t\t//so it should be safe to only set the context the first time addRole() is called\n\t\t//from within a context (rather than every time addRole() is called)\n\t\tif (empty($this->currentContext)) {\n\t\t\t$this->currentContext = $context;\n\t\t\t$this->currentContextClassName = get_class($context);\n\t\t}\n\t}", "public function Left(){\n $this->context->setContext($this->context->getc3());\n $this->context->setc2($this->context->getc1());\n $this->context->setc3($this->context->getc2());\n $this->context->setc1($this->context->getc3());\n\n $this->context->Mash();\n}", "public function incStackPointer() {}", "public function incStackPointer() {}", "public function stkpush()\n {\n $this -> responseCode = $this -> response -> ResponseCode;\n $this -> responseDescription = $this -> response -> ResponseDescription;\n $this -> merchantRequestID = $this -> response -> MerchantRequestID;\n $this -> checkoutRequestID = $this -> response -> CheckoutRequestID;\n $this -> resultCode = $this -> response -> ResultCode;\n $this -> resultDesc = $this -> response -> ResultDesc;\n }", "public function preDispatch()\n {\n $this->getLayout()->setArea($this->_currentArea);\n\n parent::preDispatch();\n return $this;\n }", "public function push()\n {\n $this->handler->push($this->toArray());\n }", "public function rest(): self\n {\n array_pop(self::$stacking);\n\n return $this;\n }", "private function add_services_to_context() {\n foreach ($this->services as $class => $info) {\n $injects = $info['props'];\n $this->context .= <<< IF_START\n if (\\$id === \"$class\") {\n \\$proxy = new Proxy{$class}();\n \\$this->objects[\"$class\"] = \\$proxy;\n \\$actual = new $class();\n\nIF_START;\n foreach ($injects as $prop => $id) {\n $this->context .=\n \" \\$actual->$prop = \"\n . \"\\$this->get(\\\"$id\\\");\\n\";\n }\n $this->context .= \" \\$proxy->actual = \\$actual;\";\n $this->context .= \" }\\n\"; // close if statement\n }\n }", "public function startChain()\n\t{\n\t\treturn $this;\n\t}", "public function startChain()\n\t{\n\t\treturn $this;\n\t}", "public function startChain()\n\t{\n\t\treturn $this;\n\t}", "public function createContext();", "protected function establishContext() { }", "public function preDispatch()\n {\n parent::preDispatch();\n\n return $this;\n }", "protected function getContext() {}", "public function push () {}", "public function push($object) {\r\n if (count($this->stack) == 0) {\r\n $this->root = $object;\r\n }\r\n $this->stack[] = $object;\r\n }", "public function addContext($name, ConfigInterface $config)\n {\n $process = $this->contexts[self::PROCESS_CONTEXT];\n unset($this->contexts[self::PROCESS_CONTEXT]);\n $this->contexts[$name] = $config;\n $this->contexts[self::PROCESS_CONTEXT] = $process;\n\n return $this;\n }", "public function locally()\n {\n list(\n $this->item,\n $this->itemIterator,\n $this->itemIteratorTotal,\n $this->popIndex,\n $this->upIndex,\n $this->currentIndex\n ) = $this->itemStack[$this->localIndex];\n\n // Remember any un-completed (resetLocalScope hasn't been called) lookup chain. Even if there isn't an\n // un-completed chain we need to store an empty item, as resetLocalScope doesn't know the difference later\n $this->localStack[] = array_splice($this->itemStack, $this->localIndex + 1);\n\n return $this;\n }", "public static function stagCurrentContext($stagName)\n\t{\n\t\tself::getInstance()->staggedContext[$stagName] = self::getInstance()->context;\n\t}", "public function postDispatch()\n {\n parent::postDispatch();\n\n return $this;\n }", "public function lPushx()\n {\n }", "public static function setContext()\n\t{\n\t\tself::getInstance()->context = array();\n\t\tforeach (func_get_args() as $name)\n\t\t{\n\t\t\tself::getInstance()->context[] = $name;\n\t\t}\n\t}", "public function push($data, $id='') {\n $this->data_stack[] = $this->cur_context;\n $this->id_stack[] = $this->id;\n $this->id = $id;\n $this->cur_context = $data;\n $this->cur_context_xml = '';\n\n if ($id) {\n /* if (@is_array($this->data_sources[$id]) && is_array($data)) {\n $data = array_merge($this->data_sources[$id], $data);\n }\n */\n $this->data_sources[$id] = $data;\n }\n }", "protected function finalise() : self\n {\n // Bind self to container.\n self::$container->addRule('*', array('substitutions' => array(self::class => $this, \\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\App_Config::class => self::$app_config)));\n /** @hook{string, App_Config, Loader, DI_Container} */\n do_action(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_PRE_BOOT, self::$app_config, $this->loader, self::$container);\n // phpcs:disable WordPress.NamingConventions.ValidHookName.*\n // Initialise on init\n add_action('init', function () {\n do_action(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_PRE_REGISTRATION, self::$app_config, $this->loader, self::$container);\n $this->registration->process();\n do_action(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_POST_REGISTRATION, self::$app_config, $this->loader, self::$container);\n $this->loader->register_hooks();\n }, 1);\n return $this;\n }", "public function getContext()\n {\n }", "public function current()\n {\n $newContextData = clone $this->data;\n $newContextData['env'] = array(\n 'name' => $this->currentEnvName(),\n 'host' => current($this->hosts)\n );\n\n $newContext = new static($newContextData, $this->idx);\n\n return $newContext;\n }", "private function shippingContextModel()\n {\n\n }", "public function push() : void;", "public function push(){\n \n }", "public function push($value)\n {\n $this->stack[] = $value;\n }", "public abstract function getContext();", "public function getContext() {}", "public function getContext() { }", "function __construct() {\n $stackList=[];\n }", "public function setContext(Context\\ContextInterface $context);", "private function handle_request_stack() {\t\n\t\t$this->handle_request_stack_push();\n\t\t$this->handle_request_stack__pop();\n\t\treturn;\n\t}", "public function context();", "protected function addTableStackToCurrentPlayer(): GameService\n {\n $this->getCurrentPlayer()->addStackToStack($this->getTableStack());\n // Clear the table stack\n $this->clearTableStack();\n return $this;\n }", "public function commit()\n {\n // Nothing to do\n return $this;\n }", "public function fillContextBackreferences()\n {\n parent::fillContextBackreferences();\n }", "public function push();", "public function push();", "function __construct() {\n\t\t$this->reset();\n\t\treturn $this;\n\t}", "public function setContext($value)\n {\n $this->_context = $value;\n return $this;\n }", "public function rewind()\n {\n $this->_oCurrent = $this->_oRoot;\n array_push($this->_aStack, $this->_oRoot);\n }", "function push($e)\r\n {\r\n return $this->add($e);\r\n }", "function pushCondition($condition) {\n $this->condition = $this->condition_stack[] = $condition;\n }", "public function set_context( $context ) {\n\t\t$this->context = $context;\n\t\treturn $this;\n\t}", "private function handle_request_stack_push(){\n\t\t\n\t//\t$request_trigger: $_REQUEST parameters that trigger the building of a return-button:\n\t\t$request_trigger = ['calculation', 'article', 'result'];\n\t\t\n\t//\t$trigger: name of paramters that triggered the building of a return-button:\n\t\t$trigger \t= false;\n\t\t$i\t\t\t= 0;\n\t\t$nb \t\t= count($request_trigger);\n\t\tdo {\n\t\t\t$trigger = $request_trigger[$i];\n\t\t\t$i++;\n\t\t} while (!array_key_exists($trigger, $_REQUEST) && $i < $nb );\n\t\n\t//\tReturn empty html in case none of the triggers is in $_REQUEST:\n\t\tif ( !array_key_exists($trigger, $_REQUEST)) { return;}\n\t\t\n\t//\tIf trigger = \"result\"\n\t\tif ($trigger == 'result'){\n\t\t\t$url = array_key_exists('id', $_REQUEST)? HOME.URL.'?id='.$_REQUEST['id']: HOME.URL;\n\t\t\t$id = (int)$_REQUEST[$trigger];\n\t\t\t$href = HOME_.'sleutels/calculaties/result?id='.$id;\n\t\t\t//\tAdd positon parameter 'pos' to href:\n\t\t\t\tif ($pos >0 ) { $href .= '&pos='.$pos;}\n\t\t\t//\tPush to stack:\n\t\t\t\t$this->stack_push($href);\n\t\t\t\t\n\t\t\t//\tRe-direct:\n\t\t\t\theader('Location: '.$url);\n\t\t\t\texit;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t//\tModel instance for getting href:\n\t\trequire_once MODELS.$trigger.'.php';\n\t\t$model_name = 'model'.ucfirst($trigger);\n\t\t$model \t\t= new $model_name();\n\t\t\n\t//\tGet $href from model:\n\t\t$id = (int)$_REQUEST[$trigger];\n\t\tunset($_REQUEST[$trigger]);\n\t\t$href = $model->get_ar_href($id);\n\t\t\n\t//\tGet pos:\n\t $pos = 0;\n\t\tif (array_key_exists('pos', $_REQUEST)) {\n\t\t\t$pos = (int)$_REQUEST['pos'];\n\t\t\tunset($_REQUEST['pos']);\n\t\t}\n\t\t\n\t//\tRe-build url with parameter 'id' in case was part of request: \n\t\t$url = array_key_exists('id', $_REQUEST)? HOME.URL.'?id='.$_REQUEST['id']: HOME.URL;\n\t\t\n\t\t\n\t//\tHref not found: re-direct without adding to stack:\n\t\tif ( !$href ) {\n\t\t\theader('Location: '.$url);\n\t\t\texit;\n\t\t}\n\t\t\n\t//\tAdd positon parameter 'pos' to href:\n\t\tif ($pos >0 ) {\n\t\t\t$href .= '&pos='.$pos;\n\t\t}\n\t\t\n\t//\tPush to stack:\t\n\t\t$this->stack_push($href);\n\t\t\n\t//\tRe-direct:\n\t\theader('Location: '.$url);\n\t\texit;\n\t\t\n\t}", "public function execute () {\n\n $this->pushStack($this->getLocalstorage(2));\n \n }", "public function push($value) {\n array_push($this->stack, $value);\n }", "function push($array) {\n\t\tif (!is_array($array))\n\t\t\treturn FALSE;\n\n\t\tarray_push($this->contexts, $array);\n\n\t\treturn TRUE;\n\t}", "public function __construct(RequestStack $request_stack, LoggerChannelFactoryInterface $loggerFactory) {\n$this->requestStack = $request_stack;\n$this->loggerFactory = $loggerFactory;\n}", "public function getContext();", "public function getContext();", "public function getContext();" ]
[ "0.54964864", "0.5491995", "0.537711", "0.5282771", "0.5262598", "0.5241258", "0.52020603", "0.51586974", "0.51560634", "0.5138438", "0.50917196", "0.5069967", "0.5050231", "0.49635103", "0.49321878", "0.49321637", "0.48981968", "0.48850346", "0.48739627", "0.48653832", "0.48536614", "0.48501903", "0.48415497", "0.481221", "0.4801698", "0.4800293", "0.47770783", "0.47679627", "0.47627178", "0.47627178", "0.47627178", "0.47627178", "0.47341248", "0.4676413", "0.46745446", "0.4669592", "0.4667266", "0.4664713", "0.4664339", "0.4664339", "0.46636048", "0.46376595", "0.46375826", "0.4619608", "0.46099272", "0.4608797", "0.46070656", "0.46038297", "0.4594154", "0.45915073", "0.4591243", "0.45872983", "0.45872983", "0.45872983", "0.45851424", "0.45774928", "0.45767924", "0.45706555", "0.4548525", "0.4548338", "0.45459437", "0.4526272", "0.45238414", "0.45146942", "0.44999838", "0.44885883", "0.44807324", "0.4475729", "0.44671422", "0.446132", "0.44428548", "0.44390443", "0.44281584", "0.4425658", "0.4424371", "0.44134542", "0.44114152", "0.44091576", "0.44086283", "0.44054765", "0.440364", "0.4400711", "0.43970162", "0.43954659", "0.4394579", "0.4394579", "0.43938133", "0.43932948", "0.43856013", "0.43742624", "0.43735468", "0.43574494", "0.4355802", "0.43526375", "0.4344604", "0.43434405", "0.43383327", "0.43374714", "0.43374714", "0.43374714" ]
0.757171
0
Gets the component associated with this component data
Получает компонент, связанный с этими данными компонента
public function getComponent() { return $this->component; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComponent()\n {\n return $this->component;\n }", "public function getComponent()\n {\n return $this->component;\n }", "public function getComponent()\n {\n return $this->component;\n }", "public function getComponent()\n {\n return $this->hasOne(AwpbComponent::className(), ['id' => 'component_id']);\n }", "public function getComponent()\n {\n return $this->hasOne(AwpbComponent::className(), ['id' => 'component_id']);\n }", "public static function component()\n {\n $name = static::getName();\n return self::$components[$name] ??\n self::$components[$name] = self::$app->container()[$name];\n }", "function getTargetComponent () {\r\n\t\t\treturn $this->_target_comp;\r\n\t\t}", "function getSourceComponent () {\r\n\t\t\treturn $this->_source_comp;\t\t\t\r\n\t\t}", "public function getComponentid()\n {\n return $this->componentid;\n }", "public function component()\n {\n return $this->belongsTo('App\\Models\\Component');\n }", "function getCellComponent() {\n\t\treturn $this->display->getDisplayComponent();\n\t}", "public function getComponent()\n {\n $callingClass = get_called_class();\n return $callingClass::EXPORTER_COMPONENT_TYPE;\n }", "public function component()\n {\n return $this->belongsTo(Component::class);\n }", "function getFirstComponent() {\n\t\treturn $this->first;\n\t}", "public function getComponentNum()\n {\n return $this->getProperty('compNum');\n }", "public function get($component){\n return $this->userInfoArray[$component];\n }", "public function getData(): ?FrameComponent\n {\n return $this->data;\n }", "public function getData(): ?FrameComponent\n {\n return $this->data;\n }", "public function getComponent( $key )\n\t{\n\t\tif( !isset( $this->_components[ $key ] ) )\n\t\t{\n\t\t\t$config = $this->getConfig();\n\t\t\t$config = ( isset( $config[ $key ] ) ) ? $config[ $key ] : array();\n\t\t\t$this->_components[ $key ] = new $key();\n\t\t\t$this->_components[ $key ]->init( $config );\n\t\t}\n\t\treturn $this->_components[ $key ];\n\t}", "public function get()\n {\n return $this->_composition;\n }", "public function getComponentName() {\n\t\treturn $this->dataQuery->getQueryParam('Component.Name');\n\t}", "function component($name) {\n\t\t$this->addComponent($name);\n\t\tif (isset($this->components[$name])) {\n\t\t\treturn $this->components[$name];\n\t\t} else {\n\t\t\ttrigger_error(\"Component $name does not exist\");\n\t\t}\n\t}", "public function retrieve()\n {\n return $this->components;\n }", "public function getComponentName(){\n\t\tif($this->iterator!=null){\n\t\t\treturn $this->iterator->key();\n\t\t}\n\t\treturn null;\n\t}", "private function getValueForComponent()\n {\n if ($value = $this->Value()) {\n if ($this->idOnlyMode) {\n return $value;\n }\n\n return json_decode($value, true);\n }\n\n return null;\n }", "protected function &_ar_get_component($component)\n\t{\n\t\t$Aruna =& get_instance();\n\t\treturn $Aruna->$component;\n\t}", "function getRowComponent() {\n\t\treturn $this->display;\n\t}", "public function componentName() {\n\t\treturn $this->config['name'];\n\t}", "public function loadComponent()\r\n {\r\n return $this->selectVersion($this->currentVersion);\r\n }", "public function getSystemComponent() {\n return $this->systemComponent;\n }", "function getHeaderComponent() {\n\t\treturn $this->header;\n\t}", "public function loadComponent()\n {\n return $this->selectVersion($this->getCurrentVersion());\n }", "public function getComponentPage()\n {\n return $this->_componentPage;\n }", "public function getComponent( $ID = null )\n {\n // If the ID is null, return the entire array\n if( $ID === null )\n return $this->components;\n \n // Check to make sure there is a component with that ID, and return it\n if( isset($this->components[$ID]) )\n return $this->components[$ID];\n \n // Otherwise return null\n return null;\n }", "abstract public function getSharedComponent();", "protected function &get_component($component)\n\t{\n\t\t$Aruna =& get_instance();\n\n\t\treturn $Aruna->$component;\n\t}", "protected function &_ci_get_component($component)\n\t{\n\t\t$CI =& get_instance();\n\t\treturn $CI->$component;\n\t}", "public function get_component ( $component ) {\n\t\t$headers = array(\n\t\t\t'title' => 'Module Name',\n\t\t\t'short_description' => 'Module Description', \n\t\t\t'version' => 'Module Version', \n\t\t\t'sort' => 'Sort Order', \n\t\t\t'settings' => 'Module Settings',\n\t\t\t'deps' => 'Dependencies'\n\t\t);\n\t\t$mod = get_file_data( $component, $headers );\n\t\tif ( empty( $mod['sort'] ) )\n\t\t\t$mod['sort'] = 10;\n\t\tif ( ! empty( $mod['title'] ) ) {\n\t\t\t$obj = new StdClass();\n\t\t\t\n\t\t\tforeach ( $mod as $k => $v ) {\n\t\t\t\t$obj->$k = $v;\n\t\t\t}\n\n\t\t\tif ( ! isset( $obj->product_id ) ) {\n\t\t\t\t$obj->product_id = 0;\n\t\t\t}\n\n\t\t\treturn $obj;\n\t\t}\n\t\treturn false;\n\t}", "function sa_hc_get_component($id = null){\n\n\t$file = \"components.xml\";\n\t$path = GSDATAOTHERPATH;\n\t$data = getXML($path . $file);\n\t\n\tif(!$id){\n\t\treturn $data; // return all components\n\t}\n\t\n\t# _debugLog($data);\n\t\n\t$component = $data->xpath('item/title[.=\"'.$id.'\"]/parent::*'); // return the componenet requested\t\n\tif(!isset($component)) return null;\n\treturn $component;\n}", "public function getComponents()\n {\n return $this->components;\n }", "public function getComponents()\n {\n return $this->components;\n }", "public function getComponents()\n {\n return $this->components;\n }", "function get_component($id){\n\tglobal $components;\n\tif(array_key_exists($id,$components)){\n\t\treturn $components[$id];\n\t}else{\n\t\treturn;\n\t}\n}", "public function getComponent(string $name): ?Component\n {\n return $this->View->getComponent($name);\n }", "public function getComponentIdField()\n {\n $callingClass = get_called_class();\n return $callingClass::EXPORTER_COMPONENT_ID_FIELD;\n }", "public function getTag()\n {\n return 'component';\n }", "public function __get($name)\n\t{\n\t\treturn $this->component($name);\n\t}", "public function __get($name)\n\t{\n\t\treturn $this->component->$name;\n\t}", "public function __get($identifier)\n {\n if (isset($this->components[$identifier])) {\n return $this->components[$identifier];\n }\n }", "public function component()\n {\n return 'cashier-tool';\n }", "public function getCompte()\n {\n return $this->compte;\n }", "public function get_content_com() {\n return $this->_com_data;\n }", "public function extension()\n {\n return $this->hasOne(Component::class, 'id', 'component_id');\n }", "public function getCompte()\n {\n return $this->Compte;\n }", "public function getFileComponent()\n {\n return $this->file;\n }", "public function parent()\n {\n if ($this->parent_id !== null) return ComponentType::find($this->parent_id);\n return null;\n }", "public function getComponentByName($name);", "public function getDataObject()\n {\n return $this->getElement()->getForm()->getDataObject();\n }", "public function getData() {\n if (!$this->componentRow) {\n return parent::getData();\n }\n\n if (!$this->dataNeedsProcessing) {\n return $this->data;\n }\n\n $this->data = $this->componentRow->getData();\n\n $this->dataNeedsProcessing = false;\n\n return $this->data;\n }", "public function getComponent($name)\n {\n if (empty($name)) {\n return null;\n }\n $componentRepo = $this->cx->getDb()->getEntityManager()->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');\n $component = $componentRepo->findOneBy(array('name' => $name));\n if (!$component) {\n return null;\n }\n return $component->getSystemComponentController();\n }", "protected function getDataElement() {\n return $this->_dataElement;\n }", "function sp_get_bp_current_component(){\n global $bp;\n return $bp->current_component;\n}", "public function get() {\n\t\treturn $this->instance;\n\t}", "public function get() {\n return $this->instance;\n }", "abstract public function getComponente();", "public function component($component)\n {\n return $this->option('component', $component);\n }", "public function getValue()\n {\n return $this->data;\n }", "public function get()\n {\n $container = isset($this->container) ? $this->container : Yii::$container;\n $value = $container->get($this->class, $this->params, $this->config);\n return Instance::ensureAny($value, $this->ensureTypes, $container);\n }", "public function getComponentCode();", "protected function getDataObject()\n {\n return Injector::inst()->get($this->getList()->dataClass());\n }", "public function getUser()\n\t{\n\t\treturn $this->getComponent('user');\n\t}", "public function componentName();", "public function getComposite()\n {\n return $this->_composite;\n }", "public function getData()\n {\n return $this->container;\n }", "public function componentDetails() {\n return [\n 'name' => 'Daftar Wisuda Component',\n 'description' => 'Manage Pendaftaran Mahasiswa Wisuda'\n ];\n }", "public function get($component)\n {\n return isset($this->changelog[$component])\n ? $this->changelog[$component]\n : null;\n }", "public function getIndex ()\n {\n if (!isset($this->parent))\n throw new ComponentException($this, \"The component is not attached to a parent.\");\n if (!$this->parent->children)\n throw new ComponentException($this, \"The parent component has no children.\");\n\n return array_search ($this, $this->parent->children, true);\n }", "protected function getComponent($name)\n {\n $formatter = $this->cache->get('formatter');\n\n if (!$formatter) {\n $this->cacheFormatter();\n\n $formatter = $this->cache->get('formatter');\n }\n\n return $formatter[$name];\n }", "public function getItem() {\n return $this->getParentBlock()->getData('item');\n }", "public function getCategory()\n {\n return $this->getProductData()->Category->Name->{'@attributes'}->Value;\n }", "public function component() {\n return 'pos-config';\n }", "public function getComponents();", "public function getComponents();", "public function get()\n {\n return $this->grid;\n }", "public function getRedComponent() {\n\t\treturn $this->r;\n\t}", "public function lookup($component) {\n $component = strtolower($component);\n $key = $this->componentKey($component);\n\n if (!array_key_exists($key, $this->components)) {\n $this->loadComponent($component);\n }\n\n if (isset($this->components[$key])) {\n return $this->components[$key];\n } else {\n // Mark a tombstone to the component array so it doesn't keep getting loaded.\n $this->components[$key] = null;\n return null;\n }\n }", "function get_component_by_key( $key )\n\t{\n\t\t$this->component = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'com_section=\"'.$key.'\"' ) );\n\t}", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function getMainControl(Component $component);", "public function getValue() \n { \n return $this->_data; \n }", "public function getWorker() {\n return $this->getComponent(\"worker\");\n }", "public function current()\n {\n return $this->data[0];\n }", "public function current()\n {\n return $this->__get(key($this->hData));\n }", "public function get () {\n return $this->data ;\n }", "public function getComponents(): array\n {\n return $this->components;\n }", "public function get_course() {\n return $this->_course;\n }", "public function getProduct()\n {\n if (!($this->getData('product') instanceof Mage_Catalog_Model_Product)) {\n $this->setData('product', Mage::registry('product'));\n }\n return $this->getData('product');\n }", "public function get_current_complex_content_object_item()\n {\n return $this->get_current_node()->get_complex_content_object_item();\n }", "public function getCom()\n {\n return $this->com;\n }" ]
[ "0.80899376", "0.80899376", "0.80899376", "0.7406386", "0.7406386", "0.7029321", "0.6825534", "0.6747541", "0.6737628", "0.6612515", "0.6556265", "0.6553449", "0.65169156", "0.6440119", "0.6368159", "0.6363563", "0.63355786", "0.63355786", "0.63312584", "0.63285947", "0.6327975", "0.6297814", "0.6288753", "0.62774545", "0.6273561", "0.62646943", "0.62387705", "0.6192442", "0.6163779", "0.61635464", "0.6161215", "0.6143368", "0.61423326", "0.610878", "0.6079187", "0.6057853", "0.5974523", "0.59315956", "0.5887335", "0.5884784", "0.5884784", "0.5884784", "0.5862973", "0.5849639", "0.5842468", "0.5812722", "0.5790679", "0.5778002", "0.5744799", "0.5743841", "0.57402635", "0.5739513", "0.5727868", "0.57233876", "0.5719762", "0.57149905", "0.5681779", "0.5643266", "0.5640639", "0.5600307", "0.5597358", "0.5586313", "0.5535282", "0.55204666", "0.55005944", "0.5479668", "0.54729366", "0.54566383", "0.544334", "0.5436352", "0.5432641", "0.54282975", "0.5410986", "0.5405396", "0.5391785", "0.5383868", "0.53791744", "0.5367943", "0.5366289", "0.53541535", "0.5343886", "0.53407174", "0.53407174", "0.5338088", "0.533349", "0.5323963", "0.53224015", "0.5307817", "0.53016794", "0.53005695", "0.5299431", "0.5298711", "0.5297728", "0.52894086", "0.5269913", "0.52691704", "0.526806", "0.52639055", "0.52598095" ]
0.8168449
0
Gets if the component is peer
Проверяет, является ли компонент пировым
public function isPeer(): bool { return $this->is_peer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasPeerAuth()\n {\n return $this->peer_auth !== null;\n }", "public function connected()\r\n {\r\n return !is_null($this->link);\r\n }", "public function getBubble(): bool\n {\n return $this->bubble;\n }", "public function isConnected() {\n return $this->remote !== null;\n }", "function isConnectable()\n\t{\n\t\treturn $this->connectable;\n\t}", "public function isExternal()\r\n {\r\n return $this->communicator->isIsExternal();\r\n }", "public function hasSink(){\n return $this->_has(2);\n }", "public function hasSink(){\n return $this->_has(2);\n }", "public function isConnected(){ return $this->hasField('connected'); }", "public function getPeerCert(): string|false\n {\n }", "public function getPeeringState()\n {\n return $this->peering_state;\n }", "public function isConnected()\n\t{\n\t return (bool) $this->getDocument();\n\t}", "public function isSelfConnected(): bool;", "protected function isAttached()\n {\n return is_resource($this->stream);\n }", "public function owner(){\n\t\treturn $this->is_owner!==0;\n\t}", "public function is_active_network() {\n\t\t\treturn is_plugin_active_for_network( $this->plugin );\n\t\t}", "private final function isTunnel() {\n\t\t\treturn $this->isTunnel;\n\t\t}", "public function has_parent() {\n if ($this->child_of > 0) {\n if ($this->get_parent() instanceof private_party_group) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new ItineraryPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}", "function IsPartnered( $chan ) {\n \n $data = $this->get( 'channels/' . $chan );\n if( isset( $data['error'] ) ) {\n return NULL;\n } else {\n return $data['partner'];\n }\n\n }", "function isEdge()\n\t{\n\t\treturn $this->edge;\n\t}", "public function getIsActive()\n {\n return $this->_socket !== null;\n }", "public static function isConnecte()\n\t{\n\t\treturn self::$_isConnecte;\n\t}", "public function isAttachedToPattern()\n {\n return $this->attach === self::ATTACH_TO_PATTERN;\n }", "public function getIsOpaque() /*: bool*/ {\n if ($this->isOpaque === null) {\n return false;\n }\n return $this->isOpaque;\n }", "public function isExternal(): bool\n {\n return $this->external;\n }", "function isconnected() {\n\t\treturn $this->mConnected;\n\t}", "public function getPeer()\n {\n if (self::$peer === null) {\n self::$peer = new comlabPeer();\n }\n\n return self::$peer;\n }", "public function is_connected()\n\t{\n\t\treturn $this->connected;\n\t}", "public function isConnected()\r\n {\n \treturn $this->_connected;\n }", "public function hasParent()\n {\n return $this->origin !== null && $this->origin !== 0;\n }", "function isConnected() \r\n\t{\r\n return $this->connected;\r\n }", "public function getPeer()\n {\n if (self::$peer === null) {\n self::$peer = new PessoaPeer();\n }\n\n return self::$peer;\n }", "public function isRemote()\n {\n return $this->alias_record->isRemote();\n }", "public function hasComponent();", "public function hasSender(): bool\n {\n return ! is_null($this->from) &&\n $this->from instanceof Sender;\n }", "private function is_connected() {\n\t\t$option = get_option( 'jetpack_mailchimp' );\n\t\tif ( ! $option ) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = json_decode( $option, true );\n\t\tif ( ! $data ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isset( $data['follower_list_id'], $data['keyring_id'] );\n\t}", "function isLink() {\n\t\treturn $this->_getDriver()->isLink();\n\t}", "public function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new UserPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}", "public function hasPrevious()\n {\n return ($this->previous instanceof ChainLink);\n }", "public function socketRequested()\n { \n $queryParams = $this->getParameters('query');\n return isset($queryParams['socketModule']);\n }", "function isConnected() {\n\t\treturn $this->connected;\n\t}", "public function isFirstFromChatWidget()\n {\n return Arr::get($this->referral, 'source') === 'CUSTOMER_CHAT_PLUGIN';\n }", "function isConnected()\n {\n return isset($this->conecxion);\n }", "public function hasReceivers(): bool;", "public function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new VideoAssetPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}", "public static function isRemote()\n {\n return self::$type == 'remote';\n }", "public function hasOwner()\n {\n return !is_null($this->getOwner());\n }", "public function hasOwner() {\n return isset($this->_owner);\n }", "public function isConnected()\r\n {\r\n return !is_null($this->socket);\r\n }", "public function isConnected()\n\t{\n\t\treturn ( ($this->mConnection !== NULL)\n\t\t\t && ($this->mConnection !== TRUE) );\t\t\t\t\t\t\t\t\t// ==>\n\t\n\t}", "function is_network_only_plugin($plugin)\n{\n}", "public function isConnected()\n\t\t{\n\t\t\treturn $this->connected;\n\t\t}", "public function isConnected()\n {\n return (bool)$this->_connected;\n }", "abstract public function isConnected();", "abstract public function isConnected();", "function is_destination_detached( $object_id, $object_type ) {\n\t$class = get_syncable_class( $object_type );\n\n\tif ( empty( $class ) ) {\n\t\treturn false;\n\t}\n\n\treturn $class::destination_is_detached( $object_id );\n}", "public function isConnected() {\n \n \n try {\n $this->getBlockChainSdkObj()->getChainStatus();\n return true;\n \n } catch (Exception $e){\n return false;\n\n }\n }", "public function isExternal() {\n\t\treturn (bool)$this->is_external;\n\t}", "public function getPeer()\n {\n if (self::$peer === null)\n {\n self::$peer = new CommentArchivePeer();\n }\n return self::$peer;\n }", "public function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new SubjectPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function hasConnections(): bool;", "public function hasParent(): bool\n\t{\n\t\treturn (bool) $this->parent;\n\t}", "public function hasAttachedData(): bool;", "private function getOtherPeer() {\n global $db;\n $sql = $this->sqlHeader . \"WHERE caqc_flags & 8 AND \" . $this->whereClause;\n $result = $db->getRow($sql);\n return $result['COUNT(*)'];\n }", "public function isConnected() {\n return $this->handshakeComplite;\n }", "public function isConnected() {}", "public function isConnected() {}", "public function hasParent()\n {\n return (bool) $this->parent;\n }", "function isConnected()\n {\n return $this->connected;\n }", "public function getPeer()\n {\n if (self::$peer === null) {\n self::$peer = new ClientePeer();\n }\n\n return self::$peer;\n }", "public function isConnected ();", "public function isExternal() {\n return $this->is_external;\n }", "public function isBubbleOnFetch()\n {\n return $this->bubbleOnFetch;\n }", "public function getFollow(): bool\n {\n return $this->bFollow;\n }", "public function isConnected(): bool\n {\n return $this->remote->isConnected();\n }", "public function isConnected()\r\n {\r\n return $this->connected;\r\n }", "public function IsConnected() {\n\t\treturn $this->connected;\n\t}", "abstract function isConnected();", "abstract function isConnected();", "public function isConnected() {\n\t\treturn $this->connected;\n\t}", "public function hasNext()\n {\n return ($this->next instanceof ChainLink);\n }", "public function isAMessage()\n {\n\t\tif (empty($this->parent))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n }", "public function isConnected()\n {\n return $this->connected;\n }", "public function isConnected()\n {\n return $this->connected;\n }", "public function hasParent() {\n\t\treturn !is_null($this->getParent());\n\t}", "public function hasTransport ( ) {\n\n return null !== $this->getTransport();\n }", "public function canSendPrivateMessage()\n {\n return $this->strInterface;\n }", "public function is_downloaded_component ( $component, $type ) {\n\t\t$is_downloaded = false;\n\n\t\tif ( $type == 'downloadable' && file_exists( $this->config->downloads_path . $this->components[$type][$component]->filepath ) ) {\n\t\t\t$is_downloaded = true;\n\t\t}\n\t\t\n\t\tif ( $type == 'standalone' && file_exists( trailingslashit( WP_PLUGIN_DIR ). $this->components[$type][$component]->filepath ) ) {\n\t\t\t$is_downloaded = true;\n\t\t}\n\t\t\n\t\treturn $is_downloaded;\n\t}", "public function hasSinkName(){\n return $this->_has(1);\n }", "public function hasSinkName(){\n return $this->_has(1);\n }", "public function hasSinkName(){\n return $this->_has(1);\n }", "public function isRemote() {\n return $this->isRemote;\n }", "public function getTransferable()\n {\n return isset($this->transferable) ? $this->transferable : false;\n }", "public function haveParent()\n {\n return !empty($this->parent);\n }", "public function isConnected(){\r\n return $this->connected;\r\n }", "public function isUseSecondaryConnection() {\n $retVal = false;\n if ($this->def->getService() !== null\n && is_object($this->def->getService())\n && $this->def->getService()->isUseSecondary() == true) {\n $retVal = true;\n }\n\n return $retVal;\n }" ]
[ "0.6452158", "0.5995989", "0.59714276", "0.593523", "0.5853567", "0.5829269", "0.5760369", "0.5760369", "0.56463206", "0.5643544", "0.55989337", "0.5585106", "0.5551485", "0.55335784", "0.5530723", "0.5525789", "0.5513408", "0.55128866", "0.551046", "0.55054283", "0.5503528", "0.5502164", "0.54765445", "0.54640156", "0.5456733", "0.5454549", "0.54390144", "0.54389006", "0.5435535", "0.54226655", "0.5417505", "0.5399023", "0.5396558", "0.53895116", "0.53838134", "0.53827155", "0.53821373", "0.5374644", "0.53712785", "0.53573227", "0.53524697", "0.53477955", "0.5341443", "0.5339472", "0.53359723", "0.53265584", "0.5326186", "0.53228474", "0.53197354", "0.5303129", "0.53024113", "0.53020537", "0.52934283", "0.5286388", "0.5282592", "0.5282592", "0.52823025", "0.52821803", "0.5275892", "0.5273403", "0.5270694", "0.5265595", "0.5265595", "0.5265595", "0.52650326", "0.5261332", "0.5260875", "0.5258302", "0.52579576", "0.5255965", "0.5255965", "0.5253391", "0.52505124", "0.5249953", "0.5234695", "0.5233866", "0.5233582", "0.5228147", "0.5227067", "0.5226096", "0.52219445", "0.52202076", "0.52202076", "0.52175134", "0.52168393", "0.52097666", "0.51930845", "0.51930845", "0.5192211", "0.51905525", "0.51883036", "0.5183989", "0.5179024", "0.5179024", "0.5179024", "0.51765627", "0.5174557", "0.51735646", "0.5172298", "0.51708657" ]
0.7648421
0
Gets the TaGradedGradeable that owns this graded component
Получает TaGradedGradeable, которому принадлежит этот оцененный компонент
public function getTaGradedGradeable() { return $this->ta_graded_gradeable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function grade()\n {\n return Grade::where('assignment_id', $this->attributes['assignment_id'])->first();\n }", "public function getGrade()\n {\n return $this->hasOne(Grade::className(), ['id' => 'grade_id']);\n }", "public function get_grade() {\n global $DB;\n\n return $DB->get_field('gradingform_sfrbric_grades', 'grade', array('instanceid' => $this->get_id()));\n }", "public function getGrade()\n {\n return $this->_itemGrade;\n }", "public function getGrade()\n {\n return $this->grade;\n }", "public function achievement()\n\t{\n\t\treturn $this->belongs_to('Achievement');\n\t}", "public function getGradedComponent(User $grader = null) {\n return $this->getOrCreateGradedComponent($grader, false);\n }", "public function grade()\n {\n return $this->hasOne(Grade::class, 'id', 'grade_id');\n }", "public function grade()\n {\n return $this->hasOne('App\\Grade');\n }", "public function getGrade()\n {\n if (array_key_exists(\"grade\", $this->_propDict)) {\n return $this->_propDict[\"grade\"];\n } else {\n return null;\n }\n }", "public function getGrade() {\n if(property_exists($this->data, 'grade')) return $this->data->grade;\n $this->fenixEdu->login();\n foreach($this->fenixEdu->getPersonCourses($this->academicTermYear($this->data->academicTerm))->enrolments as $course) {\n if(strcmp($course->id, $this->data->id) == 0) {\n $this->data->grade = $course->grade;\n return $this->data->grade;\n }\n }\n foreach($this->fenixEdu->getPersonCurriculum() as $curriculum) {\n foreach ($curriculum->approvedCourses as $course) {\n if(!property_exists($course, 'id')) continue;\n if(strcmp($course->id, $this->data->id) == 0) {\n $this->data->grade = $course->grade;\n return $this->data->grade;\n }\n }\n }\n return NULL;\n }", "public function grade()\n {\n return $this->belongsTo('App\\Models\\Grade');\n }", "public function getGrader() {\n return $this->grader;\n }", "public function grade()\n {\n //return $this->hasOne(Grade::class);\n return $this->belongsTo(Grade::class);\n }", "public function grade() {\n return $this->hasMany(Grade::class);\n }", "public function getGrade()\n {\n $this->_initGroups();\n foreach ($this->groups as $group) {\n if ($group[\"maxPoints\"] == 0) {\n $this->_calculatePoints();\n break;\n }\n }\n\n return $this->_getGrade();\n }", "public function getGraders() {\n $graders = [];\n /** @var GradedComponent $graded_component */\n foreach ($this->graded_components as $graded_component) {\n $grader = $graded_component->getGrader();\n $graders[$grader->getId()] = $grader;\n }\n return $graders;\n }", "public function achievement()\n {\n return $this->belongsTo('App\\Models\\Achievement');\n }", "public function getGothraTable() {\r\n if (!$this->_gothraTable) {\r\n $sm = $this->getServiceLocator();\r\n $this->_gothraTable = $sm->get('Application\\Model\\GothraTable');\r\n }\r\n return $this->_gothraTable;\r\n }", "public function getGrade($grade=null)\n {\n if ($grade != null && is_array($this->statuts) && count($this->statuts)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE grade = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$grade]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId($d['id']);\n$this->setGrade($d['grade']);\n$this->statuts =$data; \n return $this;\n }\n \n } else {\n return $this->grade;\n }\n \n }", "public function getAssetGlAcc()\n {\n return $this->hasOne(GlAccount::className(), ['account_id' => 'asset_gl_acc_id']);\n }", "public function grades()\n {\n return $this->belongsTo('App\\Models\\Grade','grade_id');\n }", "public function getTalent() {\n return $this->talent;\n }", "public function getGradedGradeable(TaGradedGradeable $ta_graded_gradeable, User $grader, $all_peers = false) {\n $grading_done_by = ($all_peers ? null : $grader);\n $response_data = $ta_graded_gradeable->toArray($grading_done_by);\n $response_data_with_peer = $ta_graded_gradeable->toArray();\n $graded_gradeable = $ta_graded_gradeable->getGradedGradeable();\n $gradeable = $graded_gradeable->getGradeable();\n $submitter = $graded_gradeable->getSubmitter()->getId();\n $combined_score = 0;\n foreach ($response_data_with_peer['peer_scores'] as $score) {\n $combined_score += $score;\n }\n //remove non peer component scores from combined score to get the combined peer score\n $combined_peer_score = $combined_score - $ta_graded_gradeable->getTotalTaScore($this->core->getUser());\n\n // If there is autograding, also send that information TODO: this should be restricted to non-peer\n if (count($gradeable->getAutogradingConfig()->getPersonalizedTestcases($submitter)) > 1) {\n // NOTE/REDESIGN FIXME: We might have autograding that is\n // penalty only. The available positive autograding\n // points might be zero. Testing for autograding > 1 is\n // ignoring the submission limit test case... but this is\n // also imperfect. We want to render the column if any\n // student has received the penalty. But if no one has\n // received the penalty maybe we omit it? (expensive?/confusing?)\n // See also note in ElectronicGraderView.php\n // if ($gradeable->getAutogradingConfig()->anyPoints()) {\n $response_data['auto_grading_total'] = $gradeable->getAutogradingConfig()->getTotalNonExtraCredit();\n\n // Furthermore, if the user has a grade, send that information\n if ($graded_gradeable->getAutoGradedGradeable()->hasActiveVersion()) {\n $response_data['auto_grading_earned'] = $graded_gradeable->getAutoGradedGradeable()->getActiveVersionInstance()->getTotalPoints();\n }\n }\n //send ta score information\n $response_data['ta_grading_total'] = $gradeable->getTaPoints();\n if ($gradeable->hasPeerComponent()) {\n $response_data['ta_grading_earned'] = $ta_graded_gradeable->getTotalTaScore($this->core->getUser());\n $response_data['see_peer_grade'] = $ta_graded_gradeable->getTotalPeerScore($grading_done_by);\n $response_data['peer_grade_earned'] = $ta_graded_gradeable->getTotalScore($this->core->getUser());\n $response_data['peer_total'] = $gradeable->getPeerPoints();\n $response_data['user_group'] = $this->core->getUser()->getGroup();\n $response_data['peer_gradeable'] = true;\n $response_data['combined_peer_score'] = $combined_peer_score;\n }\n else {\n $response_data['ta_grading_earned'] = $ta_graded_gradeable->getTotalScore(null);\n $response_data['user_group'] = $this->core->getUser()->getGroup();\n $response_data['peer_gradeable'] = false;\n }\n\n $response_data['anon_id'] = $graded_gradeable->getSubmitter()->getAnonId($gradeable->getId());\n\n $response_data['itempool_items'] = [];\n $components = $gradeable->getComponents();\n $submitter_itempool_map = $this->getItempoolMapForSubmitter($gradeable, $submitter);\n foreach ($components as $key => $value) {\n $response_data['itempool_items'][$value->getId()] = $value->getItempool() === '' ? '' : $submitter_itempool_map[$value->getItempool()];\n }\n\n return $response_data;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('ProfileGradebookItem');\n }", "public function getTableau()\n {\n return $this->tableau;\n }", "public function grade($gradingStrategy) {\n $class = get_class($gradingStrategy);\n $grade = $gradingStrategy->grade( $this->getExams() );\n $this->setGrade($grade);\n \n echo \"[ STUDENT ]--> grade with '$class': $grade\\n\";\n return $grade;\n }", "private function amIBlindGrading($gradeable, $user, $peer) {\n if ($peer && $gradeable->getPeerBlind() === Gradeable::DOUBLE_BLIND_GRADING) {\n return \"double\";\n }\n\n if (($peer && $gradeable->getPeerBlind() === Gradeable::SINGLE_BLIND_GRADING) || ($gradeable->getLimitedAccessBlind() === Gradeable::SINGLE_BLIND_GRADING && $this->core->getUser()->getGroup() === User::GROUP_LIMITED_ACCESS_GRADER)) {\n return \"single\";\n }\n\n return \"unblind\";\n }", "public function getPercentGraded() {\n $required_graders = $this->component->getGradingSet();\n $graders = count($this->graded_components);\n return Utils::safeCalcPercent($graders, $required_graders, false);\n }", "public function get_grad_student(): ?GradStudent { return $this->grad_student; }", "private function _getGrade()\n {\n $grade = 0;\n $totalWeight = 0;\n foreach ($this->groups as $group => $unused) {\n $groupInfo = $this->_getGroupInfo($group);\n if ($groupInfo[\"graded\"]) {\n $grade += $groupInfo[\"weightedGrade\"];\n $totalWeight += $groupInfo[\"weight\"];\n }\n }\n if (count($this->groups) == 0 || $totalWeight == 0) {\n return 100;\n }\n return $grade / $totalWeight;\n }", "public function Grade(){\n return $this->belongsTo('App\\Models\\Grade', 'teachID','teachID');\n }", "public function grades()\n {\n return $this->hasMany('App\\Grade');\n }", "public function grades()\n {\n return $this->hasMany(Grade::class);\n }", "public function getTierItem()\n {\n return $this->getItem()->getTierItem();\n }", "public function getTpAvancementALaLigne() {\n return $this->tpAvancementALaLigne;\n }", "public function getAsset(): Asset {\n return $this->asset;\n }", "public function getPassable(): Passable\n {\n return $this->getEvent()->passable;\n }", "public function getAchieve()\n {\n return $this->Achieve;\n }", "public function grades_link() {\n\t\tglobal $USER, $CFG;\n\t\t$context = $this->page->context;\n\n\t\t$coursecontext = $context->get_course_context();\n\n\t\t$categoryid = null;\n\n\t\tif ($coursecontext) { \n\t\t\t$courseid = $coursecontext->instanceid;\n\t\t}\n\t\t$userid = $USER->id;\n\n\t\t$link = \"$CFG->wwwroot/course/user.php?mode=grade&id=$courseid&user=$userid\";\n\n\t\treturn $link;\n\n\t}", "public function getActiveIngredient()\n {\n return $this->activeIngredient;\n }", "private function createMockGradedGradeable($gradeable, int $highest_version = 0) {\n $graded_gradeable = new GradedGradeable(\n $this->core,\n $gradeable,\n new Submitter($this->core, $this->core->getUser()),\n []\n );\n\n $auto_graded_gradeable = new AutoGradedGradeable(\n $this->core,\n $graded_gradeable,\n [\n 'active_version' => 0\n ]\n );\n\n $auto_graded_version = new AutoGradedVersion(\n $this->core,\n $graded_gradeable,\n [\n 'version' => $highest_version,\n 'non_hidden_non_extra_credit' => 0,\n 'non_hidden_extra_credit' => 0,\n 'hidden_non_extra_credit' => 0,\n 'hidden_extra_credit' => 0,\n 'submission_time' => '9999-01-01 01:01:01',\n 'autograding_complete' => true\n ]\n );\n $auto_graded_gradeable->setAutoGradedVersions([$auto_graded_version]);\n $graded_gradeable->setAutoGradedGradeable($auto_graded_gradeable);\n return $graded_gradeable;\n }", "public function get_grader() {\n global $CFG;\n $grader = $this->grader == null ? constants::DEFAULT_GRADER : $this->grader;\n if ($grader === 'CombinatorTemplateGrader') { // Legacy grader type.\n $grader = 'TemplateGrader';\n assert($this->iscombinatortemplate);\n }\n $graders = qtype_coderunner_grader::available_graders();\n $graderclass = $graders[$grader];\n\n $graderinstance = new $graderclass();\n return $graderinstance;\n }", "public function get_parent()\n {\n $this->loadBed();\n return $this->_bed;\n }", "public function getInstructor()\n {\n return $this->instructor;\n }", "public function getLegenda()\n {\n return $this->legenda;\n }", "public function getGradeListAttribute(){\n return $this->grades->lists('id');\n }", "public function getSkill() {\n return $this->skill;\n }", "public function getGradeLetters()\n {\n $mdl_context = $this->getContext();\n return $this->app->getGradeLetters($mdl_context);\n }", "public function grades(){\n return $this->hasMany('App\\Grade');\n }", "public function getScore() {\n return $this->component->isPeerComponent() ? 0.0 : $this->getGradedComponent()->getScore();\n }", "public function get_grade($id = NULL) {\r\n \r\n // Initialize where clause\r\n $where = array();\r\n \r\n // Create where clause if id is set.\r\n if($id != NULL) {\r\n $where = array(\r\n array('field' => 'gradeid', 'value' => $id)\r\n );\r\n }\r\n \r\n // Call get_data from utl_model\r\n return $this->util_model->get_data(\r\n 'grades', \r\n array('*'),\r\n $where\r\n );\r\n \r\n }", "public function getGreen()\n {\n return $this->g;\n }", "public function grades() {\n return $this->belongsToMany('Grade');\n }", "public function getWeapon() {\n return $this->weapon;\n }", "public function getOrCreateGradedComponent(User $grader = null, $generate = false) {\n $grades_exist = $this->anyGradedComponents();\n if ($grader === null) {\n // If the grader is null and its a peer component, we can't do anything useful\n if ($this->component->isPeerComponent()) {\n throw new \\InvalidArgumentException('Cannot get peer graded component with null grader');\n }\n\n // Grades exist, not a peer component, so grab the first grade\n if ($grades_exist) {\n return $this->graded_components[0];\n }\n\n // If no grader is provided we can't generate a graded component\n if ($generate) {\n throw new \\InvalidArgumentException('Cannot generate graded component with null grader');\n }\n\n // No grades exist, not trying to generate, not peer, no grader, so can't do anything\n return null;\n }\n\n //\n // Grader not null\n //\n\n if ($this->component->isPeerComponent()) {\n // Try to find existing graded component for this component and user...\n foreach ($this->graded_components as $graded_component) {\n if ($graded_component->getGrader()->getId() === $grader->getId()) {\n // ... Found one\n return $graded_component;\n }\n }\n\n // None found, but generate one (append to array)\n if ($generate) {\n return $this->graded_components[] =\n new GradedComponent($this->core, $this->ta_graded_gradeable, $this->component, $grader, []);\n }\n\n // None found. Don't generate one\n return null;\n }\n\n //\n // Not peer component\n //\n\n // Grades exist for component, so get the only one\n if ($grades_exist) {\n return $this->graded_components[0];\n }\n\n // Grades don't exist, but generate one (at zero index of array)\n if ($generate) {\n return $this->graded_components[0] =\n new GradedComponent($this->core, $this->ta_graded_gradeable, $this->component, $grader, []);\n }\n\n // Grades don't exist. Don't generate one\n return null;\n }", "public function getAsserter() {\n return $this->asserter;\n }", "protected function getIntance()\n {\n if(self::$gpAsset===null)\n {\n self::$gpAsset = new self();\n }\n return self::$gpAsset;\n }", "public function getTargetOg()\n {\n return $this->targetOg;\n }", "public function getAtk() {\n return $this->atk; \n }", "public function getSkill()\n {\n return $this->skill;\n }", "public function getChildGtin()\n {\n\n return $this->child_gtin;\n }", "public function activitable() {\n\n return $this->morphTo();\n }", "public function getGuiObject(){\n return get_object_vars($this); \n }", "public function getAActiveClass()\n {\n return $this->aActiveClass;\n }", "public function getFinalGradeAttribute() {\n $grade = ($this->pace_grade * 0.9) + ($this->conventional_grade * 0.1);\n return number_format($grade, 2);\n }", "public function getGroupGraded($group)\n {\n $groupInfo = $this->_getGroupInfo($group);\n return $groupInfo[\"graded\"];\n }", "public function getComponent() {\n return $this->component;\n }", "public function getComponent() {\n return $this->component;\n }", "public function getCptAssurance() {\n return $this->cptAssurance;\n }", "public function getAsset()\r\n {\r\n return $this->asset;\r\n }", "public function getAGLSIdentifier()\n {\n return $this->owner->MetaAbsoluteLink;\n }", "public function student() {\n return $this->belongsTo(\n Student::class,\n 'grade_students',\n 'student_id',\n 'grade_id',\n );\n }", "public function getGround($axe) {\n return $this->{'_ground_' . $axe};\n }", "public function getGradedVersion() {\n $version = false;\n /** @var GradedComponent $graded_component */\n foreach ($this->graded_components as $graded_component) {\n $v = $graded_component->getGradedVersion();\n if ($version === false) {\n $version = $v;\n continue;\n }\n if ($v !== $version) {\n return false;\n }\n }\n return $version;\n }", "public function getGrade(): ?string {\n $val = $this->getBackingStore()->get('grade');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'grade'\");\n }", "public function walletable()\n {\n return $this->morphTo();\n }", "protected function _getMe() {\r\n\t\tif (empty($this -> _row)) {\r\n\t\t\tJTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_tienda' . DS . 'tables');\r\n\t\t\t$table = JTable::getInstance('Shipping', 'TiendaTable');\r\n\t\t\t$table -> load(array('element' => $this -> _element, 'folder' => 'tienda'));\r\n\t\t\t$this -> _row = $table;\r\n\t\t}\r\n\t\treturn $this -> _row;\r\n\t}", "public function GetJournal() {\n\t\t\treturn OrdemProducaoGrade::GetJournalForId($this->intId);\n\t\t}", "public function globalGetGradeLevel(){\n\n\t\t//get the username\n\t\t$userid = $this->input->post(\"UserId\");\n\n\t\t//call the model function for deactivating the game table\n\t\t$result = $this->md->model_get_gradelevel_by_userid($userid);\n\n\t\t//echo the user account id\n\t\techo $result[0][\"GradeLevel\"];\n\n\t}", "public function getStockAux()\n {\n return $this->aAuxStock;\n }", "public function path()\n {\n return \"grades/{$this->id}\";\n }", "public function getLotteryDraw()\n {\n return $this->lotteryDraw;\n }", "public function getProduitAchete()\n\t {\n\t return $this->produitAchete;\n\t }", "public function object()\n\t{\n\t\treturn $this->getOverride();\n\t}", "public function get_instructor_stimulus() {\n return $this->instructor_stimulus;\n }", "public function get_instructor_stimulus() {\n return $this->instructor_stimulus;\n }", "public function get_instructor_stimulus() {\n return $this->instructor_stimulus;\n }", "public function getActiveGambits()\n {\n return $this->activeGambits;\n }", "public function getGoal()\n {\n return $this->goal;\n }", "public function getGoal()\n {\n return $this->goal;\n }", "public function getBonus()\n {\n return $this->_bonus;\n }", "final public function getThis(): object\n {\n return $this->instance;\n }", "function getStrengthGoals()\n {\n return $this->strengthGoals;\n }", "public function progress()\n {\n return $this->hasMany('Gstt\\Achievements\\Model\\AchievementProgress', 'achievement_id');\n }", "public function getTieneAgua()\n {\n return $this->tiene_agua;\n }", "public function getAssociatedSource()\n {\n return $this->associated_source;\n }", "public function getAssociatedSource()\n {\n return $this->associated_source;\n }", "final public function getRefObject()\n {\n return $this->refObject;\n }" ]
[ "0.62144494", "0.6208461", "0.612655", "0.6106888", "0.6084767", "0.5997825", "0.5950962", "0.5895107", "0.56990016", "0.56618726", "0.554716", "0.5541323", "0.54935294", "0.53352714", "0.53308517", "0.530498", "0.5272299", "0.5247586", "0.524267", "0.5188777", "0.5154941", "0.5032764", "0.4991301", "0.4977595", "0.49551874", "0.49460423", "0.4923731", "0.4912612", "0.48915887", "0.4883898", "0.48828322", "0.482014", "0.4799743", "0.47835132", "0.47820297", "0.4777681", "0.47758877", "0.47731128", "0.47497976", "0.47483966", "0.47445396", "0.47432095", "0.4737435", "0.47313386", "0.4715734", "0.4705101", "0.4700022", "0.46928075", "0.4691761", "0.46773246", "0.46675915", "0.46667936", "0.46530956", "0.46522647", "0.46428335", "0.46409112", "0.46404755", "0.46316698", "0.4631456", "0.46299088", "0.46285254", "0.46179008", "0.46137717", "0.4608367", "0.460746", "0.46035737", "0.4592499", "0.45892674", "0.45892674", "0.45837095", "0.45829812", "0.45797867", "0.45767546", "0.4571946", "0.45694342", "0.45680827", "0.45653084", "0.45616752", "0.4560147", "0.45586574", "0.4553004", "0.4552498", "0.45501235", "0.45457172", "0.45454273", "0.454074", "0.454074", "0.454074", "0.45389146", "0.45328805", "0.45328805", "0.45315576", "0.4530384", "0.45290527", "0.45258066", "0.45210525", "0.45210436", "0.45210436", "0.45156994" ]
0.7788696
0
Gets if this component grade is attached to a AutoGradedVersion
Проверяет, прикреплен ли этот компонент оценки к AutoGradedVersion
public function hasGradedVersion() { return $this->graded_version !== -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGradedVersion() {\n $version = false;\n /** @var GradedComponent $graded_component */\n foreach ($this->graded_components as $graded_component) {\n $v = $graded_component->getGradedVersion();\n if ($version === false) {\n $version = $v;\n continue;\n }\n if ($v !== $version) {\n return false;\n }\n }\n return $version;\n }", "public function isComplete() {\n if ($this->component->isPeerComponent()) {\n if (count($this->graded_components) > 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n $required_graders = $this->component->getGradingSet();\n $graders = count($this->graded_components);\n if ($graders === $required_graders) {\n return true;\n }\n else {\n /** @var GradedComponent $graded_component */\n foreach ($this->graded_components as $graded_component) {\n // TODO: should this be full access?\n if ($graded_component->getGrader()->accessGrading()) {\n return true;\n }\n }\n }\n return false;\n }", "public function anyGradedComponents() {\n return count($this->graded_components) > 0;\n }", "public function hasVersion(){\n return $this->_has(2);\n }", "public function hasVersion(){\n return $this->_has(4);\n }", "public function onHasCompatibleAkeebaVersion(): bool\n\t{\n\t\t// Get the extension ID for com_akeeba\n\t\t$eid = $this->upgradeModel->getExtensionId('com_akeeba');\n\n\t\tif (empty($eid))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the cached manifest of the old component (com_akeeba)\n\t\t$db = $this->dbo;\n\t\t$query = $db->getQuery(true)\n\t\t ->select([\n\t\t\t $db->quoteName('manifest_cache'),\n\t\t ])\n\t\t ->from($db->quoteName('#__extensions'))\n\t\t ->where($db->quoteName('type') . ' = ' . $db->quote('component'))\n\t\t ->where($db->quoteName('element') . ' = ' . $db->quote('com_akeeba'));\n\n\t\ttry\n\t\t{\n\t\t\t$manifestCacheJson = $db->setQuery($query)->loadResult();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// JSON decode the manifest\n\t\t$manifest = @json_decode($manifestCacheJson, true);\n\n\t\tif (empty($manifest))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the creation date and version\n\t\t$creationDate = $manifest['creationDate'];\n\t\t$version = $manifest['version'];\n\n\t\t// If it's version 7.0.0 or later we're golden.\n\t\tif (version_compare($version, '7.0.0', 'ge'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$date = clone JoomlaFactory::getDate($creationDate);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we have a dev release it must be published after January 1st, 2020, i.e. the year must be 2020 or later.\n\t\tif ($date->year >= 2020)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// All checks failed. This is an old version.\n\t\treturn false;\n\t}", "public function hasVersion() {\n return $this->hasProperty(Array('ver', 'version'));\n }", "public function hasVersion() : bool\n {\n return isset($this->version);\n }", "public function getTaGradedGradeable() {\n return $this->ta_graded_gradeable;\n }", "public function getTaGradedGradeable() {\n return $this->ta_graded_gradeable;\n }", "static public function isVersioningEnabled()\n {\n return self::$isVersioningEnabled;\n }", "public function needsUpdate(){\n\n if (!$this->meta){\n return null;\n }\n\n return (version_compare($this->version, $this->getLatestVersion()) < 0);\n }", "public function hasVersion(): bool\n {\n return !empty($this->version);\n }", "public function needs_grading() {\n return ($this->timemodified > $this->timegraded);\n }", "function getExistsOnLive() {\n\t\treturn (bool) Versioned::get_versionnumber_by_stage(get_class($this->owner), 'Live', $this->owner->ID);\n\t}", "public function hasVersionsGatherer()\n {\n return $this->versions_gatherer !== null; # TODO: check it really exists\n }", "public static function isVersioned()\n {\n return in_array('Divergence\\\\Models\\\\Versioning', class_uses(get_called_class()));\n }", "function have_version() {\n\n\t\tif ( isset( $this->version ) AND ! empty( $this->version ) ) {\n\t\t\t$this->set( 'have_version', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_version', 0 );\n\t\t}\n\n\t\treturn $this->have_version;\n\n\t}", "public function getIsVendorAttribute() {\n return $this->vendor()->exists();\n }", "public static function existCurrentVersion(): bool\n {\n return self::getSQLCurrentVersion()->execute()->fetch()\n ? true : false;\n }", "public function hasVersions()\n {\n return !$this->versions->isEmpty();\n }", "public function getVersionA()\n\t{\n\t\treturn $this->versionA;\n\t}", "public static function getCurrentVersion()\n {\n $data = self::findByQueryBuilder(\n self::getSQLCurrentVersion()\n );\n\n return !empty($data) ? $data[0] : false;\n }", "public function hasEggIncubators()\n {\n return $this->egg_incubators !== null;\n }", "public function getIsActiveAttribute()\n {\n if ($this->dues->count() > 0) {\n $lastDuesTransaction = $this->dues->last();\n $pkgIsActive = $lastDuesTransaction->package->is_active;\n $hasPayment = ($lastDuesTransaction->payment()->exists());\n if ($hasPayment) {\n $paidTotal = ($lastDuesTransaction->payment->sum('amount') >= $lastDuesTransaction->getPayableAmount());\n\n return $paidTotal && $pkgIsActive;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function getIsCraftDbMigrationNeeded(): bool\n {\n if ($this->_isCraftDbMigrationNeeded === null) {\n $storedSchemaVersion = Craft::$app->getInfo()->schemaVersion;\n $this->_isCraftDbMigrationNeeded = version_compare(Craft::$app->schemaVersion, $storedSchemaVersion, '>');\n }\n\n return $this->_isCraftDbMigrationNeeded;\n }", "public function isVersionActivelyMaintained() {}", "public function is_proversion_active()\n\t\t{\n\t\t\treturn class_exists( 'SB_Instagram_Feed_Pro' );\n\t\t}", "public function isStable(): bool {\n\t\treturn $this->getPreReleaseType() === null && $this->getMajor() > 0;\n\t}", "public function isVersionable();", "public function is_legacy_ical_active() {\n\t\treturn class_exists( 'Tribe__Events__Ical_Importer__Main' );\n\t}", "private function gearsNewer()\n {\n $gearsInstalled = $this->getExtensionData('cwgears');\n $manifest = json_decode($gearsInstalled->manifest_cache);\n\n if ($manifest->version >= $this->gears_version) {\n return false;\n } else {\n return true;\n }\n }", "protected function usesAutoload()\n {\n return $this->hasAutoload($this->getInfo());\n }", "public function getAutoTaggingEnabled()\n {\n return isset($this->auto_tagging_enabled) ? $this->auto_tagging_enabled : false;\n }", "function have_existing_version() {\n\n\t\tif ( isset( $this->existing_version ) AND ! empty( $this->existing_version ) AND $this->existing_version > 0 ) {\n\t\t\t$this->set( 'have_existing_version', 1 );\n\t\t} else {\n\t\t\t$this->set( 'have_existing_version', 0 );\n\t\t}\n\n\t\treturn $this->have_existing_version;\n\n\t}", "public function hasAttachment () {\n\t\tif ( $this->getOwner()->getIsNewRecord() ) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * берем версию из базы, потому что новая при сохранении стирается\n\t\t */\n\t\treturn $this->getOwner()->findByPk($this->getOwner()->primaryKey)->{$this->attribute};\n\t}", "public function hasPaymentDetailsVersion()\n {\n return $this->_has(1);\n }", "public function isFullVersion(): bool\n {\n return !!$this->isFullVersion;\n }", "function abi_is_component() {\n\tglobal $bp;\n\tif ( bp_is_current_component( $bp->groups->slug ) && bp_is_current_action( 'blog' ) )\n\t\treturn true;\n\n\treturn false;\n}", "function exist() {\n\n return($this->getRelease() && !$this->getRelease()->isDeleted());\n\n }", "function isActive() \n {\n return ((int) $this->getValueByFieldName( 'viewer_isActive' ) == 1);\n }", "public function getVersionOnly() {\n if( $supporter = $this->getSupportInstance() ) {\n return $supporter->_getVersionOnly();\n }\n }", "public function hasComponent();", "public function getHasAddedAttribute()\n {\n if (Auth::guard('api')->check()) {\n $driver = Auth::guard('api')->user()->driver;\n if ($driver) {\n return $this->drivers->contains($driver->id);\n }\n }\n\n return false;\n }", "function is_upgrade_available() {\n\t\t\treturn count($this->available_upgrades()) > 0;\n\t\t}", "public function isInstalledVersionAReleasedVersion() {}", "public function hasConfigVersion(){\n return $this->_has(20);\n }", "public function hasBehaviour()\r\n {\r\n return isset($this->_behaviour) && count($this->_behaviour);\r\n }", "public function isAcrEssential()\n {\n return $this->acrEssential;\n }", "public function getIsActive()\n {\n return $this->_level > 0 && $this->db;\n }", "public function getIsAutoTracker() : bool\n {\n return $this->isAutoTracker;\n }", "public function is_jedi_version()\n {\n try\n {\n $l_dao = $this->get_connection();\n $l_result_set = $l_dao->query('SELECT * FROM installationinfo');\n $l_arr = $l_dao->fetch_row_assoc($l_result_set);\n if (isset($l_arr['edition']))\n {\n return (strtolower($l_arr['edition']) == 'essential') ? true : false;\n }\n else\n {\n // old version\n return false;\n } // if\n }\n catch (Exception $e)\n {\n return false;\n } // try\n }", "public function hasEggIncubatorId()\n {\n return $this->egg_incubator_id !== null;\n }", "function isReference()\n {\n return $this->hasProperty('references');\n }", "public function isVestaGuaranteeActive()\n {\n return $this->moduleManager->isEnabled('Vesta_Guarantee') &&\n $this->moduleManager->isOutputEnabled('Vesta_Guarantee');\n }", "public function is_auto_update() {\n\t\treturn (bool) $this->_auto_update;\n\t}", "public function issetProductVersion(): bool\n {\n return isset($this->productVersion);\n }", "private function canAutoRelease()\n {\n $now = new \\DateTime();\n $releaseMoment = $this->readAutoReleaseMoment();\n\n return $now > $releaseMoment;\n }", "public function has_upgrade ( $component, $type ) {\n\t\t$has_upgrade = false;\n\n\t\tif ( ( $this->components[$type][$component]->is_free == true ) || $this->is_purchased_component( $component, $type ) ) {\n\t\t\t$latest = $this->components[$type][$component]->version;\n\t\t\t$active = $this->get_component( $this->config->downloads_path . $this->components[$type][$component]->filepath )->version;\n\t\t}\n\n\t\tif ( version_compare( $active, $latest, '<' ) ) {\n\t\t\t$has_upgrade = $latest;\n\t\t}\n\n\t\treturn $has_upgrade;\n\t}", "public function isInstalled()\n {\n return !!$this->getInstalledVersion();\n }", "private function is_back_compat_key() {\n\t\treturn isset( $this->back_compat_keys[ $this->meta_key ] );\n\t}", "public function isActive()\n {\n return $this->getActivity() == 1;\n }", "public function isStable()\n {\n return is_numeric($this->patch);\n }", "public function isAttachedToProduct()\n {\n return $this->attach === self::ATTACH_TO_PRODUCT;\n }", "public function isUpdate()\n {\n return $this->version && !$this->version->isNewRecord;\n }", "public function acf_active() {\n\t\t$acf_plugins = [\n\t\t\t'advanced-custom-fields/acf.php',\n\t\t\t'advanced-custom-fields-pro/acf.php',\n\t\t];\n\n\t\treturn $this->any_plugin_active( $acf_plugins ) || function_exists( 'get_field' );\n\t}", "public function needUpgrade()\n {\n return $this->currentVersion() !== $this->userVersion();\n }", "public function hasUpdates()\n {\n /* @var Addon $addon */\n if (!$addon = dispatch_now(new GetAddon($this->getNamespace()))) {\n return false;\n }\n\n $composer = app('composer.json');\n\n if (!$constraint = array_get($composer['require'], $this->getName())) {\n return false;\n }\n\n if (!$installed = array_get($addon->getComposerLock(), 'version')) {\n return false;\n }\n\n $satisfied = Semver::satisfiedBy(\n $this->getVersions(),\n $constraint\n );\n\n $satisfied = array_filter(\n $satisfied,\n function ($version) use ($installed) {\n\n if (Comparator::equalTo($version, $installed)) {\n return null;\n }\n\n return Comparator::greaterThan($version, $installed) ? $version : null;\n }\n );\n\n return !empty($satisfied);\n }", "public function isCompatible()\n\t{\n\t\treturn $this->compatible;\n\t}", "public function isCompatible()\n\t{\n\t\treturn $this->compatible;\n\t}", "public function available(): bool\n {\n return $this->name;\n }", "public function getUseAutoload()\n\t{\n\t\treturn $this->useAutoload;\n\t}", "function cc_cafnr_is_component() {\n if ( bp_is_groups_component() && bp_is_current_action( cc_cafnr_get_slug() ) )\n return true;\n\n return false;\n}", "public function getExistsOnLive()\n {\n return (bool)Versioned::get_versionnumber_by_stage('ContentModule', 'Live', $this->ID);\n }", "public function access() {\n list($major, $minor, $fix) = $this->version;\n if ($major == '2')\n return true;\n else\n return false;\n }", "function isUpgrade() {\n\t\treturn true;\n\t}", "function isUpgrade() {\n\t\treturn true;\n\t}", "final protected function hasRevision() {\n return (bool)$this->revision;\n }", "public function getAolVersion() {}", "function available ()\n\t{\n\t\treturn function_exists('apc_fetch') === true && $this->checkIdentifier () === true ;\n\t}", "public static function need_update() {\n\n\t\t$current_version = self::get_version();\n\t\t\n\t\tif (!is_array(self::$versions)) {\n\t\t\tself::$versions = self::populate_version();\n\t\t}\n\t\t\n\t\t/* \n\t\t Go through the versions we have and see if\n\t\t we need to apply any updates\n\t\t*/\n\t\tforeach (self::$versions as $update) {\n\t\t\tif ($update['version'] > $current_version) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t} // end foreach version\n\n\t\treturn false;\n\n\t}", "protected function getWhetherRevisionableOwner()\n {\n return $this->getOwner() instanceof IRevisionable;\n }", "protected function get_component_db_version( $component ) {\n\n\t\t$wordpoints_data = wordpoints_get_maybe_network_option( 'wordpoints_data' );\n\n\t\treturn ( isset( $wordpoints_data['components'][ $component ]['version'] ) )\n\t\t\t? $wordpoints_data['components'][ $component ]['version']\n\t\t\t: '';\n\t}", "public function hasBadgesList()\n {\n return $this->badges !== null;\n }", "public function isAttached($appender) {\n\t\treturn isset($this->aai[$appender->getName()]);\n\t}", "public static function needs_update() {\n\t\t$needs_upgrade = self::compare_for_update(\n\t\t\tarray(\n\t\t\t\t'option' => 'frm_db_version',\n\t\t\t\t'new_db_version' => FrmAppHelper::$db_version,\n\t\t\t\t'new_plugin_version' => FrmAppHelper::plugin_version(),\n\t\t\t)\n\t\t);\n\n\t\tif ( ! $needs_upgrade ) {\n\t\t\t$needs_upgrade = apply_filters( 'frm_db_needs_upgrade', $needs_upgrade );\n\t\t}\n\n\t\treturn $needs_upgrade;\n\t}", "public function hasAgencyId()\n {\n return isset($this->agency_id);\n }", "public function UpdateIsAvaleiable( ) {\n\t\t\treturn version_compare( $this->localConfig->gamepanel_version, $this->szLatestVersion, \"<\" ) ? true : false;\n\t\t}", "public function has_attachment()\n {\n return (bool)$this->parts_count;\n }", "final public function is_vaa_enabled() {\r\n\t\treturn (bool) $this->vaa->is_enabled();\r\n\t}", "protected function useShopAssociation()\n {\n return version_compare(_PS_VERSION_, '1.5.0', 'ge');\n }", "function bulkmodifications_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n \n // Requires greater than 2011R3.1\n if (get_product_release() < 215) {\n return false;\n }\n\n return true;\n}", "public function getAvailability()\n {\n return $this->_availability;\n }", "public function isVersionedService()\n {\n if ($this->def->getService() === null || !$this->def->getService()->getVersioning()) {\n return false;\n }\n\n return (boolean) $this->def->getService()->getVersioning();\n }", "public function getStatus(): bool\n {\n foreach ($this->requestVersion() as $key => $version) {\n if ($key !== 'dev-master' && Comparator::greaterThan($version['version'],\n $this->currentVersion)) {\n return true;\n }\n }\n\n return false;\n }", "public function getForceActive(): bool\n {\n\t\treturn $this->forceActive;\n\t}", "function hgsg_component_checkversion()\n{\n\n if (!function_exists('get_product_release'))\n return false;\n //requires greater than 2009R1.2\n if (get_product_release() < 114)\n return false;\n\n return true;\n}", "public function onNeedsMigration(): bool\n\t{\n\t\t$cParams = ComponentHelper::getParams('com_akeebabackup');\n\t\t$alreadyMigrated = $cParams->get('migrated_from_pkg_akeeba', 0) == 1;\n\t\t$hasPkgAkeeba = !empty($this->upgradeModel->getExtensionId('com_akeeba'));\n\n\t\treturn $hasPkgAkeeba && !$alreadyMigrated;\n\t}", "public function isActive()\n {\n return $this->hasApi();\n }", "public function isEnabled()\n {\n return $this->getActive();\n }" ]
[ "0.7189566", "0.6314128", "0.62158984", "0.6100976", "0.6035056", "0.5995955", "0.5987742", "0.5947798", "0.5943939", "0.5943939", "0.59294987", "0.5882882", "0.58427525", "0.58131784", "0.58021355", "0.5745298", "0.5724583", "0.5722984", "0.5700532", "0.5677431", "0.5646063", "0.56151587", "0.56058574", "0.55918705", "0.55569303", "0.5541038", "0.55224067", "0.55078006", "0.55070335", "0.5490601", "0.54884666", "0.5469378", "0.5468506", "0.5442936", "0.5430433", "0.5420471", "0.54140145", "0.5400041", "0.53984755", "0.5382135", "0.5377649", "0.5377127", "0.5374059", "0.5370913", "0.5363262", "0.53629094", "0.53569853", "0.53474015", "0.534055", "0.53399104", "0.53223246", "0.5321449", "0.5320615", "0.5320074", "0.53125525", "0.530193", "0.5288995", "0.52747643", "0.5270056", "0.5269495", "0.5266082", "0.52582544", "0.52574205", "0.5248011", "0.5247113", "0.52273715", "0.5226684", "0.5218854", "0.52162", "0.52162", "0.5211735", "0.5211681", "0.5210281", "0.52060926", "0.52059007", "0.52058893", "0.52058893", "0.51976544", "0.5197416", "0.5195982", "0.5192721", "0.51885724", "0.5185947", "0.51839787", "0.51797396", "0.5173394", "0.5173119", "0.5171196", "0.5169248", "0.51689595", "0.5167355", "0.5162806", "0.51620984", "0.51598036", "0.5152964", "0.51470035", "0.51365674", "0.5133641", "0.51314026", "0.51271516" ]
0.7045761
1
Gets if the graded component has a custom mark
Проверяет, имеет ли компонент с оценкой пользовательскую отметку
public function hasCustomMark() { return $this->getComment() !== '' || $this->getScore() != 0.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isMarked() {\n\t\t$sessionVars = WCF::getSession()->getVars();\n\t\tif (isset($sessionVars['markedSmileys'])) {\n\t\t\tif (in_array($this->smileyID, $sessionVars['markedSmileys'])) return 1;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "private function hasLabelMarker()\n\t{\n\t\treturn strpos($this->string, self::LABEL_MARKER) !== false;\n\t}", "public function hasLandmarkAnnotations(){\n return $this->_has(2);\n }", "public function getMark()\n {\n return $this->mark;\n }", "public function getMark()\n {\n return $this->mark;\n }", "public function getMark()\n {\n $questions = 0;\n foreach ($this->getQuestions() as $question) {\n if ($question->question_type_id === \\app\\models\\QuestionType::TYPE_THREE_QUESTION) {\n $questions += 3;\n } else {\n $questions++;\n }\n }\n\n if ( $this->challenge->getQuestionsCount() > $questions ) {\n return false;\n }\n\n $percent = $this->getCorrectPercent();\n\n foreach ($this->marks as $range) {\n if ($percent >= $range['min'] && $percent <= $range['max']) {\n return $range['mark'];\n }\n }\n\n return false;\n }", "public function anyMarks() {\n return count($this->marks) !== 0;\n }", "public function isMarker() {\n\t\t$delimiter = ':';\n\t\t$segments = preg_split('/' . $delimiter . '/', $this->e2servicereference);\n\n\t\tif (!empty($segments) && isset($segments[1]) && $segments[1] == '64') {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getHighlight(): bool {}", "public function getHighlight(): bool {}", "public function isMarked() {\n $sessionVars = WCF::getSession()->getVars();\n if (isset($sessionVars['markedWarnings'])) {\n if (in_array($this->warningID, $sessionVars['markedWarnings']))\n return 1;\n }\n return 0;\n }", "public function isCustom() {\n\t\treturn ! $this->isBuiltin();\n\t}", "public function hasShape(){\n return $this->_has(12);\n }", "public function hasLandmarks(){\n return $this->_has(3);\n }", "function containsData() {\r\n if (!isset($this->data[\"Series\"])) { \r\n return false; \r\n }\r\n\r\n $result = false;\r\n foreach($this->data[\"Series\"] as $key => $value) { \r\n if ( $this->data[\"Abscissa\"] != $key && $this->data[\"Series\"][$key][\"isDrawable\"]==true) { \r\n $result = true; \r\n } \r\n }\r\n \r\n return $result;\r\n }", "public function hasLabelAnnotations(){\n return $this->_has(4);\n }", "public function hasFaceAnnotations(){\n return $this->_has(1);\n }", "public function hasPenis()\n {\n return false;\n }", "public function hasGiftpoint(){\n return $this->_has(1);\n }", "public function isGraphicContent()\n {\n return $this->getGraphicContent();\n }", "public function hasIcon(){\n return $this->_has(7);\n }", "public function hasCustomClass()\n {\n return $this->pThemeHasCustomClass;\n }", "public function hasCropHintsAnnotation(){\n return $this->_has(11);\n }", "public function isDecorated(): bool;", "public function getMarked()\n {\n return $this->marked;\n }", "public function getIndicator(): bool;", "public function hasLatLongRect(){\n return $this->_has(1);\n }", "public function hasColour(): bool;", "function wpsc_have_custom_meta() {\n\tglobal $wpsc_custom_meta;\n\treturn esc_html( $wpsc_custom_meta->have_custom_meta() );\n}", "public function valid()\n {\n return isset($this->_annotations[$this->_position]);\n }", "public function hasMark(Mark $mark, User $grader = null) {\n return $this->getMarkMultiplicity($mark, $grader) > 0;\n }", "public function isHit() {}", "public function hasLabel()\n {\n return $this->use_label;\n }", "abstract public function hasStyle();", "public function baselineIdentified(): bool\n {\n return $this->baseline !== null && $this->baseline !== '';\n }", "function add_mark($name,$symbol,$icon,$class=\"changed\") {\n if (isset($this->umark->$name)) return FALSE;\n if (strlen($symbol) != 1) return FALSE;\n $this->umark->$name->symbol = $symbol;\n $this->umark->$name->icon = $icon;\n $this->umark->$name->class = $class;\n $this->umarks[\"$symbol\"] = $name;\n return TRUE;\n }", "public function isCustom()\n {\n $module = $this->getRepository()->getModuleFromMarketplace($this);\n\n return !isset($module) || $module->getModuleID() === $this->getModuleID();\n }", "public function hasTotalpoint(){\n return $this->_has(2);\n }", "public function isHit(): bool;", "public function hasLogoAnnotations(){\n return $this->_has(3);\n }", "function object_measure_marker($object)\r\n{\r\n return $object['measure']['style']['marker'];\r\n}", "public function hasColor(){\n return $this->_has(1);\n }", "public function getDecorated(): bool\n {\n return $this->decorated;\n }", "function test_passed($mark)\n {\n return (float) $mark > TEST_PASSING_MARK;\n }", "public function hasMark(Mark $mark) {\n return $this->hasMarkId($mark->getId());\n }", "public function markSupported()\n {\n return false;\n }", "public function hasTextAnnotations(){\n return $this->_has(5);\n }", "public function hasBoundingBox(){\n return $this->_has(2);\n }", "public function hasBoundingBox(){\n return $this->_has(2);\n }", "public function hasBoundingBox(){\n return $this->_has(2);\n }", "public function hasBoundingBox(){\n return $this->_has(2);\n }", "function hasCustomAvatar()\n {\n if ($this->avatar !== null) {\n return true;\n }\n\n return false;\n }", "public function hasFullTextAnnotation(){\n return $this->_has(12);\n }", "public function hasAnnotations(): bool {\n $details= XPClass::detailsForField($this->_reflect->getDeclaringClass(), $this->_reflect->getName());\n return $details ? !empty($details[DETAIL_ANNOTATIONS]) : false;\n }", "public function getTotalMark()\n {\n return $this->totalMark;\n }", "public function hasCustomObject()\n {\n return null !== $this->customObject;\n }", "public function isJustgdprcfied()\n\t{\n\t\treturn $this->justgdprcfied;\n\t}", "public function isHit();", "public function isHit();", "public function isHit();", "public function hasLandmarkingConfidence(){\n return $this->_has(8);\n }", "function isCustomStyleTbi($name)\r\n {\r\n if (isset($this->custom_tbi_styles[$name]))\r\n return true;\r\n else\r\n return false;\r\n }", "public function hasMetric(){\n return $this->_has(8);\n }", "private function can_add_mark_menu() {\n\t\treturn $this->is_front() && Helper::has_cap( 'onpage_general' );\n\t}", "public function hasImagePropertiesAnnotation(){\n return $this->_has(8);\n }", "public function hasIcon()\n {\n return $this->icon !== null;\n }", "public function hasLatLng(){\n return $this->_has(1);\n }", "protected function usesIcon() {\n return $this->usesIcon;\n }", "public function hasFinalStrike() {\r\n\t\treturn FALSE;\r\n\t}", "public function hasMetric(){\n return $this->_has(2);\n }", "public function hasMetric(){\n return $this->_has(2);\n }", "public function hasAnnotations();", "protected function isCustomType()\n\t{\n\t\treturn ($this->data['TYPE'] != self::TYPE_STANDARD);\n\t}", "public function isPoint() : bool\n {\n return $this->min == $this->max;\n }", "public function hasMountPoint(){\n return $this->_has(8);\n }", "public function isDecorated()\n {\n return $this->formatter->isDecorated();\n }", "public function getFacet(): bool {}", "public function getFacet(): bool {}", "public function getMarkMultiplicity(Mark $mark, User $grader = null) {\n $count = 0;\n foreach ($this->graded_components as $graded_component) {\n if ($graded_component->hasMark($mark)) {\n if ($grader === null) {\n $count++;\n }\n else {\n if ($graded_component->getGrader()->getId() === $grader->getId()) {\n return 1;\n }\n }\n }\n }\n return $count;\n }", "public function isTrueColor(): bool;", "private static function hasLabels(): bool\n {\n return property_exists(static::class, 'labels');\n }", "public function isDecorated()\n {\n }", "public function harKart()\n {\n return $this->getKart()->hasMap();\n }", "public function hasLabels(){\n return $this->_has(9);\n }", "public function get_marks()\n {\n return $this->marks;\n }", "public function isMarked() {\n\t\t$sessionVars = WCF::getSession()->getVars();\n\t\tif (isset($sessionVars['markedSubscribedThreads'])) {\n\t\t\tif (in_array($this->threadID, $sessionVars['markedSubscribedThreads'])) return 1;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public function hasLabels();", "public function hasLayer(){\n return $this->_has(1);\n }", "function exa_is_cover($post = null) {\n\t$post = get_post($post);\n\t$cover = has_term('cover','importance',$post);\n\treturn $cover;\n}", "public function isCustom() {\n return (bool) preg_match('/\\/custom\\//', $this->path);\n }", "public function hasMatk(){\n return $this->_has(23);\n }", "public function hasMetrics(){\n return $this->_has(1);\n }", "function GetMark($mark)\n {\n switch (strtoupper($mark)) {\n case \"SQUARE\": return MARK_SQUARE;\n case \"UTRIANGLE\": return MARK_UTRIANGLE;\n case \"DTRIANGLE\": return MARK_DTRIANGLE;\n case \"DIAMOND\": return MARK_DIAMOND;\n case \"CIRCLE\": return MARK_CIRCLE;\n case \"FILLEDCIRCLE\": return MARK_FILLEDCIRCLE;\n case \"CROSS\": return MARK_CROSS;\n case \"STAR\": return MARK_STAR;\n case \"X\": return MARK_X;\n default: return 0;\n }\n }", "public function isLabelInTrackInfo();", "public function hasInvisiblexit(){\n return $this->_has(8);\n }", "private function isIcon() {\n return ($this->dsid == 'TN') || (preg_match('/-tn\\.([^\\/]*)$/i', $this->dsid) > 0);\n }", "public function hasEggKmWalkedStart()\n {\n return $this->egg_km_walked_start !== null;\n }", "public function getMarks() {\n return $this->marks;\n }", "public function hasMarkId($mark_id) {\n return in_array($mark_id, $this->mark_ids);\n }", "public function hasIcon()\n {\n return !is_null($this->icon) && !empty($this->icon);\n }" ]
[ "0.63237303", "0.616663", "0.6154675", "0.607917", "0.607917", "0.604678", "0.60460025", "0.60126543", "0.60113955", "0.60113955", "0.5912757", "0.5895516", "0.5892654", "0.58664083", "0.58662474", "0.5833017", "0.5806465", "0.5806269", "0.5780461", "0.57798547", "0.57629997", "0.57585555", "0.575309", "0.57295257", "0.5707458", "0.57047045", "0.56889015", "0.5671524", "0.56360817", "0.5635551", "0.5631249", "0.56306493", "0.5618104", "0.5600822", "0.559916", "0.55668217", "0.5563098", "0.55587745", "0.5549562", "0.55414516", "0.55386055", "0.5536291", "0.55091876", "0.5497855", "0.5496287", "0.5490868", "0.54683083", "0.5464085", "0.5464085", "0.5464085", "0.5464085", "0.54639715", "0.5447666", "0.54211974", "0.5416209", "0.5416124", "0.5413016", "0.5406282", "0.5406282", "0.5406282", "0.53647375", "0.5359322", "0.5344527", "0.53350955", "0.5327643", "0.5312538", "0.53119975", "0.53048736", "0.5302955", "0.53004885", "0.53004885", "0.5290441", "0.5284985", "0.5278364", "0.52710277", "0.5270697", "0.526466", "0.526466", "0.526258", "0.5258495", "0.5257016", "0.525353", "0.5252598", "0.52371216", "0.52341205", "0.52270705", "0.5220062", "0.5213039", "0.52121246", "0.52102214", "0.5205234", "0.5203692", "0.5203466", "0.52005494", "0.51958925", "0.5188949", "0.5187489", "0.518142", "0.5171907", "0.51695275" ]
0.7552105
0
Gets the mark ids loaded from the database
Получает идентификаторы меток, загруженные из базы данных
public function getDbMarkIds() { return $this->db_mark_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIDs();", "public function getIds();", "public function getIds()\n {\n $this->_loadSet();\n return $this->_set;\n }", "public function getIds()\n {\n \treturn $this->_cacheEnabled ? $this->_cache->getIds() : array();\n }", "public function getIds()\n {\n return $this->ids;\n }", "abstract public function getIds();", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(GlDistCode::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function getIDs()\r\n\t{\r\n\t\treturn $this->IDs;\r\n\t}", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getAllIds(): array;", "public function getIDs()\n {\n /** @var $found Result[] */\n $found = $this->getResults();\n\n $ids = array();\n\n foreach ($found as $item) {\n $ids[] = $item->getId();\n }\n\n return $ids;\n }", "public function ids()\n {\n return $this->extract('id');\n }", "public function getIds()\n\t{\n\t\treturn array_keys($this->data);\n\t}", "function getIds() {\n return array();\n}", "public function retrieveAllIds();", "public function fetchIds()\n {\n $all_data = $this->fetchAll();\n\n // no data to begin with\n if (count($all_data) == 0) {\n return array();\n }\n\n // no id column in the data\n if (!isset($all_data[0]['id'])) {\n return $all_data;\n }\n\n $ids = array();\n foreach ($all_data as $data) {\n $ids[] = (int) $data['id'];\n }\n return $ids;\n }", "public function ids();", "protected function fetchKeys()\r\n {\r\n $keys = array();\r\n foreach($this->getData() as $i => $data)\r\n $keys[$i] = $data['_id'];\r\n return $keys;\r\n }", "public function getIds(): array\n {\n return $this->ids;\n }", "public function retrieveAllIds() {\n return $this->getIdsByCriteria(new Criteria());\n }", "public function retrieveAllIds()\n {\n return $this->getIdsByCriteria(new Criteria());\n }", "public function retrieveAllIds()\n {\n return $this->getIdsByCriteria(new Criteria());\n }", "public function retrieveAllIds()\n {\n return $this->getIdsByCriteria(new Criteria());\n }", "public function getMarks(): array\n {\n return $this->marks;\n }", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(ProspectSource::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(ArRouteCode::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function getIds() {\n\t\treturn (is_array($this->ids)) ? $this->ids : false;\t\n\t}", "public function getDocumentIds() {\n $_temp_resultset = $this->resultset;\n while ($_biblio_d = $_temp_resultset->fetch_assoc()) { $this->biblio_ids[] = $_biblio_d['biblio_id']; }\n unset($_temp_resultset);\n return $this->biblio_ids;\n }", "public function getIdList()\n {\n return $this->getModel()->lists('id');\n }", "public function getIds()\n {\n return $this->_options[static::QUERY_IDS];\n }", "protected function _getSetIds()\n {\n\t\t$setIds = $this->getProductCollection()->getSetIds();\n return $setIds;\n }", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(ApTermsCode::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function getIdentities()\n {\n return $this->getId();\n }", "public function findAllIds() {\r\n $select = $this->_createSelectQuery();\r\n // Magasin\r\n $select->field('id');\r\n // From et jointures\r\n $select->from($this->_tableName);\r\n\r\n return $this->_mapper->buildIdObjectsFromRows($this->_selectAll($select));\r\n }", "public function getSetIds()\n {\n $select = clone $this->getSelect();\n /** @var $select Varien_Db_Select */\n $select->reset(Zend_Db_Select::COLUMNS);\n $select->distinct(true);\n $select->columns('attribute_set_id');\n return $this->getConnection()->fetchCol($select);\n }", "public function getAllIds(): array\n {\n // Use our custom hydrator for maximum efficiency\n return $this->getQueryBuilder()->select(\"{$this->alias}.id\")->getQuery()->getResult('column');\n }", "public function getAllIds()\n {\n $idsSelect = clone $this->getSelect();\n $idsSelect->reset(Zend_Db_Select::ORDER);\n $idsSelect->reset(Zend_Db_Select::LIMIT_COUNT);\n $idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET);\n $idsSelect->reset(Zend_Db_Select::COLUMNS);\n\n $idsSelect->columns($this->getResource()->getIdFieldName(), 'main_table');\n return $this->getConnection()->fetchCol($idsSelect);\n }", "private function getDocumentIds() : array {}", "public function fetchActiveIds();", "public function findAll() {\n $sql = \"SELECT * FROM c_mark ORDER BY c_mark_id\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $c_mark = array();\n foreach ($result as $row) {\n $c_markId = $row['c_mark_id'];\n $c_mark[$c_markId] = $this->buildDomainObject($row);\n }\n return $c_mark;\n }", "public function getEntityIds();", "public function listId() {\n\t\treturn $this->branch->all()->pluck('id')->all();\n\t}", "public function getIdentities()\n {\n return [self::CACHE.'_'.$this->getId()];\n }", "public function getIds(): array\n {\n $qb = $this->_em->createQueryBuilder();\n $qb->addSelect('x.id')->from(School::class, 'x');\n $results = $qb->getQuery()->getScalarResult();\n return array_map('intval', array_column($results, 'id'));\n }", "public function getIds(): array\n {\n $qb = $this->_em->createQueryBuilder();\n $qb->addSelect('x.id')->from(School::class, 'x');\n $results = $qb->getQuery()->getScalarResult();\n return array_map('intval', array_column($results, 'id'));\n }", "public function loadIdList() {}", "public function loadIdList() {}", "public function loadIdList() {}", "public function findIds()\n {\n $method = $this->getIdsCall();\n $response = $this->api->$method($this->params);\n\n return json_decode($response);\n }", "function getRecordIds() {\n\t\tif(!isset($this->_RecordIds)){\n\t\t\t$this->_RecordData = $this->_dbmole->selectRows($this->_Query,$this->_BindAr,$this->_QueryOptions);\n\t\t\tif( $this->_RecordData ) {\n\t\t\t\t$this->_RecordKey = key(current($this->_RecordData));\n\t\t\t\t$this->_RecordIds = array_column($this->_RecordData, $this->_RecordKey);\n\t\t\t} else {\n\t\t\t\t$this->_RecordIds = array();\n\t\t\t}\n\t\t}\n\t\treturn $this->_RecordIds;\n\t}", "function getIds() {\n return DB::executeFirstColumn('SELECT id FROM ' . $this->getTargetTableName() . ' WHERE ' . $this->getFieldName() . ' = ?', $this->source_instance->getId());\n }", "public function getAllReferencesForPersistenceIdentifier() : array {}", "public function getId_list()\n {\n return $this->_id_list;\n }", "public function getAllIds()\n {\n $ids = array();\n foreach ($this->getItems() as $item) {\n $ids[] = $this->_getItemId($item);\n }\n return $ids;\n }", "public function getFilteredMarkerIdList($params)\n{\n\t$conditions = $this->getFilteredQueryConditions($params);\n\n\t/* Limit to only querying from the Listing table. */\n\t$this->contain();\n\n\t$markerIdList = $this->find('all', array(\n\t\t'conditions' => $conditions,\n\t\t'fields' => array('marker_id')));\n\n\t//return $markerIdList[0]['Listing']['marker_id'];\n\t$formattedIdList = array();\n\tfor ($i = 0; $i < count($markerIdList); $i++)\n\t\tarray_push($formattedIdList, $markerIdList[$i]['Listing']['marker_id']);\n\n\treturn json_encode($formattedIdList);\n}", "public function getIds()\n {\n $this->_log(\"Zend_Cache_Backend_Memcached::save() : getting the list of cache ids is unsupported by the Memcache backend\");\n return [];\n }", "public function getSetIdWithUnprocessedEntries() {\n\t\t$db = $this->getDB();\n\t\t$res = $db->exec_SELECTquery(\n\t\t\t'set_id',\n\t\t\t$this->tableName,\n\t\t\t'exec_time = 0 AND scheduled < '.time(),\n\t\t\t'set_id'\n\t\t);\n\t\t$setIds = array();\n\t\twhile ($row = $db->sql_fetch_assoc($res)) {\n\t\t\t$setIds[] = intval($row['set_id']);\n\t\t}\n\t\treturn $setIds;\n\t}", "public function fetchFileIds() {\n return self::sFetchFileIds($this->id);\n }", "public function getIDs() {\r\n \r\n if ($this->resultIDs == false) {\r\n $this->resultIDs = get_restaurant_id_from_pattern($this->pattern);\r\n }\r\n return $this->resultIDs;\r\n }", "public static function getQualificationIds() {\r\n $tableObj = new TrainingRecommend();\r\n\r\n $select = $tableObj->select()\r\n ->from(array('pq' => 'person_qualification_option'), array('id'))\r\n ->setIntegrityCheck(false)\r\n ->where(\"parent_id IS NULL\")\r\n ->order(\"qualification_phrase\");\r\n\r\n $rows = $tableObj->fetchAll($select);\r\n\r\n $ids = array();\r\n foreach($rows as $row) {\r\n $ids[] = $row->id;\r\n }\r\n\r\n return $ids;\r\n\r\n }", "protected function getIDListFromDB() : array\n {\n $arElementIDList = (array) Review::orderBy('id', 'desc')->lists('id');\n\n return $arElementIDList;\n }", "private function getAllDocumentIds() : array {}", "public function entityIds()\n {\n return $this->map(function ($entity) {\n return $entity->getId();\n })->toBase();\n }", "function &getIdentifier_Ids()\n\t{\n\t\tinclude_once 'Services/MetaData/classes/class.ilMDIdentifier_.php';\n\n\t\treturn ilMDIdentifier_::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_relation');\n\t}", "public function getObjectIds()\n {\n $this->_init();\n return array_keys($this->_data_cache->getObjects());\n }", "public function getIds()\n {\n if ($this->_notMatchingTags) {\n return (array) $this->_redis->sMembers(self::SET_IDS);\n } else {\n $keys = $this->_redis->keys(self::PREFIX_KEY . '*');\n $prefixLen = strlen(self::PREFIX_KEY);\n foreach ($keys as $index => $key) {\n $keys[$index] = substr($key, $prefixLen);\n }\n return $keys;\n }\n }", "public function getCompleteIdList() {\n\t$returnVal = array();\n\t$resultSet = $this->select()\n\t\t->from($this->_name, array('document_id'))\n\t\t->query();\n\twhile (false !== ($row = $resultSet->fetch())) {\n\t $returnVal[] = $row['document_id'];\n\t}\n\n\treturn $returnVal;\n }", "public function getIds()\n {\n return \\array_keys($this->_getItems());\n }", "public function getIdentities()\n\t{\n\t\treturn [self::CACHE_TAG . '_' . $this->getId()];\n\t}", "private function getStoredShowIds()\n {\n return array_column(\n $this->entityManager\n ->createQueryBuilder()\n ->select('ash.id')\n ->from(\n 'MKosolofski\\HouseSeats\\MonitorBundle\\Entity\\ActiveShow',\n 'ash'\n )\n ->getQuery()\n ->getResult() ?? [],\n 'id'\n );\n }", "protected function loadIdsForJobs()\n {\n $ids = $this->loadCacheItem($this->idPrefix, []);\n\n return $ids;\n }", "public function getLoadedIds()\n {\n return array_keys($this->_items);\n }", "public function listId() {\n\t\treturn $this->subject->all()->pluck('id')->all();\n\t}", "protected function getLiveIds()\n {\n return $this->getLiveRecords()->column('ID');\n }", "public function getSuggesterIds();", "public function getIds(): Ids\n {\n return (clone $this->ids);\n }", "function get_ids() {\n\t\t$fai_volume_array = array();\n\t\t$query = \"select fai_volume_id from \".$this->_db_table;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute($query);\n\t\tif (!$rs)\n\t\t\t$event->log(\"get_list\", $_SERVER['REQUEST_TIME'], 2, \"fai-volume.class.php\", $db->ErrorMsg(), \"\", \"\", 0, 0, 0);\n\t\telse\n\t\twhile (!$rs->EOF) {\n\t\t\t$fai_volume_array[] = $rs->fields;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $fai_volume_array;\n\t}", "public function getIdentities()\n {\n return $this->identities;\n }", "public function marks()\n\t{\n\t\treturn $this->hasManyThrough('Evaluation\\Mark', 'Evaluation\\GradeScaleMark',\n\t\t\t'grade_scale_mark_gradeScaleID', 'mark_id')->select(array('mark_id', 'mark_value'))->getResults();\n\t}", "public function getIdentifiers()\n {\n return $this->init()->_identifiers;\n }", "protected function fetchKeys()\n {\n $keys=array();\n foreach($this->getData() as $i=>$data)\n {\n $key=$this->keyAttribute===null ? $data->getPrimaryKey() : $data->{$this->keyAttribute};\n $keys[$i]=is_array($key) ? implode(',',$key) : $key;\n }\n return $keys;\n }", "public static function listeIdIntervenants() {\n\t\t\t$listeId = Array();\n\t\t\ttry {\n\t\t\t\t$pdoOptions[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n\t\t\t\t$bdd = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME, DB_LOGIN, DB_PASSWORD, $pdoOptions);\n\t\t\t\t$bdd->query(\"SET NAMES utf8\");\n\t\t\t\t$req = $bdd->prepare(\"SELECT id FROM \".Intervenant::$nomTable.\" ORDER BY nom\");\n\t\t\t\t$req->execute();\n\t\t\t\twhile ($ligne = $req->fetch()) {\n\t\t\t\t\tarray_push($listeId, $ligne['id']);\n\t\t\t\t}\n\t\t\t\t$req->closeCursor();\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo \"Erreur : \".$e->getMessage().\"<br />\";\n\t\t\t}\n\t\t\treturn $listeId;\n\t\t}", "public function getIds() {\n return [\n 'identifier' => [\n 'type' => 'string',\n 'alias' => 'i',\n ],\n ];\n }", "public function getCachedRevisionsIds()\n {\n $sql = 'SELECT id\n FROM revisions\n ORDER BY id ASC;';\n return $this->fetchAll($sql, PDO::FETCH_COLUMN, 0);\n }", "public function getEntityIDs()\n {\n return $this->entityIDs;\n }", "public function getKeywordIds()\n {\n $ids = [];\n foreach ($this->getKeywords() as $keyword) {\n $ids[] = $keyword->getId();\n }\n\n return $ids;\n }", "public function getAssociatedIds()\n {\n return RoadDamageReport::select('id', 'roaddamage_id')->where('image_id', '=', $this->image_id)->get()->toArray();\n }", "public function getIdentities()\n {\n return [static::CACHE_TAG . '_' . $this->getId()];\n }", "public static function getJobIds(){\n return ORM::factory('BoardCategory')->select('id')->where('job','=',1)->cached(Model_BoardCategory::CATEGORIES_CACHE_TIME)->find_all()->as_array('id','id');\n }", "public function getMarksForSearch(array $ids);", "public function getSelectedIndicatorsIds()\n {\n $indicators = InstanceIndicators::select('indicator_id')->groupBy('indicator_id')->get();\n $indicatorIds = [];\n foreach ($indicators as $indicator)\n array_push($indicatorIds, $indicator->indicator_id);\n\n return $indicatorIds;\n }", "public function fields_Ids(){\n\t\treturn $this->fields('ids');\n\t}", "public function getMarks() {\n return $this->marks;\n }", "public static function get_list_ids()\n {\n }", "public function getNewsFavouriteIds()\n {\n return array_reduce($this->newsFavourite->toArray(), function ($acc, $item) {\n $acc[] = $item->getId();\n return $acc;\n }, []);\n }", "public function getEmployeeIds( ) {\n\t\treturn $this->users->pluck('id')->toArray();\n }", "public function getIdentities() {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }" ]
[ "0.710534", "0.70867383", "0.68969417", "0.6847137", "0.67710775", "0.6770092", "0.6765654", "0.66598845", "0.6650772", "0.6650772", "0.6650772", "0.6650772", "0.6640876", "0.6627386", "0.6616881", "0.6612259", "0.6593205", "0.6586956", "0.65512395", "0.6540529", "0.64335907", "0.64257765", "0.6421955", "0.6415355", "0.6415355", "0.6415355", "0.64097595", "0.63992184", "0.63965225", "0.6374558", "0.63722533", "0.6363408", "0.63353986", "0.63183725", "0.6317159", "0.6315969", "0.6306961", "0.63039285", "0.629514", "0.6283914", "0.6280113", "0.6264272", "0.62605935", "0.6257988", "0.62533927", "0.6245461", "0.62380487", "0.62380487", "0.62359226", "0.62359226", "0.62359226", "0.6207029", "0.62063694", "0.6204682", "0.6204173", "0.6157807", "0.61376524", "0.61180276", "0.6117487", "0.6103829", "0.61029774", "0.6094228", "0.60906327", "0.60865855", "0.6086364", "0.60754687", "0.6075355", "0.6073496", "0.6071384", "0.60696167", "0.6068651", "0.60563546", "0.6052632", "0.6029607", "0.6028292", "0.6025826", "0.60040843", "0.5998855", "0.5998397", "0.5997029", "0.5992847", "0.5975901", "0.59736127", "0.5971449", "0.5955954", "0.59438527", "0.59338915", "0.5926047", "0.5919739", "0.5917863", "0.59129906", "0.5911032", "0.58988154", "0.5897808", "0.5892088", "0.5889934", "0.587875", "0.58717793", "0.5871757", "0.5870669" ]
0.79959816
0
Gets the id of the verifier or '' if none exist
Получает идентификатор проверяющего или пустую строку, если его нет
public function getVerifierId() { return $this->verifier_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdForVerification() {\n /** @noinspection PhpUndefinedFieldInspection */\n return $this->id;\n }", "public function obtenerID();", "public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }", "public function getId()\n {\n return $this->response['openid'] ?: null;\n }", "public function getId(){\n\t\t \t\treturn $this->id_prov;\n\t\t \t}", "public function getVerifier()\n {\n return $this->verifier;\n }", "public function getVerifier()\n {\n return $this->verifier;\n }", "static function getID(): string {\n return \"\";\n }", "public function getProviderId(): ?string;", "public function getProviderId(): ?string;", "public static function getID(): string;", "public function getVersiondId() {}", "public function id()\n {\n // will need to be created with a proof response\n $this->clear();\n\n if( null !== $this->proofResponse->personMeta ) {\n return (int)$this->proofResponse->personMeta->id;\n }\n\n return 0;\n }", "public function getAuthId()\n {\n }", "public function id()\n {\n if ($user = $this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n }", "public function getUniqueIdentifier() : string {}", "public function getUniqueIdentifier() : string {}", "public function getUniqueIdentifier() : string {}", "public function determineId() {}", "public function getID(): string {\n return $this[\"id\"] ?? \"\";\n }", "public function getVersionId()\n {\n return $this->getData('version_id');\n }", "public function getId(): ?string\n {\n if (!$this->isSuccessful()) {\n return null;\n }\n return $this->getData()['id'];\n }", "public function getExternalId();", "public function get_id() : string;", "public function getAuthIdentifier(): string;", "function getInternalPaymentId() ;", "static private function _apbct_alt_session__id__get()\n {\n /** @var \\Cleantalk\\Common\\Helper\\Helper $helper_class */\n $helper_class = Mloader::get('Helper');\n\n $id = $helper_class::ipGet('real')\n . filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')\n . filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE');\n return hash('sha256', $id);\n }", "public function GetId()\r\n {\r\n return isset($_SESSION['user']) ? $_SESSION['user']->id : null;\r\n }", "public function getTokenId()\r\n {\r\n $info = $this->getInfo();\r\n /* @var Mage_Sales_Model_Order_Payment $info */\r\n $order = $info->getOrder();\r\n if($order->getCustomerIsGuest()) {\r\n return '';\r\n }\r\n\r\n Mage::helper('ewayrapid')->unserializeInfoInstace($info);\r\n if(!$info->getSavedToken()) {\r\n return '';\r\n }\r\n\r\n $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());\r\n $helper = Mage::helper('ewayrapid/customer')->setCurrentCustomer($customer);\r\n return $helper->getCustomerTokenId($info->getSavedToken());\r\n }", "public function getOid();", "public function getVerificationCode();", "private function getauthID(){\n\t}", "public function getAuthIdentifier() {\n\t\treturn $this->memb___id;\n\t}", "public function getAuthIdentifier()\n {\n }", "public static function getSecretIdField(): string;", "public function get_id() : string\n {\n }", "public function get_id() : string\n {\n }", "public function id()\n {\n $user = $this->user();\n return $user->id ?? null;\n }", "function verify_id()\n\t{\n\t\tlog_debug(\"platforms\", \"Executing verify_id()\");\n\n\t\tif ($this->id)\n\t\t{\n\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t$sql_obj->string\t= \"SELECT id FROM `apps_platform` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t\t$sql_obj->execute();\n\n\t\t\tif ($sql_obj->num_rows())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\n\t}", "public function getVersionId()\n {\n return $this->version_id;\n }", "public function getIdentificationCode();", "public function getId(): string\n {\n\t\treturn $this->id ?: self::DEFAULT_ID;\n\t}", "private function getCurrentVisitorId() {\n $_ga = isset($_COOKIE['_ga']) ? $_COOKIE['_ga'] : null;\n if ($_ga) {\n $arr = explode('.', $_ga);\n return $arr[2] . '.' . $arr[3];\n }\n return null;\n }", "public function getAuthIdentifier()\n {\n return 1;\n }", "public function getProviderId();", "public function getID() {\n if (isset($_GET['id'])) {\n $this->id = $_GET['id'];\n return $this->id;\n } else {\n die('Id has not been found');\n }\n }", "public function get_id();", "public function get_id();", "public function get_id();", "public function get_id();", "public function getID(): string\n {\n return (string) session_id();\n }", "public function getVentanillaActualId()\n {\n return $this->getVentanillaActual() ? $this->getVentanillaActual()->getId() : null;\n }", "public function getOrCreateId()\n {\n $check = $this->firstOrCreate();\n\n //if no character id was given, return and say no character with that id\n if (!isset($check->character)) {\n $error = 'Character does not exist';\n\n return $error;\n }\n\n //else if character already claimed\n if (isset($check->user_id)) {\n $error = 'Character already claimed.';\n\n return $error;\n }\n\n return $check->verification_code;\n }", "public function getId()\n\t{\n\t\treturn $this->response['id'] ? : null;\n\t}", "public function getId() {\n return !empty($this->html_params['id']) ? $this->html_params['id'] : NULL;\n }", "public function getProvisionerId();", "public function getAuthIdentifier()\n\t{\n\t\treturn $this->id;\n\t}", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifierName()\n {\n return 'id';\n }", "public function getVentanillaActualIdentificador()\n {\n return $this->getVentanillaActual() ? $this->getVentanillaActual()->getIdentificador() : null;\n }", "public function obtenerID(){\n\t\t\treturn $this->id;\n\t\t}", "public function getAuthIdentifierName(): string\n {\n return 'id';\n }", "public function getAuthIdentifier()\n {\n return $this->steam_id;\n }", "public function getIdentificationID()\n {\n return $this->identificationID;\n }", "public function getIdent() {\n return $this->_identStr;\n }", "public function getID() : string {\n return $this->code;\n }", "function snasolutions_primary_token_id_get() {\n global $user;\n if (!$user->uid) {return false;}\n \n $user_tokens_list = variable_get('snasolutions_token_list', array());\n return $user_tokens_list[$user->uid] ? $user_tokens_list[$user->uid] : false;\n}", "public function getAuthIdentifier()\n {\n }", "public function getId(): ?string;", "public function getId(): ?string;", "public function getId(): ?string;", "public function getId(): ?string;", "protected function generateId() {\n return $this->stringToId($this->storage->login);\n }", "public function id()\n {\n if ($this->loggedOut) {\n return;\n }\n\n return $this->user()\n ? $this->user()->getAuthIdentifier()\n : $this->session->get($this->getName());\n }", "public function getId()\n\t{\n\t\tif (isset($this->data['id'])) return $this->data['id'];\n\t\treturn '';\n\t}", "public function getID(): string;", "public function getID(): string;", "public function getAuthIdentifierName()\n {\n return \"id\";\n }", "public function getId(): ?string\n {\n return $this->{self::ID};\n }", "protected function getUserIdentifier(): string\n {\n return $this->getValidWebsiteUser()->getIdentifier();\n }", "public function getId()\n\t{\n\t\tif( isset( $this->values['id'] ) ) {\n\t\t\treturn (string) $this->values['id'];\n\t\t}\n\t}", "public function getIdentifier() : ?string\n {\n return $this->getAttribute('identifier');\n }", "public function getIdentifier(): string\n {\n return $this->getId();\n }", "public function getID()\n\t{\n\t\treturn ( isset( $this->properties['id'] ) ) ? (string) $this->properties['id'] : NULL;\n\t}", "protected function generateId()\n {\n return $this->stringToId( $this->storage->login );\n }", "protected function getId()\n {\n try{\n return $this->get('id');\n }catch(\\Exception $e){\n \\Log::error($e);\n return FALSE;\n }\n }", "public function getVersionID()\n {\n return (int)$this->_array2String($this->getVersion(), 2);\n }", "private function getIdentifier() {\n if (empty($this->_identifier)) {\n $this->_identifier = md5($this->getId());\n }\n return $this->_identifier;\n }", "public function getFirebaseId()\n {\n return $this->getVerifier()->claims()->has('user_id')\n ? $this->getVerifier()->claims()->get('user_id') : null;\n }", "public function generateCodeVerifier(): string\n {\n return $this->codeVerifier = $this->generateRandomString(128);\n }", "public function getActivityId(): ?string;", "function getId_enc()\n {\n if (!isset($this->iid_enc) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_enc;\n }", "public function getIdentificationNumber(): string\n {\n return $this->identification_number;\n }", "public function getId(): ?string\n {\n return $this->id;\n }" ]
[ "0.7067803", "0.64882976", "0.63731116", "0.63384485", "0.6332771", "0.6292247", "0.6292247", "0.6255581", "0.6242169", "0.6242169", "0.62348974", "0.62205666", "0.6220401", "0.61821836", "0.61806375", "0.6164845", "0.6164845", "0.6164845", "0.61108714", "0.61069924", "0.6104491", "0.60996795", "0.60923934", "0.6056195", "0.60278434", "0.6020301", "0.6019428", "0.5996227", "0.5987758", "0.5986563", "0.5985366", "0.5978165", "0.5967409", "0.59664005", "0.5965864", "0.5965712", "0.5965712", "0.5964467", "0.5942272", "0.5939558", "0.5934111", "0.5931598", "0.59282327", "0.5926351", "0.59233534", "0.59190655", "0.59058166", "0.59058166", "0.59058166", "0.59058166", "0.5905387", "0.59012204", "0.590063", "0.58974856", "0.58917403", "0.5890738", "0.58841956", "0.588156", "0.588156", "0.588156", "0.588156", "0.588156", "0.588156", "0.588156", "0.5877003", "0.58763397", "0.58739257", "0.58697665", "0.58667666", "0.586499", "0.5854887", "0.585394", "0.58472896", "0.5846288", "0.5845996", "0.5845996", "0.5845996", "0.5845996", "0.58444744", "0.5841848", "0.5840335", "0.58395344", "0.58395344", "0.5837405", "0.58290255", "0.58264214", "0.5825214", "0.5820792", "0.5816295", "0.5814835", "0.5808887", "0.5807442", "0.5803272", "0.58022887", "0.58012056", "0.5800876", "0.5792928", "0.57915705", "0.5789536", "0.5786155" ]
0.75717735
0
Gets the time when this component was verified
Получает время, когда этот компонент был проверен
public function getVerifyTime() { return $this->verify_time; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVerifyTime()\n {\n return $this->verify_time;\n }", "public function getArticleVerifyTime()\n {\n return $this->article_verify_time;\n }", "public function getAuthTime()\n {\n return $this->authTime;\n }", "function get_last_check_in_time(){\n return $this->get_user_info_array()['last_check_in_time'];\n }", "public function getEmail_verified_at()\n {\n return $this->email_verified_at;\n }", "public function getConfirmTime()\n {\n return $this->confirm_time;\n }", "public function getTime() {\n return $this->bnetUpdate;\n }", "protected function getTimestamp() {\n\t\treturn time();\n\t}", "protected function getTime()\n {\n return Carbon::now()->getTimestamp();\n }", "public function getTimeNeeded()\n\t{\n\t\treturn $this->timeNeeded;\n\t}", "public function getTime() {\n\t\treturn $this->time;\n\t}", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getCardholderAuthenticationDateTime();", "public function getTime()\n\t{\n return $this->time;\n\t}", "public function getTime()\n\t{\n\t\treturn $this->time;\n\t}", "public function getTime()\n\t{\n\t\treturn $this->time;\n\t}", "public function getTime() {\n return $this->time;\n }", "public function getTime() {\n return $this->time;\n }", "public function getTime()\n {\n return $this->_time;\n }", "public function getTime()\n {\n return $this->_time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getCTime(): int\n {\n return $this->decorated->getCTime();\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getCurrentTime() {}", "protected function currentTime()\n {\n return time();\n }", "public function getTime()\n {\n return $this->data['transaction']['processing']['timestamp'];\n }", "public function getTimestamp()\n {\n if (!$this->timestamp) {\n // AWS use time format iso 8601 and GMT time zone\n $date = new \\DateTime(\"now\", new \\DateTimeZone('GMT'));\n // Store the timestamp generated to be sure we are using the same one in the auth process and the request\n $this->timestamp = $date->format(\"c\");\n }\n\n return $this->timestamp;\n }", "public function getTimestamp()\n\t{\n\t\treturn floor(microtime(true) / static::KEY_REGENERATION);\n\t}", "public function getTimestamp()\n {\n return $this->message[3];\n }", "public function get_create_time(){\n\t\treturn $this->v_create_time->sec;\n\t}", "function getCreateTime(){\n\t\t$status =& $this->getStatus();\n\t\treturn $status['Create_time'];\n\t}", "public function getTime() {}", "public function getPaymentTime()\n {\n return $this->payment_time;\n }", "public function get_timestamp()\n {\n return $_SERVER['REQUEST_TIME'];\n }", "public function getCreate_time() {\n\t\treturn $this->create_time;\n\t}", "public function getEventTime()\n {\n return $this->eventTime;\n }", "public function getResponseTime()\n {\n return $this->status[self::STATUS_REQUEST_TIME];\n }", "public function getTime(){\n\t\treturn($this->time);\n\t}", "public function getTimestamp()\n {\n return time();\n }", "public function getServerTimestamp() {\n $this->setHeaders(\"getServerTimestamp\");\n return $this->sforce->getServerTimestamp()->result;\n }", "public function getVerificationTimestamp($bolAsObject=FALSE)\n\t{\n\t\t$doHistory = DO_Sales_SaleStatusHistory::getFirstOccuranceOfStatus($this, DO_Sales_SaleStatus::VERIFIED);\n\t\t\n\t\tif ($doHistory === NULL)\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\treturn ($bolAsObject) ? $doHistory : $doHistory->changedOn;\n\t}", "public function getStatusCreateTime()\n {\n return $this->StatusCreateTime;\n }", "public function getGenerateTime()\n {\n return isset($this->generate_time) ? $this->generate_time : null;\n }", "public function getStamp();", "function getTime() {\n return max(0, $this->getExpireTime() - Misc::dbtime());\n }", "protected function getTime() {\n return (new \\DateTime())->getTimestamp();\n }", "public function getTime()\n {\n return isset($this->time) ? $this->time : null;\n }", "public function getCheckOutTime() {\n return $this->checkOutTime;\n }", "public function timestamp()\n {\n return $this->_timestamp;\n }", "public function getTime();", "public function getTime();", "public function getTime();", "public function getTime();", "public function timestamp() {\n\n\t\treturn $this->external_created_at();\n\n\t}", "private function submit_time_test()\n {\n return $this->ct_cookies_test() ? time() - intval($this->ct_getcookie('apbct_timestamp')) : null;\n }", "public function getRequestTime()\n {\n return $this->status[self::STATUS_REQUEST_TIME];\n }", "function getUpdateTime(){\n\t\t$status =& $this->getStatus();\n\t\treturn $status['Update_time'];\n\t}", "public function get_now();", "public function _getcreate_time() {\n\t\treturn $this->_createTime;\n\t}", "public function getUpdate_time() {\n\t\treturn $this->update_time;\n\t}", "protected function timeNow()\n {\n $this->timestamp = (new \\DateTime('now'))->getTimestamp();\n return $this->timestamp;\n }", "function GetTimestamp () {\n return $this->submission_timestamp;\n }", "public function getInactivityTime()\n {\n return $this->getStoreConfig(self::XML_PATH_INACTIVITY_TIME);\n }", "public function getWhenVerified()\n {\n $verifiedAt = $this->getVerifiedAt();\n if (empty($verifiedAt)) {\n return null;\n }\n\n $interval = date_diff($this->getVerifiedAt(), new \\DateTimeImmutable())->format('%a');\n switch ($interval) {\n case '0':\n $interval = self::VERIVIED_TODAY;\n break;\n\n case '1':\n $interval = self::VERIVIED_YESTERDAY;\n break;\n\n default:\n $interval .= self::VERIVIED_DAYS_AGO;\n break;\n }\n\n return $interval;\n }", "function getTime() {\n\t\treturn $this->format('H:i:s');\n\t}", "public function getCreatedTime() {\r\n // Not all submission types seem to have a created time but all seem to have\r\n // an updated time.\r\n return ($this->created_time ? $this->created_time : $this->getUpdatedTime());\r\n }", "function getTimestamp() {\r\n\t\treturn $this->timestamp;\r\n\t}", "public function getAccessTime() {\n $status = $this->getStat();\n return $status[8];\n }", "public function getReferenceTime()\n {\n return $this->referenceTime;\n }", "public function timestamp() { return; }", "public function getSnapshotTime()\n {\n return $this->snapshot_time;\n }", "public function getCreateTime() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_createTime === null)\n\t\t\t$this->load();\n\t\treturn $this->_createTime;\t\n\t}", "public function getLastUpdateTime()\n\t{\n\t\treturn time();\n\t}", "function timeNow() {\n return $this->mdate($this->timeFormat);\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function serverTimestamp() {\n\t\treturn time();\n\t}", "public function getTime(): string\n {\n return $this->time;\n }", "public function getStateTime()\n {\n return $this->state_time;\n }", "public function getExpirationTime()\n {\n return $this->getPayload(self::JWT_CLAIM_EXPIRATION_TIME);\n }", "public function getMemberSinceAttribute(): string\n {\n $accountCreated = $this->attributes['account_created'] ?? time();\n\n return date('Y-m-d', $accountCreated).'T'.date('H:i:s.ZZZZ+ZZZZ', $accountCreated);\n }", "public static function getTime()\n {\n if (isset($_SERVER['REQUEST_TIME'])) {\n return $_SERVER['REQUEST_TIME'];\n }\n\n return time();\n }" ]
[ "0.83443516", "0.775813", "0.7371043", "0.69668", "0.6959738", "0.68934554", "0.68642455", "0.68227077", "0.67675555", "0.66901034", "0.66833353", "0.6671488", "0.6671488", "0.6671488", "0.6671488", "0.6671488", "0.6671488", "0.6671488", "0.6671488", "0.6667427", "0.6663916", "0.6660396", "0.6660396", "0.6655143", "0.6655143", "0.66418004", "0.66418004", "0.66372776", "0.6631688", "0.6618185", "0.66088927", "0.6608073", "0.6603153", "0.6580742", "0.65716344", "0.6571361", "0.65602434", "0.65599215", "0.6541663", "0.6541009", "0.6537468", "0.6536141", "0.65273136", "0.6518674", "0.648665", "0.6485206", "0.6467118", "0.6466094", "0.64557016", "0.64514387", "0.64391285", "0.64316946", "0.6423774", "0.6422668", "0.64096117", "0.6407823", "0.64057726", "0.64057726", "0.64057726", "0.64057726", "0.64055115", "0.6396688", "0.63946015", "0.63933665", "0.63796985", "0.6377095", "0.6368092", "0.63668597", "0.6356533", "0.63524574", "0.63358265", "0.6326952", "0.63263255", "0.6324529", "0.6323285", "0.63200045", "0.6318481", "0.6317647", "0.63158673", "0.6309623", "0.62964714", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62949663", "0.62937474", "0.62920606", "0.62863487", "0.62842655", "0.628065", "0.6276961" ]
0.8292077
1
Used to get email id on which order is placed
Используется для получения идентификатора электронной почты, на который оформляется заказ
public function get_email_id($id) { $this->db->select('billing_email'); $this->db->where('id',$id); $query = $this->db->get('user_order')->row_array(); return $query['billing_email']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmailid()\n {\n return $this->emailid;\n }", "function getEmailID(){\n return $this->email_ad;\n }", "public function getEmailId()\n {\n return $this->emailId;\n }", "public function getEmailId()\n {\n return $this->emailId;\n }", "function getEmailAddressFromOrderID($orderID) {\r\n\tglobal $DBTABLEPREFIX;\r\n\t\r\n\t$sql = \"SELECT orders_user_id FROM `\" . $DBTABLEPREFIX . \"orders` WHERE orders_id='\" . $orderID . \"'\";\r\n\t$result = mysql_query($sql);\r\n\t\r\n\tif ($result && mysql_num_rows($result) > 0) {\r\n\t\twhile ($row = mysql_fetch_array($result)) {\r\n\t\t\treturn getEmailAddressFromID($row['orders_user_id']);\r\n\t\t}\t\r\n\t\tmysql_free_result($result);\r\n\t}\r\n}", "public function getEmailIdemail()\n {\n return $this->email_idEmail;\n }", "public function getEmail() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"email\");\n\t}", "public function getEmail() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"email\");\n\t}", "public function getEmail() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"email\");\n\t}", "function get_order_id()\n\t{\n\t\t// after that a card has been processed,\n\t\t// sometime it is possible retrieve the order id if assign by the gateway.\n\t\treturn $this->order['o_orderID'];\n\t}", "public function getEMailId(): string;", "public function id()\n {\n return $this['order_id'];\n }", "public function getIdemail()\n {\n return $this->idEmail;\n }", "public function get_order_id()\n {\n return $this->_order_id;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "private function getEmailKey()\n {\n if (!$this->emailKey) {\n foreach ($this->fieldMaps as $map) {\n if ($map->isEmail()) {\n $this->emailKey = $map->getCrmKey();\n }\n }\n }\n \n return $this->emailKey;\n }", "public function getIdentifierForEmailConfirmation()\n {\n return $this->{$this->getKeyName()};\n }", "function get_order_id (){\n return $this->order_id ;\n }", "public function get_to_email();", "public function getEmail()\n {\n $db = DBConnection::getInstance();\n $query = \"SELECT DISTINCT email FROM Users INNER JOIN Adverts On userID = Adverts.userPK WHERE advertID = :ID;\";\n $db->setQuery($query);\n $db->bindQueryValue(':ID', $this->PK);\n $db->run();\n return $db->getRow()[0];\n }", "function orderID()\r\n {\r\n return $this->OrderID;\r\n }", "function get_email() {\n if($this->email == null) { $this->fetch_info(); }\n \n return $this->email;\n }", "public static function get_order_id($order)\n {\n }", "public function getOrderID() {\r\n return $this->_output->quickOrderResponse->orderID;\r\n }", "function getUserIDFromEmail($email){\n $user = getUserFromEmail($email);\n return $user['userID'];\n }", "public function getEmail(): int { return $this->email; }", "public function getEmail()\n {\n return $this->getValueByKey($this->response['return'], 'email');\n }", "public function getDeliveryEmailAddress();", "function bosa_reservation_action_order_id($order) {\n error_log(basename(__FILE__) . ':' . __LINE__ . ' Var: $order = ' . print_r($order->order_id, 1));\n return $order;\n}", "public function getCustomerSenderEmail();", "function getUid()\n {\n return $this->getEmail();\n }", "public function getEmail() {\n return $this->hashOne('email');\n }", "public function getCustomerEmail();", "public function order_id()\n\t{\n\t\tif (isset($this->_params['order_id']))\n\t\t\treturn $this->_params['order_id'];\n\t\treturn null;\n\t}", "public function getMailId()\n {\n $value = $this->get(self::MAIL_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function get_from_email();", "public function getPrimaryId()\n {\n return $this->getMail();\n }", "public function orderId(): int\n {\n return $this->order->id();\n }", "private function getIdFromEmail($email)\n {\n return $this->nativeCustomerModel->load($email, 'customers_email_address')->getCustomersId();\n }", "public function get_current_email_id() {\n\n\t\treturn (int) $this->current_email_id;\n\t}", "public function __invoke($email) {\n\n $id = $this->repository->getidwithemail($email);\n\n return $id;\n\n }", "public function get_email() {\n return $this->get_crypted($this->Email, \"\");\n }", "function pname_email($r)\n\t{\n\t\treturn $r['email_address'];\n\t}", "protected function _getCustomerEmail()\n {\n return Mage::getSingleton('customer/session')->getCustomer()->getEmail();\n }", "function DRIVE_getCustomerByEmail($email){\n\tglobal $ch;\n\t// #1 - get Order By Id\n\t$url = backendUrl . '/SearchWS/QueryAsEntities';\n\n\t$params = array('itemQuery' => '{\n\t\t\t\t\t\t\t\t \"entityName\": \"Cl\",\n\t\t\t\t\t\t\t\t \"distinct\": false,\n\t\t\t\t\t\t\t\t \"lazyLoaded\": false,\n\t\t\t\t\t\t\t\t \"SelectItems\": [],\n\t\t\t\t\t\t\t\t \"filterItems\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t \"filterItem\": \"email\",\n\t\t\t\t\t\t\t\t\t \"valueItem\": \"'.$email.'\",\n\t\t\t\t\t\t\t\t\t \"comparison\": 0,\n\t\t\t\t\t\t\t\t\t \"groupItem\": 0\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\t \"orderByItems\": [],\n\t\t\t\t\t\t\t\t \"JoinEntities\": [],\n\t\t\t\t\t\t\t\t \"groupByItems\": []\n\t\t\t\t\t\t\t\t}');\n\n\n\n\n\t$response=DRIVE_Request($ch, $url, $params);\n\n\tif(empty($response)){\n\t\treturn false;\n\t} else if(count($response['result']) == 0 ){\n\t\treturn null;\n\t}\n\n return $response['result'][0];\n}", "public function getEmail(){\n\t\t$email = '';\n\t\t$lti_email_vars = array( 'lis_person_contact_email_primary' );\n\t\t$email_found = false;\n\t\tforEach( $lti_email_vars as $check_me ){\n\t\t\t$temp = $this->getLtiDataValue( $check_me, $email_found );\n\t\t\tif( $email_found ){\n\t\t\t\t$email = $temp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $email;\n\t}", "function GetEmail()\r\n\t{\r\n\t\treturn $this->m_email;\r\n\t}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "final public function getMainEmailId()\n\t{\n\t\treturn $this->main_email_id;\n\t}", "public function getEmail()\n {\n return $this->getValueByKey($this->response, 'Email');\n }", "public function getEmail()\n\t{\n\t\treturn reset($this->email);\n\t}", "private static function get_global_order_id()\n {\n }", "public function get_email()\n {\n return $this->_email;\n }", "public function get_email()\n {\n return $this->_email;\n }", "public function get_email()\n {\n return $this->_email;\n }", "public function getMail()\n {\n return $this->identite['mail'];\n }", "public function getEmail(): string\n {\n $response = $this->sendRequest(\"get_email_address\");\n return $response->email_addr;\n }", "public function EmailAddr() {\n\tthrow new exception('Does anything call this? It should use the template defined in site.php.');\n\treturn 'order-'.$this->NumberString().'@'.KS_EMAIL_DOMAIN;\n }", "public function getEmail()\n {\n $email = $this->getShopUserEmail();\n return (empty($email) ? $this->email : $email);\n // END: WORKAROUND FOR ACCOUNTS SOLD IN THE SHOP\n }", "public function getEmail()\n {\n return $this->getValueByKey($this->response, 'email');\n }", "public function get_email_sent($order)\n {\n }", "public function getEmail(){\n\t\treturn $this->__get('email');\n\t}", "public function red_get_admin_email() {\n\t\t$e = get_option('woocommerce_new_order_recipient');\n\t\tif ( ! $e ) {\n\t\t\t$e = get_option('admin_email');\n\t\t}\n\t\treturn $e;\n\t}", "protected function _getShipmentIdByOrder()\n {\n /** @var $select \\Magento\\Framework\\DB\\Select */\n $select = $this->_connection->select();\n $select->from(['s' => $this->getShipmentTable()], 's.entity_id')\n ->join(\n ['o' => $this->getOrderTable()],\n 'o.entity_id = s.order_id',\n []\n )->where('o.increment_id = ?', $this->_currentOrderId);\n\n return $this->_connection->fetchOne($select);\n }", "public function get_email(){\n\t\treturn $this->email;\n\t}", "public function getEmail()\r\n {\r\n return $this->_email;\r\n }", "function getInsertEmailId() {\n\t\treturn $this->getInsertId('email_templates', 'emailId');\n\t}", "private function getOwnerEmail() {\n\t$ow = new gfOwnersManage();\n\t$owEmail = $ow->getDetailsByInstance($this->getInstId());\n\tforeach ($owEmail as $oe) {\n\t return $oe[0];\n\t}\n }", "function wc_get_order_id_by_order_key($order_key)\n {\n }", "public function getStoreEmail(){\n return $this->scopeConfig->getValue(\n 'trans_email/ident_sales/email',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getStoreEmail(){\n return $this->scopeConfig->getValue(\n 'trans_email/ident_sales/email',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "private function getStoredEmailForUser()\n {\n return $this->employeeToUpdate->getOriginal('email');\n }", "public function get_email_id($data)\r\r\n\t{\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$user_id = $data;\r\r\n\t\t\r\r\n $query = \"SELECT email FROM \" . $this->table_users . \" WHERE id = \". $user_id;\r\r\n\t\t\r\r\n\t\t$stmt = $this->conn->getData($query);\r\r\n\t\t\r\r\n\t\treturn $stmt[0]['email'];\r\r\n\t}", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getEmail();", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getSenderEmail();", "public function getEmail()\n {\n return $this->_email;\n }", "public function getEmail()\n {\n return $this->_email;\n }", "public function getEmail()\n {\n return $this->_email;\n }", "public function get_email()\n\t{\n\t\treturn $this->email;\n\t}", "public function getAdminEmail() {\n $admin_email = '';\n $sql = \"SELECT * FROM admin_tab\";\n $resultnew = $this->db->query($sql);\n\n foreach ($resultnew->result_array() as $row) {\n $admin_email = $row['admin_email'];\n }\n return $admin_email;\n }", "function getEmail() {\n\t\treturn $this->email;\n\t}", "function get_site_emailId()\n{\n\n\tif(get_option('ptthemes_site_email'))\n\t{\n\t\treturn get_option('ptthemes_site_email');\n\t}\n\treturn get_option('admin_email');\n}", "function wc_get_email_order_items($order, $args = array())\n {\n }", "function pname_email($r)\n\t{\n\t\treturn $r['email'];\n\t}", "public function getUnfiOrderId();" ]
[ "0.71464175", "0.70892656", "0.70497006", "0.70497006", "0.68760484", "0.68066543", "0.66748255", "0.66748255", "0.66748255", "0.66739523", "0.664565", "0.66345674", "0.6621736", "0.6598294", "0.65540534", "0.654114", "0.65275514", "0.6489585", "0.648808", "0.647645", "0.64643157", "0.6462852", "0.6458262", "0.64455193", "0.644167", "0.6437731", "0.6428473", "0.64261025", "0.64116293", "0.63942206", "0.6375181", "0.63724035", "0.63689667", "0.63454527", "0.6340746", "0.63376975", "0.63146794", "0.631301", "0.6298226", "0.62966835", "0.62480384", "0.62471706", "0.62224764", "0.6209238", "0.62072647", "0.6206724", "0.620561", "0.6204546", "0.6204546", "0.6204546", "0.6204546", "0.6203202", "0.6199784", "0.6196806", "0.6185958", "0.61849815", "0.6181632", "0.6181632", "0.6181632", "0.61799014", "0.6162265", "0.61528516", "0.6148221", "0.614785", "0.6145113", "0.61389536", "0.6132113", "0.6126866", "0.6126807", "0.61223423", "0.6119374", "0.61191165", "0.61186373", "0.6117901", "0.6117901", "0.6111281", "0.6108113", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6107093", "0.6106468", "0.6106468", "0.6106468", "0.6102821", "0.6098258", "0.6098258", "0.6098258", "0.60979813", "0.6091059", "0.60854214", "0.6084356", "0.60809666", "0.60789", "0.60784316" ]
0.7158682
0
Gets the name of the section class that is specified in the config.
Получает имя класса секции, указанного в конфигурации.
public function getSectionClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_name() {\n\t\treturn 'section';\n\t}", "public function getSectionName(): string;", "private static function guessSectionName(): string\n {\n foreach (debug_backtrace() as $trace) {\n if (isset($trace['class']) && $trace['class'] == self::class) {\n continue;\n }\n\n if (isset($trace['function'])) {\n return $trace['function'];\n }\n }\n\n return 'default';\n }", "public function getClassname();", "public function getClassname() {\n return __CLASS__;\n }", "public function getClass():string\n {\n return $this->name;\n }", "public static function get_class_name() {\n\t\treturn self::$class_name;\n\t}", "public function getName()\n\t{\n\t\treturn __CLASS__;\n\t}", "public function getClassName(): string\n {\n return $this->rawData['parameterArray']['fieldConf']['config']['t3baClass'] ?? '';\n }", "public function getClassName()\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public function getName()\n {\n return __CLASS__;\n }", "public function get_name() {\n return 'cta-section';\n }", "protected function getClassName()\n {\n return class_basename($this->namespace);\n }", "public function model(): string\n {\n return ClassSection::class;\n }", "public function getClassName() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_className === null)\n\t\t\t$this->load();\n\t\treturn $this->_className;\t\n\t}", "public function getClassName()\n {\n return $this->__get(\"class_name\");\n }", "function get_section_type()\n {\n return $this->get_default_property(self::PROPERTY_SECTION_TYPE);\n }", "public static function getClass()\n\t{\n\t\t$class = WorkflowUtil::getValue( \"config\", \"class\" );\n\n\t\tif( !$class )\n\t\t{\n\t\t\t$class = 2;\n\t\t}\n\n\t\treturn $class;\n\t}", "protected function getClassName(): string\n {\n return class_basename($this);\n }", "public static function getClassName(): string {\n return self::$className;\n }", "public function get_classname() {\n\t\tif ( !empty( $this->classname ) ) {\n\t\t\treturn $this->classname;\n\t\t}\n\t\t$this->classname = $this->sanatize_key( $this->name );\n\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n\t{\n\t\treturn $this->get('ClassRef FullName');\n\t}", "public function getClassName()\n\t{\n\t\t\n\t\techo __CLASS__;\n\t}", "function getClassNameById($course_id){\n if(isset($this->courseList[$course_id]->controllerArray()['name'])){\n return $this->courseList[$course_id]->controllerArray()['name'];\n }else{\n return \"not a class\";\n }\n }", "public function configName();", "function get_class_name() {\n\t\treturn get_class($this);\n\t\t\n\t}", "protected function getClassName() {\n $class_name = get_class($this);\n return $class_name;\n }", "public function getClassName() {\n\t\t$path = $this->getClass();\n\t\treturn Path::basename($path);\n\t}", "function get_section()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_SECTION);\r\n }", "public function getClassName() {\n\t\treturn $this->moufManager->getInstanceType($this->name);\n\t}", "public function getClassName()\n {\n return $this->name;\n }", "public function getConfigClass();", "public function get_class_name() {\n return ucfirst($this->className);\n }", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getSectionKey() {\n return $this->getPageKey() . '-section';\n }", "public function getClass()\n {\n $str = get_class($this);\n $name = substr(strrchr($str,'\\\\'),1);\n return $name;\n }", "public function getName()\n {\n return defined($this->get('confcat_name')) ? constant($this->get('confcat_name')) : $this->get('confcat_name');\n }", "public static function class_name()\n {\n return get_called_class();\n }", "public function getName()\n {\n return $this->class;\n }", "public function getClassName() { return __CLASS__; }", "public static function getClassName()\n\t{\n\t\treturn self::CLASS_NAME;\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public static function getClsName() {\r\n return get_called_class();\r\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClass() {\n\t\t\treturn $this->className;\n\t\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function class(): string\n {\n return $this->class;\n }", "public static function getClassName()\n {\n return static::CLASS_NAME;\n }", "public static function getClass($className){\r\n static::initialize();\r\n //If this is a global class\r\n $globalClasses = array('AclObject', 'Action', 'RequestingActiveRecord', \r\n 'RestrictedActiveRecord', 'CGroup', 'RGroup');\r\n if(in_array($className, $globalClasses))\r\n return $className;\r\n \r\n if(substr($className, 0, strlen(static::$config['prefix'])) == static::$config['prefix'])\r\n return $className;\r\n \r\n return static::$config['prefix'].$className;\r\n }", "public function get_section($section);", "protected function getClassName()\n {\n return basename($this->getNameInput()) . $this->type;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function get_section()\n {\n return $this->get_default_property(self::PROPERTY_SECTION);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public function getClassName()\n {\n return get_called_class();\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClass(): string {\n return $this->class;\n }", "protected function getSUTClassName() {\n\t\t$testCaseClass = '\\\\' . get_class($this);\n\t\t\t// -> ConfigRead\\Test\\TestCase\\Shell\\ConfigReadShellTest\n\n\t\t$testingOverrideClass = preg_replace(\n\t\t\t'/^(.*)\\\\\\([^\\\\\\]+)Test$/',\n\t\t\t'\\1\\\\\\Test\\2',\n\t\t\t$testCaseClass\n\t\t); // -> ConfigRead\\Test\\TestCase\\Shell\\TestConfigReadShell\n\n\t\t$testedClass = preg_replace(\n\t\t\t'/^(.*)\\\\\\Test\\\\\\TestCase\\\\\\(.*)Test$/',\n\t\t\t'\\1\\\\\\\\\\2',\n\t\t\t$testCaseClass\n\t\t); // -> ConfigRead\\Shell\\ConfigReadShell\n\n\t\t$this->classBasename = preg_replace(\n\t\t\t'/^.*\\\\\\([^\\\\\\]+)$/',\n\t\t\t'\\1',\n\t\t\t$testedClass\n\t\t); // -> ConfigReadShell\n\n\t\treturn (class_exists($testingOverrideClass) ? $testingOverrideClass : $testedClass);\n\t}", "public static function getClassName();", "public static function getClassName();", "public function getClassName()\n\t{\n\t\treturn $this->className;\n\t}", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public function model()\n {\n return ClassSection::class;\n }", "public function componentName() {\n\t\treturn $this->config['name'];\n\t}", "public function getClassName()\n {\n if (is_null($this->_className)) {\n $this->_className = get_called_class();\n }\n return $this->_className;\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function get_section_name($section) {\n if (is_object($section)) {\n $sectionnum = $section->section;\n } else {\n $sectionnum = $section;\n }\n\n $dbapi = $this->contexthelper->get_database_api();\n $name = $dbapi->get_section_name_by_courseid_and_sectionidx($this->courseid, $sectionnum);\n return !empty($name) ? $name : get_string('default-section-title', 'format_ludic', $sectionnum);\n }", "public function getClassName(){\n\t\treturn $this->className;\t\t\n\t}", "public function getClassName()\n {\n return $this->namespace . '\\\\' . $this->name;\n }", "static public function getClassName()\n {\n return get_called_class();\n }", "public function getClass(): string\n {\n if ($this->class instanceof ReflectionClass) {\n return $this->class->getName();\n }\n\n return $this->class;\n }" ]
[ "0.68680054", "0.67874485", "0.63780165", "0.6302024", "0.6246768", "0.6212077", "0.61780024", "0.61293596", "0.61201185", "0.6114118", "0.61136496", "0.61136496", "0.61038357", "0.6096554", "0.6090343", "0.6087818", "0.6071965", "0.6054992", "0.60523176", "0.6049861", "0.60239035", "0.6023664", "0.60213757", "0.60169077", "0.6005377", "0.59996444", "0.5996763", "0.5989932", "0.59882456", "0.59818965", "0.59818655", "0.5978973", "0.5970863", "0.5970131", "0.5969763", "0.59644943", "0.59644943", "0.59644943", "0.59644943", "0.59644943", "0.59644943", "0.59644943", "0.59644943", "0.59558064", "0.5954838", "0.5953612", "0.5952213", "0.59502745", "0.5948558", "0.5944715", "0.594106", "0.594106", "0.5936051", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59354705", "0.59353554", "0.5934771", "0.5934771", "0.5932692", "0.5931711", "0.5930581", "0.5925548", "0.59253746", "0.5921671", "0.5921671", "0.5921671", "0.5919564", "0.59071946", "0.5894812", "0.5884717", "0.5884717", "0.5884717", "0.5879063", "0.5877879", "0.58740276", "0.58740276", "0.58508736", "0.584944", "0.5845731", "0.58381325", "0.5833941", "0.58268994", "0.58268994", "0.58268994", "0.582212", "0.5813165", "0.5812554", "0.58082473", "0.5797363" ]
0.7762734
0
Gets the name of the topic class that is specified in the config.
Получает имя класса темы, указанного в конфигурации.
public function getTopicClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName()\n {\n return 'acme.topic';\n }", "public function getName()\n {\n return 'agil.topic';\n }", "public function getClassName()\n {\n return $this->faqClass;\n }", "public function getTopicName();", "public function getName()\n {\n return 'publications.topic';\n }", "public function get_classname() {\n\t\tif ( !empty( $this->classname ) ) {\n\t\t\treturn $this->classname;\n\t\t}\n\t\t$this->classname = $this->sanatize_key( $this->name );\n\n\t\treturn $this->classname;\n\t}", "public function getTopicName(): string\n {\n return $this->topic->getTopicName();\n }", "function getTopicName();", "public function getClassName(): string\n {\n return $this->rawData['parameterArray']['fieldConf']['config']['t3baClass'] ?? '';\n }", "public function getTopicName()\n {\n return $this->topicName;\n }", "public function getClassName()\n {\n return $this->get(self::CLASS_NAME);\n }", "protected function getClassName() {\n $class_name = get_class($this);\n return $class_name;\n }", "public function getClassName() {\n\t\treturn $this->moufManager->getInstanceType($this->name);\n\t}", "public function getClassName()\n {\n return $this->__get(\"class_name\");\n }", "protected function getClassName()\n {\n return class_basename($this->namespace);\n }", "protected function SingularName() {\n\treturn 'vcqrTopicInfo';\n }", "public function getClassName()\n {\n return get_class($this->blog);\n }", "public static function get_class_name() {\n\t\treturn self::$class_name;\n\t}", "public function getClassname();", "protected function getClassName()\n {\n return basename($this->getNameInput()) . $this->type;\n }", "protected function getClassName(): string\n {\n return class_basename($this);\n }", "public function getTopic() {\n\t\t$result = '';\n\t\tif ($this->getAccount()) {\n\t\t\t$result = $this->getAccount()->getName() . ' (Account)';\n\t\t} elseif ($this->getContact()) {\n\t\t\t$result = $this->getContact()->getDisplayName() . ' (Contact)';\n\t\t} elseif ($this->getOpportunity()) {\n\t\t\t$result = $this->getOpportunity()->getName() . ' (Opportunity)';\n\t\t} elseif ($this->getLead()) {\n\t\t\t$result = $this->getLead()->getFullName() . ' (Lead)';\n\t\t}\n\t\treturn $result;\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClass():string\n {\n return $this->name;\n }", "protected static function getClassName() {\r\n\t\t\t// $classname = get_called_class();\r\n\t\t\t$classname = get_class($this);\r\n\t\t\treturn $classname;\r\n\t\t}", "protected function getClassName() {\n\t\tif (empty($this->tcaObjectName)) {\n\t\t\t// assuming that \"fooRepository\" contains \"foo\" objects\n\t\t\t$this->tcaObjectName = str_replace('Repository', '', get_class($this)); \n\t\t}\n\t\treturn $this->tcaObjectName;\n\t}", "function get_class_name() {\n\t\treturn get_class($this);\n\t\t\n\t}", "public function getClassName()\n\t{\n\t\treturn $this->get('ClassRef FullName');\n\t}", "public function bbp_get_topic_class( $classes, $topic_id ) {\n\t\treturn $this->get_badge_class( $classes, 'topic', $topic_id );\n\t}", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function get_class_name() {\n return ucfirst($this->className);\n }", "private function getClassName()\n : string\n {\n if (!Str::contains($this->name, 'Controller')) {\n return $this->name . 'Controller';\n }\n return $this->name;\n }", "public function getClassName(string $fqcn): string;", "public function getClassName() {\n\t\t$path = $this->getClass();\n\t\treturn Path::basename($path);\n\t}", "public static function getClassName();", "public static function getClassName();", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public function getClassName()\n {\n return $this->name;\n }", "public function getClassName() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_className === null)\n\t\t\t$this->load();\n\t\treturn $this->_className;\t\n\t}", "public static function getClassName(): string {\n return self::$className;\n }", "public static function getClassName()\n\t{\n\t\treturn self::CLASS_NAME;\n\t}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public static function getClass()\n\t{\n\t\t$class = WorkflowUtil::getValue( \"config\", \"class\" );\n\n\t\tif( !$class )\n\t\t{\n\t\t\t$class = 2;\n\t\t}\n\n\t\treturn $class;\n\t}", "public function getClassName() : string {\n try {\n $reflect = new ReflectionClass($this);\n return strtolower ($reflect->getShortName());\n } catch (\\ReflectionException $e) {\n echo ($e);\n }\n return \"\";\n }", "public function getClassName()\n {\n return $this->namespace . '\\\\' . $this->name;\n }", "protected function getClassName()\n {\n $class = studly_case($this->input->getArgument('class'));\n\n if (strpos($class, 'Seeder') === false) {\n $class .= 'Seeder';\n }\n\n return $class;\n }", "public function getName()\n {\n return $this->class;\n }", "public function getClassname() {\n return __CLASS__;\n }", "protected function feedClassName() {\n\t\t$feedType = $this->getFeedType();\n\n\t\treturn $feedType;\n\t}", "public function exchangeTopic(): string\n {\n return $this->exchangeName;\n }", "public function getClassName(): string\n\t{\n\t\treturn get_class($this);\n\t}", "public static function getClassName()\n {\n return static::CLASS_NAME;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n if (is_null($this->_className)) {\n $this->_className = get_called_class();\n }\n return $this->_className;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getTopic()\n {\n return $this->topic;\n }", "public function getClassName()\n\t{\n\t\t\n\t\techo __CLASS__;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "protected function getUserClass()\n {\n $forumConfig = $this->container->getParameter('valantir_forum');\n return $forumConfig['user_class'];\n }", "public function getName()\n\t{\n\t\treturn __CLASS__;\n\t}", "function getClassNameById($course_id){\n if(isset($this->courseList[$course_id]->controllerArray()['name'])){\n return $this->courseList[$course_id]->controllerArray()['name'];\n }else{\n return \"not a class\";\n }\n }", "public function getClassName()\n\t{\n\t\treturn $this->className;\n\t}", "public static function get_name_from_class($class) \n {\n $parts = explode('_',$class);\n return array_pop($parts);\n }", "static function class_name($className){\n\t\treturn $className;\n\t}", "public function getTopic()\r\n {\r\n return $this->topic;\r\n }", "public function getName()\n {\n return defined($this->get('confcat_name')) ? constant($this->get('confcat_name')) : $this->get('confcat_name');\n }", "protected function getClass(): string\n {\n $name = $this->qualifyClass($this->getNameInput());\n $namespace = $this->getNamespace($name);\n\n return \\str_replace($namespace.'\\\\', '', $name);\n }", "public function getName()\n {\n return __CLASS__;\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "private function _className() {\n\t\treturn get_class($this);\n\t}" ]
[ "0.7211653", "0.6990955", "0.6875443", "0.6840823", "0.6752869", "0.6733864", "0.6696334", "0.6692732", "0.66713965", "0.6656002", "0.66088694", "0.65779847", "0.6552345", "0.6511476", "0.64982325", "0.64893246", "0.6485503", "0.6474517", "0.64705336", "0.64226353", "0.6413199", "0.6403394", "0.6377551", "0.6377551", "0.6354068", "0.63445324", "0.6342295", "0.63344836", "0.6328568", "0.63074225", "0.6306534", "0.6306534", "0.6306534", "0.6306534", "0.6306534", "0.6306534", "0.6306534", "0.6306534", "0.6299958", "0.6294787", "0.6270567", "0.6264091", "0.62543523", "0.62543523", "0.62383485", "0.62383485", "0.6230198", "0.6226239", "0.6225863", "0.6222497", "0.62179595", "0.62179595", "0.62179595", "0.6209149", "0.6204922", "0.62043244", "0.6201733", "0.6194471", "0.6180885", "0.61781436", "0.6175015", "0.6172052", "0.6170492", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61604524", "0.61365527", "0.61345285", "0.61345285", "0.61345285", "0.61345285", "0.61345285", "0.6130588", "0.61302865", "0.61302865", "0.6127148", "0.6127148", "0.6127148", "0.6125546", "0.6119899", "0.611335", "0.61081934", "0.6105382", "0.6096557", "0.60901994", "0.60824025", "0.6072086", "0.6071229", "0.60653716", "0.6050531" ]
0.77583146
0
Gets the name of the comment class that is specified in the config.
Получает имя класса комментария, указанного в конфигурации.
public function getCommentClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName()\n {\n return $this->commentClass;\n }", "protected function getConfigName()\n {\n return 'codex-comments';\n }", "protected function _getClassComment()\n\t{\n\t\t//create an instance of the ReflectionClass passing the class name as parameter\n\t\t$reflection = new \\ReflectionClass($this->class);\n\n\t\t//get and return the comment block for this class\n\t\treturn $reflection->getDocComment();\n\n\t}", "function get_comment_class($class = '', $comment_id = \\null, $post_id = \\null)\n{\n}", "function GetName() {\n\t\treturn __(\"Comment Count\",'sitemap');\n\t}", "public function getClassName(): string\n {\n return $this->rawData['parameterArray']['fieldConf']['config']['t3baClass'] ?? '';\n }", "public function getClassName()\n\t{\n\t\treturn $this->get('ClassRef FullName');\n\t}", "public function getClassName()\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getClassName()\n {\n return get_class($this->blog);\n }", "public function getClassName()\n {\n return $this->__get(\"class_name\");\n }", "public function getClassName()\n\t{\n\t\t$namespace = preg_quote( $this->_reflection_class->getNamespaceName(), '#' );\n\t\t$class_name = $this->_reflection_class->getName();\n\n\t\treturn preg_replace( \"#^{$namespace}\\\\\\#\", '', $class_name );\n\t}", "public function getClassName()\n {\n return $this->name;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getResourceName()\n {\n return 'comment';\n }", "public function getClassName()\n {\n return $this->namespace . '\\\\' . $this->name;\n }", "public static function getClassName()\n\t{\n\t\treturn self::CLASS_NAME;\n\t}", "protected function getClassName()\n {\n return basename($this->getNameInput()) . $this->type;\n }", "protected function getClassName() {\n $class_name = get_class($this);\n return $class_name;\n }", "protected function getClassName(): string\n {\n return class_basename($this);\n }", "public static function getClassName(): string {\n return self::$className;\n }", "public static function get_class_name() {\n\t\treturn self::$class_name;\n\t}", "public function getClassName() {\n\t\treturn $this->moufManager->getInstanceType($this->name);\n\t}", "protected function getClassName()\n {\n return class_basename($this->namespace);\n }", "public function getClassName() {\n\t\t$path = $this->getClass();\n\t\treturn Path::basename($path);\n\t}", "protected function getClassName() {\n\t\tif (empty($this->tcaObjectName)) {\n\t\t\t// assuming that \"fooRepository\" contains \"foo\" objects\n\t\t\t$this->tcaObjectName = str_replace('Repository', '', get_class($this)); \n\t\t}\n\t\treturn $this->tcaObjectName;\n\t}", "public function getComment()\n {\n return $this->getConfig()->getCseComment();\n }", "public function getName()\n {\n return $this->class;\n }", "public function getClass():string\n {\n return $this->name;\n }", "public function getClassName()\n\t{\n\t\t\n\t\techo __CLASS__;\n\t}", "public static function getClassName()\n {\n return static::CLASS_NAME;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return $this->faqClass;\n }", "public function getClassName()\n\t{\n\t\treturn $this->className;\n\t}", "public function getName()\n\t{\n\t\treturn __CLASS__;\n\t}", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getClassname() {\n return __CLASS__;\n }", "public function getClassName() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_className === null)\n\t\t\t$this->load();\n\t\treturn $this->_className;\t\n\t}", "public function getClassName(): string\n\t{\n\t\treturn get_class($this);\n\t}", "function GetName() {\n\t\treturn __(\"Comment Average\",'sitemap');\n\t}", "public function getClassname();", "public static function getClassName();", "public static function getClassName();", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "protected static function getClassName() {\r\n\t\t\t// $classname = get_called_class();\r\n\t\t\t$classname = get_class($this);\r\n\t\t\treturn $classname;\r\n\t\t}", "public function getClassName()\n {\n return get_called_class();\n }", "public function getClass()\n {\n $str = get_class($this);\n $name = substr(strrchr($str,'\\\\'),1);\n return $name;\n }", "public function getClassName()\n {\n $full_class_name = $this->getClass();\n $pos = strrpos($full_class_name, '\\\\');\n\n return substr($full_class_name, $pos + 1);\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n if (is_null($this->_className)) {\n $this->_className = get_called_class();\n }\n return $this->_className;\n }", "protected function feedClassName() {\n\t\t$feedType = $this->getFeedType();\n\n\t\treturn $feedType;\n\t}", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public function class(): string\n {\n return $this->class;\n }", "public function getType()\n {\n return '\\Dlin\\Zendesk\\Entity\\TicketComment';\n }", "public function getClassName(): string;", "public function getClassName(): string;", "public function getClassName(): string;", "public static function getClass()\n\t{\n\t\t$class = WorkflowUtil::getValue( \"config\", \"class\" );\n\n\t\tif( !$class )\n\t\t{\n\t\t\t$class = 2;\n\t\t}\n\n\t\treturn $class;\n\t}", "public function className(): string\n {\n return $this->className;\n }", "static public function getClassName()\n {\n return get_called_class();\n }", "public function getComment()\n {\n $value = $this->get(self::comment);\n return $value === null ? (string)$value : $value;\n }", "public function getComment() {\n return isset($this->container['Comment']) ? $this->container['Comment'] : null;\n\t}", "public function getSource() {\n return 'comment';\n }", "public function defaultCommentString()\n {\n return __('Comment');\n }", "public function getName(): string\n {\n return 'config';\n }", "protected function getClass(): string\n {\n $name = $this->qualifyClass($this->getNameInput());\n $namespace = $this->getNamespace($name);\n\n return \\str_replace($namespace.'\\\\', '', $name);\n }", "public function getClassName() { return __CLASS__; }", "private function GetClassName() : string\n {\n $namespace = explode('\\\\', get_class($this->className));\n return end($namespace);\n }", "public function getClassName(){\n\t\treturn $this->className;\t\t\n\t}", "public static function className()\n\t{\n\t\treturn self::class;\n\t}" ]
[ "0.836009", "0.71195066", "0.6858578", "0.66616786", "0.66060483", "0.6601709", "0.6551159", "0.6534497", "0.65218157", "0.6517963", "0.6444389", "0.6444055", "0.6434327", "0.6434327", "0.6404213", "0.63905054", "0.6388232", "0.63833493", "0.6362723", "0.635989", "0.6356212", "0.6351352", "0.6348705", "0.6331129", "0.6320559", "0.6283883", "0.6274724", "0.6269749", "0.62605006", "0.62525177", "0.6249061", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.6239406", "0.623508", "0.623508", "0.623508", "0.6229092", "0.62163657", "0.6212305", "0.6211204", "0.6211204", "0.6211204", "0.6211204", "0.6211204", "0.6211204", "0.6211204", "0.6211204", "0.62077147", "0.620432", "0.620432", "0.620432", "0.6172857", "0.6172857", "0.6138101", "0.6124085", "0.6120965", "0.61170274", "0.61089456", "0.61042494", "0.61022085", "0.61022085", "0.608285", "0.6074221", "0.60738003", "0.6063287", "0.6063057", "0.6060713", "0.6057685", "0.60475296", "0.60338", "0.60338", "0.60195374", "0.6018586", "0.60171825", "0.60171825", "0.60171825", "0.60012424", "0.59897625", "0.5988937", "0.59857", "0.59600127", "0.5959969", "0.59598494", "0.59565806", "0.59535605", "0.5952998", "0.594762", "0.59470594", "0.59424776" ]
0.76392984
1
Gets the name of the parser class that is specified in the config.
Получает имя класса парсера, указанного в конфигурации.
public function getParserClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getParserClassInstance() {\n\t\t\t$args = func_get_args();\n\t\t\t$name = array_shift($args);\n\n\t\t\t$parser = \\Configure::read('Saito.Settings.ParserPlugin');\n\t\t\t$name = \"\\\\Plugin\\\\{$parser}Parser\\\\Lib\\\\$name\";\n\n\t\t\t$reflection = new \\ReflectionClass($name);\n\t\t\treturn $reflection->newInstanceArgs($args);\n\t\t}", "protected function getParser($parser)\n {\n switch($parser)\n {\n case 'regular':\n $parser = RegularParser::class;\n break;\n case 'wordpress':\n $parser = WordpressParser::class;\n break;\n default:\n $parser = RegexParser::class;\n break;\n }\n\n return $parser;\n }", "public function getClassName() {\n\t\treturn $this->moufManager->getInstanceType($this->name);\n\t}", "function getClassName()\n\t{\n\t\treturn \"Bayrell.Lang.LangBay.ParserBayProgram\";\n\t}", "public function getClassName()\n {\n return $this->get(self::CLASS_NAME);\n }", "function getClassName()\n\t{\n\t\treturn \"Bayrell.Lang.LangBay.ParserBayBase\";\n\t}", "public function getParser() {\n\t return $this->root->parser;\n\t}", "public function getClassName()\n {\n return $this->__get(\"class_name\");\n }", "protected function getClassName()\n {\n return basename($this->getNameInput()) . $this->type;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getClassname();", "public function getParser()\n\t{\n\t\treturn $this->parser;\n\t}", "public function getParser(){\n\t\treturn $this->parser;\n\t}", "public function getParser() {\n\t\treturn $this->parser;\n\t}", "public function getParser() {\n\t\treturn $this->parser;\n\t}", "public function getClassName()\n {\n return $this->name;\n }", "public function getParser()\n {\n\n return $this->parser;\n }", "public function getClassName()\n\t{\n\t\t\n\t\techo __CLASS__;\n\t}", "public function getClassName() {\n\t\t$path = $this->getClass();\n\t\treturn Path::basename($path);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName(): string\n {\n return $this->rawData['parameterArray']['fieldConf']['config']['t3baClass'] ?? '';\n }", "public function getClass():string\n {\n return $this->name;\n }", "protected function getClassName(): string\n {\n $explodedName = $this->getExplodedName();\n \n $class = Str::studly(array_pop($explodedName));\n\n if (!Str::endsWith($class, 'Response')) {\n $class .= 'Response';\n }\n\n return $class;\n }", "protected function getClassName()\n {\n return class_basename($this->namespace);\n }", "protected function getClassName() {\n $class_name = get_class($this);\n return $class_name;\n }", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "function getClassName() {\r\n \tpreg_match('/\\[\\s\\<\\w+?>\\s([\\w\\\\\\\\]+)/s', $this->__toString(), $matches);\r\n \t$class = isset($matches[1]) ? $matches[1] : null;\r\n if(in_array($class, [ 'array', 'string', 'char', 'bool', 'boolean', 'int', 'integer', 'double', 'float', 'real', 'mixed', 'number', 'null', 'callable', 'callback' ])) {\r\n return null;\r\n }\r\n return $class;\r\n }", "public function getClass()\n {\n $str = get_class($this);\n $name = substr(strrchr($str,'\\\\'),1);\n return $name;\n }", "public function getName()\n\t{\n\t\treturn __CLASS__;\n\t}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName(): string\n\t{\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_className === null)\n\t\t\t$this->load();\n\t\treturn $this->_className;\t\n\t}", "public function getName()\n {\n return $this->class;\n }", "public static function getClassName(): string {\n return self::$className;\n }", "public function getClassname() {\n return __CLASS__;\n }", "public function getParser() : Spring\\Object\\Parser {\n\t\t\treturn $this->parser;\n\t\t}", "function parser()\n {\n return o2system()->getService('parser');\n }", "static public function getParser($type)\n {\n $class = 'Doctrine_Parser_'.ucfirst($type);\n\n return new $class;\n }", "public function getParser($type)\n {\n $parser = false;\n\n switch ($type) {\n case 'php':\n $parser = $this->getPhpParser();\n break;\n case 'xml':\n $parser = $this->getXmlParser();\n break;\n }\n\n return $parser;\n }", "public function getClassName()\n {\n return $this->namespace . '\\\\' . $this->name;\n }", "protected function getClass(): string\n {\n $name = $this->qualifyClass($this->getNameInput());\n $namespace = $this->getNamespace($name);\n\n return \\str_replace($namespace.'\\\\', '', $name);\n }", "public static function getClassName();", "public static function getClassName();", "public function getName()\n {\n return __CLASS__;\n }", "public static function getClass()\n\t{\n\t\t$class = WorkflowUtil::getValue( \"config\", \"class\" );\n\n\t\tif( !$class )\n\t\t{\n\t\t\t$class = 2;\n\t\t}\n\n\t\treturn $class;\n\t}", "public function getParser()\n {\n if (!isset($this->_parser)) {\n $this->_parser = new Parser($this->_path);\n }\n return $this->_parser;\n }", "protected function getClassName(): string\n {\n return class_basename($this);\n }", "public function getName()\n {\n $str = get_class($this);;\n $pieces = explode('\\\\', $str);\n\n if ('SocietoPlugin' === $pieces[0]) {\n array_shift($pieces);\n }\n\n $name = '';\n\n foreach ($pieces as $piece) {\n $name .= $piece;\n if (preg_match('#(Bundle|Plugin)$#', $piece)) {\n break;\n }\n }\n\n $name .= ':'.array_pop($pieces);\n\n return $name;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getParser();", "public function getParser();", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public static function getClassName()\n\t{\n\t\treturn self::CLASS_NAME;\n\t}", "public function getClassName()\n {\n return get_class($this->blog);\n }", "protected function getClassName()\n {\n $class = studly_case($this->input->getArgument('class'));\n\n if (strpos($class, 'Seeder') === false) {\n $class .= 'Seeder';\n }\n\n return $class;\n }", "public function getConfigClass();", "protected static function getClassName() {\n return strtolower(preg_replace('#([a-zA-Z]+\\\\\\\\)+([a-zA-Z]+)#i', '$2', get_called_class()));\n }", "protected static function getClassName() {\r\n\t\t\t// $classname = get_called_class();\r\n\t\t\t$classname = get_class($this);\r\n\t\t\treturn $classname;\r\n\t\t}", "public static function get_class_name() {\n\t\treturn self::$class_name;\n\t}", "public function getClassName()\n {\n return get_called_class();\n }", "public function get_classname() {\n\t\tif ( !empty( $this->classname ) ) {\n\t\t\treturn $this->classname;\n\t\t}\n\t\t$this->classname = $this->sanatize_key( $this->name );\n\n\t\treturn $this->classname;\n\t}", "protected function getParser()\n\t{\n\t\tif (!isset($this->parser))\n\t\t{\n\t\t\t$this->parser = ParserBuilder::create()->build($this->path);\n\t\t}\n\n\t\treturn $this->parser;\n\t}", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public function getClassName() : string {\n try {\n $reflect = new ReflectionClass($this);\n return strtolower ($reflect->getShortName());\n } catch (\\ReflectionException $e) {\n echo ($e);\n }\n return \"\";\n }", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public static function get_class_name() {\n\t\treturn __CLASS__;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName()\n {\n if (is_null($this->_className)) {\n $this->_className = get_called_class();\n }\n return $this->_className;\n }", "public function getClassName()\n\t{\n\t\treturn $this->get('ClassRef FullName');\n\t}" ]
[ "0.6682969", "0.6451235", "0.62527645", "0.6121954", "0.6121398", "0.6044556", "0.5998079", "0.59837675", "0.59406185", "0.5940309", "0.5940309", "0.5940309", "0.5940309", "0.5940309", "0.5940309", "0.59275466", "0.59112936", "0.5910404", "0.5905992", "0.5905992", "0.5901781", "0.58853424", "0.58723944", "0.5866255", "0.5848218", "0.5848218", "0.5844687", "0.5836649", "0.58308214", "0.58249605", "0.58222604", "0.5807554", "0.5807554", "0.5807554", "0.5807554", "0.5807554", "0.5807554", "0.5807554", "0.5807554", "0.5807431", "0.58047026", "0.58017623", "0.580061", "0.580061", "0.580061", "0.5797218", "0.5792144", "0.57819575", "0.57737917", "0.57735825", "0.57664126", "0.5761029", "0.5743839", "0.5732948", "0.5731677", "0.5729917", "0.57269245", "0.57269245", "0.5726844", "0.5724982", "0.5723249", "0.57161176", "0.5708122", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.57007813", "0.5693423", "0.5693423", "0.5692456", "0.5692456", "0.56901693", "0.56889915", "0.5688819", "0.56883943", "0.56856257", "0.5682545", "0.5681292", "0.5675556", "0.5665204", "0.56641", "0.5648391", "0.56364286", "0.56305593", "0.5622944", "0.5622944", "0.5622817", "0.5622817", "0.5622817", "0.5622021", "0.5622017" ]
0.7541585
0
Tests that form caches is invalidated when Antibot settings are updated.
Тесты, проверяющие, что кэши формы становятся недействительными при обновлении настроек Antibot.
public function testFormCacheInvalidation() { $antibot_settings = $this->config('antibot.settings'); // Unprotect all forms. $antibot_settings->set('form_ids', [])->save(); // Warm the page cache. $this->verifyPageCache(Url::fromRoute('user.pass'), 'MISS'); $this->verifyPageCache(Url::fromRoute('user.pass'), 'HIT'); // Protect the user password form. $antibot_settings->set('form_ids', ['user_pass'])->save(); // Check that the cache has been invalidated. $this->verifyPageCache(Url::fromRoute('user.pass'), 'MISS'); // Check that the Antibot protection has been added. $this->assertSession()->hiddenFieldExists('antibot_key'); // Reverse user password form protection. $antibot_settings->set('form_ids', [])->save(); $this->verifyPageCache(Url::fromRoute('user.pass'), 'MISS'); // Check that the Antibot protection has been removed. $this->assertSession()->hiddenFieldNotExists('antibot_key'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webform_plus_admin_settings_form_submit($form, &$form_state) {\n cache_clear_all();\n drupal_set_message(t('Cache cleared'));\n}", "function gsb_academic_year_settings_form_submit(array &$form, array &$form_state) {\n views_invalidate_cache();\n}", "protected function _onUpdate(Form_AdminGeneral $form)\n {\n // don't remove elements from the actual form so we can render them all\n // if it's invalid\n $form = clone $form;\n\n switch ($this->_request->getParam('cacheBackend')) {\n case 'Zend_Cache_Backend_Apc':\n if (!extension_loaded('apc')) {\n throw new UnexpectedValueException('apc extension is not loaded');\n }\n $form->removeElement('cacheMemcacheHost');\n $form->removeElement('cacheMemcachePort');\n $form->removeElement('cacheFile');\n $form->removeElement('cacheXcacheUser');\n $form->removeElement('cacheXcachePassword');\n break;\n\n case 'Zend_Cache_Backend_Xcache':\n if (!extension_loaded('xcache')) {\n throw new UnexpectedValueException('xcache extension is not loaded');\n }\n $form->removeElement('cacheMemcacheHost');\n $form->removeElement('cacheMemcachePort');\n $form->removeElement('cacheFile');\n break;\n\n case 'Zend_Cache_Backend_Memcached':\n if (!extension_loaded('memcache')) {\n throw new UnexpectedValueException('memcache extension is not loaded');\n }\n $form->removeElement('cacheFile');\n $form->removeElement('cacheXcacheUser');\n $form->removeElement('cacheXcachePassword');\n break;\n\n case 'Zend_Cache_Backend_Libmemcached':\n if (!extension_loaded('memcached')) {\n throw new UnexpectedValueException('memcached extension is not loaded');\n }\n $form->removeElement('cacheFile');\n $form->removeElement('cacheXcacheUser');\n $form->removeElement('cacheXcachePassword');\n break;\n\n case 'Zend_Cache_Backend_Sqlite':\n if (!extension_loaded('sqlite3')) {\n throw new UnexpectedValueException('sqlite3 extension is not loaded');\n }\n case 'Zend_Cache_Backend_File':\n default:\n $form->removeElement('cacheMemcacheHost');\n $form->removeElement('cacheMemcachePort');\n $form->removeElement('cacheXcacheUser');\n $form->removeElement('cacheXcachePassword');\n break;\n }\n\n if (!$form->isValid($this->_request->getPost())) {\n return false;\n }\n\n $wordPress = $this->_bootstrap->bootstrap('wordPress')\n ->getResource('wordPress');\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n if (preg_match('/^bootstrap/', $key)) {\n $value = $value ? 'Yes' : 'No';\n }\n\n $wordPress->setCustomOption($key, $value);\n }\n\n return true;\n }", "function valet_admin_form_submit($form, &$form_state){\n\tcache_clear_all('valet_lookup', 'cache');\n}", "function project21_admin_form($form, &$form_state) {\n\n $form['project21_clear_caches'] = array(\n '#type' => 'checkbox',\n '#title' => t('Clear all table caches?'),\n );\n\n $form['#submit'][] = 'project21_form_submit';\n\n return system_settings_form($form);\n}", "public function clearInvalidedCache()\n {\n if ($this->isElementPresent(self::$xpathCacheInvalidated)) {\n $this->clickAndWait(self::$xpathCacheInvalidated);\n $this->validatePage('cache_storage_management');\n\n $invalided = array('cache_disabled', 'cache_invalided');\n foreach ($invalided as $value) {\n $xpath = $this->_getControlXpath('pageelement', $value);\n $qty = $this->getXpathCount($xpath);\n for ($i = 1; $i < $qty + 1; $i++) {\n $fillData = array('path' => $xpath . '[' . $i . ']//input',\n 'value' => 'Yes');\n $this->_fillFormCheckbox($fillData);\n }\n }\n $this->fillForm(array('cache_action' => 'Refresh'));\n\n $selectedItems = $this->getText($this->_getControlXpath('pageelement', 'selected_items'));\n $this->addParameter('qtySelected', $selectedItems);\n\n $this->clickButton('submit', false);\n $alert = $this->isAlertPresent();\n if ($alert) {\n $text = $this->getAlert();\n $this->fail($text);\n }\n $this->waitForNewPage();\n $this->validatePage('cache_storage_management');\n }\n }", "function settings_update_Network_Admin_GForms_TMP() {\n\t\tcheck_admin_referer( 'gforms-tmp-edit-settings' );\n\t\t\n\t\t$action = isset( $_POST ['action2'] ) ? $_POST ['action2'] : false;\n\t\t\n\t\t$is_token_authorized = $this->is_api_authorized_GForms_TMP();\n\t\t\n\t\t$message = isset( $_POST ['gforms_tmp_google_oauth_message'] ) ? $_POST ['gforms_tmp_google_oauth_message'] : false;\n\t\t\n\t\t$error = isset( $_POST ['gforms_tmp_google_oauth_error'] ) ? $_POST ['gforms_tmp_google_oauth_error'] : false;\n\t\t\n\t\t$updated = false;\n\t\t\n\t\tif ($action) {\n\t\t\t\n\t\t\tif ($action == 'authorize' && $is_token_authorized) {\n\t\t\t\t\n\t\t\t\t$updated = true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($action == 'deauthorize' && ! $is_token_authorized) {\n\t\t\t\t\n\t\t\t\t$updated = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\twp_redirect( add_query_arg( array (\n\t\t\t\t'updated' => ($updated ? 'updated' : 'failed'),\n\t\t\t\t'operation' => $action,\n\t\t\t\t'msg' => rawurlencode( $message ),\n\t\t\t\t'error' => rawurlencode( $error ) \n\t\t), network_admin_url( 'admin.php?page=' . $this::slug . '&t=settings' ) ) );\n\t\t\n\t\texit();\n\t}", "function testReviewFormGetsUpdated(){\n\t}", "function wpse_check_settings( $option, $old_value, $new_value ) {\n if ( $option == 'theme_cache_settings') {\n\n if ( isset( $new_value['az_cache_clear_all'] ) && $new_value['az_cache_clear_all'] == '1' ) {\n\n // Unset the checkbox for clearing cache\n $new_value['az_cache_clear_all'] = '';\n update_option( 'theme_cache_settings', $new_value );\n AZ_Cache::delete_all_transients();\n\n }\n\n }\n\n\n}", "function clear_caching()\n { \n global $FNS;\n \n $FNS->clear_caching($_POST['type']);\n \n return Utilities::clear_cache_form(TRUE);\n }", "function blink_admin_settings_validate($form, &$form_state) {\n // check if the user clicked \"reset to defaults\" button and flag to reload defaults when displaying form next\n $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';\n if ($op == t('Reset to defaults')) return; \n $server_list = array();\n for ($i=0; $i<20; $i++) if (isset($form_state['values'][\"blink_server_{$i}\"])) {\n $server = $form_state['values'][\"blink_server_{$i}\"];\n $removed = $form_state['values'][\"blink_server_removed_{$i}\"];\n $blsid = $form_state['values'][\"blink_server_blsid_{$i}\"];\n if (!$removed) {\n if (in_array($server, $server_list)) { // duplicate server name\n form_set_error('', t('Each server in the list must be unique.'));\n } \n else {\n $server_list[] = $server;\n if (!$form_state['values'][\"blink_server_weight_{$i}\"]) $form_state['values'][\"blink_server_weight_{$i}\"] = 1;\n if (strpos($server, '://')) $form_state['values'][\"blink_server_{$i}\"] = trim(substr($server, strpos($server, '://')+3));\n }\n }\n }\n //drupal_set_message('blink_admin_settings_validate: ' . $stopwatch->elapsed());\n}", "private function clearWebAdminSystemFormCache($event)\n\t{\n\t\t//clear web form system form cache\n\t\t$this->getSystemFormManager()->clearFormCache(\"Core\\Forms\\SystemForms\\Forms\\FormsForm\");\n\t}", "public function testGetThenUpdateSettings(): void\n {\n $index = $this->createEmptyIndex($this->safeIndexName());\n\n $resetPromise = $index->resetSettings();\n $this->assertIsValidPromise($resetPromise);\n $index->waitForTask($resetPromise['taskUid']);\n\n $settings = $index->getSettings();\n $promise = $index->updateSettings($settings);\n $this->assertIsValidPromise($promise);\n $index->waitForTask($promise['taskUid']);\n }", "function dmn_edit_page_submit($form, &$form_state)\r\n{\r\n $update = dmn_edit_page_db_update($form_state);\r\n if (isset($update)) {\r\n drupal_set_message(t('values updated'));\r\n cache_clear_all('*', 'dmn_cache', TRUE);\r\n drupal_goto('admin/config/content/dmn/editfields');\r\n } else {\r\n drupal_set_message(t('something went wrong'), 'error');\r\n }\r\n}", "public function testSettingsUpdateSetting()\n {\n }", "public function testForm() {\n $form = $this->formBuilder->getForm($this->formClass);\n $this->assertCount(4, Element::children($form));\n $this->assertArrayHasKey('urls', $form);\n\n $form_state = new FormState();\n $form_state->setValue('urls', 'garbage url');\n $this->formBuilder->submitForm($this->formClass, $form_state);\n $this->assertNotEmpty($form_state->getErrors());\n $form_state->clearErrors();\n\n $form_state->setValue('urls', 'http://google.com');\n $this->formBuilder->submitForm($this->formClass, $form_state);\n $this->assertNotEmpty($form_state->getErrors());\n $form_state->clearErrors();\n\n $form_state->setValue('urls', 'http://explorecourses.stanford.edu/search');\n $this->formBuilder->submitForm($this->formClass, $form_state);\n $this->assertNotEmpty($form_state->getErrors());\n $form_state->clearErrors();\n\n $form_state->setValue('urls', $this->validUrl);\n $this->formBuilder->submitForm($this->formClass, $form_state);\n $this->assertEmpty($form_state->getErrors());\n\n $config_urls = $this->config('hs_courses_importer.importer_settings')\n ->get('urls');\n $this->assertEquals($this->validUrl, reset($config_urls));\n }", "public function shouldResetCache();", "private function clearCommsAdminSystemFormCache($event)\n\t{\n\t\t//clear comms admin system form cache\n\t\t$this->getSystemFormManager()->clearFormCache(\"Core\\Forms\\SystemForms\\Forms\\FormsForm\");\n\t}", "public function testAlterForm()\n {\n // So we don't really need expectations or assertions\n $mockForm = m::mock('\\Laminas\\Form\\Form');\n $this->assertNull($this->sut->alterForm($mockForm));\n }", "protected static function clear_cache(){\n\t\tself::$index = array();\n\t\tself::$registry_cache = array();\n\t\tself::$stored_forms = array();\n\t\twp_cache_delete( '_caldera_forms_forms', 'options' );\n\t\tdelete_transient( self::$registry_cache_key );\n\t}", "function dic_admin_settings_form_submit($form, $form_state) {\n // flush the cache of the current environment\n _dic_get_helper()->flushCaches();\n\n // save form values\n foreach ($form_state['values'] as $key => $value) {\n if (strpos($key, 'dic_') === 0) {\n variable_set($key, $value);\n }\n }\n\n // re-initialize the kernel with current values\n $helper = _dic_get_helper(true);\n // flush the cache of the target environment\n $helper->flushCaches();\n // prepare the new container for the next request\n $helper->getContainer();\n}", "public function test_access_manager_uses_cached_config_key() {\n global $FULLME;\n $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);\n\n $accessmanager = $this->get_access_manager();\n\n $configkey = $accessmanager->get_valid_config_key();\n\n // Set up dummy request.\n $FULLME = 'https://example.com/moodle/mod/quiz/attempt.php?attemptid=123&page=4';\n $expectedhash = hash('sha256', $FULLME . $configkey);\n $_SERVER['HTTP_X_SAFEEXAMBROWSER_CONFIGKEYHASH'] = $expectedhash;\n\n $this->assertTrue($accessmanager->validate_config_key());\n\n // Change settings (but don't save) and check that still can validate config key.\n $quizsettings = quiz_settings::get_record(['quizid' => $this->quiz->id]);\n $quizsettings->set('showsebtaskbar', 0);\n $this->assertNotEquals($quizsettings->get_config_key(), $configkey);\n $this->assertTrue($accessmanager->validate_config_key());\n\n // Now save settings which should purge caches but access manager still has config key.\n $quizsettings->save();\n $this->assertNotEquals($quizsettings->get_config_key(), $configkey);\n $this->assertTrue($accessmanager->validate_config_key());\n\n // Initialise a new access manager. Now validation should fail.\n $accessmanager = $this->get_access_manager();\n $this->assertFalse($accessmanager->validate_config_key());\n }", "function fancybox_admin_settings_form_submit($form, &$form_state) {\n $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';\n if ($op == t('Reset to defaults')) {\n variable_del('fancybox_settings');\n variable_del('fancybox_path');\n variable_del('fancybox_files');\n drupal_set_message(t('The configuration options have been reset to their default values.'));\n }\n else {\n\n // Remove trailing slash from path\n $path = rtrim($form_state['values']['fancybox_path'], '/ ');\n\n variable_set('fancybox_path', $path);\n variable_set('fancybox_files', _detect_fancybox_files($path));\n\n _save_fancybox_settings($form_state);\n\n drupal_set_message(t('The configuration options have been saved.'));\n }\n}", "public static function submitResetHttpRequestCache(array $form, FormStateInterface $form_state) {\n $form_state->setRebuild();\n $theme = SystemThemeSettings::getTheme(Element::create($form), $form_state);\n $cache = \\Drupal::keyValueExpirable('theme:' . $theme->getName() . ':http');\n $cache->deleteAll();\n }", "public function testUpdateSettings()\n {\n $this->markTestIncomplete(\n 'Test of \"updateSettings\" method has not been implemented yet.'\n );\n }", "public function cacheSubmit() {\n views_invalidate_cache();\n $this->messenger()->addStatus($this->t('The cache has been cleared.'));\n }", "private function setupSystemFormCache()\n\t{\n\t\tif (!$this->cache)\n\t\t{\n\t\t\t$cache = $this->getServiceLocator()->get(\"FrontCore\\Caches\\Cache\");\n\t\t\t$this->cache = $cache;\n\t\t}//end if\n\n\t\treturn $this->cache;\n\t}", "function webform_ab_clear_test_data_confirm_submit($form, &$form_state) {\n db_delete('webform_ab_conversion')\n ->condition('test_nid', $form['#test_nid'])\n ->execute();\n db_delete('webform_ab_hits')\n ->condition('test_nid', $form['#test_nid'])\n ->execute();\n db_update('webform_ab_forms')\n ->fields(array(\n 'status' => WEBFORM_AB_WEBFORM_STATUS_ACTIVE,\n 'win_time' => 0,\n ))\n ->condition('test_nid', $form['#test_nid'])\n ->execute();\n // Notify other modules that may have test data to wipe\n module_invoke_all('webform_ab_reset_data', $form['#test_nid']);\n drupal_set_message(t('The data has been cleared.'));\n $form_state['redirect'] = 'node/' . $form['#test_nid'] . '/reports';\n}", "function filter_admin_configure_submit($form, &$form_state) {\n cache_clear_all($form_state['values']['format'] .':', 'cache_filter', TRUE);\n}", "public function settingsForm(&$form, &$form_state) {\n // Nothing to do...\n }", "public function testCacheOption() {\n $notBlankConstraint = new \\Symfony\\Component\\Validator\\Constraints\\NotBlank();\n\n $mockInput = $this->getMock('AIV\\InputInterface');\n $mockInput->expects($this->once())\n ->method('getData')\n ->will($this->returnCallback(function(){\n return ['name' => 'John Smith'];\n }));\n\n $validator = new Validator();\n $validator->setOptions(['cache' => true]);\n $validator->setConstraints([\n 'name' => [$notBlankConstraint]\n ]);\n $validator->setInput($mockInput);\n $validator->hasErrors();\n $validator->hasErrors();\n $validator->getErrors();\n $validator->getErrors();\n $validator->getData();\n $validator->getData();\n }", "public function check_compile_cache_invalidation()\n {\n }", "function clear_cache_form($message = FALSE)\n { \n global $DSP, $LANG;\n \n if ( ! $DSP->allowed_group('can_admin_utilities'))\n {\n return $DSP->no_access_message();\n }\n \n $DSP->title = $LANG->line('clear_caching');\n $DSP->crumb = $LANG->line('clear_caching'); \n \n \n if ($message == TRUE)\n {\n $DSP->body = $DSP->qdiv('success', $LANG->line('cache_deleted')); \n }\n\n\t\t$DSP->body .= $DSP->div('box320');\n $DSP->body .= $DSP->form('C=admin'.AMP.'M=utilities'.AMP.'P=clear_caching');\n $DSP->body .= $DSP->heading($LANG->line('clear_caching')); \n \n $DSP->body .= $DSP->div('itemWrapper');\n \n if ( ! isset($_POST['type']))\n {\n $_POST['type'] = 'page'; \n } \n \n $selected = ($_POST['type'] == 'page') ? 1 : '';\n\n $DSP->body .= $DSP->input_radio('type', 'page', $selected).$LANG->line('page_caching').BR; \n \n $selected = ($_POST['type'] == 'tag') ? 1 : '';\n \n $DSP->body .= $DSP->input_radio('type', 'tag', $selected).$LANG->line('tag_caching').BR;\n \n $selected = ($_POST['type'] == 'db') ? 1 : '';\n\n $DSP->body .= $DSP->input_radio('type', 'db', $selected).$LANG->line('db_caching').BR;\n \n $selected = ($_POST['type'] == 'all') ? 1 : '';\n\n $DSP->body .= $DSP->input_radio('type', 'all', $selected).$LANG->line('all_caching');\n \n $DSP->body .= $DSP->div_c();\n $DSP->body .= $DSP->qdiv('itemWrapper', BR.$DSP->input_submit($LANG->line('submit')));\n $DSP->body .= $DSP->form_c();\n $DSP->body .= $DSP->div_c();\n }", "public function updateForm()\n {\n if ($userDefinedForm = $this->owner->getController()->data()) {\n \n if ($userDefinedForm->EnableSpamGuard) {\n $this->owner->enableSpamProtection();\n }\n \n }\n }", "public function _testSpiChangeForm() {\n // Connect site on key and id.\n $edit_fields = [\n 'acquia_identifier' => $this->acqtestId,\n 'acquia_key' => $this->acqtestKey,\n ];\n $submit_button = 'Connect';\n $this->drupalPostForm($this->credentialsPath, $edit_fields, $submit_button);\n $this->drupalGet($this->settingsPath);\n $this->assertText($this->acquiaConnectorStrings('subscription'), 'Subscription connected with key and identifier');\n // No changes detected.\n $edit_fields = [\n 'acquia_dynamic_banner' => TRUE,\n 'name' => $this->acqtestName,\n 'machine_name' => $this->acqtestMachineName,\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->settingsPath, $edit_fields, $submit_button);\n $this->assertText($this->acquiaConnectorStrings('saved'), 'The configuration options have been saved.');\n $this->drupalGet($this->statusReportUrl);\n $this->clickLink('manually send SPI data');\n $this->drupalGet($this->environmentChangePath);\n $this->assertText('No changes detected', 'No changes are currently detected.');\n // Detect Changes.\n $edit_fields = [\n 'acquia_dynamic_banner' => TRUE,\n 'name' => $this->acqtestName,\n 'machine_name' => $this->acqtestMachineName . '_change',\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->settingsPath, $edit_fields, $submit_button);\n $this->assertText($this->acquiaConnectorStrings('saved'), 'The configuration options have been saved.');\n $this->assertText('A change has been detected in your site environment. Please check the Acquia SPI status on your Status Report page for more information', 'Changes have been detected');\n $this->drupalGet($this->environmentChangePath);\n // Check environment change action.\n $elements = $this->xpath('//input[@name=:name]', [':name' => 'env_change_action']);\n $expected_values = ['block', 'update', 'create'];\n foreach ($elements as $element) {\n $expected = array_shift($expected_values);\n $this->assertIdentical((string) $element['value'], $expected);\n }\n // Test \"block\" the connector from sending data to NSPI.\n $edit_fields = [\n 'env_change_action' => 'block',\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->environmentChangePath, $edit_fields, $submit_button);\n $this->assertText('This site has been blocked from sending profile data to Acquia Cloud.');\n $this->assertText('You have blocked your site from sending data to Acquia Cloud.');\n // Test unblock site.\n $this->clickLink('Unblock this site');\n $this->assertText('The Acquia Connector is blocked and is not sending site profile data to Acquia Cloud for evaluation.');\n $edit_fields = [\n 'env_change_action[unblock]' => TRUE,\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->environmentChangePath, $edit_fields, $submit_button);\n $this->assertText('Your site has been unblocked and is sending data to Acquia Cloud.');\n $this->clickLink('manually send SPI data');\n $this->assertText('A change has been detected in your site environment. Please check the Acquia SPI status on your Status Report page for more information.');\n // Test update existing site.\n $this->clickLink('confirm the action you wish to take');\n $edit_fields = [\n 'env_change_action' => 'update',\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->environmentChangePath, $edit_fields, $submit_button);\n // Test new site in Acquia Cloud.\n $edit_fields = [\n 'acquia_dynamic_banner' => TRUE,\n 'name' => $this->acqtestName,\n 'machine_name' => $this->acqtestMachineName,\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->settingsPath, $edit_fields, $submit_button);\n $this->assertText($this->acquiaConnectorStrings('saved'), 'The configuration options have been saved.');\n $this->assertText('A change has been detected in your site environment. Please check the Acquia SPI status on your Status Report page for more information.');\n $this->drupalGet($this->statusReportUrl);\n $this->clickLink('confirm the action you wish to take');\n $edit_fields = [\n 'env_change_action' => 'create',\n 'name' => '',\n 'machine_name' => '',\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->environmentChangePath, $edit_fields, $submit_button);\n $this->assertText($this->acquiaConnectorStrings('site-name-required'), 'Name field is required.');\n $this->assertText($this->acquiaConnectorStrings('site-machine-name-required'), 'Machine name field is required.');\n $edit_fields = [\n 'env_change_action' => 'create',\n 'name' => $this->acqtestName,\n 'machine_name' => $this->acqtestMachineName,\n ];\n $submit_button = 'Save configuration';\n $this->drupalPostForm($this->environmentChangePath, $edit_fields, $submit_button);\n $this->assertText($this->acquiaConnectorStrings('first-connection'), 'First connection from this site');\n }", "public function testForm() {\n $this->drupalGet($this->urlValid);\n $this->assertResponse(403);\n $this->drupalLogin($this->adminUser);\n $this->drupalGet($this->urlInvalid);\n $this->assertResponse(404);\n // Test the plain version of the form.\n $this->drupalGet($this->urlValid);\n $this->assertResponse(200);\n $this->assertRaw('Save configuration');\n $this->assertNoRaw('Cancel');\n $this->assertFieldByName('textfield');\n // Test the modal dialog version of the form.\n $this->drupalGet($this->urlValidDialog);\n $this->assertResponse(200);\n $this->assertRaw('Save configuration');\n $this->assertRaw('Cancel');\n $this->assertFieldByName('textfield');\n // Test the AJAX response of the modal dialog version.\n $json = $this->drupalPostAjaxForm($this->urlValidDialog->toString(), [], ['op' => 'Cancel']);\n $this->assertEqual('closeDialog', $json[1]['command']);\n $this->assertEqual(2, count($json));\n }", "protected function setUpSettings() {\n // This form will never be reached.\n }", "public function testAccountSettingUpdatePassword()\n {\n // log user in\n $client = $this->makeClient();\n $crawler = $client->request('GET', '/login');\n $form = $crawler->selectButton('Login')->form();\n $form->setValues(['_username' => 'change_password@gmail.com', '_password' => 'password']);\n $client->submit($form);\n\n // Change the password and make sure the flash message appears\n $crawler = $client->request('GET', '/account-settings/change-password');\n $this->assertStatusCode(200, $client);\n $form = $crawler->selectButton('Change Password')->form();\n $form->get('change_password[currentPassword]')->setValue('password');\n $form->get('change_password[newPassword]')->setValue('new_password');\n $crawler = $client->submit($form);\n Assert::assertEquals(1,$crawler->filter('#success-flash-message')->count());\n\n // logout user\n $client->request('GET', '/logout');\n\n // login in user\n $crawler = $client->request('GET', '/login');\n $form = $crawler->selectButton('Login')->form();\n $form->setValues(['_username' => 'change_password@gmail.com', '_password' => 'new_password']);\n $client->submit($form);\n\n // Go to protected page to make sure user is logged in\n $client->request('GET', '/account-settings/information');\n $this->assertStatusCode(200, $client);\n }", "public function testLoginActionFlushesFormKey()\n {\n $beforeKey = $this->formKey->get();\n $this->_customerSession->loginById(1);\n $afterKey = $this->formKey->get();\n\n $this->assertNotEquals($beforeKey, $afterKey);\n }", "function pass_alter_passwords_form($form, &$form_state) {\n $form['pass_alter_badpasswords'] = array(\n '#type' => 'textfield',\n '#title' => t('Bad Passwords'),\n '#default_value' => variable_get('pass_alter_badpasswords'),\n '#description' => t('Enter a list of bad passes here'),\n );\n\n return(system_settings_form($form)); // Does variable_set()\n}", "public function testResetContentCached()\n {\n oxTestModules::addFunction('oxUtils', 'oxResetFileCache', '{ $_GET[\"testReset\"] = \"resetDoneMain\"; }');\n\n $oAdminView = oxNew('oxAdminView');\n $oAdminView->resetContentCache();\n\n $this->assertEquals('resetDoneMain', $_GET[\"testReset\"]);\n }", "function site_update_Network_Admin_GForms_TMP() {\n\t\t$id = isset( $_POST ['id'] ) ? $_POST ['id'] : 0;\n\t\t\n\t\t$updated = false;\n\t\t\n\t\tif ($id) {\n\t\t\t\n\t\t\tcheck_admin_referer( 'gforms-tmp-edit-site' );\n\t\t\t\n\t\t\t$details = get_blog_details( $id );\n\t\t\t\n\t\t\t$attributes = array (\n\t\t\t\t\t'archived' => $details->archived,\n\t\t\t\t\t'spam' => $details->spam,\n\t\t\t\t\t'deleted' => $details->deleted \n\t\t\t);\n\t\t\t\n\t\t\tif (! in_array( 1, $attributes )) {\n\t\t\t\t\n\t\t\t\t$gforms_tmp_admin_client_id = isset( $_POST ['gforms_tmp_admin_client_id'] ) ? $_POST ['gforms_tmp_admin_client_id'] : false;\n\t\t\t\t\n\t\t\t\t$gforms_tmp_admin_client_name = isset( $_POST ['gforms_tmp_admin_client_name'] ) ? $_POST ['gforms_tmp_admin_client_name'] : false;\n\t\t\t\t\n\t\t\t\t$gforms_tmp_active = isset( $_POST ['gforms_tmp_active'] ) ? 1 : 0;\n\t\t\t\t\n\t\t\t\tif ($gforms_tmp_admin_client_id || $gforms_tmp_admin_client_name || ! $gforms_tmp_active) {\n\t\t\t\t\t\n\t\t\t\t\t$updated = true;\n\t\t\t\t\t\n\t\t\t\t\tswitch_to_blog( $id );\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'gforms_tmp_admin_client_id', $gforms_tmp_admin_client_id );\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'gforms_tmp_admin_client_name', $gforms_tmp_admin_client_name );\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'gforms_tmp_active', $gforms_tmp_active );\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'gforms_tmp_last_update', time() );\n\t\t\t\t\t\n\t\t\t\t\trestore_current_blog();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\twp_redirect( add_query_arg( array (\n\t\t\t\t'update' => $updated ? 'updated' : 'failed',\n\t\t\t\t'id' => $id \n\t\t), network_admin_url( 'admin.php?page=' . $this::slug . '&action=edit' ) ) );\n\t\t\n\t\texit();\n\t}", "public function clearFormCache($namespace)\n\t{\n\t\t//is system form cache enabled?\n\t\tif ($this->getServiceLocator()->get(\"config\")[\"front_end_application_config\"][\"cache_enabled_system_forms\"] !== TRUE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$this->setupSystemFormCache()->clearItem(\"system-form-\" . str_replace(\"\\\\\", \"-\", $namespace));\n\t}", "public function testDisabledRegistrationForm() : void\n {\n // form is no longer displayed.\n config(['auth.user_registration_form_enabled' => false]);\n $response = $this->get('/register');\n $response->assertStatus(404);\n }", "public function maybe_clear_fields_cache() {\n\n\t\t// If the clear_field_cache parameter isn't set, exit.\n\t\tif ( 'true' !== rgget( 'clear_field_cache' )) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear the cache.\n\t\tdelete_transient( $this->fields_transient_name );\n\n\t\t// Add success message.\n\t\tGFCommon::add_message( esc_html__( 'Custom fields cache has been cleared.', 'gravityformszohocrm' ) );\n\n\t}", "public function testLoggedInSubmittedValidChanges() {\n $stmt = PDODAO::$PDO->query('SELECT o.* FROM '. $this->user_database .\n '.tu_owners o WHERE o.email = \"me@example.com\"');\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->assertEqual($row['timezone'], 'UTC');\n $this->assertEqual($row['email_notification_frequency'], 'daily');\n\n $this->simulateLogin('me@example.com', false, true);\n\n // Set $_POST vars\n $_POST['Done'] = 'Done';\n $_POST['timezone'] = 'America/Los_Angeles';\n $_POST['csrf_token'] = parent::CSRF_TOKEN;\n $controller = new SettingsController(true);\n $results = $controller->go();\n\n // Assert that timezone is new values\n $stmt = PDODAO::$PDO->query('SELECT o.* FROM '. $this->user_database .\n '.tu_owners o WHERE o.email = \"me@example.com\"');\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->assertEqual($row['timezone'], 'America/Los_Angeles');\n $this->assertEqual($row['email_notification_frequency'], 'daily');\n\n $this->debug($results);\n $this->assertPattern(\"/Settings/\", $results);\n $this->assertPattern(\"/Saved your changes/\", $results);\n }", "public function testViewUpdateCacheError() {\n\t\t$this->testAction(\n\t\t\t'/rss_readers/rss_readers/view/185',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$this->assertTextEquals('view', $this->controller->view);\n\t}", "function squeeze_admin_settings_submit($form, $form_state) {\n // Grab the values store them in the 'variable DB' database (and print to log)\n $squeeze_enable_value = $form_state['values']['squeeze_enable']; \n variable_set('enable_squeeze_for', $squeeze_enable_value);\n watchdog(\"Squeeze\", 'Changed squeeze enable setting to: %value', array('%value'=>$squeeze_enable_value));\n \n $squeeze_timer_value = $form_state['values']['squeeze_timer']; \n variable_set('squeeze_timer', $squeeze_timer_value);\n watchdog(\"Squeeze\", 'Changed squeeze timer setting to: %value', array('%value'=>$squeeze_timer_value));\n \n $squeeze_clicks_value = $form_state['values']['squeeze_timer']; \n variable_set('squeeze_timer', $squeeze_clicks_value);\n watchdog(\"Squeeze\", 'Changed squeeze timer setting to: %value', array('%value'=>$squeeze_clicks_value));\n \n \n \n \n \n}", "private function setFormCache($namespace, $objData)\n\t{\n\t\t//is system form cache enabled?\n\t\tif ($this->getServiceLocator()->get(\"config\")[\"front_end_application_config\"][\"cache_enabled_system_forms\"] !== TRUE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$this->setupSystemFormCache()->setCacheItem(\"system-form-\" . str_replace(\"\\\\\", \"-\", $namespace), $objData, array(\"ttl\" => (60 * 5)));\n\t}", "public function testUpdateSettingsFlow()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function ting_field_search_install_confirm_form($form, &$form_state) {\n if (ting_field_search_get_status()) {\n drupal_goto('admin/config/ting/settings');\n }\n\n $backend = variable_get('cache_class_cache_ting', FALSE);\n if (!$backend) {\n // A default is being used and it's not one if ours.\n $backend = variable_get('cache_default_class', 'DrupalDatabaseCache');\n }\n\n $message = '<p>' . t('Ting field search will <strong>NOT</strong> function correctly without the proper backend for cache_ting.') . '<//p>';\n $message .= '<p>' . t('The current backend %backend will <strong>NOT</strong> work with Ting field search. Please press install below to correct this.', array('%backend' => $backend)) . '</p>';\n\n return confirm_form($form,\n t('Confirm installation of Ting field search cache backend'),\n 'admin/config/ting/settings',\n $message,\n t('Install'),\n t('Cancel')\n );\n}", "function testAcceptFormReset(){\n\t}", "public function testLoggedInSubmittedChangesNoCSRFToken() {\n $stmt = PDODAO::$PDO->query('SELECT o.* FROM '. $this->user_database .\n '.tu_owners o WHERE o.email = \"me@example.com\"');\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->assertEqual($row['timezone'], 'UTC');\n $this->assertEqual($row['email_notification_frequency'], 'daily');\n\n $this->simulateLogin('me@example.com');\n\n // Set $_POST vars\n $_POST['Done'] = 'Done';\n $_POST['timezone'] = 'America/Los_Angeles';\n $controller = new SettingsController(true);\n try {\n $results = $controller->control();\n $this->fail(\"should throw InvalidCSRFTokenException\");\n } catch(InvalidCSRFTokenException $e) {\n $this->assertIsA($e, 'InvalidCSRFTokenException');\n }\n }", "public function isNoCacheVariableSetOnFaultyPages() {\r\n\t\t$this->tsfeMock->no_cache = 0;\r\n\r\n\t\t$this->tsfeMock->content = '';\r\n\t\t$this->hook->handleFaultyEvent();\r\n\t\t$this->hook->disableCachingOnFaultyPages(array(), $this->tsfeMock);\r\n\r\n\t\t$this->assertTrue((bool) $this->tsfeMock->no_cache);\r\n\t}", "protected function invalidateFrontendCache() {\n $this->_frontendCache->clearAll();\n }", "protected function flushCacheStorageWithAssert()\n {\n $this->cachePage->open();\n $this->cachePage->getActionsBlock()->flushCacheStorage();\n $this->cachePage->getModalBlock()->acceptAlert();\n \\PHPUnit\\Framework\\Assert::assertTrue(\n $this->cachePage->getActionsBlock()->isStorageCacheFlushed(),\n 'Cache is not flushed.'\n );\n }", "public function needsRevalidation()\r\n {\r\n if(Cache::has(\"components\") && Cache::has(\"mappings\") && Cache::has(\"hooks\") && Cache::has(\"pages\") && Cache::has(\"auth\"))\r\n {\r\n if(Config::get(\"debug\", 0, \"debug\") >= 1)\r\n {\r\n $component = Cache::get(\"components\");\r\n\r\n foreach($component as $component)\r\n {\r\n $componentFile = $component->component_path.\"class.\".ucfirst($component->component_name).\"Component.inc\";\r\n if(file_exists($componentFile))\r\n {\r\n if($component->component_lastModified < filemtime($componentFile))\r\n {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n //check if the config has changed\r\n if(Cache::has(\"configCheck\") && Cache::get(\"configCheck\") != Config::get(\"checksum\", \"\"))\r\n {\r\n Cache::set(\"configCheck\", Config::get(\"checksum\", \"\"));\r\n return true;\r\n }\r\n else if(!Cache::has(\"configCheck\"))\r\n {\r\n Cache::set(\"configCheck\", Config::get(\"checksum\", \"\"));\r\n }\r\n\r\n return false;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "public function testClearValuesFormSubmission()\n {\n $test = $this;\n\n $this->useTestTheme($this->theme_base_dir, 'onetimetest', function () use ($test) {\n\n TestClearLocalDataObject::add_extension( HasSecrets::class );\n\n $one_fieldname = self::ONE_FIELDNAME;\n $one_plain_value = self::ONE_FIELDVALUE;\n $two_fieldname = self::TWO_FIELDNAME;\n $two_plain_value = self::TWO_FIELDVALUE;\n\n // create a record (clear values only appear for existing records)\n $test_object = new TestClearLocalDataObject();\n $id = $test_object->write();\n\n // force store some values in the fields\n DB::Query(\"UPDATE `TestClearLocalDataObject`\\n\"\n . \" SET {$one_fieldname} = '\" . $one_plain_value . \"',\"\n . \" {$two_fieldname} = '\" . $two_plain_value . \"'\"\n . \" WHERE ID = {$id}\");\n\n $test_object = TestClearLocalDataObject::get()->byId($id);\n $test_values = $test_object->getQueriedDatabaseFields();\n\n $session = Controller::curr()->getRequest()->getSession();\n\n $session->set('TestClearLocalDataObject_record', $test_object);\n\n $test->assertEquals($one_plain_value, $test_values[ self::ONE_FIELDNAME ]);\n $test->assertEquals($two_plain_value, $test_values[ self::TWO_FIELDNAME ]);\n\n $clear_field_one = HasSecrets::getClearFieldName($one_fieldname);\n $clear_field_two = HasSecrets::getClearFieldName($two_fieldname);\n $input_field_one = HasSecrets::getAlteredFieldName($one_fieldname);\n $input_field_two = HasSecrets::getAlteredFieldName($two_fieldname);\n\n $data = [\n // these field values can be submitted, but the clear checkbox values will remove them\n $input_field_one => $one_plain_value,\n $input_field_two => $two_plain_value,\n // clear checkbox values\n $clear_field_one => 1,\n $clear_field_two => 1,\n ];\n\n $page = TestClearPage::get()->filter('URLSegment','clear-test-page')->first();\n $page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);\n\n $form_id = 'Form_Form';\n // switch to page\n $response = $test->get( $page->Link() );\n // submit form\n $response = $test->submitForm(\n $form_id,\n 'action_doSubmit',\n $data\n );\n\n // get submitted data from Controller - at this point the values should be cleared\n $record = $session->get('TestClearLocalDataObject_record');\n\n // the field names should be present\n $test->assertTrue(isset($record->$one_fieldname), \"Field {$one_fieldname} is not set\");\n $test->assertTrue(isset($record->$two_fieldname), \"Field {$two_fieldname} is not set\");\n // but the values must be an empty string\n $test->assertTrue($record->$one_fieldname === \"\", \"Field {$one_fieldname} is not empty string\");\n $test->assertTrue($record->$two_fieldname === \"\", \"Field {$two_fieldname} is not empty string\");\n\n });\n\n }", "public function testEditInactiveSettings()\n {\n $this->resetDB();\n $this->adminLogin();\n factory(App\\Admin\\AdminSettings::class)->create();\n $this->visit('admin/settings/1/edit')\n ->see('Edit active quote function')\n ->see('Back to index')\n ->type('10', 'quantity_default')\n ->type(100, 'bom_line_default')\n ->type('1.75', 'bom_line_charge_per')\n ->type(150, 'smt_default')\n ->type('.25', 'smt_charge_per')\n ->type(10, 'tht_default')\n ->type(0, 'tht_charge_per')\n ->type(3, 'bga_default')\n ->type('1.50', 'bga_charge_per')\n ->type(2, 'sides_default')\n ->type(75, 'sides_charge_per')\n ->type(1, 'flat_fee_default')\n ->type(200, 'flat_fee_charge_per')\n ->type('1.25', 'function_x')\n ->type('0.05', 'function_b')\n ->type(2, '2_layer_sq_inch_price')\n ->type(600, '2_layer_base_price')\n ->type(3, '4_layer_sq_inch_price')\n ->type(700, '4_layer_base_price')\n ->type(4, '6_layer_sq_inch_price')\n ->type(900, '6_layer_base_price')\n ->type(5, '8_layer_sq_inch_price')\n ->type(1000, '8_layer_base_price')\n ->type(100, 'assembled_turn_day_1')\n ->type(90, 'assembled_turn_day_2')\n ->type(85, 'assembled_turn_day_3')\n ->type(80, 'assembled_turn_day_4')\n ->type(75, 'assembled_turn_day_5')\n ->type(100, 'unassembled_turn_day_1')\n ->type(90, 'unassembled_turn_day_2')\n ->type(85, 'unassembled_turn_day_3')\n ->type(80, 'unassembled_turn_day_4')\n ->type(75, 'unassembled_turn_day_5')\n ->press('submitQuoteForm')\n ->seePageIs('/admin/settings/3/edit')\n ->see('Edit active quote function')\n ->seeInDatabase('admin_settings', ['bom_line_charge_per' => '1.75'])\n ->seeInDatabase('admin_settings', ['active' => '0'])\n ->seeInDatabase('admin_settings', ['active' => '1'])\n ->visit('/admin/settings/1/edit')\n ->seePageIs('/admin/settings')\n ->see('Cannot edit inactive settings');\n }", "function rules_forms_elements_rebuild($form_id, $form_state) {\n $form_info = rules_forms_get_form_info($form_state['values']['reset_form']);\n $form_info['reset'] = TRUE;\n rules_forms_save_form_info($form_state['values']['reset_form'], $form_info);\n drupal_set_message(t('Please revisit %form so Rules forms Support can re-evaluate element information.',\n array('%form' => $form_state['values']['reset_form'])));\n if (isset($form_info['path'])\n && drupal_lookup_path($form_info['path']) !== FALSE) {\n drupal_goto($form_info['path']);\n }\n}", "public function testCacheInvalidation()\n {\n $queries = $this->selectDataProvider();\n foreach ($queries as $query) {\n Cache::getInstance()->setQuery($query, array('queryResult'));\n }\n\n Cache::getInstance()->setQuery('SELECT name FROM ps_confiture WHERE id = 1', array('queryResultExtra'));\n\n $tableMapKey = Cache::getInstance()->getTableMapCacheKey('ps_configuration');\n $invalidatedKeys = $this->cacheArray[$tableMapKey];\n\n $this->assertArrayHasKey($tableMapKey, $this->cacheArray);\n \n Cache::getInstance()->deleteQuery('SELECT name FROM ps_configuration WHERE id = 1');\n\n $this->assertArrayNotHasKey($tableMapKey, $this->cacheArray);\n\n foreach (array_keys($invalidatedKeys) as $invalidatedKey) {\n $this->assertArrayNotHasKey($invalidatedKey, $this->cacheArray);\n }\n\n $validTableMapKey = Cache::getInstance()->getTableMapCacheKey('ps_confiture');\n $this->assertArrayHasKey($validTableMapKey, $this->cacheArray);\n\n Cache::getInstance()->deleteQuery('SELECT name FROM ps_confiture WHERE id = 1');\n\n $this->assertArrayNotHasKey($validTableMapKey, $this->cacheArray);\n\n // now check invalidation why full deletion of entry from \"other table\"\n foreach ($queries as $query) {\n Cache::getInstance()->setQuery($query, array('queryResult'));\n }\n\n $tableMapKey = Cache::getInstance()->getTableMapCacheKey('ps_configuration');\n $invalidatedKeys = $this->cacheArray[$tableMapKey];\n\n $this->assertArrayHasKey($tableMapKey, $this->cacheArray);\n\n // all entries from both ps_configuration AND ps_confiture will be deleted\n Cache::getInstance()->deleteQuery('SELECT name FROM ps_configuration WHERE id = 1');\n\n $this->assertArrayNotHasKey($tableMapKey, $this->cacheArray);\n $otherTableMapKey = Cache::getInstance()->getTableMapCacheKey('ps_confiture');\n $this->assertArrayNotHasKey($otherTableMapKey, $this->cacheArray);\n }", "function file_antivirus_admin_settings_submit($form, &$form_state) {\n $op = $form_state['clicked_button']['#value'];\n $values = $form_state['values'];\n switch ($op) {\n case t('Save configuration'):\n variable_set('file_antivirus_clamav', $values['file_antivirus_clamav']);\n variable_set('file_antivirus_clamav_method', $values['file_antivirus_clamav_method']);\n variable_set('file_antivirus_clamav_allow', $values['file_antivirus_clamav_allow']);\n variable_set('file_antivirus_clamav_host', $values['file_antivirus_clamav_host']);\n variable_set('file_antivirus_clamav_port', $values['file_antivirus_clamav_port']);\n variable_set('file_antivirus_clamav_path', $values['file_antivirus_clamav_path']);\n drupal_set_message(t('The configuration options have been saved.'));\n break;\n case t('Reset to defaults'):\n variable_del('file_antivirus_clamav');\n variable_del('file_antivirus_clamav_method');\n variable_del('file_antivirus_clamav_allow');\n variable_del('file_antivirus_clamav_host');\n variable_del('file_antivirus_clamav_port');\n variable_del('file_antivirus_clamav_path');\n drupal_set_message(t('The configuration options have been reset to their default values.'));\n break;\n }\n}", "public static function settings_cta_dismiss() {\n\t\tFrmAppHelper::permission_check( 'frm_change_settings' );\n\n\t\tupdate_option( 'frm_lite_settings_upgrade', time(), 'no' );\n\n\t\twp_send_json_success();\n\t}", "public function afterSettingsUpdate()\n {\n if ($this->_cacheDriver && $this->settingsModelCache) {\n $model = $this->getSettingsModel();\n $settings = $model->objects()->get();\n $this->_cacheDriver->set($this->getSettingsCacheKey(), $settings, $this->settingsModelCache);\n }\n }", "protected function testSettingsFormSubmission() {\n $this->drupalGet('/admin/config/services/recurly');\n $this->drupalPostForm(NULL, [], t('Save configuration'));\n $this->assertText('The configuration options have been saved.');\n }", "public function testUserSettingsUpdate()\n {\n }", "public function performPurgeCaches()\n {\n curl_setopt($this->curl_connection, CURLOPT_URL, $this->app->getAppUrl() . '/admin/purgecaches.php');\n $result = curl_exec($this->curl_connection);\n $dom = new domDocument();\n $dom->loadHTML($result);\n $formTags = $dom->getElementsByTagName('input');\n foreach ($formTags as $tag)\n {\n if ($tag->getAttribute('name') == 'sesskey')\n {\n $sess_key = $tag->getAttribute('value');\n }\n }\n // now we send the request to purge caches\n curl_setopt($this->curl_connection, CURLOPT_POSTFIELDS, \"confirm=1&sesskey=$sess_key\");\n curl_exec($this->curl_connection);\n return true;\n \n }", "public function testAccountSettingEmailIsPopulated()\n {\n $client = $this->makeClient();\n $crawler = $client->request('GET', '/login');\n $form = $crawler->selectButton('Login')->form();\n $form->setValues(['_username' => 'update_profile@gmail.com', '_password' => 'password']);\n $client->submit($form);\n\n\n $crawler = $client->request('GET', '/account-settings/information');\n $this->assertStatusCode(200, $client);\n Assert::assertEquals('update_profile@gmail.com', $crawler->filter('#update_user_email')->first()->attr('value'));\n\n $form = $crawler->selectButton('Update')->form();\n\n $form['update_user[displayName]']->setValue('blue_man');\n $form['update_user[bio]']->setValue('this is about me');\n // $form['update_user[image]']->upload(__DIR__ .'/cat.png');\n $crawler = $client->submit($form);\n\n Assert::assertEquals(1, $crawler->filter('#success-flash-message')->count());\n Assert::assertEquals('update_profile@gmail.com', $crawler->filter('#update_user_email')->first()->attr('value'));\n Assert::assertEquals('this is about me', $crawler->filter('#update_user_bio')->first()->text());\n Assert::assertEquals('blue_man', $crawler->filter('#update_user_displayName')->first()->attr('value'));\n\n\n // IF EVER TURNED ON USE USER REPOSITORY INSTEAD\n// $user = $this->getContainer()\n// ->get('AppBundle\\Repository\\UserRepository')\n// ->findUserByEmail('update_profile@gmail.com');\n//\n// Assert::assertNotEmpty($user->getImageUrl());\n }", "function elgg_flush_caches() {\n\t_elgg_services()->events->trigger('cache:flush', 'system');\n}", "function _elgg_invalidate_query_cache() {\n\tglobal $DB_QUERY_CACHE, $DB_QUERY_CACHE_COUNT;\n\tif ($DB_QUERY_CACHE instanceof ElggLRUCache) {\n\t\t$DB_QUERY_CACHE->clear();\n\t\t$DB_QUERY_CACHE_COUNT = 0;\n\t\telgg_log(\"Query cache invalidated\", 'NOTICE');\n\t} elseif ($DB_QUERY_CACHE) {\n\t\t// In case someone sets the cache to an array and primes it with data\n\t\t$DB_QUERY_CACHE = array();\n\t\t$DB_QUERY_CACHE_COUNT = 0;\n\t\telgg_log(\"Query cache invalidated\", 'NOTICE');\n\t}\n}", "public function testServerModuleCache()\n {\n $result = $this->adminHandler->flushServerModuleCache();\n $this->assertTrue($result, 'Should be true!');\n }", "function test_setting_fields()\n\t{\n\t\t$this->assertEquals( get_option( 'offline_page' ), '' , 'The default offline_page option was ' . get_option( 'offline_page' ) . '. It should have been an empty string.');\n\t}", "function rules_forms_settings_submit($form_id, $form_state) {\n $_SESSION['rules_forms_message'] = (bool) $form_state['values']['enable_form_activation_message'];\n $_SESSION['rules_forms_element_info'] = (bool) $form_state['values']['enable_form_element_info'];\n drupal_set_message(t('The settings have been saved.'));\n}", "public function validateSettingsForm(FormStateInterface $form_state);", "function c4media_test_edit_form_submit($form, &$form_state) {\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n if (isset($form_state['values'][$key])) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n }\n}", "public function testInputForgery() {\n $this->drupalGet('form-test/input-forgery');\n // The value for checkboxes[two] was changed using post render to simulate\n // an input forgery.\n // @see \\Drupal\\form_test\\Form\\FormTestInputForgeryForm::postRender\n $this->submitForm(['checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE], 'Submit');\n $this->assertSession()->pageTextContains('An illegal choice has been detected.');\n }", "public static function wpfc_admin_clean_cache() {\n\n\t\tif ( self::can_user_clean_wpfc_cache() ) {\n\t\t\tif ( isset( $_POST['wpFastestCachePage'] ) && $_POST['wpFastestCachePage'] === 'deleteCache' ) {\n\t\t\t\tBF_Booster_Cache::flush_cache();\n\t\t\t}\n\t\t}\n\t}", "public function testLogoutActionFlushesFormKey()\n {\n $this->_customerSession->loginById(1);\n\n $this->formKey->set(\n 'form_key',\n $this->cookieMetadata\n );\n\n $beforeKey = $this->formKey->get();\n $this->_customerSession->logout();\n $afterKey = $this->formKey->get();\n\n $this->assertNotEquals($beforeKey, $afterKey);\n }", "public function invalidateCacheElement(){\n\n }", "public function testResetContentCachedWhenResetOnLogoutEnabledAndForceResetIsOn()\n {\n oxTestModules::addFunction('oxUtils', 'oxResetFileCache', '{ $_GET[\"testReset\"] = \"resetDone\"; }');\n\n $this->getConfig()->setConfigParam(\"blClearCacheOnLogout\", 1);\n\n $oAdminView = oxNew('oxAdminView');\n $oAdminView->resetContentCache(true);\n\n $this->assertEquals('resetDone', $_GET[\"testReset\"]);\n }", "function form_action()\n {\n $options = new SwimTeamOptions() ;\n $options->loadOptions() ;\n $options->setGoogleAPIKey($this->get_element_value('Google API Key')) ;\n $options->updateOptions() ;\n\n $this->set_action_message('Swim Team Google Maps options updated.') ;\n\n return true ;\n }", "function ccfm_admin_init() {\n global $pagenow;\n\n ccfm_handle_requests();\n\n add_action( 'wp_dashboard_setup', 'ccfm_dashboard_widget' );\n \n //add styles for dashboard\n add_action( 'admin_head', 'ccfm_admin_head' );\n\n if ( ccfm_supported_caching_exists() ) {\n\n if ( defined( 'QODE_ROOT' ) ) {\n if ( 'options.php' == $pagenow ) {\n //detect when qode options saved.\n add_action( 'updated_option', 'ccfm_save_clear_cache_for_qode', 10, 3 ); \n }\n }\n\n //detect widget save, reorder and delete detection. Thanks to Ov3rfly.\n add_action( 'wp_ajax_save-widget', 'ccfm_clear_cache_for_widgets_wp_ajax_action', 1 );\n add_action( 'wp_ajax_widgets-order', 'ccfm_clear_cache_for_widgets_wp_ajax_action', 1 );\n add_action( 'sidebar_admin_setup', 'ccfm_clear_cache_for_widgets_sidebar_admin_setup' );\n //detect customize theme actions.\n add_action( 'customize_save_after', 'ccfm_clear_cache_for_customized_theme' );\n\n //detect nav menu changes\n add_action( 'wp_update_nav_menu', 'ccfm_clear_cache_for_menus' );\n\n //detect settings page changes\n add_filter( 'pre_set_transient_settings_errors', 'ccfm_clear_cache_for_settings' );\n\n //detect ContactForm7 changes\n add_action( 'wpcf7_save_contact_form', 'ccfm_clear_cache_for_cf7' );\n\n //detect WooThemes settings changes\n add_action( 'update_option_woo_options', 'ccfm_clear_cache_for_woo_options' );\n\n //try detect NextGen Gallery changes\n add_action( 'ngg_update_gallery', 'ccfm_clear_cache_for_ngg' );\n add_action( 'ngg_delete_gallery', 'ccfm_clear_cache_for_ngg' );\n add_action( 'ngg_update_album', 'ccfm_clear_cache_for_ngg' );\n add_action( 'ngg_update_album_sortorder', 'ccfm_clear_cache_for_ngg' );\n add_action( 'ngg_delete_album', 'ccfm_clear_cache_for_ngg' );\n\n //detect Formidable changes\n add_action( 'frm_update_form', 'ccfm_clear_cache_for_formidable' );\n\n //detect Contact Form by WP Forms changes\n add_action( 'wpforms_builder_save_form', 'ccfm_clear_cache_for_wpforms' );\n\n // detect Insert Headers and Footers by WPBeginner changes\n add_action( 'update_option_ihaf_insert_header', 'ccfm_insert_headers_and_footers' );\n add_action( 'update_option_ihaf_insert_footer', 'ccfm_insert_headers_and_footers' );\n add_action( 'update_option_ihaf_insert_body', 'ccfm_insert_headers_and_footers' );\n\n do_action( 'ccfm_admin_init' );\n }\n}", "function olmo_form_system_theme_settings_submit(&$form, &$form_state) {\n\n\n // set favicon config\n config_set('olmo.settings', 'theme_favicon', $form_state['values']['theme_favicon']);\n config_set('system.core', 'site_favicon_theme', $form_state['values']['theme_favicon']);\n\n // set meta_generator\n config_set('olmo.settings', 'meta_generator', $form_state['values']['meta_generator']);\n\n // set meta_generator\n config_set('olmo.settings', 'rss_feeds', $form_state['values']['rss_feeds']);\n\n // set toolbar_color_chrome\n config_set('olmo.settings', 'toolbar_color_chrome', $form_state['values']['toolbar_color_chrome']);\n\n // set pin-tab-safari\n config_set('olmo.settings', 'pin-tab-safari', $form_state['values']['pin-tab-safari']);\n\n}", "function elgg_reset_system_cache() {\n\t_elgg_services()->systemCache->reset();\n}", "function display_test_twitter_element(){\r\n?>\r\n<input type=\"text\" name=\"reset_cache\" id=\"reset_cache\" value=\"<?php echo get_option('reset_cache'); ?>\" />\r\n<b>Type 'reset', save and refresh home page to reset cache</b>\r\n<?php\r\n}", "public function testFormAlterNoFields(): void {\n $form = $this->getTestForm([]);\n\n $expectedForm = $form;\n\n $this->alterForm($form, $expectedForm);\n\n self::assertSame($expectedForm, $form);\n }", "public function testFormStateAdmin() {\n campaignion_node_admin_path_is_admin(TRUE);\n $form_state = form_state_defaults();\n _campaignion_node_admin_title_process_form([], $form_state);\n $this->assertArrayHasKey('path_is_admin', $form_state);\n $this->assertTrue($form_state['path_is_admin']);\n }", "function file_antivirus_admin_settings_validate($form, &$form_state) {\n $op = $form_state['clicked_button']['#value'];\n $values = $form_state['values'];\n switch ($op) {\n case t('Save configuration'):\n $clamav_path = $values['file_antivirus_clamav_path'];\n if ($values['file_antivirus_clamav_method'] && !empty($clamav_path)) {\n if (!preg_match('/clamscan$/', $clamav_path)) {\n form_set_error('file_antivirus_clamav_path', t('Invalid path %path specified for the \\'clamscan\\' utility. The path should end with a \\'clamscan\\'.', array('%path' => $clamav_path)));\n }\n else if (!file_exists($clamav_path)) {\n form_set_error('file_antivirus_clamav_path', t('Invalid path %path specified for the \\'clamscan\\' utility. Program not found.', array('%path' => $clamav_path)));\n }\n else if (!preg_match('/ClamAV/', _file_antivirus_check_clamav(array('path' => $clamav_path)))) {\n form_set_error('file_antivirus_clamav_path', t('Invalid path %path specified for the \\'clamscan\\' utility. Utility have not returned it\\'s version string.', array('%path' => $clamav_path)));\n }\n }\n if (!$values['file_antivirus_clamav_method']) {\n if (empty($values['file_antivirus_clamav_host'])) {\n form_set_error('file_antivirus_clamav_host', t('A hostname should be provided to connect to.'));\n }\n if (empty($values['file_antivirus_clamav_port'])) {\n form_set_error('file_antivirus_clamav_port', t('A port should be provided to connect to.'));\n }\n else if (!ctype_digit($values['file_antivirus_clamav_port'])) {\n form_set_error('file_antivirus_clamav_port', t('A port should only contain digits.'));\n }\n }\n break;\n }\n}", "public function formForget()\n {\n $this->view->addForget();\n }", "public function testInvalidate()\n {\n $this->_cache->expects($this->once())->method('load')->with(TypeList::INVALIDATED_TYPES)->will(\n $this->returnValue([])\n );\n $expectedInvalidated = [\n self::TYPE_KEY => 1,\n ];\n $this->serializerMock->expects($this->once())\n ->method('serialize')\n ->with($expectedInvalidated)\n ->willReturn('serializedData');\n $this->_cache->expects($this->once())->method('save')->with(\n 'serializedData',\n TypeList::INVALIDATED_TYPES\n );\n $this->_typeList->invalidate(self::TYPE_KEY);\n }", "public static function wpsc_clean_cache() {\n\n\t\tif ( ! isset( $_POST['wp_delete_cache'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! function_exists( 'wpsupercache_site_admin' ) || ! wpsupercache_site_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn BF_Booster_Cache::flush_cache();\n\t}", "function elgg_invalidate_simplecache() {\n\t_elgg_services()->simpleCache->invalidate();\n}", "public function widget_clear_cache(){\n $element = array();\n if(wfUser::hasRole('webmaster') || wfUser::hasRole('webadmin')){\n wfFilesystem::clearCache();\n $element[] = wfDocument::createHtmlElement('p', 'Cache is now empty.');\n }else{\n $element[] = wfDocument::createHtmlElement('p', 'You have not proper role to do this.');\n }\n wfDocument::renderElement($element);\n }", "public function testIsCacheValidExpired(): void\n {\n $domain = 'whatever.io';\n $filename = '0a35602901944a0c6d853da2a5364665c2bda0695120.jpg';\n mkdir(self::$cache . '/thumb/' . $domain, 0755, true);\n $cacheFile = self::$cache . '/thumb/' . $domain . '/' . $filename;\n touch($cacheFile, time() - ConfigManager::get('settings.cache_duration') - 1);\n\n $this->assertFalse(CacheManager::isCacheValid($cacheFile, $domain, CacheManager::TYPE_THUMB));\n }", "public function invalidate()\n\t{\n\t\t$this->invalidated = TRUE;\n\t}", "protected function _Update_Form() {\r\n\t\t$form_instance = $this->form_instance;\r\n\t\t// Retrieve the form's fields\r\n $form_fields = $form_instance->fields;\r\n\t\t// If there are no form fields\r\n\t\tif (!$form_fields || !is_array($form_fields)) { return; }\r\n // Set the invalid number\r\n $invalid = 0;\r\n\t\t// Loop through each containers\r\n\t\tforeach ($form_fields as $machine_code => $field_instance) {\r\n // If the field is valid, move on\r\n if ($field_instance->Is_Hidden()) { continue; }\r\n // If the field is valid, move on\r\n if ($field_instance->Is_Valid()) { continue; } //echo $machine_code;\r\n // Inc up the invalid field\r\n $invalid++;\r\n }\r\n // If there are no invalid fields\r\n if ($invalid == 0) { return; }\r\n // Set the form valid flag to false\r\n $form_instance->is_valid = false;\r\n }", "public function flush_site() {\n\t\tif ( ! function_exists( 'current_user_can' ) || false == current_user_can( 'manage_options' ) )\n\t\t\treturn false;\n\n\t\tif ( ! empty( $_POST['pantheon-cache-nonce'] ) && wp_verify_nonce( $_POST['pantheon-cache-nonce'], 'pantheon-cache-clear-all' ) ) {\n\t\t\tif ( function_exists( 'pantheon_clear_edge_all' ) ) {\n\t\t\t\tpantheon_clear_edge_all();\n\t\t\t}\n\t\t\twp_cache_flush();\n\t\t\twp_redirect( admin_url( 'options-general.php?page=pantheon-cache&cache-cleared=true' ) );\n\t\t\texit();\n\t\t}\n\t}", "public function testAuthSettings() {\n $admin_user = $this->drupalCreateUser(array(\n 'administer site configuration',\n 'administer google analytics counter',\n ));\n $this->drupalLogin($admin_user);\n\n // Create item(s) in the queue.\n $queue_name = 'google_analytics_counter_worker';\n $queue = \\Drupal::queue($queue_name);\n\n // Enqueue an item for processing.\n $queue->createItem([$this->randomMachineName() => $this->randomMachineName()]);\n\n $assert = $this->assertSession();\n $this->drupalGet(self::ADMIN_AUTH_SETTINGS_PATH);\n $assert->statusCodeEquals(200);\n\n $edit = [];\n\n // Post form. Assert response.\n $this->submitForm($edit, t('Save configuration'));\n }", "public function saveConfig() {\n\t\t$active = getInt($_POST['activateCache']);\n\t\t// Wenn sich etwas geändert hat, jenachdem reagieren\n\t\tif ($active != option::get('caching')) {\n\t\t\t// Caching wurde aktiviert\n\t\t\tif ($active == 1) {\n\t\t\t\tmkdir(BP.'/mandant/'.page::mandant().'/cache',0777);\n\t\t\t}\n\t\t\t// Caching wurde deaktiviert\n\t\t\tif ($active == 0) {\n\t\t\t\tfileOps::deleteFolder(BP.'/mandant/'.page::mandant().'/cache');\n\t\t\t}\n\t\t}\n\t\t// Option speichern\n\t\toption::set('caching',$active);\n\t\t// Erfolg melden und weiterleiten\n\t\t$this->setErrorSession($this->Res->html(57,page::language()));\n\t\tsession_write_close();\n\t\tredirect('location: /admin/cache/index.php?id='.page::menuID());\n\t}", "function pearson_update_instance($lti, $mform) {\n\t// this should never be called\n return true;\n}" ]
[ "0.6742718", "0.66673344", "0.62957", "0.61093897", "0.6078337", "0.6054831", "0.5971363", "0.5963644", "0.5946898", "0.5882171", "0.58023304", "0.57939345", "0.5766675", "0.5758205", "0.5736888", "0.5718661", "0.57123137", "0.56944454", "0.5676824", "0.56677234", "0.56413335", "0.558882", "0.5587166", "0.5583795", "0.55749935", "0.5571761", "0.5561202", "0.55564374", "0.5541018", "0.55389", "0.5524012", "0.55212563", "0.5512457", "0.5505814", "0.54983515", "0.5494433", "0.5489145", "0.54867077", "0.5479928", "0.54721785", "0.54650956", "0.54615474", "0.5454587", "0.5452163", "0.5443467", "0.5440359", "0.5436997", "0.54346025", "0.5426294", "0.5425619", "0.54241586", "0.54240316", "0.5407959", "0.5399587", "0.5399178", "0.53915185", "0.5390157", "0.538397", "0.53797317", "0.5365165", "0.5363778", "0.53610444", "0.5355427", "0.5355142", "0.53479856", "0.53310865", "0.5323528", "0.5323292", "0.5320057", "0.53178024", "0.5316118", "0.529555", "0.5295295", "0.52855676", "0.5283809", "0.5281657", "0.52804214", "0.5279871", "0.52776927", "0.5275754", "0.52583194", "0.52479815", "0.52458584", "0.5244682", "0.5243762", "0.52313817", "0.5229773", "0.52277046", "0.5227028", "0.521684", "0.5210661", "0.51983523", "0.5193352", "0.51903033", "0.5189308", "0.51876956", "0.5180094", "0.5179611", "0.51785994", "0.51720023" ]
0.80446756
0
Gets the debug response.
Получает отладочный ответ.
public function getDebugResponse();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function debug()\n\t{\n\t\t$this->response['REQUEST'] = $this->request;\n\t\tvar_dump($this->response);\n\t}", "public function get_response(){\n\t\tprint_r($this->response);\n\n\t\treturn $this->response;\n\t}", "public function debug(){\n return $this->getClient()->debug_str;\n }", "public function debug()\n {\n return $this->message;\n }", "public function get_response()\n\t{\n\t\treturn $this->_response;\n\t}", "function get_response(){\n\t\treturn $this->response;\n\t}", "public function response() {\n return $this->response;\n }", "public function response() {\n\treturn $this->response;\n }", "public function getResponse() {\n\n\t\treturn $this->server->getResponse();\n\t}", "public function response()\n {\n return $this->response;\n }", "public function response()\n {\n return $this->response;\n }", "public function response()\n {\n return $this->response;\n }", "public function response()\n\t{\n\t\treturn $this->response;\n\t}", "function getResponse() {\n return $this->response;\n }", "public function getResponse(){\n\t\treturn $this->response;\n\t}", "public function getResponse(){\n return $this->response;\n }", "public function getResponse(){\n return $this->response;\n }", "public function getResponse(){\n \treturn $this->response;\n }", "public function getResponse(): string\n\t{\n\t\treturn $this->response;\n\t}", "public function getDebugOutput()\n {\n return $this->debugOutput;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse(){\n\t\treturn $this->_response;\n\t}", "public function getResponse()\n {\n\n if (! $this->response)\n $this->response = $this->env->getResponse();\n \n return $this->response;\n \n }", "public function getResponse() \n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "protected function getResponse()\n\t{\n\t\treturn $this->response;\n\t}", "public function getResponse() {\n\t\treturn $this->response;\n\t}", "public function getResponse() {\n\t\treturn $this->response;\n\t}", "public function getResponse() {\n\t\treturn $this->response;\n\t}", "public function getDebug(): string {}", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\r\n {\r\n return $this->response;\r\n }", "public function getResponse()\r\n {\r\n return $this->response;\r\n }", "protected function getResponse()\n {\n return $this->response;\n }", "protected function getResponse()\n {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse()\r\n\t{\r\n\t\treturn $this->response;\r\n\t}", "public function getResponse()\r\n\t{\r\n\t\treturn $this->response;\r\n\t}", "public function getDebugOutput()\n {\n }", "public function get_debug_data() {\n return $this->debug_data;\n }", "public function getResponse()\n\t{\n\t\treturn $this->response;\n\t}", "public function getResponse()\n\t{\n\t\treturn $this->response;\n\t}", "public function getResponse()\n\t{\n\t\treturn $this->response;\n\t}", "public function response()\n\t{\n\t\treturn $this->request->response();\n\t}", "public function getResponse() {\r\n return $this->response;\r\n }", "public function getResponse() {\n return $this->context->getResponse();\n }", "public function getDebug() {\n return $this->debug;\n }", "public function getDebug() {\n return $this->_debug;\n }", "public function getResponse() {\n\n return $this->response;\n\n }" ]
[ "0.72941434", "0.7111575", "0.6883882", "0.66076046", "0.65540695", "0.6538842", "0.65253496", "0.650537", "0.65047216", "0.64808357", "0.64808357", "0.64808357", "0.6477634", "0.6471205", "0.64662623", "0.6461189", "0.6461189", "0.6451847", "0.6448448", "0.6422073", "0.6415217", "0.6415217", "0.63916475", "0.6389504", "0.6351584", "0.6344617", "0.6335645", "0.6329871", "0.6329263", "0.6329263", "0.6329263", "0.63241124", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.6319319", "0.631578", "0.631578", "0.63132733", "0.63132733", "0.63092965", "0.63092965", "0.63092965", "0.63092965", "0.63092965", "0.63090515", "0.63090515", "0.63080245", "0.6305747", "0.63031554", "0.63031554", "0.63031554", "0.630291", "0.6300356", "0.629212", "0.62658983", "0.626526", "0.62576604" ]
0.8726222
0
Function to check whether to display the cancel appointment button
Функция для проверки необходимости отображения кнопки отмены записи
function checkToDisplayCancelButton($conn, $teacher_id) { // Variable to store a URL for deleting the record $cancel_appointment_script = WEBURL.DOCROOT."scripts/parents-evening/students/timeslot_cancel.php"; // SQL to check if there is already an appointment $sql_check_if_already_appointment = "SELECT * FROM appointments WHERE student_id = {$_SESSION['userid']} AND teacher_id = {$teacher_id} AND parents_evening_id = {$_GET['id']}"; // Store the result set in a variable $result = mysqli_query($conn, $sql_check_if_already_appointment); // Check if there any rows returned by the query if(mysqli_num_rows($result) > 0) { // Return the string return "<a class='btn btn-block btn-warning' href='$cancel_appointment_script?teacherid=$teacher_id&id={$_GET['id']}'>Cancel Appointment</a>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isCancelAble() {}", "public function isCancelRequested(){\n\t\treturn $this->getSubscription()->getCancelRequest() == 1;\n\t}", "public function isStatusCancel(){\n return $this->status == 'cancel';\n }", "public function canCancel ()\n {\n return true;\n }", "private function showCancelFilterButton(): bool\n {\n return $this->filterDataSource != $this->filterDefaults;\n }", "public function canCancel(){\n\t\treturn $this->checkWorkflow(self::STATUS_CANCELED) && !$this->isCancelRequested();\n\t}", "function IsCanceled() {\r\n\t\treturn $this->LastAction == \"cancel\" && $this->CurrentAction == \"\";\r\n\t}", "protected function _isCanCancel()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel');\n }", "public function isCanceled(){\n\t\treturn $this->getStatus() == self::STATUS_CANCELED;\n\t}", "function setCancelOff() {\r\n $this->__settings['cancelButtonOff'] = 1;\r\n }", "public function isCancelled()\n {\n return $this->data['VK_T_STATUS'] == '3';\n }", "public function isCanceled(){\n return ($this->status == self::STATUS_CANCELED);\n }", "private function shouldCancelCommand()\n {\n $endpoint = $this->getCurrentEndpoint();\n if ($endpoint === '') {\n return false;\n }\n\n return !$this->confirmReplace();\n }", "public function isCancelled();", "public function isCancelled();", "public function isCancelled();", "public function isCancelled();", "function OKCancelButtons()\n\t{\n\t\techo \"<tr>\";\n\t\techo \"\t<td></td>\";\n\t\techo \"\t<td>\";\n\t\techo \"\t\t<input type=submit id='ok-button' value=' OK '>\";\n\t\techo \"</tr>\";\n\t}", "function cancel( $alt='Cancel', $href='', $title='') {\r\n\t\t$image = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/components/com_timewriter/images/', NULL, NULL, 'Cancel', 'cancel' );\r\n\t\t$image2 = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/components/com_timewriter/images/', NULL, NULL, 'Cancel', 'cancel', 0 );\r\n\t\tif ( $href ) {\r\n\t\t\t$link = $href;\r\n\t\t} else {\r\n\t\t\t$link = 'javascript:window.history.back();';\r\n\t\t}\r\n\t\t?>\r\n\t\t<td>\r\n\t\t<a class=\"toolbar\" <?php echo $title; ?>href=\"<?php echo $link; ?>\" onmouseout=\"MM_swapImgRestore();\" onmouseover=\"MM_swapImage('cancel','','<?php echo $image2; ?>',1);\">\r\n\t\t<?php echo $image; ?>\r\n\t\t<?php echo $alt;?>\r\n\t\t</a>\r\n\t\t</td>\r\n\t\t<?php\r\n\t}", "public function isCancelled() : bool {}", "public function isCancelled(): bool\n {\n return !$this->isAutomaticRenew() && !empty($this->date_cancel);\n }", "public function maybe_render_cancel_link() {\r\n\t\tprintf(\r\n\t\t\t'<a href=\"%s\" class=\"wc-gateway-ppexpress-mx-cancel\">%s</a>',\r\n\t\t\tesc_url( add_query_arg( 'wc-gateway-ppexpress-mx-clear-session', true, wc_get_cart_url() ) ),\r\n\t\t\tesc_html__( 'Cancel', 'woocommerce-paypal-express-mx' )\r\n\t\t);\r\n\t}", "function chooseCancelOnNextConfirmation() {\r\n\t\t\techo $this->__getRow('chooseCancelOnNextConfirmation');\r\n\t\t}", "function canCancel($eventId) {\n\t\t$db = & JFactory::getDBO() ;\n\t\t$sql = 'SELECT COUNT(*) FROM #__eb_events WHERE id='.$eventId.' AND enable_cancel_registration = 1 AND (DATEDIFF(cancel_before_date, NOW()) >=0) ';\n\t\t$db->setQuery($sql) ;\n\t\t$total = $db->loadResult() ;\n\t\tif ($total)\t\t\n\t\t\treturn true ;\n\t\telse\n\t\t\treturn false ;\t\t\t\n\t}", "function cancel()\n\t{\n\t\tilUtil::sendInfo($this->lng->txt(\"msg_cancel\"),true);\n\n\t\t$this->ctrl->redirectByClass(\"ilobjilinccoursegui\");\n\t}", "public function isCancelled()\n {\n return false;\n }", "public function isButtonValidInvalidButtonGivenExpectFalse() {}", "public function isCanceled()\n {\n return $this->getState() == self::STATE_CANCELED;\n }", "public function isCanceled()\n {\n return $this->getState() == self::STATE_CANCELED;\n }", "function process_cancel(){\r\r\n\t\t// redirect to cancel page\r\r\n\t\tmgm_redirect(add_query_arg(array('status'=>'cancel'), $this->_get_thankyou_url()));\r\r\n\t}", "function onButtonClick($button){\n\t\t$this->session->trace(TRACE_RARE, 'WaitPage.onButtonClick() ' . $button);\n\t\t$redraw = true;\n\t\tif (strcmp($button, \"button_cancel\") == 0){\n\t\t\t$redraw = $this->stop('wait.cancel');\n\t\t}\n\t\treturn $redraw;\n\t}", "public function canCancel()\n {\n return $this->getState() == self::STATE_OPEN;\n }", "public function isCanceled()\n {\n return $this->status == self::$status['canceled'];\n }", "public function cancelAction()\n {\n \n }", "function isCanceled() {\n return $this->getClosedOn() instanceof DateValue && $this->getStatus() == INVOICE_STATUS_CANCELED;\n }", "public function isCancelled()\n\t{\n\t\treturn ($this->getStatus() == ESL_Buckaroo::STATUS_CANCEL);\n\t}", "public function cancelAction()\n {\n $get = Zend_Registry::get('getFilter'); \n \n if (!isset($get->eventId)) {\n throw new Ot_Exception_Input('msg-error-eventIdNotSet');\n }\n \n $event = new Event();\n $location = new Location(); \n $workshop = new Workshop();\n $instructor = new Event_Instructor();\n $attendee = new Event_Attendee();\n \n $thisEvent = $event->find($get->eventId);\n if (is_null($thisEvent)) {\n throw new Ot_Exception_Data('msg-error-noEvent');\n }\n $this->view->event = $thisEvent->toArray();\n\n $status = $event->getStatusOfUserForEvent(Zend_Auth::getInstance()->getIdentity()->accountId, $thisEvent->eventId);\n if ($status != 'waitlist' && $status != 'attending') {\n throw new Ot_Exception_Data('msg-error-notAttending');\n }\n $this->view->status = $status; \n \n $this->view->reservationCancelable = $event->isReservationCancelable($thisEvent->eventId);\n \n $thisLocation = $location->find($thisEvent->locationId); \n if (is_null($thisLocation)) {\n throw new Ot_Exception_Data('msg-error-noLocation');\n }\n $this->view->location = $thisLocation->toArray();\n \n $thisWorkshop = $workshop->find($thisEvent->workshopId); \n if (is_null($thisWorkshop)) {\n throw new Ot_Exception_Data('msg-error-noWorkshop');\n }\n $this->view->workshop = $thisWorkshop->toArray(); \n \n $instructors = $instructor->getInstructorsForEvent($thisEvent->eventId); \n $inst = array();\n foreach ($instructors as $i) {\n $inst[] = $i['firstName'] . ' ' . $i['lastName'];\n }\n $this->view->instructors = $inst;\n \n \n $events = $event->getEvents($thisWorkshop->workshopId, null, null, time(), null, 'open')->toArray();\n \n $newEvents = array(); \n foreach ($events as $e) {\n if ($e['eventId'] != $thisEvent->eventId) {\n $e['status'] = $event->getStatusOfUserForEvent(Zend_Auth::getInstance()->getIdentity()->accountId, $e['eventId']);\n $e['workshop'] = $thisWorkshop->toArray();\n $newEvents[] = $e;\n }\n } \n \n $this->view->events = $newEvents;\n \n $form = Ot_Form_Template::delete('cancelReservation', 'workshop-signup-cancel:cancel', 'workshop-signup-cancel:keep');\n \n if ($this->_request->isPost() && $form->isValid($_POST)) {\n \n $instructorNames = array();\n $instructorEmails = array();\n \n foreach ($instructors as $i) {\n $instructorNames[] = $i['firstName'] . ' ' . $i['lastName'];\n $instructorEmails[] = $i['emailAddress'];\n }\n \n $attendee->cancelReservation(Zend_Auth::getInstance()->getIdentity()->accountId, $thisEvent->eventId);\n \n $startDt = strtotime($thisEvent->date . ' ' . $thisEvent->startTime);\n $endDt = strtotime($thisEvent->date . ' ' . $thisEvent->endTime);\n \n $data = array(\n 'workshopName' => $thisWorkshop->title,\n 'workshopDate' => date('m/d/Y', $startDt),\n 'workshopStartTime' => date('g:i a', $startDt),\n 'workshopEndTime' => date('g:i a', $endDt),\n 'workshopMinimumEnrollment' => $thisEvent->minSize,\n 'locationName' => $thisLocation->name,\n 'locationAddress' => $thisLocation->address,\n 'instructorNames' => implode(', ', $instructorNames),\n 'instructorEmails' => implode(', ', $instructorEmails),\n 'studentEmail' => Zend_Auth::getInstance()->getIdentity()->emailAddress,\n 'studentName' => Zend_Auth::getInstance()->getIdentity()->firstName . ' ' . Zend_Auth::getInstance()->getIdentity()->lastName,\n 'studentUsername' => Zend_Auth::getInstance()->getIdentity()->username\n ); \n \n $this->_helper->flashMessenger->addMessage($this->view->translate('msg-info-canceled', $thisWorkshop->title));\n \n $trigger = new Ot_Trigger();\n $trigger->setVariables($data);\n $trigger->dispatch('Event_Cancel_Reservation'); \n\n $account = new Ot_Account();\n \n if ($status != 'waitlist') {\n $waiting = $attendee->getAttendeesForEvent($thisEvent->eventId, 'waitlist');\n if (count($waiting) != 0) { \n $newAccount = $account->find($waiting[0]['accountId']);\n \n if (!is_null($newAccount)) {\n $attendee->makeReservation($newAccount->accountId, $thisEvent->eventId);\n \n $data['studentEmail'] = $newAccount->emailAddress;\n $data['studentName'] = $newAccount->firstName . ' ' . $newAccount->lastName;\n $data['studentUsername'] = $newAccount->username;\n \n $trigger = new Ot_Trigger();\n $trigger->setVariables($data);\n $trigger->dispatch('Event_Waitlist_To_Attending'); \n } \n } \n } \n \n $this->_redirect('/');\n }\n \n $this->view->form = $form;\n $this->view->layout()->setLayout('twocolumn');\n $this->view->layout()->rightContent = $this->view->render('signup/right.phtml'); \n }", "public function render()\n {\n if (!$this->action->generator->getRow()->is_canceled)\n {\n return ull_submit_tag(\n __('Cancel course', null, 'ullCourseMessages'),\n array(\n 'name' => 'submit|action_slug=cancel', \n 'form_id' => 'ull_tabletool_form',\n 'confirm' => __('Are you sure?', null, 'common'),\n 'display_as_link' => true,\n )\n );\n } \n }", "public function cancelBooking()\n {\n echo \"Booking cancelled\";\n }", "public function isCancelled()\n {\n return $this->status === 'cancelled';\n }", "public function isCancelled() {\n return false;\n }", "public function action_cancelapps()\n\t{\n\t\t$startdate = $_POST[\"startdate\"];\n\t\t$startdate = date('Y-m-d',strtotime($startdate));\n\t\t$enddate = $_POST[\"enddate\"];\n\t\t$enddate = date('Y-m-d',strtotime($enddate));\n\t\t$doccalendarid = $_POST[\"calid\"];\n\t\t$docid = $_POST[\"docid\"];\n\t\t$shortvisit = $_POST[\"shortvisit\"];\n\t\t$longvisit = $_POST[\"longvisit\"];\n\t\t$appstartegy = $_POST[\"appstartegy\"];\n\t\t$restricteddates = $_POST[\"restricteddates\"];\t\t\n\t\t$mondaydata = $_POST[\"monday\"];\t\t\n\t\t$tuesdaydata = $_POST[\"tuesday\"];\n\t\t$wednesdaydata = $_POST[\"wednesday\"];\n\t\t$thursdaydata = $_POST[\"thursday\"];\n\t\t$fridaydata = $_POST[\"friday\"];\n\t\t$saturdaydata = $_POST[\"saturday\"];\n\t\t$sundaydata = $_POST[\"sunday\"];\n\t\t$chargetype = $_POST[\"chargetype\"];\n\t\t$schedulename = $_POST[\"schedulename\"];\n\t\tif($appstartegy == \"blockslot\")\n\t\t\t$blockval = $_POST[\"blockval\"];\n\t\telse\n\t\t\t$blockval =\"\";\t\t\n\t\t\t\n\t\t//find all active schedules for the doctor\n\t\t$objdoctorschedule = new Model_Doctorschedule;\n\t\t$objdoctorschedule=$objdoctorschedule-> where('refdocschedulecalendarid_c','=',$doccalendarid )->where('status_c','=','active') ->find_all();\n\t\t\n\t\t//find all overlapping appointments and send email to patients regarding cancelltaion\n\t\t$arscheduledapps = array();\n\t\t$ardocscheduledapps = array();$i=0;\n\t\tforeach($objdoctorschedule as $res)\n\t\t{\n\t\t\t$availability = $this->check_in_range($res->startdate_c,$res->enddate_c,$startdate);\t\n\t\t\tif($availability == 1)\n\t\t\t{\n\t\t\t\t$objdocscheduleovrlappingapps = new Model_Docscheduleoverlappingapp;\n\t\t\t\t$objdocscheduleovrlappingapps=$objdocscheduleovrlappingapps->where('startdate_c',\">=\", $startdate)->where('enddate_c','<=',$enddate)->where('refdocschedulecalendarid_c','=',$doccalendarid )->find_all();\n\t\t\t\t$arappids =array();\n\t\t\t\tforeach($objdocscheduleovrlappingapps as $result)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tif(! (array_key_exists($result->id ,$arappids) ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objappointments = new Model_Appointment;\n\t\t\t\t\t\t$objappointments->where('id','=',$result->id)->find();\n\t\t\t\t\t\t$objappointments->refappointmentstatusesid_c='3';\n\t\t\t\t\t\t$objappointments->save();\n\t\t\t\t\t\t$email = $result->email;\n\t\t\t\t\t\t$emailbody = \"Your Appointment with Dr. \".$result->docnm.\" at \".$result->scheduledstarttime_c .\" has been cancelled by doctor \";\n\t\t\t\t\t\t$subject = \"Your Appointment with Dr. \".$result->docnm.\" at \".$result->scheduledstarttime_c .\" has been cancelled by doctor \" ;\n\t\t\t\t\t\t$name=\"\";\n\t\t\t\t\t\t$emailsendrequest=Request::factory('cemailsender/emailwithoutattachement');\n\t\t\t\t\t\t$emailsendrequest->post('email',$email);\n\t\t\t\t\t\t$emailsendrequest->post('emailbody',$emailbody);\n\t\t\t\t\t\t$emailsendrequest->post('subject',$subject);\n\t\t\t\t\t\t$emailsendrequest->post('name',$name);\n\t\t\t\t\t\t$emailsendrequest->execute();\n\t\t\t\t\t\tarray_push($arappids,$result->id);\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all dates in range\n\t\t$completearr = $this->getdatesinrange($startdate,$enddate) ;\n\t\t\n\t\t//delete all previous schedules of doctor\n\t\t$objdoctorschedule = new Model_Doctorschedule;\n\t\t$objdoctorschedule=$objdoctorschedule-> where('refdocschedulecalendarid_c','=',$doccalendarid )->where('status_c','=','active') ->find_all();\n\t\t\t\t\n\t\tforeach($objdoctorschedule as $res)\n\t\t{\n\t\t\tfor($i=0;$i<sizeof($completearr);$i++ )\n\t\t\t{\n\t\t\t\tif($res->startdate_c <= $completearr[$i] && $completearr[$i]<=$res->enddate_c )\n\t\t\t\t{\n\t\t\t\t\t$oldscheduleid =$res->id;\n\t\t\t\t\t$objdoctorschedule = new Model_Doctorschedule;\n\t\t\t\t\t$objdoctorschedule-> where('id','=',$oldscheduleid );\n\t\t\t\t\t\n\t\t\t\t\tforeach($objdoctorschedule->find_all() as $res)\n\t\t\t\t\t{\n\t\t\t\t\t\t$objdoctorscheduleslots = new Model_Doctorscheduleslot;\t\t\t\n\t\t\t\t\t\t$objdoctorscheduleslots = $objdoctorscheduleslots->where('refdoctorscheduleslotid_c','=',$res->id)->find_all();\n\t\t\t\t\t\tforeach($objdoctorscheduleslots as $r )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$r->delete();\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$res->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t//put all restricted dates into $newresticteddates\n\t\t$arrresdates= explode(\",\", $restricteddates);\n\t\t$newresticteddates = array();\n\t\t\n\t\tfor($j=0;$j<sizeof($arrresdates);$j++ )\n\t\t{\n\t\t\tif( strtotime($startdate)<= strtotime($arrresdates[$j] ) && strtotime($arrresdates[$j]) <= strtotime( $enddate) )\n\t\t\t{\n\t\t\t\tarray_push( $newresticteddates, date('Y-m-d',strtotime( $arrresdates[$j])));\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//set new schedule for doctor\n\t\tfor($i=0;$i<sizeof($completearr);$i++ )\n\t\t{\n\t\t\t$result = $this->savedocschedule($doccalendarid,$completearr[$i] ,$completearr[$i] ,$shortvisit,$longvisit,$blockval,$appstartegy,$restricteddates,$schedulename);\n\t\t\tif( array_search($completearr[$i],( $newresticteddates)) == FALSE)\n\t\t\t{\n\t\t\t\t$this->adddayschedule($result,date('l',strtotime($completearr[$i] )) ,$mondaydata,$tuesdaydata,$wednesdaydata,$thursdaydata,$fridaydata,$saturdaydata,$sundaydata );\n\t\t\t}\n\t\t}\n\t\techo $result;\n\t}", "public function cancelled()\n {\n return ! is_null($this->ends_at) || $this->paddle_status === Paddle::STATUS_CANCELLED;\n }", "public function isCancelled()\n {\n return $this->getStatus() == Response::STATUS_CANCELLED;\n }", "function paypal_cancel(){\n\t\t$data['template'] = 'paypal_cancel';\n\t\t$data['records'] = \"\";\n\t\t$this->load->view('front/front-base', $data);\t\n\t}", "function paypal_cancel($id=null) {\n // $this->layout = 'clean'; \n // $this->render('paypal_back'); \n }", "public function isButtonValidBlankCallExpectFalse() {}", "public function isButtonValidBlankCallExpectFalse() {}", "public static function cancelAppointment($data) {\n // Validate the appointment details\n $valid = self::validateCancellation($data);\n\n if ($valid) {\n try {\n // Define conditions to be checked in query\n $selections = array(\n 'id' => array(\n 'comparison' => '=',\n 'param' => ':id',\n 'value' => $data['to_cancel'],\n ),\n );\n\n // Define columns to be updated\n $update_columns = array(\n 'cancelled' => array(\n 'param' => ':cancelled',\n 'value' => true,\n ),\n );\n\n if ($_SESSION['user']->role_id == PATIENT_ROLE) {\n // Set patient's cancellation reason\n $cancellation_reason_column = 'p_cancellation_reason';\n } else {\n // Set booker's cancellation reason\n $cancellation_reason_column = 'b_cancellation_reason';\n }\n\n // Define columns to be updated, depending on the user's role\n $update_columns[$cancellation_reason_column] = array(\n 'param' => \":$cancellation_reason_column\",\n 'value' => strlen($data['cancellation_reason']) > 0 ? $data['cancellation_reason'] : null,\n );\n\n // Cancel the specified appointment\n $cancellation_result = $GLOBALS['app']->getDB()->updateWhere('appointment', $selections, $update_columns);\n\n if ($cancellation_result) {\n $GLOBALS['successes'][] = 'Your appointment has been successfully cancelled.';\n\n // Define message to be sent via the user's contact preferences\n $message = \"Your appointment has been cancelled\";\n $message .= isset($data['cancellation_reason']) ? ' for the following reason: \"' . $data['cancellation_reason'] . '\".' : '.';\n\n if ($_SESSION['user']->role_id == PATIENT_ROLE) {\n if ($_SESSION['user']->contact_by_email) {\n UserManager::receiveEmail($_SESSION['user']->id, $message);\n }\n if ($_SESSION['user']->contact_by_text) {\n UserManager::receiveSms($_SESSION['user']->id, $message);\n }\n } else {\n if ($data['patient_contact_by_email']) {\n UserManager::receiveEmail($data['patient_id'], $message);\n }\n if ($data['patient_contact_by_text']) {\n UserManager::receiveSms($data['patient_id'], $message);\n }\n }\n } else {\n $GLOBALS['errors'][] = 'An unexpected error has occurred. Please check the appointment you selected and try again.';\n }\n } catch (PDOException $e) {\n $GLOBALS['errors'][] = $e->getMessage();\n }\n } else {\n $GLOBALS['errors'][] = 'Sorry, the appointment could not be cancelled using the given details. Please check your selection and reason and try again.';\n }\n }", "public function isButtonValidBlankCallExpectFalse() {}", "public function hasCancelPeriod(){\n\t\treturn $this->getSubscription()->getCancelPeriod() >= 1;\n\t}", "public function isButtonValidBlankCallExpectFalse() {}", "public function process_button()\n {\n return false;\n }", "function buttonDisabled() {\n global $user;\n if($user->can_edit_events())\n return '';\n else\n return 'disabled';\n}", "public function cancelAction(){\n\t\t$actionId = $this->input->post('actionId');\n\t\t$actionNotes = $this->input->post('actionNotes');\n\t\t$entryId = $this->input->post('entryId');\n\n\t\tif($actionId !== false){\n\t\t\t$this->load->model('action_model');\n\t\t\t$update_action = $this->action_model->cancel_action($actionId, $entryId, $actionNotes, $this->user_id);\n\t\t\t\n\t\t\tif($update_action === true){\n\t\t\t\techo \"action cancelled\";\n\t\t\t} else {\n\t\t\t\techo \"error\";\n\t\t\t}\n\n\t\t} else{\n\t\t\techo 'actionId can not be empty';\n\t\t}\n\t\t\n\t}", "public function isCancelled()\n {\n return $this->getPaymentStatus() == 'canceled';\n }", "public function cancelled(): bool;", "function cancel()\n\t{\n\t\t// @task: Check for acl rules.\n\t\t$this->checkAccess( 'setting' );\n\n\t\t$mainframe = JFactory::getApplication();\n\t\t$mainframe->redirect('index.php?option=com_easyblog');\n\t}", "function checkIfAlreadyAppointment($conn, $teacher_id, $start_time, $end_time)\n{\n\t// SQL to check if there is already an appointment\n\t$sql_check_if_already_appointment = \"SELECT * FROM appointments WHERE student_id = {$_SESSION['userid']} AND teacher_id = {$teacher_id} AND parents_evening_id = {$_GET['id']}\";\n\n\t// Store the result set in a variable\n\t$result = mysqli_query($conn, $sql_check_if_already_appointment);\n\n\t// Check if there any rows returned by the query\n\tif(mysqli_num_rows($result) > 0)\n\t{\n\t\t// Return the string\n\t\treturn \"secondary' disabled>\";\n\t}\n\telse\n\t{\n\t\t// Return the string\n\t\treturn \"secondary' data-toggle='modal' data-target='#choose-timeslot-modal' onClick=\\\"chooseTimeslot('{$_SESSION['userid']}','{$teacher_id}','{$start_time}','{$end_time}')\\\">\";\n\t}\n}", "public function isCanceled() : bool\n {\n return $this->is_canceled;\n }", "function wpdev_is_booking_resource_exist($blank, $bk_type_id, $is_echo) {\n global $wpdb;\n $wp_q = $wpdb->prepare( \"SELECT booking_type_id as id FROM {$wpdb->prefix}bookingtypes WHERE booking_type_id = %d \", $bk_type_id );\n $res = $wpdb->get_results( $wp_q );\n if ( count($res) == 0 ) {\n if ($is_echo) {\n ?> <script type=\"text/javascript\">\n if (document.getElementById('booking_form_div<?php echo $bk_type_id; ?>') !== null)\n document.getElementById('booking_form_div<?php echo $bk_type_id; ?>').innerHTML = '<?php echo __('This booking resources does not exist' ,'booking'); ?>';\n </script> <?php\n }\n return false;\n } else {\n return true;\n }\n\n }", "public function cancelAppointment($appointmentId) {\n $sql = query_Update_CancelAppointment;\n $stmt = $this->con->prepare($sql);\n $stmt->bind_param('s', $appointmentId);\n $result = $stmt->execute();\n $stmt->close();\n\n if ($result == 1) {\n return true;\n } else {\n return false;\n }\n\n }", "public function checkMessageCancel($message){\n \techo substr($message,0,9).'<br>';\n \tif(substr($message,0,7)=='CANCEL:'){return true;}\n \telse{return false;}\n }", "public function canCancel(&$why)\n {\n if ($this->getStatus() == 'cancelled') {\n $why = 'Already cancelled';\n return false;\n }\n\n $now = new DateTime();\n $pickupDate = date_create($this->getPickupDate());\n\n if ($pickupDate <= $now) {\n $why = 'Pickup date already passed';\n return false;\n }\n\n return true;\n }", "public function getCancel(): ?string;", "public function canInteract()\n {\n return !$this->scheduled_deactivate && !$this->scheduled_delete;\n }", "function cancel(){\n\t\tredirect ('admin/tampil');\n\t}", "public function cancelAction() {\n if ($this->getRequest()->isPost()) {\n $can = $this->getRequest()->getPost('can');\n if ($can == 'Yes') {\n $id = $this->getRequest()->getPost('id');\n $request = new Application_Model_DbTable_Request();\n $request->updateStatusRequest($id, 4);\n }\n $this->_helper->redirector('home', 'index');\n } else {\n $id = $this->_getParam('id', 0);\n $request = new Application_Model_DbTable_Request();\n $this->view->request = $request->getRequest($id);\n }\n }", "protected function inputIsCancel($digit)\n {\n return $digit == $this->cancelDigit;\n }", "protected function getFunction()\n {\n return 'cancel';\n }", "function cancelEvent(){\n\n\t}", "public function canCancelKlarnaOrder()\n {\n return $this->scopeConfig->isSetFlag(self::XML_KLARNA_CANCEL_ALLOW);\n }", "public function allowCancel()\n {\n // todo: Implement order cancelling allowance check\n\n // Example implementation\n return true; // do not allow cancellation\n }", "function _displayFormConfirm($err='')\r\n\t{\r\n\t\t$dt =& $this->_dt;\r\n\r\n\t\t$utpage = new utPage('schedu');\r\n\t\t$content =& $utpage->getPage();\r\n\t\t$act = kform::getData();\r\n\t\t$form =& $content->addForm('tConfirmation', 'schedu', $act);\r\n\r\n\t\t$kedit =& $form->addHide('venue', kform::getInput('venue', ''));\r\n\t\t$kedit =& $form->addHide('day', kform::getInput('day', ''));\r\n\t\t$kedit =& $form->addHide('start', kform::getInput('start', ''));\r\n\t\t$kedit =& $form->addHide('end', kform::getInput('end', ''));\r\n\t\t$kedit =& $form->addHide('length', kform::getInput('length', 30));\r\n\t\t$kedit =& $form->addHide('nbCourt', kform::getInput('nbCourt', 5));\r\n\t\t$kedit =& $form->addHide('matchList', kform::getInput('matchList', ''));\r\n\t\t$kedit =& $form->addHide('scheduList', kform::getInput('scheduList', ''));\r\n\t\t// Initialize the field\r\n\t\tif ($err =='')\r\n\t\t{\r\n\t $form->addMsg(\"msgConfirm$act\");\r\n\t $form->addBtn('btnDelete', KAF_SUBMIT);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t $form->addWng($err);\r\n\t\t}\r\n\t\t$form->addBtn('btnCancel');\r\n\t\t$elts = array('btnDelete', 'btnCancel');\r\n\t\t$form->addBlock('blkBtn', $elts);\r\n\r\n\t\t//Display the page\r\n\t\t$utpage->display();\r\n\t\texit;\r\n\t}", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "function verificarCancelado() {\n $cancelado=$this->validacion->validarCancelado($_REQUEST);\n if($cancelado!='ok' && is_array($cancelado))\n {\n $_REQUEST['confirmacion']=\"cancelado\";\n $mensaje=\"El Espacio Acad&eacute;mico ha sido cancelado\".$cancelado['VECES'].\"en el per&iacute;odo actual. ¿Desea inscribirlo nuevamente?\";\n $this->solicitarConfirmacion($mensaje,$_REQUEST);\n }\n }", "function can_confirm() {\n return true;\n }", "private function show_send_to_crm_button() {\n \n $form_id = rgget('id');\n \n return $this->has_feed($form_id);\n }", "function cancel()\n\t{\n\t\t// Checkin the detail\n\t\t$model = $this->getModel('inventory_detail');\n\t\t$model->checkin();\n\t\t$this->setRedirect( 'index.php?option=com_jinventory' );\n\t}", "public function actionacceptRejectAppointment()\n\t{\n\t\t$this->isLogin();\n\t\t$data = array();\n\t\t$data['status'] = $_REQUEST['appointment_status'];\n\t\t//$data['patient_view'] = 0;\n\t\t$data['modified_at'] = date(\"Y-m-d H:i:s\");\n\t\n\t\t$AppointmentObj = new Appointment();\n\t\t$AppointmentObj->setData($data);\n\t\t$AppointmentObj->insertData($_REQUEST['appointment_id']);\n\t\t$AppointmentObj = new Appointment();\n\t\t$appointmentData = $AppointmentObj->getAppointmentById($_REQUEST['appointment_id']);\n\t\n\t\tif ($_REQUEST['appointment_status'] == 3)\n\t\t{\n\t\t\t$appointmentData['message'] = \"Your appointment have been accepted on \".date('M d, Y',strtotime($appointmentData['modified_at'])).' with doctor '.Yii::app()->session['fullName'];\n\t\t\tYii::app()->user->setFlash(\"success\", \"Appointment accepted successfully.\");\n\t\t}\n\t\telse if ($_REQUEST['appointment_status'] == 4)\n\t\t{\n\t\t\t$appointmentData['message'] = \"Your appointment have been rejected on \".date('M d, Y',strtotime($appointmentData['modified_at'])).' with doctor '.Yii::app()->session['fullName'];\n\t\t\tYii::app()->user->setFlash(\"success\", \"Appointment rejected successfully.\");\n\t\t}\n\t\n\t\t$this->redirect(array(\"patient/appointmentList\"));\n\t}", "function leaveAppointment()\r\n {\r\n $app = JFactory::getApplication();\r\n $appSettings = JBusinessUtil::getInstance()->getApplicationSettings();\r\n $model = $this->getModel('companies');\r\n $post = JRequest::get( 'post' );\r\n $companyId = JRequest::getVar('company_id');\r\n $company = $model->getPlainCompany($companyId);\r\n $companyEmail = $company->email;\r\n $companyName = $company->name;\r\n\r\n if($appSettings->captcha){\r\n\t $captchaAnswer = !empty($post['recaptcha_response_field'])?$post['recaptcha_response_field']:$post['g-recaptcha-response'];\r\n $namespace=\"jbusinessdirectory.contact\";\r\n $captcha = JCaptcha::getInstance(\"recaptcha\", array('namespace' => $namespace));\r\n if(!$captcha->checkAnswer($captchaAnswer)){\r\n $error = $captcha->getError();\r\n $this->setMessage(\"Captcha error!\", 'warning');\r\n $this->setRedirect(JBusinessUtil::getCompanyLink($company));\r\n return;\r\n }\r\n }\r\n\r\n $eventModel = $this->getModel('event');\r\n $event = $eventModel->getPlainEvent($post['event_id']);\r\n if ($eventModel->leaveAppointment($post))\r\n {\r\n $this->setMessage(JText::_('LNG_APPOINTMENT_RESERVED'));\r\n EmailService::sendAppointmentEmail($event, $post, $companyEmail, $companyName);\r\n $this->setRedirect(JBusinessUtil::getCompanyLink($company));\r\n }else {\r\n $this->setMessage(JText::_('LNG_ERROR_RESERVING_APPOINTMENT'), 'warning');\r\n $this->setRedirect(JBusinessUtil::getCompanyLink($company));\r\n }\r\n }", "function addCancel()\n\t{\n\t\t$this->redirectToReferer();\n\t}", "public function isCancelled()\n {\n return $this -> id == config('constant.orderstate.CANCELLED_ID');\n }", "public function isCanceled()\n {\n return $this->markedAs($this->getCanceledValue());\n }", "public function isCanceled()\n {\n return $this->status === SubscriptionStatus::STATUS_CANCELED;\n }", "function cancel() {\n $msg = JText::_('Operation cancelled');\n $this->setRedirect('index.php?option=com_shortlink', $msg);\n }", "public function requestCancel(){\n\t\t$this->checkWorkflow(self::STATUS_CANCELED, false);\n\t\tif ($this->hasCancelPeriod()) {\n\t\t\t$this->getSubscription()->setCancelRequest(true);\n\t\t\t$this->save();\n\t\t\t$this->sendCancelRequestEmail();\n\t\t\t$this->getLogger()->info('The cancelation of the subscription was requested.');\n\t\t}\n\t\telse {\n\t\t\t$this->cancel();\n\t\t\t$this->sendCancelEmail();\n\t\t}\n\t}", "public function isDismissable();", "private function showMultipleCancelFilterButton(): bool\n {\n return (bool) count($this->multipleFilter);\n }", "public function cancelled(): bool\n {\n return $this->status === self::STATUS_CANCELLED;\n }", "public function canCancel(int $customerId): bool;", "private static function validateCancellation($data) {\n $reason_limit = 255;\n $valid_id = false;\n\n // Check if the given ID matches an ID of one of the appointments\n foreach ($data['appointments'] as $appointment) {\n if ($appointment['id'] === $data['to_cancel']) {\n $valid_id = true;\n break;\n }\n }\n\n if (empty($data['to_cancel']) || !$valid_id) {\n $GLOBALS['errors'][] = 'Please select an existing appointment.';\n } elseif (strlen($data['cancellation_reason']) > $reason_limit) {\n $GLOBALS['errors'][] = 'Please ensure the cancellation reason does not exceed 255 characters.';\n } else {\n return true;\n }\n\n return false;\n }", "function cancel()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$id\t\t= JRequest::getVar( 'id', 0, '', 'int' );\n\t\t$db\t\t=& JFactory::getDBO();\n\t\t$row\t=& JTable::getInstance('mfpoll', 'Table');\n\n\t\t$row->checkin( $id );\n\t\t$this->setRedirect( 'index.php?option=com_mfpolls' );\n\t}", "public function cancelPopup() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('cancelPopup', func_get_args()));\n }", "function cancelUpdateNewsItem()\n\t{\n\t\treturn $this->editNews();\n\t}", "public function isButtonValidBrokenSetupInvalidButtonAsSecondParametersGivenExpectFalse() {}", "function cancel() {\n\t\t$model = $this->getModel( $this->_sTaskModel, '', $this->_parameters );\n\t\t$model->resetFormFields();\n\t\t$link = $model->getReturnLink();\n\t\t$this->setRedirect($link);\n\t}", "public function setPrefectButton()\n {\n // If ???? complete button active\n\n // If no correspondence, \"send head prefect email\"\n\n // if correspondence greater than 0 \"head prefect email sent\" btn-success-\n // need drop down to resend\n\n // else button disabled\n\n\n }", "public function notifyIfCancelled()\n {\n if (isset($_GET['cancelled'])) {\n wc_add_notice(__('Cancelled transaction! You cancelled you payment, or the transaction has been expired!', 'pine-simplepay'), 'error');\n }\n }", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('topup_offline')->update($info->id, $data);\n\t \n\t $data = array();\n\t $data['order_status'] = 'canceled';\n\t model('invoice_order')->update($info->invoice_order_id, $data);\n\t \n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}" ]
[ "0.68407214", "0.6665447", "0.66481256", "0.65242183", "0.649454", "0.64808327", "0.6404077", "0.62213165", "0.61329806", "0.6039677", "0.6008333", "0.59728724", "0.5947292", "0.5921994", "0.5921994", "0.5921994", "0.5921994", "0.5907158", "0.59041667", "0.59011054", "0.58939314", "0.58935165", "0.58340365", "0.5825319", "0.5790063", "0.57722", "0.57511234", "0.5748493", "0.5748493", "0.5701611", "0.5689452", "0.5669734", "0.5666772", "0.5665628", "0.5663357", "0.5659592", "0.5642611", "0.5629861", "0.5627525", "0.5626395", "0.5625203", "0.56002915", "0.5594296", "0.55867225", "0.55851847", "0.55773085", "0.55727386", "0.55727386", "0.55721724", "0.557215", "0.55720395", "0.5571548", "0.5566297", "0.5564841", "0.5555825", "0.55476755", "0.5543321", "0.55354416", "0.5532472", "0.55183816", "0.55087996", "0.5506381", "0.5505021", "0.54958487", "0.548107", "0.5465413", "0.5459519", "0.5458265", "0.54533654", "0.54516613", "0.544753", "0.54445755", "0.5442123", "0.54419595", "0.54349357", "0.5423863", "0.5415238", "0.5405729", "0.5399343", "0.5397921", "0.5393923", "0.53933126", "0.5391478", "0.5389852", "0.5385289", "0.5382619", "0.53783655", "0.5377892", "0.537463", "0.53687036", "0.53635573", "0.5362335", "0.53574044", "0.53518116", "0.5343009", "0.533986", "0.53345805", "0.53260785", "0.532567", "0.53255475" ]
0.71290517
0
Gets the childlessDescendants of the node.
Получает потомков без детей узла.
public function childlessDescendants() { $condition = [ 'and', ['>', $this->leftAttribute, $this->owner->getAttribute($this->leftAttribute)], ['<', $this->rightAttribute, $this->owner->getAttribute($this->rightAttribute)], [$this->rightAttribute => new Expression($this->owner->getDb()->quoteColumnName($this->leftAttribute) . '+ 1')], ]; $this->applyTreeAttributeCondition($condition); return $this->owner->find()->andWhere($condition)->addOrderBy([$this->leftAttribute => SORT_ASC]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllDescendants()\n {\n return $this->all_descendants;\n }", "public function childrenAndSelf(): Descendants\n {\n return $this->descendantsAndSelf()->whereDepth('<=', 1);\n }", "public function getDescendants();", "public function getDescendants()\r\n {\r\n return self::descendants()->orderBy('level')->orderBy('name')->get();\r\n }", "public function getDescendants()\n\t{\n\t\t$this->scopeDescendants();\n\n\t\treturn $this->get(true);\n\t}", "public function children()\n {\n return $this->descendants(1);\n }", "public function descendants(): Descendants\n {\n return $this->newDescendants(\n (new static())->newQuery(),\n $this,\n $this->getPivotTableName(),\n $this->getParentKeyName(),\n $this->getChildKeyName(),\n $this->getLocalKeyName(),\n $this->getLocalKeyName(),\n false\n );\n }", "public function getDescendants()\n {\n if (!$this->isLoaded() or $this->getNumDescendants() == 0) return array();\n\t\t$id = $this->getId();\n return new $this->_list_class_name ($this->_db, \"{$this->_left_side} > {$this->lside} AND {$this->_left_side} < {$this->rside}\", 0, 0, $this->_left_side);\n }", "public function getChildNodes()\n {\n return $this->childNodes;\n }", "public function get_children($visible_only = '')\n {\n }", "public function get_visible_children()\n {\n }", "public function getChildNodes()\n {\n return $this->children;\n }", "public function getChildNodesUnfiltered()\n {\n return PagesModel::getChildNodesUnfiltered($this->id, $this->lang);\n }", "public function descendants()\n {\n return $this->joinClosureBy('descendant');\n }", "public function descendantsAndSelf(): Descendants\n {\n return $this->newDescendants(\n (new static())->newQuery(),\n $this,\n $this->getPivotTableName(),\n $this->getParentKeyName(),\n $this->getChildKeyName(),\n $this->getLocalKeyName(),\n $this->getLocalKeyName(),\n true\n );\n }", "function getDescendants ();", "public function getDescendants() {\n $c = $this->xpdo->newQuery('disBoard');\n $c->innerJoin('disBoardClosure', 'c', 'c.descendant = disBoard.id');\n $c->where(array('c.ancestor' => $this->get('id'),\n 'id:!=' => $this->get('id')\n ));\n $boards = $this->xpdo->getCollection('disBoard', $c);\n $descendants = array();\n foreach ($boards as $board) {\n $descendants[] = $board;\n }\n return $descendants;\n }", "public function getImmediateDescendants()\n\t{\n\t\t$this->scopeImmediateDescendants();\n\n\t\treturn $this->get(true);\n\t}", "public function getDescendantsAndSelf()\n\t{\n\t\t$this->scopeDescendantsAndSelf();\n\n\t\treturn $this->get(true);\n\t}", "public function getChildren()\r\n {\r\n return self::descendants()->where('depth', $this->depth + 1)->orderBy('name')->get();\r\n }", "public function descendants()\n\t{\n\t\treturn new DescendantsRelation($this->newQueryWithoutScopes(), $this);\n\t}", "public function children()\n {\n return $this->getAttribute('children');\n }", "public function getChildNodes() {}", "public function getChildrenAttribute() {\n return $this->children();\n }", "public function getChildNodes();", "public function getChildrens() {\n return $this->children;\n }", "public function get_children()\n\t{\n\t\treturn $this->_children;\n\t}", "public function getDescendantCount() {\r\n\t\treturn $this->_children->getDescendantCount() ?: 1;\r\n\t}", "public function getChildren ()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren ()\n {\n return $this->children;\n }", "public function children(): NodeList {\n $results = $this->collection()->reduce(function($carry, $node) {\n return $carry->merge(\n $node->findXPath('child::*')\n );\n }, $this->newNodeList());\n\n return $results;\n }", "protected function scopeDescendants()\n\t{\n\t\t$this->treeNestedGet = true;\n\n\t\t$db = $this->getDbo();\n\n\t\t$fldLft = $db->qn($this->getFieldAlias('lft'));\n\t\t$fldRgt = $db->qn($this->getFieldAlias('rgt'));\n\n\t\t$this->whereRaw($db->qn('node') . '.' . $fldLft . ' > ' . $db->qn('parent') . '.' . $fldLft);\n\t\t$this->whereRaw($db->qn('node') . '.' . $fldLft . ' < ' . $db->qn('parent') . '.' . $fldRgt);\n\t\t$this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft));\n\t}", "public function children() {\n\t\treturn $this->children; \n\t}", "public function getDescendants($depth = 0) {\n $c = $this->xpdo->newQuery('quipComment');\n $c->select($this->xpdo->getSelectColumns('quipComment','quipComment'));\n $c->select(array(\n 'Descendants.depth',\n ));\n $c->innerJoin('quipCommentClosure','Descendants');\n $c->innerJoin('quipCommentClosure','Ancestors');\n $c->where(array(\n 'Descendants.ancestor' => $this->get('id'),\n ));\n if ($depth) {\n $c->where(array(\n 'Descendants.depth:<=' => $depth,\n ));\n }\n $c->sortby('quipComment.rank','ASC');\n return $this->xpdo->getCollection('quipComment',$c);\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function nodes() {return $this->doc->childNodes;}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren() {\n\t\treturn new self($this->getCurrentNodeSubnodes(), $this->includeAllSubNodes);\n\t}", "Public Function getChildren() { Return $this->children; }", "public function getChildren() {\n return $this->children;\n }", "public function getChildren() {\n return $this->children;\n }", "public function getChildren() {\n return $this->children;\n }", "public function getChildren() {\r\n return $this->children;\r\n }", "public function getOnChildrenOnly() {\n return $this->onChildrenOnly;\n }", "public function getChilds() {\r\n\t\treturn $this->childs;\r\n\t}", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function getChildren() {\n return $this->children;\n }", "public function getChilds()\n {\n return $this->childs;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n if (array_key_exists(\"children\", $this->_propDict)) {\n return $this->_propDict[\"children\"];\n } else {\n return null;\n }\n }", "public function getChildren ( ) {\n\t\treturn $this->children_;\n\t}", "public function &getChildren()\n\t{\n\t\treturn $this->_children;\n\t}", "public function getNumberDescendants() {\n return $this->getDescendantsQuery()->count();\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getNumDescendants()\n {\n return max($this->{$this->_right_side} - $this->{$this->_left_side} - 1, 0);\n }", "public function getChildren()\n {\n if (array_key_exists(\"children\", $this->_propDict)) {\n return $this->_propDict[\"children\"];\n } else {\n return null;\n }\n }", "function children() {\r\n return $this->_children;\r\n }", "protected function getChildElementNodes(): array\n {\n $childNodes = [];\n\n /** @var self $childNode */\n foreach ($this->childNodes as $childNode) {\n if ($childNode->nodeType === \\XML_ELEMENT_NODE) {\n $childNodes[] = $childNode;\n }\n }\n\n return $childNodes;\n }", "public function &getChildren()\n {\n return $this->children;\n }", "public function getChildren() {\n\t\treturn clone $this->children;\n\t}", "public function allChildren()\n {\n return $this->children()->with('allChildren');\n }", "public function setAllDescendants($var)\n {\n GPBUtil::checkBool($var);\n $this->all_descendants = $var;\n\n return $this;\n }", "public function getDescendants($maxDepth = null, $includeItself = false)\n {\n $descentantsContainer = collect();\n\n self::collectDescendants($descentantsContainer, $this, $maxDepth, $includeItself);\n\n return $descentantsContainer;\n }", "public function getChildrenItems()\n {\n return $this->_children;\n }", "public function withDescendants()\n {\n $this->addDescendants = true;\n\n return $this;\n }", "public function descendants() {\n\t\t$categories = collect( array() );\n\n\t\t$children = $this->children()->with( 'posts' )->get();\n\n\t\twhile ( $children->isNotEmpty() ) {\n\t\t\t$children_ids = array();\n\n\t\t\tforeach ( $children as $child ) {\n\t\t\t\t$categories->push( $child );\n\n\t\t\t\t$children_ids[] = $child->id;\n\t\t\t}\n\n\t\t\t$children = Category::whereIn( 'parent', $children_ids )->with( 'posts' )->get();\n\t\t}\n\n\t\treturn $categories;\n\t}", "function getChildren() {\n return $this->getChildren;\n }", "public function children()\n {\n $children = $this->filter(array('category_id' => $this->id));\n return $children;\n }", "public function isChildless()\n {\n return $this->owner->getAttribute($this->rightAttribute) - $this->owner->getAttribute($this->leftAttribute) === 1;\n }", "public function get_children_count() {\n $sortedids = self::get_tree($this->id);\n $invisibleids = $this->get_not_visible_children_ids();\n return count($sortedids) - count($invisibleids);\n }", "public function children($selector=null)\n {\n $result = $this->createChildInstance();\n\n if (isset($this->document) && $this->length > 0) {\n if (isset($this->root_instance) || isset($this->xpath_query)) {\n foreach ($this->nodes as $node) {\n if ($node->hasChildNodes()) {\n $result->loadDomNodeList($node->childNodes);\n }\n }\n } else {\n $result->loadDomNodeList($this->document->childNodes);\n }\n\n if ($selector) {\n $result = $result->filter($selector);\n }\n }\n\n return $result;\n }", "public function descendants(): DescendantsRelation\n\t{\n\t\ttry {\n\t\t\treturn new DescendantsRelation($this->newQuery(), $this);\n\t\t} catch (\\Throwable $e) {\n\t\t\tthrow new QueryBuilderException($e);\n\t\t}\n\t}", "public function getHasChildren()\n {\n return isset($this->has_children) ? $this->has_children : false;\n }", "public function get_children() {\n\t\treturn $this->child_categories;\n\t}", "function getChildren($node) {\n $result = array();\n foreach ($node->childNodes as $child) {\n if ($child->nodeType != XML_NODE_COMMENT && ($child->nodeType != XML_NODE_TEXT || trim($child->nodeValue) != \"\")) {\n array_push($result, $child);\n }\n }\n return $result;\n }", "public function childrenRecursive()\n {\n return $this->children()->with(['childrenRecursive', 'childrenPercent', 'childrenName']);\n }", "public function children($node) {\n $query = $this->node->newQuery();\n\n $query->where($this->node->getQualifiedParentColumnName(), '=', $node->getKey());\n\n // We must also add the scoped column values to the query to compute valid\n // left and right indexes.\n foreach($this->scopedAttributes($node) as $fld => $value)\n $query->where($this->qualify($fld), '=', $value);\n\n $query->orderBy($this->node->getQualifiedLeftColumnName());\n $query->orderBy($this->node->getQualifiedRightColumnName());\n $query->orderBy($this->node->getQualifiedKeyName());\n\n return $query->get();\n }", "public function getElements() {\n\t\treturn $this->children;\n\t}", "public function get_children()\n {\n }", "public function hasChildren()\n {\n return false;\n }", "public function getChildren(): \\Traversable\n {\n return $this->children;\n }" ]
[ "0.650445", "0.6502458", "0.64661944", "0.6357282", "0.62369347", "0.6232968", "0.60085875", "0.59939826", "0.5982118", "0.5979084", "0.5977756", "0.5965765", "0.59585726", "0.5951064", "0.587662", "0.58654886", "0.58388865", "0.58088064", "0.58037275", "0.5800578", "0.57928175", "0.57631415", "0.57273513", "0.56163955", "0.5573268", "0.55574197", "0.5531058", "0.5530043", "0.5492616", "0.5479971", "0.546726", "0.5465186", "0.54645896", "0.54422385", "0.543939", "0.5437709", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54364264", "0.54357064", "0.54357064", "0.5435546", "0.5428642", "0.54139334", "0.54139334", "0.54139334", "0.5408591", "0.53987294", "0.53944045", "0.53932947", "0.5378192", "0.5373245", "0.5372266", "0.53721386", "0.53704196", "0.53505504", "0.5339233", "0.53316486", "0.5328757", "0.5326414", "0.53255844", "0.53223485", "0.5314641", "0.5314618", "0.52941173", "0.52830267", "0.527917", "0.5279121", "0.516077", "0.5149638", "0.5138742", "0.5134899", "0.51326877", "0.5116613", "0.51107955", "0.51087505", "0.5083673", "0.50822467", "0.5073172", "0.5072297", "0.507198", "0.5058461", "0.5044854", "0.50416934", "0.50160706" ]
0.740919
0
Lists all Apkversion models.
Перечисляет все модели Apkversion.
public function actionIndex() { if ($this->checkAdminSession()) { $searchModel = new ApkversionSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function index()\n {\n return Brand::with('models')->get();\n }", "public function getListOfModels() {\n $requestBody = null;\n $inputArray = [];\n $ret = $this->fetch('GET', 'repository/models', $requestBody, $inputArray, array (\n ), array (\n ), array (\n 200 => 'Indicates request was successful and the models are returned',\n 400 => 'Indicates a parameter was passed in the wrong format. The status-message contains additional information.',\n ));\n return $ret;\n }", "public function getModelsList(){\n return $this->_get(1);\n }", "public function list(Request $request, AppVersion $model)\n {\n\n $search_data = json_decode($request->get('search_data'), true);\n\n $name = isset_and_not_empty($search_data, 'name');\n if ($name) {\n $model = $model->columnEqualSearch('name', $name);\n }\n $mobile_os = isset_and_not_empty($search_data, 'mobile_os');\n if ($mobile_os) {\n $model = $model->columnEqualSearch('mobile_os', $mobile_os);\n }\n $version_sn = isset_and_not_empty($search_data, 'version_sn');\n if ($version_sn) {\n $model = $model->columnLikeSearch('version_sn', '%' . $version_sn);\n }\n $order_by = isset_and_not_empty($search_data, 'order_by');\n if ($order_by) {\n $order_by = explode(',', $order_by);\n $model = $model->orderBy($order_by[0], $order_by[1]);\n }\n\n return $this->success($model->get());\n }", "public function getVersions();", "public function versions()\n {\n return $this->hasMany(\\App\\Version::class);\n }", "public function actionList() {\r\n\t\t// ToDo: Add security, Add pagination\r\n\t\t\r\n\t\t// Get a list of all the required resources\r\n\t\t$models = \\parallel\\yii\\ActiveRecord::model($this->_model)->findAll();\r\n\t\t\r\n\t\t// Return the list to the client\r\n\t\t$this->sendResponse($models);\r\n\t}", "public function getVersions() {}", "public function getVersions() {}", "public function getVersions() {}", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => CmsDocumentVersion::find(),\n 'pagination' => false,\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionVersionMap()\n\t{\n\t\t$models = Ut4Versionmap::model()->findAll(\"is_deleted = 0\");\n\t\t$versions = array();\n\n\t\tforeach ($models as $model)\n\t\t{\n\t\t\tarray_push($versions, array(\n\t\t\t\t\"version\" => $model->version,\n\t\t\t\t\"semver\" => $model->semver,\n\t\t\t\t\"released\" => date(\"Y-m-d\", strtotime($model->date_released)) . \"T00:00:00Z\"\n\t\t\t));\n\t\t}\n\t\theader(\"Content-Type: application/json\");\n\t\techo json_encode($versions);\n\t}", "public function versions()\n {\n return $this->hasMany(Version::class);\n }", "public function index()\n {\n return Vet::all();\n }", "public function index()\n {\n return Vendor::all();\n }", "function getversionlist() {\n\t\tJRequest::checkToken('request') or jexit( 'Invalid Token' );\n\t\t@ob_end_clean();\n\t\t$id \t\t= JRequest::getInt('id', 0);\n\t\t$active \t= JRequest::getInt('active', 0);\n\t\tif(!$id) return;\n\t\t$revert \t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/arrow_rotate_anticlockwise.png', JText::_( 'FLEXI_REVERT' ) );\n\t\t$view \t\t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/magnifier.png', JText::_( 'FLEXI_VIEW' ) );\n\t\t$comment \t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/comment.png', JText::_( 'FLEXI_COMMENT' ) );\n\n\t\t$model \t= $this->getModel('item');\n\t\t$model->_id = $id;\n\t\t$item = $model->getItem($id);\n\t\t$cparams =& JComponentHelper::getParams( 'com_flexicontent' );\n\t\t$versionsperpage = $cparams->get('versionsperpage', 10);\n\n\t\t$currentversion = $item->version;\n\t\t$page=JRequest::getInt('page', 0);\n\t\t$versioncount = $model->getVersionCount();\n\t\t$numpage = ceil($versioncount/$versionsperpage);\n\t\tif($page>$numpage) $page = $numpage;\n\t\telseif($page<1) $page = 1;\n\t\t$limitstart = ($page-1)*$versionsperpage;\n\t\t$versions = $model->getVersionList();\n\t\t$versions\t= & $model->getVersionList($limitstart, $versionsperpage);\n\t\tforeach($versions as $v) {\n\t\t\t$class = ($v->nr == $active) ? ' class=\"active-version\"' : '';\n\t\t\techo \"<tr\".$class.\"><td class='versions'>#\".$v->nr.\"</td>\n\t\t\t\t<td class='versions'>\".JHTML::_('date', (($v->nr == 1) ? $item->created : $v->date), JText::_( 'FLEXI_DATE_FORMAT_FLEXI_VERSIONS' )).\"</td>\n\t\t\t\t<td class='versions'>\".(($v->nr == 1) ? $item->creator : $v->modifier).\"</td>\n\t\t\t\t<td class='versions' align='center'><a href='#' class='hasTip' title='Comment::\".$v->comment.\"'>\".$comment.\"</a>\";\n\t\t\t\tif((int)$v->nr==(int)$currentversion) {//is current version?\n\t\t\t\t\techo \"<a onclick='javascript:return clickRestore(\\\"index.php?option=com_flexicontent&view=item&cid=\".$item->id.\"&version=\".$v->nr.\"\\\");' href='#'>\".JText::_( 'FLEXI_CURRENT' ).\"</a>\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"<a class='modal-versions' href='index.php?option=com_flexicontent&view=itemcompare&cid[]=\".$item->id.\"&version=\".$v->nr.\"&tmpl=component' title='\".JText::_( 'FLEXI_COMPARE_WITH_CURRENT_VERSION' ).\"' rel='{handler: \\\"iframe\\\", size: {x:window.getSize().scrollSize.x-100, y: window.getSize().size.y-100}}'>\".$view.\"</a><a onclick='javascript:return clickRestore(\\\"index.php?option=com_flexicontent&task=items.edit&cid=\".$item->id.\"&version=\".$v->nr.\"&\".JUtility::getToken().\"=1\\\");' href='#' title='\".JText::sprintf( 'FLEXI_REVERT_TO_THIS_VERSION', $v->nr ).\"'>\".$revert;\n\t\t\t\t}\n\t\t\t\techo \"</td></tr>\";\n\t\t}\n\t\texit;\n\t}", "public function get_vip_models()\n {\n $vip_models = ModelsApi::GetVIPModels();\n\n return response()->json([\n 'model' => $vip_models\n ], 200);\n\n }", "public function index()\n {\n return Objava::all();\n }", "public function get_list()\n {\n $versions = cfr('Thorin_Version');\n return $versions;\n }", "public function index()\n {\n return ModelsProduct::all();\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index()\n {\n return $this->model->all();\n }", "public function getModels(): array\n {\n return $this->models;\n }", "public function index()\n {\n\n $models = Essay_model::all();\n\n return view('admin.essay.models.index')->with(['models' => $models]);\n\n }", "function api_version_lists(){\n $query = db_select(\"api_code_version\" , \"version\")\n ->fields(\"version\")->execute()->fetchAll();\n\n foreach ($query as $data) {\n $rows[] = array(\n array('data' => $data->url),\n array('data' => $data->method),\n array('data' => $data->source_name),\n array('data' => $data->version),\n array('data' => $data->last_function),\n array('data' => l(t('Edit'), 'admin/structure/services/apiversion/edit/' . $data->id) . ' - ' . l(t('Delete'), 'admin/structure/services/apiversion/delete/' . $data->id)),\n );\n }\n\n return theme('table', array('header'=>array(t('url'), t('method'),t('source'),t('version'), t('last_function'), t('action')), 'rows'=>$rows));\n}", "protected function getAllVersionableTables() : array {}", "public function index(){\n\n return $this->model->all();\n }", "public function index()\n {\n $versiones = versiones::all();\n return view('pages.versiones.index',compact('versiones'));\n }", "public function versions()\n {\n return $this->execute('versions');\n }", "public function index()\n {\n $models = $this->modelRepository->getAll();\n return $this->respondOk([\n 'models' => $this->modelTransformer->transformCollection($models)\n ]);\n }", "public function listarVersionsPlans(){\n $version= $this->db->select('*')->from('plans');\n return $version->get();\n }", "public function index()\n {\n $oCarModels = CarModel::paginate(15);\n return view('admin.fleet_management.models.index', compact('oCarModels'));\n }", "public function index()\n {\n $models = Modell::with('brand') ;\n $models = Modell::with('car') //WITH RELATION عشان يعمل Eggar load\n ->latest() // حسب الاسم برتب من الاخر\n ->orderBy('name', 'ASC') // برتب حسب الاسم \n ->paginate(5); //للتقسيم \n\n return view('admin.models.index', [\n 'models' => $models,\n 'cars' => Car::all(),\n 'brands' => Brand::all(),\n ]);\n }", "public function index() {\n $models = $this->model->paginate(10);\n $title = 'Models';\n\n return View::make('admin.models.index', compact('models','title'));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => ModelAssembly::find()->groupBy('modelid'),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return view('asset-models.view');\n }", "public static function get_versions()\n\t{\n\t\t$result = array();\n\n\t\t$modules = Module_Manager::get_modules(false);\n\t\tforeach ($modules as $module)\n\t\t{\n\t\t\t$module_id = $module->get_module_info()->id;\n\t\t\t$version = self::get_db_version($module_id);\n\t\t\t$result[$module_id] = $version;\n\t\t}\n\n\t\treturn $result;\n\t}", "function allAction() {\n $page = (int) $this->_getParam('page', 0);\n $limit = 100;\n $productModel = new Model_Product();\n $query = $productModel->select(false);\n $query\n ->from('products', array('id', 'name'))\n ->where('deleted <> 1')\n ->where('status = ?', 'APPROVED')\n ->limit($limit, $page * $limit);\n $results = $productModel->fetchAll($query);\n $this->view->apps = $results;\n $this->view->page = $page;\n }", "public function versions()\n\n {\n\n\n try {\n\n $versions = Version::where('content_name', $this->getAttributeValue('name'))->get();\n\n foreach ($versions as $version) {\n\n $version->data = json_decode($version->getAttributeValue('data'), true);\n\n }\n\n return $versions;\n\n } catch (\\Exception $e) {\n\n echo $e; die;\n\n }\n\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $planeModels = $em->getRepository('AppBundle:PlaneModel')->findAll();\n\n return $this->render(\n 'planemodel/index.html.twig', array(\n 'planeModels' => $planeModels,\n )\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $projectVersions = $em->getRepository('ProjectBundle:Common\\ProjectVersion')->findAll();\n\n return $this->render('ProjectBundle:common\\projectversion:index.html.twig', array(\n 'projectversions' => $projectVersions,\n ));\n }", "public function index()\n {\n return Vehicle::all();\n }", "public function index() {\n $versions = Version::with(['project'])->take(5)->orderBy('is_end', 'asc')->get();\n $my_list = Version::with(['project'])->whereHas('records', function ($query) {\n $query->where('user_id', \\Auth::id())->orderBy('current_time', 'desc');\n })->take(5)->orderBy('is_end', 'asc')->get();\n return view('home', compact('versions', 'my_list'));\n }", "public function loadModels($index = null)\n {\n /* @var ActiveQuery $query */\n $query = call_user_func([$this->query->modelClass, 'find']);\n if ($index) {\n $query = $query->indexBy($index);\n }\n\n return $query->all();\n }", "public function getModelsList()\n {\n $query = $this->createQueryBuilder('m')\n ->orderBy('m.name', 'DESC')\n ->getQuery();\n\n return $query->execute();\n }", "public function index()\n {\n return $this->model::orderBy('id', 'desc')->get();\n }", "public function models() { return $this->models; }", "function index()\n\t\t{\n\t\t\t$this->%lcaseModels% = (new %Model%)->find();\n\t\t}", "public function getAllModels()\n\t{\n //realizamos la consulta de todos los segmentos\n $consulta = $this->db->prepare(\"\n SELECT \n a.COD_MODEL\n , a.COD_MODEL_SUFFIX\n , a.COD_GBU\n , a.COD_SEGMENT\n , a.COD_SUB_SEGMENT\n , a.COD_MICRO_SEGMENT\n , a.COD_BRAND\n , a.COD_ESTADO\n FROM t_product a\");\n\n $consulta->execute();\n\n //devolvemos la coleccion para que la vista la presente.\n return $consulta;\n\t}", "public function getVersions()\n {\n return $this->sortVersions();\n }", "public function getModels()\n {\n return $this->models;\n }", "public function actionIndex()\n {\n $searchModel = new VendorsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function showAvisos(){\r\n require_once 'modelo/aviso.php';\r\n $aviso = new Aviso();\r\n $avisos = $aviso->getAll();\r\n return $avisos;\r\n }", "public function index() {\n $rows = Module::paginate(10);\n return View::make(\"CoreCms::module.listing\")->with(\"models\", $rows);\n }", "public function index(Request $request, ClientVersion $versionModel)\n {\n // $version_code = $request->query('version_code', 0);\n $type = $request->query('type');\n $limit = $request->query('limit', 15);\n $after = $request->query('after');\n\n $versions = $versionModel->when($after, function ($query) use ($after) {\n return $query->where('id', '>', $after);\n })\n ->where('type', $type)\n ->orderBy('version_code', 'desc')\n ->limit($limit)\n ->get();\n\n return response()->json($versions, 200);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ItesACBackendBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n\n $versions = Version::with('players')\n ->orderBy('created_at')\n ->get()\n ->groupBy(function ($val) {\n return Carbon::parse($val->created_at)->format('d j, Y');\n });\n\n\n // return GameResource::collection($versions)->response();\n\n return new GamesCollection($versions);\n }", "public function index()\n {\n return VatTariff::all();\n }", "public function listar() {\n $dados = $this->model->listar();\n echo $this->toJson($dados);\n }", "public function index(Request $request) {\n //展示我加入的version\n $type = $request->get('type', 'all');\n switch ($type) {\n # 全部\n case 'all':\n $list = Version::with(['user', 'project'])->whereHas('records', function ($query) {\n $query->where('user_id', \\Auth::user()->id);\n })->latest()->notclose()->paginate(10);\n break;\n # 正在进行中\n case 'current':\n $list = Version::with(['user', 'project'])->whereHas('records', function ($query) {\n $query->where('user_id', \\Auth::user()->id);\n })->latest()->active()->paginate(10);\n break;\n # 已结束\n case 'end':\n $list = Version::with(['user', 'project'])->whereHas('records', function ($query) {\n $query->where('user_id', \\Auth::user()->id);\n })->latest()->end()->paginate(10);\n break;\n default:\n\n }\n return view('versions.index', compact('list', 'type'));\n }", "public function index()\n {\n\n return \\View::make('elementSetHasVersions.index')\n ->with(['displayName' => 'elementSetHasVersions']\n );\n }", "public function models() {\n\t\t$models = $this->getModelNames();\n\t\treturn $models;\n\t}", "public function all()\n {\n return $this->modelClassName->all();\n }", "public function models() {\n\t\t$this->set('plugins', Admin::getModels());\n\t}", "public function index() {\n\t\t$plugins = Admin::getModels();\n\t\t$counts = array();\n\n\t\t// Gather record counts\n\t\tforeach ($plugins as $plugin) {\n\t\t\tforeach ($plugin['models'] as $model) {\n\t\t\t\tif ($model['installed']) {\n\t\t\t\t\t$object = Admin::introspectModel($model['class']);\n\n\t\t\t\t\tif ($object->hasMethod('getCount')) {\n\t\t\t\t\t\t$count = $object->getCount();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$count = $object->find('count', array(\n\t\t\t\t\t\t\t'cache' => array($model['class'], 'count'),\n\t\t\t\t\t\t\t'cacheExpires' => '+24 hours'\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\n\t\t\t\t\t$counts[$model['class']] = $count;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->set('plugins', $plugins);\n\t\t$this->set('counts', $counts);\n\t}", "public function actionIndex()\n {\n \n $limit_Lang_home = FConfigParam::find()->where(['name' => 'NUMBER_LANGUE_IN_HOME'])->one();\n $query = FLanguecenter::find()->where(['is_show' => 1])->orderBy('ordinal_view ASC');\n $count = $query->count();\n $pagination = new Pagination([\n 'defaultPageSize' => $limit_Lang_home->value,\n 'totalCount' => $count]);\n $models = $query->offset($pagination->offset)\n ->limit($pagination->limit)\n ->all();\n return $this->render('index', [\n 'models' => $models,\n 'pagination'=>$pagination,\n ]);\n }", "public function showAll() {\n $this->db->query('SELECT * FROM main_video');\n return $this->db->resultSet();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('IDPCBaseBundle:ProyectoInversion')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function get_versions()\n {\n $cards = $this->entityManager->getRepository(Card::class)->findAll();\n\n $versions = [];\n foreach ($cards as $card) {\n $versions[$card->getTitle()][] = $card;\n }\n\n return $versions;\n }", "public function APIVersions(){\n $dir = Config::inst()->get('Swagger', 'data_dir');\n $api_data_dir = (isset($dir)) ? Director::baseFolder().$dir : Director::baseFolder().\"/assets/api\";\n if (file_exists($api_data_dir)){\n $dirlist = array();\n foreach (new DirectoryIterator($api_data_dir) as $subdir) {\n if($subdir->isDir() && !$subdir->isDot())\n $dirlist[] = strtolower($subdir->getFileName());\n }\n if (count($dirlist) > 0){\n sort($dirlist);\n $out = new ArrayList();\n for ($pos = 0; $pos < count($dirlist); $pos++){\n $out->push(new ArrayData(array(\n \"Path\" => $dirlist[$pos],\n \"Name\" => str_replace('v', 'version ', $dirlist[$pos]),\n \"Selected\" => (($pos === count($dirlist) - 1) ? 'selected' : '')\n )));\n }\n return $out;\n }\n }\n return null;\n }", "public function indexAction()\n {\n $helpers = $this->get(\"app.helpers\");\n $em = $this->getDoctrine()->getManager();\n $msvRevisiones = $em->getRepository('AppBundle:MsvRevision')->findBy(array('estado' => 1));\n\n $response = array(\n 'status' => 'succes',\n 'code' => 200,\n 'msj' => \"Listado revisiones\",\n 'data' => $msvRevisiones,\n );\n return $helpers->json($response);\n }", "public function getVersions(){\n\t\n\t\tif( empty($this->_allversions) ){\n\t\t\n\t\t\t$query = \"SELECT a.* \"\n\t\t\t.\"FROM #__zbrochure_client_versions AS a \"\n\t\t\t.\"WHERE a.client_id = \".$this->_id\n\t\t\t;\n\t\t\t\t\t\n\t\t\t$this->_db->setQuery( $query );\n\t\t\t$this->_allversions = $this->_db->loadObjectlist();\n\t\t\n\t\t}\n\t\t\n\t\treturn $this->_allversions;\n\t\t\n\t}", "public function index()\n {\n $objeto = Objeto::all();\n return $this->showAll($objeto);\n }", "public function index()\n {\n \n $carModels = CarModel::orderBy('updated_at', 'DESC')->get();\n return response()->json(['data' => $this->option_transform($carModels, 'model', 'car_brand_id')], 200);\n }", "public function index()\n {\n $carModels=CarModel::all();\n \n return view('Admin.CarModels.index',compact('carModels'));\n }", "public function getModels()\n {\n return $this->_models;\n }", "public function index()\n {\n $vendors = Vendor::all();\n return view('admin.listvendor', compact('vendors'));\n }", "public function index()\n {\n //\n return Models::orderBy('id', 'desc')->get();\n }", "public function index()\n {\n return Vimeo::all();\n }", "public static function findAllInstances()\n {\n $ret = array();\n $modelProviders = Kwf_Config::getValueArray('modelProviders');\n foreach ($modelProviders as $modelProvider) {\n if ($modelProvider) {\n $modelProvider = new $modelProvider;\n $ret = array_merge($modelProvider->findModels(), $ret);\n }\n }\n $ret = array_unique($ret, SORT_REGULAR);\n return $ret;\n }", "function getModels()\n\t{\n\t\treturn $this->models;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:Vitrine')->findAllByOrder();\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n /**\n * How many articles we want to display per page.\n * @var integer\n */\n $pageSize = 2;\n\n /**\n * Articles have to be published.\n * @var boolean\n */\n $published = true;\n\n $searchModel = new AvisoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $pageSize, $published);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "private function ls() {\n\t\t$products = $this->Product->find('all');\n\t\tforeach($products as $product) {\n\t\t\t$this->out(\"ID: {$product['Product']['id']}\\t\\\"{$product['Product']['title']}\\\"\\t{$product['Product']['price']}\");\n\t\t}\n\t}", "public function index()\n {\n $assets = Asset::with('category', 'brand')->get();\n $defectives = Asset::defectives()->with('category', 'brand')->get();\n //Get all the asset with its relationship (category, brand, tags, asset_users, computers)\n return view('assets.all')->with(compact('assets', 'defectives'));\n }", "public function getAllModels()\n {\n if (!isset($this->model)) {\n $this->model = $this->modelRepo->findBy([], ['name' => 'asc']);\n }\n\n return $this->model;\n }", "public function verdicts()\n {\n return response()->json([ 'alphas' => Alpha::retrieveVerdicts() ]);\n }", "public function index()\n {\n $models=Motormodels::all();\n return view('Models.index')->with('models', $models);\n }", "public function get_models(){\n return $this->_ci_models;\n }", "public function actionList()\n {\n $query = CarManagement::find()->where([\n 'uid' => Yii::$app->user->getId(),\n 'status' => CarManagement::STATUS_SHOW\n ]);\n\n $data = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $pagination = new Pagination(['totalCount' => $query->count()]);\n\n return $this->_return([\n 'list' => $data->getModels(),\n 'pages' => [\n 'totalCount' => intval($pagination->totalCount),\n 'pageCount' => $pagination->getPageCount(),\n 'currentPage' => $pagination->getPage() + 1,\n 'perPage' => $pagination->getPageSize(),\n ]\n ]);\n }", "public function actionIndex() {\n\n $applications = Application::find()->where(['status' => 1])->asArray()->all();\n\n $adds = array();\n\n $types = array('BackAd', 'MainAd', 'BannerAd');\n\n\n foreach ($applications as $app) {\n\n $images = ApplicationImage::find()->where(['application_id' => $app['id']])->asArray()->all();\n\n\n foreach ($images as $image) {\n\n if (in_array($image['type'], $types)) {\n $adds[] = [\n 'AdType' => $image['type'],\n 'AppTitle' => $app['title'],\n 'IconUrl' => $image['name'],\n 'Id' => $app['package_id'],\n ];\n }\n }\n }\n\n\n\n $output = [\n 'Version' => 6,\n 'AppsList-Android' => $adds\n ];\n\n //echo \"<pre>\";\n\n print_r(json_encode($output, JSON_PRETTY_PRINT));\n\n exit;\n }", "public function index()\n {\n //\n return Venta::all();\n\n }", "public function index(Request $request)\n {\n $this->bimModelRepository->pushCriteria(new RequestCriteria($request));\n $bimModels = $this->bimModelRepository->all();\n\n return view('bimmodels::bim_models.index')\n ->with('bimModels', $bimModels);\n }", "public function actionIndex()\n {\n $searchModel = new VacunacionesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new VacunacionesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listsAll()\n {\n $products = new Product();\n return $products->all();\n }", "function &models()\n {\n $args = func_get_args();\n\n if (count($args)) {\n return o2system()->__get('models')->get($args[ 0 ]);\n }\n\n return o2system()->__get('models');\n }", "public function index()\n {\n $abonos = Abono::all();\n return view('abono/lista_abono', compact('abonos'));\n }", "public function actionIndexAll($purgeBefore = false)\n {\n foreach ($this->module->models as $model) {\n $this->run('index-model', [$model, $purgeBefore]);\n $this->stdout(\"\\n\");\n }\n }" ]
[ "0.618161", "0.61317515", "0.60249764", "0.59552777", "0.58904546", "0.58516353", "0.57221854", "0.5700592", "0.5696615", "0.5696615", "0.5696615", "0.56569755", "0.56485", "0.564086", "0.5623015", "0.5613821", "0.56097066", "0.56005836", "0.5572809", "0.555475", "0.55537933", "0.5534165", "0.5534165", "0.55255157", "0.55243486", "0.55235445", "0.5509953", "0.550245", "0.547775", "0.54706514", "0.54471356", "0.5444159", "0.5438744", "0.54357964", "0.5433797", "0.5414468", "0.5411004", "0.53915036", "0.5373621", "0.5363686", "0.53618616", "0.5347799", "0.5345571", "0.534326", "0.5336939", "0.53308624", "0.5308517", "0.53077096", "0.52986", "0.5293707", "0.5276955", "0.52763", "0.52707946", "0.52676505", "0.5266973", "0.5259447", "0.5259003", "0.5243893", "0.523563", "0.5233212", "0.5232673", "0.5223743", "0.5222617", "0.5222445", "0.52177763", "0.5217749", "0.52164674", "0.5211712", "0.5209263", "0.5207747", "0.5206154", "0.5193599", "0.5192549", "0.5188571", "0.51854324", "0.51763576", "0.51719135", "0.5169877", "0.51677996", "0.5167353", "0.5161232", "0.5148334", "0.51380056", "0.5130774", "0.5124295", "0.5122165", "0.5119494", "0.51158", "0.51123804", "0.51115525", "0.5099696", "0.5089146", "0.5088504", "0.50765884", "0.50762707", "0.50762707", "0.50728416", "0.5070796", "0.5069497", "0.5065209" ]
0.71769685
0
Creates a new Apkversion model. If creation is successful, the browser will be redirected to the 'view' page.
Создает новый объект модели Apkversion. Если создание успешно, браузер будет перенаправлен на страницу 'view'.
public function actionCreate() { if ($this->checkAdminSession()) { $rootPath = "apk/"; $model = new Apkversion(); if ($model->load(Yii::$app->request->post())) { $url = UploadedFile::getInstance($model, 'url'); $ext = $url->getExtension(); $randName = "hb" . $model->cat_default_id . CommonFun::getCurrentDateForFile() . "." . $ext; $url->saveAs($rootPath . $randName); $model->url = $rootPath . $randName; $model->createtime = CommonFun::getCurrentDateTime(); if ($model->save()) { return $this->redirect(['view', 'id' => $model->id]); } } else { return $this->render('create', [ 'model' => $model, ]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new voucher();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Videos();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function create() {\n //\n $this->authorize('create', Version::class);\n return view('versions.create', compact('users', 'projects'));\n }", "public function actionCreate()\n {\n $model = new Vote();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(VersionRequest $request) {\n //\n $this->authorize('create', Version::class);\n Version::create($request->all());\n session()->flash('success', '版本创建成功');\n return redirect(route('project.show', ['id' => $request->project_id,'param'=>'versions']));\n }", "public function actionCreate()\n {\n $model = new Baiduorder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->layout = static::FORM_LAYOUT;\n $model = new $this->MainModel;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->afterCreate($model);\n if ($this->hasView) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->redirect(['index']);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new $this->modelClass;\n\n if ($model->load($this->_request->post()) && $model->save()) {\n return $this->redirect([$this->viewView, 'id' => $model->$this->primaryKey]);\n } else {\n return $this->render($this->createView, [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new VacanteAspirante(['scenario' => VacanteAspirante::SCENARIO_CREATE]);\n\n $model->id_vacante = Yii::$app->request->post('id');\n\n if ($model->save()) {\n return $this->redirect(['indexmovil']);\n }\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Product();\n $model->loadDefaultValues();\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 actionCreate()\n {\n $model = new Inresult();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Vn]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Pengampu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) { \n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Maestroclipro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view(\"pages.admin.specification.os-version.create-os-version\",$this->data);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Product();\n\t\t\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$transaction = Yii::$app->db->beginTransaction();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$model->save();\n\t\t\t\t$transaction->commit();\n\t\t\t\t\n\t\t\t\treturn $this->redirect(['index']);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$transaction->rollBack();\n\t\t\t\t\n\t\t\t\techo '<pre>' . print_r($e, true);\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function store(CreateCarVersionRequest $request)\n {\n $carVersion = $this->carVersionRepository->saveRecord($request);\n\n Flash::success('Car Version saved successfully.');\n return redirect(route('admin.carVersions.index'));\n }", "public function actionCreate()\n {\n $model = new Vendors();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->logo = $model->upload($model,'logo');\n $model->photo = $model->upload($model,'photo');\n\n $model->comp_id = Yii::$app->session->get('Rules')['comp_id'];\n\n\n $model->save(false);\n\n $UpdateSeries = Generater::UpdateSeries('vendors','vatbus_posting_group',$model->vatbus_posting_group,$model->code);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('@admin/modules/vendors/views/vendors/create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new A2Caja();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_caja]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new OaGoodsinfo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->pid]);\n } else {\n\n return $this->render('create', [\n 'model' => $model,\n\n ]);\n }\n }", "public function actionCreate()\n {\n $modelName = $this->getModel();\n\t\t$model = new $modelName;\n\t\t$model->dt_create = date('c');\n\t\t$model->dt_update = date('c');\n\t\t$model->id_user_create = 1;\n\t\t$model->id_user_update = 1;\n\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t \n\t\t\t\t\treturn $this->redirect(['index']);\n\t\t\t\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Svision();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Brand();\n if ($model->load(Yii::$app->request->post())&& $model->save()){\n return $this->redirect(['index','model'=>$model]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model = new Dmpaper;\n\t\t$model->save();\n\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\n\t\t/*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}*/\n\t}", "public function actionCreate()\n {\n $model = new Purchase();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Apartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n /*return $this->render('create', [\n 'model' => $model,\n ]);*/\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Product();\n $model -> is_visible = 1;\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['index']);\n return $this->redirect(['view','id'=>$model->id]);\n }\n\n //print_r($model->errors);\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new XaPhuong();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n \t//$this->layout = \"@app/views/layouts/vendor\";\n \t$this->layout = \"@app/views/layouts/vendor_left\";\n \t$model = new Vendorproducts ();\n \n \tif ($model->load (Yii::$app->request->post())) {\n \t\t$model->vendorId = Yii::$app->user->id;\n \t\t\n \t\t$model->save ();\n \t\t\n \t\treturn $this->redirect ( [\n \t\t\t\t'index'\n \t\t] );\n \t} else {\n \t\t\n \t\treturn $this->render ( 'create', [\n \t\t\t\t'model' => $model\n \t\t] );\n \t}\n }", "public function actionIndex()\n {\n if ($this->checkAdminSession()) {\n $searchModel = new ApkversionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Anggota();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Product();\n $model->created_by = Yii::$app->getUser()->getId();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Articulo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->sku]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Link();\n\n if ($model->load(Yii::$app->request->post()) && $this->upload($model) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $this->active_menu = \"ex\";\n $this->open_class = \"exp\";\n $this->active_class = \"vadmin\";\n $id = Yii::app()->request->getParam('id');\n $receiver_type = Yii::app()->request->getParam('receiver_type');\n $receiver_id = Yii::app()->request->getParam('receiver_id');\n $voucher_type_id = Yii::app()->request->getParam('voucher_type_id');\n $model = new Voucher;\n if (!empty($_GET['closing_amt'])) {\n $model->amount = $_GET['closing_amt'];\n }\n $model->payment_date = date('Y-m-d');\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Voucher'])) {\n $model->attributes = $_POST['Voucher'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model, 'id' => $id, 'receiver_type' => $receiver_type, 'receiver_id' => $receiver_id,'voucher_type_id'=>$voucher_type_id,\n ));\n }", "public function actionCreate()\n {\n $model = new VehicleManagement();\n $model->aliyeingiza = Yii::$app->user->identity->username;\n $model->muda = date('Y-m-d H:i:s');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Cms();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Objects();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $session = Yii::$app->session;\n $session->setFlash('msg','บันทึกรายการเรียบร้อย');\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new AmCoa();\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n $transaction = \\Yii::$app->db->beginTransaction();\n\n try {\n\n if($model->save()){\n $transaction->commit();\n // Set success data\n \\Yii::$app->getSession()->setFlash('success', 'Successfully Inserted'); \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n\n }catch (\\Exception $e) {\n\n \\Yii::$app->getSession()->setFlash('error', $e->getMessage());\n $transaction->rollBack();\n }\n\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Cvpersonal();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n\t\tthrow new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\n\t\t/*\n $model = new SubOrder;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n }", "public function actionCreate()\n {\n $model = new OrderBasic();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n KursverwaltungAsset::register($this->view);\n $user = Yii::$app->user;\n $model = new KursVeranstaltungen();\n\n $modules = [new ModulVeranstaltungen()];\n if ($model->load(Yii::$app->request->post())) {\n $modules = Model::createMultiple(ModulVeranstaltungen::class);\n Model::loadMultiple($modules, Yii::$app->request->post());\n // ajax validation\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ArrayHelper::merge(\n ActiveForm::validateMultiple($modules),\n ActiveForm::validate($model)\n );\n }\n\n $model->von_kv = date('Y-m-d', strtotime($model->von_kv));\n $model->bis_kv = date('Y-m-d', strtotime($model->bis_kv));\n $model->sigid_kv = $user->id;\n $model->sigdate_kv = date('Y-m-d H:i:s');\n $model->deleted_kv = 0;\n // validate all models\n $valid = $model->validate();\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save()) {\n\n foreach ($modules as $modul) {\n $modul->von_mv = date('Y-m-d H:i:s', strtotime($modul->von_mv));\n $modul->bis_mv = date('Y-m-d H:i:s', strtotime($modul->bis_mv));\n $modul->idkv_mv = $model->id_kv;\n $modul->sigdate_mv = date('Y-m-d H:i:s');\n $modul->sigid_mv = $user->id;\n if (!($flag = $modul->save())) {\n $transaction->rollBack();\n break;\n }\n }\n \n // Save user to Kursveranstaltung\n $utk = new UserToKursveranstaltung();\n $utk->iduser_utkv = $user->id;\n $utk->idkv_utkv = $model->id_kv;\n if (!$utk->save()) {\n throw new Exception('user zu Kursveranstaltung nicht gespeichert!');\n }\n\n $sutd = new SendUpdatesToDc();\n $sutd->idkv_sudc = $model->id_kv;\n if (!$sutd->save()) {\n throw new Exception('Send updates to DC konnte nicht gespeichert werden');\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id_kv]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'modules' => (empty($modules)) ? [new ModulVeranstaltungen()] : $modules\n ]);\n }", "public function actionCreate()\n {\n $model = new CPartner;\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 actionCreate()\n {\n $model = new Vaccination();\n $model2 = new UploadFormVaccination();\n if ($model->load(Yii::$app->request->post()) && $model2->load(Yii::$app->request->post()) ) {\n\n // загрузка файла\n $model2 = new UploadFormVaccination();\n $model2->vaccin = UploadedFile::getInstance($model2, 'vaccin');\n // путь файла\n $filename = $model2->upload();\n\n // какая вакцина 1,2 или 3\n if ($model->vaccin == 1) $numVaccin = 'first_vaccination';\n elseif ($model->vaccin == 2) $numVaccin = 'second_vaccination';\n elseif ($model->vaccin == 3) $numVaccin = 'third_vaccination';\n\n // массив с людьми\n $peoples = explode(\",\", $model->person_id);\n\n foreach ($peoples as $people){\n // Добавление людей в базу\n $vaccin = new Vaccination();\n $vaccin->person_id = $people;\n $vaccin->$numVaccin = $model->date_cheak;\n $vaccin->url_docs = $filename;\n $vaccin->save(false);\n }\n\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'model2' => $model2,\n ]);\n }", "public function actionCreate() {\n $model = new GacDataTrxV();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'FiscalYear' => $model->FiscalYear, 'InstitutionalCode' => $model->InstitutionalCode]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Review();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate() {\n\t\t$model = new Order ();\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'create', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}", "public function actionCreate()\n {\n $model = new Params();\n\n if ($model->load(Yii::$app->request->post(),'') && $model->save()) {\n return $this->success();\n }\n\n return $this->fail($model->errors);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Zip();\n\t\t\n\t\tif($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['index']);\n\t\t}\n\t\t\n\t\treturn $this->render('_form', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function actionCreate()\n {\n $model = new Apartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Adsmanager();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SampleStockCard();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Contract();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \t$this->addImage($model);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\t$this->changeDBPuid();\n $model = new Tracking();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SystemRecord();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Dmvoucherlog();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->VOUCHER_CODE]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $Product = Product::create(['title'=>'']);\n if(!empty($Product))\n {\n return redirect(aurl('products/'.$Product->id.'/edit'));\n }\n }", "public function actionCreate()\n {\n $model = new Agent();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Account();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new ExpoStand();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n print_r($model->getErrors());\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new tarjetacanon();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'nroTarjeta' => $model->nroTarjeta, 'idcanon' => $model->idcanon]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCrear()\n {\n $model = new AuthItem();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['detalle', 'id' => $model->name]);\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Agendamento();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Entity();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create() {\n\n\n\n $order_model = $this->loadModel('order');\n $order_model->create($_POST);\n\n header('location: ' . URL . 'order/index');\n }", "public function actionCreate()\n {\n $model = new Advert();\n $model->load(Yii::$app->request->post());\n $model->date_create = date('Y-m-d H:i:s');\n $model->date_create_utc = date('Y-m-d H:i:s');\n $model->date_modified = date('Y-m-d H:i:s');\n $model->deleted = 0;\n $model->car_id = $model->car_id[0];\n $model->author_id = $model->author_id[0];\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n $cars = Cars::find()->where(['>', 'count_cars', 0])->all();\n $cars = $this->rebuildArrayForDropDown($cars);\n \n $users = User::find()->all();\n $users = $this->rebuildArrayForDropDown($users);\n \n return $this->render('create', [\n 'model' => $model,\n 'cars' => $cars,\n 'users' => $users,\n ]);\n }", "public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Order();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Orders();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Uploads();\n $model->setScenario('create');\n if ($model->load(Yii::$app->request->post()) && Yii::$app->SetValues->Attributes($model)) {\n $files = UploadedFile::getInstance($model, 'upload_file');\n $model->upload_file = $files->name;\n $model->save();\n $root_path = 'uploads/common_uploads/' . $model->id;\n if (!empty($files)) {\n Yii::$app->UploadFile->UploadSingle($files, $model, $root_path);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new PenangInvoice();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new BuildingShopPark();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new ArticuloMeli();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->sku]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new ArticleBrowseModel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Invoice();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n {\r\n $model = new Photos();\r\n\r\n $post = yii::$app->request->post();\r\n \r\n if ($model->load($post) && $model->save()) {\r\n \r\n return $this->redirect(['view', 'id' => $model->id]);\r\n \r\n }else {\r\n \r\n return $this->render('create', [\r\n 'model' => $model\r\n ]);\r\n }\r\n }", "public function create()\n {\n $brands = $this->brandRepository->all()->pluck('name', 'id')->toArray();\n $carModels = $this->modelRepository->all()->pluck('name', 'id')->toArray();\n\n BreadcrumbsRegister::Register($this->ModelName, $this->BreadCrumbName);\n return view('admin.car_versions.create')->with([\n 'brands' => $brands,\n 'carModels' => $carModels\n ]);\n }", "public function actionCreate()\n {\n $model = new Record();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Huxuan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Huxuan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function add()\n {\n $submit = $this->input->post('submit');\n\n if($submit)\n {\n $this->load->library('form_validation');\n $this->load->model('version');\n $this->load->model('spark');\n \n $insert = elements(array('spark_id', 'tag'), $_POST);\n\n if($this->form_validation->run('add-version'))\n {\n if(Version::insert($insert))\n {\n UserHelper::setNotice(\"Version added!\");\n }\n }\n else\n {\n UserHelper::setNotice(\"Try to enter a valid tag!\", FALSE);\n }\n\n $spark = Spark::getById($insert['spark_id']);\n redirect(base_url() . 'packages/' . $spark->name . '/show');\n }\n\n show_error(\"Whatcha doin' here?\");\n }", "public function actionCreate()\n {\n $model = new Brand();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Bin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['binstuff', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new COrders;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->o_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Rmodel();\n\n /**\n * Try - 使用异常的函数应该位于 \"try\" 代码块内。如果没有触发异常,\n * 则代码将照常继续执行。但是如果异常被触发,会抛出一个异常。\n */\n try {\n if ($model->load(Yii::$app->request->post()))\n {\n \n $model->created = date('Y-m-d H:i:s');\n $model->save();\n \n //获取插入主键并作为mid值当前条插入的记录\n $mid = $model->getPrimaryKey();\n $model->mid = $mid;\n $model->save();\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n } catch (Exception $e) {\n echo 'Message: ' .$e->getMessage();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Minerhistory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Absen;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Absen']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Absen'];\n $is_success=$model->save();\n $this->notice($is_success,'Absen','create');\n\t\t\tif($is_success){\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n }else{\n $this->render('create',array(\n 'model'=>$model\n ));\n }\n\t\t}else{\n if($_GET['ajax'])\n $this->renderModal('create',array(\n 'model'=>$model,\n ));\n else\n $this->render('create',array(\n 'model'=>$model,\n ));\n }\n\t}", "public function actionCreate()\n {\n $model = new Admin();\n\n $model->setScenario('create');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CreateElementSetHasVersionRequest $request)\n {\n $input = $request->all();\n $elementSetHasVersion = $this->service->save($input);\n Flash::success('ElementSetHasVersion salvo com sucesso.');\n return redirect(route('elementSetHasVersions.index'));\n }", "public function actionCreate() {\n\t\t$model = new PublicAccount ();\n\t\tif ($model->load ( Yii::$app->request->post ())) {\n\t\t\tif($this->request->post('isNormal') == 'normal'){//普通模式\n\t\t\t\t$model->normal();\n\t\t\t}else{//一键模式\n\t\t\t\t$model->onekey();\n\t\t\t}\n\t\t\t$model->save();\n\t\t\tif($model->id){\n\t\t\t\t$this->session->setFlash('success');\n\t\t\t\treturn $this->redirect ( [\n\t\t\t\t\t\t'view','id' => $model->id\n\t\t\t\t] );\n\t\t\t}else{\n\t\t\t\t$this->session->setFlash('fail',\\implode(',', $model->errors));\n\t\t\t\treturn $this->redirect('index');\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\treturn $this->render ( 'create', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}", "public function actionCreate() {\n $model = new Invoice();\n $model->loadDefaultValues();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('general', 'The creation was successful'));\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new AwsSeba();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Trabajador();\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 actionCreate()\n {\n $this->view->params['no_wrapp'] = true;\n \n $model = new Invoice();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n //$model = new DetalleMatricula();\n\t\t/*\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n\t\treturn $this->redirect(Yii::$app->request->referrer);\n }" ]
[ "0.66325676", "0.6556545", "0.6545332", "0.65191734", "0.6501146", "0.63808537", "0.6378779", "0.63644624", "0.6338942", "0.63211864", "0.6277233", "0.6270961", "0.6267358", "0.6248556", "0.6240587", "0.62143475", "0.6211697", "0.6201255", "0.6199726", "0.6194283", "0.6150878", "0.61400294", "0.61337626", "0.61298096", "0.6123422", "0.61112565", "0.6108983", "0.6096083", "0.6095744", "0.60915613", "0.6083481", "0.6071965", "0.60608953", "0.6049431", "0.6048407", "0.59995836", "0.5993276", "0.5990203", "0.5984916", "0.59736854", "0.5969818", "0.59685636", "0.5953021", "0.5947476", "0.5944755", "0.59446335", "0.59422684", "0.5935414", "0.59233105", "0.59207356", "0.59182835", "0.59141827", "0.5913585", "0.5913089", "0.5908297", "0.59044033", "0.59027785", "0.5902429", "0.5894165", "0.5892136", "0.5884233", "0.58833927", "0.587964", "0.5869211", "0.5868867", "0.5868471", "0.58650064", "0.58531934", "0.58510405", "0.58510405", "0.58510405", "0.58504516", "0.5847223", "0.58429444", "0.58417755", "0.5838919", "0.5831275", "0.5828488", "0.58265156", "0.5823548", "0.5822374", "0.58223677", "0.5820978", "0.5820978", "0.5820929", "0.5820744", "0.5820447", "0.5815773", "0.581385", "0.58128995", "0.5810685", "0.5810182", "0.5809413", "0.5807554", "0.58073556", "0.5807269", "0.58035743", "0.5803471", "0.58030635", "0.58011204" ]
0.8015885
0
previous vertices in the shortest path
предыдущие вершины в кратчайшем пути
public function testPreviousVertices() { $previousVertices = self::$shortestPath->previousVertices(self::$graph, 'a'); $this->assertEquals($previousVertices['h'], 'e'); $this->assertEquals($previousVertices['c'], 'a'); $this->assertEquals($previousVertices['l'], 'k'); $this->assertEquals($previousVertices['j'], 'h'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gonext(){\r\n\t\t$this->back-=1;\r\n\t\tif ($this->back<0) {//Retreated to the last point\r\n\t\t\t$this->back=0;\r\n\t\t}\r\n\t\treturn $this->history[$this->prevNum($this->first,$this->back)]['path'];\r\n\t}", "function getPredecessors();", "function previous() {\r\n \t\tif ($return=prev($this->model->triples)) {\r\n \t\t\t$this->position=key($this->model->triples);\r\n\t\t\treturn $return;\r\n\t\t} else {\r\n\t\t\t$this->position=key($this->model->triples);\r\n\t\t\treturn NULL;\r\n\t\t} \r\n }", "function getShortestPathDijkstra($from_node, $to_node, $transport){\n $path = array($from_node);\n // fill in the $path variable\n // also return the $distance variable\n $path[] = 31813803;\n $path[] = 31813811;\n $path[] = 31813815;\n $path[] = 31813827;\n //$path[] = $to_node;\n $distance = 3246.146;\n return array($distance, $path);\n}", "public function getPredecessors()\n\t\t{\n\t\t\treturn new Vertex_IteratorAggregate($this, $this->getIncidentEdges());\n\t\t}", "public function getPreviousLocations()\n {\n return $this->previousLocations;\n }", "function goback(){\r\n\t\t$this->back+=1;\r\n\t\t//Maximum number of setbacks as a starting point to the end point of difference (the difference between the clockwise)\r\n\t\t$mins=$this->minus($this->first,$this->last);\r\n\t\tif ($this->back >= $mins) {//Retreated to the last point\r\n\t\t\t$this->back=$mins;\r\n\t\t}\r\n\r\n\t\t$pos=$this->prevNum($this->first,$this->back);\r\n\t\treturn $this->history[$pos]['path'];\r\n\t}", "function Dijkstra($array, $start, $target) {\n //removing the useless items :D\n for($i=0; $i<$start; $i++){\n unset($array[$i]);\n }\n\n $cost = []; //cost array to match it and find out the shortest way\n $path = []; //path array just to insert the path (way)\n\n if(in_array($target, $array)){ //Check if its in the main array\n return array_search($target, $array);\n }else{\n for($i=0; $i<count($array); $i++){ //fetch all of the arraies\n $cost[$i] = $i;\n $path[$i] = \"$i\";\n\n if(in_array($target, $array[$i])){\n $cost[$i] += array_search($target, $array[$i]);\n $path[$i] .= \" > \".array_search($target, $array[$i]);\n }else{\n unset($cost[$i]);\n unset($path[$i]);\n }\n }\n\n $easiest_way = array_search(min($cost), $cost);\n\n return [$easiest_way, $path[$easiest_way]];\n }\n}", "public function previous();", "public function prevFacing();", "function getVertex($v);", "public function pathBeforeIterator()\n {\n $iteratorPos = $this->getIteratorPos($this->pointer);\n $pathBefore = array();\n $path = $this->getPath();\n for ($pos = $path->getStart(); $pos < $iteratorPos; $pos++) {\n $pathBefore[] = $path[$pos];\n }\n return implode($path->getSeparator(), $pathBefore);\n }", "function findReversePath($start_node, $goal_node, $last_node) {\n $path = array();\n $current_node = null;\n //var_dump($goal_node);\n // echo '<pre>', print_r($goal_node), '</pre>';\n if ($goal_node->parent_node != null) {\n $path[] = $goal_node;\n $current_node = $goal_node->parent_node;\n }\n while ($current_node->parent_node != null) {\n $path[] = $current_node;\n $current_node = $current_node->parent_node;\n }\n if (isSameNode($current_node, $start_node)) {\n $path[] = $current_node;\n }\n// echo '<br /> start of the path <br />';\n// echo '<pre>', print_r($path), '</pre>';\n// echo '<br /> end of the path <br />';\n return $path;\n}", "function bfs_path($start, $end) {\n $graph = array();\n $lines = Line::all();\n \n for($i = 0; $i < 300; $i++) {\n $graph[$i] = array();\n }\n\n foreach($lines as $line) {\n $first_node = (int)$line->first_node;\n $second_node = (int)$line->second_node;\n\n $graph[$first_node][] = $second_node;\n $graph[$second_node][] = $first_node;\n };\n\n $queue = new \\SplQueue();\n\n $queue->enqueue([$start]);\n $visited = [$start];\n \n while ($queue->count() > 0) {\n $path = $queue->dequeue();\n \n $node = $path[sizeof($path) - 1];\n \n if ($node === $end) {\n return $path;\n }\n \n foreach ($graph[$node] as $neighbour) {\n if (!in_array($neighbour, $visited)) {\n $visited[] = $neighbour;\n \n $new_path = $path;\n $new_path[] = $neighbour;\n \n $queue->enqueue($new_path);\n }\n };\n }\n \n return false;\n }", "public function prevNodes(): self\n {\n return $this\n ->where($this->model->leftAttribute()->name(), '<', $this->model->leftOffset())\n ->treeCondition();\n }", "function getVertices();", "public function prevRow(){\r\n$this->pointer = $this->pointer - 1;\r\n}", "public function prevRow(){\r\n$this->pointer = $this->pointer - 1;\r\n}", "public function path() {\n $path = array();\n $pair = $this;\n do {\n $path[] = $pair;\n $pair = $pair->parent;\n } while ($pair != null);\n\n return array_reverse($path);\n }", "public function prev()\n {\n do {\n $v = prev($this->array);\n } while ($v === null);\n }", "public function shortestPaths($source, $target, array $exclude = array())\n {\n $this->distance = array_fill_keys(array_keys($this->graph), INF);\n // ...except the start node\n $this->distance[$source] = 0;\n // The previously visited nodes\n $this->previous = array_fill_keys(array_keys($this->graph), array());\n // Process all nodes in order\n $this->queue = array($source => 0);\n while (!empty($this->queue)) {\n $this->processNextNodeInQueue($exclude);\n }\n if ($source === $target) {\n \n return array(array($source));\n } elseif (empty($this->previous[$target])) {\n \n return array();\n } else {\n \n return $this->extractPaths($target);\n }\n }", "public function mst()\n\t{\n\t\t// return cached result\n\t\tif ($this->mst) return $this->mst;\n\n\t\t// init\n\t\t$this->mst = array();\n\t\t$vertices = array();\n\n\t\t// first step: build vertices set\n\t\tforeach ($this->graph as $edge)\n\t\t{\n\t\t\t$vertices[] = reset($edge['vertices']);\n\t\t\t$vertices[] = end($edge['vertices']);\n\t\t}\n\n\t\t// make set\n\t\t$vertices = array_unique($vertices);\n\t\t$vertices_used = array();\n\n\t\t// compare function\n\t\t$cmp = function($a, $b) \n\t\t{\n\t\t\treturn $a['weight'] > $b['weight'];\n\t\t};\n\n\t\t// user defined sort\n\t\tusort($this->graph, $cmp);\n\n\t\t// second step: loop edges, as long as $vertices_u != $vertices\n\t\tif (count($this->graph))\n\t\t{\n\t\t\t$this->mst[] = $edge = reset($this->graph);\n\t\t\t$vertices_used = $edge['vertices'];\n\t\t}\n\n\t\tforeach ($this->graph as $edge)\n\t\t{\n\t\t\tif (in_array(reset($edge['vertices']), $vertices_used) != in_array(end($edge['vertices']), $vertices_used))\n\t\t\t{\n\t\t\t\t// add to mst\n\t\t\t\t$this->mst[] = $edge;\n\t\t\t\t$vertices_used = array_unique(array_merge($edge['vertices'], $vertices_used));\n\t\t\t}\n\t\t}\n\n\t\t// report back\n\t\treturn $this->mst;\n\t}", "function hasPrevious() {\r\n \t\tif (prev($this->model->triples)!=NULL) \r\n \t\t{\r\n \t\t\tnext($this->model->triples);\r\n\t\t\treturn TRUE;\r\n\t\t} else {\r\n\t\t\treset($this->model->triples);\r\n\t\t\treturn FALSE;\r\n\t\t};\r\n }", "public function previous() {\r\n if (($this->maxPoints > 0) && ($this->current > 1)) {\r\n $this->setCurrent($this->current - 1);\r\n }\r\n }", "public function get_initial_solution() {\r\n $depot_visited = 0;\r\n $current_node = $this->stops->search('is_depot', true);\r\n $distance = 0;\r\n $time = 0;\r\n while (!empty($this->stops->search('available', true))) {\r\n $this->best_route->sequence[] = $current_node->id;\r\n //update availability\r\n if ($current_node->is_depot) {\r\n $depot_visited += 1;\r\n if ($depot_visited === $this->truck_count) {\r\n $current_node->available = false;\r\n }\r\n } else {\r\n $this->best_route->add_stop($current_node);\r\n $current_node->available = false;\r\n }\r\n $next_node = null;\r\n //pick the next node to visit\r\n foreach ($current_node->closeness as $i => $d) {\r\n $node = $this->stops->search('id', $i);\r\n //if this node exists and is available, pick it as the next node to visit\r\n if (!empty($node) && $node->available) {\r\n $next_node = $node;\r\n break;\r\n }\r\n }\r\n //if there is no next node, we're done\r\n if (empty($next_node)) {\r\n //if we didn't end on a depot, return to the depot\r\n if (!$current_node->is_depot) {\r\n $next_node = $this->stops->search('is_depot', true);\r\n } else {\r\n break;\r\n }\r\n }\r\n //update values for this path\r\n $distance += $current_node->meters[$next_node->id];\r\n $time += $current_node->seconds[$next_node->id];\r\n\r\n //if this is a depot, update values for journey leg and reset counters\r\n if ($current_node->is_depot) {\r\n $this->best_route->visit_depot($distance, $time);\r\n $distance = 0;\r\n $time = 0;\r\n }\r\n $current_node = $next_node;\r\n }\r\n $this->best_route->check_valid($this->capacity, $this->time_limit);\r\n\r\n //initialize pheromones based on this solution\r\n $pheromones = $this->stops->initialize_pheromones(\r\n $this->beta,\r\n count($this->best_route->sequence)\r\n );\r\n $this->initial_pheromone = $pheromones;\r\n }", "public function vertices(){\n return $this->vertices;\n }", "public function previous()\n {\n $this->getIteratorObject()->previous();\n }", "public function getPrevious();", "public function getPrevious();", "public function visitedTwice()\n {\n $journey = [];\n $duplicates = [];\n\n foreach ($this->journey as $location) {\n $steps = $location[0] . ' . ' . $location[1];\n if (! in_array($steps, $journey)) {\n $journey[] = $steps;\n } else {\n $duplicates[] = $location;\n }\n }\n\n return $duplicates[0];\n }", "public function getPreviousValidFrom();", "protected function prepareStrongestPath ()\n\t{\n\t\t$this->_StrongestPaths = array() ;\n\n\t\tforeach ( $this->_Candidates as $candidate_key => $candidate_id )\n\t\t{\n\t\t\t$this->_StrongestPaths[$candidate_key] = array() ;\n\n\t\t\t// Format array for the strongest path\n\t\t\tforeach ( $this->_Candidates as $candidate_key_r => $candidate_id_r )\n\t\t\t{\n\t\t\t\tif ($candidate_key_r != $candidate_key)\n\t\t\t\t{\n\t\t\t\t\t$this->_StrongestPaths[$candidate_key][$candidate_key_r]\t= 0 ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "public static function prev($path){\n\t \t$files \t=\tMenu::list_files(dirname($path));\n\t \t$pos \t=\tarray_search($path,$files);\n\n\t \tif( isset($pos) && $pos > 0 ){\n\t \t\t/// Found $path\n \t\t\treturn $files[$pos-1];\n\t \t}\n\t \treturn $path;\n\t }", "private function searchPath(array $step, $to)\n {\n\n foreach($step as $node) {\n // If current node hasn't been visited, add it to current path\n if (!in_array($node,$this->visitedNodes)) {\n array_push($this->visitedNodes,$node);\n // If current path has been already followed remove two last points and take next node\n if (in_array($this->visitedNodes, $this->visitedPaths)) {\n $this->visitedNodes=array_slice($this->visitedNodes,0,-2);\n continue;\n }\n }\n // Check if current node is end point\n if($node !== $to) {\n\n $nextStep = $this->map[$node];\n // Make filter to find available nodes, such as it's forbidden to return to visited nodes\n $availableNextStep = array();\n foreach($nextStep as $nextNodes) {\n if (!in_array($nextNodes,$this->visitedNodes)) {\n $availableNextStep[]=$nextNodes;\n }\n }\n // If there are no available points add current path to visitedPaths, remove last node and take next node\n if (empty($availableNextStep)) {\n $this->visitedPaths[] = $this->visitedNodes;\n $this->visitedNodes=array_slice($this->visitedNodes,0,-1);\n continue;\n }\n // Call recursive function and with next available nodes\n $this->searchPath($availableNextStep, $to);\n // Remove last node such as we need te return to previous node\n $this->visitedNodes=array_slice($this->visitedNodes,0,-1);\n\n } else {\n // Add to visitedPath successful route\n $this->visitedPaths[] = $this->visitedNodes;\n // Remove last node\n $this->visitedNodes=array_slice($this->visitedNodes,0,-1);\n\n }\n }\n\n return true;\n }", "public function getChildPrev(){\n if($this->currentPosition > 0){\n return $this->getChildAt(--$this->currentPosition);\n }else{\n $this->currentPosition = $this->childCount;\n return $this->getChildAt(--$this->currentPosition);\n }\n}", "public function path(Block $target) {\r\n\t\t//echo \"Path \" . $this->x . \",\" . $this->y . \" to \" . $target->x . \",\" . $target->y . \"<br />\";\r\n\t\t\r\n $dx = $this->x - $target->x;\r\n $dy = $this->y - $target->y;\r\n\r\n // wrapping support\r\n if (abs($dx) > $this->map->width / 2) {\r\n $dx = $dx > 0 ? $dx - $this->map->width : $this->map->width + $dx;\r\n }\r\n if (abs($dy) > $this->map->height / 2) {\r\n $dy = $dy > 0 ? $dy - $this->map->height : $this->map->height + $dy;\r\n }\r\n\t\t\r\n\r\n\t\t//echo \"Difference X: \" . $dx . \" Y: \" . $dy . \"<br />\";\r\n\r\n\t\t$towards = [];\r\n\t\tif ($dx != 0)\r\n\t\t{\r\n\t\t\t$towards[] = $dx > 0 ? LEFT : RIGHT;\r\n\t\t}\r\n\t\tif ($dy != 0)\r\n\t\t{\r\n\t\t\t$towards[] = $dy > 0 ? UP : DOWN;\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->distance($target) == 0)\r\n\t\t{\r\n\t\t\treturn array(\"directions\"=>[0],\"blocks\"=>array(), \"cost\"=>0, \"prod\"=>0);\r\n\t\t}\r\n\t\tif ($this->distance($target) == 1)\r\n\t\t{\r\n\t\t\treturn array(\"directions\"=>[$towards[0]], \"blocks\"=>array($target), \"cost\" => $target->cost(), \"prod\"=>$target->prod);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$costs = [];\r\n\t\t\t$paths = [];\r\n\t\t\t$prods = [];\r\n\t\t\tforeach ($towards as $direction)\r\n\t\t\t{\r\n\t\t\t\t$path = $this->get($direction)->path($target);\r\n\t\t\t\t$costs[$direction] = $this->get($direction)->cost() + $path['cost'];\r\n\t\t\t\t$prods[$direction] = $path['prod'] + $this->get($direction)->prod;\r\n\t\t\t\t$paths[$direction] = $path;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$min = min($costs);\r\n\t\t\t$directions = array_keys($costs, $min);\r\n\t\t\t\r\n\t\t\t$highestProd = -1;\r\n\t\t\t$highestDirection = -1;\r\n\t\t\t\r\n\t\t\tforeach ($directions as $direction)\r\n\t\t\t{\r\n\t\t\t\tif ($highestProd == -1 || $prods[$direction] > $highestProd)\r\n\t\t\t\t{\r\n\t\t\t\t\t$highestDirection = $direction;\r\n\t\t\t\t\t$highestProd = $prods[$direction];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$direction = $highestDirection;\r\n\t\t\t\r\n\t\t\tarray_unshift($paths[$direction]['directions'],$direction);\r\n\t\t\tarray_unshift($paths[$direction]['blocks'],$this->get($direction));\r\n\t\t\treturn array(\r\n\t\t\t\t\"directions\"=>$paths[$direction]['directions'],\r\n\t\t\t\t\"blocks\"=>$paths[$direction]['blocks'], \r\n\t\t\t\t\"cost\" => $min,\r\n\t\t\t\t\"prod\"=>$prods[$direction]\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n }", "final public function prev()\n {\n prev($this->_collection);\n $this->_index = key($this->_collection);\n }", "function getPathway()\n\t{\n\t\t$pw = $this->_pathway;\n\n\t\t// Use array_values to reset the array keys numerically\n\t\treturn array_values($pw);\n\t}", "public function getPrevious()\n {\n return end($this->steps);\n }", "public function createGraph()\n {\n $graphResult = $this->startVertex->getGraph()->createGraphClone();\n\n // initialize null flow and check edges\n foreach ($graphResult->getEdges() as $edge) {\n if (!($edge instanceof EdgeDirected)) {\n throw new UnexpectedValueException('Undirected edges not supported for edmonds karp');\n }\n $edge->setFlow(0);\n }\n\n $idA = $this->startVertex->getId();\n $idB = $this->destinationVertex->getId();\n\n do {\n // Generate new residual graph and repeat\n $residualAlgorithm = new ResidualGraph($graphResult);\n $graphResidual = $residualAlgorithm->createGraph();\n\n // 1. Search _shortest_ (number of hops and cheapest) path from s -> t\n $alg = new BreadthFirst($graphResidual->getVertex($idA));\n try {\n $pathFlow = $alg->getWalkTo($graphResidual->getVertex($idB));\n } catch (OutOfBoundsException $e) {\n $pathFlow = NULL;\n }\n\n // If path exists add the new flow to graph\n if ($pathFlow) {\n // 2. get max flow from path\n $maxFlowValue = $pathFlow->getEdges()->getEdgeOrder(Edges::ORDER_CAPACITY)->getCapacity();\n\n // 3. add flow to path\n foreach ($pathFlow->getEdges() as $edge) {\n // try to look for forward edge to increase flow\n try {\n $originalEdge = $graphResult->getEdgeClone($edge);\n $originalEdge->setFlow($originalEdge->getFlow() + $maxFlowValue);\n // forward edge not found, look for back edge to decrease flow\n } catch (UnderflowException $e) {\n $originalEdge = $graphResult->getEdgeCloneInverted($edge);\n $originalEdge->setFlow($originalEdge->getFlow() - $maxFlowValue);\n }\n }\n }\n\n // repeat while we still finds paths with residual capacity to add flow to\n } while ($pathFlow);\n\n return $graphResult;\n }", "public function getVertices()\n {\n return $this->vertices;\n }", "public function fetchComprisedPositions(){\r\n return $this->getPaths();\r\n }", "public function previous_step() {\n\t\t$this->step--;\n\t}", "function prev($array)\n{\n\treturn 0;\n}", "function prev($array)\n{\n return 0;\n}", "function generateTransitPoint() {\n RouteTransitPoint::query()->delete(); \n\n $indirectInterchanges = RouteIndirectInterchange::all();\n\n foreach ($indirectInterchanges as $indirectInterchange) {\n $lineFromNodes = Node::where('line_id', $indirectInterchange->line_id_from)\n ->where('sequence', '>=', $indirectInterchange->sequence_from_start)\n ->where('sequence', '<=', $indirectInterchange->sequence_from_end)\n ->get();\n $lineToNodes = Node::where('line_id', $indirectInterchange->line_id_to)\n ->where('sequence', '>=', $indirectInterchange->sequence_to_start)\n ->where('sequence', '<=', $indirectInterchange->sequence_to_end)\n ->get();\n\n $this->updateTransitRoutePaths($lineFromNodes, $lineToNodes, $indirectInterchange);\n }\n\n // loop through all route indirect interchanges records\n // based on total transit get the first and last interchange\n }", "public function previous () {\n return $this->experiment->find_prev_shift_for($this) ;\n }", "abstract protected function _getLeftUpPoint();", "public function next()\n\t\t{\n\t\t\t$matrix = $this->graph->getMatrix();\n\t\t\tfor(++$this->w; $this->w < $this->graph->getNumberOfVertices(); ++$this->w) {\n\t\t\t\tif ($matrix->offsetGet(array($this->v, $this->w)) !== NULL) \n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(++$this->v; $this->v < $this->graph->getNumberOfVertices(); ++$this->v) {\n\t\t\t\tfor($this->w = $this->v + 1; $this->w < $this->graph->getNumberOfVertices(); ++$this->w) {\n\t\t\t\t\tif ($matrix->offsetGet(array($this->v, $this->w)) !== NULL) \n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function incomingEdgesOf(VertexInterface $vertex): EdgeSet;", "public function next()\n\t\t{\n\t\t\t$matrix = $this->graph->getMatrix();\n\t\t\tfor(++$this->w; $this->w < $this->graph->getNumberOfVertices(); ++$this->w) {\n\t\t\t\tif ($matrix->offsetGet(array($this->v, $this->w)) !== NULL) \n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(++$this->v; $this->v < $this->graph->getNumberOfVertices(); ++$this->v) {\n\t\t\t\tfor($this->w = 0; $this->w < $this->graph->getNumberOfVertices(); ++$this->w) {\n\t\t\t\t\tif ($matrix->offsetGet(array($this->v, $this->w)) !== NULL) \n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function moveToPreviousLine() {\r\n\t\t$this->currentLine = $this->lines [-- $this->currentLineNb];\r\n\t}", "public function outDegreeOf(VertexInterface $vertex): int;", "public function getPreviousIteratorRow () {}", "function getFirst(){\r\n\t\treturn $this->history[$this->first]['path'];\r\n\t}", "private function getPrev() {\n if ($this->prev === null) {\n $this->prev = false;\n $other = $this->db->getOne('SELECT cp, name, gc FROM codepoints\n WHERE cp < ?\n ORDER BY cp DESC\n LIMIT 1', $this->id);\n if ($other) {\n $this->prev = self::getCached($other, $this->db);\n }\n }\n return $this->prev;\n }", "public function previous()\n\t{\n\t\t$this->get($this->index - 1);\n\t}", "function topologicalOrderTraversal(IVisitor $visitor);", "public function prevSibling()\n {\n return $this->adjacentSibling(-1);\n }", "public function MovePrev() {\r\n $this->actualRow = null;\r\n $this->actualRowNumber = -1;\r\n if ($this->iterador > 0)\r\n $this->iterador--;\r\n }", "public function prev(){\n $key=$this->key();\n if(isset($key)){\n $this->seek($key-1);\n }\n }", "public function getUrlPrev($params = []);", "private function checkIfWasVisited(){\n if(in_array($this->currentPoint, $this->antTabuPoints)){\n $visited = $this->antsVisitedPoints[$this->antNumber][$this->iter];\n\n $lengthToDelet = array_search($this->currentPoint, array_reverse($this->antTabuPoints));\n\n for ($n=0; $n < $lengthToDelet-2; $n++) {\n array_pop($this->antsVisitedPoints[$this->antNumber][$this->iter]);\n array_pop($this->antTabuPoints);\n }\n $this->currentPoint = array_pop($this->antsVisitedPoints[$this->antNumber][$this->iter]);\n array_pop($this->antTabuPoints);\n\n $this->loopsCount++;\n }\n }", "public function startOfJourney(): string\n {\n // canBeStartOfJourney has one element only - Following statement is O(1)\n $tripStartsAt = array_keys($this->canBeStartOfJourney);\n\n return reset($tripStartsAt);\n }", "function getCurrentPosition() {\r\n \t \t\treturn key($this->model->triples);\r\n }", "public function getPrevSiblingsQuery() {\n if (($field = $this->_tree->getAttribute('sortBy')) === null) {\n $this->unsupportedMethod();\n }\n $rel = $this->_tree->getAttribute('sortOrder') == 'ASC' ? '<' : '>';\n return $this->getSiblingsQuery()\n ->andWhere(\"$field $rel ?\", array($this->record->get($field)));\n }", "public function prev() {\n\n\t\t$this->tokens->prev();\n\t}", "public function prev(): void\n {\n do {\n --$this->currentColumnIndex;\n } while (($this->onlyExistingCells) && (!$this->cellCollection->has(Coordinate::stringFromColumnIndex($this->currentColumnIndex) . $this->rowIndex)) && ($this->currentColumnIndex >= $this->startColumnIndex));\n }", "public function getVertexSet(): VertexSet;", "public function getDijkstraRoute($from, $to = null)\n {\n if (!array_key_exists($from, $this->graph) || (isset($to) && !array_key_exists($to, $this->graph))) {\n throw new \\Exception('Unknown point \"from\":' . $from . ' or \"to\":' . $to);\n }\n $paths = array();\n foreach ($this->graph as $node => $weight) {\n $paths[$node]['weight'] = INF;\n $paths[$node]['path'] = [];\n }\n $paths[$from]['weight'] = 0;\n $this->calculatePotentials($paths, $from);\n $paths = array_replace($this->graph, $paths);\n if (isset($to)) {\n return [$to => $paths[$to]];\n }\n return $paths;\n }", "public function isVertexSource(Vertex $vertex)\n {\n foreach ($vertex->getEdges() as $edge) {\n if ($edge->hasVertexTarget($vertex)) {\n return false;\n }\n }\n\n // reach this point: no edge to this vertex\n return true;\n }", "public function getPrev()\n\t{\n\t\treturn $this->getRel('prev');\n\t}", "public function getInitialPathway()\n {\n $ids = $this->owner->getRequest()->getVar('decisionpathway');\n\n if ($ids && is_string($ids)) {\n return explode(',', $ids);\n }\n\n return null;\n }", "public function prevSiblings(): self\n {\n return $this\n ->prevNodes()\n ->where($this->model->parentAttribute()->name(), '=', $this->model->parentValue());\n }", "public function prev()\n {\n nstable_seekPrev($this->cPtr, $this->lockBias);\n ++$this->pos;\n }", "public function run()\n {\n\n $start = $this->start;\n $goal = $this->goal;\n\n $open = new Set([$start], function (NodeInterface $node) use ($goal) {\n return $this->getHeuristic($goal, $node);\n });\n $closed = new Set();\n\n $open->add($start);\n\n $path = new \\SplStack();\n\n while (!$open->isEmpty()) {\n $current = $open->current();\n $path->push($current->getNode());\n\n if ($current->getNode() == $goal) {\n break;\n }\n\n $closed->add($current->getNode());\n\n $neighbours = $current->getNode()->getNeighbours();\n foreach ($neighbours as $neighbour) {\n if ($closed->has($neighbour)) {\n continue;\n }\n if (!$open->has($neighbour)) {\n $open->add(\n $neighbour,\n $this->getHeuristic($current->getNode(), $neighbour) + $neighbour->getCost()\n );\n }\n\n }\n\n }\n\n return $path;\n\n }", "public function getPreviousUrl()\n {\n $currentUrl = $this->getCurrentUrl();\n\n $steps = (array) $this->data['steps'];\n foreach (array_reverse($steps) as $step) {\n if ($step['url'] !== $currentUrl) {\n return $step['url'];\n }\n }\n\n return null;\n }", "public function virtualTourFromBeginning()\n {\n Tour::setFromBeginning();\n return back();\n }", "public function findPath(Node $start, Node $end)\n {\n // no path if there is no need for moving\n if ($start->equals($end)) {\n $this->getLogger()->debug(\"$start equals $end, route is empty\");\n return [];\n }\n\n $this->addToOpen($start);\n\n $foundTarget = false;\n\n while (!$foundTarget && count($this->open) > 0) {\n $this->getLogger()->debug(\"sorting open nodes by cost. Node count:\" . count($this->open));\n uasort(\n $this->open,\n function (Node $a, Node $b) use ($end) {\n return $a->getFCost($end) - $b->getFCost($end);\n }\n );\n\n /** @var Node $current */\n $current = $this->open[array_keys($this->open)[0]];\n unset($this->open[array_keys($this->open)[0]]); \n\n $this->getLogger()->debug(\"current node selected: \" . $current);\n\n if ((string)$current == (string)$end) {\n $foundTarget = $current;\n // we don't need to look at its adjacents anymore,\n // as we do have our route\n $this->getLogger()->debug(\"current node is target node, exciting loop\");\n continue;\n }\n\n $adjacent = $current->getAdjacentNodes();\n\n foreach ($adjacent as $node) {\n if (in_array((string)$node, $this->closed)) {\n $this->getLogger()->debug(\"skipping adjacent: $node as it was already processed\");\n continue;\n }\n $node->setParent($current);\n $this->addToOpen($node);\n }\n $this->addToClosed($current);\n\n }\n\n // we failed to find a route\n if (!$foundTarget && count($this->open) == 0) {\n $this->getLogger()->debug(\"no open nodes left, and no target found.\");\n return [];\n }\n\n $this->getLogger()->debug(\"found route!\");\n /** @var Node $foundTarget */\n return $this->createRouteList($foundTarget);\n\n }", "private function get_previous_state()\n\t{\n\t\t//Get previous remembered coordinates & convert it to an associative array\n\t\t$pref_value = $this->get_preference_value(\"previous_state\");\n\t\t$param_array = null;\n\t\tif ($pref_value != null)\n\t\t\t$param_array = json_decode(func_json_clean_param_string($pref_value), true);\n\t\treturn $param_array;\n\t}", "public function getPrevSibling() {\n if (($field = $this->_tree->getAttribute('sortBy')) === null) {\n $this->unsupportedMethod();\n }\n return $this->getPrevSiblingsQuery()->fetchOne();\n }", "function breadthFirstTraversal(IVisitor $visitor, $start);", "function back() {\n if ($path = $GLOBALS['_previous']) {\n return get($path);\n } else {\n print \" Couldn't find previous path\";\n }\n }", "public function getPrev()\n {\n return $this->_prev;\n }", "private function __floydwarshall ():void {\n for ($i = 0; $i < $this->__nodes; $i++) {\n for ($j = 0; $j < $this->__nodes; $j++) {\n if ($i == $j) {\n $this->__distances[$i][$j] = 0;\n } else if ($this->__weights[$i][$j] > 0) {\n $this->__distances[$i][$j] = $this->__weights[$i][$j];\n } else {\n $this->__distances[$i][$j] = INFINITE;\n }\n $this->__predecessor[$i][$j] = $i;\n }\n }\n\n for ($k = 0; $k < $this->__nodes; $k++) {\n for ($i = 0; $i < $this->__nodes; $i++) {\n for ($j = 0; $j < $this->__nodes; $j++) {\n if ($this->__distances[$i][$j] > ($this->__distances[$i][$k] + $this->__distances[$k][$j])) {\n $this->__distances[$i][$j] = $this->__distances[$i][$k] + $this->__distances[$k][$j];\n $this->__predecessor[$i][$j] = $this->__predecessor[$k][$j];\n }\n }\n }\n }\n }", "public function getDiagonalPaths()\n {\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey ++, $rKey ++) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey --, $rKey ++) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey --, $rKey --) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n unset($possiblePath);\n for ($fKey = array_search($this->getFile(), $this->files), $rKey = array_search($this->getRank(), $this->ranks); array_key_exists($fKey, $this->files) && array_key_exists($rKey, $this->ranks); $fKey ++, $rKey --) {\n $possiblePath[] = array((string) $this->files[$fKey], (string) $this->ranks[$rKey]);\n }\n $possiblePaths[] = $possiblePath;\n return $possiblePaths;\n }", "public function getPrevUrl()\n\t{\n\t\treturn $this->getPageUrl($this->currentPage-1);\n\t}", "public function outgoingEdgesOf(VertexInterface $vertex): EdgeSet;", "public function getPreviousSibling();", "public function getAvailableForStep($pos)\n\t{\n\t\t$x = key($pos);\n\t\t$y = $pos[$x];\n\t\t// All possible next step position.\n\t\t$positions = [\n\t\t\t[$x - 1 => $y],\n\t\t\t[$x + 1 => $y],\n\t\t\t[$x => $y - 1],\n\t\t\t[$x => $y + 1],\n\t\t];\n\t\t$result = [];\n\t\t// Check available moves.\n\t\tforeach ($this->available as $row) {\n\t\t\tforeach ($row as $x => $y) {\n\t\t\t\tforeach ($positions as $pos) {\n\t\t\t\t\tif (isset($pos[$x]) and $pos[$x] == $y) {\n\t\t\t\t\t\t$result[] = [$x => $y];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If can go only back.\n\t\tif ((count($result) < 2 and isset($this->prevPosition))\n\t\t\tand isset($result[0])\n\t\t\tand $result[0] === $this->prevPosition\n\t\t) {\n\t\t\t// If dead end, remove and and fire up that need be removed.\n\t\t\tif ($this->removeFromAvailable($this->stepPosition)) {\n\t\t\t\t// Set flag that this part of path need be removed.\n\t\t\t\t$this->needRemove = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Filter out previous step from available steps.\n\t\t\tforeach ($result as $key => $items) {\n\t\t\t\tforeach ($items as $x => $y) {\n\t\t\t\t\tif (isset($this->prevPosition[$x]) and $this->prevPosition[$x] === $y) {\n\t\t\t\t\t\tunset($result[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Remove dead end part of path.\n\t\tif (count($result) > 1 and $this->needRemove) {\n\t\t\t$this->removeFromAvailable($this->prevPosition);\n\t\t\t$this->needRemove = false;\n\t\t}\n\n\t\treturn $result;\n\t}", "function isVertex()\n\t{\n\t\treturn $this->vertex;\n\t}", "private function calculateAnotherPotentials(&$path, &$list, $currentNodeId)\n {\n foreach ($this->graph[$currentNodeId] as $id => $weight) {\n if(!empty($list[$id]) && $list[$currentNodeId] + $weight < $list[$id]) {\n $list[$id] = $path[$id]['weight'] = $list[$currentNodeId] + $weight;\n $path[$id]['path'] = array_merge($path[$currentNodeId]['path'],[$currentNodeId]);\n }\n }\n }", "public function prev(): bool;", "public function getPrev()\n {\n return $this->prev;\n }", "public function getPrev()\n {\n return $this->prev;\n }", "function getEmanatingEdges();", "public function previous()\n {\n $this->pointer--;\n }", "public function calc_PSPforward(){\r\n\t\tforeach($this->PSPBasisElements as $Datensatz){\r\n\t\t\tif(!$this->check_forPrevious($Datensatz)){\r\n\t\t\t\t$MyStartID = $Datensatz->idtm_activity;\r\n\t\t\t\t$this->calc_StartEndDate($Datensatz,1);\r\n $this->walkChildren($Datensatz);\r\n\t\t\t}\r\n\t\t}\r\n }", "function prev($method)\n {\n return $this->Uri->prev($this, $method);\n }", "function previousUrl ();" ]
[ "0.6092318", "0.5884771", "0.5874125", "0.57625544", "0.56418777", "0.56265104", "0.5620941", "0.55696076", "0.54972255", "0.5494119", "0.5438149", "0.53684926", "0.5329762", "0.532603", "0.5300924", "0.52438086", "0.5170784", "0.5170784", "0.51692677", "0.51599175", "0.5143681", "0.5128518", "0.5113079", "0.5107639", "0.5094797", "0.5079169", "0.5066119", "0.50414675", "0.50414675", "0.5038875", "0.5000479", "0.49989945", "0.49979728", "0.4997884", "0.49859193", "0.49431747", "0.49365875", "0.49123612", "0.4903589", "0.48945224", "0.48863298", "0.4883184", "0.48777616", "0.48674467", "0.48594427", "0.4849032", "0.48458073", "0.48252878", "0.48023432", "0.48015934", "0.47761464", "0.47749072", "0.47502744", "0.47481757", "0.4746906", "0.4743392", "0.4729051", "0.47251913", "0.47106072", "0.47047055", "0.47028807", "0.46975914", "0.4688632", "0.46827105", "0.46761924", "0.46572295", "0.46543556", "0.46543193", "0.46477064", "0.4645297", "0.46446818", "0.4643253", "0.46415102", "0.46401316", "0.46398854", "0.46349236", "0.4623902", "0.4623795", "0.46221742", "0.46194834", "0.46189985", "0.4616907", "0.4615617", "0.46104348", "0.46073663", "0.4600463", "0.45986208", "0.45971456", "0.4595406", "0.4594549", "0.45937708", "0.4589217", "0.4586933", "0.45856792", "0.45856792", "0.458117", "0.45746997", "0.45746177", "0.45610473", "0.45601508" ]
0.73798895
0
Create a Service Manager Prototype object
Создать прототип объекта Service Manager
protected function initializePrototype() { $config = require 'config/application.config.php'; $serviceManager = new ServiceManager( new ServiceManagerConfig( isset($config['service_manager']) ? $config['service_manager'] : array())); $serviceManager->setService('ApplicationConfig', $config); $serviceManager->get('ModuleManager')->loadModules(); self::$serviceManagerPrototype = $serviceManager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function makeService();", "public function createObject () {\n\t\t// check base class (non-country specific)\n\t\t$baseDir = $this->config->get('app.path') . '/services/modules/' . $this->module;\n\t\t$baseFile = $baseDir . '/' . ucfirst($this->module) . 'Service.php';\n\t\t$class = ucfirst($this->module) . 'Service';\n\t\tif (!file_exists($baseFile)) {\n\t\t\tthrow new \\Exception('Module '.$baseFile.' does not exist!');\n\t\t}\n\t\trequire_once $baseFile;\n\t\t\n\t\t// load class\n\t\t$this->object = new $class($this->config);\n\t}", "public static function getServiceManager();", "public static function init($config=null){\r\n\t\t$sm = ServiceManager::getInstance();\r\n\t\t$sm->setService(__CLASS__);\r\n\t\t$cf=$sm->setService('Bscheshir\\Service\\Config');\r\n\t\t\r\n\t\tif(is_string($config))\r\n\t\t\t$config=require($config);\r\n\t\t\r\n\t\tif(is_array($config))\r\n\t\t\tforeach($config as $key=>$value)\r\n\t\t\t\t$cf->$key=$value;\r\n\t\t\r\n\t\treturn $sm(__CLASS__);\r\n }", "function Service_create() {\n\n global $Service_path, $Service_directory;\n\n // Set default timezone (required by date functions)\n date_default_timezone_set('UTC');\n\n // Convert all errors into exceptions (including E_NOTICE and E_STRICT)\n // Errors suppressed with @ are not handled (even if they're fatal!)\n set_error_handler(function ($errno, $errstr, $errfile, $errline) {\n if (error_reporting() !== 0) { // not suppressed by @ operator\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n }\n });\n\n // Get service path\n $Service_path = @$_GET['servicePath'];\n if (!$Service_path) { // no service specified\n exit('<center><pre style=\"margin-top:3em; font-size:22px\">... FJS Web Server ...</pre></center>');\n }\n\n // Get service directory\n $Service_directory = strstr($Service_path, '/', TRUE) ?: NULL;\n }", "public function create(ServiceLocatorInterface $sm, ChangeSet $changeSet);", "function createService()\n {\n return $this;\n }", "function bootstrap(CommonPHP\\ServiceManagement\\ServiceManager $serviceManager): void\n {\n // The $serviceManager parameter name is explicit, it must be exactly this type and exactly this name.\n $this->serviceManager = $serviceManager;\n }", "function __construct(){\n $this->_objError = ServiceErrors::getInstance();\n $this->serviceConfig = new ServiceConfig();\n }", "function __construct(){\n $this->_objError = ServiceErrors::getInstance();\n $this->serviceConfig = new ServiceConfig();\n }", "abstract protected function _initServices();", "public function __construct()\n\t{\n\t\t$this->services = new SalonServices();\n\n\t}", "abstract protected function createEntityPrototype(ServiceLocatorInterface $serviceLocator);", "public function __construct()\n {\n $this->service = new ServiceContacts();\n }", "public function testCreateService()\n {\n $serviceLocator = new ServiceManager();\n $serviceLocator->setService('config', $this->getConfiguration());\n $sdkFactory = new SdkFactory();\n $instance = $sdkFactory->createService($serviceLocator);\n static::assertInstanceOf(\n Sdk::class,\n $instance,\n 'The instance of ' . Sdk::class . ' returned was not created correctly.'\n );\n }", "abstract protected function getServiceInstance();", "static public function PEOPLE() { return new Service_OpenSocial_Service(self::PEOPLE); }", "public function createManager()\n {\n $manager = factory(Manager::class)->create();\n return $manager;\n }", "static public function create()\n {\n $t = new static();\n\n $t->registerService(new Service\\Youtube());\n $t->registerService(new Service\\Dailymotion());\n $t->registerService(new Service\\Vimeo());\n $t->registerService(new Service\\Spotify());\n $t->registerService(new Service\\SoundCloud());\n\n return $t;\n }", "protected static function initServices() {\n\t\tparent::initServices();\n\n\t\tServiceRegister::registerService(\n\t\t\tSerializer::CLASS_NAME,\n\t\t\tfunction () {\n\t\t\t\treturn new NativeSerializer();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tConfiguration::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Config_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopLoggerAdapter::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Logger_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopShippingMethodService::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Shop_Shipping_Method_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tShopOrderService::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn Shop_Order_Service::getInstance();\n\t\t\t}\n\t\t);\n\n\t\tServiceRegister::registerService(\n\t\t\tHttpClient::CLASS_NAME,\n\t\t\tstatic function () {\n\t\t\t\treturn new CurlHttpClient();\n\t\t\t}\n\t\t);\n\t}", "abstract public function setService();", "static public function create()\n {\n //XXX add multi parameters to pass already \n // fetched mosaic definitions\n\n\n //XXX check and test whether we want to include *all* preconfigured\n // classes or do that on a dynamic level\n return new static([\n Registry::getDefinition(\"nem:xem\")\n ]);\n }", "function createPrototype();", "public function __createService($class) {\n\t\t\t$return = new stdClass;\n\t\t\t$return->class = $class;\n\t\t\t$return->key = $this->_settings['key'];\n\t\t\t$return->secret = $this->_settings['secret'];\n\t\t\treturn $return;\n\t\t}", "public function testCreateServiceReturnsService()\n {\n $cut = new $this->cc;\n $instance = $cut->createService($this->serviceManager);\n\n $this->assertInstanceOf('\\SakeTest\\EasyConfig\\Service\\TestAsset\\MyPluginManager', $instance);\n }", "abstract public function getService();", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "public static function create();", "public function createNewService($name, array $definition);", "public function __construct($serviceManager = null)\n {\n $this->serviceManager = $serviceManager;\n }", "public function createService(ServiceLocatorInterface $serviceLocator);", "protected static function initServices()\n {\n ServiceRegister::registerService(\n TimeProvider::CLASS_NAME,\n function () {\n return TimeProvider::getInstance();\n }\n );\n ServiceRegister::registerService(\n GuidProvider::CLASS_NAME,\n function () {\n return GuidProvider::getInstance();\n }\n );\n ServiceRegister::registerService(\n EventBus::CLASS_NAME,\n function () {\n return EventBus::getInstance();\n }\n );\n ServiceRegister::registerService(\n AsyncProcessService::CLASS_NAME,\n function () {\n return AsyncProcessStarterService::getInstance();\n }\n );\n ServiceRegister::registerService(\n QueueService::CLASS_NAME,\n function () {\n return new QueueService();\n }\n );\n ServiceRegister::registerService(\n TaskRunnerWakeup::CLASS_NAME,\n function () {\n return new TaskRunnerWakeupService();\n }\n );\n ServiceRegister::registerService(\n TaskRunner::CLASS_NAME,\n function () {\n return new TaskRunner();\n }\n );\n ServiceRegister::registerService(\n TaskRunnerStatusStorage::CLASS_NAME,\n function () {\n return new RunnerStatusStorage();\n }\n );\n }", "private function createService(): void\n {\n $client = new Google_Client();\n\n $client->setApplicationName(\"Craft 3 CMS\");\n\n $client->setDeveloperKey($this->settings->apiKey);\n\n $this->service = new Google_Service_YouTube($client);\n }", "function systemSettingsDaoCreate() {\n return BaseService::getService(\"SettingsDao\");\n}", "public static function testService()\n {\n return new static();\n }", "public static function create() {}", "protected static function initServices()\n {\n parent::initServices();\n\n ServiceRegister::registerService(\n Serializer::CLASS_NAME,\n function () {\n return new NativeSerializer();\n }\n );\n\n ServiceRegister::registerService(\n ShopLoggerAdapter::CLASS_NAME,\n function () {\n return LoggerService::getInstance();\n }\n );\n\n ServiceRegister::registerService(\n Configuration::CLASS_NAME,\n function () {\n return ConfigurationService::getInstance();\n }\n );\n\n ServiceRegister::registerService(\n BrandConfigurationService::CLASS_NAME,\n function () {\n return new PacklinkConfigurationService();\n }\n );\n\n ServiceRegister::registerService(\n ShopShippingMethodService::CLASS_NAME,\n function () {\n return new CarrierService();\n }\n );\n\n ServiceRegister::registerService(\n HttpClient::CLASS_NAME,\n function () {\n return new CurlHttpClient();\n }\n );\n\n ServiceRegister::registerService(\n ShopOrderServiceInterface::CLASS_NAME,\n function () {\n return new ShopOrderService();\n }\n );\n\n ServiceRegister::registerService(\n RegistrationInfoServiceInterface::CLASS_NAME,\n function () {\n return new RegistrationInfoService();\n }\n );\n\n ServiceRegister::registerService(\n SystemInfoInterface::CLASS_NAME,\n function () {\n return new SystemInfoService();\n }\n );\n\n ServiceRegister::registerService(\n FileResolverService::CLASS_NAME,\n function () {\n return new FileResolverService(array(\n dirname(__FILE__) . '/../views/brand/countries',\n dirname(__FILE__) . '/../views/countries',\n ));\n }\n );\n }", "public static function factory($service_name)\r\n {\r\n $service_data = self::getConfig()[$service_name];\r\n if(!empty($service_data))\r\n {\r\n $regexp = '~.*class.*~';\r\n foreach($service_data as $namespace => $path)\r\n {\r\n if(preg_match($regexp, $namespace))\r\n {\r\n $object = new $path;\r\n if($service_name == 'security')\r\n {\r\n return $object;\r\n }\r\n Service::set($service_name, $object);\r\n return $object;\r\n }\r\n }\r\n throw new InvalidTypeException(\"There are no objects in service $service_name!\");\r\n }\r\n else\r\n {\r\n throw new InvalidArgumentException(\"Service $service_name not found!\");\r\n }\r\n }", "protected function createService()\n {\n $service = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call('gemboot:make-service', array_filter([\n 'name' => \"{$service}Service\",\n 'model' => $modelName,\n '--resource' => $this->option('resource'),\n ]));\n }", "private function createSdkManager(string $baseUri, ?array $headers = null): SdkManagerInterface\n {\n $options = \\is_array($headers) === true ?\n ['base_uri' => $baseUri, 'headers' => $headers] :\n ['base_uri' => $baseUri];\n\n return new SdkManager(\n new RequestHandler(\n new GuzzleClient($options),\n new ResponseHandler(),\n new SerializerFactory(),\n new UrnFactory()\n )\n );\n }", "public function createInstance()\n {\n if (!self::$_instance instanceof \\Yana\\Views\\Managers\\IsManager) {\n $smarty = new \\Smarty();\n self::$_instance = new \\Yana\\Views\\Managers\\Manager($smarty, $this->_getDependencyContainer());\n $config = $this->_getDependencyContainer()->getTemplateConfiguration();\n $this->_configureGeneralSettings($smarty, $config);\n $this->_configurePlugins($smarty, $config);\n if ($config->security) {\n $smarty->enableSecurity();\n $this->_configureSecuritySettings($smarty->security_policy, $config->security);\n }\n }\n\n return self::$_instance;\n }", "public function testCreateService()\n {\n $mockPluginManager = $this\n ->getMockBuilder('\\Rcm\\Service\\PluginManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n $mockEntityManager = $this\n ->getMockBuilder('\\Doctrine\\ORM\\EntityManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n $mockContainerRepo = $this\n ->getMockBuilder('\\Rcm\\Repository\\Container')\n ->disableOriginalConstructor()\n ->getMock();\n\n $mockEntityManager->expects($this->any())\n ->method('getRepository')\n ->will($this->returnValue($mockContainerRepo));\n\n $site = new Site();\n $site->setSiteId(1);\n\n $sm = new ServiceManager();\n $sm->setService('Doctrine\\ORM\\EntityManager', $mockEntityManager);\n $sm->setService('Rcm\\Service\\PluginManager', $mockPluginManager);\n $sm->setService('Rcm\\Service\\CurrentSite', $site);\n\n $helperManager = new HelperPluginManager();\n $helperManager->setServiceLocator($sm);\n\n $factory = new ContainerViewHelperFactory();\n $object = $factory->createService($helperManager);\n\n $this->assertTrue($object instanceof Container);\n }", "private function create_service_object( string $service_name, array $options = null ) {\n $factory = $this->get_service_factory( $service_name );\n return $factory( $this->creation_service_manager, $service_name, $options );\n }", "public function __construct(ManagerInterface $manager) {\n $this->manager = $manager;\n }", "public function __construct()\n {\n $this->filesystem = new Filesystem();\n $this->fileService = new FileService();\n $this->tableService = new TableService();\n $this->testService = new TestService();\n $this->modelService = new ModelService();\n }", "abstract protected function initServiceName(): string;", "public function __construct(ServiceLocatorInterface $sm)\n {\n $this->serviceManager = $sm;\n }", "abstract protected function createInstance();", "public function __construct() {\n $this->_soapComponent = new ComponentSoapModel();\n }", "public function __construct()\n {\n parent::__construct();\n $this->downloadService = new DownloadService;\n $this->processingService = new ProcessingService;\n $this->exportService = new ExportService;\n }", "public function __construct()\n {\n $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n }", "public static function create()\n {\n //\n }", "public function getService();", "public function __construct()\n {\n\n $this->classeService = new EpisodioService();\n }", "public function __construct(ServiceManager\\ServiceLocatorInterface $serviceManager)\n {\n $gatewayFactory = $serviceManager->get('FdlGatewayFactory');\n $this->factoryEventManager = $gatewayFactory->getEventManager();\n\n // trigger the pre run hook, the pre run hook will only run once in the life of the factory\n $this->factoryEventManager->trigger(\n GatewayFactoryEvent::ON_MANAGER_STARTUP,\n $gatewayFactory,\n $serviceManager->get('FdlGatewayFactoryEvent')\n );\n }", "public function __construct()\n {\n // Default configuration\n $this->definitionManager = new DefinitionManager();\n $this->definitionManager->useReflection(true);\n $this->definitionManager->useAnnotations(true);\n\n // Default factory\n $this->factory = new Factory($this);\n }", "private function getManager(?EntityInterface $entity = null): SdkManagerInterface\n {\n return new SdkManager(new RequestHandlerStub($entity));\n }", "public function createService(ServiceLocatorInterface $serviceLocator)\r\n {\r\n }", "protected function getEs_ManagerFactoryService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/ongr/elasticsearch-bundle/Service/ManagerFactory.php';\n\n $this->services['es.manager_factory'] = $instance = new \\ONGR\\ElasticsearchBundle\\Service\\ManagerFactory(($this->services['es.metadata_collector'] ?? $this->getEs_MetadataCollectorService()), ($this->services['es.result_converter'] ?? $this->getEs_ResultConverterService()), ($this->services['es.tracer'] ?? $this->getEs_TracerService()), ($this->privates['monolog.logger'] ?? $this->getMonolog_LoggerService()));\n\n $instance->setEventDispatcher(($this->services['event_dispatcher'] ?? $this->getEventDispatcherService()));\n $instance->setStopwatch(($this->privates['debug.stopwatch'] ?? ($this->privates['debug.stopwatch'] = new \\Symfony\\Component\\Stopwatch\\Stopwatch(true))));\n\n return $instance;\n }", "public function & factory() {\n\t\treturn $this->mvcServiceManager()->factory();\n\t}", "public function & factory() {\n\t\treturn $this->mvcServiceManager()->factory();\n\t}", "public function __construct()\n {\n $this->verifyService = new VerifyService();\n }", "public function __construct()\n {\n parent::__construct();\n $this->EnseignantServices = new EnseignantServices();\n $this->Services = new EnseignantServices();\n $this->DivisionServices = new DivisionServices();\n $this->ProfPrincipalServices = new ProfPrincipalServices();\n $this->EnseignantMatiereServices = new EnseignantMatiereServices();\n $this->MatiereServices = new MatiereServices();\n $this->ProfPrincipalServices = new ProfPrincipalServices();\n }", "function initServices() {\n\n\t\treturn array(\n\t\t\t'UserStorage' => new Service('User\\Storage\\User'),\n\t\t\t'UserEntity' => new Service('User\\Entity\\User')\n\t\t);\n\t\t\n\t}", "private static function instantiate($class){\r\n\t\t$service= new $class();\r\n\t\treturn $service;\r\n\t}", "static function create(){\n }", "protected abstract function manager();", "final public static function service()\n\t{\n\t\treturn self::__registry(\\Eco\\System\\Registry\\Service::ID, '\\EcoServiceRegistry');\n\t}", "public function defaultService();", "protected function setUp()\n {\n parent::setUp();\n \n if ($this->cloneServices) {\n if (null === self::$serviceManagerPrototype) {\n $this->initializePrototype();\n }\n \n $this->services = clone self::$serviceManagerPrototype;\n } else {\n $config = $this->config ?: require $this->configPath;\n $this->services = new ServiceManager(\n new ServiceManagerConfig(\n isset($config['service_manager']) ?\n $config['service_manager'] : array()));\n $this->services->setService('ApplicationConfig', $config);\n $this->services->get('ModuleManager')->loadModules();\n }\n }", "protected function get_ServiceLocator_VdmMuyEService()\n {\n return $this->privates['.service_locator.vdmMuyE'] = new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($this->getService, [\n 'doctrine' => ['services', 'doctrine', 'getDoctrineService', false],\n 'form.factory' => ['services', 'form.factory', 'getForm_FactoryService', false],\n 'http_kernel' => ['services', 'http_kernel', 'getHttpKernelService', false],\n 'parameter_bag' => ['privates', 'parameter_bag', 'getParameterBagService', false],\n 'request_stack' => ['services', 'request_stack', 'getRequestStackService', false],\n 'router' => ['services', 'router', 'getRouterService', false],\n 'security.authorization_checker' => ['services', 'security.authorization_checker', 'getSecurity_AuthorizationCheckerService', false],\n 'security.csrf.token_manager' => ['services', 'security.csrf.token_manager', 'getSecurity_Csrf_TokenManagerService', false],\n 'security.token_storage' => ['services', 'security.token_storage', 'getSecurity_TokenStorageService', false],\n 'serializer' => ['services', 'serializer', 'getSerializerService', false],\n 'session' => ['services', 'session', 'getSessionService', false],\n 'templating' => ['services', 'templating', 'getTemplatingService', false],\n 'twig' => ['services', 'twig', 'getTwigService', false],\n ], [\n 'doctrine' => '?',\n 'form.factory' => '?',\n 'http_kernel' => '?',\n 'parameter_bag' => '?',\n 'request_stack' => '?',\n 'router' => '?',\n 'security.authorization_checker' => '?',\n 'security.csrf.token_manager' => '?',\n 'security.token_storage' => '?',\n 'serializer' => '?',\n 'session' => '?',\n 'templating' => '?',\n 'twig' => '?',\n ]);\n }", "public function __construct()\n {\n $this->launchManager = new LaunchManager();\n $this->rocketManager = new RocketManager();\n $this->providerManager = new ProviderManager();\n $this->padManager = new PadManager();\n $this->statusManager = new StatusManager();\n }", "public function __construct()\n {\n $awsConfig = Config::awsConverter(\n Config::getSection('aws')\n );\n\n $this->sdkAws = new \\Aws\\Sdk($awsConfig);\n $this->swfClient = $this->sdkAws->createClient('Swf');\n\n $allConfig = Config::getAll();\n\n $this->service = new Service(new ServiceConfig(\n $allConfig->swf->domain,\n $allConfig->identity,\n $this->swfClient,\n 'Continuous\\\\Demo\\\\Swf'\n ));\n }", "public function create() {\n\t \n }", "abstract public function servicemain();", "public function factory();", "protected function getMaker_FileManagerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/FileManager.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/Util/AutoloaderUtil.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/Util/ComposerAutoloaderFinder.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/Util/MakerFileLinkFormatter.php';\n\n return $this->privates['maker.file_manager'] = new \\Symfony\\Bundle\\MakerBundle\\FileManager(($this->services['filesystem'] ?? ($this->services['filesystem'] = new \\Symfony\\Component\\Filesystem\\Filesystem())), new \\Symfony\\Bundle\\MakerBundle\\Util\\AutoloaderUtil(new \\Symfony\\Bundle\\MakerBundle\\Util\\ComposerAutoloaderFinder('App')), new \\Symfony\\Bundle\\MakerBundle\\Util\\MakerFileLinkFormatter(($this->privates['debug.file_link_formatter'] ?? $this->getDebug_FileLinkFormatterService())), \\dirname(__DIR__, 4), (\\dirname(__DIR__, 4).'/templates'));\n }", "public function __construct()\n\t{\n\n\t\t$this->addClassAlias( DatabaseManager::class, 'mgr' );\n\t\t$this->setDefault( 'mgr' );\n\t}", "protected function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t//// resolve related classes\n\t\t\n\t\t$this->_sInstanceClass = get_class( $this );\n\t\t\n\t\t$this->_sEntityClass = Geko_Class::resolveRelatedClass(\n\t\t\t$this->_sInstanceClass, '_Service', '', $this->_sEntityClass\n\t\t);\n\t\t\n\t\t$this->_sManageClass = Geko_Class::resolveRelatedClass(\n\t\t\t$this->_sEntityClass, '', '_Manage', $this->_sManageClass\n\t\t);\n\t\t\n\t\tif ( $this->_sManageClass ) {\n\t\t\t$this->_oManage = Geko_Singleton_Abstract::getInstance( $this->_sManageClass );\n\t\t\t$oManage = $this->_oManage;\n\t\t}\n\n\t}", "public static function factory()\n {\n $manager = new self();\n $manager->archives = [];\n $manager->recipients = [];\n return $manager;\n }", "function __construct($name)\n{\n\tglobal $pclib;\n\tparent::__construct();\n\t$this->name = $name;\n\t$pclib->app = $this;\n\n\tsystem\\BaseObject::defaults('serviceLocator', array($this, 'getService'));\n\n\t$this->errorHandler = new system\\ErrorHandler;\n\t$this->errorHandler->register();\n\n\t$this->paths = $this->getPaths();\n\n\t$this->environmentIp(\n\t\tarray(\n\t\t\t'127.0.0.1' => 'develop',\n\t\t\t'::1' => 'develop',\n\t\t\t'*' => 'production',\n\t\t)\n\t);\n\n\t$this->addConfig( PCLIB_DIR.'Config.php' );\n}", "abstract public static function create();", "protected function createService()\n {\n return $this->drive->children;\n }", "static public function APPDATA() { return new Service_OpenSocial_Service(self::APPDATA); }", "public function setServiceName(string $service):static;", "public function __construct()\n {\n $this->service = new KiotVietService();\n parent::__construct();\n }", "public function createObjectInstance();", "public function __construct()\n {\n $this->organization_repo = new OrganizationRepo(); \n $this->student_paravalue_repo = new StudentParaValue();\n $this->student_para_repo = new StudentParameter(); \n $this->Permission_service = new Permission(); \n $this->seat_repo = new SeatRepo();\n $this->Seat_service = new Seat(); \n $this->Student_service = new Student(); \n $this->Utils = new Utils(); \n $this->Assessment_Service = new Assessment(); \n }", "public function __construct() {\n self::registerServices();\n }", "static function create() {\n\t\treturn new self ( $_SERVER );\n\t}", "public function __construct( $manager )\n\t{\n\t\t$this->typeManager = $manager;\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->service= new SpotifyService();\n }", "public function __construct(ObjectManager $manager)\r\n {\r\n $this->manager = $manager;\r\n }", "public static function services();", "public static function factory(ServiceLocatorInterface $sl, array $spec);", "protected function setUp()\n {\n $this->serviceManager = new ServiceManager(\n new Config(\n array(\n 'factories' => array(\n 'SphinxSearch\\Db\\Adapter\\Adapter' => 'SphinxSearch\\Db\\Adapter\\AdapterServiceFactory'\n ),\n 'alias' => array(\n 'sphinxql' => 'SphinxSearch\\Db\\Adapter\\Adapter'\n )\n )\n )\n );\n $this->serviceManager->setService(\n 'Config',\n array(\n 'sphinxql' => array(\n 'driver' => 'pdo_mysql',\n ),\n )\n );\n }" ]
[ "0.6783758", "0.6641691", "0.64322317", "0.6376634", "0.6297134", "0.6275471", "0.62674534", "0.61799", "0.6167933", "0.6167933", "0.61084086", "0.6089522", "0.60774577", "0.6038725", "0.60359496", "0.60339284", "0.60018295", "0.5994039", "0.59651464", "0.59593767", "0.5902523", "0.5897092", "0.588707", "0.5886418", "0.5878584", "0.5860876", "0.58403516", "0.58403516", "0.58403516", "0.58403516", "0.58403516", "0.58403516", "0.5830319", "0.58258057", "0.58240837", "0.578288", "0.5764011", "0.5761756", "0.575155", "0.57329816", "0.5731581", "0.5721264", "0.57138073", "0.5705859", "0.5695948", "0.56946313", "0.5693965", "0.5686592", "0.5673777", "0.56575096", "0.56543607", "0.56503034", "0.5648847", "0.564673", "0.563305", "0.56285745", "0.5625226", "0.5620174", "0.5616292", "0.5600493", "0.5592925", "0.55928445", "0.55849063", "0.5577126", "0.5577126", "0.55763686", "0.5576139", "0.55744666", "0.5573867", "0.5571253", "0.55661696", "0.55499387", "0.55472004", "0.5545622", "0.55427605", "0.55398154", "0.5529536", "0.55291426", "0.55245036", "0.55213994", "0.5518285", "0.5510819", "0.5508793", "0.55046606", "0.55043066", "0.5500717", "0.5492589", "0.5491428", "0.5483485", "0.54795754", "0.54758435", "0.54735243", "0.54719836", "0.54714227", "0.5463544", "0.54614544", "0.5459417", "0.5458418", "0.5457793", "0.545415" ]
0.72786826
0
Build and return the Page in string format.
Создайте и верните страницу в формате строки.
public function buildPage(PageBuilderInterface $pageBuilder): string { $pageBuilder ->setHeading() ->setContent() ->setFooter(); return $pageBuilder->getPage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPage() {\n\n\t\t$this->main = $this->makeMain($this->main);\n\n\t\treturn \t$this->pageStart.\n\t\t\t\t$this->header.\n\t\t\t\t$this->nav.\n\t\t\t\t$this->main.\n\t\t\t\t$this->footer.\n\t\t\t\t$this->pageEnd; \n\t}", "public static function toString()\r\n\t{\r\n\t\tif( ! self::$alreadyGenerated )\r\n\t\t{\r\n\t\t\t$class = BASE_NAME.' page_'.Context::getPageCode();\r\n\t\t\tif( SETTINGS_MULTI_LINGUAGES )\r\n\t\t\t\t$class .= ' lang_'.Lang::getCurrentLanguage();\r\n?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n\t<head>\r\n\t\t<title><?php echo self::getTitle(); ?></title>\r\n<?php\r\n\t\t\t$padding = \"\\t\\t\";\r\n\t\t\tforeach(self::$meta_data as $key => $value)\r\n\t\t\t\tself::loadMetaData($key, $value, $padding);\r\n?>\r\n\t\t<meta http-equiv=\"REFRESH\" content=\"n\" />\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=<?php echo ENCTYPE_CHARSET; ?>\" />\r\n<?php\r\n\t\t\tself::loadFavIcon($padding);\r\n\t\t\tforeach(self::$myCSS as $key)\r\n\t\t\t\tself::loadCSS($key, $padding);\r\n\t\t\tforeach(self::$myJS as $key)\r\n\t\t\t\tself::loadJS($key, $padding);\r\n\t\t\tself::$alreadyGenerated = true;\r\n?>\r\n\t</head>\r\n\r\n\t<body class=\"<?php echo $class; ?>\">\r\n\t\t<a id=\"top\" name=\"top\"></a>\r\n\r\n<?php\r\n\t\t}\r\n\t}", "public function __toString(): string\n {\n return 'Page ' . $this->getKey() . ': ' . $this->getTitle();\n }", "public function build( )\n {\n\n\n $this->load();\n\n $this->html = $this->genTree();\n\n return $this->html;\n\n }", "private function buildPage()\n {\n $resource = $this->_objects->getObjects();\n $parse = $this->_lang;\n $parse['dpath'] = DPATH;\n $page = '';\n $max_fields = DevelopmentsLib::maxFields($this->_current_planet);\n\n // time to do something\n $this->doCommand();\n\n DevelopmentsLib::setFirstElement($this->_current_planet, $this->_current_user);\n\n $Sprice = array();\n $queue = $this->showQueue($Sprice);\n\n $this->startBuilding();\n\n $full_queue = ( $queue['lenght'] < MAX_BUILDING_QUEUE_SIZE ) ? false : true;\n\n foreach ($this->_lang['tech'] as $building => $building_name) {\n if (in_array($building, $this->_allowed[$this->_current_planet['planet_type']])) {\n $queue['to_destroy'] = isset($queue['to_destroy']) ? $queue['to_destroy'] : 0;\n\n if ($this->_current_planet['planet_field_current'] < ( $max_fields - $queue['to_destroy'] )) {\n $have_fields = true;\n } else {\n $have_fields = false;\n }\n\n if (DevelopmentsLib::isDevelopmentAllowed($this->_current_user, $this->_current_planet, $building)) {\n $building_level = $this->_current_planet[$resource[$building]];\n $building_time = DevelopmentsLib::developmentTime(\n $this->_current_user,\n $this->_current_planet,\n $building,\n $building_level\n );\n\n $parse['i'] = $building;\n $parse['nivel'] = DevelopmentsLib::setLevelFormat($building_level);\n $parse['n'] = $building_name;\n $parse['descriptions'] = $this->_lang['res']['descriptions'][$building];\n $parse['price'] = DevelopmentsLib::formatedDevelopmentPrice(\n $this->_current_user,\n $this->_current_planet,\n $building,\n true,\n $building_level\n );\n $parse['time'] = DevelopmentsLib::formatedDevelopmentTime($building_time);\n $parse['click'] = $this->setActionButton($have_fields, $full_queue, $building, $queue);\n\n $page .= parent::$page->parseTemplate(parent::$page->getTemplate('buildings/buildings_builds_row'), $parse);\n }\n }\n }\n\n if ($queue['lenght'] > 0) {\n $parse['BuildListScript'] = DevelopmentsLib::currentBuilding($this->_current_page);\n $parse['BuildList'] = $queue['buildlist'];\n } else {\n $parse['BuildListScript'] = '';\n $parse['BuildList'] = '';\n }\n\n $parse['BuildingsList'] = $page;\n\n parent::$page->display(parent::$page->parseTemplate(parent::$page->getTemplate('buildings/buildings_builds'), $parse));\n }", "private function makeV1() : string\n {\n $inner_links = ceil( $this->current_page + $this->inner_links);\n\n $html = '<nav><ul class=\"pagination df_custom_pagination\">';\n $html .= '<li class=\"page-item\"><a class=\"page-link\" href=\"'.str_replace('{i}', 1, $this->url).$this->querystring.'\"> First </a></li>';\n\n if($this->offset > 0 AND $this->current_page <= ceil($this->max_item/$this->limit))\n {\n $html .= '<li class=\"page-item\"><a class=\"page-link\" href=\"'.str_replace('{i}', ($this->current_page - 1), $this->url).$this->querystring.'\"> << </a> </li>';\n }\n for($i= $this->current_page; $i<$inner_links; $i++)\n {\n $active = ((($i-1) * $this->limit) == $this->offset) ? 'active' : '';\n\n if ($i <= ceil($this->max_item/$this->limit))\n {\n $html.= '<li class=\"page-item '.$active.'\"><a class=\"page-link\" href=\"'.str_replace('{i}', $i, $this->url).$this->querystring.'\">'.$i.'</a></li>';\n }\n }\n if(($this->offset + $this->inner_links) < $this->max_item)\n {\n $html .= '<li class=\"page-item\"><a class=\"page-link\" href=\"'.str_replace('{i}', ($this->current_page + 1), $this->url).$this->querystring.'\"> >> </a></li>';\n }\n $html .= '<li class=\"page-item\"><a class=\"page-link\" href=\"'.str_replace('{i}', ceil($this->max_item/$this->limit), $this->url).$this->querystring.'\"> Last </a></li>';\n $html .= '</ul></nav>';\n \n return $html;\n }", "public function getPage() {\n// html for the web page, the header, the main body, \n// the footer sections and closing body and html tags\n\nreturn $this->pageStart.$this->header.\"\\n\".$this->mainBody.\"</main>\\n\".$this->foot.\"\\n</body>\\n</html>\"; \n}", "public function build( )\n {\n\n if( !$this->html )\n $this->html = '<p>empty</p>';\n\n return $this->html;\n\n }", "public function getPage() {\n return $this->head . $this->body . \"\\n</body>\\n</html>\";\n }", "public function createPage()\n\t{\n\t\t$page = new Page(); // introduce $page variable for action\n\t\t$page->checkMultilingualSetup();\n\n\t\t// log the last viewed page in the Page object itself\n\t\t$page->add('lastPage', $this->getNextUrl());\n\n\t\t// Add assets that are common for all p-actions\n\t\t$page->addCommonAssets();\n\t\t// Add assets that are common for all p-actions of given module\n\t\t$page->addModuleAssets($this->moduleName);\n\n\t\treturn $page;\n\t}", "public function __toString() {\n return htmlentities(\"<CMS Content Page: {$this->path}>\");\n }", "public function __toString()\n\t\t{\n\t\t\t$string = \"<pre>\";\n\t\t\t$string .= \"page_array: \" . To_String($this->page_array);\n\t\t\t$string .= \"data: \" . To_String($this->data);\n\t\t\t$string .= \"user_acl: \" . To_String($this->user_acl);\n\t\t\t$string .= \"company_list: \" . To_String($this->company_list);\n\t\t\t$string .= \"company_id: {$this->company_id}\";\n\t\t\t$string .= \"</pre>\";\n\t\t\treturn $string;\n\t\t}", "public function __toString(){\n\t\t\n\t\t\t// calculate the total number of pages based on default values given\n\t\t\t$this->_totalPages();\n\t\t\tif($this->_totalPages <= 1) return \"\";\n\t\t\t\t\n\t\t\t//initialize string variable\n\t\t\t$string = NULL;\n\t\t\t\n\t\t\t// iterate through pages\n\t\t\t// checks to see if the results exceede the truncation point and if there is to \n\t\t\t// be truncation, otherwise the results will be rolled out normally \n\t\t\t// truncation will show results in three formats\n\t\t\t// 1 [2] 3 4 ... XX -- if the page is less than 1/2 the truncation value\n\t\t\t// 1...5 6 [7] 8 9 ... XX -- if the current page is inbetween the extremes\n\t\t\t// 1... 22 23 [24] 25 -- if the current page is greater than Max-1/2 truncation \n\t\t\t\n\t\t\t\n\t\t\t//echo $this->_totalPages;\n\t\t\t$mid = floor($this->_params['truncate']/2);\n\t\t\t$startPage = 1;\n\t\t\t\n\t\t\t/*--------- truncation page_rules --------------*/\n\t\t\t// if current page is greater than 2, set the current page in the middle of the group\n\t\t\tif( $this->_currentPage - $mid > 2){ $startPage = $this->_currentPage - $mid; }\n\t\t\t// if current page is greater than max pages - truncation, will set the max pages so that it cannot be exceeded\n\t\t\tif( $this->_currentPage > $this->_totalPages - $mid - 2 ){ $startPage = $this->_totalPages - $mid -2; }\n\t\t\t// if startpage is < 0 startpage = 1\n\t\t\tif( $startPage < 1 ){ $startPage = 1; }\n\t\t\t\n\t\t\t// iterate through the pages\n\t\t\tfor($i = $startPage; $i < $this->_params['truncate'] + $startPage && $i <= $this->_totalPages; $i++){\n\t\t\t\tif($i == $this->_currentPage){\n\t\t\t\t\t// replaces the * with the current page number in the currentPageLocator string\n\t\t\t\t\t$string .= \"<li class='current'><a href='#'>\".$i.\"</a></li>\";\n\t\t\t\t} else {\n\t\t\t\t\t// detect if link has variables\n\t\t\t\t\t//$link = $this->_link.(strstr($this->_link,\"?\")?\"&\":\"?\").\"page=\".$i;\n\t\t\t\t\t// creates a page link\n\t\t\t\t\t$string .= $this->_jslink($i);\n\n\t\t\t\t}// end if\n\t\t\t\t\n\t\t\t\t$string .= $this->_params['divider'];\n\t\t\t}// end for\n\n\t\t\t\n\t\t\t// additional string addons\n\t\t\t// adds a perminant link to the first page\n\t\t\tif( $this->_currentPage - $mid > 2){ \n\t\t\t\t$string = $this->_jslink(1).\"<li class='unavailable'>&hellip;</li>\".$string;\n\t\t\t}\n\t\t\t\n\t\t\t// adds a perminant link to the last page\n\t\t\tif( $this->_currentPage < $this->_totalPages - $mid - 1){ \n\t\t\t\t$string .= \"<li class='unavailable'>&hellip;</li>\".$this->_jslink($this->_totalPages);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn \"<ul class='pagination'>\".$string.\"</ul>\";\n\t\t}", "public function renderPage()\n\t{\n\t\tlist($start,$len) = $this->pageRange($this->pageCount);\n\t\t$pages = $this->pageLinkItem($start,$len);\n\t\t$content = '';\n\t\t\n\t\t// first page link\n\t\tif($this->alwaysEnableFirstAndLastTag===false)\n\t\t{\n\t\t\tif($this->currentPage!==1)\n\t\t\t{\n\t\t\t\t$content .= $this->getFirstPageItem();\t\n\t\t\t}\n\t\t}else{\n\t\t\t$content .= $this->getFirstPageItem();\n\t\t}\n\t\t\n\t\t// when the sequenceTurnPage is true, enable previous page link\n\t\tif($this->sequenceTurnPage===true)\n\t\t{\n\t\t\t$content .= $this->getPreviousPageItem();\n\t\t}\n\t\t\n\t\t// all the page link\n\t\t$content .= implode(\"\\n\",$pages);\n\t\t\n\t\t// when the sequenceTurnPage is true, enable next page link\n\t\tif($this->sequenceTurnPage===true)\n\t\t{\n\t\t\t$content .= $this->getNextPageItem();\n\t\t}\n\n\t\t// last page link\n\t\tif($this->alwaysEnableFirstAndLastTag===false)\n\t\t{\n\t\t\tif($this->currentPage!==$this->pageCount)\n\t\t\t{\n\t\t\t\t$content .= $this->getLastPageItem();\n\t\t\t}\n\t\t}else{\n\t\t\t$content .= $this->getLastPageItem();\n\t\t}\n\t\treturn $content;\n\t}", "abstract public function buildHTML();", "public function getXML(): string\n {\n $this->dom = new DOMDocument('1.0', \"UTF-8\");\n $this->dom->formatOutput = true;\n\n $this->createUrlset();\n \n array_map(\n function ($page) {\n $this->createUrl($page);\n },\n $this->pages\n );\n\n $this->dom->appendChild($this->urlset);\n\n return $this->dom->saveHTML();\n }", "public function render() {\n\n try {\n $this->_content = $this->loadPage();\n } catch(UnexpectedValueException $e) {\n // Clean ouput first\n ob_clean();\n $this->_page \t= 'page-not-found';\n $this->_content = $this->loadPage();\n }\n\n if ($this->getConfig()->raw) {\n $page = $this->_content;\n } else {\n // Template has be loaded first to set title, description, keywords first\n $header = $this->loadLayout('header.php');\n $footer = $this->loadLayout('footer.php');\n $body\t= $this->loadLayout('template.php');\n $page = $header . $body . $footer;\n }\n\n return $page;\n }", "protected function __generate_page() {\n\n\t\t$request_type = $this->request_type();\n\n\t\tif ( $request_type == 'standard' ) {\n\t\t\techo file_get_contents($this->root . '/views/layout.mustache');\n\t\t\treturn;\n\t\t}\n\n\t\t$page = $this->wp_model->get('page');\n\t\t$comments = $this->wp_model->get('comments');\n\t\t$commentform = $this->wp_model->get('commentform', $page['ID']);\n\t\t$content = array_merge($page, array(\n\t\t\t'author' => $this->wp_model->get('author', $page['post_author'])\n\t\t));\n\n\t\tif ( $request_type == 'async' ) {\n\n\t\t\theader('Content-type: application/json');\n\t\t\techo json_encode(array(\n\t\t\t\t'type' => 'page',\n\t\t\t\t'content' => $content,\n\t\t\t\t'comments' => $comments,\n\t\t\t\t'commentform' => $commentform\n\t\t\t));\n\t\t\texit;\n\n\t\t}\n\n\t\t$content = array_merge($content, $this->get('frame'), $commentform);\n\t\t$content['comments'] = $comments;\n\n\t\t$layout = $this->mustache->loadTemplate('page');\n\t\techo $layout->render($content);\n\n\t}", "public function display()\n {\n $this->compile();\n echo(trim($this->page));\n\n /****************************************************************\n * Return Page *\n ****************************************************************/\n return($this->page);\n }", "public function getSimplePage()\n\t{\n\t\tob_start();\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t.align-left{text-align: left;float: left;padding: 3px;}\n\t\t.align-right{text-align: right; padding: 3px;}\n\t\t.align-center{text-align: center; padding: 3px;}\n\t\t\n\t\t</style>\n\t\t\n\t\t<div >\n\t\t<div class=\"align-center\">\n\t\t\t<b>контакты</b>\n\t\t</div>\n\t\t\t<br>(страница доступна только для зарегистрированных пользователей)\n\t\t<div class=\"align-center\" style=\"width: 550px;\">\n\t\t\tконтактная информация: <br><br><br>\n\t\t\t<div style=\"width: 350px;\">\n\t\t\t<div class=\"align-center\"><div class=\"align-left\">электронная почта: </div><div width=\"50px\"></div><div class=\"align-right\">alfreerj@gmail.com</div></div>\n\t\t\t<div class=\"align-center\"><div class=\"align-left\">скайп: </div><div width=\"50px\"></div><div class=\"align-right\">alfreerj</div></div>\n\t\t\t<div class=\"align-center\"><div class=\"align-left\">телефон: </div><div width=\"50px\"></div><div class=\"align-right\"> * * * ****** </div></div>\n\t\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t\n\t\t<?php\n\t\t$cont=ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $cont;\n\t}", "public function getPageBuilder()\n {\n return $this->pageBuilder;\n }", "public function __toString()\n {\n $title = $this->getTitle() ? \"<title>{$this->getTitle()}</title>\" : '';\n $head = implode(PHP_EOL, $this->getAllHeadElements());\n $footer_scripts = implode(PHP_EOL, $this->getScripts('footer'));\n\n $out = <<<END\n<html{$this->getHtmlAttributes()}>\n<head>\n{$title}\n{$head}\n</head>\n<body>\n{$this->getContent()}\n{$footer_scripts}\n</body>\n</html>\nEND;\n\n return $out;\n }", "public function __toString()\n {\n ob_start();\n\n $this->render($this->template, $this->data);\n $content = ob_get_clean();\n\n return $content; \n }", "public function __toString()\n\t{\n\t\t$steps = ($this->_absoluteCount / $this->_itemsPerPage);\n\n\t\tif ($steps > 1)\n\t\t{\n\t\t\t$view = new View(APPLICATION_PATH . '/Layout/Helpers/paginator.html.php');\n\t\t\t$view->steps = ceil($steps);\n\t\t\t$view->last = $view->steps - 1;\n\t\t\t$view->current = $this->_page;\n\t\t\t$view->class = $this->_class;\n\n\n\t\t\tif ($view->current < ($steps - 1))\n\t\t\t{\n\t\t\t\t$view->next = $view->current + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$view->next = $view->steps - 1;\n\t\t\t}\n\n\t\t\tif ($this->_page > 0)\n\t\t\t{\n\t\t\t\t$view->prev = $this->_page - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$view->prev = 0;\n\t\t\t}\n\n\t\t\t$view->start = 0;\n\t\t\t$view->end = $view->steps;\n\n\t\t\tif ($view->steps > $this->_pointCount)\n\t\t\t{\n\t\t\t\t$view->end = $view->current + 3;\n\t\t\t\t$view->start = $view->current - 2;\n\n\t\t\t\tif ($view->start < 0)\n\t\t\t\t{\n\t\t\t\t\t$view->start = 0;\n\t\t\t\t}\n\n\t\t\t\tif ($view->end > $view->steps)\n\t\t\t\t{\n\t\t\t\t\t$view->end = $view->steps;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $view->render();\n\t\t}\n\n\t\treturn '';\n\t}", "private function buildPage() {\n\t\tglobal $wgScriptPath;\n\t\t$htmlOut = '';\n\n\t\t// Output beginning of the page\n\t\t$htmlOut .= <<<HTML\n<!DOCTYPE html>\n<html lang=\"en\" dir=\"ltr\" class=\"client-nojs\">\n<head>\n<title>Wikipedia, the free encyclopedia</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta name=\"generator\" content=\"MediaWiki 1.18wmf1\" />\n<style type=\"text/css\">\nbody {\n\tcolor: #dedede;\n\tmargin: 2em;\n\tfont-family:Times New Roman;\n\tbackground: black url('//upload.wikimedia.org/wikipedia/commons/9/98/WP_SOPA_Splash_Full.jpg') no-repeat 0 0;\n}\nh3{\n font-size: 1.5em;\n text-align:center;\n margin-bottom: 0.5em;\n color: #ffffff;\n font-weight: bold;\n}\n\nh4 { \n font-weight: bold;\n color: #ffffff;\n}\na:link, a:visited {\n\tcolor: #dedede;\n}\na:hover, a:active {\n\tcolor: #ffffff;\n}\ndiv#everything {\n\twidth: 920px;\n\tmargin: 0 auto;\n}\ndiv#instructions {\n\tposition: absolute;\n\ttop: 67px;\n\tleft: 480px;\n\ttext-align: left;\n\twidth: 500px;\n\tpadding-bottom: 30px;\n}\ndiv#instructions p {\n text-align:justify;\n}\ndiv#contacts {\n\tposition: absolute;\n\ttop: 50px;\n\tleft: 80px;\n\twidth: 320px;\n\tbackground-color: #161616;\n\tpadding: 5px 20px 20px 20px;\n\tfilter:alpha(opacity=90);\n\t-moz-opacity:0.90;\n\t-khtml-opacity: 0.90;\n\topacity: 0.90;\n}\ndiv#contacts form {\n\tmargin-bottom: 1em;\n}\ntable.person {\n\tmargin-bottom: 1em;\n\tmargin-left: 20px;\n\tborder: none;\n}\ntable.person td.name {\n\tfont-weight: bold;\n}\np {\n\tmargin: 1em 0;\n}\np.quote {\n\tfont-family: georgia, serif;\n\tfont-size: 14px;\n\tcolor: #cccccc;\n\tmargin-left: 20px;\n}\np.note {\n\tmargin-top: 0;\n}\nh3 {\n\tfont-weight: normal;\n\tfont-size: 20px;\n}\nh4 {\n\tfont-weight: normal;\n\tfont-size: 17px;\n}\n.sopaBigHeadline {\n font-size: 1.5em;\n margin-bottom: 0.5em;\n}\n.sopaSectionHeadline {\n font-size: 1.2em;\n margin-bottom: 0.2em;\n}\n.sopaSocial {\n float: left;\n text-align: center;\n margin-right: 12px;\n margin-bttom: 3px;\n font-size: small;\n}\n.sopaActionHead {\n font-weight: bold\n}\n</style>\n</head>\n<body>\n<div id=\"everything\">\n<div id=\"instructions\">\n\t<div class=\"sopaBigHeadline\">Call your elected officials.</div>\n\t\n\t<p>\n\tTell them you are their constituent, and you oppose SOPA and PIPA.\n\t</p>\n\t\n\t<div class=\"sopaSectionHeadline\">Why?</div>\n\t<p>\n\tSOPA and PIPA put the burden on website owners to police user-contributed material and call for the unnecessary blocking of entire sites. Small sites won't have sufficient resources to defend themselves. Big media companies may seek to cut off funding sources for their foreign competitors, even if copyright isn't being infringed. Foreign sites will be blacklisted, which means they won't show up in major search engines. SOPA and PIPA build a framework for future restrictions and suppression.\n\t</p>\n\t\n\t<p>\n\tIn a world in which politicians regulate the Internet based on the influence of big money, Wikipedia &mdash; and sites like it &mdash; cannot survive.\n\t</p>\n\t\n\t<p>\n\tCongress says it's trying to protect the rights of copyright owners, but the \"cure\" that SOPA and PIPA represent is worse than the disease. SOPA and PIPA are not the answer: they will fatally damage the free and open Internet.\n\t</p>\n</div>\n<div id=\"contacts\">\n\n\t\nHTML;\n\n\t\tif ( $this->getZip() === false ) {\n\t\t\t$htmlOut .= $this->getZipForm( true );\n\t\t} elseif ( !is_null( $this->getZip() )) {\n\t\t\t$htmlOut .= $this->getCongressTables();\n\t\t} else {\n\t\t\t$htmlOut .= $this->getZipForm();\n\t\t}\n\n\t\t// Output end of the page\n\t\t$htmlOut .= \"\\n</div>\\n</div>\\n</body>\\n</html>\\n\";\n\n\t\techo $htmlOut;\n\n\t\treturn true;\n\t}", "public function buildPage(){\n\t\tif (!$this->_has_content()){\n\t\t\tthrow new Exception(\"No content to build\");\n\t\t}\n\t\t$this->_include_template();\n\t\treturn $this;\n\t}", "public function __toString()\n {\n try {\n return $this->render();\n } catch (\\Exception $e) {\n return \"Error rendering page: \" . $e->getMessage();\n }\n }", "public function build()\n {\n $path = $this->path();\n\n return $this->render($path, $this->data());\n }", "public function __toString() {\n\t$this->file = static::clean_paths($this->file);\n\t\n\ttry {\n\t\t$page = bootstrap::get_library('page');\n\t\t\n\t\t$page = new $page;\n\t\t$page->exception($this);\n\t}\n\tcatch (\\Exception $e) {\n\t\techo $e;\n\t}\n\t\n\treturn 'Sorry, something went wrong.';\n}", "public function __toString()\n {\n try {\n $pageText = $this->pipeString($this->trimBody($this->getSession()->getPage()->getContent()) . \"\\n\");\n $string = sprintf(\"%s\\n\\n%s%s\", $this->getMessage(), $this->getResponseInfo(), $pageText);\n } catch (\\Exception $e) {\n return $this->getMessage();\n }\n\n return $string;\n }", "private function makeV2() : string\n {\n $array_pagination = $this->generateArrayPagination();\n\n $html = '<nav><ul class=\"pagination df_custom_pagination\">';\n if ($this->limit)\n {\n foreach ($array_pagination as $v)\n {\n if ($v == $this->separator)\n {\n $html .= '<li class=\"page-item disabled\"><a class=\"page-link\">' . $this->separator . '</a></li>';\n }\n else if (preg_match(\"/<b>(.*)<\\/b>/i\", $v))\n {\n $html .= '<li class=\"page-item active\"><a class=\"page-link\">' . strip_tags($v) . '</a></li>';\n }\n else\n {\n $html .= '<li>' . $v . '</li>';\n }\n }\n }\n else\n {\n $html .= '<li class=\"page-item active\"><span>1</span></li>';\n }\n $html .= '</ul></nav>';\n\n return $html;\n }", "function buildThePage()\n{\n global $url;\n\n try {\n $pageKey = $url->slug();\n $page = new Page($pageKey);\n } catch (Exception $e) {\n $url->setNotFound();\n return false;\n }\n\n if ($page->draft() || $page->scheduled() || $page->autosave()) {\n if ($url->parameter('preview') !== md5($page->uuid())) {\n $url->setNotFound();\n return false;\n }\n }\n\n return $page;\n}", "abstract public function pageHtml();", "private function buildPage()\n {\n // some values by default\n $parse = $this->langs;\n $parse['js_path'] = XGP_ROOT . JS_PATH;\n\n // display an specific category of items\n if (isset($_GET['dsp']) && $_GET['dsp'] == 1 && $this->have_premium) {\n $mode = '';\n $get_messages = '';\n\n foreach ($_GET as $field => $value) {\n\n if (FunctionsLib::inMultiarray($field, $this->message_type)) {\n\n $type_id = FunctionsLib::recursiveArraySearch($field, $this->message_type);\n $get_messages .= $type_id . ',';\n $active[$type_id] = 1;\n }\n }\n\n // get list of messages\n $message_list = $this->Messages_Model->getByUserIdAndType($this->current_user['user_id'], $get_messages);\n\n // set messages as read\n $this->Messages_Model->markAsReadByType($this->current_user['user_id'], $get_messages);\n } else {\n\n $mode = isset($_GET['mode']) ? $_GET['mode'] : null;\n }\n\n // to delete something\n $to_delete = isset($_POST['deletemessages']) ? $_POST['deletemessages'] : null;\n\n if (isset($to_delete)) {\n $mode = \"delete\";\n }\n\n $write_to = isset($_GET['id']) ? (int) $_GET['id'] : null;\n\n switch ($mode) {\n case 'write':\n $text = '';\n $error_page = '';\n\n if (!is_numeric($write_to)) {\n\n FunctionsLib::redirect('game.php?page=messages');\n } else {\n \n $OwnerHome = $this->Messages_Model->getHomePlanet($write_to);\n\n if (!$OwnerHome) {\n FunctionsLib::redirect('game.php?page=messages');\n }\n }\n\n if ($_POST) {\n $error = 0;\n\n if (!$_POST['subject']) {\n $error++;\n $parse['error_text'] = $this->langs['mg_no_subject'];\n $parse['error_color'] = '#FF0000';\n $error_page = parent::$page->parseTemplate(\n parent::$page->getTemplate('messages/messages_error_table'),\n $parse\n );\n }\n\n if (!$_POST['text']) {\n $error++;\n $parse['error_text'] = $this->langs['mg_no_text'];\n $parse['error_color'] = '#FF0000';\n $error_page = parent::$page->parseTemplate(\n parent::$page->getTemplate('messages/messages_error_table'),\n $parse\n );\n }\n\n if ($error == 0) {\n $parse['error_text'] = $this->langs['mg_msg_sended'];\n $parse['error_color'] = '#00FF00';\n\n $error_page = parent::$page->parseTemplate(\n parent::$page->getTemplate('messages/messages_error_table'),\n $parse\n );\n\n $Owner = $write_to;\n $Sender = $this->current_user['user_id'];\n $From = $this->current_user['user_name'] . ' ' . FormatLib::prettyCoords(\n $this->current_user['user_galaxy'],\n $this->current_user['user_system'],\n $this->current_user['user_planet']\n );\n $Subject = $_POST['subject'];\n $Message = FunctionsLib::formatText($_POST['text']);\n\n FunctionsLib::sendMessage($Owner, $Sender, '', 4, $From, $Subject, $Message);\n\n $subject = '';\n $text = '';\n }\n }\n\n $parse['id'] = $write_to;\n $parse['to'] = $OwnerHome['user_name'] . ' ' . FormatLib::prettyCoords(\n $OwnerHome['planet_galaxy'],\n $OwnerHome['planet_system'],\n $OwnerHome['planet_planet']\n );\n $parse['subject'] = (!isset($subject) ) ? $this->langs['mg_no_subject'] : $subject;\n $parse['text'] = $text;\n $parse['status_message'] = $error_page;\n\n parent::$page->display(\n parent::$page->parseTemplate(\n parent::$page->getTemplate('messages/messages_pm_form_view'),\n $parse\n )\n );\n\n break;\n\n case 'delete':\n if ($to_delete == 'deleteall') {\n\n $this->Messages_Model->deleteAllByOwner($this->current_user['user_id']);\n } elseif ($to_delete == 'deletemarked') {\n\n foreach ($_POST as $Message => $Answer) {\n\n if (preg_match(\"/delmes/i\", $Message) && $Answer == 'on') {\n\n $MessId = str_replace(\"delmes\", \"\", $Message);\n\n $this->Messages_Model->deleteByOwnerAndId($this->current_user['user_id'], $MessId);\n }\n }\n } elseif ($to_delete == 'deleteunmarked') {\n\n foreach ($_POST as $Message => $Answer) {\n\n $MessId = str_replace(\"showmes\", \"\", $Message);\n $Selected = \"delmes\" . $MessId;\n $IsSelected = $_POST[$Selected];\n\n if (preg_match(\"/showmes/i\", $Message) && !isset($IsSelected)) {\n\n $this->Messages_Model->deleteByOwnerAndId($this->current_user['user_id'], $MessId);\n }\n }\n }\n\n FunctionsLib::redirect('game.php?' . strtr($_SERVER['QUERY_STRING'], ['&amp;' => '&']));\n\n break;\n\n default:\n if ($this->have_premium) {\n\n // make messages count per type, notes and admins count\n $this->makeCounts();\n \n $parse['form_submit'] = 'game.php?' . $_SERVER['QUERY_STRING'];\n $type_row_template = parent::$page->getTemplate('messages/messages_body_premium_row_view');\n $rows = '';\n \n while ($messages_list = parent::$db->fetchAssoc($this->_messages_count)) {\n\n $this->message_type[$messages_list['message_type']]['count']\n = $messages_list['message_type_count'];\n $this->message_type[$messages_list['message_type']]['unread']\n = $messages_list['unread_count'];\n }\n\n foreach ($this->message_type as $id => $data) {\n\n $parse['message_type'] = $data['type_name'];\n $parse['message_type_name'] = $this->langs['mg_type'][$id];\n $parse['message_amount'] = isset($data['count']) ? $data['count'] : 0;\n $parse['message_unread'] = isset($data['unread']) ? $data['unread'] : 0;\n $parse['checked'] = (isset($active[$id]) ? 'checked' : '');\n $parse['checked_status'] = (isset($active[$id]) ? 1 : 0);\n\n $rows .= parent::$page->parseTemplate($type_row_template, $parse);\n }\n\n $parse['message_type_rows'] = $rows;\n $parse['buddys_count'] = $this->_extra_count['buddys_count'];\n $parse['alliance_count'] = $this->_extra_count['alliance_count'];\n $parse['operators_count'] = $this->_extra_count['operators_count'];\n $parse['notes_count'] = $this->_extra_count['notes_count'];\n \n $parse['mg_ab_friends'] = '';\n $parse['mg_ab_members'] = '';\n $parse['mg_ab_operators'] = '';\n $parse['mg_notes_rows'] = '';\n $parse['owncontactsopen'] = '';\n $parse['ownallyopen'] = '';\n $parse['gameoperatorsopen'] = '';\n $parse['noticesopen'] = '';\n \n if (isset($_POST['owncontactsopen']) && $_POST['owncontactsopen'] == 'on') {\n \n $parse['owncontactsopen'] = 'checked=\"1\"';\n $parse['mg_ab_friends'] = $this->buildFriendsAddressBook();\n }\n \n if (isset($_POST['ownallyopen']) && $_POST['ownallyopen'] == 'on') {\n \n $parse['ownallyopen'] = 'checked=\"1\"';\n $parse['mg_ab_members'] = $this->buildAllinaceAddressBook(); \n }\n \n if (isset($_POST['gameoperatorsopen']) && $_POST['gameoperatorsopen'] == 'on') {\n \n $parse['gameoperatorsopen'] = 'checked=\"1\"';\n $parse['mg_ab_operators'] = $this->buildOperatorsAddressBook();\n }\n \n if (isset($_POST['noticesopen']) && $_POST['noticesopen'] == 'on') {\n \n $parse['noticesopen'] = 'checked=\"1\"';\n $parse['mg_notes_rows'] = $this->buildNotes();\n }\n \n $parse['message_list'] = isset($message_list) ? $this->loadMessages($message_list) : '';\n $parse['delete_options'] = isset($_GET['dsp']) ? $this->loadDeleteBox() : '';\n \n } else {\n \n // get list of messages\n $message_list = $this->Messages_Model->getByUserId($this->current_user['user_id']);\n\n // set messages as read\n $this->Messages_Model->markAsRead($this->current_user['user_id']);\n\n $single_message_template = parent::$page->getTemplate('messages/messages_list_row_view');\n $list_of_messages = '';\n\n while ($message = parent::$db->fetchArray($message_list)) {\n\n $message['message_text'] = nl2br($message['message_text']);\n $message['message_time'] = date(\n strtr(FunctionsLib::readConfig('date_format_extended'),['.Y' => '']),\n $message['message_time']\n );\n\n $list_of_messages .= parent::$page->parseTemplate($single_message_template, $message);\n }\n\n $parse['message_list'] = $list_of_messages;\n $parse['show_operators'] = $this->buildOperatorsAddressBook();\n }\n\n parent::$page->display(\n parent::$page->parseTemplate($this->setDefaultTemplate(), $parse)\n );\n\n break;\n }\n }", "private function buildPage () : void {\n\t\trequire \"{$this->root}/frameworks/Twig/Autoloader.php\";\n\t\t\\Twig_Autoloader::register ();\n\t\t$paths\t\t\t\t= Config::paths ('twig', 'filesystem');\n\t\t$paths []\t\t\t= $this->page->path ();\n\t\t$twigEnv\t\t\t= Config::get ('client', 'paths');\n\t\t$twigEnv ['page']\t= $this->page;\n\t\t$twigEnv ['data']\t= $this->mess->getData ();\n\t\t$loader\t\t\t\t= new \\Twig_Loader_Filesystem ($paths);\n\t\t$twig\t\t\t\t= new \\Twig_Environment ($loader, [\n\t\t\t'debug' => debug (),\n\t\t\t'cache' => Config::path ('twig', 'cache')\n\t\t]);\n\t\t$twig->addExtension (new \\Twig_Extension_Debug ());\n\t\t$template = $twig->loadTemplate ($this->page->content ());\n\t\t$template->display ($twigEnv);\n\t}", "public function toString(){\n\t\t$html = '';\n\n\t\treturn $html;\n\t}", "protected function createModuleContentForPage()\n {\n $this->addModuleStyles();\n\n $result = $this->getFunctionMenu() . ' ';\n\n switch ($this->pObj->MOD_SETTINGS['type']) {\n case 'pathcache':\n $this->edit_save();\n $result .= $this->getDepthSelector();\n $moduleContent = $this->renderModule($this->initializeTree());\n $result .= $this->renderSearchForm();\n $result .= $moduleContent;\n break;\n case 'encode':\n $result .= $this->getDepthSelector();\n $result .= $this->encodeView($this->initializeTree());\n break;\n case 'decode':\n $result .= $this->getDepthSelector();\n $result .= $this->decodeView($this->initializeTree());\n break;\n case 'uniqalias':\n $this->edit_save_uniqAlias();\n $result .= $this->uniqueAlias();\n break;\n case 'config':\n $result .= $this->getDepthSelector();\n $result .= $this->configView();\n break;\n case 'redirects':\n $result .= $this->redirectView();\n break;\n case 'log':\n $result .= $this->logView();\n break;\n }\n return $result;\n }", "public function build()\r\n\t{\r\n\t\t$template = Template::Singleton();\r\n\r\n\t\t$this->attach_menu();\r\n\t\t$this->attach_page_tags();\r\n\t\t$this->load_elements();\r\n\t\t$this->attach_head();\r\n\t\t$this->attach_settings();\r\n\t\t$this->attach_user();\r\n\t\t$this->attach_security();\r\n\t\t$this->attach_options();\r\n\t\t$this->attach_cart();\r\n\t\t$this->attach_warnings(); //This should be the last but one\r\n\t\t$this->attach_debug(); //This should be the last one\r\n\t\t$this->build_xml();\r\n\r\n\t\treturn $this->dom->saveXML();\r\n\t}", "function __toString(){\n\t\tob_start();\n\t\t$this->render();\n\t\treturn ob_get_clean();\n\t}", "public function __toString()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->before();\n\t\t\t$this->_html = parent::render();\n\t\t\t$this->after();\n\n\t\t\treturn $this->_html;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tif (Kohana::$errors)\n\t\t\t{\n\t\t\t\t// Display the exception message\n\t\t\t\tKohana_Exception::handler($e);\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'Error Rendering Page';\n\t\t\t}\n\t\t}\n\t}", "public function build(): string\n {\n switch ($this->type)\n {\n case self::TYPE_SELECT:\n default:\n // Query base\n $parts = [\n 'SELECT ' . implode(',', $this->getSelectFields()),\n 'FROM ' . $this->tableName,\n implode(\"\\n\", $this->joins),\n 'WHERE ' . (empty($this->clauses) ? '1' : implode(' AND ', $this->clauses))\n ];\n\n // Ordering\n if (!empty($this->orderings)) {\n $orderings = [];\n foreach ($this->orderings as $field => $direction) {\n $orderings[] = $field . ' ' . $direction;\n }\n $parts[] = 'ORDER BY ' . implode(', ', $orderings);\n }\n\n // Limit & offset\n if ($this->limit > 0) {\n if ($this->offset > 0) {\n $parts[] = 'LIMIT ' . (int)$this->offset . ',' . (int)$this->limit;\n } else {\n $parts[] = 'LIMIT ' . (int)$this->limit;\n }\n }\n break;\n }\n return implode(\"\\n\", $parts);\n }", "protected function buildFakePage()\n {\n try {\n $rawResponse = App::$View->render('_core/exceptions/' . $this->tpl, ['msg' => $this->text]);\n if (Str::likeEmpty($rawResponse)) {\n $rawResponse = $this->text;\n }\n } catch (\\Exception $e) {\n $rawResponse = $this->text;\n }\n // set status code for header\n App::$Response->setStatusCode((int)$this->status);\n // return compiled html output\n return $rawResponse;\n }", "public function __toString() {\n\t\t$this->document->formatOutput = true;\n\t\t$this->document->preserveWhitespace = false;\n\t\t$title = $this->document->createElement('title', $this->getFullTitle());\n\t\t$this->head->appendChild($title);\n\t\tif(!empty($this->favicon)) {\n\t\t\t$favicon = $this->document->createElement('link');\n\t\t\t$favicon->setAttribute('rel', 'shortcut icon');\n\t\t\t$favicon->setAttribute('href', $this->favicon);\n\t\t\t$this->head->appendChild($favicon);\n\t\t\t$favicon = $this->document->createElement('link');\n\t\t\t$favicon->setAttribute('rel', 'icon');\n\t\t\t$favicon->setAttribute('href', $this->favicon);\n\t\t\t$this->head->appendChild($favicon);\n\t\t}\n\t\tif(!empty($this->keywords)) {\n\t\t\t$keywords = $this->document->createElement('meta');\n\t\t\t$keywords->setAttribute('name', 'keywords');\n\t\t\t$keywords->setAttribute('content', $this->keywords);\n\t\t\t$this->head->appendChild($keywords);\n\t\t}\n\t\t$html = $this->document->getElementsByTagName('html')->item(0);\n\t\t$html->appendChild($this->head);\n\t\t$html->appendChild($this->body);\n\t\treturn $this->document->saveXML();\n\t}", "function buildPage($pageKey)\n{\n try {\n $page = new Page($pageKey);\n return $page;\n } catch (Exception $e) {\n return false;\n }\n}", "public function build_page_bar($options = array()) {\n\t\t$buffer = \"\";\n\n\t\t$options = array_merge(array(\n\t\t\t'type' => static::TYPE_DEFAULT,\n\t\t\t'include_div_tag' => true,\n\t\t), $options);\n\n\t\tswitch($options['type']) {\n\t\t\tcase static::TYPE_DEFAULT:\n\t\t\t\t$r = $this->calculate_page_data();\n\t\t\t\t$index = '&laquo;';\n\t\t\t\t$pre = '&lsaquo;';\n\t\t\t\t$next = '&rsaquo;';\n\t\t\t\t$end = '&raquo;';\n\n\t\t\t\tif ($this->page_count <= 7) {\n\t\t\t\t\t$range = range(1, $this->page_count);\n\t\t\t\t} else {\n\t\t\t\t\t$min = $this->page_no - 3;\n\t\t\t\t\t$max = $this->page_no + 3;\n\n\t\t\t\t\tif ($min < 1) {\n\t\t\t\t\t\t$max += (3-$min);\n\t\t\t\t\t\t$min = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $max > $this->page_count ) {\n\t\t\t\t\t\t$min -= $max - $this->page_count;\n\t\t\t\t\t\t$max = $this->page_count;\n\t\t\t\t\t}\n\n\t\t\t\t\t$min = $min > 1 ? $min : 1;\n\t\t\t\t\t$range = range($min, $max);\n\t\t\t\t}\n\n\t\t\t\t$buffer .= '<ul>';\n\n\t\t\t\tif ($this->page_no > 1) {\n\t\t\t\t\t$buffer .= \"<li><a href='\".$this->get_url($this->page_string, 1).\"'>{$index}</a></li>\";\n\t\t\t\t\t$buffer .=\" <li><a href='\".$this->get_url($this->page_string, $this->page_no-1).\"'>{$pre}</a></li>\";\n\t\t\t\t}\n\n\t\t\t\tforeach($range AS $one) {\n\t\t\t\t\tif ( $one == $this->page_no ) {\n\t\t\t\t\t\t$buffer .= \"<li class=\\\"active\\\"><a href='\".$this->get_url($this->page_string, $one).\"'>{$one}</a></li>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$buffer .= \"<li><a href='\".$this->get_url($this->page_string, $one).\"'>{$one}</a></li>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->page_no < $this->page_count) {\n\t\t\t\t\t$buffer .= \"<li><a href='\".$this->get_url($this->page_string, $this->page_no+1).\"'>{$next}</a></li>\";\n\t\t\t\t\t$buffer .= \"<li><a href='\".$this->get_url($this->page_string, $this->page_count).\"'>{$end}</a></li>\";\n\t\t\t\t}\n\n\t\t\t\t$buffer .= '</ul>';\n\t\t\t\tbreak;\n\t\t\tcase static::TYPE_BACK_NEXT:\n\t\t\t\t$buffer .= '<ul class=\"pager\">';\n\n\t\t\t\tif ($this->page_no > 1) {\n\t\t\t\t\t$buffer .= '<li class=\"previous\">';\n\t\t\t\t\t$buffer .= '\t<a href=\"'.$this->get_url($this->page_string, $this->page_no-1).'\">&larr; Newer</a>';\n\t\t\t\t\t$buffer .= '</li>';\n\t\t\t\t}else{\n\t\t\t\t\t$buffer .= '<li class=\"previous disabled\">';\n\t\t\t\t\t$buffer .= '\t<a href=\"javascript:void(0)\">&larr; Newer</a>';\n\t\t\t\t\t$buffer .= '</li>';\n\t\t\t\t}\n\n\t\t\t\tif ($this->page_no < $this->page_count) {\n\t\t\t\t\t$buffer .= '<li class=\"next\">';\n\t\t\t\t\t$buffer .= '\t<a href=\"'.$this->get_url($this->page_string, $this->page_no+1).'\">Older &rarr;</a>';\n\t\t\t\t\t$buffer .= '</li>';\n\t\t\t\t}else{\n\t\t\t\t\t$buffer .= '<li class=\"next disabled\">';\n\t\t\t\t\t$buffer .= '\t<a href=\"javascript:void(0)\">Older &rarr;</a>';\n\t\t\t\t\t$buffer .= '</li>';\n\t\t\t\t}\n\n\t\t\t\t$buffer .= '</ul>';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($options['include_div_tag'] === true) {\n\t\t\t$buffer = '<div class=\"pagination\">'.$buffer.'</div>';\n\t\t}\n\n\t\treturn $buffer;\n\t}", "public function menu_gen() : string {\n\n // Starts the output buffer.\n ob_start();\n \n // Loop through the menu items and build the HTML\n foreach( $this->_menu_items as $label=>$page ) {\n\n $classes = array( \n \"nav-item\",\n \"nav-link\",\n \"text-inverse\" \n );\n\n // Check to see if the link we're building is the active page, and gives it the\n // \"active\" CSS class.\n if( $_SERVER['REQUEST_URI'] == $page || basename( __FILE__ ) == $page)\n array_push( $classes, \"active\" );\n ?>\n <a class=\"<?= implode( \" \", $classes ); ?>\" href=\"<?= $page ?>\"><?= $label ?></a>\n <?php\n }\n\n // Return the buffered HTML\n return ob_get_clean();\n }", "public function __toString()\n {\n try {\n ob_start();\n $this->render();\n\n return ob_get_clean();\n } catch (Exception $e) {\n \\Sledgehammer\\report_exception($e);\n\n return '';\n }\n }", "public function __toString()\n {\n return $this->process($this->html);\n }", "public function __toString() {\n ob_start();\n $this->wrap();\n return ob_get_clean();\n }", "public function __toString() { //{{{\n global $haveWP;\n\n $output = \"\";\n do {\n // check for DOM\n if (null == $this->dom) {\n $this->dummyDom();\n }\n // just raw XML\n if ($this->raw) {\n header(\"Content-type: text/xml\");\n $output = $this->dom->saveXML();\n break;\n }\n\n // need xsltFile, or use default one\n if (!$this->xsltFile) {\n $this->xsltFile = XSLT_DIR . \"templates.xsl\";\n }\n\n // do transform\n $xslt = new XSLT($this->xsltFile);\n\n if ($this->params) {\n $xslt->addParams($this->params);\n }\n\n // inject path param for relative paths\n $path = $this->resolvePath($_SERVER[\"REQUEST_URI\"]);\n if ($path) {\n $xslt->addParams(array(\"path\" => $path));\n }\n\n // get user from Shibboleth\n $user = getUser();\n if ($user) {\n $xslt->addParams(array(\"user\" => $user));\n }\n\n // get possible message\n $m = $this->getMessage();\n if ($m) {\n $xslt->addParams(array(\"message\" => $m[\"message\"],\n \"messageClass\" => $m[\"messageClass\"]));\n }\n\n // transform\n $output = $xslt->transformToXML($this->dom);\n\n // merge with WordPress\n if ($haveWP) {\n // title\n if (isset($this->params[\"title\"])) {\n $title = $this->params[\"title\"];\n add_filter(\"wp_title\", function () use ($title) { return $title . \" | \";});\n }\n\n ob_start();\n get_header();\n //get_sidebar(\"left\");\n print sprintf('<div id=\"content\">%s</div>', $output);\n //get_sidebar(\"right\");\n get_footer();\n\n $output = ob_get_clean();\n }\n\n } while (false);\n\n return $output;\n }", "function buildURL($limitParams=false) {\n\treturn page('url');\n}", "function makePageStart() {\n\n\t$pageStartContent = <<<PAGESTART\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> \n <script src=\"https://kit.fontawesome.com/a076d05399.js\"></script>\n <title>Henderson Building Contractors</title>\n <link rel=\"icon\" href=\"styles/images/logo.png\" type=\"image\" sizes=\"16x16\">\n <link rel=\"stylesheet\" href=\"styles/style.css\"> \n </head>\nPAGESTART;\n\t$pageStartContent .=\"\\n\";\n\treturn $pageStartContent;\n}", "public function __toString()\n {\n $page = (isset($_GET[$this->queryKey]) && ((int)$_GET[$this->queryKey] > 0)) ? (int)$_GET[$this->queryKey] : 1;\n return implode($this->separator, $this->getLinks($page));\n }", "public function build(){\n $content = \"\";\n $content = \"<\".$this->tag.$this->attributes.\">\";\n $content .= $this->content;\n if(!empty($this->children)){\n foreach($this->children as $children){\n $content .= \"\\n\".$children->build().\"\\n\";\n }\n }\n $content .= \"</\".$this->tag.\">\";\n return ($content);\n }", "abstract public function makeHtml();", "public function render() {\n\t\t$this->templateVariableContainer->add('isPageable', $this->isPageable);\n\t\t$this->templateVariableContainer->add('isPageableNextPage', $this->isPageableNextPage);\n\t\t$this->templateVariableContainer->add('previousPage', $this->currentPage - 1);\n\t\t$this->templateVariableContainer->add('currentPage', $this->currentPage);\n\t\t$this->templateVariableContainer->add('nextPage', $this->currentPage + 1);\n\t\t$this->templateVariableContainer->add('totalPages', $this->totalPages);\n\n\t\t$pages = array();\n\t\t$hasPlaceholderBefore = $hasPlaceholderAfter = FALSE;\n\t\tfor ($i = 1; $i <= $this->totalPages; $i++) {\n\t\t\tif ($i === 1 || $i === $this->pagesTotal) {\n\t\t\t\t$pages[] = $i;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($i < ($this->currentPage - $this->settings['maxBefore'])) {\n\t\t\t\tif (!$hasPlaceholderBefore) {\n\t\t\t\t\t$pages[] = '...';\n\t\t\t\t\t$hasPlaceholderBefore = TRUE;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($i > ($this->currentPage + $this->settings['maxAfter'])) {\n\t\t\t\tif (!$hasPlaceholderAfter) {\n\t\t\t\t\t$pages[] = '...';\n\t\t\t\t\t$hasPlaceholderAfter = TRUE;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$pages[] = $i;\n\t\t}\n\n\t\t$this->templateVariableContainer->add('pages', $pages);\n\t\t\n\n\t\treturn $this->renderChildren();\n\t}", "static function generatePages()\n {\n $page = Page::find(1);\n if(is_null($page))\n {\n $website = Website::where('name', 'flooflix')->first();\n $page1 = Page::create(['name'=>'accueil', 'url' => 'http://127.0.0.1:8000']);\n $page1->website_id = $website->id;\n $page1->save();\n $page2 = Page::create(['name'=>'connexion', 'url' => 'http://127.0.0.1:8000/Connexion']);\n $page2->website_id = $website->id;\n $page2->save();\n $page3 = Page::create(['name'=>'inscription', 'url' => 'http://127.0.0.1:8000/Inscription']);\n $page3->website_id = $website->id;\n $page3->save();\n $page4 = Page::create(['name'=>'categories', 'url' => 'http://127.0.0.1:8000/LesCatégories']);\n $page4->website_id = $website->id;\n $page4->save();\n return 'Les pages ont été ajoutés dans la base de données.';\n }\n else \n {\n return '';\n } \n }", "public function buildPage() {\n $content=$this->controlSwitch();\n $VHome=USingleton::getInstance('VHome');\n //!content= need to show homepage\n if(!$content){$content=$VHome->getHomeContent();}\n \n $this->setPage($content);\n //$this->addLoginBox();\n //$VHome->assign('loginBox',NULL); //lato client\n }", "public function createPageHeader()\n\t{\n\t\t$page=CHtml::openTag('div',$this->htmlOptions);\n\t\tif($this->center==true) $page.='<center>';\n\t\t$page.=CHtml::openTag('h1');\n\t\t$page.=$this->heading;\n\t\tif(isset($this->slogan)) $page.=' <small>'.$this->slogan.'</small>';\n\t\t$page.=CHtml::closeTag('h1');\n\t\tif($this->center==true) $page.='</center>';\n\t\t$page.=CHtml::closeTag('div');\n\t\t\n\t\treturn $page;\n\t}", "public function execute()\n {\n $page = $this->pageFactory->create();\n if ($cmsPage = $this->registry->registry(App::MAINTENANCE_CMS_PAGE_KEY)) {\n /* @var PageInterface $cmsPage */\n $content = $this->filterProvider->getPageFilter()->filter($cmsPage->getContent());\n\n echo '\n<html>\n <head>\n <title>'.$cmsPage->getTitle().'</title> \n </head>\n <body>\n '.$content.'\n </body>\n</html>\n ';exit(0);\n }\n return $page;\n }", "public function __toString(){\n\t\treturn $this->html();\n\t}", "public function toHtml(): string\n {\n if ($this->numPages <= 1) {\n return '';\n }\n\n $html = '<ul class=\"pagination\">';\n if ($this->getPrevUrl()) {\n $html .= '<li><a href=\"' . htmlspecialchars($this->getPrevUrl()) . '\">&laquo; ' . $this->previousText . '</a></li>';\n }\n\n foreach ($this->getPages() as $page) {\n if ($page['url']) {\n $html .= '<li' . ($page['isCurrent'] ? ' class=\"active\"' : '') . '><a href=\"' . htmlspecialchars($page['url']) . '\">' . htmlspecialchars($page['num']) . '</a></li>';\n } else {\n $html .= '<li class=\"disabled\"><span>' . htmlspecialchars($page['num']) . '</span></li>';\n }\n }\n\n if ($this->getNextUrl()) {\n $html .= '<li><a href=\"' . htmlspecialchars($this->getNextUrl()) . '\">' . $this->nextText . ' &raquo;</a></li>';\n }\n $html .= '</ul>';\n\n return $html;\n }", "public function thepage ()\n {\n\n $webpage = '<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>REACT PHP</title>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\tnew webpage for REACT PHP code and the <a href=\"/secondpage\">Second Page</a> \n\t\t\t\t</body>\n\t\t\t\t</html>';\n \n\t\t\t\treturn $webpage;\n\t }", "protected function page() {\n return $this->kirbytext->page();\n }", "function __toString(): string\n {\n return $this->build();\n }", "public function get_html() {\n\n if ($this->page == '')\n $this->page = 1;\n\n if ($this->url == null)\n $this->url = \"\";\n\n $Page_block = \"\";\n $Page_num = @ceil($this->total / $this->limit);\n $StartPage = $this->page - 5;\n\n if ($StartPage < 1)\n $StartPage = 1;\n $LastPage = $StartPage + 9;\n\n if ($LastPage > $Page_num)\n $LastPage = $Page_num;\n if ($LastPage != $StartPage + 9)\n $StartPage = $LastPage - 9;\n if ($StartPage < 1)\n $StartPage = 1;\n\n if ($this->page == 1) {\n $PrePage = \"\";\n $First = \"\";\n } else {\n $PrePage = \"\";\n $First = \"\";\n }\n\n if ($this->page == $Page_num) {\n $NextPage = \"<li><a class=\\\"next off\\\">Next</a></li>\";\n $Last = \"<li><a class=\\\"last off\\\">Last</a></li>\";\n } else {\n $NextPage = \"<li class=\\\"pagination-next\\\"><a class=\\\"pagenav\\\" href=\\\"\". $this->url . ($this->page + 1) . \"\\\"title=\\\"Next\\\">Next</a></li>\";\n $Last = \"<li class=\\\"pagination-end last\\\"><a class=\\\"pagenav\\\" href=\\\"\". $this->url . $Page_num .\"\\\" title=\\\"End\\\">End</a></li></ul>\";\n //$NextPage = \"<li class=\\\"next\\\"><a href=\\\"\" . $this->url . ($this->page + 1) . \"\\\" rel=\\\"next\\\">Next</a></li>\";\n //$Last = \"<li><a class=\\\"last\\\" href=\\\"\" . $this->url . $Page_num . \"\\\">Last </a></li>\";\n }\n\n //$threadpagestats = \"about $this->total results, max $this->limit results/page\";\n\n while ($StartPage <= $LastPage) {\n if ($StartPage == $this->page) {\n $ShowPage = \"<li><a class=\\\"active\\\">\" . $StartPage . \"</a></li>\";\n } else if ($StartPage == 1) {\n $ShowPage = \"<li><a href=\\\"\" . $this->url . \"\\\">\" . $StartPage . \"</a></li>\";\n } else {\n $ShowPage = \"<li><a href=\\\"\" . $this->url . $StartPage . \"\\\">\" . $StartPage . \"</a></li>\";\n }\n\n $Page_block .= $ShowPage;\n $StartPage++;\n }\n\n $leftPage = $LastPage + 1;\n while ($leftPage <= 10) {\n\n $Page_block .= \"<li><a class=\\\"off\\\">$leftPage</a></li>\";\n $leftPage++;\n }\n\n\n $Page_block = \"\n <div class=\\\"k2Pagination\\\"><ul>\n $First $PrePage $Page_block $NextPage $Last\n </ul><div class=\\\"clr\\\"></div></div>\n \"; //$threadpagestats\";\n return $Page_block;\n }", "public function __toString() {\n return $this->html();\n }", "public function __toString() {\n return $this->html();\n }", "public function render(int $curPage, Website $web): string\n {\n $query = new QueryString($this->whitelist);\n $lb = $this->getLowerBoundary($curPage);\n $ub = $this->getUpperBoundary($curPage);\n $str = '<div class=\"'.$this->cssClass.'\">';\n\n if ($this->renderText) {\n $str .= '<div class=\"text\">';\n $str .= $this->i18n[$this->lang]['search result'].': '.$this->numRec.' ';\n $str .= $this->numRec > 1 ? $this->i18n[$this->lang]['entries'] : $this->i18n[$this->lang]['entry'];\n $str .= ' '.$this->i18n[$this->lang]['on'].\" $this->numPages \";\n $str .= $this->numPages > 1 ? $this->i18n[$this->lang]['pages'] : $this->i18n[$this->lang]['page'];\n $str .= '</div>';\n }\n\n $str .= '<div class=\"pages\">';\n // link jump back small\n if ($lb > $this->numLinks / 2) {\n // reuse existing query string in navigation links\n $queryStr = $query->withString([$this->queryVarName => $curPage - $this->stepSmall]);\n $str .= '<span class=\"pageStepSmall prevPages\"><a href=\"'.$web->page.$queryStr.'\">';\n $str .= '[-'.$this->stepSmall.']';\n $str .= '</a></span>';\n }\n // direct accessible pages\n for (; $lb <= $ub; $lb++) {\n if ($this->numPages > 1) {\n if ($lb === $curPage) {\n $str .= '<span class=\"curPage\">';\n } else {\n $str .= '<span class=\"page\">';\n $queryStr = $query->withString([$this->queryVarName => $lb]);\n $str .= '<a href=\"'.$web->page.$queryStr.'\">';\n }\n $str .= $lb;\n if ($lb !== $curPage) {\n $str .= '</a>';\n }\n $str .= '</span>';\n }\n }\n // link jump forward small\n if ($ub <= $this->numPages - $this->numLinks / 2) {\n // reuse query string\n $queryStr = $query->withString([$this->queryVarName => $curPage + $this->stepSmall]);\n $str .= '<span class=\"pageStepSmall nextPages\"><a href=\"'.$web->page.$queryStr.'\">';\n $str .= '[+'.$this->stepSmall.']';\n $str .= '</a></span>';\n }\n $str .= '</div></div>';\n\n return $str;\n }", "public function getPageHtml() {\n\t\treturn $this->pageHtml();\n\t}", "public function createPage() {\r\n\r\n }", "public function getPage() : string\n {\n return $this->page;\n }", "public function __toString() {\n\n\t\tif(!is_array($this->view))\n\t\t\treturn (string)$this->view;\n\n\t\tif(isset($this->view['json'])){\n\t\t\theader('Content-Type: application/json; charset=utf-8');\n\t\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \"GMT\");\n\t\t\theader(\"Cache-Control: no-cache,must-revalidate\");\n\t\t\theader(\"Pragma: no-cache\");\n\t\t\treturn json_encode($this->view['json']);\n\t\t}\n\n\t\t$viewFile = ROOT.DS.'app'.DS.'views'.DS.$this->controller.DS.$this->action.'.phtml';\n\n\t\t// load view template\n\t\tob_start();\n\t\tforeach($this->view as $i=>$v){\n\t\t\t${$i} = $v;\n\t\t}\n\t\tinclude $viewFile;\n\t\t$body = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// load layout template\n\t\t$layoutFile = ROOT.DS.'app'.DS.'views'.DS.'layout'.DS.'layout.phtml';\n\t\tob_start();\n\t\tinclude $layoutFile;\n\t\t$html = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $html;\n\t}", "public function buildPageBar($options = []) {\n $buffer = \"\";\n\n $options = array_merge([\n 'type' => static::TYPE_DEFAULT,\n ], $options);\n\n switch($options['type']) {\n case static::TYPE_DEFAULT:\n $r = $this->calculatePageData();\n $index = '&laquo;';\n $pre = '&lsaquo;';\n $next = '&rsaquo;';\n $end = '&raquo;';\n\n if ($this->page_count <= 7) {\n $range = range(1, $this->page_count);\n } else {\n $min = $this->page_no - 3;\n $max = $this->page_no + 3;\n\n if ($min < 1) {\n $max += (3-$min);\n $min = 1;\n }\n\n if ( $max > $this->page_count ) {\n $min -= $max - $this->page_count;\n $max = $this->page_count;\n }\n\n $min = $min > 1 ? $min : 1;\n $range = range($min, $max);\n }\n\n $buffer .= '<ul class=\"pagination\">';\n\n if ($this->page_no > 1) {\n $buffer .= \"<li><a href='\".$this->getUrl($this->page_string, 1).\"'>{$index}</a></li>\";\n $buffer .=\" <li><a href='\".$this->getUrl($this->page_string, $this->page_no-1).\"'>{$pre}</a></li>\";\n }\n\n foreach($range AS $one) {\n if ( $one == $this->page_no ) {\n $buffer .= \"<li class=\\\"active\\\"><a href='\".$this->getUrl($this->page_string, $one).\"'>{$one}</a></li>\";\n } else {\n $buffer .= \"<li><a href='\".$this->getUrl($this->page_string, $one).\"'>{$one}</a></li>\";\n }\n }\n\n if ($this->page_no < $this->page_count) {\n $buffer .= \"<li><a href='\".$this->getUrl($this->page_string, $this->page_no+1).\"'>{$next}</a></li>\";\n $buffer .= \"<li><a href='\".$this->getUrl($this->page_string, $this->page_count).\"'>{$end}</a></li>\";\n }\n\n $buffer .= '</ul>';\n break;\n case static::TYPE_BACK_NEXT:\n $buffer .= '<ul class=\"pager\">';\n\n if ($this->page_no > 1) {\n $buffer .= '<li class=\"previous\">';\n $buffer .= ' <a href=\"'.$this->getUrl($this->page_string, $this->page_no-1).'\">&larr; Newer</a>';\n $buffer .= '</li>';\n }else{\n $buffer .= '<li class=\"previous disabled\">';\n $buffer .= ' <a href=\"javascript:void(0)\">&larr; Newer</a>';\n $buffer .= '</li>';\n }\n\n if ($this->page_no < $this->page_count) {\n $buffer .= '<li class=\"next\">';\n $buffer .= ' <a href=\"'.$this->getUrl($this->page_string, $this->page_no+1).'\">Older &rarr;</a>';\n $buffer .= '</li>';\n }else{\n $buffer .= '<li class=\"next disabled\">';\n $buffer .= ' <a href=\"javascript:void(0)\">Older &rarr;</a>';\n $buffer .= '</li>';\n }\n\n $buffer .= '</ul>';\n break;\n }\n\n return $buffer;\n }", "public function __toString()\n {\n if (isset($_SERVER['REQUEST_URI'])) {\n return $this->toHtml();\n }\n return $this->toText();\n }", "public function __toString()\n {\n return $this->renderContent();\n }", "function write() {\n echo $this->page;\n }", "public function __toString(): string\n {\n return $this->type === Document::TYPE_HTML ? $this->html() : $this->xml();\n }", "function render()\n {\n $pages = empty($this->reference->{'number-of-pages'}) ? '' : rtrim($this->reference->{'number-of-pages'}, '.,pf ');\n\n if (empty($pages)) {\n\n return '';\n }\n\n return $pages . ' pp.';\n\n }", "public function render()\n {\n $typoScriptFrontendController = $this->getTypoScriptFrontendController();\n $as = (string)$this->arguments['as'];\n $pageUids = (array)$this->arguments['pageUids'];\n $sortField = $this->arguments['sortField'];\n $maximumAge = $this->arguments['maximumAge'];\n $includeNotInMenu = (bool)$this->arguments['includeNotInMenu'];\n $includeMenuSeparator = (bool)$this->arguments['includeMenuSeparator'];\n $excludeNoSearchPages = (bool)$this->arguments['excludeNoSearchPages'];\n\n // If no pages have been defined, use the current page\n if (empty($pageUids)) {\n $pageUids = array($typoScriptFrontendController->page['uid']);\n }\n\n $unfilteredPageTreeUids = array();\n foreach ($pageUids as $pageUid) {\n $unfilteredPageTreeUids = array_merge(\n $unfilteredPageTreeUids,\n explode(\n ',',\n $typoScriptFrontendController->cObj->getTreeList($pageUid, 20)\n )\n );\n }\n $pageTreeUids = array_unique($unfilteredPageTreeUids);\n\n $constraints = $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator);\n\n if ($excludeNoSearchPages) {\n $constraints .= ' AND no_search = 0';\n }\n\n if (!in_array($sortField, ['starttime', 'lastUpdated', 'tstamp', 'crdate'])) {\n $sortField = 'SYS_LASTCHANGED';\n }\n\n $minimumTimeStamp = time() - (int)$typoScriptFrontendController->cObj->calc($maximumAge);\n $constraints .= ' AND ' . $sortField . ' >=' . $minimumTimeStamp;\n\n $pages = $typoScriptFrontendController->sys_page->getMenuForPages(\n $pageTreeUids,\n '*',\n $sortField . ' DESC',\n $constraints\n );\n return $this->renderChildrenWithVariables(array(\n $as => $pages\n ));\n }", "public static function buildPage($parameters)\n\t{\n\t\trequire_once 'HTML/Template/IT.php';\n\t\t$templateForBody = new \\HTML_Template_IT(dirname(__FILE__) . '/../html');\n\t\t$templateForBody->loadTemplatefile('html.html');\n\n\t\t$html = '';\n\n\t\trequire_once 'HeaderView.php';\n\t\t$html .= HeaderView::buildHeader();\n\n\t\t$html .= $parameters['middle'];\n\n\t\trequire_once 'FooterView.php';\n\t\t$html .= FooterView::buildFooter();\n\n\t\t$templateForBody->setCurrentBlock('html');\n\t\t$templateForBody->setVariable (array (\n\t\t\t'BODY' => $html\n\t\t));\n\t\t$templateForBody->parse ('html');\n\t\treturn $templateForBody->get('html');\n\t}", "public function build() {\n return implode('', $this->display);\n }", "public function __toString()\n {\n return $this->html;\n }", "private function aboutContent(){\n\t\t$html.='<div class=\"post\"><div class=\"pageContent\">';\t\t\n\t\t$rs=$this->generated->getPage($_GET['pageName']);\n\t\t$content=$rs['pageContent'];\n\t\t$content=$this->generated->stripHTMLTags($content);\n\t\n\t\tif($content!=\"\"||$content!=null){\n\t\t\t$html.=nl2br($content);\n\t\t}\n\t\t$html.='</p>';\n\t\t$html.='</div></div>';\n\t\t\t$html.='<div class=\"clear\"></div>';\n\t\treturn $html;\n\t}", "public function __toString() {\n ob_start();\n try {\n $this->render();\n } catch (Throwable $e) {\n ob_end_clean();\n throw $e;\n }\n $return = ob_get_contents();\n ob_end_clean();\n return $return;\n }", "public function render(): string {\n if ($this->isCurrentPage) {\n $element = \"<span class=\\\"button-selector-page disabled\\\" aria-label=\\\"Sei nella pagina $this->pageNumber\\\" aria-current=\\\"page\\\">$this->pageNumber</span>\";\n } else {\n $this->url = $this->buildPageUrl($this->pageNumber);\n $element = \"<a href=\\\"$this->url\\\" class=\\\"button-selector-page\\\" aria-label=\\\"Vai alla pagina $this->pageNumber\\\" aria-current=\\\"false\\\">$this->pageNumber</a>\";\n }\n \n $this->replaceValue('ELEMENT', $element);\n return $this;\n }", "public function displayPage() {\n $this -> model -> checkUserSession();\n $this -> model -> checkDevice();\n\n /*\n Calling these three functions as they are what makes up each page. The displayHeader() and\n displayFooter() functions are included in the viewClass, but as for displayContent(), this is\n a protected function that is initialized in all other view classes that are used to display each pages\n content.\n */\n $html = $this -> displayHeader();\n $html .= $this -> displayContent();\n $html .= $this -> displayFooter();\n \n return $html; \n }", "public function page()\n {\n if ($this->uri->total_segments() == 4) {\n $language_code = '';\n $uri_start_segment = 3;\n } // there is a language code prefix\n else {\n $language_code = $this->uri->segment(4);\n $uri_start_segment = 4; // Array offset not segment position\n\n // language code prefix should be of 2 charachters long\n if (strlen($language_code) != 2) {\n $language_code = '';\n $uri_start_segment = 3;\n }\n }\n\n // generating the relative URI\n $uri = implode('/', array_slice($this->uri->segment_array(), $uri_start_segment));\n $this->execute($language_code, $uri);\n }", "protected function _buildPageList()\n {\n $startPage = (1 < ($_s = ($this->_currentLayer - 1) * $this->_pagesPerLayer + 1))\n ? $_s\n : 1;\n $endPage = ($this->_totalPages > ($_e = ($this->_currentLayer * $this->_pagesPerLayer)))\n ? $_e\n : $this->_totalPages;\n\n for ($i = $startPage; $i <= $endPage; $i ++) {\n $this->_pageList[$i] = ($i == $this->_currentPage)\n ? 'current'\n : '';\n }\n }", "public function pages() : string\n {\n $html = '';\n\n for ($i = 1; $i < $this->pagesTotal + 1; $i++) {\n if ($i === $this->page) {\n $html .= '<li class=\"page-item active\">';\n } else {\n $html .= '<li class=\"page-item\">';\n }\n \n $html .= '<a href=\"' . $this->url . '/' . $i . '\" class=\"page-link\">' . $i . '</a>';\n $html .= '</li>';\n }\n \n return $html;\n }", "protected function buildUrl($page) {\n return '';\n }", "public function __toString()\n\t{\n\t\t# start output buffering\n\t\tob_start();\n\n\t\t# extract parameters\n\t\textract($this->params());\n\n\t\t# require view\n\t\trequire $this->_path;\n\n\t\t# get the view content\n\t\t$contents\t= ob_get_contents();\n\n\t\t# stop buffering\n\t\tob_end_clean();\n\n\t\t# return contents\n\t\treturn $contents;\n\t}", "public function __toString() : string\n {\n return $this->render();\n }", "public function __toString() : string\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->build();\n }", "public function render()\n {\n $output = '<ul>';\n foreach($this->list as $lKey=>$lValue) {\n $output .= '<li><a href=\"?page='.$lKey.'\">'.$lValue.'</a></li>';\n }\n $output .= '</ul>';\n\n return (string) $output;\n }", "function genGoPage()\r\n\t{\r\n\t\t$max_page_option = 1;\r\n\t\t$x ='<div class=\"page_area\"><span class=\"pages\">Page '.$this->pageNo.' of '.$this->max_page.'</span>';\r\n\t\t# first page button\r\n\t\t$x.= ($this->pageNo>1)?'<a href=\"javascript:easyGallery.gopage(1,document.'.$this->form_name.'); \" title=\"First Page\">&laquo;</a>':'';\r\n\t\t# previous page button\r\n\t\t$x.= ($this->pageNo>1)?'<a href=\"javascript:easyGallery.gopage('.($this->pageNo-1).',document.'.$this->form_name.'); \" title=\"Previous Page\">&lsaquo;</a>':'';\r\n\t\t\r\n\t\tif($this->pageNo-$max_page_option-1>0)\r\n\t\t$x.='<span class=\"dot\">...</span>';\r\n\t\t\r\n\t\tfor($a=0;$a<$this->max_page;$a++)\r\n\t\t{\r\n\t\t\t$page = $a+1;\r\n\t\t\tif($page == $this->pageNo)\r\n\t\t\t{\r\n\t\t\t\t$x.='<span class=\"current\">'.$page.'</span>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif($page<$this->pageNo && $page>=$this->pageNo-$max_page_option)\r\n\t\t\t\t{\r\n\t\t\t\t\t$x.='<a href=\"javascript:void(0)\" onClick=\"easyGallery.gopage('.$page.',document.'.$this->form_name.'); \" title=\"Page '.$page.'\">'.$page.'</a>';\t\r\n\t\t\t\t}\r\n\t\t\t\telse if($page>$this->pageNo && $page<=$this->pageNo+$max_page_option)\r\n\t\t\t\t{\r\n\t\t\t\t\t$x.='<a href=\"javascript:void(0)\" onClick=\"easyGallery.gopage('.$page.',document.'.$this->form_name.'); \" title=\"Page '.$page.'\">'.$page.'</a>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($this->max_page-$this->pageNo>$max_page_option)\r\n\t\t$x.='<span class=\"dot\">...</span>';\r\n\t\t\r\n\t\t# next page button\r\n\t\t$x .= ($this->pageNo<$this->max_page)?'<a href=\"javascript:void(0)\" onClick=\"easyGallery.gopage('.($this->pageNo+1).',document.'.$this->form_name.'); \" title=\"Next Page\">&rsaquo;</a>':'';\r\n\t\t# last page button\r\n\t\t$x .= ($this->pageNo<$this->max_page)?'<a href=\"javascript:void(0)\" onClick=\"easyGallery.gopage('.($this->max_page).',document.'.$this->form_name.'); \" title=\"Last Page\">&raquo;</a>':'';\r\n\t\t\r\n\t\t$x.='</div>';\r\n\t\treturn $x;\t\t\r\n\t\t\t\r\n\t}", "function to_string( ) {\n\t\tob_start( );\n\t\t$this->load( );\n\t\t$returnvalue = ob_get_clean( );\n\t\treturn $returnvalue;\n\t}", "protected function build()\n {\n return simplexml_load_string('<html></html>');\n }", "public function __toString(): string\n {\n return $this->render();\n }" ]
[ "0.71200943", "0.68438435", "0.6667688", "0.6558808", "0.65088636", "0.64961225", "0.64932895", "0.6421072", "0.6250447", "0.623914", "0.620929", "0.62064433", "0.6204577", "0.6193331", "0.6134028", "0.61252874", "0.6101891", "0.5998184", "0.5992351", "0.59779286", "0.5959236", "0.5956762", "0.5949429", "0.59396774", "0.5937457", "0.593722", "0.5934888", "0.5884032", "0.5883682", "0.5879444", "0.58753794", "0.5870927", "0.58274066", "0.58220273", "0.5791253", "0.57843965", "0.5780868", "0.5775054", "0.57626677", "0.5747211", "0.5743993", "0.5708713", "0.56822735", "0.5670872", "0.5670387", "0.5650363", "0.5635559", "0.5627578", "0.56204164", "0.56191283", "0.5619021", "0.56173944", "0.5598519", "0.55977476", "0.55854774", "0.55843586", "0.55843014", "0.558082", "0.5579526", "0.55781776", "0.5569198", "0.5553533", "0.555299", "0.5551991", "0.5539723", "0.55380386", "0.5534733", "0.5534733", "0.55343866", "0.55294293", "0.55229694", "0.5521945", "0.5516158", "0.5515743", "0.55083275", "0.550348", "0.550245", "0.54911214", "0.54878795", "0.54867095", "0.5482458", "0.5478493", "0.5475672", "0.5462861", "0.5457025", "0.54557544", "0.5454509", "0.5452545", "0.5450716", "0.54495275", "0.54451185", "0.54424524", "0.5441662", "0.5441662", "0.543905", "0.54366624", "0.542477", "0.54242694", "0.5419936", "0.5410974" ]
0.7101373
1
function ItemCompulsoriesUndefined, Parameter list: $item=array(),$datas=array() Tests item according to whether all compulsory fields are defined. Returns lista of undefined data, empty list of all defined.
Функция ItemCompulsoriesUndefined, Список параметров: $item=array(), $datas=array() Проверяет элемент на наличие всех обязательных полей. Возвращает список неопределенных данных, пустой список, если все определены.
function ItemCompulsoriesUndefined($item=array(),$datas=array()) { if (empty($item)) { $item=$this->ItemHash; } if (empty($datas)) { $datas=array_keys($this->ItemData); } $rdatas=array(); foreach ($datas as $data) { if ($this->ItemData[ $data ][ "Compulsory" ]) { if (empty($item[ $data ])) { $res=FALSE; array_push($rdatas,$data); } } } return $rdatas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ItemsForm_AddItemMissingData($newitem)\n {\n $missingdatas=array();\n foreach ($this->Args[ \"AddDatas\" ] as $data)\n {\n if (empty($newitem[ $data ]))\n {\n array_push($missingdatas,$data);\n }\n }\n\n if (count($missingdatas)>0) \n {\n $this->ItemsForm_AddMessage\n (\n \"Missing datas: \".\n join(\", \",$missingdatas).\n \" indefinidos.\".\n $this->ItemName.\n \".\"\n );\n\n return FALSE;\n }\n\n return TRUE;\n }", "public function filterEmptyItems();", "function emptiness_check_all_inputs() {\n\t\tempty_check_extract(\"user_id\", \"user_id\");\n\t\tempty_check_extract(\"flight_id\", \"flight_id\");\n\t\tempty_check_extract(\"seat_num\", \"seat_num\");\n\t\tempty_check_extract(\"flyer_fname\", \"flyer_fname\");\n\t\tempty_check_extract(\"flyer_lname\", \"flyer_lname\");\n\t\tempty_check_extract(\"flyer_street_number\", \"flyer_street_number\");\n\t\tempty_check_extract(\"flyer_street_address\", \"flyer_street_address\");\n\t\tempty_check_extract(\"flyer_city\", \"flyer_city\");\n\t\tempty_check_extract(\"flyer_postal_code\", \"flyer_postal_code\");\n\t\tempty_check_extract(\"flyer_gender\", \"flyer_gender\");\n\t\tempty_check_extract(\"flyer_dob\", \"flyer_dob\");\n\t\tempty_check_extract(\"flyer_phone_number\", \"flyer_phone_number\");\n\t\tempty_check_extract(\"flyer_email\", \"flyer_email\");\n\t\tempty_check_extract(\"class\", \"class\");\n\t\tempty_check_extract(\"class\", \"class\");\n\t\tempty_check_extract(\"flyer_passport_id\", \"flyer_passport_id\");\n\t}", "public function getCantUndefined() {\n $data['indefinidos'] = $this->getCantIndefinidos();\n $data['nulos'] = $this->getCantNull();\n $data['new_types'] = $this->cant_new_types();\n $data['new_status'] = $this->cant_new_status();\n $data['afeterEigtDays'] = $this->cant_after_eigt_days();\n return $data;\n }", "function ItemDataIsUnique($item,$data)\n {\n if (!empty($item[ $data ]) && empty($this->ItemData[ $data ][ \"Derived\" ]))\n {\n $nitems=$this->MySqlNEntries(\"\",array($data => $item[ $data ]));\n if ($nitems>1)\n {\n if (!array($this->HtmlStatus))\n {\n $this->HtmlStatus=array($this->HtmlStatus);\n }\n\n $msg=\n $this->ItemName.\": Campo \".$this->ItemData[ $data ][ \"Name\" ].\n \" não é único: \".$item[ $data ];\n\n array_push($this->HtmlStatus,$msg);\n return FALSE; \n }\n }\n\n return TRUE;\n }", "function checkAllData($f,$new = 0){\n\t\tif(empty($f['partno'])) return \"The field Part No does not have to be null\";\n if(empty($f['description'])) return \"The field Type does not have to be null\";\n\t \treturn 0;\n\t}", "public static function getUnfulfilled() {\n $db = getDBConn();\n\n // Get all order items (and their orders) that aren't in a loading_order_item.\n $vals = [];\n $sql = <<<SQL\n SELECT `order`.*,\n `order_items`.`id` AS `order_item_id`,\n `order_items`.`order_id` AS `order_item_order_id`,\n `order_items`.`recipe_id` AS `order_item_recipe_id`\n FROM `order_items`\n JOIN `order`\n ON `order_items`.`order_id` = `order`.`id`\n LEFT OUTER JOIN `loading_order_items`\n ON `order_items`.`id` = `loading_order_items`.`order_item_id`\n WHERE `loading_order_items`.`id` IS NULL\n ORDER BY `order`.`delivery_date`, `order`.`id`\nSQL;\n\n $statement = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n $statement->execute($vals);\n\n $orderAndItemEntries = $statement->fetchAll(PDO::FETCH_OBJ);\n $unfulfilledOrders = static::coalesceEntries($orderAndItemEntries);\n\n return $unfulfilledOrders;\n }", "public function checkEmptyFiled($data){\n foreach ($data as $key=>$input) {\n if(!$input){\n //составляем имена и текста ошибок для возврата в форму\n $data['error_'.$key] = 'has-error';\n $data['error_'.$key.'_p'] = \"Field $key not be empty\";\n $data['err'] = 'err';\n }\n }\n return $data;\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function testCreateEmptyValues()\n {\n $item = Item::createFromArray([\n 'uuid' => [\n 'id' => '1',\n 'type' => 'product',\n ],\n 'coordinate' => null,\n 'distance' => null,\n 'metadata' => [],\n 'indexed_metadata' => [],\n 'searchable_metadata' => [],\n 'exact_matching_metadata' => [],\n 'suggest' => [],\n ]);\n\n $this->assertSame([], $item->getMetadata());\n $this->assertSame([], $item->getIndexedMetadata());\n $this->assertSame([], $item->getSearchableMetadata());\n $this->assertSame([], $item->getExactMatchingMetadata());\n $this->assertSame([], $item->getSuggest());\n $this->assertSame([], $item->getAllMetadata());\n $this->assertNull($item->getCoordinate());\n $this->assertNull($item->getDistance());\n $this->assertNull($item->getScore());\n }", "public function isItemListDataSpecified()\n {\n return $this->itemListData !== null;\n }", "protected function item_is_null($item)\n {\n }", "protected function item_is_null($item)\n {\n }", "public function no_items() {\r\n\t}", "public static function validateItem($item){\n\t\tif(!property_exists($item,'name') || !property_exists($item, 'value') || !property_exists($item, 'type') ||\n\t\t!property_exists($item, 'content') || !property_exists($item, 'answers') || !property_exists($item, 'display') ||\n\t\t!property_exists($item, 'mandatory')){\n\t\t\tthrow new CException('Invalid item: '.print_r($item, true));\n\t\t}\n\t\treturn true;\n\t}", "function check_data($data,$force = false , $refdata = NULL){\n\t\t$clean_data = [];\n\t\t$required = $refdata ? $refdata : $this->cols;\n\t\tforeach($required as $col => $req){\n\t\t\tif($req || $force){\n\t\t\t\tif(isset($data[$col])){\n\t\t\t\t\t@$clean_data[$col] = $data[$col];\n\t\t\t\t}else{\n\t\t\t\t\t// No puede continuar si Falta una variable Requerida no se ejecuta con force\n\t\t\t\t\tif(!$force){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t// No es requerida agrega si existe en el listado\n\t\t\t\t@$clean_data[$col] = $data[$col];\n\t\t\t}\n\t\t}\n\t\treturn $clean_data;\n\t}", "function ItemsDataValues($data,$items=array())\n {\n $values=array();\n foreach ($items as $id => $item)\n {\n $value=$item[ $data ];\n if (!preg_grep('/^$value$/',$values))\n {\n array_push($values,$value);\n }\n }\n\n return $values;\n }", "public function hasItemDatas(){\n return $this->_has(7);\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public static function check_item ( $item ) {\n\t}", "public static function NOT_EMPTY_FACTS( \\BOTK\\ModelInterface $data)\n\t{\n\t\treturn $data->getTripleCount()?false:'No facts found.';\n\t}", "function returnAll($item){\r\n if($item)\r\n return true;\r\n}", "public function isSetItemList()\n {\n return !empty($this->_fields['ItemList']['FieldValue']);\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function stdWrap_ifEmptyDataProvider() {}", "private function checkCourseDefinedFields()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\tinclude_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');\n\t\tinclude_once('Modules/Course/classes/Export/class.ilCourseUserData.php');\n\t\t\n\t\t$all_required = true;\n\t\tforeach(ilCourseDefinedFieldDefinition::_getFields($this->obj_id) as $field_obj)\n\t\t{\n\t\t\t$required_given = false;\n\t\t\tswitch($field_obj->getType())\n\t\t\t{\n\t\t\t\tcase IL_CDF_TYPE_SELECT:\n\t\t\t\t\t$tmp_values = ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]);\n\t\t\t\t\t$tmp_values = explode('_', $tmp_values,2);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(isset($tmp_values[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_value = isset($tmp_values[1]) ? $tmp_values[1] : '';\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\tforeach((array) $field_obj->getValues() as $v)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($v == $tmp_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = $tmp_value;\n\t\t\t\t\t\t\t\t$required_given = true;\n\t\t\t\t\t\t\t\tbreak;\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\tbreak;\n\t\t\t\t\n\t\t\t\tcase IL_CDF_TYPE_TEXT:\n\t\t\t\t\t$value = ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]);\n\t\t\t\t\tif($value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$required_given = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());\n\t\t\t$course_user_data->setValue($value);\n\t\t\t$course_user_data->update();\n\t\t\t\n\t\t\tif($field_obj->isRequired() and !$required_given)\n\t\t\t{\n\t\t\t\t$all_required = false;\n\t\t\t}\n\t\t}\t\n\t\treturn $all_required;\n\t}", "function testBadData3(){\n $this->get(VIRTUAL_PATH. '../../foodTruck.php');\n $this->setField('itemType[]','burrito');\n $this->setField('quantity[\"burrito\"]', -1);\n $this->clickSubmitByName(\"submit\");\n $this->assertResponse(200);\n $this->assertText(\"Please select at least one item to purchase\");\n }", "function getvalidvalues($flds, $data) {\n $tmpdata = array();\n foreach ($flds as $fld) {\n if (isset($data[$fld]) && !empty($data[$fld])) {\n $tmpdata[$fld] = $data[$fld];\n }\n }\n\n return $tmpdata;\n}", "function getEmptyFields()\n {\n $fieldsList = [];\n if (!isset($_POST['content']) || ($_POST['content'] == '')) {\n array_push($fieldsList, \"content=0\");\n }\n if (!isset($_POST['sub-category']) || ($_POST['sub-category'] == '')) {\n array_push($fieldsList, \"sub-category=0\");\n }\n\n if (!isset($_POST['tag-list']) || ($_POST['tag-list'] == '')) {\n array_push($fieldsList, \"tag-list=0\");\n }\n\n return $fieldsList;\n\n }", "function hook_field_is_empty($item, $field) {\n if (empty($item['value']) && (string) $item['value'] !== '0') {\n return TRUE;\n }\n return FALSE;\n}", "function dataConsideredEmpty( $data, $repeatCounter )\r\n\t{\r\n\t\tforeach($data as $d) {\r\n\t\t\tif ($d != '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function testModifyDataWithoutItems()\n {\n $data = ['items' => null];\n $this->complexModifier->expects($this->never())->method('modifyData');\n $this->assertEquals($data, $this->modifier->modifyData($data));\n }", "function system_is_item_array_empty(array $t){\n\tforeach($t as $item){\n\t\tif($item == \"\" || empty($item)){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public abstract function init($selfitemisempty = false);", "public function getExistencias($item,$sitio,$almacen,$localidad,$documenType,$company) {\n $query = $this->_adapter->prepare(\"EXECUTE devGetExistenciasExiCompany ?,?,?,?,?,?;\");\n $query->bindParam(1,$item);\n $query->bindParam(2,$sitio);\n $query->bindParam(3,$almacen);\n $query->bindParam(4,$localidad);\n $query->bindParam(5,$documenType);\n $query->bindParam(6,$company);\n $query->execute();\n $result = $query->fetchAll();\n if (empty($result)){ $datos['noresult'] = \"NoResults\"; }\n foreach ($result as $k => $v) { $datos[$k] = $v; }\n return json_encode(array('datos' => $datos));\n }", "public function testNoItemsView(): void\n {\n // setup\n $listBuilder = new ListBuilder\\Common($this->getFields(), new FakeAdapter([]));\n $listBuilder->setNoItemsView('no items!');\n $listBuilder->listTitle = 'title';\n\n // test body\n $result = $listBuilder->listingForm();\n\n // assertions\n $this->assertStringContainsString('title', $result);\n $this->assertStringContainsString('Ни одной записи не найдено', $result);\n $this->assertStringContainsString('no items!', $result);\n }", "function testBadData(){\n $this->get(VIRTUAL_PATH. '../../foodTruck.php');\n $this->setField('itemType[]','burrito');\n $this->setField('quantity[\"burrito\"]','r');\n $this->clickSubmitByName(\"submit\");\n $this->assertResponse(200);\n $this->assertText(\"Please select at least one item to purchase\");\n }", "function testBadData2(){\n $this->get(VIRTUAL_PATH. '../../foodTruck.php');\n $this->setField('itemType[]','burrito');\n $this->setField('quantity[\"burrito\"]', 0);\n $this->clickSubmitByName(\"submit\");\n $this->assertResponse(200);\n $this->assertText(\"Please select at least one item to purchase\");\n }", "public function stdWrap_ifBlankDataProvider() {}", "function dataConsideredEmpty($data, $repeatCounter)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\tforeach ($data as $d) {\r\n\t\t\tif ($d != '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function testItemsValidations()\n {\n $I = $this->tester;\n $this->authByUsername('driverPortland');\n\n // Valid items\n $validItems = [\n [\n 'id' => 6,\n 'status' => 'short',\n 'initials' => 'AB'\n ],\n [\n 'id' => 15,\n 'status' => 'refused',\n 'initials' => 'KS'\n ], \n ];\n\n // Bad items\n $badItems = [\n 'id' => [4, 5, 222, 'asdasdasd', null, 0, true, false],\n 'status' => [123, '123', null, true, false, 123123, 'text', 0],\n 'initials' => ['ABC', true, false, null, 123, 0]\n ];\n\n // Success items\n $successItems = [\n 'status' => ['short', 'refused', 'received'],\n 'initials' => ['KG', 'DB', 'JS']\n ];\n\n // Check number of items\n $items = $validItems;\n foreach($items as $key => $item) {\n $tempFields = $this->_successAttributes;\n if ($key == 0) {\n $tempFields['items'] = array_merge($validItems, [['id' => 12]]);\n } else {\n unset($items[$key]);\n $tempFields['items'] = $items;\n }\n \n // Send and validate response\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType([\n 'field' => 'string',\n 'message' => 'string'\n ], '$.*');\n $I->seeResponseContainsJson([\n ['field' => 'items']\n ]);\n }\n\n // Check bad validate of each item\n foreach($validItems as $itemKey => $fields) {\n foreach($fields as $field => $fieldValue) {\n foreach($badItems[$field] as $badValue) {\n $items = $validItems;\n $items[$itemKey][$field] = $badValue;\n $tempFields = $this->_successAttributes;\n $tempFields['items'] = $items;\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType([\n 'field' => 'string',\n 'message' => 'string'\n ], '$.*');\n $I->seeResponseContainsJson([\n ['field' => 'items']\n ]);\n }\n }\n }\n\n // Check success validate of each item\n foreach($validItems as $itemKey => $fields) {\n foreach($fields as $field => $fieldValue) {\n if ($field == 'id') {\n continue;\n }\n foreach($successItems[$field] as $goodValue) {\n $items = $validItems;\n $items[$itemKey][$field] = $goodValue;\n $tempFields = $this->_successAttributes;\n $tempFields['items'] = $items;\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType(self::rules());\n $I->seeResponseContainsJson([\n [$field => $goodValue]\n ]);\n }\n }\n }\n }", "public function unsuccessfulItems();", "function filterAll($item)\r\n {\r\n $item['name'] \t= JOSC_utils::filter($this->encodeData_Charset($item['name']));\r\n $item['title'] \t= JOSC_utils::filter($this->encodeData_Charset($item['title']));\r\n $item['comment'] = JOSC_utils::filter($this->encodeData_Charset($item['comment']));\r\n return $item;\r\n }", "function checkAllData($f,$new = 0){\n\t\tif(empty($f['project'])) return \"The field Project does not have to be null\";\n\t \treturn 0;\n\t}", "function ItemIsUnique($item)\n {\n foreach ($this->ItemData as $data => $value)\n {\n if (empty($this->ItemData[ $data ][ \"Unique\" ])) { continue; }\n if (empty($item[ $data ])) { continue; }\n\n $nitems=$this->MySqlNEntries(\"\",array($data => $item[ $data ]));\n if ($nitems>0)\n {\n\n $this->ApplicationObj->AddHtmlStatusMessage\n (\n \"Campo \".\n $this->ItemData[ $data ][ \"Name\" ].\n \" não é único - \".\n $this->ItemName\n );\n\n return FALSE; // return right away, minimizing mysql talks\n }\n }\n\n if (!empty($this->UniqueSqlWhere))\n {\n $nitems=$this->MySqlNEntries(\"\",$this->UniqueSqlWhere);\n\n if ($nitems>0)\n {\n if (!array($this->HtmlStatus))\n {\n $this->HtmlStatus=array($this->HtmlStatus);\n }\n\n $msg=$this->ItemName.\" \".$this->MyLanguage_GetMessage(\"IsNotUnique\");\n\n array_push($this->HtmlStatus,$msg);\n return FALSE; \n }\n \n }\n\n return TRUE;\n }", "function get_list_optional($sy_id,$student_id) {\n\t\t$cmd = \"SELECT $this->tblname.feeelement_id,title,feecategory_id,sum(payment) AS payment FROM $this->tblname,tblfeeelement\"\n\t\t\t. \" WHERE sy_id=$sy_id AND student_id=$student_id\"\n\t\t\t. \" AND $this->tblname.feeelement_id=tblfeeelement.feeelement_id\"\n\t\t\t. \" AND (fee_flag & \" . FEEFLAG_OPTIONALFEE . \")!=0\"\n\t\t\t. \" GROUP BY feeelement_id\";\n\t\treturn $this->query( $cmd );\n\t}", "public static function showUsedInfo($item, $fields)\n\t{\n\t\t$return = '';\n\t\t$used = false;\n\t\tif (isset($item['count']) && $item['count'] > 0) {\n\t\t\t$used = true;\n\t\t}\n\n\t\t$table = '';\n\t\tforeach ($fields as $tablename => $field) {\n\t\t\tif ($item[$tablename] !== null) {\n\t\t\t\t$used = true;\n\t\t\t\t$table = $tablename;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($item['usagecheck_s_id']) && $item['usagecheck_s_id'] > 0) {\n\t\t\t$used = true;\n\t\t}\n\n\t\tif (isset($item['usagecheck_metaArtIDs']) && $item['usagecheck_metaArtIDs'] > 0) {\n\t\t\t$used = true;\n\t\t}\n\n\t\tif (isset($item['usagecheck_metaCatIDs']) && $item['usagecheck_metaCatIDs'] > 0) {\n\t\t\t$used = true;\n\t\t}\n\n\t\tif (isset($item['usagecheck_metaMedIDs']) && $item['usagecheck_metaMedIDs'] > 0) {\n\t\t\t$used = true;\n\t\t}\n\n\t\t$errors = array();\n\t\tif ($used === false) {\n\t\t\t$errors[] = rex_i18n::rawMsg('akrys_usagecheck_images_msg_not_used');\n\t\t}\n\n\t\tif (!Medium::exists($item)) {\n\t\t\t$errors[] = rex_i18n::rawMsg('akrys_usagecheck_images_msg_not_found');\n\t\t}\n\n\t\t//Ob ein Medium lt. Medienpool in Nutzung ist, brauchen wir nur zu prüfen,\n\t\t//wenn wir glauben, dass die Datei ungenutzt ist.\n\t\t//Vielleicht wird sie ja dennoch verwendet ;-)\n\t\t//\n\t\t//Hier wird die Funktion verwendet, die auch beim Löschen von Medien aus dem Medienpool aufgerufen\n\t\t//wird.\n\t\t//\n\t\t//ACHTUNG:\n\t\t//XAMPP 5.6.14-4 mit MariaDB unter MacOS hat ein falsch kompiliertes PCRE-Mdoul an Bord, so dass\n\t\t//alle REGEXP-Abfragen abstürzen.\n\t\t//Der Fehler liegt also nicht hier, und auch nicht im Redaxo-Core\n\t\tif (!$used) {\n\t\t\t$used = rex_mediapool_mediaIsInUse($item['filename']);\n\n\t\t\tif ($used) {\n\t\t\t\t$errors[] = rex_i18n::rawMsg('akrys_usagecheck_images_msg_in_use');\n\t\t\t}\n\t\t}\n\n\t\tif (count($errors) > 0) {\n\t\t\t$fragment = new rex_fragment(['msg' => $errors]);\n\t\t\t$return = $fragment->parse('msg/error_box.php');\n\t\t} else {\n\t\t\t$fragment = new rex_fragment(['msg' => [rex_i18n::rawMsg('akrys_usagecheck_images_msg_used')]]);\n\t\t\t$return = $fragment->parse('msg/info_box.php');\n\t\t}\n\t\treturn $return;\n\t}", "function checkGeneralItemIfExist($id,$data0,$table)\r\n\t{\r\n\t\t$item =array(); // use it to avoid return false from database\r\n\t\t$cols=$this->getGeneralColums($table);\r\n\t\t$PRI=$cols['primaryKeys'];\r\n\t\t$PRI=$PRI[0];\r\n\t\t$data0[$PRI]=$id;\r\n\t\t$indexes=$this->getGeneralUniqueIndexes($table);\r\n\r\n\t\tforeach($indexes as $ind =>$cols2)\r\n\t\t{\r\n\t\t\t$data=array();\r\n\t\t\t$missingInfo=false;\r\n\t\t\tforeach ($cols2 as $ind2 => $values)\r\n\t\t\t{\r\n\t\t\t\tif(!isset($data0[$values['Column_name']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$missingInfo=true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$data[$values['Column_name']]=$data0[$values['Column_name']];\r\n\t\t\t}\r\n\t\t\tif(!$missingInfo && $ind!=\"PRIMARY\") //break if not all the colums of the index_key given\r\n\t\t\t{\r\n\t\t\t\tif(!is_array($data))\r\n\t\t\t\t{\r\n\t\t\t\t\t$data= array();\r\n\t\t\t\t}\r\n\t\t\t\t$fillSQL='';\r\n\t\t\t\tforeach ($data as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t\t$returnA[]=$key;\r\n\t\t\t\t\tif($fillSQL=='')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$fillSQL=$fillSQL.'WHERE (`'.$key.'`=\"'.addslashes($value).'\" ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$fillSQL=$fillSQL.'AND `'.$key.'`=\"'.addslashes($value).'\" ';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($fillSQL!='')\r\n\t\t\t\t{\r\n\t\t\t\t\t$fillSQL=$fillSQL.') AND `'.$PRI.'`!=\"'.$id.'\"';\r\n\t\t\t\t\t$sql = 'SELECT '.$PRI.' FROM `'.$table.'` '.$fillSQL; // change by function\r\n\t\t\t\t\t//if($table==\"member\") echo $sql.'<br/>';\r\n\t\t\t\t\t$result = mysqli_query($this->cnx,$sql); // use it to fetch\r\n\t\t\t\t\twhile($row = mysqli_fetch_assoc($result))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$item[]='('.implode(',',$returnA).')'; // return to user like \"(phone,email,name)\"\r\n\t\t\t\t\t\tunset($returnA);// not to effect the new loop term\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if($table==\"member\") $this->show($item);\r\n\t\tif(count($item))\r\n\t\t{\r\n\t\treturn implode(' Or ',$item);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $item;\r\n\t\t}\r\n\t}", "public static function notifyAboutCompleteItems($items)\n {\n if (!count($items)) {\n return;\n }\n if (!is_array($items)) {\n $items = array($items);\n }\n $csm = new waContactSettingsModel();\n $q = \"SELECT\n cs1.contact_id contact_id,\n cs2.value setting\n FROM wa_contact_settings cs1\n LEFT JOIN wa_contact_settings cs2 ON\n cs1.contact_id = cs2.contact_id\n AND cs2.app_id = s:app_id\n AND cs2.name = 'email_complete_item'\n AND cs2.value IN (i:setting)\n WHERE\n cs1.app_id = s:app_id\n AND cs1.name = 'email_complete_item_on'\n AND cs1.value = 1\";\n $users = $csm->query(\n $q,\n array(\n 'app_id' => wa()->getApp(),\n 'setting' => array(\n pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_I_CREATED,\n pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_I_FAVORITE,\n pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_IN_FAVORITE_LIST,\n pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ANY_ITEM,\n )\n )\n )->fetchAll('contact_id');\n\n $lm = new pocketlistsListModel();\n $im = new pocketlistsItemModel();\n\n $subject = 'string:{if !$complete}🚫{else}✅{/if} {str_replace(array(\"\\r\", \"\\n\"), \" \", $item.name_original)|truncate:64}';\n // todo: refactor\n foreach ($users as $user_id => $user) { // foreach user\n $filtered_items = array();\n switch ($user['setting']) {\n case pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_I_CREATED:\n foreach ($items as $item) { // filter items according to settings\n if ($item['contact_id'] == $user_id && // created by mine\n $item['complete_contact_id'] != $user_id && // completed not by me\n (\n ($item['list_id'] && pocketlistsRBAC::canAccessToList($item['list_id'], $user_id)) || ( // not from NULL-list\n $item['list_id'] == null && ( // OR from NULL-list,\n isset($item['assigned_contact_id']) && $item['assigned_contact_id'] == $user_id || // but assigned to this user\n $item['contact_id'] == $user_id // OR created by user\n )\n )\n )\n ) {\n $filtered_items[$item['id']] = $item;\n $c = new waContact($item['complete_contact_id']);\n $filtered_items[$item['id']]['complete_contact_name'] = $c->getName();\n }\n }\n if ($filtered_items) {\n $item = reset($filtered_items);\n $list = $lm->getById($item['list_id']);\n $items_left = count($im->getUndoneByList($list['id'], false));\n self::sendMail(\n array(\n 'contact_id' => $user_id,\n 'subject' => $subject,\n 'body' => wa()->getAppPath('templates/mails/completeanyitem.html'),\n 'variables' => array(\n 'n' => $items_left,\n 'list' => $list,\n 'list_url' => '#/list/' . $list['id'] . '/',\n 'complete' => $item['status'],\n 'item' => $item\n ),\n ),\n self::getBackendUrl($user_id)\n );\n }\n break;\n case pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_I_FAVORITE:\n $ufm = new pocketlistsUserFavoritesModel();\n $user_items = $ufm->query(\n \"SELECT item_id FROM {$ufm->getTableName()} WHERE contact_id = {$user_id}\"\n )->fetchAll('item_id');\n foreach ($items as $item) {\n if (array_key_exists($item['id'], $user_items) &&\n $item['complete_contact_id'] != $user_id && (\n ($item['list_id'] && pocketlistsRBAC::canAccessToList($item['list_id'], $user_id)) || ( // not from NULL-list\n $item['list_id'] == null && ( // OR from NULL-list,\n isset($item['assigned_contact_id']) && $item['assigned_contact_id'] == $user_id || // but assigned to this user\n $item['contact_id'] == $user_id // OR created by user\n )\n )\n )\n ) {\n $filtered_items[$item['id']] = $item;\n $c = new waContact($item['complete_contact_id']);\n $filtered_items[$item['id']]['complete_contact_name'] = $c->getName();\n }\n }\n if ($filtered_items) {\n $item = reset($filtered_items);\n $list = $lm->getById($item['list_id']);\n $items_left = count($im->getUndoneByList($list['id'], false));\n self::sendMail(\n array(\n 'contact_id' => $user_id,\n 'subject' => $subject,\n 'body' => wa()->getAppPath('templates/mails/completeanyitem.html'),\n 'variables' => array(\n 'n' => $items_left,\n 'list' => $list,\n 'list_url' => '#/list/' . $list['id'] . '/',\n 'complete' => $item['status'],\n 'item' => $item\n ),\n ),\n self::getBackendUrl($user_id)\n );\n }\n break;\n case pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ITEM_IN_FAVORITE_LIST:\n $ufm = new pocketlistsUserFavoritesModel();\n $user_lists = $ufm->query(\n \"SELECT i.key_list_id FROM {$ufm->getTableName()} uf JOIN pocketlists_item i ON uf.item_id = i.id AND i.key_list_id > 0 WHERE uf.contact_id = {$user_id}\"\n )->fetchAll('key_list_id');\n foreach ($items as $item) {\n if (array_key_exists($item['list_id'], $user_lists) &&\n $item['complete_contact_id'] != $user_id && (\n ($item['list_id'] && pocketlistsRBAC::canAccessToList($item['list_id'], $user_id)) || ( // not from NULL-list\n $item['list_id'] == null && ( // OR from NULL-list,\n isset($item['assigned_contact_id']) && $item['assigned_contact_id'] == $user_id || // but assigned to this user\n $item['contact_id'] == $user_id // OR created by user\n )\n )\n )\n ) {\n $filtered_items[$item['id']] = $item;\n $c = new waContact($item['complete_contact_id']);\n $filtered_items[$item['id']]['complete_contact_name'] = $c->getName();\n }\n }\n if ($filtered_items) {\n $item = reset($filtered_items);\n $list = $lm->getById($item['list_id']);\n $items_left = count($im->getUndoneByList($list['id'], false));\n self::sendMail(\n array(\n 'contact_id' => $user_id,\n 'subject' => $subject,\n 'body' => wa()->getAppPath('templates/mails/completeanyitem.html'),\n 'variables' => array(\n 'n' => $items_left,\n 'list' => $list,\n 'list_url' => '#/list/' . $list['id'] . '/',\n 'complete' => $item['status'],\n 'item' => $item\n ),\n ),\n self::getBackendUrl($user_id)\n );\n }\n break;\n case pocketlistsUserSettings::EMAIL_WHEN_SOMEONE_COMPETES_ANY_ITEM:\n foreach ($items as $item) { // filter items according to settings\n if ($item['complete_contact_id'] != $user_id && (\n ($item['list_id'] && pocketlistsRBAC::canAccessToList($item['list_id'], $user_id)) || ( // not from NULL-list\n $item['list_id'] == null && ( // OR from NULL-list,\n isset($item['assigned_contact_id']) && $item['assigned_contact_id'] == $user_id || // but assigned to this user\n $item['contact_id'] == $user_id // OR created by user\n )\n )\n )\n ) { // completed not by me & not from NULL-list\n $filtered_items[$item['id']] = $item;\n $c = new waContact($item['complete_contact_id']);\n $filtered_items[$item['id']]['complete_contact_name'] = $c->getName();\n }\n }\n if ($filtered_items) {\n $item = reset($filtered_items);\n $list = $lm->getById($item['list_id']);\n $items_left = 0;\n if ($list) {\n $items_left = count($im->getUndoneByList($list['id'], false));\n }\n self::sendMail(\n array(\n 'contact_id' => $user_id,\n 'subject' => $subject,\n 'body' => wa()->getAppPath('templates/mails/completeanyitem.html'),\n 'variables' => array(\n 'n' => $items_left,\n 'list' => $list,\n 'list_url' => $list ? '#/list/' . $list['id'] . '/' : false,\n 'complete' => $item['status'],\n 'item' => $item\n ),\n ),\n self::getBackendUrl($user_id)\n );\n }\n break;\n }\n }\n }", "function entity_metadata_field_file_validate_item($items, $context) {\n // Allow NULL values.\n if (!isset($items)) {\n return TRUE;\n }\n\n // Stream-line $items for multiple vs non-multiple fields.\n $items = !entity_property_list_extract_type($context['type']) ? array($items) : (array) $items;\n\n foreach ($items as $item) {\n // File-field items require a valid file.\n if (!isset($item['fid']) || !file_load($item['fid'])) {\n return FALSE;\n }\n if (isset($context['property info']['display']) && !isset($item['display'])) {\n return FALSE;\n }\n }\n return TRUE;\n}", "function check_item_data()\r\n{\r\n\tif (!check_num('qty',0))\r\n\t{\r\n\t\tdisplay_error(_(\"The quantity entered is negative or invalid.\"));\r\n\t\tset_focus('qty');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (!check_num('std_cost', 0))\r\n\t{\r\n\t\tdisplay_error(_(\"The entered standard cost is negative or invalid.\"));\r\n\t\tset_focus('std_cost');\r\n\t\treturn false;\r\n\t}\r\n\r\n \treturn true;\r\n}", "function ItemTable($edit=0,$item=array(),$noid=FALSE,$rdatalist=array(),$tbl=array(),\n $plural=FALSE,$includename=TRUE,$includecompulsorymsg=TRUE,$precgikey=\"\")\n {\n if (empty($item)) { $item=$this->ItemHash; }\n $item=$this->TestItem($item);\n\n $datalist=array_keys($this->ItemData);\n $datalist=preg_grep('/^[AMC]Time$/',$datalist,PREG_GREP_INVERT);\n if (\n count($rdatalist)==0\n &&\n count($this->ItemEditData)>0\n )\n {\n $rdatalist=$this->ItemEditData;\n }\n\n if (count($rdatalist)==0) { $rdatalist=$datalist; }\n if ($noid) { $rdatalist=preg_grep('/^ID$/',$rdatalist,PREG_GREP_INVERT); }\n\n if ($includename)\n {\n array_push\n (\n $tbl,\n array\n (\n $this->MultiCell\n (\n $this->MyMod_Item_Anchor($item).\n $this->H(5,$this->MyMod_Item_Name_Get($item)),\n 2\n )\n )\n );\n }\n\n if (!empty($item[ \"ID\" ] ) && empty($this->Item_Data_Edit_Control[ $item[ \"ID\" ] ]))\n {\n $this->Item_Data_Edit_Control[ $item[ \"ID\" ] ]=array();\n }\n \n $compulsories=0;\n foreach ($rdatalist as $data)\n {\n $redit=$this->MyMod_Item_Table_Edit($item,$edit,$data);\n $hidden=FALSE;\n if (\n isset($this->ItemData[ $data ][ \"Hidden\" ]) &&\n $this->ItemData[ $data ][ \"Hidden\" ]\n )\n {\n $hidden=TRUE;\n }\n\n $this->MyMod_Item_Table_Edit_Control_Set($item,$data);\n if (\n !$hidden &&\n $data!=\"No\" &&\n isset($this->ItemData[ $data ])\n )\n {\n $row=array();\n $this->ItemTableRow($redit,$item,$data,$compulsories,$row,$plural,$precgikey);\n if (count($row)>0) { array_push($tbl,$row); }\n }\n elseif (isset($this->Actions[ $data ]))\n {\n $row=array\n (\n $this->DecorateDataTitle\n (\n $this->GetRealNameKey($this->Actions[ $data ]).\":\"\n ),\n $this->MyActions_Entry($data,$item)\n );\n if (count($row)>0) { array_push($tbl,$row); }\n }\n elseif (method_exists($this,$data))\n {\n array_push\n (\n $tbl,\n array\n (\n $this->Span($this->$data().\":\",array(\"CLASS\" => 'datatitlelink')),\n $this->Span($this->$data($item),array(\"CLASS\" => 'data'))\n )\n );\n }\n\n }\n\n if ($includecompulsorymsg && $compulsories>0 && $edit==1)\n {\n array_push\n (\n $tbl,\n array\n (\n $this->MyMod_Data_Compulsory_Message()\n )\n );\n }\n\n\n return $tbl;\n }", "function getDatosDisponibilidadPonderadaPorItem() {\n\t\tforeach (Utiles::getElementsByArrayTagName($this->dom, array(\"detalles\", \"detalle\")) as $detalle_obj) {\n\t\t\t$objetivo = & $this->__objetivos[$detalle_obj->getAttribute('objetivo_id')];\n\t\t\t\n\t\t\t/* LISTA DE MONITORES DEL OBJETIVO */\n\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_obj, array(\"detalles\", \"detalle\")) as $detalle_mon) {\n\t\t\t\tif (isset($this->__monitores[$detalle_mon->getAttribute('nodo_id')])) {\n\t\t\t\t\n\t\t\t\t$monitor = clone $this->__monitores[$detalle_mon->getAttribute('nodo_id')];\n\t\t\t\t\n\t\t\t\t/* LISTA DE PASOS DEL OBJETIVO POR MONITOR */\n\t\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_mon, array(\"detalles\", \"detalle\")) as $detalle_pas) {\n\t\t\t\t\tif (isset($objetivo->__pasos[$detalle_pas->getAttribute('paso_orden')])) {\n\t\t\t\t\t\t$paso = clone $objetivo->__pasos[$detalle_pas->getAttribute('paso_orden')];\n\n\t\t\t\t\t\t/* LISTA DE PASOS DEL OBJETIVO POR MONITOR */\n\t\t\t\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_pas, array(\"detalles\", \"detalle\")) as $detalle_pon) {\n\t\t\t\t\t\t\t$ponderacion = clone $this->__ponderaciones[$detalle_pon->getAttribute('item_id')];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* LISTA DE PORCENTAJES DE EVENTOS DEL PASO */\n\t\t\t\t\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_pon, array(\"estadisticas\", \"estadistica\")) as $dato_pas) {\n\t\t\t\t\t\t\t\t$this->tiene_datos = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$evento = clone $this->__eventos[$dato_pas->getAttribute('evento_id')];\n\t\t\t\t\t\t\t\t$evento->porcentaje = $dato_pas->getAttribute('porcentaje');\n\t\t\t\t\t\t\t\t$evento->duracion = $dato_pas->getAttribute('duracion');\n\t\t\t\t\t\t\t\t$ponderacion->__eventos[$evento->evento_id] = $evento;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$paso->__ponderaciones[$ponderacion->ponderacion_item_id] = $ponderacion;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tksort($paso->__eventos);\n\t\t\t\t\t\t$monitor->__pasos[] = $paso;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$objetivo->__monitores[$monitor->monitor_id] = $monitor;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function dataCheck() {\n\t\tif( FALSE === isset( $this->data['egResult'] ) ) {\n\t\t\t$this->data['egResult'] = array();\n\t\t}\n\t\tif( FALSE === isset( $this->data['fields'] ) ) {\n\t\t\t$this->data['fields'] = self::DEFAULT_FIELDS;\n\t\t}\n\t}", "private function check_if_field_item_exists($section, $items, $fields)\n {\n }", "public function itemDataAdicional($item) {\n\n }", "#[@test]\n public function emptyValueForMultipleSelection() {\n $this->loadFromRequest(array(\n 'orderdate' => '',\n 'shirt_size' => 'S',\n 'shirt_qty' => 1,\n 'notify_me' => array(),\n 'person_ids' => array('1549', '1552')\n ));\n $this->assertFalse($this->handler->errorsOccured());\n $this->assertEquals(array(), $this->wrapper->getValue('notify_me'));\n }", "public function emptyCheck($data){\n\t\t\t$error = array();\n\t\t\tif( !is_array($data) ) $data = array($data);\n\t\t\tforeach ($data as $k => $v) {\n\t\t\t\tif( $v === \"\" ) $error[$k] = $k.'_empty';\n\t\t\t}\n\t\t\treturn $error;\n\t\t}", "public function testGetDataMultipleRecordsWithNoSpecificDataField()\n\t{\n\t\t$testData = array(\n\t\t\t'test',\n\t\t\t'data'\n\t\t);\n\t\t\n\t\t// set data\n\t\t$this->data->setData($testData);\n\t\t\n\t\t// set data field\n\t\t$this->data->dataField = '';\n\t\t\n\t\t$this->assertEquals($testData, $this->data->getData(false));\n\t}", "public function hasItemdata(){\n return $this->_has(12);\n }", "abstract public function hasMultipleItems();", "public function get_unested_item_lists()\n {\n\n \t$tableName = $this->_wpdb->prefix . \"cil_listInfo\";\n\n \t$sql = \"SELECT * FROM $tableName WHERE nestedIn_id IS NULL ORDER BY list_index\";\n\n\t\treturn $this->_wpdb->get_results($sql);\n\n }", "public function set_data_empty() {\n\t\t$this->data = array();\n\t\tforeach ($this->fields as $field) {\n\t\t\t$this->data[$field] = null;\n\t\t}\n\t\t$this->data['set_from'] = 'empty';\n\t}", "function ItemsForm_AddItemTestUniqueData($newitem)\n {\n $nitems=0;\n $nonuniquedatas=array();\n\n foreach ($this->Args[ \"UniqueDatas\" ] as $data)\n {\n $rnitems=$this->MySqlNEntries(\"\",array($data => $newitem[ $data ]));\n if ($rnitems>0)\n {\n array_push($nonuniquedatas,$data);\n $nitems+=$rnitems;\n }\n }\n\n if ($nitems>0) \n {\n $this->ItemsForm_AddMessage\n (\n \"Chaves SQL: \".\n join(\", \",$nonuniquedatas).\n \" não única(s).\".\n $this->ItemName.\n \".\"\n );\n\n return FALSE;\n }\n\n return TRUE;\n }", "public function getAll($item) {\n\t\t\n\t\tswitch($item) {\n\t\t\tcase 'participant' :\n\t\t\t\t$select = $this->_db->select()\t\n\t\t\t\t\t\t\t->from(array('document' => 'document'))\n\t\t\t\t\t\t\t->joinLeft(array('participant' => 'participant'), 'participant.participant_code = document.document_item')\n\t\t\t\t\t\t\t->joinLeft('participantlogin', 'participantlogin.participant_code = participant.participant_code and participantlogin_deleted = 0', array('participantlogin_type' =>new Zend_Db_Expr('GROUP_CONCAT(DISTINCT participantlogin.participantlogin_type)')))\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t->joinLeft(array('areapost' => 'areapost'), 'areapost.areapost_code = document.areapost_code')\n\t\t\t\t\t\t\t->where('document.document_type = ? and participant_deleted = 0', $item)\n\t\t\t\t\t\t\t->group('participant.participant_code');\n\t\t\tbreak;\n\t\t\tcase 'payment' :\n\t\t\t\t$select = $this->_db->select()\n\t\t\t\t\t\t\t->from(array('document' => 'document'))\n\t\t\t\t\t\t\t->joinLeft(array('booking' => 'booking'), 'booking.booking_code = document.document_item')\n\t\t\t\t\t\t\t->where('document.document_type = ? and participant_deleted = 0', $item);\t\t\t\n\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\t$select = $this->_db->select()\t\n\t\t\t\t\t\t\t->from(array('document' => 'document'))\n\t\t\t\t\t\t\t->where('document.document_code = ?', $code);\n\t\t\tbreak;\t\t\t\t\n\t\t}\n\t\t\n\t\t$result = $this->_db->fetchAll($select);\n\t\treturn ($result == false) ? false : $result = $result;\t \n\t}", "function checkItems( &$items, $show_tax=false )\n { \t\n \tif (empty($items)) { return array(); }\n \t\n \tTienda::load('TiendaHelperUser', 'helpers.user');\n \tTienda::load('TiendaHelperTax', 'helpers.tax');\n \t\n\t\t\t\tif ( $show_tax )\n\t\t \t$taxes = TiendaHelperTax::calculateTax( $items, 2 );\n\t\t \t\n\t\t $subtotal = 0;\n\t\t\t\tforeach( $items as $item )\n\t\t\t\t{\n\t\t\t\t\tif( $show_tax )\n\t\t\t\t\t{\n \t$item->product_price = $item->product_price + $taxes->product_taxes[$item->product_id];\n \t$item->taxtotal = $taxes->product_taxes[$item->product_id];\n\t\t\t\t\t}\n \t\n \t$item->subtotal = $item->product_price * $item->product_qty;\t\n \t$subtotal = $subtotal + $item->subtotal;\t\t\n\t\t\t\t}\n \t////////////////\n $cartObj = new JObject();\n $cartObj->items = $items;\n\t \t$cartObj->subtotal = $subtotal;\n return $cartObj;\n }", "public function add_item_not_packed( $item ){\n\t\t$this->items_not_packed[] = $item;\n\t\t\n\t\t$this->calculate_percent();\n\t\t\n\t}", "function copper_pipes_and_fittings_inventory_without_description() {\n\n\t// pull our entire inventory of copper pipes and fittings //\n\t$inventory = copper_pipes_and_fittings_inventory();\n\t\n\t// container where we duplicate our inventory of copper pipes and fittings with omitted description //\n\t$inventory_without_details = array();\n\t\n\t// iterate through our inventory and duplicate all item attributes except for their description //\n\tforeach ($inventory as $key=>$value) {\n\t\tif (is_array($value)) {\n\t\t\t$inventory_item = array();\n\t\t\tforeach ($value as $subkey=>$subvalue) {\n\t\t\t\tif ( strcasecmp($subkey,'description') != 0 )\n\t\t\t\t\t$inventory_item[$subkey] = $subvalue;\n\t\t\t}\n\t\t\t$inventory_without_details[$key] = $inventory_item;\n\t\t}\n\t}\n\treturn $inventory_without_details;\t\n}", "protected static function getListForItemParams(CommonDBTM $item, $noent = false) {\n $params = parent::getListForItemParams($item, $noent);\n $params['SELECT'][] = self::getTable() . '.entities_id';\n $params['SELECT'][] = self::getTable() . '.is_recursive';\n $params['SELECT'][] = 'glpi_entities.completename AS completename';\n $params['LEFT JOIN']['glpi_entities'] = [\n 'FKEY' => [\n self::getTable() => 'entities_id',\n 'glpi_entities' => 'id'\n ]\n ];\n return $params;\n }", "protected function validateBlank($list)\n {\n $errors = array();\n $fields = $_POST;\n $emptyMsg = 'champ obligatoire';\n foreach ($fields as $field => $value) {\n if(empty($value) && in_array($field, $list)) {\n $errors[$field] = array();\n $errors[$field][] = $emptyMsg;\n }\n }\n\n return $errors;\n }", "public function get_items_to_validate()\n {\n }", "public function invalid($item)\n {\n\n }", "public function check_required_input_fields ($inputs,$msg=\"You Must Fill In All Fields\") {\r\n $errors=array();\r\n foreach($inputs as $input){\r\n \r\n if(empty($input)){\r\n $errors[]=$msg;\r\n break;\r\n }\r\n} \r\n return $errors; \r\n\r\n}", "private static function validize($item) {\n $collection = 'events';\n $fields = array('name', 'capacity', 'price', 'start_date', 'end_date');\n \n if(!$item) return false;\n if($item['valid']) return true;\n \n foreach($fields as $key) \n if($item[$key] === false) return false;\n \n // all clear!\n \n $update['valid'] = true;\n MongoLib::set($collection, $item['_id'], $update);\n \n return true;\n }", "function form_data( $item = '' )\n\t{\n\t\t// return item or FALSE\n\t\treturn isset($this->form_data[$item]) ? $this->form_data[$item] : FALSE;\n\t}", "protected static function _empty_form_elements(){\n\t\t$thelists = self::_merge_form_lists();\n\t\t$thekeys = array_keys($thelists);\n\t\t$thelists = array_fill_keys($thekeys, '');\n\t\treturn $thelists;\n\t}", "public function check_required($arr, $list)\n {\n // does not exist in the $arr, it is added to the $err array so that Smarty could know which fields\n // are missing: style=\"field {{if $err.some_value}}error{{/if}}\"\n $x = explode(\",\", $list);\n $err = array();\n foreach($x as $v){\n if (!$arr[$v]) {\n $err[] = $v;\n } else {\n if (is_array($arr[$v])) {\n if (!$arr[$v][0] && count($arr[$v]) == 1) {\n $err[] = $v;\n }\n }\n }\n }\n return $err;\n }", "public function orderhasitems() {\n\t\tif(isset($_POST['orderid'])) {\n\t\t\t$this->loadModel('TempOrder');\n\t\t\t$orderid = $_POST['orderid'];\n\t\t\t$temporder = $this->TempOrder->getTempOrder($orderid);\n\t\t}\n\n\t\tif(isset($_POST['deliverymin'])) { \n\t\t\t$deliveryminimum = $_POST['deliverymin'];\n\t\t}\n\n\t\tif(isset($_POST['ordertype'])) { \n\t\t\t$ordertype = $_POST['ordertype'];\n\t\t}\t\t\n\t\t\n\t\t\n\t\t$isValid = true;\n\t\tif(strtoupper($ordertype) == 'DELIVERY' && $temporder['tempordertotals']['subtotal'] <= 0) {\n\t\t\t$isValid = false;\n\t\t\t$errormsg = 'noitems';\n\t\t}\n\t\telse if(strtoupper($ordertype) == 'DELIVERY' && $temporder['tempordertotals']['subtotal'] < $deliveryminimum) {\n\t\t\t$isValid = false;\n\t\t\t$errormsg = 'deliveryminimum';\t\n\t\t} else if($temporder['tempordertotals']['subtotal'] == 0) {\n\t\t\t$isValid = false;\n\t\t\t$errormsg = 'noitems';\n\t\t}\n\t\t\n\t\tif($temporder && !empty($temporder['orderdetails'][0]['TempItem']) && $isValid)\t\n\t\t \t$this->set('temporder', 'items');\n\t\telse\n\t\t $this->set('temporder', $errormsg);\t\t\t\t \t\t\t \t\t \t\t \t\t\n\t\t\n\t}", "public function provideDataConsideredAsEmpty(){\n return [\n [null],\n [[]],\n [''],\n ['yes its not empty, but its also not an array!']\n ];\n }", "function init($item)\r\n\t{\r\n\t\t$item = trim($item);\r\n\t\tif ($this->parsePages($item))\r\n\t\t\treturn $this->return;\r\n\t\telseif ($this->completeField) //if true, return the complete item, else return only the first number found.\r\n\t\t\treturn array($item, FALSE);\r\n\t\telseif (preg_match(\"/([\\divxIVX]+)/i\", $item, $array))\r\n\t\t\treturn array($array[1], FALSE);\r\n\t\telse\r\n\t\t\treturn array(FALSE, FALSE);\r\n\t}", "private static function required($item, $fields, $message)\n {\n if (!array_key_exists($item, $fields)) {\n self::$errors[] = (empty($message) ? \"The field '$item' is required\" : $message);\n }\n }", "public function no_items() {\n\t\t_e( 'No items found.' );\n\t}", "public function no_items() {\n\t\t_e( 'No pickup-points avaliable.', 'samedaycourier' );\n\t}", "abstract protected function getBlankObjectPropertyValues();", "public function processExtraFields($item) {\n $arrayDeDatosExtra = [];\n if ($item[\"valueType\"] == \"arrayFields\") {\n $typedefKeyField = $this->getTypedefKeyField($item[\"value\"]);\n $renderKeyField = $this->getRenderKeyField($item[\"name\"]);\n $render = $this->createRender($typedefKeyField, $renderKeyField);\n $render->init($item[\"name\"], $renderKeyField['render']['styletype']);\n\n $arrayDataField = $this->getDataField($item[\"value\"]);\n if (!is_array($arrayDataField)) {\n $arrayDataField = json_decode($arrayDataField, true);\n }\n foreach ($arrayDataField as $key) {\n $arrDataField[$key['ordre']] = $key['nom'];\n }\n ksort($arrDataField);\n\n if ($item[\"type\"] == \"psdom\") {\n $arrDocument = array();\n foreach ($arrDataField as $dataField) {\n $this->_createSessionStyle($renderKeyField['render']);\n $jsonPart = $render->process($dataField, $item[\"name\"]);\n $this->_destroySessionStyle();\n if (($arrPart = json_decode($jsonPart))) //evita procesar los documentos inexistentes\n $arrDocument = array_merge($arrDocument, $arrPart);\n }\n $arrayDeDatosExtra[$item[\"name\"]] = json_encode($arrDocument);\n }\n else {\n // Renderiza cada uno de los documentos\n $htmlDocument = \"\";\n foreach ($arrDataField as $dataField) {\n $this->_createSessionStyle($renderKeyField['render']);\n $htmlDocument .= $render->process($dataField, $item[\"name\"]);\n $this->_destroySessionStyle();\n $toc[] = $this->cfgExport->toc[$item[\"name\"]];\n }\n // Une los TOCs de todos los documentos\n $aux = array();\n foreach ($toc as $t) {\n if ($t) $aux = array_merge($aux, $t);\n }\n $this->cfgExport->toc[$item[\"name\"]] = $aux;\n\n $arrayDeDatosExtra[$item[\"name\"]] = $htmlDocument;\n }\n }\n else {\n $arrayDeDatosExtra = parent::processExtraFields($item);\n }\n return $arrayDeDatosExtra;\n }", "private function renderListEmpty() {\n\t\t$template = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_RESULTS_LIST_EMPTY###');\n\t\t$markers = array(\n\t\t\t'MESSAGE' => $this->pi->pi_getLL('empty_list', 'Empty list', true),\n\t\t);\n\t\treturn $this->cObj->substituteMarkerArray($template, $markers, '###|###', false, true);\n\t}", "function aDBc_filter_results_in_all_items_array_free(&$aDBc_all_items, $aDBc_tables_name_to_optimize, $aDBc_tables_name_to_repair){\n\n\tif(function_exists('is_multisite') && is_multisite()){\n\n\t\t// Filter according to tables types (to optimize, to repair...)\n\t\tif(!empty($_GET['t_type']) && $_GET['t_type'] != \"all\"){\n\t\t\t$type = esc_sql($_GET['t_type']);\n\t\t\tif($type == 'optimize'){\n\t\t\t\t$array_names = $aDBc_tables_name_to_optimize;\n\t\t\t}else{\n\t\t\t\t$array_names = $aDBc_tables_name_to_repair;\n\t\t\t}\n\t\t\tforeach($aDBc_all_items as $item_name => $item_info){\n\t\t\t\tforeach($item_info['sites'] as $site_id => $site_item_info){\n\t\t\t\t\tif(!in_array($site_item_info['prefix'] . $item_name, $array_names)){\n\t\t\t\t\t\tunset($aDBc_all_items[$item_name]['sites'][$site_id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\n\t}else{\n\n\t\t// Prepare an array containing names of items to delete\n\t\t$names_to_delete = array();\n\n\t\t// Filter according to tables types (to optimize, to repair...)\n\t\t$filter_on_t_type = !empty($_GET['t_type']) && $_GET['t_type'] != \"all\";\n\t\tif($filter_on_t_type){\n\t\t\t$type = esc_sql($_GET['t_type']);\n\t\t\tif($type == \"optimize\"){\n\t\t\t\t$array_names = $aDBc_tables_name_to_optimize;\n\t\t\t}else{\n\t\t\t\t$array_names = $aDBc_tables_name_to_repair;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tforeach($aDBc_all_items as $item_name => $item_info){\n\t\t\tif($filter_on_t_type){\n\t\t\t\tif(!in_array($item_info['sites'][1]['prefix'] . $item_name, $array_names)){\n\t\t\t\t\tarray_push($names_to_delete, $item_name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Loop over the names to delete and delete them for the array\n\t\tforeach($names_to_delete as $name){\n\t\t\tunset($aDBc_all_items[$name]);\n\t\t}\n\n\t}\n\n}", "protected function _filledFields(array $data)\n {\n // Remove column-value pairs with null values.\n $nonNullData = array();\n foreach ( $data as $field => $value )\n {\n if ( $value !== null && $value != \"\" && $value != self::ANY_VAL )\n {\n $nonNullData[$field] = $value;\n }\n }\n return $nonNullData;\n }", "public function no_items() {\n\t\t_e( 'No licenses avaliable.', 'wpec-licensing' );\n\t}", "function required($required, $fields) {\n\t\t$missing = array();\n\t\t\n\t\tforeach ($required as $required_field) {\n\t\t\t// If the array key doesn't exist in our fieldset,\n\t\t\t// or the value is empty, add the key to our missing\n\t\t\t// fields array.\n\t\t\tif (!array_key_exists($required_field, $fields) ||\n\t\t\t\t\tempty($fields[$required_field])) {\n\t\t\t\t$missing[] = $required_field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $missing;\n\t}", "public function userBasicInfoWithParamtersEmpty()\n { \n $datasetOne = [\n [\n \"firstName\" => \"test1\",\n \"lastName\" => \"Sample1\", \n \"email\" => \"\",\n \"password\" => \"\"\n ]\n ];\n $datasetTwo = [\n [\n \"firstName\" => \"Test131#\", \n \"lastName\" => \"\",\n \"email\" => \"Test445Sample@@gmail.com\",\n \"password\" => \"\"\n ]\n ];\n $datasetThree = [\n [\n \"firstName\" => \"Test72@\",\n \"lastName\" => \"\",\n \"email\" => \"\",\n \"password\" => \"%6h3h\"\n ]\n ];\n $datasetFour = [\n [\n \"firstName\" => \"\",\n \"lastName\" => \"Sample91\", \n \"email\" => \"Sample91@yahoo.co.in\",\n \"password\" => \"\"\n ]\n ];\n $datasetFive = [\n [\n \"firstName\" => \"\", \n \"lastName\" => \"Sample65\",\n \"email\" => \"\",\n \"password\" => \"%7hIkTh0\"\n ]\n ];\n $datasetSix = [\n [\n \"firstName\" => \"\",\n \"lastName\" => \"\",\n \"email\" => \"TestSample657@hij..org\",\n \"password\" => \"%T3h\"\n ]\n ];\n \n return\n [\n 'negative test data set one' => $datasetOne,\n 'negative test data set two' => $datasetTwo,\n 'negative test data set three' => $datasetThree,\n 'negative test data set Four' => $datasetFour,\n 'negative test data set five' => $datasetFive,\n 'negative test data set six' => $datasetSix\n ];\n }", "public function testCheckFailsWithAnEmptyDataSet()\n\t{\n\t\t$this->object->check();\n\t}", "public function incomplete(Request $request){\n $this->validate($request, [\n 'data'=>'required',\n 'data.*'=>'required',\n 'data.*.item_id'=>'required|numeric|exists:items,id'\n ]);\n\n //collector checklist id for check items\n $checklist_ids = collect([]);\n\n //data for return\n $return = [];\n\n $completed = Carbon::now()->toDateTimeString();\n \n foreach($request->data as $dt){\n try{\n $item = Item::find($dt['item_id']);\n if($item->is_completed != false) {\n $item->is_completed = false;\n $item->completed_at = $completed;\n if($item->save()){\n $return[] = [\n 'id' => $item->id,\n 'item_id' => $item->id,\n 'is_completed' => $item->is_completed == 1 ? true : false,\n 'checklist_id' => $item->task_id,\n ];\n $checklist_ids = $checklist_ids->push($item->task_id);\n } else {\n return Json::exception('Cannot bulk update', null, null, 400);\n } \n } else {\n return Json::exception('item_id '. $dt['item_id'].' has been incompleted before', null, 400); \n }\n } catch (\\Illuminate\\Database\\QueryException $e){\n return Json::exception($e->getMessage(), env('APP_ENV', 'local') == 'local' ? $e : null, 500);\n } catch (\\Exception $e){\n return Json::exception($e->getMessage(), env('APP_ENV', 'local') == 'local' ? $e : null, 400);\n } \n }\n\n // //check all item complete for checklist\n foreach($checklist_ids->unique() as $chk){\n $task = Task::find($chk);\n $chkItem = $task->items; \n \n if($chkItem->count() == $chkItem->where('is_completed', 1)->count()){\n \n // check if task is_completed = false before complete the task\n if($task->is_completed != true){\n $task->is_completed = true;\n $task->completed_at = $completed;\n $task->save();\n }\n } \n }\n\n\n return Json::response($return, null, 200, null, 'single');\n }" ]
[ "0.5828304", "0.57543534", "0.5503311", "0.5500929", "0.54884285", "0.5402384", "0.5383416", "0.5362782", "0.5362295", "0.5319241", "0.5308312", "0.5285028", "0.5284196", "0.52634853", "0.5259597", "0.5258828", "0.5256567", "0.5227345", "0.52218413", "0.5221348", "0.5221348", "0.5221348", "0.5219904", "0.5219904", "0.5219904", "0.5219552", "0.52166325", "0.5215089", "0.5200262", "0.51837903", "0.51837903", "0.5153594", "0.51530415", "0.5142861", "0.5141069", "0.5133872", "0.5130763", "0.51247", "0.5123953", "0.5111997", "0.51053226", "0.5059455", "0.5051162", "0.5048268", "0.50378174", "0.5035566", "0.50354075", "0.5034224", "0.5023553", "0.5007061", "0.49999493", "0.49988887", "0.496386", "0.4958154", "0.49531308", "0.4943807", "0.49387076", "0.49336928", "0.4916433", "0.49114585", "0.4904027", "0.49028653", "0.49027526", "0.49012542", "0.48916727", "0.48860437", "0.48775595", "0.48687088", "0.48661014", "0.4860719", "0.4860363", "0.48535833", "0.48520845", "0.48385593", "0.48349348", "0.48341876", "0.482851", "0.48256436", "0.481656", "0.48150262", "0.48132405", "0.48047107", "0.47989038", "0.47937977", "0.47859362", "0.47800046", "0.47779486", "0.47774655", "0.4775303", "0.47743347", "0.47735527", "0.47735193", "0.47616982", "0.47615838", "0.47600615", "0.47591144", "0.47419575", "0.47372782", "0.4734069", "0.47318605" ]
0.868681
0
Tests whether $item[ $data ] is unique.
Проверяет, является ли $item[ $data ] уникальным.
function ItemDataIsUnique($item,$data) { if (!empty($item[ $data ]) && empty($this->ItemData[ $data ][ "Derived" ])) { $nitems=$this->MySqlNEntries("",array($data => $item[ $data ])); if ($nitems>1) { if (!array($this->HtmlStatus)) { $this->HtmlStatus=array($this->HtmlStatus); } $msg= $this->ItemName.": Campo ".$this->ItemData[ $data ][ "Name" ]. " não é único: ".$item[ $data ]; array_push($this->HtmlStatus,$msg); return FALSE; } } return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ItemIsUnique($item)\n {\n foreach ($this->ItemData as $data => $value)\n {\n if (empty($this->ItemData[ $data ][ \"Unique\" ])) { continue; }\n if (empty($item[ $data ])) { continue; }\n\n $nitems=$this->MySqlNEntries(\"\",array($data => $item[ $data ]));\n if ($nitems>0)\n {\n\n $this->ApplicationObj->AddHtmlStatusMessage\n (\n \"Campo \".\n $this->ItemData[ $data ][ \"Name\" ].\n \" não é único - \".\n $this->ItemName\n );\n\n return FALSE; // return right away, minimizing mysql talks\n }\n }\n\n if (!empty($this->UniqueSqlWhere))\n {\n $nitems=$this->MySqlNEntries(\"\",$this->UniqueSqlWhere);\n\n if ($nitems>0)\n {\n if (!array($this->HtmlStatus))\n {\n $this->HtmlStatus=array($this->HtmlStatus);\n }\n\n $msg=$this->ItemName.\" \".$this->MyLanguage_GetMessage(\"IsNotUnique\");\n\n array_push($this->HtmlStatus,$msg);\n return FALSE; \n }\n \n }\n\n return TRUE;\n }", "protected function isUnique($item)\n {\n return !in_array($item, $this->items);\n }", "function ItemsForm_AddItemTestUniqueData($newitem)\n {\n $nitems=0;\n $nonuniquedatas=array();\n\n foreach ($this->Args[ \"UniqueDatas\" ] as $data)\n {\n $rnitems=$this->MySqlNEntries(\"\",array($data => $newitem[ $data ]));\n if ($rnitems>0)\n {\n array_push($nonuniquedatas,$data);\n $nitems+=$rnitems;\n }\n }\n\n if ($nitems>0) \n {\n $this->ItemsForm_AddMessage\n (\n \"Chaves SQL: \".\n join(\", \",$nonuniquedatas).\n \" não única(s).\".\n $this->ItemName.\n \".\"\n );\n\n return FALSE;\n }\n\n return TRUE;\n }", "protected function is_unique($param)\n\t{\n\t\treturn $this->is_key($param);\n\t}", "function checkUnique($data, $fieldName) \n\t{\n\t\t $Product=$this->find(array(\"lower(Product.\".$fieldName.\")='\".low($data['product_name']).\"' and Product.is_deleted=0\"));\n\t\t if(!empty($Product))\n\t\t { \n\t\t if($Product['Product']['id']!=$this->id)\n\t\t\treturn false;\n\t\t\telse\n\t\t\treturn true;\t \n\t\t }\n\t\t else\n\t\t return true; \n\t}", "public function isItemUnique($value, $key = null) {\n\t\treturn $this->keyForValue($value) === false;\n\t}", "public function hasUnique()\n {\n return $this->get(self::UNIQUE) !== null;\n }", "public function isUnique() // {{{\n {\n return (bool) ($this->_flags & self::FIELD_UNIQUE);\n }", "function isUnique() { return!$this->failed; }", "function isUnique() { return!$this->failed; }", "private function isDublicate(array $data): bool\n {\n\n return false;\n }", "public function isUnique(): bool\n {\n return $this->is_unique;\n }", "public function isKeyUnique();", "public function isUnique() {\n return $this->unique;\n }", "public function getIsUnique()\n {\n return true;\n }", "public function valid_unique() {}", "function array_has_dupes($array)\n {\n return count($array) !== count(array_unique($array));\n }", "abstract public function IsUserPropertyValueUnique(int $uid = null, string $title, string $data) : bool;", "function isUnique($idElement){\n\t\trequire_once(\"arbre.php\");\n\t\tglobal \t$reslist;\n\t\treturn(in_array($idElement,$reslist['unique']));\n\t}", "public function isUnique(): bool\n {\n $result = $this->db->query(\"select count(*) as existing from `existing_pins` where pin = {$this->getPin()};\");\n $result = $result->fetchArray();\n return $result['existing'] === 0;\n }", "public function uniqueEmail($data)\n {\n\n $res = $this->get(\"SELECT COUNT(email) as `count` FROM $this->table WHERE email=?\", $data);\n\n if($res['count'] == 0){\n\n return true;\n }else{\n\n return false;\n }\n }", "public function checkUniquness($name)\n {\n $ids = [];\n foreach($this->jsoner->get() as $region) {\n $ids[] = $region->id;\n }\n sort($ids);\n\n\n\n //$str = '';\n //foreach ($titles as $title) {\n // $str .= '[\\'codes\\'=>[], \\'title\\'=>\\''.$title.'\\'], '.\"\\n\";\n //\n //}\n //\n //L::data($str);\n\n\n\n if($this->jsoner->isUnique('id')) {\n L::i('id', 'is unique');\n } else {\n L::e('id', 'is NOT unique');\n }\n }", "public function be_unique($arg) {\r\n if (in_array($arg, $this->_uniques)) {\r\n $this->form_validation->set_message('be_unique', '%s is not available.');\r\n return false;\r\n }\r\n return true;\r\n }", "public function action_unique()\n\t{\t\n\n\t\t$data = $_POST['data'];\n\n\t\tif (!isset($data)) return Resp::exec(Resp::invalid_request);\n\n\t\t$email = User::where_email($data)->first();\n\n\t\tif ($email) return false;\n\t\telse return true;\n\t}", "public function toBeUnique();", "public function hasUniqueHash()\n {\n $hash = $this->workingRecord->{$this->dbField} ?: $this->encrypt();\n\n return !($this->workingRecord->get()->filter($this->dbField, $hash)->exclude('ID', $this->workingRecord->ID)->exists());\n }", "final public static function isUnique(array $collection): bool\n {\n return count($collection) === count(array_unique($collection));\n }", "public function isURLUnique($slug, $item_id = null) {\r\n // avoid returning false positive\r\n if (isset($item_id)) {\r\n $items = BallotItem::model()->findAllByAttributes(\r\n array('slug' => $slug), 'id!=:item_id', array(':item_id' => $item_id)\r\n );\r\n } else {\r\n $items = BallotItem::model()->findAllByAttributes(\r\n array('slug' => $slug));\r\n }\r\n\r\n if ($items)\r\n return false;\r\n else\r\n return true;\r\n }", "public function isUnique($data)\n {\n try {\n $query = '\n\t SELECT \n COUNT(login) as isUnique\n FROM \n users\n WHERE\n login = :login\n\t ';\n $statement = $this->db->prepare($query);\n $statement->bindValue('login', $data['login'], \\PDO::PARAM_STR);\n $statement->execute();\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n return $result[0]['isUnique'] > 0 ? array() : $result;\n } catch (\\PDOException $e) {\n throw $e;\n }\n }", "function checkUnique($pdo, $thisUser)\n{\n $results = fetchData($pdo, \"user\");\n foreach ($results as $value) {\n if ($value[\"user_email\"] == $thisUser->__get(\"email\")) {\n return false;\n } else if ($value[\"user_name\"] == $thisUser->__get(\"username\")) {\n return false;\n }\n }\n return true;\n}", "public function checkUnique($value)\n {\n }", "public function check_duplicated($data, $menu_id = NULL)\r\n {\r\n $query_string = \"SELECT menu_id FROM menu WHERE menu_name=? AND menu_slug=?\";\r\n if ( !is_null($menu_id))\r\n {\r\n $query_string .= \" AND menu_id != '$menu_id'\";\r\n }\r\n $array_data = array(\r\n $data['menu_name'],\r\n $data['menu_slug']\r\n );\r\n $query = $this->db->query($query_string, $array_data);\r\n\r\n return $query->num_rows();\r\n }", "private function checkHasUniqueItem($params): void\n {\n foreach ($this->unique as $key) {\n $result = $this->select(\"COUNT(id) as count\", $key, $this->primary_key)->where($key, $params[$key])->get();\n if ($this->where_key != '') {\n if ($result['count'] && $result[$this->primary_key] != $this->where_key) {\n throw new StoragePdoException(\"'$key' has already been registered\");\n }\n } else if ($result['count']) {\n throw new StoragePdoException(\"'$key' has already been registered\");\n }\n }\n }", "function IsSimilarTo($item)\r\n {\r\n $same = 0;\r\n $diff = 0;\r\n if (!empty($this->Email())) { if ($this->Email() == $item->Email()) $same++; else if (!empty($item->Email())) $diff++; }\r\n if (!empty($this->DisplayName())) { if ($this->DisplayName() == $item->DisplayName()) $same++; else if (!empty($item->DisplayName())) $diff++; }\r\n if (!empty($this->Role())) { if ($this->Role() == $item->Role()) $same++; else if (!empty($item->Role())) $diff++; }\r\n if (!empty($this->Status())) { if ($this->Status() == $item->Status()) $same++; else if (!empty($item->Status())) $diff++; }\r\n if (!empty($this->Rsvp())) { if ($this->Rsvp() == $item->Rsvp()) $same++; else if (!empty($item->Rsvp())) $diff++; }\r\n if (!empty($this->Attended())) { if ($this->Attended() == $item->Attended()) $same++; else if (!empty($item->Attended())) $diff++; }\r\n \r\n return $diff == 0 && $same > 0;\r\n }", "public function getIsUnique()\n\t\t{\n\t\t\treturn $this->isUnique;\n\t\t}", "public function testUnique()\n {\n $same1 = $same2 = new \\stdClass;\n $different1 = new \\stdClass;\n $different2 = new \\stdClass;\n\n $actualUnique = SetFunctions::unique([$different1, $same1, $same2, $different2], new ObjectComparator);\n ksort($actualUnique); // sort order from spl_object_hash is not deterministic\n $expectedUnique = [ $different1, $same1, $different2 ];\n $this->assertEquals($expectedUnique, array_values($actualUnique));\n }", "static function uniqueTypesCheck($a_items)\n\t{\n\t\t$types = array();\n\t\tif (is_array($a_items))\n\t\t{\n\t\t\tforeach($a_items as $item)\n\t\t\t{\n\t\t\t\t$type = ilSkillTreeNode::_lookupType($item);\n\t\t\t\t$types[$type] = $type;\n\t\t\t}\n\t\t}\n\n\t\tif (count($types) > 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function getUnique(): bool\n {\n return $this->_unique;\n }", "protected function isSlugUnique(string $slug): bool\n {\n $q = $this->newQueryWithoutScopes()->where(static::getSlugName(), $slug);\n\n // exclude item itself from checking\n if ($this->exists) {\n $q->where($this->getKeyName(), '!=', $this->getKey());\n }\n return !$q->exists();\n }", "public function checkUnique($item, $table, $fields, $id = \"\") {\n\t\t$fields\t = explode(',', $fields);\n\t\t$count\t = count($fields);\n\t\t$sql\t = \"select count(*) as count from $table where 1\";\n\t\tif ($id) $sql\t .= \" and id!=$id\";\n\t\tforeach ($item as $key => $value) {\n\t\t\t$arr[$key] = $value;\n\t\t}\n\t\tforeach ($fields as $val) {\n\t\t\t$sql .= \" and $val=\" . \"'$arr[$val]'\";\n\t\t}\n\t\t$obj = $this->dbh->query($sql)->fetch();\n\t\tif ($obj->count > 0) {\n\t\t\tdie(js::alert($this->lang->kevinuser->errorUnique));\n\t\t}\n\t}", "public function isUniqueInScope($Model, $data, $field) {\n\t\tif (empty($data[$field])) {\n\t\t\ttrigger_error('SluggableBehavior: missing data for VALIDATING unique scoped field ' . $field . ' in model ' . $Model->name, E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t\t$conditions = array($Model->alias . '.' . $field => $data[$field]);\n\t\tif ($Model->id) {\n\t\t\t$conditions[$Model->alias . '.' . $Model->primaryKey] = '!= ' . $Model->id;\n\t\t}\n\t\t$scope = $this->settings[$Model->alias]['scope'];\n\t\tif (empty($Model->data[$Model->alias][$scope])) {\n\t\t\ttrigger_error('SluggableBehavior: missing data for VALIDATING over scoped field ' . $scope . ' in model ' . $Model->name, E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t\t$conditions[$Model->alias . '.' . $scope] = $Model->data[$Model->alias][$scope];\n\t\treturn (!$Model->hasAny($conditions));\n\t}", "function check_duplicate()\n {\n }", "public function countUniqueItems();", "function mf_validate_unique($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$input_value = $value[0]; \r\n\t\r\n\t\t$exploded = explode('#',$value[1]);\r\n\t\t$form_id = $exploded[0];\r\n\t\t$element_name = $exploded[1];\r\n\t\t\r\n\t\t$dbh = $value[2]['dbh'];\r\n\t\t\r\n\t\tif(!empty($_SESSION['edit_entry']) && ($_SESSION['edit_entry']['form_id'] == $form_id)){\r\n\t\t\t//if admin is editing through edit_entry.php, bypass the unique checking if the new entry is the same as previous\r\n\t\t\t$query = \"select count($element_name) total from \".MF_TABLE_PREFIX.\"form_{$form_id} where {$element_name}=? and `id` != ?\";\r\n\t\t\t$params = array($input_value,$_SESSION['edit_entry']['entry_id']);\r\n\t\t\t\r\n\t\t\t$sth = mf_do_query($query,$params,$dbh);\r\n\t\t\t$row = mf_do_fetch_result($sth);\r\n\t\t}else{\r\n\t\t\t$query = \"select count($element_name) total from \".MF_TABLE_PREFIX.\"form_{$form_id} where {$element_name}=? \";\r\n\t\t\t$params = array($input_value);\r\n\t\t\t\r\n\t\t\t$sth = mf_do_query($query,$params,$dbh);\r\n\t\t\t$row = mf_do_fetch_result($sth);\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($row['total'])){ \r\n\t\t\treturn $mf_lang['val_unique'];\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function hasUnique($object, $property, array $opts = []): bool;", "public function apiCheckUnique(CheckUniqRequest $request)\n {\n $request = (object)$request->validated();\n return json_encode(!Post::where('slug', '=', $request->slug)->exists());\n }", "public function verifyItem(\\Magento\\Quote\\Model\\Quote\\Item $item, $itemData)\n {\n foreach ($itemData as $key => $value) {\n $this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');\n }\n }", "public static function makeUnique(array $data) {\n $final = array();\n foreach ($data as $array) {\n if (!in_array($array, $final)) {\n $final[] = $array;\n }\n }\n return $final;\n }", "function codeMustBeUnique($code){\n $subject = $this->data[$this->alias];\n return $this->find('count', array('conditions' => array(\n 'Subject.code' => $code,\n 'Subject.course_id' => $subject['course_id'],\n ))) == 0;\n }", "public function uniqueFor();", "public function hasUniqueRow()\n {\n if ($this->getRowNumber() == 1) {\n return true;\n }\n\n return false;\n }", "public function woo_vou_order_item_exist( $order_items, $item_id, $data_id ) {\r\r\n\r\r\n\t\tif( !empty( $order_items ) ) {//If order itemd are empty\r\r\n\r\r\n\t\t\tforeach ( $order_items as $item_key => $order_item ) {\r\r\n\r\r\n\t\t\t\tif( $item_key == $item_id ) {\r\r\n\t\t\t\t\tcontinue;\r\r\n\t\t\t\t}\r\r\n\r\r\n\t\t\t\t//get product id\r\r\n\t\t\t\t$productid = isset( $order_item['product_id'] ) ? $order_item['product_id'] : '';\r\r\n\r\r\n\t\t\t\t//taking variation id\r\r\n\t\t\t\t$variation_id = !empty($order_item['variation_id']) ? $order_item['variation_id'] : '';\r\r\n\r\r\n\t\t\t\t//if product is variable product take variation id else product id\r\r\n\t\t\t\t$item_data_id = ( !empty($variation_id) ) ? $variation_id : $productid;\r\r\n\r\r\n\t\t\t\tif( $item_data_id == $data_id ) {//If item already exist\r\r\n\t\t\t\t\treturn true;\r\r\n\t\t\t\t}\r\r\n\t\t\t}//end foreach\r\r\n\t\t}\r\r\n\r\r\n\t\treturn false;\r\r\n\t}", "public function hasUniqueId(){\n return $this->_has(4);\n }", "function saveU(&$item_data,$item_id=false)\n\t{\n\t\tif (!$item_id or !$this->exists($item_id))\n\t\t{\n\t\t\tif($this->db->insert('items',$item_data))\n\t\t\t{\n\t\t\t\t$item_data['item_id']=$this->db->insert_id();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->db->where('item_number', $item_data['item_number']);\n\t\treturn $this->db->update('items',$item_data);\n\t}", "function is_unique($user_id, $map_name) {\n\tglobal $wpdb;\n\t$main_table_name = $wpdb->prefix . 'standardsreader_maps';\n\t\n\t$wpdb->get_results(\"SELECT id FROM $main_table_name WHERE user_id = \".$user_id.\" AND set_name = '\" . $map_name . \"'\");\n\tif ($wpdb->num_rows == 0)\n\t\treturn true;\n\telse return false;\n}", "private function _validateItemData(&$data) {\n\t\t$ret = true;\n\n\t\t// Remove all \"art_\" indexes\n\t\t$temp = array();\n\t\tforeach($data as $i => $val) {\n\t\t\t// If the indexes are price or price_new\n\t\t\t// Then replace , with . for Float-numbers\n\t\t\tif ($i == 'art_price' || $i == 'art_price_new')\n\t\t\t\t$val = str_replace(',', '.', $val);\n\n\t\t\t$temp[str_replace('art_', '', $i)] = $val;\n\t\t}\n\t\t// Replace data with our temp array without art_ prefixes\n\t\t$data = $temp;\n\n\t\tif (!isset($data['name']) || strlen($data['name']) <= 3) {\n\t\t\t$this->errors[] = 'Gelieve een naam van min. 4 tekens op te geven';\n\t\t\t$ret = false;\n\t\t}\n\n\t\tif (!isset($data['description']) || strlen($data['description']) <= 5) {\n\t\t\t$this->errors[] = 'Gelieve een beschrijving van min. 5 tekens lang op te geven';\n\t\t\t$ret = false;\n\t\t}\n\n\t\tif (!isset($data['description_short']) || strlen($data['description_short']) <= 5) {\n\t\t\t$this->errors[] = 'Gelieve een korte beschrijving op te geven, deze wordt als eerst gezien.';\n\t\t\t$ret = false;\n\t\t}\n\n\t\tif (!isset($data['price']) || !is_numeric($data['price'])) {\n\t\t\t$this->errors[] = 'Gelieve een geldige, in getallen geschreven, prijs op te geven.';\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function CheckDuplicate() {\n\t\t\n\t\t$pass = true;\n\t\tforeach( $this->users as $user => $data ) {\n\t\t\t\n\t\t\tif( $data['username'] == $this->username ) {\n\t\t\t\t\n\t\t\t\t$pass = false;\n\t\t\t}\n\t\t}\n\t\treturn $pass;\n\t}", "function name_is_unique($id,$name)\r\n{\r\n $cf=$this->get_by_name($name);\r\n $status=0;\r\n if( is_null($cf) || isset($cf[$id]) )\r\n {\r\n $status=1;\r\n }\r\n return($status);\r\n}", "public function checkUnique($key, $value, $id = 0)\n {\n $count = $this->model->where($key, $value)->where('id','<>',$id)->count();\n\n return ($count != 0) ? false : true; \n }", "public function unique()\n\t{\n\t}", "public function validateUnique() {\n $email = $this->myRequest[\"CustEmail\"];\n $dB = new DB('travelexperts');\n $query = \"SELECT CustEmail FROM `customers` WHERE CustEmail='\" . $email . \"'\";\n $customer = $dB->get($query);\n\n //If we get a row in the result, then the email address has already been used.\n if ( !($customer===0) ) {\n //Custom Message\n return false;\n } else {\n return true;\n }\n\n }", "protected function isUnique($key, $message): bool\n {\n $messages = (array) $this->messages;\n \n return ! isset($messages[$key]) || ! in_array($message, $messages[$key]);\n }", "public function unique();", "public function unique();", "public function forceUnique();", "function duplicados($array) {\r\n if (count($array) > count(array_unique($array))) {\r\n echo \"En este array existen elementos repetidos!!\";\r\n } else {\r\n echo \"En este array no existen elementos repetidos!!\";\r\n }\r\n}", "function isHandleUnique($handle, $element_id=\"\") {\n\t\t$ucHandle = strtoupper($handle);\n\t\tif($ucHandle == \"CREATION_UID\" OR $ucHandle == \"CREATION_DATETIME\" OR $ucHandle == \"MOD_UID\" OR $ucHandle == \"MOD_DATETIME\" OR $ucHandle == \"CREATOR_EMAIL\" OR $ucHandle == \"UID\" OR $ucHandle == \"PROXYID\" OR $ucHandle == \"CREATION_DATE\" OR $ucHandle == \"MOD_DATE\" OR $ucHandle == \"MAIN_EMAIL\" OR $ucHandle == \"MAIN_USER_VIEWEMAIL\") {\n\t\t\treturn false; // don't allow reserved words that will be used in the main data extraction queries\n\t\t}\n\t\tglobal $xoopsDB;\n\t\t$element_id_condition = $element_id ? \" AND ele_id != \" . intval($element_id) : \"\";\n\t\t$sql = \"SELECT count(ele_handle) FROM \" . $xoopsDB->prefix(\"formulize\") . \" WHERE ele_handle = '\" . mysql_real_escape_string($handle) . \"' $element_id_condition\";\n\t\tif(!$res = $xoopsDB->query($sql)) {\n\t\t\tprint \"Error: could not verify uniqueness of handle '$handle' in form $fid\";\n\t\t} else {\n\t\t\t$row = $xoopsDB->fetchRow($res);\n\t\t\tif($row[0] == 0) { // zero rows found with that handle in this form\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function testEditingValidationUnique() {\n $product = factory(Product::class)->create();\n\n $response = $this->post('/api/product/'.$product->id, [\n 'title' => $product->title,\n ]);\n\n $response->assertStatus(400);\n $response->assertExactJson([\n 'status' => false,\n 'message' => [\n 'title' => [\n 'The title has already been taken.',\n ],\n ],\n ]);\n }", "protected function validate_uniquekey() {\n $this->_regenerate_session_id();\n\n if (isset($_SESSION['_UniqueKey']))\n return $_SESSION['_UniqueKey'] === $this->_make_uniquekey();\n\n if (DEBUG)\n echo '_UniqueKey is not set!';\n return false;\n }", "public function testUnique(): void\n {\n $post = factory(Post::class)->create();\n\n $data = [\n 'type' => 'posts',\n 'attributes' => [\n 'value' => $post->slug,\n ],\n ];\n\n $expected = [\n 'status' => '422',\n 'title' => 'Unprocessable Entity',\n 'detail' => 'The value has already been taken.',\n 'meta' => [\n 'failed' => [\n 'rule' => 'unique',\n // no options as they reveal database settings.\n ],\n ],\n 'source' => [\n 'pointer' => '/data/attributes/value',\n ],\n ];\n\n $this->validator->method('rules')->willReturn([\n 'value' => Rule::unique('posts', 'slug'),\n ]);\n\n $response = $this\n ->jsonApi('posts')\n ->withData($data)\n ->post('/api/v1/posts');\n\n $response\n ->assertExactErrorStatus($expected);\n }", "function dataConsideredEmpty( $data, $repeatCounter )\r\n\t{\r\n\t\tforeach($data as $d) {\r\n\t\t\tif ($d != '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function getData($data) {\n if (is_array($data)) {\n $check = array_values(array_unique($data));\n foreach ($check as $value) {\n if (!empty($value)) {\n return $data;\n }\n }\n }\n return false;\n }", "function is_unique_product()\n\t{\n\t\t//using global variable 'connection' to communicate to the database\n\t\t$query = $GLOBALS['connection']->query(\"SELECT * FROM products WHERE name='\". $GLOBALS['product_name'] .\"'\");\n\t\t\n\t\treturn $query->fetch_assoc();\n\t}", "public function getUniqueRow(): bool\n {\n }", "function _check_unique($str, $tb_data){\n $tb_arr = explode(\".\",$tb_data);\n $where = array($tb_arr[1]=>$str);\n $result = $this->common_model->getsingle($tb_arr[0], $where);\n \n if(!empty($result)){\n $this->form_validation->set_message('_check_unique',$this->name_exists_msg);\n return FALSE;\n }\n else{\n return TRUE;\n } \n }", "function validates_uniqueness_of($field, $message = null)\n\t{\n\t\t$result = false;\n\t\t\n\t\tif(gettype($field) == 'array')\n\t\t{\n\t\t\t$validate_model = model::create($this->get_table_name());\n\t\t\t$validate_array = array();\n\t\t\t\n\t\t\tforeach($field as $property)\n\t\t\t\t$validate_array[$property] = $this->$property;\n\t\t\t\n\t\t\tif($validate_model->find_by_field_array($validate_array))\n\t\t\t\t$id = $validate_model->id;\n\t\t\telse\n\t\t\t\t$id = null;\n\t\t\t\n\t\t\t//Convert back to string for error message display\n\t\t\t$field = implode(' ',$field);\n\t\t}\n\t\telse\n\t\t\t$id = $this->field_exists($field,$this->$field);\n\t\t\n\t\tif(!is_null($id) && $id != $this->id)\n\t\t\t$this->_errors[] = is_null($message) ? ($this->get_table_name().' '.$field.' is not unique') : $message;\t\n\t\telse\n\t\t\t$result = true;\n\t\t\t\n\t\treturn $result;\t\t\n\t}", "protected function is_id_slug_unique(string $slug) {\n\t\t\t\t$is_unique = !array_key_exists($slug, $this->known_slugs);\n\n\t\t\t\tif ($is_unique) {\n\t\t\t\t\t$this->known_slugs[$slug] = [];\n\t\t\t\t}\n\n\t\t\t\treturn $is_unique;\n\t\t\t}", "public function setUniqueness($unique);", "public function testStoringValidationUnique() {\n $product = factory(Product::class)->create();\n\n $response = $this->post('/api/product', [\n 'title' => $product->title,\n 'manufacturer' => $product->manufacturer,\n 'text' => $product->text,\n 'image' => UploadedFile::fake()->image('image.jpg', 100, 100),\n ]);\n\n $response->assertStatus(400);\n $response->assertExactJson([\n 'status' => false,\n 'message' => [\n 'title' => [\n 'The title has already been taken.',\n ],\n ],\n ]);\n }", "function isUniqueSentinel($node) {\n\t\t// query for number of rows with given id\n\t\t$query = \"SELECT COUNT(node) FROM sentinels WHERE node='$node'\";\n\n\t\t$dbc = connect_to_db();\n\t\t$result = perform_query($dbc, $query);\n\t\t$resultAr = $result->fetch_assoc();\n\t\tdisconnect_from_db($dbc, $result);\n\n\t\t// get count specifically\n\t\t$repeatCount = $resultAr[\"node\"];\n\n\t\t// if id is unique, and passwords match\n\t\tif ($repeatCount == 0) {\n\t\t\treturn True;\n\t\t}\n\t\treturn False;\n\t}", "private function is_slug_unique($tbl, $slug)\n\t{\n\t\t$query = $this->db->get_where($tbl, array('slug' => $slug));\n\t\treturn $query->num_rows() === 0;\n\t}", "public function isDuplicate() {\n\t\t\treturn false;\n\t\t}", "function TestUniqueList(&$a, $isSort = VnBase::VnSorting) {\n if ($isSort) {\n sort($a, SORT_STRING);\n }\n\n $n = count($a);\n $duplicates = [];\n for ($i=0; $i <= $n-2 ; $i++) { \n if ($a[$i] == $a[$i+1] ||\n VnBase::Vn2En($a[$i]) == VnBase::Vn2En($a[$i+1])) {\n array_push($duplicates, [\"index\"=>$i, \"name\"=>$a[$i].\" # \".$a[$i+1]]);\n }\n }\n if (count($duplicates) == 0) {\n echo \"<b>don't have duplicate name</b>\";\n } else {\n echo \"<b>duplicate names</b><br/>\";\n foreach ($duplicates as $i => $value) {\n echo ($i+1).\". \".$value['index'].\" and \".($value['index']+1).\" (\".$value['name'].\")<br/>\";\n }\n }\n}", "public function shouldMergeOnDuplicateKey(): bool\n {\n return in_array($this->uniqueKey, ['description', 'keywords', 'robots'], true);\n }", "public function checkUniqueUsername($data, $fieldName) {\r\n\t\tif (isset($this->data['User']['id']) && !empty($this->data['User']['id'])) {\r\n\t\t\tif ($data[$fieldName] == $this->field($fieldName, \"user_name='\" . $this->data['User']['user_name'] . \"' AND id != '\" . $this->data['User']['id'] . \"'\")) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\t//$valid = false;\r\n\t\t\t\tif (isset($fieldName) && $this->hasField($fieldName)) {\r\n\t\t\t\t\t$valid = $this->isUnique(array($fieldName => $data));\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $valid;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ($data[$fieldName] == $this->field($fieldName, \"user_name='\" . $this->data['User']['email'] . \"'\")) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\t//$valid = false;\r\n\t\t\t\tif (isset($fieldName) && $this->hasField($fieldName)) {\r\n\t\t\t\t\t$valid = $this->isUnique(array($fieldName => $data));\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $valid;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function ValidateExists($data)\n\t{\n\t\tif($data != '')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function checkDuplicate($data, $isData = false) {\n\t\treturn $this->get_record($data, $isData);\n\t}", "public function alreadyExists() {\r\n return $this->doesAlreadyExist(array(\r\n 'key' => $this->getProperty('key'),\r\n 'user' => $this->getProperty('user'),\r\n ));\r\n }", "public function validateData(array $data)\n {\n $errors = array();\n foreach ($this->getAttributes() as $attribute) {\n if ($this->_isAttributeOmitted($attribute)) {\n continue;\n }\n $dataModel = $this->_getAttributeDataModel($attribute);\n $dataModel->setExtractedData($data);\n if (!isset($data[$attribute->getAttributeCode()])) {\n $data[$attribute->getAttributeCode()] = null;\n }\n $result = $dataModel->validateValue($data[$attribute->getAttributeCode()]);\n if ($result !== true) {\n $errors = array_merge($errors, $result);\n }\n if ($attribute->getIsUnique()) {\n $cid = $this->getEntity()->getData('entity_id'); //get current customer id\n $cli = Mage::getModel('customer/customer')\n ->getCollection()\n ->addAttributeToFilter($attribute->getAttributeCode(), $data[$attribute->getAttributeCode()])\n ->addFieldToFilter('entity_id', array('neq' => $cid)); //exclude current user from results //###### not working......\n if (count($cli)>0) {\n $label = $attribute->getStoreLabel();\n $errors = array_merge($errors, array(Mage::helper('customer')->__('\"%s\" already used!',$label)));\n }\n }\n }\n if (count($errors) == 0) {\n return true;\n }\n\n return $errors;\n }", "function isUniqueEmail($email) {\n\t\t// query for number of rows with given email\n\t\t$query = \"SELECT COUNT(email) as count FROM users WHERE email='$email'\";\n\n\t\t$dbc = connect_to_db();\n\t\t// save query result object\n\t\t$result = perform_query($dbc, $query);\n\t\tdisconnect_from_db($dbc, $result);\n\n\t\t// save as array of values\n\t\t$resultAr = $result->fetch_assoc();\n\t\t// get bool value of unique\n\t\treturn $resultAr[\"count\"] == 0;\n\t}", "public function testItemDuplicate()\n {\n $itemsFile = $this->loadData('Item', 'default');\n\n $this->resetAll();\n $token = $this->_loginAsNormalUser();\n $this->params['token'] = $token;\n $this->params['method'] = 'midas.item.duplicate';\n $this->params['id'] = $itemsFile[0]->getKey();\n $this->params['dstfolderid'] = 1002;\n $resp = $this->_callJsonApi();\n $this->_assertStatusOk($resp);\n\n $dupItemId = $resp->data->item_id;\n $dupItemDao = $this->Item->load($dupItemId);\n $owningFolders = $dupItemDao->getFolders();\n $this->assertEquals($owningFolders[0]->getKey(), 1002);\n\n $origItemDao = $this->Item->load($itemsFile[0]->getKey());\n $this->assertEquals($resp->data->name, $origItemDao->getName());\n $this->assertEquals($resp->data->description, $origItemDao->getDescription());\n\n $revisions = $dupItemDao->getRevisions();\n $this->assertEquals(count($revisions), 2);\n $revision1 = $revisions[0]->toArray();\n $this->assertEquals($revision1['revision'], '1');\n $revision2 = $revisions[1]->toArray();\n $this->assertEquals($revision2['revision'], '2');\n }", "private function isUnique($value) {\r\n\r\n $counter = 0;\r\n foreach ($this->rules as $input) {\r\n if ($input[0] == $value) {\r\n $counter++;\r\n }\r\n }\r\n return ($counter > 1) ? false : true;\r\n }", "public function hasItemdata(){\n return $this->_has(12);\n }", "function dataConsideredEmpty($data, $repeatCounter)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\tforeach ($data as $d) {\r\n\t\t\tif ($d != '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function is_same(Model_Purchase_Item $item)\n\t{\n\t\treturn ($item->reference_id\n\t\t\tAND $this->reference_id == $item->reference_id\n\t\t\tAND $this->reference_model == $item->reference_model\n\t\t\tAND $this->model == $item->model);\n\t}", "public function exist($item){\n return in_array($item,$this->items);\n }", "public static function check_item ( $item ) {\n\t}", "public function checkUnique($attributes, $params,$index, $value){\n //check which value is the same one\n\n if($this->getEnabled($index)){\n for($i = 0; $i < 10 ; $i++){\n if($index != $i){ \n if( ($value == $this->getValueFriendId($i)) && $this->getEnabled($i)){\n Yii::trace(\"index: $index , $value equals\". $this->getValueFriendId($i));\n $duplicated = $i + 1;\n $this->addError($attributes, \"There is a duplicate of this name\");\n }\n }\n }\n }\n }", "public function unique()\n {\n return $this->unique;\n }", "public function testValidateUnique()\n {\n $user = $this->getUserLogin();\n $subUser = $this->getSubUser();\n\n $this->put('/api/users/'. $user->id, [\n 'username' => $subUser->username,\n 'email' => $subUser->email,\n 'token' => $user->remember_token\n ])\n ->seeJson([\n 'data' => null,\n 'meta' => array(\n 'code' => trans('api.CODE_INPUT_FAILED'),\n 'description' => trans('api.DESCRIPTION_INPUT_FAILED'),\n \"messages\" => array(\n array(\"message\" => trans('validation.unique', ['attribute' => 'email']) ),\n array(\"message\" => trans('validation.unique', ['attribute' => 'username']) ),\n )\n )\n ]\n );\n\n }" ]
[ "0.78157043", "0.74666196", "0.6772948", "0.6760574", "0.67532223", "0.67348075", "0.6634373", "0.66261846", "0.6614851", "0.6614851", "0.6544826", "0.6516002", "0.6459767", "0.6427407", "0.6405819", "0.63128567", "0.62941915", "0.6282527", "0.62664974", "0.6255159", "0.6232582", "0.6159041", "0.6156256", "0.6130246", "0.60983884", "0.60879856", "0.6036333", "0.601813", "0.59997255", "0.5975902", "0.59280777", "0.59239936", "0.589851", "0.58926183", "0.5889863", "0.58754426", "0.58748484", "0.5871457", "0.58563876", "0.5840156", "0.5838593", "0.5823018", "0.5815984", "0.578626", "0.5782697", "0.57757807", "0.57658476", "0.5762056", "0.5730106", "0.57199746", "0.57180876", "0.5698942", "0.56950456", "0.56948054", "0.5680603", "0.56793356", "0.5677203", "0.5672017", "0.56647766", "0.5639503", "0.563482", "0.5617675", "0.5607316", "0.5607316", "0.5606295", "0.5598278", "0.559576", "0.55953956", "0.5566704", "0.5547221", "0.5536499", "0.5519701", "0.5508206", "0.5506596", "0.5505494", "0.5500549", "0.5498301", "0.5480386", "0.5475255", "0.54683757", "0.54562736", "0.545505", "0.5453059", "0.5450709", "0.54345924", "0.5433677", "0.5421133", "0.5402335", "0.5401435", "0.53852284", "0.53827804", "0.5382589", "0.5380199", "0.5379439", "0.5377029", "0.5366732", "0.5364274", "0.5358515", "0.53584754", "0.53581464" ]
0.83956385
0
Tests if data declared uniques ("Unique" => 1) is really unique. First detects the list of data that needs to be unique. Then queiries the DB if any of these values in $item are already present. Returns the TRUE, if everything OK, FALSE it nonunique.
Проверяет, действительно ли данные, объявленные как уникальные ("Unique" => 1), уникальны. Сначала определяет список данных, которые должны быть уникальны. Затем запрашивает базу данных, чтобы убедиться, что ни одно из этих значений в $item не существует. Возвращает TRUE, если всё в порядке, и FALSE, если данные не уникальны.
function ItemIsUnique($item) { foreach ($this->ItemData as $data => $value) { if (empty($this->ItemData[ $data ][ "Unique" ])) { continue; } if (empty($item[ $data ])) { continue; } $nitems=$this->MySqlNEntries("",array($data => $item[ $data ])); if ($nitems>0) { $this->ApplicationObj->AddHtmlStatusMessage ( "Campo ". $this->ItemData[ $data ][ "Name" ]. " não é único - ". $this->ItemName ); return FALSE; // return right away, minimizing mysql talks } } if (!empty($this->UniqueSqlWhere)) { $nitems=$this->MySqlNEntries("",$this->UniqueSqlWhere); if ($nitems>0) { if (!array($this->HtmlStatus)) { $this->HtmlStatus=array($this->HtmlStatus); } $msg=$this->ItemName." ".$this->MyLanguage_GetMessage("IsNotUnique"); array_push($this->HtmlStatus,$msg); return FALSE; } } return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ItemDataIsUnique($item,$data)\n {\n if (!empty($item[ $data ]) && empty($this->ItemData[ $data ][ \"Derived\" ]))\n {\n $nitems=$this->MySqlNEntries(\"\",array($data => $item[ $data ]));\n if ($nitems>1)\n {\n if (!array($this->HtmlStatus))\n {\n $this->HtmlStatus=array($this->HtmlStatus);\n }\n\n $msg=\n $this->ItemName.\": Campo \".$this->ItemData[ $data ][ \"Name\" ].\n \" não é único: \".$item[ $data ];\n\n array_push($this->HtmlStatus,$msg);\n return FALSE; \n }\n }\n\n return TRUE;\n }", "protected function isUnique($item)\n {\n return !in_array($item, $this->items);\n }", "public function hasUnique()\n {\n return $this->get(self::UNIQUE) !== null;\n }", "function ItemsForm_AddItemTestUniqueData($newitem)\n {\n $nitems=0;\n $nonuniquedatas=array();\n\n foreach ($this->Args[ \"UniqueDatas\" ] as $data)\n {\n $rnitems=$this->MySqlNEntries(\"\",array($data => $newitem[ $data ]));\n if ($rnitems>0)\n {\n array_push($nonuniquedatas,$data);\n $nitems+=$rnitems;\n }\n }\n\n if ($nitems>0) \n {\n $this->ItemsForm_AddMessage\n (\n \"Chaves SQL: \".\n join(\", \",$nonuniquedatas).\n \" não única(s).\".\n $this->ItemName.\n \".\"\n );\n\n return FALSE;\n }\n\n return TRUE;\n }", "public function isUnique() // {{{\n {\n return (bool) ($this->_flags & self::FIELD_UNIQUE);\n }", "public function isUnique(): bool\n {\n $result = $this->db->query(\"select count(*) as existing from `existing_pins` where pin = {$this->getPin()};\");\n $result = $result->fetchArray();\n return $result['existing'] === 0;\n }", "private function checkHasUniqueItem($params): void\n {\n foreach ($this->unique as $key) {\n $result = $this->select(\"COUNT(id) as count\", $key, $this->primary_key)->where($key, $params[$key])->get();\n if ($this->where_key != '') {\n if ($result['count'] && $result[$this->primary_key] != $this->where_key) {\n throw new StoragePdoException(\"'$key' has already been registered\");\n }\n } else if ($result['count']) {\n throw new StoragePdoException(\"'$key' has already been registered\");\n }\n }\n }", "public function isUnique(): bool\n {\n return $this->is_unique;\n }", "public function valid_unique() {}", "public function checkUnique($item, $table, $fields, $id = \"\") {\n\t\t$fields\t = explode(',', $fields);\n\t\t$count\t = count($fields);\n\t\t$sql\t = \"select count(*) as count from $table where 1\";\n\t\tif ($id) $sql\t .= \" and id!=$id\";\n\t\tforeach ($item as $key => $value) {\n\t\t\t$arr[$key] = $value;\n\t\t}\n\t\tforeach ($fields as $val) {\n\t\t\t$sql .= \" and $val=\" . \"'$arr[$val]'\";\n\t\t}\n\t\t$obj = $this->dbh->query($sql)->fetch();\n\t\tif ($obj->count > 0) {\n\t\t\tdie(js::alert($this->lang->kevinuser->errorUnique));\n\t\t}\n\t}", "function isUnique() { return!$this->failed; }", "function isUnique() { return!$this->failed; }", "public function isUnique() {\n return $this->unique;\n }", "public function hasUniqueHash()\n {\n $hash = $this->workingRecord->{$this->dbField} ?: $this->encrypt();\n\n return !($this->workingRecord->get()->filter($this->dbField, $hash)->exclude('ID', $this->workingRecord->ID)->exists());\n }", "protected function is_unique($param)\n\t{\n\t\treturn $this->is_key($param);\n\t}", "static function uniqueTypesCheck($a_items)\n\t{\n\t\t$types = array();\n\t\tif (is_array($a_items))\n\t\t{\n\t\t\tforeach($a_items as $item)\n\t\t\t{\n\t\t\t\t$type = ilSkillTreeNode::_lookupType($item);\n\t\t\t\t$types[$type] = $type;\n\t\t\t}\n\t\t}\n\n\t\tif (count($types) > 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function isUnique($idElement){\n\t\trequire_once(\"arbre.php\");\n\t\tglobal \t$reslist;\n\t\treturn(in_array($idElement,$reslist['unique']));\n\t}", "public function isURLUnique($slug, $item_id = null) {\r\n // avoid returning false positive\r\n if (isset($item_id)) {\r\n $items = BallotItem::model()->findAllByAttributes(\r\n array('slug' => $slug), 'id!=:item_id', array(':item_id' => $item_id)\r\n );\r\n } else {\r\n $items = BallotItem::model()->findAllByAttributes(\r\n array('slug' => $slug));\r\n }\r\n\r\n if ($items)\r\n return false;\r\n else\r\n return true;\r\n }", "public function getIsUnique()\n {\n return true;\n }", "public function isItemUnique($value, $key = null) {\n\t\treturn $this->keyForValue($value) === false;\n\t}", "function mf_validate_unique($value){\r\n\t\tglobal $mf_lang;\r\n\r\n\t\t$input_value = $value[0]; \r\n\t\r\n\t\t$exploded = explode('#',$value[1]);\r\n\t\t$form_id = $exploded[0];\r\n\t\t$element_name = $exploded[1];\r\n\t\t\r\n\t\t$dbh = $value[2]['dbh'];\r\n\t\t\r\n\t\tif(!empty($_SESSION['edit_entry']) && ($_SESSION['edit_entry']['form_id'] == $form_id)){\r\n\t\t\t//if admin is editing through edit_entry.php, bypass the unique checking if the new entry is the same as previous\r\n\t\t\t$query = \"select count($element_name) total from \".MF_TABLE_PREFIX.\"form_{$form_id} where {$element_name}=? and `id` != ?\";\r\n\t\t\t$params = array($input_value,$_SESSION['edit_entry']['entry_id']);\r\n\t\t\t\r\n\t\t\t$sth = mf_do_query($query,$params,$dbh);\r\n\t\t\t$row = mf_do_fetch_result($sth);\r\n\t\t}else{\r\n\t\t\t$query = \"select count($element_name) total from \".MF_TABLE_PREFIX.\"form_{$form_id} where {$element_name}=? \";\r\n\t\t\t$params = array($input_value);\r\n\t\t\t\r\n\t\t\t$sth = mf_do_query($query,$params,$dbh);\r\n\t\t\t$row = mf_do_fetch_result($sth);\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($row['total'])){ \r\n\t\t\treturn $mf_lang['val_unique'];\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function isKeyUnique();", "public function be_unique($arg) {\r\n if (in_array($arg, $this->_uniques)) {\r\n $this->form_validation->set_message('be_unique', '%s is not available.');\r\n return false;\r\n }\r\n return true;\r\n }", "function checkUnique($pdo, $thisUser)\n{\n $results = fetchData($pdo, \"user\");\n foreach ($results as $value) {\n if ($value[\"user_email\"] == $thisUser->__get(\"email\")) {\n return false;\n } else if ($value[\"user_name\"] == $thisUser->__get(\"username\")) {\n return false;\n }\n }\n return true;\n}", "final public static function isUnique(array $collection): bool\n {\n return count($collection) === count(array_unique($collection));\n }", "public function element_exist ( $table, $element, $unique = array(\"id\"), &$multiple ) {\n\t\tif ( is_array($unique) ) {\n\t\t\tforeach ( $unique as $key ) {\n\t\t\t\tif ( ( is_object($element) && isset($element->{$key}) ) || isset($element[$key]) ) {\n\t\t\t\t\tif ( $this->exists($table, array($key => $this->_fetch($element, $key))) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$multiple = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function checkUnique($data, $fieldName) \n\t{\n\t\t $Product=$this->find(array(\"lower(Product.\".$fieldName.\")='\".low($data['product_name']).\"' and Product.is_deleted=0\"));\n\t\t if(!empty($Product))\n\t\t { \n\t\t if($Product['Product']['id']!=$this->id)\n\t\t\treturn false;\n\t\t\telse\n\t\t\treturn true;\t \n\t\t }\n\t\t else\n\t\t return true; \n\t}", "function IsSimilarTo($item)\r\n {\r\n $same = 0;\r\n $diff = 0;\r\n if (!empty($this->Email())) { if ($this->Email() == $item->Email()) $same++; else if (!empty($item->Email())) $diff++; }\r\n if (!empty($this->DisplayName())) { if ($this->DisplayName() == $item->DisplayName()) $same++; else if (!empty($item->DisplayName())) $diff++; }\r\n if (!empty($this->Role())) { if ($this->Role() == $item->Role()) $same++; else if (!empty($item->Role())) $diff++; }\r\n if (!empty($this->Status())) { if ($this->Status() == $item->Status()) $same++; else if (!empty($item->Status())) $diff++; }\r\n if (!empty($this->Rsvp())) { if ($this->Rsvp() == $item->Rsvp()) $same++; else if (!empty($item->Rsvp())) $diff++; }\r\n if (!empty($this->Attended())) { if ($this->Attended() == $item->Attended()) $same++; else if (!empty($item->Attended())) $diff++; }\r\n \r\n return $diff == 0 && $same > 0;\r\n }", "protected function itemExists(array $item, $languageUid = 0)\n {\n\n $clause = sprintf(\n 'internal_identifier = \"%s\" AND election = %s AND sys_language_uid = %s',\n $item[$this->internalIdentifier],\n $this->election->getUid(),\n $languageUid\n );\n $clause .= BackendUtility::deleteClause($this->tableName);\n\n $record = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('uid', $this->tableName, $clause);\n return !empty($record);\n }", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"UserPaymentInfoPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $UserPaymentInfo = UserPaymentInfoPeer::doSelect($c);\n \n if (count($UserPaymentInfo) >= 1) {\n $this ->UserPaymentInfo = $UserPaymentInfo[0];\n return true;\n } else {\n $this ->UserPaymentInfo = new UserPaymentInfo();\n return false;\n }\n }", "public function countUniqueItems();", "public function checkUnique( $POST ){\n if( $POST['player1'] == $POST['player2']){\n return false;\n }\n\n // if player 3 exists, compare it to player1 and player2\n if( $POST['player3'] != \"\" and\n ($POST['player3'] == $POST['player1'] or $POST['player3'] == $POST['player2'])){\n\n return false;\n }\n\n // if player 4 exists, compare it to player1, player2 and player3\n if( $POST['player4'] != \"\" and\n ($POST['player4'] == $POST['player3'] or $POST['player4'] == $POST['player2'] or\n $POST['player4'] == $POST['player1'])){\n\n return false;\n }\n\n return true;\n\n }", "public function getIsUnique()\n\t\t{\n\t\t\treturn $this->isUnique;\n\t\t}", "private function checkIfColumnContainsJustUniqueValues($tableName, $columnName)\n {\n $db = $this->getDataSource();\n $duplicates = $this->query(\n sprintf(\n 'SELECT %s, COUNT(*) c FROM %s GROUP BY %s HAVING c > 1;',\n $db->name($columnName),\n $db->name($tableName),\n $db->name($columnName)\n )\n );\n return empty($duplicates);\n }", "protected function isSlugUnique(string $slug): bool\n {\n $q = $this->newQueryWithoutScopes()->where(static::getSlugName(), $slug);\n\n // exclude item itself from checking\n if ($this->exists) {\n $q->where($this->getKeyName(), '!=', $this->getKey());\n }\n return !$q->exists();\n }", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"ScreeningReminderPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $ScreeningReminder = ScreeningReminderPeer::doSelect($c);\n \n if (count($ScreeningReminder) >= 1) {\n $this ->ScreeningReminder = $ScreeningReminder[0];\n return true;\n } else {\n $this ->ScreeningReminder = new ScreeningReminder();\n return false;\n }\n }", "public function checkDuplicates($userID,$productID)\n {\n\n $sqlQuery = \"SELECT * FROM Basket WHERE idUser = ? AND idBook = ?\";\n $statement = $this->_dbHandle->prepare($sqlQuery); // prepare a PDO statement\n $statement->bindParam(1,$userID);\n $statement->bindParam(2,$productID);\n $statement->execute(); // execute the PDO statement\n\n if($statement->rowCount() > 0){\n return true;\n }\n else {\n return false;\n }\n }", "public function action_unique()\n\t{\t\n\n\t\t$data = $_POST['data'];\n\n\t\tif (!isset($data)) return Resp::exec(Resp::invalid_request);\n\n\t\t$email = User::where_email($data)->first();\n\n\t\tif ($email) return false;\n\t\telse return true;\n\t}", "function is_unique($user_id, $map_name) {\n\tglobal $wpdb;\n\t$main_table_name = $wpdb->prefix . 'standardsreader_maps';\n\t\n\t$wpdb->get_results(\"SELECT id FROM $main_table_name WHERE user_id = \".$user_id.\" AND set_name = '\" . $map_name . \"'\");\n\tif ($wpdb->num_rows == 0)\n\t\treturn true;\n\telse return false;\n}", "public function getUnique(): bool\n {\n return $this->_unique;\n }", "public function validateUnique() {\n $email = $this->myRequest[\"CustEmail\"];\n $dB = new DB('travelexperts');\n $query = \"SELECT CustEmail FROM `customers` WHERE CustEmail='\" . $email . \"'\";\n $customer = $dB->get($query);\n\n //If we get a row in the result, then the email address has already been used.\n if ( !($customer===0) ) {\n //Custom Message\n return false;\n } else {\n return true;\n }\n\n }", "function check_for_duplicates()\n {\n global $dbconn;\n db_connect(); // be sure to be connected\n\n // but first check there are no other components named the same\n $res = mysql_query(\"SELECT * FROM components WHERE \"\n . \"(name LIKE '$this->name' OR location LIKE '$this->location')\", $dbconn);\n if ($res == FALSE or mysql_num_rows($res) != 0)\n return TRUE;\n return FALSE;\n }", "function saveU(&$item_data,$item_id=false)\n\t{\n\t\tif (!$item_id or !$this->exists($item_id))\n\t\t{\n\t\t\tif($this->db->insert('items',$item_data))\n\t\t\t{\n\t\t\t\t$item_data['item_id']=$this->db->insert_id();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->db->where('item_number', $item_data['item_number']);\n\t\treturn $this->db->update('items',$item_data);\n\t}", "public function validateItemsExist()\n {\n $itemIds = $this->getItemIds();\n $implodedIds = implode(',', $itemIds);\n $this->productModel->getSelect()\n ->where('products_id IN (' . $implodedIds . ')');\n $this->productModel->getCollection();\n\n if ($this->productModel->getSize() !== count($itemIds)) {\n throw new ShopgateLibraryException(\n ShopgateLibraryException::PLUGIN_ORDER_ITEM_NOT_FOUND,\n \"Collection ids expected: '{$implodedIds}' returned: '{$this->productModel->getAllIds()}'\", true, true\n );\n }\n\n return true;\n }", "function array_has_dupes($array)\n {\n return count($array) !== count(array_unique($array));\n }", "public function exist($item){\n return in_array($item,$this->items);\n }", "public function hasUniqueRow()\n {\n if ($this->getRowNumber() == 1) {\n return true;\n }\n\n return false;\n }", "public function exist($item) {\n return ($this->items[$item['product']['id']]) ? true : false;\n }", "public function toBeUnique();", "public function apiCheckUnique(CheckUniqRequest $request)\n {\n $request = (object)$request->validated();\n return json_encode(!Post::where('slug', '=', $request->slug)->exists());\n }", "public function setUniqueness($unique);", "public function getUniqueRow(): bool\n {\n }", "function isHandleUnique($handle, $element_id=\"\") {\n\t\t$ucHandle = strtoupper($handle);\n\t\tif($ucHandle == \"CREATION_UID\" OR $ucHandle == \"CREATION_DATETIME\" OR $ucHandle == \"MOD_UID\" OR $ucHandle == \"MOD_DATETIME\" OR $ucHandle == \"CREATOR_EMAIL\" OR $ucHandle == \"UID\" OR $ucHandle == \"PROXYID\" OR $ucHandle == \"CREATION_DATE\" OR $ucHandle == \"MOD_DATE\" OR $ucHandle == \"MAIN_EMAIL\" OR $ucHandle == \"MAIN_USER_VIEWEMAIL\") {\n\t\t\treturn false; // don't allow reserved words that will be used in the main data extraction queries\n\t\t}\n\t\tglobal $xoopsDB;\n\t\t$element_id_condition = $element_id ? \" AND ele_id != \" . intval($element_id) : \"\";\n\t\t$sql = \"SELECT count(ele_handle) FROM \" . $xoopsDB->prefix(\"formulize\") . \" WHERE ele_handle = '\" . mysql_real_escape_string($handle) . \"' $element_id_condition\";\n\t\tif(!$res = $xoopsDB->query($sql)) {\n\t\t\tprint \"Error: could not verify uniqueness of handle '$handle' in form $fid\";\n\t\t} else {\n\t\t\t$row = $xoopsDB->fetchRow($res);\n\t\t\tif($row[0] == 0) { // zero rows found with that handle in this form\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function CheckDuplicate() {\n\t\t\n\t\t$pass = true;\n\t\tforeach( $this->users as $user => $data ) {\n\t\t\t\n\t\t\tif( $data['username'] == $this->username ) {\n\t\t\t\t\n\t\t\t\t$pass = false;\n\t\t\t}\n\t\t}\n\t\treturn $pass;\n\t}", "public function checkUnique($value)\n {\n }", "protected function validate_uniquekey() {\n $this->_regenerate_session_id();\n\n if (isset($_SESSION['_UniqueKey']))\n return $_SESSION['_UniqueKey'] === $this->_make_uniquekey();\n\n if (DEBUG)\n echo '_UniqueKey is not set!';\n return false;\n }", "private function isActiveRecordUnique($attributes) {\r\n /* @var $class \\yii\\db\\ActiveRecord */\r\n $class = $this->className;\r\n return empty($attributes) ? true :\r\n !$class::find()->where($attributes)->exists();\r\n }", "abstract public function hasMultipleItems();", "public function is_unique($value, array $args=array())\n\t{\n\t\t$is_update=array_key_exists('is_update', $args) ? $args['is_update'] : false;\n\n\t\tif(!$this->is_empty($value) && !$is_update)\n\t {\n\t \t $params = array();\n\n\t\t $params[$args['field']] = $value;\n\n\t\t $result = $this->where($params)->results();\n\n\t\t if(is_array($result) && count($result) > 0)\n\t\t {\n\t\t return false;\n\t\t }\n\n\t }\n\t elseif(!$this->is_empty($value) && $is_update)\n\t {\t\n\t \t $params = array();\n\n\t\t $params[$args['field']] = $value;\n\n\t\t $result = $this->where($params)->results();\n\n\t\t if(is_array($result) && count($result) > 0)\n\t\t {\n\t\t $record=array_pop($result);\n\n\t\t if($record->id === $args['id']) return true;\n\t\t }\n\n\t\t return false;\n\t }\n\n\t return true; \n\t}", "public function unique();", "public function unique();", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"UserScreeningPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $UserScreening = UserScreeningPeer::doSelect($c);\n \n if (count($UserScreening) >= 1) {\n $this ->UserScreening = $UserScreening[0];\n return true;\n } else {\n $this ->UserScreening = new UserScreening();\n return false;\n }\n }", "public function ContainsItem(Item $item): bool\n\t{\n\t\t//higher order funcitons enough to ignore it.\n\t\t$checkFunc = function (Item $n) use ($item) {\n\t\t\treturn Item::Match($n, $item);\n\t\t};\n\t\treturn count(array_filter($this->Items, $checkFunc)) == 1; //shouldn't be higher than one\n\t}", "public function checkUnique($key, $value, $id = 0)\n {\n $count = $this->model->where($key, $value)->where('id','<>',$id)->count();\n\n return ($count != 0) ? false : true; \n }", "function is_unique_product()\n\t{\n\t\t//using global variable 'connection' to communicate to the database\n\t\t$query = $GLOBALS['connection']->query(\"SELECT * FROM products WHERE name='\". $GLOBALS['product_name'] .\"'\");\n\t\t\n\t\treturn $query->fetch_assoc();\n\t}", "abstract public function IsUserPropertyValueUnique(int $uid = null, string $title, string $data) : bool;", "public function check_unique_entry($table, $column, $hash){\n\t\t$this->db->where($column, $hash);\n\t\t$query = $this->db->get($table);\n\t\tif($query->num_rows() < 1){\n\t\t\t// Success; hash is unique.\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t// Failure; hash is not unique.\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function woo_vou_order_item_exist( $order_items, $item_id, $data_id ) {\r\r\n\r\r\n\t\tif( !empty( $order_items ) ) {//If order itemd are empty\r\r\n\r\r\n\t\t\tforeach ( $order_items as $item_key => $order_item ) {\r\r\n\r\r\n\t\t\t\tif( $item_key == $item_id ) {\r\r\n\t\t\t\t\tcontinue;\r\r\n\t\t\t\t}\r\r\n\r\r\n\t\t\t\t//get product id\r\r\n\t\t\t\t$productid = isset( $order_item['product_id'] ) ? $order_item['product_id'] : '';\r\r\n\r\r\n\t\t\t\t//taking variation id\r\r\n\t\t\t\t$variation_id = !empty($order_item['variation_id']) ? $order_item['variation_id'] : '';\r\r\n\r\r\n\t\t\t\t//if product is variable product take variation id else product id\r\r\n\t\t\t\t$item_data_id = ( !empty($variation_id) ) ? $variation_id : $productid;\r\r\n\r\r\n\t\t\t\tif( $item_data_id == $data_id ) {//If item already exist\r\r\n\t\t\t\t\treturn true;\r\r\n\t\t\t\t}\r\r\n\t\t\t}//end foreach\r\r\n\t\t}\r\r\n\r\r\n\t\treturn false;\r\r\n\t}", "public function checkUnique($table, $column, $value)\n {\n $sql = \"SELECT COUNT(\".$column.\") AS count FROM \".$table.\" WHERE \".$column.\" = :value\";\n $statement = $this->db->prepare($sql);\n $statement->execute(['value' => $value]);\n $result = $statement->fetch();\n if ($result['count'] == 0) {\n return true;\n };\n return false;\n }", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"LogWtvrlogPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $LogWtvrlog = LogWtvrlogPeer::doSelect($c);\n \n if (count($LogWtvrlog) >= 1) {\n $this ->LogWtvrlog = $LogWtvrlog[0];\n return true;\n } else {\n $this ->LogWtvrlog = new LogWtvrlog();\n return false;\n }\n }", "public function isUnique(string $properyValue, string $columnName) {\n\t\t$values = DB::getInstance()->select($this->tableName(), [$columnName])\n\t\t\t->fetchAll(DB::getInstance()->fetchColumn(), 0);\n\n\t\treturn !in_array($properyValue, $values);\n\t}", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"LogFlashlogPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $LogFlashlog = LogFlashlogPeer::doSelect($c);\n \n if (count($LogFlashlog) >= 1) {\n $this ->LogFlashlog = $LogFlashlog[0];\n return true;\n } else {\n $this ->LogFlashlog = new LogFlashlog();\n return false;\n }\n }", "function _check_unique($str, $tb_data){\n $tb_arr = explode(\".\",$tb_data);\n $where = array($tb_arr[1]=>$str);\n $result = $this->common_model->getsingle($tb_arr[0], $where);\n \n if(!empty($result)){\n $this->form_validation->set_message('_check_unique',$this->name_exists_msg);\n return FALSE;\n }\n else{\n return TRUE;\n } \n }", "public function checkUniquness($name)\n {\n $ids = [];\n foreach($this->jsoner->get() as $region) {\n $ids[] = $region->id;\n }\n sort($ids);\n\n\n\n //$str = '';\n //foreach ($titles as $title) {\n // $str .= '[\\'codes\\'=>[], \\'title\\'=>\\''.$title.'\\'], '.\"\\n\";\n //\n //}\n //\n //L::data($str);\n\n\n\n if($this->jsoner->isUnique('id')) {\n L::i('id', 'is unique');\n } else {\n L::e('id', 'is NOT unique');\n }\n }", "public function itemExists($itemId);", "function checkUniqRecord()\r\n{\r\n\tglobal $DB, $objComm;\r\n\t$tb=$_REQUEST[\"tb\"];\r\n\t$col_name = $_REQUEST['col_name'];\r\n\t$col_value = $_REQUEST['col_value'];\r\n\r\n\tif($_REQUEST[\"act\"]==\"UPDATE\") \r\n\t{\r\n\t\t$cur_id=$_REQUEST[\"cur_col\"];$cur_value=$_REQUEST[\"cur_value\"];\r\n\t\t$SQL=\"SELECT \".$col_name.\" FROM \".$tb.\" WHERE \".$col_name.\"='\".$col_value.\"' AND \".$cur_id.\"!='\".$cur_value.\"'\";\r\n\t\t$record=$DB->totRecord($SQL, '');\r\n\t\t$response=($record>0) ? \"NO\" : \"OK\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$SQL=\"SELECT \".$col_name.\" FROM \".$tb.\" WHERE \".$col_name.\"='\".$col_value.\"'\";\r\n\t\t$record=$DB->totRecord($SQL, '');\r\n\t\t$response=($record>0) ? \"NO\" : \"OK\";\r\n\t}\r\n\techo json_encode(array(\"status\"=>$response));\r\n\r\n}", "public function hasUnique($object, $property, array $opts = []): bool;", "private function is_slug_unique($tbl, $slug)\n\t{\n\t\t$query = $this->db->get_where($tbl, array('slug' => $slug));\n\t\treturn $query->num_rows() === 0;\n\t}", "function checkUnique( $vals ) {\n $c = new Criteria();\n \n foreach ($vals as $key =>$value) {\n $name = \"WtvrErrorPeer::\".strtoupper($key);\n eval(\"\\$c->add(\".$name.\",\\$value);\");\n }\n \n $c->setDistinct();\n $WtvrError = WtvrErrorPeer::doSelect($c);\n \n if (count($WtvrError) >= 1) {\n $this ->WtvrError = $WtvrError[0];\n return true;\n } else {\n $this ->WtvrError = new WtvrError();\n return false;\n }\n }", "public function isLikeExist($itemId)\n {\n if (Auth::user()) {\n $likeData = DB::table('favourite_items')->where('item_id', $itemId)\n ->where('user_id', Auth::user()->id)->get();\n if (!$likeData->isEmpty()) {\n return true;\n }\n }\n return false;\n }", "function division_is_unique($p_name ) {\n\tdb_param_push();\n\t$t_query = 'SELECT COUNT(*) FROM {division}\n\t\t\t\t\tWHERE division=' . db_param();\n\t$t_count = db_result( db_query( $t_query, array( $p_name ) ) );\n\tif( 0 < $t_count ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function is_unique($str, $field) {\n list($table, $field, $field_id) = explode('.', $field);\n if (isset($this->CI->db)) {\n $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));\n $id = $this->CI->input->post($field_id);\n if ($id) {\n if ($query->row() && $query->row_array()[$field_id] != $id)\n return FALSE;\n }else {\n if ($query->row())\n return FALSE;\n }\n } else\n return FALSE;\n return TRUE;\n }", "private static function validize($item) {\n $collection = 'events';\n $fields = array('name', 'capacity', 'price', 'start_date', 'end_date');\n \n if(!$item) return false;\n if($item['valid']) return true;\n \n foreach($fields as $key) \n if($item[$key] === false) return false;\n \n // all clear!\n \n $update['valid'] = true;\n MongoLib::set($collection, $item['_id'], $update);\n \n return true;\n }", "function process_duplicates($db, $item)\n {\n $name2 = $item['name'];\n $size2 = $item['size'] !== null ? $item['size'] : '-1';\n $modified2 = $item['modified'];\n \n $result = query(__FILE__, __LINE__, 'find_duplicates', array($name2, $size2, $modified2), $db);\n \n $arr = pg_fetch_all($result);\n if (!@$arr[0])\n {\n return null;\n }\n \n if (count($arr) > 1)\n {\n echo \"More than one duplicate found!\\n\";\n print_r(array($name2, $size2, $modified2));\n exit;\n }\n \n $result = query(__FILE__, __LINE__, 'update_duplicates', array($arr[0]['id'], $modified2), $db);\n \n return $arr[0]['id'];\n }", "public function contains($item): bool\n {\n foreach ($this->data as $dataItem) {\n if (static::equal($item, $dataItem)) {\n return true;\n }\n }\n return false;\n }", "function ItemCompulsoriesUndefined($item=array(),$datas=array())\n {\n if (empty($item)) { $item=$this->ItemHash; }\n if (empty($datas)) { $datas=array_keys($this->ItemData); }\n\n $rdatas=array();\n foreach ($datas as $data)\n {\n if ($this->ItemData[ $data ][ \"Compulsory\" ])\n {\n if (empty($item[ $data ]))\n {\n $res=FALSE;\n array_push($rdatas,$data);\n }\n }\n }\n\n return $rdatas;\n }", "private static function itemIsExists()\n {\n return (bool) Cart::where('product_id', self::$product)\n ->where('user_id', self::$user)\n ->first();\n }", "public function valid()\n {\n return isset($this->items[$this->index]);\n }", "protected function isUnique($mUrl)\n {\n\n return Link::where('murl', $mUrl)->first() === null;\n }", "public function is_unique($userinput, $type){\n $value = $this->db->real_escape_string($userinput);\n $type = $this->db->real_escape_string($type);\n $query = \"SELECT \" . $type . \" FROM users WHERE \" . $type . \" = '\" . $value . \"'\";\n if($this->make_query($query) === NULL){\n return true;\n } else {\n return false;\n }\n }", "function create($args, $unique = NULL) {\n\t\t$this->newRecord($args);\n\t\tif($unique !== NULL) {\n\t\t\t$unique = explode(',', $unique);\n\t\t\t$uniqueArray = array();\n\n\t\t\t$i = 0;\n\t\t\tforeach($unique as $u) {\n\t\t\t\t$u = str_replace(\" \", \"\", $u);\n\t\t\t\tif(!isset($args[$u], $args)) { return FALSE; }\n\t\t\t\tif($i > 0) {\n\t\t\t\t\tarray_push($uniqueArray, \"||$u = '\" . $args[$u] . \"'\");\n\t\t\t\t} else {\n\t\t\t\t\tarray_push($uniqueArray, \"$u = '\" . $args[$u] . \"'\");\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\t\n\t\t\tif($this->exists($uniqueArray)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$this->saveRecord();\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->saveRecord();\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t}", "public function isExists() {\r\n $propsByName = $this->propertiesGetByName();\r\n $tableName = $this->table;\r\n $query = \"SELECT count(*) as count FROM `{$tableName}` WHERE \";\r\n $loop = 0;\r\n $preparedTypes = array();\r\n foreach ($this->params as $param=>$value) {\r\n if (isset($propsByName[$param]['unique'])\r\n && $propsByName[$param]['unique'])\r\n {\r\n if ($loop) {\r\n $query .= \" OR \";\r\n }\r\n $query .= \"`{$param}` = :{$param}\";\r\n $preparedTypes[] = array(\":{$param}\", $value, $propsByName[$param]['type']);\r\n }\r\n $loop++;\r\n }\r\n $db = $this->dbConnect()->prepare($query);\r\n foreach ($preparedTypes as $prepared) {\r\n $db->bindValue($prepared[0], $prepared[1], $prepared[2]);\r\n }\r\n $result = $db->execute()->fetch(PDO::FETCH_ASSOC);\r\n if ($result['count']) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function forceUnique();", "public function is_unique( $table, $column, $value, $id_col, $id_val ){\n\t\tglobal $obj_bd;\n\t\t$query = \"SELECT \" . $column \n\t\t\t\t. \" FROM \" . PFX_MAIN_DB . $table \n\t\t\t\t. \" WHERE \" . $column . \" = '\" . $value . \"' \" \n\t\t\t\t\t. \" AND NOT \" . $id_col . \" = '\" . $id_val . \"' \";\n\t\t$result = $obj_bd->query( $query );\n\t\tif ( $result !== FALSE ){\n\t\t\tif ( count($result) > 0 ){\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function uniqueFor();", "private function checkUnique($ean)\n {\n\t\t$result = true;\n\n\t\t$sth = $this->exec(\"SELECT COUNT(1) FROM product WHERE ean = :ean\", array(\n\t\t\t':ean' => $ean,\n\t\t));\n\n\t\t$countRow = $sth->fetch();\n\n\t\tif ((int)$countRow[0] > 0)\n\t\t{\n\t\t\t$result = false;\n\t\t}\n\n\t\treturn $result;\n }", "public static function likeExists($user_id,$item_id)\n {\n \n $exists = 0; \n $model = self::find()\n ->where( [ 'item_id' => (int)$item_id, 'user_id' => (int)$user_id ] )\n ->exists();\n if ( $model === true ) {\n $exists = 1;\n } \n\n return $exists;\n }", "protected function checkUnique()\n {\n $identity = $this->respondentIdentity;\n if (!$identity->respondent) {\n return SuspiciousStatus::LEGAL;\n }\n\n $deviceId = $identity->respondent->device_id;\n $fingerprint = $identity->getRms('fp');\n\n $query = Respondent::find()\n ->andWhere([\n 'device_id' => $deviceId,\n 'fingerprint_id' => $fingerprint,\n 'ip' => \\Yii::$app->request->userIP,\n ])\n ->andWhere(['<>', 'id', $identity->respondent->id])\n ->orderBy(['id' => SORT_DESC])\n ->limit(1);\n\n $exists = $query->one();\n\n return !$exists ? SuspiciousStatus::LEGAL : SuspiciousStatus::ID_DUPLICATED;\n }", "function isUniqueEmail($email) {\n\t\t// query for number of rows with given email\n\t\t$query = \"SELECT COUNT(email) as count FROM users WHERE email='$email'\";\n\n\t\t$dbc = connect_to_db();\n\t\t// save query result object\n\t\t$result = perform_query($dbc, $query);\n\t\tdisconnect_from_db($dbc, $result);\n\n\t\t// save as array of values\n\t\t$resultAr = $result->fetch_assoc();\n\t\t// get bool value of unique\n\t\treturn $resultAr[\"count\"] == 0;\n\t}", "function if_exist($conn,$chkfield,$checkitem,$tblname){\n\t$chkresult=getAllRecord($conn,$tblname,$where=\"$chkfield='$checkitem'\",\"\",\"\");\n\t$numrow=mysqli_num_rows($chkresult);\n\t$row=mysqli_fetch_array($chkresult);\n\t\n\tif($numrow > 0)\n\t{\n\t\tdie(\"<p class='w3-red'>Error 1212!..Duplicate entry is not allowed on the system</p>\");\n\t\treturn;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n\t\n}" ]
[ "0.78925806", "0.7428742", "0.6948566", "0.6871804", "0.68186516", "0.67292976", "0.65517163", "0.6516417", "0.6485219", "0.6456174", "0.64230126", "0.64230126", "0.63681424", "0.6366566", "0.6332403", "0.6286769", "0.62814903", "0.62248117", "0.620564", "0.619257", "0.6189823", "0.61723053", "0.6150934", "0.61400986", "0.6121862", "0.61145514", "0.61132723", "0.6053497", "0.5985945", "0.5980145", "0.59293646", "0.58738506", "0.5858582", "0.5849662", "0.58309597", "0.5821446", "0.5814293", "0.581195", "0.581079", "0.5810324", "0.58021057", "0.57907164", "0.5783479", "0.5777482", "0.5774568", "0.57680935", "0.57639384", "0.57585067", "0.57385075", "0.57360584", "0.5733179", "0.5713205", "0.5712246", "0.57035065", "0.57017124", "0.5664388", "0.56465155", "0.56431925", "0.56380016", "0.5635254", "0.5635254", "0.5625547", "0.56168336", "0.5615318", "0.56060493", "0.56029516", "0.5601962", "0.55873686", "0.55827755", "0.5578437", "0.5577896", "0.5575233", "0.5572952", "0.5564896", "0.55634636", "0.5541151", "0.5541082", "0.5537143", "0.5525298", "0.55226713", "0.5520771", "0.5516693", "0.55142504", "0.55142313", "0.5508983", "0.5508262", "0.5508169", "0.5500169", "0.54988754", "0.5495593", "0.5493272", "0.5482598", "0.54807526", "0.54757696", "0.5471448", "0.5464382", "0.5461231", "0.5457299", "0.54480374", "0.5441275" ]
0.8382657
0
Treats $newvalue, backspaces and stuff.
Обрабатывает $newvalue, возвращает каретку назад и прочее.
function TreatNewValue($newvalue) { //replace's $newvalue=preg_replace("/'/","&#39;",$newvalue); //backslashes $newvalue=preg_replace('/\\\\/',"&#92;",$newvalue); //$newvalue=preg_replace("/&#92;&#92;/","&#92;",$newvalue); $newvalue=preg_replace('/\s+$/',"",$newvalue); return $newvalue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retestInput($newInput) {\n\t\t//trim removes unnecessary white space\n\t\t$newInput = trim($newInput);\n\t\treturn $newInput;\n\t}", "function ReplaceSpace($_new, $_string){\n return preg_replace('/\\s+/', $_new, $_string);\n}", "function modify_content($value){\r\n\t $value = str_replace(\"####\",\"\\r \\r\",$value);\r\n\t $value = str_replace(\"##\",\"\\r\",$value);\r\n\t //return utf8_encode($value);\r\n\t return $value;\r\n}", "function replace_value($matches,$value) {\n\t\t//----------------------------------------------\n\t\t\t\n\t\t\tarray_shift($matches);\n\n\t\t\tif(($value!='')&&($matches[1]==\"<\")) //Value must be hexified..\n\t\t\t\t$value=$this->pdf_encode_field_value($value); \n\t\t\n\t\t\t$matches[2]=$value;\n\t\t\t$value_type_code=$matches[0]; //Should be V, DV or TU\n\t\t\t$matches[0]=\"/\".$value_type_code.\" \";\n\t\t\t\n\t\t\t$value=implode(\"\",$matches);\n\t\t\t//echo(htmlentities($value));\n\t\t\treturn $value;\n\t\t}", "function _set_field_value($line,$value) {\n\t\t//----------------------------------------\n\t\t\n\t\t\t$verbose_set=($this->verbose&&($this->verbose_level>1));\n\t\t\t//get the line content\n\t\t\t$CurLine =$this->pdf_entries[$line];\n\t\t\n\t\t\t$OldLen=strlen($CurLine);\n\t\t\t\n\t\t\t//My PHP4/5 static call hack, only to make the callback $this->replace_value($matches,\"$value\") possible!\n\t\t\t$callback_code='$THIS=new FPDM(\"[_STATIC_]\");return $THIS->replace_value($matches,\"'.$value.'\");';\n\t\t\t\n\t\t\t$field_regexp='/^\\/(\\w+)\\s?(\\<|\\()([^\\)\\>]*)(\\)|\\>)/';\n\t\t\t\n\t\t\tif(preg_match($field_regexp,$CurLine)) {\n\t\t\t\t//modify it according to the new value $value\n\t\t\t\t$CurLine = preg_replace_callback(\n\t\t\t\t\t$field_regexp,\n\t\t\t\t\tcreate_function('$matches',$callback_code),\n\t\t\t\t\t$CurLine\n\t\t\t\t);\n\t\t\t}else {\n\t\t\t\tif($verbose_set) echo(\"<br>WARNING:\".htmlentities(\"Can not access to the value: $CurLine using regexp $field_regexp\"));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$NewLen=strlen($CurLine);\n\t\t\t$Shift=$NewLen-$OldLen;\n\t\t\t$this->shift=$this->shift+$Shift;\n\t\t\t\n\t\t\t//Saves\n\t\t\t$this->pdf_entries[$line]=$CurLine;\n\t\t\t\n\t\t\treturn $Shift;\n\t\t}", "public function rewrite_value($value) {\n\t\tif (!is_numeric($value)) { \n\t\t\t$value = $this->connection->real_escape_string($value); \n\t\t\t\n\t\t\t$value = \"'$value'\"; \n\t\t}\n\t\treturn $value; \n\t}", "protected function clean_value($value) {\n\t\t\t$replace = array(\n\t\t\t\t\"\\r\" => '',\n\t\t\t\t\"\\n\" => ''\n\t\t\t);\n\t\t\treturn trim(str_replace(array_keys($replace), array_values($replace), $value));\n\t\t}", "function Clean($value)\r\n{\r\n\t$value = preg_replace('/\\\\n/','',$value);\r\n\t$value = preg_replace('/\\\\r/','',$value);\r\n\t$value = addslashes($value);\r\n\treturn $value;\r\n}", "function setNewValue($new_value) {\n $this->new_value = $new_value;\n }", "protected function _update_value() {\n\t\tif (isset($_POST[$this->name])) {\n\t\t\t$this->value(stripslashes($_POST[$this->name]));\n\t\t}\n\t}", "public function setValue( $value )\n {\n $this->value = trim( $value );\n }", "public function escapeValue($value);", "public function mres($value)\n {\n #skip following chars: \\x00, \\n, \\r, \\, ', \" and \\x1a\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n\n return str_replace($search, $replace, $value);\n }", "public static function escapeSimple(&$value)\n\t\t{\n\t\t\t$value = str_replace(\"\\n\",\"<br>\",stripslashes(trim($value)));\n\t\t}", "public function setValue($value) {\n\t\tparent::setValue(stripslashes($value));\n\t}", "protected function doTransform($value)\n {\n $lf = '/(?:\\r\\n|\\n|\\x0b|\\r|\\f|\\x85)/';\n return preg_replace($lf,'<br />',$value);\n }", "protected function wrapValue($value) {\n if ($value === '*')\n return $value;\n return $value;\n return '`' . str_replace('`', '``', $value) . '`';\n }", "function mres($value)\n{\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n\n return str_replace($search, $replace, $value);\n}", "private function processToken(&$value) {\n if (is_string($value)) {\n $token_service = \\Drupal::token();\n\n $token_info = $token_service->getInfo();\n\n if ($found_tokens = $token_service->scan($value)) {\n foreach ($found_tokens as $context => $token_group) {\n if (in_array($context, array_keys($token_info['types']))) {\n foreach ($token_group as $token) {\n $context_variable = str_replace('-','_', $context);\n\n \\Drupal::moduleHandler()->alter('dx8_' . $context . '_drupal_token_context', $context_variable);\n\n // If token has been detected replace potential breaking chars with nothing as they are not valid\n $context = str_replace(['[', ']', '{', '}'], '', $context);\n\n $twig_token = '[token.' . str_replace([\n '[',\n ']',\n '{',\n '}',\n ], '', $token) . '|' . $context . '|' . $context_variable . ']';\n $value = str_replace($token, $twig_token, $value);\n }\n }\n }\n }\n }\n }", "public function cleanPostValue($value){ \r\n\t\t// o mica protectie pt a afisa corect ceea ce insereaza.\r\n\t\t// sunt diferiti factori care pot fute si asta impiedica\r\n\t\t\t// $value = htmlspecialchars_decode($value);\r\n\t\t\r\n\t\t\r\n\t\t$value = trim($value);\r\n\t\t$value = htmlspecialchars($value);\r\n\t\t\r\n\t\treturn $value;\r\n\t}", "private function escape($value) {\n return $value;\n }", "private function pushBackChar()\n {\n $this->r->pushBackChar();\n }", "function mres($value) {\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n return str_replace($search, $replace, $value);\n}", "private function _bump($new_line = TRUE)\n\t{\n\t\tif ($new_line)\n\t\t{\n\t\treturn '\n\t\t\n\t';\t\t}\n\t\telse\n\t\t{\n\t\treturn '\n\t';\t\t}\n\t}", "function replace($value){\n if($value == '' || $value == NULL){\n echo '-';\n }else{\n echo $value;\n }\n }", "private function process_value( $value ){\n //$temp = $value;\n $value = preg_replace( '/^%([a-zA-Z0-9]+)/', '%%%${1}', $value );\n $value = preg_replace( '/([a-zA-Z0-9]+)%$/', '${1}%%%', $value );\n //drupal_set_message( $temp . \" => \" . $value );\n\n if( is_int($value) )\n return $value;\n if( is_string($value) && preg_match('/^[a-zA-Z_]+\\(.*\\)$/', $value) )\n return $value;\n /*if( is_array($value) ){\n if( count($value) == 1 && preg_match('/^[a-zA-Z_]+\\(.*\\)$/', $value[0]) )\n return $value[0];\n else if( count($vlaue) > 1 && preg_match('/^[a-zA-Z_]+\\(.*\\)$/', $value[0]) )\n $func_name preg_match( '/([a-zA-Z_]+)\\(.*\\)/', $value[0] );\n \n }*/\n \n if( is_string($value) )\n return \"'\" . db_escape_string( $value ) . \"'\";\n }", "public function replaceEmptySpaces ($value) {\n\t\t$newValue = str_replace(' ', '_', $value);\n\n\t\treturn $newValue;\n\t}", "function _set_text_value($stream,$value) {\n //---------------------------------------\n\t\t\t$chunks=preg_split(\"/(\\s*Td\\s+[\\<\\(])([^\\>\\)]+)([\\>\\)]\\s+Tj)/\",$stream,0,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t$chunks[2]=$value;\n\t\t\t$stream=implode($chunks,'');\n\t\t\treturn $stream;\n }", "function format($value) {\n\t\treturn nl2br(preg_replace(self::PATTERN,self::REPLACE,htmlentities($value,ENT_NOQUOTES,'UTF-8')));\n\t}", "public function setValue($new_value, $id) {\n \t$value = '';\n \t$where = array();\n \t$where[self::field_id] = $id;\n \t$config = array();\n \tif (!$this->sqlSelectRecord($where, $config)) {\n \t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->getError()));\n \t\treturn false;\n \t}\n \tif (sizeof($config) < 1) {\n \t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, sprintf(reg_error_cfg_id, $id)));\n \t\treturn false;\n \t}\n \t$config = $config[0];\n \tswitch ($config[self::field_type]):\n \tcase self::type_array:\n \t\t// Funktion geht davon aus, dass $value als STR uebergeben wird!!!\n \t\t$worker = explode(\",\", $new_value);\n \t\t$data = array();\n \t\tforeach ($worker as $item) {\n \t\t\t$data[] = trim($item);\n \t\t};\n \t\t$value = implode(\",\", $data);\n \t\tbreak;\n \tcase self::type_boolean:\n \t\t$value = (bool) $new_value;\n \t\t$value = (int) $value;\n \t\tbreak;\n \tcase self::type_email:\n \t\tif ($this->validateEMail($new_value)) {\n \t\t\t$value = trim($new_value);\n \t\t}\n \t\telse {\n \t\t\t$this->setMessage(sprintf(reg_msg_invalid_email, $new_value));\n \t\t\treturn false;\n \t\t}\n \t\tbreak;\n \tcase self::type_float:\n \t\t$value = $this->str2float($new_value);\n \t\tbreak;\n \tcase self::type_integer:\n \t\t$value = $this->str2int($new_value);\n \t\tbreak;\n \tcase self::type_url:\n \tcase self::type_path:\n \t\t$value = $this->addSlash(trim($new_value));\n \t\tbreak;\n \tcase self::type_string:\n \t\t$value = (string) trim($new_value);\n \t\t// Hochkommas demaskieren\n \t\t$value = str_replace('&quot;', '\"', $value);\n \t\tbreak;\n \tendswitch;\n \tunset($config[self::field_id]);\n \t$config[self::field_value] = (string) $value;\n \tif (!$this->sqlUpdateRecord($config, $where)) {\n \t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->getError()));\n \t\treturn false;\n \t}\n \treturn true;\n }", "function test_value($input) {\n $input = htmlspecialchars($input);\n $input = stripslashes($input);\n $input = trim($input);\n return $input;\n }", "protected function processValue($value) {\r\n\t\t$die = (object)array('prep'=>'','state'=>'');\r\n\t\tif (!strstr($value, '{%')) \r\n\t\t\treturn (object)array('prep'=>'', 'state'=>'\\''.addslashes($value).'\\'');\r\n\t\t\t\r\n\t\t$commands = array();\r\n\t\t$ct = 0;\r\n\t\t$commands[$ct]='';\r\n\t\t$tokens = preg_split('/(\\'|\\{\\%|\\%\\})/Us', $value, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\r\n\t\t$php = false;\r\n\t\t$buf = array();\r\n\t\tforEach ($tokens as $token) switch ($token) {\r\n\t\t\tcase '{%': if (!$php) {\r\n\t\t\t\t$php = true;\r\n\t\t\t\t$buf[]='\\'.';\r\n\t\t\t} else {\r\n\t\t\t\t$commands[$ct]=$token;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase '%}': if ($php) {\r\n\t\t\t\t$php = false;\r\n\t\t\t\t$buf[]='$__RESULTS['.$ct.']';\r\n\t\t\t\t$ct++;\r\n\t\t\t\t$commands[$ct]='';\r\n\t\t\t\t$buf[]='.\\'';\r\n\t\t\t} else {\r\n\t\t\t\t$buf[]=$token;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase '\\'': if (!$php) {\r\n\t\t\t\t$buf[]='\\\\'.$token;\r\n\t\t\t} else {\r\n\t\t\t\t$commands[$ct]=$token;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tdefault: if (!$php) {\r\n\t\t\t\t$buf[]=$token;\r\n\t\t\t} else {\r\n\t\t\t\t$commands[$ct].=$token;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($php) throw new Exception('Unclosed \\'{%\\' in controller XML');\r\n\t\t$value = '\\''.join('', $buf).'\\'';\r\n\t\t\r\n\t\t$value = preg_replace('/(^|\\.)\\'\\'(\\.|$)/Uis', '.', $value);\r\n\t\t$value = preg_replace('/(^\\.)|(\\.$)/Uis', '', $value);\r\n\t\t\r\n\t\t$preparation = '$ex = function ($dictionary) { extract($dictionary); $__RESULTS=array(); $__RESULTS[]='.join('; $__RESULTS[]=', $commands).'; return $__RESULTS; }; $__RESULTS = $ex();';\r\n\t\t\t\r\n\t\t\r\n\t\treturn (object)array(\r\n\t\t\t'prep'=>$preparation,\r\n\t\t\t'state'=>$value\r\n\t\t);\r\n\t}", "private function stripWhitespace(&$value, $key){\n $value = preg_replace('/\\s+/', '', $value);\n }", "function _handle_magic_quotes($value,$add=false){\n\t\tif($add)\n\t\t\treturn $this->_magic_quotes ? $value : addslashes($value);\n\t\telse\n\t\t\treturn $this->_magic_quotes ? stripslashes($value) : $value;\n\t}", "private function addEscapedChars()\n\t{\n\t\t$this->parsed = str_replace($this->replacedString, $this->protectedStrings, $this->parsed);\n\t}", "public function save( $newvalue, $oldvalue ) {\n\n\t\t\treturn $newvalue;\n\n\t\t}", "function change($replacement)\n {\n $word = substr($this->string, $this->strpos - $this->strlen, \n $this->prepStrlen);\n $replacement = stripslashes($this->adjustFirst($word, $replacement));\n $this->string = substr_replace($this->string, $replacement,\n $this->strpos - $this->strlen, $this->prepStrlen);\n $this->strpos += strlen($replacement) - $this->strlen;\n $this->adjustedString = substr($this->string, $this->strpos);\n }", "function escapeJsonString($value) { # list from www.json.org: (\\b backspace, \\f formfeed)\n\t\t$escapers = array(\"\\\\\", \"/\", \"\\\"\", \"\\n\", \"\\r\", \"\\t\", \"\\x08\", \"\\x0c\", \"\t\");\n\t\t$replacements = array(\"\\\\\\\\\", \"\\\\/\", \"\\\\\\\"\", \"\\\\n\", \"\\\\r\", \"\\\\t\", \"\\\\f\", \"\\\\b\", \" \");\n\t\t$result = str_replace($escapers, $replacements, $value);\n\n\t\treturn $result;\n\t}", "abstract public function escape($value);", "public function unescapeValue($value);", "public function yieldToNextTransducer($newCurrentWorkingValue)\n {\n $this->currentWorkingValue = $newCurrentWorkingValue;\n $this->nextTransducer();\n }", "function character_data($parser, $data)\n{\n $data = trim(api_utf8_decode($data));\n global $current_value;\n $current_value = $data;\n}", "function _getNewValue(){\n\t\tparent::_getNewValue();\n\t}", "public function change_as_history($key, $new, $prev)\n {\n $threshold = 50;\n $change = ucwords(\"$key: \");\n if (strlen($new) > $threshold && strlen($prev) > $threshold)\n $change .= \"\\n'\";\n else\n $change .= \"'\";\n $change .= stripslashes($new) . \"'\\n\";\n $change .= \"Previous \" . ucwords($key) . \": \";\n if (strlen($prev) > $threshold && strlen($new) > $threshold)\n $change .= \"\\n' \";\n else\n $change .= \"'\";\n $change .= stripslashes($prev) . \"'\";\n $change .= \"\\n\";\n return $change;\n }", "function replaceSpaces($expression) {\n\t\t$new = '';\n\t\t$tmp = explode(' ', $expression);\n\t\tforeach ($tmp as $word) {\n\t\t\t$new .= '+' . $word;\n\t\t}\n\t\treturn $new;\n\t}", "function prepare_string_value($value) {\n\t\t$new_value = (!get_magic_quotes_gpc()) ? addslashes($value) : $value;\n\t\t$new_value = ($value != \"\") ? \"'\".trim($value).\"'\" : \"''\";\n\t\treturn $new_value;\n\t}", "function mapTabToStart($value)\n{\n return \"\\t$value\";\n}", "public function interFormSimple($nValue)\n {\n $nValue = str_replace(\"\\r\", \"\", $nValue);\n $nValue = str_replace(\"\\n\", \" \", $nValue);\n $nValue = str_replace('\"', '\"\"', $nValue);\n\n return $nValue;\n }", "public static function _replace_plus_with_space($val)\n {\n return str_replace('+', ' ', $val);\n }", "public function process($value, $record)\n {\n $this->processedRecord = $record;\n\n return preg_replace_callback(\n '/\\$([A-Za-z_][A-Za-z0-9_]*)/',\n array($this, 'replaceKeyword'),\n $value\n );\n }", "public function replace( $old, $new ) {\n\t\t\t if( @$old[ 0 ] == '/' ) {\n\t\t\t\t\t $this->string = preg_replace( $old, $new, $this->string );\n\t\t\t }\n\t\t\t else {\n\t\t\t\t\t $this->string = str_replace( $old, $new, $this->string );\n\t\t\t }\n\t }", "function jr_mt_prep_query_value( $value ) {\n\treturn str_ireplace( '%e2%80%8e', '', jr_mt_strtolower( trim( $value ) ) );\n}", "public function processValue($value);", "function format_value($value)\n\t{\n\t\treturn $value;\n\t}", "function setValueEscaped($value_escaped)\n {\n $this->value_escaped = $value_escaped;\n }", "function yy_r10(){if ($this->lex->strip) {\r\n $this->_retvalue = preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor);\t\r\n } else {\r\n $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;\t\r\n }\r\n }", "function e($v){ return $this->escape($v); }", "private function cleanValue($value)\n {\n $value = str_replace(\"„\", '\"', $value);\n $value = str_replace(\"“\", '\"', $value);\n return $value;\n }", "public function transform($value)\n\t{\n\t\tswitch($this->mode)\n\t\t{\n\t\t\tcase self::REPLACE:\n\t\t\t\treturn $this->string;\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase self::PREFIX:\n\t\t\t\treturn $this->string.$value;\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase self::SUFFIX:\n\t\t\t\treturn $value.$this->string;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "function escape($value) {\n\t\t$escapers = array(\"\\\\\", \"/\", \"\\\"\", \"\\n\", \"\\r\", \"\\t\", \"\\x08\", \"\\x0c\"); \n\t\t$replacements = array(\"\\\\\\\\\", \"\\\\/\", \"\\\\\\\"\", \"\\\\n\", \"\\\\r\", \"\\\\t\", \"\\\\f\", \"\\\\b\"); \n\t\t$result = str_replace($escapers, $replacements, $value); \n\t\treturn $result; \n\t}", "function trim_value(&$value){ \n \t$value = trim($value); \n\t}", "private function adjust_character_encoding($value)\n {\n }", "private function deliv_browser($value){\n\t\n\treturn \tstr_replace(\"%2B\",\"+\",$value);\n\t\n}", "private function scrubData($fieldValue)\n\t{\n\t\t$fieldValue = str_replace(chr(10), \" \", $fieldValue);\n\t\t$fieldValue = str_replace(chr(13), \" \", $fieldValue);\n\t\t$fieldValue = str_replace(\"\\r\", \" \", $fieldValue);\n\t\t$fieldValue = str_replace(\"\\n\", \" \", $fieldValue);\n\t\t$fieldValue = str_replace(\"\\r\\n\", \" \", $fieldValue);\n\t\t$fieldValue = str_replace(\"\\t\", \" \", $fieldValue);\n\t\treturn $fieldValue;\n\t}", "function trim_value(&$value)\n{\n $value = trim($value);\n}", "public abstract function escapeString(string $value) :string;", "public function value($value)\n {\n return str_replace('$', $this->sanitiseValue($value), $this->binder);\n }", "private function _insert_value($value) {\n // Grab the top item from the stack that we're currently parsing.\n $current_item = array_pop($this->_stack);\n\n // Examine the current item, and then:\n // - if it's an object, associate the newly-parsed value with the most recent key\n // - if it's an array, push the newly-parsed value to the array\n if ($current_item['type'] === 'object') {\n $current_item['value'][array_pop($this->_keys)] = $value;\n } else {\n $current_item['value'][] = $value;\n }\n\n // Replace the current item on the stack.\n $this->_stack[] = $current_item;\n }", "function trim_value(&$value) {\n $value = trim($value);\n}", "public function _replace_space_with_plus($val)\n {\n return str_replace(' ', '+', $val);\n }", "protected function value_char()\n {\n }", "protected function _doClean($value) {\n return $value;\n }", "protected function _doClean($value) {\n return $value;\n }", "public function tokenizeValue($value, $row_index = NULL);", "function change_word( $word_from, $word_to, $exclude_words, $old_value )\n{\n if ( !empty( $exclude_words ) )\n {\n // generate the array of excluded words\n $exclude = array();\n foreach ( explode( ',', $exclude_words ) as $word )\n {\n if ( empty( $word ) )\n {\n continue;\n }\n\n $exclude[] = $word;\n $exclude[] = ucfirst( $word );\n }\n\n // checked whether old value contains any of exluded words\n if ( !empty( $exclude ) && preg_match( '/' . implode( '|', $exclude ) . '/', $old_value ) )\n {\n return $old_value;\n }\n }\n\n $old_value = preg_replace( '/' . ucfirst( $word_from ) . '/', ucfirst( $word_to ), $old_value );\n return preg_replace( '/' . $word_from . '/', $word_to, $old_value );\n}", "private function withSpace(string $value): string {\n\t\treturn str_repeat(' ', $value ? 1 : 0) . $value;\n\t}", "protected function parseValue()\n {\n\n if ( isset( $this->value ) ) {\n\n return 'value=\"' . $this->value . '\"';\n }\n\n }", "protected function parseValue($value){\n\t\treturn $value;\n\t}", "public function cleanData($value)\n\t{\n\t\t$value = preg_replace('/\\xA0/u', ' ', $value); //Elimina %C2%A0 del principio y resto de espacios\n\t\t$value = trim(str_replace(array(\"\\r\", \"\\n\"), '', $value)); //elimina saltos de linea al principio y final\n\t\treturn $value;\n\t}", "public function cleanData($value)\n\t{\n\t\t$value = preg_replace('/\\xA0/u', ' ', $value); //Elimina %C2%A0 del principio y resto de espacios\n\t\t$value = trim(str_replace(array(\"\\r\", \"\\n\"), '', $value)); //elimina saltos de linea al principio y final\n\t\treturn $value;\n }", "public function walkValue( Value $value ) {\n\t\t// TODO: Check how the value should be passed with wpdb.\n\t\treturn '?';\n\t}", "function changeV($v1)\n{\n//WARNING! DO NOT USE FOR EMAILS ! Function removes the @ sign and the fullstop!\n\n//\t$Cust_Addr = strtr($Cust_Addr, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n//\t$Cust_Addr = preg_replace('/\\s/u', '_', $Cust_Addr);//this baby also does the trick!!!\n\n//$html_reg = '/<+\\s*\\/*\\s*([A-Z][A-Z0-9]*)\\b[^>]*\\/*\\s*>+/i';\n//$v1 = htmlentities( preg_replace( $html_reg, '', $v1 ) );\n//echo \"<br>after htmlent:\".$v1.\"<br><br><br>\";\n$v1 = preg_replace(\"/'/\",\"_\",$v1);\n//$v1 = preg_replace(\"/‘/\",\"_\",$v1);\n$v1 = preg_replace(\"/’/\",\"_\",$v1);\n$v1 = preg_replace(\"/&/\",\"and\",$v1);\n$v1 = preg_replace(\"/,/\",\"+\",$v1);\n$v1 = preg_replace(\"/…/\",\".\",$v1);\n\n$v1 = preg_replace(\"/&nbsp;/\",\"_\",$v1);\n$v1 = preg_replace(\"/ /\",\"_\",$v1);\n$v1 = str_replace(' ', '_', $v1);\n$v1 = preg_replace(\"/\\xA0\\xA0/\",\"_\",$v1);\n$v1 = str_replace(' ', '_', $v1);\n\n//$v1 = strtr($v1, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n\n$v1 = str_replace(\" \",\"_\", $v1); //this baby works for ENotes\n$v1 = str_replace(\"&nbsp;\",\"_\",$v1);\n\n//echo \"<br>afterstreplacec:\".$v1.\"<br><br><br>\";\n\n$old_pattern = array(\"/[^a-zA-Z0-9]/\", \"/_+/\", \"/_$/\");\n$new_pattern = array(\"_\", \"_\", \"\");\n$v2 = preg_replace($old_pattern, $new_pattern , $v1);\n//All characters but a to z, A to z and 0 to 9 are replaced by an underscore. Multiple connected underscores are reduced to a single underscore and trailing underscores are removed.\n//echo \"loading function ChangeV\";\n//return $v2;\nreturn $v1;\n}", "function clean_value($val)\n{\n\t// Thanks for this function go to Istari from theamazonbasin.com\n\tif ($val == \"\")\n\t{\n\t\treturn $val;\n\t}\n\n\t$val = str_replace( \"&#032;\", \" \", $val );\n\t$val = str_replace( chr(0xCA), \"\", $val ); //Remove sneaky spaces\n\t\n\t$val = str_replace( \"&\" , \"&amp;\" , $val );\n\t$val = str_replace( \"<!--\" , \"&#60;&#33;--\" , $val );\n\t$val = str_replace( \"-->\" , \"--&#62;\" , $val );\n\t$val = preg_replace( \"/<script/i\" , \"&#60;script\" , $val );\n\t$val = str_replace( \">\" , \"&gt;\" , $val );\n\t$val = str_replace( \"<\" , \"&lt;\" , $val );\n\t$val = str_replace( \"\\\"\" , \"&quot;\" , $val );\n\t$val = preg_replace( \"/\\n/\" , \"<br />\" , $val ); // Convert literal newlines\n\t$val = preg_replace( \"/\\\\\\$/\" , \"&#036;\" , $val );\n\t$val = preg_replace( \"/\\r/\" , \"\" , $val ); // Remove literal carriage returns\n\t$val = str_replace( \"!\" , \"&#33;\" , $val );\n\t$val = str_replace( \"'\" , \"&#39;\" , $val ); // IMPORTANT: It helps to increase sql query safety.\n\t\n\t// Ensure unicode chars are OK\n\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val );\n\t\n\t// Swap user inputted backslashes\n\t$val = preg_replace( \"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $val );\n\t\n\treturn $val;\n}", "protected function cleanValue($value)\n {\n return str_replace(array('%', '-', '+'), '', $value);\n }", "protected static function prepareValue($value)\n {\n return trim($value, \", \\t\\n\\r\\0\\x0B\");\n }", "public function keepClean($value){\n\t\tstr_replace(\" \", \" \", $value);\n\t\t$val = $value;\n\t\t$datos = bin2hex($val);\n\t\tfor($i = 0 ; $i < strlen($datos) ; $i+=2 )\n\t\t\t$chars[] = substr($datos,$i,2);\n\t\t$val = \"\";\n\t\tforeach($chars as $c)\n\t\t\tif($c!=\"0a\")\n\t\t\t$val = $val.chr(hexdec($c));\n\t\t$excepciones = explode(\",\", TXT_WYSIWYG);\n\t\tif (is_array($excepciones)) {\n\t\t\tforeach ($excepciones as $excepcion => $exc){\n\t\t\t\tif(strcmp(\"comma\",$exc)==0)\n\t\t\t\t\t$val = str_replace(\",\",\"\",$val);\n\t\t\t\telse\n\t\t\t\t\t$val = str_replace($exc,\"\",$val);\n\t\t\t}\n\t\t}\n\t\treturn $val;\n\t}", "public function escapeString($value);", "function str_finish($value, $cap)\n\t{\n\t\treturn Str::finish($value, $cap);\n\t}", "function trimer($value) \n{\n\treturn trim(html_entity_decode($value), \" \\t\\n\\r\\0\\x0B\\xC2\\xA0\");\n}", "function item_sorter_compare_value($current_value, $new_value)\r\n\t{\r\n\t\tif(preg_match('/(\\d+)\\/(\\d+)\\/(\\d+) (\\d+:\\d+:\\d+)/', $new_value, $match))\r\n\t\t{\r\n\t\t\t$new_value = $match[3].'/'.$match[2].'/'.$match[1].' '.$match[4];\t\r\n\t\t}\r\n\t\telse if(preg_match('/(\\d+)\\/(\\d+)\\/(\\d+)/', $new_value, $match))\r\n\t\t{\r\n\t\t\t$new_value = $match[3].'/'.$match[2].'/'.$match[1];\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif(empty($current_value))\r\n\t\t{\r\n\t\t\treturn $new_value;\t\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($new_value))\r\n\t\t{\r\n\t\t\treturn $current_value;\t\r\n\t\t}\r\n\t\t\r\n\t\t// this is desc so we want a higher value\r\n\t\tif($this->sort_direction==-1)\r\n\t\t{\r\n\t\t\tif($new_value > $current_value)\r\n\t\t\t{\r\n\t\t\t\t$current_value = $new_value;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t// this is asc so we want a lower value\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($new_value < $current_value)\r\n\t\t\t{\r\n\t\t\t\t$current_value = $new_value;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $current_value;\r\n\t}", "function character_data($parser, $data) {\n $data = trim(api_utf8_decode($data));\n global $current_value;\n $current_value = $data;\n }", "function edit_value() {\n global $_field, $_value, $_newval;\n if ($_newval == '') {\n sql_delete_value($_field, $_value);\n } else {\n sql_update_value($_field, $_value, $_newval);\n }\n index();\n}", "public function setValue($new_value)\n {\n // simple value\n if (!is_array($this->value)) {\n $this->value = htmlentities($new_value, ENT_COMPAT, 'UTF-8', false);\n return;\n }\n // multiples-values (checkbox, radio, select)\n if (!is_array($new_value)) {\n $new_value = array($new_value);\n }\n foreach ($new_value as $i) {\n $this->selected_values[intval($i)] = true;\n }\n }", "function osubs_combine( $value ) {\n\t\tif ( empty( $value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$pattern = \"/([-–—]{1})\\s/i\";\n\t\t$replacement = \"$1&nbsp;\";\n\n\t\treturn preg_replace( $pattern, $replacement, $value );\n\t}", "protected function wrapValue($value)\n\t{\n return $value;\n\t}", "public function parse_tags_spaces_field($value)\n {\n }", "public function escape ( $value )\n\t{\n\t\treturn $value;\n\t}", "public function textModifier($name, $value);", "public function parse_backorders_field($value)\n {\n }", "public function quoteSmart($value){\n if( !is_numeric($value) ){\n\t $value = addslashes($value);\n\t}\n\treturn $value;\n }" ]
[ "0.59249574", "0.56167024", "0.5603858", "0.53163993", "0.5163295", "0.51395106", "0.51072073", "0.50707704", "0.5056794", "0.50274533", "0.5022357", "0.5002943", "0.49806383", "0.49491614", "0.49480823", "0.4943412", "0.49369866", "0.49312285", "0.4926966", "0.48944825", "0.48943523", "0.48936903", "0.48839524", "0.48817226", "0.48687094", "0.48601973", "0.4851969", "0.4830145", "0.4818632", "0.4807342", "0.48066148", "0.4799669", "0.47878903", "0.47826356", "0.47764778", "0.4775063", "0.47683433", "0.4763834", "0.47609878", "0.47597063", "0.4756104", "0.47485104", "0.4743932", "0.47432882", "0.47411355", "0.47319746", "0.47303745", "0.47270483", "0.4726541", "0.47198814", "0.47173864", "0.4700726", "0.46994436", "0.46978864", "0.4680231", "0.4678972", "0.467864", "0.46689105", "0.46681774", "0.46668592", "0.4661319", "0.46592945", "0.46540245", "0.46502694", "0.46474484", "0.4647198", "0.4645778", "0.46454468", "0.46426815", "0.4639303", "0.46344954", "0.463188", "0.463188", "0.46304125", "0.46261108", "0.46257478", "0.46212617", "0.46199825", "0.4618422", "0.46122584", "0.46113035", "0.45938775", "0.4593431", "0.45912227", "0.45903224", "0.4576659", "0.45758408", "0.45720163", "0.4569155", "0.4561023", "0.45571592", "0.45561007", "0.45527676", "0.4551616", "0.45461538", "0.45455158", "0.4539532", "0.45359933", "0.4530789", "0.4528515" ]
0.7403429
0
function TestPRN, Parameter list: $item Verifies brazilian PRN, rejects if invalid.
Функция TestPRN, список параметров: $item Проверяет бразильский PRN, отвергает при недействительном.
function TestPRN($prn) { $body = substr($prn,0,9); $dv = substr($prn,9,2); $d1 = 0; for ($i = 0; $i < 9; $i++) { $d1 += intval( substr ($body, $i, 1)) * (10 - $i); } $res=TRUE; if ($d1 == 0) { $res=FALSE; } $d1 = 11 - ($d1 % 11); if ($d1 > 9) { $d1 = 0; } if (substr ($dv, 0, 1) != $d1) { $res=FALSE; } $d1 *= 2; for ($i = 0; $i < 9; $i++) { $d1 += intval(substr($body, $i, 1)) * (11 - $i); } $d1 = 11 - ($d1 % 11); if ($d1 > 9) { $d1 = 0; } if (substr ($dv, 1, 1) != $d1) { $res=FALSE; } if (!$res) { $this->ApplicationObj()->AddHtmlStatusMessage("CPF ".$prn." Inválido!"); echo $this->H(5,"CPF ".$prn." Inválido!"); } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function booknet_utilities_validISBN($testisbn) {\n\treturn (preg_match (\"([0-9]{10})\", $testisbn, $regs) || preg_match (\"([0-9]{13})\", $testisbn, $regs));\n}", "public static function check_item ( $item ) {\n\t}", "abstract protected function validateIpn();", "function isValidItem ($item) {\n\t\treturn preg_match('/^Q?[0-9]+$/', $item);\n\t}", "abstract public function validate( $item );", "public function testPostal()\n {\n $this->assertTrue(InValidation::postal('500091'));\n $this->assertTrue(InValidation::postal('500 091'));\n\n $this->assertFalse(InValidation::postal('50009 1'));\n $this->assertFalse(InValidation::postal('test'));\n $this->assertFalse(InValidation::postal('1234567'));\n }", "public function testPostal()\n {\n $this->assertTrue(AuValidation::postal('2300'));\n $this->assertFalse(AuValidation::postal('02300'));\n }", "public function validateIpn($parameters = array())\r\n\t{\r\n\t\t// retrieve the parameters\r\n\t\t$this->ipnData = $parameters;\r\n\t\t$parameters[\"cmd\"] = \"_notify-validate\";\r\n\t\t$browser = new sfWebBrowser(array(\"Content-type: application/x-www-form-urlencoded\\r\\n\",\"Connection: close\\r\\n\\r\\n\"));\r\n\t\t$browser->post($this->gatewayUrl, $parameters);\r\n\t\t\r\n\t\t$this->ipnResponse= $browser->getResponseText();\r\n\t\t\r\n\t\tif($browser->getResponseText() === \"VERIFIED\")\r\n {\r\n // Valid IPN transaction.\r\n $this->logResults(true);\r\n return true;\r\n }\r\n else\r\n {\r\n \t// Invalid IPN transaction. Check the log for details.\r\n $this->lastError = \"IPN Validation Failed . \".$this->gatewayUrl;\r\n $this->logResults(false);\r\n return false;\r\n }\r\n\t}", "public function testInModuleListBadItem(): void\n {\n $result = $this->Validator->inModuleList('FOO', 'Common', 'currencies');\n $this->assertTrue(is_string($result), 'Expected error string');\n $this->assertContains('Invalid list item', $result);\n }", "function validatePpp()\n{\n global $self, $CONFIG;\n\n if (!isset($self['ppp']) || $self['ppp'] == '') {\n $self['ppp'] = $CONFIG['postperpage'];\n } else {\n $self['ppp'] = is_numeric($self['ppp']) ? (int) $self['ppp'] : $CONFIG['postperpage'];\n }\n\n if ($self['ppp'] < 5) {\n $self['ppp'] = 30;\n }\n}", "function checkPaypalIps ($test_ipn) {\n\n\t\treturn;\n\t\t// Get the list of IP addresses for www.paypal.com and notify.paypal.com\n\n\t\t$swed_iplist = gethostbynamel ('www.paypal.com');\n\t\t$swed_iplist2 = gethostbynamel ('notify.paypal.com');\n\t\t$swed_iplist3 = array('216.113.188.202', '216.113.188.203', '216.113.188.204', '66.211.170.66');\n\t\t$swed_iplist = array_merge ($swed_iplist, $swed_iplist2, $swed_iplist3);\n\n\t\t$swed_sandbox_hostname = 'ipn.sandbox.paypal.com';\n\t\t$remote_hostname = gethostbyaddr ($_SERVER['REMOTE_ADDR']);\n\n\t\t$valid_ip = FALSE;\n\n\t\tif ($swed_sandbox_hostname == $remote_hostname) {\n\t\t\t$valid_ip = TRUE;\n\t\t\t$hostname = 'www.sandbox.paypal.com';\n\t\t} else {\n\t\t\t$ips = \"\";\n\t\t\t// Loop through all allowed IPs and test if the remote IP connected here\n\t\t\t// is a valid IP address\n\t\t\tif (in_array ($_SERVER['REMOTE_ADDR'], $swed_iplist)) {\n\t\t\t\t$valid_ip = TRUE;\n\t\t\t}\n\t\t\t$hostname = 'www.paypal.com';\n\t\t}\n\n\t\tif (!$valid_ip) {\n\n\t\t\t$mailsubject = \"PayPal IPN Transaction on your site: Possible fraud\";\n\t\t\t$mailbody = \"Error code 506. Possible fraud. Error with REMOTE IP ADDRESS = \" . $_SERVER['REMOTE_ADDR'] . \".\n The remote address of the script posting to this notify script does not match a valid PayPal ip address\\n\n These are the valid IP Addresses: $ips\n\n The Order ID received was: $invoice\";\n\n\t\t\t$this->sendEmailToVendorAndAdmins ($mailsubject, $mailbody);\n\n\t\t\texit();\n\t\t}\n\n\t\tif (!($hostname == \"www.sandbox.paypal.com\" && $test_ipn == 1)) {\n\t\t\t$res = \"FAILED\";\n\t\t\t$mailsubject = \"PayPal Sandbox Transaction\";\n\t\t\t$mailbody = \"Hello,\n\t\tA fatal error occurred while processing a paypal transaction.\n\t\t----------------------------------\n\t\tHostname: $hostname\n\t\tURI: $uri\n\t\tA Paypal transaction was made using the sandbox without your site in Paypal-Debug-Mode\";\n\t\t\t//vmMail($mosConfig_mailfrom, $mosConfig_fromname, $debug_email_address, $mailsubject, $mailbody );\n\t\t\t$this->sendEmailToVendorAndAdmins ($mailsubject, $mailbody);\n\t\t\texit();\n\t\t}\n\t}", "public function testPhonePostalSsnPass() {\n\t\t$this->assertTrue ( Validation::postal ( 'text', null, 'testNl' ) );\n\t\t$this->assertTrue ( Validation::phone ( 'text', null, 'testDe' ) );\n\t\t$this->assertTrue ( Validation::ssn ( 'text', null, 'testNl' ) );\n\t}", "public function verifyIPN()\r\r\n {\r\r\n if ( ! count($_POST)) {\r\r\n throw new Exception(\"Missing POST Data\");\r\r\n }\r\r\n \r\r\n $raw_post_data = file_get_contents('php://input');\r\r\n $raw_post_array = explode('&', $raw_post_data);\r\r\n $myPost = array();\r\r\n foreach ($raw_post_array as $keyval) {\r\r\n $keyval = explode('=', $keyval);\r\r\n if (count($keyval) == 2) {\r\r\n // Since we do not want the plus in the datetime string to be encoded to a space, we manually encode it.\r\r\n if ($keyval[0] === 'payment_date') {\r\r\n if (substr_count($keyval[1], '+') === 1) {\r\r\n $keyval[1] = str_replace('+', '%2B', $keyval[1]);\r\r\n }\r\r\n }\r\r\n $myPost[$keyval[0]] = urldecode($keyval[1]);\r\r\n }\r\r\n }\r\r\n // Build the body of the verification post request, adding the _notify-validate command.\r\r\n $req = 'cmd=_notify-validate';\r\r\n $get_magic_quotes_exists = false;\r\r\n if (function_exists('get_magic_quotes_gpc')) {\r\r\n $get_magic_quotes_exists = true;\r\r\n }\r\r\n foreach ($myPost as $key => $value) {\r\r\n if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {\r\r\n $value = urlencode(stripslashes($value));\r\r\n } else {\r\r\n $value = urlencode($value);\r\r\n }\r\r\n $req .= \"&$key=$value\";\r\r\n }\r\r\n // Post the data back to PayPal, using curl. Throw exceptions if errors occur.\r\r\n $ch = curl_init($this->getPaypalUri());\r\r\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\r\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\r\r\n curl_setopt($ch, CURLOPT_SSLVERSION, 6);\r\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\r\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\r\r\n // This is often required if the server is missing a global cert bundle, or is using an outdated one.\r\r\n if ($this->use_local_certs) {\r\r\n curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . \"/cert/cacert.pem\");\r\r\n }\r\r\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\r\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\r\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\r\r\n $res = curl_exec($ch);\r\r\n if ( ! ($res)) {\r\r\n $errno = curl_errno($ch);\r\r\n $errstr = curl_error($ch);\r\r\n curl_close($ch);\r\r\n throw new Exception(\"cURL error: [$errno] $errstr\");\r\r\n }\r\r\n $info = curl_getinfo($ch);\r\r\n $http_code = $info['http_code'];\r\r\n if ($http_code != 200) {\r\r\n throw new Exception(\"PayPal responded with http code $http_code\");\r\r\n }\r\r\n curl_close($ch);\r\r\n // Check if PayPal verifies the IPN data, and if so, return true.\r\r\n if ($res == self::VALID) {\r\r\n return true;\r\r\n } else {\r\r\n return false;\r\r\n }\r\r\n }", "function simple_service_support_validate_person($item)\n{\n $messages = array();\n\n if (empty($item['name'])) $messages[] = __('Name is required', 'simple_service_support');\n if (!empty($item['email']) && !is_email($item['email'])) $messages[] = __('E-Mail is in wrong format', 'simple_service_support');\n // if (!ctype_digit($item['age'])) $messages[] = __('Age in wrong format', 'simple_service_support');\n //if(!empty($item['age']) && !absint(intval($item['age']))) $messages[] = __('Age can not be less than zero');\n if(!empty($item['plomba']) && !preg_match('/[0-9]+/', $item['plomba'])) $messages[] = __('Plomba must be number');\n //...\n\n if (empty($messages)) return true;\n return implode('<br />', $messages);\n}", "public function testPassThroughMethod() {\n\t\t$this->assertTrue ( Validation::postal ( 'text', null, 'testNl' ) );\n\t}", "function isbnVerify($isbn, $isbnCheck) {\n\t\n\tif ($isbnCheck % 11 ==0) { #divisiblity test\n\t\tprint \"$isbn is Valid!\";\n\t} else {\n\t\tprint \"$isbn is NOT Valid!\";\n\t}\n}", "function VerifyPaypalIPN(array $IPN = null){\n\t error_log(\"RUNNING\", 0);\n\n if(empty($IPN)){\n $IPN = $_POST;\n\t\n\terror_log(\"EMPTY IPN\", 0);\n\n\t foreach ($_POST as $key => $value) {\nerror_log($key.\"=\".$value,0);\n\n//[Fri Nov 27 17:42:34.884180 2015] [:error] [pid 15911] [client 104.194.100.143:57372] mc_gross=6.99\n//[Fri Nov 27 17:42:34.884229 2015] [:error] [pid 15911] [client 104.194.100.143:57372] protection_eligibility=Ineligible\n//[Fri Nov 27 17:42:34.884276 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_status=confirmed\n//[Fri Nov 27 17:42:34.884316 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payer_id=BG43B994VAFWJ\n//[Fri Nov 27 17:42:34.884360 2015] [:error] [pid 15911] [client 104.194.100.143:57372] tax=0.00\n//[Fri Nov 27 17:42:34.884401 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_street=1 Main St\n//[Fri Nov 27 17:42:34.884440 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payment_date=15:42:17 Nov 27, 2015 PST\n//[Fri Nov 27 17:42:34.884480 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payment_status=Pending\n//[Fri Nov 27 17:42:34.884525 2015] [:error] [pid 15911] [client 104.194.100.143:57372] charset=windows-1252\n//[Fri Nov 27 17:42:34.884570 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_zip=95131\n//[Fri Nov 27 17:42:34.884615 2015] [:error] [pid 15911] [client 104.194.100.143:57372] first_name=default\n//[Fri Nov 27 17:42:34.884655 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_country_code=US\n//[Fri Nov 27 17:42:34.884694 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_name=default user\n//[Fri Nov 27 17:42:34.884739 2015] [:error] [pid 15911] [client 104.194.100.143:57372] notify_version=3.8\n//[Fri Nov 27 17:42:34.884785 2015] [:error] [pid 15911] [client 104.194.100.143:57372] custom=\n//[Fri Nov 27 17:42:34.884830 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payer_status=verified\n//[Fri Nov 27 17:42:34.884870 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_country=United States\n//[Fri Nov 27 17:42:34.884925 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_city=San Jose\n//[Fri Nov 27 17:42:34.884969 2015] [:error] [pid 15911] [client 104.194.100.143:57372] quantity=1\n//[Fri Nov 27 17:42:34.885014 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payer_email=default@iit.edu\n//[Fri Nov 27 17:42:34.885060 2015] [:error] [pid 15911] [client 104.194.100.143:57372] verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AL6.3oZlZmJvRwirWnbHYwzYeDt6\n//[Fri Nov 27 17:42:34.885107 2015] [:error] [pid 15911] [client 104.194.100.143:57372] txn_id=35B29021J09358213\n//[Fri Nov 27 17:42:34.885153 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payment_type=instant\n//[Fri Nov 27 17:42:34.885193 2015] [:error] [pid 15911] [client 104.194.100.143:57372] last_name=user\n//[Fri Nov 27 17:42:34.885238 2015] [:error] [pid 15911] [client 104.194.100.143:57372] address_state=CA\n//[Fri Nov 27 17:42:34.885279 2015] [:error] [pid 15911] [client 104.194.100.143:57372] receiver_email=blah@foo.net\n//[Fri Nov 27 17:42:34.885318 2015] [:error] [pid 15911] [client 104.194.100.143:57372] pending_reason=unilateral\n//[Fri Nov 27 17:42:34.885357 2015] [:error] [pid 15911] [client 104.194.100.143:57372] txn_type=web_accept\n//[Fri Nov 27 17:42:34.885402 2015] [:error] [pid 15911] [client 104.194.100.143:57372] item_name=test jkhkhk\n//[Fri Nov 27 17:42:34.885483 2015] [:error] [pid 15911] [client 104.194.100.143:57372] mc_currency=USD\n//[Fri Nov 27 17:42:34.885522 2015] [:error] [pid 15911] [client 104.194.100.143:57372] item_number=\n//[Fri Nov 27 17:42:34.885559 2015] [:error] [pid 15911] [client 104.194.100.143:57372] residence_country=US\n//[Fri Nov 27 17:42:34.885603 2015] [:error] [pid 15911] [client 104.194.100.143:57372] test_ipn=1\n//[Fri Nov 27 17:42:34.885641 2015] [:error] [pid 15911] [client 104.194.100.143:57372] handling_amount=0.00\n//[Fri Nov 27 17:42:34.885679 2015] [:error] [pid 15911] [client 104.194.100.143:57372] transaction_subject=\n//[Fri Nov 27 17:42:34.885717 2015] [:error] [pid 15911] [client 104.194.100.143:57372] payment_gross=6.99\n//[Fri Nov 27 17:42:34.885760 2015] [:error] [pid 15911] [client 104.194.100.143:57372] shipping=0.00\n//[Fri Nov 27 17:42:34.885799 2015] [:error] [pid 15911] [client 104.194.100.143:57372] auth=Alcv8Wo.aV7K-lDIsPlmj4MGtS3qBvfu6daWIsqUwTpy81hNBCmHCK-DQvnMFzwapmHr3Kd1PDNPPu.hSO.vNDg\n//[Fri Nov 27 17:42:35.808141 2015] [:error] [pid 15911] [client 104.194.100.143:57372] VERIFIED\n\n\n\n}\n }\n if(empty($IPN['verify_sign'])){\n\t error_log(\"verifysign\", 0);\n return null;\n }\n $IPN['cmd'] = '_notify-validate';\n $PaypalHost = (empty($IPN['test_ipn']) ? 'www' : 'www.sandbox').'.paypal.com';\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($cURL, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($cURL, CURLOPT_URL, \"https://{$PaypalHost}/cgi-bin/webscr\");\n curl_setopt($cURL, CURLOPT_ENCODING, 'gzip');\n curl_setopt($cURL, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($cURL, CURLOPT_POST, true); // POST back\n curl_setopt($cURL, CURLOPT_POSTFIELDS, $IPN); // the $IPN\n curl_setopt($cURL, CURLOPT_HEADER, false);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($cURL, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($cURL, CURLOPT_FORBID_REUSE, true);\n curl_setopt($cURL, CURLOPT_FRESH_CONNECT, true);\n curl_setopt($cURL, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($cURL, CURLOPT_TIMEOUT, 60);\n curl_setopt($cURL, CURLINFO_HEADER_OUT, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Connection: close',\n 'Expect: ',\n ));\n $Response = curl_exec($cURL);\n $Status = (int)curl_getinfo($cURL, CURLINFO_HTTP_CODE);\n curl_close($cURL);\n if(empty($Response) or !preg_match('~^(VERIFIED|INVALID)$~i', $Response = trim($Response)) or !$Status){\n\terror_log(\"GREENULL\", 0);\n return null;\n }\n if(intval($Status / 100) != 2){\n\terror_log(\"STATUSFALSE\", 0);\n return false;\n }\n\terror_log(\"VERIFIED\", 0);\n return !strcasecmp($Response, 'VERIFIED');\n}", "function handleNoPnr($config, $input) {\n $items = $input[\"items\"];\n if(sizeof($items) == 1) {\n $mysqli = getDBConnection($config);\n $mysqli->autocommit(FALSE);\n $items = getNameForItems($items, $mysqli);\n $name = $items[0][\"name\"];\n $price = cleanField($items[0][\"price\"], $mysqli);\n $signed = $_SESSION[\"pnr\"];\n $sql = \"SELECT price, `table` FROM prices WHERE name = '$name'\";\n $result = $mysqli->query($sql);\n if($result) {\n $row = $result->fetch_row();\n if($row && $row[1] == \"ten_card\" && $price == $row[0]) {\n $card = rand (1000000, 9999999);\n $token = bin2hex(random_bytes(25));\n $customerName = $input[\"name\"];\n $sql = \"INSERT INTO ten_card (card, signed, receipt, customer_name) VALUES ('$card', '$signed', '$token', '$customerName')\";\n $result = $mysqli->real_query($sql);\n if($result) {\n $sql = \"INSERT INTO item (name, price, signed) VALUES ('$name($card)', '$price', '$signed')\";\n $result = $mysqli->real_query($sql);\n if($result) {\n echo \"{\\\"reference\\\":\\\"$card\\\"}\";\n $mysqli->commit();\n $mysqli->close();\n return;\n }\n }\n } else if($row[1] != \"ten_card\") {\n error(\"Not ten card. Missing member id\");\n } \n }\n $mysqli->rollback();\n $mysqli->close();\n }\n error(\"Failed to add anonymous card\");\n }", "function isvalid($item, $type) {\r\n $isvalid = 0;\r\n\r\n // $type can be port, date, time, pax, and notes\r\n switch ($type) {\r\n case 'port':\r\n $isvalid = preg_match(\"#^[0-9a-zA-Z]+$#\", $item);\r\n break;\r\n case 'date':\r\n if ($item == '') {\r\n $isvalid = 1;\r\n } else {\r\n $isvalid = preg_match(\"#^[0-9]{4}\\-((0?[1-9])|(10)|(11)|(12))\\-([0-3]?[0-9])$#\", $item);\r\n }\r\n break;\r\n case 'time':\r\n if ($item == '') {\r\n $isvalid = 1;\r\n } else {\r\n $isvalid = preg_match(\"#^(([0-1]?[0-9])|(20)|(21)|(22)|(23)):([0-5][0-9])$#\", $item);\r\n }\r\n break;\r\n case 'pax':\r\n $isvalid = preg_match(\"#^[0-9]+$#\", $item);\r\n// if (! preg_match(\"#^[0-9]+$#\", $item))\r\n// $isvalid = 0;\r\n break;\r\n };\r\n\r\n// echo $isvalid;\r\n return($isvalid);\r\n }", "function validateIpn()\n\t{\n\t\t$ipnData = $_POST;\n\t\t\n\t\tif($ipnData['invoice_id'] && $ipnData['vendor_order_id'])\n\t\t{\n\t\t\t\n\t\t\t$this->ipnData = $ipnData;\n\t\t\treturn true;\t\n\t\t}\n\t\t\n\t\treturn false;\t\t\n\t}", "public function verifyIPN() {\n if (!count($_POST)) {\n throw new Exception(\"Missing POST Data\");\n }\n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode('=', $keyval);\n if (count($keyval) == 2) {\n // Since we do not want the plus in the datetime string to be encoded to a space, we manually encode it.\n if ($keyval[0] === 'payment_date') {\n if (substr_count($keyval[1], '+') === 1) {\n $keyval[1] = str_replace('+', '%2B', $keyval[1]);\n }\n }\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n }\n // Build the body of the verification post request, adding the _notify-validate command.\n $req = 'cmd=_notify-validate';\n $get_magic_quotes_exists = false;\n if (function_exists('get_magic_quotes_gpc')) {\n $get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {\n $value = urlencode(stripslashes($value));\n } else {\n $value = urlencode($value);\n }\n $req .= \"&$key=$value\";\n }\n // Post the data back to PayPal, using curl. Throw exceptions if errors occur.\n $ch = curl_init($this->getPaypalUri());\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSLVERSION, 6);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n // This is often required if the server is missing a global cert bundle, or is using an outdated one.\n if ($this->use_local_certs) {\n curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . \"/cert/cacert.pem\");\n }\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\n $res = curl_exec($ch);\n if (!($res)) {\n $errno = curl_errno($ch);\n $errstr = curl_error($ch);\n curl_close($ch);\n throw new \\Exception(\"cURL error: [$errno] $errstr\");\n }\n $info = curl_getinfo($ch);\n $http_code = $info['http_code'];\n if ($http_code != 200) {\n throw new \\Exception(\"PayPal responded with http code $http_code\");\n }\n curl_close($ch);\n // Check if PayPal verifies the IPN data, and if so, return true.\n if ($res == self::VALID) {\n return true;\n } else {\n return false;\n }\n }", "public function testShouldNotCreateItemIfNotValidWithAllParameters()\r\n {\r\n // when\r\n $notValidItem = false;\r\n try {\r\n new Item('', null);\r\n } catch (ReceiptException $e) {\r\n $notValidItem = true;\r\n $this->assertContains(ReceiptErrorCode::ITEM_NULL, $e->getErrorCodes());\r\n $this->assertContains(ReceiptErrorCode::PRICE_NULL, $e->getErrorCodes());\r\n }\r\n\r\n // then\r\n $this->assertTrue($notValidItem);\r\n\r\n // when\r\n $notValidItem = false;\r\n try {\r\n new Item('', 0.50);\r\n } catch (ReceiptException $e) {\r\n $notValidItem = true;\r\n $this->assertContains(ReceiptErrorCode::ITEM_NULL, $e->getErrorCodes());\r\n $this->assertNotContains(ReceiptErrorCode::PRICE_NULL, $e->getErrorCodes());\r\n }\r\n\r\n // then\r\n $this->assertTrue($notValidItem);\r\n\r\n // when\r\n $notValidItem = false;\r\n try {\r\n new Item('Baked Beans', null);\r\n } catch (ReceiptException $e) {\r\n $notValidItem = true;\r\n $this->assertNotContains(ReceiptErrorCode::ITEM_NULL, $e->getErrorCodes());\r\n $this->assertContains(ReceiptErrorCode::PRICE_NULL, $e->getErrorCodes());\r\n }\r\n\r\n // then\r\n $this->assertTrue($notValidItem);\r\n }", "public function invalid($item)\n {\n\n }", "public function testCanGetIsbnInfoWithValidIsbnCode()\n {\n # TEST GOOGLE PROVIDER\n foreach ($this->valid_isbns as $isbn)\n {\n $Isbn = new Isbn($isbn);\n $this->assertArrayHasKey('status', $Isbn->data);\n $this->assertEquals('success', $Isbn->data['status']);\n }\n }", "function validate_ipn() {\n\t\t$url_parsed=parse_url($this->paypal_url);\n\n\t\t// generate the post string from the _POST vars aswell as load the\n\t\t// _POST vars into an arry so we can play with them from the calling\n\t\t// script.\n\t\t$post_string = '';\n\t\tforeach ($_POST as $field=>$value) {\n\t\t\t$this->ipn_data[\"$field\"] = $value;\n\t\t\t$post_string .= $field.'='.urlencode(stripslashes($value)).'&';\n\t\t}\n\t\t$post_string.=\"cmd=_notify-validate\"; // append ipn command\n\n\t\t// open the connection to paypal\n\t\t$fp = fsockopen($url_parsed['host'],\"80\",$err_num,$err_str,30);\n\t\tif(!$fp) {\n\n\t\t\t// could not open the connection. If loggin is on, the error message\n\t\t\t// will be in the log.\n\t\t\t$this->last_error = \"fsockopen error no. $errnum: $errstr\";\n\t\t\t$this->log_ipn_results(false);\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t// Post the data back to paypal\n\t\t\tfputs($fp, \"POST $url_parsed[path] HTTP/1.1\\r\\n\");\n\t\t\tfputs($fp, \"Host: $url_parsed[host]\\r\\n\");\n\t\t\tfputs($fp, \"Content-type: application/x-www-form-urlencoded\\r\\n\");\n\t\t\tfputs($fp, \"Content-length: \".strlen($post_string).\"\\r\\n\");\n\t\t\tfputs($fp, \"Connection: close\\r\\n\\r\\n\");\n\t\t\tfputs($fp, $post_string . \"\\r\\n\\r\\n\");\n\n\t\t\t// loop through the response from the server and append to variable\n\t\t\twhile(!feof($fp)) {\n\t\t\t\t$this->ipn_response .= fgets($fp, 1024);\n\t\t\t}\n\n\t\t\tfclose($fp); // close connection\n\n\t\t}\n\n\t\tif (eregi(\"VERIFIED\",$this->ipn_response)) {\n\n\t\t\t// Valid IPN transaction.\n\t\t\t$this->log_ipn_results(true);\n\n\t\t\t//do some backend updates\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\t// Invalid IPN transaction. Check the log for details.\n\t\t\t$this->last_error = 'IPN Validation Failed.';\n\t\t\t$this->log_ipn_results(false);\n\t\t\treturn false;\n\n\t\t}\n\n\t}", "function validateISBN(string $isbn): string {\n return $isbn;\n}", "function check_ipn_response() {\n\t\t\t\n\t\tif (isset($_GET['paypalListener']) && $_GET['paypalListener'] == 'paypal_standard_IPN'):\n\t\t\n \t$_POST = stripslashes_deep($_POST);\n \t\n \tif ($this->check_ipn_request_is_valid()) :\n \t\n \tdo_action(\"valid-paypal-standard-ipn-request\", $_POST);\n\n \t\tendif;\n \t\t\n \tendif;\n\t\t\t\n\t}", "function validate_ipn() {\r\n\r\n // Paypalurl wird verarbeitet\r\n $url_parsed=parse_url($this->paypal_url); \r\n\r\n // Post String zusammenbauen\r\n $post_string = ''; \r\n foreach ($_POST as $field=>$value) { \r\n $this->ipn_data[\"$field\"] = $value;\r\n $post_string .= $field.'='.urlencode(stripslashes($value)).'&'; \r\n }\r\n $post_string.=\"cmd=_notify-validate\"; \r\n\r\n // Verbindung mit Paypal herstellen\r\n $fp = fsockopen($url_parsed[host],\"80\",$err_num,$err_str,30); \r\n if(!$fp) {\r\n \r\n // wenns nicht funktioniert hat wird der Error gelogged, falls Logging aktiviert ist\r\n $this->last_error = \"fsockopen error no. $errnum: $errstr\";\r\n $this->log_ipn_results(false); \r\n return false;\r\n \r\n } else { \r\n \r\n // ansonsten werden die Daten zu Paypal geschickt\r\n fputs($fp, \"POST $url_parsed[path] HTTP/1.1\\r\\n\"); \r\n fputs($fp, \"Host: $url_parsed[host]\\r\\n\"); \r\n fputs($fp, \"Content-type: application/x-www-form-urlencoded\\r\\n\"); \r\n fputs($fp, \"Content-length: \".strlen($post_string).\"\\r\\n\"); \r\n fputs($fp, \"Connection: close\\r\\n\\r\\n\"); \r\n fputs($fp, $post_string . \"\\r\\n\\r\\n\"); \r\n\r\n // die Antwort wird in ipn_response gespeichert\r\n while(!feof($fp)) { \r\n $this->ipn_response .= fgets($fp, 1024); \r\n } \r\n\r\n fclose($fp); // Verbindung schließen\r\n\r\n }\r\n //Wenn VERIFIED zurückkommt isses gelungen\r\n if (eregi(\"VERIFIED\",$this->ipn_response)) {\r\n \r\n\r\n $this->log_ipn_results(true);\r\n return true; \r\n \r\n } else {\r\n \r\n // Wenns nicht geklappt hat\r\n $this->last_error = 'IPN Validation Failed.';\r\n $this->log_ipn_results(false); \r\n return false;\r\n \r\n }\r\n \r\n }", "public function testGetAllValidRsvps() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"rsvp\");\n\n\t\t// create a new Rsvp and insert to into mySQL\n\t\t$rsvp = new Rsvp(null, $this->invitee->getInviteeId(), $this->VALID_RSVPBROWSER, $this->VALID_RSVPCOMMENT, $this->VALID_RSVPIPADDRESS, $this->VALID_RSVPNUMPEOPLE);\n\t\t$rsvp->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Rsvp::getAllRsvps($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"rsvp\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Io\\\\Deepdivedylan\\\\Invitersvp\\\\Rsvp\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoRsvp = $results[0];\n\t\t$this->assertEquals($pdoRsvp->getRsvpInviteeId(), $this->invitee->getInviteeId());\n\t\t$this->assertEquals($pdoRsvp->getRsvpBrowser(), $this->VALID_RSVPBROWSER);\n\t\t$this->assertEquals($pdoRsvp->getRsvpComment(), $this->VALID_RSVPCOMMENT);\n\t\t$this->assertEquals($pdoRsvp->getRsvpIpAddress(), $this->VALID_RSVPIPADDRESS);\n\t\t$this->assertEquals($pdoRsvp->getRsvpNumPeople(), $this->VALID_RSVPNUMPEOPLE);\n\t\t$this->assertEquals($pdoRsvp->getRsvpTimestamp(), $this->VALID_RSVPTIMESTAMP);\n\t}", "function validaPuntos($poin){\r\n\t// Debe tener como maximo 4 caracteres\r\n\tif(strlen($poin) > 4)\r\n\t\treturn false;\r\n\t// Solamente debe tener numeros\r\n\telse if(!preg_match(\"/^[0-9]+$/\", $poin))\r\n\t\treturn false;\r\n\t// Si todo esta bien devuelve true\r\n\telse\r\n\t\treturn true;\r\n}", "public function testInfoIsRingbaNumber()\n {\n }", "public function validateIpn()\n\t{\n\t\t// parse the paypal URL\n\t\t$urlParsed = parse_url($this->gatewayUrl);\n\n\t\t$string = \"cmd=_notify-validate\";\n\t\t\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\t// Put the key / value in our ipnData array. \n\t\t\t\t$this->ipnData[$key] = $value;\n\t\t\t$clean = (get_magic_quotes_gpc()) ? stripslashes(str_replace(\"\\n\", \"\\r\\n\", $value)) : str_replace(\"\\n\", \"\\r\\n\", $value);\n\t\t\t$string .= \"&\".$key.\"=\".urlencode($clean);\n\t\t}\n\t\t\n\t\t$ch = curl_init('https://'.$urlParsed['host'].'/cgi-bin/webscr');\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $string);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t\t\n\t\t$this->ipnResponse = curl_exec($ch);\n\n \n\t\tif (strpos(strtoupper($this->ipnResponse), \"VERIFIED\"))\n\t\t{\n\t\t \treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function validateItem($item){\n\t\tif(!property_exists($item,'name') || !property_exists($item, 'value') || !property_exists($item, 'type') ||\n\t\t!property_exists($item, 'content') || !property_exists($item, 'answers') || !property_exists($item, 'display') ||\n\t\t!property_exists($item, 'mandatory')){\n\t\t\tthrow new CException('Invalid item: '.print_r($item, true));\n\t\t}\n\t\treturn true;\n\t}", "function paypalipnOld() {\n\n Log::info(\"Ipn Runs\");\n\n $ipn = new PaypalIPNListener();\n $ipn->use_sandbox = true;\n\n $verified = $ipn->processIpn();\n\n $report = $ipn->getTextReport();\n\n Log::info(\"-----new payment-----\");\n\n Log::info($report);\n\n if ($verified) {\n if ($_POST['address_status'] == 'confirmed') {\n // Check outh POST variable and insert your logic here\n Log::info(\"payment verified and inserted to db\");\n }\n } else {\n Log::info(\"Some thing went wrong in the payment !\");\n }\n }", "function gw_validate_payment()\n\t{\n\t\t//--------------------------------------\n\t\t// INIT\n\t\t//--------------------------------------\n\t\t\n\t\t//--------------------------------------\n\t\t// Debug...\n\t\t//--------------------------------------\n\t\t\n\t\tif ( GW_TEST_MODE_ON )\n\t\t{\n\t\t\tif ( ! is_array( $_POST ) or ! count( $_POST ) )\n\t\t\t{\n\t\t\t\t$_POST = $_GET;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$post_back[] = 'cmd=_notify-validate';\n\t\t\n\t\tforeach ($_POST as $key => $val)\n\t\t{\n\t\t\t$post_back[] = $key . '=' . urlencode (stripslashes($val));\n\t\t}\n\t\t\n\t\t$post_back_str = implode('&', $post_back);\n\t\t\n\t\t//--------------------------------------\n\t\t// URLS\n\t\t//--------------------------------------\n\t\t\n\t\t$urls = array( 'curl_full' => 'http://www.paypal.com/cgi-bin/webscr',\n\t\t\t\t\t 'sock_url' => 'www.paypal.com',\n\t\t\t\t\t 'sock_path' => '/cgi-bin/webscr' );\n\t\t\t\t\t \n\t\t//--------------------------------------\n\t\t// Throw back to PayPal to verify\n\t\t//--------------------------------------\n\t\t\n\t\t$state = $this->core_post_back( $urls, $post_back_str, 80 );\n\t\t\n\t\t//--------------------------------------\n\t\t// Check...\n\t\t//--------------------------------------\n\t\t\n\t\t$state = ( stristr($state, 'VERIFIED') ) ? 'VERIFIED' : 'INVALID';\n\t\t\n\t\tif ( $state != 'VERIFIED' )\n\t\t{\n\t\t\tif ( ! GW_TEST_MODE_ON )\n\t\t\t{\n\t\t\t\t$this->error = 'not_valid';\n\t\t\t\treturn array( 'verified' => FALSE );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//--------------------------------------\n\t\t// Fix ticket: #56264 Second POST - we can ignore\n\t\t//--------------------------------------\n\t\t\n\t\tif ( ! $_POST['txn_id'] and $_POST['txn_type'] == 'subscr_signup' )\n\t\t{\n\t\t\texit();\n\t\t}\n\t\t\n\t\t//--------------------------------------\n\t\t// Populate return array\n\t\t//--------------------------------------\n\t\t\n\t\tlist( $cur_sub_id, ) = explode( 'x', trim($_POST['invoice']) );\n\t\t\n\t $return = array( 'currency_code' => $_POST['mc_currency'],\n\t\t\t\t\t\t 'payment_amount' => $_POST['mc_gross'],\n\t\t\t\t\t\t 'member_unique_id' => intval($_POST['custom']),\n\t\t\t\t\t\t 'purchase_package_id'=> intval($_POST['item_number']),\n\t\t\t\t\t\t 'current_package_id' => intval($cur_sub_id),\n\t\t\t\t\t\t 'verified' => TRUE,\n\t\t\t\t\t\t 'verification'\t\t => $this->ipsclass->input['verification'],\n\t\t\t\t\t\t 'subscription_id' => $_POST['subscr_id'],\n\t\t\t\t\t\t 'transaction_id' => $_POST['txn_id'] );\n\t\t\n\t\t//--------------------------------------\n\t\t// Sort out payment status\n\t\t//--------------------------------------\n\t\t\n\t\tif ( $_POST['payment_status'] == 'Refunded' )\n\t\t{\n\t\t\t$return['payment_status'] = 'REFUND';\n\t\t}\n\t\telse if( $_POST['txn_type'] == 'subscr_cancel' )\n\t\t{\n\t\t\t$return['payment_status'] = 'CANCEL';\n\t\t}\n\t\telse if ( strstr( $_POST['txn_type'], 'subscr_' ) )\n\t\t{\n\t\t\t$return['payment_status'] = 'RECURRING';\n\t\t}\n\t\telse if ( $_POST['txn_type'] == 'web_accept' )\n\t\t{\n\t\t\t$return['payment_status'] = 'ONEOFF';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$return['payment_status'] = '';\n\t\t}\n\t\t\n\t\t//--------------------------------------\n\t\t// Pass back to handler\n\t\t//--------------------------------------\n\t\t\n\t\treturn $return;\n\t}", "public function testPriceListItemsPostPriceListItem()\n {\n }", "public function testInValidNumber(){\n\t\t\t$enquiryVars = [\n\t\t\t\t'firstName' => 'Rebecca',\n\t\t\t\t'familyName' => 'Collision',\n\t\t\t\t'contactNum' => '',\n\t\t\t\t'email' => 'neeraj@gmail.com',\n\t\t\t\t'enquiryMsg' => 'Wow! Nice site'\n\t\t\t];\n\t\t\t$properTest = testEnquirySubmit($enquiryVars);\n\t\t\t$this->assertFalse($properTest);\n\t\t}", "static public function ctrValidarTituloNoticia($item, $valor){\n\n $tabla = \"noticias\";\n\n $respuesta = ModeloNoticias::mdlValidarTituloNoticia($tabla, $item, $valor);\n\n return $respuesta;\n \n }", "public function test_is_valid(){\n\n\t\t$this->assertTrue( APP_Currencies::is_valid( 'USD' ) );\n\t\t$this->assertFalse( APP_Currencies::is_valid( 'not-a-currency' ) );\n\n\t}", "function donation_can_process_paypal_ipn($wp) {\n global $wpdb;\n $general_settings = donation_can_get_general_settings();\n\n w2log(\"IPN notification received\");\n\n // Send a request back to PayPal to confirm the notification\n $req = 'cmd=_notify-validate';\n\n foreach ($_POST as $key => $value) {\n $value = urlencode(stripslashes($value));\n $req .= \"&$key=$value\";\n }\n\n $header .= \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\";\n $header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n $header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\";\n\n // Use Sandbox version if debug mode is on\n $url = \"ssl://www.paypal.com\";\n if ($general_settings[\"debug_mode\"]) {\n $url = \"ssl://www.sandbox.paypal.com\";\n }\n\n $fp = fsockopen ($url, 443, $errno, $errstr, 30);\n\n // Assign posted variables to data array for saving to database\n $payer_name = stripslashes($_POST['first_name']);\n $payer_lastname = stripslashes($_POST['last_name']);\n\n $data = array(\n \"item_number\" => $_POST[\"item_number\"],\n \"cause_code\" => \"\",\n \"payment_status\" => $_POST['payment_status'],\n \"amount\" => $_POST['mc_gross'],\n \"transaction_id\" => $_POST['txn_id'],\n \"payer_email\" => $_POST['payer_email'],\n \"payer_name\" => $payer_name,\n \"payer_lastname\" => $payer_lastname,\n \"fee\" => $_POST['mc_fee'],\n \"time\" => current_time('mysql')\n );\n\n if ($general_settings[\"debug_mode\"]) {\n $data[\"sandbox\"] = 1;\n }\n\n $types = array('%s', '%s', '%s', \"%f\", \"%s\", \"%s\", \"%s\", \"%s\", \"%f\", \"%s\");\n\n foreach ($data as $k => $v) {\n w2log(\"$k: $v\");\n }\n\n if (!$fp) {\n w2log(\"Http error, can't connect to \" + $url);\n } else {\n\tfputs ($fp, $header . $req);\n\twhile (!feof($fp)) {\n $res = fgets ($fp, 1024);\n if (strcmp ($res, \"VERIFIED\") == 0) {\n w2log(\"Transaction verified --> \");\n $table_name = donation_can_get_table_name($wpdb);\n w2log(\"Saving donation to $table_name\");\n\n // Check if the transaction has already been saved\n // and update if payment_status has changed\n $saved_transaction = $wpdb->get_row($wpdb->prepare(\"SELECT * FROM $table_name WHERE item_number = %s\", $data[\"item_number\"]));\n\n if ($saved_transaction == null) {\n w2log(\"Error, no transaction found with item_number \" . $data[\"item_number\"]);\n } else { \n // TODO Depending on the original status, do different updates...\n $data[\"cause_code\"] = $saved_transaction->cause_code;\n\n if ($data[\"payment_status\"] == \"Refunded\") {\n // Refunds send back the change in the donation amount\n $change = intval($data[\"amount\"]);\n $fee_change = intval($data[\"fee\"]);\n\n $data[\"amount\"] = $saved_transaction->amount + $change;\n $data[\"fee\"] = $saved_transaction->fee + $fee_change;\n }\n\n $wpdb->update($table_name,\n $data,\n array(\"item_number\" => $data[\"item_number\"]),\n $types,\n \"%s\"); \n }\n\n w2log(\"OK\");\n\n // Try to notify via email\n $goals = get_option(\"donation_can_causes\");\n $goal = $goals[$data[\"cause_code\"]];\n\n $emails = split(\",\", $general_settings[\"notify_email\"]);\n $goal_emails = split(\",\", $goal[\"notify_email\"]);\n\n if (!empty($emails) || !empty($goal_emails)) {\n $all_emails = array_merge($emails, $goal_emails);\n\n //TODO tässä välissä voisi varmistella vielä, että kaikki on oikein formatoitu...\n $to = join(\",\", $all_emails);\n w2log(\"Sending email to: \" . $to);\n\n $message = $general_settings[\"email_template\"];\n if ($message == null || $message == \"\") {\n // Default version\n $message = donation_can_get_default_email_template();\n }\n\n if ($data[\"payment_status\"] == \"Completed\") {\n $subject = '[Donation Can] New Donation to ' . $goal[\"name\"];\n donation_can_send_email($to, $subject, $message, $general_settings, $goal, $data);\n } else if ($data[\"payment_status\"] == \"Pending\" || $data[\"payment_status\"] == \"Created\") {\n $subject = '[Donation Can] Pending Donation to ' . $goal[\"name\"];\n donation_can_send_email($to, $subject, $message, $general_settings, $goal, $data);\n }\n }\n\n // Send a receipt to donor (only if completed)\n if ($data[\"payment_status\"] == \"Completed\") {\n if ($general_settings[\"send_receipt\"]) {\n donation_can_send_receipt($data, $goal);\n }\n }\n } else if (strcmp ($res, \"INVALID\") == 0) {\n // TODO log more info on this into the db?\n w2log(\"Invalid\");\n } else {\n //w2log(\"Unknown response: \" . $res);\n }\n\t}\n\tfclose ($fp);\n }\n}", "function handleIPN () {\n\t\t$url_parsed = parse_url($this->paypal_url); \n\t\t// generate the post string from the _POST vars aswell as load the\n\t\t// _POST vars into an array so we can play with them from the calling\n\t\t// script.\n\t\t$post_string = ''; \n\t\t#viewArray($_POST, 'test POST response');\n\t\tforeach ($_POST as $field => $value) {\n\t\t\t$this->ipn_data[$field] = $value;\n\t\t\t$post_string .= $field.'='.urlencode($value).'&'; \n\t\t}\n\t\t$post_string .= \"cmd=_notify-validate\"; // append ipn command\n\n\t\t// open the connection to paypal\n\t\t$fp = fsockopen($url_parsed['host'], '80', $err_num, $err_str, 30); \n\t\tif (!$fp) {\n\t\t\t// could not open the connection. \n\t\t\t// If loggin is on, the error message will be in the log.\n\t\t\t$this->last_error = \"fsockopen error no. $errnum: $errstr\";\n\t\t\t$this->logIPN(false); \n\t\t\treturn false;\n\t\t} else { \n\t\t\t// Post the data back to paypal\n\t\t\tfputs($fp, \"POST $url_parsed[path] HTTP/1.1\\r\\n\"); \n\t\t\tfputs($fp, \"Host: $url_parsed[host]\\r\\n\"); \n\t\t\tfputs($fp, \"Content-type: application/x-www-form-urlencoded\\r\\n\"); \n\t\t\tfputs($fp, \"Content-length: \".strlen($post_string).\"\\r\\n\"); \n\t\t\tfputs($fp, \"Connection: close\\r\\n\\r\\n\"); \n\t\t\tfputs($fp, $post_string . \"\\r\\n\\r\\n\"); \n\n\t\t\t// loop through the response from the server and append to variable\n\t\t\twhile(!feof($fp))\n\t\t\t\t$this->ipn_response .= fgets($fp, 1024); \n\t\t\tfclose($fp); // close connection\n\t\t}\n\t\tif (eregi(\"VERIFIED\", $this->ipn_response)) {\n\n\t\t\tif ($_POST['payment_status'] == \"Completed\") {\n\t\t\t\t// vérifier que txn_id n'a pas été précédemment traité: Créez une fonction qui va interroger votre base de données\n\t\t\t\t//if (VerifIXNID($txn_id) == 0) {\n\t\t\t\t\t// vérifier que receiver_email est votre adresse email PayPal principale\n\t\t\t\t\tif ($_POST['receiver_email'] == SHP_PAYPAL_EMAIL) {\n\t\t\t\t\t\t// track payment amount for later verification\n\t\t\t\t\t\t$this->ipn_data['amount'] = $_POST['mc_gross'];\n\t\t\t\t\t\t// Valid transaction.\n\t\t\t\t\t\treturn Array(\t'id_order'\t=> $_POST['invoice'],\n\t\t\t\t\t\t\t\t'success'\t=> true,\n\t\t\t\t\t\t\t\t'error'\t\t=> '',\n\t\t\t\t\t\t\t\t'track'\t\t=> $this->ipn_data );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Invalid PAYPAL account email address\n\t\t\t\t\t\treturn Array(\t'id_order'\t=> $_POST['invoice'],\n\t\t\t\t\t\t\t\t'success'\t=> false,\n\t\t\t\t\t\t\t\t'error'\t\t=> 'IPN Validation Failed : Invalid PAYPAL account email address',\n\t\t\t\t\t\t\t\t'track'\t\t=> $this->ipn_data );\n\t\t\t\t\t}\n\t\t\t\t//} else {\n\t\t\t\t\t// ID de transaction déjà utilisé\n\t\t\t\t//}\n\t\t\t} else {\n\t\t\t\t// Payment status : Failed\n\t\t\t\treturn Array(\t'id_order'\t=> $_POST['invoice'],\n\t\t\t\t\t\t'success'\t=> false,\n\t\t\t\t\t\t'error'\t\t=> 'IPN Validation Failed : Failed status',\n\t\t\t\t\t\t'track'\t\t=> $this->ipn_data );\n\t\t\t}\n\t\t} else {\n\t\t\t// Invalid IPN transaction. Check the log for details.\n\t\t\treturn Array(\t'id_order'\t=> $_POST['invoice'],\n\t\t\t\t\t'success'\t=> false,\n\t\t\t\t\t'error'\t\t=> 'IPN Validation Failed : Invalid response',\n\t\t\t\t\t'track'\t\t=> $this->ipn_data );\n\t\t}\n\t}", "function testCpfValido(){\n $cliente = new Cliente();\n\n $cliente->setCpf(97622242222);\n $this->assertTrue(RegrasDeNegocio::validaCPF($cliente->getCpf()));\n\n $cliente->setCpf(\"a97622242222\");\n $this->assertFalse(RegrasDeNegocio::validaCPF($cliente->getCpf()));\n\n $cliente->setCpf(242222);\n $this->assertFalse(RegrasDeNegocio::validaCPF($cliente->getCpf()));\n }", "function paypal_ipn()\n {\n if ($this->paypal->validate_ipn() == true) {\n \n $data['status'] = 'paid';\n $data['payment_details'] = json_encode($_POST);\n $invoice_id = $_POST['custom'];\n $this->db->where('vendor_invoice_id', $invoice_id);\n $this->db->update('vendor_invoice', $data);\n }\n }", "function paypal_ipn()\n {\n if ($this->paypal->validate_ipn() == true) {\n \n $data['status'] = 'paid';\n $data['payment_details'] = json_encode($_POST);\n $invoice_id = $_POST['custom'];\n $this->db->where('vendor_invoice_id', $invoice_id);\n $this->db->update('vendor_invoice', $data);\n }\n }", "public function checkVPSSignature($purchase, $nvals) {\n\n // concatenate various fields\n $values = [\n $purchase->VPSTxId,\n $nvals['VendorTxCode'],\n $nvals['Status'],\n isset($nvals['TxAuthNo']) ? $nvals['TxAuthNo'] : '',\n $_ENV['sage_vendor'],\n $nvals['AVSCV2'],\n $purchase->securitykey,\n $nvals['AddressResult'],\n $nvals['PostCodeResult'],\n $nvals['CV2Result'],\n $nvals['GiftAid'],\n $nvals['3DSecureStatus'],\n isset($nvals['CAVV']) ? $nvals['CAVV'] : '',\n isset($nvals['AddressStatus']) ? $nvals['AddressStatus'] : '',\n isset($nvals['PayerStatus']) ? $nvals['PayerStatus'] : '',\n $nvals['CardType'],\n $nvals['Last4Digits'],\n isset($nvals['DeclineCode']) ? $nvals['DeclineCode'] : '',\n $nvals['ExpiryDate'],\n isset($nvals['FraudResponse']) ? $nvals['FraudResponse'] : '',\n isset($nvals['BankAuthCode']) ? $nvals['BankAuthCode'] : '',\n ];\n\n // Calculate our version of signature\n $oursignature = strtoupper(md5(implode($values)));\n\n $match = $oursignature == $nvals['VPSSignature'];\n\n // If it fails log the trouble.\n if (!$match) {\n\t $this->controller->log('VPSSignature mismatch - ' . var_export($values, true));\n $this->controller->log('Notification response - ' . var_export($nvals, true));\n $this->controller->log('Purchase record - ' . var_export($purchase, true));\n $this->controller->log('Our MD5 is ' . $oursignature);\n $this->controller->log('Their MD5 is ' . $nvals['VPSSignature']);\n }\n\n return $match;\n }", "function validateForm($itemName,$itemPrice,$itemQty,$itemDesc){\n\t\t$errMsg = \"\"; // stores error message as string\n\n\t\t// Validation rules\n\t\t// Validation Rule 1: item name can't be emtpy\n\t\tif(empty($itemName)){\n\t\t\t$errMsg .= \"Item Name cannot be empty <br/>\\r\\n\";\n\t\t}\n\n\t\t//Validation Rule 2: item price can't be empty\n\t\tif($itemPrice == \"\"){\n\t\t\t$errMsg .= \"Price field must be filled. <br/>\\r\\n\";\n\t\t}else if( !(filter_var($itemPrice,FILTER_VALIDATE_FLOAT) && $itemPrice > 0 ) ){\n\t\t\t$errMsg .= \"Invalid Price Format. It must be float/integer value such that > 0 <br/>\\r\\n\";\n\t\t}\n\n\t\t//Validation Rule 3A: item qty can't be empty\n\t\tif(empty($itemQty)){\n\t\t\t$errMsg .= \"Quantity field cannot be empty <br/>\\r\\n\";\n\t\t} // Validation Rule 3B: quantity must be a positive integer (>0)\n\t\telse if( !(filter_var($itemQty, FILTER_VALIDATE_INT) && $itemQty > 0)){\n\t\t\t$errMsg .= \"Invalid Quantity Format. It must be a positive integer. (i.e. whole number > 0) <br/>\\r\\n\";\n\t\t} \n\n\t\t\n\t\t//Validation Rule 4: item description can't be empty\n\t\tif(empty($itemDesc)){\n\t\t\t$errMsg .= \"Item description cannot be empty <br/>\\r\\n\";\n\t\t}\n\n\t\t// Validation Rule 5: Item Name is unique (avoid duplicate items in system)\n\t\tif(checkItemExists($itemName)){\n\t\t\t$errMsg .=\"The Item Name is already exists in the system.<br/>\\r\\n\";\n\t\t}\n\n\t\treturn $errMsg;\n\t}", "private function isValidIPN($data)\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\t\t$hostname = $sandbox ? 'www.sandbox.paypal.com' : 'www.paypal.com';\n\n\t\t$url = 'ssl://' . $hostname;\n\t\t$port = 443;\n\n\t\t$req = 'cmd=_notify-validate';\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\t$value = urlencode($value);\n\t\t\t$req .= \"&$key=$value\";\n\t\t}\n\t\t$header = '';\n\t\t$header .= \"POST /cgi-bin/webscr HTTP/1.1\\r\\n\";\n\t\t$header .= \"Host: $hostname:$port\\r\\n\";\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t$header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\";\n\t\t$header .= \"User-Agent: AkeebaSubscriptions\\r\\n\";\n\t\t$header .= \"Connection: Close\\r\\n\\r\\n\";\n\n\n\t\t$fp = fsockopen($url, $port, $errno, $errstr, 30);\n\n\t\tif (!$fp)\n\t\t{\n\t\t\t// HTTP ERROR\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfputs($fp, $header . $req);\n\t\t\twhile (!feof($fp))\n\t\t\t{\n\t\t\t\t$res = fgets($fp, 1024);\n\t\t\t\tif (stristr($res, \"VERIFIED\"))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if (stristr($res, \"INVALID\"))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t}\n\t}", "public function testGoodsReceivedNoteLinePOSTRequestGRNIDLinesPost()\n {\n }", "static function IssueInvoice(OmniFlow\\ProcessItem $item)\n\t{\n\t\t$proc=$item->proc;\n\t\t$case=$proc->dataHandler;\n\t\t$amount = $case->GetValue(\"Amount\");\n\t\t\n\t\t$item->result=\"Invoice#5001 - amount $amount\";\n\t\t$case->SetValue(\"Invoice#\",\"5001\");\n\t}", "public function _testEmailFromPerl() {\n $testEmailsFromPerl = self::getTestEmailFromPerl();\n foreach ($testEmailsFromPerl as $testEmail) {\n if ($testEmail->isValid) {\n $this->assertTrue('Should be OK: ' . $testEmail->item, $this->validator->isValid($testEmail->item));\n } else {\n $this->assertFalse('Should fail: ' . $testEmail->item, $this->validator->isValid($testEmail->item));\n }\n }\n }", "public function testGoodsReceivedNoteCREATEFromPOLinesRequestFromPurchaseOrderLinesPost()\n {\n }", "public function testPreValidateFails()\n {\n $this->assertFalse(LuhnChecker::check('123456789'));\n $this->assertFalse(LuhnChecker::check('123456789'));\n $this->assertFalse(LuhnChecker::check('asd123asd123sdsa'));\n $this->assertFalse(LuhnChecker::check('000000000000'));\n $this->assertFalse(LuhnChecker::check('000'));\n $this->assertFalse(LuhnChecker::check('0000000000000000000'));\n }", "function policy_library_plugin_validate_division($item)\n{\n $messages = array();\n\n if (empty($item['name'])) $messages[] = __('Name is required', 'policy_library_plugin');\n \n\n if (empty($messages)) return true;\n return implode('<br />', $messages);\n}", "public function testGetItemSerialById()\n {\n }", "public function testGetItemSerialByFilter()\n {\n }", "private function isValidIPN(&$data)\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\t\t$hostname = $sandbox ? 'ipnpb.sandbox.paypal.com' : self::IPNPostbackDomain;\n\n\t\t$url = 'https://' . $hostname;\n\n\t\t$newData = array(\n\t\t\t'cmd' => '_notify-validate'\n\t\t);\n\t\t$newData = array_merge($newData, $data);\n\n\t\t$options = array(\n\t\t\tCURLOPT_SSL_VERIFYPEER => true,\n\t\t\tCURLOPT_SSL_VERIFYHOST => 2,\n\t\t\tCURLOPT_VERBOSE => false,\n\t\t\tCURLOPT_HEADER => false,\n\t\t\tCURLINFO_HEADER_OUT => false,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_CAINFO => JPATH_LIBRARIES . '/fof30/Download/Adapter/cacert.pem',\n\t\t\tCURLOPT_HTTPHEADER => [\n\t\t\t\t'User-Agent: AkeebaSubscriptions'\n\t\t\t],\n\t\t\tCURLOPT_POST => true,\n\t\t\tCURLOPT_POSTFIELDS => $newData,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\n\t\t);\n\n\t\t// TLS 1.2 is only supported in OpenSSL 1.0.1c and later AND cURL 7.34.0 and later running on PHP 5.5.19+ or\n\t\t// PHP 5.6.3+. If these conditions are met we can use PayPal's minimum requirement of TLS 1.2 which is mandatory\n\t\t// since June 2016.\n\t\t$curlVersionInfo = curl_version();\n\t\t$curlVersion = $curlVersionInfo['version'];\n\t\t$openSSLVersionRaw = $curlVersionInfo['ssl_version'];\n\t\t// OpenSSL version typically reported as \"OpenSSL/1.0.1e\", I need to convert it to 1.0.1.5\n\t\t$parts = explode('/', $openSSLVersionRaw, 2);\n\t\t$openSSLVersionRaw = (count($parts) > 1) ? $parts[1] : $openSSLVersionRaw;\n\t\t$openSSLVersion = substr($openSSLVersionRaw, 0, - 1) . '.' . (ord(substr($openSSLVersionRaw, - 1)) - 96);\n\t\t// PHP version required for TLS 1.2 is 5.5.19+ or 5.6.3+\n\t\t$minPHPVersion = version_compare(PHP_VERSION, '5.6.0', 'ge') ? '5.6.3' : '5.5.19';\n\n\t\tif (\n\t\t\t!version_compare($curlVersion, '7.34.0', 'ge') ||\n\t\t\t!version_compare($openSSLVersion, '1.0.1.3', 'ge') ||\n\t\t\t!version_compare(PHP_VERSION, $minPHPVersion, 'ge')\n\t\t)\n\t\t{\n\t\t\t$phpVersion = PHP_VERSION;\n\t\t\t$data['akeebasubs_ipncheck_warning'] =\n\t\t\t\t\"WARNING! PayPal demands that connections be made with TLS 1.2. This requires PHP $minPHPVersion+ (you have $phpVersion), libcurl 7.34.0+ (you have $curlVersion) and OpenSSL 1.0.1c+ (you have $openSSLVersionRaw) on your server's PHP. Please upgrade these requirements to meet the stated minimum or the PayPal integration will cease working.\";\n\t\t}\n\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt_array($ch, $options);\n\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\t\t$response = curl_exec($ch);\n\t\t$errNo = curl_errno($ch);\n\t\t$error = curl_error($ch);\n\t\t$lastHttpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n\t\tcurl_close($ch);\n\n\t\tif (($errNo > 0) && !empty($error))\n\t\t{\n\t\t\t$data['akeebasubs_ipncheck_failure'] = \"Could not open SSL connection to $hostname:443, cURL error $errNo: $error\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($lastHttpCode >= 400)\n\t\t{\n\t\t\t$data['akeebasubs_ipncheck_failure'] = \"Invalid HTTP status $lastHttpCode verifying PayPal's IPN\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (stristr($response, \"VERIFIED\"))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if (stristr($response, \"INVALID\"))\n\t\t{\n\t\t\t$data['akeebasubs_ipncheck_failure'] = 'PayPal claims the IPN data is INVALID – Possible fraud!';\n\n\t\t\treturn false;\n\t\t}\n\t}", "public function testVerifyURL()\n\t{\n \t$testedObject = new params(array(\"1\",\"2\",\"3\",\"4\"));\n\t $res = $testedObject->verifyURL('brokenURL:#$%//site.com/page.html');\n\t\t$this->assertFalse($res, false);\n\t}", "public function testItemsValidations()\n {\n $I = $this->tester;\n $this->authByUsername('driverPortland');\n\n // Valid items\n $validItems = [\n [\n 'id' => 6,\n 'status' => 'short',\n 'initials' => 'AB'\n ],\n [\n 'id' => 15,\n 'status' => 'refused',\n 'initials' => 'KS'\n ], \n ];\n\n // Bad items\n $badItems = [\n 'id' => [4, 5, 222, 'asdasdasd', null, 0, true, false],\n 'status' => [123, '123', null, true, false, 123123, 'text', 0],\n 'initials' => ['ABC', true, false, null, 123, 0]\n ];\n\n // Success items\n $successItems = [\n 'status' => ['short', 'refused', 'received'],\n 'initials' => ['KG', 'DB', 'JS']\n ];\n\n // Check number of items\n $items = $validItems;\n foreach($items as $key => $item) {\n $tempFields = $this->_successAttributes;\n if ($key == 0) {\n $tempFields['items'] = array_merge($validItems, [['id' => 12]]);\n } else {\n unset($items[$key]);\n $tempFields['items'] = $items;\n }\n \n // Send and validate response\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType([\n 'field' => 'string',\n 'message' => 'string'\n ], '$.*');\n $I->seeResponseContainsJson([\n ['field' => 'items']\n ]);\n }\n\n // Check bad validate of each item\n foreach($validItems as $itemKey => $fields) {\n foreach($fields as $field => $fieldValue) {\n foreach($badItems[$field] as $badValue) {\n $items = $validItems;\n $items[$itemKey][$field] = $badValue;\n $tempFields = $this->_successAttributes;\n $tempFields['items'] = $items;\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType([\n 'field' => 'string',\n 'message' => 'string'\n ], '$.*');\n $I->seeResponseContainsJson([\n ['field' => 'items']\n ]);\n }\n }\n }\n\n // Check success validate of each item\n foreach($validItems as $itemKey => $fields) {\n foreach($fields as $field => $fieldValue) {\n if ($field == 'id') {\n continue;\n }\n foreach($successItems[$field] as $goodValue) {\n $items = $validItems;\n $items[$itemKey][$field] = $goodValue;\n $tempFields = $this->_successAttributes;\n $tempFields['items'] = $items;\n $I->sendPOST('/orders/3/survey', $tempFields);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType(self::rules());\n $I->seeResponseContainsJson([\n [$field => $goodValue]\n ]);\n }\n }\n }\n }", "public function propostaItemGetList($prpoid){\n \tif(is_int($prpoid)){\n \t\treturn $this->prpDAO->propostaItemGetList($prpoid);\n \t} else{\n \t\treturn false;\n \t}\n }", "function db_add_receipt($addr, $amnt, $rcpt) {\n}", "public function testGoodsReceivedNotePurchaseOrderPOSTRequestGRNIDPurchaseOrdersPost()\n {\n }", "function check_ipn_request_is_valid() {\n\t\tglobal $cmdeals;\n\t\t\n\t\tif ($this->debug=='yes') $this->log->add( 'paypal', 'Checking IPN response is valid...' );\n \n \t // Add cmd to the post array\n $_POST['cmd'] = '_notify-validate';\n\n // Send back post vars to paypal\n $params = array( \n \t'body' => $_POST,\n \t'sslverify' => false\n );\n\n // Get url\n \tif ( $this->testmode == 'yes' ):\n\t\t\t$paypal_adr = $this->testurl;\t\t\n\t\telse :\n\t\t\t$paypal_adr = $this->liveurl;\t\t\n\t\tendif;\n\t\t\n\t\t// Post back to get a response\n $response = wp_remote_post( $paypal_adr, $params );\n\t\t\n\t\t // Clean\n unset($_POST['cmd']);\n \n // check to see if the request was valid\n if ( !is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 && (strcmp( $response['body'], \"VERIFIED\") == 0)) {\n if ($this->debug=='yes') $this->log->add( 'paypal', 'Received valid response from PayPal' );\n return true;\n } \n \n if ($this->debug=='yes') :\n \t$this->log->add( 'paypal', 'Received invalid response from PayPal' );\n \tif (is_wp_error($response)) :\n \t\t$this->log->add( 'paypal', 'Error response: ' . $result->get_error_message() );\n \tendif;\n endif;\n \n return false;\n }", "function check_item_data()\r\n{\r\n\tif (!check_num('qty',0))\r\n\t{\r\n\t\tdisplay_error(_(\"The quantity entered is negative or invalid.\"));\r\n\t\tset_focus('qty');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (!check_num('std_cost', 0))\r\n\t{\r\n\t\tdisplay_error(_(\"The entered standard cost is negative or invalid.\"));\r\n\t\tset_focus('std_cost');\r\n\t\treturn false;\r\n\t}\r\n\r\n \treturn true;\r\n}", "function ciniki_tenants_processPaypalIPN($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 'txn_type'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No txn_type specified'),\n 'subscr_id'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No subscr_id specified'),\n 'first_name'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No first_name specified'),\n 'last_name'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No last_name specified'),\n 'payer_id'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No payer_id specified'),\n 'payer_email'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No payer_email specified'),\n 'item_name'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No item_name specified'),\n 'item_number'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No item_number specified'),\n 'mc_currency'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No mc_currency specified'),\n 'mc_fee'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No mc_fee specified'),\n 'mc_gross'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No mc_gross specified'),\n 'mc_amount3'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'errmsg'=>'No mc_amount3 specified'),\n ));\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $ciniki['request']['args']['ipn_track_id'] . ' - ' . $rc['err']['code'] . ' - ' . $rc['err']['msg']);\n }\n if( !isset($rc['args']) ) {\n $args = array('txn_type'=>'', \n 'subscr_id'=>'',\n 'first_name'=>'',\n 'last_name'=>'',\n 'payer_id'=>'',\n 'payer_email'=>'',\n 'item_name'=>'',\n 'item_number'=>'',\n 'mc_currency'=>'',\n 'mc_fee'=>'',\n 'mc_gross'=>'',\n 'mc_amount3'=>'',\n );\n } else {\n $args = $rc['args'];\n }\n\n //\n // Lookup the tnid for the IPN\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n $strsql = \"SELECT id, status, name \"\n . \"FROM ciniki_tenants \"\n . \"WHERE uuid = '\" . ciniki_core_dbQuote($ciniki, $args['item_number']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.tenants', 'tenant');\n if( $rc['stat'] != 'ok') {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . ' - ' . $rc['err']['code'] . ' - ' . $rc['err']['msg']);\n }\n $tnid = 0;\n $tenant_status = 0;\n if( !isset($rc['tenant']) ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \"Unable to locate tenant \" . $args['item_number'] . ' for ' . $args['item_name']);\n } else {\n $tnid = $rc['tenant']['id'];\n $tenant_status = $rc['tenant']['status'];\n }\n\n\n //\n // Enter the information into the paypal_log\n //\n $strsql = \"INSERT INTO ciniki_tenant_paypal_log (tnid, status, txn_type, \"\n . \"subscr_id, first_name, last_name, \"\n . \"payer_id, payer_email, \"\n . \"item_name, item_number, \"\n . \"mc_currency, mc_fee, mc_gross, mc_amount3, \"\n . \"serialized_args, \"\n . \"date_added, last_updated) VALUES (\"\n . \"'\" . ciniki_core_dbQuote($ciniki, $tnid) . \"', \"\n . \"0, \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['txn_type']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['subscr_id']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['first_name']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['last_name']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['payer_id']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['payer_email']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['item_name']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['item_number']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['mc_currency']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['mc_fee']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['mc_gross']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, $args['mc_amount3']) . \"', \"\n . \"'\" . ciniki_core_dbQuote($ciniki, serialize($ciniki['request']['args'])) . \"', \"\n . \"UTC_TIMESTAMP(), UTC_TIMESTAMP()\"\n . \")\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n $rc = ciniki_core_dbInsert($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to log \" . $args['item_number'] . ' for ' . $args['item_name']);\n }\n $log_id = 0;\n if( isset($rc['insert_id']) && $rc['insert_id'] > 0 ) {\n $log_id = $rc['insert_id'];\n } else {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to log \" . $args['item_number'] . ' for ' . $args['item_name']);\n }\n\n //\n // If no tenant was found, then \n //\n if( $tnid < 1 ) {\n return array('stat'=>'ok');\n }\n\n //\n // Lookup the subscription id\n //\n $strsql = \"SELECT id \"\n . \"FROM ciniki_tenant_subscriptions \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.tenants', 'subscription');\n if( $rc['stat'] != 'ok') {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . ' - ' . $rc['err']['code'] . ' - ' . $rc['err']['msg']);\n }\n if( !isset($rc['subscription']) ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . ' - No tenant subscription found');\n return array('stat'=>'ok');\n }\n $subscription_id = $rc['subscription']['id'];\n\n //\n // subscr_signup - initial setup of subscription\n //\n if( $args['txn_type'] == 'subscr_signup' ) {\n //\n // Update the subscription\n //\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 10 \"\n . \", paypal_subscr_id = '\" . ciniki_core_dbQuote($ciniki, $args['subscr_id']) . \"' \"\n . \", paypal_payer_id = '\" . ciniki_core_dbQuote($ciniki, $args['payer_id']) . \"' \"\n . \", paypal_payer_email = '\" . ciniki_core_dbQuote($ciniki, $args['payer_email']) . \"' \"\n . \", paypal_amount = '\" . ciniki_core_dbQuote($ciniki, $args['mc_amount3']) . \"' \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to update tenant subscription\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'status', '10');\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_subscr_id', $args['subscr_id']);\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_payer_id', $args['payer_id']);\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_payer_email', $args['payer_email']);\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_amount', $args['mc_amount3']);\n\n //\n // Unsuspend the tenant if suspended\n //\n if( $tenant_status == 50 ) {\n $strsql = \"UPDATE ciniki_tenants SET status = 1 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 50 \";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to unsuspend tenant\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenants', $tnid, 'status', '50');\n }\n }\n\n //\n // subscr_modify - modified their subscription\n //\n elseif( $args['txn_type'] == 'subscr_modify' ) {\n //\n // Update the subscription\n //\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 10, last_updated = UTC_TIMESTAMP() \"\n . \"\";\n if( $args['subscr_id'] != '' ) {\n $strsql .= \", paypal_subscr_id = '\" . ciniki_core_dbQuote($ciniki, $args['subscr_id']) . \"' \";\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_subscr_id', $args['subscr_id']);\n }\n if( $args['payer_id'] != '' ) {\n $strsql .= \", paypal_payer_id = '\" . ciniki_core_dbQuote($ciniki, $args['payer_id']) . \"' \";\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_payer_id', $args['payer_id']);\n }\n if( $args['payer_email'] != '' ) {\n $strsql .= \", paypal_payer_email = '\" . ciniki_core_dbQuote($ciniki, $args['payer_email']) . \"' \";\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_payer_email', $args['payer_email']);\n }\n if( $args['mc_amount3'] != '' ) {\n $strsql .= \", paypal_amount = '\" . ciniki_core_dbQuote($ciniki, $args['mc_amount3']) . \"' \";\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'paypal_amount', $args['mc_amount3']);\n }\n $strsql .= \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to update tenant subscription\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'status', '10');\n\n //\n // Unsuspend the tenant if suspended\n //\n if( $tenant_status == 50 ) {\n $strsql = \"UPDATE ciniki_tenants SET status = 1 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 50 \";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to unsuspend tenant\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenants', $tnid, 'status', '1');\n }\n }\n\n //\n // subscr_payment - received a recurring payment\n //\n elseif( $args['txn_type'] == 'subscr_payment' ) {\n // \n // Update the subscription\n //\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET last_payment_date = UTC_TIMESTAMP() \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to cancel tenant subscription\");\n }\n }\n\n //\n // subscr_cancel - the customer cancelled their subscription\n //\n elseif( $args['txn_type'] == 'subscr_cancel' ) {\n // \n // Update the subscription\n //\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 60 \"\n . \", paypal_subscr_id = '\" . ciniki_core_dbQuote($ciniki, $args['subscr_id']) . \"' \"\n . \", paypal_payer_id = '\" . ciniki_core_dbQuote($ciniki, $args['payer_id']) . \"' \"\n . \", paypal_payer_email = '\" . ciniki_core_dbQuote($ciniki, $args['payer_email']) . \"' \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to cancel tenant subscription\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenant_subscriptions', $subscription_id, 'status', '60');\n\n //\n // Suspend the tenant\n //\n if( $tenant_status == 1 ) {\n $strsql = \"UPDATE ciniki_tenants SET status = 50 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 1 \";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to suspend tenant\");\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $tnid, \n 2, 'ciniki_tenants', $tnid, 'status', '50');\n }\n }\n\n else {\n error_log(\"PAYPAL-IPN: \" . $args['ipn_track_id'] . \" - Unable to unknown transaction type\");\n }\n \n return array('stat'=>'ok');\n}", "public function testGoodsReceivedNoteGETRequestGRNIDGet()\n {\n }", "function validate_pcode_number($number, $pcode_formats)\r\n{\r\n$format = trim(ereg_replace(\"[0-9]\", \"#\", $number));\r\n\r\nreturn (in_array($format, $pcode_formats)) ? true : false;\r\n}", "public function testAddItemSerial()\n {\n }", "function ipn(){\n\t\t$paypalInfo\t= $this->input->post();\n\n\t\t$data['user_id'] = $paypalInfo['custom'];\n\t\t$data['product_id']\t= $paypalInfo[\"item_number\"];\n\t\t$data['txn_id']\t= $paypalInfo[\"txn_id\"];\n\t\t$data['payment_gross'] = $paypalInfo[\"payment_gross\"];\n\t\t$data['currency_code'] = $paypalInfo[\"mc_currency\"];\n\t\t$data['payer_email'] = $paypalInfo[\"payer_email\"];\n\t\t$data['payment_status']\t= $paypalInfo[\"payment_status\"];\n\n\t\t$paypalURL = $this->paypal_lib->paypal_url;\t\t\n\t\t$result\t= $this->paypal_lib->curlPost($paypalURL,$paypalInfo);\n\t\t\n\t\t//redirect(base_url());\n\t\t//check whether the payment is verified\n\t\tif(preg_match(\"/VERIFIED/i\",$result)){\n\t\t //insert the transaction data into the database\n\t\t\t//$this->product->insertTransaction($data);\n\t\t $table_data['transaction_id'] = $TRANSACTIONID;\n\t\t\t$table_data['transaction_status'] = 1;\n\t\t\t$table_data['transaction_date'] = date('Y-m-d H:i:s');\n\t\t\t$this->db->update('payments', $table_data, \"id = \" . $user_pay_id);\n\t\t}\n }", "public function check_ipn() {\r\n\t\t\tWC_Paypal_Logger::obj()->warning( 'Check IPN', array(\r\n\t\t\t\t'POST' => $_POST, // @codingStandardsIgnoreLine\r\n\t\t\t\t'GET' => $_GET, // @codingStandardsIgnoreLine\r\n\t\t\t\t'php://input' => file_get_contents( 'php://input' ), // @codingStandardsIgnoreLine\r\n\t\t\t) );\r\n\t\t\tif ( true === $this->ipn_interface->validate() ) {\r\n\t\t\t\t$this->ipn_data = $this->ipn_interface->getRawData();\r\n\t\t\t\tWC_Paypal_Logger::obj()->debug( 'IPN is Valid. DATA: ' . wp_json_encode( $this->ipn_data ) );\r\n\t\t\t\t// Lowercase returned variables.\r\n\t\t\t\t$this->ipn_data['payment_status'] = strtolower( $this->ipn_data['payment_status'] );\r\n\t\t\t\t// Sandbox fix.\r\n\t\t\t\tif ( ( empty( $posted_data['pending_reason'] ) || 'authorization' !== $posted_data['pending_reason'] ) && isset( $posted_data['test_ipn'] ) && 1 === (int) $posted_data['test_ipn'] && 'pending' === $posted_data['payment_status'] ) {\r\n\t\t\t\t\t$this->ipn_data['payment_status'] = 'completed';\r\n\t\t\t\t}\r\n\t\t\t\treturn $this->ipn_data;\r\n\t\t\t}\r\n\t\t\tWC_Paypal_Logger::obj()->warning( 'Invalid IPN Request' );\r\n\t\t\treturn false;\r\n\t\t}", "public function process_ipn() {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// setup api library\n\t\t\t\trequire_once( plugin_dir_path( __FILE__ ) . '/cavirtex_merchant_api.php' );\n\t\t\t\t$cavirtex = new Cavirtex_Merchant_Api( $this->merchant_key, $this->merchant_secret );\n\t\t\t\t\n\t\t\t\t// parse IPN data\n\t\t\t\t$params = $cavirtex->process_ipn();\n\t\t\t\tif( ! $params ) throw new Exception( 'Could not parse IPN data.' );\n\t\t\t\t\n\t\t\t\t// check that the data is correct\n\t\t\t\t$valid = $cavirtex->merchant_confirm_ipn( $params, TRUE );\n\t\t\t\tif( ! $valid ) throw new Exception( 'Invalid IPN data.' );\n\t\t\t\t\n\t\t\t\t// has the invoice been paid in full? if yes, success; if not, continue waiting\n\t\t\t\t$paid_in_full = $cavirtex->merchant_invoice_balance_check( $params['order_key'], TRUE );\n\t\t\t\tif( $paid_in_full ) return $this->payment_successful( $params['order_key'] );\n\t\t\t\t\n\t\t\t} catch( Exception $e ){\n\t\t\t\treturn $this->handle_error( $e->getMessage() );\n\t\t\t}\n\t\t\t\n\t\t}", "function ipn(){\n $paypalInfo = $this->input->post();\n \n $data['user_id'] = $paypalInfo['custom'];\n $data['product_id'] = $paypalInfo[\"item_number\"];\n $data['txn_id'] = $paypalInfo[\"txn_id\"];\n $data['payment_gross'] = $paypalInfo[\"mc_gross\"];\n $data['currency_code'] = $paypalInfo[\"mc_currency\"];\n $data['payer_email'] = $paypalInfo[\"payer_email\"];\n $data['payment_status'] = $paypalInfo[\"payment_status\"];\n $data['entry_date'] =date('Y-m-d');\n \n $paypalURL = $this->paypal_lib->paypal_url; \n $result = $this->paypal_lib->curlPost($paypalURL,$paypalInfo);\n \n //check whether the payment is verified\n if(preg_match(\"/VERIFIED/i\",$result)){\n //insert the transaction data into the database\n $this->product->insertTransaction($data);\n }\n }", "public function testVisaCard()\n {\n $this->assertTrue(LuhnChecker::check('4111111111111111')); // valid JCB Card\n $this->assertFalse(LuhnChecker::check('411111111111111'));\n $this->assertFalse(LuhnChecker::check('41111111111111111'));\n }", "function check_ipn_response() {\n\t\t\n\t\tif ( is_admin() ) return;\n\t\t\n\t\tif ( isset($_GET['paypalListener']) && $_GET['paypalListener'] == 'paypal_standard_IPN' ) {\n\n\t\t\t@ob_clean();\n\t\t\t\n\t\t\t$_POST = stripslashes_deep($_POST);\n\t\t\t\n\t\t\tif ( self::check_ipn_request_is_valid() ) {\n\t\t\t\t\n\t\t\t\theader('HTTP/1.1 200 OK');\n\t\t\t\t\n\t\t\t\tdo_action(\"valid-paypal-standard-ipn-request\", $_POST);\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\twp_die(\"PayPal IPN Request Failure\");\n\t\t\t\n\t\t\t}\n\n\t\t} else {\n//\t\t\tif ( ! empty( $_GET )) jigoshop_log( \"Paypal function 'check_ipn_response' -- GET['paypalListener'] is NOT set\\nGET values: \" . print_r( $_GET, true ) );\n//\t\t\tif ( ! empty( $_POST )) jigoshop_log( \"Paypal function 'check_ipn_response' -- GET['paypalListener'] is NOT set\\nPOST values: \" . print_r( $_POST, true ) );\n\t\t}\n\n\t}", "FUNCTION prBR($testo_da_stampare = \"\", $n_BR_dopo_testo = 1, $n_BR_prima_testo = 0) {\n\techo str_repeat(\"<br>\\n\", $n_BR_prima_testo), (string) $testo_da_stampare, \"\\n\", str_repeat(\"<br>\\n\", $n_BR_dopo_testo);\n}", "public function testCheckUserEntitlementItem()\n {\n }", "public function testInsertInvalidRsvp() {\n\t\t// create a Invitee with a non null invitee id and watch it fail\n\t\t$rsvp = new Rsvp(InvitersvpTest::INVALID_KEY, $this->invitee->getInviteeId(), $this->VALID_RSVPBROWSER, $this->VALID_RSVPCOMMENT, $this->VALID_RSVPIPADDRESS, $this->VALID_RSVPNUMPEOPLE);\n\t\t$rsvp->insert($this->getPDO());\n\t}", "public function testGetEntitlementItem()\n {\n }", "public function testValid()\n {\n $this->todo('stub');\n }", "function postcodeValidate($state, $postcode) {\n $errMsg = \"\";\n \n $state = sanitiseInput($state);\n $postcode = sanitiseInput($postcode);\n $stateArray = array(\"VIC\", \"NSW\", \"QLD\", \"NT\", \"WA\", \"SA\", \"TAS\", \"ACT\");\n if (!in_array($state, $stateArray)) {\n $errMsg = $errMsg . \"Error. Please enter your state properly\";\n }\n else {\n if (!preg_match(\"/^[\\d]{4}$/\", $postcode)) {\n $errMsg = $errMsg . \"Error. Please make sure postcode contain 4 digits\";\n }\n else {\n switch ($state) {\n case \"VIC\": //postcode of VIC start with 3 or 8\n if (!in_array($postcode[0], [\"3\", \"8\"])) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"NSW\": //postcode of NSW start with 1 or 2\n if (!in_array($postcode[0], [\"1\", \"2\"])) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"QLD\": //postcode of QLD start with 4 or 9\n if (!in_array($postcode[0], [\"4\", \"9\"])) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"NT\": //postcode of NT start with 0\n if (!($postcode[0] == \"0\")) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"WA\": //postcode of WA start with 6 \n if (!($postcode[0] == \"6\")) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"SA\": //postcode of SA start with 5\n if (!($postcode[0] == \"5\")) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"TAS\": //postcode of TAS start with 7 \n if (!($postcode[0] == \"7\")) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n case \"ACT\": //postcode of ACT start with 0 \n if (!($postcode[0] == \"0\")) {\n $errMsg = $errMsg . \"Mismatch between postcode and state\";\n }\n break;\n\n }\n }\n }\n return [$errMsg, $postcode];\n $sm[] = \"sdfk\";\n \n }", "public function verify(){\n if($_POST['test_ipn'] == 1 && !self::TESTING){\n $this->logError('null', 'null', 'Received test notification on live environment.');\n }else{\n //define the url we are communicating with\n $url = (self::TESTING) ? self::TEST_URL : self::LIVE_URL;\n \n $request = 'cmd=_notify-validate';\n foreach ($_POST as $key => $value) {\n $value = urlencode(stripslashes($value));\n $request .= \"&$key=$value\";\n }\n\n $txn_id = $_POST['txn_id'];\n $user_id = $_POST['custom'];\n $paid = $_POST['mc_gross'];\n\n //send unaltered data back to PayPal to\n //check validity of received data\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n $message = curl_exec($ch);\n curl_close($ch);\n\n if($message == 'VERIFIED') {\n if(!isset($_POST['reason_code']) && $paid > 0 ) {\n\n //make sure it's USD\n if($_POST['mc_currency'] != 'USD') {\n $this->logError($txn_id, null, 'Incorrect currency.');\n return false;\n }\n\n if($_POST['receiver_email'] != self::PAYPAL_EMAIL) {\n $this->logError($txn_id, null, 'Incorrect receiver email.');\n return false;\n }\n\n return true;\n }\n }else{\n $this->logError($txn_id, $user_id, 'PayPal returned \"INVALID\" for attempted verification.');\n return false;\n }\n }\n }", "function ipn()\n {\n $this->load->library('PayPal_IPN'); // Load the library\n // Try to get the IPN data.\n if ($this->paypal_ipn->validateIPN())\n {\n // Succeeded, now let's extract the order\n $this->paypal_ipn->extractOrder();\n // And we save the order now (persist and extract are separate because you might only want to persist the order in certain circumstances).\n $this->paypal_ipn->saveOrder();\n // Now let's check what the payment status is and act accordingly\n if ($this->paypal_ipn->orderStatus == PayPal_IPN::PAID)\n {\n \n }\n }\n else // Just redirect to the root URL\n {\n $this->load->helper('url');\n redirect('courses', 'refresh');\n }\n }", "public function paypalIPN()\n {\n $sql = \"update zpayment_paypal set status='Failedsssss'\";\n // DBUtil::executeSQL($sql);\n define(\"DEBUG\", 1);\n\n // Set to 0 once you're ready to go live\n define(\"USE_SANDBOX\", 1);\n\n define(\"LOG_FILE\", \"./ipn.log\");\n\n // Read POST data\n // reading posted data directly from $_POST causes serialization\n // issues with array data in POST. Reading raw POST data from input stream instead.\n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode('=', $keyval);\n if (count($keyval) == 2)\n $myPost [$keyval [0]] = urldecode($keyval [1]);\n }\n // read the post from PayPal system and add 'cmd'\n $req = 'cmd=_notify-validate';\n if (function_exists('get_magic_quotes_gpc')) {\n $get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {\n $value = urlencode(stripslashes($value));\n } else {\n $value = urlencode($value);\n }\n $req .= \"&$key=$value\";\n }\n\n // Post IPN data back to PayPal to validate the IPN data is genuine\n // Without this step anyone can fake IPN data\n\n if (USE_SANDBOX == true) {\n $paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n } else {\n $paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n }\n\n $ch = curl_init($paypal_url);\n if ($ch == FALSE) {\n return FALSE;\n }\n\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\n if (DEBUG == true) {\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLINFO_HEADER_OUT, 1);\n }\n\n // CONFIG: Optional proxy configuration\n // curl_setopt($ch, CURLOPT_PROXY, $proxy);\n // curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);\n // Set TCP timeout to 30 seconds\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER,\n array(\n 'Connection: Close'\n ));\n\n // CONFIG: Please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and set the directory path\n // of the certificate as shown below. Ensure the file is readable by the webserver.\n // This is mandatory for some environments.\n // $cert = __DIR__ . \"./cacert.pem\";\n // curl_setopt($ch, CURLOPT_CAINFO, $cert);\n\n $res = curl_exec($ch);\n if (curl_errno($ch) != 0) { // cURL error\n if (DEBUG == true) {\n error_log(date('[Y-m-d H:i e] ').\"Can't connect to PayPal to validate IPN message: \".curl_error($ch).PHP_EOL,\n 3, LOG_FILE);\n }\n curl_close($ch);\n exit();\n } else {\n // Log the entire HTTP response if debug is switched on.\n if (DEBUG == true) {\n error_log(date('[Y-m-d H:i e] ').\"HTTP request of validation request:\".curl_getinfo($ch,\n CURLINFO_HEADER_OUT).\" for IPN payload: $req\".PHP_EOL,\n 3, LOG_FILE);\n error_log(date('[Y-m-d H:i e] ').\"HTTP response of validation request: $res\".PHP_EOL,\n 3, LOG_FILE);\n\n // Split response headers and payload\n list ( $headers, $res ) = explode(\"\\r\\n\\r\\n\", $res, 2);\n }\n curl_close($ch);\n }\n\n // Inspect IPN validation result and act accordingly\n $txn_id = $_POST ['txn_id'];\n if (strcmp($res, \"VERIFIED\") == 0) {\n // check whether the payment_status is Completed\n // check that txn_id has not been previously processed\n // check that receiver_email is your PayPal email\n // check that payment_amount/payment_currency are correct\n // process payment and mark item as paid.\n // assign posted variables to local variables\n $item_name = $_POST ['item_name'];\n $item_number = $_POST ['item_number'];\n $payment_status = $_POST ['payment_status'];\n $payment_amount = $_POST ['mc_gross'];\n $payment_currency = $_POST ['mc_currency'];\n $txn_id = $_POST ['txn_id'];\n $receiver_email = $_POST ['receiver_email'];\n $payer_email = $_POST ['payer_email'];\n $sql = \"update zpayment_paypal set status='\".$payment_status.\"sssss' where transaction_id='\".$txn_id.\"'\";\n DBUtil::executeSQL($sql);\n if (DEBUG == true) {\n error_log(date('[Y-m-d H:i e] ').\"Verified IPN: $req \".PHP_EOL,\n 3, LOG_FILE);\n }\n } else if (strcmp($res, \"INVALID\") == 0) {\n // log for manual investigation\n $sql = \"update zpayment_paypal set status='Failedsssss' where transaction_id='\".$txn_id.\"'\";\n DBUtil::executeSQL($sql);\n // Add business logic here which deals with invalid IPN messages\n if (DEBUG == true) {\n error_log(date('[Y-m-d H:i e] ').\"Invalid IPN: $req\".PHP_EOL, 3,\n LOG_FILE);\n }\n }\n }", "function _wpiu_paypal_ipn(){\n\t\t\n\t\tif (get_query_var( 'action' ) == 'wpiu_paypal_ipn' && get_query_var( 'invoice_id' )) {\n\t\t\t\n\t\t\t$invoice_id = $_GET['invoice_id'];\n\t\n\t\t\t$meta = array();\n\t\t\t$meta = get_post_meta($invoice_id, '_wpiu_invoice_meta_trans',true);\n\t\t\t$postmeta = get_post_meta($invoice_id, '_wpiu_invoice_meta',true);\n\t\t\t\n\t\t\t$ipnlog = array();\n\t\t\t$ipnlog - get_option(WPIU_OPTION.'_ipn_log');\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//strip slashes\n\t\t\t$_POST = stripslashes_deep($_POST);\n\t\n\t\t\t//get the values into a meta array for later use. and also ipn log\n\t\t\t$meta[] = $_POST;\n\t\t\t$ipnlog[] = $_POST;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// add the paypal cmd to the post array\n\t $_POST['cmd'] = '_notify-validate';\n\t\n\t // send the message back to PayPal just as we received it\n\t $params = array( \n\t \t'body' => $_POST,\n\t\t\t\t'timeout' \t=> 30\n\t );\n\t\n\t\t\t//set paypal url\n\t $paypal_adr = 'https://www.paypal.com/cgi-bin/webscr';\n\t \n\t // post it all back to paypal to get a response code\n\t $response = wp_remote_post( $paypal_adr, $params );\n\t \n\t // Retry\n\t\t\tif ( is_wp_error($response) ) {\n\t\t\t\t$params['sslverify'] = false;\n\t\t\t\t$response = wp_remote_post( $paypal_adr, $params );\n\t\t\t}\n\t \n\t\t\t\n\t // cleanup\n\t unset($_POST['cmd']);\n\t \n\t //get options array\n\t $options = get_option(WPIU_OPTION);\n\t \n\t //check response\n\t if ( !is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 && (strcmp( $response['body'], \"VERIFIED\") == 0) && $_POST['payment_status'] == 'Completed' && $_POST['receiver_email'] == $options['invoice_payment_email']) {\n\t \t\n\t \t\tupdate_post_meta($invoice_id, '_wpiu_invoice_meta_trans', $meta);\n\t \t\t\n\t \t\t//update the paid amount\n\t \t\t$postmeta['_wpiu_invoice_meta_paid'] += $_POST['mc_gross'];\n\t \t\tupdate_post_meta($invoice_id, '_wpiu_invoice_meta',$postmeta);\n\t \t\t\n\t \t\t//update the ipn log\n\t \t\tupdate_option(WPIU_OPTION.'_ipn_log', $ipnlog);\n\t \t\t\n\t \t\t//send email\n\t \t\tWPIU_Notifications::_send_payment_update($postmeta, 'payment', $invoice_id);\n\t \t\t\n\t }else{\n\t \tWPIU_Notifications::_send_payment_update($postmeta, 'failed_payment', $invoice_id, print_r($_POST, true));\t\n\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t//kill wp\n\t\t\texit();\n\t\t}//if empty posts\n\t}", "public function rockNRollVerificationTest(FunctionalTester $I)\n {\n \t$I->login(); \t\n \t$this->checkAndVerifyAlopeciaStudy($I);\n \t$this->checkAndVerifyPresenceStudy($I);\n \t$this->checkAndVerifyEczemaStudy($I);\n \t$this->checkAndVerifyBreastCancerStudy($I);\n \t$this->checkAndVerifyOasisStudy($I);\n \t$this->checkAndVerifyRadiantStudy($I);\n \t$this->checkAndVerifyDialogtecTestLine($I);\n }", "function check_ipn_request_is_valid() {\n\n\t\tjigoshop_log( 'Checking if PayPal IPN response is valid ...' );\n\t\t\n\t\t// Get recieved values from post data\n\t\t$current_values = (array) stripslashes_deep( $_POST );\n\t\t\n\t\t // Add cmd to the post array\n\t\t$current_values['cmd'] = '_notify-validate';\n\n\t\t// Send back post vars to paypal\n\t\t$paypal_params = array( \n\t\t\t'body' => $current_values,\n\t\t\t'sslverify' => false,\n\t\t\t'timeout' => 30,\n\t\t\t'user-agent' => 'Jigoshop/' . jigoshop::jigoshop_version()\n\t\t);\n\n\t\t// Get url\n\t\tif ( $this->testmode == 'yes' ) {\n\t\t\t$paypal_adr = $this->testurl;\t\t\n\t\t} else {\n\t\t\t$paypal_adr = $this->liveurl;\t\t\n\t\t}\n\t\t\n\t\t// Post back to get a response\n\t\t$response = wp_remote_post( $paypal_adr, $paypal_params );\n\t\t\n\t\t// check to see if the request was valid\n\t\tif ( ! is_wp_error( $response )\n\t\t\t&& $response['response']['code'] >= 200\n\t\t\t&& $response['response']['code'] < 300\n\t\t\t&& (strcmp( $response['body'], \"VERIFIED\") == 0)) {\n\t\t\n\t\t\tjigoshop_log( 'Received valid response from PayPal' );\n\t\t\treturn true;\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\tjigoshop_log( 'Received invalid response from PayPal!' );\n\t\t\tjigoshop_log( 'IPN Response: ' . print_r( $response, true ) );\n\t\t\t\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\tjigoshop_log( 'PayPal IPN WordPress Error message: ' . $result->get_error_message() );\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "private function ipn_validate_payment_type(): void {\n\t\t\tif ( ! isset( $this->transaction_data['txn_type'] ) ) {\n\t\t\t\t$message = 'Missing transaction parameter \"txn_type\" in IPN data';\n\t\t\t\t$this->log_error( $message );\n\t\t\t\t$this->exit( '', true, $message, 422 );\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->transaction_data['txn_type'] ) ) {\n\t\t\t\tswitch ( $this->transaction_data['txn_type'] ) {\n\t\t\t\t\tcase 'web_accept':\n\t\t\t\t\tcase 'subscr_signup':\n\t\t\t\t\tcase 'subscr_payment':\n\t\t\t\t\tcase 'subscr_cancel':\n\t\t\t\t\tcase 'subscr_failed':\n\t\t\t\t\tcase 'subscr_eot':\n\t\t\t\t\t\t$this->log_info( 'Valid IPN txn_type: ' . $this->transaction_data['txn_type'] );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$message = 'Unsupported transaction txn_type: ' . $this->transaction_data['txn_type'];\n\t\t\t\t\t\t$this->log_error( $message );\n\t\t\t\t\t\t$this->exit( '', true, $message, 422 );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addToPRZL($item)\n {\n // validation for constraint: pattern\n if (is_scalar($item) && !preg_match('/[a-zA-Z,0-9]{1,10}/', $item)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches \"[a-zA-Z,0-9]{1,10}\", \"%s\" given', var_export($item, true)), __LINE__);\n }\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The PRZL property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->PRZL[] = $item;\n return $this;\n }", "public function verifyItem(\\Magento\\Quote\\Model\\Quote\\Item $item, $itemData)\n {\n foreach ($itemData as $key => $value) {\n $this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');\n }\n }", "function callback() {\r\n // if IPN callback is called\r\n\t\tSLEEP(5);\r\n if ($this->request->gethtml('method') == 'ipn'){ \r\n \r\n // read the post from PayPal system and add 'cmd'\r\n $req = 'cmd=_notify-validate';\r\n foreach ($_POST as $key => $value) {\r\n $req .= '&' . $key . '=' . urlencode(stripslashes($value));\r\n }\r\n //Debug\r\n if ($this->config->get('paypal_ipn_debug')) { $this->DoDebug($req); }\r\n // post back to PayPal system to validate\r\n $header = \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\";\r\n $header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\r\n $header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\";\r\n \r\n $url=$this->config->get('paypal_test')?'ssl://www.sandbox.paypal.com':'ssl://www.paypal.com';\r\n //SSL version\r\n $fp = fsockopen($url, 443, $errno, $errstr, 30);\r\n //NON-SSL version\r\n //$fp = fsockopen ($url, 80, $errno, $errstr, 30);\r\n \r\n //Debug\r\n if ($this->config->get('paypal_ipn_debug')) { $this->DoDebug($header . $req); }\r\n \r\n if ($fp) {\r\n fputs($fp, $header . $req); \r\n while (!feof($fp)) {\r\n $res = fgets($fp, 1024);\r\n }\r\n fclose($fp);\r\n \r\n //Debug\r\n if ($this->config->get('paypal_ipn_debug')) { $this->DoDebug($res); }\r\n \r\n if (strcmp ($res, \"VERIFIED\") == 0) {\r\n\t\t\t\t\t$this->order->load($this->request->gethtml('ref'));\r\n\t\t\t\t\t$this->order->process($this->getOrderStatusId('order_status_paid_unconfirmed'));\r\n\t\t\t\t\t$this->notification = 'IPN';\r\n $this->orderUpdate(); // Update order to pending or specify new value in language file\r\n }\r\n }\r\n }\r\n }", "protected function validateParams() {\r\n $item = $this->item;\r\n $itemId = $this->itemId;\r\n if ($item === NULL) {\r\n $lang = $this->getLanguage();\r\n $this->addErrorMessage($lang->getMessage('error.itemNotFound', (int)$itemId));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function ipn(){\n $paypalInfo = $this->input->post();\n if(!empty($paypalInfo)){\n // Validate and get the ipn response\n $ipnCheck = $this->paypal_lib->validate_ipn($paypalInfo);\n // Check whether the transaction is valid\n if($ipnCheck){\n // Insert the transaction data in the database\n $data['user_id'] = $paypalInfo[\"custom\"];\n $data['product_id'] = $paypalInfo[\"item_number\"];\n $data['txn_id'] = $paypalInfo[\"txn_id\"];\n $data['payment_gross'] = $paypalInfo[\"mc_gross\"];\n $data['currency_code'] = $paypalInfo[\"mc_currency\"];\n $data['payer_email'] = $paypalInfo[\"payer_email\"];\n $data['payment_status'] = $paypalInfo[\"payment_status\"];\n\n $this->product->insertTransaction($data);\n }\n }\n }", "public function process_ipn() {\n global $CFG, $DB, $SESSION, $OUTPUT, $PAGE;\n\n $simulating = optional_param('simulating', '', PARAM_BOOL);\n\n // Get all input parms.\n $transid = required_param('invoice', PARAM_TEXT);\n // Get the shopid. Not sure its needed any more.\n $custom = required_param('custom', PARAM_TEXT);\n\n if (is_scalar($custom)) {\n $shopid = $custom;\n } else {\n list($shopid) = $custom;\n }\n\n if ($simulating) {\n $PAGE->set_url(new moodle_url('/local/shop/paymodes/paypal/paypal_ipn.php'));\n $PAGE->set_title(get_string('paypalipnsimulation', 'shoppaymodes_paypal'));\n echo $OUTPUT->header();\n echo $OUTPUT->heading(get_string('paypalipnsimulation', 'shoppaymodes_paypal'), 2);\n echo '<pre>';\n }\n\n if (empty($transid)) {\n if ($simulating) {\n mtrace(\"[ERROR] Paypal IPN : Empty Transaction ID\");\n }\n shop_trace(\"[ERROR] Paypal IPN : Empty Transaction ID\");\n die;\n }\n\n if (!$afullbill = Bill::get_by_transaction($transid)) {\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN ERROR : No such order\");\n }\n shop_trace(\"[$transid] Paypal IPN ERROR : No such order\");\n die;\n }\n\n // Integrity check : the bill must belong to the shop wich is returned as info in custom Paypal data.\n if ($afullbill->shopid != $shopid) {\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN ERROR : Paypal returned info ($shopid) do not match the bill's shop ({$afullbill->shopid}).\");\n }\n shop_trace(\"[$transid] Paypal IPN ERROR : Paypal returned info ($shopid) do not match the bill's shop ({$afullbill->shopid}).\");\n die;\n }\n\n // Pass reference from bill.\n $this->theshop = $afullbill->theshop;\n\n $txnid = required_param('txn_id', PARAM_TEXT);\n $data = new StdClass;\n $validationquery = 'cmd=_notify-validate';\n $querystring = '';\n\n shop_trace(\"[$transid] Paypal IPN : paypal txn : $txnid\");\n shop_trace(\"[$transid] Paypal IPN : paypal trans : $transid\");\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : paypal txn : $txnid\");\n mtrace(\"[$transid] Paypal IPN : paypal trans : $transid\");\n }\n\n foreach ($_POST as $key => $value) {\n $value = stripslashes($value);\n $querystring .= \"&$key=\".urlencode($value);\n $value = clean_param($value, PARAM_TEXT);\n $data->$key = $value;\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : paypal $key : \".$value);\n }\n shop_trace(\"[$transid] Paypal IPN : paypal $key : \".$value);\n }\n\n $validationquery .= $querystring;\n // Control for replicated notifications (normal operations).\n if (empty($this->_config->test) && $DB->record_exists('local_shop_paypal_ipn', array('txnid' => $txnid))) {\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : paypal event collision on $txnid\");\n }\n shop_trace(\"[$transid] Paypal IPN : paypal event collision on $txnid\");\n shop_email_paypal_error_to_admin(\"Paypal IPN : Transaction $txnid is being repeated.\", $data);\n die;\n } else {\n $paypalipn = new Stdclass;\n $paypalipn->txnid = $txnid;\n $paypalipn->transid = $transid;\n $paypalipn->paypalinfo = $querystring;\n $paypalipn->result = '';\n $paypalipn->timecreated = time();\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : Recording paypal event\");\n }\n shop_trace(\"[$transid] Paypal IPN : Recording paypal event\");\n try {\n $DB->insert_record('local_shop_paypal_ipn', $paypalipn);\n } catch (Exception $e) {\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : Recording paypal event error \".$DB->get_last_error());\n }\n shop_trace(\"[$transid] Paypal IPN : Recording paypal event error \".$DB->get_last_error());\n }\n }\n\n /*\n * Warning : Paypal Sandbox may NOT activate any IPN back call.\n * See further faking answer solution for testing paypal.\n */\n if (empty($this->_config->test)) {\n $paypalurl = 'https://www.paypal.com/cgi-bin/webscr';\n } else {\n $paypalurl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n }\n\n // Fetch the file on the consumer side and store it here through a CURL call.\n // If simulating, we are confirming a purchase for test. No need to validate again.\n if (!$data->simulating) {\n $ch = curl_init(\"{$paypalurl}?$validationquery\");\n shop_trace(\"[$transid] Paypal IPN : sending validation request: \".\"{$paypalurl}?$validationquery\");\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, false);\n if (!empty($this->_config->test)) {\n curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-IPN-Moodle-Shop-Test-Agent');\n } else {\n curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-IPN-Moodle-Shop');\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: text/xml charset=UTF-8\"));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n $rawresponse = curl_exec($ch);\n\n if (empty($rawresponse)) {\n shop_trace('[$transid] Paypal IPN ERROR : VERIFICATION RESPONSE ERROR');\n die;\n }\n\n shop_trace(\"[$transid] Paypal IPN : Raw Response : {$rawresponse}.\");\n if ($rawresponse != 'VERIFIED') {\n shop_trace('[$transid] Paypal IPN ERROR : VERIFICATION ERROR');\n die;\n }\n\n // At this point the IPN is a true return from PAYPAL AND is VERIFIED.\n\n $DB->set_field('local_shop_paypal_ipn', 'result', 'VERIFIED', array('txnid' => $txnid));\n shop_trace(\"[$transid] Paypal IPN : Recording VERIFIED STATE on \".$txnid);\n\n if ($data->payment_status != \"Completed\" && $data->payment_status != \"Pending\") {\n $error = \"Paypal IPN : Status not completed nor pending. Check transaction with customer.\";\n shop_email_paypal_error_to_admin($error, $data);\n shop_trace(\"[$transid] Paypal IPN : Status not completed nor pending. Check transaction with customer.\");\n die;\n }\n }\n\n if ($data->simulating && empty($this->_config->test)) {\n mtrace(\"[$transid] Paypal IPN : Payment simulation only possible in test mode.\");\n shop_trace(\"[$transid] Paypal IPN : Payment simulation only possible in test mode.\");\n die;\n }\n\n if ($data->payment_status == \"Pending\") {\n $error = \"[$transid] Paypal IPN : Status is pending. Check transaction state in a while.\";\n if ($simulating) {\n mtrace($error);\n }\n shop_trace($error);\n die;\n }\n\n $prod = $this->_config->paypalsellername;\n $test = $this->_config->paypalsellertestname;\n $sellerexpectedname = (empty($this->_config->test)) ? $prod : $test;\n if ($data->receiver_id != $sellerexpectedname) { // Check that the business account is the one we want it to be.\n $error = \"[$transid] Paypal IPN : Business email is {$data->receiver_id} (not {$this->_config->paypalsellername})\";\n shop_email_paypal_error_to_admin($error, $data);\n if ($simulating) {\n mtrace($error);\n }\n shop_trace($error);\n unset($SESSION->shoppingcart);\n die;\n }\n\n // At this point, we have a payment confirmation.\n\n /*\n * Bill has not yet been soldout through an IPN notification\n * sold it out and update both DB and memory record\n */\n if ($afullbill->status != SHOP_BILL_SOLDOUT) {\n // Stores the back code of paypal.\n $tx = required_param('invoice', PARAM_TEXT);\n $afullbill->onlinetransactionid = $tx;\n $afullbill->paymode = 'paypal';\n $afullbill->status = SHOP_BILL_SOLDOUT;\n $afullbill->paymentfee = 0 + @$data->mc_fee;\n $afullbill->save(true);\n\n shop_trace(\"[$transid] Paypal IPN Start Production\");\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN Start Production\");\n }\n // Perform final production.\n $action = 'produce';\n include_once($CFG->dirroot.'/local/shop/front/produce.controller.php');\n $theblock = null;\n $controller = new \\local_shop\\front\\production_controller($afullbill->theshop, $afullbill->thecatalogue, $theblock, $afullbill, true, $simulating);\n $controller->process($action);\n if ($simulating) {\n mtrace(\"[{$transid}] Paypal IPN End Production\");\n }\n shop_trace(\"[{$transid}] Paypal IPN End Production\");\n }\n\n if ($simulating) {\n mtrace(\"[$transid] Paypal IPN : End of transaction\");\n }\n shop_trace(\"[$transid] Paypal IPN : End of transaction\");\n }", "function validateInput()\n{\n \n if ( (strlen($_POST['firstName']) < 2 ) && (strpos($_POST['firstName'],' ') !==false) )\n {\n echo \"First Name is not formatted properly.<br />\";\n return False;\n }\n if ( (strlen($_POST['lastName']) < 2 ) && (strpos($_POST['lastName'],' ') !==false) )\n {\n echo \"Last Name is not formatted properly.<br />\";\n return False;\n }\n if ( ($_POST['ISBN10'] == \"\") || (!is_isbn_10_valid($_POST['ISBN10'])) )\n {\n echo \"ISBN-10 is not formatted properly.<br />\";\n return False;\n }\n if ($_POST['ISBN13'] == \"\" || (!is_isbn_13_valid($_POST['ISBN13'])) )\n {\n echo \"ISBN-13 is not formatted properly.<br />\";\n return False;\n }\n /*\n if ($_POST['description'] == \"\")\n {\n echo \"Description is not formatted properly.<br />\";\n return False;\n }\n */\n\tif ($_POST['course'] < 1)\n\t{\n\t return false;\n\t} \n \n return True;\n \n}", "public function invalid_xrp()\n {\n _e('<div class=\"notice notice-error\"><p>The specified <b>XRP Account</b> and/or <b>XRPL Webhook</b> details are invalid. Please correct these for <b>WooCommerce XRP</b> to work properly.</p></div>', 'wc-gateway-xrp');\n }", "function testInvalidSubmit(){ \n $this->assertFieldValue('itemType[]',\"burrito\",\"burrito\",\"message goes here.\");\n $this->assertFieldValue('quantity[\"burrito\"]',3,3,\"another message\");\n }", "public function testCanMakeTsmFromPricingWithPnrInfo()\n {\n\n $msg = new CreateTSMFromPricing(\n new TicketCreateTsMFromPricingOptions([\n 'informationalRecordLocator' => 'ABC123',\n 'pricings' => [\n new Pricing([\n 'tsmNumber' => 3\n ])\n ]\n ])\n );\n\n $this->assertEquals('ABC123', $msg->pnrLocatorData->reservationInformation->controlNumber);\n }", "function check_parameter_or_fail($parameter, $error_message) {\n\t\tif (! CourseManager::check_parameter ( $parameter, $error_message )) die ();\n\t}", "public function testBuyAPhoneNumber()\n {\n }", "public function testContract()\n {\n $api_conf = $this->getAPIConf();\n if($api_conf->services->url) {\n \\TwentyI\\API\\Services::$serviceURL = $api_conf->services->url;\n }\n $rest = new \\TwentyI\\API\\Services($api_conf->services->key);\n\n $list = $rest->getWithFields(\"/domain\");\n if(count($list) > 0) {\n $item = end($list);\n $info = $rest->getWithFields(\"/domain/{$item->name}/contract\");\n $this->assertTrue(\n !!preg_match(\n '/^\\d{4}-\\d{2}-\\d{2}$/',\n $info->renewalDate\n ),\n \"Renewal date returned\"\n );\n } else {\n $this->markTestSkipped(\"Please add some domains to test fetch\");\n }\n }", "public function testPriceListItemsGetPriceListItemList()\n {\n }" ]
[ "0.56386715", "0.5636169", "0.55734175", "0.55495566", "0.55315804", "0.5526705", "0.5520879", "0.5493905", "0.5456569", "0.5448314", "0.54246396", "0.53366107", "0.5284224", "0.5254319", "0.5240165", "0.5235318", "0.5234429", "0.522308", "0.5175656", "0.51343596", "0.5125998", "0.50943714", "0.50939333", "0.5083616", "0.50810003", "0.50714624", "0.5045597", "0.50400907", "0.5038733", "0.5034938", "0.5009942", "0.4999189", "0.4979913", "0.4963681", "0.4963363", "0.4940137", "0.49216124", "0.49079987", "0.49079704", "0.4901588", "0.48988155", "0.4891978", "0.48794135", "0.48794135", "0.48788467", "0.48645142", "0.48596704", "0.48596233", "0.48461214", "0.48455298", "0.48363724", "0.48180774", "0.48103955", "0.4810225", "0.48052174", "0.48040453", "0.47971603", "0.4786763", "0.47865057", "0.47800326", "0.47795674", "0.47739226", "0.47736305", "0.477101", "0.4768754", "0.47681186", "0.47656214", "0.47632486", "0.47568515", "0.4753182", "0.47458434", "0.4743203", "0.47418886", "0.4739838", "0.473808", "0.47285426", "0.47252384", "0.47223538", "0.47201613", "0.47094172", "0.47059855", "0.47028497", "0.46966392", "0.46849543", "0.46772185", "0.4675807", "0.4675215", "0.46750948", "0.46742746", "0.46728235", "0.46661672", "0.4665016", "0.46619475", "0.46603957", "0.4656437", "0.46561605", "0.46427467", "0.46420348", "0.4638642", "0.4635129" ]
0.71495
0
Returns the String representation of an access rootline element.
Возвращает строковое представление элемента корневого дерева доступа.
public function __toString() { $rootlineElement = ''; if ($this->type == self::ELEMENT_TYPE_CONTENT) { $rootlineElement .= 'c'; } else if ($this->type == self::ELEMENT_TYPE_RECORD) { $rootlineElement .= 'r'; } else { $rootlineElement .= $this->pageId; } $rootlineElement .= self::PAGE_ID_GROUP_DELIMITER; $rootlineElement .= implode(',', $this->accessGroups); return $rootlineElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReadableRootline() {}", "public function __toString()\n {\n $tree = $this->_rootNode->getName() . \"\\n\";\n $tree .= $this->_traverse($this->_rootNode->getId());\n return $tree;\n }", "public function AsSingleLine() {\n\t$sLine = $this->AsString(' / ');\n\tif (empty($sLine)) {\n\t $out = \"(empty address)\";\n\t} else {\n\t $out = $sLine;\n\t}\n\t$id = $this->GetKeyValue();\n\treturn $out.\" (a$id)\";\n }", "public function __toString()\n {\n if ($this->_root == null) {\n return 'The tree is empty!';\n }\n \n return $this->_print($this->_root->getLeft()) . ' '\n . $this->_root->getKey() . ' '\n . $this->_print($this->_root->getRight());\n }", "protected function getRootLine() {}", "public function toString() {\n $s= sprintf(\"%s@DN(%s){\\n\", $this->getClassName(), $this->getDN());\n foreach ($this->attributes as $name => $attr) {\n $s.= sprintf(\" [%-20s] %s\\n\", $this->_ans[$name], implode(', ', $attr));\n }\n return $s.\"}\\n\";\n }", "public function toString() {\n\n\t\treturn (string) $this->nodeValue;\n\t}", "public function __toString() {\n\t\treturn 'Access: ' . $this->uid;\n\t}", "function asString(){\r\n \t$s = '<job_chain_node' . $this->attributes(). '/>';\r\n return $s;\r\n \r\n }", "public function __toString()\n {\n return $this->dom->C14N();\n }", "public function toString () {\r\n\t\t#src/logipar/Node.hx:49: characters 38-58\r\n\t\treturn $this->fancyString();\r\n\t}", "function asString(){\r\n \t$s = '<job_chain_node.job_chain' . $this->attributes(). '/>';\r\n return $s;\r\n \r\n }", "public function __toString() {\r\n $result = array($this->name);\r\n foreach( $this->elements as $e ) {\r\n $result[] = (string) $e;\r\n }\r\n return implode(\"\\n\", $result);\r\n }", "public function __toString() {\n\t\t\treturn implode( \"\\n\", $this->children );\n\t\t}", "public function getRoot(): string;", "public function getRoot(): string;", "protected function determineRootline() {}", "protected function determineRootline() {}", "public function doc_root() : string\n\t{\n\t\t$ret = $this->doc_root;\n\t\treturn $ret;\n\t}", "function asString(){\r\n \t$s = '<job_chain_node.end' . $this->attributes(). '/>';\r\n return $s;\r\n \r\n }", "public function __toString() {\n $ret = \"\\n\\t\".'<mapping root=\"'.$this->getPath().'\">';\n foreach($this->adapters as $adapter) $ret .= $adapter->__toString();\n $ret .= \"\\n\\t\".'</mapping>';\n return $ret;\n }", "public function __toString()\r\n {\r\n if (substr($this->name, -2) == '()') {\r\n return PHP_EOL . substr($this->name, 0, -2) . '(' . implode($this->glue, $this->elements) . ')';\r\n } else {\r\n return PHP_EOL . $this->name . ' ' . implode($this->glue, $this->elements);\r\n }\r\n }", "function __toString(){\n\t\t// TODO all are string values, maybee som should be decimal\n\t\t$result = sprintf(\"0\\nPOLYLINE\\n66\\n1\\n%s\\n70\\n%s\\n%s\", // 66\\n1\\n entities follow\n\t\t\t\t\t\t\t\t\t$this->common(),\n\t\t\t\t\t\t\t\t\t$this->attributes['flag'],\n\t\t\t\t\t\t\t\t\tpoint($this->attributes['points'][0])\n\t\t\t\t);\n\t\tif (isset($this->attributes['width'])){\n\t\t\t$result .= sprintf(\"43\\n%s\\n\",\n\t\t\t\t\t\t\t\t$this->attributes['width']);\n\t\t}\n\t\tforeach ($this->attributes['points'] as $p){\n\t\t\t$result .= sprintf(\"0\\nVERTEX\\n%s\\n%s\",\n\t\t\t\t\t\t\t\t\t$this->common(),\n\t\t\t\t\t\t\t\t\tpoint($p));\n\t\t}\n\t\t$result .= \"0\\nSEQEND\\n\";\n\t\treturn $result;\n\t}", "function __toString()\n {\n return $this->rootObj->toString($this->type);\n }", "public function toString()\n {\n $ldif = $this->addCommentsToString('');\n if (!is_null($this->version)) {\n $ldif .= $this->getLdifLine(self::DIRECTIVE_VERSION, $this->version);\n }\n foreach ($this->entries as $entry) {\n $this->setupEntry($entry);\n $ldif .= $this->lineEnding.$entry->toString();\n }\n\n return $ldif;\n }", "public function __toString()\n {\n return PHP_EOL.trim($this->name).' '.implode($this->sep, $this->elements);\n }", "public function getRoot()\n {\n return Arr::get($this->customAttributes, 'root');\n }", "public function getDataWithTypeFullrootline() {}", "function toString()\n {\n return\n '<'.$this->name.\n $this->getAttributeString().\n ($this->first_child\n ? '>'.\n (is_a('HtmlTag', $this->first_child)\n ? $this->first_child->toString\n : $this->first_child\n )\n : ''\n );\n }", "abstract protected function determineRootline() ;", "public function __toString()\n\t{\n\t\treturn 'element (class: ' . get_class($this) . '; xpath: ' . $this->getXpath() . ')';\n\t}", "public function toString()\n {\n\t\treturn $this->__toString();\n\t}", "public function __toString()\n {\n $function = $this->function;\n $file = $this->file;\n $line = $this->line;\n // Format trace as a string.\n if ($file === null) {\n $formattedLine = \"[internal function]: {$function}\";\n } else {\n $formattedFile = \"{$file}({$line})\";\n if (self::isFileEditable($file)) {\n $formattedLine = \"{$formattedFile}: {$function}\";\n } else {\n $formattedLine = \"<u>{$formattedFile}</u>: {$function}\";\n }\n }\n\n return $formattedLine;\n }", "function __toString(){\n\t\t// TODO all are string values, maybee som should be decimal\n\t\treturn sprintf(\"0\\nARC\\n%s\\n%s40\\n%f\\n50\\n%f\\n51\\n%f\",\n\t\t\t\t\t\t\t\t\t$this->common(),\n\t\t\t\t\t\t\t\t\tpoint($this->attributes['center']),\n\t\t\t\t\t\t\t\t\t$this->attributes['radius'],\n\t\t\t\t\t\t\t\t\t$this->attributes['startAngle'],\n\t\t\t\t\t\t\t\t\t$this->attributes['endAngle']\n\t\t\t\t);\n\t}", "public function toString(){\n\t\treturn $this->__toString();\n\t}", "public function toString(){\n\t\treturn $this->__toString();\n\t}", "public function getString()\n {\n $s = \"\";\n $node = $this->front;\n while ($node != null)\n {\n $s .= $node->data.\" \";\n $node = $node->next;\n }\n $s = substr($s,0,-1);\n return $s;\n }", "public function getOpeningLineText()\n {\n return \": \" . substr($this->obj->title, 0, self::MAX_LENGTH_LINE);\n }", "function __toString(){\n\t\t// TODO all are string values, maybee som should be decimal\n\t\treturn sprintf(\"0\\n3DFACE\\n%s\\n%s\",\n\t\t\t\t\t\t\t\t\t$this->common(),\n\t\t\t\t\t\t\t\t\tpoints($this->attributes['points'])\n\t\t\t\t);\n\t}", "public function __toString(): string\n {\n return (string) $this->getFullyQualifiedStructuralElementName();\n }", "public function toString() {\n return $this->getClassName().'@<'.xp::stringOf($this->base).'>';\n }", "public function toString(): string\n {\n return $this->attributeCollection->toString();\n }", "public function toString()\n {\n return $this->__toString();\n }", "function __toString()\n\t{\n\t\treturn $this->name . \": \" . wordwrap($this->value, 75, \"\\n \", FALSE) . \"\\n\";\n\t}", "public function __toString()\n {\n $string = \"--------------------------------------\" . PHP_EOL;\n foreach ($this->parts as $part) {\n $len = strlen($part);\n if ($len == 17 && $part[0] == 0) {\n $part = $this->encodeUuid($part);\n $len = strlen($part);\n }\n $string .= sprintf(\"[%03d] %s %s\", $len, $part, PHP_EOL);\n }\n\n return $string;\n }", "public function getRoot()\n {\n return $this->_getValue('Root');\n }", "public function __toString() {\r\n return $this->C14N();\r\n }", "public function toString() {\n return sprintf(\n \" [title ] %s\\n\".\n \" [urgency ] %s\\n\".\n \" [category ] %s\\n\".\n \" [keywords ] %s\\n\".\n \" [dateCreated ] %s\\n\".\n \" [author ] %s\\n\".\n \" [authorPosition ] %s\\n\".\n \" [city ] %s\\n\".\n \" [state ] %s\\n\".\n \" [country ] %s\\n\".\n \" [headline ] %s\\n\".\n \" [credit ] %s\\n\".\n \" [source ] %s\\n\".\n \" [copyrightNotice ] %s\\n\".\n \" [caption ] %s\\n\".\n \" [writer ] %s\\n\".\n \" [supplementalCategories ] %s\\n\".\n \" [specialInstructions ] %s\\n\".\n \" [originalTransmissionReference] %s\\n\".\n \"}\", \n $this->title,\n $this->urgency,\n $this->category,\n xp::stringOf($this->keywords, ' '),\n xp::stringOf($this->dateCreated),\n $this->author,\n $this->authorPosition,\n $this->city,\n $this->state,\n $this->country,\n $this->headline,\n $this->credit,\n $this->source,\n $this->copyrightNotice,\n $this->caption,\n $this->writer,\n xp::stringOf($this->supplementalCategories, ' '),\n $this->specialInstructions,\n $this->originalTransmissionReference\n );\n }", "public function __toString()\n {\n return $this->get(self::FORMAT_DOTTED_NOTATION);\n }", "public function toString(): string\n\t{\n\t\treturn MessageHeaderRenderer::renderAttributedValue( $this );\n\t}", "public function __toString(): string\n {\n return $this->getXml();\n }", "public function __toString()\n {\n $s = '';\n foreach ($this as $key => $attr) {\n $s .= $key . ': ' . $attr . PHP_EOL;\n }\n return $s;\n }", "public function __toString() {\n\t\t$out = '';\n\t\tforeach($this as $item) $out .= \"\\n$item\"; \n\t\treturn trim($out); \n\t}", "public function __toString(): string\n {\n return $this->file . ':' . $this->line_number_start;\n }", "public function string()\n {\n return\n $this->drive() .\n ':' .\n static::ATOM_SEPARATOR .\n implode(static::ATOM_SEPARATOR, $this->atoms()) .\n ($this->hasTrailingSeparator() ? static::ATOM_SEPARATOR : '');\n }", "public function toString(): string {\n return $this->__toString();\n }", "public function getFullLine()\n {\n if (strlen($this->getKey()) > 0) {\n $this->setFullLine(\n sprintf('%s=\"%s\"', $this->getKey(), $this->getValue())\n );\n }\n\n return $this->fullLine;\n }", "public function __toString() {\n return $this->letter() . $this->coordinates();\n }", "public function toString() {\n return \"{ id: $this->id, name: $this->name, size: $this->size, full_path: $this->full_path }\";\n }", "public function toString()\n {\n $EOL = $this->config()->EOL();\n \n $result = '';\n if ($this->config()->debug()) {\n $result .= '<!-- DEBUG: ' . print_r($this->toArray(), true) . ' -->' . $EOL;\n }\n \n\n $attr = ($this->getAttributes());\n $filename = '';\n if (isset($attr['filename'])) {\n $filename = $this->getFilepathResolver()->resolveFilepath($attr['filename']);\n if ($filename !== null) {\n \n if ($this->config()->debugTileFilenames()) {\n $result .= $EOL . '<!-- BEGIN: ' . $filename . ' -->' . $EOL;\n }\n\n $result .= $this->getTileFile($filename);\n \n if ($this->config()->debugTileFilenames()) {\n $result .= $EOL . '<!-- END: ' . $filename . '\" -->' . $EOL;\n }\n \n }\n }\n \n \n return $result;\n }", "public function toString(): string\n {\n // clone because the line shouldn't be completed on this instance where toString() is called or it would be a\n // side-effect.\n $c = clone $this;\n $c->completeLine();\n return $c->concatenateLines();\n }", "public function __toString() {\n\t\t$ostr = '===================================================' . \"\\n\";\n\t\t$ostr .= '| netxCart Object |' . \"\\n\";\n\t\t$ostr .= '===================================================' . \"\\n\";\n\t\t$ostr .= '===================================================' . \"\\n\";\n\t\treturn $ostr;\n\t}", "public function toString() {\n return $this->id . '//' . $this->grouping . '//' . $this->title . '//' . $this->status . '//' . $createBy;\n }", "public function rootNamespace() :string\n {\n return $this->rootNamespace;\n }", "public function getLeveledName($root_level = 1){\n return str_repeat('.&nbsp;.&nbsp;',$this->lvl - $root_level) . $this->name;\n }", "public function getName()\n {\n return self::LINESTRING;\n }", "public function toString(){\n\t $s = '';\n\t $s .= 'a_barcode: '.$this->barcode;\n\t $s .= 'a_name: '.$this->name;\n\t $s .= 'a_description: '.$this->description;\n\t $s .= 'a_condition: '.$this->condition;\n\t $s .= 'a_checkout_to: '.$this->checkoutTo;\n\t $s .= 'a_box: '.$this->box;\n\t $s .= 'a_item_type: '.$this->itemType;\n\t return $s;\n\t}", "public function __toString(){\n\t\t$output = '<b>Attributes:</b><pre>';\n\t\t$output .= print_r($this->entity->attributes,true);\n\t\t$output .= '</pre>';\n\t\treturn $output;\n\t}", "public function toString() {\n\t\t$html = '<' . strtolower($this->_name);\n\n\t\tforeach ($this->_attributes as $key => $value)\n\t\t\t$html .= ' ' . $key . '=\"' . $value . '\"';\n\n\t\t$inner_html = '';\n\n\t\tforeach ($this->_child_tags as $tag)\n\t\t\t$inner_html .= $tag->toString();\n\n\t\tif (empty($inner_html) && $this->_self_close) {\n\t\t\t$html .= ' />';\n\t\t} else {\n\t\t\t$html .= '>' . $this->_inner_html\n\t\t\t . '</' . strtolower($this->_name) . '>';\n\t\t}\n\n\t\treturn $html;\n\t}", "public function toString() {\n return $this->getClassName(). '<'.$this->path.'>';\n }", "function get_string() {\n\t\t$str = '';\n\t\t$attribs = $this->__attribs();\n\t\t$text = '';\n\t\tif(isset($this->__elements)) {\n\t\t\t$text = $this->__elements;\n\t\t}\n\t\tif(!is_array($text)) {\n\t\t\t$text = array($text);\n\t\t}\n\n \t$k = array_keys($text);\n \t$s = sizeOf($k);\n\t\treset($text);\n\n\t\tfor($i = 0; $i < $s; ++$i) {\n\t\t\t$value = $text[$k[$i]];\n\t\t\tif(is_object($value)) {\n\t\t\t\t$str .= $value->get_string();\n\t\t\t} else {\n\t\t\t\tif($value === '') { $value = '&#160;'; }\n\t\t\t\t$str .= $value;\n\t\t\t}\n\t\t}\n\t\t$_str = \"\\n<$this->type$attribs>\";\n\t\t$_str .= $str;\n\t\t$_str .= \"</$this->type>\";\n\treturn $_str;\n\t}", "public function __toString() {\r\n\t\t$string = '';\r\n\r\n\t\t$string .= $this->getTagAsString();\r\n\t\t$string .= ' - ';\r\n\t\t$string .= 'chksm = 0x' . sprintf('%08X', $this->checkSum);\r\n\t\t$string .= ', off = 0x' . sprintf('%08X', $this->offset);\r\n\t\t$string .= ', len = ' . $this->length;\r\n\r\n\t\treturn $string;\r\n\t}", "public function __toString() {\n $name = $this->name . \"{\";\n foreach ($this->attributes as $attr) {\n $name .= $attr->getKey() . \"='\" . $attr->getValue() . \"',\";\n }\n return substr($name, 0, strlen($name) - 1) . \"}\";\n }", "function __toString()\n {\n return $this->getNode()->getTitle();\n }", "public function __toString(): string\n {\n if (empty($this->point)) {\n return '';\n }\n\n return $this->point['lat'].' '.$this->point['lng'];\n }", "function asString(){\r\n \t$s = '<file_order_sink' . $this->attributes(). '/>';\r\n return $s;\r\n \r\n }", "public function toString() {\n\t\tif ($this->_name == \"php\") {\n\t\t\treturn $this->_contenu;\n\t\t}\n\t\t$str = \"<\".$this->_name;\n\n\t\tforeach ($this->_listOfAttributs as $attribute) {\n\t\t\t$str .= $attribute->toString();\n\t\t}\n\t\t// Si la balise est orpheline\n\t\tif ($this->_orphan) {\n\t\t\t$str .= \"/>\\n\";\n\t\t\treturn $str;\n\t\t}\n\n\t\t$str .= \"> \" . $this->_contenu ;\n\t\tforeach ($this->_listOfBalises as $balise) { // balise dans la balise\n\t\t\t$str .= $balise->toString().\"\\n\";\n\t\t}\n\n\t\t$str .= \"</\" . $this->_name .\">\"; //fermeture\n\t\treturn $str;\n\t}", "public function __toString()\n {\n return sprintf('%s', $this->getPlanAsignacion());\n }", "public function getLineIdentifier() : string\n {\n return (string) $this->id;\n }", "public function __toString()\n\t\t{\n\t\t\t$string = \"<pre>\";\n\t\t\t$string .= \"page_array: \" . To_String($this->page_array);\n\t\t\t$string .= \"data: \" . To_String($this->data);\n\t\t\t$string .= \"user_acl: \" . To_String($this->user_acl);\n\t\t\t$string .= \"company_list: \" . To_String($this->company_list);\n\t\t\t$string .= \"company_id: {$this->company_id}\";\n\t\t\t$string .= \"</pre>\";\n\t\t\treturn $string;\n\t\t}", "public function __toString()\n {\n return $this->reference ?? '';\n }", "public function __toString()\n\t{\n\t $value = str_replace(\"\\n\", \"\\\\\\n\", $this->nodeValue);\n\t return preg_match('/[\"\\'\\s]/', $this->nodeValue) && !($value[0] == '[' && substr($value, -1, 1) == ']') ? '\"' . addcslashes($this->nodeValue, '\"') . '\"' : $value;\n\t}", "function toString($newLine = \"\\n\") {\n\t\t$string = '';\n\t\t$string .= \" ID[$this->_ID] $newLine\";\n\t\t$string .= \" Name[$this->_Name] $newLine\";\n\t\t$string .= \" Description[$this->_Description] $newLine\";\n\t\t$string .= \" Folder[$this->_Folder] $newLine\";\n\t\treturn $string;\n\t}", "public function toString()\n {\n return $this->path;\n }", "public function toString()\n {\n return (string) $this->get();\n }", "protected function rootNamespace(): string\n {\n return $this->preset->rootNamespace().'\\\\';\n }", "public function __toString()\n {\n return $this->renderRequestLine() . parent::__toString();\n }", "public function __toString(): string\n {\n return (string) $this->getDn();\n }", "public function __toString()\n {\n return (string) $this->exportTo(AktPdPeer::DEFAULT_STRING_FORMAT);\n }", "public function __tostring()\n {\n return (string)$this->decorated;\n }", "public function toString() {\n $r= nameof($this).'['.$this->size.\"]@{\\n\";\n foreach ($this->elements as $i => $element) {\n $r.= ' '.$i.': '.Objects::stringOf($element, ' ').\"\\n\";\n } \n return $r.'}';\n }", "public function toString() {\n $s= $this->getClassName().'('.$this->_size.\")@{\\n\";\n for ($i= 0; $i < $this->_size; $i++) {\n $s.= ' '.xp::stringOf($this->list[$i], ' ').\"\\n\";\n }\n return $s.'}';\n }", "public function __toString()\n {\t\n return (string) str_repeat('_', abs($this->getLevel())).$this->getNo().' '.substr($this->getName(),0,50);\n }", "function asString(){\r\n \t$s = '<file_order_source' . $this->attributes(). '/>';\r\n return $s;\r\n }", "public function __toString()\n\t\t{\n\t\t\t$s = $this->reduce(new LinkedListToStringReduceFunction(), array('', ''));\n\t\t\t//create_function(\n\t\t\t// '$s, $item', \n\t\t\t// 'return array($s[0] . $s[1] . str($item), \", \");'\n\t\t\t//), array('',''));\n\t\t\treturn 'LinkedList{' . $s[0] . '}';\n\t\t}", "public function __toString()\n {\n $string = '';\n foreach ($this as $resource) {\n $string .= $resource->getName() . PHP_EOL;\n $rii = new RecursiveIteratorIterator($resource, RecursiveIteratorIterator::SELF_FIRST);\n foreach ($rii as $item) {\n $string .= str_repeat(' ', $rii->getDepth()+1) . $item->getName()\n . ((count($attributes = $item->getAttributes()) > 0) ? ' [' . http_build_query($attributes) . ']' : '')\n . PHP_EOL;\n }\n }\n return $string;\n }", "public function __toString()\n {\n $attributes = $this->maybeTruncate(\n array_reduce(\n iterator_to_array($this->element->attributes, true),\n static function ($text, DOMAttr $attribute) {\n return $text . \" {$attribute->nodeName}=\\\"{$attribute->value}\\\"\";\n },\n ''\n )\n );\n\n $textContent = $this->maybeTruncate($this->element->textContent);\n\n return sprintf(\n '<%1$s%2$s>%3$s</%1$s>',\n $this->element->tagName,\n $attributes,\n $textContent\n );\n }", "public function __toString() {\n $name = $this->get_name();\n if ($this->has_parent()) {\n $name = $this->get_parent()->__toString() . \" / \" . $name;\n }\n\n return $name;\n }", "public function __toString()\n\t{\n\t\treturn $this->path();\n\t}", "public function __toString()\n\t{\n\t\treturn sprintf(\n\t\t\t'%s: %s%s',\n\t\t\t$this->getName(),\n\t\t\t$this->getValue(),\n\t\t\tself::CRLF\n\t\t);\n\t}" ]
[ "0.61850303", "0.61006445", "0.6031593", "0.5851109", "0.5850358", "0.5685366", "0.5669439", "0.5658628", "0.5645712", "0.5614355", "0.5602519", "0.5593096", "0.5554503", "0.5542186", "0.5491166", "0.5491166", "0.54593897", "0.54588455", "0.5456775", "0.5456694", "0.5424541", "0.5419031", "0.5416214", "0.5398732", "0.5345595", "0.534037", "0.5336033", "0.5306528", "0.5295969", "0.52896786", "0.52696", "0.52680373", "0.5258046", "0.5257798", "0.5237709", "0.5237709", "0.5234862", "0.523306", "0.52318805", "0.5214907", "0.52052295", "0.5201845", "0.5201057", "0.5191673", "0.51756084", "0.5168822", "0.51681685", "0.5152252", "0.5142611", "0.5141337", "0.513801", "0.51215476", "0.5121524", "0.5119934", "0.51063037", "0.510277", "0.5099005", "0.5097204", "0.5090131", "0.50827503", "0.508095", "0.5073972", "0.5071669", "0.50694174", "0.5067732", "0.5067436", "0.50614816", "0.5043107", "0.5032856", "0.5031903", "0.50257295", "0.5024979", "0.50233185", "0.50228006", "0.5022158", "0.5021475", "0.50212014", "0.50200164", "0.50197536", "0.5015279", "0.50089407", "0.5001005", "0.4996579", "0.49958214", "0.4994221", "0.49907374", "0.49905443", "0.4985879", "0.49844396", "0.4982168", "0.49812043", "0.49743614", "0.49729198", "0.49673197", "0.49664593", "0.49651617", "0.49635467", "0.49623498", "0.49609342", "0.49536726" ]
0.7357863
0
Lists all InstructorInfo models.
Список всех моделей InstructorInfo.
public function actionIndex() { $dataProvider = new ActiveDataProvider([ 'query' => InstructorInfo::find(), ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex()\n {\n $searchModel = new CurInstructorSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAllConfigInstructor() {\n\t\t$data=$this->Settings_model->getlist_ConfigInstructor();\n\t\techo json_encode($data);\n\t}", "public function index(Instructor $instructor)\n {\n $enrollments = $instructor->courses()\n ->whereHas('enrollments')\n ->with('enrollments')\n ->get()\n ->pluck('enrollments')\n ->collapse();\n return $this->showAll($enrollments);\n }", "public function getAllInstructors(): Collection;", "public function index()\n {\n $instructors = Instructor::all();\n return view('instructors.index',compact('instructors'));\n }", "public function show ()\n {\n\n View::renderTemplate(\"Instructor/index.html\",[\n \"instructors\" => InstructorModel::getAll()\n ]);\n\n }", "public function index()\n {\n $all_instructors = Instructor::all();\n \n return view('instructors.index', \n ['all_instructors' => $all_instructors ]);\n }", "public function index()\n\t{\n\t\t$instructors=Instructor::orderBy('name')->get();\n\t\treturn View::make('instructors.index')\n\t\t\t->with(\"instructors\", $instructors);\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $instructors = $em->getRepository('FormationBundle:Instructor')->findAll();\n\n return $this->render('instructor/index.html.twig', array(\n 'instructors' => $instructors,\n ));\n }", "function GetInstructors()\n\t{\t$this->instructors = array();\n\t\t\n\t\t$sql = 'SELECT instructors.*, courseinstructors.listorder AS cilistorder FROM courseinstructors, instructors WHERE courseinstructors.inid=instructors.inid AND cid = '. (int)$this->id . ' ORDER BY courseinstructors.listorder, instructors.instname';\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$this->instructors[$row['inid']] = new Instructor($row);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function index()\n {\n //\n abort_if(Gate::denies('instructor_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n $instructors = Instructor::all();\n return view('admin.instructors.index', compact('instructors'));\n }", "public function index()\n {\n //\n $instructor = Instructors::all();\n\n return view('instructors.index', compact('instructor'));\n }", "public function show(Instructor $instructor)\n {\n //\n }", "public function getAll()\n {\n return Institute::where('from', '<=', Carbon::now())\n ->with('courses')\n ->orderBy('from', 'desc')\n ->get();\n }", "public function index()\n {\n if(\\Auth::user()->role !='admin'){\n return redirect('/dashboard');\n exit();\n }\n\n $instructors = User::where('role','instructor')\n ->where('is_active',true)\n ->withCount('class')\n ->withSum('students','member_count')\n ->orderBy('students_sum_member_count','DESC')\n ->get();\n //dd($instructors->toArray());\n return view('back.instructors',['instructors'=>$instructors]);\n }", "public function index()\n\t{\n\t\treturn $this->students->findAll();\n\t}", "public function index()\n {\n $instructores=Instructor::where('id','!=',1)->where('estado','!=',2)->orderBy('id','asc')->get();\n return view('admin.instructores.index')\n \t->with('instructores',$instructores);\n }", "public function instructors_management(){\n $instructors = Instructor::all();\n return view('admin.instructors_management',['activeLi' => 'instructorManagement' , 'instructors' => $instructors\n ]);\n }", "public function index()\n {\n\n return new ManageEnrollmentCollection(ManageEnrollment::with('enrollprograms','studinfo','enrollassoc','enrsy','enrsem','enryearlevel','enrsection')->orderBy('id','DESC')->paginate(15));\n }", "public function index()\n\t{\n\t\treturn Student::all();\n\t}", "public function index(Course $course)\n {\n\n $this->allowedAdminAction();\n\n $students = $course->enrollments()\n ->with('student')\n ->get()\n ->pluck('student');\n\n return $this->showAll($students);\n }", "public function index()\n {\n return Course::all()->toArray();\n }", "public function index()\n {\n return Students::all();\n }", "public function getAllCoursesByInstructor($id)\n {\n $sql = 'select c.id courseId ,u.id instructorID,cat.id categoryId,c.name course,\n c.price,c.description,c.img_url img_course,c.created_at,u.name instructor, \n u.adress,u.email,u.phone,cat.name category,avg(ra.rating_value) rating \n from courses c \n join users u ON u.id=c.instructor_id \n join roles r ON u.role_id=r.id AND r.type LIKE \"instructor\" \n join categories cat ON c.category_id =cat.id \n join rating ra ON ra.course_id=c.id \n group by ra.course_id \n Having instructorID =?';\n $courses = DB::select($sql, [$id]);\n\n return $courses;\n }", "public function getInstructors()\n {\n // This function contains some hacks. To wit:\n // Each instructor will be listed once for each course they are teaching,\n // with each course name in parentheses after the instructor name. This is\n // because Sierra doesn't actually have an \"instructor ID\" -- reserve books\n // can only be looked up by course, not by instructor.\n // To deal with cases where a given course may have multiple instructors,\n // \"fake IDs\" are constructed for each instance of a course after the first.\n // The findReserves function can work back from these fake IDs to the actual\n // course ID. (Otherwise a course could only be listed under one instructor.)\n try {\n $query = \"SELECT t1.field_content, t2.field_content, t1.record_num \"\n . \"FROM sierra_view.varfield_view AS t1 \"\n . \"INNER JOIN sierra_view.varfield_view AS t2 ON \"\n . \"t1.record_num = t2.record_num WHERE \"\n . \"t1.record_type_code = 'r' AND t1.varfield_type_code = 'p' AND \"\n . \"t2.record_type_code = 'r' AND t2.varfield_type_code = 'r' AND \"\n . \"t2.occ_num = '0' ORDER BY t1.field_content;\";\n $results = pg_query($query);\n $instructors = [];\n $j = 0;\n while ($row = pg_fetch_row($results)) {\n if (!empty($instructors[$row[2]]) ) {\n $fakeId = $row[2] . \"-\" . $j;\n $instructors[$fakeId] = $row[0] . \" (\" . $row[1] . \")\";\n $j++;\n } else {\n $instructors[$row[2]] = $row[0] . \" (\" . $row[1] . \")\";\n }\n }\n return $instructors;\n } catch (\\Exception $e) {\n throw new ILSException($e->getMessage());\n }\n }", "public function ShowAll()\n {\n return Attestation::all();\n }", "public function show(Instructor $instructor){\n $user = Auth::user();\n //Check if user has permission to view instructors\n $isAuthorized = app('App\\Http\\Controllers\\UserPrivilegeController')->checkPrivileges($user->id, Config::get('settings.instructor_management'), 'read_priv');\n\n if($isAuthorized){\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Viewed instructor record of ' . $instructor->last_name . ', ' . $instructor->first_name . '.',\n 'time' => Carbon::now()\n ]);\n $instructor['availabilities'] = $instructor->availabilities()->get();\n $instructor['preferred_subjects'] = $instructor->preferred_subjects()->get();\n return $instructor;\n }else{\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Attempted to view instructor record of ' . $instructor->last_name . ', ' . $instructor->first_name . '.',\n 'time' => Carbon::now()\n ]);\n return response()->json([\n 'message' => 'You are not authorized to view instructor records.'\n ],401);\n }\n }", "function load_instructors()\r\n {\r\n return $this->db->where('level', '2')\r\n ->get('users') ->result();\r\n }", "public function getAll()\n {\n $students = Student::all();\n\n return $students;\n }", "public function index()\n {\n return Course::all();\n }", "private function get_students()\n {\n return $this->students_model->find_all();\n }", "public function index()\n {\n return $courses = Course::all();\n }", "public function index()\n {\n $users=User::where('role_id', 3)->get();\n \n return view('Admin.instructors.index', compact('users'));\n }", "public function index()\n {\n return \\App\\Student::all();\n }", "public function showAll()\n {\n if (isset($_SESSION['loggedIn']) && isset($_SESSION['admin'])) {\n\n $universities = DAOFactory::getUniversityDAO()->findAll();\n\n require_once('../view/manageAllUniversity.php');\n } else {\n require_once('../view/home.php');\n }\n }", "public function index()\n {\n $classes = StudentsClass::get();\n return $classes;\n }", "public function instructors()\n {\n $instructors = array();\n foreach($this->course_sections as $section)\n {\n $instructors[] = $section->instructor;\n }\n return array_unique($instructors);\n }", "public function _load_instructors() {\n\t\t$this->instructors = array();\n\t\t$this->instructors_unique = array();\n\t\t$this->instructors_term_unique = array();\n\n\t\tforeach($this->courses as $term_code => $term) {\n\t\t\t$this->data['instructors_term_unique'][$term_code] = array();\n\t\t\tforeach($term as $crn => $course) {\n\t\t\t\t$this->data['instructors'][$term_code][$crn] = $course->instructors;\n\t\t\t\tforeach($course->instructors as $instructor) {\n\t\t\t\t\t$this->data['instructors_unique'][] = $instructor;\n\t\t\t\t\t$this->data['instructors_term_unique'][$term_code][] = $instructor;\n\t\t\t\t}//end foreach\n\t\t\t}//end foreach\n\n\t\t\t$this->data['instructors_term_unique'][$term_code] = array_unique($this->data['instructors_term_unique'][$term_code]);\n\t\t}//end foreach\n\n\t\t$this->data['instructors_unique'] = array_unique($this->data['instructors_unique']);\n\t}", "public function index()\n {\n $enrollments = Enrollment::with(['student', 'course'])->get();\n\n return new EnrollmentResource($enrollments);\n }", "public function index()\n {\n $vans = Student::all();\n return $this->showAll($vans);\n }", "function getListByInstructor($instructorId)\n {\n return $this->getCourseByInstructor($instructorId, 'list');\n }", "public function index()\n {\n return Faculty::all();\n }", "public function index()\n {\n $idInstructor= Auth::user()->id;\n $groups = DB::table('groups')\n ->leftJoin('courses', 'groups.id', '=', 'courses.id_group')\n ->where('id_instructor', '=', $idInstructor )\n ->select('groups.*', 'courses.title as course')\n ->get();\n return view('instructor.index', compact('groups'));\n }", "public function index()\n {\n $courses = Course::all();\n return view('instructor.courses.index', compact('courses'));\n }", "public function index()\n {\n /*Get assignment */\n $assignment = DB::table('assignment')->join('aspiration', 'assignment.student_id', '=', 'aspiration.student_id')->paginate(10);\n }", "public function index()\n {\n return QueryBuilder::for(Student::class)\n ->allowedFilters([AllowedFilter::exact('gender'),\n AllowedFilter::exact('blood_group'),\n AllowedFilter::exact('caste'),\n AllowedFilter::exact('caste_category'),\n AllowedFilter::exact('religion'),])\n ->allowedIncludes(['user', 'user.addresses', 'parent', 'parent.user', 'user.roles', 'user.updater'])\n ->paginate(100)\n ->appends(request()->query());\n }", "public function availabilities(Instructor $instructor=null){\n $user = Auth::user();\n //Check if user has permission to view instructors\n $isAuthorized = app('App\\Http\\Controllers\\UserPrivilegeController')->checkPrivileges($user->id, Config::get('settings.instructor_management'), 'read_priv');\n\n if($isAuthorized){\n if($instructor == null)\n //use this to display all instructor with all their time availabilities\n //$availabilities = Instructor::with('availabilities')->get();\n\n //use this to display all time availabilities only\n /*$availabilities = InstructorAvailability::select(array('id', 'instructor_id', 'day', 'time_start', 'time_end'))\n ->where('academic_year_id', \\Config::get('settings.current_ay'))\n ->where('semester_id', \\Config::get('settings.current_sem'))->get();*/\n $availabilities = InstructorAvailability::select(array('id', 'instructor_id', 'day', 'time_start', 'time_end'))->get();\n else\n $availabilities = $instructor->availabilities()->get();\n\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Viewed instructor availabilities.',\n 'time' => Carbon::now()\n ]);\n return $availabilities;\n\n }else{\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Attempted to view instructor availabilities.',\n 'time' => Carbon::now()\n ]);\n return response()->json([\n 'message' => 'You are not authorized to view instructor records.'\n ],401);\n }\n\n }", "public function getStudents()\n {\n \n return $this->student->paginate(10);\n\n }", "public function courses()\n {\n return $this->hasMany('App\\Models\\Course','instructor_id');\n }", "public function index()\n {\n $insurances = Insurance::all();\n\n return $this->showAll($insurances);\n }", "public function index()\n {\n //\n $infos = infomation::get();\n return InfoCollection::collection($infos);\n }", "public static function getAllStudent() {\n return Student::where('status', 1)->paginate(10);\n }", "public function index()\n {\n $students = Student::with(\"teacher\")->get();\n return view(\"student.list\", compact(\"students\"));\n }", "public function index()\n {\n return $this->showAll(LawyerResource::collection(Lawyer::where('authorized', true)->get()));\n }", "public function index(Request $request)\n { \n $academicInfos = AcademicInfo::where('school_session_id', $request->current_school_session_id)\n ->orderBy('created_at', 'desc')\n ->get();\n\n return view('students.index', compact('academicInfos'));\n }", "public function index()\n {\n personas::all();\n print_r( personas::all()->toJson());\n }", "public function index() {\n\t\t$this->data['students'] = $this->student_model->ListAll();\n\t\t$this->load->view('admin/student_list', $this->data);\n\t}", "public function index()\n {\n return new TeacherCollection(Teacher::paginate());\n }", "public function index(Request $request)\n {\n $this -> authorize(\"view\", Teacher::class);\n\n\t\t$levels = Level::pluck(\"name\", \"id\") -> all();\n\t\t$branches = Branch::selectOptions();\n\t\t$parents = ParentModel::selectOptions();\n\n\t\t$students = Student::with(\"classes.level\", \"studentOfDayCount\")\n\t\t\t-> filter($request -> all())\n\t\t\t-> paginate();\n\n return view(\"admin.student.index\", compact(\"students\", \"levels\", \"branches\", \"parents\"));\n }", "public function show($id)\n\t{\n\t\t$mod=Instructor::findOrFail($id);\n\t\t$cs=Helper::courselistwithmodel($mod);\n\t\t$link=HTML::linkAction('InstructorsController@history', \"full history\", $mod->id);\n\t\t$otherlink=link_to_action('TestsController@getPiperlineall', \"all evals for this term\", $mod->id);\n\t\t$title=\"Instructor: {$mod->name} ($link) ($otherlink)\";\n\t\treturn View::make('courses.index')\n\t\t\t->with('courses',$cs)\n\t\t\t->with('title',$title);\n\t}", "public function courseShow(){\n\n //ORM query\n $instructors= User::where('type','instructor')->get();\n //ORM query\n $courses = Course::select('name', 'user_id', 'id')->where('user_id', '=', auth()->user()->id)->get();\n\n return view('courseViewer', compact('courses', 'instructors'));\n\n }", "public function getAllInfo()\n\n\n {\n $this->checkPermission(4);\n\n $pageTitle = \"All Public Informations\";\n\n $informations = $this->publicInfo->getAllInformatiosData();\n\n // view Form\n include (WEBINTY_VIEWS.'/admin/header.html');\n include (WEBINTY_VIEWS.'/admin/menu.html');\n include (WEBINTY_VIEWS.'/admin/nav.html');\n include (WEBINTY_VIEWS.'/admin/allPublicInfo.html');\n include (WEBINTY_VIEWS.'/admin/footer.html');\n\n }", "public function index()\n {\n $allstudent = Student::all();\n return $allstudent;\n \n //\n }", "public function index()\n {\n return response()->json(Lesson::with(['teacher', 'grade'])->get());\n }", "public function index()\n {\n info(__METHOD__);\n\n return Applicant::all();\n }", "public function index()\n {\n return view('admin.courseEnroll.index')\n ->with('semesters', Semester::pluck('semester','id')->all());\n }", "public function index()\n {\n $serviceEnrollments = ServiceEnrollment::all();\n return $serviceEnrollments;\n }", "public function actionIndex()\n {\n return new ArrayDataProvider([\n 'allModels' => Professor::find()->asArray()->all()\n ]);\n }", "public function index()\n {\n return CoordinacionProfesor::all();\n }", "public function index()\n {\n $role = '';\n if (Auth::check()) {\n $role = Auth::user()->role;\n }\n if ($role == 'Instructor') {\n $modules_for_review = array();\n $modules_reviewed = array();\n $for_review_message = '';\n $reviewed_message = '';\n $for_review_patients = users_patient::where( 'user_id', Auth::user()->id )\n ->where( 'patient_record_status_id', 2 )\n ->get();\n $reviewed_patients = users_patient::where( 'user_id', Auth::user()->id )\n ->where( 'patient_record_status_id', 3 )\n ->get();\n\n if (!empty( $for_review_patients ))\n {\n foreach ($for_review_patients as $for_review_patient) {\n if ( $for_review_patient->patient->module ) {\n array_push( $modules_for_review, $for_review_patient->patient->module->module_name );\n } else {\n $for_review_message = 'There are no patients for review.';\n }\n }\n }\n else\n {\n $for_review_message = 'There are no patients for review.';\n }\n\n if (!empty( $reviewed_patients ))\n {\n foreach ($reviewed_patients as $reviewed_patient) {\n if ( $reviewed_patient->patient->module ) {\n array_push( $modules_reviewed, $reviewed_patient->patient->module->module_name );\n } else {\n $reviewed_message = 'There are no reviewed patients.';\n }\n }\n }\n else\n {\n $reviewed_message = 'There are no reviewed patients.';\n }\n $modules_for_review = array_unique( $modules_for_review );\n $modules_reviewed = array_unique( $modules_reviewed );\n return view( 'instructor/instructorHome', compact( 'for_review_patients', 'modules_for_review', 'modules_reviewed', 'for_review_message', 'reviewed_patients', 'reviewed_message' ) );\n }\n else\n {\n $error_message = \"You are not authorized to view this page\";\n return view( 'auth/not_authorized', compact( $error_message ) );\n }\n }", "public function instructorHasManySubjects()\n {\n return $this->hasMany('App\\InstructorSubject', 'instructorId', 'id');\n }", "public function instructor()\n {\n return $this->hasOne('App\\Instructor',\"user_id\");\n }", "public function index()\n {\n try{\n $conferencias = Conferencia::with('espacio')->orderByDesc('con_updated_at')->paginate(7);\n $instructores = Instructor::all();\n info($instructores);\n return view('Administrador.conferencias.index',compact('conferencias','instructores'));\n }catch(\\Exception | QueryException $e){\n return back()->withErrors(['exception'=>$e->getMessage()]);\n }\n }", "public function index()\n {\n // $educations = Education::where()\n }", "public function index()\n {\n return Claim::with(['Insurer.Namelist.School','Insurer.Namelist.Plan','Insurer.Title','Status'])->latest()->paginate(10);\n }", "public function index()\n {\n return Resource::collection(Teacher::paginate(10));\n }", "public function all()\n {\n return School::select('id', 'name')->get();\n }", "public function instructorFind(){\n //first completely validate the users input\n $this->validate(request(), [\n\n 'search' => 'required|integer',\n ]);\n\n $instructorID = request('search');\n\n $instructors= User::where('type','instructor')->get();\n\n $instruct = User::where('id', $instructorID)->first();\n\n $link = Link::where('link_id', $instructorID)->first();\n\n $courses = Course::where('user_id', $instructorID)->get();\n\n return view('studentInstructorView', compact('instructors', 'instruct', 'courses', 'link'));\n }", "public function instructor()\n {\n return InstructorStudentAssignment::where('student_id', $this->id)->first();\n }", "function index(){\n \n $this->my_page_builder('Instructor/gradesList');\n \n }", "public function index()\n {\n // Get Students\n\n $students = Student::paginate(10); \n return StudentResource::collection($students);\n }", "public function index()\n {\n //\n return ProfileResource::collection(Profile::with('institution')->paginate(100));\n }", "public function getSubjects()\n\n {\n\n $this->checkPermission(4);\n\n $pageTitle = \"All Subjects\";\n\n // model\n $subjects = $this->subjectsModel->getSubjects();\n\n // view\n include (WEBINTY_VIEWS.'/admin/header.html');\n include (WEBINTY_VIEWS.'/admin/menu.html');\n include (WEBINTY_VIEWS.'/admin/nav.html');\n include (WEBINTY_VIEWS.'/admin/subjects.html');\n include (WEBINTY_VIEWS.'/admin/footer.html');\n\n\n }", "public function index()\n {\n $students = Student::paginate(10);\n\n return view('admin.students.index')->with('students', $students);\n }", "public function index()\n {\n $data = Course::all();\n return view('profiling.course.index',compact('data'));\n }", "public function AllStudent()\n\t\t{\n\t\t\t$data = $this -> all('students', 'DESC');\n\n\t\t\tif ($data) {\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}", "public function index()\n {\n $industry = Industry::all();\n\n return $this->showAll($industry,Industry::class);\n }", "public function index()\n {\n return StudentResource::collection(Student::with('school')->orderByDesc('created_at')->paginate(10));\n }", "public function index()\n {\n $students = Student::latest('updated_at')->paginate();\n return (new StudentCollection($students));\n }", "public function index()\n {\n return School::all();\n }", "public function index()\n {\n return new JsonResponse(CourseType::all());\n }", "public function getInstituteList()\n\t\t {\n\t\t\t //get all values from database\n\t\t \t $institutes = $this->_DAL_Obj->getValue('institute_info','*');\n\t\t\t\n\t\t\tif(!empty($institutes[0]))\n\t\t\t{\n\t\t\t\tforeach ($institutes as $institute)\n\t\t\t\t{\n\t\t\t\t\t//getting institute status\n\t\t\t\t\tif($institute['institute_status'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$btn = '<button class=\"btn btn-success\">Active</button>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$btn = '<button class=\"btn btn-danger\">Deactive</button>';\n\t\t\t\t\t}\n\t\t\t\t\techo '<tr>\n\t\t\t\t\t\t\t<td>'.$institute['name'].'</td>\n\t\t\t\t\t\t\t<td>'.$institute['email'].'</td>\n\t\t\t\t\t\t\t<td>'.$institute['institute_type'].'</td>\n\t\t\t\t\t\t\t<td>'.$institute['city'].'</td>\n\t\t\t\t\t\t\t<td>'.$this->getInstituteName('zone','id',$institute['state'],'name').'</td>\n\t\t\t\t\t\t\t<td>'.$this->getInstituteName('country','id',$institute['country'],'name').'</td>\n\t\t\t\t\t\t\t<td><a href=\"edit-institute.php?uid='.$institute['institute_id'].'\"><button class=\"btn btn-info\">Edit</button></a></td>\n\t\t\t\t\t\t\t<td>'.$btn.'</td>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t }", "public function index()\n {\n return Participant::all();\n }", "public function index()\n {\n $acciones = Accion::all();\n\n return $this->showAll($acciones);\n }", "public function listProfessor(){\n return Professor::all();\n }", "public function index(Request $request)\n {\n $request->user()->authorizeRoles(['admin', 'user']);\n $students = Student::all();\n\n return view('students.index', compact('students'));\n\n }", "public function list()\n {\n return $this->apartment->all()->pluck('name', 'id')->all();\n }", "public function index()\n {\n return new CurriculumCollection(Curriculum::with('currsy','currprograms','currcourses','currsemester','curryearlevel','currsection','currinstructor')->orderBy('id','DESC')->paginate(10));\n }", "public function actionIndex()\n {\n $repository = new StudentsRepository();\n $dataProvider = $repository->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'repository' => $repository,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return tutorAcademico::all();\n }" ]
[ "0.7025984", "0.6773472", "0.6711657", "0.6544107", "0.6538991", "0.6456815", "0.63616073", "0.6308241", "0.63033223", "0.6286349", "0.6284292", "0.6254382", "0.6134451", "0.60906005", "0.60133314", "0.60008544", "0.5991663", "0.5936962", "0.5915513", "0.5857026", "0.5815847", "0.58130705", "0.5809084", "0.5790371", "0.5768525", "0.57601786", "0.5748405", "0.5737832", "0.57259345", "0.56901455", "0.5686683", "0.5685829", "0.5671132", "0.5648812", "0.5611718", "0.56088966", "0.55965406", "0.55829513", "0.557735", "0.55686826", "0.556504", "0.5543834", "0.55398375", "0.55236405", "0.55112916", "0.55068994", "0.55008996", "0.5494488", "0.5485554", "0.54812354", "0.54768735", "0.5474152", "0.5460284", "0.54559", "0.5455455", "0.544439", "0.5442776", "0.54314315", "0.5419417", "0.5404091", "0.540042", "0.53973085", "0.5387096", "0.5384753", "0.5380742", "0.53623956", "0.53590286", "0.53573936", "0.5352072", "0.53503203", "0.5341707", "0.5339831", "0.5338231", "0.533533", "0.5316002", "0.5292908", "0.52902174", "0.52885866", "0.5286435", "0.5283631", "0.52817935", "0.5279958", "0.52729714", "0.5260185", "0.5260047", "0.5250124", "0.5249051", "0.52417773", "0.52388436", "0.5236047", "0.52331764", "0.52327245", "0.5229625", "0.5228108", "0.5223432", "0.52231675", "0.52218825", "0.52170813", "0.52169335", "0.5216762" ]
0.74280506
0
Creates a new InstructorInfo model. If creation is successful, the browser will be redirected to the 'view' page.
Создает новый модель InstructorInfo. Если создание успешно, браузер будет перенаправлен на страницу 'view'.
public function actionCreate($id) { $model = new InstructorInfo(); $model->fkPersonID = $id; $model->year = date('Y'); if ($model->load(Yii::$app->request->post())) { $db = Yii::$app->db; // for convenience $transaction = $db->beginTransaction(); try { // Save the primary instructor_info record $model->save(); // Update the M2M relationships, if changed $this->updateM2M('instructor_info_ages', 'fkInstructorAgeGroup', $model->pkInstructorInfo); $this->updateM2M('instructor_info_activity', 'fkInstructorActivity', $model->pkInstructorInfo); $this->updateM2M('instructor_info_ridetypes', 'fkInstructorRideType', $model->pkInstructorInfo); $this->updateM2M('instructor_info_available', 'fkInstructorAvailable', $model->pkInstructorInfo); // Everything worked, commit the changes! $transaction->commit(); // And return to the person's view page return $this->redirect(['person/view', 'id' => $model->fkPersonID]); } // try catch(\Throwable $e) { $transaction->rollBack(); throw $e; } } return $this->render('create', [ 'model' => $model, 'person' => Person::findOne($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new CurInstructor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['view', 'id' => $model->ins_id]);\n }\n else \n {\n return $this->render('create', ['model' => $model]);\n }\n }", "public function create()\n {\n $instructors = Instructor::all();\n return view('students.create', compact('instructors'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Enrollment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Enrollment']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Enrollment'];\n\t\t\tif($model->save()){\n\t\t\t\t//$this->redirect(array('view','id'=>$model->id));\n //exit(json_encode(array('result' => 'success', 'msg' => 'success')));\n $this->renderPartial('classSchedule',array('model'=>$model,'classSchedule'=>ClassSchedule::model()));\n exit();\n }else{\n exit(json_encode(array('result' => 'error', 'msg' => 'Opps error on saving data.')));\n }\n\t\t}else{\n $model->enrollment_type_id = 1;\n }\n \n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'students'=>$this->loadStudentModel(),\n 'bands'=>$this->loadBandModel(),\n 'groups'=>$this->loadGroupModel(),\n\t\t));\n\t}", "public function create()\n {\n return view('instructors.create');\n \n }", "public function create()\n {\n return view('instructors.create');\n \n }", "public function actionCreate()\n {\n $model = new ExamStudent();\n\n if ($model->load(Yii::$app->request->post())) {\n $user=\\common\\models\\User::find()->where(['=', 'user.id', Yii::$app->user->id])->one();\n $model->uni_id = $user->uni_id;\n $model->save();\n return $this->redirect(['index', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('back.instructor-form',['instructor'=>[]]);\n }", "public function newinstructorAction()\n {\n /*if ($this->hasParam(\"sn\")) {\n $this->view->pageTitle = \"Activate Your Account\";\n $serial = SerialNumberLegacy::getBySerialNumber($this->_getParam(\"sn\"));\n\n //Display an error if the given serial number is already in use\n if ($serial->isActive()) {\n $this->displayError(\"This serial number has already been activated by \" . $serial->user->getName() . \" on \" . $serial->activation_date->format(\"m-d-Y\"));\n return;\n }\n\n $this->view->accountDetails = $serial->getAccountDetails();*/\n $form = new NewInstructorForm();\n /*} else {\n //Otherwise, we're already logged in, creating a free account\n $pageTitle = \"Create a new Instructor\";\n\n //Display an error if the user does not have permission to create instructor accounts\n if (!$this->objUser->hasPermission(\"Edit Instructor Accounts\")) {\n $this->displayError(\"You do not have permission to create instructor accounts. Please contact \" . $this->objUser->getCurrentProgram()->getProgramContactName() . \" for more information.\");\n return;\n }\n $form = new NewInstructorForm();\n\n }\n/*\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n if ($userId = $this->view->form->process($request->getPost())) {\n if ($this->hasParam(\"sn\")) {\n $this->redirect(\"/account/new/user-agreement/userId/\" . $userId);\n } else {\n $this->flashMessenger->addMessage(\"Instructor Account successfully created.\");\n $this->redirect(\"/account/new/instructor/\");\n }\n }\n }\n */\n return new ViewModel([\n 'form' => $form,\n ]);\n }", "public function actionCreate()\n {\n $model = new Students();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->response->cookies->add(new \\yii\\web\\Cookie([\n 'name' => 'user_' . $model->id,\n 'value' => 1,\n 'expire' => time() + 315360000.0042889 // ten years\n ]));\n\n Yii::$app->session->addFlash(\"success\", \"New student successfully added\");\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n return View::make('instructors.create');\n\t}", "public function actionCreate()\n {\n $model = new Student;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Student'])) {\n $model->attributes = $_POST['Student'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->Id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n //\n return view('instructors.create');\n\n return redirect()->back()->with('status', 'Instructor Successfully Added!');\n }", "public function actionCreate()\n {\n $model = new Information();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Courses;\n\n\t\tif(isset($_POST['Courses']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Courses'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('update','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Course();\n $post = Yii::$app->request->post();\n if ($model->load($post) && $model->save()) {\n //插入属性\n CourseAttr::insterAttr($model->id, $post['CourseAtts'], true);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->loadDefaultValues();\n $model->create_by = Yii::$app->user->id;\n return $this->render('create', [\n 'model' => $model,\n 'templates' => CourseTemplate::getTemplate(), //模板\n 'course_models' => ArrayHelper::map(CourseModel::find()->all(), 'id', 'name'),\n 'teachers' => ArrayHelper::map(Teacher::find()->all(), 'id', 'name'),\n ]);\n }\n }", "public function createAction()\n {\n\n $staff = new InstructorModel($_POST);\n\n $staff->setFile($_FILES['photo']);\n\n if ($staff->save('create')) {\n\n Flash::addMessage(\"Success\");\n $this->redirect(\"/admin/instructor/show\");\n\n } else {\n\n Flash::addMessage(\"Something went wrong\", Flash::WARNING);\n $this->redirect(\"/admin/instructor/show\");\n }\n\n }", "public function actionCreate()\n {\n $model = new Course();\n $model->scenario = 'self_create';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->course_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model= new Student;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Profile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Students;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Students']))\n\t\t{\n\n\t\t\t$model->attributes=$_POST['Students'];\n\t\t\t$list = $_POST['Students'];\n\t\t\tif($model->admission_date)\n\t\t\t$model->admission_date=date('Y-m-d',strtotime($model->admission_date));\n\t\t\tif($model->date_of_birth)\n\t\t\t$model->date_of_birth=date('Y-m-d',strtotime($model->date_of_birth));\n\t\t\t //$model->photo_data=CUploadedFile::getInstance($model,'photo_data');\n\t\t\t \n\t\t\tif($file=CUploadedFile::getInstance($model,'photo_data'))\n \t\t {\n $model->photo_file_name=$file->name;\n $model->photo_content_type=$file->type;\n $model->photo_file_size=$file->size;\n $model->photo_data=file_get_contents($file->tempName);\n \t\t }\n \n\t\t\t \n\t\t\t\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('guardians/create','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n\n\n $all_instructors = Instructor::all();\n $all_category = Category::all();\n \n return view('courses.create', \n ['all_instructors' => $all_instructors,\n 'all_category' => $all_category ]);\n\n }", "public function create()\n { \n $instructors = Instructors::all();\n return view('drivingschool.add', compact('instructors'));\n }", "public function create()\n {\n //\n return view('student.addStudent');\n }", "public function create()\n {\n return view(\"students.create\");\n }", "public function actionCreate()\n\t{\n\t\t$this->_model=new Profile;\n\n\t\tif(isset($_POST['Profile'])){\n\t\t\t$this->_model->attributes=$_POST['Profile'];\n\t\t\tif($this->_model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$this->_model->user_id));\n\t\t}\n\n\t\t//$this->debug($this->_model);\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$this->_model,\n\t\t));\n\n\t}", "public function create()\n\t{\n\t\treturn view('students.create');\n\t}", "public function create() {\n\t\t//\n\t\treturn view('student.create');\n\t}", "public function create()\n {\n $categories = Category::all();\n $instructors = Instructor::all();\n return view(\"backend.courses.create\", compact(\"categories\", \"instructors\"));\n }", "public function create()\n {\n //\n return view(\"students.create\");\n\n }", "public function create()\n {\n return view('admin.student.addnew');\n }", "public function create()\n {\n return view(\"student.create\"); \n }", "public function create()\n {\n $majors = Major::pluck('name', 'id')->all();\n \n return view('Admin.instructors.create', compact('majors'));\n }", "public function create()\n {\n \t$this -> authorize(\"create\", Student::class);\n\n $branches = Branch::selectOptions();\n $parents = ParentModel::selectOptions();\n $classes = ClassModel::selectOptions();\n $years = Year::selectOptions();\n\n return view(\"admin.student.create\", compact(\"branches\", \"parents\", \"classes\", \"years\"));\n }", "public function create()\n {\n //\n return view('student.create');\n }", "public function actionCreate()\n {\n $model = new Members();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newstudent()\n\t{\n\t\t$this->load->model(\"administrator\");\n\t\t$this->load->view('admin/super/header');\n\t\t$this->load->view('admin/super/newstudent');\n\t\t$this->load->view('admin/super/footer');\n\t}", "public function create()\n {\n return view ('students.create');\n }", "public function create()\n\t{\n\t\treturn View::make('backend.students.create');\n\t}", "public function create()\n {\n return view('admin.student.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('student.create');\n }", "public function create()\n {\n return view('student.create');\n }", "public function create()\n {\n return view('student.create');\n }", "public function create()\n {\n return view('student.create');\n }", "public function actionCreate() {\n $model = new Asistencia;\n\n $this->performAjaxValidation($model, 'asistencia-form');\n\n if (isset($_POST['Asistencia'])) {\n $model->attributes = $_POST['Asistencia'];\n $model->COD_USUARIO = (Yii::app()->getSession()->get('id_usuario'));\n if ($model->save()) {\n $this->redirect(array('view', 'id' => $model->CODIGO_ASISTENCIA));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n return view('students.create');\n\n }", "public function actionCreate()\n {\n if(!Yii::$app->user->isAdminGroup){\n return $this->redirect('index');\n }\n\n $model = new Stamps();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('students.create');\n }", "public function create()\n {\n return view('admin.addStudent');\n }", "public function create()\n {\n $categories = Category::all();\n $instructors = Instructor::all();\n return view('admin.courses.create', compact('categories', 'instructors'));\n }", "public function create()\n {\n $studentList=student::all();\n return view('pages.courses.addCourse')->with('studentList',$studentList);\n }", "public function actionCreate()\n {\n $model = new Registration();\n $model->loadDefaultValues();\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 create()\n {\n return view('admin.campus.institute.create');\n }", "public function create()\n {\n return view('student::create');\n }", "public function create()\n {\n return view('student::create');\n }", "public function create()\n {\n $degrees = \\App\\Degree::all();\n $ascriptions = \\App\\Ascription::all();\n\n return view('student.create',['degrees' => $degrees,'ascriptions' => $ascriptions]);\n }", "public function create()\n {\n\n return view('students.create');\n }", "public function actionCreate()\n {\n $model = new StudyRequest();\n $user = Yii::$app->user->getIdentity()->getUser();\n\n $model->fio = $user->surname.' '.mb_substr($user->name, 0, 1).'.';\n $model->invited = false;\n $model->with_docs = false;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'institutions' => Institution::getList(),\n 'specializations' => Specialization::getList(),\n 'invalidTypes' => $this->repository->getInvalidTypes(),\n ]);\n }", "public function create()\n {\n $data['religions'] = $this->religion;\n $data['educations'] = $this->education;\n $data['workKinds'] = $this->workKind;\n $data['class'] = StudentClass::pluck('name', 'id');\n return view('student.create', $data);\n }", "public function create()\n {\n return view('admin.students.create');\n }", "public function actionCreate()\n {\n $model = new Program();\n\t\t$model->scenario = 'update';\n\n if ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->faculty_id = Yii::$app->params['faculty_id'];\n\t\t\tif($model->save()){\n\t\t\t\treturn $this->redirect(['index']);\n\t\t\t}\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\r\n {\r\n $course = Course::all();\r\n return view('teacher.create',compact(\"course\"));\r\n\r\n }", "public function actionCreate() {\r\n $model = new Reginfo;\r\n // Uncomment the following line if AJAX validation is needed\r\n // $this->performAjaxValidation($model);\r\n\r\n if (isset($_POST['Reginfo'])) {\r\n $model->attributes = $_POST['Reginfo'];\r\n if ($model->save())\r\n $this->redirect(array('view', 'id' => $model->id));\r\n }\r\n\r\n $this->render('create', array(\r\n 'model' => $model,\r\n ));\r\n }", "public function create()\n {\n return view('Student.create');\n }", "public function actionCreate()\n {\n $model = new Cvpersonal();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Apartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n /*return $this->render('create', [\n 'model' => $model,\n ]);*/\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AccionCentralizada();\n $model->usuario_creacion=Yii::$app->user->identity->id;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $student = new User();\n\n $studentData = $this->getRequest()->get('User');\n if(!is_null($studentData))\n {\n $student->setName($studentData['name']);\n $student->setPassword($studentData['password']);\n $student->setEmail($studentData['email']);\n $student->setRole('student');\n\n $this->getEntityManager()->persist($student);\n $this->getEntityManager()->flush();\n $this->redirect(array('view','id'=>$student->getId()));\n }\n\n $this->render('create',array(\n 'model'=>$student,\n ));\n }", "public function actionCreate()\n {\n $model = new Apartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $courses = Course::all();\n return view('admin.trainer.create',compact('courses'));\n\n }", "public function actionCreate()\n {\n $model = new Grade();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $teachers = Teacher::all();\n return view(\"student.create\", compact(\"teachers\"));\n }", "public function create()\n {\n //\n $arrPersonalInfo = \\Session::has('personal-info') ? \\Session::get('personal-info') : [];\n $arrNextOfKeen = \\Session::has('next-of-keen') ? \\Session::get('next-of-keen') : [];\n $arrPayament = \\Session::has('payment') ? \\Session::get('payment') : [];\n $arrSubject = \\Session::has('subject') ? \\Session::get('subject') : [];\n\n\n\n $types = IdentificaitonType::all();\n $grades = Grade::all();\n $relationship = Relationship::all();\n return view('students.create',compact('types',\n 'grades',\n 'relationship',\n 'arrPersonalInfo',\n 'arrPayament',\n 'arrNextOfKeen',\n 'arrSubject'));\n }", "public function actionCreate()\n {\n $model = new Graduate();\n $intitaUser = new StudentReg();\n $rating = new RatingUserCourse();\n // Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n if (isset($_POST['Graduate'])) {\n $model->attributes = $_POST['Graduate'];\n $model->avatar = CUploadedFile::getInstance($model, 'avatar');\n\n if ($model->save()) {\n if (!empty($model->avatar)) {\n $path = Yii::getPathOfAlias('webroot') . '/images/graduates/' . $model->avatar->getName();\n $model->avatar->saveAs($path);\n } else {\n $model->updateByPk($model->id, array('avatar' => 'noname.png'));\n }\n $this->redirect(Yii::app()->createUrl('/_teacher/cabinet/') . '#/graduate');\n }\n }\n $this->renderPartial('create', array(\n 'model' => $model, 'user' => $intitaUser, 'rating' => $rating\n ), false, true);\n }", "public function actionCreate()\n {\n $transaction = Yii::$app->db->beginTransaction();\n\n // Get the user's school and the current date.\n $schoolId = Yii::$app->user->schoolId;\n $today = date('Y-m-d');\n\n $student = new Student;\n $student->contract_school_id = $schoolId;\n $student->start_date = $today;\n\n if ($student->load(Yii::$app->request->post()) && $student->save())\n {\n // Affiliate the new student with the same school as the user\n $role = Role::find()->where(['like', 'name', 'student'])->one();\n $affiliation = new Affiliation();\n if ($affiliation->load(Yii::$app->request->post()))\n {\n $affiliation->student_id = $student->id;\n $affiliation->school_id = $schoolId;\n $affiliation->role_id = $role->id;\n $affiliation->date = $today;\n $affiliation->save();\n }\n\n /* Get the phone # that was posted along with the new student,\n * and assign it to the student via the newly-created ID.\n */\n $phone = new StudentPhone();\n if ($phone->load(Yii::$app->request->post()))\n {\n $phone->student_id = $student->id;\n $phone->save();\n }\n\n if ($affiliation->isSaved && $phone->isSaved)\n {\n $transaction->commit();\n\n $url = Html::a($student->name, ['update', 'id' => $student->id]);\n Yii::$app->session->setFlash('success', 'Student added: ' . $url);\n\n if (Yii::$app->request->post('then-add') !== null)\n {\n return $this->redirect(['create']);\n } elseif (Yii::$app->request->post('then-edit') !== null)\n {\n return $this->redirect(['update', 'id' => $student->id]);\n } else\n {\n return $this->redirect(['index']);\n }\n } else\n {\n $transaction->rollBack();\n \n $msg = 'Unable to create student: ';\n //!!! find a better way to extract the model errors\n $msg .= serialize($affiliation->errors);\n $msg .= serialize($phone->errors);\n Yii::$app->session->setFlash('error', $msg);\n }\n }\n\n return $this->render('create', [\n 'model' => $student,\n ]);\n }", "public function create()\n {\n \n $year_level = Grade::pluck('name','id')->all();\n $section = Section::pluck('name','id')->all();\n\n return view('admin.student.create',compact('year_level','section'));\n }", "public function create()\n {\n $students = Student::all();\n return view('students.create',compact('students'));\n }", "public function create()\n {\n return view('students.addStudentForm');\n }", "public function courseCreate(){\n //ORM query\n $courses = Course::select('name', 'user_id', 'id')->where('user_id', '=', auth()->user()->id)->get();\n\n //Retrieve authenticated user through the Auth facade.\n $user = Auth::user();\n\n //ORM query\n $instructors= User::where('type','instructor')->get();\n\n\n return view('courseCreator', compact('user', 'instructors'));\n }", "public function actionCreate() {\n $model = new Patient;\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if (isset($_POST['Patient'])) {\n $model->attributes = $_POST['Patient'];\n if ($model->save())\n $this->redirect(array('admin', 'id' => $model->cid));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n return view('students.create_students');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Ingresopersonal;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Ingresopersonal']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Ingresopersonal'];\n\t\t\t$model->estado=\"Confirmacion\";\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('site/index'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('student');\n }", "public function actionCreate()\n {\n $this->layout = static::FORM_LAYOUT;\n $model = new $this->MainModel;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->afterCreate($model);\n if ($this->hasView) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->redirect(['index']);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('profiling.course.create');\n }", "public function editCreate(){\n //ORM query\n $instructors= User::where('type','instructor')->get();\n\n return view('editInstructor', compact('instructors'));\n }", "public function actionCreate()\n {\n $model = new Participantes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $countryList = Country::all();\n return view('pages.students.add-student', compact('countryList'));\n }", "public function create()\n {\n $student = new Student();\n $courses = Course::pluck('name', 'id')->toArray();\n return view('student.create', array('courses' => $courses, 'student' => $student));\n }", "public function create()\n {\n return view ('courses.course_add'); \n }", "public function create()\n {\n //\n return view('superadmin.create_new_course');\n \n }", "public function actionCreate()\n {\n $model = new Admin();\n\n $model->setScenario('create');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.8192234", "0.7113849", "0.699584", "0.6963172", "0.6963172", "0.68430454", "0.68387765", "0.680924", "0.67619234", "0.676157", "0.6757656", "0.67567086", "0.67491126", "0.672778", "0.6715734", "0.6688008", "0.6665859", "0.66330475", "0.6605173", "0.65951777", "0.65386933", "0.65378594", "0.65315276", "0.65275735", "0.6522376", "0.65178406", "0.65164524", "0.65139174", "0.65128523", "0.6477325", "0.6473964", "0.64163977", "0.6414149", "0.64065653", "0.6405624", "0.6395806", "0.6381729", "0.6379195", "0.6363818", "0.6356857", "0.63564223", "0.63564223", "0.63564223", "0.63564223", "0.635091", "0.6348412", "0.6340565", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.63299865", "0.6329866", "0.63294476", "0.6328659", "0.6328257", "0.63236606", "0.6312997", "0.6312997", "0.63104826", "0.6304301", "0.62923557", "0.62847525", "0.6284367", "0.62729937", "0.62690914", "0.62599814", "0.6257076", "0.62558657", "0.6255828", "0.6255766", "0.6254648", "0.62385213", "0.62312263", "0.6230469", "0.6225307", "0.6222111", "0.62207395", "0.62166744", "0.62095034", "0.62085825", "0.6206602", "0.6200606", "0.62005574", "0.6198063", "0.61965245", "0.6194761", "0.61937654", "0.61780596", "0.6176365", "0.61759007", "0.6172702", "0.61705977", "0.6163695", "0.6162107", "0.615619" ]
0.74616176
1
action list my events.
список действий моих событий.
public function listMyEventsAction() { $events = $this->eventRepository->findMyEvents($GLOBALS['TSFE']->fe_user->user['uid']); $this->view->assign('events', $events); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_list() {\n if (Input::method() != 'GET') { $this->response($this->no_access); return; }\n \n $params = Input::get();\n \n $user = $this->user_login->user;\n \n try {\n $resp = $this->listStuff($params, $user);\n } catch (Exception $exc) {\n return $this->_error_response($exc->getMessage());\n }\n \n $data = array('data' => array('events' => $resp[\"events_array\"]), 'meta' => $resp[\"meta\"]);\n $this->response($data);\n\t}", "public function admin_evnt_list()\n {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('Event.created' => 'asc' ),\n );\n $data = $this->paginate('Event');\n\n $this->set('events', $data);\n $this->render('/Events/event_list');\n }", "protected function listEvents()\n\t{\n\t\tglobal $tpl;\n\n\t\t// table of examination events\n\t\tinclude_once(\"./Services/ADN/ES/classes/class.adnExaminationEventTableGUI.php\");\n\t\t$table = new adnExaminationEventTableGUI($this, \"listEvents\",\n\t\t\tadnExaminationEventTableGUI::MODE_SCORING, true);\n\t\t\n\t\t// output table\n\t\t$tpl->setContent($table->getHTML());\n\t}", "public function listAction();", "public function listAction() {}", "public function allAction()\r\n { \r\n return $this->render('AcmeAdminBundle:Event:events.html.twig');\r\n }", "public function actionIndex()\n\t{\n $model_event = new Event();\n $event = $model_event->getAllEvent();\n\n\t\t$this->render('index', array(\n 'event' => $event\n ));\n\t}", "public function eventsAction() {\n $data = array('collection' => $this->model->getCollection(),);\n\n return $this->getView($data);\n }", "public function getAllEvents();", "public function indexAction() {\n $this->_title($this->__('Events'))\n ->_title($this->__('Manage Events'));\n \n $this->_initAction();\n $this->renderLayout();\n }", "public function getEvents();", "public function getEvents();", "public function getEvents();", "public function getEvents();", "public function actionIndex()\n {\n $this->event_id = GetHelper::Get_integer( \"event_id\" );\n\n $this->Validate_and_load_event();\n $this->Load_event_categories();\n $this->Handle_post();\n\n return $this->Render_view( 'index' );\n }", "public function executeList()\n {\n if($this->hasRequestParameter(\"cal\")){\n return $this->renderComponent('events', 'calendar');\n }else{\n return $this->renderComponent('events', 'array');\n }\n }", "public function actionIndex()\n {\n $this->Load_events();\n\n return $this->Render_view( 'index' );\n }", "public function getAllEvents(){\n $events=$this->eventsManager->getAllEvents();\n require('view/listEventsAdminView.php');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:event')->findAll();\n\n return $this->render('event/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function eventListMyAction(Request $request) \n {\n $repository = $this->getDoctrine()->getRepository('AppBundle:Event');\n /* @var $repository \\AppBundle\\Entity\\EventRepository */\n \n $user = $this->container->get('security.context')->getToken()->getUser();\n /* @var $user \\AppBundle\\Entity\\User */\n \n /* @var $user \\AppBundle\\Entity\\User */\n $events = $repository->findFutureEventsByUser($user);\n \n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $events, \n $request->query->getInt('page', 1),\n 2\n );\n \n return $this->render('AppBundle:Event:list_my.html.twig', array(\n 'pagination' => $pagination\n ));\n }", "function getEventsAction() {\n\n //GET EVENT TABLE\n $siteeventTable = Engine_Api::_()->getDbtable('events', 'siteevent');\n $siteeventTableName = $siteeventTable->info('name');\n\n //MAKE QUERY\n $select = $siteeventTable->select()\n ->where('title LIKE ? ', '%' . $this->_getParam('text') . '%')\n ->where($siteeventTableName . '.closed = ?', '0')\n ->where($siteeventTableName . '.approved = ?', '1')\n ->where($siteeventTableName . '.draft = ?', '0')\n ->where($siteeventTableName . '.search = ?', '1')\n ->order('title ASC')\n ->limit($this->_getParam('limit', 40));\n\n //FETCH RESULTS\n $usersiteevents = $siteeventTable->fetchAll($select);\n $data = array();\n $mode = $this->_getParam('struct');\n\n if ($mode == 'text') {\n foreach ($usersiteevents as $usersiteevent) {\n $content_photo = $this->view->itemPhoto($usersiteevent, 'thumb.icon');\n $data[] = array(\n 'id' => $usersiteevent->event_id,\n 'label' => $usersiteevent->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersiteevents as $usersiteevent) {\n $content_photo = $this->view->itemPhoto($usersiteevent, 'thumb.icon');\n $data[] = array(\n 'id' => $usersiteevent->event_id,\n 'label' => $usersiteevent->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }", "public function viewEventList() {\n return view('eventlist');\n }", "public function lists()\t{\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 $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->event);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->event,$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/event/list',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "function allevents()\n {\n if (!$_SESSION['loggedIn'] instanceof Admin) {\n //if its not redirect to the login page\n header('location: login');\n }\n\n // send data to view\n $result = $GLOBALS['dataLayer']->getEvents();\n\n // add data to hive\n $this->_f3->set('events', $result);\n\n //Display the page\n $view = new Template();\n echo $view->render('views/allevents.html');\n }", "public function eventListAction(Request $request)\n {\n $repository = $this->getDoctrine()->getRepository('AppBundle:Event');\n /* @var $repository \\AppBundle\\Entity\\EventRepository */\n \n $events = $repository->findFuturePublicEvents(); \n \n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $events, \n $request->query->getInt('page', 1),\n 2\n );\n \n return $this->render('AppBundle:Event:list.html.twig', array(\n 'pagination' => $pagination\n ));\n }", "public function listEventi()\n {\n return view('list_eventi', ['eventi' => Evento::all()]);\n }", "public function index()\n {\n $result[\"items\"] = Event::orderby(\"order\",\"ASC\")->get();\n\n return view(\"eventList\",[\"result\" => $result]);\n }", "public function list_action() {\n Navigation::activateItem('/calendar/raumbelegung/list');\n PageLayout::setTitle($this->dispatcher->plugin->getDisplayName() . ' - ' .\n dgettext('roomplanplugin', 'Tagesansicht (Liste)'));\n $this->loadBelegung();\n }", "public function index()\n {\n \t$events = array();\n \treturn view('admin.events.lists', compact('events'));\n }", "public function action_index()\r\n\t{\r\n\t\t$this->action_list();\r\n\t}", "public function showAllEvents()\n {\n $em =$this->getDoctrine()->getManager();\n\n //zo niet geef aflopende datum events\n if(empty($events)) {\n //CURRENT_TIMESTAMP()\n $events = $em->createQuery('Select e from AppBundle:Event as e where e.date > CURRENT_TIMESTAMP()')\n ->getResult();\n }\n\n //WANNEER ER GEEN EVENTS ZIJN (mag niet gebeuren, gewoon events in het verleden tonen)\n if (empty($events)) {\n //zelfde als dit maar dan gelimit\n //$events = $em->getRepository('AppBundle:Event')->findAll();\n $events = $em->createQuery('Select e from AppBundle:Event as e')\n ->setMaxResults(20)\n ->getResult();\n }\n\n\n return $this->render('event/event_overview.html.twig',array('events'=>$events));\n }", "public function actionIndex()\n {\n $allLinks = [];\n $event = new CrudEvent(['moduleId' => 'event', 'links' => $allLinks]);\n Yii::$app->trigger(CrudEvent::FILTER_INDEX_PAGE_LINKS, $event);\n\n return $this->render('index', [\n 'links' => $event->links,\n 'moduleId' => 'event',\n ]);\n }", "abstract public function getEvents();", "public function index()\n\t{\n\t\t$events = Event::paginate(10);\n\t\treturn view('event.list_event', ['events'=>$events]);\n\t}", "public abstract function getEvents();", "public function indexAction(){\n $user = new Model_DbTable_User();\n if($this->current_user = $user->getUser()) {\n $this->view->current_user = $this->current_user;\n }else{\n $this->_redirect('/');\n }\n if(!$this->getRequest()->getParam('referer')){\n $this->_helper->layout->disableLayout(); \n }\n $this->view->month = $this->getRequest()->getParam('month');\n $this->view->year = $this->getRequest()->getParam('year');\n $this->view->view = $this->getRequest()->getParam('view');\n $this->view->week = 0;\n if($this->view->view == \"week\"){\n $this->view->week = $this->getRequest()->getParam('week');\n }\n \n $lists = $this->current_user->findModel_DbTable_ListViaModel_DbTable_UserHasListByUserAndList();\n $items = array();\n $event = new Model_DbTable_Event();\n $inst_list = new Model_DbTable_List();\n foreach($lists as $list){\n $items[] = $inst_list->getItems($list,$event->Model_id);\n }\n \n $events = array();\n foreach ($items as $item_tmp){\n foreach($item_tmp as $item){\n if(is_array($item)){\n $events[] = $item;\n }\n }\n }\n $this->view->events = $events;\n }", "public function getMyEvents()\r\n {\r\n // Create form\r\n if (!$this->getActionController()->getHelper('requireAuth')->setAuthParams('event', null, 'edit')->isValid()) {\r\n $this->getActionController()->jsonErrorOutput(Mgslapi_Controller_Action_Helper_Error::NOT_ALLOWED);\r\n }\r\n\r\n $request = Zend_Controller_Front::getInstance()->getRequest();\r\n\r\n $formFilter = new Event_Form_Filter_Manage();\r\n $defaultValues = $formFilter->getValues();\r\n\r\n // Populate form data\r\n if ($formFilter->isValid($request->getParams())) {\r\n $values = $formFilter->getValues();\r\n } else {\r\n $formFilter->populate($defaultValues);\r\n $values = array();\r\n }\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $table = Engine_Api::_()->getDbtable('events', 'event');\r\n $tableName = $table->info('name');\r\n\r\n // Only mine\r\n if (@$values['view'] == 2) {\r\n $select = $table->select()\r\n ->where('user_id = ?', $viewer->getIdentity());\r\n }\r\n // All membership\r\n else {\r\n $membership = Engine_Api::_()->getDbtable('membership', 'event');\r\n $select = $membership->getMembershipsOfSelect($viewer);\r\n }\r\n\r\n if (!empty($values['search_text'])) {\r\n $values['text'] = $values['search_text'];\r\n }\r\n if (!empty($values['text'])) {\r\n $select->where(\"`{$tableName}`.title LIKE ?\", '%' . $values['text'] . '%');\r\n }\r\n\r\n $select->order('starttime ASC');\r\n //$select->where(\"endtime > FROM_UNIXTIME(?)\", time());\r\n\r\n $paginator = Zend_Paginator::factory($select);\r\n\r\n return $paginator;\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('CareerBundle:Event')->findAll();\n\n return $this->render('event/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function showEvents()\n {\n \t$events = event::all()->where('publish','1')->where('test','0')->sortBy('date');\n \techo $events;\n \t\n\n }", "public function actionIndex()\n {\n return $this->render('index', [\n 'model' => Event::find()->orderBy('start_timedate DESC')->all(),\n ]);\n }", "public function listAction()\n {\n $basically_correct = true;\n\n $param_version = $this->_request->getParam('version');\n $param_client = $this->_request->getParam('client');\n if (empty($param_version) || empty($param_client)) {\n $basically_correct = false;\n }\n if (!in_array($param_client, array('iphone', 'iphone_retina', 'ipad', 'ipad_retina', 'web'))) {\n $basically_correct = false;\n }\n\n if (!$basically_correct) {\n\n $output_data = array();\n //$output_json = json_encode($output_data);\n $output_json = Zend_Json::encode($output_data);\n\n header('Content-Type: application/json; charset=utf-8');\n header('Content-Length: ' . strlen($output_json));\n\n echo $output_json;\n exit(0);\n\n }\n\n\n $event_list = $this->_innerListProcess();\n// echo count($event_list);\n\n $this->_outerListProcess($event_list);\n\n }", "public function actionList()\n {\n if(!$this->tasks) // If there are no tasks.\n {\n echo \" No tasks found\\n\";\n return; \n }\n \n foreach($this->tasks as $task) //Iterate through all tasks.\n {\n echo ' '; //Indent.\n //Echo the name of the task followed by its status.\n echo $task->taskId.' : '.TaskReport::getStatusName($task->getStatus()).\"\\n\";\n } \n }", "public function actionIndex()\n {\n $searchModel = new EventsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $module = Module::get('Events');\n\n if(Module::hasAccess($module->id)) {\n return View('la.events.index', [\n 'show_actions' => $this->show_action,\n 'listing_cols' => $this->listing_cols,\n 'module' => $module\n ]);\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }", "public function index()\n {\n\t\t$allevent = $this->event\n ->get();\n\t\t\t \n\t\treturn view('backend.event_gallery.list_event',compact('allevent')); \n\t\t\n }", "function display_list(){\n\t\t\tif(!$this->authentication->logged_in(\"admin\")){\n\t\t\t\t$this->gen_contents['msg'] = 'Session expired';\n\t\t\t\t$this->load->view('admin/schedule/display_error',$this->gen_contents);\n\t\t\t\treturn;\n\t\t\t}\t\t\n\t\t\t$this->gen_contents['current_date']\t= $_POST['datecurrent'];\n\t\t\t$this->gen_contents['arr_list'] \t= $this->admin_schedule_model->dbGetEventListWithSearch($_POST);\n\t\t\t$this->load->view('admin/schedule/display_list_event',$this->gen_contents);\n\t\t}", "public function getActiveEvents();", "public function index()\n {\n \n $even = DB::table('events')->get();\n\n return view('Admin/event.eventLister', compact('even'));\n }", "public function allEvents()\n {\n return view('front.event.index');\n }", "protected function renderActionList() {}", "public function get_actions();", "public function event_list()\n\t{\n\t\t$user_info = $this->session->userdata('logged_user');\n\t\t$user_id = $user_info['user_id'];\n\t\t$currentUser = singleDbTableRow($user_id)->rolename;\n\t\t\n\t\t\tif($this->input->post())\n\t\t\t{\n\t\t\t\tif($this->input->post('submit') == 'csv')\n\t\t\t{\n\t\t\t\t$data['events'] = $this->Event_model->events_csv();\n\t\t\t}\n\t\t\telse if($this->input->post('submit') == 'pdf')\n\t\t\t{\n\t\t\t\t$data['event'] = $this->Event_model->Export_to_pdf();\n\t\t\t\t\n\t\t\t\t$this->load->library('pdf');\n\t\t\t\t$this->pdf->load_view('events_pdf', $data);\n\t\t\t\t$this->pdf->render();\n\t\t\t\t$this->pdf->stream(\"Events-at-\".date('d-m-Y-h:i').\".pdf\");\n\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\ttheme('event_list');\n\t\t\n\t}", "function index() {\n\t\t$this->Event->recursive = 1;\n\t\t$this->set('events', $this->paginate());\n\t}", "public function events_get()\n\t{\n\t\treturn $this->_request('/my/events/','get');\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('JordoCalendarBundle:Event')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function eventList(Request $request) {\n $user_id = $request->get('user_id');\n $response = Activity::event_list_new($user_id);\n return $response;\n }", "function em_events( $args = array() ){ echo em_get_events($args); }", "public function buildListActions();", "public function indexAction()\n {\n $date = null;\n if ($this->getRequest()->getParam('date'))\n {\n //add date in form yyyy-mm-dd\n $date = new \\DateTime($this->getRequest()->getParam('date')); \n \n }\n \n //case for all categories\n if ($this->_category->name === 'all')\n {\n $memberId = Zend_Auth::getInstance()->getIdentity()->id;\n $events = $this->_model->findEventsByMemberIdOrderByDateDesc($memberId);\n $this->view->allOption = 'all';\n }\n else\n //only one choosen category \n {\n $events = $this->_model->findEventsByCategoryByMemberIdOrderByDateDesc(\n $this->_userId,\n $this->_category,\n $date\n );\n \n //get widget graphs\n $widget = $this->_model->getWidget(\n $this->_category->id,\n Zend_Auth::getInstance()->getIdentity()->id\n );\n \n //get properties for widget char graph\n $items = $this->_category->items;\n $numberProperties = array();\n foreach($items as $item)\n {\n if (property_exists($item,'typeSQL'))\n {\n $type = $item->typeSQL;\n if ($type == 'integer' || $type == 'float')\n {\n $numberProperties[]= array(\n 'name' => Events_Model_Events::getPropertyName($this->_category->name, $item->name),\n 'itemName' =>$item->name\n );\n }\n }\n }\n $this->view->widget = $widget;\n $this->view->properties = $numberProperties;\n \n }\n \n $this->view->eventsPerDay = $this->_model->getEventPerDay($events);\n \n //sent to the view\n $this->view->events = $events;\n $this->view->paginatorEvents = $this->_getPaginator($events);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('EvenementBundle:Event')->findAll();\n\n return $this->render('@Evenement\\Default\\index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function lista() {\n $eventos = new Eventos(); // Aqui carrega o model\n $dados['eventos'] = $eventos->getTodos();\n $this->loadTemplate('eventos', $dados);\n }", "public function index()\n {\n $user = Auth::user();\n $events = EventRepository::getUserEvents($user);\n\n return EventResource::collection($events);\n }", "public function actionIndex()\n {\n $searchModel = new EventSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new EventSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeevents = $em->getRepository('SoukFrontEndBundle:Typeevent')->findAll();\n\n return $this->render('typeevent/index.html.twig', array(\n 'typeevents' => $typeevents,\n ));\n }", "public function index()\n {\n $data['pageTitle'] = 'Event List';\n return view('admin.events.index', $data);\n }", "public function allAction() {}", "public function index()\n\t{\t\n\t\t$this->load->view('header');\n\t\t$data['events']=$this->db->select('*')->from('tbl_events')->get()->result_array();\n\t\t$this->load->view('list_event',$data);\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('OjsUserBundle:EventLog')->findAll();\n\n return $this->render('OjsUserBundle:EventLog:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index() {\n\t\t$this->request->data('Audit', $this->request->query);\n\t\t$list = $this->request->data('Audit.list');\n\t\t$count = $this->request->data('Audit.count');\n\t\t$this->paginate = array(\n\t\t\t'Audit' => array(\n\t\t\t\t'limit' => ($list && $count) ? $count : Configure::read('Pagination.limit'),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'id',\n\t\t\t\t\t'event',\n\t\t\t\t\t'model',\n\t\t\t\t\t'created',\n\t\t\t\t\t'user_id',\n\t\t\t\t\t'entity_id'\n\t\t\t\t),\n\t\t\t\t'contain' => array(\n\t\t\t\t\t'User' => array(\n\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\tConfigure::read('AuditLog.User.name')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'conditions' => $this->_paginationFilter(),\n\t\t\t\t'order' => array('created' => 'desc'),\n\t\t\t)\n\t\t);\n\t\t$this->set(array(\n\t\t\t'data' => $this->paginate(\"Audit\"),\n\t\t\t'users' => $this->User->find('list', array(\n\t\t\t\t'fields' => array('id', Configure::read('AuditLog.User.name'))\n\t\t\t)),\n\t\t\t'modelsList' => $this->_getModelsList(),\n\t\t\t'_serialize' => array('data')\n\t\t));\n\t\tif ($list) {\n\t\t\t$this->render('list');\n\t\t}\n\t}", "public function eventsBrowsable()\n {\n $this->get('/events')->assertSee('Events');\n }", "public function eventosAction()\n { \n $events = $this->getDoctrine()->getRepository('PCFundationBundle:Event')->findAll();\n return $this->render('PCFundationBundle:fundation:eventos.html.twig', array('events' => $events));\n }", "public function index()\n {\n return view('admin.site_admin.admin.event')->with([\n 'url'=>'event'\n ]);\n }", "function ShowEvents()\n {\n /* $event=$this->Event(); */\n /* if (!empty($event)) */\n /* { */\n /* $this->ShowEvent($event); */\n /* return; */\n /* } */\n \n echo\n $this->Htmls_Text\n (\n array\n (\n $this->Htmls_Comment_Section\n (\n \"Show Events\",\n array_merge\n (\n $this->Htmls_H\n (\n 1,\n $this->MyLanguage_GetMessage(\"Events_Table_Title\")\n ),\n $this->Events_Form\n (\n 0,\n $this->Events_Read(True)\n )\n )\n )\n )\n );\n }", "public function indexAction()\n\t{\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\tif (!Engine_Api::_() -> core() -> hasSubject() || !$viewer -> getIdentity())\n\t\t{\n\t\t\treturn $this -> setNoRender();\n\t\t}\n\n\t\t// Get subject and check auth\n\t\t$this -> view -> member = $subject = Engine_Api::_() -> core() -> getSubject('event');\n\n\t\t$this -> view -> navigation = Engine_Api::_() -> getApi('menus', 'core') -> getNavigation('ynmobileview_event');\n\n\t}", "private function getEventList() {\n //check if time is set in the URL\n if(isset($this->request->get['time'])) {\n $time = $this->request->get['time'];\n } else {\n $time = time();\n }\n \n $today = date(\"Y/n/j\", time());\n \n $current_month = date(\"n\", $time);\n \n $current_year = date(\"Y\", $time);\n \n $current_month_text = date(\"F Y\", $time);\n \n $total_days_of_current_month = date(\"t\", $time);\n \n $events = array();\n \n $filter_data = array();\n $filter_data['current_month'] = $current_month;\n $filter_data['current_year'] = $current_year;\n $filter_data['total_days_of_current_month'] = $total_days_of_current_month;\n \n //query the database for events between the first date of the month and the last date of month\n \t$results = $this->model_catalog_calendar->getEvents($filter_data, $_SESSION['store_code']);\n \n /*\n $result = mysql_query(\"SELECT DATE_FORMAT(eventDate,'%d') AS day,eventContent,eventTitle FROM eventcal WHERE eventDate BETWEEN '$current_year/$current_month/01' AND '$current_year/$current_month/$total_days_of_current_month'\");\n \n while($row_event = mysql_fetch_object($result))\n {\n //loading the $events array with evenTitle and eventContent wrapped with <span> and <li>. We will add them inside <ul> in later part\n $events[intval($row_event->day)] .= '<li><span class=\"title\">'.stripslashes($row_event->eventTitle).'</span><span class=\"desc\">'.stripslashes($row_event->eventContent).'</span></li>';\n }\n */\n\n $first_day_of_month = mktime(0,0,0,$current_month,1,$current_year);\n \n //geting Numeric representation for the first day of the month. 0 (for Sunday) through 6 (for Saturday).\n $first_w_of_month = date(\"w\", $first_day_of_month);\n \n //calculate how many rows will be in the calendar to show the dates\n $total_rows = ceil(($total_days_of_current_month + $first_w_of_month)/7);\n \n //trick to show empty cell in the first row if the month doesn't start from Sunday\n $day = -$first_w_of_month;\n \n $next_month = mktime(0,0,0,$current_month+1,1,$current_year);\n $next_month_text = date(\"F \\'y\", $next_month);\n \n $previous_month = mktime(0,0,0,$current_month-1,1,$current_year);\n $previous_month_text = date(\"F \\'y\", $previous_month);\n \n $next_year = mktime(0,0,0,$current_month,1,$current_year+1);\n $next_year_text = date(\"F \\'y\", $next_year);\n \n $previous_year = mktime(0,0,0,$current_month,1,$current_year-1);\n $previous_year_text = date(\"F \\'y\", $previous_year);\n \n $this->data['today'] = $today;\n $this->data['current_month'] = $current_month;\n $this->data['current_year'] = $current_year;\n $this->data['current_month_text'] = $current_month_text;\n $this->data['total_days_of_current_month'] = $total_days_of_current_month;\n $this->data['first_day_of_month'] = $first_day_of_month;;\n $this->data['first_w_of_month'] = $first_w_of_month;;\n $this->data['total_rows'] = $total_rows;;\n $this->data['day'] = $day;;\n $this->data['next_month'] = $next_month;;\n $this->data['next_month_text'] = $next_month_text;;\n $this->data['previous_month'] = $previous_month;;\n $this->data['previous_month_text'] = $previous_month_text;;\n $this->data['next_year'] = $next_year;;\n $this->data['next_year_text'] = $next_year_text;;\n $this->data['previous_year'] = $previous_year;;\n $this->data['previous_year_text'] = $previous_year_text;;\n $this->data['results'] = $results;\n $this->data['calendarurl'] = $this->url->http('information/calendar');\n //var_dump($results);\n\t\t//if ($results) {\n\t\t\t$this->document->title = $this->language->get('heading_title');\n\t\t\t$this->document->breadcrumbs[] = array(\n\t\t\t\t'href' => $this->url->http('information/calendar'),\n\t\t\t\t'text' => $this->language->get('heading_title'),\n\t\t\t\t'separator' => $this->language->get('text_separator')\n\t\t\t);\n\t\t\t$this->data['heading_title'] = $this->language->get('heading_title');\n\t\t\t/*$this->data['calendar_data'] = array();\n\t\t\tforeach ($this->model_catalog_calendar->getCalendar() as $result) {\n\t\t\t\t$this->data['calendar_data'][] = array(\n\t\t\t\t\t'title' => $result['title'],\n\t\t\t\t\t'start_date' => $result['start_date'],\n\t\t\t\t\t'href' => $this->url->http('information/calendar&calendar_id=' . $result['calendar_id'])\n\t\t\t\t);\n\t\t\t}*/\n\t\t\t$this->data['button_continue'] = $this->language->get('button_continue');\n\t\t\t$this->data['continue'] = $this->url->http('common/home');\n\t\t\t$this->id = 'content';\n\t\t\t$this->template = $this->config->get('config_template') . 'information/calendar.tpl';\n\t\t\t$this->layout = 'common/layout';\n\t\t\t$this->render();\n\t\t/*} else {\n\t\t\t$this->getError();\n\t\t}*/\n }", "public function indexAction ()\n {\n // TODO Auto-generated AdminCalendarController::indexAction() default\n // action\n }", "public function actionIndex()\n {\n $events = Event::find()->all();\n $cities = City::find()->all();\n $streets = Street::find()->all();\n $homes = Home::find()->all();\n $rooms = Room::find()->all();\n\n $searchModel = new EventSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index',\n compact('searchModel',\n 'dataProvider',\n 'events',\n 'cities',\n 'streets',\n 'homes',\n 'rooms'\n ));\n }", "public function getEventsAction()\n {\n $this->_helper->viewRenderer->setNeverRender();\n $this->_helper->layout->disableLayout();\n \n $get = Zend_Registry::get('getFilter');\n \n if (isset($get->date)) {\n if (!empty($get->date)) {\n $date = new Zend_Date($get->date);\n } else {\n $date = new Zend_Date();\n }\n } else {\n $date = new Zend_Date();\n }\n \n $locationId = null;\n if (isset($get->locationId) && !empty($get->locationId)) {\n $locationId = $get->locationId; \n }\n \n $startDate = clone $date;\n $endDate = clone $date;\n \n $startDate->setHour(0)->setMinute(0)->setSecond(0);\n $startDate->setDay(1);\n $startDate->subDay($startDate->get(Zend_Date::WEEKDAY_DIGIT));\n \n $endDate->setHour(23)->setMinute(59)->setSecond(59);\n $endDate->setDay($endDate->get(Zend_Date::MONTH_DAYS));\n $endDate->addDay(6 - $endDate->get(Zend_Date::WEEKDAY_DIGIT));\n \n $event = new Event();\n \n $events = $event->getEvents(null, null, $locationId, $startDate->getTimestamp(), $endDate->getTimestamp(), array('open', 'closed'), null)->toArray();\n \n $workshop = new Workshop();\n \n foreach ($events as &$e) {\n $e['startTime'] = strftime('%l:%M %p', strtotime($e['startTime']));\n $e['endTime'] = strftime('%l:%M %p', strtotime($e['endTime']));\n \n $e['workshop'] = $workshop->find($e['workshopId'])->toArray();\n }\n \n echo Zend_Json::encode($events);\n }", "public function getevents()\n {\n //\n return view('events.getevent', compact(['event']));\n }", "public function index()\n {\n //\n $events = Event::all();\n return $events;\n }", "function afficherEvents(){\n\t\t$sql=\"SElECT * From events\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function indexAction() {\n $this->view->pageTitle = 'Ausgehen';\n $this->view->events = $this->_helper->parseCinemas();\n }", "public function index()\n {\n $items = EventLoker::all();\n\n return \\view('pages.admin.event-loker.event', [\n 'items' => $items\n ]);\n }", "public function rectentEvents(){\n $req=$this->db()->query(\"SELECT * FROM `evento`\n ORDER BY evento.fecha DESC\");\n if($req==false)\n throw new Exception('MySQL: Error al realizar la consulta SQL');\n $this->list = $this->showData($req);\n }", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_event')) {\n return $this->setNoRender();\n }\n\n $this->view->isajax = $isajax = $this->_getParam('isajax', 0);\n $this->view->params = $params = $this->_getAllParams();\n if ($this->_getParam('loaded_by_ajax', false) && !$isajax) {\n $this->view->loaded_by_ajax = true;\n if ($this->_getParam('is_ajax_load', false)) {\n $this->view->is_ajax_load = true;\n $this->view->loaded_by_ajax = false;\n $this->getElement()->removeDecorator('Container');\n } else {\n return;\n }\n }\n\n $this->view->siteevent = $siteevent = Engine_Api::_()->core()->getSubject('siteevent_event');\n $this->view->occurrence_id = $occurrence_id = $this->_getParam('occurrence_id', null);\n\n if ($isajax) {\n $this->getElement()->removeDecorator('Container');\n $this->getElement()->removeDecorator('title');\n }\n\n $this->view->show_seeall = $this->_getParam('show_seeall', 1);\n $this->view->occurrence_filtering = $this->_getParam('occurrence_filtering', 0);\n $this->view->itemCount = $itemCount = $this->_getParam('itemCount', 10);\n\n $occurrenceTable = Engine_Api::_()->getDbtable('occurrences', 'siteevent');\n ;\n if (!$isajax && $this->view->occurrence_filtering) {\n $this->view->datesInfo = $occurrenceTable->getAllOccurrenceDates($siteevent->event_id);\n }\n\n $params = array();\n $params['event_id'] = $siteevent->event_id;\n\n if ($this->view->occurrence_filtering) {\n $params['occurrence_id'] = $occurrence_id;\n }\n \n $params['is_private_order'] = 0;\n \n \n\n //FIND THE MEMBERS WHO BOUGHT THE TICKET\n $orderTable = Engine_Api::_()->getDbTable('orders', 'siteeventticket');\n $this->view->members = $members = $orderTable->getMembers($params);\n $this->view->memberCount = COUNT($members);\n \n $viewer = Engine_Api::_()->user()->getViewer();\n $canEdit = $siteevent->authorization()->isAllowed($viewer, 'edit');\n\n if ($this->view->memberCount < 1 && !$canEdit && !$isajax && count($this->view->datesInfo) == 1) {\n return $this->setNoRender();\n }\n \n if($this->view->memberCount < 1 && !$canEdit && empty($this->view->occurrence_filtering)) {\n return $this->setNoRender();\n } \n \n $params['totalTicketsCount'] = 1;\n $this->view->purchasedTickets = $occurrenceTable->maxSoldTickets($params); \n \n if($this->view->memberCount < 1) {\n unset($params['is_private_order']);\n $this->view->purchasedTicketsPrivately = $occurrenceTable->maxSoldTickets($params);\n }\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Tickets list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the tickets.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/tickets/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\n\t\t$this->datagrid->setConfig ( Tickets::grid() )->datagrid ();\n\t}", "public function getEvents()\n {\n return array();\n }", "public function index()\n {\n\n $event = $this->event->getList();\n return view('event.index', ['events' => $event]);\n }", "public function events()\n {\n return view('myevents');\n }", "public function get_events_list() {\n $cache = \\cache::make_from_params(\\cache_store::MODE_SESSION, 'report_extendedlog', 'menu');\n if ($eventslist = $cache->get('eventnames')) {\n return $eventslist;\n }\n\n $eventslist = array();\n $pluginevents = $this->get_plugin_events();\n foreach ($pluginevents as $event) {\n $displayname = get_string('filter_event_template', 'report_extendedlog', $event);\n $eventslist[$event->name] = $displayname;\n }\n $coreevents = $this->get_core_events();\n foreach ($coreevents as $event) {\n $displayname = get_string('filter_event_template', 'report_extendedlog', $event);\n $eventslist[$event->name] = $displayname;\n }\n \\core_collator::asort($eventslist);\n\n $cache->set('eventnames', $eventslist);\n return $eventslist;\n }", "public function index()\n {\n $events = $this->eventRepository->getEvents();\n\n return view('admin.event.index', compact('events'));\n }", "public function eventList(){\n $akce = DB::table('Events')->paginate(2);\n foreach($akce as $a){\n echo link_to('root/attendants/'.$a->id, $a->nazev).', '.link_to('event/destroy/'.$a->id, \"smazat\").'<br>';\n }\n echo link_to('root', 'zpět');\n echo $akce->links();\n }", "public function listAction()\n {\n $all = $this->rss->findAll();\n \n $this->theme->setTitle(\"Visa alla RSS-flöden\");\n $this->views->add('rss/list-all', [\n 'feeds' => $all,\n 'title' => \"Visa alla RSS-flöden\",\n ], 'main');\n \n $this->views->add('rss/rss-sidebar', [], 'rsidebar');\n }", "public function actionUserList()\n {\n return parent::actionIndex();\n }", "public function actionIndex()\n {\n $searchModel = new EventoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getEvents(){\n\n\t\t\techo json_encode($this->mdl_events->all()->result() ) ;\n\t\t}", "public function index(Request $request, ListEventService $service)\n {\n return $service->getAllEvents($request);\n }", "public function fetchEvents()\n {\n return $this->client->get('/events');\n }", "public function addAction()\n\t{\t// TODO: add event to google calendars\t\n\t}" ]
[ "0.7782786", "0.750044", "0.7468574", "0.7349831", "0.7331223", "0.7245521", "0.72207433", "0.72044027", "0.71910065", "0.7156835", "0.7093781", "0.7093781", "0.7093781", "0.7093781", "0.7046539", "0.7002021", "0.69728744", "0.69438654", "0.68950915", "0.68780196", "0.68676823", "0.6836207", "0.6835643", "0.6802159", "0.6760882", "0.6760239", "0.67525035", "0.67401457", "0.67378217", "0.67215616", "0.6711976", "0.67099345", "0.67068005", "0.66981626", "0.66938317", "0.6686218", "0.66841435", "0.6672706", "0.6660916", "0.665916", "0.66459584", "0.6625277", "0.66251534", "0.6614925", "0.6606615", "0.6604899", "0.6585441", "0.65816385", "0.65809196", "0.65785044", "0.65698326", "0.65696245", "0.6567088", "0.65637857", "0.6559963", "0.6543818", "0.6520856", "0.65021616", "0.64957523", "0.64887", "0.6484632", "0.64735526", "0.64701444", "0.64701444", "0.64671403", "0.6466325", "0.6451232", "0.64505285", "0.6440376", "0.64238197", "0.641754", "0.641643", "0.64113027", "0.6409149", "0.640894", "0.64021695", "0.6398641", "0.6396464", "0.6395063", "0.6392589", "0.6388121", "0.6379631", "0.6377812", "0.63752604", "0.6369365", "0.63686186", "0.63532984", "0.635148", "0.6348959", "0.6336094", "0.6334844", "0.6331481", "0.6327846", "0.6326313", "0.6325046", "0.6321504", "0.6315887", "0.6302071", "0.6301446", "0.6299511" ]
0.8207517
0
initialize edit action This only happens if webko clicks on edit link in mail.
initialize edit action Это происходит только в случае, если webko нажимает на ссылку "редактировать" в письме.
public function initializeEditAction() { $this->registerEventFromRequest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction() {}", "public function editAction()\n\t{\n\t}", "public function action_edit()\n\t{\n\t\t\n\t}", "public function edit() {\n\t\t/* CHANGED - switched to url(\"id\") as $this->param(\"id\") is deprecated */\n\t $this->id = WaxUrl::get(\"id\");\n\t\tif(!$this->id) $this->id = $this->route_array[0];\n $this->model = new $this->model_class($this->id);\n \n\t\t$this->form = $this->render_partial(\"form\");\n\t\tif($_POST['cancel']) $this->redirect_to(Session::get(\"list_refer\"));\n\t\tif($_POST['save']) $this->save($this->model, \"edit\");\n\t\telse $this->save($this->model, Session::get(\"list_refer\"));\n\t}", "public function init()\n {\n \t\n \t$this->id = $this->getRequest()->getParam(\"ID_CONTEUDO\");\n \t\n \tif($this->id != 0 && $this->id != \"\")\n \t{\n \t\t$this->tipo_acao = \"edit\";\n \t}\n \t\n \t\t$this->view->modulo = $this->getRequest()->getModuleName();\n \t$this->view->controlador = $this->getRequest()->getControllerName();\n \t\n \tif($this->getRequest()->getActionName() != \"uploadicone\")\n \t{\n \t\n \t $auth = Zend_Auth::getInstance();\n \t $read = $auth->getStorage()->read();\n \t $this->view->aplicacoes = $read->aplicacoes;\n \t} \n \t \n \t\n }", "public function edit() {\n\n\t\tif ($this->authenticated===false) {\n\t\t\t$this->index();\n\t\t} else {\n\n\t\t\t// Get model type and id\n\t\t\t$this->requestParser();\n\n\t\t\t// Create the helper\n\t\t\t$viewHelper = new View_Admin_Helper($this->model, $this->id);\n\n\t\t\t// Set notice to View if available\n\t\t\t$message = isset($this->message) ? $viewHelper->notice($this->message) : null;\t\t\n\n\t\t\t// Setup the editor View\n\t\t\t$this->data['view'] = $viewHelper->editView();\n\t\t}\n\t}", "function edit()\n {\n $this->_view_edit('edit');\n }", "public function editAction()\n\t{\n\t\t$this->_initAction();\n\t\t$this->_addContent($this->getLayout()->createBlock('padoo_testimonial/adminhtml_testimonial_edit'));\n\t\t$this->renderLayout();\n\t}", "public function editAction()\n {\n //...\n }", "public function action_edit()\n {\n $action = $this->request->action;\n $controller = $this->request->controller;\n $id = $this->request->param('id');\n if (!$this->_checkActionAllowed()) {\n throw new Kohana_Exception (I18N::get('Die Operation \\':operation\\' ist in diesem Kontext leider nicht erlaubt!'), array(':operation' => $action));\n }\n if (!$this->_checkTemplateExists()) {\n throw new Kohana_Exception (I18n::get('Das Template für die Action existiert leider nicht.'));\n }\n /**\n * @todo refactoring\n */\n $templatePath = $this->_templatePath . '/' . $controller . '/' . $action;\n $siteTitle = I18n::get('Bearbeiten');\n $this->template->bind_global('siteTitle', $siteTitle);\n /**\n * @todo refactoring\n */\n $this->template->content = View::factory($templatePath)->bind('row', $row)->bind('templatePath', $this->_templatePath);\n\n try {\n $modelClassName = substr($this->request->controller, 0, -1);\n $row = ORM::factory($modelClassName, $id);\n if (!$row->loaded()) {\n Kohana::$log->add(Kohana::ERROR, I18N::get('Der Datensatz mit der ID: ' . $id . ' existiert leider nicht.'));\n $request->status = 404;\n }\n\n if($_POST) {\n \t\n \t/**\n \t * @todo change to use htmlpurify\n \t */\n \t\n $_POST = Security::xss_clean($_POST);\n $row->values($_POST);\n if($row->check()) {\n $row->save();\n $this->request->redirect(Route::get('default')->uri(array('controller' => $controller, 'action' => 'list')));\n }\n }\n\n }\n catch (Kohana_Exception $e) {\n throw new Kohana_Exception(__('Es ist ein Fehler aufgetreten: :fehler'), array(':fehler' => $e->getMessage()));\n }\n }", "protected function beforeEdit() {}", "public function editAction(){\n Log::infoLog('method='.__FUNCTION__.';user_id='.Auth_Info::getUser()->user_id.';control_number'.';Start action');\n $role = Auth_Info::getUser()->user_type;\n if(strcmp($role, 'DA'))\n $this->_redirect('/error');\n\n $this->view->token = Csrf::getToken();\n $id = $this->_input->id;\n $row = MInformations::getInstance()->getEntryById($id);\n $this->getRequest()->setParams($row->toArray());\n Log::infoLog('method='.__FUNCTION__.';user_id='.Auth_Info::getUser()->user_id.';control_number'.';End action');\n\n }", "public function editAction() {\n\n }", "public function editAction()\n {\n\n }", "public function edit()\n\t{\n\t\t$this->auth->restrict('Simplenews.Content.Edit');\n\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('simplenews_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/content/simplenews');\n\t\t}\n\n\t\tAssets::add_module_js('simplenews', 'simplenews.js');\n\n\t\tTemplate::set('toolbar_title', lang('simplenews_edit') . ' simplenews');\n\t\tTemplate::render();\n\t}", "public function doEditAction(){\n\n }", "function edit() {\t\t\n\t\t$sendData = $this->request->params['named'];\n\t\t\n\t\tif (isset($sendData['model']) && isset($sendData['id'])) {\n\t\t\t$this->Session->write($this->SEND_DATA_KEY, $sendData);\n\t\t}\n\n\t\tif ($this->data) {\n\t\t\t$emails = $this->data;\n\t\t\t\t\n\t\t\t//for adding recipients just before sending.\n\t\t\tif (isset($emails['KnownEmail']['new'])) {\n\t\t\t\t$additionalRecips = $this->data['KnownEmail']['new'];\n\t\t\t\t$matches = array();\n\t\t\t\tif (preg_match_all($this->KnownEmail->VAL_EMAIL_REGEX, $additionalRecips, $matches)) {\n\t\t\t\t\t$this->KnownEmail->saveUnknownEmails($matches[0], 1, 1);\n\t\t\t\t}\n\t\t\t\t//delete the additional recipients data.\n\t\t\t\tunset($emails['KnownEmail']);\n\t\t\t}\n\t\t}\n\n\t\t$emails = $this->paginate('KnownEmail');\n\t\t$this->set('emails', $emails);\n\n\t\tif ($this->Session->check($this->SEND_DATA_KEY)) {\n\t\t\t$this->set('sendData', $this->Session->read($this->SEND_DATA_KEY));\n\t\t}\n\t}", "public function actionEdit()\n\t{\n\t \t// render the template, pass model on render template\n \t$this->renderTemplate('galleryoots/_edit');\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n\t}", "public function editAfterSubmit(){\n\t\t$this->registerAfterSubmit(\"edit\");\t\n\t}", "public function edit() {\n\t $this->id = WaxUrl::get(\"id\");\n\t\tif(!$this->id) $this->id = $this->route_array[0];\n $this->model = new $this->model_class($this->id);\n \n\t\t$this->all_sections = $this->current_user->allowed_sections_model()->tree();\n\t\t$this->list_sections_partial = $this->render_partial(\"list_sections\");\n\t\t$this->section_list_partial = $this->render_partial(\"section_list\");\n\t\t$this->apply_sections_partial = $this->render_partial(\"apply_sections\");\n\n\t\t$this->form = $this->render_partial(\"form\");\n\t\tif($_POST['cancel']) $this->redirect_to(Session::get(\"list_refer\"));\n\t\tif($_POST['save']) $this->save($this->model, \"edit\");\n\t\telse $this->save($this->model, Session::get(\"list_refer\"));\n\t}", "function view_edit() {}", "public function edit()\n\t{\n\n\t}", "public function neweditAction()\n\t{\t\n\t\tglobal $mySessionFront;\n\t\t$db=new Db();\n\t\tif(!isLogged()) { \n\t\t\n\t\t\t$this->_redirect('index');\n\t\t\t\n\t\t}\n\t\t\n\t\t$arr=$this->getRequest()->getParams();\n\t\t$this->_helper->layout()->setLayout('ajaxlayout');\t\n\t\t\n\t\tif($arr['user_id']) {\n\t\t\t$qry = \"select * from `tbl_users` where user_id='\".$mySessionFront->user['FrontUserId'].\"'\";\n\t\t\t\t//prd($qry);\n\t\t\t$this->view->user_id = $arr['user_id'];\n\t\t\t$user_id = $db->runQuery($qry);\n\t\t\t$this->view->user_id_Data = $user_id[0];\n\t\t\n\t\t}\n\t}", "public function edit()\n\t{\n\t\t$this->_actionType = $this->uri->segment(3);\n\t\t$this->set_item_id($this->uri->segment(4));\n\t\t// valid_company('trailer','company_id',$id);\n\n\t\t$this->_viewData['item_detail'] = $this->model->hardGet($this->get_item_id())->row_array();\n\t\t// var_dump($this->_viewData['item_detail']);\n\t\t// die();\n\t\t$this->_viewData['title'] = 'Edit Page';\n\t\t$this->add_block();\n\t}", "public function editing(){\n\t\t/// Send the user to this view\n\t\t$this->render(\"editing\");\n\t}", "public function edit()\n\t{\t\n\n\t}", "public function isEditAction() {}", "public function edit( )\n\t{\n\t\t// show\n\t}", "public function __actionEdit() {\n\t\t\tif(isset($_POST['action']['delete']) && isset($_POST['fields']['id'])) {\n\t\t\t\t$_POST['with-selected'] = 'delete';\n\t\t\t\t$_POST['items'] = array($_POST['fields']['id'] => '');\n\t\t\t\treturn $this->__actionIndex();\n\t\t\t}\n\n\t\t\treturn $this->__actionNew();\n\t\t}", "public function editAction()\n {\n $model = $this->_initModel();\n\n // make sure that the model exists before continuing\n if ($this->_getRequestedId() && !$model && !$model->getId()) {\n Mage::getSingleton('adminhtml/session')->addError($this->__('This ' . $this->_getObjectLabel() . ' no longer exist or is corrupt.'));\n $this->_redirect('*/*/');\n } else {\n $this->_initAction()->renderLayout();\n }\n }", "public function editAction() {\n $id = $this->getRouter()->getId('id');\n //get data\n $data = (object) [\n \"alias\" => $this->getCode()->post(\"alias\"),\n \"title\" => $this->getCode()->post(\"title\"),\n \"description\" => $this->getCode()->post(\"description\"),\n \"manager\" => $this->getCode()->post(\"manager\"),\n \"role\" => $this->getCode()->arr(\"role\", \"POST\")\n ];\n\n $data->app_id = $this->getViewer()->app->id;\n $data->creator_id = $this->getViewer()->member->id;\n\n //update the obj\n $obj = $this->entity_member->update($id, $data);\n\n //check redirect\n if ($this->getCode()->post('fromajax')) {\n\n $this->getCode()->success(\"Thành viên đã được chỉnh sửa thành công.\");\n }\n\n $this->getCode()->success(\"Thành viên đã được chỉnh sửa thành công.\", [], $this->url('assignment', ['controller' => 'member']));\n }", "public function before_edit()\n {\n $this->pushCampaignsToView();\n }", "public function editAction()\n {\n $assign_id = $this->_getParam('assign');\n $this->_includeForm($assign_id);\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n //TODO\n }", "protected function beforeEdit()\n {\n }", "public function init()\n {\n //of the employee being edited or deleted. Check here to ensure that the employee\n //id exists and belongs to the team managed by the user. If not, then simply display the\n //index page.\n $action = $this->getRequest()->getActionName();\n if(($action == 'put') || ($action == 'delete')) {\n \t\n \t$forceRedirect = false;\n \t$employeeHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Employee');\n\t $employeeId = $this->getRequest()->getParam('id');\n\t \n\t if(empty($employeeId)) {\n\t \t\n\t \t$forceRedirect = true;\n\t }\n\t else {\n\t \t\n\t \t$user = Zend_Auth::getInstance()->getStorage()->read();\n\t \tif(!$employeeHelper->isValidEmployee($employeeId, $user)) {\n\t \t\t\n\t \t\t$forceRedirect = true;\n\t \t}\n\t }\n\t \n\t if($forceRedirect) {\n\t \t\t \t\n\t \t$redirector = $this->_helper->getHelper('Redirector');\n\t \t$redirector->gotoRoute(\n\t \t\tarray(\n\t \t\t\t'action' => 'index',\n\t \t\t\t'controller' => 'Employee',\n\t \t\t\t'module' => 'App'\n\t \t\t),\n\t \t\t'module_partial_path',\n\t \t\ttrue\n\t \t);\n\t }\n }\n }", "function edit()\n\t{\n\t\tget_instance()->data['widgettext'] = 'Edit Block';\n\t\tget_instance()->data['helpertext'] = 'To edit this block fill out the field below and click \"save\"';\n\t\tget_instance()->data['type'] = 'edit';\n\t\t\n\t\t// Get data\n\t\tget_instance()->data['id'] = $id = $this->uri->segment(4);\n\t\tif(! get_instance()->data['data'] = $this->cms_blocks_model->get_by_id($id)) \n\t\t{\n\t\t\tredirect($this->config->item('cb_cp_url_base') . '/blocks');\n\t\t}\t\n\t\t\n\t\t$this->_add_edit_shared_func($id);\t\n\t}", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit() {\n \n $email = $this->email_model->get_by_id($this->input->get('id'));\n if (!is_null($email)) {\n echo $this->load->view('email/edit_form', array(\n 'id' =>$email->id,\n 'subject' => $email->subject,\n 'message' => $email->message\n ), TRUE);\n }\n else {\n echo show_404('The resource you requested was not found');\n } \n }", "public function edit(){\n\n //Establish a default\n $staticContent = '';\n $uid = null;\n\n if( isset($this->params->query['uid']) ){\n $uid = $this->params->query['uid'];\n $staticContentRecord = $this->StaticContent->find('first', [\n 'conditions' => [\n 'StaticContent.uid' => $uid\n ]\n ]);\n if( $staticContentRecord != false ){\n $staticContent = $staticContentRecord['StaticContent']['html'];\n }\n\n }\n\n $this->set( 'uid', $uid );\n $this->set( 'staticContent', $staticContent );\n $this->set( '_serialize', [\n 'uid',\n 'staticContent'\n ]);\n\n }", "public function editView() {\n $this->edit = true;\n $this->addView();\n }", "public function editAction()\n {\n $emtModel = $this->_initEmt();\n\n // prepare attribute data form\n $data = $this->_getSession()->getData('edit_emt_form_data',true);\n $attributeData = array();\n if (isset($data)) {\n // set entered data if was error when we do save\n $emtModel->addData($data);\n }\n\n if ($emtModel->getId() && $emtModel->getEmvSendMailModeId() == Emv_Emt_Model_Mailmode::EMV_CREATE){\n // take attributes of this emt\n $collection = Mage::getResourceModel('emvemt/attribute_collection')\n ->addEmtFilter($emtModel->getId())\n ->load();\n\n $attributeData = $collection->getItems();\n } else {\n // get back attribute data\n if ($data && isset($data['attributes']) && is_array($data['attributes'])) {\n $attributeData = $data['attributes'];\n }\n }\n Mage::register(self::EMV_ATTRIBUTES_REGISTRY, $attributeData);\n\n // don't display form if account does not exist in database\n $account = $emtModel->getAccount();\n if (!$account && null !== $emtModel->getEmvAccountId()) {\n $this->_getSession()->addError(\n Mage::helper('emvemt')\n ->__('Your SmartFocus account associated to this template does not exist anymore ! Please delete it !')\n );\n $this->_redirect('*/*/');\n return;\n }\n\n // try to retreive invalid fields if we just came back from save action\n // all invalid fields are stored in session\n $invalidFields = $this->_getSession()->getData('invalid_emt_fields',true);\n if (!$invalidFields) {\n $invalidFields = array();\n }\n\n $options = null;\n $emvParams = $emtModel->getEmailVisionParams();\n if ($emvParams && is_array($emvParams)) {\n $options = array(\n 'value' => $emvParams['emv_id'],\n 'label' => $emvParams['emv_name'],\n );\n }\n\n $templateCode = '';\n $error = array();\n try {\n if (null != $emtModel->getEmvAccountId() && null != $emtModel->getMageTemplateId()) {\n if (count($invalidFields) == 0) {\n // if emt is not already tested, verify emt data\n $error = $emtModel->validate();\n $invalidFields = $emtModel->getInvalidFields();\n }\n\n // check whether magento template exists\n /* @var $magentoTemplates Mage_Core_Model_Mysql4_Email_Template_Collection */\n $magentoTemplates = Mage::getResourceModel('core/email_template_collection');\n $magentoTemplates->getSelect()->reset(Zend_Db_Select::COLUMNS)\n ->columns(array('template_id', 'template_code')); // only get template_id, and template_code\n $magentoTemplates->addFieldToFilter('template_id ', array('eq' => $emtModel->getMageTemplateId()));\n $template = $magentoTemplates->getFirstItem();\n if (!$template->getId()) {\n $invalidFields['mage_template_id'] = Mage::helper('emvemt')\n ->__('Your selected Magento template does not exist. Please select a new one !');\n } else {\n $templateCode = $template->getTemplateCode();\n }\n\n // to enhance the performance, only get campaign commander template if we don't have any invalid fields\n // and the template is in mode emv_create\n if (\n (!$invalidFields || !isset($invalidFields['emv_template_id']))\n && $emtModel->getEmvSendMailModeId() == Emv_Emt_Model_Mailmode::EMV_CREATE\n ){\n $template = $emtModel->getEmvTemplate();\n if ($template && isset($template->name)) {\n Mage::register(self::EMV_TEMPLATE_REGISTRY, $template);\n $options = array(\n 'value' => $emtModel->getEmvTemplateId(),\n 'label' => $template->name\n );\n }\n }\n\n if (is_array($error)) {\n foreach ($error as $message) {\n $this->_getSession()->addError($message);\n }\n }\n }\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n }\n\n Mage::register(self::EMV_TEMPLATE_ARRAY_REGISTRY,$options);\n Mage::register(self::MAGE_TEMPLATE_NAME_REGISTRY, $templateCode);\n Mage::register(self::INVALID_FIELD_EMV_TEMPLATE_REGISTRY, $invalidFields);\n\n $this->_initAction();\n $this->_title(($templateCode));\n // add emt edit block form html to return\n $this->_addContent($this->getLayout()->createBlock('emvemt/adminhtml_template_edit'))\n ->_addLeft($this->getLayout()->createBlock('emvemt/adminhtml_template_edit_tabs'))\n ;\n $this->renderLayout();\n }", "function edit() {\n\t}", "function edit(){\r\n\t\t$this->checkSession();\r\n\t\t//if data is submitted, respond with something other than the form, unless it is bad,\r\n\t\t//maybe a json something to add the thing to the list\r\n\t\tif(!empty($this->data)){\r\n\t\t\tif($this->Session->check(\"User\")){\r\n\t\t\t\t$user = $this->Session->read(\"User\");\r\n\t\t\t}else{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t$this->data['Mailbox']['user_id'] = $user['id'];\r\n\t\t\tif($this->Mailbox->save($this->data)){\r\n\t\t\t\t$output = \"mailbox saved\";\r\n\t\t\t\t$this->Session->flash('mailbox saved');\r\n\t\t\t}else{\r\n\t\t\t\t$this->Mailbox->validateErrors();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($this->Session->check(\"User\")){\r\n\t\t\t$user = $this->Session->read(\"User\");\r\n\t\t}else{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$mbox = $this->Mailbox->findAllByUser_id($user['id']);\r\n\t\t$this->set('datas',$mbox);\r\n\t\t$this->render('edit','ajax');\t\t\r\n\t}", "function __construct()\r\n\t{\r\n\t\t$this->events[\"AfterEdit\"]=true;\r\n\r\n\r\n//\tonscreen events\r\n\r\n\t}", "public function ReadyForEdit()\n {\n }", "public function edit(){\n \n }", "public function editAction()\n {\n echo \"Hello from edit() action method of Posts controller \";\n echo \"<p>Query string parameters: <pre>\" . \n htmlspecialchars(print_r($this->route_params, true)) . \n \"</pre></p>\";\n }", "public function executeEdit()\n {\n $this->usClass = $this->getRequestParameter('usClass');\n $this->modelClass = $this->getRequestParameter('modelClass');\n $this->tableClass = $this->getRequestParameter('tableClass');\n $this->formClass = $this->getRequestParameter('formClass');\n $this->namespace = $this->getRequestParameter('namespace');\n \n $this->autocomplete = isset($this->autocomplete) ? $this->autocomplete : 'on';\n $this->object = method_exists($this->form, 'getObject') ? $this->form->getObject() : null;\n $this->parent = isset($this->parent) ? $this->parent : null;\n \n $this->action_uri = isset($this->action_uri) ? $this->action_uri : $this->getCurrentActionUri();\n $this->action_url = $this->getController()->genUrl($this->action_uri);\n }", "public function editAction()\n\t{\n\t\techo \"<p>Hello from edit action in the Posts controller</p>\";\n\t\techo \"<p>Route params:</p>\";\n\t\techo htmlspecialchars(print_r($this->route_params, true));\n\t\techo \"<br>\" . $this->route_params[\"id\"];\n\t}", "public function postEdit(){\n \t\n }", "public function editUrl() {}", "public function __edit()\n {\n // We override the standard CRUD edit actualiser in order to redirect to a\n // second edit screen if certain conditions are met. Other than this, the\n // rest of this method's code is copypasta'd from the standard CRUD module\n\n // CRUD stuff to begin with\n\n $id = strval(get_param_integer('id'));\n\n $delete = post_param_integer('delete', 0);\n if ($delete == 1) {\n $test = $this->handle_confirmations($this->title);\n if (!is_null($test)) {\n return $test;\n }\n\n $this->delete_actualisation($id);\n\n $description = do_lang_tempcode('SUCCESS');\n\n return $this->do_next_manager($this->title, $description, null);\n } else {\n $test = $this->handle_confirmations($this->title);\n if (!is_null($test)) {\n return $test;\n }\n\n // Here we interrupt the regular CRUD code see if we should redirect to\n // a second data entry screen\n if ($this->need_second_screen()) {\n return $this->second_screen();\n }\n\n $this->edit_actualisation($id);\n\n $description = do_lang_tempcode('SUCCESS');\n }\n\n return $this->do_next_manager($this->title, $description, $id);\n }", "private function init_dialog_edit(){\n\t\t$this->helper_ajax = new Admin_sarung_ujis_ajax_helper( );\n\t\t$this->helper_ajax->set_default_value( $this->get_url_this_ajax().\"/ujian\" , $this->get_url_this_ajax().\"/santri\");\n\t\t$js = $this->helper_ajax->get_js();\n\t\t$this->set_js($js);\n\t}", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "protected function editMode()\n\t{\n\t\t$dataToPass = $this->_viewData;\n\t\tif($this->_manageAction == 'edit')\n\t\t{\n\t\t\tif(!empty($this->_viewData['formError']))\n\t\t\t\t$dataToPass['fields'] = $this->_data->fields;\n\t\t\telse\n\t\t\t\t$dataToPass['fields'] = $this->_db->getCurrentRow();\n\t\t\tif(!$dataToPass['fields'])\n\t\t\t\tthrow new CHttpException(404, Yii::t('AutoAdmin.errors', 'Can\\'t find the record'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach($this->_data->fields as &$field)\n\t\t\t{\n\t\t\t\tif(!is_null($field->bind))\n\t\t\t\t\t$field->defaultValue = $field->bind;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t$dataToPass['fields'] = $this->_data->fields;\n\t\t}\n\n\t\tif($this->_data->foreignLinks)\n\t\t{\n\t\t\tif(!isset($dataToPass['iframes']))\n\t\t\t\t$dataToPass['iframes'] = array();\n\t\t\tforeach($this->_data->foreignLinks as $alias=>$foreignLink)\n\t\t\t{\n\t\t\t\t//Passing the data for IFRAME\n\t\t\t\t$dataToPass['iframes'][$alias] = array(\n\t\t\t\t\t'action'\t=> $alias,\n\t\t\t\t\t'foreign'\t=> $foreignLink,\n\t\t\t\t\t'parent'\t=> $_GET,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$dataToPass = array_merge($dataToPass, array(\n\t\t\t\t'interface'\t=> $this->_interface,\n\t\t\t\t'clientData'=> $this->clientViewData,\n\t\t\t\t'baseURL'\t=> Yii::app()->request->requestUri,\n\t\t\t));\n\n\t\t$this->_controller->render($this->viewsPath.'edit', $dataToPass);\n\t}", "function NewsEdit()\n\t\t{\t\n\t\t\t$this->obTemplate->clear_cache('affiliates/ihtml/news_edit.html');\t\t\t\n\t\t\t$this->obTemplate->assign('vMsg', $this->vMsg);\n\t\t\t\n\t\t\t$this->obTemplate->assign('affiliateArticle',$this->affiliateArticle[0] );\n\t\t\t//echo \"<pre>\";print_r($this->affiliateArticle);\n\t\t\t$this->obTemplate->assign('Content',$this->obTemplate->fetch('affiliates/ihtml/news_edit.html'));\t\t\n\t\t\t$this->parse();\t\n\t\t}", "public function __construct($action=\"\", $id=\"edit_rechazarRendicion\") {\n\n\t\tparent::__construct($id);\n\n\t\t$fieldset = new FormFieldset( \"\" );\n\t\t//$fieldset->addField( FieldBuilder::buildFieldReadOnly ( CDT_ENTITIES_LBL_ENTITY_OID, \"oid\", \"\" ) );\n\t\t\n\t\t\t\n\t\t$findRendicion = CYTSecureComponentsFactory::getFindRendicion(new Rendicion(), CYT_LBL_RENDICION, CYT_MSG_RENDICON_ESTADO_RENDICION_REQUIRED, \"rendicion_form_estado_oid\", \"rendicion.oid\", \"estado_filter_rendicion_change\");\n\t\t//$findRendicion->getInput()->setInputSize(5,80);\n\t\t$fieldset->addField( $findRendicion );\n\t\t\n\t\t$fieldset->addField( FieldBuilder::buildFieldTextArea ( CYT_MSG_SOLICITUD_RECHAZAR_MOTIVOS, \"observaciones\", CYT_MSG_SOLICITUD_RECHAZAR_MOTIVOS_REQUIRED ) );\n\t\t\n\t\t\n\t\t$this->addFieldset($fieldset);\n\t\t$this->addHidden( FieldBuilder::buildInputHidden ( \"oid\", \"\") );\n\n\t\t//properties del form.\n\t\t$this->addProperty(\"method\", \"POST\");\n\t\t$this->setAction(\"doAction?action=$action\");\n\t\t\n\t\t$cancel = 'doAction?action=list_solicitudes';\t\n\t\t\n\t\t$this->setOnCancel(\"window.location.href = '$cancel';\");\n\t\t$this->setUseAjaxSubmit( true );\n\t\t//$this->setOnSuccessCallback(\"successTest\");\n\t\t//$this->setUseAjaxCallback( true );\n\t\t//$this->setIdAjaxCallback( \"content-left\" );\n\t}", "public function initializeSaveFormAction() {}", "protected function _beforeEditSave()\n { }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function editAction()\n {\n echo 'Hello from the edit action in the Posts controller!';\n echo '<p>Route parameters : <pre>'.htmlspecialchars(print_r($this->route_params, true)).'</pre></p>';\n }", "function loadMailEditFields() {\n $this->editFields['xmlfile'] = array(\n 'Form XML File', 'isFile', TRUE, 'filecombo',\n array(PAPAYA_XMLFILES_PATH, '/^\\w+\\.xml$/i'), '');\n $this->editFields['mail_to'] = array(\n 'Mail to', 'isEMail', TRUE, 'input', 60, '', 'webmaster@localhost');\n $this->editFields['mail_from'] = array(\n 'Mail from (default)', 'isEMail', TRUE, 'input', 60, '',\n 'webmaster@localhost');\n $this->editFields['mail_subject'] = array(\n 'Subject', 'isNoHTML', TRUE, 'input', 60, '', 'Feedback from your website');\n $this->editFields['mail_text'] = array(\n 'Text', 'isSomeText', FALSE, 'textarea', 6, $this->loadMarkersDescription(),\n 'The following data has been submitted... Use the markers.');\n $this->editFields['mail_empty_values'] = array(\n 'Replace empty values with:', 'isSomeText', FALSE, 'input', 60, '',\n '-');\n }", "public function do_edit()\n {\n\n $request = $this->getRequest();\n $console = $this->getConsole();\n\n $workarea = $console->tpl->getWorkArea( );\n $workarea->addTemplate( 'usermgmt/create' );\n\n }", "protected function editAction(): void\n {\n $this->editAction\n ->setAccess($this, Access::CAN_EDIT)\n ->execute($this, PermissionEntity::class, PermissionActionEvent::class, NULL, __METHOD__)\n ->render()\n ->with(\n [\n 'permission' => $this->toArray($this->findOr404()),\n 'role_perm' => $this->rolePerm->getRepo()->findBy(['role_id'], ['permission_id' => $this->thisRouteID()])\n ]\n )\n ->form($this->formPermission)\n ->end();\n }", "public function __construct($action=\"\", $id=\"edit_evaluadores\") {\n\n\t\tparent::__construct($id);\n\n\t\t$fieldset = new FormFieldset( \"\" );\n\t\t$fieldset->addField( FieldBuilder::buildFieldReadOnly ( CDT_ENTITIES_LBL_ENTITY_OID, \"oid\", \"\" ) );\n\t\t\n\t\t$findSolicitud = CYTSecureComponentsFactory::getFindSolicitud(new Solicitud(), CYT_LBL_SOLICITUD, \"\", \"evaluacion_filter_solicitud_oid\", \"solicitud.oid\", \"solicitud_filter_evaluador_change\");\n\t\t$fieldset->addField( $findSolicitud );\n\n\t\t$findEvaluador = CYTSecureComponentsFactory::getFindEvaluador(new User(), CYT_LBL_EVALUADOR_INTERNO, \"\", \"evaluacion_filter_evaluadorInterno_oid\", \"evaluadorInterno.oid\", \"\");\n\t\t$fieldset->addField( $findEvaluador );\n\t\t\n\t\t$findEvaluador = CYTSecureComponentsFactory::getFindEvaluador(new User(), CYT_LBL_EVALUADOR_EXTERNO, \"\", \"evaluacion_filter_evaluadorExterno_oid\", \"evaluadorExterno.oid\", \"\");\n\t\t$fieldset->addField( $findEvaluador );\n\t\t\n\t\t/*$findEvaluador = CYTSecureComponentsFactory::getFindEvaluador(new User(), CYT_LBL_EVALUADOR_TERCERO, \"\", \"evaluacion_filter_evaluadorTercero_oid\", \"evaluadorTercero.oid\", \"\");\n\t\t\n\t\t$fieldset->addField( $findEvaluador );*/\n\t\t\n\t\t\n\t\t$this->addFieldset($fieldset);\n\n\t\t$this->addHidden( FieldBuilder::buildInputHidden ( \"oid\", \"\") );\n\n\t\t//properties del form.\n\t\t$this->addProperty(\"method\", \"POST\");\n\t\t$this->setAction(\"doAction?action=$action\");\n\t\t$this->setOnCancel(\"window.location.href = 'doAction?action=list_evaluaciones';\");\n\t\t$this->setUseAjaxSubmit( true );\n\t\t$this->setCustomHTML(\"\");\n\t\t//$this->setOnSuccessCallback(\"successTest\");\n\t\t//$this->setUseAjaxCallback( true );\n\t\t//$this->setIdAjaxCallback( \"content-left\" );\n\t}", "public function editAction() {\r\n\r\n\t\t// initialise action varibles\r\n\t\t$request = $this->getRequest();\r\n\t\t$user = $this->loggedInUser();\r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->sub = Base::siteSub();\r\n\t\t// get the requested order. Also checks that the logged in user has access\r\n\t\t$order_id = $request->getParam('id');\r\n\t\t$ordModel = Base::getModel('Common_Orders');\r\n\t\t$where = $ordModel->select()->where('id = ?', $order_id)->where('sub_id IN (?)', $user->subs()->inField('id'));\r\n\t\t$order = $ordModel->fetchRow($where);\r\n\t\tif (!$order) {\r\n\t\t\t$this->addFlash('Invalid order', 'errors');\r\n\t\t\t$this->_redirect('/common/orders');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif ($order->isLocked()){\r\n\t\t\t$this->addFlash('This order is locked.', 'warning');\r\n\t\t}\r\n\t\t\r\n\t\tif (!$user->access($order->commonUser()->sub()->id)) {\r\n\t\t\t$this->addFlash('You do not have access to this record. Please contact site administrator.', 'notice');\r\n\t\t\t$this->_redirect('/common/orders', array('exit' => true));\r\n\t\t}\r\n\t\r\n\t\t$this->view->order = $order;\r\n\t\t$this->view->source = 'Order '. $order->order_number ;\r\n\t\t$this->view->statuses = array_combine($this->_statuses, $this->_statuses); // use same key & value to satisfy the select\r\n\t\t$this->view->status3 = array('' => '', 'ACTIVE' => 'Order ACTIVE', 'HOLD' => 'Order HOLD', 'CANCELLED' => 'Order CANCELLED');\r\n\t\t$notesModel = Base::getModel('Notes');\r\n\t\t$notes_data = array(\r\n\t\t\t'common_orders'\t\t=> $order->id,\r\n\t\t\t'common_users'\t\t=> $order->commonUser()->id,\r\n\t\t\t'common_items'\t\t=> '',\r\n\t\t\t'client_products'\t=> '',\r\n\t\t);\r\n\r\n\t\t$this->view->notes = $notesModel->fetchNotes($notes_data);\t\r\n\t\t$this->view->users = $this->internalUsers();\r\n\t\t\r\n\t\t// form has been submitted\r\n\t\tif ($request->isPost()) {\r\n\t\t\t\r\n\t\t\t// last minute\r\n\t\t\t$request->setParam('id', $order->id);\r\n\r\n\t\t\t$updated = $ordModel->process($request->getParams(), 'update', array('id', 'priority', 'gift', 'watch', 'internal', 'dispatch_notes'));\r\n\t\t\tif ($updated) {\r\n\t\t\t\t// add log if priority changed\r\n\t\t\t\tif ($request->getParam('priority') != $order->priority ||\r\n\t\t\t\t $request->getParam('watch') != $order->watch) {\r\n\t\t\t\t\t$order->changePriorityLog($request->getParam('priority'), $order->priority, $request->getParam('watch'), $order->watch);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->addFlash('Order updated.', 'notice');\r\n\t\t\t\t$this->_redirect('/common/orders/edit/id/' . $order->id, array('exit' => true));\r\n\t\t\t\treturn;\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$this->addFlash('Error updating order. Correct form below.', 'errors');\r\n\t\t\t\t$this->view->errors = $ordModel->getErrors();\r\n\t\t\t\t$this->view->data = $request->getParams();\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// first time loading form\r\n\t\t$this->view->data = $order->toArray();\r\n\t}", "public function __construct($action=\"\", $id=\"edit_encomienda\") {\n\n\t\tparent::__construct($id);\n\n\t\t$fieldset = new FormFieldset( \"\" );\n\t\t$fieldset->addField( FieldBuilder::buildFieldReadOnly ( CDT_ENTITIES_LBL_ENTITY_OID, \"oid\", \"\" ) );\n\t\t$fieldset->addField( FieldBuilder::buildFieldReadOnly ( CPIQ_LBL_ENCOMIENDA_NUMERO, \"numero\", \"\" ) );\n\t\t\n\t\t$findTipoEncomienda = CPIQComponentsFactory::getFindTipoEncomienda(new TipoEncomienda(), CPIQ_LBL_TIPO_ENCOMIENDA, CPIQ_MSG_ENCOMIENDA_TIPO_ENCOMIENDA_REQUIRED, \"encomienda_filter_tipoEncomienda_oid\", \"tipoEncomienda.oid\");\n\t\t$findTipoEncomienda->getInput()->setFunctionCallback(\"editEncomienda_tipoEncomiendaCallback\");\n\t\t$fieldset->addField( $findTipoEncomienda );\n\t\t\n\t\t/*$findMatriculado = CPIQComponentsFactory::getFindMatriculado(new Matriculado(), CPIQ_LBL_MATRICULADO, CPIQ_MSG_TITULO_MATRICULADO_REQUIRED, \"titulo_matriculado_oid\", \"matriculado.oid\", \"titulo_filter_matriculado_change\");\n\t\t$fieldset->addField( $findMatriculado );*/\n\t\t\n\t\t\n\t\t\n\t\t$fieldset->addField( FieldBuilder::buildFieldText ( CPIQ_LBL_ENCOMIENDA_COMITENTE, \"comitente\", CPIQ_MSG_ENCOMIENDA_COMITENTE_REQUIRED) );\n\t\t\n\t\t$fieldTipoComitente = FieldBuilder::buildFieldSelect (CPIQ_LBL_ENCOMIENDA_TIPO_COMITENTE, \"tipoComitente\", TipoComitente::getItems(), CPIQ_MSG_ENCOMIENDA_TIPO_COMITENTE_REQUIRED, null, null, \"--seleccionar--\" );\n\t\t$fieldTipoComitente->getInput()->addProperty( 'onChange', 'seleccionarTipoComitente(this)' );\n\t\t$fieldset->addField( $fieldTipoComitente );\n\t\t\n\t\t$inputRepresentante = FieldBuilder::buildFieldText ( CPIQ_LBL_ENCOMIENDA_REPRESENTANTE, \"representante\");\n\t\t$inputRepresentante->getInput()->setIsVisible(false);\n\t\t$fieldset->addField( $inputRepresentante );\n\t\t\n\t\t\n\t\t\n\t\t$fieldTipoDocumento = FieldBuilder::buildFieldSelect (CPIQ_LBL_ENCOMIENDA_TIPO_DOCUMENTO, \"tipoDocumento.oid\", CPIQUtils::getTiposDocumentoItems(), \"\", null, null, \"--seleccionar--\", \"tipoDocumento_oid\" );\n\t\t$fieldTipoDocumento->getInput()->setIsVisible(false);\n\t\t$fieldset->addField( $fieldTipoDocumento );\n\t\t\n\t\t$inputDocumento = FieldBuilder::buildFieldNumber ( CPIQ_LBL_ENCOMIENDA_DOCUMENTO, \"documento\", \"\", \"\", 10 ) ;\n\t\t$inputDocumento->getInput()->setIsVisible(false);\n\t\t$fieldset->addField( $inputDocumento );\n\t\t\n\t\t\n\t\t$fieldset->addField( FieldBuilder::buildFieldNumber ( CPIQ_LBL_ENCOMIENDA_NRO_CUIL, \"cuil\", CPIQ_MSG_ENCOMIENDA_NRO_CUIL_REQUIRED, \"\", 12 ) );\n\n\n\t\t$fieldDomicilio = FieldBuilder::buildFieldText ( CPIQ_LBL_MATRICULADO_DOMICILIO, \"domicilio\", CPIQ_MSG_ENCOMIENDA_DOMICILIO_REQUIRED );\n\t\t//$fieldDomicilio->getInput()->addProperty(\"maxlength\", 255);\n\t\t$fieldset->addField( $fieldDomicilio );\n\t\t\n\t\t$findLocalidad = CPIQComponentsFactory::getFindLocalidad(new Localidad(), CPIQ_LBL_LOCALIDAD, CPIQ_MSG_ENCOMIENDA_LOCALIDAD_REQUIRED, \"matriculado_filter_localidad_oid\", \"localidad.oid\", \"matriculado_filter_localidad_change\");\n\t\t$fieldset->addField( $findLocalidad );\n\t\t\n\t\t$fieldset->addField( FieldBuilder::buildFieldText ( CPIQ_LBL_ENCOMIENDA_CP, \"cp\",CPIQ_MSG_ENCOMIENDA_CP_REQUIRED ) );\n\t\t\n\t\t\t\t\n\n\t\t$fieldset->addField( FieldBuilder::buildFieldText ( CPIQ_LBL_ENCOMIENDA_TELEFONO, \"telefono\",CPIQ_MSG_ENCOMIENDA_TELEFONO_REQUIRED ) );\n\t\t$this->addFieldset($fieldset);\n\n\t\t\n\t\t\n\t\t$this->addHidden( FieldBuilder::buildInputHidden ( \"oid\", \"\") );\n\n\t\t//properties del form.\n\t\t$this->addProperty(\"method\", \"POST\");\n\t\t$this->setAction(\"doAction?action=$action\");\n\t\t$this->setOnCancel(\"window.location.href = 'doAction?action=list_encomiendas';\");\n\t\t$this->setUseAjaxSubmit( true );\n\t\t//$this->setOnSuccessCallback(\"successTest\");\n\t\t//$this->setUseAjaxCallback( true );\n\t\t//$this->setIdAjaxCallback( \"content-left\" );\n\t\t$this->setCustomHTML('<script> $(function() {$(\"#tipoComitente\").change();});</script>');\n\t}", "public function editAction()\r\n {\r\n $this->_forward('add');\r\n }", "function edit() {\n\t\t$this->display();\n\t}", "function edit()\n {\n }", "public function display_edit() {\n\t\t$document = \\Document::get_by_id($_GET['id']);\n\t\tif ($document->classname != 'Document_Incoming_Invoice') {\n\t\t\tSession::redirect('/administrative/document?action=edit&id=' . $_GET['id']);\n\t\t}\n\n\t\tparent::display_edit();\n\t}", "public function edit()\n {\n //\n\n \n }", "public function __construct() {\n\n\t\t$this->_objectId = 'faq_id';\n\t\t$this->_controller = 'admin';\n\t\t$this->_blockGroup = 'faq';\n\t\t\n\t\tparent :: __construct();\n\t\t\n\t\t$this->_updateButton('save', 'label', Mage :: helper('faq')->__('Save FAQ item'));\n\t\t$this->_updateButton('delete', 'label', Mage :: helper('faq')->__('Delete FAQ item'));\n\t\t\n\t\t$this->_addButton('saveandcontinue', array (\n\t\t\t\t'label' => Mage :: helper('faq')->__('Save and continue edit'), \n\t\t\t\t'onclick' => 'saveAndContinueEdit()', \n\t\t\t\t'class' => 'save' ), -100);\n\t\t\n\t\t$this->_formScripts[] = \"\n function saveAndContinueEdit(){\n editForm.submit($('edit_form').action+'back/edit/');\n }\n \";\n\t}", "public function editmailtemplateAction(){\n\t\t\n\t\tglobal $mySession; \n\t\t\n\t\t$this->view->pageHeading = \"Edit Email Templates\";\n\t\t$this->view->pageDescription = \"manage all email templates\";\n\t\t$this->view->pageIcon = \"icon-envelope-letter\";\n \t\t\n\t\t$id = $this->_getParam('email_key');\n\t\t\n\t\t\n \t\t$record = $this->modelStatic->getTemplate($id);\n\t\t\n \t\tif(!$record){\n \t\t\t$mySession->errorMsg = \"No Such Email Template Exists\";\n \t\t\t$this->_helper->getHelper(\"Redirector\")->gotoRoute(array(),\"admin_email_templates\");\n \t\t}\n \n \t\t$form = new Application_Form_StaticForm();\n \t\t$form->email_template();\n\t\t\n \t\t$form->populate((array)$record);\n\t\t\n\t\tif($this->getRequest()->isPost()){\n\t\t\t\n\t\t\tif($form->isValid($this->getRequest()->getPost())){\n\t\t\t\t$data=$form->getValues();\n\t\t\t\t$data['emailtemp_modified']=date('Y-m-d H:i:s');\n\t\t\t\t$this->modelStatic->add(\"email_templates\",$data,\"emailtemp_key='\".$id.\"'\");\n\t\t\t\t$mySession->successMsg = \"Email Template Updated Successfully\";\n \t\t\t\t$this->_helper->getHelper(\"Redirector\")->gotoRoute(array(),\"admin_email_templates\");\n\t\t\t\t\n\t\t\t}\n \t\t}\n\t\t\n \t\t$this->view->form = $form;\n\t\t$this->_helper->getHelper('viewRenderer')->renderScript(\"add.phtml\");\n\t}" ]
[ "0.71237046", "0.69055253", "0.68564516", "0.68416667", "0.67570764", "0.6749017", "0.6697065", "0.6683093", "0.66404456", "0.662891", "0.66173464", "0.6615029", "0.66043204", "0.6592291", "0.65851873", "0.6562243", "0.6543653", "0.65201116", "0.6504085", "0.64705145", "0.64455116", "0.6443611", "0.643314", "0.64318424", "0.64040536", "0.6398403", "0.6395154", "0.6386983", "0.63783526", "0.6364098", "0.6359449", "0.63340163", "0.6317843", "0.63031846", "0.63028497", "0.63028497", "0.63028497", "0.63028497", "0.63028497", "0.6299779", "0.62819755", "0.6279929", "0.6275854", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.6272588", "0.62721044", "0.62675405", "0.62576824", "0.62518936", "0.6238645", "0.62384427", "0.62377435", "0.62360674", "0.6230519", "0.62230253", "0.6214226", "0.62090343", "0.62075806", "0.61971927", "0.61970127", "0.6195588", "0.61890626", "0.6187665", "0.6179165", "0.6169827", "0.61646277", "0.61645466", "0.61487603", "0.61487603", "0.61487603", "0.61487603", "0.61487603", "0.6142656", "0.6142656", "0.6142656", "0.6142656", "0.61232895", "0.6123037", "0.61170614", "0.61123115", "0.6111429", "0.61099213", "0.61083263", "0.61042386", "0.609675", "0.60795414", "0.60749936", "0.606896", "0.606577", "0.60655683" ]
0.7425025
0
//////////////////////////////////////////////////////////////////////////////////////// Add the ARK Crypto Currency Symbol to WooCommerce (As Custom Currency)//
//////////////////////////////////////////////////////////////////////////////////////// Добавление символа криптовалюты ARK в WooCommerce (как пользовательская валюта) //
function arkcommerce_add_ark_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { // Add ISO 4217 currency symbol case 'ARK': $currency_symbol = 'Ѧ'; break; } return $currency_symbol; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arkcommerce_add_ark_currency( $currencies ) \n{\n\t// Add ISO 4217 currency identifier\n\t$currencies['ARK'] = 'ARK';\n\treturn $currencies;\n}", "function ecommerce_get_currency_symbol()\n{\n\t$currency=get_option('currency');\n\tswitch ($currency)\n\t{\n\t\tcase 'USD':\n\t\t\t$currency='$';\n\t\t\tbreak;\n\t\tcase 'CAD':\n\t\t\t$currency='$';\n\t\t\tbreak;\n\t\tcase 'EUR':\n\t\t\t$currency='&euro;';\n\t\t\tbreak;\n\t\tcase 'GBP':\n\t\t\t$currency='&pound;';\n\t\t\tbreak;\n\t\tcase 'JPY':\n\t\t\t$currency='&yen;';\n\t\t\tbreak;\n\t\tcase 'AUD':\n\t\t\t$currency='$';\n\t\t\tbreak;\n\t}\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($currency);\n\treturn $currency;\n}", "function get_woocommerce_currency_symbols()\n {\n }", "function my_give_add_costarican_currency( $currencies ) {\n\n\t$currencies['CRC'] = array(\n\t\t'admin_label' => __( 'Costa Rican Col&oacute;n (&#8353;)', 'give' ),\n\t\t'symbol' => '&#8353;',\n\t);\n\n\treturn $currencies;\n}", "function get_woocommerce_currency_symbol($currency = '')\n {\n }", "public function get_currency_alphabetic_code() {\n\t\treturn 'EUR';\n\t}", "function carolina_display_ccy ($symbol, $currency) {\n $symbol = $currency . \" \";\n return $symbol;\n}", "function learn_press_currency_symbols() {\n\t$symbols = array(\n\t\t'AED' => '&#x62f;.&#x625;',\n\t\t'AFN' => '&#x60b;',\n\t\t'ALL' => 'L',\n\t\t'AMD' => 'AMD',\n\t\t'ANG' => '&fnof;',\n\t\t'AOA' => 'Kz',\n\t\t'ARS' => '&#36;',\n\t\t'AUD' => '&#36;',\n\t\t'AWG' => 'Afl.',\n\t\t'AZN' => 'AZN',\n\t\t'BAM' => 'KM',\n\t\t'BBD' => '&#36;',\n\t\t'BDT' => '&#2547;&nbsp;',\n\t\t'BGN' => '&#1083;&#1074;.',\n\t\t'BHD' => '.&#x62f;.&#x628;',\n\t\t'BIF' => 'Fr',\n\t\t'BMD' => '&#36;',\n\t\t'BND' => '&#36;',\n\t\t'BOB' => 'Bs.',\n\t\t'BRL' => '&#82;&#36;',\n\t\t'BSD' => '&#36;',\n\t\t'BTC' => '&#3647;',\n\t\t'BTN' => 'Nu.',\n\t\t'BWP' => 'P',\n\t\t'BYR' => 'Br',\n\t\t'BYN' => 'Br',\n\t\t'BZD' => '&#36;',\n\t\t'CAD' => '&#36;',\n\t\t'CDF' => 'Fr',\n\t\t'CHF' => '&#67;&#72;&#70;',\n\t\t'CLP' => '&#36;',\n\t\t'CNY' => '&yen;',\n\t\t'COP' => '&#36;',\n\t\t'CRC' => '&#x20a1;',\n\t\t'CUC' => '&#36;',\n\t\t'CUP' => '&#36;',\n\t\t'CVE' => '&#36;',\n\t\t'CZK' => '&#75;&#269;',\n\t\t'DJF' => 'Fr',\n\t\t'DKK' => 'DKK',\n\t\t'DOP' => 'RD&#36;',\n\t\t'DZD' => '&#x62f;.&#x62c;',\n\t\t'EGP' => 'EGP',\n\t\t'ERN' => 'Nfk',\n\t\t'ETB' => 'Br',\n\t\t'EUR' => '&euro;',\n\t\t'FJD' => '&#36;',\n\t\t'FKP' => '&pound;',\n\t\t'GBP' => '&pound;',\n\t\t'GEL' => '&#x20be;',\n\t\t'GGP' => '&pound;',\n\t\t'GHS' => '&#x20b5;',\n\t\t'GIP' => '&pound;',\n\t\t'GMD' => 'D',\n\t\t'GNF' => 'Fr',\n\t\t'GTQ' => 'Q',\n\t\t'GYD' => '&#36;',\n\t\t'HKD' => '&#36;',\n\t\t'HNL' => 'L',\n\t\t'HRK' => 'kn',\n\t\t'HTG' => 'G',\n\t\t'HUF' => '&#70;&#116;',\n\t\t'IDR' => 'Rp',\n\t\t'ILS' => '&#8362;',\n\t\t'IMP' => '&pound;',\n\t\t'INR' => '&#8377;',\n\t\t'IQD' => '&#x639;.&#x62f;',\n\t\t'IRR' => '&#xfdfc;',\n\t\t'IRT' => '&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;',\n\t\t'ISK' => 'kr.',\n\t\t'JEP' => '&pound;',\n\t\t'JMD' => '&#36;',\n\t\t'JOD' => '&#x62f;.&#x627;',\n\t\t'JPY' => '&yen;',\n\t\t'KES' => 'KSh',\n\t\t'KGS' => '&#x441;&#x43e;&#x43c;',\n\t\t'KHR' => '&#x17db;',\n\t\t'KMF' => 'Fr',\n\t\t'KPW' => '&#x20a9;',\n\t\t'KRW' => '&#8361;',\n\t\t'KWD' => '&#x62f;.&#x643;',\n\t\t'KYD' => '&#36;',\n\t\t'KZT' => '&#8376;',\n\t\t'LAK' => '&#8365;',\n\t\t'LBP' => '&#x644;.&#x644;',\n\t\t'LKR' => '&#xdbb;&#xdd4;',\n\t\t'LRD' => '&#36;',\n\t\t'LSL' => 'L',\n\t\t'LYD' => '&#x644;.&#x62f;',\n\t\t'MAD' => '&#x62f;.&#x645;.',\n\t\t'MDL' => 'MDL',\n\t\t'MGA' => 'Ar',\n\t\t'MKD' => '&#x434;&#x435;&#x43d;',\n\t\t'MMK' => 'Ks',\n\t\t'MNT' => '&#x20ae;',\n\t\t'MOP' => 'P',\n\t\t'MRU' => 'UM',\n\t\t'MUR' => '&#x20a8;',\n\t\t'MVR' => '.&#x783;',\n\t\t'MWK' => 'MK',\n\t\t'MXN' => '&#36;',\n\t\t'MYR' => '&#82;&#77;',\n\t\t'MZN' => 'MT',\n\t\t'NAD' => 'N&#36;',\n\t\t'NGN' => '&#8358;',\n\t\t'NIO' => 'C&#36;',\n\t\t'NOK' => '&#107;&#114;',\n\t\t'NPR' => '&#8360;',\n\t\t'NZD' => '&#36;',\n\t\t'OMR' => '&#x631;.&#x639;.',\n\t\t'PAB' => 'B/.',\n\t\t'PEN' => 'S/',\n\t\t'PGK' => 'K',\n\t\t'PHP' => '&#8369;',\n\t\t'PKR' => '&#8360;',\n\t\t'PLN' => '&#122;&#322;',\n\t\t'PRB' => '&#x440;.',\n\t\t'PYG' => '&#8370;',\n\t\t'QAR' => '&#x631;.&#x642;',\n\t\t'RMB' => '&yen;',\n\t\t'RON' => 'lei',\n\t\t'RSD' => '&#1088;&#1089;&#1076;',\n\t\t'RUB' => '&#8381;',\n\t\t'RWF' => 'Fr',\n\t\t'SAR' => '&#x631;.&#x633;',\n\t\t'SBD' => '&#36;',\n\t\t'SCR' => '&#x20a8;',\n\t\t'SDG' => '&#x62c;.&#x633;.',\n\t\t'SEK' => '&#107;&#114;',\n\t\t'SGD' => '&#36;',\n\t\t'SHP' => '&pound;',\n\t\t'SLL' => 'Le',\n\t\t'SOS' => 'Sh',\n\t\t'SRD' => '&#36;',\n\t\t'SSP' => '&pound;',\n\t\t'STN' => 'Db',\n\t\t'SYP' => '&#x644;.&#x633;',\n\t\t'SZL' => 'L',\n\t\t'THB' => '&#3647;',\n\t\t'TJS' => '&#x405;&#x41c;',\n\t\t'TMT' => 'm',\n\t\t'TND' => '&#x62f;.&#x62a;',\n\t\t'TOP' => 'T&#36;',\n\t\t'TRY' => '&#8378;',\n\t\t'TTD' => '&#36;',\n\t\t'TWD' => '&#78;&#84;&#36;',\n\t\t'TZS' => 'Sh',\n\t\t'UAH' => '&#8372;',\n\t\t'UGX' => 'UGX',\n\t\t'USD' => '&#36;',\n\t\t'UYU' => '&#36;',\n\t\t'UZS' => 'UZS',\n\t\t'VEF' => 'Bs F',\n\t\t'VES' => 'Bs.S',\n\t\t'VND' => '&#8363;',\n\t\t'VUV' => 'Vt',\n\t\t'WST' => 'T',\n\t\t'XAF' => 'CFA',\n\t\t'XCD' => '&#36;',\n\t\t'XOF' => 'CFA',\n\t\t'XPF' => 'Fr',\n\t\t'YER' => '&#xfdfc;',\n\t\t'ZAR' => '&#82;',\n\t\t'ZMW' => 'ZK',\n\t);\n\n\treturn apply_filters( 'learn-press/currency-symbols', $symbols );\n}", "public function getBaseCurrencySymbol();", "public static function addCurrency(string $symbol, $options = []): void\n {\n self::$currencies[$symbol] = $options + ['name' => $symbol,'before' => $symbol . ' ','after' => ''];\n }", "function wppb_get_currency_symbol( $currency_code ) {\r\n\r\n $currency_symbols = array(\r\n 'AED' => '&#1583;.&#1573;', // ?\r\n 'AFN' => '&#65;&#102;',\r\n 'ALL' => '&#76;&#101;&#107;',\r\n 'AMD' => '',\r\n 'ANG' => '&#402;',\r\n 'AOA' => '&#75;&#122;', // ?\r\n 'ARS' => '&#36;',\r\n 'AUD' => '&#36;',\r\n 'AWG' => '&#402;',\r\n 'AZN' => '&#1084;&#1072;&#1085;',\r\n 'BAM' => '&#75;&#77;',\r\n 'BBD' => '&#36;',\r\n 'BDT' => '&#2547;', // ?\r\n 'BGN' => '&#1083;&#1074;',\r\n 'BHD' => '.&#1583;.&#1576;', // ?\r\n 'BIF' => '&#70;&#66;&#117;', // ?\r\n 'BMD' => '&#36;',\r\n 'BND' => '&#36;',\r\n 'BOB' => '&#36;&#98;',\r\n 'BRL' => '&#82;&#36;',\r\n 'BSD' => '&#36;',\r\n 'BTN' => '&#78;&#117;&#46;', // ?\r\n 'BWP' => '&#80;',\r\n 'BYR' => '&#112;&#46;',\r\n 'BZD' => '&#66;&#90;&#36;',\r\n 'CAD' => '&#36;',\r\n 'CDF' => '&#70;&#67;',\r\n 'CHF' => '&#67;&#72;&#70;',\r\n 'CLF' => '', // ?\r\n 'CLP' => '&#36;',\r\n 'CNY' => '&#165;',\r\n 'COP' => '&#36;',\r\n 'CRC' => '&#8353;',\r\n 'CUP' => '&#8396;',\r\n 'CVE' => '&#36;', // ?\r\n 'CZK' => '&#75;&#269;',\r\n 'DJF' => '&#70;&#100;&#106;', // ?\r\n 'DKK' => '&#107;&#114;',\r\n 'DOP' => '&#82;&#68;&#36;',\r\n 'DZD' => '&#1583;&#1580;', // ?\r\n 'EGP' => '&#163;',\r\n 'ETB' => '&#66;&#114;',\r\n 'EUR' => '&#8364;',\r\n 'FJD' => '&#36;',\r\n 'FKP' => '&#163;',\r\n 'GBP' => '&#163;',\r\n 'GEL' => '&#4314;', // ?\r\n 'GHS' => '&#162;',\r\n 'GIP' => '&#163;',\r\n 'GMD' => '&#68;', // ?\r\n 'GNF' => '&#70;&#71;', // ?\r\n 'GTQ' => '&#81;',\r\n 'GYD' => '&#36;',\r\n 'HKD' => '&#36;',\r\n 'HNL' => '&#76;',\r\n 'HRK' => '&#107;&#110;',\r\n 'HTG' => '&#71;', // ?\r\n 'HUF' => '&#70;&#116;',\r\n 'IDR' => '&#82;&#112;',\r\n 'ILS' => '&#8362;',\r\n 'INR' => '&#8377;',\r\n 'IQD' => '&#1593;.&#1583;', // ?\r\n 'IRR' => '&#65020;',\r\n 'ISK' => '&#107;&#114;',\r\n 'JEP' => '&#163;',\r\n 'JMD' => '&#74;&#36;',\r\n 'JOD' => '&#74;&#68;', // ?\r\n 'JPY' => '&#165;',\r\n 'KES' => '&#75;&#83;&#104;', // ?\r\n 'KGS' => '&#1083;&#1074;',\r\n 'KHR' => '&#6107;',\r\n 'KMF' => '&#67;&#70;', // ?\r\n 'KPW' => '&#8361;',\r\n 'KRW' => '&#8361;',\r\n 'KWD' => '&#1583;.&#1603;', // ?\r\n 'KYD' => '&#36;',\r\n 'KZT' => '&#1083;&#1074;',\r\n 'LAK' => '&#8365;',\r\n 'LBP' => '&#163;',\r\n 'LKR' => '&#8360;',\r\n 'LRD' => '&#36;',\r\n 'LSL' => '&#76;', // ?\r\n 'LTL' => '&#76;&#116;',\r\n 'LVL' => '&#76;&#115;',\r\n 'LYD' => '&#1604;.&#1583;', // ?\r\n 'MAD' => '&#1583;.&#1605;.', //?\r\n 'MDL' => '&#76;',\r\n 'MGA' => '&#65;&#114;', // ?\r\n 'MKD' => '&#1076;&#1077;&#1085;',\r\n 'MMK' => '&#75;',\r\n 'MNT' => '&#8366;',\r\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\r\n 'MRO' => '&#85;&#77;', // ?\r\n 'MUR' => '&#8360;', // ?\r\n 'MVR' => '.&#1923;', // ?\r\n 'MWK' => '&#77;&#75;',\r\n 'MXN' => '&#36;',\r\n 'MYR' => '&#82;&#77;',\r\n 'MZN' => '&#77;&#84;',\r\n 'NAD' => '&#36;',\r\n 'NGN' => '&#8358;',\r\n 'NIO' => '&#67;&#36;',\r\n 'NOK' => '&#107;&#114;',\r\n 'NPR' => '&#8360;',\r\n 'NZD' => '&#36;',\r\n 'OMR' => '&#65020;',\r\n 'PAB' => '&#66;&#47;&#46;',\r\n 'PEN' => '&#83;&#47;&#46;',\r\n 'PGK' => '&#75;', // ?\r\n 'PHP' => '&#8369;',\r\n 'PKR' => '&#8360;',\r\n 'PLN' => '&#122;&#322;',\r\n 'PYG' => '&#71;&#115;',\r\n 'QAR' => '&#65020;',\r\n 'RON' => '&#108;&#101;&#105;',\r\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\r\n 'RUB' => '&#1088;&#1091;&#1073;',\r\n 'RWF' => '&#1585;.&#1587;',\r\n 'SAR' => '&#65020;',\r\n 'SBD' => '&#36;',\r\n 'SCR' => '&#8360;',\r\n 'SDG' => '&#163;', // ?\r\n 'SEK' => '&#107;&#114;',\r\n 'SGD' => '&#36;',\r\n 'SHP' => '&#163;',\r\n 'SLL' => '&#76;&#101;', // ?\r\n 'SOS' => '&#83;',\r\n 'SRD' => '&#36;',\r\n 'STD' => '&#68;&#98;', // ?\r\n 'SVC' => '&#36;',\r\n 'SYP' => '&#163;',\r\n 'SZL' => '&#76;', // ?\r\n 'THB' => '&#3647;',\r\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\r\n 'TMT' => '&#109;',\r\n 'TND' => '&#1583;.&#1578;',\r\n 'TOP' => '&#84;&#36;',\r\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\r\n 'TTD' => '&#36;',\r\n 'TWD' => '&#78;&#84;&#36;',\r\n 'TZS' => '',\r\n 'UAH' => '&#8372;',\r\n 'UGX' => '&#85;&#83;&#104;',\r\n 'USD' => '&#36;',\r\n 'UYU' => '&#36;&#85;',\r\n 'UZS' => '&#1083;&#1074;',\r\n 'VEF' => '&#66;&#115;',\r\n 'VND' => '&#8363;',\r\n 'VUV' => '&#86;&#84;',\r\n 'WST' => '&#87;&#83;&#36;',\r\n 'XAF' => '&#70;&#67;&#70;&#65;',\r\n 'XCD' => '&#36;',\r\n 'XDR' => '',\r\n 'XOF' => '',\r\n 'XPF' => '&#70;',\r\n 'YER' => '&#65020;',\r\n 'ZAR' => '&#82;',\r\n 'ZMK' => '&#90;&#75;', // ?\r\n 'ZWL' => '&#90;&#36;',\r\n );\r\n\r\n if( !empty( $currency_symbols[$currency_code] ) )\r\n return $currency_symbols[$currency_code];\r\n else\r\n return '';\r\n\r\n}", "function get_woocommerce_currency()\n {\n }", "public function getCalcCurrencyCode();", "function get_woocommerce_currencies()\n {\n }", "function give_simplepay_add_naira_symbol($symbol, $currency)\n{\n switch ($currency) :\n case \"NGN\" :\n $symbol = '&#8358;';\n break;\n endswitch;\n return $symbol;\n}", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "function currency_icon()\n {\n \n return \"$\";\n }", "function get_currency_code (){\n return $this->currency_code ;\n }", "function append_currency( $price, $nbsp = true, $currency_key = false ) {\n\t\t$currencies = $this->get_currencies();\n\t\t$currency = $currencies[ $this->options['currency'] ];\n\t\tif ( $currency_key )\n\t\t\t$currency = $currencies[ $currency_key ];\n\n\t\tif ( ! $currency )\n\t\t\t$currency = array( 'label' => __( 'U.S. Dollar', 'camptix' ), 'format' => '$ %s' );\n\n\t\t$with_currency = sprintf( $currency['format'], number_format( (float) $price, 2 ) );\n\t\tif ( $nbsp )\n\t\t\t$with_currency = str_replace( ' ', '&nbsp;', $with_currency );\n\n\t\treturn $with_currency;\n\t}", "public function getQuoteCurrency(): string;", "function currency_symbol() {\n\t\treturn DEFAULT_CURRENCY;\n\t}", "public function getBaseCurrencyCode();", "public function getBaseCurrencyCode();", "public function currencyCode()\n\t{\n\t\t$currencies = array(\n\t\t\t\t\t'AUD' => array(\n\t\t\t\t\t'label' => 'Australian Dollar',\n\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'CAD' => array(\n\t\t\t\t\t'label' => 'Canadian Dollar',\n\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'EUR' => array(\n\t\t\t\t\t\t'label' => 'Euro',\n\t\t\t\t\t\t'format' => '€',\n\t\t\t\t\t),\n\t\t\t\t\t'GBP' => array(\n\t\t\t\t\t\t'label' => 'Pound Sterling',\n\t\t\t\t\t\t'format' => '£',\n\t\t\t\t\t),\n\t\t\t\t\t'JPY' => array(\n\t\t\t\t\t\t'label' => 'Japanese Yen',\n\t\t\t\t\t\t'format' => '¥',\n\t\t\t\t\t),\n\t\t\t\t\t'USD' => array(\n\t\t\t\t\t\t'label' => 'U.S. Dollar',\n\t\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'NZD' => array(\n\t\t\t\t\t\t'label' => 'N.Z. Dollar',\n\t\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'CHF' => array(\n\t\t\t\t\t\t'label' => 'Swiss Franc',\n\t\t\t\t\t\t'format' => 'Fr',\n\t\t\t\t\t),\n\t\t\t\t\t'HKD' => array(\n\t\t\t\t\t\t'label' => 'Hong Kong Dollar',\n\t\t\t\t\t\t'format' => '$ ',\n\t\t\t\t\t),\n\t\t\t\t\t'SGD' => array(\n\t\t\t\t\t\t'label' => 'Singapore Dollar',\n\t\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'SEK' => array(\n\t\t\t\t\t\t'label' => 'Swedish Krona',\n\t\t\t\t\t\t'format' => 'kr',\n\t\t\t\t\t),\n\t\t\t\t\t'DKK' => array(\n\t\t\t\t\t\t'label' => 'Danish Krone',\n\t\t\t\t\t\t'format' => 'kr',\n\t\t\t\t\t),\n\t\t\t\t\t'PLN' => array(\n\t\t\t\t\t\t'label' => 'Polish Zloty',\n\t\t\t\t\t\t'format' => 'zł',\n\t\t\t\t\t),\n\t\t\t\t\t'NOK' => array(\n\t\t\t\t\t\t'label' => 'Norwegian Krone',\n\t\t\t\t\t\t'format' => 'kr',\n\t\t\t\t\t),\n\t\t\t\t\t'HUF' => array(\n\t\t\t\t\t\t'label' => 'Hungarian Forint',\n\t\t\t\t\t\t'format' => 'Ft',\n\t\t\t\t\t),\n\t\t\t\t\t'CZK' => array(\n\t\t\t\t\t\t'label' => 'Czech Koruna',\n\t\t\t\t\t\t'format' => 'Kč',\n\t\t\t\t\t),\n\t\t\t\t\t'ILS' => array(\n\t\t\t\t\t\t'label' => 'Israeli New Sheqel',\n\t\t\t\t\t\t'format' => '₪',\n\t\t\t\t\t),\n\t\t\t\t\t'MXN' => array(\n\t\t\t\t\t\t'label' => 'Mexican Peso',\n\t\t\t\t\t\t'format' => '$',\n\t\t\t\t\t),\n\t\t\t\t\t'BRL' => array(\n\t\t\t\t\t\t'label' => 'Brazilian Real',\n\t\t\t\t\t\t'format' => 'R$ ',\n\t\t\t\t\t),\n\t\t\t\t\t'MYR' => array(\n\t\t\t\t\t\t'label' => 'Malaysian Ringgit',\n\t\t\t\t\t\t'format' => 'RM ',\n\t\t\t\t\t),\n\t\t\t\t\t'PHP' => array(\n\t\t\t\t\t\t'label' => 'Philippine Peso',\n\t\t\t\t\t\t'format' => '₱ ',\n\t\t\t\t\t),\n\t\t\t\t\t'TWD' => array(\n\t\t\t\t\t\t'label' => 'New Taiwan Dollar',\n\t\t\t\t\t\t'format' => 'NT$ ',\n\t\t\t\t\t),\n\t\t\t\t\t'THB' => array(\n\t\t\t\t\t\t'label' => 'Thai Baht',\n\t\t\t\t\t\t'format' => '฿ ',\n\t\t\t\t\t),\n\t\t\t\t\t'TRY' => array(\n\t\t\t\t\t\t'label' => 'Turkish Lira',\n\t\t\t\t\t\t'format' => 'TRY ', // Unicode is ₺ but this doesn't seem to be widely supported yet (introduced Sep 2012)\n\t\t\t\t\t),\n\t\t\t\t\t'RUB' => array(\n\t\t\t\t\t\t\t'label'=>'Russian Rubel',\n\t\t\t\t\t\t\t'format'=>'руб'\n\t\t\t\t\t),\n\t\t\t);\n\t\n\t\n\t\treturn $currencies;\n\t}", "function learn_press_get_currency_symbol( $currency = '' ) {\n\tif ( ! $currency ) {\n\t\t$currency = learn_press_get_currency();\n\t}\n\t$symbols = learn_press_currency_symbols();\n\t$currency_symbol = isset( $symbols[ $currency ] ) ? $symbols[ $currency ] : '';\n\n\t$currency_symbol = apply_filters( 'learn_press_currency_symbol', $currency_symbol, $currency );\n\n\treturn apply_filters( 'learn-press/currency-symbol', $currency_symbol, $currency );\n}", "function arkcommerce_display_checkout_arkprice() \n{\n\t// Gather and/or set variables\n\tglobal $woocommerce;\n\t$arkgatewaysettings = get_option( 'woocommerce_ark_gateway_settings' );\n\t$store_currency = get_woocommerce_currency();\n\n\t// Check if ARK is already chosen as main currency and do nothing if so\n\tif( $store_currency != 'ARK' ) \n\t{\n\t\t// Gather and prepare fiat prices\n\t\t$total_float = arkcommerce_price_number_conversion( WC()->cart->get_cart_total() );\n\t\t$shipping_float = arkcommerce_price_number_conversion( WC()->cart->get_shipping_total() );\n\t\t\n\t\t// Execute conversion from fiat to ARK\n\t\t$arkprice = arkcommerce_conversion_into_ark( ( $total_float + $shipping_float ) );\n\t\t\n\t\t// Assemble the cart notice\n\t\t$arkcommercecheckoutnotice = ( '<span class=\"dashicons-before dashicons-arkcommerce\"> </span> <strong>' . __( 'Total', 'arkcommerce' ) . ': Ѧ' . $arkprice . '<br></strong><small>' . __( 'Order Expiry', 'arkcommerce' ) . ': ' . arkcommerce_get_order_timeout() . '</small>' );\n\t}\n\telse $arkcommercecheckoutnotice = ( '<span class=\"dashicons-before dashicons-arkcommerce\"> </span> <small>' . __( 'Order Expiry', 'arkcommerce' ). ': ' . arkcommerce_get_order_timeout() . '</small>' );\n\t\n\t// Output the checkout notice\n\twc_print_notice( $arkcommercecheckoutnotice, 'notice' );\n}", "public function get_currency() : string\n {\n }", "public function getCurrencySymbol(){\n\t\t$currency_code = Mage::app()->getStore()->getBaseCurrencyCode();\n\t\treturn Mage::app()->getLocale()->currency( $currency_code )->getSymbol();\n\t}", "function give_simplepay_add_nigerian_currency($currencies)\n{\n $currencies['NGN'] = __('Nigerian Naira (&#8358;)', 'give');\n return $currencies;\n}", "function arkcommerce_display_cart_arkprice() \n{\n\t// Gather and/or set variables\n\tglobal $woocommerce;\n\t$arkgatewaysettings = get_option( 'woocommerce_ark_gateway_settings' );\n\t$store_currency = get_woocommerce_currency();\n\n\t// Check if ARK is already chosen as main currency and do nothing if so\n\tif( $store_currency != 'ARK' ) \n\t{\n\t\t// Gather and prepare fiat prices\n\t\t$total_float = arkcommerce_price_number_conversion( WC()->cart->get_cart_total() );\n\t\t$shipping_float = arkcommerce_price_number_conversion( WC()->cart->get_shipping_total() );\n\t\t\n\t\t// Execute conversion from fiat to ARK\n\t\t$arkprice = arkcommerce_conversion_into_ark( ( $total_float + $shipping_float ) );\n\t\t\n\t\t// Assemble the cart notice\n\t\t$arkcommercecartnotice = ( '<span class=\"dashicons-before dashicons-arkcommerce\"> </span> <strong>' . __( 'Total', 'arkcommerce' ) . ': Ѧ' . $arkprice . '<br></strong><small>' . __( 'Order Expiry', 'arkcommerce' ) . ': ' . arkcommerce_get_order_timeout() . '</small>' );\n\t}\n\telse $arkcommercecartnotice = ( '<span class=\"dashicons-before dashicons-arkcommerce\"> </span> <small>' . __( 'Order Expiry', 'arkcommerce' ). ': ' . arkcommerce_get_order_timeout() . '</small>' );\n\t\n\t// Output the cart notice if enabled\n\tif( $arkgatewaysettings['arkdisplaycart'] == 'on' )\twc_print_notice( $arkcommercecartnotice, 'notice' );\n}", "function get_price_with_currency( array $pricing ) {\n\t\t$price = '';\n\t\tif ( isset( $pricing['currency'] ) ) {\n\t\t\t$currency_symbols = json_decode(\n\t\t\t\tfile_get_contents( IDG_TERRITORIES_DIR . '/inc/currency-symbols.json' ),\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\t$key = 'symbol_native';\n\t\t\t$currency_symbol = $currency_symbols[ $pricing['currency'] ][ $key ] ?? '';\n\t\t\t$price = $pricing['price'] ? $currency_symbol . $pricing['price'] : '';\n\t\t}\n\n\t\treturn $price;\n\t}", "function get_price_with_currency( array $pricing ) {\n\t\t$price = '';\n\t\tif ( isset( $pricing['currency'] ) ) {\n\t\t\t$currency_symbols = json_decode(\n\t\t\t\tfile_get_contents( IDG_TERRITORIES_DIR . '/inc/currency-symbols.json' ),\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\t$key = 'symbol_native';\n\t\t\t$currency_symbol = $currency_symbols[ $pricing['currency'] ][ $key ] ?? '';\n\t\t\t$price = $pricing['price'] ? $currency_symbol . $pricing['price'] : '';\n\t\t}\n\n\t\treturn $price;\n\t}", "function currency()\n {\n $school = School::setup();\n $currency = new Gerardojbaez\\Money\\Currency($school->currency);\n return $currency->getSymbol(); \n }", "function fine_get_currency_symbol($isocode) {\r\n\treturn FineCurrencyUtils::getCurrencySymbol($isocode);\r\n}", "public function GetCurrency()\n\t{\n\t\t$this->settingcurrency('ucc34433443','cf34433443', 'ccv56598954');\n\t}", "function payler_rub_currency_symbol( $currency_symbol, $currency ) {\r\n if($currency == \"RUB\") {\r\n $currency_symbol = 'р.';\r\n }\r\n return $currency_symbol;\r\n}", "public function getCurrencySymbol() { return $this->currencySymbol; }", "function paybox_currency_num( $code ) {\n $_currencies = array (\n 'AED' => '784',\n 'AFN' => '971',\n 'ALL' => '008',\n 'AMD' => '051',\n 'ANG' => '532',\n 'AOA' => '973',\n 'ARS' => '032',\n 'AUD' => '036',\n 'AWG' => '533',\n 'AZN' => '944',\n 'BAM' => '977',\n 'BBD' => '052',\n 'BDT' => '050',\n 'BGN' => '975',\n 'BHD' => '048',\n 'BIF' => '108',\n 'BMD' => '060',\n 'BND' => '096',\n 'BOB' => '068',\n 'BOV' => '984',\n 'BRL' => '986',\n 'BSD' => '044',\n 'BTN' => '064',\n 'BWP' => '072',\n 'BYR' => '974',\n 'BZD' => '084',\n 'CAD' => '124',\n 'CDF' => '976',\n 'CHE' => '947',\n 'CHF' => '756',\n 'CHW' => '948',\n 'CLF' => '990',\n 'CLP' => '152',\n 'CNY' => '156',\n 'COP' => '170',\n 'COU' => '970',\n 'CRC' => '188',\n 'CUC' => '931',\n 'CUP' => '192',\n 'CVE' => '132',\n 'CZK' => '203',\n 'DJF' => '262',\n 'DKK' => '208',\n 'DOP' => '214',\n 'DZD' => '012',\n 'EGP' => '818',\n 'ERN' => '232',\n 'ETB' => '230',\n 'EUR' => '978',\n 'FJD' => '242',\n 'FKP' => '238',\n 'GBP' => '826',\n 'GEL' => '981',\n 'GHS' => '936',\n 'GIP' => '292',\n 'GMD' => '270',\n 'GNF' => '324',\n 'GTQ' => '320',\n 'GYD' => '328',\n 'HKD' => '344',\n 'HNL' => '340',\n 'HRK' => '191',\n 'HTG' => '332',\n 'HUF' => '348',\n 'IDR' => '360',\n 'ILS' => '376',\n 'INR' => '356',\n 'IQD' => '368',\n 'IRR' => '364',\n 'ISK' => '352',\n 'JMD' => '388',\n 'JOD' => '400',\n 'JPY' => '392',\n 'KES' => '404',\n 'KGS' => '417',\n 'KHR' => '116',\n 'KMF' => '174',\n 'KPW' => '408',\n 'KRW' => '410',\n 'KWD' => '414',\n 'KYD' => '136',\n 'KZT' => '398',\n 'LAK' => '418',\n 'LBP' => '422',\n 'LKR' => '144',\n 'LRD' => '430',\n 'LSL' => '426',\n 'LTL' => '440',\n 'LYD' => '434',\n 'MAD' => '504',\n 'MDL' => '498',\n 'MGA' => '969',\n 'MKD' => '807',\n 'MMK' => '104',\n 'MNT' => '496',\n 'MOP' => '446',\n 'MRO' => '478',\n 'MUR' => '480',\n 'MVR' => '462',\n 'MWK' => '454',\n 'MXN' => '484',\n 'MXV' => '979',\n 'MYR' => '458',\n 'MZN' => '943',\n 'NAD' => '516',\n 'NGN' => '566',\n 'NIO' => '558',\n 'NOK' => '578',\n 'NPR' => '524',\n 'NZD' => '554',\n 'OMR' => '512',\n 'PAB' => '590',\n 'PEN' => '604',\n 'PGK' => '598',\n 'PHP' => '608',\n 'PKR' => '586',\n 'PLN' => '985',\n 'PYG' => '600',\n 'QAR' => '634',\n 'RON' => '946',\n 'RSD' => '941',\n 'RUB' => '643',\n 'RWF' => '646',\n 'SAR' => '682',\n 'SBD' => '090',\n 'SCR' => '690',\n 'SDG' => '938',\n 'SEK' => '752',\n 'SGD' => '702',\n 'SHP' => '654',\n 'SLL' => '694',\n 'SOS' => '706',\n 'SRD' => '968',\n 'SSP' => '728',\n 'STD' => '678',\n 'SYP' => '760',\n 'SZL' => '748',\n 'THB' => '764',\n 'TJS' => '972',\n 'TMT' => '934',\n 'TND' => '788',\n 'TOP' => '776',\n 'TRY' => '949',\n 'TTD' => '780',\n 'TWD' => '901',\n 'TZS' => '834',\n 'UAH' => '980',\n 'UGX' => '800',\n 'USD' => '840',\n 'USN' => '997',\n 'USS' => '998',\n 'UYI' => '940',\n 'UYU' => '858',\n 'UZS' => '860',\n 'VEF' => '937',\n 'VND' => '704',\n 'VUV' => '548',\n 'WST' => '882',\n 'XAF' => '950',\n 'XAG' => '961',\n 'XAU' => '959',\n 'XBA' => '955',\n 'XBB' => '956',\n 'XBC' => '957',\n 'XBD' => '958',\n 'XCD' => '951',\n 'XDR' => '960',\n 'XOF' => '952',\n 'XPD' => '964',\n 'XPF' => '953',\n 'XPT' => '962',\n 'XSU' => '994',\n 'XTS' => '963',\n 'XUA' => '965',\n 'XXX' => '999',\n 'YER' => '886',\n 'ZAR' => '710',\n 'ZMW' => '967',\n 'ZWD' => '932',\n );\n return ( !empty($_currencies[ $code ]) ? $_currencies[ $code ] : 840 );\n }", "public static function currencySymbol()\n {\n return static::randomElement(static::$currencySymbol);\n }", "public function getDefaultDisplayCurrencySymbol();", "public static function getCurrencyCode(){\r\n\t\treturn self::getQuote()->getQuoteCurrencyCode();\r\n\t}", "public function getCurrencySymbol(){\n\t\treturn $this->_data->itemAt('geoplugin_currencySymbol');\n\t}", "public function currency(): string\n {\n return Nova\\EasyLicense::currency();\n }", "public function setBaseCurrencySymbol($symbol);", "public function getCurrency() : string;", "public function getCurrencyTo();", "function mje_get_currency() {\n\t$currency = ae_get_option('currency', array(\n\t\t'align' => 'left',\n\t\t'code' => 'USD',\n\t\t'icon' => '$',\n\t));\n\n\treturn $currency;\n}", "public function getBaseCurrency(): string;", "private function addCurrency(string $code): void\n {\n $this->currencyCodes[] = $code;\n }", "function woocommerce_external_add_to_cart()\n {\n }", "function wc_2c2p_get_store_currency_code(){\r\n $objWC_2c2p_currency = new WC_2c2p_currency();\r\n $currenyCode = get_option('woocommerce_currency');\r\n\r\n if(!isset($currenyCode))\r\n return \"\";\r\n\r\n foreach ($objWC_2c2p_currency->get_currency_code() as $key => $value) {\r\n if($key === $currenyCode){\r\n return $value['Num'];\r\n }\r\n return \"\";\r\n }\r\n }", "public function getCurrency(): string;", "public function getCurrency()\n {\n }", "public function setCurrencyTo($code);", "public function getCurrency(): string {\n return $this->currency;\n }", "function wizGradeCurrency($money, $curSymbol){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t$rMoney = round($money, 2);\r\n\t\t\t\r\n\t\t\t$nMoney = number_format($rMoney,2,'.','');\r\n\t\t\t\r\n\t\t\treturn $curSymbol.$nMoney;\r\n\r\n\t\t\r\n\t\t}", "function ckt_paypal_price() {\r\n\t$price=osc_item_field(\"i_price\") ;\r\n\r\n $price = $price/1000000;\r\n $currencyFormat = osc_locale_currency_format();\r\n\t$currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat);\r\n\t$currencyFormat = str_replace('{CURRENCY}', osc_premium_currency_symbol(), $currencyFormat);\r\n\treturn osc_apply_filter('item_price', $currencyFormat );\r\n\t\r\n}", "public static function useCurrencySymbol($symbol)\n {\n static::$currencySymbol = $symbol;\n }", "public function getPaymorrowBasketCurrency()\n {\n }", "function learn_press_get_currency() {\n\t$currency = apply_filters( 'learn_press_currency', LP_Settings::instance()->get( 'currency', 'USD' ) );\n\n\treturn apply_filters( 'learn-press/currency', $currency );\n}", "public function getCurrencySymbol(){\n\t\t$currency \t= $this->input->post('currency');\n\t\t$symbol \t= $this->currency_converter->get_currency_symbol($currency);\n\t\techo $symbol;\n\t}", "public function totalWithCurrency()\n {\n if (starts_with($total = $this->total(), '-')) {\n return '-'.$this->billable->addCurrencySymbol(ltrim($total, '-'));\n } else {\n return $this->billable->addCurrencySymbol($total);\n }\n }", "public function getGiftCardCurrency();", "function cardealer_get_cars_currency_symbol(){\n global $car_dealer_options;\n $currency_symbol = '';\n if(function_exists('cdhl_get_currency_symbols')){\n $currency_code = isset($car_dealer_options['cars-currency-symbol']) ? $car_dealer_options['cars-currency-symbol'] : '';\n $currency_symbol = cdhl_get_currency_symbols($currency_code);\n } else {\n $currency_code = isset($car_dealer_options['cars-currency-symbol']) ? $car_dealer_options['cars-currency-symbol'] : '';\n $currency_symbol = $currency_code;\n }\n return $currency_symbol;\n}", "public function getBaseCurrencyCode()\n {\n return Mage::app()->getStore()->getBaseCurrencyCode();\n }", "function _get_currency_symbol( $money_symbol )\n{\n if( $money_symbol =='dollar'){\n return '$';\n } \n\n if( $money_symbol =='pound'){\n return '&pound';\n } \n\n}", "public function getCurrencySymbol($currency_code, $forceloadall = 0)\n {\n\t\t$currency_sign = '';\t// By default return iso code\n\n\t\tif (function_exists(\"mb_convert_encoding\"))\n\t\t{\n\t\t\t$this->loadCacheCurrencies($forceloadall?'':$currency_code);\n\n\t\t\tif (isset($this->cache_currencies[$currency_code]) && ! empty($this->cache_currencies[$currency_code]['unicode']) && is_array($this->cache_currencies[$currency_code]['unicode']))\n\t\t\t{\n\t\t\t\tforeach($this->cache_currencies[$currency_code]['unicode'] as $unicode)\n\t\t\t\t{\n\t\t\t\t\t$currency_sign .= mb_convert_encoding(\"&#{$unicode};\", \"UTF-8\", 'HTML-ENTITIES');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn ($currency_sign?$currency_sign:$currency_code);\n }", "public function supported_currencies()\n {\n _e('<div class=\"notice notice-error\"><p><b>WooCommerce XRP</b> does not support the <b>currency</b> your shop is using.</p></div>', 'wc-gateway-xrp');\n }", "public function getCurrency(): string\n {\n return $this->currency;\n }", "function geoplugin_currency_shortcode( $atts, $content = null ) {\r\n\t$atts = shortcode_atts(\r\n\t\t[ 'base' => 'GBP' ],\r\n\t\t$atts,\r\n\t\t'currency'\r\n\t);\r\n\r\n\t$query_args = [\r\n\t\t'base_currency' => $atts['base'],\r\n\t\t'ip' => $_SERVER['REMOTE_ADDR'],\r\n\t];\r\n\r\n\t$url = add_query_arg( $query_args, 'http://www.geoplugin.net/php.gp' );\r\n\r\n\t$geoplugin_array = unserialize( file_get_contents( $url ) );\r\n\r\n\tif (\r\n\t\tisset( $geoplugin_array['geoplugin_currencyCode'] ) &&\r\n\t\t$geoplugin_array['geoplugin_currencyCode'] !== $atts['base'] &&\r\n\t\tis_numeric( $content )\r\n\t) {\r\n\t\t$amount = round( ( $content * $geoplugin_array['geoplugin_currencyConverter'] ), 2 );\r\n\r\n\t\treturn $content . ' (~' . $geoplugin_array['geoplugin_currencySymbol'] . $amount . ')';\r\n\t}\r\n\r\n\treturn $content;\r\n}", "function paymaster_rub_currency_symbol($currency_symbol, $currency)\n\t{\n\tif ($currency == \"RUB\")\n\t\t{\n\t\t$currency_symbol = 'р.';\n\t\t}\n\n\treturn $currency_symbol;\n\t}", "public function getCurrencyCode()\n {\n return Mage::app()->getStore()->getCurrentCurrencyCode();\n }", "function hook_commerce_currency_info_alter(&$currencies, $langcode) {\n $currencies['CHF']['code_placement'] = 'after';\n}", "public function getCurrencyCode() { return $this->currencyCode; }", "function filter_woocommerce_get_price_html( $wc, $cart_item, $cart_item_key ) {\n\t$amt = (int)$cart_item['data']->subscription_price + (int)$cart_item['data']->subscription_sign_up_fee;\n return '$ '.number_format($amt, 2);\n}", "function getStoreCurrencysymbol($domain_id)\r\n {\r\n global $CFG, $objSmarty;\r\n $sel_qry = \"SELECT st.tax_rate,st.currency, cur.currency_type, cur.currency_symbol, cur.currency_image \".\r\n \" FROM \".$CFG['table']['store_details'].\" as st \".\r\n \" LEFT JOIN \".$CFG['table']['currencymanage'].\" as cur ON st.currency = cur.currency_code \".\r\n \" WHERE st.domain_id = '\".$this->filterInput($domain_id).\"'\";\r\n $res = $this->ExecuteQuery($sel_qry,'select');\r\n \r\n if($res[0]['currency_type'] == 'I'){\r\n $CFG['site']['currency_image']\t= $CFG['site']['photo_sitelogo_url'].'/'.$res['0']['currency_image']; \r\n \t\t\t$currency = '<img src=\"'.$CFG['site']['currency_image'].'\" title=\"\" alt=\"Currency\" width=\"10\" height=\"10\"/>';\r\n define(\"CURRENCY_SYMBOL\",$currency);\r\n \t\t}else{\r\n \t\t\t$currency = $res['0']['currency_symbol'];\r\n define(\"CURRENCY_SYMBOL\",$currency);\r\n \t\t}\t\r\n $currency_rate = 1.00;\r\n $objSmarty->assign(\"symbol\", CURRENCY_SYMBOL);\r\n $objSmarty->assign(\"rate\", $currency_rate);\r\n }", "public function display_currency()\n\t{\n\t\treturn $this->get_insist('brand_purchase')->display_currency();\n\t}", "public function getCurrentCurrencySymbol(): string\n {\n return $this->currency->getCurrencySymbol();\n }", "public function addCurrency(iStatementCurrency $ccy) {\r\n }", "public static function getCurrencySymbols()\n {\n $currenySymbols = array(\n 'AED', 'AFN', 'ALL',\n 'AMD', 'ANG', 'AOA',\n 'ARS', 'AUD', 'AWG',\n 'AZN', 'BAM', 'BBD',\n 'BDT', 'BGN', 'BHD',\n 'BIF', 'BMD', 'BND',\n 'BOB', 'BRL', 'BSD',\n 'BTN', 'BWP', 'BYR',\n 'BZD', 'CAD', 'CDF',\n 'CHF', 'CLP', 'CNY',\n 'COP', 'CRC', 'CUC',\n 'CUP', 'CVE', 'CZK',\n 'DJF', 'DKK', 'DOP',\n 'DZD', 'EGP', 'ERN',\n 'ETB', 'EUR', 'FJD',\n 'FKP', 'GBP', 'GEL',\n 'GGP', 'GHS', 'GIP',\n 'GMD', 'GNF', 'GTQ',\n 'GYD', 'HKD', 'HNL',\n 'HRK', 'HTG', 'HUF',\n 'IDR', 'ILS', 'IMP',\n 'INR', 'IQD', 'IRR',\n 'ISK', 'JEP', 'JMD',\n 'JOD', 'JPY', 'KES',\n 'KGS', 'KHR', 'KMF',\n 'KPW', 'KRW', 'KWD',\n 'KYD', 'KZT', 'LAK',\n 'LBP', 'LKR', 'LRD',\n 'LSL', 'LTL', 'LVL',\n 'LYD', 'MAD', 'MDL',\n 'MGA', 'MKD', 'MMK',\n 'MNT', 'MOP', 'MRO',\n 'MUR', 'MVR', 'MWK',\n 'MXN', 'MYR', 'MZN',\n 'NAD', 'NGN', 'NIO',\n 'NOK', 'NPR', 'NZD',\n 'OMR', 'PAB', 'PEN',\n 'PGK', 'PHP', 'PKR',\n 'PLN', 'PYG', 'QAR',\n 'RON', 'RSD', 'RUB',\n 'RWF', 'SAR', 'SBD',\n 'SCR', 'SDG', 'SEK',\n 'SGD', 'SHP', 'SLL',\n 'SOS', 'SPL', 'SRD',\n 'STD', 'SVC', 'SYP',\n 'SZL', 'THB', 'TJS',\n 'TMT', 'TND', 'TOP',\n 'TRY', 'TTD', 'TVD',\n 'TWD', 'TZS', 'UAH',\n 'UGX', 'USD', 'UYU',\n 'UZS', 'VEF', 'VND',\n 'VUV', 'WST', 'XAF',\n 'XCD', 'XDR', 'XOF',\n 'XPF', 'YER', 'ZAR',\n 'ZMK',\n );\n\n return $currenySymbols;\n }", "public function getCurrencyName(): string;", "function add_custom_charge($key, $price)\n\t{\n\t\t$this->_cart_contents['custom_charges'][$key] = $price;\n\t\t$this->_save_cart();\n\t}", "public function getCurrency(): string\n {\n return $this->_data->currency;\n }", "function getCurrencySymbol() {\n\treturn Cache::rememberForever('symbol', function() {\n\t return Currency::where('code', getSetting('CURRENCY'))->first()->symbol;\n\t});\n}", "public function getCurrencyCode()\n {\n return $this->currency_code;\n }", "public function preferredCurrency(): string\n {\n return Cashier::usesCurrency();\n }", "abstract function getCurrency();", "function learn_press_currencies() {\n\t$currencies = array(\n\t\t'AFN' => __( 'Afghan afghani', 'learnpress' ),\n\t\t'ALL' => __( 'Albanian lek', 'learnpress' ),\n\t\t'DZD' => __( 'Algerian dinar', 'learnpress' ),\n\t\t'EUR' => __( 'Euro', 'learnpress' ),\n\t\t'AOA' => __( 'Angolan kwanza', 'learnpress' ),\n\t\t'XCD' => __( 'East Caribbean dollar', 'learnpress' ),\n\t\t'ARS' => __( 'Argentine peso', 'learnpress' ),\n\t\t'AMD' => __( 'Armenian dram', 'learnpress' ),\n\t\t'AWG' => __( 'Aruban florin', 'learnpress' ),\n\t\t'AUD' => __( 'Australian dollar', 'learnpress' ),\n\t\t'AZN' => __( 'Azerbaijani manat', 'learnpress' ),\n\t\t'BSD' => __( 'Bahamian dollar', 'learnpress' ),\n\t\t'BHD' => __( 'Bahraini dinar', 'learnpress' ),\n\t\t'BDT' => __( 'Bangladeshi taka', 'learnpress' ),\n\t\t'BBD' => __( 'Barbadian dollar', 'learnpress' ),\n\t\t'BYR' => __( 'Belarusian ruble', 'learnpress' ),\n\t\t'BZD' => __( 'Belizean dollar', 'learnpress' ),\n\t\t'XOF' => __( 'West African CFA franc', 'learnpress' ),\n\t\t'BMD' => __( 'Bermudian dollar', 'learnpress' ),\n\t\t'BTN' => __( 'Bhutanese ngultrum', 'learnpress' ),\n\t\t'BOB' => __( 'Bolivian boliviano', 'learnpress' ),\n\t\t'USD' => __( 'US dollar', 'learnpress' ),\n\t\t'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'learnpress' ),\n\t\t'BWP' => __( 'Botswana pula', 'learnpress' ),\n\t\t'BRL' => __( 'Brazilian real', 'learnpress' ),\n\t\t'BND' => __( 'Brunei dollar', 'learnpress' ),\n\t\t'BGN' => __( 'Bulgarian lev', 'learnpress' ),\n\t\t'MMK' => __( 'Burmese kyat', 'learnpress' ),\n\t\t'BIF' => __( 'Burundian franc', 'learnpress' ),\n\t\t'KHR' => __( 'Cambodian riel', 'learnpress' ),\n\t\t'XAF' => __( 'Central African CFA franc', 'learnpress' ),\n\t\t'CAD' => __( 'Canadian dollar', 'learnpress' ),\n\t\t'CVE' => __( 'Cape Verdean escudo', 'learnpress' ),\n\t\t'KYD' => __( 'Cayman Islands dollar', 'learnpress' ),\n\t\t'CLP' => __( 'Chilean peso', 'learnpress' ),\n\t\t'CNY' => __( 'Chinese renminbi', 'learnpress' ),\n\t\t'COP' => __( 'Colombian peso', 'learnpress' ),\n\t\t'KMF' => __( 'Comorian franc', 'learnpress' ),\n\t\t'CDF' => __( 'Congolese franc', 'learnpress' ),\n\t\t'NZD' => __( 'New Zealand dollar', 'learnpress' ),\n\t\t'CRC' => __( 'Costa Rican colón', 'learnpress' ),\n\t\t'HRK' => __( 'Croatian kuna', 'learnpress' ),\n\t\t'CUC' => __( 'Cuban peso', 'learnpress' ),\n\t\t'ANG' => __( 'Netherlands Antilles guilder', 'learnpress' ),\n\t\t'CZK' => __( 'Czech koruna', 'learnpress' ),\n\t\t'DKK' => __( 'Danish krone', 'learnpress' ),\n\t\t'DJF' => __( 'Djiboutian franc', 'learnpress' ),\n\t\t'DOP' => __( 'Dominican peso', 'learnpress' ),\n\t\t'EGP' => __( 'Egyptian pound', 'learnpress' ),\n\t\t'SVC' => __( 'Salvadoran colón', 'learnpress' ),\n\t\t'ERN' => __( 'Eritrean nakfa', 'learnpress' ),\n\t\t'ETB' => __( 'Ethiopian birr', 'learnpress' ),\n\t\t'FKP' => __( 'Falkland Islands pound', 'learnpress' ),\n\t\t'FJD' => __( 'Fijian dollar', 'learnpress' ),\n\t\t'XPF' => __( 'CFP franc', 'learnpress' ),\n\t\t'GMD' => __( 'Gambian dalasi', 'learnpress' ),\n\t\t'GEL' => __( 'Georgian lari', 'learnpress' ),\n\t\t'GHS' => __( 'Ghanian cedi', 'learnpress' ),\n\t\t'GIP' => __( 'Gibraltar pound', 'learnpress' ),\n\t\t'GTQ' => __( 'Guatemalan quetzal', 'learnpress' ),\n\t\t'GBP' => __( 'British pound', 'learnpress' ),\n\t\t'GNF' => __( 'Guinean franc', 'learnpress' ),\n\t\t'GYD' => __( 'Guyanese dollar', 'learnpress' ),\n\t\t'HTG' => __( 'Haitian gourde', 'learnpress' ),\n\t\t'HNL' => __( 'Honduran lempira', 'learnpress' ),\n\t\t'HKD' => __( 'Hong Kong dollar', 'learnpress' ),\n\t\t'HUF' => __( 'Hungarian forint', 'learnpress' ),\n\t\t'ISK' => __( 'Icelandic króna', 'learnpress' ),\n\t\t'INR' => __( 'Indian rupee', 'learnpress' ),\n\t\t'IDR' => __( 'Indonesian rupiah', 'learnpress' ),\n\t\t'IRR' => __( 'Iranian rial', 'learnpress' ),\n\t\t'IQD' => __( 'Iraqi dinar', 'learnpress' ),\n\t\t'ILS' => __( 'Israeli new sheqel', 'learnpress' ),\n\t\t'JMD' => __( 'Jamaican dollar', 'learnpress' ),\n\t\t'JPY' => __( 'Japanese yen ', 'learnpress' ),\n\t\t'JOD' => __( 'Jordanian dinar', 'learnpress' ),\n\t\t'KZT' => __( 'Kazakhstani tenge', 'learnpress' ),\n\t\t'KES' => __( 'Kenyan shilling', 'learnpress' ),\n\t\t'KPW' => __( 'North Korean won', 'learnpress' ),\n\t\t'KWD' => __( 'Kuwaiti dinar', 'learnpress' ),\n\t\t'KGS' => __( 'Kyrgyzstani som', 'learnpress' ),\n\t\t'KRW' => __( 'South Korean won', 'learnpress' ),\n\t\t'LAK' => __( 'Lao kip', 'learnpress' ),\n\t\t'LVL' => __( 'Latvian lats', 'learnpress' ),\n\t\t'LBP' => __( 'Lebanese pound', 'learnpress' ),\n\t\t'LSL' => __( 'Lesotho loti', 'learnpress' ),\n\t\t'LRD' => __( 'Liberian dollar', 'learnpress' ),\n\t\t'LD' => __( 'Libyan dinar', 'learnpress' ),\n\t\t'CHF' => __( 'Swiss franc', 'learnpress' ),\n\t\t'LTL' => __( 'Lithuanian litas', 'learnpress' ),\n\t\t'MOP' => __( 'Macanese pataca', 'learnpress' ),\n\t\t'MKD' => __( 'Macedonian denar', 'learnpress' ),\n\t\t'MGA' => __( 'Malagasy ariary', 'learnpress' ),\n\t\t'MWK' => __( 'Malawian kwacha', 'learnpress' ),\n\t\t'MYR' => __( 'Malaysian ringgit', 'learnpress' ),\n\t\t'MVR' => __( 'Maldivian rufiyaa', 'learnpress' ),\n\t\t'MRO' => __( 'Mauritanian ouguiya', 'learnpress' ),\n\t\t'MUR' => __( 'Mauritian rupee', 'learnpress' ),\n\t\t'MXN' => __( 'Mexican peso', 'learnpress' ),\n\t\t'MDL' => __( 'Moldovan leu', 'learnpress' ),\n\t\t'MNT' => __( 'Mongolian tugrik', 'learnpress' ),\n\t\t'MAD' => __( 'Moroccan dirham', 'learnpress' ),\n\t\t'MZN' => __( 'Mozambican metical', 'learnpress' ),\n\t\t'NAD' => __( 'Namibian dollar', 'learnpress' ),\n\t\t'NPR' => __( 'Nepalese rupee', 'learnpress' ),\n\t\t'NIO' => __( 'Nicaraguan córdoba', 'learnpress' ),\n\t\t'NGN' => __( 'Nigerian naira', 'learnpress' ),\n\t\t'NOK' => __( 'Norwegian krone', 'learnpress' ),\n\t\t'OMR' => __( 'Omani rial', 'learnpress' ),\n\t\t'PKR' => __( 'Pakistani rupee', 'learnpress' ),\n\t\t'PAB' => __( 'Panamanian balboa', 'learnpress' ),\n\t\t'PGK' => __( 'Papua New Guinea kina', 'learnpress' ),\n\t\t'PYG' => __( 'Paraguayan guarani', 'learnpress' ),\n\t\t'PEN' => __( 'Peruvian nuevo sol', 'learnpress' ),\n\t\t'PHP' => __( 'Philippine peso', 'learnpress' ),\n\t\t'PLN' => __( 'Polish zloty', 'learnpress' ),\n\t\t'QAR' => __( 'Qatari riyal', 'learnpress' ),\n\t\t'RON' => __( 'Romanian leu', 'learnpress' ),\n\t\t'RUB' => __( 'Russian ruble', 'learnpress' ),\n\t\t'RWF' => __( 'Rwandan franc', 'learnpress' ),\n\t\t'WST' => __( 'Samoan tālā', 'learnpress' ),\n\t\t'STD' => __( 'São Tomé and Príncipe dobra', 'learnpress' ),\n\t\t'SAR' => __( 'Saudi riyal', 'learnpress' ),\n\t\t'RSD' => __( 'Serbian dinar', 'learnpress' ),\n\t\t'SCR' => __( 'Seychellois rupee', 'learnpress' ),\n\t\t'SLL' => __( 'Sierra Leonean leone', 'learnpress' ),\n\t\t'SGD' => __( 'Singapore dollar', 'learnpress' ),\n\t\t'SBD' => __( 'Solomon Islands dollar', 'learnpress' ),\n\t\t'SOS' => __( 'Somali shilling', 'learnpress' ),\n\t\t'ZAR' => __( 'South African rand', 'learnpress' ),\n\t\t'LKR' => __( 'Sri Lankan rupee', 'learnpress' ),\n\t\t'SHP' => __( 'St. Helena pound', 'learnpress' ),\n\t\t'SDG' => __( 'Sudanese pound', 'learnpress' ),\n\t\t'SRD' => __( 'Surinamese dollar', 'learnpress' ),\n\t\t'SZL' => __( 'Swazi lilangeni', 'learnpress' ),\n\t\t'SEK' => __( 'Swedish krona', 'learnpress' ),\n\t\t'SYP' => __( 'Syrian pound', 'learnpress' ),\n\t\t'TWD' => __( 'New Taiwan dollar', 'learnpress' ),\n\t\t'TJS' => __( 'Tajikistani somoni', 'learnpress' ),\n\t\t'TZS' => __( 'Tanzanian shilling', 'learnpress' ),\n\t\t'THB' => __( 'Thai baht ', 'learnpress' ),\n\t\t'TOP' => __( 'Tongan pa’anga', 'learnpress' ),\n\t\t'TTD' => __( 'Trinidad and Tobago dollar', 'learnpress' ),\n\t\t'TND' => __( 'Tunisian dinar', 'learnpress' ),\n\t\t'TRY' => __( 'Turkish lira', 'learnpress' ),\n\t\t'TMT' => __( 'Turkmenistani manat', 'learnpress' ),\n\t\t'UGX' => __( 'Ugandan shilling', 'learnpress' ),\n\t\t'UAH' => __( 'Ukrainian hryvnia', 'learnpress' ),\n\t\t'AED' => __( 'United Arab Emirates dirham', 'learnpress' ),\n\t\t'UYU' => __( 'Uruguayan peso', 'learnpress' ),\n\t\t'UZS' => __( 'Uzbekistani som', 'learnpress' ),\n\t\t'VUV' => __( 'Vanuatu vatu', 'learnpress' ),\n\t\t'VEF' => __( 'Venezuelan bolivar', 'learnpress' ),\n\t\t'VND' => __( 'Vietnamese dong', 'learnpress' ),\n\t\t'YER' => __( 'Yemeni rial', 'learnpress' ),\n\t\t'ZMK' => __( 'Zambian kwacha', 'learnpress' ),\n\t\t'ZWL' => __( 'Zimbabwean dollar', 'learnpress' ),\n\t\t'JEP' => __( 'Jersey pound', 'learnpress' ),\n\t\t'LYD' => __( 'Libyan dinar', 'learnpress' ),\n\t);\n\n\tasort( $currencies );\n\n\treturn apply_filters( 'learn-press/currencies', $currencies );\n}", "public function getDefaultDisplayCurrencyCode();", "public function getDefaultDisplayCurrencyCode();", "public function getCurrency(): string\n {\n\n return $this->currency;\n }", "function format_currency($price,$decimal_places = null) {\n $code = Currency::find( Settings::get('payment_currency') );\n\n // get the format base on that currency\n if (!is_numeric($price)){\n return $price;\n }\n\n if (!is_null($decimal_places)) {\n $code->decimal_places = $decimal_places;\n }\n\n $formatted_price =number_format( $price , $code->decimal_places , $code->decimal_point, $code->thousands_point );\n\n return $code->symbol_left . \" \" . $formatted_price . \" \" . $code->symbol_right;\n\n}", "public function getPricingCurrencyCode()\n {\n return $this->pricingCurrencyCode;\n }", "public function getCurrency(): string {\n return $this->currency;\n }", "public function getCurrency();", "public function getCurrency();", "public function getCurrency();" ]
[ "0.6947566", "0.67014855", "0.6609597", "0.649299", "0.6376773", "0.62846726", "0.6224289", "0.6212388", "0.6179096", "0.61576366", "0.61462945", "0.6107476", "0.6099074", "0.6011647", "0.5967635", "0.59335446", "0.59335446", "0.59335446", "0.59335446", "0.59278864", "0.58551764", "0.58264345", "0.58013046", "0.5800816", "0.57934946", "0.57934946", "0.577975", "0.576267", "0.5756662", "0.57501584", "0.57353675", "0.57271373", "0.5721694", "0.5714031", "0.5714031", "0.5711914", "0.57092386", "0.56977093", "0.5676715", "0.56680375", "0.56373113", "0.56242454", "0.5622435", "0.56215006", "0.56195915", "0.5610947", "0.55882263", "0.55726695", "0.55601573", "0.5558627", "0.55551714", "0.5555042", "0.5553945", "0.55533427", "0.55295223", "0.55288476", "0.55214596", "0.55179256", "0.551273", "0.55103236", "0.55052245", "0.55036896", "0.54938567", "0.5480241", "0.5464658", "0.5450289", "0.5430453", "0.5428912", "0.54221886", "0.54187065", "0.54174584", "0.5416232", "0.5414395", "0.54107267", "0.540989", "0.5405734", "0.5374355", "0.53730726", "0.5364918", "0.536092", "0.53606373", "0.535882", "0.5356765", "0.53535354", "0.53511226", "0.534894", "0.53404206", "0.5333521", "0.5333253", "0.5328631", "0.5328086", "0.53210884", "0.53210884", "0.53185874", "0.53178227", "0.5301958", "0.5301088", "0.5300437", "0.5300437", "0.5300437" ]
0.7264929
0
//////////////////////////////////////////////////////////////////////////////////////// ARKCommerce Dual Price Display//
//////////////////////////////////////////////////////////////////////////////////////// Двойное отображение цен ARKCommerce//
function arkcommerce_dual_price_display( $price ) { // Gather and/or set variables $arkgatewaysettings = get_option( 'woocommerce_ark_gateway_settings' ); $store_currency = get_woocommerce_currency(); // Show ARK price if default store currency other than ARK is chosen and dual price display is switched on if( $store_currency != 'ARK' && $arkgatewaysettings['arkdualprice'] == 'on' ) { // Clean up price string and convert to float $float_price = arkcommerce_price_number_conversion( $price ); if( is_array( $float_price ) ) { // Variable price detected if( substr_count( $price, "&ndash" ) > 0 ) { $arkprice = ( '<br>Ѧ' . arkcommerce_conversion_into_ark ( $float_price[0] ) . ' –' ); $arkprice .= ( '<br>Ѧ' . arkcommerce_conversion_into_ark ( $float_price[1] ) ); $price .= $arkprice; return $price; } // Sale price detected else { $arkprice = ( '<br><del>Ѧ' . arkcommerce_conversion_into_ark ( $float_price[0] ) . '</del>' ); $arkprice .= ( '<br>Ѧ' . arkcommerce_conversion_into_ark ( $float_price[1] ) ); $price .= $arkprice; return $price; } } // Regular price detected else { $arkprice = ( '<br>Ѧ' . arkcommerce_conversion_into_ark ( $float_price ) ); $price .= $arkprice; return $price; } } // Price already in ARK else return $price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function displayBothPrices()\n {\n return $this->itemPriceRenderer->displayBothPrices();\n }", "public function displayBoth ()\n\t{\n\t\treturn Mage::helper( \"tax\" )->displayCartBothPrices();\n\t}", "public function display_prices_including_tax()\n {\n }", "function aa_display_program_prices( $single_price, $double_price ) {\n\t// Format the prices for consistency\n\t$single_price = aa_format_program_price( $single_price );\n\t$double_price = aa_format_program_price( $double_price );\n\t\n\t?>\n\t<p class=\"program-prices\">\n\t\t<?php\n\t\tif ( $single_price ) echo 'Single: $', esc_html($single_price);\n\t\tif ( $single_price && $double_price ) echo '<br>';\n\t\tif ( $double_price ) echo 'Double: $', esc_html($double_price);\n\t\t?>\n\t</p>\n\t<?php\n}", "public function catalog_actual_product_price(){\n\t}", "public function getPrice(){\n \techo $this->price.\"<br>\" ;\n }", "public function getFormattedPrice();", "public function displayUnitPrice();", "function getPriceStringShort($price_selection='') {\n // A selection of 'r' returns the formated regular price only\n // A selection of 's' returns the formated special price only, or null\n global $currencies;\n\n if (strtolower($price_selection) == 'r') {\n if ($this->hasCustomersGroupPrice == 'true') {\n $lc_text = $currencies->display_price($this->customers_group_thePrice, tep_get_tax_rate($this->taxClass));\n } else {\n $lc_text = $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass));\n }\n } elseif (strtolower($price_selection) == 's') {\n if ($this->hasSpecialPrice == true) {\n $lc_text = $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass));\n } else {\n $lc_text = '';\n }\n } else {\n if ($this->hasSpecialPrice == true) {\n if ($this->hasCustomersGroupPrice == 'true' && $this->specialPrice > $this->customers_group_thePrice) {\n $lc_text = '&nbsp;<s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s>&nbsp;&nbsp;<span class=\"productSpecialPrice\">' . $currencies->display_price($this->customers_group_thePrice, tep_get_tax_rate($this->taxClass)) . '</span>&nbsp;';\n } else {\n $lc_text = '&nbsp;<s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s>&nbsp;&nbsp;<span class=\"productSpecialPrice\">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span>&nbsp;';\n }\n } else {\n if ($this->hasQuantityPrice == true) {\n if ($this->hasCustomersGroupPrice == 'true') {\n if ($this->customers_group_lowPrice != $this->customers_group_hiPrice && $this->customers_group_lowPrice != 0) {\n $lc_text = '&nbsp;' . $currencies->display_price($this->customers_group_lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->customers_group_hiPrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n } else {\n $lc_text = '&nbsp;' . $currencies->display_price($this->customers_group_lowPrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n }\n } else {\n if ($this->lowPrice != $this->hiPrice && $this->lowPrice != 0) {\n $lc_text = '&nbsp;' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - '. $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n } else {\n $lc_text = '&nbsp;' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n }\n }\n } else {\n if ($this->hasCustomersGroupPrice == 'true') {\n $lc_text = '&nbsp;' . $currencies->display_price($this->customers_group_thePrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n } else {\n $lc_text = '&nbsp;' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '&nbsp;';\n }\n }\n }\n }\n // hide prices\n if (defined('HIDE_PRICES') && HIDE_PRICES == 'true' && !isset($_SESSION['customer_id'])) $lc_text = HIDE_PRICES_TEXT_LOGIN;\n return $lc_text;\n }", "function getPrice()\n {\n }", "function yith_change_product_price_display($price_html, $product, $price){\n\t\treturn $price;\n\t}", "function view_price($hotel_id){\r\n $price = getValue(\"SELECT hotel_lowest_price FROM tbl_hotels WHERE hotel_id = \" . $hotel_id);\r\n echo '\r\n <div class=\"hotel_price\"><span>';\r\n if($price != \"\" && $price != \"0\") echo ' From <span>' . $price . '</span> USD';\r\n echo '</span><span style=\"display:inline;font-size:10px;\"><a href=\"#\" id=\"edit_price\" class=\"edit hide\"><span>[Change Price]</span></a></span>\r\n </div>\r\n ';\r\n }", "function getPriceCalculator() ;", "public function getDisplayPriceAttribute();", "function wc_get_price_to_display($product, $args = array())\n {\n }", "function getPrice();", "public function get_display_price($price = '', $qty = 1)\n {\n }", "public function price();", "function woocommerce_template_single_price()\n {\n }", "public function showPrice() {\n return money_format('$%i', $this->price / 100); // This should work but since I have Windows, this function (money_format) is not available.\n }", "public function bdt_shortcode_vehicleprice()\n {\n if(!isset($this->currentVehicle) || $this->currentVehicle === null)\n {\n return __('Vehicle not found', 'biltorvet-dealer-tools');\n }\n $showPrice = '';\n // @TODO: refactor\n $priceController = new PriceController(VehicleFactory::create(json_decode(json_encode($this->currentVehicle), true)));\n $i = 0;\n foreach ($priceController->getDetailsPrioritizedPrices() as $price) {\n if ($i === 0) {\n $showPrice = '<span class=\"bdt_price_mainLabel\">' . $price['label'] . '</span>';\n $showPrice .= '<br/><big class=\"bdt_price_big\">' . $price['price'] . '</big>';\n } else {\n if(preg_match(\"/{$price['label']}/i\", \"Kontantpris\"))\n {\n $showPrice .= '<br/><span class=\"bdt_price_small\">' . $price['label'] . ': ' . $price['price'] . '<br/>' . '('. __('Incl. delivery costs', 'biltorvet-dealer-tools') . ')' . '</span>';\n }\n else\n {\n $showPrice .= '<br/><span class=\"bdt_price_small\">' . $price['label'] . ': ' . $price['price'] . '</span>';\n }\n }\n $i++;\n }\n\n return '<span class=\"bdt_price_container\">'. $showPrice .'</span>';\n }", "abstract public function getPrice();", "abstract public function getPrice();", "protected function get_filtered_price()\n {\n }", "public function createDisplayPrice()\n {\n if($this->title == null)\n return null;\n// $output = \"\\t<div class='col-md-3'>\\n\";\n $output = \"\\t\\t<p><strong>Price:</strong> £$this->price</p>\\n\";\n// $output = $output . \"\\t</div>\\n\";\n return $output;\n }", "public function getExtendedPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function displayPriceWithWeeeDetails()\n {\n return $this->itemPriceRenderer->displayPriceWithWeeeDetails();\n }", "public static function render_banner_meta_price() {\n\t\t$price = Inventor_Price::get_price();\n\n\t\tif ( ! empty( $price ) ) {\n\t\t\t$reduced = get_post_meta( get_the_ID(), INVENTOR_LISTING_PREFIX . 'reduced', true );\n\t\t\t$class = ! empty( $reduced ) ? 'reduced-price' : '';\n\n\t\t\techo '<div class=\"detail-banner-meta-info ' . $class . '\">';\n\t\t\t\techo '<i class=\"fa fa-fw fa-money\"></i>' . ( esc_attr( ! empty( $reduced ) ) ? esc_attr__( 'Reduced Price', 'superlist' ) . ': ' : '' );\n\t\t\t\techo esc_attr( $price );\n\t\t\t\tdo_action( 'inventor_after_listing_price', get_the_ID() );\n\t\t\techo '</div>';\n\t\t}\n\t}", "public function getShowPriceWithTax();", "public function getPrice(){\n }", "public function CalculatedPrice();", "function ckt_paypal_price() {\r\n\t$price=osc_item_field(\"i_price\") ;\r\n\r\n $price = $price/1000000;\r\n $currencyFormat = osc_locale_currency_format();\r\n\t$currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat);\r\n\t$currencyFormat = str_replace('{CURRENCY}', osc_premium_currency_symbol(), $currencyFormat);\r\n\treturn osc_apply_filter('item_price', $currencyFormat );\r\n\t\r\n}", "function woocommerce_template_loop_price()\n {\n }", "public function getCalcPrice();", "public function getPriceFormat();", "public function Price_View(){\n\t\tglobal $post, $woocommerce, $product, $wpdb;\n if(is_user_logged_in()){\n $product_id = $post->ID;\n $sku = strtoupper(get_meta($product_id, \"sku\"));\n $discount1 = get_option(\"_bulkdiscount_discount_1\");\n $discount2 = get_option(\"_bulkdiscount_discount_2\");\n $discount3 = get_option(\"_bulkdiscount_discount_3\");\n $variations = $wpdb->get_results( 'SELECT post_id,meta_value FROM '.$wpdb->prefix.'postmeta where UPPER(meta_value) LIKE \"'.$sku.'%\" AND meta_key=\"attribute_pa_style\" ORDER BY meta_value ASC;' );\n $PricesArr = array();\n foreach ( $variations as $variation )\n {\t\n $price = get_meta($variation->post_id, \"regular_price\");\n if ($price > 0 && $price != 123456789){\n $PricesArr[] = $price;\n }\n }\n $PricesArr = array_unique($PricesArr);\n asort($PricesArr);\n $regsize=1;\n ?>\n <div class=\"priceBox\">\n <h2>Pricing</h2>\n <?php foreach($PricesArr as $price): ?>\n <?php if ($regsize > 1): ?>\n <h3>Big/Tall</h3>\n <?php endif; ?>\n <div class=\"priceTier\">1-6: </div>\n <span>$<?php echo number_format($price * (1 - $discount1/100),2,'.',','); ?></span>\n <div class=\"priceTier\">7-47: </div>\n <span>$<?php echo number_format($price * (1 - $discount2/100),2,'.',','); ?></span>\n <div class=\"priceTier\">48+: </div>\n <span>$<?php echo number_format($price * (1 - $discount3/100),2,'.',','); ?></span>\n <div class=\"clear\"></div>\n <?php $regsize++; ?>\n <?php endforeach; ?>\n </div>\n\t\t<?php\n }\n\t}", "function wedding_item_price_html($item_price,$item_maxprice,$currency_code)\n{\n\tif($item_maxprice)\n\t{\n\t\t$item_price_value = $currency_code.' '.$item_price.' - '.$currency_code.' '.$item_maxprice;\n\t}\n\telse{\n\t\t$item_price_value = $currency_code.' '.$item_price;\n\t}\n\t\n\tif($item_price)\n\t{\n\t\t$item_price_html = '<div class=\"vendor-price\"><div class=\"price\">' . esc_html($item_price_value).'</div></div>'; \n\t}\n\telse\n\t{\n\t\t$item_price_html = '';\n\t}\n\treturn $item_price_html;\n}", "protected function getPriceRender()\n {\n return $this->getLayout()->getBlock('product.price.render.default')\n ->setData('is_product_list', true);\n }", "public function get_price($context = 'view')\n {\n }", "public function displayFinalPrice()\n {\n return $this->itemPriceRenderer->displayFinalPrice();\n }", "public function getDisplayPriceAttribute()\n {\n return Shop::format($this->attributes['price']);\n }", "public function getPrice()\n {\n }", "function theme_chargify_product_price($product) {\n if (is_object($product)) {\n $default = '<span class=\"price\"><span class=\"denom\">@denom</span>@price</span> <span class=\"divider\">every</span>';\n $singular = $default .' <span class=\"interval\">@interval-unit</span>';\n $plural = $default .' <span class=\"interval\">@interval-num @interval-units</span>';\n\n $args = array(\n '@denom' => '$',\n '@price' => $product->getPriceInDollars(),\n '@interval-num' => $product->getInterval(),\n '@interval-unit' => $product->getIntervalUnit(),\n );\n\n $text = format_plural($product->getInterval(), $singular, $plural, $args);\n\n return \"<div class='chargify-product-price'>$text</div>\";\n }\n}", "function getPriceObj(){\n \t\treturn $this->price;\n \t\n }", "public function formatPrice(){\n return number_format($this->price -($this->price*$this->discount/100), 2 ,',', '.').' RSD';\n }", "public function get_price_html($price = '')\n {\n }", "public function get_price_html($price = '')\n {\n }", "function formatProductCatalogPrice($product, array $options = array())\n{\n if(strtoupper(getVisitorCountryCode()) == 'AU') {\n $displayFormat = getConfig('taxDefaultTaxDisplayCatalog');\n $options['displayInclusive'] = $displayFormat;\n \n if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {\n return formatProductPrice($product, $product['prodcalculatedprice'], $options);\n }\n\n $options['displayInclusive'] = TAX_PRICES_DISPLAY_INCLUSIVE;\n $priceIncTax = formatProductPrice($product, $product['prodcalculatedprice'], $options);\n\n $output = '<span class=\"CatalogPriceIncTax\">';\n $output .= $priceIncTax;\n $output .= '</span> ';\n } else {\n\t $displayFormat = getConfig('taxDefaultTaxDisplayCatalog');\n\t $options['displayInclusive'] = $displayFormat;\n\n\t if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {\n\t\t return formatProductPrice($product, $product['prodcalculatedprice'], $options);\n\t }\n\n\t $options['displayInclusive'] = TAX_PRICES_DISPLAY_INCLUSIVE;\n\t $priceIncTax = formatProductPrice($product, $product['prodcalculatedprice'], $options);\n\n\t $options['displayInclusive'] = TAX_PRICES_DISPLAY_EXCLUSIVE;\n\t $priceExTax = formatProductPrice($product, $product['prodcalculatedprice'], $options);\n\n\t $output = '<span class=\"CatalogPriceIncTax\">';\n\t $output .= $priceIncTax;\n\t $output .= getLang('CatalogPriceIncTaxLabel', array(\n\t\t 'label' => getConfig('taxLabel')\n\t ));\n\t $output .= '</span> ';\n\t /*$output .= '<span class=\"CatalogPriceExTax\">';\n\t $output .= $priceExTax;\n\t $output .= getLang('CatalogPriceExTaxLabel', array(\n\t\t 'label' => getConfig('taxLabel')\n\t ));\n\t $output .= '</span>';*/\n }\n\n\treturn $output;\n}", "function showPricePerPiece(){\n\t\treturn false; // @TODO: should be from config\n\t}", "public function get_variation_prices($for_display = \\false)\n {\n }", "function cardealer_get_car_price($class='', $id= null){\n global $car_dealer_options,$post;\n $currency_code = isset($car_dealer_options['cars-currency-symbol']) ? $car_dealer_options['cars-currency-symbol'] : '';\n $currency_symbol = cdhl_get_currency_symbols($currency_code);\n $price_html = '<div class=\"price car-price '.$class.'\">';\n $regular_price=0;$sale_price=0;\n\t\t$carId = (isset($id) && $id != null)? $id : $post->ID;\n $regular_price = get_post_meta($carId, 'regular_price', $single = true);\n $regular_price = (int)$regular_price;\n\n $sale_price = get_post_meta($carId, 'sale_price', $single = true);\n\t\t$sale_price = (int)$sale_price;\n if($regular_price > 0 && $sale_price > 0){\n $price_html .= '<span class=\"old-price\"> '.esc_html($currency_symbol.$regular_price).'</span>';\n $price_html .= '<span class=\"new-price\"> '.esc_html($currency_symbol.$sale_price).'</span>';\n } elseif($regular_price == 0 || empty($regular_price) && $sale_price > 0) {\n $price_html .= '<span class=\"new-price\"> '.esc_html($currency_symbol.$sale_price).'</span>';\n } elseif($sale_price == 0 || empty($sale_price) && $regular_price > 0) {\n $price_html .= '<span class=\"new-price\"> '.esc_html($currency_symbol.$regular_price).'</span>';\n } else {\n $price_html .= '<span class=\"new-price\"> '.esc_html($currency_symbol).'0.00</span>';\n }\n $price_html .= '</div>';\n return $price_html;\n}", "function getUnitPrice();", "public function prod_price_box() {\n global $post, $p_price;\t\n\t\t$p_price = get_post_meta( $post->ID, 'p_price', true ); ?>\n\t\n\t\t<p><label for=\"p_price\"><strong>Price $:</strong> <input id=\"p_price\" size=\"20\" name=\"p_price\" value=\"<?php echo $p_price; ?>\" /></label></p>\t\n\t\t\n\t<?php }", "function getExtrasPrice(): float;", "public function get_sale_price($context = 'view')\n {\n }", "public function getTotalPriceForDisplay() {\r\n return Vushop_Utils::formatPrice($this->getTotalPrice());\r\n }", "public function price()\n {\n return $this->price_dollars;\n }", "public function price()\n {\n return $this->price_dollars;\n }", "function item_price($id) {\n return $this->get_item($id,'price');\n }", "public function get_regular_price($context = 'view')\n {\n }", "function get_price_content($price_id=null) {\n\t$price_data = array();\n\t$page_title = \"Add New Price\";\n\tif ($price_id){\n\t\t$page_title = \"Price List\";\n\t\t$price_data = get_price_row_data($price_id);\n\t}\n\t$product_prices = get_product_prices($price_id);\n\n\t// Price Rule Checked\n\t$price_rule_checked = array();\n\tif ($price_data[0]->price_rule == 1 ) {\n\t\t$price_rule_checked[0] = \"checked\";\n\t} else {\n\t\t$price_rule_checked[1] = \"checked\";\n\t}\n\t// Select Rule Selected\n\t$select_rule_checked = array();\n\tif ($price_data[0]->select_rule == 1 ) {\n\t\t$select_rule_checked[0] = \"selected\";\n\t} else {\n\t\t$select_rule_checked[1] = \"selected\";\n\t}\n\n\tif (!$price_id) {\n\t\t$price_rule_checked = array(\"checked\",\"\");\n\t\t$select_rule_checked[0] = \"selected\";\n\t\t$select_rule_checked[1] = \"\";\n\t}\n\t\n\t// Number Round Checked\n\t$number_round_checked = $price_data[0]->number_round == 1 ? \"checked\" : \"\";\n\n\t$args = array(\n\t 'post_type' => 'product',\n\t 'posts_per_page' => -1,\n\t 'orderby' => array('date'=>'DESC','title'=>'ASC')\n\t);\n\t$post_data = get_posts( $args );\n\t$product_content .= '\n\t\t<table class=\"widefat striped product-table\">\n\t\t <thead>\n\t\t \t<tr>\n\t\t \t <td>SKU</td>\n\t\t \t <td>Product Name</td>\n\t\t \t <td>Categories</td>\n\t\t \t <td>Stock Status</td>\n\t\t \t <td>Regular Price</td>\n\t\t \t <td>New Price</td>\n\t\t \t</tr>\n\t\t </thead>\n\t\t <tbody>\n\t';\n\tif (sizeof($post_data)>0) {\n\t\tforeach ($post_data as $post) {\n\t\t\t$product = wc_get_product($post->ID);\n\t\t\t$product_row = $product->data;\n\t\t\t$in_stock = $product->is_in_stock() ? 'In Stock' : '';\n\t\t\t$product_content .= '\n\t\t\t\t<tr>\n\t\t\t\t <td>'.$product->get_sku().'</td>\n\t\t\t\t <td>'.$post->post_title.'</td>\n\t\t\t\t <td>'.$product->get_categories( ', ', _n( '', 'Category:', sizeof( get_the_terms( $post->ID, 'product_cat' ) ), 'woocommerce' ) . ' ', '' ).'</td>\n\t\t\t\t <td>'.$in_stock.'</td>\n\t\t\t\t <td>'.$product->get_regular_price().'</td>\n\t\t\t\t <td style=\"padding-bottom: 0px;\"><input type=\"text\" name=\"post_'.$post->ID.'\" id=\"post_'.$post->ID.'\" style=\"width:70px;\" value=\"'.$product_prices[$post->ID].'\"></td>\n\t\t\t\t</tr>\n\t\t\t';\n\t\t}\n\t}else {\n\t\t$product_content .= '<tr style=\"text-align:center;\"><td colspan=\"6\">No Results</td></tr>';\n\t}\n\t$product_content .= '</tbody></table>';\n\n\t$content .= '\n\t\t<div style=\"height:65px;\">\n\t\t\t<div style=\"float:left;\">\n\t\t\t\t<h1>'.$page_title.'</h1>\n\t\t\t</div>\n\t\t</div>\n\t\t<div>\n\t\t <form method=\"post\" id=\"customer_content_data\" action=\"\" enctype=\"multipart/form-data\">\n\t\t\t<table class=\"price-table\">\n\t\t\t <tr>\n\t\t\t \t<td>\n\t\t\t \t\t<span class=\"td-text\">Name</span>\n\t\t\t \t</td>\n\t\t\t \t<td>\n\t\t\t \t\t<input type=\"text\" name=\"price_name\" id=\"price_name\" value=\"'.$price_data[0]->price_name.'\">\n\t\t\t \t</td>\t\t\t \t\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t \t<td style=\"padding-bottom:50px;\">\n\t\t\t \t <span class=\"td-text\">Price Rule</span>\n\t\t\t \t</td>\n\t\t\t \t<td>\n\t\t\t \t <input type=\"radio\" name=\"price_rule\" class=\"price-rule\" value=\"1\" '.$price_rule_checked[0].'> Markup OR Markdown the item rates by an percentage.<br><br>\n\t\t\t \t <input type=\"radio\" name=\"price_rule\" class=\"price-rule\" value=\"0\" '.$price_rule_checked[1].'> Enter a price manually for each item\n\t\t\t \t</td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t \t<td style=\"padding-bottom:50px;\">\n\t\t\t \t <span class=\"td-text\">Percentage</span>\n\t\t\t \t</td>\t\t\t \n\t\t\t \t<td>\n\t\t\t \t <select name=\"select_rule\" id=\"select_rule\">\n\t\t\t \t \t<option value=\"1\" '.$select_rule_checked[0].'>MarkUp %</option>\n\t\t\t \t \t<option value=\"0\" '.$select_rule_checked[1].'>MarkDown %</option>\n\t\t\t \t </select>\n\t\t\t \t <input type=\"number\" name=\"price_percentage\" id=\"price_percentage\" min=\"0\" style=\"width: 60px;\" value=\"'.$price_data[0]->price_percentage.'\"> %<br>\n\t\t\t \t <input type=\"checkbox\" name=\"number_round\" id=\"number_round\" '.$number_round_checked.'> Round off to nearest whole number\n\t\t\t \t</td>\n\t \t \t </tr>\n\t\t\t <tr id=\"product_list\">\n\t\t\t \t<td>\n\t\t\t \t <span class=\"td-text\">Enter New Price</span>\n\t\t\t \t</td>\n\t\t\t \t<td>'.$product_content.'</td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t \t<td colspan=\"2\">\n\t\t \t \t\t<input type=\"hidden\" name=\"customer_row_id\" id=\"customer_row_id\" value=\"'.$price_id.'\">\n\t\t \t \t\t<input type=\"button\" name=\"customer_cancel_btn\" id=\"customer_cancel_btn\" class=\"document-button\" value=\"Cancel\">\n\t\t \t \t\t<input type=\"submit\" name=\"customer_save_btn\" id=\"customer_save_btn\" class=\"document-button customer-save-btn\" value=\"Save\">\n\t\t \t \t</td>\n\t \t \t </tr>\t\t\t \n\t\t\t</table>\n\t\t </form>\n\t\t</div>\n\t';\n\treturn $content;\n}", "abstract public function getDollarPrice(): float;", "function getPrice(){\n\t\treturn $this->price;\n\t}", "function format_price($meal) { return $meal->price ? '(' . str_replace('.', ',', $meal->price) . '&nbsp;€)' : ''; }", "function get_woocommerce_price_format()\n {\n }", "public abstract function getNetPrice();", "protected function priceFields() \n {\n return ['price'];\n }", "function zen_get_products_display_price($products_id) {\n global $db, $currencies;\n\n $free_tag = \"\";\n $call_tag = \"\";\n\n// 0 = normal shopping\n// 1 = Login to shop\n// 2 = Can browse but no prices\n // verify display of prices\n switch (true) {\n case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):\n // customer must be logged in to browse\n return '';\n break;\n case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):\n // customer may browse but no prices\n return TEXT_LOGIN_FOR_PRICE_PRICE;\n break;\n case (CUSTOMERS_APPROVAL == '3' and TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM != ''):\n // customer may browse but no prices\n return TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM;\n break;\n case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customer_id'] == ''):\n // customer must be logged in to browse\n return TEXT_AUTHORIZATION_PENDING_PRICE;\n break;\n case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customers_authorization'] > '0'):\n // customer must be logged in to browse\n return TEXT_AUTHORIZATION_PENDING_PRICE;\n break;\n default:\n // proceed normally\n break;\n }\n\n// show case only\n if (STORE_STATUS != '0') {\n if (STORE_STATUS == '1') {\n return '';\n }\n }\n\n // $new_fields = ', product_is_free, product_is_call, product_is_showroom_only';\n $product_check = $db->Execute(\"select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, products_type from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$products_id . \"'\" . \" limit 1\");\n\n // no prices on Document General\n if ($product_check->fields['products_type'] == 3) {\n return '';\n }\n\n $show_display_price = '';\n $display_normal_price = zen_get_products_base_price($products_id);\n $display_special_price = zen_get_products_special_price($products_id, true);\n $display_sale_price = zen_get_products_special_price($products_id, false);\n\n $show_sale_discount = '';\n if (SHOW_SALE_DISCOUNT_STATUS == '1' and ($display_special_price != 0 or $display_sale_price != 0)) {\n if ($display_sale_price) {\n if (SHOW_SALE_DISCOUNT == 1) {\n if ($display_normal_price != 0) {\n $show_discount_amount = number_format(100 - (($display_sale_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS);\n } else {\n $show_discount_amount = '';\n }\n $show_sale_discount = '<span class=\"productPriceDiscount\">' . $show_discount_amount . PRODUCT_PRICE_DISCOUNT_PERCENTAGE . '</span>';\n\n } else {\n $show_sale_discount = '<span class=\"productPriceDiscount\">' . $currencies->display_price(($display_normal_price - $display_sale_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT . '</span>';\n }\n } else {\n if (SHOW_SALE_DISCOUNT == 1) {\n $show_sale_discount = '<span class=\"productPriceDiscount\">' . number_format(100 - (($display_special_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS) . PRODUCT_PRICE_DISCOUNT_PERCENTAGE . '</span>';\n } else {\n $show_sale_discount = '<span class=\"productPriceDiscount\">' . $currencies->display_price(($display_normal_price - $display_special_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT . '</span>';\n }\n }\n }\n\n if ($display_special_price) {\n $show_normal_price = '<span class=\"normalprice\">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . ' </span>';\n if ($display_sale_price && $display_sale_price != $display_special_price) {\n $show_special_price = '<span class=\"productSpecialPriceSale\">' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';\n if ($product_check->fields['product_is_free'] == '1') {\n $show_sale_price = '<span class=\"productSalePrice\">' . PRODUCT_PRICE_SALE . '<s>' . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>' . '</span>';\n } else {\n $show_sale_price = '<span class=\"productSalePrice\">' . PRODUCT_PRICE_SALE . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';\n }\n } else {\n if ($product_check->fields['product_is_free'] == '1') {\n $show_special_price = '<span class=\"productSpecialPrice\">' . '<s>' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>' . '</span>';\n } else {\n $show_special_price = '<span class=\"productSpecialPrice\">' . $currencies->display_price($display_special_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';\n }\n $show_sale_price = '';\n }\n } else {\n if ($display_sale_price) {\n $show_normal_price = '<span class=\"normalprice\">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . ' </span>';\n $show_special_price = '';\n $show_sale_price = '<span class=\"productSalePrice\">' . PRODUCT_PRICE_SALE . $currencies->display_price($display_sale_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</span>';\n } else {\n if ($product_check->fields['product_is_free'] == '1') {\n $show_normal_price = '<s>' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</s>';\n } else {\n $show_normal_price = '<div class=\"single_price\">' . $currencies->display_price($display_normal_price, zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '</div>';\n }\n $show_special_price = '';\n $show_sale_price = '';\n }\n }\n\n if ($display_normal_price == 0) {\n // don't show the $0.00\n $final_display_price = $show_special_price . $show_sale_price . $show_sale_discount;\n } else {\n $final_display_price = $show_normal_price . $show_special_price . $show_sale_price . $show_sale_discount;\n }\n\n // If Free, Show it\n if ($product_check->fields['product_is_free'] == '1') {\n if (OTHER_IMAGE_PRICE_IS_FREE_ON=='0') {\n $free_tag = '<br />' . PRODUCTS_PRICE_IS_FREE_TEXT;\n } else {\n $free_tag = '<br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_PRICE_IS_FREE, PRODUCTS_PRICE_IS_FREE_TEXT);\n }\n }\n\n // If Call for Price, Show it\n if ($product_check->fields['product_is_call']) {\n if (PRODUCTS_PRICE_IS_CALL_IMAGE_ON=='0') {\n $call_tag = '<br />' . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT;\n } else {\n $call_tag = '<br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_CALL_FOR_PRICE, PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT);\n }\n }\n\n return $final_display_price . $free_tag . $call_tag;\n }", "public function get_tax_price_display_mode()\n {\n }", "function showTotalPriceClient($product) {\n $delivery = floatval( $product->recargo / $product->solicitados );\n\n $html = '';\n if(isset($product->dsct_lista_regalo) && ($product->dsct_lista_regalo > 0)) {\n\n $new_price = floatval($product->precio) - floatval($product->dsct_lista_regalo);\n $new_price = $new_price + $delivery;\n\n $html .= '<span>S/ '.number_format($new_price, 2).'</span>';\n\n } else {\n $new_price = $product->precio + $delivery;\n $html .= '<span>S/ '.number_format($new_price, 2).'</span>';\n }\n\n return $html;\n}", "public function getShopProductPrices()\n {\n\n }", "function getPrice($choice_id)\r\n\t\t{\r\n\t\t\tglobal $CFG,$objSmarty;\r\n\t\t $sqlsel = \"SELECT price FROM \".$CFG['table']['product_choice']. \" WHERE choice_id='\".$this->filterInput($choice_id).\"' \";\r\n\t\t\t$sqlres = $this->ExecuteQuery($sqlsel,'select');\r\n\t\t\t$objSmarty->assign('matchprice',$sqlres);\r\n\t\t}", "public function getPrice()\n {\n return $this->price;\n }", "public function getOtherPrices(){\n return $this->aPriceFields;\n }", "public function buildPrices();", "public function getPrice()\n {\n return $this->source['real_price'];\n }", "public function display_currency()\n\t{\n\t\treturn $this->get_insist('brand_purchase')->display_currency();\n\t}", "protected function _toHtml()\n {\n \t$productId = null;\n\t\tif($this->getProduct()){\n\t\t\t$productId = $this->getProduct()->getId();\n\t\t}\n \t$productsCanApply = PayRandom_PRPayment_Helper_Data::idProductsDeal();\n if(in_array($productId, $productsCanApply)){\n $productDeal = PayRandom_PRPayment_Helper_Data::getProductDeal($productId);\n $this->setProductDeal($productDeal);\n $this->setTemplate('prpayment/price.phtml');\n }\n\n if (!$this->getProduct() || $this->getProduct()->getCanShowPrice() === false) {\n return '';\n }\n return parent::_toHtml();\n }", "public function getPriceAttribute()\n {\n if($this->type == 'raffle') return null;\n $symbol = Config::get('lorekeeper.settings.currency_symbol');\n\n switch($this->type) {\n case 'flatsale':\n return 'Price: '.$symbol.$this->data['price'];\n break;\n case 'auction':\n return 'Starting Bid: '.$symbol.$this->data['starting_bid'].'<br/>'.\n 'Minimum Increment: '.$symbol.$this->data['min_increment'].\n (isset($this->data['autobuy']) ? '<br/>Autobuy: '.$symbol.$this->data['autobuy'] : '')\n ;\n break;\n case 'ota':\n return (isset($this->data['autobuy']) ? '<br/>Autobuy: '.$symbol.$this->data['autobuy'] : '');\n break;\n case 'xta':\n return (isset($this->data['autobuy']) ? '<br/>Autobuy: '.$symbol.$this->data['autobuy'] : '');\n break;\n case 'flaffle':\n return 'Price: '.$symbol.$this->data['price'];\n break;\n case 'pwyw':\n return 'Minimum: '.$symbol.$this->data['minimum'];\n break;\n }\n }", "function calculateEachProductPrice(){\n\t\techo \"..................>>CART-PRODUCT DETAILS>>...............<br/>\";\n\t\t$mycart = \"\";\n\t\tforeach ($this->pr as $pr)\n\t\t{\n\t\t\t$mycart = \"Product Name: $pr->name <br/>\";\n\t\t\t$mycart .= \"Product Price: $\" .$pr->price*$pr->quantity .\"<br/>\";\n\t\t}\n\t\techo $mycart;\n\t}", "function cuspricecal_price_table(){\n\t\tglobal $product; \n\t\t$product_id = $product->get_id();\n\t\t$_cuspricecalPdata = get_post_meta( $product_id, '_cuspricecalPdata', true );\n\t\tif ($_cuspricecalPdata['pluginStatus']) {\n\t\t\t?>\n\t\t\t<div>\n\t\t\t\t<h3><?php echo _e('Priceing Table', 'cus-price-cal');?></h3>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th><?php echo _e('Qty', 'cus-price-cal');?>: </th>\n\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\tforeach ($_cuspricecalPdata['qty_rang'] as $pqty) {\n\t\t\t\t\t\t\t\tif (!empty($pqty)) {\n\t\t\t\t\t\t\t\t\techo '<th>'.$pqty.'</th>';\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}\n\t\t\t\t\t\t?>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th><?php echo _e('Price', 'cus-price-cal');?>: </th>\n\t\t\t\t\t\t<?php \n\t\t\t\t\t\tforeach ($_cuspricecalPdata['price'] as $pqtyprice) {\n\t\t\t\t\t\t\tif (!empty($pqtyprice)) {\n\t\t\t\t\t\t\techo '<th>'.$pqtyprice.'</th>';\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</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "function shortcode_for_showing_price() {\n\n global $post, $product, $sa_smart_offers;\n\n if ( $post->post_type != 'smart_offers' ) {\n return;\n }\n\n $target_product_id = get_post_meta( $post->ID, 'target_product_ids', true );\n\n $product = $sa_smart_offers->get_product( $target_product_id );\n\n $product_id = ( ! empty( $product->variation_id ) ) ? $product->variation_id : $product->id;\n\n if ( ! is_a( $product, 'WC_Product' ) ) {\n return;\n }\n\n $sale_price = $product->get_sale_price();\n \n $price = $product->get_price();\n $so_offer = new SO_Offer();\n $offer_price = $so_offer->get_offer_price( array( 'offer_id' => $post->ID, 'prod_id' => $target_product_id ) );\n \n if ( $sale_price != $offer_price ) {\n $so_display_price_html = '<del>' . $product->get_price_html() . '</del> <ins>' . $sa_smart_offers->wc_price($offer_price) . '</ins>';\n } else {\n $so_display_price_html = $product->get_price_html();\n }\n \n $price_content = '<span class=\"price\"> ' . __( 'Offer Price', SA_Smart_Offers::$text_domain ) . ': ' . $so_display_price_html . '</span>';\n\n return $price_content;\n }", "public function pricing()\n {\n $this->loadView('pricing');\n }", "function my_epl_return_price_with_under_offer( $price ) {\n\n\tglobal $property;\n\n\tif ( 'yes' == $property->get_property_meta('property_under_offer') && 'sold' != $property->get_property_meta('property_status') ) {\n\t\t$price = $property->get_property_price_display();\n\t\t$price = '<span class=\"page-price under-offer-status\">'.$property->label_under_offer . ' ' . $price . '</span>';\n\t}\n\treturn $price;\n}", "public function displayBoth()\n {\n return $this->_taxConfig->displayCartPaymentFeeBoth($this->getStore());\n }", "function wedding_item_price($item_price,$item_maxprice,$currency_code)\n{\n\t$item_price_array=array();\n\tif($item_maxprice)\n\t{\n\t\t$item_maxprice_html = ' - '.$currency_code.' '.$item_maxprice;\n\t}\n\telse{\n\t\t$item_maxprice_html = '';\n\t}\n\t\n\tif($item_price)\n\t{\n\t\t$item_price_array['html'] \t= '<div class=\"vendor-price\"><div class=\"price\">'.$currency_code.' '.$item_price.$item_maxprice_html.'</div></div>';\n\t\t$item_price_array['marker'] = $currency_code.' '. $item_price.$item_maxprice_html;\n\t}\n\telse{\n\t\t$item_price_array['html'] \t= '';\n\t\t$item_price_array['marker'] = '';\n\t}\n\n\treturn $item_price_array;\t\n}", "public function loop_price() {\n echo '<span class=\"wc-simulador-parcelas-parcelamento-loop\">';\n $this->set_values( $this->exibicao_shop_page );\n echo '</span>';\n }", "function wc_get_price_decimals()\n {\n }", "public function getPrice() \n {\n return $this->_fields['Price']['FieldValue'];\n }", "public function getBasePrice();", "public function showPrice(){\n echo 'This vehicle costs '.$this->price.'.<br />';\n}", "function getTotalPrice()\n {\n }", "public function pricing()\n\t{\n\t\treturn view('website.pricing');\n\t}", "public function displayPrice( $price )\n {\n $priceVal = 0;\n $price = intval($price);\n// if($price > 0)\n// {\n $priceVal = Globals::DEFAULT_CURRENCY.$price;\n// }\n return $priceVal;\n }", "public function getPriceCurrencyAttribute() {\n return 'Q '.$this->price;\n }", "function canadianhifi_uc_product_price($price, $context, $options = array()) {\n if ($context['field'] === 'sell_price') $context['class'][] = 'price-ours';\n $output = '<div class=\"product-info '. implode(' ', (array)$context['class']) .'\">';\n $output .= uc_price($price, $context, $options);\n $output .= '</div>';\n\n return $output;\n}", "public function pricing()\n\t{\n\t\t$data['title'] = 'Pricing | IPB India';\n\n\t\t$this->load->view('frontend/pricing.view.php',$data);\n\t}" ]
[ "0.73441", "0.7232216", "0.7204855", "0.7190571", "0.70571107", "0.6974191", "0.69736814", "0.6973031", "0.68478525", "0.6840202", "0.68327814", "0.6813987", "0.6810744", "0.68064076", "0.6799497", "0.6789539", "0.6747348", "0.67296433", "0.671344", "0.6697185", "0.66703933", "0.6658962", "0.6658962", "0.6652839", "0.66341513", "0.66247463", "0.6619955", "0.6619955", "0.6619955", "0.66068965", "0.6589465", "0.6573081", "0.654756", "0.6547287", "0.65233034", "0.6508234", "0.6506306", "0.6487936", "0.6478979", "0.6470019", "0.64689225", "0.64607716", "0.6442537", "0.6437684", "0.64173424", "0.6417298", "0.63826656", "0.63684255", "0.63628995", "0.63628995", "0.63609356", "0.63552237", "0.6342314", "0.6332901", "0.63269114", "0.63252366", "0.6312153", "0.6308383", "0.6308076", "0.6299397", "0.6299397", "0.62990797", "0.62839365", "0.62825096", "0.6274676", "0.6264768", "0.6263934", "0.6263459", "0.625951", "0.62588984", "0.62583494", "0.62472", "0.623112", "0.6229285", "0.6223042", "0.62076616", "0.6202961", "0.6181992", "0.6181923", "0.6170331", "0.6161753", "0.61534405", "0.61498463", "0.61481935", "0.61458504", "0.611982", "0.61191857", "0.61169374", "0.61125314", "0.61087286", "0.6106662", "0.6105601", "0.6091083", "0.6087243", "0.6072736", "0.6070117", "0.60683197", "0.6052149", "0.6050171", "0.60469735" ]
0.76206005
0
Sets the response for this controller
Устанавливает ответ для этого контроллера
public function setResponse(Response $response);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setResponse(\\Zend_Controller_Response_Abstract $response)\n {\n $this->_escort->setResponse($response);\n\n return parent::setResponse($response);\n }", "function setHttpResponse($response) {\n $this->httpResponse = $response;\n }", "public function setResponse($response)\n {\n\n $this->response = $response;\n \n }", "private function initResponse()\n {\n $this->response = new Response(\n $this->request,\n new SymfonyResponse(),\n new Blade(ROOT.'resource/views', ROOT.'resource/cache')\n );\n }", "public function setResponse(HttpResponse $response) {\n $this->response = $response;\n }", "private function setup_response() {\n\t\t$this->response = array(\n\t\t\t'status' => 'error',\n\t\t\t'message' => 'An error occurred.',\n\t\t);\n\t}", "protected function setResponse($response)\n {\n $this->response = $response;\n }", "public function setResponse(Response $response) {\n $this->response = $response;\n }", "public function setResponse(Response $response)\r\n {\r\n $this->response = $response;\r\n }", "public function setResponse(Response $response)\n\t{\n\t\t$this->response = $response;\n\t}", "public function setJsonResponse() {\n $this->view->disable();\n\n $this->_isJsonResponse = true;\n $this->response->setContentType('application/json', 'UTF-8');\n }", "protected function setResponse($response) {\n $this->loadResponseIfNeeded();\n $this->response->setResponse($response);\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n }", "public function response()\n {\n $this->response->setVersion($this->transfer->getVersion());\n $this->response->setStatusCode($this->transfer->getStatusCode());\n $this->response->setStatusText($this->transfer->getStatusText());\n $this->response->headers->setAll($this->transfer->getHeaders());\n $this->response->cookies->setAll($this->transfer->getCookies());\n $this->response->setContent($this->transfer->getContent());\n }", "public function setResponse($response)\n {\n $this->response = $response;\n\n return $this;\n }", "private function setResponse($resp){\n $this->response = $resp;\n }", "protected function setResponse(Response $response)\n {\n $this->response = $response;\n }", "public function setResponse($response) \n {\n $this->response = $response;\n return $this;\n }", "public function resp_set($resp) {\n\t\t$this->response = $resp;\n\t}", "public function setResponse(Zend_Controller_Response_Abstract $response = null)\n {\n $this->_response = $response;\n return $this;\n }", "private function response()\n {\n $response = (new Response())->json(array_reverse($this->errors),500);\n ResponseFoundation::send($response);\n }", "public function setResponse(Response $response): void\n {\n $this->response = $response;\n }", "private function _setResponse($response){\n $this->_response = $response;\n return $response;\n }", "public function set($response);", "public function setResponse($response)\n {\n \t$this->_responses = array($response);\n \t$this->_responseIndex = 0;\n }", "public function setResponse($response)\n {\n $this->response = $response;\n\n return $this;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n\n $this->stopPropagation();\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n\n $this->stopPropagation();\n }", "public function setResponse(string $response): void\n {\n $this->_response = $response;\n }", "public function setResponse(Response $response): self;", "protected function setResponse()\n {\n \n // Tracking service might contain <ContinuationKey> element\n // which works like a pagination\n // We have to loop request until this key exists in the response\n $response = parent::sendRequest();\n \n $this->outputs[] = $response;\n \n if ($this->continueRequest($response) === true) {\n $this->setResponse();\n }\n }", "public function setResponse( $pValue );", "public function setResponse($response)\n {\n $this->getServiceContainer()->set('sf_response', $response);\n }", "public function setResponse($responseData){\n\n return $this->response = $responseData;\n }", "public function ResponseSetContent($content){\n $this->response->setContent($content);\n }", "public function asResponse()\r\n {\r\n $this->isJson = true;\r\n }", "public function setResponse($response)\n {\n $this->_response = $response;\n \n return $this;\n }", "public function setResponse($response)\n {\n $this->response = $response;\n\n return $this;\n }", "public function setResponse(Jaf_Response $response) {\n $this->_response = $response;\n return $this;\n }", "public function setResponse($response) : self\n {\n $this->initialized['response'] = true;\n $this->response = $response;\n return $this;\n }", "public function setResponse(Response $response): void\n {\n $this->response = $response;\n\n $this->stopPropagation();\n }", "public function setResponse(array $response)\n {\n $this->response = $response;\n }", "public function set_output() {\n $ci =& get_instance();\n \n //make sure the controller outputs the response and stops all further execution when an API controller is called\n if(get_parent_class($ci->router->class) === \"API_Controller\") {\n \n /* handle CORS for local development\n if(ENVIRONMENT === 'development') {\n if (strtolower($_SERVER['REQUEST_METHOD']) === 'options') {\n header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n header('Access-Control-Allow-Methods: POST, GET, OPTIONS');\n header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type, Authorization, UserName, UserPassword, AuthToken');\n header('Access-Control-Allow-Credentials: true');\n exit;\n }\n }\n //*/\n \n //set the output headers\n $ci->output\n ->set_status_header(200)\n ->set_content_type('application/json', 'utf-8')\n ->set_output(json_encode($ci->response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))\n ->_display();\n\n //stop script execution\n exit;\n }\n }", "protected function setResponseCode()\n {\n http_response_code($this->statusCode);\n }", "public function setResponse($response)\n {\n $this->response = $response !== null ? (string) $response : null;\n return $this;\n }", "public function onKernelResponse(ResponseEvent $event): void\n {\n if ($this->handleResponse && $this->httpCode !== null) {\n $response = $event->getResponse();\n $response->setStatusCode($this->httpCode, $this->httpStatus);\n }\n }", "public function setHttpResponseObject($response){\n\t\t$this->responseObject = $response;\n\t\t$this->createSimpleXMLBody();\n\t}", "public function setResponse(Response $response)\n {\n $this->response = $response;\n return $this;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n return $this;\n }", "protected function sendResponse() {}", "public function outputResponse() {\n }", "public function outputResponse() {\n }", "protected function setResponse($data)\n {\n if (!$this->isTagPage) {\n return;\n }\n $data['response'] = $data['response']->withStatus(200);\n }", "public function OptionResponse(){\n return $this->setHeaders( [\n\n ], Response::HTTP_OK );\n }", "public function setResponse(Psr\\Http\\Message\\ResponseInterface $response) {\n $this->response = $response;\n }", "protected function _initResponse()\n {\n return new HttpResponse();\n }", "function setResponse($inResponse) {\n\t\tif ( $this->_Response !== $inResponse ) {\n\t\t\t$this->_Response = $inResponse;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "protected function setStatusCode($response) {\n $this->response->status($response->getStatusCode());\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n\n return $this;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n\n return $this;\n }", "public function outputResponse(){\n header(\"HTTP/1.1 \" . $this->getStatus() . \" \" . $this->status_codes[$this->getStatus()]);\n echo json_encode($this->response, JSON_PRETTY_PRINT);\n }", "public function showResponse(){\n /*return Response::json(array('data' => $this->response,\n 'errors' => $this->errors,\n 'error_code' => $this->error_code));*/\n $json = array(\n 'data' => $this->response,\n 'message' => $this->getMessage(),\n 'response_code' => $this->getResponseCode());\n\n if($this->response_code==0){\n $this->setResponseCode(200);\n }\n return response()->json($json, $this->getResponseCode());\n }", "function setResponse(puzzle_message_ResponseInterface $response);", "public function setResponse(ResponseInterface $Response);", "protected function respond()\n {\n $data = $this->data;\n\n if ($this->errors) {\n $errors = array_key_exists('errors', $data) ? $data['errors'] : array();\n $data['errors'] = array_merge($this->errors, $errors);\n }\n\n $view = $this->view($data, $this->statusCode);\n\n foreach ($this->headers as $key => $value) {\n $view->setHeader($key, $value);\n }\n\n return $this->handleView($view);\n }", "private function setHttpResponse(OAuth2Response $response)\n {\n $httpResponse = $this->getResponse();\n $httpResponse->setStatusCode($response->getStatusCode());\n\n $headers = $httpResponse->getHeaders();\n $headers->addHeaders($response->getHttpHeaders());\n $headers->addHeaderLine('Content-type', 'application/json');\n\n $httpResponse->setContent($response->getResponseBody());\n return $httpResponse;\n }", "public function response()\n {\n $this->set_status_code();\n if($this->response)\n echo json_encode($this->response);\n\n $this->distruct();\n exit(0);\n }", "public function setResponse(Response $response): void\n\t{\n\t\tparent::setResponse($response);\n\n\t\t$this->crawler = new Crawler($this->getResponse()->getBody());\n\t}", "public function setResponse(\\Klevu\\Search\\Model\\Api\\Response $response_model)\n {\n $this->response = $response_model;\n\n return $this;\n }", "public function setResponse(IO\\AbstractResponse $response)\n {\n\t $this->_response = $response;\n return $this;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "function response() {\n\t\t\treturn new Response;\n\t\t}", "public function setResponse(ResponseInterface $response);", "final protected function Response() {\n\n return $this->\n Framework()->\n Response();\n }", "public function returnResponse(): self\n {\n $this->returnResponse = true;\n\n return $this;\n }", "public function response() {\n\treturn $this->response;\n }", "protected function configureResponse(Response $response)\n {}", "public function response() {\n\t\tif (is_null($this->response)) {\n\t\t\t$this->createResponse();\n\t\t}\n\n\t\treturn $this->response;\n\t}", "public function resetLastResponse()\n {\n $this->response = new Response();\n }", "public function resetLastResponse()\n {\n $this->response = new Response();\n }", "function response() {\n\t\t$data = $this->app->page->header();\n\t\t$data['content'] = $this->app->page->content();\n\n\t\t$response = new Response;\n\n\t\tif (array_get($data, 'layout') == '404')\n\t\t{\n\t\t\t$data = ['error' => 'page not found', 'status' => 404];\n\t\t\t$response->status(404);\n\t\t}\n\n\t\t$response->header('Content-Type', 'application/json')\n\t\t\t\t->content(json_encode($data));\n\t\texit($response);\n\t}", "private function respond($response)\r\n {\r\n if (!$this->mController) {\r\n header('Content-Type: application/json');\r\n echo json_encode($response);\r\n return;\r\n }\r\n\r\n $notXml = strcasecmp($this->mController->RESPONSE_TYPE, 'xml') !== 0;\r\n if (strcasecmp($this->mController->RESPONSE_TYPE, 'json') !== 0 && $notXml) {\r\n trigger_error('Unknown response type \"' . $this->mController->RESPONSE_TYPE .\r\n '\". Valid response types are JSON and XML.', E_USER_ERROR);\r\n }\r\n\r\n header('Content-Type: application/' . $this->mController->RESPONSE_TYPE);\r\n\r\n if ($notXml) {\r\n echo json_encode($response, $this->mController->JSON_OPTIONS);\r\n } else {\r\n echo $this->xml_encode($response);\r\n }\r\n }", "public function response() {\n return $this->response;\n }", "protected function sendResponse() {\n\t\techo json_encode($this->_response_string);\n\t\t$this->_resetResponse();\n\t}", "public function setResponseContent($responseContent)\n {\n $this->responseContent = $responseContent;\n }", "public function postDispatch() {\n $this->getResponse()->setHttpResponseCode($this->_response_code);\n $this->_helper->json($this->_response_data);\n }", "protected function registerResponse()\n {\n $this->app->singleton('laragram.response', function () {\n return new BotResponse(\n $this->config('paths.views')\n );\n });\n }", "public function setJsonResponse()\n {\n $this->jsonResponse = true;\n\n return $this;\n }", "public function setResponse(Response $response = null)\n {\n $this->response = $response;\n\n return $this;\n }", "public function after($response) \n\t{\n\t\tEvent::trigger('controller_after');\n\t\t\n\t\tif ( ! $response instanceof \\Response)\n\t\t{\n\t\t\t$response = $this->response; \n\t\t}\n\n\t\treturn parent::after($response);\n\t}", "public function setOK()\n {\n return new Response('FooBar', ResponseHeaders::HTTP_OK);\n }", "public function setResponse($result = '')\n {\n $this->_response = $result;\n parse_str(urldecode($result), $this->parameters);\n return $this;\n }", "public function setResponse(array $response = []);", "public function view()\n {\n $this->response = 'alive';\n }", "abstract public function assignResponse($response);" ]
[ "0.7366285", "0.73371637", "0.72962487", "0.7270878", "0.72475183", "0.71834373", "0.71491706", "0.71255904", "0.7112312", "0.7109093", "0.70879954", "0.70499957", "0.7045896", "0.6996273", "0.6985478", "0.69427544", "0.6936919", "0.6907739", "0.6895912", "0.6893638", "0.6874536", "0.68680835", "0.6868001", "0.68566084", "0.6824587", "0.68161327", "0.67266154", "0.67266154", "0.67113614", "0.67047346", "0.67017066", "0.667235", "0.666203", "0.6631309", "0.66263473", "0.66184294", "0.6611845", "0.66050464", "0.65977263", "0.6590932", "0.65809995", "0.65384704", "0.6533838", "0.65179336", "0.64605486", "0.64588183", "0.6451762", "0.6442418", "0.6442418", "0.6436841", "0.64111245", "0.64111245", "0.6387858", "0.63878196", "0.638462", "0.6360057", "0.6354829", "0.6352543", "0.6330658", "0.6330658", "0.6327758", "0.63239837", "0.63163257", "0.6303801", "0.63016737", "0.6300262", "0.62888765", "0.62886", "0.62872356", "0.62870055", "0.6273316", "0.6273316", "0.6273316", "0.6273316", "0.6273316", "0.627008", "0.62633574", "0.6249938", "0.624071", "0.62406766", "0.62388027", "0.62383026", "0.62280935", "0.62280935", "0.622707", "0.62218034", "0.621632", "0.62079895", "0.6206522", "0.6188219", "0.61869806", "0.6167033", "0.6162042", "0.6154196", "0.6152141", "0.6151528", "0.6149682", "0.614916", "0.6130153" ]
0.74420154
0
Get the data class data manager
Получить менеджер данных класса данных
public function get_data_manager() { return DataManager::getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_data_manager()\n {\n // return DataManager :: getInstance();\n }", "protected function getDataObject()\n {\n return Injector::inst()->get($this->getList()->dataClass());\n }", "public function getTypedDataManager() {\n return $this->typedDataManager ?: \\Drupal::service('typed_data_manager');\n }", "private static function dataBaseInstance()\n\t{\n\t\treturn DataBase_MD::getInstance();\n\t}", "static function get_instance()\r\n {\r\n if (! isset(self :: $instance))\r\n {\r\n $type = Configuration :: get_instance()->get_parameter('general', 'data_manager');\r\n require_once dirname(__FILE__) . '/data_manager/' . strtolower($type) . '_laika_data_manager.class.php';\r\n $class = __NAMESPACE__ . '\\\\' . $type . 'LaikaDataManager';\r\n self :: $instance = new $class();\r\n }\r\n return self :: $instance;\r\n }", "public function getManager()\n {\n return self::$manager;\n }", "public static function getInstance() {\n return !self::$instance ? new dataService() : self::$instance;\n }", "public function getDataModel()\n {\n $accountmanagerData = $this->getData();\n\n $accountmanagerDataObject = $this->accountmanagerDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $accountmanagerDataObject,\n $accountmanagerData,\n AccountManagerInterface::class\n );\n\n return $accountmanagerDataObject;\n }", "public function get_field_manager() {\n return mod_dataform_field_manager::instance($this->_dataformid);\n }", "public function getDataProcessorManager() {\n if (empty($this->dataProcessorManager)) {\n $this->dataProcessorManager = \\Drupal::service('plugin.manager.rules_data_processor');\n }\n return $this->dataProcessorManager;\n }", "public function get_data_store()\n {\n }", "public function getTypedDataManager() {\n if (empty($this->typedDataManager)) {\n $this->setTypedDataManager(\\Drupal::service('config.typed'));\n }\n\n return $this->typedDataManager;\n }", "public function getManager()\n {\n return $this->_manager;\n }", "private function getManager()\n {\n return $this->get('example_dashboard.manager');\n }", "public function getManager() {\n return $this->_manager;\n }", "public function get_data_store() {\n return $this->data_store;\n }", "public function getDataModel()\n {\n $assigned_customer_managerData = $this->getData();\n\n $assigned_customer_managerDataObject = $this->assigned_customer_managerDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $assigned_customer_managerDataObject,\n $assigned_customer_managerData,\n AssignedCustomerManagerInterface::class\n );\n\n return $assigned_customer_managerDataObject;\n }", "protected function getLiipImagine_Data_ManagerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/liip/imagine-bundle/Imagine/Data/DataManager.php';\n\n $this->services['liip_imagine.data.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Data\\DataManager(($this->privates['liip_imagine.binary.mime_type_guesser'] ?? $this->getLiipImagine_Binary_MimeTypeGuesserService()), \\Symfony\\Component\\Mime\\MimeTypes::getDefault(), ($this->privates['liip_imagine.filter.configuration'] ?? ($this->privates['liip_imagine.filter.configuration'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterConfiguration([]))), 'default', NULL);\n\n $instance->addLoader('default', ($this->services['liip_imagine.binary.loader.default'] ?? $this->getLiipImagine_Binary_Loader_DefaultService()));\n\n return $instance;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "protected function getObjectManager()\n {\n return GeneralUtility::makeInstance(ObjectManager::class);\n }", "public function get_dataconnector() {\n if (!$this->dataconnector) {\n $this->dataconnector = new data_connector();\n }\n return $this->dataconnector;\n }", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }", "public function getManager()\n {\n return $this->getFirstAttribute($this->schema->manager());\n }", "public function get_data_provider()\n {\n if (!isset($this->data_provider))\n {\n $classname = $this->get_class('DataProvider');\n $this->data_provider = new $classname($this);\n }\n\n return $this->data_provider;\n }", "public function get_view_manager() {\n return mod_dataform_view_manager::instance($this->_dataformid);\n }", "function getInstance() {\r\n if (isset($this->singleton)) {\r\n $this->$singleton = new DataBase();\r\n }\r\n return $this->singleton;\r\n }", "public function getDatabaseManager()\n {\n return $this->manager;\n }", "public function getManager(){return $this->_manager;}", "public static function getDBManager(): DatabaseManager\n {\n return static::$DBmanager;\n }", "public function getManager()\n {\n return isset($this->manager) ? $this->manager : false;\n }", "private function getManager()\n {\n return self::getDocker();\n }", "private function getManager()\n {\n return self::getDocker();\n }", "public function getStore(): DataStore{\n return $this->store;\n }", "public function getDataService()\n {\n if (!$this->dataService instanceof DataService) {\n $this->dataService = new DataService($this->communicatorCredentials);\n }\n\n return $this->dataService;\n }", "public function getDbManagementObj() {\n //global for the management object\n global $_globalObjDbManager;\n /*\n\t\t*do the checks that the db object gets instantiated once, then\n\t\t*let MDB2 take over for the on-demand construction\n\t\t*/\n if ($this->_objDbManager == NULL || $_globalObjDbManager == NULL) {\n //load the config object (same as the db Object)\n $this->_objDbConfig = $this->getObject ( 'altconfig', '_core' );\n $mdsn = KEWL_DB_DSN; //$this->_objDbConfig->getDsn();\n $this->mdsn = $this->parseDSN ( $mdsn );\n // Connect to the database\n //require_once $this->getPearResource ( 'MDB2/Schema.php' );\n //MDB2 has a factory method, so lets use it now...\n $_globalObjDbManager = &MDB2::connect ( $this->dsn );\n\n //Check for errors\n if (PEAR::isError ( $_globalObjDbManager )) {\n /*\n\t\t\t\t * manually call the callback function here,\n\t\t\t\t * as we haven't had a chance to install it as\n\t\t\t\t * the error handler\n\t\t\t\t */\n $this->_pearErrorCallback ( $_globalObjDbManager );\n //return the db object for use globally\n return $_globalObjDbManager;\n }\n // keep a copy as a field as well\n $this->_objDbManager = $_globalObjDbManager;\n // install the error handler with our custom callback on error\n $this->_objDbManager->setErrorHandling ( PEAR_ERROR_CALLBACK, array ($this, '_pearErrorCallback' ) );\n\n }\n //return the local copy\n return $this->_objDbManager;\n }", "public function getObjectManager() {\n if(is_null($this->_objectManager)) {\n if($this->isMage2()) {\n /** \\Magento\\Framework\\ObjectManager\\ObjectManager */\n $this->_objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n } else {\n /* create Object Manager for M1 and initialize common objects (shared instances) */\n $this->_objectManager = new Context\\ObjectManager();\n $resource = \\Mage::getModel('core/resource');\n $dbAdapter = new DbAdapter($resource);\n $this->_objectManager->addSharedInstance($dbAdapter, 'Flancer32\\Lib\\Context\\IDbAdapter');\n }\n }\n return $this->_objectManager;\n }", "private function getManager()\n {\n return $this->getContainer()->get('ulabox_gearman.manager');\n }", "public function getObjectManager()\n {\n return $this->manager;\n }", "public function getDataClass()\n {\n return $this->dataClass;\n }", "public static function GetInstance()\n\t{\n\t\tif(self::$instance == null)\n\t\t{\n\t\t\tself::$instance = new DataAccess();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance(){\n static $instance = null;\n if($instance === null) $instance = new DBManager();\n return $instance;\n }", "private function getManager()\n {\n return $this->get('sulu_product.product_manager');\n }", "public function getDataGrid()\n {\n if (!self::$dataGrid) {\n self::$dataGrid = new DataGrid($this->getEntityManager());\n }\n return self::$dataGrid;\n }", "protected function getDoctrineManager()\n {\n return Doctrine_Manager::getInstance();\n }", "public function getDataHandler(): DataHandler\n {\n return $this->dataHandler;\n }", "public function getDataStore()\n {\n return [\n 'megaplan_deal_dataStore_service' => [\n 'class' => MegaplanDataStore::class,\n 'singleEntity' => Entity\\Deal\\Deal::class,\n 'listEntity' => Entity\\Deal\\Deals::class,\n ],\n 'megaplan_contractor_dataStore_service' => [\n 'class' => MegaplanDataStore::class,\n 'singleEntity' => Entity\\Contractor\\Contractor::class,\n 'listEntity' => Entity\\Contractor\\Contractors::class,\n ],\n ];\n }", "private function getManager()\n {\n return $this->get('kac_site.manager.product');\n }", "public function getObjectManager()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n return $objectManager;\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getObjectManager() {}", "private function getFieldManager()\n {\n return $this->getContainer()->get('mremi_dolist.api.field_manager');\n }", "protected function getApiPlatform_Doctrine_Orm_DataPersisterService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Bridge/Doctrine/Common/DataPersister.php';\n\n return $this->privates['api_platform.doctrine.orm.data_persister'] = new \\ApiPlatform\\Core\\Bridge\\Doctrine\\Common\\DataPersister(($this->services['doctrine'] ?? $this->getDoctrineService()));\n }", "public function get_datastore() {\n\t\treturn $this->datastore;\n\t}", "public function getDataStore()\n {\n return [\n 'megaplan_deal_dataStore_service' => [\n 'class' => MegaplanDataStore::class,\n 'singleEntity' => 'dealEntity',\n 'listEntity' => 'dealsEntity',\n ],\n ];\n }", "public static function getInstance()\n\t{\n\t\tstatic $xInstance = null;\n\t\tif(!$xInstance)\n\t\t{\n\t\t\t$xInstance = new Manager(); \n\t\t}\n\t\treturn $xInstance;\n\t}", "protected function getDb(): Manager\n {\n if ($this->db === null) {\n $db = new Manager;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->setAsGlobal();\n\n $this->db = $db;\n }\n\n return $this->db;\n }", "public function getData()\n {\n return $this->container;\n }", "public static function getCookieManagerData() {\n\n $cookieManagerData = self::getYamlDataObjType(self::getCurrentCookieManagerPath());\n\n return $cookieManagerData;\n }", "private function instance(){\n if (!is_object(self::$_instance)) {\n self::$_instance = new DataParser();\n }\n return self::$_instance;\n }", "private function _getConfigData()\n {\n return ConfigDataBase::$configDataBase;\n }", "protected function getObjectManager() {}", "public function getDataObject()\n\t{\n\t\treturn $this->_dataObject;\n\t}", "protected function manager()\n {\n if (! $this->manager) {\n $this->manager = new CountCacheManager;\n }\n\n return $this->manager;\n }", "public function getManager() {\r\n\t\treturn Yii::app()->packageManager;\r\n\t}", "protected function getDataObjectProcessor()\n {\n if ($this->dataProcessor === null) {\n $this->dataProcessor = ObjectManager::getInstance()->get(\\Magento\\Framework\\Reflection\\DataObjectProcessor::class);\n }\n return $this->dataProcessor;\n }", "public static function instance($dataformid) {\n static $instances = array();\n\n if (empty($instances[$dataformid])) {\n $instances[$dataformid] = new mod_dataform_field_manager($dataformid);\n }\n return $instances[$dataformid];\n }", "public function getDataMapper()\n {\n return $this->_dataMapper;\n }", "function dataDelegate()\n {\n if ($this->dataDelegate === NULL) throw( new Exception(\"No dataDelegate assigned.\") );\n return $this->dataDelegate;\n }", "public function getDataConnector()\n {\n\n return $this->dataConnector;\n\n }", "public function getReaderManager()\n\t{\n\t\t// only ever want one instance...\n\t\tif(isset(self::$instances['reader_manager'])){\n\t\t\treturn self::$instances['reader_manager'];\n\t\t}\n\n\t\t$rm = new ReaderManager();\n\t\t$rm->setReaderType($this->getReader());\n\n\t\treturn self::$instances['reader_manager'] = $rm;\n\t}", "public function getDataStorageModel()\n {\n if (! $this->_dataModel instanceof FieldDataModel) {\n $this->_dataModel = $this->tracker->createTrackClass('Model\\\\FieldDataModel');\n }\n\n return $this->_dataModel;\n }", "public static function getInstance(){\n\t\tif (!self::$db_Instance){\n\t\t\tself::$db_Instance = new DataBase();\n\t\t}\n\n\t\treturn self::$db_Instance;\n\t}", "function jdi_files_manager() {\n\treturn Jet_Data_Importer_Files_Manager::get_instance();\n}", "protected function getDatasourcePluginManager() {\n return $this->datasourcePluginManager;\n }", "protected function queryManager() {\n\t\t\tif (!$this->queryManager)\n\t\t\t\t$this->queryManager = app(QueryManager::class);\n\n\t\t\treturn $this->queryManager;\n\t\t}", "public function getDataMapper()\n {\n return $this->dataMapper;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "protected function getDb() {\n\t\t$this->db = getPersistClass('Folder');\n\t}", "public function getDataParser() {\n return $this->dataParser;\n }", "public static function getInstance() {\n\t\t\t\n\t\t\tif(is_null(self::$_instance)) {\n\t\t\t\tself::$_instance = new DataWriter(); \n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t\t\n\t\t}", "private function getContactManager()\n {\n return $this->getContainer()->get('mremi_dolist.api.contact_manager');\n }", "function manager($name) {\n return new Dormio_Manager($name, $this->db, $this->dialect);\n }", "public function getCollectionManager(): ManagerInterface\n {\n return $this->collectionsManager;\n }", "public static function inst()\n {\n return DataObject::get_one(self::class);\n }", "public function getObjectManager()\n {\n return $this->om;\n }", "static public function getManager($context=null)\n {\n if (is_null(self::$manager))\n {\n if (is_null($context))\n {\n $context = sfContext::getInstance();\n }\n\n self::checkConfiguration($context);\n\n $managerClass = sfConfig::get('app_sfDynamicsPlugin_manager', 'sfDynamicsManager');\n self::$manager = new $managerClass($context);\n }\n\n return self::$manager;\n }", "public static function getInstance()\n {\n static $instance = NULL; \n\n if ($instance == null)\n {\n $instance = new list_manager();\n }\n\n return $instance;\n }", "function getDAO() {\r\n return $this->DAO;\r\n }", "public static function getConnection(): DataBase{\n \n $cls = static::class;\n \n if (!isset(self::$instance[$cls])) {\n self::$instance[$cls] = new static();\n }\n \n return self::$instance[$cls];\n\n }", "static public function getInstance ()\r\n\r\n\t{\r\n\r\n\t\tif ($objdiscussion_db_manager == NULL)\r\n\r\n\t\t{\r\n\r\n\t\t\t$objdiscussion_db_manager = new chat_db_manager();\r\n\r\n\t\t}\r\n\r\n\t\t//Return the instance of discussion_db_manager class\r\n\r\n\t\treturn $objdiscussion_db_manager;\r\n\r\n\t}", "public static function get_instance() {\n\t\tif(self::$_instance === null)\n\t\t\tself::$_instance = new SN_Lander_Manager();\n\n\t\treturn self::$_instance;\n\t}" ]
[ "0.8790626", "0.7196337", "0.7148469", "0.7138529", "0.71294874", "0.68546885", "0.6824086", "0.6816631", "0.6734136", "0.6715872", "0.6710997", "0.6682356", "0.66228724", "0.6592384", "0.6580199", "0.6576303", "0.65043503", "0.6502546", "0.64821994", "0.64821994", "0.64821994", "0.64821994", "0.64821994", "0.6442992", "0.6440464", "0.64232", "0.64139587", "0.64012754", "0.64004254", "0.63771755", "0.6372012", "0.63653314", "0.635739", "0.630763", "0.63026065", "0.63026065", "0.6276278", "0.6266056", "0.6255246", "0.62486935", "0.62373686", "0.6230767", "0.622325", "0.6221248", "0.6211914", "0.61931896", "0.6190124", "0.61785436", "0.6173033", "0.6172405", "0.61664474", "0.61505103", "0.61482865", "0.61482865", "0.6141394", "0.6137489", "0.6128614", "0.6102768", "0.6099532", "0.6080248", "0.6070154", "0.60665494", "0.6063272", "0.60554224", "0.6041684", "0.6035598", "0.60348105", "0.6013372", "0.6009626", "0.59955233", "0.59925354", "0.598313", "0.5979498", "0.59722495", "0.5962765", "0.5945352", "0.5943592", "0.594127", "0.59287375", "0.5924463", "0.59220785", "0.59161776", "0.59161776", "0.59161776", "0.5912384", "0.5902859", "0.5895286", "0.5895156", "0.5894971", "0.58923", "0.58855176", "0.5884275", "0.5878156", "0.5867091", "0.5852741", "0.5839328", "0.58318055", "0.5830387" ]
0.88393885
1
Sets the lifetime of this Session.
Устанавливает срок действия этого сеанса.
public function set_lifetime($lifetime) { $this->set_default_property(self::PROPERTY_LIFETIME, $lifetime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLifetime($lifetime);", "public function setSessionCookieLifetime(int $ttl): void\n {\n // Set new cookie TTL\n session_set_cookie_params($ttl);\n\n if ($this->sessionExists()) {\n // There is a running session so we'll regenerate id to send a new cookie\n $this->regenerateId();\n }\n }", "public function setLifetime($lifetime)\n {\n }", "public function setAuthenticationExpirationTime() {\n\n $expirationTime = time() + $this->allowedIdleTimeInSeconds;\n\n $authSession = new Container(self::SESSION_CONTAINER_NAME);\n\n if($authSession->offsetExists(self::SESSION_VARIABLE_NAME)) {\n $authSession->offsetUnset(self::SESSION_VARIABLE_NAME);\n }\n\n $authSession->offsetSet(self::SESSION_VARIABLE_NAME, $expirationTime);\n }", "public function setLifetime($t)\n\t{\n\t\t$this->lifetime = $t;\n\t}", "public static function setLifetime($lifetime) {\n\t\tself::$lifetime = $lifetime;\n\t}", "protected function fixLifetime()\n {\n Config::set('session.expire_on_close', true);\n }", "public static function setCookieLifetime( $lifetime = 0 )\n\t{\n\t\tself::setCookieParams( compact( 'lifetime' ) );\n\t}", "public function set_session_life($lifeSpan=0)\n\t{\n\t\tif(!is_numeric($lifeSpan) || $lifeSpan == 0)\n {\n\t\t\treturn false;\n }\n\t\t//cookie lifespan\n\t\t$this->sessionLifeTime = $lifeSpan;\n\t}", "public function setLifetime($ttl)\n {\n $this->lifetime = (int)$ttl;\n }", "public function lifetime($lifetime = null)\n\t{\n\t\treturn $this->getSet(\"lifetime\", $lifetime);\n\t}", "public function setCookieLifetime($seconds)\n {\n $this->_cookieLifetime = $seconds;\n }", "public function setLifetime($lifetime)\n {\n $this->lifetime = $lifetime;\n\n return $this;\n }", "public function __construct() {\n $this->maxlifetime = ini_get('session.gc_maxlifetime');\n session_set_save_handler($this, true);\n }", "public function remember($lifetime = null): self;", "public static function getLifetime() {\n\t\tif (!self::$lifetime) {\n\t\t\tself::$lifetime = 60 * 60 * $sessionExpirationHours;\n\t\t}\n\n\t\treturn self::$lifetime;\n\t}", "function ExpireSession()\n {\n $this->DestroySession();\n $this->CreateSession();\n\n }", "private function configureSession()\n\t{\n\t\tini_set('session.gc_maxlifetime', ($this->_settings['session_expire_time'] * 60));\n\t\t\n\t\t// Make sure we only use cookie sessions\n\t\tini_set('session.use_only_cookies', $this->_settings['use_only_cookies']);\n\t\t\n\t\t// Configure cookie time\n\t\t//ini_set('session.cookie_lifetime', ($this->_settings['session_expire_time'] * 60));\n\t}", "public function setCookieLifetime($ltime) {\r\n session_set_cookie_params($ltime,$this->path,$this->domain,$this->secure);\r\n $this->ltime = $ltime;\r\n }", "public function setLifetime($lifetime, $overrideLifetime = null)\n {\n if ($lifetime < 0) {\n /**\n * @see Xzend_Session_SaveHandler_Exception\n */\n require_once 'Xzend/Session/SaveHandler/Exception.php';\n throw new Xzend_Session_SaveHandler_Exception();\n } else if (empty($lifetime)) {\n $this->_lifetime = (int) ini_get('session.gc_maxlifetime');\n } else {\n $this->_lifetime = (int) $lifetime;\n }\n\n if ($overrideLifetime != null) {\n $this->setOverrideLifetime($overrideLifetime);\n }\n\n return $this;\n }", "public static function expire()\n {\n $storage = ServiceUtil::getService('session.storage');\n $storage->expire();\n }", "public function setMaxlifetime(int $maxlifetime) {\n $this->maxlifetime = $maxlifetime;\n ini_set('session.gc_maxlifetime', $maxlifetime);\n return $this;\n }", "function setCacheLifetime($lifetime) {\r\n\t\tif ($lifetime <= 0) {\r\n\t\t\tdie(\"Cache lifetime should be greater than zero! ($lifetime)\");\r\n\t\t}\r\n\t\t$this->cacheLifetime = $lifetime;\r\n\t}", "public static function lifetime($lifetime){\n\t\tif(empty($lifetime)) return self::$lifetime;\n\t\tself::$lifetime = $lifetime;\n\t}", "function SessionManager() {\n // $this->life_time = get_cfg_var(\"session.gc_maxlifetime\");\n\t $this->life_time = 60 * 60 * 24 * 7;\n // Register this object as the session handler\n session_set_save_handler( \n array( &$this, \"open\" ), \n array( &$this, \"close\" ),\n array( &$this, \"read\" ),\n array( &$this, \"write\"),\n array( &$this, \"destroy\"),\n array( &$this, \"gc\" )\n );\n\n }", "public function setSessionExpirationDateTime($val)\n {\n $this->_propDict[\"sessionExpirationDateTime\"] = $val;\n return $this;\n }", "public function setSessionExpires($expires);", "public function persistFor(int $lifetime) : void;", "private function setConfiguration()\n {\n ini_set('session.name', $this->config[ 'name' ]);\n\n if (empty($this->config[ 'lifetime' ])) {\n $this->config[ 'lifetime' ] = (int)ini_get('session.gc_maxlifetime');\n } else {\n ini_set('session.gc_maxlifetime', (int)$this->config[ 'lifetime' ]);\n }\n\n ini_set('session.cookie_domain', $this->config[ 'cookie' ]->domain);\n ini_set('session.cookie_path', $this->config[ 'cookie' ]->path);\n\n // Security is king\n ini_set('session.cookie_lifetime', $this->config[ 'lifetime' ]);\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.use_strict_mode', 1);\n ini_set('session.cookie_httponly', 1);\n ini_set('ssession.cookie_secure', (is_https() ? 1 : 0));\n ini_set('session.use_trans_sid', 0);\n \n session_set_cookie_params(\n (empty($this->config[ 'lifetime' ]) ? 0 : time() + $this->config[ 'lifetime' ]),\n $this->config[ 'cookie' ]->path,\n $this->config[ 'cookie' ]->domain,\n $this->config[ 'cookie' ]->secure,\n true\n );\n\n $this->configureSidLength();\n }", "function initSessionLife(){\n\t\t$_SESSION['start'] = time();\n\t\t$_SESSION['expiration'] = $_SESSION['start'] + 900;\n\t}", "protected function setTokenExpiration()\n {\n $this->tokenExpireAt = time() + ($this->tokenExpireTime * 60);\n\n $_SESSION[$this->tokenExpireTimeName] = $this->tokenExpireAt;\n\n return $this;\n }", "function set_session() {\n\t\t\tglobal $config, $app, $session;\n\t\t\t\n\t\t\t$time = ($config->cookie->lifespan == 0)? 0 : time()+$config->cookie->lifespan;\n\t\t\t\n\t\t\tsetcookie(\n\t\t\t\t$config->cookie->session, \n\t\t\t\t$_SESSION['user_id'] . '|' . $session->rs, \n\t\t\t\t$time, \n\t\t\t\t\"/\", \n\t\t\t\t$this->domain()\n\t\t\t);\n\t\t}", "public function get_lifetime()\n {\n return $this->get_default_property(self::PROPERTY_LIFETIME);\n }", "public function extends()\n {\n self::setInt('session_validUntil', self::validUntil());\n }", "public function setCacheLifetime(int $cacheLifetime): void\n {\n $this->cacheLifetime = $cacheLifetime;\n }", "public function get_lifetime(): int {\n return $this->lifetime;\n }", "public function getLifetime()\n {\n return $this->lifetime;\n }", "function setSession($name)\n\t{\n\t\t$session =& $this->_createSession($name);\n\n\t\tif ($session->getState() == 'expired') {\n\t\t\t$this->logout();\n\t\t}\n\t}", "public function __construct() {\n//return ini_set('session.gc_maxlifetime', 36000000);\n\n// each client should remember their session id for EXACTLY 1 hour\n// session_set_cookie_params(36000000);\n// session_set_cookie_params(36000000000,\"/\");\n\n return session_start();\n \n }", "public function reduceClientSessionLifetime()\n {\n Mage::app()->getStore()->setConfig(\"web/cookie/cookie_lifetime\", self::REDUCED_SESSION_LIFETIME);\n }", "public function testAuthenticationSessionTtlDuration()\n {\n $test_session_id = 's123';\n\n $user_repository = new UserRepository([new AuthenticatedUser(1, 'ilija.studen@activecollab.com', 'Ilija Studen', '123')]);\n $session = new Session($test_session_id, 'ilija.studen@activecollab.com');\n\n // Check Default\n $this->assertEquals(Session::SESSION_TTL, $session->getSessionTtl());\n\n // Check if extended\n $session->setIsExtendedSession(true);\n $this->assertEquals(Session::EXTENDED_SESSION_TTL, $session->getSessionTtl());\n }", "protected function set_ttl(?int $seconds): void\n\t{\n\t\t$this->cache_control->s_maxage = $this->age + $seconds;\n\t}", "public function getLifetime()\n\t{\n\t\treturn $this->lifetime;\n\t}", "public function setExpire($seconds)\n {\n $this->expire = $seconds;\n }", "protected function checkSessionLifetime() {}", "public function clearAuthenticationExpirationTime() {\n\n $authSession = new Container(self::SESSION_CONTAINER_NAME);\n $authSession->offsetUnset(self::SESSION_VARIABLE_NAME);\n }", "protected function getSessionTTL()\n {\n return config('laravel-sso.session_ttl');\n }", "public static function setRememberDuration($minutes)\n {\n /** @var \\Illuminate\\Auth\\SessionGuard $instance */\n return $instance->setRememberDuration($minutes);\n }", "public function set_session()\n {\n }", "public function setLifeTime($newLifeTime)\n {\n $this->setOption('lifeTime', (int)$newLifeTime);\n }", "public function expireSession() {\n // sure that the session is gone. I know it doesn't make a lot of sense to start a session in this file,\n // but bear with me. We've gotta start it, to empty it, to destroy it.\n if (!session_status() === PHP_SESSION_ACTIVE) {\n\n // Initialize the session.\n session_start();\n\n }\n\n // Unset all of the session variables.\n $_SESSION = array();\n\n // Also delete the session cookie.\n // Note: This will destroy the session, and not just the session data!\n if (ini_get(\"session.use_cookies\")) {\n $params = session_get_cookie_params();\n setcookie(session_name(), '', time() - 42000,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\n // Finally, destroy the session.\n session_destroy();\n\n }", "public function expireSessionCookie(): void\n {\n if (ini_get('session.use_cookies')) {\n $params = session_get_cookie_params();\n setcookie(\n $this->getName(),\n '',\n $_SERVER['REQUEST_TIME'] - 42000,\n $params['path'],\n $params['domain'],\n $params['secure'],\n $params['httponly']\n );\n }\n }", "public function start() {\n\t\t@session_name($this->sessionName);\n\t\tif ($this->started) {\n\t\t\treturn;\n\t\t}\n\t\t$this->started = TRUE;\n\t\t@ini_set('session.gc_maxlifetime', $this->timeout);\n\n\t\t//set session cookie to far future expire\n\t\t$oldlifetime = ini_get('session.cookie_lifetime');\n\t\t$oldpath = ini_get('session.cookie_path');\n\t\t$olddomain = ini_get('session.cookie_domain');\n\t\t$oldsecure = ini_get('session.cookie_secure');\n\t\t$oldhttp = ini_get('session.cookie_httponly');\n\t\t//session_set_cookie_params ( 86400*365 , '/' , $olddomain , $oldsecure , TRUE );\n\t\t@session_set_cookie_params ( 0 , '/' , $olddomain , $oldsecure , TRUE );\n\t\t@session_start();\n\t\t@session_set_cookie_params ( $oldlifetime, $oldpath , $olddomain , $oldsecure , $oldhttp );\n\t\t$this->sessionId = session_id();\n\t\t$this->touch();\n\t}", "public function __construct() {\n if ( $this->session_timeout == 0 ) {\n ini_set(\"session.cache_expire\", 600);\n ini_set(\"session.gc_maxlifetime\", 36000);\n ini_set(\"session.cookie_lifetime\", 36000);\n }\n\n if ( isset($this->session_name) && $this->session_name != '' ) {\n ini_set('session.name', $this->session_name);\n }\n\n if ( isset($this->session_path) && is_dir($this->session_path) ) {\n session_save_path($this->session_path);\n ini_set('session.gc_probability', 1);\n }\n\n if ( $this->session_cookie_secure ) {\n ini_set('session.cookie_secure','1');\n }\n }", "public function setCartLifetime($seconds)\r\n\t{\r\n\t\t$this->cartLifetime = $seconds;\r\n\t}", "private function setSessionTime( $timeSeconds = 43200)\r\n\t{\r\n\t\t\r\n\t\tif (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > $timeSeconds)) \r\n\t\t{\r\n\t\t\t\r\n\t\t\tsession_unset(); // unset $_SESSION variable for the run-time \r\n\t\t\tsession_destroy(); // destroy session data in storage\r\n\t\t\techo \"Session destroyed\";\r\n\t\t}\r\n\t\r\n\t\t$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp\r\n\t}", "public function setTimeToLive($ttl)\n {\n $this->ttl = $ttl;\n }", "public function setExpiration($seconds = 0) {\n if($seconds == 0) {\n $this->expires = NULL;\n } else {\n $this->expires = time() + intval($seconds);\n }\n }", "public function setLifetimeInMinutes(?int $value): void {\n $this->getBackingStore()->set('lifetimeInMinutes', $value);\n }", "protected function setCookie()\n {\n $expiration = $this->config->expiration === 0 ? 0 : Time::now()->getTimestamp() + $this->config->expiration;\n $this->cookie = $this->cookie->withValue(session_id())->withExpires($expiration);\n\n $this->cookies[] = $this->cookie;\n }", "public function setTtl($ttl)\n {\n $this->ttl = $ttl;\n }", "public function setTtl($ttl)\n {\n $this->ttl = $ttl;\n }", "public static function set_session_feature()\n\t{\n\t\tini_set(\"session.name\", self::$cookSessName);\n\t\tini_set(\"session.cookie_lifetime\", self::$cookTicketLifeSpan);\n\t\tini_set(\"session.gc_maxlifetime\", self::$sessGcMaxlifetime);\n\t\tini_set(\"session.gc_probability\", self::$sessGcProbability);\n\t\tini_set(\"session.gc_divisor\", self::$sessGcDivisor);\n\t}", "public function setTimeout($ttl)\n {\n $this->_timeout = (int) $ttl;\n return $this;\n }", "public function getSessionExpires();", "public function setLifeTime($input)\n {\n $this->_lifeTime = $input;\n }", "public function getMaxlifetime(): int {\n return $this->maxlifetime;\n }", "public function __construct(){\n\t\t$ns = new Zend_Session_Namespace('info');\n\t\t//$ns->setExpirationSeconds(1800);\n\t}", "public function initialize() {\n ini_set('session.gc_maxlifetime', 8 * 60 * 60);\n ini_set('max_execution_time', 3600);\n ini_set(\"session.cookie_lifetime\", 3600);\n\n session_set_cookie_params(8 * 60 * 60);\n date_default_timezone_set('America/Chicago');\n $this->setVar('user', NULL);\n }", "protected function handleSessionLifeTimeExpired() {}", "public function setMaxLifeTime(int $maxLifeTime): void\n {\n // maxIdleTime cannot be negative\n if ($maxLifeTime < 0) {\n throw new InvalidArgumentException('maxLifeTime should be a positive value');\n }\n\n $this->maxLifeTime = $maxLifeTime;\n }", "function turn_on_session($life_time, $session_name)\n{\n \n session_start();\n \n // Do not allow to use too old session ID\n if (!empty($_SESSION['deleted_time']) && $_SESSION['deleted_time'] < time() - $life_time) {\n \n session_destroy();\n \n session_start();\n\n setcookie($session_name, session_id(), time()+$life_time);\n \n }\n\n}", "public function setLength(int $length)\n {\n $this->settings[self::EXPIRATION][self::LENGTH] = $length;\n }", "private function renewSession() {}", "public function setExpiration($time)\r\n\t{\r\n\t\tif ($time === 0) {\r\n\t\t\tunset($_SESSION['__M'][$this->namespace]['__E']);\r\n\t\t} else {\r\n\t\t\tif (is_string($time))\r\n\t\t\t\t$time = strtotime($time);\r\n\r\n\t\t\t$_SESSION['__M'][$this->namespace]['__E'] = $time;\r\n\t\t}\r\n\r\n\t\treturn $this;\r\n\t}", "public function setTTL($ttl);", "protected function verifySessionNotTimedOut()\n {\n $last_activity_datetime = $this->getSessionValue('last_activity_datetime');\n\n $time_out = $last_activity_datetime + ($this->configuration->session_expires_minutes * 60);\n\n if ($time_out < time()) {\n $this->error = true;\n session_regenerate_id(true);\n\n //todo time out?\n\n } else {\n $this->setSessionValue('last_activity_datetime', time());\n }\n\n return $this;\n }", "public function setTtl($seconds)\n {\n $this->ttl = min(0, (int)$seconds);\n }", "public function setRequestTtl($ttl);", "function Session(){\n $this->time = time();\n $this->startSession();\n }", "public function setAction()\n {\n self::settingCookie(time() + \\Application_Service_Session_Timeout::getSessionTimeout());\n self::commonFunctionForSetUnsetCookie();\n\n }", "public function regenerateSessionId($destroy = false, $lifetime = null);", "public function invalidate($lifetime = null);", "public function refresh()\n {\n $this->set('refresh', time() + self::REFRESH);\n $this->set('expires', time() + self::EXPIRES);\n\n session_regenerate_id();\n }", "public function setLifetime($name, $hops)\n\t{\n\t\t$this->_validateNamespace();\n\t\t$_SESSION[$this->_name]['m'][(string)$name] = (int)$hops;\n\t}", "public function gcSession($maxLifetime)\n {\n $this->db->delete()\n\t ->table($this->sessionTable)\n\t ->where(['<', 'expire', time()])\n\t ->result();\n\n return true;\n }", "private function Set() {\n $_SESSION[''.$this->name] = serialize($this->session);\n }", "public static function rememberUntil($seconds = 0) {\n\t\t$cookieParams = session_get_cookie_params();\n\n\t\tsession_set_cookie_params(\n\t\t\t$seconds,\n\t\t\t$cookieParams['path'],\n\t\t\t$cookieParams['domain'],\n\t\t\t$cookieParams['secure']\n\t\t);\n\n\t\t// normally \"rememberMe()\" represents a security context change, so should use new session id\n\t\tself::regenerateId();\n\t}", "public function setTtl($ttl) {\n $this->_adapter->setTtl($this->getKey(), $ttl);\n }", "public function setDuration()\n {\n $this->set('duration', $this->getInterval($this->begin, $this->end));\n }", "function session_gc($maxlifetime){\n return true;\n }", "public function setLifeTime($newLifeTime)\n {\n $this->lifeTime = $newLifeTime;\n $this->refreshTime = time() - $newLifeTime;\n\treturn $this;\n }", "public function setSharedMaxAge($ttl)\n {\n $this->shares_max_age = (int) $ttl;\n }", "public function setTimeToLive(int $ttl): self\n {\n $this->ttl = $ttl;\n return $this;\n }", "public function expire()\n {\n }", "function configEtOuvertureSession() {\n $ttl = 1800; // Une heure, en secondes\n $local_sessions_save_path = ini_get('session.save_path').'/sessionGSB';\n \n session_set_cookie_params($ttl);\n ini_set('session.gc_maxlifetime', $ttl);\n ini_set('session.save_path', $local_sessions_save_path);\n return session_start();\n}", "public static function extendSession()\r\n\t{\r\n\t\tif (self::$sSessId != NULL)\r\n\t\t{\r\n//self::debug('EP_Session::extendSession(): extending session ' . self::$sSessId . ' until ' . (time() + self::SESSION_TTL));\r\n\t\t\t$db = self::$oDb;\r\n\r\n\t\t\t$aData = array('time' => time() + self::SESSION_TTL);\r\n\r\n\t\t\t$query = $db->where('id', self::$sSessId);\r\n\t\t\t$query = $db->update(self::TABLE, $aData);\r\n\t\t}\r\n\t}", "public function setCookieTime(){\n $this->cookieExpireTime = time()+250;\n }", "function set_as_session_store($session_expire_time = null){\n if ($session_expire_time != null){\n $this->session_expire_time = $session_expire_time;\n }\n session_set_save_handler(\n array($this, 'session_open'),\n array($this, 'session_close'),\n array($this, 'session_read'),\n array($this, 'session_write'),\n array($this, 'session_destroy'),\n array($this, 'session_gc')\n );\n }", "public function setTTL($seconds)\n {\n $this->ttl = $seconds;\n\n return $this;\n }" ]
[ "0.7120548", "0.6998317", "0.6964429", "0.6918106", "0.6864487", "0.6822981", "0.66772443", "0.65793663", "0.6568525", "0.6526433", "0.64814186", "0.6275364", "0.6268776", "0.6251468", "0.6198105", "0.6193285", "0.6190523", "0.61244243", "0.61118454", "0.6097735", "0.60955536", "0.6089275", "0.59908056", "0.59620464", "0.5938867", "0.59053355", "0.58976525", "0.58656347", "0.5851099", "0.58476436", "0.5825631", "0.58008605", "0.5799785", "0.5793232", "0.5773402", "0.57316035", "0.5697278", "0.5671877", "0.56444937", "0.5615695", "0.56146836", "0.560408", "0.5598628", "0.5593216", "0.55776316", "0.5573848", "0.5571608", "0.5570442", "0.5568023", "0.5552874", "0.5545621", "0.553738", "0.5529997", "0.5521918", "0.5521632", "0.5494782", "0.5465885", "0.54355556", "0.54264927", "0.54010063", "0.537483", "0.537483", "0.5374709", "0.53366053", "0.533369", "0.53274554", "0.5317102", "0.53117293", "0.5311195", "0.5311042", "0.5307242", "0.5303111", "0.5293419", "0.5290591", "0.5276084", "0.5275626", "0.5266102", "0.52631813", "0.5261552", "0.52603656", "0.52562785", "0.52413595", "0.5237631", "0.5233055", "0.52287334", "0.5222752", "0.52208126", "0.52203315", "0.5219136", "0.52156043", "0.52120924", "0.5211396", "0.5195102", "0.5194462", "0.51913786", "0.5180267", "0.51737565", "0.51719457", "0.5159023", "0.5157743" ]
0.71825016
0
Sets the save_path of this Session.
Устанавливает save_path этого сеанса.
public function set_save_path($save_path) { $this->set_default_property(self::PROPERTY_SAVE_PATH, $save_path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSavePath(string $path)\n {\n $this->savePath = rtrim($path, '/');\n }", "public function setSavePath()\n {\n $savePath = $this->app->getDataRoot() . \"upload/\" . date('Ym/', $this->now);\n if(!file_exists($savePath)) @mkdir($savePath, 0777, true);\n $this->savePath = dirname($savePath) . '/';\n }", "protected function setSavePath(string $savePath): void\n {\n if (\n !is_dir($savePath)\n || !is_writable($savePath)\n ) {\n throw new ComponentException('Session path is not writable');\n }\n session_save_path($savePath);\n }", "#[@beforeClass]\n public static function setSessionSavePath() {\n session_save_path(getcwd());\n }", "protected function setSavePath($value) {\n\t\tif(is_dir($value))\n\t\t\tsession_save_path($value);\n\t}", "public function getSavePath()\r\n\t\t{\r\n\t\t\treturn session_save_path();\r\n\t\t}", "public static function GetSavePath() {\n return session_save_path();\n }", "function setSavePath($path) {\n\t\tif (!isset($path) || $path == NULL) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_dir($path) && !@mkdir($path, '0755', $this->_dirMakeRecursive)) {\n\t\t\tdie(\"{error:'mkdir error.', msg:''}\");\t\t\t\n\t\t}\n\t\t\n\t\tif (substr($path, strlen($path)-1) != '/') {\n\t\t\t$this->_FileSavePath = $path.'/';\n\t\t} else {\n\t\t\t$this->_FileSavePath = $path;\n\t\t}\n\t}", "public function get_save_path()\n {\n return $this->get_default_property(self::PROPERTY_SAVE_PATH);\n }", "private function getSessionSavePath() {}", "function getSavePath() {\n\t\treturn $this->_FileSavePath;\n\t}", "public function savePath($path){\n\t\tif(!file_exists($path)){\n\t\t\tmkdir($path,0777,true);\n\t\t}\n\t\t$this->savePath = $path;\n\t\treturn $this;\n\t}", "public static function sessionSavePath($path) {\n if ($path) {\n if ($path[\\strlen($path)-1] !== DIRECTORY_SEPARATOR) {\n $path .= DIRECTORY_SEPARATOR;\n }\n static::$_sessionSavePath = $path;\n if (!\\is_dir($path)) {\n \\mkdir($path, 0777, true);\n }\n }\n return $path;\n }", "private function setSavePath($pathsetting)\n {\n $savePath = $pathsetting . DS . date('Ym', $this->now);\n if(!file_exists($savePath)) @mkdir($savePath, 0777, true);\n $this->savePath = $savePath;\n }", "public function save($path = null);", "public function save()\n {\n if ($this->enabled) {\n session_write_close();\n }\n }", "public function getSavePath(){\n return Yii::getPathOfAlias($this->savePathAlias).DIRECTORY_SEPARATOR;\n }", "private function saveSession() {\n $_SESSION[$this->getIdentifier()][self::SESSION_FILE_NAME] = parent::getFileName();\n $_SESSION[$this->getIdentifier()][self::SESSION_ORIGINAL_FILE_NAME] = $this->_originalFile;\n }", "protected function setSaveHandler()\n {\n // session_set_save_handler($this->driver, true);\n }", "public function setDownloadLocation ($fileSaveLocation)\n {\n // Sanity check that we have a file save location\n if (empty($fileSaveLocation) == true) {\n throw new Exception('No file save location specified');\n }\n\n // Make sure the directory we want to save into exists\n if (file_exists($fileSaveLocation) == false) {\n throw new Exception('File save location does not exist');\n }\n\n // Set the file location to save downloads\n $this->fileSaveLocation = $fileSaveLocation;\n }", "public function setPath($path){\n if(session_status()==PHP_SESSION_NONE){\n session_start();\n }\n $_SESSION['path'] = $path;\n }", "private function setPathAfterLogin(string $path)\n {\n return Session::set(self::SESSION_KEY_PATH_AFTER_LOGIN.$this->name, $path);\n }", "public function save()\n {\n session_write_close();\n }", "public function save()\n {\n session_write_close();\n }", "public function save($path, $name = null);", "protected function getSavePath() {\r\n $path = self::SAVE_FOLDER;\r\n if($this->getTypeQuestionnaire() == self::TYPE_QUESTIONNAIRE_ETUDIANT\r\n && self::SAVE_SUBFOLDER_ETU != '')\r\n {\r\n $path .= '/'. self::SAVE_SUBFOLDER_ETU;\r\n }\r\n elseif ($this->getTypeQuestionnaire() == self::TYPE_QUESTIONNAIRE_MDS\r\n && self::SAVE_SUBFOLDER_MDS != '') {\r\n $path .= '/'. self::SAVE_SUBFOLDER_MDS;\r\n }\r\n \r\n return $path . '/';\r\n }", "public function save()\n {\n $this->driver->save($this);\n }", "public function save()\n {\n $filepath = $this->getFilepath();\n $this->validateConfig($this->rules, $this->configData);\n $fileSystem = $this->createNew(FileSystem::class);\n $fileSystem->filePutContents($filepath, json_encode($this->configData, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));\n }", "function get_save_location() {\n return $this->save_directory . $this->filename;\n }", "public function getSavePath() {\n $savePath = $this->getRuntimeDir() . \"/file-manager\";\n if (!file_exists($savePath)) {\n mkdir($savePath, 0755, true);\n }\n return $savePath;\n }", "function setSessionPath(){\n $currentPath = getcwd();\n ini_set('session.save_path', $currentPath.'/sessionData');\n session_start();\n}", "public function save() {\n $this->saveConfig($this);\n }", "function save($path, array $options = array());", "public function save()\n {\n $this->resetErrorBag();\n\n if ($this->file) {\n $file = File::createAndSave($this->file);\n\n session()->flash('upload-url', $file->resource_url);\n }\n\n $this->reset('file');\n }", "protected function savePath() {\n // return the path if the type is a PUT request\n if ($this->saveType() == 'PUT') {\n return static::NAME . '/' . $this->entity->id . '.json';\n }\n \n // the save request is a post request\n return static::NAME . '.json';\n }", "public function set_path( $path ) {\n\t\t$this->path = $path;\n\t}", "public function save() {\n $cache = Location::get(\\Raptor\\Core\\Location::CACHE);\n if (!file_exists($cache . DIRECTORY_SEPARATOR . $this->name))\n mkdir($cache . DIRECTORY_SEPARATOR . $this->name);\n $this->instanceCache=NULL;\n file_put_contents($cache . DIRECTORY_SEPARATOR . $this->name . DIRECTORY_SEPARATOR . '52753' . $this->name, serialize($this), LOCK_EX);\n \n }", "public function save()\n {\n $_SESSION[SESSION_USER_PROFILE] = $this->profileToString();\n }", "public function save(): string\n {\n return $this->path();\n }", "public function setCookiePath($path) {\r\n session_set_cookie_params($this->ltime,$path,$this->domain,$this->secure);\r\n $this->path = $path;\r\n }", "public function save()\n\t{\n\t\tif (!$this->started || $this->closed) {\n\t\t\tthrow new \\RuntimeException(\"Trying to save a session that was not started yet or was already closed\");\n\t\t}\n\t\t// nothing to do since we don't persist the session data\n\t\t$this->closed = false;\n\t\t$this->started = false;\n\t}", "public static function save(){\n\t\t$_SESSION['saved_url'] = $_SERVER['REQUEST_URI'];\n\t}", "public function setSaveHandler(SaveHandlerInterface $saveHandler);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function save($path = null)\n {\n if($path && is_dir($path)){\n $path .= DIRECTORY_SEPARATOR . $this->filename;\n }\n $this->getPdf()->Output($path, 'F');\n }", "public static function setAfterSsoSignInPath($path)\n {\n self::$_after_sso_sign_in_path = $path;\n }", "public function setPath($path) {\r\n $this->_path = $path;\r\n }", "function session_save_path($path=NULL)\n{\n\treturn '';\n}", "public function setSaveHandler($saveHandler = null){\n\t\tif(!$saveHandler instanceof AbstractProxy &&\n\t\t\t !$saveHandler instanceof NativeSessionHandler &&\n\t\t\t !$saveHandler instanceof \\SessionHandlerInterface &&\n\t\t\t null !== $saveHandler){\n\t\t\tthrow new \\InvalidArgumentException('Must be instance of AbstractProxy or NativeSessionHandler; implement \\SessionHandlerInterface; or be null');\n\t\t}\n\t\t\n\t\tif(!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \\SessionHandlerInterface){\n\t\t\t$saveHandler = new SessionHandlerProxy($saveHandler);\n\t\t}else if(!$saveHandler instanceof AbstractProxy){\n\t\t\t$saveHandler = new SessionHandlerProxy(new \\SessionHandler());\n\t\t}\n\t\t\n\t\t$this->saveHandler = $saveHandler;\n\t\t\n\t\tif($this->saveHandler instanceof \\SessionHandlerInterface){\n\t\t\tsession_set_save_handler($this->saveHandler, false);\n\t\t}\n\t\t\n\t}", "protected function setPath($path) :void\n {\n Storage::makeDirectory($path, true);\n\n $this->path = $path;\n }", "public function save(): void\n {\n file_put_contents($this->filepath, $this->getSerializedStructure());\n }", "function set_path($path) {\n $this->path = $path;\n }", "public function set_path($path)\n {\n $this->path = $path;\n }", "public function save(): void\n {\n $rHandle = fopen($this->sPath, 'wb');\n fwrite($rHandle, $this->sSql);\n fclose($rHandle);\n }", "public final function save()\n {\n }", "function set_save_directory($dir) {\n \n // Normalize (remove trailing slash if present)\n $save_dir = realpath($dir);\n \n // Check if valid\n if(is_dir($save_dir)) {\n \n // Set the save directory with a trailing slash\n $this->save_directory = $save_dir . DIRECTORY_SEPARATOR;\n \n }\n else {\n \n // Error\n throw new Exception(\"Directory does not exist: {$dir}\");\n }\n }", "public function save()\n {\n if (\n ! $this->isStarted()\n ) {\n $this->start();\n }\n\n $this->setWrite(\n false\n );\n\n return session_write_close();\n }", "public function save()\n\t{\n\t\t$cookieName = self::getPersistenceName();\n\n\t\tif(!Cookie::exists($cookieName))\n\t\t{\n\t\t\t$hash = sha1(uniqid(microtime(), true));\n//\t\t\tsetcookie($cookieName, $hash, $this->time->getTimestamp(), '/');\n\t\t\t$cookie = Cookie::create($cookieName, $hash, $this->time);\n\t\t\t$cookie->setPath('/');\n//\t\t\t$cookie->setDomain(CurrentHttpRequest::getInstance()->getHost());\n\t\t\t$cookie->save();\n\n\t\t\t$hashFilePath = Application::getCurrent()->getPath('temp') . \"$hash.persist\";\n\t\t\t$hashFile = File::create($hashFilePath);\n\t\t\t$hashFile->write(\"{$this->data},{$this->time}\");\n\t\t\t$hashFile->close();\n\t\t}\n\t}", "function setPath($path)\n {\n $this->path = $path;\n }", "function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path){\n $this->path = $path;\n }", "function set_path($path) {\n\t\t$this->path = $path;\n\t}", "function save( string $path ) {\n// \t\tif( is_file( $path ) )\n// \t\t\tthrow new \\Exception( \"File with the target directory name '\".$path.\"' exist\" );\n\t\tif( !is_dir( $path ) && !mkdir( $path, 0777, true ) )\n\t\t\t\tthrow new \\Exception( \"Can't create target directory \".$path );\n\t\tif( $this->data === null )\n\t\t\t$this->load();\n\t\t$name = $path.DIRECTORY_SEPARATOR.$this->name;\n\t\tif( file_put_contents( $name, $this->data ) === false )\n\t\t\tthrow new \\Exception( \"Can't write \".$name );\n\t}", "public function save_settings()\n {\n }", "public function saveToClient() {\n\t\t\n\t\t$path = $this->filenameSaveToClient(true) ;\n\t\t$this->isSavedToClient = true;\n\t\t$data = serialize($this);\n\t\t$dir='';\n\t\t$parts = explode('/', $path);\n\t\t$filename = array_pop($parts);\t// lose the filename\n foreach($parts as $part) {\n if (! is_dir($dir .= \"{$part}/\")) mkdir($dir);\n }\n\n\t\tfile_put_contents($path , $data );\n\n\t}", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "static function save() {\n\t\t\tsession_start();\n\n\t\t\t$_SESSION['session::user'] = serialize(self::$user);\n\t\t\t$_SESSION['session::storedVars'] = serialize(self::$storedVars);\n\n\t\t\tsession_write_close();\n\t\t}", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "protected function afterFileSave($path)\n {\n\n }", "protected function savePath() {\n\t\treturn 'components/';\n\t}", "public function save() {\n\t\tupdate_option( self::SAVE_KEY, $this->toArray(), false );\n\t}", "private function saveToSession() {\n\t\t\n\t\t\t$mySession =& DMSession::getSession();\n\t\t\t$mySession->set('user', self::$user);\n\t\t\t\n\t\t}", "protected function _saveToSession()\n {\n }", "public function setPath()\n {\n $this->path = Reflect::getDirectory($this);\n }", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function save()\n\t{\n\t\tif (! $this->keep_old_files) {\n\t\t\t$this->flushDeletes();\n\t\t}\n\n\t\t$this->flushWrites();\n\t}", "public function save() {\n\t\tif ( ! $this->started ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->age_flash_data();\n\n\t\t/* @noinspection PhpParamsInspection */\n\t\t$this->handler->write( $this->get_id(), $this->attributes );\n\n\t\t$this->started = false;\n\t}", "public function setSaveFile($pdf_savefile = '') {\n\t\t\t$this->pdf_savefile = $pdf_savefile;\n\t\t\treturn $this;\n\t\t}", "public function open($save_path, $name) {\n // Force use of main domain, i.e. no sub-domain, for session cookies\n ini_set('session.cookie_domain', str_replace('admin.', '.', Zend_Registry::get('siteDomain')));\n $this->_sessionSavePath = $save_path;\n $this->_sessionName = $name;\n return true;\n }", "public function set_path()\n {\n $this->path=\"upload/$this->id/\";\n }", "public function setSaveToDisk($boolean);" ]
[ "0.77195656", "0.76073104", "0.727949", "0.7058033", "0.7040648", "0.7028991", "0.67939824", "0.67800677", "0.6652912", "0.65821236", "0.65142095", "0.6462034", "0.630569", "0.6298235", "0.62489796", "0.62464786", "0.60834146", "0.60714906", "0.6037438", "0.5808029", "0.5772993", "0.57223547", "0.5700641", "0.5700641", "0.56861746", "0.56742543", "0.5672305", "0.5667077", "0.565276", "0.56435287", "0.5640032", "0.5628006", "0.5627221", "0.5627082", "0.55811626", "0.5574432", "0.55676883", "0.55595887", "0.5542692", "0.5541558", "0.55377", "0.55320424", "0.5518136", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5510408", "0.5507891", "0.5501304", "0.5497524", "0.54944605", "0.5474578", "0.54726017", "0.5460803", "0.5456291", "0.54482746", "0.5445719", "0.5445485", "0.54251", "0.54087734", "0.54044956", "0.5403971", "0.5403971", "0.54038155", "0.53927517", "0.5388671", "0.5387047", "0.53844374", "0.53831834", "0.53831834", "0.5382278", "0.53796995", "0.53796995", "0.53796995", "0.53796995", "0.53796995", "0.53796995", "0.53796995", "0.53796995", "0.5365175", "0.53557706", "0.5347516", "0.5343387", "0.53418714", "0.5332203", "0.5326954", "0.5326954", "0.5326954", "0.5326954", "0.5323807", "0.53224325", "0.5317409", "0.5306634", "0.52980006", "0.52940184" ]
0.7727547
0
Outputs the JQuery for the media uploader
Выводит JQuery для медиа загрузчика
function jsOutput(){ if( get_current_screen()->base != 'nav-menus' ) return; wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); ?> <script type="text/javascript"> jQuery(document).ready(function($) { // Upload function goes here jQuery('.upload_menu_image_button').click(function() { formField = jQuery(this).attr('rel'); tb_show( '', 'media-upload.php?type=image&matcustom=true&TB_iframe=true'); return false ; }); //This will run when the submit button is pressed window.send_to_editor = function(html) { if( formField != null){ imgurl = jQuery('img',html).attr('src'); jQuery('#'+formField).val(imgurl); tb_remove(); } } jQuery(document).keyup( function(e) { if (e.keyCode == 27) formfield=null; }); }); </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_media_script() { \r\n echo \"<script> $.wpMediaUploader(); </script> \";\r\n}", "public function uploadcare_media_upload()\n {\n \\wp_enqueue_script('uc-config');\n \\wp_enqueue_script('admin-js', null, require \\dirname(__DIR__) . '/compiled-js/admin.asset.php');\n $sign = __('Click to upload any file up to 5GB from anywhere', $this->plugin_name);\n $btn = __('Upload via Uploadcare', $this->plugin_name);\n $href = '#';\n\n $scr = \\get_current_screen();\n $isMediaAdd = $scr instanceof \\WP_Screen && $scr->base === 'media' && $scr->action === 'add';\n $styleDef = 'add';\n if (!$isMediaAdd) {\n $href = \\admin_url() . 'media-new.php';\n $sign .= ' <br><strong>' . __('from Wordpress upload page') . '</strong>';\n $styleDef = 'wrap-margin';\n }\n\n echo <<<HTML\n<div class=\"uc-picker-wrapper $styleDef\">\n <p class=\"uploadcare-picker\">\n <a id=\"uploadcare-post-upload-ui-btn\"\n class=\"button button-hero\"\n style=\"background: url('https://ucarecdn.com/assets/images/logo.png') no-repeat 5px 5px; padding-left: 44px;\"\n href=\"$href\">\n $btn\n </a>\n </p>\n <p class=\"max-upload-size\">$sign</p>\n</div>\nHTML;\n }", "function ayecode_admin_media_scripts()\n{\n ?>\n <script>\n jQuery(document).ready(function($) {\n $(document).on('click', '.avatar-image-upload', function(e) {\n e.preventDefault();\n var $button = $(this);\n var file_frame = wp.media.frames.file_frame = wp.media({\n title: 'Select or Upload an Custom Avatar',\n library: {\n type: 'image' // mime type\n },\n button: {\n text: 'Select Avatar'\n },\n multiple: false\n });\n file_frame.on('select', function() {\n var attachment = file_frame.state().get('selection').first().toJSON();\n $button.siblings('#ayecode-custom-avatar').val(attachment.sizes.thumbnail.url);\n $button.siblings('.custom-avatar-preview').attr('src', attachment.sizes.thumbnail.url);\n });\n file_frame.open();\n });\n });\n </script>\n <?php\n}", "public function upload(){\n\t\n\t\t// list of valid extensions, ex. array(\"jpeg\", \"xml\", \"bmp\")\n\t\t$allowedExtensions = array();\n\t\t// max file size in bytes\n\t\t$sizeLimit = 10 * 1024 * 1024;\n\t\t\n\t\t$asset_dir = JPath::clean( JPATH_SITE.DS.'images'.DS.'assets'.DS );\n\t\t$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\n\t\t$result = $uploader->handleUpload($asset_dir);\n\t\t\n\t\t// to pass data through iframe you will need to encode all html tags\n\t\techo htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n\t\t\n\t}", "public function setting_media_input_html() {\n\t\techo '<p id=\"' . $this->setting_key . '\"><span class=\"wp-setting-media' . ( $this->media_has_image() ? ' has-image' : '' ) . '\">' . $this->_media_input_html() . '</span></p>';\n\n\t\t// Enqueue media scripts\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'setting-media', $this->url . 'assets/js/setting-media.js', array( 'media-editor' ), $this->version, true );\n\t\twp_enqueue_style( 'setting-media', $this->url . 'assets/css/setting-media.css', array(), $this->version );\n\n\t\t// Add script to setup the js instance\n\t\twp_add_inline_script( 'setting-media', \"\n/* global wp */\njQuery(document).ready( function( $ ) {\n\tif ( typeof wp.media.wpSettingMedia === 'undefined' )\n\t\treturn;\n\n\t// Setup media selector\n\tif ( $( '.wp-setting-media', '\" . $this->element . \"' ).length ) {\n\t\twp.media.wpSettingMedia( \" . json_encode( $this->get_js_data() ) . \" );\n\t}\n} );\n\" );\n\t}", "function widget( $args, $instance ) {\n\n\n\n $phayCode = '\n\n <div style=\"padding: 4px; overflow:auto; max-width: 90%\">\n <form action=\"http://www.photoalbum-2day.com/fancyupload/server/script.php\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-demo\">\n <div id=\"demo-status\" class=\"hide\">\n\n <input type=\"hidden\" id=\"wpplugin\" name=\"wpplugin\" value=\"yes\" />\n \n <p>\n <table border=0 cellpadding=5 cellspacing=0>\n <tr><td><span id=\"demo-browse\" class=\"phaybtn\">Choose Images</span></td></tr>\n <tr><td><span id=\"demo-clear\" class=\"phaybtn\">Clear List</span></td></tr>\n <tr><td><span id=\"demo-upload\" class=\"phaybtn\">Start Upload</span></td></tr>\n </table>\n <p>\n\n <b>Thumbnails Width</b>\n <select id=\"tw\">\n <option value=\"130\">130</option>\n <option value=\"140\">140</option>\n <option value=\"150\">150</option>\n <option value=\"160\">160</option>\n <option value=\"170\">170</option>\n <option value=\"180\">180</option>\n <option value=\"190\">190</option>\n <option value=\"200\">200</option>\n <option value=\"210\">210</option>\n </select>&nbsp;PX\n\n <div>\n <strong class=\"overall-title\"></strong><br />\n <img src=\"http://www.photoalbum-2day.com/fancyupload/assets/progress-bar/bar.gif\" class=\"progress overall-progress\" />\n </div>\n \n <div>\n <strong class=\"current-title\"></strong><br />\n <img src=\"http://www.photoalbum-2day.com/fancyupload/assets/progress-bar/bar.gif\" class=\"progress current-progress\" />\n </div>\n\n <div class=\"current-text\"></div>\n </div>\n \n <ul id=\"demo-list\"></ul>\n </form>\n </div>\n ';\n\n\n\t\textract( $args );\n\n\t\t/* Our variables from the widget settings. */\n\t\t$title = apply_filters('widget_title', $instance['title'] );\n\t\t$textarea = $phayCode;\n\n\t\t/* Before widget (defined by themes). */\n\t\techo $before_widget;\n\n\t\t/* Display the widget title if one was input (before and after defined by themes). */\n\t\tif ( $title )\n\t\t\techo $before_title . $title . $after_title;\n\n\t\t/* Display name from widget settings if one was input. */\n\t\tif ( $textarea )\n\t\t\techo $textarea;\n\n\t\t/* After widget (defined by themes). */\n\t\techo $after_widget;\n\t}", "public function form_media()\n {\n return $this->load_view('form_media', array(\n 'module' => $this->module,\n 'entry_hash' => $this->encode_entry(),\n 'comment' => ci()->session->flashdata('comment'),\n 'parent_id' => null\n ));\n }", "function my_media_lib_uploader_enqueue() {\n wp_enqueue_media();\n wp_register_script( 'main-js', plugins_url( '/javascript/main.js' , __FILE__ ), array('jquery') );\n wp_enqueue_script( 'main-js' );\n}", "function add_script_upload() {\n\t\techo '\n\t\t<script type=\"text/javascript\">\n\t\tjQuery(document).ready(function($) {\n\t\t\t// add more file\n\t\t\t$(\".rw-add-file\").click(function(){\n\t\t\t\tvar $first = $(this).parent().find(\".file-input:first\");\n\t\t\t\t$first.clone().insertAfter($first).show();\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t// delete file\n\t\t\t$(\".rw-delete-file\").click(function(){\n\t\t\t\tvar $parent = $(this).parent(),\n\t\t\t\t\tdata = $(this).attr(\"rel\");\n\t\t\t\t$.post(ajaxurl, {action: \\'rw_delete_file\\', data: data}, function(response){\n\t\t\t\t\t$parent.fadeOut(\"slow\");\n\t\t\t\t\talert(response);\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t\t</script>';\n\t}", "public function getJqueryFileUploadWidget() {\n\t\treturn $this->jqueryFileUploadWidget;\n\t}", "private function wp_media_uploader( $value ) {\n\t\t$image_stored = isset($this->_saved_options[ $value['id'] ]) ? $this->_saved_options[ $value['id'] ]: null;\n\t\t$this->form_element_start( $value ); \n\t\t// Save Post ID and create function to return first attachment to the post.\n\t\t$id= $value['id'];\n\t\t$post_ID = $this->create_empty_post($value);\n\t\t$button_value = 'Select an Image';\n\t\t?>\n\t\t<div>\n\t\t\t<input type=\"hidden\" option=\"<?php echo $post_ID; ?>\" name=\"<?php echo $id; ?>\" class=\"upload_input\" value=\"<?php echo $image_stored; ?>\"/>\n\t\t\t<div class='upload-image' id='holder-<?php echo $post_ID; ?>' nonce='<?php echo wp_create_nonce( \"set_post_thumbnail-$post_ID\" ); ?>'>\n\t\t\t\t<?php \n\t\t\t\tif( isset( $image_stored ) && false != $image_stored ) {\n\t\t\t\t\t$temp_image = $this->get_upload_image_html( $image_stored );\n\t\t\t\t\tif( false != $temp_image ) {\n\t\t\t\t\t\t$button_value = 'Remove';\n\t\t\t\t\t\techo $temp_image;\n\t\t\t\t\t}\n\t\t\t\t} ?>\n\t\t\t</div>\n\t\t\t<span class=\"submit\"><input name=\"save\" type=\"button\" value=\"<?php echo $button_value;?>\" data=\"<?php echo $value['name']; ?>\" class=\"tk_image_upload button upload_save\" id=\"tkbtn-<?php echo $post_ID; ?>\" rel=\"<?php echo $post_ID; ?>\"/></span>\n\t\t</div>\n\t\t<?php\t\n\t\t$this->form_element_end( $value );\t\n\t}", "function dt_video_uploader_script() {\r\n global $post;\r\n if( empty($post) || 'dt_video' != get_post_type($post->ID) ) {\r\n return false;\r\n }\r\n ?>\r\n <script type=\"text/javascript\">\r\n jQuery(document).ready(function() {\r\n/*\r\n jQuery('#upload_image_button').click(function() {\r\n formfield = jQuery('#dt_video').attr('name');\r\n tb_show('', jQuery(this).attr('href') );\r\n return false;\r\n });\r\n*/\r\n window.send_to_editor = function(html) {\r\n var video = jQuery(html.toString()).attr('href');\r\n jQuery('input[name=\"dt_video_options_video_link\"]').attr('value', video);\r\n tb_remove();\r\n }\r\n/* \r\n jQuery('#remove_image_button').click(function(){\r\n jQuery(this).parent().find('#dt_video').attr('value', '');\r\n return false;\r\n });\r\n*/\r\n });\r\n </script>\r\n <?php\r\n}", "public function run() {\n\t\t$this->id = 'yw'.time().rand(0,99);\n\t\t$this->registerClientScript();\n\t\treturn $this->render('ajax-upload-widget', [\n\t\t\t'model'=>$this->model,\n\t\t\t'attribute'=>$this->attribute,\n\t\t\t'options'=>$this->options\n\t\t]);\n\t}", "public static function get_media($name, $values, $field){\n\t wp_enqueue_script('jquery'); \n wp_enqueue_script('thickbox'); \n wp_enqueue_style('thickbox'); \n wp_enqueue_script('media-upload');\n $id = 'rand_'.rand();\n\t\t?>\n\t\t<ul id=\"<?php echo $id; ?>-values\">\n\t\t\t<?php \n\t\t\t\tforeach($values as $value): \n\t\t\t?>\n\t\t\t\t<input type=\"checkbox\" value=\"<?php echo $value; ?>\" name=\"<?php echo $name; ?>[]\">\n\t\t\t<?php endforeach; ?>\n\t\t</ul>\n\t\t<button id=\"<?php echo $id; ?>\" data-name='<?php echo $name; ?>' data-label='<?php echo $field['label']; ?>'>Add Media</button>\n\t\t<script>\n\t\tjQuery(document).ready(function($) { \n\t\t\tvar $element = $('#<?php echo $id; ?>')\n\t\t\t,\t$values_container = $('#<?php echo $id; ?>-values')\n\t\t\t,\tlabel = $element.data('label')\n\t\t\t,\tname = $element.data('name');\n\t\t\t\n\t\t $element.click(function() { \n\t\t tb_show(label, 'media-upload.php?referer='+name+'&type=image&TB_iframe=true&post_id=0', false); \n\t\t window.send_to_editor = function(html) { \n\t\t\t\t var data = $(html).attr('src'); \n\t\t\t\t $values_container.append(pt_media_render(data)); \n\t\t\t\t tb_remove(); \n\t\t\t\t} \n\t\t return false; \n\t\t }); \n\t\t \n\t\t function pt_media_render(data){\n\t\t \tvar buffer = ''\n\t\t \t,\tid = '_' + Math.random(true);\n\t\t \t\n\t\t\t buffer += '<li>';\n\t\t\t\tbuffer += '<label for=\"'+id+'\">';\n\t\t\t\tbuffer += '<img src=\"'+data+'\">';\n\t\t\t\tbuffer += '<input style=\"position:absolute;left:-20000px;\" type=\"checkbox\" value=\"'+data+'\" name=\"'+name+'[]\" id=\"'+id+'\" checked=\"checked\">';\n\t\t\t\tbuffer += '<p>'+data+'</p>';\n\t\t\t\tbuffer += '</label>';\n\t\t\t\tbuffer += '</li>';\n\t\t\t\treturn buffer;\n\t\t }\n\t\t \n\t\t $values_container.find('input[type=checkbox]').each(function(i, $el){\n\t\t \tvar value = $el.attr('value');\n\t\t \t$el.replaceWith(pt_media_render(value));\n\t\t });\n\t\t}); \n\t\t</script>\n\t\t<?php\n\t}", "function snax_upload_form_render_form_internals() {\n?>\n\t<div id=\"media-items\">\n\t\t<div id=\"media-upload-error\"></div>\n\t</div>\n\n\t<input type=\"hidden\" class=\"snax-uploaded-media-id\" value=\"\" autocomplete=\"off\"/>\n<?php\n}", "protected function fp_js_template_uploadform() {\n return $this->render_from_template('core/filemanager_uploadform', []);\n }", "public function enqueue() {\n debug_log('enqueue control style and JS');\n wp_enqueue_media(); \n wp_register_script( 'eep-control-media-gallery',plugins_url( '/js/ctrl-media-gallery.js', ELEMENTOR_EXTENSION ), array('jquery'), EEP_VERSION, true ); // jquery here, or use jQuery in ctrl..js\n\t wp_enqueue_script( 'eep-control-media-gallery' );//\n }", "public static function optionsframework_media_uploader_function($id,$std,$mod){\n\n\t $as_of = get_option(OPTIONS);\n\t\t\n\t\t$uploader = '';\n\t $upload = isset($as_of[$id]) ? $as_of[$id] : '';\n\t\t$hide = '';\n\t\t\n\t\tif ($mod == \"min\") {$hide ='hide';}\n\t\t\n\t if ( $upload != \"\") { $val = $upload; } else {$val = $std;}\n\t \n\t\t$uploader .= '<input class=\"'.$hide.' upload of-input\" name=\"'. $id .'\" id=\"'. $id .'_upload\" value=\"'. $val .'\" />';\t\n\t\t\n\t\t//Upload controls DIV\n\t\t$uploader .= '<div class=\"upload_button_div\">';\n\t\t//If the user has WP3.5+ show upload/remove button\n\t\tif ( function_exists( 'wp_enqueue_media' ) ) {\n\t\t\t$uploader .= '<span class=\"button media_upload_button\" id=\"'.$id.'\">Upload</span>';\n\t\t\t\n\t\t\tif(!empty($upload)) {$hide = '';} else { $hide = 'hide';}\n\t\t\t$uploader .= '<span class=\"button remove-image '. $hide.'\" id=\"reset_'. $id .'\" title=\"' . $id . '\">Remove</span>';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$output .= '<p class=\"upload-notice\"><i>Upgrade your version of WordPress for full media support.</i></p>';\n\t\t}\n\n\t\t$uploader .='</div>' . \"\\n\";\n\n\t\t//Preview\n\t\t$uploader .= '<div class=\"screenshot\">';\n\t\tif(!empty($upload)){\t\n\t \t$uploader .= '<a class=\"of-uploaded-image\" href=\"'. $upload . '\">';\n\t \t$uploader .= '<img class=\"of-option-image\" id=\"image_'.$id.'\" src=\"'.$upload.'\" alt=\"\" />';\n\t \t$uploader .= '</a>';\t\t\t\n\t\t\t}\n\t\t$uploader .= '</div>';\n\t\t$uploader .= '<div class=\"clear\"></div>' . \"\\n\"; \n\t\n\t\treturn $uploader;\n\t\t\n\t}", "protected function add_media_library_interaction() {\n\t\t\t?>\n\t\t\t<input type=\"hidden\"\n\t\t\t\t name=\"<?php echo esc_attr( $this->item_name ); ?>\"\n\t\t\t\t value=\"<?php echo esc_attr( $this->item_value ); ?>\"\n\t\t\t\t id=\"<?php echo esc_attr( $this->item_name ); ?>\"\n\t\t\t/>\n\t\t\t<div style=\"clear:both;\">\n\t\t\t\t<a id=\"<?php echo esc_attr( $this->item_name ); ?>_upload_button\"\n\t\t\t\t href=\"javascript:void(0)\"\n\t\t\t\t class=\"button\">\n\t\t\t\t\t<?php echo $this->media_frame_title; ?>\n\t\t\t\t</a>\n\t\t\t\t<a id=\"<?php echo esc_attr( $this->item_name ); ?>_remove_button\"\n\t\t\t\t href=\"javascript:void(0)\"\n\t\t\t\t class=\"button\">\n\t\t\t\t\t<?php echo $this->media_frame_remove; ?>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tvar frame_<?php echo esc_attr( $this->item_name ); ?>;\n\n\t\t\t\tfunction set_selection_<?php echo esc_attr( $this->item_name ); ?>() {\n\t\t\t\t\tselection = frame_<?php echo esc_attr( $this->item_name ); ?>.state().get('selection');\n\t\t\t\t\tmedia_ids = jQuery(\"#<?php echo esc_attr( $this->item_name ); ?>\").val();\n\t\t\t\t\tmedia_ids = media_ids.split(',');\n\t\t\t\t\tmedia_ids.forEach(\n\t\t\t\t\t\tfunction (id) {\n\t\t\t\t\t\t\tattachment = wp.media.attachment(id);\n\t\t\t\t\t\t\tattachment.fetch();\n\t\t\t\t\t\t\tselection.add(attachment ? [attachment] : []);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>_upload_button').on('click', function () {\n\t\t\t\t\t\tif (frame_<?php echo esc_attr( $this->item_name ); ?>) {\n\t\t\t\t\t\t\tset_selection_<?php echo esc_attr( $this->item_name ); ?>();\n\t\t\t\t\t\t\tframe_<?php echo esc_attr( $this->item_name ); ?>.open();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tframe_<?php echo esc_attr( $this->item_name ); ?> = wp.media.frames.frame_<?php echo esc_attr( $this->item_name ); ?> = wp.media({\n\t\t\t\t\t\t\t\ttitle: '<?php echo $this->media_frame_title; ?>',\n\t\t\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\t\t\ttext: '<?php echo $this->media_frame_button; ?>'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlibrary: {\n\t\t\t\t\t\t\t\t\ttype: ['<?php echo implode( '\\',\\'', explode( ',', $this->media_types ) ); ?>']\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tmultiple: <?php echo 'number' === $this->data_type ? 'false' : 'true'; ?>\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tframe_<?php echo esc_attr( $this->item_name ); ?>.on('select', function () {\n\t\t\t\t\t\t\t\tif ('number' === '<?php echo esc_attr( $this->data_type ); ?>') {\n\t\t\t\t\t\t\t\t\tattachment = frame_<?php echo esc_attr( $this->item_name ); ?>.state().get('selection').first().toJSON();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tattachment = frame_<?php echo esc_attr( $this->item_name ); ?>.state().get('selection').toJSON();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tget_selection_<?php echo esc_attr( $this->item_name ); ?>(attachment);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tframe_<?php echo esc_attr( $this->item_name ); ?>.open();\n\t\t\t\t\t\t\tset_selection_<?php echo esc_attr( $this->item_name ); ?>();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>_remove_button').on('click', function () {\n\t\t\t\t\t\tjQuery('#media_container_<?php echo esc_attr( $this->item_name ); ?>').empty();\n\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val('');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}", "function media_selector_print_scripts($hook) {\n //echo serialize($hook);\n $logo = krs_options();\n\n\t?><script type='text/javascript'>\n\n\t\tjQuery( document ).ready( function( $ ) {\n\n\t\t\t// Uploading files\n\t\t\tvar file_frame,\n previous_logo_id = <?php echo $logo['id']; ?>,\n selected_logo_id = previous_logo_id; // Set this\n\n function newSelection(id, url) {\n if (selected_logo_id === id) return;\n $( '#image-preview' ).attr( 'src', url ).css( 'width', 'auto' );\n $( '#image_attachment_id' ).val( id );\n selected_logo_id = id;\n $('#krs_save').prop('disabled', previous_logo_id === selected_logo_id);\n }\n\n $('#use_default_logo_button').on('click', function(){\n newSelection(-1, '<?php echo KRS_LOGO; ?>');\n });\n\n\t\t\t$('#select_logo_button').on('click', function(){\n\t\t\t\t// If the media frame already exists, reopen it.\n\t\t\t\tif ( !file_frame ) {\n \t\t\t\t// Create the media frame.\n \t\t\t\tfile_frame = wp.media.frames.file_frame = wp.media({\n \t\t\t\t\ttitle: 'Select logo',\n \t\t\t\t\tbutton: {\n \t\t\t\t\t\ttext: 'Use this image',\n \t\t\t\t\t},\n \t\t\t\t\tmultiple: false\t// Set to true to allow multiple files to be selected\n \t\t\t\t});\n\n \t\t\t\t// When an image is selected, run a callback.\n \t\t\t\tfile_frame.on( 'select', function() {\n \t\t\t\t\t// We set multiple to false so only get one image from the uploader\n \t\t\t\t\tvar attachment = file_frame.state().get('selection').first();\n newSelection(attachment.get('id'), attachment.get('url'));\n \t\t\t\t});\n }\n\t\t\t\t// Finally, open the modal\n\t\t\t\tfile_frame.open();\n\t\t\t});\n\t\t});\n\n\t</script><?php\n\n}", "public function slgf_admin_print_scripts() {\n wp_enqueue_script('media-upload');\n wp_enqueue_script('slgf-media-uploader-js', WEBLIZAR_SLGF_PLUGIN_URL . 'js/slgf-multiple-media-uploader.js', array('jquery'));\n\t\twp_enqueue_media();\n\t\t//custom add image box css\n\t\twp_enqueue_style('slgf-meta-css', WEBLIZAR_SLGF_PLUGIN_URL.'css/rpg-meta.css');\n\n\t\t//font awesome css\n\t\twp_enqueue_style('slgf-font-awesome-4', WEBLIZAR_SLGF_PLUGIN_URL.'css/font-awesome-latest/css/font-awesome.min.css');\n\n\t\t//single media uploader js\n\t\twp_enqueue_script('slgf-media-uploads',WEBLIZAR_SLGF_PLUGIN_URL.'js/slgf-media-upload-script.js',array('media-upload','thickbox','jquery'));\n }", "public function upload_scripts() {\n // Scripts\n wp_enqueue_script('media-upload');\n wp_enqueue_script('thickbox');\n wp_enqueue_script('widget_media_upload', plugin_dir_url(__FILE__) . 'upload-media.js', array('jquery'));\n // Css\n wp_enqueue_style('thickbox');\n }", "public function upload_scripts()\n {\n wp_enqueue_script('media-upload');\n wp_enqueue_script('thickbox');\n wp_enqueue_script('upload_media_widget', get_template_directory_uri(). '/assets/js/upload-media.js', array('jquery'));\n wp_enqueue_style('thickbox');\n }", "public function render()\n {\n if ($this->picker) {\n $this->renderMediaPicker();\n }\n\n $this->options(['overwriteInitial' => true, 'msgPlaceholder' => trans('admin.choose_file')]);\n\n $this->setupDefaultOptions();\n\n if (!empty($this->value)) {\n $this->attribute('data-files', $this->value);\n $this->attribute('data-file-captions', $this->initialCaption($this->value));\n\n $this->setupPreviewOptions();\n /*\n * If has original value, means the form is in edit mode,\n * then remove required rule from rules.\n */\n unset($this->attributes['required']);\n }\n\n $this->setupScripts();\n\n return parent::render();\n }", "function gwyns_imagemap_selector_enqueue_admin_scripts() {\n\twp_enqueue_script('jquery');\n\twp_enqueue_script('jquery-colorPicker', plugins_url() . '/gwyns-imagemap-selector/imagemap-creator/js/jquery.colorPicker.js');\n\twp_enqueue_media();\n\t// wp_enqueue_script('media-upload');\n\t// wp_enqueue_script('thickbox');\n?>\n<script type=\"text/javascript\">\n// Deals with calling the WordPress Media popup box\nfunction myMediaPopupHandler()\n{\n\tevent.preventDefault();\n\n\tframe = wp.media({\n\t\ttitle:\t '<?php _e('Choose', 'gwyns-imagemap-selector'); ?>',\n\t\tlibrary:\t {\t\t\t\t \n\t\t}\n\t});\n\n\tframe.on( 'toolbar:render:select', function(view) {\n\t\tview.set({\n\t\t\tselect: {\n\t\t\t\tstyle: 'primary',\n\t\t\t\ttext: '<?php _e('Choose', 'gwyns-imagemap-selector'); ?>',\n\t\t\t\tclick: function() {\n\t\t\t\t\tvar attachment = frame.state().get('selection').first();\t\t\t\t\t\t\t\t\t\tjQuery('#upload_image').val(attachment.attributes.url);\t\t\t\t\t\t\t\t\t\t\tframe.close();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n \n\tframe.setState('library').open();\n \nreturn false;\n}\n</script>\n<?php\n}", "public function enqueue_media_scripts() {\n\n\t\tif ( _has_run( __METHOD__ ) ) return;\n\n\t\t$args = [];\n\t\tif ( $this->is_post_edit() ) {\n\t\t\t$args['post'] = $this->get_the_real_admin_ID();\n\t\t}\n\t\t\\wp_enqueue_media( $args );\n\n\t\t//! PHP 5.4 compat: put in var.\n\t\t$scripts = $this->Scripts();\n\t\t$scripts::register( [\n\t\t\t'id' => 'tsf-media',\n\t\t\t'type' => 'js',\n\t\t\t'deps' => [ 'jquery', 'tsf' ],\n\t\t\t'autoload' => true,\n\t\t\t'name' => 'media',\n\t\t\t'base' => THE_SEO_FRAMEWORK_DIR_URL . 'lib/js/',\n\t\t\t'ver' => THE_SEO_FRAMEWORK_VERSION,\n\t\t\t'l10n' => [\n\t\t\t\t'name' => 'tsfMediaL10n',\n\t\t\t\t'data' => [\n\t\t\t\t\t'labels' => [\n\t\t\t\t\t\t'social' => [\n\t\t\t\t\t\t\t'imgSelect' => \\esc_attr__( 'Select Image', 'autodescription' ),\n\t\t\t\t\t\t\t'imgSelectTitle' => \\esc_attr_x( 'Select social image', 'Button hover', 'autodescription' ),\n\t\t\t\t\t\t\t'imgChange' => \\esc_attr__( 'Change Image', 'autodescription' ),\n\t\t\t\t\t\t\t'imgRemove' => \\esc_attr__( 'Remove Image', 'autodescription' ),\n\t\t\t\t\t\t\t'imgRemoveTitle' => \\esc_attr__( 'Remove selected social image', 'autodescription' ),\n\t\t\t\t\t\t\t'imgFrameTitle' => \\esc_attr_x( 'Select Social Image', 'Frame title', 'autodescription' ),\n\t\t\t\t\t\t\t'imgFrameButton' => \\esc_attr__( 'Use this image', 'autodescription' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'logo' => [\n\t\t\t\t\t\t\t'imgSelect' => \\esc_attr__( 'Select Logo', 'autodescription' ),\n\t\t\t\t\t\t\t'imgSelectTitle' => '',\n\t\t\t\t\t\t\t'imgChange' => \\esc_attr__( 'Change Logo', 'autodescription' ),\n\t\t\t\t\t\t\t'imgRemove' => \\esc_attr__( 'Remove Logo', 'autodescription' ),\n\t\t\t\t\t\t\t'imgRemoveTitle' => \\esc_attr__( 'Unset selected logo', 'autodescription' ),\n\t\t\t\t\t\t\t'imgFrameTitle' => \\esc_attr_x( 'Select Logo', 'Frame title', 'autodescription' ),\n\t\t\t\t\t\t\t'imgFrameButton' => \\esc_attr__( 'Use this image', 'autodescription' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t] );\n\t}", "function ajax_mediadetails(){\n global $IMG, $JUMPTO, $REV, $fullscreen, $INPUT;\n $fullscreen = true;\n require_once(DOKU_INC.'lib/exe/mediamanager.php');\n\n $image = '';\n if ($INPUT->has('image')) $image = cleanID($INPUT->str('image'));\n if (isset($IMG)) $image = $IMG;\n if (isset($JUMPTO)) $image = $JUMPTO;\n $rev = false;\n if (isset($REV) && !$JUMPTO) $rev = $REV;\n\n html_msgarea();\n tpl_mediaFileDetails($image, $rev);\n}", "protected function add_media_library_selection() {\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tfunction get_selection_<?php echo esc_attr( $this->item_name ); ?>(attachment) {\n\t\t\t\t\tvar media_container = jQuery('#media_container_<?php echo esc_attr( $this->item_name ); ?>');\n\t\t\t\t\tmedia_container.empty();\n\t\t\t\t\tif ('number' === '<?php echo esc_attr( $this->data_type ); ?>') {\n\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val(attachment.id);\n\t\t\t\t\t\tmedia_container.append('<span style=\"float:left;padding:10px;text-align:center;\"><a href=\"' + attachment.url + '\" target=\"_blank\"><img src=\"' + attachment.icon + '\"><br/>' + attachment.title + '</a></span>');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val('');\n\t\t\t\t\t\tfor (var i = 0; i < attachment.length; ++i) {\n\t\t\t\t\t\t\tif (attachment[i].id !== '') {\n\t\t\t\t\t\t\t\tif (jQuery('#<?php echo esc_attr( $this->item_name ); ?>').val() === '') {\n\t\t\t\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val(attachment[i].id);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val(\n\t\t\t\t\t\t\t\t\t\tjQuery('#<?php echo esc_attr( $this->item_name ); ?>').val() + ',' + attachment[i].id\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\tmedia_container.append('<span style=\"float:left;padding:10px;text-align:center;\"><a href=\"' + attachment[i].url + '\" target=\"_blank\"><img src=\"' + attachment[i].icon + '\"><br/>' + attachment[i].title + '</a></span>');\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}\n\t\t\t</script>\n\t\t\t<?php\n\t\t}", "public function render_content() {\r\n\t$id = str_replace( '[', '-', str_replace( ']', '', $this->id ) );\r\n ?>\r\n \r\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\r\n \t\r\n <div id=\"<?php echo $id; ?>_preview\" class=\"control_gallery_preview\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$value = $this->value();\r\n\t\t\t\tif(!empty($value)){\r\n\t\t\t\t\t\t$sliderimgs = $value;\r\n\t\t\t\t\t\t$args = array(\r\n\t\t\t\t\t\t\t'post_type' => 'attachment',\r\n\t\t\t\t\t\t\t'post__in' => explode(',', $sliderimgs), \r\n\t\t\t\t\t\t\t'posts_per_page' => 99,\r\n\t\t\t\t\t\t\t'order' => 'menu_order ID',\r\n\t\t\t\t\t\t\t'orderby' => 'post__in',\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$attachments = get_posts( $args );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach ( $attachments as $attachment ) {\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t$imgsrc = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );\r\n\t\t\t\t\t\t\techo '<img class=\"gallery_preview_thumb\" src=\"'.$imgsrc[0].'\" />';\r\n\t\t\t\t\r\n\t\t\t\t\t\t }\r\n\t\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t\techo '<span class=\"gallery_empty\">'.__('No Images Added','optimizer').'</span>';\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t?>\r\n </div>\r\n <label> \r\n\t\t\t<button type=\"button\" class=\"button upload-button control_gallery_clear\" id=\"<?php echo $id; ?>_clear\"><?php _e('Clear', 'optimizer');?></button>\r\n <button type=\"button\" class=\"button upload-button\" id=\"<?php echo $id; ?>_add_slides\"><?php _e('Add Slides', 'optimizer');?></button>\r\n <input <?php $this->link(); ?> type=\"hidden\" id=\"<?php echo $id; ?>\" value=\"<?php $this->value(); ?>\" />\r\n </label>\r\n <script type=\"text/javascript\">\r\n\t\t\tjQuery(document).ready(function($){\r\n\t\t\t\t var custom_uploader;\r\n\t\t\t\t $(\"#<?php echo $id; ?>_add_slides\").click(function(e) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\t\t\t//If the uploader object has already been created, reopen the dialog\r\n\t\t\t\t\tif (custom_uploader) {\r\n\t\t\t\t\t\tcustom_uploader.open();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar val = $('#<?php echo $id; ?>').val();\r\n\t\t\t\t\tif ( !val ) {\r\n\t\t\t\t\t\tfinal = '[gallery ids=\"0\"]';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinal = '[gallery ids=\"' + val + '\"]';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar custom_uploader = wp.media.gallery.edit( final );\r\n/*\t\t\t\t\tvar custom_uploader = wp.media({\r\n\t\t\t\t\t\t\t\tid: 'slider-window', \r\n\t\t\t\t\t\t\t\tframe: 'post',\r\n\t\t\t\t\t\t\t\tstate: 'gallery-edit',\r\n\t\t\t\t\t\t\t\ttitle: wp.media.view.l10n.editGalleryTitle,\r\n\t\t\t\t\t\t\t\tediting: true,\r\n\t\t\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t});\r\n\t\t\t*/\r\n\t\t\t\t\t\r\n\t\t\t\t\tcustom_uploader.on('update', function( selection ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#<?php echo $id; ?>_preview .gallery_preview_thumb').hide();\r\n\t\t\t\t\t\t//var numberlist = []; \r\n\r\n\t\t\t\t\t\t\t//console.log(selection.models);\r\n\t\t\t\t\t\t\tvar ids = selection.models.map(\r\n\t\t\t\t\t\t\t\tfunction( e ) {\r\n\t\t\t\t\t\t\t\t\telement = e.toJSON();\r\n\t\t\t\t\t\t\t\t\tpreview_img = typeof element.sizes.thumbnail !== 'undefined' ? element.sizes.thumbnail.url : element.url;\r\n\t\t\t\t\t\t\t\t\tpreview_html = \"<img class='gallery_preview_thumb' src=\" +preview_img+\">\";\r\n\t\t\t\t\t\t\t\t\t$( '#<?php echo $id; ?>_preview' ).append( preview_html );\r\n\t\t\t\t\t\t\t\t\t$( '#<?php echo $id; ?>_preview .gallery_empty' ).hide();\r\n\t\t\t\t\t\t\t\t\treturn e.id;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Insert Attachment ids in the Input field and Refresh the Customizer\r\n\t\t\t\t\t\t\tvar control_key = $('#<?php echo $id; ?>').data('customize-setting-link');\r\n\t\t\t\t\t\t\tvar currentval = $('#<?php echo $id; ?>').val();\r\n\t\t\t\t\t\t\tvar updatedval = ids.join(\",\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(currentval == updatedval){\r\n\t\t\t\t\t\t\t\twp.customize(control_key, function(obj) {\r\n\t\t\t\t\t\t\t\t\tobj.set(ids.join(\", \"));\r\n\t\t\t\t\t\t\t\t} );\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\twp.customize(control_key, function(obj) {\r\n\t\t\t\t\t\t\t\t\tobj.set(ids.join(\",\"));\r\n\t\t\t\t\t\t\t\t} );\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t//Open the uploader dialog\r\n\t\t\t\t\tif(jQuery(this).attr('id') == 'nivo_accord_slider_add_slides'){\r\n\t\t\t\t\t\tcustom_uploader.open( jQuery('#'+custom_uploader.el.id).addClass('gallery-window'));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcustom_uploader.open( jQuery('#'+custom_uploader.el.id).addClass('gall-window'));\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\t\t$(document).on(\"click\", \"#<?php echo $id; ?>_trigger\", function(e) {\r\n\t\t\t\t\t\t\tconsole.log('Gallery Clicked!');\r\n $('#<?php echo $id; ?>').trigger( 'change' );\r\n });\r\n\t\t\t\t\r\n\t\t\t\t//Clear the Images\r\n\t\t\t\t$('#<?php echo $id; ?>_clear').click(function(e) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t//Insert Attachment ids in the Input field and Refresh the Customizer\r\n\t\t\t\t\tvar control_key = $('#<?php echo $id; ?>').data('customize-setting-link');\r\n\t\t\t\t\t\twp.customize(control_key, function(obj) {\r\n\t\t\t\t\t\t\tobj.set('');\r\n\t\t\t\t\t} );\r\n\t\t\t\t\t//remove the preview\r\n\t\t\t\t\t$('#<?php echo $id; ?>_preview .gallery_preview_thumb').remove();\r\n\t\t\t\t\t$( '#<?php echo $id; ?>_preview .gallery_empty' ).show();\r\n\t\t\t\t});\r\n\r\n\t\t\t});\r\n </script>\r\n <style type=\"text/css\">\r\n\t\t\r\n\t\t\r\n\t\t.gall-window .collection-settings.gallery-settings, .gallery-window .collection-settings.gallery-settings{ display:none;} /*Hides The Gallery Settings*/\r\n\t\t\r\n\t\t.gallery-window .attachments-browser .media-toolbar{right: 400px;}\r\n\t\t.gallery-window .attachments-browser .attachments{right: 380px;}\r\n\t\t.gallery-window .media-sidebar{ width: 367px;}\r\n\t\t\r\n\t\t.gallery-window li.attachment input.describe{display: none!important;}\r\n\t\t.gallery-window .attachment-info .details{ float:none;}\r\n\t\t/*Change Field Names*/\r\n\t\t.gallery-window [data-setting=\"url\"]{ display:none;} \r\n\t\t.gallery-window [data-setting=\"caption\"] .name, .gallery-window [data-setting=\"alt\"] .name, .gallery-window [data-setting=\"description\"] .name{ color:#f3f3f3!important;}\r\n\t\t.gallery-window .attachment-details .setting input[type=text], .gallery-window .attachment-details .setting textarea{ width:99%;}\r\n\t\t.gallery-window .media-sidebar .setting .name { max-width: none; width: 100%; font-size: 14px; font-weight: bold; text-align: left;}\r\n\t\t\r\n\t\t.gallery-window [data-setting=\"caption\"] .name:after{content:\"<?php _e('Description','optimizer'); ?>\"; margin-top:-20px; color:#666; display: block;}\r\n\t\t.gallery-window [data-setting=\"alt\"] .name:after{content:\"<?php _e('Button Text','optimizer'); ?>\"; margin-top:-20px; color:#666; display: block;}\r\n\t\t.gallery-window [data-setting=\"description\"] .name:after{content:\"<?php _e('Button Link','optimizer'); ?>\"; margin-top:-20px; color:#666; display: block;}\r\n\t\t.gallery-window [data-setting=\"description\"] textarea{ height:30px;}\r\n\t\t\r\n\t\t.gallery-window .media-frame-title h1 { width: 0px; overflow: hidden; color: transparent;}\r\n\t\t.gallery-window .media-frame-title h1:before { content: \"<?php _e('Slider Settings','optimizer'); ?>\"; color: #333; width: 170px; position: absolute;}\r\n\t\t.gallery-window .media-frame:not(.hide-menu) .media-frame-title .dashicons { color: #21759b; position: absolute;top: 4px; left: 125px;}\r\n\t\t.gallery-window .media-frame-menu .media-menu-item, .gallery-window .media-frame-menu .media-menu-item.active, .gallery-window .media-frame-menu .media-menu-item:hover { color: transparent!important;}\r\n\t\t.gallery-window .media-frame-menu .media-menu a.active {background-color: #E7E7ED;}\r\n\t\t.gallery-window .media-frame-menu .media-menu a:nth-child(1):before { content: \"<?php _e('< Cancel Slider','optimizer'); ?>\"; color: #888; width: 120px;}\r\n\t\t.gallery-window .media-frame-menu .media-menu a:nth-child(3):before { content: \"<?php _e('Edit Slider','optimizer'); ?>\"; color: #888; width: 120px;}\r\n\t\t.gallery-window .media-frame-menu .media-menu a:nth-child(4):before { content: \"<?php _e('Add to Slider','optimizer'); ?>\"; color: #888; width: 120px;}\r\n\t\t.gallery-window .media-button-insert{ text-indent: -9999px; line-height: 0; overflow: hidden;}\r\n\t\t.gallery-window .media-button-insert:before { content: \"<?php _e('Update','optimizer'); ?>\"; text-indent: 0; line-height: 27px; display: block;}\r\n </style>\r\n <?php }", "public function setKbMedia()\n {\n $this->context->controller->addJs($this->getModuleDirUrl() . 'spinwheel/views/js/velovalidation.js');\n $this->context->controller->addJs($this->getModuleDirUrl() . 'spinwheel/views/js/admin/spin_wheel_admin.js');\n $this->context->controller->addCSS($this->getModuleDirUrl() . 'spinwheel/views/css/admin/spin_wheel_admin.css');\n $this->context->controller->addJs($this->getModuleDirUrl() . 'spinwheel/views/js/admin/spin_wheel_validations.js');\n $this->context->controller->addJqueryPlugin('flot');\n }", "function my_media_lib_uploader_enqueue() {\n\twp_enqueue_media();\n\twp_register_script( 'age-gate-js', plugins_url( 'admin/assets/agegate.js' , __FILE__ ), array('jquery') );\n\twp_enqueue_script( 'age-gate-js' );\n}", "public function renderUploadForm() {}", "public function showJqueryImageUpload()\n {\n $wCond = array(\"topic_name\"=>\"Entrepreneurship\");\n $topic1_id = DHelpers::get_record_value(\"si_topic_master\",\"top_id\",$wCond);\n \n return view('demo');\n }", "function ghostpool_category_media_field( $option, $term_meta ) { \n \t\t\t\n\t// Load scripts\n\twp_enqueue_media();\n\t\n\t?>\n\t<script>\n\tjQuery( document ).ready( function( $ ) {\n\t\tvar mediaUploader;\n\t\t$( '#gp_upload_image_<?php echo esc_attr( $option[\"id\"] ); ?>' ).click( function( e ) {\n\t\t\te.preventDefault();\n\t\t\tif ( mediaUploader ) {\n\t\t\t\tmediaUploader.open();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmediaUploader = wp.media.frames.file_frame = wp.media({\n\t\t\t\ttitle: '<?php esc_html_e( \"Choose Image\", \"socialize\" ); ?>',\n\t\t\t\tbutton: {\n\t\t\t\t\ttext: '<?php esc_html_e( \"Choose Image\", \"socialize\" ); ?>'\n\t\t\t\t}, \n\t\t\t\tmultiple: false \n\t\t\t});\n\t\t\tmediaUploader.on( 'select', function() {\n\t\t\t\tvar attachment = mediaUploader.state().get( 'selection' ).first().toJSON();\n\t\t\t\t$( '#gp_term_meta_<?php echo esc_attr( $option[\"id\"] ); ?>' ).val( attachment.url );\n\t\t\t\t$( '#gp-cat-image-preview-<?php echo esc_attr( $option[\"id\"] ); ?>' ).show();\n\t\t\t\t$( '#gp-cat-image-preview-<?php echo esc_attr( $option[\"id\"] ); ?> img' ).attr( 'src', attachment.sizes.thumbnail.url );\n\t\t\t\t$( '#gp-remove-image-<?php echo esc_attr( $option[\"id\"] ); ?>' ).show();\n\t\t\t});\n\t\t\tmediaUploader.open();\n\t\t});\n\t\t$( '#gp-remove-image-<?php echo esc_attr( $option[\"id\"] ); ?>' ).click( function( e ) {\n\t\t\te.preventDefault();\n\t\t\t$( '#gp_term_meta_<?php echo esc_attr( $option[\"id\"] ); ?>' ).val( '' );\n\t\t\t$( '#gp-cat-image-preview-<?php echo esc_attr( $option[\"id\"] ); ?>' ).hide();\n\t\t\t$( this ).hide();\n\t\t});\n\t});\n\t</script>\n\n\t<?php \n\t$image_thumb = '';\n\tif ( isset( $term_meta[$option['id']] ) ) {\n\t\tglobal $wpdb;\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $term_meta[$option['id']] ) ); \n\t\t$image_id = isset( $attachment[0] ) ? $attachment[0] : ''; \n\t\tif ( $image_id ) {\n\t\t\t$image_thumb = wp_get_attachment_image_src( $image_id, 'thumbnail' );\t\n\t\t\t$image_thumb = isset( $image_thumb[0] ) ? $image_thumb[0] : '';\n\t\t}\n\t} ?>\n\n\t<div id=\"gp-cat-image-preview-<?php echo esc_attr( $option['id'] ); ?>\" class=\"gp-cat-image-preview\"<?php if ( isset( $term_meta[$option['id']] ) ) { ?> style=\"display: block;\"<?php } ?>>\n\t\t<img src=\"<?php echo $image_thumb; ?>\" alt=\"\" />\n\t</div>\n\n\t<input type=\"button\" id=\"gp_upload_image_<?php echo esc_attr( $option[\"id\"] ); ?>\" class=\"gp-upload-image-button button button-primary\" value=\"<?php if ( isset( $term_meta[$option['id']] ) ) { esc_attr_e( 'Change Image', 'socialize' ); } else { esc_attr_e( 'Add Image', 'socialize' ); } ?>\" />\n\t<?php if ( isset( $term_meta[$option['id']] ) ) { ?>\n\t\t<a class=\"gp-remove-image-button\" id=\"gp-remove-image-<?php echo esc_attr( $option[\"id\"] ); ?>\" href=\"#\"><?php esc_attr_e( 'Remove Image', 'socialize' ); ?></a>\n\t<?php } ?>\n\n\t<input id=\"gp_term_meta_<?php echo esc_attr( $option['id'] ); ?>\" type=\"hidden\" name=\"gp_term_meta[<?php echo esc_attr( $option['id'] ); ?>]\" value=\"<?php echo esc_attr( isset( $term_meta[$option['id']] ) ? $term_meta[$option['id']] : '' ); ?>\" />\n\t<p class=\"description\"><?php echo esc_attr( $option['desc'] ); ?></p>\n\t\n<?php }", "public static function bamobile_mobiconnector_media_upload_scripts() {\r\n global $current_user,$pagenow,$post;\r\n $user = ($pagenow == 'user-edit.php' && isset($_GET['user_id'])) ? get_user_by('id', $_GET['user_id']) : $current_user;\r\n $avatar_default = self::bamobile_get_gravatar_url($user->user_email);\r\n wp_register_script('mobiconnector_avatar_js', plugins_url('assets/js/mobiconnector-avatar.js',MOBICONNECTOR_PLUGIN_FILE), array('jquery'), MOBICONNECTOR_VERSION);\t\r\n\t\t$setting = array(\r\n\t\t\t'current_user' => $user,\r\n 'default_avatar' => $avatar_default\r\n\t\t);\t\r\n\t\twp_localize_script( 'mobiconnector_avatar_js', 'mobiconnector_avatar_js_params', $setting );\r\n\t\twp_enqueue_script( 'mobiconnector_avatar_js' );\r\n wp_enqueue_media(array('post' => $post));\r\n wp_register_style( 'mobiconnector-avatar-style', plugins_url('assets/css/mobiconnector-avatar.css',MOBICONNECTOR_PLUGIN_FILE), array(), MOBICONNECTOR_VERSION, 'all' );\r\n\t\twp_enqueue_style( 'mobiconnector-avatar-style' );\r\n \r\n }", "function bio_get_image() {\n\t\twp_enqueue_script('jquery');\n\t\twp_enqueue_media();\n?>\n\t\t<script type=\"text/javascript\">\n\t\t\tjquery(document).ready(function($) {\n\t\t\t\t$('.pilih-foto').click(function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar image = wp.media({\n\t\t\t\t\t\ttitle\t\t: 'Pilih Foto',\n\t\t\t\t\t\tmultiple\t: false\n\t\t\t\t\t}).open()\n\t\t\t\t\t.on('select', function(e) {\n\t\t\t\t\t\tvar uploaded_image = image.state().get('selection').first();\n\t\t\t\t\t\tvar image_url = uploaded_image.tojson().url;\n\t\t\t\t\t\t$('#foto').val(image_url);\n\t\t\t\t\t\t$('#tampil-foto').html('<img src=\"' + image_url + '\" width=\"150\">');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n<?php\n\t}", "function upload_test_upload_form () {\n\t//echos the tabs at the top of the media window\n\tmedia_upload_header();\n\n\t//Adds your javascript\n\tupload_test_scripts();\n\t?>\n\t<div class=\"test-form\">\n\t\t<input type='text' id='name' />\n\t\t<input id='insert_shortcode' type='button' class='button' value='Insert Shortcode'>\n\t</div> \t\n\n<?php }", "function WPBikeRent_Theme_uploadmedia() {\n\t\tif ( ! did_action( 'wp_enqueue_media' ) ) {\n\t\t\twp_enqueue_media();\n\t\t}\n\t \n\t\twp_enqueue_script( 'custom_js', get_stylesheet_directory_uri().'/js/custom.js');\n\t}", "public function media_meta_box() {\n\t\tglobal $post_id;\n\n\t\t$media = get_post_meta( $post_id, '_attached_media', true );\n\n\t\t$html = '<input type=\"hidden\" name=\"' . esc_attr( $this->token . '_nonce' ) . '\" id=\"' . esc_attr( $this->token . '_nonce' ) . '\" value=\"' . esc_attr( wp_create_nonce( plugin_basename( $this->file ) ) ) . '\" />';\n\n\t\t$html .= '<table class=\"form-table\" id=\"sensei_media_attachments\">' . \"\\n\";\n\t\t$html .= '<tbody>' . \"\\n\";\n\n\t\t$c = 0;\n\t\tif( isset( $media ) && is_array( $media ) && count( $media ) > 0 ) {\n\t\t\tforeach( $media as $k => $file ) {\n\t\t\t\tif( $c == 0 ) {\n\t\t\t\t\t$html .= '<tr valign=\"top\">' . \"\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= '<td><input type=\"button\" id=\"sensei_media_attachments_' . $k . '_button\" class=\"button upload_media_file_button\" value=\"'. __( 'Upload File' , 'sensei_media_attachments' ) . '\" data-uploader_title=\"' . __( 'Choose a file', 'sensei_media_attachments' ) . '\" data-uploader_button_text=\"' . __( 'Add file', 'sensei_media_attachments' ) . '\" /> <input name=\"sensei_media_attachments[]\" type=\"text\" id=\"sensei_media_attachments_' . $k . '\" value=\"' . $file . '\" /></td>' . \"\\n\";\n\t\t\t\t$c++;\n\t\t\t\tif( $c == 2 ) {\n\t\t\t\t\t$html .= '</tr>' . \"\\n\";\n\t\t\t\t\t$c = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( $c == 1 ) {\n\t\t\t$html .= '<td><input type=\"button\" id=\"sensei_media_attachments_extra_button\" class=\"button upload_media_file_button\" value=\"'. __( 'Upload File' , 'sensei_media_attachments' ) . '\" data-uploader_title=\"' . __( 'Choose a file', 'sensei_media_attachments' ) . '\" data-uploader_button_text=\"' . __( 'Add file', 'sensei_media_attachments' ) . '\" /> <input name=\"sensei_media_attachments[]\" type=\"text\" id=\"sensei_media_attachments_extra\" value=\"\" /></td>' . \"\\n\";\n\t\t\t$html .= '</tr>' . \"\\n\";\n\t\t}\n\n\t\t$html .= '<tr valign=\"top\">' . \"\\n\";\n\t\t$html .= '<td><input type=\"button\" id=\"sensei_media_attachments_one_button\" class=\"button upload_media_file_button\" value=\"'. __( 'Upload File' , 'sensei_media_attachments' ) . '\" data-uploader_title=\"' . __( 'Choose a file', 'sensei_media_attachments' ) . '\" data-uploader_button_text=\"' . __( 'Add file', 'sensei_media_attachments' ) . '\" /> <input name=\"sensei_media_attachments[]\" type=\"text\" id=\"sensei_media_attachments_one\" value=\"\" /></td>' . \"\\n\";\n\t\t$html .= '<td><input type=\"button\" id=\"sensei_media_attachments_two_button\" class=\"button upload_media_file_button\" value=\"'. __( 'Upload File' , 'sensei_media_attachments' ) . '\" data-uploader_title=\"' . __( 'Choose a file', 'sensei_media_attachments' ) . '\" data-uploader_button_text=\"' . __( 'Add file', 'sensei_media_attachments' ) . '\" /> <input name=\"sensei_media_attachments[]\" type=\"text\" id=\"sensei_media_attachments_two\" value=\"\" /></td>' . \"\\n\";\n\t\t$html .= '</tr>' . \"\\n\";\n\n\t\t$html .= '<tr id=\"sensei_media_attachments_new_row\" colspan=\"1\" valign=\"top\">' . \"\\n\";\n\t\t$html .= '<td><a class=\"button-secondary\" id=\"sensei_media_attachments_add_row\">'. __( '+ Add more files' , 'sensei_media_attachments' ) . '</a></td>' . \"\\n\";\n\t\t$html .= '</tr>' . \"\\n\";\n\n\t\t$html .= '</tbody>' . \"\\n\";\n\t\t$html .= '</table>' . \"\\n\";\n\n\t\techo $html;\n\t}", "public function ajaxfileupload() {\n\t\t\t$this->Fileuploader->ajaxfileupload();\n\t\t}", "public function ajaxfileupload() {\n\t\t\t$this->Fileuploader->ajaxfileupload();\n\t\t}", "public function ajaxfileupload() {\n\t\t\t$this->Fileuploader->ajaxfileupload();\n\t\t}", "public function setMedia()\r\n {\r\n parent::setMedia();\r\n $this->addJqueryPlugin('tagify');\r\n }", "public function run()\n {\n if ($hasModel = $this->hasModel()) {\n $this->limit = $this->model->getRuleParam($this->attribute, 'file', 'maxFiles', 1);\n $this->maxSize = Helper::file()->bytesToSize($this->model->getRuleParam($this->attribute, 'file', 'maxSize', 5), 0, 0, false);\n $this->extensions = $this->model->getRuleParam($this->attribute, 'file', 'extensions', 'doc,docx,pdf,png,jpg,gix');\n $this->id = Html::getInputId($this->model, $this->attribute);\n }\n $this->containerOptions['id'] = $this->id . '-container';\n $this->setDefaultAction();\n $this->validate();\n $this->defaultPluginOptions();\n $this->registerScript();\n Html::addCssClass($this->options, 'hidden uploader-input');\n if ($hasModel) {\n if (is_array($this->model{$this->attribute})) {\n $this->model{$this->attribute} = implode(',', $this->model{$this->attribute});\n }\n $input = Html::activeFileInput($this->model, $this->attribute, $this->options);\n } else {\n $input = Html::fileInput($this->name, null, $this->options);\n }\n return Html::tag('div', $input, $this->containerOptions);\n }\n\n /**\n * check if main params are set\n * @throws InvalidConfigException\n */\n public function validate()\n {\n if ($this->name === null && !$this->hasModel()) {\n throw new InvalidConfigException(\"Either 'name', or 'model' and 'attribute' properties must be specified.\");\n }\n if (!isset($this->options['id'])) {\n $this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();\n }\n }\n\n /**\n * combine default plugin options with custom options\n * @return array\n */\n public function defaultPluginOptions()\n {\n $options = [\n 'limit' => $this->limit, //nr of max files\n 'maxSize' => $this->maxSize, //max file size in mb\n 'addMore' => false,\n 'extensions' => $this->extensions ? explode(',', $this->extensions) : null, //extensions\n 'templates' => [\n 'box' => $this->render('template/_box', ['uploader' => $this]),\n 'item' => $this->render('template/_item', ['uploader' => $this]),\n 'removeConfirmation' => false,\n 'itemAppendToEnd' => false,\n '_selectors' => [\n 'list' => '.jFiler-items-list',\n 'item' => '.jFiler-item',\n 'progressBar' => '.bar',\n 'remove' => '.jFiler-item-trash-action'\n ],\n ],\n 'showThumbs' => !$this->ajax ? $this->showThumbs : true,\n 'captions' => [\n 'button' => yii::$app->l->t('Choose Files'),\n 'feedback' => yii::$app->l->t('Choose files To Upload'),\n 'feedback2' => yii::$app->l->t('files were chosen'),\n 'drop' => yii::$app->l->t('Drop file here to Upload'),\n 'removeConfirmation' => yii::$app->l->t('delete') . ' ?',\n 'errors' => [\n 'filesLimit' => yii::t('yii', 'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.', ['limit' => $this->limit]),\n 'filesType' => yii::t('yii', 'Only files with these extensions are allowed: {extensions}.', ['extensions' => $this->extensions]),\n 'filesSize' => yii::t('yii', 'The file \"{file}\" is too big. Its size cannot exceed {formattedLimit}.', [\n 'file' => '{{fi-name}}',\n 'formattedLimit' => '{{fi-maxSize}}MB'\n ]),\n 'filesSizeAll' => yii::$app->l->t(\"Files you've choosed are too large! Please upload files up to {max-size} MB.\", [\n 'max-size' => '{{fi-maxSize}}'\n ])\n ]\n ],\n 'dragDrop' => [\n 'dragEnter' => null,\n 'dragLeave' => null,\n 'drop' => null,\n ],\n ];\n if ($this->ajax) {\n if (!$this->template) {\n $this->template = '_changeInput-drag';\n }\n $options['uploadFile'] = [\n 'url' => $this->action,\n 'type' => 'POST',\n 'enctype' => 'multipart/form-data',\n 'beforeSend' => $this->registerBeforeSendScript(),\n 'statusCode' => null,\n 'onProgress' => null,\n 'onComplete' => null,\n 'error' => new JsExpression('function($jqXHR, $textStatus, $errorThrown){ console.log($textStatus); }'),\n 'success' => $this->registerSuccessScript(),\n ];\n $options['changeInput'] = $this->render('template/_changeInput-drag', ['uploader' => $this]);\n } else {\n if (!$this->template) {\n $this->template = '_single1';\n }\n $options['changeInput'] = $this->render('template/' . $this->template, ['uploader' => $this]);\n }\n\n $options['onRemove'] = $this->registerRemoveScript();\n $options['onSelect'] = $this->registerOnSelectScript();\n $options['beforeSelect'] = $this->registerBeforeSelectScript();\n $options['onEmpty'] = $this->registerOnEmptyScript();\n $options['afterShow'] = $this->registerAfterShowScript();\n\n if ($this->pluginOptions && is_array($this->pluginOptions) && count($this->pluginOptions) > 0)\n $this->pluginOptions = array_merge($options, $this->pluginOptions);\n\n $options['headers'][Request::CSRF_HEADER] = \\Yii::$app->getRequest()->getCsrfToken();\n $options['params'][Yii::$app->getRequest()->csrfParam] = \\Yii::$app->getRequest()->getCsrfToken();\n\n $this->pluginOptions = $options;\n }\n\n /**\n * default action for Ajax upload & remove file\n */\n public function setDefaultAction()\n {\n $c = yii::$app->controller;\n $m = $c->module->id;\n $action = ($m == 'frontend' ? '' : '/' . $m) . '/' . $c->id . '/' . $c->action->id;\n if ($this->ajax && !$this->action)\n $this->action = $action;\n }\n\n /**\n * @return boolean whether this widget is associated with a data model.\n */\n protected function hasModel()\n {\n return ($this->model instanceof Model && $this->attribute !== null);\n }\n\n /**\n * catch and manage save/delete actions\n * @param array $params : \n * \"name\" => \"file\" / \"model\" => $myModel, \"attribute\" => \"model_attribute\",\n * can be set function => \"beforeSave/afterSave\" => function ($fileModel) {...} ])., \"beforeDelete/afterDelete\" => function ($fileModel) {...} ]).\n */\n public static function manage($params = [])\n {\n $path = '/public/uploads/' . (new Settings())->getSetting('tld') . '/' . date('y') . '/' . date(\"W\") . '/';\n $params['afterSave'] = function($fileName, $info) use ($params, $path) {\n $fileModel = File::saveFileInfo($fileName, $info, $path);\n $as = (array_key_exists('afterSave', $params)) ? $params['afterSave'] : null;\n if (is_callable($as))\n $as($fileModel, $info);\n if (yii::$app->request->isAjax && $fileModel && !yii::$app->request->isPjax)\n die(Json::encode(['name' => $fileModel->name, 'info' => $info]));\n };\n Helper::file()->save($path, $params);\n $fileName = yii::$app->request->post('fiRemoveFileAjax');\n if ($fileName && trim($fileName) !== '') {\n $params['afterDelete'] = function($path) use ($params, $fileName) {\n $ad = (array_key_exists('afterDelete', $params)) ? $params['afterDelete'] : null;\n if (is_callable($ad))\n $ad($fileModel);\n if (yii::$app->request->isAjax && !yii::$app->request->isPjax)\n die(Json::encode(['response' => 'success']));\n };\n File::deleteFileByName($fileName, $params);\n }\n }\n\n /**\n * register plugin script\n */\n public function registerScript()\n {\n UploaderWidgetAssets::register(yii::$app->controller->view);\n $plugin = '$(\"#' . $this->id . '\").filer(' . Json::encode($this->pluginOptions) . ');';\n yii::$app->controller->view->registerJs($plugin, View::POS_END, $this->containerOptions['id']);\n }\n\n public function registerSuccessScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiSuccessEvent($selector, $data, $textStatus, $jqXHR) ;' . $this->onSuccess . '; ';\n return new JsExpression('function($data, $textStatus, $jqXHR){ ' . $js . ' }');\n }\n\n public function registerBeforeSendScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiBeforeSendEvent($selector,$el, $l, $p, $o, $s, $id, $jqXHR, $settings) ;' . $this->onBeforeSend . '; ';\n return new JsExpression('function($el, $l, $p, $o, $s, $id, $jqXHR, $settings){' . $js . '}');\n }\n\n public function registerRemoveScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiRemoveEvent($selector, $el, $id);' . $this->onRemove . '; ';\n return new JsExpression('function($el,$id){ ' . $js . ' }');\n }\n\n public function registerBeforeSelectScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiBeforeSelectEvent($selector, $files, $l, $p, $o, $s); ' . $this->onBeforeSelect . ';';\n return new JsExpression('function($files, $l, $p, $o, $s){ ' . $js . ' return true;}');\n }\n\n public function registerOnEmptyScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiOnEmptyEvent($selector, $p, $o, $s) ;' . $this->onEmpty . '; ';\n return new JsExpression('function($p, $o, $s){ ' . $js . ' return true;}');\n }\n\n public function registerOnSelectScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiOnSelectEvent($selector, $i) ;' . $this->onSelect . ';';\n return new JsExpression('function($i){ ' . $js . ' }');\n }\n\n public function registerAfterShowScript()\n {\n $js = 'var $selector = $(\"#' . $this->containerOptions['id'] . '\");';\n $js .= 'fiAfterShowEvent($selector, $l, $p, $o, $s) ;' . $this->afterShow . '; ';\n return new JsExpression('function($l, $p, $o, $s){ ' . $js . ' }');\n }\n\n}", "public function display ( $post_id )\n {\n\t\t\twp_enqueue_media ();\n\t\t\t\n $this->loadValue ( $post_id );\n\t\t\t\n\t\t\t$attachment = wp_prepare_attachment_for_js($this->value);\n\t\t\t\n\t\t\t$html = \"\";\n\t\t\t\n\t\t\t/*$html .= \"\n\t\t\t<script>\n\t\t\t\t//var attachment_\"+$this->post_meta+\" = \".json_encode($attachment).\";\n\t\t\t</script>\n\t\t\t\";\n */\n\t\t\t\n\t\t\tif ( $this->media_type_document == \"ALL\" )\n\t\t\t{\n\t\t\t\t$this->media_type_document = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t\n $html .= $this->createStartTag ();\n\t\t\t$html .= '<input type=\"hidden\" id=\"'.$this->id.'\" name=\"'.$this->id.'\" value=\"'.$this->value.'\" />';\n\t\t\t\n\t\t\t$style_visibility_label = '';\n\t\t\t$style_visibility_image = '';\n\t\t\t$style_visibility_button_add = '';\n\t\t\t$style_visibility_button_delete = '';\n\t\t\t$label_value = \"\";\n\t\t\t\n\t\t\tif ( $this->display_media_miniature == true )\n\t\t\t{\n\t\t\t\tif ( $this->value == '' )\n\t\t\t\t{\n\t\t\t\t\t$style_visibility_image = 'display:none;';\n\t\t\t\t\t$style_visibility_button_delete = 'display:none;';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$style_visibility_button_add = 'display:none;';\n\t\t\t\t\t$label_value = $attachment['filename'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( isset ( $attachment['sizes']['thumbnail'] ) )\n\t\t\t\t\t$html .= '<img style=\"'.$style_visibility_image.'\" id=\"'.$this->id.'_image\" src=\"'.$attachment['sizes']['thumbnail']['url'].'\" />';\n\t\t\t\telse\n\t\t\t\t\t$html .= '<img style=\"'.$style_visibility_image.'\" id=\"'.$this->id.'_image\" src=\"'.$attachment['sizes']['full']['url'].'\" />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $this->value == '' )\n\t\t\t\t{\n\t\t\t\t\t$style_visibility_label = 'display:none;';\n\t\t\t\t\t$style_visibility_button_delete = 'display:none;';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$style_visibility_button_add = 'display:none;';\n\t\t\t\t\t$label_value = $attachment['filename'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '<label style=\"'.$style_visibility_label.'\" id=\"'.$this->id.'_lib\" >'.$label_value.'</label>';\n\t\t\t}\n\n\t\t\t$html .= \t'<input style=\"'.$style_visibility_button_add.'\" '.\n\t\t\t\t\t\t\t'id=\"wp-media-document-add-'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'type=\"button\" '.\n\t\t\t\t\t\t\t'data-frame-id=\"'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'data-post-meta=\"'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'data-display-miniature=\"'.$this->display_media_miniature.'\" '.\n\t\t\t\t\t\t\t'class=\"button button-primary button-large\" '.\n\t\t\t\t\t\t\t'value=\"'.$this->media_libelle_bouton_ajout.'\"/>\n\t\t\t\t\t\n\t\t\t\t\t\t<input style=\"'.$style_visibility_button_delete.'\" '.\n\t\t\t\t\t\t\t'id=\"wp-media-document-delete-'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'type=\"button\" '.\n\t\t\t\t\t\t\t'data-frame-id=\"'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'data-post-meta=\"'.$this->post_meta.'\" '.\n\t\t\t\t\t\t\t'data-display-miniature=\"'.$this->display_media_miniature.'\" '.\n\t\t\t\t\t\t\t'class=\"button button-primary button-large\" '.\n\t\t\t\t\t\t\t'value=\"'.$this->media_libelle_bouton_supression.'\"/>\n\t\t\t\t\t';\n\t\t\t\n $html .= $this->createEndTag ();\n \n return $html;\n \n//\t\t\treturn \"\";\n }", "function bc_media_upload_form() { \nmedia_upload_header();\nadd_brightcove_script();\nadd_jquery_scripts();\nadd_validation_scripts();\nadd_dynamic_brightcove_api_script();\n\n/*Gets the default player set in the admin settings*/\n$playerID=get_option('bc_player_id');\n$defaultHeight=get_option('bc_default_height');\nif ($defaultHeight == '') {\n $defaultHeight='270';\n}\n$defaultWidth=get_option('bc_default_width');\nif ($defaultWidth == '') {\n $defaultWidth='480';\n}\n\n$defaultHeightPlaylist=get_option('bc_default_height_playlist');\nif ($defaultHeightPlaylist == '') {\n $defaultHeightPlaylist='400';\n}\n$defaultWidthPlaylist=get_option('bc_default_width_playlist');\nif ($defaultWidthPlaylist == '') {\n $defaultWidthPlaylist='940';\n}\n\n$playerID_playlist=get_option('bc_player_id_playlist');\n\nif ($playerID == '' || $playerID_playlist == '') {\n $defaultSet='false';\n} else {\n $defaultSet='true';\n}\n?>\n<div class=\"bc-container\">\n <div class='hidden error' id='defaults_not_set' data-defaultsSet='<?php echo $defaultSet; ?>'>\n You have not set up your defaults for this plugin. Please go to the brightcove menu on the side panel of the admin screen.\n </div>\n <div class='no-error'>\n <div id='tabs'>\n <ul>\n <li ><a class='video-tab' href=\"#tabs-1\">Videos</a></li>\n <li><a class='playlist-tab' href=\"#tabs-2\">Playlists</a></li>\n </ul>\n\n <div class='tab video-tab' id='tabs-1'>\n <div class='media-item no-border'>\n <form id='validate_video'>\n <table>\n <tbody>\n <tr>\n <th valign='top' scope='row' class='label'>\n <span class=\"alignleft\"><label for=\"bc-video\">Video:</label></span>\n <span class=\"alignright\"></span>\n </th>\n <td>\n <input class='id-field player-data' placeholder='Video ID' aria-required=\"true\" type='text' name='bcVideo' id='bc-video' placeholder='Video ID or URL'>\n </td>\n </tr>\n <tr>\n <th valign='top' scope='row' class='label'>\n </th>\n <td class='bc-check'>\n <input class='player-data alignleft' type='checkbox' name='bc-video-ref' id='bc-video-ref' />\n <span class=\"alignleft\"><label for='bc-video-ref'>This is a reference ID, not a video ID </label></span>\n </td>\n </tr>\n </tbody>\n </table>\n </form>\n </div>\n </div>\n\n <div class='tab playlist-tab' id='tabs-2'>\n <div class='media-item no-border'>\n <form id='validate_playlist'>\n <table> \n <tbody>\n <tr>\n <th valign='top' scope='row' class='label' >\n <span class=\"alignleft\"><label for=\"bcPlaylist\">Playlist:</label></span>\n <span class=\"alignright\"></span>\n </th>\n <td>\n <input class='id-field player-data' type='text' name='bcPlaylist' id='bc-playlist' placeholder='Playlist ID(s) separated by commas or spaces' />\n </td>\n </tr>\n <tr>\n <th valign='top' scope='row' class='label'>\n </th>\n <td class='bc-check'>\n <input class='alignleft player-data' type='checkbox' name='bc-playlist-ref' id='bc-playlist-ref'/>\n <span class=\"alignleft\"><label for='bc-playlist-ref'>These are reference IDs, not playlist IDs </label></span>\n </td>\n </tr>\n </tbody>\n </table>\n </form>\n </div>\n </div>\n </div><!-- tabs -->\n\n <div class='media-item'>\n <h3>Customize Player Settings</h3>\n <input type='hidden' id='bc_default_player' name='bc_default_player' value='<?php echo $playerID; ?>' >\n <input type='hidden' id='bc_default_player_playlist' name='bc_default_player_playlist' value='<?php echo $playerID_playlist; ?>' >\n <input type='hidden' id='bc_default_height' name='bc_default_height' value='<?php echo $defaultHeight; ?>' >\n <input type='hidden' id='bc_default_width' name='bc_default_width' value='<?php echo $defaultWidth; ?>' >\n <input type='hidden' id='bc_default_height_playlist' name='bc_default_height_playlist' value='<?php echo $defaultHeightPlaylist; ?>' >\n <input type='hidden' id='bc_default_width_playlist' name='bc_default_width_playlist' value='<?php echo $defaultWidthPlaylist; ?>' >\n <form id='validate_settings'>\n <table>\n <tbody>\n <tr class='bc-player-row'>\n <th valign='top' scope='row' class='label'>\n <span class=\"alignleft\"><label for=\"bcPlayer\">Player:</label></span>\n <span class=\"alignright\"></span>\n </th>\n <td>\n <input class='digits player-data' type='text' name='bcPlayer' id='bc-player' placeholder='Player ID (optional)'/>\n </td>\n </tr>\n <tr class='bc-height-row'>\n <th valign='top' scope='row' class='label'>\n <span class=\"alignleft\"><label for=\"bcHeight\">Height:</label></span>\n <span class=\"alignright\"></span>\n </th>\n <td>\n <input class='digits player-data' type='text' name='bcHeight' id='bc-height' placeholder='Default is <?php echo $defaultHeight; ?> px' />\n </td>\n </tr>\n <tr class='bc-width-row'>\n <th valign='top' scope='row' class='label'>\n <span class=\"alignleft\"><label for=\"bcWidth\">Width:</label></span>\n <span class=\"alignright\"></span>\n </th>\n <td>\n <input class='digits player-data' type='text' name='bcWidth' id='bc-width' placeholder='Default is <?php echo $defaultWidth; ?> px' />\n </td>\n </tr>\n </tbody>\n </table>\n </form>\n </div>\n\n <div class='media-item no-border insert-button-container'>\n <button class='aligncenter button' onclick=\"BCL.insertShortcode()\" />Insert Shortcode</button>\n </div>\n\n <div class='media-item no-border'>\n <div id='bc-error' class='hidden error'></div>\n </div>\n\n <div class='media-item no-border player-preview preview-container' style=\"display: none;\">\n <h3>Video Preview</h3>\n <table>\n <tbody>\n <tr>\n <td>\n <div class='alignleft'>\n <h4 id='bc_title'></h4>\n <p id='bc_description'></p>\n <div id=\"dynamic-bc-placeholder\"></div>\n </div>\n <div class='alignleft'>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</div>\n\n\t<?php\n}", "public function ajaxuploadTask()\n\t{\n\t\tRequest::checkToken(['get', 'post']);\n\n\t\t//get config\n\t\t$config = \\Component::params('com_media');\n\n\t\t//allowed extensions for uplaod\n\t\t$allowedExtensions = array_values(array_filter(explode(',', $config->get('upload_extensions'))));\n\n\t\t// if super group allow archives\n\t\tif ($this->group->get('type') == 3)\n\t\t{\n\t\t\t$allowedExtensions[] = 'zip';\n\t\t\t$allowedExtensions[] = 'tar';\n\t\t\t$allowedExtensions[] = 'gz';\n\t\t}\n\n\t\t//max upload size\n\t\t$sizeLimit = $config->get('upload_maxsize');\n\t\t$sizeLimit = $sizeLimit * 1024 * 1024;\n\n\t\t//get the file\n\t\tif (isset($_GET['qqfile']))\n\t\t{\n\t\t\t$stream = true;\n\t\t\t$file = $_GET['qqfile'];\n\t\t\t$size = (int) $_SERVER[\"CONTENT_LENGTH\"];\n\t\t}\n\t\telseif (isset($_FILES['qqfile']))\n\t\t{\n\t\t\t$stream = false;\n\t\t\t$file = $_FILES['qqfile']['name'];\n\t\t\t$size = (int) $_FILES['qqfile']['size'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//get folder\n\t\t$folder = Request::getString('folder', '');\n\n\t\t// make sure we have an active folder\n\t\tif ($folder == '')\n\t\t{\n\t\t\t$folder = '/uploads';\n\t\t}\n\n\t\t// regular groups can only access inside /uploads\n\t\tif ($this->group->get('type') != 3)\n\t\t{\n\t\t\t$pathInfo = pathinfo($folder);\n\t\t\tif ($pathInfo['dirname'] != '/uploads')\n\t\t\t{\n\t\t\t\t$folder = '/uploads';\n\t\t\t}\n\t\t}\n\n\t\t// Build the upload path if it doesn't exist\n\t\t$uploadDirectory = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/groups'), DS) . DS . $this->group->get('gidNumber') . DS . ltrim($folder, DS);\n\n\t\t//make sure upload directory is writable\n\t\tif (!is_dir($uploadDirectory))\n\t\t{\n\t\t\tif (!Filesystem::makeDirectory($uploadDirectory))\n\t\t\t{\n\t\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_UNABLE_TO_CREATE_UPLOAD_PATH')));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (!is_writable($uploadDirectory))\n\t\t{\n\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_PATH_NOT_WRITABLE')));\n\t\t\treturn;\n\t\t}\n\n\t\t//check to make sure we have a file and its not too big\n\t\tif ($size == 0)\n\t\t{\n\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_FILE_EMPTY')));\n\t\t\treturn;\n\t\t}\n\t\tif ($size > $sizeLimit)\n\t\t{\n\t\t\t$max = preg_replace('/<abbr \\w+=\\\\\"\\w+\\\\\">(\\w{1,3})<\\\\/abbr>/', '$1', \\Hubzero\\Utility\\Number::formatBytes($sizeLimit));\n\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_FILE_TOO_BIG', $max)));\n\t\t\treturn;\n\t\t}\n\n\t\t//check to make sure we have an allowable extension\n\t\t$pathinfo = pathinfo($file);\n\t\t$filename = $pathinfo['filename'];\n\t\t$ext = $pathinfo['extension'];\n\t\tif ($allowedExtensions && !in_array(strtolower($ext), $allowedExtensions))\n\t\t{\n\t\t\t$these = implode(', ', $allowedExtensions);\n\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_INVALID_FILE', $these)));\n\t\t\treturn;\n\t\t}\n\n\t\t// clean file path\n\t\t$filename = urldecode($filename);\n\t\t$filename = Filesystem::clean($filename);\n\t\t// $filename = str_replace(' ', '_', $filename);\n\n\t\twhile (file_exists($uploadDirectory . DS . $filename . '.' . $ext))\n\t\t{\n\t\t\t$filename .= rand(10, 99);\n\t\t}\n\n\t\t//final file\n\t\t$file = $uploadDirectory . DS . $filename . '.' . $ext;\n\n\t\t//save file\n\t\tif ($stream)\n\t\t{\n\t\t\t//read the php input stream to upload file\n\t\t\t$input = fopen(\"php://input\", \"r\");\n\t\t\t$temp = tmpfile();\n\t\t\t$realSize = stream_copy_to_stream($input, $temp);\n\t\t\tfclose($input);\n\n\t\t\t//move from temp location to target location which is user folder\n\t\t\t$target = fopen($file, \"w\");\n\t\t\tfseek($temp, 0, SEEK_SET);\n\t\t\tstream_copy_to_stream($temp, $target);\n\t\t\tfclose($target);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmove_uploaded_file($_FILES['qqfile']['tmp_name'], $file);\n\t\t}\n\n\t\t// change file perm\n\t\tchmod($file, 0774);\n\n\t\t//scan file for virus if we have enabled scans\n\t\tif ($this->config->get('scan_uploads', 1))\n\t\t{\n\t\t\t//run scan on file\n\t\t\t//scan failed\n\t\t\tif (!Filesystem::isSafe($file))\n\t\t\t{\n\t\t\t\t//delete file\n\t\t\t\tunlink($file);\n\n\t\t\t\t//inform user\n\t\t\t\techo json_encode(array('error' => Lang::txt('COM_GROUPS_MEDIA_FILE_CONTAINS_VIRUS')));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$this->logActivity('uploaded', str_replace($this->path, '', $file));\n\n\t\t//return success\n\t\techo json_encode(array('success' => true));\n\t\treturn;\n\t}", "public function run()\n\t{\n\t\t$clientScript = Yii::app()->getClientScript();\n\t\t$dir = dirname(__FILE__);\n\t\t$this->baseUrl = Yii::app()->getAssetManager()->publish($dir);\n\n\t\t// $clientScript->registerScriptFile($this->baseUrl . '/uploadify-v3.1/swfobject.js', CClientScript::POS_HEAD);\n\t\t// $clientScript->registerScriptFile($this->baseUrl . '/uploadify-v3.1/jquery.uploadify-3.1.min.js', CClientScript::POS_HEAD);\t\t\n\t\t// $clientScript->registerCssFile($this->baseUrl . '/uploadify-v3.1/uploadify.css');\n\n\t\tlist($name, $id) = $this->resolveNameID();\n\t\t$options = $this->makeOptions();\n\t\t$js =<<<EOP\n$(\"#{$id}\").uploadify({$options});\nEOP;\n\t\t$clientScript->registerScript('Yii.'.get_class($this).'#'.$id, $js, CClientScript::POS_READY);\n\n\t\t$this->htmlOptions['id'] = $id;\n\t\t$this->htmlOptions['name'] = $id;\n\t\t$this->htmlOptions['type'] = 'file';\n\t\t// $html = CHtml::tag('input', $this->htmlOptions, $this->body);\n\t\t$html = CHtml::fileField($id, null, $this->htmlOptions);\n\t\techo $html;\n\t}", "public function js_template() {\n\t\t?>\n\t\t<div class=\"widget-wrapper image-control type-image\" data-field=\"{{ data.fieldID }}\">\n\t\t\t<div class=\"widget-left\">\n\t\t\t\t<label for=\"{{ data.fieldID }}\">{{{ data.title }}}</label>\n\t\t\t</div>\n\t\t\t<div class=\"widget-right\">\n\t\t\t\t<# var multiple = ( 1 < data.multiple ) ? true : false #>\n\t\t\t\t<div class=\"image-content\" data-multiple=\"{{ multiple }}\">\n\n\t\t\t\t\t<# var showImageClass = ( '' === data.value ) ? 'hide-image' : '' #>\n\t\t\t\t\t<div class=\"image-wrapper {{ showImageClass }}\">\n\t\t\t\t\t\t<# if ( 1 < data.multiple ) { #>\n\t\t\t\t\t\t\t<# if ( undefined !== data.imageUrl && Array.isArray( data.imageUrl ) ) { #>\n\t\t\t\t\t\t\t\t<# data.imageUrl.forEach( function( element ) { #>\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"{{ data.fieldName }}[]\" value=\"{{ element.id }}\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"{{ element.url }}\">\n\t\t\t\t\t\t\t\t\t\t<span class='remove'></span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<# } ) #>\n\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t<img src=\"{{ data.imageUrl }}\">\n\t\t\t\t\t\t\t<input type=\"hidden\" class=\"image-input\" id=\"{{ data.fieldID }}\" name=\"{{ data.fieldName }}\" value=\"{{ data.value }}\" />\n\t\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<# var addButtonClass = ( '' === data.value || 1 < data.multiple ) ? '' : 'hide-button'; #>\n\t\t\t\t\t<input type=\"button\" class=\"button-image-text add-button button {{ addButtonClass }}\" value=\"<?php esc_html_e( 'Add Image', 'jeg' ); ?>\">\n\t\t\t\t\t<# var removeButtonClass = ( '' === data.value || 1 < data.multiple ) ? 'hide-button' : ''; #>\n\t\t\t\t\t<input type=\"button\" class=\"button-image-text remove-button button {{ removeButtonClass }}\" value=\"<?php esc_html_e( 'Remove Image', 'jeg' ); ?>\">\n\t\t\t\t</div>\n\t\t\t\t<i>{{{ data.description }}}</i>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function upload_media()\n\t{\n\t\n\t}", "function wpeddit_add_media_upload_scripts() {\n if ( is_admin() ) {\n return;\n }\n wp_enqueue_media();\n}", "function enqueue_media(){\n $wp_version = floatval(get_bloginfo('version'));\n\n if ( $wp_version < \"3.5\" ) {\n wp_enqueue_script(\n 'redux-opts-field-upload-js',\n get_template_directory_uri() . '/inc/meta/js/assets/js/field_upload_3_4.js',\n array('jquery', 'thickbox', 'media-upload'),\n time(),\n true\n );\n wp_enqueue_style('thickbox');\n } else {\n wp_enqueue_script(\n 'redux-opts-field-upload-js',\n get_template_directory_uri() . '/inc/meta/assets/js/field_upload.js',\n array('jquery'),\n time(),\n true\n );\n wp_enqueue_media();\n }\n}", "public function render() {\n\t\t\techo '<div class=\"screenshot\">';\n\n\t\t\tif ( ! empty( $this->value ) ) {\n\t\t\t\t$ids = explode( ',', $this->value );\n\n\t\t\t\tforeach ( $ids as $attachment_id ) {\n\t\t\t\t\t$img = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );\n\t\t\t\t\t$alt = wp_prepare_attachment_for_js( $attachment_id );\n\t\t\t\t\t$alt = isset( $alt['alt'] ) ? $alt['alt'] : '';\n\n\t\t\t\t\techo '<a class=\"of-uploaded-image\" href=\"' . esc_url( $img[0] ) . '\">';\n\t\t\t\t\techo '<img class=\"redux-option-image\" id=\"image_' . esc_attr( $this->field['id'] ) . '_' . esc_attr( $attachment_id ) . '\" src=\"' . esc_url( $img[0] ) . '\" alt=\"' . esc_attr( $alt ) . '\" target=\"_blank\" rel=\"external\" />';\n\t\t\t\t\techo '</a>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo '</div>';\n\t\t\techo '<a href=\"#\" onclick=\"return false;\" id=\"edit-gallery\" class=\"gallery-attachments button button-primary\">' . esc_html__( 'Add/Edit Gallery', 'redux-framework' ) . '</a> ';\n\t\t\techo '<a href=\"#\" onclick=\"return false;\" id=\"clear-gallery\" class=\"gallery-attachments button\">' . esc_html__( 'Clear Gallery', 'redux-framework' ) . '</a>';\n\t\t\techo '<input type=\"hidden\" class=\"gallery_values ' . esc_attr( $this->field['class'] ) . '\" value=\"' . esc_attr( $this->value ) . '\" name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '\" />';\n\t\t}", "public function VideoPickPopUp()\n\t{\tob_start();\n\t\techo '<script type=\"text/javascript\">$().ready(function(){$(\"body\").append($(\".jqmWindow\"));$(\"#mmc_modal_popup\").jqm();});</script>',\n\t\t\t'<!-- START multimedia modal popup --><div id=\"mmc_modal_popup\" class=\"jqmWindow\" style=\"padding-bottom: 5px; width: 640px; margin-left: -320px; top: 10px; height: 600px; \"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"mmcModalInner\" style=\"height: 500px; overflow:auto;\"></div></div>';\n\t\treturn ob_get_clean();\n\t}", "function media_upload_uploadzip() {\n\t\t$errors = false;\n\t\tif ( isset( $_POST['send'] ) ) {\n\n\t\t\t// Build output\n\t\t\t$html = '';\n\t\t\t$size = $_POST['size'];\n\t\t\tif ( ! empty( $_POST['altsize'] ) ) {\n\t\t\t\t$size = explode( ',', $_POST['altsize'] );\n\t\t\t}\n\n\t\t\tforeach ( $_POST['srcs'] as $k => $id ) {\n\t\t\t\t$html .= wp_get_attachment_image( $id, $size );\n\t\t\t\t$html .= ' ';\n\t\t\t}\n\t\t\t// Return it to TinyMCE\n\t\t\treturn media_send_to_editor( $html );\n\t\t}\n\t\treturn wp_iframe( array( $this, 'media_uploadzip_tab_content' ), 'media', $errors );\n\t}", "public function actionUploadAjax() {\n $this->Uploads(true);\n }", "function tt_media_add_js($hook) {\n if ( $hook != 'upload.php' )\n return;\n wp_enqueue_script( 'tt_media_js', theme('include/admin-assets/admin-area.js'), array('jquery'), 1.0, true );\n\n // Make enabled languages visible for javascript\n// global $q_config;\n// wp_localize_script('jquery', 'qtranxsList', array(\n// 'enabled_languages' => $q_config['enabled_languages'])\n// );\n}", "function imagepicker_upload() {\n variable_del('imagepicker_advanced_browser_pagestart');\n if (variable_get('imagepicker_upload_progress_enabled', 1)) {\n $content = imagepicker_upload_progress_get_script(variable_get('imagepicker_upload_progress_delay', 0));\n }\n $content .= imagepicker_quota_ok('iframe', FALSE, '', t('Upload images. You can give them a title and description'));\n theme('imagepicker', $content);\n}", "public static function admin_footer_widgets() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\tjQuery(function($) {\n\t\t\t$('#wpbody').on('selectionChange.blazersix', '.blazersix-media-control', function( e, selection ) {\n\t\t\t\tvar $control = $( e.target ),\n\t\t\t\t\t$sizeField = $control.closest('.blazersix-widget-image-form').find('select.image-size'),\n\t\t\t\t\tmodel = selection.first(),\n\t\t\t\t\tsizes = model.get('sizes'),\n\t\t\t\t\tsize, image;\n\t\t\t\t\n\t\t\t\tif ( sizes ) {\n\t\t\t\t\t// The image size to display in the widget.\n\t\t\t\t\tsize = sizes['post-thumbnail'] || sizes.medium;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $sizeField.length ) {\n\t\t\t\t\t// Builds the option elements for the size dropdown.\n\t\t\t\t\tBlazerSixMediaControl.updateSizeDropdownOptions( $sizeField, sizes );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsize = size || model.toJSON();\n\t\t\t\t\n\t\t\t\timage = $( '<img />', { src: size.url, width: size.width } );\n\t\t\t\t\t\t\n\t\t\t\t$control.find('img').remove().end()\n\t\t\t\t\t.prepend( image )\n\t\t\t\t\t.addClass('has-image')\n\t\t\t\t\t.find('a.blazersix-media-control-choose').removeClass('button-hero');\n\t\t\t});\n\t\t});\n\t\t</script>\n\t\t<?php\t\n\t}", "public function MultiMediaDisplay()\n\t{\tob_start();\n\t\techo '<div class=\"mmdisplay\"><div id=\"mmdContainer\">', $this->MultiMediaTable(), '</div><script type=\"text/javascript\">$().ready(function(){$(\"body\").append($(\".jqmWindow\"));$(\"#rlp_modal_popup\").jqm();});</script>',\n\t\t\t'<!-- START instructor list modal popup --><div id=\"rlp_modal_popup\" class=\"jqmWindow\" style=\"padding-bottom: 5px; width: 640px; margin-left: -320px; top: 10px; height: 600px; \"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"rlpModalInner\" style=\"height: 500px; overflow:auto;\"></div></div></div>';\n\t\treturn ob_get_clean();\n\t}", "function timber_lite_wp_enqueue_media() {\n\n\t// this will ensure all the resources needed for the media modal\n\twp_enqueue_media();\n\n\twp_enqueue_script( 'timber-image-widget-admin', get_template_directory_uri() . '/inc/widgets/assets/image.js', array(\n\t\t'media-upload',\n\t\t'media-views',\n\t) );\n\n\twp_localize_script(\n\t\t'timber-image-widget-admin',\n\t\t'TimberImageWidget',\n\t\tarray(\n\t\t\t'l10n' => array(\n\t\t\t\t'frameTitle' => esc_html__( 'Choose an Image', 'timber-lite' ),\n\t\t\t\t'frameUpdateText' => esc_html__( 'Update Image', 'timber-lite' ),\n\t\t\t),\n\t\t)\n\t);\n}", "public function YourUploads()\n {\n $rows = $this->user->getMedia();\n $this->view->SetContent(array(\n 'uploads' => $rows,\n 'boardTitle' => 'Your Uploads',\n ));\n $this->view->DisplayPage();\n }", "function wp_media_upload_handler()\n{\n}", "function rtm_group_uploader_func() {\n \t\t// get current logged in user id.\n \t\t$user_id = get_current_user_id();\n \t\t// Get all logeed in user's groups.\n \t\t$user_groups = ( groups_get_user_groups( $user_id ) );\n \t\t$user_groups = $user_groups[\"groups\"];\n ?>\n \t\t<!-- Render Uploader -->\n \t\t<h1> Upload Media To Your Groups </h1>\n\n \t\tSelect Your Group:\n \t\t<select id=\"select-group\">\n \t\t\t<option value=\"-1\">Select Group</option>\n \t\t\t\t<?php\n \t\t\t\t\tforeach( $user_groups as $group ) {\n \t\t\t\t\t\t$groupObj = groups_get_group( array( 'group_id' => $group) );\n \t\t\t\t?>\n \t\t\t<option value=\"<?php echo $group; ?>\"> <?php echo esc_html( $groupObj->name ); ?> </option>\n \t\t\t\t<?php\n \t\t\t\t\t}\n \t\t\t\t?>\n \t\t</select>\n\n \t\t<div id=\"multiple-group-uploader\">\n \t\t\t<!-- Call our rtmedia_uploader shortcode with some deffault arguments -->\n \t\t\t<?php echo do_shortcode( '[rtmedia_uploader context=group context_id=-1 album_id=1 privacy=0]' ); ?>\n \t\t</div>\n \t<?php\n \t}", "public function upload()\n\t{\n\t\t// Only allow logged in users\n\t\tFoundry::requireLogin();\n\n\t\t// Load up the ajax library\n\t\t$ajax \t= Foundry::ajax();\n\n\t\t// Get the unique item id\n\t\t$uid \t= JRequest::getInt( 'uid' );\n\t\t$type \t= JRequest::getCmd( 'type' );\n\n\n\t\t$theme\t= Foundry::themes();\n\t\t$theme->set( 'uid' , $uid );\n\t\t$theme->set( 'type' , $type );\n\n\t\t$output\t= $theme->output( 'site/avatar/upload' );\n\n\t\treturn $ajax->resolve( $output );\n\t}", "function action_enqueue_scripts(){\n if(is_user_logged_in() && strstr($_SERVER['REQUEST_URI'], 'toolbox')){\n if(!wp_script_is('toolbox-spinner'))\n wp_enqueue_script('toolbox-spinner', plugins_url('spinner.min.js', __FILE__), array('jquery'), '20121205');\n wp_enqueue_script('custom-plupload-core', plugins_url('plupload/plupload.full.js', __FILE__), array(), '1.5.7');\n wp_enqueue_script('the-media-uploader', plugins_url('mediauploader.js', __FILE__), array(), '20121205');\n\n $settings = (get_site_option('mediauploader_settings'))?get_site_option('mediauploader_settings'):get_blog_option(1, 'mediauploader_settings');\n if(!$settings){\n $settings = array(\n \"max_upload_size\"=>self::$default_max_upload_size,\n \"max_width\"=>self::$default_max_width,\n \"max_height\"=>self::$default_max_height,\n \"image_quality\"=>self::$default_image_quality\n );\n }\n\n // Default settings for plupload\n $plupload_init = array(\n 'runtimes' => 'html5,flash,html4,silverlight',\n 'browse_button' => 'plupload-browse-button', // default, changed later\n 'container' => 'plupload-upload-ui', // default, changed later\n 'drop_element' => false,\n 'file_data_name' => 'async-upload', // default, changed later\n 'multiple_queues' => false,\n 'max_file_size' => $settings[\"max_upload_size\"].'b',\n 'url' => admin_url('admin-ajax.php'),\n 'flash_swf_url' => plugins_url('media-uploader/plupload/plupload.flash.swf', __FILE__),\n 'silverlight_xap_url' => plugins_url('media-uploader/plupload/plupload.silverlight.xap', __FILE__),\n 'filters' => array(array('title' => __('Image Files'), 'extensions' => \"jpg,png,jpeg,gif\")),\n 'multipart' => true,\n 'urlstream_upload' => true,\n 'multi_selection' => false,\n // additional post data to send to our ajax hook\n 'multipart_params' => array(\n '_ajax_nonce' => wp_create_nonce('pluloader'), // will be added per uploader\n 'action' => 'plupload_action', // the ajax action name\n 'imgid' => 0 // default, will be changed later\n ),\n 'resize'=> array(\n 'width'=> $settings[\"max_width\"],\n 'height'=> $settings[\"max_height\"],\n 'quality'=> $settings[\"image_quality\"]\n )\n );\n // Load plupload settings into javascript\n wp_localize_script('the-media-uploader', 'plupload_base_settings',$plupload_init);\n wp_enqueue_style( 'the-media-uploader', plugins_url( 'mediauploader.css', __FILE__ ));\n $net = get_site_option('tb_network_setting');\n if(!isset($net['name']) || (isset($net['name']) && $net['name']!='WindowCleaning.com')){\n wp_localize_script('the-media-uploader', 'logo_extension', 'jpg,png,jpeg,gif');\n }\n }\n }", "public function JQ_ImagePicker() {\n $this->JS('image-picker.js');\n $this->CSS('image-picker.css');\n }", "public function display_attached_media() {\n\t\tglobal $post;\n\n\t\t$media = get_post_meta( $post->ID, '_attached_media', true );\n\n\t\t$html = '';\n\n\t\t$post_type = ucfirst( get_post_type( $post ) );\n\n\t\tif( $media && is_array( $media ) && count( $media ) > 0 ) {\n\t\t\t$html .= '<div id=\"attached-media\">';\n\t\t\t\t$html .= '<h2>' . sprintf( __( '%s Media', 'sensei_media_attachments' ), $post_type ) . '</h2>';\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\tforeach( $media as $k => $file ) {\n\t\t\t\t\t\t$file_parts = explode( '/', $file );\n\t\t \t\t\t$file_name = array_pop( $file_parts );\n\t\t\t\t\t\t$html .= '<li id=\"attached_media_' . $k . '\"><a href=\"' . esc_url( $file ) . '\" target=\"_blank\">' . esc_html( $file_name ) . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t$html .= '</ul>';\n\t\t\t$html .= '</div>';\n\t\t}\n\n\t\techo $html;\n\t}", "public function getName()\n {\n return \"display_media\";\n }", "public function actionUploadAjax() {\n\t\t//$this->Uploads ( true );\n\t}", "public function render_media($instance)\n {\n }", "public function render_media($instance)\n {\n }", "public function render_media($instance)\n {\n }", "public function render_media($instance)\n {\n }", "function renderFileupload($name,$in_value){\n echo(\"\n <script>\n $('#stepForm')\n .attr( 'enctype', 'multipart/form-data')\n .attr( 'encoding', 'multipart/form-data');\n </script>\n \");\n\n echo(\"\n <label for='\".$name.\"' class='col-sm-4'>$name</label>\");\n \n if($in_value != NULL){\n echo(\"\n <img src='\".$in_value.\"' width='350px' />\n \");\n }\n\n echo(\"\n <span class='col-sm-4'></span>\n <input type='file' id='\".$name.\"' name='\".$name.\"' value=''>\n \");\n\n echo(\"\");\n \n \n}", "public function uploader(){\r\n\t\treturn $this->module_uploader();\r\n\t}", "function rex_mediapool_Mediaform($form_title, $button_title, $rex_file_category, $file_chooser, $close_form)\n{\n global $ftitle, $warning, $info;\n\n $s = '';\n\n $cats_sel = new rex_media_category_select();\n $cats_sel->setStyle('class=\"form-control\"');\n $cats_sel->setSize(1);\n $cats_sel->setName('rex_file_category');\n $cats_sel->setId('rex-mediapool-category');\n $cats_sel->setAttribute('class', 'selectpicker form-control');\n $cats_sel->setAttribute('data-live-search', 'true');\n $cats_sel->setAttribute('onchange', 'this.form.submit()');\n $cats_sel->setSelected($rex_file_category);\n\n if (rex::getUser()->getComplexPerm('media')->hasAll()) {\n $cats_sel->addOption(rex_i18n::msg('pool_kats_no'), '0');\n }\n\n if (isset($warning)) {\n if (is_array($warning)) {\n if (count($warning) > 0) {\n $s .= rex_view::error(implode('<br />', $warning));\n }\n } elseif ($warning != '') {\n $s .= rex_view::error($warning);\n }\n $warning = '';\n }\n\n if (isset($info)) {\n if (is_array($info)) {\n if (count($info) > 0) {\n $s .= rex_view::success(implode('<br />', $info));\n }\n } elseif ($info != '') {\n $s .= rex_view::success($info);\n }\n $info = '';\n }\n\n if (!isset($ftitle)) {\n $ftitle = '';\n }\n\n $arg_fields = '';\n foreach (rex_request('args', 'array') as $arg_name => $arg_value) {\n $arg_fields .= '<input type=\"hidden\" name=\"args[' . htmlspecialchars($arg_name) . ']\" value=\"' . htmlspecialchars($arg_value) . '\" />' . \"\\n\";\n }\n\n $opener_input_field = rex_request('opener_input_field', 'string');\n if ($opener_input_field != '') {\n $arg_fields .= '<input type=\"hidden\" name=\"opener_input_field\" value=\"' . htmlspecialchars($opener_input_field) . '\" />' . \"\\n\";\n }\n\n $add_submit = '';\n if ($close_form && $opener_input_field != '') {\n $add_submit = '<button class=\"btn btn-save\" type=\"submit\" name=\"saveandexit\" value=\"' . rex_i18n::msg('pool_file_upload_get') . '\"' . rex::getAccesskey(rex_i18n::msg('pool_file_upload_get'), 'save') . '>' . rex_i18n::msg('pool_file_upload_get') . '</button>';\n }\n\n $panel = '';\n $panel .= '<fieldset>';\n $formElements = [];\n\n $e = [];\n $e['label'] = '<label for=\"rex-mediapool-category\">' . rex_i18n::msg('pool_file_category') . '</label>';\n $e['field'] = $cats_sel->get();\n $formElements[] = $e;\n\n $e = [];\n $e['label'] = '<label for=\"rex-mediapool-title\">' . rex_i18n::msg('pool_file_title') . '</label>';\n $e['field'] = '<input class=\"form-control\" type=\"text\" id=\"rex-mediapool-title\" name=\"ftitle\" value=\"' . htmlspecialchars($ftitle) . '\" />';\n $formElements[] = $e;\n\n $fragment = new rex_fragment();\n $fragment->setVar('elements', $formElements, false);\n $panel .= $fragment->parse('core/form/form.php');\n\n $panel .= rex_extension::registerPoint(new rex_extension_point('MEDIA_FORM_ADD', ''));\n\n if ($file_chooser) {\n $e = [];\n $e['label'] = '<label for=\"rex-mediapool-choose-file\">' . rex_i18n::msg('pool_file_file') . '</label>';\n $e['field'] = '<input id=\"rex-mediapool-choose-file\" type=\"file\" name=\"file_new\" />';\n $e['after'] = '<h3>' . rex_i18n::msg('phpini_settings') . '</h3>\n <dl class=\"dl-horizontal text-left\">\n ' . ((rex_ini_get('file_uploads') == 0) ? '<dt><span class=\"text-warning\">' . rex_i18n::msg('pool_upload') . '</span></dt><dd><span class=\"text-warning\">' . rex_i18n::msg('pool_upload_disabled') . '</span></dd>' : '') . '\n <dt>' . rex_i18n::msg('pool_max_uploadsize') . ':</dt><dd>' . rex_formatter::bytes(rex_ini_get('upload_max_filesize')) . '</dd>\n <dt>' . rex_i18n::msg('pool_max_uploadtime') . ':</dt><dd>' . rex_ini_get('max_input_time') . 's</dd>\n </dl>';\n\n $fragment = new rex_fragment();\n $fragment->setVar('elements', [$e], false);\n $panel .= $fragment->parse('core/form/form.php');\n }\n $panel .= '</fieldset>';\n\n $formElements = [];\n\n $e = [];\n $e['field'] = '<button class=\"btn btn-save rex-form-aligned\" type=\"submit\" name=\"save\" value=\"' . $button_title . '\"' . rex::getAccesskey($button_title, 'save') . '>' . $button_title . '</button>';\n $formElements[] = $e;\n\n $e = [];\n $e['field'] = $add_submit;\n $formElements[] = $e;\n\n $fragment = new rex_fragment();\n $fragment->setVar('elements', $formElements, false);\n $buttons = $fragment->parse('core/form/submit.php');\n\n $fragment = new rex_fragment();\n $fragment->setVar('class', 'edit', false);\n $fragment->setVar('title', $form_title, false);\n $fragment->setVar('body', $panel, false);\n $fragment->setVar('buttons', $buttons, false);\n $content = $fragment->parse('core/page/section.php');\n\n $s .= ' <form action=\"' . rex_url::currentBackendPage() . '\" method=\"post\" enctype=\"multipart/form-data\" data-pjax=\"false\">\n ' . rex_csrf_token::factory('mediapool')->getHiddenField() . '\n <fieldset>\n <input type=\"hidden\" name=\"media_method\" value=\"add_file\" />\n ' . $arg_fields . '\n ' . $content . '\n </fieldset>\n ';\n\n if ($close_form) {\n $s .= '</form>' . \"\\n\";\n }\n\n return $s;\n}", "public function uploadForm ()\r\n {\r\n $MediaModel = new Admin_Model_Multimedia();\r\n $listClients = $MediaModel->fetchClients($this->auth_session->username);\r\n unset($MediaModel);\r\n $this->view->doctype('XHTML1_STRICT');\r\n $title = new Zend_Form_Element_Text('mediumtitle', \r\n array('label' => 'Title', 'required' => true));\r\n $title->addValidator('StringLength', false, array(1, 63));\r\n $immediateActive = new Zend_Form_Element_Radio('mediumactivatenow', \r\n array('label' => 'Immediately activate?', 'required' => true, \r\n 'value' => '1', \r\n 'description' => 'Will this item begin showing immediately or at a later date?'));\r\n $immediateActive->addMultiOption('1', 'Yes')->addMultiOption('0', 'No');\r\n $alternating = new Zend_Form_Element_Select('mediumalternating', \r\n array('label' => 'On which days should this play?', 'required' => true, \r\n 'description' => 'Will this item show only on Day 1, Day 2 or all days?'));\r\n $alternating->addMultiOptions(\r\n array('0' => 'All Days', '1' => 'Day 1', '2' => 'Day 2'));\r\n $activates = new Zend_Form_Element_Text('mediumactivation', \r\n array('label' => 'Start showing on (YYYY-MM-DD)', 'required' => false));\r\n $expires = new Zend_Form_Element_Text('mediumexpiration', \r\n array('label' => 'Stop showing on (YYYY-MM-DD)', 'required' => false));\r\n $activates->addFilter('Digits');\r\n $expires->addFilter('Digits');\r\n $duration = new Zend_Form_Element_Text('mediumduration', \r\n array('label' => 'Length to show image', \r\n 'description' => 'This value is ignored for videos.'));\r\n $duration->setValue('15');\r\n $weight = new Zend_Form_Element_Select('mediumweight', \r\n array('label' => 'Weight', \r\n 'description' => 'A higher weight usually results in the file showing more frequently.'));\r\n $weight->addValidator('int', false)\r\n ->addValidator('between', false, array(1, 10))\r\n ->addMultiOptions(array_combine(range(1, 10), range(1, 10)));\r\n $submit = new Zend_Form_Element_Submit('mediasubmit', \r\n array('label' => 'Upload!'));\r\n $submit->setDecorators(array('ViewHelper'));\r\n $reset = new Zend_Form_Element_Reset('mediareset', \r\n array('label' => 'Reset'));\r\n $reset->setDecorators(array('ViewHelper'));\r\n $file = new Zend_Form_Element_File('mediumfile', \r\n array('label' => 'Media file', 'required' => true, \r\n 'description' => 'Upload a file in a supported format (JPEG, PNG, MP4, MOV, AVI, MKV, WMV, MPG, MPEG, ZIP).'));\r\n $file->addValidator('count', false, 1)\r\n ->addValidator('Extension', false, \r\n array('jpg', 'jpeg', 'png', 'mov', 'mp4', 'avi', 'wmv', 'mkv', 'zip', \r\n 'mpg', 'mpeg', 'duizip'))\r\n ->setDestination(MEDIA_DIR);\r\n $clients = new Zend_Form_Element_Multiselect('mediumclients', \r\n array('label' => 'Show on these clients', 'required' => true, \r\n 'description' => 'You can hold down Shift or Ctrl to select multiple clients.'));\r\n foreach ($listClients as $c) {\r\n $clients->addMultiOption($c['id'], $c['sys_name']);\r\n }\r\n // file can be any mime type or extension, we're not checking it\r\n // form handling part will use the mime type and insert it into the db\r\n $form = new Zend_Form();\r\n $form->setAction(\r\n $this->view->url(\r\n array('module' => 'admin', 'controller' => 'multimedia', \r\n 'action' => 'upload-process')))\r\n ->setMethod('post')\r\n ->setAttrib('id', 'mediaupload')\r\n ->addElements(\r\n array('mediumtitle' => $title, 'mediumclients' => $clients, \r\n 'mediumfile' => $file, 'mediumactivatenow' => $immediateActive, \r\n 'mediumactivation' => $activates, 'mediumalternating' => $alternating, \r\n 'mediumexpiration' => $expires, 'mediumweight' => $weight, \r\n 'mediumduration' => $duration, 'mediasubmit' => $submit, \r\n 'mediareset' => $reset));\r\n return $form;\r\n }", "public function getJQueryUploadItem() {\n return new UploadItem(Yii::app()->clientScript->getCoreScriptUrl() . '/jquery.js');\n }", "public function actionUploadAjax() {\n\t\t$this->Uploads ( true );\n\t}", "public function setMedia(){\r\n\t\tparent::setMedia();\r\n\t\t$this->context->controller->addJS(array('https://assets.pagar.me/js/pagarme.min.js',\r\n\t\t$this->module->getPath().'/views/js/jquery.mask.min.js',\r\n\t\t$this->module->getPath().'/views/js/gateway.js',\r\n\t\t));\r\n\t}", "function my_admin_scripts() {\n\twp_enqueue_script('media-upload');\n\twp_enqueue_script('thickbox');\n\twp_register_script('my-upload', get_template_directory_uri().'/library/js/upload.js', array('jquery','media-upload','thickbox'));\n\twp_enqueue_script('my-upload');\n}", "private function _render_gallery_metabox() {\n\n\t\t$images = get_post_meta( $this->get_id(), 'modula-images', true );\n\t\t$helper_guidelines = $this->get_setting( 'helpergrid' );\n\n\t\t$max_upload_size = wp_max_upload_size();\n\t if ( ! $max_upload_size ) {\n\t $max_upload_size = 0;\n\t }\n\n\t\techo '<div class=\"modula-uploader-container\">';\n\t\techo '<div class=\"modula-upload-actions\">';\n\t\techo '<div class=\"upload-info-container\">';\n\t\techo '<div class=\"upload-info\">';\n\t\techo sprintf( __( '<b>Drag and drop</b> files here (max %s per file), or <b>drag images around to change their order</b>', 'modula-best-grid-gallery' ), esc_html( size_format( $max_upload_size ) ) );\n\t\techo '</div>';\n\t\techo '<div class=\"upload-progress\">';\n\t\techo '<p class=\"modula-upload-numbers\">' . esc_html__( 'Uploading image', 'modula-best-grid-gallery' ) . ' <span class=\"modula-current\"></span> ' . esc_html__( 'of', 'modula-best-grid-gallery' ) . ' <span class=\"modula-total\"></span>';\n\t\techo '<div class=\"modula-progress-bar\"><div class=\"modula-progress-bar-inner\"></div></div>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '<div class=\"buttons\">';\n\t\techo '<a href=\"#\" id=\"modula-uploader-browser\" class=\"button\">' . esc_html__( 'Upload image files', 'modula-best-grid-gallery' ) . '</a><a href=\"#\" id=\"modula-wp-gallery\" class=\"button button-primary\">' . esc_html__( 'Select from Library', 'modula-best-grid-gallery' ) . '</a>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '<div id=\"modula-uploader-container\" class=\"modula-uploader-inline\">';\n\t\t\techo '<div class=\"modula-error-container\"></div>';\n\t\t\techo '<div class=\"modula-uploader-inline-content\">';\n\t\t\t\techo '<h2 class=\"modula-upload-message\"><span class=\"dashicons dashicons-upload\"></span>' . esc_html__( 'Drag & Drop files here!', 'modula-best-grid-gallery' ) . '</h2>';\n\t\t\t\techo '<div id=\"modula-grid\" style=\"display:none\"></div>';\n\t\t\techo '</div>';\n\t\t\techo '<div id=\"modula-dropzone-container\"><div class=\"modula-uploader-window-content\"><h1>' . esc_html__( 'Drop files to upload', 'modula-best-grid-gallery' ) . '</h1></div></div>';\n\t\techo '</div>';\n\n\t\t// Helper Guildelines Toggle\n\t\techo '<div class=\"modula-helper-guidelines-container\">';\n\n\t\t\tdo_action( 'modula_before_helper_grid' );\n\n\t\t\techo '<div class=\"modula-toggle modula-helper-guidelines-wrapper\">';\n\t\t\t\techo '<input class=\"modula-toggle__input\" type=\"checkbox\" id=\"modula-helper-guidelines\" name=\"modula-settings[helpergrid]\" data-setting=\"modula-helper-guidelines\" value=\"1\" ' . checked( 1, $helper_guidelines, false ) . '>';\n\t\t\t\techo '<div class=\"modula-toggle__items\">';\n\t\t\t\t\techo '<span class=\"modula-toggle__track\"></span>';\n\t\t\t\t\techo '<span class=\"modula-toggle__thumb\"></span>';\n\t\t\t\t\techo '<svg class=\"modula-toggle__off\" width=\"6\" height=\"6\" aria-hidden=\"true\" role=\"img\" focusable=\"false\" viewBox=\"0 0 6 6\"><path d=\"M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z\"></path></svg>';\n\t\t\t\t\techo '<svg class=\"modula-toggle__on\" width=\"2\" height=\"6\" aria-hidden=\"true\" role=\"img\" focusable=\"false\" viewBox=\"0 0 2 6\"><path d=\"M0 0h2v6H0z\"></path></svg>';\n\t\t\t\techo '</div>';\n\t\t\t\techo '<strong class=\"modula-helper-guidelines-label\">' . esc_html__( 'Disable Helper Grid', 'modula-best-grid-gallery' ) . '</strong>';\n\t\t\techo '</div>';\n\t\t\n\t\tdo_action( 'modula_after_helper_grid' );\n\n\t\techo '</div>';\n\n\t\techo '</div>';\n\t}", "public function run() {\r\n $this->render('Uploadify', array('baseUrl'=>$this->baseUrl, 'fileDesc'=>$this->fileDesc, 'fileExt'=>$this->fileExt, 'callbackUrl'=>$this->callbackUrl, 'onCancel'=>$this->onCancel, 'onComplete'=>$this->onComplete, 'onOpen'=>$this->onOpen) );\r\n\t}", "function vibrant_life_do_field_media( $args = array() ) {\n\tvibrant_life_field_helpers()->fields->do_field_media( $args['name'], $args );\n}", "function assets() {\n\t// return;\n // This function loads in the required media files for the media manager.\n wp_enqueue_media();\n wp_register_script( 'tgm-nmp-media', get_bloginfo('template_url') . '/assets/js/media/media.js', array( 'jquery' ), '1.0.0', true );\n wp_localize_script( 'tgm-nmp-media', 'tgm_nmp_media',\n\t array(\n\t\t 'title' => __( 'Upload or Choose Your Custom Image File', 'language' ),\n\t\t 'button' => __( 'Insert Image into Input Field', 'language' ) \n\t )\n );\n wp_enqueue_script( 'tgm-nmp-media' );\n}", "public function add_media_scripts()\n {\n }", "public function addMedia() {\n\t\t$p = User::getUser();\n\t\tif ($this->isAjax() and $p) {\n\t\t\t$game = $this->getGame();\n\t\t\tif (isset($game) and $p->canAccess('Edit game information')) {\n\t\t\t\t$tabs = array();\n\t\t\t\t$tabs[MEDIA_VIDEO_URL] = $this->__('Videos');\n\t\t\t\t$tabs[MEDIA_SCREENSHOT_URL] = $this->__('Screenshots');\n\t\t\t\t$tabs[MEDIA_CONCEPTART_URL] = $this->__('Concept Art');\n\t\t\t\t$tabs[MEDIA_WALLPAPER_URL] = $this->__('Wallpapers');\n\n\t\t\t\t$data['game'] = $game;\n\t\t\t\t$data['tabs'] = $tabs;\n\t\t\t\techo $this->renderBlock('games/admin/addMedia', $data);\n\t\t\t}\n\t\t}\n\t}", "function head_opions()\r\n {\r\n $plupload_init = array(\r\n 'runtimes' => 'html5,silverlight,flash,html4',\r\n 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader\r\n 'container' => 'plupload-upload-ui', // will be adjusted per uploader\r\n 'drop_element' => 'drag-drop-area', // will be adjusted per uploader\r\n 'file_data_name' => 'async-upload', // will be adjusted per uploader\r\n 'multiple_queues' => true,\r\n 'max_file_size' => wp_max_upload_size() . 'b',\r\n 'url' => admin_url('admin-ajax.php'),\r\n 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),\r\n 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),\r\n 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')),\r\n 'multipart' => true,\r\n 'urlstream_upload' => true,\r\n 'multi_selection' => false, // will be added per uploader\r\n // additional post data to send to our ajax hook\r\n 'multipart_params' => array(\r\n '_ajax_nonce' => \"\", // will be added per uploader\r\n 'action' => 'plupload_action', // the ajax action name\r\n 'imgid' => 0 // will be added per uploader\r\n )\r\n );\r\n echo '<script type=\"text/javascript\">var base_plupload_config='.json_encode($plupload_init).'</script>';\r\n }", "function theme_video_widget($variables) {\n $element = $variables['element'];\n $output = '';\n $output .= '<div class=\"video-widget form-managed-file clearfix\">';\n\n if (isset($element['preview'])) {\n $output .= '<div class=\"video-preview\">';\n $output .= drupal_render($element['preview']);\n $output .= '</div>';\n }\n\n $output .= '<div class=\"video-widget-data\">';\n if ($element['fid']['#value'] != 0) {\n $element['filename']['#markup'] .= ' <span class=\"file-size\">(' . format_size($element['#file']->filesize) . ')</span> ';\n }\n $output .= drupal_render_children($element);\n $output .= '</div>';\n $output .= '</div>';\n\n return $output;\n}", "public function uploader() {\r\n if ((bool) $this->configuration()) {\r\n if ((bool) $this->unisession) {\r\n $GLOBALS['THEME'] = \"\";\r\n global $dir, $fileTypes, $uploadFolder, $requestTarget, $build, $jquery, $style, $build_prop, $upload_prop;\r\n $request = parse_url(request_uri());\r\n $fileTypes = array();\r\n $build = array();\r\n $fileTypes = $this->source_prop['filetypes'];\r\n $uploadFolder = $this->conf['publicfiles'] . $this->get_folder();\r\n $requestTarget = kernel::base_tag_folder_filter('{host}' . $request['path'] . \"?{$this->unisession}=process&{$request['query']}\");\r\n $build = $this->source_prop;\r\n $dir = kernel::base_tag_folder_filter(\"{host}{$this->src_folder}/{$this->upload_prop['upload.active']}\");\r\n $jquery = kernel::base_tag_folder_filter(\"{host}{$this->upload_prop['upload.jquery']}\");\r\n $style = kernel::base_tag_folder_filter(\"{host}{$this->upload_prop['upload.style']}\");\r\n $build_prop = $this->source_prop;\r\n $upload_prop = $this->upload_prop;\r\n switch ($_GET[$this->unisession]) {\r\n default:\r\n if (defined(\"USER_PRIV\")) {\r\n if ($this->upload_prop['upload.allow.lvl'] <= constant(\"USER_PRIV\")) {\r\n return $this->attach_sourceCode($this->upload_prop['upload.source.key']);\r\n }\r\n } else {\r\n global $language;\r\n $responce = (dp_show_responses(401, $language['lan.need.users']));\r\n echo \" <b>{$responce['0']}</b> <br /> {$responce['1']}\";\r\n return false;\r\n }\r\n break;\r\n case 'process':\r\n if ($this->upload_prop['upload.allow.lvl'] <= constant(\"USER_PRIV\")) {\r\n return $this->attach_sourceCode($this->upload_prop['upload.process.key']);\r\n } else {\r\n global $language;\r\n theme::content(dp_show_responses(401, $language['lan.need.users']));\r\n }\r\n break;\r\n }\r\n } else {\r\n theme::content(dp_show_responses(405, 'You do not have rights to upload!'));\r\n }\r\n }\r\n }", "public function post_upload()\n {\n $allowedExtensions = array('jpg', 'png', 'gif');\n\n // max file size in bytes\n $sizeLimit = 100 * 1024 * 1024;\n\n $uploader = new Keystone\\qqFileUploader($allowedExtensions, $sizeLimit);\n\n // Call handleUpload() with the name of the folder, relative to PHP's getcwd()\n $result = $uploader->handleUpload(path('public').'uploads/', true);\n\n if (@$result['success'] === true) {\n $asset = new Keystone\\Entity\\Asset('public/uploads/'.$uploader->getUploadName());\n \\Keystone\\Repository\\Asset::save($asset);\n $result['asset'] = $asset->to_array();\n }\n\n // to pass data through iframe you will need to encode all html tags\n echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n }", "function mfiles_head($name)\r\n\t{\r ob_start();\r\n?>\r\n<script type=\"text/javascript\">\r\n $(document).ready(function() {\r\n $(\"#mfiles_<?php echo $name;?>_add\").click(function() {$(\"#mfiles_<?php echo $name;?>\").append('<br /><input type=\"file\" name=\"<?php echo $name;?>[]\" id=\"<?php echo $id;?>\" class=\"<?php echo $class;?>\" style=\"width:220px;\" value=\"<?php echo $value;?>\">')});\r\n });\r\n</script>\r\n<?php\r\n return ob_get_clean();\r\n\t}", "function renderFileTree()\t{\n\t\t\n\t\t\n\t\t// Add specific JS\n\t\t$javascript = \"\njQuery(document).ready( function() {\n\tjQuery('#fileTreeDemo_\" . $this->cObj->data['uid'] . \"').fileTree({ root: 'fileadmin/', script: '/index.php?eID=tcfilearchive' }, function(file) { \n\t\talert(file);\n\t});\n});\n</script>\n\n\n\n\n\t\t<style type='text/css'>\n\t\t\t.demo {\n\t\t\t\twidth: 200px;\n\t\t\t\theight: 200px;\n\t\t\t\tborder-top: solid 1px #BBB;\n\t\t\t\tborder-left: solid 1px #BBB;\n\t\t\t\tborder-bottom: solid 1px #FFF;\n\t\t\t\tborder-right: solid 1px #FFF;\n\t\t\t\tbackground: #FFF;\n\t\t\t\toverflow: scroll;\n\t\t\t\tpadding: 5px;\n\t\t\t}\n\t\t</style>\n\n\n\n\n\";\n\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] .= \"\\n\" . '<script type=\"text/javascript\">' . $javascript . \"</script>\";\n\n\t\t\n\t\t$content = '<div id=\"fileTreeDemo_' . $this->cObj->data['uid'] . '\" class=\"demo\">heps</div>';\n\n\t\treturn $content;\n\t\t\n\t}", "function jquery_file_uploader($id='fileupload', $val='', $options = array(), $container_options = array()) {\n global $__APP; \n if(!$options) $options = array(); \n //print_log(\"jquery_file_uploader: options=\".dump($options, true), 'upload', LOG_LEVEL_TEST);\n $options = jfu_fix_options($options);\n print_log(\"jquery_file_uploader: cloud={$options['cloud']}\", 'upload', LOG_LEVEL_TEST);\n extract($options);\n if($error) $error = html_div($error, 'alert alert-danger');\n if(!$version) $version = 'bootstrap';\n jfu_dependencies($__APP, $options); \n \n if($coptions = jfu_container_options($id, $options)) $container_options = array_merge($container_options ?: array(), $coptions); // options for DIV container\n $container_options['data-tip'] = jfu_tip($options, true);\n $container_options['data-version'] = $version;\n $container_options['data-view'] = isset($options['view']) ? $options['view'] : \"list\";\n $classes = array('jquery-fileupload');\n if($class = $options['class']) $classes[] = $class;\n $output = html_div($error.html_div('', implode(' ', $classes), $container_options), 'jquery-file-uploader-container'); //.\"id=$id\".dump($options, true);\n //$output .= dump($options, true);\n //print_log(\"jquery_file_uploader: options=\".dump($options, true), 'upload', LOG_LEVEL_TEST);\n \n return $output;\n}", "private function renderFormMedia($field_key, array $fields, array $options_values = [])\n {\n wp_enqueue_script('jquery');\n wp_enqueue_media();\n\n $field_name = (array_key_exists('id', $fields) ? $fields['id'] : $field_key);\n // check values\n $field_values = [];\n if (is_array($options_values) && array_key_exists($field_name, $options_values)) {\n $field_values = $options_values[$field_name];\n }\n\n $preview_mode = 'preview_all';\n if (array_key_exists('mode', $fields)) {\n if (in_array($fields['mode'], ['preview_all', 'preview_url', 'preview_img', 'no_preview_img', 'no_preview_url'])) {\n $preview_mode = $fields['mode'];\n }\n }\n\n $output = '';\n if ('preview_all' === $preview_mode || 'preview_url' === $preview_mode || 'no_preview_img' === $preview_mode) {\n $output = '<input type=\"text\" id=\"preview-media-url-'.$field_name.'\" class=\"large-text\" value=\"'.(is_array($field_values) && array_key_exists('url', $field_values) ? esc_url($field_values['url']) : '').'\" readonly>'.\"\\n\";\n }\n $output .= '<input type=\"hidden\" id=\"media-id-'.$field_name.'\" name=\"'.$field_name.'[id]\" value=\"'.(is_array($field_values) && array_key_exists('id', $field_values) ? $field_values['id'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-height-'.$field_name.'\" name=\"'.$field_name.'[height]\" value=\"'.(is_array($field_values) && array_key_exists('height', $field_values) ? $field_values['height'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-width-'.$field_name.'\" name=\"'.$field_name.'[width]\" value=\"'.(is_array($field_values) && array_key_exists('width', $field_values) ? $field_values['width'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-url-'.$field_name.'\" name=\"'.$field_name.'[url]\" value=\"'.(is_array($field_values) && array_key_exists('url', $field_values) ? $field_values['url'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-large-'.$field_name.'\" name=\"'.$field_name.'[large]\" value=\"'.(is_array($field_values) && array_key_exists('large', $field_values) ? $field_values['large'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-medium-'.$field_name.'\" name=\"'.$field_name.'[medium]\" value=\"'.(is_array($field_values) && array_key_exists('medium', $field_values) ? $field_values['medium'] : '').'\">'.\"\\n\";\n $output .= '<input type=\"hidden\" id=\"media-thumbnail-'.$field_name.'\" name=\"'.$field_name.'[thumbnail]\" value=\"'.(is_array($field_values) && array_key_exists('thumbnail', $field_values) ? $field_values['thumbnail'] : '').'\">'.\"\\n\";\n $output .= '<br>'.\"\\n\";\n if ('preview_all' === $preview_mode || 'preview_img' === $preview_mode || 'no_preview_url' === $preview_mode) {\n $output .= '<div class=\"image-preview image-preview-'.$field_name.'\">';\n if (is_array($field_values) && array_key_exists('thumbnail', $field_values) && !empty($field_values['thumbnail'])) {\n $output .= '<img src=\"'.$field_values['thumbnail'].'\" alt=\"\">';\n }\n $output .= '</div>'.\"\\n\";\n }\n $output .= '<input type=\"button\" class=\"button-secondary upload-media-button\" value=\"'.__('Upload', 'okv-oauth').'\" data-input_target=\"'.$field_name.'\">'.\"\\n\";\n $output .= '<input type=\"button\" class=\"button-secondary remove-media-button\" value=\"'.__('Remove', 'okv-oauth').'\" data-input_target=\"'.$field_name.'\">'.\"\\n\";\n\n unset($field_name, $field_values, $preview_mode);\n return $output;\n }", "public function displayAjaxUploadfile()\n {\n $var1 = Tools::getValue('var1');\n $var2 = Tools::getValue('var2');\n $var3 = Tools::getValue('var3');\n//echo \"DUPA\";\n header('Content-Type: application/json');\n die(Tools::jsonEncode(['var1'=> $_FILES]));\n }", "public function render_options_media($args = array())\n {\n // Render text input field\n printf(\n '<input id=\"%s\" type=\"text\" name=\"woo_pdf_options[%s]\" value=\"%s\" class=\"woo-pdf-field-width\" />',\n $args['name'],\n $args['name'],\n $args['options'][$args['name']]\n );\n\n // Render \"Open Library\" button \n printf(\n '<input id=\"%s_upload_button\" type=\"button\" value=\"%s\" />',\n $args['name'],\n __('Open Library', 'woo_pdf')\n );\n }", "function media_uploader_admin(){\n // Create default settings\n $max_upload_size = self::$default_max_upload_size;\n $max_width = self::$default_max_width;\n $max_height = self::$default_max_height;\n $image_quality = self::$default_image_quality;\n\n if(isset($_POST['submit'])){\n if($_POST['max_upload_size']!='') $max_upload_size = $_POST['max_upload_size'];\n if($_POST['max_width']!='') $max_width = $_POST['max_width'];\n if($_POST['max_height']!='') $max_height = $_POST['max_height'];\n if($_POST['image_quality']!='') $image_quality = $_POST['image_quality'];\n \n $new_settings = array(\n 'max_upload_size' => $max_upload_size,\n 'max_width' => $max_width,\n 'max_height' => $max_height,\n 'image_quality' => $image_quality\n );\n update_site_option('mediauploader_settings', $new_settings);\n\n add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');\n }\n else if((get_site_option('mediauploader_settings'))?get_site_option('mediauploader_settings'):get_blog_option(1, 'mediauploader_settings')){\n $settings = (get_site_option('mediauploader_settings'))?get_site_option('mediauploader_settings'):get_blog_option(1, 'mediauploader_settings');\n $max_upload_size = $settings['max_upload_size'];\n $max_width = $settings['max_width'];\n $max_height = $settings['max_height'];\n $image_quality = $settings['image_quality'];\n }\n settings_errors();\n\n ?>\n <div class=\"wrap\">\n <h2>Media Uploader Settings</h2>\n <form method=\"post\" action=\"\">\n <table class=\"form-table\">\n <tr valign=\"top\">\n <th scope=\"row\">Maximum upload size</th>\n <td>\n <input type=\"text\" name=\"max_upload_size\" value=\"<?=$max_upload_size?>\" /> bytes\n <p class=\"description\">Maximum image file size in bytes</p>\n </td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\">Image resolution</th>\n <td>\n <input type=\"text\" name=\"max_width\" class=\"small-text\" value=\"<?=$max_width?>\" /> x\n <input type=\"text\" name=\"max_height\" class=\"small-text\" value=\"<?=$max_height?>\" />\n <p class=\"description\">Image resolution in pixels, width x height.</p>\n </td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\">Image quality</th>\n <td>\n <input type=\"text\" name=\"image_quality\" class=\"small-text\" value=\"<?=$image_quality?>\" /> %\n <p class=\"description\">Image quality in percent.</p>\n </td>\n </tr>\n </table>\n <?php submit_button(); ?>\n </form>\n </div>\n \n <?php\n }", "function wp_gear_manager_admin_scripts() {\n wp_enqueue_script('media-upload');\n //wp_enqueue_script('thickbox');\n wp_enqueue_script('jquery');\n wp_enqueue_media();\n wp_enqueue_script('my-uploader', WP_PLUGIN_URL. '/oko/scripts/m-uploader.js', array('jquery'/*,'media-upload','thickbox'*/));\n wp_enqueue_script('my-uploader');\n wp_enqueue_script('datepicker', WP_PLUGIN_URL. '/oko/scripts/datepicker.js');\n wp_enqueue_script('jquery-ui-datepicker');\n\n wp_enqueue_script( 'fancybox', WP_PLUGIN_URL. '/oko/js/jquery.fancybox.pack.js', array( 'jquery' ), false, true );\n wp_enqueue_script( 'lightbox', WP_PLUGIN_URL. '/oko/js/lightbox.js', array( 'fancybox' ), false, true );\n \n \n}" ]
[ "0.7370417", "0.6928465", "0.6785709", "0.6526941", "0.64519227", "0.6437506", "0.64285547", "0.63774544", "0.63686734", "0.6340649", "0.63117045", "0.62978476", "0.62819546", "0.62720925", "0.6237588", "0.62241495", "0.6179762", "0.61795706", "0.61751986", "0.61679465", "0.61567074", "0.6148257", "0.6144914", "0.61395043", "0.61263126", "0.6125318", "0.610476", "0.6100739", "0.60921484", "0.6058709", "0.60470456", "0.6042494", "0.60419345", "0.6031426", "0.6018694", "0.5992699", "0.5988099", "0.5965365", "0.5933102", "0.59188676", "0.59188676", "0.59188676", "0.59174496", "0.5914717", "0.58874744", "0.5874179", "0.5874142", "0.58612204", "0.5839375", "0.5839197", "0.5838545", "0.5832212", "0.58281577", "0.58144766", "0.57999206", "0.5789663", "0.5789343", "0.57742393", "0.57742244", "0.57569164", "0.5746035", "0.5745373", "0.5739639", "0.57303804", "0.5729787", "0.57256967", "0.57186466", "0.57052404", "0.57016116", "0.569288", "0.5689666", "0.5689666", "0.5689666", "0.5689666", "0.5680543", "0.56804603", "0.56740165", "0.5672537", "0.56702983", "0.5668598", "0.56607634", "0.5659698", "0.56586593", "0.5654017", "0.56522346", "0.5650397", "0.56418896", "0.5640958", "0.56405246", "0.5628486", "0.56164527", "0.5614779", "0.5614353", "0.56051964", "0.55974936", "0.5593733", "0.55924517", "0.5591529", "0.559047", "0.55894065" ]
0.7438468
0
Save the icons data when menu is saved
Сохраните данные иконок при сохранении меню
function saveIconData($item, $id){ if( isset($_POST['menu-item-icon'][$id]) ){ update_post_meta( $id, '_menu_item_icon', esc_url_raw($_POST['menu-item-icon'][$id]) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_menu_items() {\n \n // Save menu items\n (new MidrubBaseAdminCollectionUserHelpers\\Menu)->save_menu_items();\n \n }", "function vantage_menu_icon_save($post_id){\n\tif(empty($_POST['_vantage_menuicon_nonce']) || !wp_verify_nonce($_POST['_vantage_menuicon_nonce'], 'save_post_icon')) return;\n\tif(!current_user_can('edit_post', $post_id));\n\tupdate_post_meta($post_id, 'vantage_menu_icon', $_POST['vantage_menu_icon']);\n}", "public function saveMenus() {\n\n // Check for previously saved menu\n $menu = get_option(self::MENU);\n $submenu = get_option(self::SUBMENU);\n \n // Populate, if needed\n if ($menu === false || $submenu === false) {\n update_option(self::MENU, $GLOBALS['menu']);\n update_option(self::SUBMENU, $GLOBALS['submenu']);\n } else {\n // Compare to see if a resave is needed\n if ($menu !== $GLOBALS['menu'] || $submenu !== $GLOBALS['submenu']) {\n update_option(self::MENU, $GLOBALS['menu']);\n update_option(self::SUBMENU, $GLOBALS['submenu']);\n }\n }\n }", "public function SaveMenu() {\n\t\tDatabaseHandler::SetBeginTransaction();\n\t\tfor ($i = 0; $i < count($this -> _mGroupe); $i++) {\n\t\t\t$this -> _mGroupe[$i] -> SaveGroupe();\n\t\t}\n\t\tDatabaseHandler::CommitTransaction();\n\t}", "function wp_save_nav_menu_items($menu_id = 0, $menu_data = array())\n{\n}", "public function save(Menu $menu): void;", "function addIconToRetrievedData($items){\n foreach( $items as $item ){\n $item->icon = get_post_meta($item->db_id,'_menu_item_icon', true);\n }\n return $items;\n }", "public function saveMenuCode()\n {\n // Save menu code to template record:\n $cfg = GeneralUtility::_POST('CFG');\n if (isset($cfg['menuCode'])) {\n // Get template record:\n $TSrecord = BackendUtility::getRecord('sys_template', $this->wizardData['typoScriptTemplateID']);\n if (is_array($TSrecord)) {\n $data = array();\n $data['sys_template'][$TSrecord['uid']]['config'] = '\n\n## Menu [Begin]\n' . trim($cfg['menuCode']) . '\n## Menu [End]\n\n\n\n' . $TSrecord['config'];\n\n // Execute changes:\n $tce = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->stripslashes_values = 0;\n $tce->dontProcessTransformations = 1;\n $tce->start($data, array());\n $tce->process_datamap();\n }\n }\n }", "public function savemenu()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'menumanager', 'create')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tinclude_once '../'.DIR_CON.'/component/menumanager/modules/menu.php';\n\t\t$instance = new Menu;\n\t\t$instance->save();\n\t}", "public function save_menu_item_data() {\n\t\t$_POST['data'] = stripslashes_deep( $_POST['data'] );\n\t\tparse_str( $_POST['data'], $data );\n\t\t$updated = $data;\n\n\t\t// Save menu item data\n\t\tforeach ( $data['menu-item-mega'] as $id => $meta ) {\n\t\t\t$old_meta = get_post_meta( $id, '_menu_item_mega', true );\n\t\t\t$old_meta = tz_addons_recurse_parse_args( $old_meta, TZ_Addons_Mega_Menu::default_settings() );\n\t\t\t$meta = tz_addons_recurse_parse_args( $meta, $old_meta );\n\n\t\t\t$updated['menu-item-mega'][ $id ] = $meta;\n\n\t\t\tupdate_post_meta( $id, '_menu_item_mega', $meta );\n\t\t}\n\n\t\twp_send_json_success( $updated );\n\t}", "protected function saveMenusSession() {\n\n \\Session::put('menu', $this->getMenusByUserRol());\n }", "protected function save_items()\n {\n }", "function MENU_saveCloneMenu( ) {\n global $_CONF, $_TABLES, $LANG_MENU00, $_MENU_CONF, $Menus, $_GROUPS;\n\n $menu_name = Geeklog\\Input::fPost('menuname');\n $menu = (int) Geeklog\\Input::post('menu');\n\n $sql = \"SELECT * FROM {$_TABLES['menu']} WHERE id=\".$menu;\n $result = DB_query($sql);\n if ( DB_numRows($result) > 0 ) {\n $M = DB_fetchArray($result);\n $menu_type = $M['menu_type'];\n $menu_active = $M['menu_active'];\n $group_id = $M['group_id'];\n\n $sqlFieldList = 'menu_name,menu_type,menu_active,group_id';\n $sqlDataValues = \"'$menu_name',$menu_type,$menu_active,$group_id\";\n DB_save($_TABLES['menu'], $sqlFieldList, $sqlDataValues);\n $menu_id = DB_insertId();\n $sql = \"SELECT * FROM {$_TABLES['menu_config']} WHERE menu_id='\".$menu.\"'\";\n $result = DB_query($sql);\n while ($C = DB_fetchArray($result) ) {\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'\".$C['conf_name'].\"','\".$C['conf_value'].\"'\");\n }\n\n $meadmin = SEC_hasRights('menu.admin');\n $root = SEC_inGroup('Root');\n $groups = $_GROUPS;\n\n $sql = \"SELECT * FROM {$_TABLES['menu_elements']} WHERE menu_id=\".$menu;\n $result = DB_query($sql);\n while ($M = DB_fetchArray($result)) {\n $M['menu_id'] = $menu_id;\n $element = new mbElement();\n $element->constructor( $M, $meadmin, $root, $groups );\n $element->id = $element->createElementID($M['menu_id']);\n $element->saveElement();\n }\n }\n MENU_CACHE_remove_instance('menu');\n MENU_CACHE_remove_instance('css');\n $randID = rand();\n DB_save($_TABLES['vars'],'name,value',\"'cacheid',$randID\");\n MENU_initMENU(true);\n}", "function wp_ajax_menu_locations_save()\n{\n}", "function MENU_saveNewMenu( ) {\n global $_CONF, $_TABLES, $LANG_MENU00, $_MENU_CONF, $Menus, $_GROUPS;\n \n $menuname = Geeklog\\Input::fPost('menuname');\n $menutype = (int) Geeklog\\Input::fPost('menutype');\n $menuactive = (int) Geeklog\\Input::fPost('menuactive');\n $menugroup = (int) Geeklog\\Input::fPost('group');\n\n $sqlFieldList = 'menu_name,menu_type,menu_active,group_id';\n $sqlDataValues = \"'$menuname',$menutype,$menuactive,$menugroup\";\n DB_save($_TABLES['menu'], $sqlFieldList, $sqlDataValues);\n\n $menu_id = DB_insertId();\n\n switch ( $menutype ) {\n case 1:\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_bg_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_bg_color','#3667c0'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_text_color','#CCCCCC'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_text_color','#FFFFFF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_text_color','#FFFFFF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_text_color','#679EF1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_background_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_bg_color','#333333'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_highlight_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_shadow_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'use_images','1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_bg_filename','menu_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_hover_filename','menu_hover_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_parent_filename','menu_parent.png'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_alignment','1'\");\n break;\n case 2:\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_bg_color','#000000'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_bg_color','#000000'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_text_color','#3677C0'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_text_color','#679EF1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_text_color','#FFFFFF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_text_color','#679EF1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_background_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_bg_color','#333333'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_highlight_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_shadow_color','#151515'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'use_images','1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_bg_filename','menu_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_hover_filename','menu_hover_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_parent_filename','menu_parent.png'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_alignment','1'\");\n break;\n case 3:\n case 4:\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_bg_color','#DDDDDD'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_bg_color','#BBBBBB'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_text_color','#0000FF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'main_menu_hover_text_color','#FFFFFF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_text_color','#0000FF'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_text_color','#F7FF00'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_background_color','#DDDDDD'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_hover_bg_color','#BBBBBB'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_highlight_color','#999999'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'submenu_shadow_color','#999999'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'use_images','1'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_bg_filename','menu_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_hover_filename','menu_hover_bg.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_parent_filename','vmenu_parent.gif'\");\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_alignment','1'\");\n break;\n }\n\n MENU_CACHE_remove_instance('menu');\n MENU_CACHE_remove_instance('css');\n $randID = rand();\n DB_save($_TABLES['vars'],'name,value',\"'cacheid',$randID\");\n MENU_initMENU(true);\n}", "public function save() {\n foreach ( $this->changed as $key ) {\n update_option( $this->prefix . $key, $this->data[ $key ], false );\n }\n }", "public function loadFileTypeIcon() {\r\n parent::afterFind();\r\n if ($this->filetype == 'dir'){\r\n $this->icon = 'dir-icon';\r\n }else{\r\n // TODO: load confing\r\n $this->icon = 'file-icon';\r\n }\r\n //$this->attributes['icon'] = $this->icon;\r\n //Shared::debug($this->icon);\r\n }", "public static function _save( $menu_id, $menu_item_db_id, $menu_item_args ) {\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$screen = get_current_screen();\n\t\tif ( ! $screen instanceof WP_Screen || 'nav-menus' !== $screen->id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcheck_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );\n\n\t\t// Sanitize\n\t\tif ( ! empty( $_POST['menu-icons'][ $menu_item_db_id ] ) ) {\n\t\t\t$value = array_map(\n\t\t\t\t'sanitize_text_field',\n\t\t\t\twp_unslash( (array) $_POST['menu-icons'][ $menu_item_db_id ] )\n\t\t\t);\n\t\t} else {\n\t\t\t$value = array();\n\t\t}\n\n\t\tMenu_Icons_Meta::update( $menu_item_db_id, $value );\n\t}", "public function savepositionmenu()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'menumanager', 'update')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tinclude_once '../'.DIR_CON.'/component/menumanager/modules/menu.php';\n\t\t$instance = new Menu;\n\t\t$instance->save_position();\n\t}", "function sociallocker_change_menu_icon($icon)\n\t{\n\t\tif( !BizPanda::isSinglePlugin() ) {\n\t\t\treturn $icon;\n\t\t}\n\n\t\treturn SOCIALLOCKER_URL . '/plugin/admin/assets/img/menu-icon.png';\n\t}", "function my_update_custom_nav_fields( $menu_id, $menu_item_db_id, $args ) {\n\n\t // Check if element is properly sent\n\t if ( is_array( $_REQUEST['menu-item-icon']) ) {\n\t $icon_value = $_REQUEST['menu-item-icon'][$menu_item_db_id];\n\t update_post_meta( $menu_item_db_id, '_menu_item_icon', $icon_value );\n\t }\n\n\t}", "function on_save_changes() {\n\n if ( isset($_POST['menu_content']) ) {\n //debuge($_POST);\n $menu_content = $_POST['menu_content'];\n $menu_hints = $_POST['menu_hints'];\n $menu_links = $_POST['menu_links'];\n $submenu_id = $_POST['submenu_id'];\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n if ( get_option( 'wpdev_mc_menu_content' ) !== false ) update_option( 'wpdev_mc_menu_content' , $menu_content );\n else add_option('wpdev_mc_menu_content' , $menu_content );\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n if ( get_option( 'wpdev_mc_menu_hints' ) !== false ) update_option( 'wpdev_mc_menu_hints' , $menu_hints );\n else add_option('wpdev_mc_menu_hints' , $menu_hints );\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n if ( get_option( 'wpdev_mc_menu_links' ) !== false ) update_option( 'wpdev_mc_menu_links' , $menu_links );\n else add_option('wpdev_mc_menu_links' , $menu_links );\n\n }\n\n if( isset( $_POST['submenu_count'] ) ) {\n\n $sub_save = '';\n for ($i = 1 ; $i <= $_POST['submenu_count'] ; $i++) {\n\n if ( $_POST['page_'.$i] != '' ) $sub_save .= 'page=' . $_POST['page_'.$i];\n elseif ( $_POST['pages_'.$i] != '' ) $sub_save .= 'pages=' . $_POST['pages_'.$i];\n elseif ( $_POST['cat_'.$i] != '-1' ) $sub_save .= 'cat=' . $_POST['cat_'.$i];\n\n $sub_save .= '|';\n } $sub_save\n = substr($sub_save,0,strlen($sub_save)-1);\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////\n if ( get_option( 'wpdev_mc_submenu_id' ) !== false ) update_option( 'wpdev_mc_submenu_id' , $sub_save );\n else add_option('wpdev_mc_submenu_id' , $sub_save );\n }\n }", "function MENU_saveMenuConfig($menu_id=0) {\n global $_CONF, $_TABLES, $_MENU_CONF, $Menus;\n\n $menu_id = (int) Geeklog\\Input::fPost('menu_id');\n $mc['main_menu_bg_color'] = Geeklog\\Input::fPost('tmbg_sample');\n $mc['main_menu_hover_bg_color'] = Geeklog\\Input::fPost('tmh_sample');\n $mc['main_menu_text_color'] = Geeklog\\Input::fPost('tmt_sample');\n $mc['main_menu_hover_text_color'] = Geeklog\\Input::fPost('tmth_sample');\n $mc['submenu_text_color'] = Geeklog\\Input::fPost('smt_sample');\n $mc['submenu_hover_text_color'] = Geeklog\\Input::fPost('smth_sample');\n $mc['submenu_background_color'] = Geeklog\\Input::fPost('smbg_sample');\n $mc['submenu_hover_bg_color'] = Geeklog\\Input::fPost('smhbg_sample');\n $mc['submenu_highlight_color'] = Geeklog\\Input::fPost('smh_sample');\n $mc['submenu_shadow_color'] = Geeklog\\Input::fPost('sms_sample');\n $mc['menu_alignment'] = (int) Geeklog\\Input::fPost('malign', 0);\n $mc['use_images'] = (int) Geeklog\\Input::fPost('gorc', 0);\n $menutype = (int) Geeklog\\Input::fPost('menutype');\n $menuactive = (int) Geeklog\\Input::fPost('menuactive');\n $menugroup = (int) Geeklog\\Input::fPost('group');\n\n $menuname = $Menus[$menu_id]['menu_name'];\n\n $sqlFieldList = 'id,menu_name,menu_type,menu_active,group_id';\n $sqlDataValues = \"$menu_id,'$menuname',$menutype,$menuactive,$menugroup\";\n DB_save($_TABLES['menu'], $sqlFieldList, $sqlDataValues);\n\n foreach ($mc AS $name => $value) {\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'$name','$value'\");\n }\n\n $file = array();\n $file = $_FILES['bgimg'];\n if ( isset($file['tmp_name']) && $file['tmp_name'] != '' ) {\n\n switch ( $file['type'] ) {\n case 'image/png' :\n case 'image/x-png' :\n $ext = '.png';\n break;\n case 'image/gif' :\n $ext = '.gif';\n break;\n case 'image/jpg' :\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $ext = '.jpg';\n break;\n default :\n $ext = 'unknown';\n $retval = 2;\n break;\n }\n if ( $ext != 'unknown' ) {\n $imgInfo = @getimagesize($file['tmp_name']);\n if ( $imgInfo != false ) {\n $newFilename = 'menu_bg' . substr(md5(uniqid(rand())),0,8) . $ext;\n $rc = move_uploaded_file($file['tmp_name'],$_CONF['path_html'] . 'images/menu/' . $newFilename);\n if ( $rc ) {\n @unlink($_CONF['path_html'] . '/menu/images/' . $Menus[$menu_id]['config']['bgimage']);\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_bg_filename','$newFilename'\");\n }\n }\n }\n }\n $file = array();\n $file = $_FILES['hvimg'];\n if ( isset($file['tmp_name']) && $file['tmp_name'] != '' ) {\n switch ( $file['type'] ) {\n case 'image/png' :\n case 'image/x-png' :\n $ext = '.png';\n break;\n case 'image/gif' :\n $ext = '.gif';\n break;\n case 'image/jpg' :\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $ext = '.jpg';\n break;\n default :\n $ext = 'unknown';\n $retval = 2;\n break;\n }\n if ( $ext != 'unknown' ) {\n $imgInfo = @getimagesize($file['tmp_name']);\n if ( $imgInfo != false ) {\n $newFilename = 'menu_hover_bg' . substr(md5(uniqid(rand())),0,8) . $ext;\n $rc = move_uploaded_file($file['tmp_name'],$_CONF['path_html'] . 'images/menu/' . $newFilename);\n if ( $rc ) {\n @unlink($_CONF['path_html'] . '/menu/images/' . $Menus[$menu_id]['config']['hoverimage']);\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_hover_filename','$newFilename'\");\n }\n }\n }\n }\n $file = array();\n $file = $_FILES['piimg'];\n if ( isset($file['tmp_name']) && $file['tmp_name'] != '' ) {\n switch ( $file['type'] ) {\n case 'image/png' :\n case 'image/x-png' :\n $ext = '.png';\n break;\n case 'image/gif' :\n $ext = '.gif';\n break;\n case 'image/jpg' :\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $ext = '.jpg';\n break;\n default :\n $ext = 'unknown';\n $retval = 2;\n break;\n }\n if ( $ext != 'unknown' ) {\n $imgInfo = @getimagesize($file['tmp_name']);\n if ( $imgInfo != false ) {\n $newFilename = 'menu_parent' . substr(md5(uniqid(rand())),0,8) . $ext;\n $rc = move_uploaded_file($file['tmp_name'],$_CONF['path_html'] . 'images/menu/' . $newFilename);\n if ( $rc ) {\n @unlink($_CONF['path_html'] . '/menu/images/' . $Menus[$menu_id]['config']['parentimage']);\n DB_save($_TABLES['menu_config'],\"menu_id,conf_name,conf_value\",\"$menu_id,'menu_parent_filename','$newFilename'\");\n }\n }\n }\n }\n MENU_CACHE_remove_instance('menu');\n MENU_CACHE_remove_instance('css');\n $randID = rand();\n DB_save($_TABLES['vars'],'name,value',\"'cacheid',$randID\");\n return;\n}", "public static function save() {\n\t\tThemexCore::updateOption(self::$id,self::$data);\n\t}", "function write_add_icons() {\n\n ?> <div class=\"clear\"><br></div> <?php\n\n require_once(WPDEV_CP_PLUGIN_DIR. '/include/wpdev-flash-uploader.php' ); // Connect to flash uploader class\n\n $this->flash_uploader = &new wpdev_flash_uploader( 'Choose Icons to upload' );\n\n $this->flash_uploader->set_dir( array($this->icons_dir, $this->icons_url) );\n\n if(get_option( 'wpdev_mc_icon_crop' ) == 'On') $wpdev_mc_icon_crop = 1;\n else $wpdev_mc_icon_crop = 0;\n\n $this->flash_uploader->set_sizes( get_option( 'wpdev_mc_icon_size_w' ), get_option( 'wpdev_mc_icon_size_h' ), $wpdev_mc_icon_crop );\n\n $this->flash_uploader->upload_form();\n }", "public function saveCurrent() {\n\t\treturn \\MyStorage::save('lg', $this);\t\t\n\t}", "public function saveStyleIcon($file)\n {\n if ($file) {\n $filename = 'ol_style_static_icon.'.$file->getClientOriginalExtension();\n $file->move($this->getPublicStoragePath(), $filename);\n $this->ol_style_static_icon = $filename;\n $this->save();\n }\n }", "public function getIconsPath()\n {\n return 'storage/layer/'.$this->id.'/icons';\n }", "function jig_save_refreshed_fb_icons(){\r\n\t\t\tcheck_ajax_referer('jig_save_refreshed_fb_icons', 'security');\r\n\t\t\t$output = array();\r\n\t\t\t$new_icons = $_REQUEST['new_icons'];\r\n\t\t\tif(!empty($new_icons)){\r\n\t\t\t\tforeach ($new_icons as $pair) {\r\n\t\t\t\t\t$this->settings['fb_authed'][$pair[0]]['picture'] = $pair[1];\r\n\t\t\t\t}\r\n\t\t\t\tupdate_option(self::SETTINGS_NAME,$this->settings);\r\n\t\t\t\t$output = array('success'\t\t\t=> 'OK',\r\n\t\t\t\t\t\t\t\t'success_singular'\t=> __('icon was saved successfully.', 'jig_td'),\r\n\t\t\t\t\t\t\t\t'success_plural' \t=> __('icons were saved successfully.', 'jig_td')\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t}else{\r\n\t\t\t\t$output = array('error' => __(\"Icons could not be saved.\", \"jig_td\"));\r\n\t\t\t}\r\n\t\t\techo json_encode($output);\r\n\t\t\tdie();\r\n\t\t}", "function MENU_saveEditMenuElement ( ) {\n global $_TABLES, $Menus;\n \n $id = (int) Geeklog\\Input::fPost('id');\n $menu_id = Geeklog\\Input::fPost('menu');\n $pid = (int) Geeklog\\Input::fPost('pid');\n $label = htmlspecialchars(strip_tags(COM_checkWords(Geeklog\\Input::post('menulabel'))));\n $type = (int) Geeklog\\Input::fPost('menutype');\n $target = Geeklog\\Input::fPost('urltarget');\n\n if ($type == 0) {\n $type = 1;\n }\n\n switch($type) {\n case 2 :\n $subtype = Geeklog\\Input::fPost('glfunction');\n break;\n case 3 :\n $subtype = (int) Geeklog\\Input::fPost('gltype');\n break;\n case 4 :\n $subtype = Geeklog\\Input::fPost('pluginname');\n break;\n case 5 :\n $subtype = Geeklog\\Input::fPost('spname');\n break;\n case 6 :\n $subtype = Geeklog\\Input::fPost('menuurl');\n if ( strpos($subtype,\"http\") !== 0 && strpos($subtype,\"%site\") === false && $subtype[0] != '#' && rtrim($subtype) != '' ) {\n $subtype = 'http://' . $subtype;\n }\n break;\n case 7 :\n $subtype = Geeklog\\Input::fPost('phpfunction');\n break;\n case 9 :\n $subtype = Geeklog\\Input::fPost('topicname');\n break;\n default :\n $subtype = '';\n break;\n }\n \n $active = (int) Geeklog\\Input::fPost('menuactive');\n $url = trim(Geeklog\\Input::fPost('menuurl'));\n\n if (strpos($url,\"http\") !== 0 && strpos($url,\"%site\") === false && $url[0] != '#' && rtrim($url) != '') {\n $url = 'http://' . $url;\n }\n\n $group_id = (int) Geeklog\\Input::fPost('group');\n $aid = (int) Geeklog\\Input::fPost('menuorder');\n $aorder = DB_getItem($_TABLES['menu_elements'],'element_order','id=' . $aid);\n $neworder = $aorder + 1;\n\n $sql = \"UPDATE {$_TABLES['menu_elements']} SET pid=$pid, element_order=$neworder, element_label='$label', element_type='$type', element_subtype='$subtype', element_active=$active, element_url='$url', element_target='$target', group_id=$group_id WHERE id=$id\";\n\n DB_query($sql);\n MENU_initMENU(true);\n $Menus[$menu_id]['elements'][$pid]->reorderMenu();\n MENU_initMENU(true);\n}", "function save() {\n\t\t\t//Log::debug( \"SUH saving settings: \" . print_r( self::$cache, true ) );\n\t\t\tupdate_site_option( self::SETTINGS_KEY, self::$cache );\n\t\t}", "function save_menu_item($obj){\n $handle = @fopen($GLOBALS['filename'], 'w+');\n // create the file if needed\n if ($handle == null)\n {\n $handle = fopen($GLOBALS['filename'], 'w+');\n }\n\n if ($handle)\n {\n fwrite($handle, ($obj));\n // close the handle on the file\n fclose($handle);\n }\n\n}", "function addIconsToOutput($items){\n foreach( $items as $item ){\n if( $item->icon != ''){\n \n $format = apply_filters('menu_icons_format', '<img src=\"%s\" />%s', $item );\n \n $img = sprintf($format,$item->icon, $item->title );\n $item->title = $img;\n }\n }\n return $items;\n }", "public function save(){\n\t\tfile_put_contents(self::classmap,json_encode([\n\t\t\t\"autoload\" => Globals::getInstance()->__autoload__,\n\t\t\t\"pragmas\" => Globals::getInstance()->__pragmas__,\n\t\t]));\n\t\tif(!file_exists(self::timestamp)){\n\t\t\tfile_put_contents(self::timestamp,time().\",{$this->prefix}\");\n\t\t}\n\t}", "public function saveData()\n {\n if ($this->model instanceof Archive)\n self::setArchiveHeatData($this->data);\n elseif ($this->model instanceof Manga)\n self::setMangaHeatData($this->data);\n\n $this->data = $this->data();\n }", "function save_defaults() {\n $_SESSION[$this->storage_name] = serialize($this->user_permissions);\n }", "function addMenuImg($img_path){\n $this->menuImg = $img_path;\n }", "function addIconToMenuColumns($columns){\n $columns['icon'] = 'Icon';\n return $columns; \n }", "function _set_site_icon() {\n\t\tif ( ! $this->site_icon_id ) {\n\t\t\tadd_filter( 'intermediate_image_sizes_advanced', array( $this->wp_site_icon, 'additional_sizes' ) );\n\t\t\t$this->_insert_attachment();\n\t\t\tremove_filter( 'intermediate_image_sizes_advanced', array( $this->wp_site_icon, 'additional_sizes' ) );\n\t\t}\n\n\t\tupdate_option( 'site_icon', $this->site_icon_id );\n\t}", "public function saveAppearance(){\n print $this->save('appearance');\n }", "function saveMenu( $menu_id, $action_type ) {\n if (\n did_action('wp_update_nav_menu') > 1 ||\n did_action('wp_create_nav_menu') > 1\n ) {\n return $menu_id;\n }\n\n // Get a menu object\n $menu_object = wp_get_nav_menu_object( $menu_id );\n\n // Bail if not a menu object\n if ( empty( $menu_object ) ) {\n return $menu_id;\n }\n\n $global_relay_id = Relay::toGlobalId(\n 'Menu',\n $menu_id\n );\n\n $this->insertNewAction([\n 'action_type' => $action_type,\n 'title' => $menu_object->name,\n 'status' => 'publish', // menus don't have post status. This is for Gatsby\n 'node_id' => $menu_id,\n 'relay_id' => $global_relay_id,\n 'graphql_single_name' => 'menu',\n 'graphql_plural_name' => 'menus',\n ]);\n }", "protected function save_items() {\n\t\t\tforeach ( $this->items_to_delete as $item ) {\n\t\t\t\t$item->delete();\n\t\t\t}\n\t\t\t$this->items_to_delete = array();\n\n\t\t\t// Add/save items.\n\t\t\tforeach ( $this->items as $product_id => $item ) {\n\t\t\t\t$item->set_wishlist_id( $this->get_id() );\n\t\t\t\t$item->save();\n\t\t\t}\n\t\t}", "public function save()\n {\n $file = $this->file();\n if ($file) {\n $file->save($this->items);\n }\n }", "public function stdWrap_editIconsDataProvider() {}", "function save_item() {\n\t\tglobal $db;\n\t\t$db->put_data($this->items,$this->events_file);\n\t\t$db->put_data($this->items_map,$this->events_map_file);\n\t}", "public function save() {\n\t\tupdate_option( self::SAVE_KEY, $this->toArray(), false );\n\t}", "public static function migrate_menu_items()\n {\n }", "private function save()\r\n {\r\n Cache::set(\"components\", $this->componenets);\r\n Cache::set(\"mappings\", $this->mappings);\r\n Cache::set(\"hooks\", $this->hooks);\r\n Cache::set(\"pages\", $this->pages);\r\n Cache::set(\"auth\", $this->auth);\r\n }", "public static function EDIT_MENU(){\n\t\tLibMenuBar::startTable();\n\t\tLibMenuBar::save('savecategory');\n\t\tLibMenuBar::cancel('cancelcategory');\n\t\tLibMenuBar::endTable();\n\t}", "public function dot_cfi_menu_contents() {\n\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<!--<div id=\"icon-freshdesk-32\" class=\"icon32\"><br></div>-->\n\t\t\t\t<div id=\"icon-options-general\" class=\"icon32\"><br></div>\n\t\t\t\t<h2><?php _e('Custom Favicon Settings', 'dot_cfi'); ?></h2>\n\n\t\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t\t<?php //wp_nonce_field('update-options'); ?>\n\t\t\t\t\t<?php settings_fields('dot_cfi_settings'); ?>\n\t\t\t\t\t<?php do_settings_sections('dot_cfi_settings'); ?>\n\t\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t\t<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes', 'dot_cfi'); ?>\" />\n\t\t\t\t\t</p>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t<?php\n\t\t}", "public static function EDIT_MENU(){\n\t\tLibMenuBar::startTable();\n\t\tLibMenuBar::save('saveclient');\n\t\tLibMenuBar::cancel('cancelclient');\n\t\tLibMenuBar::endTable();\n\t}", "public function icons(){\n\t\tsession_start();\n\t\t$_SESSION[\"views\"]=\"imageView\";\n\t}", "function horijontal_menu_icon(){\n $menu_icon = array(\n '<i class=\"fa fa-tachometer\"></i>',\n '<i class=\"fa fa-suitcase\"></i>',\n '<i class=\"fa fa-users\"></i>',\n '<i class=\"fa fa-calendar\"></i>',\n '<i class=\"fa fa-file-text-o\"></i>',\n '<i class=\"fa fa-credit-card\"></i>',\n '<i class=\"fa fa-book\"></i>',\n '<i class=\"fa fa-connectdevelop\"></i>',\n '<i class=\"fa fa-rocket\"></i>',\n '<i class=\"fa fa-cog fa-spin\"></i>'\n );\n return $menu_icon;\n }", "public function icons(): static;", "static function saveCacheNavigation($id, $naviItemes){\n\t\twe_base_file::save(self::getNavigationFilename($id), we_serialize($naviItemes->items, SERIALIZE_PHP, false, 9));\n\t}", "function emoticons_save($form_arr) {\n\t\t\t\n\t\t\t$str = '';\n\t\t\t$emote_arr = Array();\n\t\t\tfor ( $i = 0; $i < count($form_arr); $i++) {\n\t\t\t\t$temp_arr = Array();\n\t\t\t\t$tags = $form_arr[$i]['TAGS'];\n\t\t\t\t$tags = str_replace( '|', '&#124;', $tags );\n\t\t\t\t$tags = str_replace( '=', '&#61;', $tags );\n\t\t\t\t\n\t\t\t\t$temp_arr['PATH'] = $form_arr[$i]['PATH'];\n\t\t\t\t$temp_arr['TAGS'] = sb_stripslashes($tags);\n\t\t\t\t\n\t\t\t\tarray_push( $emote_arr, implode_with_keys( $temp_arr, '=' ) );\n\t\t\t}\n\t\t\t$str = implode( '|', $emote_arr );\n\t\t\t\n\t\t\treturn sb_write_file( CONFIG_DIR.'emoticons.txt', $str );\n\t\t}", "public static function NEW_EDIT_MENU(){\n\t\tLibMenuBar::startTable();\n\t\tLibMenuBar::save('savebanner');\n\t\tLibMenuBar::apply('applybanner');\n\t\tLibMenuBar::cancel('cancelbanner');\n\t\tLibMenuBar::endTable();\n\t}", "function put(){\n \tif(isset($_POST['save_loggedin_menu'])){\n\t \tif ( !isset($_POST['loggedin_menu_security']) || !wp_verify_nonce($_POST['loggedin_menu_security'],'loggedin_menu_security') || !current_user_can('manage_options')){\n\t \t_e('Security check Failed. Contact Administrator.','vibe-customtypes');\n\t \tdie();\n\n\t \t}\n\t \tif(empty($_POST['loggedin_menu']) || empty($_POST['loggedin_menu']['component']))\n\t \t\treturn;\n\n\t \t$new_loggedin_menu = array();\n\t \tforeach($_POST['loggedin_menu']['component'] as $k => $component){\n\t \t\t$new_loggedin_menu[$component] = array();\n\t \t\tif(isset($_POST['loggedin_menu']['label'][$k])){\n\t \t\t\t$new_loggedin_menu[$component]['label'] = $_POST['loggedin_menu']['label'][$k];\n\t \t\t\tif (function_exists ( 'icl_register_string' )){\n\t\t\t\t\t\ticl_register_string('wplms', 'Loggedin Menu - '.$component, $_POST['loggedin_menu']['label'][$k]);\n\t\t\t\t\t}\n\t \t\t}\n\t \t\tif(isset($_POST['loggedin_menu']['icon'][$k])){\n\t \t\t\t$new_loggedin_menu[$component]['icon'] = $_POST['loggedin_menu']['icon'][$k];\n\t \t\t}\n\t \t\tif(isset($_POST['loggedin_menu']['link'][$k])){\n\t \t\t\t$new_loggedin_menu[$component]['link'] = $_POST['loggedin_menu']['link'][$k];\n\t \t\t}\n\t \t\tif(isset($_POST['loggedin_menu']['privacy'][$k])){\n\t \t\t\t$new_loggedin_menu[$component]['privacy'] = $_POST['loggedin_menu']['privacy'][$k];\n\t \t\t}\n\t \t}\n\t\t\tupdate_option('logged_in_profile_menu',$new_loggedin_menu);\n\t \t?>\n\t \t<div class=\"message updated\">\n\t \t\t<p><?php _ex('Settings saved','saved settings message','vibe-customtypes'); ?></p>\n\t \t</div>\n\t \t<?php\n \t}\n }", "public function set_icon($icon)\n {\n }", "public function icons() {\n /*\n * TEMPLATE QUE SERÁ USADO PELO MÓDULO DO SISTEMA\n */\n $this->dados['_conteudo_masterPageIframe'] = $this->router->fetch_class() . '/vIcons';\n $this->load->view('vMasterPageIframe', $this->dados);\n }", "function _chooseIcon(){\r\n\t}", "public function save()\n {\n if ($this->type == self::TYPE_SYSTEM) {\n $this->key = Helpers::ensureKeyHasNoPrefix($this->key);\n }\n $wpRole = get_role($this->key);\n if (!$wpRole) {\n add_role($this->key, $this->name, $this->capabilities);\n } else {\n foreach ($this->getCapabilities() as $capability => $grant) {\n $wpRole->add_cap($capability, $grant);\n }\n }\n\n\n if ($this->type != self::TYPE_SYSTEM) {\n $customRoles = Option::get('roles');\n $customRoles[$this->type][$this->key] = $this->name;\n Option::set('roles', $customRoles);\n }\n\n }", "function add_home_icon() {\n add_menu_page(__('Home Icon'), __('Home Icon'), 'manage_options', 'home-icon', 'add_toplevel_page');\n}", "private function icons() {\n\t\t\n\t\t$icons = array( \n\t\t\t\"genericon-f423\" => \"genericon-404\",\n\t\t\t\"genericon-f508\" => \"genericon-activity\",\n\t\t\t\"genericon-f509\" => \"genericon-anchor\",\n\t\t\t\"genericon-f101\" => \"genericon-aside\",\n\t\t\t\"genericon-f416\" => \"genericon-attachment\",\n\t\t\t\"genericon-f109\" => \"genericon-audio\",\n\t\t\t\"genericon-f471\" => \"genericon-bold\",\n\t\t\t\"genericon-f444\" => \"genericon-book\",\n\t\t\t\"genericon-f50a\" => \"genericon-bug\",\n\t\t\t\"genericon-f447\" => \"genericon-cart\",\n\t\t\t\"genericon-f301\" => \"genericon-category\",\n\t\t\t\"genericon-f108\" => \"genericon-chat\",\n\t\t\t\"genericon-f418\" => \"genericon-checkmark\",\n\t\t\t\"genericon-f405\" => \"genericon-close\",\n\t\t\t\"genericon-f406\" => \"genericon-close-alt\",\n\t\t\t\"genericon-f426\" => \"genericon-cloud\",\n\t\t\t\"genericon-f440\" => \"genericon-cloud-download\",\n\t\t\t\"genericon-f441\" => \"genericon-cloud-upload\",\n\t\t\t\"genericon-f462\" => \"genericon-code\",\n\t\t\t\"genericon-f216\" => \"genericon-codepen\",\n\t\t\t\"genericon-f445\" => \"genericon-cog\",\n\t\t\t\"genericon-f432\" => \"genericon-collapse\",\n\t\t\t\"genericon-f300\" => \"genericon-comment\",\n\t\t\t\"genericon-f305\" => \"genericon-day\",\n\t\t\t\"genericon-f221\" => \"genericon-digg\",\n\t\t\t\"genericon-f443\" => \"genericon-document\",\n\t\t\t\"genericon-f428\" => \"genericon-dot\",\n\t\t\t\"genericon-f502\" => \"genericon-downarrow\",\n\t\t\t\"genericon-f50b\" => \"genericon-download\",\n\t\t\t\"genericon-f436\" => \"genericon-draggable\",\n\t\t\t\"genericon-f201\" => \"genericon-dribbble\",\n\t\t\t\"genericon-f225\" => \"genericon-dropbox\",\n\t\t\t\"genericon-f433\" => \"genericon-dropdown\",\n\t\t\t\"genericon-f434\" => \"genericon-dropdown-left\",\n\t\t\t\"genericon-f411\" => \"genericon-edit\",\n\t\t\t\"genericon-f476\" => \"genericon-ellipsis\",\n\t\t\t\"genericon-f431\" => \"genericon-expand\",\n\t\t\t\"genericon-f442\" => \"genericon-external\",\n\t\t\t\"genericon-f203\" => \"genericon-facebook\",\n\t\t\t\"genericon-f204\" => \"genericon-facebook-alt\",\n\t\t\t\"genericon-f458\" => \"genericon-fastforward\",\n\t\t\t\"genericon-f413\" => \"genericon-feed\",\n\t\t\t\"genericon-f468\" => \"genericon-flag\",\n\t\t\t\"genericon-f211\" => \"genericon-flickr\",\n\t\t\t\"genericon-f226\" => \"genericon-foursquare\",\n\t\t\t\"genericon-f474\" => \"genericon-fullscreen\",\n\t\t\t\"genericon-f103\" => \"genericon-gallery\",\n\t\t\t\"genericon-f200\" => \"genericon-github\",\n\t\t\t\"genericon-f206\" => \"genericon-googleplus\",\n\t\t\t\"genericon-f218\" => \"genericon-googleplus-alt\",\n\t\t\t\"genericon-f50c\" => \"genericon-handset\",\n\t\t\t\"genericon-f461\" => \"genericon-heart\",\n\t\t\t\"genericon-f457\" => \"genericon-help\",\n\t\t\t\"genericon-f404\" => \"genericon-hide\",\n\t\t\t\"genericon-f505\" => \"genericon-hierarchy\",\n\t\t\t\"genericon-f409\" => \"genericon-home\",\n\t\t\t\"genericon-f102\" => \"genericon-image\",\n\t\t\t\"genericon-f455\" => \"genericon-info\",\n\t\t\t\"genericon-f215\" => \"genericon-instagram\",\n\t\t\t\"genericon-f472\" => \"genericon-italic\",\n\t\t\t\"genericon-f427\" => \"genericon-key\",\n\t\t\t\"genericon-f503\" => \"genericon-leftarrow\",\n\t\t\t\"genericon-f107\" => \"genericon-link\",\n\t\t\t\"genericon-f207\" => \"genericon-linkedin\",\n\t\t\t\"genericon-f208\" => \"genericon-linkedin-alt\",\n\t\t\t\"genericon-f417\" => \"genericon-location\",\n\t\t\t\"genericon-f470\" => \"genericon-lock\",\n\t\t\t\"genericon-f410\" => \"genericon-mail\",\n\t\t\t\"genericon-f422\" => \"genericon-maximize\",\n\t\t\t\"genericon-f419\" => \"genericon-menu\",\n\t\t\t\"genericon-f50d\" => \"genericon-microphone\",\n\t\t\t\"genericon-f421\" => \"genericon-minimize\",\n\t\t\t\"genericon-f50e\" => \"genericon-minus\",\n\t\t\t\"genericon-f307\" => \"genericon-month\",\n\t\t\t\"genericon-f50f\" => \"genericon-move\",\n\t\t\t\"genericon-f429\" => \"genericon-next\",\n\t\t\t\"genericon-f456\" => \"genericon-notice\",\n\t\t\t\"genericon-f506\" => \"genericon-paintbrush\",\n\t\t\t\"genericon-f219\" => \"genericon-path\",\n\t\t\t\"genericon-f448\" => \"genericon-pause\",\n\t\t\t\"genericon-f437\" => \"genericon-phone\",\n\t\t\t\"genericon-f473\" => \"genericon-picture\",\n\t\t\t\"genericon-f308\" => \"genericon-pinned\",\n\t\t\t\"genericon-f209\" => \"genericon-pinterest\",\n\t\t\t\"genericon-f210\" => \"genericon-pinterest-alt\",\n\t\t\t\"genericon-f452\" => \"genericon-play\",\n\t\t\t\"genericon-f439\" => \"genericon-plugin\",\n\t\t\t\"genericon-f510\" => \"genericon-plus\",\n\t\t\t\"genericon-f224\" => \"genericon-pocket\",\n\t\t\t\"genericon-f217\" => \"genericon-polldaddy\",\n\t\t\t\"genericon-f460\" => \"genericon-portfolio\",\n\t\t\t\"genericon-f430\" => \"genericon-previous\",\n\t\t\t\"genericon-f469\" => \"genericon-print\",\n\t\t\t\"genericon-f106\" => \"genericon-quote\",\n\t\t\t\"genericon-f511\" => \"genericon-rating-empty\",\n\t\t\t\"genericon-f512\" => \"genericon-rating-full\",\n\t\t\t\"genericon-f513\" => \"genericon-rating-half\",\n\t\t\t\"genericon-f222\" => \"genericon-reddit\",\n\t\t\t\"genericon-f420\" => \"genericon-refresh\",\n\t\t\t\"genericon-f412\" => \"genericon-reply\",\n\t\t\t\"genericon-f466\" => \"genericon-reply-alt\",\n\t\t\t\"genericon-f467\" => \"genericon-reply-single\",\n\t\t\t\"genericon-f459\" => \"genericon-rewind\",\n\t\t\t\"genericon-f501\" => \"genericon-rightarrow\",\n\t\t\t\"genericon-f400\" => \"genericon-search\",\n\t\t\t\"genericon-f438\" => \"genericon-send-to-phone\",\n\t\t\t\"genericon-f454\" => \"genericon-send-to-tablet\",\n\t\t\t\"genericon-f415\" => \"genericon-share\",\n\t\t\t\"genericon-f403\" => \"genericon-show\",\n\t\t\t\"genericon-f514\" => \"genericon-shuffle\",\n\t\t\t\"genericon-f507\" => \"genericon-sitemap\",\n\t\t\t\"genericon-f451\" => \"genericon-skip-ahead\",\n\t\t\t\"genericon-f450\" => \"genericon-skip-back\",\n\t\t\t\"genericon-f220\" => \"genericon-skype\",\n\t\t\t\"genericon-f424\" => \"genericon-spam\",\n\t\t\t\"genericon-f515\" => \"genericon-spotify\",\n\t\t\t\"genericon-f100\" => \"genericon-standard\",\n\t\t\t\"genericon-f408\" => \"genericon-star\",\n\t\t\t\"genericon-f105\" => \"genericon-status\",\n\t\t\t\"genericon-f449\" => \"genericon-stop\",\n\t\t\t\"genericon-f223\" => \"genericon-stumbleupon\",\n\t\t\t\"genericon-f463\" => \"genericon-subscribe\",\n\t\t\t\"genericon-f465\" => \"genericon-subscribed\",\n\t\t\t\"genericon-f425\" => \"genericon-summary\",\n\t\t\t\"genericon-f453\" => \"genericon-tablet\",\n\t\t\t\"genericon-f302\" => \"genericon-tag\",\n\t\t\t\"genericon-f303\" => \"genericon-time\",\n\t\t\t\"genericon-f435\" => \"genericon-top\",\n\t\t\t\"genericon-f407\" => \"genericon-trash\",\n\t\t\t\"genericon-f214\" => \"genericon-tumblr\",\n\t\t\t\"genericon-f516\" => \"genericon-twitch\",\n\t\t\t\"genericon-f202\" => \"genericon-twitter\",\n\t\t\t\"genericon-f446\" => \"genericon-unapprove\",\n\t\t\t\"genericon-f464\" => \"genericon-unsubscribe\",\n\t\t\t\"genericon-f401\" => \"genericon-unzoom\",\n\t\t\t\"genericon-f500\" => \"genericon-uparrow\",\n\t\t\t\"genericon-f304\" => \"genericon-user\",\n\t\t\t\"genericon-f104\" => \"genericon-video\",\n\t\t\t\"genericon-f517\" => \"genericon-videocamera\",\n\t\t\t\"genericon-f212\" => \"genericon-vimeo\",\n\t\t\t\"genericon-f414\" => \"genericon-warning\",\n\t\t\t\"genericon-f475\" => \"genericon-website\",\n\t\t\t\"genericon-f306\" => \"genericon-week\",\n\t\t\t\"genericon-f205\" => \"genericon-wordpress\",\n\t\t\t\"genericon-f504\" => \"genericon-xpost\",\n\t\t\t\"genericon-f213\" => \"genericon-youtube\",\n\t\t\t\"genericon-f402\" => \"genericon-zoom\"\n\t\t);\n\n\t\t$icons = apply_filters( \"megamenu_genericons_icons\", $icons );\n\n\t\treturn $icons;\n\n\t}", "function __construct(){\n add_filter( 'wp_edit_nav_menu_walker', array($this, 'customWalkerNavMenuEdit') );\n //add ability to hide icon\n add_filter( 'manage_nav-menus_columns', array( $this, 'addIconToMenuColumns'),99 ); \n //retreive icon data when needed\n add_filter( 'wp_get_nav_menu_items', array( $this, 'addIconToRetrievedData' ) );\n //Save icon data on menu save\n add_action('wp_update_nav_menu_item', array( $this, 'saveIconData'), 3, 3 );\n \n //Add the JQuery for the media uploader\n add_action('admin_head', array( $this, 'jsOutput') );\n \n //Add the icons to outputted menu\n add_filter('wp_nav_menu_objects', array($this,'addIconsToOutput'),5,3 );\n }", "function daiquiri_update_nav_menu() {\n if (!is_dir(WP_CONTENT_DIR . '/menus/')) {\n mkdir(WP_CONTENT_DIR . '/menus/', 0755);\n }\n // loop over menus and save the html in the wp-content/menus directory\n foreach (get_terms( 'nav_menu') as $menu) {\n $html = wp_nav_menu(array(\n 'menu' => $menu->name,\n 'echo' => false,\n 'container' => false,\n 'items_wrap' => '%3$s'\n ));\n $filename = WP_CONTENT_DIR . '/menus/' . $menu->name . '.html';\n $fh = fopen($filename, 'w') or die(\"can't open file\");\n fwrite($fh, $html);\n fclose($fh);\n }\n}", "function vantage_menu_icon_metabox(){\n\tadd_meta_box(\n\t\t'vantage-menu-icon-metabox',\n\t\t__( 'Menu Icon', 'vantage' ),\n\t\t'vantage_menu_icon_metabox_render',\n\t\t'page',\n\t\t'side'\n\t);\n}", "protected function getIcons() {\n return [];\n }", "function section_persistent(){\n\t\t\tregister_nav_menus( array( 'brandnav' => __( 'BrandNav Section Navigation', 'pagelines' ) ) );\n\t}", "public function save()\n {\n $params = request()->all();\n $this->menuService->editMenu($params);\n return $this->success('保存成功!');\n }", "protected function save_caches() {\n if ($this->cachechangedcourse) {\n cache::make('core', 'tagindexbuilder')->set('courseaccess', $this->courseaccess);\n $this->cachechangedcourse = false;\n }\n if ($this->cachechangedaccessible) {\n cache::make('core', 'tagindexbuilder')->set($this->component.'__'.$this->itemtype,\n $this->accessibleitems);\n $this->cachechangedaccessible = false;\n }\n }", "public function save($data)\n\t{\n\t\tif (static::$file_name == '.settings')\n\t\t\tstatic::$key_values = array_slice($data, 0, count(static::$key_values));\n\t\telse\n\t\t\tstatic::$key_values = $data;\n\t\tself::save_data();\n\t}", "function my_menu() {\n add_menu_page( \"Mihanblog importer\", \"میهن بلاگ\", \"manage_options\", \"import_page\", 'showpage', \"http://static.mihanblog.com//public/images/icon/favicon2.gif\" );\n}", "public function onAdminMenu()\n {\n $this->grav['twig']->plugins_hooked_nav['PLUGIN_SHOPPINGCART.SHOPPING_CART'] = ['route' => $this->route, 'icon' => 'fa-shopping-cart'];\n }", "function crear_menu(){\r\n add_menu_page('Descarga CSV', 'Descarga Encuesta', 'activate_plugins', 'descarga_csv', 'funcion_descarga', '\r\ndashicons-download', 7);\r\n}", "function get_icons_data(){\n return [ 'TV' => 'fa fa-television',\n 'WIFI' => 'fa fa-wifi',\n 'BATH' => 'fa fa-bath',\n 'PHONE' => 'fa fa-phone',\n 'MINIBAR' => 'fa fa-th-large',\n 'BREAKFAST' => 'fa fa-cutlery',\n 'HAIRDRYER' => 'fa fa-plug',\n ];\n}", "function edit_admin_menus() {\n global $menu;\n $menu[5][0] = 'Новости'; \n}", "private function setMenus()\n {\n $all_menus = array('top_menu', 'footer_menu');\n foreach ($all_menus as $menu_type) {\n $data_menu = array();\n $menu = Models::menu()->getMenu($menu_type, 0);\n foreach ($menu as $item) {\n $menu_item = array(\n 'name' =>$item['menu_name'],\n 'title' =>$item['menu_name'],\n 'icon' =>$item['menu_icon'],\n 'url' =>substr($item['menu_url'], 0, 4)==\"http\" ? $item['menu_url'] : base_url($this->language['code'].\"/\".$item['menu_url']),\n );\n $sub_menu = Models::menu()->getMenu(\"top_menu\", $item['menu_id']);\n\n if (count($sub_menu)!=0) {\n $sub_menu_data = array();\n foreach ($sub_menu as $sub_item) {\n $sub_menu_item = array(\n 'name' =>$sub_item['menu_name'],\n 'title' =>$sub_item['menu_name'],\n 'icon' =>$sub_item['menu_icon'],\n 'url' =>substr($sub_item['menu_url'], 0, 4)==\"http\" ? $sub_item['menu_url'] : base_url($this->language['code'].\"/\".$sub_item['menu_url']),\n );\n array_push($sub_menu_data, $sub_menu_item);\n }\n $menu_item['sub_menu'] = $sub_menu_data;\n }\n\n array_push($data_menu, $menu_item);\n }\n $this->data[$menu_type] = $data_menu;\n }\n }", "private function getStatusIcons() {\n\t\t$img = '<img src=\"view/image/osworx/16/%sokay.png\" height=\"16\" width=\"16\" title=\"%s\" alt=\"%s\" border=\"0\" />';\n\t\t$this->data['imgNokay']\t= sprintf( $img, 'not_' );\n\t\t$this->data['imgOkay']\t= sprintf( $img, '' );\n\t}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function load_menu(){\n\t\t\n\t\t$this->menu=array(\n\t\t\t'category'=>1,\n\t\t\t'permission'=>$this->privilege->is_allowed_to_grant_role(),\n\t\t\t'materials'=>$this->privilege->is_allowed_to_write_materials()\n\n\t\t);\n\n\n\t}", "public static function clearIcons() {\n self::$icons = array();\n }", "function save_all() {\r\n\r\n\t // do not save another demo history if we already have one\r\n if (isset($this->td_demo_history['demo_settings_date'])) {\r\n return;\r\n }\r\n\r\n $local_td_demo_history = array();\r\n\r\n $local_td_demo_history['page_on_front'] = get_option('page_on_front');\r\n $local_td_demo_history['show_on_front'] = get_option('show_on_front');\r\n $local_td_demo_history['nav_menu_locations'] = get_theme_mod('nav_menu_locations');\r\n\r\n $sidebar_widgets = get_option('sidebars_widgets');\r\n $local_td_demo_history['sidebars_widgets'] = $sidebar_widgets;\r\n\r\n $used_widgets = $this->get_used_widgets($sidebar_widgets);\r\n\r\n\r\n if (is_array($used_widgets)) {\r\n foreach ($used_widgets as $used_widget) {\r\n $local_td_demo_history['used_widgets'][$used_widget] = get_option('widget_' . $used_widget);\r\n }\r\n }\r\n\r\n $local_td_demo_history['theme_options'] = get_option(TD_THEME_OPTIONS_NAME);\r\n $local_td_demo_history['td_social_networks'] = get_option('td_social_networks');\r\n $local_td_demo_history['demo_settings_date'] = time();\r\n update_option(TD_THEME_NAME . '_demo_history', $local_td_demo_history);\r\n }", "public function acceptIcons();", "public function get_icon($menu_item){\n\t\t\n\t\t/// LIST OF AVAILABLE MENU ICONS\n\t\t$icons = array('dashicons-dashboard' => 'grid',\n\t\t'dashicons-admin-post' => 'file-text',\n\t\t'dashicons-database' => 'database',\n\t\t'dashicons-admin-media' => 'image',\n\t\t'dashicons-admin-page' => 'album',\n\t\t'dashicons-admin-comments' => 'comment',\n\t\t'dashicons-admin-appearance' => 'paint-bucket',\n\t\t'dashicons-admin-plugins' => 'bolt',\n\t\t'dashicons-admin-users' => 'users',\n\t\t'dashicons-admin-tools' => 'cog',\n\t\t'dashicons-chart-bar' => 'thumbnails',\n\t\t'dashicons-admin-settings' => 'settings');\n\t\t\n\t\t// SET MENU ICON\n\t\t$theicon = '';\n\t\t$wpicon = $menu_item[6];\n\t\t\n\t\tif(isset($menu_item['icon'])){\n\t\t\tif($menu_item['icon'] != \"\" ){\n\t\t\t\t\n\t\t\t\t?><span class=\"uk-icon-button\" uk-icon=\"icon:<?php echo $menu_item['icon'] ?>;ratio:0.8\"></span><?php \n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(isset($icons[$wpicon])){\n\t\t\n\t\t\t//ICON IS SET BY ADIM 2020\t\t\n\t\t\t?><span class=\"uk-icon-button\" uk-icon=\"icon:<?php echo $icons[$wpicon] ?>;ratio:0.8\"></span><?php \n\t\t\treturn;\n\t\t\t\n\t\t}\n\n\t\tif (!$theicon) {\n\t\t\tif (strpos($wpicon, 'http') !== false || strpos($wpicon, 'data:') !== false) {\n\t\t\t\t\n\t\t\t\t///ICON IS IMAGE \n\t\t\t\t?><span class=\"uk-icon uk-icon-image uk-icon-button\" style=\"background-image: url(<?php echo $wpicon ?>);\"></span><?php\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t///ICON IS ::BEFORE ELEMENT\n\t\t\t\t?><div class=\"wp-menu-image dashicons-before <?php echo $wpicon ?> uk-icon uk-icon-image uk-icon-button\"></div><?php\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function icon();", "function saveData()\n\t{\n\t\t$userId = self::$USER->getId();\n\t\tforeach($this->_userSettings as $settingName => $value) {\n\t\t\t$setting = $this->getConstSetting($settingName);\n\t\t\t$fields = array('user_id'=>$userId, 'setting_id'=>$setting['setting_id'], 'value' => $value);\n\t\t\tself::$DB->replace(TABLE_USER_SETTINGS, $fields);\n\t\t}\n\t}", "public function extensions_menu() {}", "public function save( ) {\n $handle = fopen( dirname( __FILE__ ) . \"/conf/PanicButton.conf\", \"w\" );\n \n // @todo should this verify the user group exists first?\n foreach ( $this->mOverrides as $group => $value ) {\n if ( $value ) {\n fwrite( $handle, \"override \" . $group . \"\\n\" );\n } else {\n fwrite( $handle, \"nooverride \" . $group . \"\\n\" );\n }\n }\n \n fclose( $handle );\n }", "function MENU_saveNewMenuElement ( ) {\n global $_CONF, $_TABLES, $LANG_MENU00, $_MENU_CONF, $Menus, $_GROUPS;\n\n // build post vars\n $E['menu_id'] = (int) Geeklog\\Input::fPost('menuid');\n $E['pid'] = (int) Geeklog\\Input::fPost('pid');\n $E['element_label'] = htmlspecialchars(strip_tags(COM_checkWords(Geeklog\\Input::post('menulabel'))));\n $E['element_type'] = (int) Geeklog\\Input::fPost('menutype');\n $E['element_target'] = Geeklog\\Input::fPost('urltarget');\n $afterElementID = (int) Geeklog\\Input::fPost('menuorder');\n $E['element_active'] = (int) Geeklog\\Input::fPost('menuactive');\n $E['element_url'] = trim(Geeklog\\Input::fPost('menuurl'));\n $E['group_id'] = (int) Geeklog\\Input::fPost('group');\n\n switch($E['element_type']) {\n case 2 :\n $E['element_subtype'] = Geeklog\\Input::fPost('glfunction');\n break;\n case 3 :\n $E['element_subtype'] = (int) Geeklog\\Input::fPost('gltype');\n break;\n case 4 :\n $E['element_subtype'] = Geeklog\\Input::fPost('pluginname');\n break;\n case 5 :\n $E['element_subtype'] = Geeklog\\Input::fPost('spname');\n break;\n case 6 :\n $E['element_subtype'] = Geeklog\\Input::fPost('menuurl');\n /*\n * check URL if it needs http:// appended...\n */\n if ( trim($E['element_subtype']) != '' ) {\n if(strpos($E['element_subtype'], \"http\") !== 0 && strpos($E['element_subtype'],\"%site\") === false && rtrim($E['element_subtype']) != '') {\n $E['element_subtype'] = 'http://' . $E['element_subtype'];\n }\n }\n break;\n case 7 :\n $E['element_subtype'] = Geeklog\\Input::fPost('phpfunction');\n break;\n case 9 :\n $E['element_subtype'] = Geeklog\\Input::fPost('topicname');\n break;\n default :\n $E['element_subtype'] = '';\n break;\n }\n\n // check if URL needs the http:// added\n\n if ( trim($E['element_url']) != '' ) {\n if ( strpos($E['element_url'],\"http\") !== 0 && strpos($E['element_url'],\"%site\") === false && $E['element_url'][0] != '#' && rtrim($E['element_url']) != '' ) {\n $E['element_url'] = 'http://' . $E['element_url'];\n }\n }\n\n /*\n * Pull some constants..\n */\n\n $meadmin = SEC_hasRights('menu.admin');\n $root = SEC_inGroup('Root');\n $groups = $_GROUPS;\n\n /* set element order */\n if ( $afterElementID == 0 ) {\n $aorder = 0;\n } else {\n $aorder = DB_getItem($_TABLES['menu_elements'],'element_order','id=' . $afterElementID);\n }\n $E['element_order'] = $aorder + 1;\n\n /*\n * build our class\n */\n\n $element = new mbElement();\n $element->constructor( $E, $meadmin, $root, $groups );\n $element->id = $element->createElementID($E['menu_id']);\n $element->saveElement();\n $pid = $E['pid'];\n $menu_id = $E['menu_id'];\n $Menus[$menu_id]['elements'][$pid]->reorderMenu();\n MENU_CACHE_remove_instance('menu');\n}", "function _wp_menus_changed()\n{\n}", "public function get_icon($menu_item){\r\n\t\t\r\n\t\t/// LIST OF AVAILABLE MENU ICONS\r\n\t\t$icons = array('dashicons-dashboard' => 'grid_view',\r\n\t\t'dashicons-admin-post' => 'article',\r\n\t\t'dashicons-database' => 'perm_media',\r\n\t\t'dashicons-admin-media' => 'collections',\r\n\t\t'dashicons-admin-page' => 'description',\r\n\t\t'dashicons-admin-comments' => 'forum',\r\n\t\t'dashicons-admin-appearance' => 'palette',\r\n\t\t'dashicons-admin-plugins' => 'extension',\r\n\t\t'dashicons-admin-users' => 'people',\r\n\t\t'dashicons-admin-tools' => 'build_circle',\r\n\t\t'dashicons-chart-bar' => 'analytics',\r\n\t\t'dashicons-admin-settings' => 'tune');\r\n\t\t\r\n\t\t// SET MENU ICON\r\n\t\t$theicon = '';\r\n\t\t$wpicon = $menu_item[6];\r\n\t\t\r\n\t\tif(isset($menu_item['icon'])){\r\n\t\t\tif($menu_item['icon'] != \"\" ){\r\n\t\t\t\t\r\n\t\t\t\tob_start();\r\n\t\t\t\t?><span class=\"uk-icon-button\" uk-icon=\"icon:<?php echo $menu_item['icon'] ?>;ratio:0.8\"></span><?php \r\n\t\t\t\treturn ob_get_clean();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(isset($icons[$wpicon])){\r\n\t\t\r\n\t\t\t//ICON IS SET BY ADMIN 2020\t\t\r\n\t\t\tob_start();\r\n\t\t\t?><span class=\"material-icons-outlined a2020-menu-icon\"><?php echo $icons[$wpicon] ?></span><?php\r\n\t\t\treturn ob_get_clean();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tif (!$theicon) {\r\n\t\t\tif (strpos($wpicon, 'http') !== false || strpos($wpicon, 'data:') !== false) {\r\n\t\t\t\t\r\n\t\t\t\t///ICON IS IMAGE \r\n\t\t\t\tob_start();\r\n\t\t\t\t?><span class=\"uk-icon uk-icon-image uk-icon-button\" style=\"background-image: url(<?php echo $wpicon ?>);\"></span><?php\r\n\t\t\t\treturn ob_get_clean();\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\t///ICON IS ::BEFORE ELEMENT\r\n\t\t\t\tob_start();\r\n\t\t\t\t?><div class=\"wp-menu-image dashicons-before <?php echo $wpicon ?> uk-icon uk-icon-image uk-icon-button\"></div><?php\r\n\t\t\t\treturn ob_get_clean();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function addmenus()\n\t{\n\t\tadd_meta_box('scrib_meditor_div', __('Scriblio Metadata Editor'), array( $this, 'meditor_metabox' ), 'post', 'advanced', 'high');\n\t\tadd_meta_box('scrib_meditor_div', __('Scriblio Metadata Editor'), array( $this, 'meditor_metabox' ), 'page', 'advanced', 'high');\n\n\t\t// register the settings\n\t\tregister_setting( 'Scrib' , 'scrib_opts' , array( &$this , 'save_scrib_opts' ));\n\t}", "private function saveData() {\n\t\t\n\t\t$this->persistence->store($this->manager);\n\t\t\n\t}", "public function save_settings()\n {\n }", "public function iconStore(){\n\n //first completely validate the users input\n $this->validate(request(), [\n\n 'icon' => 'file|image',\n ]);\n\n //pull the entire request into a variable\n $request = request();\n //ORM query\n $instructors= User::where('type','instructor')->get();\n\n //if it has an image/icon , save , resize\n if($request->hasFile('icon')){\n $icon = $request->file('icon');\n $filename = time() . '.' . $icon->getClientOriginalExtension();\n Image::make($icon)->resize(300, 300)->save( public_path('/uploads/icons/' . $filename) );\n $user = Auth::user();\n $user->icon = $filename;\n $user->save();\n }\n\n return view('editInstructor', compact('instructors'));\n }", "public function inlineSaveMenuData()\n {\n try {\n if ($this->config->item(\"ENABLE_ROLES_CAPABILITIES\")) {\n $access_list = array(\n \"menu_view\",\n \"menu_title_update\",\n \"menu_capability_update\",\n \"menu_status_update\",\n );\n list($edit_title, $edit_capability, $edit_status) = $this->filter->checkAccessCapability($access_list, TRUE);\n } else {\n $edit_title = $this->filter->getModuleWiseAccess(\"Menu\", \"Update\", FALSE, TRUE);\n if ($edit_title) {\n $edit_capability = $edit_status = TRUE;\n }\n }\n $data_arr = $this->input->get_post(NULL, TRUE);\n $id = $data_arr['id'];\n $field_name = $data_arr['name'];\n $new_value = $data_arr['value'];\n $response = array();\n switch ($field_name) {\n case 'menu_status':\n if (!$edit_status) {\n throw new Exception($this->general->processMessageLabel('ACTION_YOU_ARE_NOT_AUTHORIZED_TO_MODIFY_THESE_DETAILS_C46_C46_C33'));\n }\n $data = array('eStatus' => $new_value);\n $response = $this->menu_model->saveMenuData($id, $data);\n break;\n case 'menu_title':\n if (!$edit_title) {\n throw new Exception($this->general->processMessageLabel('ACTION_YOU_ARE_NOT_AUTHORIZED_TO_MODIFY_THESE_DETAILS_C46_C46_C33'));\n }\n $data = array('vMenuDisplay' => $new_value);\n $lang_label = $this->general->getDisplayLabel('Generic', trim($new_value), 'label');\n $result = $this->menu_model->checkLangugeLable($lang_label);\n if (!$result['success']) {\n $new_label_arr = array(\n 'vLabel' => $lang_label,\n 'vModule' => 'Generic',\n 'vPage' => 'Menu',\n 'eStatus' => 'Active'\n );\n $this->menu_model->addNewLanguageLabel($new_label_arr, trim($new_value));\n }\n $response = $this->menu_model->saveMenuData($id, $data);\n break;\n case 'menu_capability':\n if (!$edit_capability) {\n throw new Exception($this->general->processMessageLabel('ACTION_YOU_ARE_NOT_AUTHORIZED_TO_MODIFY_THESE_DETAILS_C46_C46_C33'));\n }\n $code = $this->menu_model->getCapabilityCode($new_value);\n if ($code['success']) {\n $data = array(\n 'vCapabilityCode' => $code['capability_code'],\n 'iCapabilityId' => $new_value\n );\n $response = $this->menu_model->saveMenuData($id, $data);\n } else {\n throw new Exception($this->general->processMessageLabel('GENERIC_ERROR_IN_UPDATION'));\n }\n break;\n }\n if (!$response['success']) {\n throw new Exception($this->general->processMessageLabel('GENERIC_ERROR_IN_UPDATION'));\n }\n $ret_arr['success'] = 1;\n } catch (Exception $e) {\n $ret_arr['success'] = 0;\n $ret_arr['message'] = $e->getMessage();\n }\n echo json_encode($ret_arr);\n $this->skip_template_view();\n }" ]
[ "0.706652", "0.6881801", "0.6785493", "0.6445617", "0.64119476", "0.6288161", "0.61928004", "0.60595083", "0.60248595", "0.5942594", "0.5803575", "0.5730537", "0.57292765", "0.57178223", "0.5714427", "0.56811386", "0.5674109", "0.56667554", "0.5636331", "0.5632987", "0.56190664", "0.56127566", "0.56036633", "0.5601147", "0.5571921", "0.5569827", "0.55516315", "0.5537499", "0.5531128", "0.552321", "0.5521627", "0.5521591", "0.5516938", "0.5505081", "0.550295", "0.5471943", "0.5471739", "0.54713935", "0.5465165", "0.5446145", "0.5426378", "0.5423771", "0.5423457", "0.54211694", "0.5419551", "0.5410675", "0.53997517", "0.5390496", "0.53898436", "0.53755575", "0.5361435", "0.53576815", "0.53496313", "0.53208196", "0.53077775", "0.5306207", "0.5286624", "0.5286487", "0.52669996", "0.5251169", "0.524687", "0.5246243", "0.52449894", "0.523678", "0.5235912", "0.5235581", "0.5232731", "0.522772", "0.52244407", "0.5215844", "0.52110016", "0.52017295", "0.5200975", "0.5198542", "0.51880413", "0.5183106", "0.5182666", "0.51727724", "0.51726025", "0.5168409", "0.51674765", "0.51674765", "0.51674765", "0.5160884", "0.51441437", "0.51407075", "0.5140367", "0.51268476", "0.5121456", "0.51173776", "0.51163846", "0.51161814", "0.5111248", "0.51071286", "0.5101859", "0.5100108", "0.50996214", "0.5094214", "0.5091045", "0.50878334" ]
0.7095766
0
Validates each row from a CSV extracted array
Проверяет каждую строку из массива, извлеченного из CSV
protected function validateRows(array $data): array { $csvLineIndex = 0; try { foreach ($data as $csvLineIndex => &$row) { $row = $this->validator->applySchemaToData($row); } return $data; } catch (ValidationException $e) { throw new CsvInvalidValueException(sprintf( "On line %d of your CSV data : %s !", $csvLineIndex + 1, // We give index + 1 because in the CSV we have the headers line $e->getMessage() )); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function processCSVLines()\n\t{\n\t\t// make connection to database\n\t\t$Database = new Connect(); \n\t\t$mysqli = $Database->getConnection();\n\t\t\n\t\tif (mysqli_connect_errno()) {\n\t\t\t$this-> error = \"ERROR - could not connect to the database\". PHP_EOL. $Database->error. PHP_EOL;\n\t\t\treturn false;\n\t\t}\n\n\t\t// processedRecords is an array that saves all the processing information\n\t\t// for the log message output\t\t\n\t\t// make a null value at position zero so the position in the array\n\t\t// corresponds to the line number in the file\n\t\t$this->processedRecords[0] = \"\";\n\t\t\n\t\t// create a Sanitize object to pass to the insertIntoDatabase metheod\n\t\t// in the loop - saves creating a new object everytime\n\t\t$clean = new Sanitize(); \n\t\t\n\t\tforeach ($this->CSVLineArray as &$value) \n\t\t{\n\t\t\t$this->processLine($value, $mysqli, $clean);\n\t\t}\n\t\t\n\t\t// close databse connections\n\t\t$mysqli->close();\n\n\t\treturn true;\n\t}", "function validateCSVLine($line, $line_number) {\n\t $errors = array();\n\n\t if(!is_array($line)) {\n\t\t array_push($errors,'Invalid line');\t\t\t \n\t }\n\n\t if($line[0] == null || $line[0] == '') {\n\t\t array_push($errors, \"Error in line $line_number: blank email\");\n\t } \n\t return $errors;\n }", "protected function passes(): bool\n {\n if ($this->doesFileExistAndReadable($this->filePath)) {\n if (false !== ($handle = fopen($this->filePath, 'r'))) {\n while (false !== ($row = fgetcsv($handle, 0, $this->delimiter))) {\n ++$this->currentRowLineNumber;\n if (empty($this->headers)) {\n $this->setHeaders($row);\n continue;\n }\n\n $rowWithAttribute = [];\n\n foreach ($row as $key => $value) {\n $attribute = $this->headers[$key];\n $rowWithAttribute[$attribute] = $value;\n }\n\n $this->validateRow($rowWithAttribute);\n }\n }\n } else {\n $this->message = self::INVALID_FILE_PATH_ERROR;\n }\n\n return empty($this->invalidRows) && empty($this->message);\n }", "private function __validate_row() {\n $this->validated_data[\"row\"] = [];\n\n # Check for our required 'row' field\n if (isset($this->initial_data[\"row\"])) {\n # Check that our array has a minimum of 1 row entry\n if (count($this->initial_data[\"row\"]) >= 1) {\n # Validate each individual row entry\n foreach ($this->initial_data[\"row\"] as $row) {\n # Run a nested API call to the APIServicesUnboundAccessListRowCreate model\n $create_row = new APIServicesUnboundAccessListRowCreate();\n $create_row->initial_data = $row;\n $create_row->__validate_acl_network();\n $create_row->__validate_mask();\n $create_row->__validate_description();\n\n # Append any identified errors to this models errors\n $this->errors = $this->errors + $create_row->errors;\n\n # Append this row entry if no errors were found\n if (!$create_row->errors) {\n $this->validated_data[\"row\"][] = $row;\n }\n }\n } else {\n $this->errors[] = APIResponse\\get(2073);\n }\n } else {\n $this->errors[] = APIResponse\\get(2073);\n }\n }", "private function checkCsvLineIsValidForIngredient(array $line)\n {\n # Check if the required fields\n if (empty($line['UUID_FAMILY']) || empty($line['UUID_INGREDIENT']) || empty($line['ORIGFDCD'])) {\n return false;\n }\n\n return true;\n }", "public function validateCsv()\n {\n try {\n $csvUploader = $this->_fileUploader->create(['fileId' => 'massupload_csv']);\n $csvUploader->setAllowedExtensions(['csv', 'xml', 'xls', 'json']);\n $validateData = $csvUploader->validateFile();\n $extension = $csvUploader->getFileExtension();\n $csvFilePath = $validateData['tmp_name'];\n $csvFile = $validateData['name'];\n $csvFile = $this->getValidName($csvFile);\n $result = [\n 'error' => false,\n 'path' => $csvFilePath,\n 'csv' => $csvFile,\n 'extension' => $extension\n ];\n } catch (\\Exception $e) {\n $msg = 'There is some problem in uploading file.';\n $result = ['error' => true, 'msg' => $msg];\n }\n return $result;\n }", "public function valid()\n {\n if (!$this->next()) {\n // nicht schließen, wenn mehrfach über die csv itteriert werden soll gibts probleme!\n// fclose($this->handle);\n return false;\n }\n\n return true;\n }", "public function testExtractFailInvalidInputType(CSV $essence)\n {\n $essence->extract(true);\n }", "private function isCsvRowValid($rowArray, $rowIndex)\n {\n if (count($rowArray) < $this->csvMinColumns) {\n Log::error('Zip file row count not match minimal count');\n return false;\n }\n\n for ($i = 1; $i < count($rowArray); $i++) {\n $mediaFilePath = $this->folderPath . '/' . $i . '/' . $rowIndex . '.mp3';\n if (!File::exists($mediaFilePath)) {\n Log::error(\"Zip content row #{$rowIndex} in folder {$i} doesn't have media file attached\");\n return false;\n }\n }\n\n return true;\n }", "protected function ValidateCSVWithDataBase($tableName, $CSVArray)\n {\n //Check the value lengthd make sure fits into database\n $columns = DB::select('show Columns from ' . $tableName);\n\n //Check if an error exists\n if (!isset($CSVArray['error']))\n {\n //CSV does not have these columns, but the database does.\n $headersToIgnore = array(\"id\", \"created_at\", \"updated_at\");\n $headers = '';\n $headerNotValid = false;\n //This foreach will validate the headers with what the database\n //has.\n foreach ($columns as $eachColumn)\n {\n $dbFieldName = $eachColumn->Field;\n if (!in_array($dbFieldName, $headersToIgnore))\n {\n // check to see if there is any entries in the file \n if (!isset($CSVArray[0]))\n {\n return \"There are no Entries in the CSV File\";\n }\n //Check if the CSV file has a header which matches the DB's\n if (!isset($CSVArray[0][$dbFieldName]))\n {\n //Add failing flag\n $headerNotValid = true;\n $headers .= $dbFieldName . ', ';\n }\n }\n }\n\n //check if header invalid\n if ($headerNotValid)\n {\n return \"Header \" . $headers . \"not present in the Comma-Seperated values file(may be spelt wrong).\";\n }\n\n $currentRow = 0;\n //For every row in the CSV file\n foreach ($CSVArray as $row)\n {\n //there are no header errors, check for mandatory values.\n //Verify the data\n foreach ($columns as $eachColumn)\n {\n //Check the field value, if it is required\n $dbFieldName = $eachColumn->Field;\n $canBeNull = $eachColumn->Null == 'YES';\n\n if (!in_array($dbFieldName, $headersToIgnore))\n {\n if (!$canBeNull)\n {\n if ($CSVArray[$currentRow][$dbFieldName] == '')\n {\n return $dbFieldName . \" is required but is empty at row \" . ($currentRow + 2);\n }\n }\n\n\n $resultingMatches = array();\n\n //Check the field type, make sure it matches DB\n $matched = preg_match('/^[A-Za-z0-9]+\\(([0-9]+)\\)$/', $eachColumn->Type, $resultingMatches);\n\n $DBValueType = $resultingMatches[1];\n\n //This flag will be set if it is a character and the size\n //Must match the max size.\n $forceMaxSize = false;\n //Check if it is an integer, do extra validation\n if ($DBValueType == 'int')\n {\n if (!is_int($CSVArray[$currentRow][$dbFieldName]))\n {\n return $dbFieldName . \" should be an whole number. but is \" . $CSVArray[$currentRow][$dbFieldName] . \" At row \" . ($currentRow + 2);\n }\n } elseif ($DBValueType == 'char')\n {\n //This flag will be set if it is a character and the size\n //Must match the max size.\n $forceMaxSize = true;\n }\n\n //Check the field length, make sure its within allowed size\n //Pass in an array, preg_match will put the result in the array\n $resultingMatches = array();\n\n //Check the field type, make sure it matches DB\n $matched = preg_match('/^[A-Za-z0-9]+\\(([0-9]+)\\)$/', $eachColumn->Type, $resultingMatches);\n\n $size = $resultingMatches[1];\n\n $resultingMatches = array();\n //Get the size of the CSV value\n\n $minLength = 0;\n $maxLength = $size;\n\n //If the minimum size is the max size (CHAR)\n if ($forceMaxSize)\n {\n $minLength = $maxLength;\n }\n\n //Checks that the CSV value is within the acceptable DB length\n $matched = preg_match('/^([\\s\\S]{' . $minLength . ',' .\n $maxLength . '})$/', $CSVArray[$currentRow][$dbFieldName], $resultingMatches);\n\n if (!$matched)\n {\n return $dbFieldName . \" is larger than the acceptable size. (\" . $CSVArray[$currentRow][$dbFieldName] . \" At row \" . ($currentRow + 2) . ')';\n }\n }\n }\n\n $currentRow++;\n }\n }\n //Validation succesful.\n return true;\n }", "private function validateCsvFields(array $data)\n {\n $isValidCsv = array_diff(array_keys(self::CONTACTS_COLUMN_MAP), $data[0]);\n if (!empty($isValidCsv)) {\n abort(406, 'CSV is missing columns!');\n }\n }", "public function runThroughCSV($filePath, $returnType) {\n\n\t\t$firsRow = $result = $trimIncorrectColumnNumber\n\t\t= $trimIncorrectAlphaNums = $trimIncorrectTimeStamps = null;\n\n\t\t$handle = fopen($filePath, \"r\");\n\n\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t$result[]=$data;\n \t}\n\n \tfclose($handle);\n\n \tif(!empty($result)) {\n \t\t$firsRow = $result[0]; // getting the first row of data, column names\n\t\t $result[0] = null;\n\t\t $result = array_filter($result);\n\n\t\t foreach($result as $row) {\n\t\t \t$trimIncorrectColumnNumber[] = $this->checkNumberOfColums($row, 3);\n\t\t }\n\n\t\t $trimIncorrectColumnNumber = array_filter($trimIncorrectColumnNumber); //removing null values\n\n \t} else {\n \t\techo 'No valid data was found in this file<br>';\n \t\treturn false;\n \t}\n\n \techo 'valid number of rows after all rows have correct number of columns ' . count($trimIncorrectColumnNumber) . '<br>';\n\n \tif(!empty($trimIncorrectColumnNumber)) {\n \t\tforeach($trimIncorrectColumnNumber as $row) {\n \t\t\t$trimIncorrectAlphaNums[] = $this->checkAlphaNumberic($row);\n \t\t}\n\n \t\t$trimIncorrectAlphaNums = array_filter($trimIncorrectAlphaNums); //removing null values\n \t} else {\n \t\techo 'No valid data was found in this file';\n \t\treturn false;\n \t}\n\n \techo 'valid number of rows after validating first column ' . count($trimIncorrectAlphaNums) . '<br>' ; \n\n \tif(!empty($trimIncorrectAlphaNums)) {\n \t\tforeach($trimIncorrectAlphaNums as $row) {\n \t\t\tif( $this->checkValidTimeStamp($row[1]) ) {\n \t\t\t\t$trimIncorrectTimeStamps[] = $row;\n \t\t\t} else {\n \t\t\t\t$trimIncorrectTimeStamps[] = null;\n \t\t\t}\n \t\t}\n \t\t\n \t\t$trimIncorrectTimeStamps = array_filter($trimIncorrectTimeStamps); //removing null values\n \t} else {\n \t\techo 'No valid data was found in this file';\n \t\treturn false;\n \t}\n\n \techo 'valid number of rows after validating second column ' . count($trimIncorrectTimeStamps) . '<br>'; \n\n \tif(!empty($trimIncorrectTimeStamps) && $returnType === 1) {\n \t\treturn $this->calculateSumOfRow($trimIncorrectTimeStamps);\t\n \t} else if (!empty($trimIncorrectTimeStamps) && $returnType === 2){\n \t\treturn $this->calculateSumOfRow($trimIncorrectTimeStamps);\n \t}\n\n \treturn false; //returns false if failure occurs\n \t \t\n\t}", "function wc_is_file_valid_csv($file, $check_path = \\true)\n {\n }", "private static function process_csv($source,$callback){\n\t\tself::$debug->print_r(\"processing csv file\");\n\t\t\n\t\tini_set('auto_detect_line_endings',true);\n\t\t\n\t\t$r_handle = fopen($source,'r');\n\t\tif(!$r_handle){\n\t\t\tself::$debug->print_r(\"cannot open the source file\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/************\n\t\thow robust should be the parsing?\n\t\tshould we allow few errors while processing a row? or should we terminate at the first hint of error?\n\t\t\n\t\tI think we should allow few errors, log it and go forward with the remaining correct rows\n\t\t\n\t\tof course, if we do not have any correct rows, we do return false\n\t\t***************/\n\t\t$row_num = 1;\n\t\t$has_row = false;\n\t\t\n\t\twhile (($csv_data = fgetcsv($r_handle, 40960, ',', '\"','|')) !== false) {\n\t\t\t$ok = call_user_func($callback,$csv_data);\n\t\t\tif(!$ok){\n\t\t\t\tself::$debug->print_r(\"error processing row \".$row_num);\n\t\t\t}else{\n\t\t\t\t$has_row = true;\n\t\t\t\t/*****\n\t\t\t\tsince we do not set this to false in case of error, a single correct row will set this to true\n\t\t\t\tand we will have usable data\n\t\t\t\t**********/ \n\t\t\t}\n\t\t\t$row_num++;\n\t\t}\n\t\tfclose($r_handle);\n\t\tself::$debug->print_r(\"finished processing csv file\");\n\t\t\n\t\tif($has_row){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function processCsv($conn, $file_name,$data){\n\n $file = fopen($file_name, \"r\");\n while (($column = fgetcsv($file, 10000, \",\")) !== FALSE) {\n\n $name = ucwords(strtolower($column[0]));\n $surname = ucwords(strtolower($column[1]));\n $email = strtolower($column[2]);\n $email = rtrim($email);\n\n //Surpass the heading if present\n if($email == \"email\"){\n continue;\n }\n\n //check email is valid or not\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n echo(\"\\n $email is not a valid email address \\n\" );\n continue;\n }\n\n //sql to insert data\n $sqlInsert = \"INSERT into users (name,surname,email) values (?,?,?)\";\n //if dry_run no need to insert the data\n if(array_key_exists('dry_run',$data)){\n continue;\n }\n\n try {\n $result = $conn->prepare($sqlInsert);\n $result->execute([$name,$surname,$email]);\n } catch (PDOException $e) {\n $error_info = $e->errorInfo;\n if($error_info[0] == 23000){\n echo(\"\\n $email already exists \\n \");\n }else{\n echo( \"\\n Error:\".$e->getMessage());\n }\n }\n\n }\n\n}", "private function validateBatchArray($data) : bool\n {\n if(gettype($data)!='array')\n {\n throw new Exception(\"column is not valid : columns should be array\");\n }\n foreach($data as $column)\n {\n foreach(array_keys($column) as $key)\n {\n if(!in_array($key,['name','source']))\n {\n throw new Exception(\"column is not valid : this key is unusable '$key'\");\n }\n }\n }\n }", "public function isValid($value, $rowData);", "private function processLine($value, $mysqli, $clean)\n\t{\n\t\t\n\t\t// convert file contents into a php array\n\t\t$array = explode(\",\", $value);\n\t\t\n\t\t// incrememnt the numberProcessed variable\n\t\t$this->numberProcessed++;\n\t\t\t\t\n\t\t// variable to see if this row in the CSV can be proccessed (had no errors)\n\t\t$process = true;\n\t\t\n\t\t\n\t\t// save the data that was used in the process \n\t\t// so we can use that in the report\n\t\t$this->makeOutputArray('data', $value);\n\t\t\n\t\t// save line number in the output array for reporting\n\t\t$this->makeOutputArray('line', $this->numberProcessed);\n\t\t\n\t\tif(!is_array($array))\n\t\t{\n\t\t\t$this->makeOutputArray('reason', \"Data could not be converted into an array\");\n\t\t\t$process = false;\n\t\t}\n\t\t\t\n\t\tif($process && count($array) != 6)\n\t\t{\n\t\t\t$this->makeOutputArray('reason', \"Data had incorrect number of columns\");\n\t\t\t$process = false;\n\t\t}\n\t\t\n\t\t// check data is valid\n\t\tif($process && !$this->isValid($array))\n\t\t{\n\t\t\t$process = false;\n\t\t}else\n\t\t{\n\t\t\t// if it is then check it meets the import criteria\n\t\t\tif($process && !$this->meetsImportRules($array))\n\t\t\t{\n\t\t\t\t$process = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// do not process any further in test mode\n\t\tif($this->testMode == \"TEST=Y\")\n\t\t{\n\t\t\tif($process)\n\t\t\t{\n\t\t\t\t$this->numberImported++;\n\t\t\t\t$this->makeOutputArray('outcome', \"SUCCESS\");\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$this->numberFailed++;\n\t\t\t\t$this->makeOutputArray('outcome', \"ERROR\");\n\t\t\t}\n\t\t\treturn true;\t\n\t\t}\n\t\t\n\t\t// process if row had no errors\n\t\tif($process)\n\t\t{\n\t\t\tif($this->insertIntoDatabase($mysqli, $array, $clean))\n\t\t\t{\n\t\t\t\t$this->numberImported++;\n\t\t\t\t$this->makeOutputArray('outcome', \"SUCCESS\");\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$this->numberFailed++;\n\t\t\t\t$this->makeOutputArray('outcome', \"ERROR\");\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$this->numberFailed++;\n\t\t\t$this->makeOutputArray('outcome', \"ERROR\");\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function parseCoursesArray($courses_array){\n\t\n\t//Clear data before import\n\t$result = clearCoursesData();\n\t\n \tif($result!==true){\n\t\treturn $result;\n \t}\n \t\n \t//Parse csv file and insert courses data\n \t$rowCount = 0;\n \tforeach($courses_array as $course){\n\t\t$rowCount++;\n\t\tif($rowCount>1){\n\t\t\t$result = addCourseData($course);\n\t\t\t\n\t\t\tif($result!==true){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n \t}\n\treturn true;\n}", "private function getCSVErrors($csvContent) {\n //SILEX:todo\n //create a library for the data type check (isGeometry, isDate, ...)\n //\\SILEX:todo\n //1. check header\n $headerCheck = $this->getCSVHeaderCorrespondancesOrErrors(str_getcsv($csvContent[0], Yii::$app->params['csvSeparator']));\n $errors = null;\n if (isset($headerCheck[\"Error\"])) {\n $errors[\"header\"] = $headerCheck[\"Error\"];\n } else { //2. check each cell's content\n $experiments = [];\n for ($i = 1; $i < count($csvContent); $i++) {\n $row = str_getcsv($csvContent[$i], Yii::$app->params['csvSeparator']);\n If ($row[$headerCheck[\"Geometry\"]] != \"\") {\n if (!$this->isGeometryOk($row[$headerCheck[\"Geometry\"]])) {\n $error = null;\n $error[\"line\"] = \"L.\" . ($i + 1);\n $error[\"column\"] = ScientificObjectController::GEOMETRY;\n $error[\"message\"] = Yii::t('app/messages', 'Bad geometry given') . \". \" . Yii::t('app/messages', 'Expected format') . \" : POLYGON ((1.33 2.33, 3.44 5.66, 4.55 5.66, 6.77 7.88, 1.33 2.33))\";\n $errors[] = $error;\n }\n }\n if (!in_array($row[$headerCheck[ScientificObjectController::EXPERIMENT_URI]], $experiments)) {\n if (!$this->existExperiment($row[$headerCheck[ScientificObjectController::EXPERIMENT_URI]])) {\n $error = null;\n $error[\"line\"] = \"L.\" . ($i + 1);\n $error[\"column\"] = ScientificObjectController::EXPERIMENT_URI;\n $error[\"message\"] = Yii::t('app/messages', 'Unknown experiment') . \" : \" . $row[$headerCheck[ScientificObjectController::EXPERIMENT_URI]];\n $errors[] = $error;\n }\n $experiments[] = $row[$headerCheck[ScientificObjectController::EXPERIMENT_URI]];\n }\n if (!$this->existSpecies($row[$headerCheck[\"Species\"]])) {\n $error = null;\n $error[\"line\"] = \"L.\" . ($i + 1);\n $error[\"column\"] = ScientificObjectController::SPECIES;\n $error[\"message\"] = Yii::t('app/messages', 'Unknown species') . \" : \" . $row[$headerCheck[ScientificObjectController::SPECIES]];\n $errors[] = $error;\n }\n if ($row[$headerCheck[\"Alias\"]] == \"\") {\n $error = null;\n $error[\"line\"] = \"L.\" . ($i + 1);\n $error[\"column\"] = ScientificObjectController::ALIAS;\n $error[\"message\"] = Yii::t('app/messages', 'Alias is missing');\n $errors[] = $error;\n }\n }\n }\n\n return $errors;\n }", "private function verifyCsvFile()\n\t{\n\t\t$testDelimiters = array(\n\t\t\tTranslate\\IO\\CsvFile::DELIMITER_TZP,\n\t\t\tTranslate\\IO\\CsvFile::DELIMITER_TAB,\n\t\t\tTranslate\\IO\\CsvFile::DELIMITER_ZPT,\n\t\t);\n\t\tforeach ($testDelimiters as $delimiter)\n\t\t{\n\t\t\t$this->csvFile->setFieldDelimiter($delimiter);\n\n\t\t\t$this->csvFile->moveFirst();\n\t\t\t$rowHead = $this->csvFile->fetch();\n\t\t\tif (\n\t\t\t\t!\\is_array($rowHead) ||\n\t\t\t\tempty($rowHead) ||\n\t\t\t\tempty($rowHead[0]) ||\n\t\t\t\t(\\count($rowHead) < 3)\n\t\t\t)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tif (\n\t\t\t!\\is_array($rowHead) ||\n\t\t\tempty($rowHead) ||\n\t\t\tempty($rowHead[0]) ||\n\t\t\t(\\count($rowHead) < 3)\n\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->languageList = self::$enabledLanguages;\n\t\t$this->columnList = \\array_flip($rowHead);\n\t\tforeach ($this->languageList as $keyLang => $langID)\n\t\t{\n\t\t\tif (!isset($this->columnList[$langID]))\n\t\t\t{\n\t\t\t\tunset($this->languageList[$keyLang]);\n\t\t\t}\n\t\t}\n\t\tif (!isset($this->columnList['file']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function validate(){\n\n\n $passed = 0;\n $failed = 0;\n $i = null;\n $line_ar = null;\n \t$data_rows = count( $this->file_data_ar);\n\n // Starting progress reporting text\n $out = \"Value Check: \" . __DIR__ . PHP_EOL . PHP_EOL . sprintf(\"%-32s\", \"Validating:\");\n\n // Loop through loaded data row arrays and send to validate_line(&$ar) function\n for ($i=0; $i<$data_rows; $i++) {\n $line_ar = $this->file_data_ar[$i];\n\n\n // Check Number of fields and branch\n $num_fields = count($line_ar);\n\n if ($num_fields == $this->expected_row_fields) {\n if( $this->validate_line($line_ar)) {\n // If valid row, push to $this->file_final_rows_ar\n array_push( $this->file_final_rows_ar,$line_ar); // Keep cleaned up line\n $passed++;\n } else {\n // If invalid row, push to $this->file_bad_rows_ar\n array_push( $this->file_bad_rows_ar, $line_ar);\n $failed++;\n } // End If\n } else {\n // Wrong Number of fields\n // If field counts are off from class property: $this->expected_row_fields, push to $this->file_bad_rows_ar\n array_push( $this->file_bad_rows_ar, $line_ar);\n $failed++;\n } // End If\n\n } // End For\n\n // Add totals to reporting text output\n $out .= \" [Done]\" . PHP_EOL;\n $out .= \" Lines Passed: \" . $passed . \" out of \" . ($passed + $failed) . PHP_EOL;\n $out .= \" Lines Failed: \" . $failed . \" out of \" . ($passed + $failed) . PHP_EOL . PHP_EOL;\n\n\n // Loop over \"Bad Rows\" and add them into reporting output text\n for ($i=0; $i<count( $this->file_bad_rows_ar); $i++) {\n $out .= sprintf(\"%-32s [BAD ROW]\" . PHP_EOL, \"-->\" . implode(',', $this->file_bad_rows_ar[$i]) . \"<--\");\n\t } // End For loop over all loaded rows\n\n $out .= PHP_EOL;\n\n // Return reporting text to calling scope\n return $out;\n }", "private function validateImportFile($pathToImportFile)\n {\n $requiredColumns = [ 0,1,2 ];\n\n $usernames = [];\n\n if (($fileHandle = fopen($pathToImportFile,\"r\")) !== FALSE)\n {\n $row = 0;\n while (($data = fgetcsv($fileHandle, 8096, \",\")) !== FALSE) {\n if (in_array(trim($data[1]),$usernames))\n {\n throw new InvalidArgumentException(trim($data[1]) . \" is entered as a username into the import file multiple times. Usernames must be unique.\");\n }\n array_push($usernames,trim($data[1]));\n $row++;\n foreach ($requiredColumns as $colNumber) {\n if (trim($data[$colNumber]) == '') {\n throw new InvalidArgumentException(\"In the RADIUS import, column number \" . ($colNumber + 1) . \" is required, and it is empty on row $row.\");\n }\n }\n }\n\n if (trim($data[3]))\n {\n if (!filter_var(trim($data[3]),FILTER_VALIDATE_IP))\n {\n throw new InvalidArgumentException(\"In the RADIUS import, column number \" . ($colNumber + 1) . \" is not a valid IP ({$data[3]}).\");\n }\n }\n }\n else\n {\n throw new InvalidArgumentException(\"Could not open import file.\");\n }\n\n return;\n }", "private function checkCsvLineIsValidForIngredientContent(array $line)\n {\n # Check if the required fields\n if (empty($line['UUID_INGREDIENT']) || empty($line['UUID_CONTENT']) || empty($line['LANG'])\n || empty($line['ORIGFDNM'])) {\n return false;\n }\n\n if (!in_array($line['LANG'], $this->languages)) {\n return false;\n }\n\n return true;\n }", "public function importFile()\n\t{\n\n\t\t// call parent function to validate the CSV\n\t\tif(!$this->parseCSV())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// get the column numbers for the required items\n\t\t$this->getColumnNumbers();\n\t\t\t\n\t\t// check column headings have been found in the CSV file\n\t\tif(!$this->checkColumnNumbers())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// remove the first line which is a row of headings\n\t\tunset($this->CSVLineArray[0]);\n\t\t\n\t\t// process array to import data\n\t\tif(!$this->processCSVLines())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected function validateRow(array $row): void\n {\n $this->currentRowMessages = [];\n $this->currentRow = $row;\n\n foreach ($this->rules as $attribute => $rules) {\n foreach ($rules as $rule) {\n $this->validateAttribute($attribute, $rule);\n }\n }\n\n if (!empty($this->currentRowMessages)) {\n $row['errors'] = $this->currentRowMessages;\n $this->invalidRows[] = $row;\n }\n\n $this->data[] = $row;\n }", "private function isRowValid($row)\n {\n if (sizeof($row) === 6) {\n return true;\n } else {\n return false;\n }\n }", "public function testCSVFileValid(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"correctdb\"][\"user\"];\n\t\t$password = $ini_array[\"correctdb\"][\"password\"];\n\t\t$host = $ini_array[\"correctdb\"][\"host\"];\n\t\t$csv = $ini_array[\"csv\"][\"valid\"];\n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host --file $csv 2>&1`;\n\n\t\t$this->assertRegExp(\n\t\t\t'/Opening CSV file/',\n\t\t\t$output\t\n\t\t);\n\t}", "public function checkImportData($rows, $headers)\n\t{\n\t\t//$this->headers = $headers;\n\t\t$emails = [];\n\t\t\n\t\tforeach($rows as $key => $row)\n\t\t{\n\t\t\t$row = array_combine($headers,$row);\n\t\t\t$this->rows = $row;\n\t\t\tif(!$this->isValidEmail($row['email']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$row['message']='Invalid Email';\n\t\t\t\t$this->errorRows[$key] = $row;\n\t\t\t\t$this->valid = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif($this->isEmailExist($row['email']))\n\t\t\t{\n\t\t\t\t$row['message']='Email Exists';\n\t\t\t\t$this->errorRows[$key] = $row;\n\t\t\t\t$this->valid = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(in_array($row['email'], array_column($this->validRows, 'email')))\n\t\t\t{\n\t\t\t\t$row['message']='Duplicate Email in Upload File';\n\t\t\t\t$this->errorRows[$key] = $row;\n\t\t\t\t$this->valid = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->validRows[]= $row;\n\t\t}\n\t\t$this->storeDataIntoTempTable();\n\t\treturn $this->valid;\n\t\t\n\t\t/*\n\t\t $rows->each(function($item ,$key) use($headers){\n\t\t\tif(!$this->checkValidEmail($item['email']))\n\t\t\t{\n\n\t\t\t}\n \t\t$record = $headers->combine($item);\n \t\t$record->put('password',bcrypt('test0000'));\n \t\t$record->put('active',0);\n \t\tUser::create($record->toArray());\n \t});\n\t\t*/\n\t}", "public function testCSVFileInvalidEmailAddress(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"correctdb\"][\"user\"];\n\t\t$password = $ini_array[\"correctdb\"][\"password\"];\n\t\t$host = $ini_array[\"correctdb\"][\"host\"];\n\t\t$database = $ini_array[\"correctdb\"][\"database\"];\n\t\t$csv = $ini_array[\"csv\"][\"invalid_email_address\"];\n\n\t\t$db = new mysqli(\n\t\t\t$host,\n\t\t\t$user,\n\t\t\t$password,\n\t\t\t$database\n\t\t);\n\n\t\t// Delete rows of user table\n\t\t$result = $db->query(\"delete from user\"); \n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host --file $csv 2>&1`;\n\n\t\t$this->assertRegExp(\n\t\t\t\"/WARNING: While parsing the line number \\d+, the email address .+ value is invalid. Skipping this row.../\",\n\t\t\t$output\t\n\t\t);\n\t}", "public function readCsvFile():array {\n // read uploaded file and make array from it\n $csv = explode(',', file_get_contents(\"../uploaded_resources/\" . $this->filename));\n\n // check if is anything red from file\n if (count($csv) === 1 && $csv[0] === '') {\n // first delete uploaded empty file\n $this->deleteUploadedFile();\n\n // throw exception\n throw new \\Exception('Uploaded file is empty');\n }\n\n // return codes\n return $csv;\n }", "public function only_valid_orders_are_imported($csvFilename)\n {\n $this->importACopiedOrderCSV($csvFilename);\n $this->seeJson(['import_status' => 'File uploaded successfuly']);\n \n $csvPathname = $this->csvDirectory.$csvFilename;\n $parsedOrders = $this->readOrderCsvFile($csvPathname);\n\n foreach ($parsedOrders as $parsedOrder) {\n //dd(App\\Order::all());\n $parsedOrders['valid'] = true;\n $this->seeInDatabase('orders', $parsedOrder);\n }\n }", "protected function readRow(): bool\n {\n if (!$this->sheet->getCell(self::COLUMNS[0] . $this->currentRow)->getValue()) {\n // if empty row - we don't need to do anything here\n return false;\n }\n // okey, data exist\n // here we should validate it\n // save it\n $notValidatedCells = 0;\n foreach (self::COLUMNS as $i => $columnSymbol) {\n // reads cell and validate it\n $cell = $this->sheet->getCell($columnSymbol . $this->currentRow);\n if (!preg_match(self::VALIDATE_RULES[$i], $cell->getFormattedValue())) {\n // fck, bad data\n $notValidatedCells++;\n $this->notValidData[$this->currentRow][$columnSymbol] = $cell->getFormattedValue();\n continue;\n }\n // here the good data - u can do with it whatever u want\n $this->validData[$this->currentRow][$columnSymbol] = $cell->getFormattedValue();\n }\n return true;\n }", "public static function parse_csv() {\n $config = get_laterpay_migrator_config();\n $logger = new LaterPay_Migrator_Core_Logger( $config->get( 'parse_log' ) );\n $csvFile = null;\n\n // search CSV file in upload folder\n $files = glob( $config->get( 'upload_dir' ) . '*', GLOB_MARK );\n foreach ( $files as $file ) {\n if ( substr( $file, -4, 4 ) === '.csv' ) {\n // get all data from CSV file\n $csvFile = @file( $file );\n break;\n }\n }\n\n if ( ! $csvFile ) {\n return false;\n }\n\n // initialize products array\n $products = array();\n\n // extract all data from the uploaded file into an array\n $data = array();\n\n foreach ( $csvFile as $line ) {\n if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {\n $data[] = str_getcsv( $line );\n } else {\n $fh = @fopen( 'php://temp', 'r+' );\n fwrite( $fh, $csvFile );\n rewind( $fh );\n $data[] = fgetcsv( $fh );\n fclose( $fh );\n }\n }\n\n // initialize array with mapped data\n $final_data = array();\n\n // check, if data has at least 1 row\n if ( ! $data ) {\n return 0;\n }\n\n // clear migration table\n LaterPay_Migrator_Model_Migration::clear_table();\n\n $invalid_count = 0;\n\n // build array of values for query\n foreach ( $data as $row ) {\n $final_row = array();\n $values = explode( ';', $row[0] );\n foreach ( $values as $key => $value ) {\n if ( isset( self::$column_mapping[ $key ] ) ) {\n $final_row[ self::$column_mapping[ $key ] ] = trim( $value, ' \"' );\n continue;\n }\n break;\n }\n\n // validate data\n if ( ! isset( $final_row['product'] ) || ! $final_row['product'] ) {\n $logger->log( 'Missed product: ', $final_row );\n $invalid_count++;\n continue;\n } else if ( ! isset( $final_row['email'] ) || ! $final_row['email'] ) {\n $logger->log( 'Missed email: ', $final_row );\n $invalid_count++;\n continue;\n } else if ( ! isset( $final_row['date'] ) || ! $final_row['date'] ) {\n $logger->log( 'Missed date: ', $final_row );\n $invalid_count++;\n continue;\n } else if ( ! strtotime( $final_row['date'] ) ) {\n $logger->log( 'Wrong date format: ', $final_row );\n $invalid_count++;\n continue;\n }\n\n // check, if user exists as WordPress user\n $user = get_user_by( 'email', $final_row['email'] );\n if ( ! $user instanceof WP_User ) {\n $logger->log( 'User not exist: ', $final_row );\n $invalid_count++;\n continue;\n }\n\n if ( ! in_array( $final_row['product'], $products ) ) {\n $products[] = $final_row['product'];\n }\n\n // make sure we have a name we can address the subscriber with in emails\n $subscriber_name = trim( $final_row['first_name'] . ' ' . $final_row['last_name'] );\n if ( $subscriber_name == '' ) {\n $subscriber_name = __( 'Subscriber', 'laterpay-migrator' );\n }\n\n // prepare data and set as final\n $final_data[] = array(\n 'expiry' => date( 'Y-m-d', strtotime( $final_row['date'] ) ),\n 'product' => $final_row['product'],\n 'email' => $final_row['email'],\n 'subscriber_name' => $subscriber_name,\n );\n }\n\n // update invalid count\n update_option( 'laterpay_migrator_invalid_count', $invalid_count );\n\n // save products in options\n update_option( 'laterpay_migrator_products', $products );\n\n // reset mapping\n update_option( 'laterpay_migrator_products_mapping', false );\n\n // import data into database\n return LaterPay_Migrator_Model_Migration::import_data( $final_data );\n }", "public function verify() {\n\t\tforeach($this->rows as $index => $row) foreach($row as $heading => $column) if($headings[$heading] === true && empty($column)) throw new Exception(\"Row {$index} requires {$heading}, but no data is present\");\n\t}", "public function validateImportUsers($content, $headerRow) {\n $content = preg_replace('/^[ \\t]*[\\r\\n]+/m', '', $content);\n $lines = array_filter(explode(\"\\n\", $content), 'strlen');\n\n $user = new User(null, null, null, null, null);\n $this->reset();\n \n $this->logger->debug(\"Number of lines: \" . count($lines) );\n $lineCount = count($lines);\n if ($headerRow === true)\n $lineCount = $lineCount > 0 ? --$lineCount : 0;\n \n if($lineCount === 0){\n $this->addError('Import file is empty.');\n return false;\n }\n \n $this->logger->debug(\"Inside Validate Import\");\n $startLine = 0;\n if($headerRow === true){\n $startLine = 1;\n $this->logger->debug(\"Ignoring header row\");\n }\n for ($i = $startLine; $i < count($lines); $i++) {\n\n $csv = str_getcsv($lines[$i], \",\", '\"', \"\\n\");\n if ($csv[0] == null)\n break;\n //set the user attributes to null if they are not set\n for ($attrIndex = 0; $attrIndex < 7; $attrIndex++) {\n if (!isset($csv[$attrIndex])){\n $csv[$attrIndex] = null;\n }\n else{\n $csv[$attrIndex] = trim($csv[$attrIndex]);\n }\n }\n if (empty(trim($csv[5])))\n $csv[5] = null; //email\n if (empty(trim($csv[5])))\n $csv[6] = null; //phone\n $user->setAllMembers($csv[0], $csv[1], $csv[2], $csv[3], $csv[4], $csv[5], $csv[6]);\n $lineNumber = $i +1;\n $this->validate($user,$lineNumber);\n }\n $isValid = $this->isValid();\n return $isValid;\n }", "public function customValidation($arrayError){\n $errArray = [];\n foreach($arrayError as $key=>$error){\n foreach($error as $key2=>$err){\n if($err==\"\"){\n $errArray[] = \"Header column (\".$key2.\" at column \".$key.\") is empty or incorrect in csv file\";\n }\n }\n }\n return $errArray;\n }", "private function validateRow(array $row, int $line) : void {\n $columns = $this->getRowExecutor()->getColumnManager()->getColumns();\n foreach ($columns as $column) {\n $input = $row[$column->getFrom()];\n $column->setInput($input);\n if (!$column->getValidator()->validate()) {\n $this->getConfig()->getLog()->write($line, __('shift::shift.validation_error', ['error' => $column->getValidator()->getError()]), ILogTypes::VALIDATION_ERROR);\n }\n }\n }", "function validate_grabber_list($fname, $verbose=false){\n\n function display_message($msg, $class, $verbose){\n if ($verbose==false and $class!=\"lineBad\") {\n return;\n } else {\n echo \"<div class='$class'>$msg</div>\";\n }\n }\n\n $totalErrors=0;\n $row=0;\n $f = fopen($fname, \"r\");\n \n if ($verbose){\n echo \"<div style='font-size: 150%; font-weight: bold'>Grabber List File Analysis</div>\";\n echo \"<div style='font-family: monospace;'>$fname</div>\";\n echo \"<div>&nbsp</div>\";\n }\n\n $uniqueIDs = [];\n\n while (($dataRow = fgetcsv($f, 1000, \",\")) !== FALSE) {\n $row++;\n $line=$dataRow;\n $lineText = implode(\", \", $line);\n $lineItemCount = count($line);\n \n if ($verbose){\n echo \"<div class='lineBlock'>\";\n echo \"<div class='lineNumber'>Line #$row</div>\";\n echo \"<div class='lineCode'>$lineText</div>\";\n }\n\n // check for empty lines\n $lineLength = strlen($lineText);\n if ($lineLength<3){\n display_message(\"GRABBER FILE ERROR (LINE $row):<br><code>$lineText</code><br>Blank lines are NOT allowed.\", \"lineBad\", $verbose);\n $totalErrors+=1;\n } else {\n display_message(\"Line length: $lineLength characters\", \"lineOK\", $verbose);\n }\n\n // check each line has 7 items\n if ($lineItemCount==7){\n display_message(\"Number of items: $lineItemCount\", \"lineOK\", $verbose);\n } else {\n display_message(\"GRABBER FILE ERROR (LINE $row):<br><code>$lineText</code><br>Each line must contain 7 items. This line contains $lineItemCount.\", \"lineBad\", $verbose);\n $totalErrors+=1;\n }\n \n if ($row==1){\n // check the first row is exactly what is needed\n $firstLineFormat = \"#ID, callsign, title, name, location, website, file\";\n if ($lineText==$firstLineFormat){\n display_message(\"First line format: OK\", \"lineOK\", $verbose);\n } else {\n display_message(\"GRABBER FILE ERROR (LINE $row):<br><code>$lineText</code><br>First line must contain this exact text:<br>$firstLineFormat\", \"lineBad\", $verbose);\n $totalErrors+=1;\n }\n } else {\n // ensure URLs are present for every grabber file and link\n if (strstr($line[5], \"://\") && strstr($line[6], \"://\")){\n display_message(\"URL format: OK\", \"lineOK\", $verbose);\n } else {\n display_message(\"GRABBER FILE ERROR (LINE $row):<br><code>$lineText</code><br>URL format is bad!\", \"lineBad\", $verbose);\n $totalErrors+=1;\n }\n }\n \n \n if (in_array($line[0],$uniqueIDs)){\n display_message(\"GRABBER FILE ERROR (LINE $row):<br><code>$lineText</code><br>Grabber IDs (the first element) must be unique!\", \"lineBad\", $verbose); \n $totalErrors+=1;\n } else {\n display_message(\"Unique grabber ID: OK\", \"lineOK\", $verbose);\n }\n $uniqueIDs[]=$line[0];\n \n echo \"</div>\";\n } \n\n return $totalErrors;\n}", "public function test_from_csv($array, $csv)\n\t{\n\t\t$this->assertEquals($array, Format::forge($csv, 'csv')->to_array());\n\n\t}", "private function isValid($array)\n\t{\n\t\t// check item 3 is int \n\t\tif(isset($array[$this->columnStock]))\n\t\t{\n\t\t\t// item is really a string so ctype_digit will check that it is just numbers \n\t\t\t// in that string eg. is_int\n\t\t\tif(!ctype_digit($array[$this->columnStock]))\n\n\t\t\t{\n\t\t\t\t$this->makeOutputArray('reason', \"Data in column 4 was not an integer\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check item 4 is numeric\n\t\tif( isset($array[$this->columnCost]))\n\t\t{\n\t\t\t// check item 4 is float\t\t\t\t\n\t\t\tif( !is_numeric($array[$this->columnCost]) )\n\t\t\t{\n\t\t\t\t// could make this error message a less technical term if necessary\n\t\t\t\t$this->makeOutputArray('reason', \"Data in column 5 was not a float\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$numbers = array($this->columnProductCode, $this->columnProductName, $this->columnProductDescription, $this->columnDiscontinued);\n\t\t\n\t\t// check remaining items are strings\n\t\tforeach ($numbers as &$value) \n\t\t{\n\t\t\tif(isset($array[$value]))\n\t\t\t{\n\t\t\t\tif( !is_string($array[$value]))\n\t\t\t\t{\n\t\t\t\t\t$this->makeOutputArray('reason', \"Data in column {$value} was not a string\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->isEncodingOK($array[$value]) === false)\n\t\t\t\t{\n\t\t\t\t\t$this->makeOutputArray('reason', \"The character encoding was not UTF8 complient\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn true;\t\t\n\t}", "public function testRowValid()\n {\n $expected = [\n 0 => null,\n 1 => null,\n 2 => 'T',\n ];\n\n $this->assertEquals(\n $expected,\n $this->Board->row(0),\n 'Requesting a valid ::row() should produce the expected subset array.'\n );\n }", "private function validate(array $row) : void {\n $columns = $this->getCrudColumns();\n foreach ($columns as $key => $column) {\n if ($columns->$key->disabled || !$columns->$key->editable)\n continue;\n $column->evalProperty('validate', $row);\n }\n}", "private function parseDataInRows() {\r\n $mFileHandle = fopen($this->filename,\r\n \"r\");\r\n\r\n // Get the first line of the file as a raw string\r\n $this->firstLineRaw = fgets($mFileHandle);\r\n\r\n // Rewind file pointer\r\n rewind($mFileHandle);\r\n\r\n $mRowNum = 1;\r\n $mLineNum = 1;\r\n while (false !== ($mLine = $this->getCsv($mFileHandle))) {\r\n if (is_array($mLine) && count($mLine) > 1) {\r\n if ($mRowNum === 1 && $this->firstRowFieldNames === true) {\r\n $this->fields = $this->normalize($mLine,\r\n true);\r\n } else\r\n if ($mRowNum === 1 && $this->firstRowFieldNames === true) {\r\n $this->rows[] = $mLine;\r\n } else {\r\n $this->rows[] = $mLine;\r\n }\r\n $mRowNum++;\r\n }\r\n $mLineNum++;\r\n }\r\n fclose($mFileHandle);\r\n }", "private function validateFields() {\n\t\t// get paths and their data types\n\t\t$conn = $this->col->getClient()->connection();\n\t\t$rows = $conn->table(Client::T_INDEX)\n\t\t\t\t\t->select($conn->raw('distinct(path)'), 'typ')\n\t\t\t\t\t->whereIn('path', array_keys($this->fields))\n\t\t\t\t\t->get();\n\n\t\t// quick comparison. can be changed for a more descriptive\n\t\t// error by comparing values in both lists\n\t\tif(sizeof($rows) != sizeof($this->fields)) {\n\t\t\tthrow new Exception(\"Error: One or more JSON paths don't exist\");\n\t\t}\n\n\t\treturn $rows;\n\t}", "public static function verifyImportFile( $file ) {\n\t\t$fp = fopen( $file, 'r' );\n\t\t$data = array();\n\t\twhile ( ( $line = fgetcsv( $fp ) ) !== false ) {\n\t\t\tif ( count( $line ) != 2 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! in_array( $line[1], array( 'whitelist', 'blacklist' ) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ( Settings::instance()->validateIp( $line[0] ) == false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$data[] = $line;\n\t\t\t\n\t\t}\n\t\tfclose( $fp );\n\t\t\n\t\treturn $data;\n\t}", "function parse_cpd_csv($csvFile) {\n\t$error_rows = array();\n\t$success_rows = 0;\n\t$row_i = 1; // csv row index start\n\t$csv_file = fopen($csvFile, 'r');\n\twhile (($row = fgetcsv($csv_file)) !== FALSE) {\n\t\tif ($row_i === 1) {\n\t\t\t$row_i++;\n\t\t\tcontinue;\n\t\t}\n\t\t$cpd_id = $user_id = 0;\n\t\t/* for cpd id */\n\t\tif(!empty(trim($row[0])) && is_numeric($row[0])) {\n\t\t\t$cpd_id = trim($row[0]);\n\t\t}\n\t\t/* for author id */\n\t\tif(!empty(trim($row[1])) && is_numeric($row[1])) {\n\t\t\t$user_id = trim($row[1]);\n\t\t}\n\t\t$cpd_date = '';\n\t\t$date = !empty(trim($row[4])) ? trim($row[4]) : '';\n\t\tif(!empty($date)){\n\t\t\t$clean_date = str_replace('/', '-', $date);\n\t\t\t$cpd_date = date('Y-m-d', strtotime($clean_date));\n\t\t}\n\t\t$provider = !empty(trim($row[5])) ? trim(esc_html($row[5])) : '';\n\t\t$activity = !empty(trim($row[6])) ? trim(esc_html($row[6])) : '';\n\t\t$ca_1 = !empty(trim($row[7])) && trim($row[7]) != '-' ? trim($row[7]) : 0;\n\t\t$ca_1_1 = !empty(trim($row[8])) && trim($row[8]) != '-' ? trim($row[8]) : 0;\n\t\t$ca_2 = !empty(trim($row[9])) && trim($row[9]) != '-' ? trim($row[9]) : 0;\n\t\t$ca_2_1 = !empty(trim($row[10])) && trim($row[10]) != '-' ? trim($row[10]) : 0;\n\t\t$ca_3 = !empty(trim($row[11])) && trim($row[11]) != '-' ? trim($row[11]) : 0;\n\t\t$ca_3_1 = !empty(trim($row[12])) && trim($row[12]) != '-' ? trim($row[12]) : 0;\n\t\t$ca_4 = !empty(trim($row[13])) && trim($row[13]) != '-' ? trim($row[13]) : 0;\n\t\t$ca_4_1 = !empty(trim($row[14])) && trim($row[14]) != '-' ? trim($row[14]) : 0;\n\n\t\tif(empty($cpd_id) && !empty($user_id)) { // insert new record\n\t\t\tif(!empty($cpd_date) && !empty($provider) && !empty($activity)) {\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type' => 'cpd_record',\n\t\t\t\t\t'post_author' => $user_id,\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t);\n\t\t\t\t$new_cpd_id = wp_insert_post($args);\n\t\t\t\tupdate_field('date', $cpd_date, $new_cpd_id);\n\t\t\t\tupdate_field('provider', $provider, $new_cpd_id);\n\t\t\t\tupdate_field('activity', $activity, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_1', $ca_1, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_1_1', $ca_1_1, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_2', $ca_2, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_2_1', $ca_2_1, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_3', $ca_3, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_3_1', $ca_3_1, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_4', $ca_4, $new_cpd_id);\n\t\t\t\tupdate_field('points_competency_4_1', $ca_4_1, $new_cpd_id);\n\t\t\t\t$success_rows++;\n\t\t\t} else {\n\t\t\t\t$error_rows[] = $row_i;\n\t\t\t}\n\t\t} elseif(!empty($cpd_id) && !empty($user_id)) { // update record by post id and user id\n\t\t\t$cpd_record = get_post($cpd_id);\n\t\t\tif(!empty($cpd_record) && $cpd_record->post_author == $user_id && !empty($cpd_date) && !empty($provider) && !empty($activity)) {\n\t\t\t\tupdate_field('date', $cpd_date, $cpd_id);\n\t\t\t\tupdate_field('provider', $provider, $cpd_id);\n\t\t\t\tupdate_field('activity', $activity, $cpd_id);\n\t\t\t\tupdate_field('points_competency_1', $ca_1, $cpd_id);\n\t\t\t\tupdate_field('points_competency_1_1', $ca_1_1, $cpd_id);\n\t\t\t\tupdate_field('points_competency_2', $ca_2, $cpd_id);\n\t\t\t\tupdate_field('points_competency_2_1', $ca_2_1, $cpd_id);\n\t\t\t\tupdate_field('points_competency_3', $ca_3, $cpd_id);\n\t\t\t\tupdate_field('points_competency_3_1', $ca_3_1, $cpd_id);\n\t\t\t\tupdate_field('points_competency_4', $ca_4, $cpd_id);\n\t\t\t\tupdate_field('points_competency_4_1', $ca_4_1, $cpd_id);\n\t\t\t\t$success_rows++;\n\t\t\t} else {\n\t\t\t\t$error_rows[] = $row_i;\n\t\t\t}\n\t\t} else {\n\t\t\t$error_rows[] = $row_i;\n\t\t}\n\t\t$row_i++;\n\t}\n\tfclose($csv_file);\n\tif($success_rows > 0){\n\t\t$success_msg = 'CPD records imported successfully. Totally ' . $success_rows . ' record(s) affected. Please click here to <a href=\"'.get_admin_url().'edit.php?post_type=cpd_record\">refresh</a> the records list.';\n\t} else {\n\t\t$success_msg = 'No CPD records imported!';\n\t}\n\t$response['success'] = $success_msg;\n\t$err_cnt = count($error_rows);\n\tif($err_cnt > 0){\n\t\t$error_msg = 'Please note that the following CPD record(s) cannot import. Row number(s) [ ' . implode(', ', $error_rows) . ' ] - this may contain empty cells or error in data supplied.';\n\t\t$response['error'] = $error_msg;\n\t}\n\treturn $response;\n}", "public function validateArray();", "public function ValidateCsvInput($fieldname) {\n\t\t$this->LoadSettings();\n\t\t/* Check if the columns match */\n\t\tif (count($this->_csv_fields) != count($this->_product_data)) {\n\t\t\t$find = array('{configfields}', '{filefields}');\n\t\t\t$replace = array(count($this->_csv_fields), count($this->_product_data));\n\t\t\tJError::raiseWarning(0, str_ireplace($find, $replace, JText::_('INCORRECT_COLUMN_COUNT')));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/* Columns match, validate */\n\t\telse {\n\t\t\tif (isset($this->_csv_fields[$fieldname])) {\n\t\t\t\t/* Check if the field has a value */\n\t\t\t\tif (array_key_exists($this->_csv_fields[$fieldname][\"order\"], $this->_product_data)\n\t\t\t\t\t&& strlen($this->_product_data[$this->_csv_fields[$fieldname][\"order\"]]) > 0) {\n\t\t\t\t\treturn trim($this->_product_data[$this->_csv_fields[$fieldname][\"order\"]]);\n\t\t\t\t}\n\t\t\t\t/* Field has no value, check if we can use default value*/\n\t\t\t\telse if (!$this->_skip_default_value) {\n\t\t\t\t\treturn $this->_csv_fields[$fieldname][\"default_value\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function hasDataRow()\n\t{\n\t\t$lines = explode(PHP_EOL, $this->string);\n\n\t\treturn count($lines) > 2;\n\t}", "function GetAllRows()\n\t{\n\t\t$rows = [];\n\t\t$rowIdx = 0;\n\t\twhile (!feof($this->file))\n\t\t{\n\t\t\t$actual = fgetcsv($this->file);\n\t\t\t$row = array();\n\t\t\t\n\t\t\tif ($this->HasHeaders && $rowIdx == 0)\n\t\t\t{\n\t\t\t\t$rowIdx++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$colIdx = 0;\n\t\t\tforeach (CsvFile::$FIELDS as $key => $val)\n\t\t\t\t$row[$key] = $actual[$colIdx++];\n\t\t\t\n\t\t\tif ($row[\"firstname\"] == \"\" || $row[\"email\"] == \"\")\n\t\t\t\t$this->Errors[count($this->Errors)] = $rowIdx;\n\t\t\telse\n\t\t\t\t$rows[$rowIdx-1] = $row;\n\t\t\t$rowIdx++;\n\t\t}\n\t\treturn $rows;\n\t}", "public function readCSV() {\n $row = 1;\n if (($handle = fopen(base_url() . 'test.csv', \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $num = count($data);\n\n //echo \"<p> $num fields in line $row: <br /></p>\\n\";\n\n for ($c = 0; $c < $num; $c++) {\n\n $oldData[$row][] = $data[$c];\n }\n $row++;\n }\n fclose($handle);\n }\n $newData = array();\n foreach ($oldData as $key => $value) {\n if ($value[2] != \"\") {\n\n //exit ;\n\n } else {\n if ($value[0] == \"\" || $value[1] == \"\") {\n } else {\n $newData[] = $value;\n }\n }\n\n //echo '<pre>';\n //print_r($newData);\n //echo '</pre>';\n\n\n }\n }", "function parse_csvtemplate($csv)\n { \n try\n {\n $descriptor = new row_descriptor();\n $line_num = 0;\n while (($row = fgetcsv($csv, 0,\",\", '\"')) !== false)\n {\n $line_num++;\n $bilan_row=[];\n $descriptor = new row_descriptor();\n $consistency=$descriptor->check_consistency($row, $line_num);\n if ($consistency)\n { \n $bilan_row = $descriptor->get_bilan_row();\n $bilan_row['solde'] = $this->get_montant($descriptor->variable_name,$bilan_row['linetype']);\n $this->bilan_table [] =$bilan_row;\n if ($descriptor->flatten){\n foreach ($descriptor->code_ranges as $range)\n {\n $code_left = $range[\"left\"];\n $code_right = $range[\"right\"];\n $leaf_postes = $this->get_range_postes($code_left,$code_right);\n if (! is_null($leaf_postes)){\n $this->bilan_table =array_merge($this->bilan_table,$leaf_postes);\n }\n else {\n }\n }\n }\n else{\n }\n }\n else \n {\n //first line and blank lines are skipped \n }\n }\n }\n catch (Exception $exc) {\n printf(_('Erreur dans le fichier %s ligne %s : %s'),$this->csvfilename,$line_num,$exc->getMessage());\n }\n return;\n }", "public function csvUpload(Request $request) {\n //truncate old tables\n //echo date('Y-m-d H:i:s');\n //print_r($);\n $subject_id = $request->subject_id;\n //print_r($request->subject_id);\n //exit;\n\n $messages = array(\n 'file_path.mimetypes' => 'Please import csv file',\n );\n $validator = Validator::make($request->all(), [\n 'file_path' => 'required|mimetypes:text/plain,application/vnd.ms-excel,text/csv,text/tsv',\n ], $messages);\n if ($validator->fails()) {\n return redirect('admin/dashboard')\n ->withInput()\n ->withErrors($validator);\n }\n $file = $request->file('file_path');\n\n /* Rearrange this array to change the search priority of delimiters */\n $delimiters = array(//'tab' => \"\\t\",\n 'comma' => \",\",\n 'zem' => \":\",\n 'semicolon' => \";\"\n );\n\n $handle = file($file); # Grabs the CSV file, loads into array\n\n $line = array(); # Stores the count of delimiters in each row\n\n $valid_delimiter = array(); # Stores Valid Delimiters\n # Count the number of Delimiters in Each Row\n for ($i = 1; $i < 10; $i++) {\n foreach ($delimiters as $key => $value) {\n //print_r($value);\n $line[$key][$i] = count(explode($value, $handle[$i])) - 1;\n }\n }\n //print_r($line); exit;\n # Compare the Count of Delimiters in Each line\n foreach ($line as $delimiter => $count) {\n\n # Check that the first two values are not 0\n if ($count[1] > 0 and $count[2] > 0) {\n $match = true;\n\n $prev_value = '';\n foreach ($count as $value) {\n\n if ($prev_value != '')\n $match = ( $prev_value == $value and $match == true ) ? true : false;\n\n $prev_value = $value;\n }\n } else {\n $match = false;\n }\n\n if ($match == true)\n $valid_delimiter[] = $delimiter;\n }//foreach\n //print_r($valid_delimiter); exit;\n # Set Default delimiter to comma\n if (isset($valid_delimiter[0])) {\n $delimiter = ( $valid_delimiter[0] != '' ) ? $valid_delimiter[0] : \"comma\";\n $import_delimiter = $delimiters[$delimiter];\n } else {\n $import_delimiter = ' ';\n }\n\n $file = $request->file('file_path');\n $file_read = fopen($file, \"r\");\n $first_row = 0;\n $uniqueCodes = \"List Of unique codes\";\n\n //$this->data = new LearningTargetsKeyConcept();\n \n\n $import_delimiter = \",\";\n while (!feof($file_read)) {\n $data = fgetcsv($file_read, null, $import_delimiter);\n // print_r($data);\n $essential_questions = trim($data[6]);\n if ($essential_questions) {\n $essential_questions = str_replace(\"^\", \"<br/>\", $essential_questions);\n }else{\n $essential_questions = '';\n }\n $overview = trim($data[4]);\n if ($overview) {\n $overview = str_replace(\"^\", \"<br/>\", $overview);\n }else{\n $overview = '';\n }\n $standards = trim($data[5]);\n if ($standards) {\n $standards = str_replace(\"^\", \"<br/>\", $standards);\n }else{\n $standards = '';\n }\n $core_ideas = trim($data[7]);\n if ($core_ideas) {\n $core_ideas = str_replace(\"^\", \"<br/>\", $core_ideas);\n }else{\n $core_ideas = '';\n }\n \n $academic_vocabulary = trim($data[8]);\n if ($academic_vocabulary) {\n $academic_vocabulary = str_replace(\"^\", \"<br/>\", $academic_vocabulary);\n }else{\n $academic_vocabulary = '';\n }\n\n $learning_target = trim($data[3]);\n if ($learning_target) {\n $learning_target = str_replace(\"^\", \"<br/>\", $learning_target);\n }else{\n $learning_target = '';\n }\n \n if ($first_row != 0) {\n // echo \"table row=>\".$first_row.\"<br/>\";\n if($data[0]!=\"\" && $data[1]!=\"\" && $data[2]!=\"\" && $data[3]!=\"\"){\n $temp = new TempCsv;\n \n // echo \"db row=>\".$first_row.\"<br/><br/>\";\n $temp->subject_id = $subject_id;\n $temp->grade = $data[0];\n $temp->theme = $data[1];\n $temp->key_concept = $data[2];\n $temp->learning_target = $learning_target;\n $temp->overview = $overview;\n $temp->standards = $standards;\n $temp->essential_questions = $essential_questions;\n $temp->core_ideas = $core_ideas;\n $temp->academic_vocabulary = $academic_vocabulary;\n $temp->save(); \n } \n }\n /*if ($first_row > 50) {\n exit;\n }*/\n \n $first_row++;\n } //exit;\n fclose($file_read);\n //echo date('Y-m-d H:i:s');\n $msg = 'Data Imported Successfully.';\n Session::flash('success_msg', $msg);\n return redirect('/admin/learningtargets');\n }", "public function importRows($csv) {\n\n $accounts = ['MasterCard', 'Chequing'];\n $transactions = $csv->filter(function($item) use ($accounts) {\n return in_array($item->account_type, $accounts);\n });\n\n Transaction::tentative()->delete();\n $importCount = 0;\n\n foreach($transactions as $item){\n $record = [\n 'date' => new Carbon($item->transaction_date),\n 'account' => $item->account_type,\n 'imported_description1' => $item->description_1,\n 'imported_description2' => $item->description_2,\n 'amount' => $item->cad * -1,\n 'description' => ucwords(strtolower($item->description_1)),\n ];\n\n if (isset($item->tentative)) $record['tentative'] = $item->tentative;\n\n $matches = collect(Searchy::transactions('description')\n ->query(explode(' ', $record['description'], 2)[0])\n ->getQuery()\n ->where('date', '=', $record['date']->toDateString())\n ->where('amount', '=', $record['amount'])\n ->where('account', '=', $record['account'])\n ->get()\n );\n\n if ($matches->count() == 0){\n $t = new Transaction($record);\n $t->category = $this->categories->getCategory($record);\n $t->save();\n $importCount++;\n }\n\n }\n\n return $importCount;\n }", "public function verify_data(mixed $data): bool {\n if (is_array($data)) {\n foreach ($data as $line) {\n if (is_array($line)) {\n if(!$this->verify_data($line)){\n return false;\n }\n }else{\n if (!$this->verify_line((string)$line)) {\n return false;\n }\n }\n }\n }else{\n if (!$this->verify_line((string)$data)) {\n return false;\n }\n }\n return true;\n }", "public function checkRows()\n {\n for ($idx = 0; $idx < 9; $idx++) {\n if (!$this->checkRowAt($idx)) {\n return false;\n }\n }\n\n return true;\n }", "public function orders_with_invalid_emails_are_imported($csvFilename)\n {\n $this->importACopiedOrderCSV($csvFilename);\n $this->seeJson(['import_status' => 'File uploaded successfuly']);\n \n $csvPathname = $this->csvDirectory.$csvFilename;\n $parsedOrders = $this->readOrderCsvFile($csvPathname);\n\n foreach ($parsedOrders as $parsedOrder) {\n //dd(App\\Order::all());\n $parsedOrder['valid'] = false;\n $parsedOrder['validation_errors'] = json_encode([[\n 'rule' => config('validation.email.type.rule_title'),\n 'message'=>config('validation.email.type.error_message'),\n ]]);\n $this->seeInDatabase('orders', $parsedOrder);\n }\n }", "function line_handler($line)\n{\n// Break of Line to match CSV, separating fields\n $input = explode(';',$line);\n \n// Set exploded into the new array on each iteration\n $items=array();\n foreach($input as $temp)\n {\n if($temp=='') {$temp='null'; }\n array_push($items, $temp);\n }\n// insert data into database!\n get_query_1($items[0]); // Agency Table\n get_query_4($items); // Pro Contact Table\n get_query_5($items); // Addr Table\n get_query_2($items); // Program Table\n}", "public function validateData()\n {\n $this->shell_io->out('Validating data...');\n\n $ws = $this->getWorksheets()[$this->activeWorksheet];\n $dataRowCount = $ws['totalRows'] - ($ws['firstDataRow'] - 1);\n $dataColCount = $ws['totalCols'] - ($ws['firstDataCol'] - 1);\n\n /** @var ProgressHelper $progress */\n $progress = $this->shell_io->helper('Progress');\n $progress->init([\n 'total' => $dataRowCount * $dataColCount,\n 'width' => 40,\n ]);\n $progress->draw();\n\n $datum = new Datum();\n $invalidData = [];\n for ($row = $ws['firstDataRow']; $row <= $ws['totalRows']; $row++) {\n for ($col = $ws['firstDataCol']; $col <= $ws['totalCols']; $col++) {\n try {\n $value = $this->getValue($col, $row);\n $cell = $this->getCell($col, $row);\n if (!$datum->isValid($value, $cell)) {\n $invalidData[] = compact('col', 'row', 'value');\n }\n } catch (Exception $e) {\n $value = '(Cannot read value)';\n $invalidData[] = compact('col', 'row', 'value');\n }\n $progress->increment(1);\n $progress->draw();\n unset($cell, $value);\n }\n }\n\n if ($invalidData) {\n $limit = 10;\n $count = count($invalidData);\n if ($count > $limit) {\n $invalidData = array_slice($invalidData, 0, $limit);\n }\n\n $this->shell_io->overwrite('Data errors:');\n array_unshift($invalidData, ['Col', 'Row', 'Invalid value']);\n $this->shell_io->helper('Table')->output($invalidData);\n if (count($invalidData) < $count) {\n $difference = $count - count($invalidData);\n $msg = '+ ' . $difference . ' more invalid ' . __n('value', 'values', $difference);\n $this->shell_io->out($msg);\n }\n $this->shell_io->error('Cannot continue. Invalid data found.');\n throw new Exception();\n }\n\n $this->shell_io->overwrite(' - Done');\n unset(\n $dataColCount,\n $dataRowCount,\n $datum,\n $invalidData,\n $progress,\n $ws\n );\n }", "protected function _checkVarsCSV($arr)\n\t{\n\t\tglobal $classFile;\n\t\tglobal $varsPluginAccountingAccount;\n\n\t\t$arrayCSV = $classFile->getCsvRows(array(\n\t\t\t'path' => $arr['varsFile']['strUrl'],\n\t\t));\n\n\t\tunlink($arr['varsFile']['strUrl']);\n\n\t\t$numFiscalPeriodTemp = $this->_getNumFiscalPeriodTemp();\n\n\t\t$classCalcLogImport = &$arr['classCalcLogImport'];\r\n\t\t$varsCSV = $classCalcLogImport->allot(array(\r\n\t\t\t'flagStatus' => 'check',\r\n\t\t\t'arrOrder' => $arrayCSV,\r\n\t\t\t'idEntity' => $varsPluginAccountingAccount['idEntityCurrent'],\r\n\t\t\t'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t\t'numFiscalPeriodTemp' => $numFiscalPeriodTemp,\n\t\t\t'idAccount' => $arr['varsFile']['idAccount'],\r\n\t\t));\n\n\t\treturn $varsCSV;\n\t}", "private function checkColumnNumbers()\n\t{\n\t\t\n\t\t$columnCode = $this->columnProductCode;\n\t\t$columnName = $this->columnProductName;\n\t\t$columnDescription = $this->columnProductDescription;\n\t\t$columnStock = $this->columnStock;\n\t\t$columnCost = $this->columnCost;\n\t\t$columnDiscontinued = $this->columnDiscontinued;\n\t\t\n\t\t$checkColumnHeadings = array($columnCode, \n\t\t\t\t\t\t\t\t\t$columnName, \n\t\t\t\t\t\t\t\t\t$columnDescription, \n\t\t\t\t\t\t\t\t\t$columnStock, \n\t\t\t\t\t\t\t\t\t$columnCost, \n\t\t\t\t\t\t\t\t\t$columnDiscontinued);\n\t\t\n\t\t$i = 0; // used to provide error message\n\t\t\n\t\t// loop through each item and check that the expected column heading was found\n\t\tforeach ($checkColumnHeadings as &$title) \n\t\t{\n\t\t\tif($title === false)\n\t\t\t{\n\t\t\t\t$this-> error = \"ERROR - could not find column heading: (\".$this->expectedColumnHeadings[$i].\") in the CSV file\". PHP_EOL;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected function checkRequiredFields(array $row){\n\t\t$required = $this->requiredFields;\n\n\t\t// Fields that must all be present\n\t\t$and = array_filter($required, 'is_string');\n\n\t\t// Fields where at least one must be present\n\t\t$or = array_filter($required, 'is_array');\n\n\t\t/**\n\t\t * The following block checks if required fields are all present\n\t\t * and logs any errors errors\n\t\t */\n\t\tif (\n\t\t\t// number of fields is less than the required count\n\t\t\tcount($row) < count($required) ||\n\n\t\t\t// $or fields are required, but not present\n\t\t\t(!empty($or) && !$this->orFieldsValid($or, $row)) ||\n\n\t\t\t// remaining fields are not present\n\t\t\tcount(array_intersect($and, $row)) !== count($and)\n\t\t){\n\t\t\t$this->logMissingRequiredFields($row, $and, $or);\n\t\t}\n\t}", "protected function checkRequiredFields(array $row) {\n\n $required = $this->expectedHeaders;\n\n // Fields that must all be present\n $and = array_filter($required, 'is_string');\n\n // Fields where at least one must be present\n $or = array_filter($required, 'is_array');\n\n /**\n * The following block checks if required fields are all present\n * and logs any errors errors\n */\n if (\n // number of fields is less than the required count\n count($row) < count($required) ||\n // $or fields are required, but not present\n (!empty($or) && !$this->orFieldsValid($or, $row)) ||\n // remaining fields are not present\n count(array_intersect($and, $row)) !== count($and)\n ) {\n $this->logMissingRequiredFields($row, $and, $or);\n }\n }", "protected function validateRow(array $row)\n\t\t{\n\t\t\tif(utils\\Arr::isMultidimensional($row))\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"Rows in a table must not be multidimensional arrays.\");\n\t\t\t}\n\n\t\t\t// Ensure the row contains no more columns than there are defined by their headers.\n\t\t\tif(isset($this->headers) and ($columnCount = count($row) !== $headerCount = count($this->headers)))\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(\"A row must contain exactly as many columns as there are headers. $columnCount given, expected $headerCount.\");\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function validate()\n\t\t{\n\t\t\t$fields = $this->_getFieldSpec();\n\t\t\t$errors = array();\n\t\t\tforeach($fields as $fieldName => $spec)\n\t\t\t{\n\t\t\t\tif(is_array($spec))\n\t\t\t\t{ // special fields are assumed correct\n\t\t\t\t\tif(isset($spec['validator']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($e = $spec['validator']->isInvalid($this->row[$fieldName], array('object' => $this, 'field' => $fieldName)))\n\t\t\t\t\t\t\t$errors[$fieldName] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(sizeof($errors)>0)\n\t\t\t{\n\t\t\t\t$this->errors = $errors;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->errors = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "protected function parseRow(CellIterator $row, $rowNumber)\n {\n $rowOk = true;\n $rowData = [];\n foreach ($this->getHeaderFields() as $cell => $field) {\n $cellValue = $this->getField($row, $cell);\n\n if (array_key_exists($cell, $this->getRequiredFields()) && empty($cellValue)) {\n $this->addError(\n sprintf('Missing <b>\"%s\"</b>', $field),\n static::SHEET_NAME,\n $rowNumber\n );\n $rowOk = false;\n }\n\n $rowData[$field] = $cellValue;\n }\n\n return $rowOk ? $rowData : false;\n }", "function processCSV($filename) { //Master\n \t\tglobal $db, $messageStack;\n \t\t$rows = $this->csv_to_array($_FILES[$filename]['tmp_name'], $delimiter=',');\n \t\t$messageStack->debug(\"\\nfinished parsing, extracted number of rows = \".sizeof($rows));\n\t\t$valid_fields = array(\n\t\t\t'description_short'\t\t=> 'description_short',\n\t\t\t'description_sales'\t\t=> 'description_sales',\n\t\t\t'description_purchase'\t=> 'description_purchase',\n\t\t\t'account_sales_income'\t=> 'account_sales_income',\n\t\t\t'account_inventory_wage'=> 'account_inventory_wage',\n\t\t\t'account_cost_of_sales'\t=> 'account_cost_of_sales',\n\t\t\t'item_taxable'\t\t\t=> 'item_taxable',\n\t\t\t'price_sheet'\t\t\t=> 'price_sheet',\n\t\t\t'full_price'\t\t\t=> 'full_price',\n\t\t\t'full_price_with_tax'\t=> 'full_price_with_tax',\n\t\t\t'item_weight'\t\t\t=> 'item_weight',\n\t\t\t'minimum_stock_level'\t=> 'minimum_stock_level',\n\t\t\t'reorder_quantity'\t\t=> 'reorder_quantity',\n\t\t\t'lead_time'\t\t\t\t=> 'lead_time',\n\t\t\t'upc_code'\t\t\t\t=> 'upc_code',\n\t\t\t'item_cost'\t\t\t\t=> 'item_cost',\n\t\t\t'price_sheet_v'\t\t\t=> 'price_sheet_v',\n\t\t\t'purch_taxable'\t\t\t=> 'purch_taxable',\n\t\t\t'item_cost'\t\t\t\t=> 'item_cost',\n\t\t\t'vendor_id'\t\t\t\t=> 'vendor_id',\n\t\t);\n\t\t$purch_fields = array(\n\t\t\t'description_purchase'\t=> 'description_purchase',\n\t\t\t'price_sheet_v'\t\t\t=> 'price_sheet_v',\n\t\t\t'purch_taxable'\t\t\t=> 'purch_taxable',\n\t\t\t'item_cost'\t\t\t\t=> 'item_cost',\n\t\t\t'vendor_id'\t\t\t\t=> 'vendor_id',\n\t\t);\n \t\t$count = 0;\n \t\tforeach ($rows as $row) {\n\t\t\t$where = false;\n\t\t\tif (isset($row['sku']) && strlen($row['sku']) > 0) {\n\t\t\t\t$where = \"sku='{$row['sku']}'\";\n\t\t\t} elseif (isset($row['upc_code']) && strlen($row['upc_code']) > 0) {\n\t\t\t\t$where = \"upc_code='{$row['upc_code']}'\";\n\t\t\t}\n\t\t\tif (!$where) {\n\t\t\t\t$messageStack->add(\"No search field was found. Either the SKU or UPC Code field must be included in the csv file.\", 'error');\n\t\t\t\tbreak; // no valid search fields\n\t\t\t}\n\t\t\t$query = \"\";\n\t\t\tforeach ($valid_fields as $key => $value) if (isset($row[$key])) $query .= \" $value='\".db_input($row[$key]).\"',\";\n\t\t\t$query .= \"last_update='\".date('Y-m-d').\"'\";\n\t\t\t$sql = \"UPDATE \".TABLE_INVENTORY.\" SET $query WHERE $where\";\n\t\t\t$messageStack->debug(\"\\nExecuting sql = $sql\");\n\t\t\t$result = $db->Execute($sql);\n\t\t\tif ($result->AffectedRows() > 0) $count++;\n\t\t\t// now update the purchase table (need the sku, upc_code will not work)\n\t\t\tif (!isset($row['sku'])) {\n\t\t\t\t$result = $db->Execute(\"SELECT sku from \".TABLE_INVENTORY.\" WHERE upc_code='{$row['upc_code']}'\");\n\t\t\t\t$row['sku'] = $result->fields['sku'];\n\t\t\t\t$where = \"sku='{$row['sku']}'\";\n\t\t\t}\n\t\t\tif (isset($row['vendor_id']) && $row['vendor_id']) $where .= \" AND vendor_id = '{$row['vendor_id']}'\";\n\t\t\t$query = \"\";\n\t\t\tforeach ($purch_fields as $key => $value) if (isset($row[$key])) $query .= \" $value='\".db_input($row[$key]).\"',\";\n\t\t\t$query = substr($query, 0, strlen($query)-1); // remove last comma\n\t\t\t$sql = \"UPDATE \".TABLE_INVENTORY_PURCHASE.\" SET $query WHERE $where\";\n\t\t\t$messageStack->debug(\"\\nExecuting sql = $sql\");\n\t\t\t$result = $db->Execute($sql);\n\t\t}\n\t\tif (DEBUG) $messageStack->write_debug();\n\t\t$messageStack->add(\"Total lines processed: \".sizeof($rows).\". Total affected rows = $count.\", \"success\");\n \t}", "function validate(Array $data);", "public function uploadSaleCSV($validated)\n {\n $path = $validated['csv_file']->getRealPath();\n $csv_data = array_map('str_getcsv', file($path));\n // save sale to Database accoding to csv row\n foreach ($csv_data as $index => $row) {\n if (count($row) >= 2) {\n try {\n $sale = new sale();\n $sale->customerID = $row[0];\n $sale->productID = $row[1];\n $sale->ordered_date = $row[2];\n $sale->save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n $errorCode = $e->errorInfo[1];\n //error handling for duplicated sale\n if ($errorCode == '1062') {\n $content = array(\n 'isUploaded' => false,\n 'message' => 'Row number (' . ($index + 1) . ') is duplicated title.'\n );\n return $content;\n }\n }\n } else {\n // error handling for invalid row.\n $content = array(\n 'isUploaded' => false,\n 'message' => 'Row number (' . ($index + 1) . ') is invalid format.'\n );\n return $content;\n }\n }\n $content = array(\n 'isUploaded' => true,\n 'message' => 'Uploaded Successfully!'\n );\n return $content;\n }", "public function parse()\n {\n $this->parseCsv->auto($this->content);\n $this->rowsCnt = count($this->parseCsv->data);\n $this->colsCnt = count($this->parseCsv->data[0]);\n\n $result = [];\n $missing = [];\n\n for ($r = 0; $r < $this->rowsCnt; $r++) {\n $rowFields = $this->parseCsv->data[$r];\n $valid = true;\n $skip = in_array($r, $this->skipRows) ? true : false;\n $fields = [];\n\n foreach ($rowFields as $f => $text) {\n $fieldObj = $this->getField($f);\n list($fields[$f], $fieldMissing) = Field::parse($fieldObj, $text);\n\n if (!$skip && $fieldMissing) {\n Helpers::mergeMissing($missing[$fieldObj->getName()], $fieldMissing);\n }\n\n if ($fieldObj && !$fields[$f]['valid']) {\n $valid = false;\n }\n }\n\n $result[] = [\n 'row' => ($r + 1),\n 'valid' => $valid,\n 'skip' => $skip,\n 'fields' => $fields,\n ];\n }\n\n // Remove duplicates and set missing property\n foreach ($missing as $name => $opts) {\n $field = $this->getFieldByName($name);\n $field->setMissing(array_values(array_unique($missing[$name])));\n }\n\n $this->result = $result;\n\n return $this->result;\n }", "static function parse_uploaded_csv(){\n $extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);\n if ($extension != \"csv\"){ //pokud soubor neni csv vrati error\n Utils::return_ERROR(\"Nahraný soubor musí být formátu CSV.\");\n }\n if (($handle = fopen($_FILES['file']['tmp_name'], \"r\")) === FALSE) {\n Utils::return_ERROR(\"Nepodařilo se otevřít soubor\");\n }\n\n //= zahlavi tabulky csv souboru\n $csv_scheme = [\"type\", \"start\", \"end\", \"title\", \"place\", \"gps\", \"meetTime\", \"meetPlace\", \"transport\", \"leader\", \"note\", \"zabicky\", \"pulci1\", \"pulci2\", \"zaci1\", \"zaci2\", \"dorost\", \"accomodation\", \"food\", \"startTime\", \"eventTypeDescription\", \"map\", \"terrain\", \"return\", \"price\", \"program\", \"thingsToTake\", \"signups\", \"doWeOrganize\"];\n $approved = [\"Z\", \"M\", \"T\", \"S\", \"BZL\", \"BBP\", \"TABOR\", \"L\", \"J\"]; //ignoruje poznamky\n\n $num = 0;\n while (($event = fgetcsv($handle)) !== FALSE) {\n if(in_array(trim($event[0]), $approved)){ //parsuje jen spravne zaznamy\n foreach($csv_scheme as $att_index => $attribute){ //prochazi sloupce a uklada do array\n $event_list[$num][$attribute] = array_key_exists($att_index, $event) ? $event[$att_index] : \"\";\n }\n }\n $num += 1;\n }\n\n fclose($handle);\n return $event_list;\n }", "function parse_csv_file($csv_file_name, $delimiter = \",\", $enclosure = '\"', $length = 102400)\r\n{\r\n\t$ar_rows = array();\r\n\r\n\t$handle = fopen($csv_file_name, \"r\");\r\n\r\n\twhile (($data = fgetcsv($handle, $length, $delimiter, $enclosure)) !== false)\r\n\t{\r\n\t\t//PHP-doc: A blank line in a CSV file will be returned as an array comprising a single null field,\r\n\t\t// and will not be treated as an error.\r\n\t\tif ($data == array(''))\r\n\t\t{\r\n\t\t\t// So let we skip empty rows by own hands\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$ar_rows[] = $data;\r\n\t}\r\n\r\n\tfclose($handle);\r\n\r\n\treturn $ar_rows;\r\n}", "private function validateRow($values){\n\t\t$formattedValues = array();\n\n\t\tforeach($this->mandatoryColumns as $index => $mandatory){\n\t\t\tif(!isset($values[$mandatory]) || $values[$mandatory] === false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$formattedValues[$mandatory] = $values[$mandatory];\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($this->optionalColumns as $optional){\n\t\t\tif(!isset($values[$optional])){\n\t\t\t\t$formattedValues[$optional] = '';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$formattedValues[$optional] = $values[$optional];\n\t\t\t}\n\t\t}\n\t\treturn $formattedValues;\n\t}", "function validate_data_indicator37($county_id, $date, $aggregate, $column_date, $column_aggregate, $row){\r\n if($county_id === \"\"){\r\n return \"ERROR: Wrong file format. County id is not defined (row \" . $row . \").\\n\"; //wrong format\r\n }\r\n if($date !== \"\"){\r\n //validate date format\r\n if(!validateDate($date)){\r\n return \"ERROR: Date format is wrong (column \" . $column_date . \", row \" . $row . \"). Must be MM/YYYY.\\n\"; //date format is wrong\r\n }\r\n if(isAggregateEmpty($aggregate)){\r\n return \"ERROR: Aggregate is empty (column \" . $column_aggregate . \", row \" . $row . \").\\n\"; //empty aggregate\r\n }\r\n if(!(validateAggregate($aggregate))){\r\n return \"ERROR: Aggregate must be a positive integer number (columns \" . $column_aggregate . \", row \" . $row . \"). Please correct value.\\n\"; //not number aggregate\r\n }\r\n }else if($aggregate !== \"\"){\r\n return \"ERROR: Date is empty (column \" . $column_date . \", row \" . $row . \").\\n\"; //empty date;\r\n }\r\n return \"\";\r\n}", "protected function isLineValid($line, $index)\n {\n /** index [0] is the title of csv response. */\n return (0 !== $index) && !empty($line);\n }", "private function cleanErrorRow()\n {\n self::$statistics['rows_with_errors'] = array_unique(self::$statistics['rows_with_errors']);\n }", "protected function checkValidPositions()\n {\n $pos = $this->row_start - 1;\n $idx = $idx2 = 0;\n foreach ($this->xml->sheetData->row as $row) {\n while (($pos + 1) < (int) $row['r']) {\n $this->valid_positions[$idx++] = false;\n $pos++;\n }\n\n $this->valid_positions[$idx++] = $idx2++;\n $pos++;\n }\n }", "private function meetsImportRules($array)\n\t{\n\t\t// check item meets the criteria for import \n\t\t// Any stock item which costs less that £5 and has less than 10 stock will not be imported. \n\t\t// Any stock items which cost over £1000 will not be imported.\n\t\t\n\t\tif(isset($array[$this->columnCost]))\n\t\t{\n\t\t\t$productCost = $array[$this->columnCost];\n\t\t\tif($productCost > self::MAX_PRODUCT_COST)\n\n\t\t\t{\n\t\t\t\t$this->makeOutputArray('reason', \"Does not meet criteria for import - item cost: {$productCost} is greater than 1000\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($array[$this->columnStock]) && isset($array[$this->columnCost]))\n\t\t{\n\t\t\t$productStock = $array[$this->columnStock];\n\t\t\t$productCost = $array[$this->columnCost];\n\t\t\tif($productStock < self::MIN_PRODUCT_STOCK && $productCost < self::MIN_STOCK_PRICE)\n\t\t\t{\n\t\t\t\t$this->makeOutputArray('reason', \"Does not meet criteria for import - Item stock: {$productStock} & item cost: {$productCost} (costs < 5 & stock < 10)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function call_center_admin_import_csv_form_validate($form, &$form_state) {\n global $user;\n $user = user_load($user->uid);\n $center_tid = (isset($user->call_center) && is_array($user->call_center) && count($user->call_center) > 0) ? $user->call_center[LANGUAGE_NONE][0]['tid'] : 0;\n if(!$center_tid) form_set_error('csv_file', t('Only call center users can import CSV file.'));\n $validators = array('file_validate_extensions' => array('csv'));\n $file = file_save_upload('csv_file', $validators, FALSE);\n if(!$file){\n form_set_error('csv_file', t('CSV file is required.'));\n }\n}", "abstract protected function validateData();", "private function checkCsvCannotBeCompared()\n {\n return !$this->oldCsvArray\n || !$this->newCsvArray\n || !is_array($this->oldCsvArray[0])\n || !is_array($this->newCsvArray[0])\n || array_diff($this->oldCsvArray[0], $this->newCsvArray[0]);\n }", "private function checkCsvRequirement(array $csvHeader): bool\n {\n\n for($i = 0; $i < count(static::CSV_HEADER); $i++) {\n if (static::CSV_HEADER[$i] !== $csvHeader[$i]) {\n return false;\n }\n }\n\n return true;\n }", "public function isRowValid(array $rowData, $rowNum, $checkRequiredAttributes = true)\n {\n $error = false;\n $rowScope = $this->_entityModel->getRowScope($rowData);\n\n if (Mage_ImportExport_Model_Import_Entity_Product::SCOPE_NULL != $rowScope) {\n foreach ($this->_getProductAttributes($rowData) as $attrCode => $attrParams) {\n // check value for non-empty in the case of required attribute?\n if (isset($rowData[$attrCode]) && strlen($rowData[$attrCode])) {\n $error |= !$this->_entityModel->isAttributeValid($attrCode, $attrParams, $rowData, $rowNum);\n } elseif (\n $this->_isAttributeRequiredCheckNeeded($attrCode)\n && $checkRequiredAttributes\n && Mage_ImportExport_Model_Import_Entity_Product::SCOPE_DEFAULT == $rowScope\n && $attrParams['is_required']\n && is_null($this->_getDefaultValue($attrParams))\n ) {\n $this->_entityModel->addRowError(\n Mage_ImportExport_Model_Import_Entity_Product::ERROR_VALUE_IS_REQUIRED, $rowNum, $attrCode\n );\n $error = true;\n }\n }\n }\n $error |= !$this->_isParticularAttributesValid($rowData, $rowNum);\n\n return !$error;\n }", "function parseToArray($fp, $accountId){\r\n /**\r\n * count Rows of csv\r\n *\r\n * @var int\r\n */\r\n $csvRow = 0;\r\n /**\r\n * is set true, a line contains \";\" , but not the correct number for this parser (5)\r\n *\r\n * @var boolean\r\n */\r\n $noValidFile = NULL;\r\n /**\r\n * is set true, after the header was ignored\r\n *\r\n * @var boolean\r\n */\r\n $headerIgnored = NULL;\r\n //for every line\r\n\r\n /*****\r\n * avoid \" & \\ in the title & description,\r\n * those characters could cause problems\r\n */\r\n function avoid_bad_sign($strings) {\r\n $strings = str_replace(\"\\\"\", \"\", $strings);\r\n $strings = str_replace(\"\\\\\", \"\", $strings);\r\n $strings = str_replace(\"\\n\", \" \",$strings);\r\n return $strings;\r\n }\r\n \r\n while (!feof($fp)) {\r\n\r\n $rowArray = NULL;\r\n \r\n //read one line\r\n $line = fgets($fp, 1024);\r\n\r\n //skip header\r\n if (!$headerIgnored) {\r\n $tmp = strpos($line, HEADER_END_MARKER);\r\n //Need this complex check as the source file is reported to say \"Buchungstag\" and Buchungstag\r\n //(with and without quotes) at random\r\n if ($tmp !== false && $tmp <= 2) {\r\n $headerIgnored = true;\r\n }\r\n continue;\r\n }\r\n\r\n if ( !empty( $line ) && !strpos($line, FOOTER_END_MARKER_A) && !strpos($line, FOOTER_END_MARKER_E)) {\r\n if (substr_count ($line, \";\") == 2 ) {\r\n $description = \"\";\r\n $line1 = 1; //set the first line of dataset\r\n\r\n // divide String to an array\r\n $transactionArray = explode(\";\", $line);\r\n\r\n //format date YY-MM-DD or YYYY-MM-DD\r\n $transactionArray[1] = avoid_bad_sign($transactionArray[1]);\r\n $valutaDate = explode(\".\", $transactionArray[1]); //Valuta Date\r\n $valutaDate[4] = $valutaDate[2] . \"-\" . $valutaDate[1] . \"-\" . $valutaDate[0];\r\n $valutaDate1 = new Date($valutaDate[4]);\r\n\r\n $transactionArray[2] = avoid_bad_sign($transactionArray[2]);\r\n $description .= $transactionArray[2];\r\n\r\n } elseif ($line1 == 1 && !strpos($line,';')){\r\n $transactionArray[3] = avoid_bad_sign($line);\r\n $transactionPartner = $transactionArray[3];\r\n $description .= $transactionArray[3];\r\n ++$line1;\r\n } elseif ($line1 == 2 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 3 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 4 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 5 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 6 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 7 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 8 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 == 9 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n } elseif ($line1 ==10 && !strpos($line,';')){\r\n $description .= avoid_bad_sign($line);\r\n $line1++;\r\n\r\n //if line contains excactly 3 ';', to ensure it is a valid VR-Bank csv file\r\n } elseif (substr_count ($line, \";\")==3){\r\n $line1 = 0;\r\n $transactionArray3 = \"\";\r\n // divide String to an array\r\n $transactionArray3 = explode(\";\", $line);\r\n //avoid \" & \\ in the title & description, those characters could cause problems\r\n $transactionArray3[0] = avoid_bad_sign($transactionArray3[0]);\r\n $description .= $transactionArray3[0];\r\n $transactionArray3[1] = avoid_bad_sign($transactionArray3[1]);\r\n\r\n // inserts the amount\r\n $transactionArray3[2] = avoid_bad_sign($transactionArray3[2]);\r\n $transactionArray3[2] = str_replace(\",\",\".\",$transactionArray3[2]);\r\n\r\n // get the sign for balance: i.e. \"H\" == plus(input); \"S\" == minus(out)\r\n $transactionArray3[3] = str_replace(\"\\\"\",\"\",$transactionArray3[3]);\r\n $transactionArray3[3] = str_replace(\"\\\\\",\"\",$transactionArray3[3]);\r\n\r\n // checks for \"S\" == minus(out) and adds a \"-\"sign\r\n if ($transactionArray3[3] == \"S\\n\") {\r\n $transactionArray3[2] = \"-\".$transactionArray3[2]; //\"-\".\r\n }\r\n }\r\n\r\n /**\r\n * transaction array\r\n *\r\n * @var array\r\n */\r\n if ($line1 == 0) {\r\n $rowArray = array (\r\n \"categoryId\" => \"\",\r\n \"accountId\" => $accountId,\r\n \"title\" => substr($transactionArray[2].$transactionArray[3],0,99),// cut title with more than 100 chars\r\n \"description\" => $description,\r\n \"valutaDate\" => $valutaDate1,\r\n \"amount\" => new Amount($transactionArray3[2]),\r\n \"transactionPartner\" => $transactionPartner\r\n );\r\n }\r\n\r\n // if a row contains valid data\r\n if ($rowArray && $line1 ==0){\r\n /**\r\n * array of all transaction arrays\r\n *\r\n * @var array\r\n */\r\n $importedTransactions[$csvRow] = $rowArray;\r\n $csvRow++;\r\n //print_r ($rowArray);\r\n }\r\n }\r\n }\r\n if ($noValidFile) {\r\n throw new badgerException('importCsv', 'wrongSeperatorNumber');\r\n //close file\r\n fclose ($fp);\r\n } else {\r\n if ($csvRow == 0){\r\n throw new badgerException('importCsv', 'noSeperator');\r\n //close file\r\n fclose ($fp);\r\n } else{\r\n //delete footer (1 line)\r\n unset($importedTransactions[$csvRow-1]);\r\n //close file\r\n fclose ($fp);\r\n return $importedTransactions;\r\n }\r\n }\r\n}", "function sigma_csv_options_validate($input){\n \t\tif(isset($input['process_csv'])){\n $delimiter = isset($input['delimiter']) ? sanitize_text_field($input['delimiter']) : ',';\n $enclosure = isset($input['enclosure']) ? sanitize_text_field($input['enclosure']) : '|';\n $message = $this->csv_to_db(esc_url($input['csv_file']), $delimiter, $enclosure);\n $type = 'updated';\n }\n\n add_settings_error(\n 'sigma',\n esc_attr('settings_updated'),\n __($message),\n $type\n );\n return $input;\n\t}", "function validate_data_indicators_6($county_id, $date, $aggregate1, $aggregate2, $aggregate3, $aggregate4, $column_date, $columns_aggregate, $row){\r\n if($county_id === \"\"){\r\n return \"ERROR: Wrong file format. County id is not defined (row \" . $row . \").\\n\"; //wrong format\r\n }\r\n if($date !== \"\"){\r\n //validate date format\r\n if(!validateDate($date)){\r\n return \"ERROR: Date format is wrong (column \" . $column_date . \", row \" . $row . \"). Must be MM/YYYY.\\n\"; //date format is wrong\r\n }\r\n if(isAggregateEmpty($aggregate1) && isAggregateEmpty($aggregate2) && isAggregateEmpty($aggregate3) && isAggregateEmpty($aggregate4)){\r\n return \"ERROR: All aggregates are empty (columns \" . $columns_aggregate . \", row \" . $row . \"). Please insert values.\\n\"; //empty aggregate\r\n }\r\n if(!(validateAggregate($aggregate1) && validateAggregate($aggregate2) && validateAggregate($aggregate3) && validateAggregate($aggregate4) )){\r\n return \"ERROR: Aggregates must be a positive integer number (columns \" . $columns_aggregate . \", row \" . $row . \"). Please correct value.\\n\"; //not number aggregate\r\n }\r\n }else if($aggregate1 !== \"\" || $aggregate2 !== \"\" || $aggregate3 !== \"\" || $aggregate4 !== \"\"){\r\n return \"ERROR: Date is empty (column \" . $column_date . \", row \" . $row . \").\\n\"; //empty date;\r\n }\r\n return \"\";\r\n}", "public function scanCsvFile(string $csv_filename)\n\t{\n\t\tif (($handle = fopen(\"files/\".$csv_filename, \"r\")) !== false) {\n\n\t\t\t$payments = array();\n\t\t\t$row = 0;\n\n\t\t\t// scan data and put into object\n\t\t while (($data = fgetcsv($handle, 1000, \",\")) !== false) {\n\n\t\t \t$row++;\n\n\t\t \t$date \t\t= (string)$data[0];\n\t\t $user_id\t= (int)$data[1];\n\t\t $user_type\t= (string)$data[2];\n\t\t $operation = (string)$data[3];\n\t\t $amount \t= (float)$data[4];\n\t\t $currency \t= (string)$data[5];\n\n\t\t // creating payment object if currency is correct\n\t\t if ($this->checkCurrency($currency) && \n\t\t \t!empty($date) && \n\t\t \t!empty($user_id) && \n\t\t \t!empty($user_type) && \n\t\t \t!empty($operation) && \n\t\t \t!empty($amount) && \n\t\t \t!empty($currency)\n\t\t ) {\n\n\t\t\t $math = new Math();\n\t\t\t $math->setPayment($date, $user_id, $user_type, $operation, $amount, $currency);\n\t\t\t $payments[] = $math;\n\n\t\t \t} else {\n\n\t \t\techo \" Netinkama valiuta arba trūksta duomenų: eilute - \".$row.\"\\n\";\n\n\t\t \t}\n\n\t\t }\n\n\t\t fclose($handle);\n\n\t\t return $payments;\n\n\t\t} else {\n\n\t\t\techo \"\\n *** Wrong file name! ***\\n\";\n\t\t\texit;\n\n\t\t}\n\t}", "private function isDataValid(CsvProduct $csvProduct): bool\n {\n $errors = $this->validator->validate($csvProduct);\n\n if ($errors->count()) {\n $msg = [];\n /** @var ConstraintViolation $error */\n foreach ($errors as $error) {\n $msg[] = $error->getMessage();\n }\n\n $this->logger->error(sprintf('Row #%s: %s', $this->currentRowNumber, implode(' | ', $msg)));\n $this->summaryDataErrors += $errors->count();\n\n return false;\n }\n\n if (in_array($csvProduct->getSku(), $this->handledSku)) {\n $this->logger->error(\n sprintf(\n 'Row #%s: contains duplicate for the product \"%s\"',\n $this->currentRowNumber,\n $csvProduct->getSku()\n )\n );\n\n $this->summaryDataErrors++;\n\n return false;\n }\n\n return true;\n }", "private function import() {\n\t\t\t\n\t\t\t$csv = $this->_file['tmp_name'];\n\t\t\t\n\t\t\t$header = true;\n\t\t\t$handle = fopen($csv,\"r\");\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t// Stores each csv line to an array\n\t\t\t\t// Check if header line\n\t\t\t\tif ( !$header ) {\n\t\t\t\t\t$i=0;\n\t\t\t\t\t$table = $this->getTable($heads[$i]);\n\t\t\t\t\tfor ($i=0; $i < count($data); $i++) {\n\t\t\t\t\t\t$table = $this->getTable($heads[$i]);\n\t\t\t\t\t\t$field = $heads[$i];\n\t\t\t\t\t\tif ($table != '') {\n\t\t\t\t\t\t\tif ($table == 'users-roles') {\n\t\t\t\t\t\t\t\t$user[$table][$heads[$i]] = $data[$i] != 0 ? $this->getRoleID($heads[$i]) : $data[$i];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$user[$table][$heads[$i]] = $data[$i];\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\tarray_push($this->data, $user);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$heads = $data;\n\t\t\t\t\t$header = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "function validateData() {}", "private function _validate() {\n // loop over all the data\n foreach($this->_data as $key=>$line) {\n $line = trim($line); // get rid of the trailing newline\n \n // see if we are in a hold state\n $this->_checkHold($key);\n \n // if we have an existing pair, we need to check for inconsistency\n // so save this line for the next loop\n if(isset($this->_pairs[$this->_linePrev])) {\n $this->_lineHold = $line;\n continue;\n }\n\n // if we haven't already written this line to the output, do so now\n if(!isset($this->_output[$key])) {\n $this->_output[$key] = $line;\n }\n\n // if this is the first line in the file, we won't have a previous\n if($this->_linePrev) {\n $this->_log($this->_linePrev, $line, true);\n $this->_pairs[$this->_linePrev] = $line;\n }\n\n // save this line for the next loop\n $this->_linePrev = $line;\n }\n\n // we must check the hold one more time, otherwise we\n // might miss an incosistency on the last line\n $this->_checkHold($key);\n }", "function validateFile($conn, $file_name){\n\n //validate the file given is csv\n $csv_mime_types = [ 'text/csv','text/plain','application/csv','text/comma-separated-values',\n 'application/excel','application/vnd.ms-excel','application/vnd.msexcel',\n 'text/anytext','application/octet-stream','application/txt',];\n\n $finfo = finfo_open( FILEINFO_MIME_TYPE );\n $mime_type = @finfo_file( $finfo, $file_name );\n finfo_close($finfo);\n\n if(!in_array($mime_type,$csv_mime_types)){\n exit(\"\\n Please enter a valid csv file \\n\");\n }\n\n if(filesize($file_name) == 0){\n exit(\"\\n Please enter a valid csv file \\n\");\n }\n\n }", "function validate_cell ( $data )\n{\n return preg_match( \"/^[0-9]{10}$/\", $data );\n}", "function import_holidays_csv( $file ) {\n\n require_once WPERP_INCLUDES . '/lib/parsecsv.lib.php';\n\n $csv = new ParseCsv();\n $csv->encoding(null, 'UTF-8');\n $csv->parse($file);\n\n $error_list = array();\n $valid_import = array();\n $line = 1;\n $msg = \"\";\n\n foreach ($csv->data as $data) {\n $title = (isset($data['title'])) ? $data['title'] : '';\n $start = (isset($data['start'])) ? $data['start'] : '';\n $end = (isset($data['end'])) ? $data['end'] : '';\n $description = (isset($data['description'])) ? $data['description'] : '';\n\n if (!empty($title) && !empty($start) && !empty($end)) {\n if (is_string($title) && is_string($start) && is_string($end)) {\n if (strlen($title) < 200) {\n if (DateTime::createFromFormat('Y-m-d H:i:s', $start) !== FALSE &&\n DateTime::createFromFormat('Y-m-d H:i:s', $end) !== FALSE) {\n $holiday_id = erp_hr_leave_insert_holiday(array(\n \"title\" => $title,\n \"start\" => $start,\n \"end\" => $end,\n \"description\" => $description,\n ));\n\n if (is_wp_error($holiday_id)) {\n $error_list[] = $line;\n } else {\n $valid_import[] = $line;\n }\n }\n }\n }\n } else {\n $error_list[] = $line;\n }\n $line++;\n }\n\n if (count($valid_import) > 0) {\n $html_class = \"updated notice\";\n $msg .= sprintf(__(\"Successfully imported %u data<br>\", 'wp-erp'), count($valid_import));\n }\n\n if (count($error_list) > 0) {\n $html_class = \"error notice\";\n $err_string = implode(',', $error_list);\n $msg .= sprintf(__(\"Failed to import line no %s. Please check if title, start & end fields are following proper formation\", 'wp-erp'), $err_string);\n }\n\n return \"<div class='{$html_class}'><p>{$msg}</p></div>\";\n}", "public function testInvalidInputData(int $rowId, array $data): void\n {\n $validator = $this->getValidator();\n $productRow = new Validator\\Product($rowId, $data);\n $errors = $validator->validate($productRow);\n $this->assertEquals(1, $errors->count());\n\n }", "public function testCSVFileDuplicateEmailAddress(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"correctdb\"][\"user\"];\n\t\t$password = $ini_array[\"correctdb\"][\"password\"];\n\t\t$host = $ini_array[\"correctdb\"][\"host\"];\n\t\t$database = $ini_array[\"correctdb\"][\"database\"];\n\t\t$csv = $ini_array[\"csv\"][\"duplicate_email_address\"];\n\n\t\t$db = new mysqli(\n\t\t\t$host,\n\t\t\t$user,\n\t\t\t$password,\n\t\t\t$database\n\t\t);\n\n\t\t// Delete rows of user table\n\t\t$result = $db->query(\"delete from user\"); \n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host --file $csv 2>&1`;\n\n\t\t$this->assertRegExp(\n\t\t\t\"/WARNING: While parsing the line number \\d+, an error occurred: Duplicate entry 'jsmith@gmail.com' for key 'email'. Skipping row.../\",\n\t\t\t$output\t\n\t\t);\n\t}", "function checkCSV($file){\n $allowed_file_extension = array(\n \"csv\"\n );\n \n //get file extension\n $file_extension = pathinfo($file[\"name\"], PATHINFO_EXTENSION);\n\n if (!in_array($file_extension, $allowed_file_extension)) {\n return false;\n }\n\n return true;\n\n}", "public function testCSVFileTooFewColumns(): void {\n\t\t$ini_array = parse_ini_file(\"test.ini\");\n\t\t$user = $ini_array[\"correctdb\"][\"user\"];\n\t\t$password = $ini_array[\"correctdb\"][\"password\"];\n\t\t$host = $ini_array[\"correctdb\"][\"host\"];\n\t\t$database = $ini_array[\"correctdb\"][\"database\"];\n\t\t$csv = $ini_array[\"csv\"][\"too_few_columns\"];\n\n\t\t$db = new mysqli(\n\t\t\t$host,\n\t\t\t$user,\n\t\t\t$password,\n\t\t\t$database\n\t\t);\n\n\t\t// Delete rows of user table\n\t\t$result = $db->query(\"delete from user\"); \n\n\t\t$output = `php src/user_upload.php -u $user -p$password -h$host --file $csv 2>&1`;\n\n\t\t$this->assertRegExp(\n\t\t\t\"/WARNING: While parsing the line number \\d+, there were 2 fields when 3 were expected. Skipping this row.../\",\n\t\t\t$output\t\n\t\t);\n\t}", "public function validateData() {\n $fieldSizes = [\n 'first_name' => 50,\n 'last_name' => 50,\n 'name' => 50,\n 'business_name' => 50,\n 'suburb' => 50,\n 'state' => 50,\n 'postcode' => 50,\n 'phone' => 20,\n 'email' => 50,\n 'country' => 50,\n ];\n foreach ($fieldSizes as $field => $max_length) {\n if (strlen($this->$field) > $max_length) {\n throw new \\Exception('Field ' . $field . ' exceeds max length of ' . $max_length);\n }\n }\n foreach ($this->lines as $address_line) {\n if (strlen($address_line) > 100) {\n throw new \\Exception('Address exceeds max length of 100');\n }\n }\n }" ]
[ "0.67894334", "0.67365545", "0.6445209", "0.6442556", "0.64263666", "0.64256084", "0.6405434", "0.64041716", "0.63949925", "0.63608015", "0.6340718", "0.6300913", "0.6277146", "0.6239186", "0.6226864", "0.6215366", "0.6204216", "0.61729664", "0.61612", "0.61610776", "0.61473286", "0.6141244", "0.6131244", "0.61157644", "0.6101441", "0.6098711", "0.6094877", "0.6091466", "0.60734904", "0.60440177", "0.6022684", "0.5957938", "0.59556645", "0.5942014", "0.59268844", "0.588928", "0.58516574", "0.5822637", "0.5817596", "0.5808365", "0.5803842", "0.5802912", "0.5774922", "0.57481354", "0.5721582", "0.5719907", "0.5705411", "0.5705169", "0.5688059", "0.5684446", "0.56781", "0.5647204", "0.56457657", "0.56327933", "0.56220365", "0.56173027", "0.56125593", "0.5609651", "0.56024116", "0.5589726", "0.5585265", "0.55694366", "0.5553647", "0.5548973", "0.5538461", "0.55364573", "0.55322295", "0.5526662", "0.551912", "0.55163556", "0.5513895", "0.5510536", "0.55087376", "0.5496599", "0.54909784", "0.5486222", "0.54834354", "0.54728675", "0.54566044", "0.5451765", "0.54482144", "0.54443014", "0.54370236", "0.5431453", "0.5427897", "0.5422204", "0.54178613", "0.54148686", "0.5411889", "0.5408734", "0.54076105", "0.5396399", "0.5396166", "0.53914934", "0.5390871", "0.53843254", "0.5377519", "0.5366666", "0.53642267", "0.5360235" ]
0.7050333
0
get path to settings file
получить путь к файлу настроек
static function getSetting_path(){ return Zend_Registry::get('config')->configs->localConfigPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function fileLocation()\n\t{\n\n\t\treturn sprintf('%s' . DIRECTORY_SEPARATOR . 'data/config' . DIRECTORY_SEPARATOR . 'settings.json', $_SERVER['DOCUMENT_ROOT'] );\n\t}", "public function getConfigFilePath();", "public function getConfigFilePath();", "private function getFilePath()\n {\n\n return Settings::getSetting('mailer_template_location');\n }", "protected function getConfigFilePath()\n {\n return realpath(__DIR__ . '/../../../storage/config.php');\n }", "public function getPath () {\n\treturn 'config.php';\n }", "public function getConfigFilePath()\n {\n return $this->getPathOfAlias($this->getComponent()->getAlias(), \n PathTypes::CONFIG_FILE);\n }", "protected function get_file_name(): string {\n\t\t\treturn 'settings';\n\t\t}", "public function getConfigPath(){\r\n\t\treturn $this->strConfigPath;\r\n\t}", "protected function getConfigPath()\n {\n return config_path('forrest.php');\n }", "public static function getSetting() {\n $file = json_decode(file_get_contents('settings.json'));\n return $file;\n }", "function getConfigPath() {\n\t\treturn $this->getName();\n\t}", "public static function getConfigPath()\r\n {\r\n return self::$app->config['PATH'];\r\n }", "protected function getConfigPath()\n {\n return config_path('constant.php');\n }", "protected function getConfigPath()\n\t{\n\t\treturn SYSPATH.'user/config';\n\t}", "public function getConfigFilepath()\n {\n return $this->_configFilepath;\n }", "protected function getConfigPath(): string\n {\n return app()->configPath('wlvpn.php');\n }", "protected function getConfigPath()\n {\n return config_path('reporter.php');\n }", "public function getDefaultPath()\n {\n return 'clastic_site_settings';\n }", "public function getPath(){\n\t\t\treturn realpath($this->config['path']);\n\t\t}", "private function pathToConfig(): string\n {\n return $this->rootDir . DIRECTORY_SEPARATOR . $this->configDirName;\n }", "public static function getConfigPath() {\n\t\treturn self::getRootPath().'/config';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getContextSpecificPluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getInstallSitePluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getInstallSitePluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "function getInstallSitePluginSettingsFile() {\n\t\treturn $this->getPluginPath() . '/settings.xml';\n\t}", "protected function getConfigPath()\n {\n return config_path('tencent-ai.php');\n }", "protected function getConfigSyncPath() {\n /** @var \\Drupal\\Core\\Site\\Settings $settings */\n $settings = \\Drupal::service('settings');\n return $settings->get('config_sync_directory');\n }", "protected function getConfigPath(): string\n {\n return 'CreativeNotes/Infrastructure/Configuration/Test';\n }", "protected function getConfigPath()\n {\n return config_path('customableauth.php');\n }", "private function getConfigFile()\n {\n $setting_file = $this->settings_config_file;\n\n if (empty($setting_file) || !is_string($setting_file)) {\n wp_die('Settings configuration file was not set.');\n }\n\n $loader = new \\RundizOauth\\App\\Libraries\\Loader();\n return $loader->loadConfig($setting_file);\n }", "private function getConfigPath(): string\n {\n return __DIR__ . '/../config/secure-headers.php';\n }", "protected function getConfigPath()\n {\n return realpath(__DIR__.'/../config/jsroute.php');\n }", "public function getConfigPath() {\n\t\treturn __DIR__ . '/config/module.ini';\n\t}", "public function getConfigPath() {\n\t\treturn __DIR__ . '/config/module.ini';\n\t}", "protected function getFullConfigPath()\n {\n return getcwd().DIRECTORY_SEPARATOR.$this->configFile;\n }", "protected function getLoggingFilePath()\n {\n return $this->getSettingsArray()['log_file_path'];\n }", "public function get_config_path() {\n\t\t$config_path = ABSPATH . 'wp-config.php';\n\n\t\tif ( ! file_exists( $config_path ) ) {\n\t\t\tif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {\n\t\t\t\t$config_path = dirname( ABSPATH ) . '/wp-config.php';\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter the config file path.\n\t\t *\n\t\t * @since 2.3.0\n\t\t *\n\t\t * @param string $config_path\n\t\t */\n\t\treturn apply_filters( 'wp_debugging_config_path', $config_path );\n\t}", "public function getConfigPath(): string\n {\n return $this->getBasePath() . '/' . $this->convention->configFolder();\n }", "public static function getApplicationConfigFilePath() {\n\t\treturn self::$application_config_file_path;\n\t}", "abstract protected function getConfigPath();", "function config_path(?string $file = null): string\n {\n if ($file) return __DIR__ . \"/../../Config/$file\";\n\n return __DIR__ . \"/../../Config/\";\n }", "public function getConfigFilePath()\n {\n $path = null;\n $locator = $this->config->getLocator();\n\n if (is_array($this->file)) {\n $res = null;\n foreach ($this->file as $file) {\n if (($res = $locator->locate($file)) !== false) {\n break;\n }\n }\n $path = $res->getPath();\n } else {\n $path = $locator->locate($this->file)->getPath();\n }\n\n return $path;\n }", "protected abstract function getConfigPath();", "protected function configPath()\n {\n return __DIR__ . '/../../config/oas.php';\n }", "public function getConfigPath()\n {\n return base_path('config' . DIRECTORY_SEPARATOR . 'sms.php');\n }", "public function getSitePath()\n {\n return $this->_config[\"site_path\"];\n }", "public function getSettings()\n {\n if ($this->configFileHandler->getSettingsFromFile('./config/settings.php')) {\n require './config/settings.php';\n\n return $settings;\n }\n }", "protected function getConfigurationFile() {\n\n\t\t$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['pt_piwik']);\n\n\t\t$filePathConfiguration = $extConf['configFilePath'];\n\n\t\t$filePath = GeneralUtility::getFileAbsFileName($filePathConfiguration);\n\n\t\t$this->createFileIfNotExitsts($filePath);\n\n\t\treturn $filePath;\n\n\t}", "public function getPhpIniConfigPath()\n {\n return get_cfg_var('cfg_file_path');\n }", "public function getPhpIniConfigPath()\n {\n return get_cfg_var('cfg_file_path');\n }", "protected function buildConfigPath()\r\n {\r\n return __DIR__ . self::CONFIG_DIR . $this->getName() . self::CONFIG_FORMAT;\r\n }", "private function getFilePath()\n {\n $config = Kohana::$config->load('upload');\n\n return $config[$this->type]['path'] . $this->filename;\n }", "public function getPhpIniPath()\n {\n return get_cfg_var('cfg_file_path');\n }", "protected static function getDbSettings() { return \"DAL/db_localsettings.php\"; }", "protected function packageConfigFilePath()\n {\n return $this->packageBasePath('config'.DIRECTORY_SEPARATOR.$this->packageConfigFilename());\n }", "protected function getConfigPath()\n\t{\n\t\t$path = explode(\"/\", config('kifegen.' . $this->type . '_path'));\n\t\tunset( $path[0] );\n\n\t\treturn implode(\"/\", $path);\n\t}", "public function getSettings() {\n\t\treturn $this->setup['settings.'];\n\t}", "protected function configurationFile()\n {\n return is_local_envorioment() ? base_path('resources/stubs/webserver') : '/etc/nginx/sites-availables/default';\n }", "protected function configPath()\n {\n return __DIR__ . '/../../config/api-core.php';\n }", "public function getPath()\n\t{\n\t\tif (!isset($this->file->save_path)) {\n\t\t\tthrow new ConfigurationException(\"'save_path' is not set in config file\");\n\t\t}\n\n\t\treturn rtrim($this->file->save_path,\"/\");\n\t}", "public function getConfigFilePath()\n {\n return $this->getProjectRootDir() . '/composer.json';\n }", "public function getConfigFileName();", "public function acf_settings_path( $path ) {\n return plugin_dir_url( realpath( __FILE__ ) ) . 'includes/acf/';\n }", "public static function getConfigurationFile() {\n\t\treturn self::$configurationFile;\n\t}", "public function configPath()\n {\n return $this->basePath.DS.'config';\n }", "function get_ini_path() {\n if ($path = get_cfg_var('cfg_file_path')) {\n return $path;\n }\n return 'WARNING: не используется файл php.ini';\n}", "public function downFilePath()\n {\n return $this->config('file_path');\n }", "public function getLocalConfigurationFileLocation() {}", "protected function getDefaultConfigPath()\n {\n return getcwd() . '/soko.yml';\n }", "public function configPath()\n {\n return $this->basePath() . DIRECTORY_SEPARATOR . 'config';\n }", "function getSettings(){\n\n $settingsFile = fopen(realpath(dirname(__FILE__)).'/'.Constants::CONST_CONFIG_FOLDER.'/settings.json', 'r') or die(\"Unable to open file!\");\n $settings = fread($settingsFile,filesize(realpath(dirname(__FILE__)).'/'.Constants::CONST_CONFIG_FOLDER.'/settings.json'));\n fclose($settingsFile);\n\n $settingsDecode = json_decode($settings);\n $settingsDecode -> server = $this -> getChanURI();\n\n return $settingsDecode;\n\n }", "public static function GetSystemConfigPath () {\n\t\treturn static::$systemConfigPath;\n\t}", "function get_ini_path()\n{\n if ($path = get_cfg_var('cfg_file_path'))\n {\n return $path;\n }\n\n return 'WARNING: not using a php.ini file';\n}", "public function getConfigPath($file)\n {\n return $this->getPath('config/' . $file);\n }", "public static function getCaptchaConfigDefaultsFilePath()\n {\n return __DIR__ . '/CaptchaConfigDefaults.php';\n }", "public static function getCaptchaConfigDefaultsFilePath()\n {\n return __DIR__ . '/CaptchaConfigDefaults.php';\n }", "protected function getPath()\n {\n return public_path(config('core.theme.general.themeDir')) . DIRECTORY_SEPARATOR . setting('theme') . '/widgets/' . $this->getWidget();\n }", "public function getModuleConfigPath()\n {\n return $this->_module_config_path;\n }", "protected function getSettings() {\n $settingsfile = $_SERVER['HOME'] . '/.twilightsparkle.yml';\n\n if (!file_exists($settingsfile)) {\n $this->taskFilesystemStack()\n ->touch($settingsfile)\n ->run();\n }\n return Yaml::parseFile($settingsfile);\n }", "public function path(): string\n {\n return VALET_HOME_PATH.'/config.json';\n }", "protected function _getConfigFilePathGlob()\n {\n return 'etc/fieldset.xml';\n }", "protected function getConfigPath(): string\n {\n return config_path('elastic-apm-laravel.php');\n }", "protected function getCoreConfigFilePath(): string\n {\n return __APP_DIR__ . '/resources/core_config.yml';\n }", "public static function getConfigPath(): string\n {\n return __DIR__ . '/../config/back-to-front.php';\n }", "public function getConfFile()\n {\n return $this->confFile;\n }", "public function getConfigurationPath()\n {\n return $this->getApplicationPath().'/config/packages/anahkiasen/rocketeer';\n }", "public static function getSettingsNamespace(): string {}", "public function path()\n\t{\n\t\t$themeDir = $this->config->get('theme::themeDir');\n\n\t\treturn $themeDir.'/'.$this->theme;\n\t}", "protected function getConfigurationFile()\n {\n return sprintf('%s/ce/2.3.x/conf/product/add-update-operation/configuration.json', $this->getFilesDir());\n }", "public function getCachedConfigPath(): string\n {\n return $this->cachePath('config.php');\n }", "public function getConfigFolder(){\n\t\treturn $this->getResourceFolder() . '/config';\n\t}", "function config_path($path = '')\n {\n return app()->configPath($path);\n }", "function config_path($path = '')\n {\n return app()->configPath($path);\n }", "function ctp_get_path( $path ) {\n\n return ctp_get_setting('path') . $path;\n\n}" ]
[ "0.77190644", "0.7390578", "0.7390578", "0.7279301", "0.71949947", "0.71820873", "0.7181507", "0.717092", "0.71546125", "0.7104957", "0.71013695", "0.70533025", "0.70501876", "0.7011686", "0.700069", "0.69946885", "0.6976611", "0.6969799", "0.69653624", "0.69650996", "0.6924492", "0.6915806", "0.6905549", "0.6905549", "0.6905549", "0.6905549", "0.6905549", "0.6905549", "0.6891466", "0.6891466", "0.6891466", "0.68849516", "0.6863586", "0.6862057", "0.68445504", "0.68138784", "0.6808761", "0.68037003", "0.6786986", "0.6786986", "0.678582", "0.6776575", "0.67553025", "0.6751958", "0.6748362", "0.67430997", "0.6733017", "0.67310894", "0.6728028", "0.67145485", "0.6705422", "0.66980743", "0.6689818", "0.66667956", "0.6664485", "0.6664485", "0.6664127", "0.6657208", "0.6653367", "0.66494375", "0.6643535", "0.66136616", "0.66003156", "0.6600079", "0.6579419", "0.65618926", "0.65593845", "0.6556521", "0.6553599", "0.6552875", "0.6538361", "0.65378535", "0.6522177", "0.6519503", "0.65114236", "0.6503446", "0.65010196", "0.6480054", "0.6476646", "0.64723533", "0.646053", "0.646053", "0.6457053", "0.6444567", "0.6441411", "0.6438751", "0.6436537", "0.64360136", "0.64316404", "0.64282715", "0.64146143", "0.6409263", "0.6408283", "0.64024323", "0.64013207", "0.63948566", "0.63939065", "0.63935673", "0.63935673", "0.6390042" ]
0.79771936
0
get guest's settings guestEmailAddress, displaySellerInfo
получить настройки гостя guestEmailAddress, отобразить информацию о продавце
static function getSettings_guest() { //дізнаємось конфігурацію файла $configs = self::getSettings_config(); return $configs->guest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdvertiseEmail()\n {\n return Mage::getStoreConfig(self::ADVERTISE_EMAIL);\n }", "public function getEmailDetails()\n {\n //try to read from Configure First\n $results = Configure::read(\"SettingsGrouped.email_server\");\n if ($results) {\n $results['email_password'] = Security::decrypt64($results['email_password']);\n return $results;\n }\n\n //fall back to read from DB\n $results = $this->find('list', ['keyField' => 'property_key', 'valueField' => 'property_value'])\n ->where(['property_group' => 'email_server'])\n ->toArray();\n $results['email_password'] = Security::decrypt64($results['email_password']);\n return $results;\n }", "protected static function getEmailSettings() {\n\t\t$menuitemid = JRequest::getInt('Itemid');\n\t\tif ($menuitemid)\n\t\t{\n\t\t\t$menu = JFactory::getApplication()->getMenu();\n\t\t\t$menuparams = $menu->getParams($menuitemid);\n\t\t\t//echo __FILE__.' ('.__LINE__.')<pre>';print_r($menuparams); echo'</pre>';\n\t\t\t$emailSettings = $menuparams->get('email');\n\t\t\t//echo __FILE__.' ('.__LINE__.')<pre>';print_r($email_menu); echo'</pre>';\n\t\t}\n\t\tif ($emailSettings === 'component' || $emailSettings === null) {\n\t\t\t// SETTINGS FROM COMPONENT\n\t\t\t$params = JComponentHelper::getParams( 'com_hbteam' );\n\t\t\t//echo __FILE__.' ('.__LINE__.')<pre>';print_r($params); echo'</pre>';\n\t\t\t$emailSettings = $params->get( 'email' );\n\t\t\t//echo __FILE__.' ('.__LINE__.')<pre>';print_r($email_com); echo'</pre>';\n\t\t}\n\t\treturn $emailSettings;\n\t}", "public static function getGuestId(){\n return config('guest_id',static::$GUEST_ID);\n }", "public function get_admin_email_and_name()\n\t{\n\t\t$this->load->model('option_model');\n\t\t$values = $this->option_model->getvalues('webadmin_email');\n\n\t\tif(count($values))\n\t\t{\n\t\t\t$data['admin_email'] = (isset($values->webadmin_email))?$values->webadmin_email:'admin@'.$_SERVER['HTTP_HOST'];\n\t\t\t$data['admin_name'] = (isset($values->webadmin_name))?$values->webadmin_name:'Admin';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['admin_email'] = 'admin@'.$_SERVER['HTTP_HOST'];\n\t\t\t$data['admin_name'] = 'Admin';\t\t\n\t\t}\n\n\t\treturn $data;\n\t}", "public static function getSettings() {\n $owner = ['select_all' => true, 'actions' => true, 'create' => true, 'actions_width' => '90px'];\n $reseller = $owner;\n $user = $owner;\n\n return [\n 1 => $owner,\n 2 => $reseller,\n 3 => $user\n ];\n }", "public static function getSettings() {\n $owner = ['select_all' => true, 'actions' => true, 'create' => true, 'actions_width' => '90px'];\n $reseller = $owner;\n $user = $owner;\n\n return [\n 1 => $owner,\n 2 => $reseller,\n 3 => $user\n ];\n }", "public function getSiteDetails()\n {\n $siteDetails = array();\n\n try\n {\n $siteDetails[\"adminEmail\"] = Mage::getStoreConfig('trans_email/ident_general/email');\n $siteDetails[\"adminName\"] = Mage::getStoreConfig('trans_email/ident_general/name');\n $siteDetails[\"salesEmail\"] = Mage::getStoreConfig('trans_email/ident_sales/email');\n $siteDetails[\"salesName\"] = Mage::getStoreConfig('trans_email/ident_sales/name');\n $siteDetails[\"secureUrl\"] = Mage::getStoreConfig('web/secure/base_url');\n $siteDetails[\"unsecureUrl\"] = Mage::getStoreConfig('web/unsecure/base_url');\n $siteDetails[\"baseCurrency\"] = Mage::getStoreConfig('currency/options/base');\n $siteDetails[\"defaultCurrency\"] = Mage::getStoreConfig('currency/options/default');\n $siteDetails[\"allowCurrency\"] = Mage::getStoreConfig('currency/options/allow');\n $siteDetails[\"timezone\"] = Mage::getStoreConfig('general/locale/timezone');\n $siteDetails[\"defaultCountry\"] = Mage::getStoreConfig('general/country/default');\n $siteDetails[\"installedCurrency\"] = Mage::getStoreConfig('system/currency/installed');\n \n }\n catch(Exception $e)\n {}\n\n return $siteDetails;\n }", "public function getSettings()\r\n {\r\n $settings = array();\r\n $helper = Mage::helper('promopopup');\r\n $settings['url'] = $this->getUrl('promopopup/index/index');\r\n $settings['wait_before'] = $helper->getStoreConfig(DMS_PromoPopup_Helper_Data::XML_CONFIG_WAIT_BEFORE);\r\n $settings['close_after'] = $helper->getStoreConfig(DMS_PromoPopup_Helper_Data::XML_CONFIG_CLOSE_AFTER);\r\n $settings['cookie_name'] = Mage::helper('promopopup')->getPromoCookieName();\r\n return $settings;\r\n }", "public function get_info()\n\t{\n\t\treturn array(\n\t\t\t'name' => 'User Emailer',\n\t\t\t'code' => 'user_emailer',\n\t\t\t'description' => 'Sends an email to the user visiting the site'\n\t\t);\n\t}", "public function get_email_settings(){\r\n\t\treturn array(\r\n\t\t\t\t'subject' => $this->get_option(\"subject\"),\r\n\t\t\t\t'email_template' => $this->get_option(\"email_template\")\r\n\t\t\t);\r\n\t}", "public function guest()\n {\n return $this->get('guest', true);\n }", "protected function getApplicationConfig(){\n\n $adminEmail=Mage::getStoreConfig('customerservice_options/admin_configuration/admin_vline_id');\n\n $customerEmail='wcg1b6hbtvm19ju2';\n\n\n $adminFeatures=array('video','audio','text','person-selector');\n\n $configuredFeatures=$this->getFeaturesVisible();\n\n if(stripos($configuredFeatures,',') !== false){\n\n $customerFeatures= explode(',',$configuredFeatures);\n }else{\n $customerFeatures=array($configuredFeatures);\n }\n\n\n $applicationConfig['serviceId']=Mage::getStoreConfig('customerservice_options/api_configuration/service_id');\n\n if(Mage::getDesign()->getArea() == 'adminhtml' || Mage::app()->getStore()->isAdmin()){\n\n $applicationConfig['localEmail']= $adminEmail;\n $applicationConfig['remoteEmail']= $customerEmail;\n $applicationConfig['viewType']='adminhtml';\n $applicationConfig['defaultPerson']='';\n $applicationConfig['featuresVisible']=$adminFeatures;\n\n }else{\n\n $applicationConfig['localEmail']= $customerEmail;\n $applicationConfig['remoteEmail']= $adminEmail;\n $applicationConfig['viewType']='frontend';\n //Default person id should come from admin configuration.\n $applicationConfig['defaultPerson']=$adminEmail;\n $applicationConfig['featuresVisible']=$customerFeatures;\n\n }\n\n return $applicationConfig;\n }", "public function getAdditionalInformation( )\n {\n $orgesabAdminEmail = 'Admin'\n . ': '\n . $this->orgesab_orgesabAdminEmail\n ;\n return $orgesabAdminEmail;\n }", "public function getsettingsData()\r\n\t{\r\n\t\t$results = $this->query(\"SELECT * FROM settings\");\t\t\t\r\n\t\tif(!defined('SITEURL')){define(\"SITEURL\",stripslashes($results[0]['site_url']));}\r\n\t\tif(!defined('ADMINMAIL')){define(\"ADMINMAIL\",stripslashes($results[0]['admin_email']));}\r\n\t\tif(!defined('RECORDPERPAGE')){define(\"RECORDPERPAGE\",stripslashes($results[0]['results']));}\r\n\t}", "public function get_settings()\n {\n }", "public function get_settings()\n {\n }", "public static function getGuest()\n\t{\n\t\tstatic $GUEST;\n\t\tif (!isset($GUEST))\n\t\t{\n\t\t\t$GUEST = new GWF_User(array(\n\t\t\t\t'user_id' => '0',\n\t\t\t\t'user_options' => 0,#GWF_User::IS_GUEST|$bot,\n\t\t\t\t'user_name' => GWF_HTML::lang('guest'),\n\t\t\t\t'user_password' => '',\n\t\t\t\t'user_regdate' => '',\n\t\t\t\t'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT),\n\t\t\t\t'user_email' => '',\n\t\t\t\t'user_gender' => GWF_User::NO_GENDER,\n\t\t\t\t'user_lastlogin' => '0',\n\t\t\t\t'user_lastactivity' => time(),\n\t\t\t\t'user_birthdate' => '',\n\t\t\t\t'user_avatar_v' => '0',\n\t\t\t\t'user_countryid' => '0',\n\t\t\t\t'user_langid' => '0',\n\t\t\t\t'user_langid2' => '0',\n\t\t\t\t'user_level' => '0',\n\t\t\t\t'user_title' => '',\n\t\t\t\t'user_settings' => '',\n\t\t\t\t'user_data' => '',\n\t\t\t\t'user_credits' => '0.00',\n\t\t\t));\n\t\t}\n\t\treturn $GUEST;\n\t}", "public static function get_settings()\n {\n }", "private function _getShopInfoAddress()\n {\n $oShop = oxRegistry::getConfig()->getActiveShop();\n\n return $oShop->oxshops__oxinfoemail->value;\n }", "function getTenantConfig() ;", "public function getEmailSettings()\n {\n return $this->db->select('*')->from('email_settings')->WHERE('id', 1)->get()->row();\n }", "static function guest() {\n return model_cache::get(\"user\", 1);\n }", "public function getGatewaySettings()\n\t{\n\t\tglobal $txt;\n\n\t\treturn array(\n\t\t\tarray('text', '2co_id', 'subtext' => $txt['2co_id_desc']),\n\t\t\tarray('text', '2co_password', 'subtext' => $txt['2co_password_desc']),\n\t\t);\n\t}", "function emailSetting() {\r\n $ci = & get_instance();\r\n $user = $ci->session->userdata('user');\r\n $userId = $user['UserID'];\r\n $ci->load->model('accountant/Settings');\r\n $response = $ci->Settings->getEmailSignature($user['UserID']);\r\n return $response;\r\n }", "function wps_get_settings() {\n\n $settings = array(\n 'wps_api_key' => WP_SHOPIFY_API_KEY,\n 'wps_shared_secret' => WP_SHOPIFY_SHARED_SECRET,\n 'wps_scopes' => WP_SHOPIFY_SCOPES,\n 'wps_redirect' => WP_SHOPIFY_REDIRECT\n );\n\n\treturn $settings;\n\n}", "public function getAdditionalDetails()\n {\n if (empty($this->getConfigData('mailing_address'))) {\n return [];\n }\n\n return [\n 'title' => trans('admin::app.admin.system.mailing-address'),\n 'value' => $this->getConfigData('mailing_address'),\n ];\n }", "function getAWSGeneralSettings() {\n\t$db = getDBConnection();\n\t\n\ttry {\n\t\t$result = $db->query(sprintf(\"select * from martini_general_aws_config\"));\t\n\t\t\n\t\tif ($result->rowCount() != '0') {\n\t\t\tforeach ($result as $row) {\n\t\t\t\t$provider = new stdClass();\n\t\t\t\t$provider->region = $row['region'];\n\t\t\t\t$provider->accesskey = $row['accesskey'];\n\t\t\t\t$provider->secretkey = $row['secretkey'];\n\t\t\t}\n\t\t\t\n\t\t\treturn $provider;\n\t\t}\n\t} catch (PDOException $ex) {\n\t\tprint \"Got error\";\n\t\tprint var_dump($ex);\n\t}\n}", "public function get_settings($gateway)\n {\n }", "public function get_settings($gateway)\n {\n }", "public function getCustomerApprovalAdminEmail()\n {\n $config = Mage::getStoreConfig(self::CUSTOMER_APPROVAL_ADMIN_EMAIL, $this->getStoreId());\n return $config;\n }", "public static function getSiteDetails() {\n $getSiteDetails = SiteSettings::where('id',1)->select('contact_email','contact_number','contact_address','city','state','country','fb_url','twitter_url','linkedin_url','googleplus_url', 'copy_right_text','skype_id')->first();\n return $getSiteDetails;\n }", "public function get_settings()\n {\n }", "protected function get_settings_for_inventory_section()\n {\n }", "public static function getGlobalShowSettings()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('params');\n\t\t$query->from($db->qn('#__extensions'));\n\t\t$query->where('name = '.$db->q('com_contact'));\n\t\t$db->setQuery($query);\n\t\t$contactSettings = $db->loadObject();\n\t\t$par = $contactSettings->params;\n\t\t$globalParams = new JRegistry;\n\t\t$globalParams->loadString($par);\n\t\t//echo __FUNCTION__.':<pre>';print_r($globalParams);echo'</pre>';\n\t\t$items = array('email','mobile','telephone');\n\t\t$global_show = null;\n\t\tforeach ($items as $value){\n\t\t\t$global_show[$value] = $globalParams->get('show_'.$value);\n\t\t}\n\t\t//echo __FUNCTION__.':<pre>';print_r($global_show);echo'</pre>';\n\t\treturn $global_show;\n\t}", "public function email($guest=false)\r\n {\r\n $email = $this->email;\r\n \r\n if ($guest && $this->guest && !empty($this->guest_email)) \r\n {\r\n $email = $this->guest_email;\r\n }\r\n \r\n return $email;\r\n }", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "public function getSettings();", "abstract protected function getRequiredUserConfig();", "function getRecipientProperties($store = null)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t\n\t\t\t$properties = array();\n\t\t\t$properties[\"entryid\"] = PR_ENTRYID;\n\t\t\t$properties[\"display_name\"] = PR_DISPLAY_NAME;\n\t\t\t$properties[\"email_address\"] = PR_EMAIL_ADDRESS;\n\t\t\t$properties[\"recipient_flags\"] = PR_RECIPIENT_FLAGS;\n\t\t\t$properties[\"type\"] = PR_RECIPIENT_TYPE;\n\t\t\t$properties[\"recipient_attendees\"] =PR_RECIPIENT_FLAGS;\n\t\t\t$properties[\"recipient_status\"] = PR_RECIPIENT_TRACKSTATUS;\n\t\t\t$properties[\"recipient_status_num\"] = PR_RECIPIENT_TRACKSTATUS_TIME;\n\t\t\t$properties[\"objecttype\"] = PR_OBJECT_TYPE;\n\n\t\t\treturn getPropIdsFromStrings($store !== null ? $store : $this->store, $properties);\n\t\t}", "public static function getEmailSettings()\n {\n return [\n Setting::MAIL_BOOKING_REMINDER => \\Yii::t('user.settings.mail.reservation_start',\n 'Am about to start a reservation.'),\n Setting::MESSAGE_UPDATE => \\Yii::t('user.settings.mail.receive_message_from_kidup_user',\n 'I receive a message from another person on KidUp.'),\n Setting::BOOKING_STATUS_CHANGE => \\Yii::t('user.settings.mail.reservation_status_changes',\n 'My outstanding booking request is accepted or declined.'),\n Setting::NEWSLETTER => \\Yii::t('user.settings.mail.kidup_newsletter_promo',\n 'Kidup wants to share some exciting news or updates.'),\n ];\n }", "static function getSettings_user()\n {\n //дізнаємось конфігурацію файла\n $configs = self::getSettings_config();\n return $configs->user;\n }", "public function get_settings() {\r\n\t\tif ( $this->is_detail_page() ) {\r\n\t\t\t$feed = $this->get_current_feed();\r\n\t\t}\r\n\r\n\t\treturn ! empty( $feed['meta'] ) ? $feed['meta'] : $this->get_plugin_settings();\r\n\t}", "protected function _retrievePickupAddr()\n {\n return $this->_oMageSession->getPostmatesPickupAddr();\n }", "private function getSettings() {\n\t\treturn array(\t\t\t\t\n\t\t\t\t\t'datasource' => $this->_datasource,\n\t\t\t\t\t'itemsperpage' => $this->_itemsperpage,\n\t\t\t\t\t'currentpage' => $this->_currentpage,\n\t\t\t\t\t'filters' => $this->_filters,\n\t\t\t\t\t'pagemumlinkformat' => $this->_pagemumlinkformat,\n\t\t\t\t\t'templates' => array(\n\t\t\t\t\t\t'page' => $this->_templates['main'],\n\t\t\t\t\t\t'page_item' => $this->_templates['item'],\n\t\t\t\t\t\t'page_numerations' => $this->_templates['numeration'],\n 'pageNumberHolder' => $this->_templates['pageNumberHolder'],\n 'pageNumber' => $this->_templates['pageNumber'],\n 'pageNumberSel' => $this->_templates['pageNumberSel']\n\t\t\t\t\t),\n 'baseurl' => $this->_baseurl,\n 'pageparam' => $this->_pageparam\n\t\t);\n\t}", "function getCartsettings()\r\n\t{\r\n\t\t$sqlSettings = \"SELECT * FROM e_settings WHERE Visible='Yes'\";\r\n\t\treturn $this->query($sqlSettings, 1);\r\n\t}", "public function partnerDetails()\n {\n return [\n \"partner_id\" => \"TP27136431\",\n \"access_key\" => \"nCRzGYxi1wdfqyBA2nQvAKq8SqUxP3\",\n \"email\" => \"test@ralmuof.com\",\n \"tenant_id\" => \"EKEDP\"\n ];\n }", "public function partnerDetails()\n {\n return [\n \"partner_id\" => \"TP27136431\",\n \"access_key\" => \"nCRzGYxi1wdfqyBA2nQvAKq8SqUxP3\",\n \"email\" => \"test@ralmuof.com\",\n \"tenant_id\" => \"EKEDP\"\n ];\n }", "public function getDeliveryEmailAddress();", "function dotgo_reseller_settings() {\r\n\r\n $keyword = _dotgo_designator();\r\n\r\n $describeSubaccounts = _dotgo_api_call($query = array(\r\n 'method' => 'describeSubaccounts',\r\n 'limit' => 1\r\n ));\r\n if ($describeSubaccounts['result_attr']['success'] == 1) {\r\n if (!$describeSubaccounts['result']['subaccounts']['item']) {\r\n $createSubaccount = _dotgo_api_call($query = array(\r\n 'method' => 'createSubaccount',\r\n 'subaccount' => $keyword\r\n ));\r\n }\r\n }\r\n\r\n $describeURLs = _dotgo_api_call($query = array(\r\n 'method' => 'describeURLs',\r\n 'limit' => 10,\r\n 'subaccounts' => \"*\"\r\n ));\r\n if ($describeURLs['result_attr']['success'] == 1) {\r\n if (empty($describeURLs['result']['urls'])) {\r\n $addURL = _dotgo_api_call($query = array(\r\n 'method' => 'addURL',\r\n 'subaccount' => $keyword\r\n ));\r\n $reloadURL = _dotgo_api_call($query = array(\r\n 'method' => 'reloadURL',\r\n 'subaccount' => $keyword\r\n ));\r\n }\r\n else {\r\n $dotgo_account = $describeURLs['result']['urls']['item']['urlKey'];\r\n variable_set('dotgo_account', $dotgo_account);\r\n }\r\n }\r\n\r\n $describeService = _dotgo_api_call($query = array('method' => 'describeServices'));\r\n if ($describeService['result_attr']['success'] == 1) {\r\n if ($describeService['result']['services']['item']) {\r\n $service_level = variable_set('dotgo_message_service_level', $describeService['result']['services']['item']['serviceLevel']);\r\n $coupon = variable_set('dotgo_message_coupon', $describeService['result']['services']['item']['coupon']);\r\n $remaining = $describeService['result']['services']['item']['details']['creditsRemaining'];\r\n $total = $describeService['result']['services']['item']['details']['creditsTotal'];\r\n $used = $describeService['result']['services']['item']['details']['creditsUsed'];\r\n $expires = $describeService['result']['services']['item']['details']['creditsExpireTime'];\r\n }\r\n }\r\n\r\n $update = variable_get('dotgo_message_update_service', 1);\r\n\r\n if ($update == 1) {\r\n variable_set('dotgo_message_update_service', 0);\r\n $level = variable_get('dotgo_message_service_level', 0);\r\n $reloadURL = _dotgo_api_call($query = array(\r\n 'method' => 'reloadURL',\r\n 'subaccount' => $keyword\r\n ));\r\n if ($level != 0) {\r\n if (empty($describeService['result']['services'])) {\r\n $addService = _dotgo_api_call($query = array(\r\n 'method' => 'addService',\r\n 'service' => 'messaging',\r\n 'subaccount' => $keyword,\r\n 'serviceLevel' => variable_get('dotgo_message_service_level', 0),\r\n 'coupon' => variable_get('dotgo_message_coupon', $coupon)\r\n ));\r\n }\r\n else {\r\n\r\n $modifyService = _dotgo_api_call($query = array(\r\n 'method' => 'modifyService',\r\n 'service' => 'messaging',\r\n 'subaccount' => $keyword,\r\n 'serviceLevel' => variable_get('dotgo_message_service_level', $service_level),\r\n 'coupon' => variable_get('dotgo_message_coupon', $coupon)\r\n ));\r\n }\r\n }\r\n }\r\n\r\n $query = array(\r\n 'method' => 'describeFollows',\r\n 'limit' => 1,\r\n );\r\n\r\n $xmlarray = _dotgo_api_call($query);\r\n\r\n $subcount = $xmlarray['result']['follows_attr']['count'];\r\n\r\n $form = array();\r\n $form['dotgo'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('DOTGO RESELLER SETTINGS'),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => FALSE,\r\n );\r\n $form['dotgo']['dotgo_api_key'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('DOTGO API Key'),\r\n '#description' => t('API Key distributed from DOTGO'),\r\n '#default_value' => variable_get('dotgo_api_key', t('thisisnotarealapikey')),\r\n );\r\n $form['dotgo']['dotgo_api_password'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('DOTGO API Password'),\r\n '#description' => t('API Password distributed from DOTGO'),\r\n '#default_value' => variable_get('dotgo_api_password', t('thisisnotarealapipassword')),\r\n );\r\n $form['messaging'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('MESSAGING SETTINGS'),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => FALSE,\r\n );\r\n $form['messaging']['dotgo_message_credits'] = array(\r\n '#type' => 'markup',\r\n '#value' => '<table><tr><td>Total Subscribers</td><td>Remaining</td><td>Total</td><td>Used</td><td>Expires</td></tr><tr><td>' . $subcount . '</td><td>' . $remaining . '</td><td>' . $total . '</td><td>' . $used . '</td><td>' . date('M jS, Y', $expires) . '</td></tr></table>',\r\n );\r\n $form['messaging']['dotgo_message_coupon'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Message Coupon'),\r\n '#description' => t('Message Coupon'),\r\n '#default_value' => variable_get('dotgo_message_coupon', $coupon),\r\n );\r\n $form['messaging']['dotgo_message_service_level'] = array(\r\n '#type' => 'radios',\r\n '#title' => t('Dotgo Service Level'),\r\n '#description' => t('Message Level'),\r\n '#default_value' => variable_get('dotgo_message_service_level', $service_level),\r\n '#options' => array(\r\n 0 => 'Free: 0 Messages',\r\n 1 => 'Basic: 1,000 Messages',\r\n 2 => 'Standard: 10,000 Messages',\r\n 3 => 'Pro: 100,000 Messages'\r\n ),\r\n );\r\n $form['messaging']['dotgo_message_update_service'] = array(\r\n '#type' => 'checkbox',\r\n '#title' => t('Update Service'),\r\n '#description' => t('Update Messaging Service'),\r\n '#default_value' => variable_get('dotgo_message_update_service', 1),\r\n );\r\n $form = system_settings_form($form);\r\n return $form;\r\n}", "public function get_config()\n\t{\n\t\treturn mod('email')->make_config();\n\t}", "public function showConfig() {\n return $this->get('assets/email/config');\n }", "function get_settings() {\n\n\t$api = 'http://api.ekomi.de/v2/getSettings?auth='.EKOMI_API_ID.'|'.EKOMI_API_KEY.'&version='.EKOMI_VERSION;\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $api);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$get_settings = curl_exec($ch);\n\tcurl_close($ch);\n\t$settings = unserialize( $get_settings );\n\n\treturn $settings;\n\n}", "function nicholls_core_admin_get_setting_config() {\n\n\t$setting[0] = array(\n\t\t'name' => 'address_location',\n\t\t'description' => 'Office Location and Building',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[1] = array(\n\t\t'name' => 'address_mailing',\n\t\t'description' => 'Office Mailing Address',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[2] = array(\n\t\t'name' => 'address_cityzip',\n\t\t'description' => 'Office Mailing City, State, and Zip Code',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[3] = array(\n\t\t'name' => 'phone',\n\t\t'description' => 'Office Phone Number',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[4] = array(\n\t\t'name' => 'fax',\n\t\t'description' => 'Office Fax Number',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[5] = array(\n\t\t'name' => 'email_name',\n\t\t'description' => 'Office Contact Email Display Name',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[6] = array(\n\t\t'name' => 'email_address',\n\t\t'description' => 'Office Contact Email Address',\n\t\t'section' => 'contact',\n\t\t'type' => 'input'\n\t);\n\t$setting[7] = array(\n\t\t'name' => 'note',\n\t\t'description' => 'Office Hours or Short Note',\n\t\t'section' => 'contact',\n\t\t'type' => 'textarea'\n\t);\n\t$setting[8] = array(\n\t\t'name' => 'title_prefix',\n\t\t'description' => 'Website Title Prefix (leave blank for NONE)',\n\t\t'section' => 'advanced',\n\t\t'type' => 'input'\n\t);\t\n\t$setting[9] = array(\n\t\t'name' => 'site_remove_dates',\n\t\t'description' => 'Do not display date on post pages.',\n\t\t'section' => 'advanced',\n\t\t'type' => 'checkbox'\n\t);\n\t$setting[10] = array(\n\t\t'name' => 'site_remove_post_meta',\n\t\t'description' => 'Do not display meta-information on post pages.',\n\t\t'section' => 'advanced',\n\t\t'type' => 'checkbox'\n\t);\n\t\t\t\n\treturn $setting;\n}", "function eBayGetSellerProfileData($sProfile) {\n global $_MagnaSession;\n $aSellerProfiles = getDBConfigValue('ebay.sellerprofile.contents', $_MagnaSession['mpID'], false);\n if (empty($aSellerProfiles))\n return;\n if (array_key_exists($sProfile, $aSellerProfiles['Payment'])) {\n echo json_encode($aSellerProfiles['Payment'][$sProfile]);\n return;\n } else if (array_key_exists($sProfile, $aSellerProfiles['Return'])) {\n echo json_encode($aSellerProfiles['Return'][$sProfile]);\n return;\n } else if (array_key_exists($sProfile, $aSellerProfiles['Shipping'])) {\n $aSellerProfiles['Shipping'][$sProfile]['ebay_default_shipping_local'] = renderReadonlyShippingDetails($aSellerProfiles['Shipping'][$sProfile]['shipping.local'], false);\n $aSellerProfiles['Shipping'][$sProfile]['ebay_default_shipping_international'] = renderReadonlyShippingDetails($aSellerProfiles['Shipping'][$sProfile]['shipping.international'], true);\n echo json_encode($aSellerProfiles['Shipping'][$sProfile]);\n return;\n } else {\n echo \"EMPTY\\n\"; // show something to prevent eternal waiting for the ajax response\n return;\n }\n}", "public function list_email(){\n $mailboxes_list = $this->email_listing();\n $email_list = array();\n if(count($mailboxes_list)>0){\n foreach($mailboxes_list as $mailbox){\n array_push($email_list, $mailbox->email);\n }\n }\n //$email_list = get_option($this->option_name);\n $show_list = array();\n if($email_list){\n foreach($email_list as $email){\n $email_split = explode('@', $email);\n $new_email = array('username' => $email_split[0], 'email' => $email);\n array_push($show_list, $new_email);\n }\n }\n return $show_list;\n }", "protected function settings() {\n return $this->configFactory->get('car_price_calculation.settings');\n }", "private function getEavConfig()\n {\n return $this->eavConfig;\n }", "public static function getSettings() {\n $admin = ['select_all' => true, 'actions' => true, 'create' => true, 'actions_width' => '90px'];\n $user = $admin;\n\n return [\n 1 => $admin,\n 2 => $user\n ];\n }", "public function getHostSettings()\n {\n return [\n [\n \"url\" => \"https://api.shipengine.com\",\n \"description\" => \"No description provided\",\n ]\n ];\n }", "protected function getReportData() {\n\n \t// Get the Guests for this estate\n\t\t$guests = User::select(['id', 'site', 'user AS guest', 'name', 'mac', 'created'])\n\t\t\t->whereIn('site', $this->childrenIds)\n\t\t\t->whereBetween('created', $this->fromTo)\n\t\t\t->with('attributes')\n\t\t\t->groupBy('id', 'site')\n\t\t\t->orderBy('created')\n\t\t\t->get()\n\t\t;\n\n\t\t// Set the headers var for later use\n\t\t$headers = [];\n\n\t\t// Transform the guests with attributes to guests using the attribute name => value\n\t\t$guests->transform(function($guests) use (&$headers) {\n\t\t\t$guests->attrs = $guests->attributes()->get(); // Set the attributes as attrs so we do not conflict with Laravel\n\t\t\t$guests->attrs = $guests->attrs->pluck('value', 'name')->toArray(); // Just the name => value\n\n\t\t\t$combined = array_merge($guests->toArray(), $guests->attrs); // Merge the arrays\n\n\t\t\t// Unset what we do not need\n\t\t\tunset($combined['attrs']);\n\t\t\tunset($combined['attributes']);\n\t\t\tunset($combined['access_token']);\n\n\t\t\t// Get the headers\n\t\t\t$headers = array_merge($headers, array_keys($combined));\n\n\t\t\t// TODO: Change the provider\n\t\t\t//if( isset($combined['provider']) && $combined['provider'] == 'Airpass')\n\t\t\t//\t$combined['provider'] = 'Email';\n\n\t\t\t// Return the flattened\n\t\t\treturn $combined;\n\t\t});\n\n\t\t// Make sure the headers are unique\n\t\t$headers = array_flip(array_unique($headers));\n\t\t$headers = array_fill_keys(array_keys($headers), null);\n\n\t\t// Add the headers into the guest\n\t\t$guests->transform(function($guest) use ($headers) {\n\t\t\treturn array_merge($headers, $guest);\n\t\t});\n\n \treturn $guests->toArray();\n }", "public function get_options() {\n\t\t\treturn TWATB_NETWORK_ACTIVATED ? get_site_option( $this->option_name, array() ) : get_option( $this->option_name, array() );\n\t\t}", "public function get_settings_info() {\n\t\t$result = $this->db->get_where($this->_settings);\n\t\treturn $result->row_array();\n\t}", "public function getHostSettings()\n {\n return [\n [\n \"url\" => \"/services/sandbox/rest/returns\",\n \"description\" => \"No description provided\",\n ]\n ];\n }", "public function whoGuest($argms){\n\t\t$default = array (\n\t\t\t'login' => FALSE,\n\t\t\t'activated' => FALSE,\n\t\t\t'registersince' => '',\n\t\t);\n\n\t\treturn array_merge($argms);\n\t}", "public static function getSettings()\n {\n return [\n 'login' => 'editor',\n 'legalTemplates' => ['skyscraper'],\n 'access' => [\n 'templates' => [\n [\n 'name' => 'skyscraper',\n 'roles' => ['editor'], // <-- has view permission on skyscraper template.\n ]\n ]\n ]\n ];\n }", "protected function _getConfig()\n {\n return $this->vendor;\n }", "protected function getConfig()\n\t{\n\t\treturn OLPBlackbox_Config::getInstance();\n\t}", "public function getThirdPartySettings();", "public function getReelSettings()\n {\n return $this->ig->request('users/reel_settings/')\n ->addPost('_uuid', $this->ig->uuid)\n ->addPost('_uid', $this->ig->account_id)\n ->addPost('_csrftoken', $this->ig->client->getToken())\n ->getResponse(new Response\\ReelSettingsResponse());\n }", "private function getdetails() {\n $DB = new connection($this->database_name);\n $sql = \"select * from conf where email = '$this->email' \";\n $q = $DB->query($sql);\n $this->query_result = $DB->mysqli_fetch($q);\n }", "function get_ssba_settings()\n {\n // get json array settings from DB\n $jsonSettings = get_option('ssba_settings');\n\n // decode and return settings\n return json_decode($jsonSettings, true);\n }", "public function getAvailableSettings()\n {\n return array(\n 'app_key',\n 'secret_key',\n );\n }", "public function get_settings(){\n\t\treturn get_option(\"cis_login_settings\");\n\t}", "public function getNotificationsForEventsSetting() { return $this->getSettingValueForKey(CRM_SETTING_EVENTS_EMAIL); }", "protected function getSenderEmailAddress() {}", "protected function getSenderEmailAddress() {}", "function _get_settings()\n\t{\t\n\t\tglobal $DB, $EXT, $REGX, $PREFS, $SESS;\n\t\t\n\t\tif (isset($SESS->cache['cartthrob']['settings'][$PREFS->ini('site_id')]))\n\t\t{\n\t\t\treturn $SESS->cache['cartthrob']['settings'][$PREFS->ini('site_id')];\n\t\t}\n\n\t\t$settings = array();\n\n\t\t$query = $DB->query(\"SELECT settings\n\t\t\t\t FROM exp_extensions\n\t\t\t\t WHERE enabled = 'y'\n\t\t\t\t AND class = '\".$this->_extension_classname.\"'\n\t\t\t\t LIMIT 1\");\n\n\t\tif ($query->num_rows && $query->row['settings'])\n\t\t{\n\t\t\t$settings = $REGX->array_stripslashes($this->_unserialize($query->row['settings']));\n\t\t}\n\n\t\tif (isset($settings[$PREFS->ini('site_id')]))\n\t\t{\n\t\t\t$settings = $settings[$PREFS->ini('site_id')];\n\t\t}\n\n\t\tforeach ($this->default_settings as $key => $value)\n\t\t{\n\t\t\tif ( ! isset($settings[$key]))\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$SESS->cache['cartthrob']['settings'][$PREFS->ini('site_id')] = $settings;\n\n\t\treturn $settings;\n\t}", "private function __setupGuest() {\r\n if( !$this->Session->check('Rating.guest_id')) {\r\n App::import('Core', 'String');\r\n $uuid = String::uuid();\r\n\r\n CakeSession::write('Rating.guest_id', $uuid);\r\n } else if( Configure::read('Rating.guest')) {\r\n // $this->Session->write('Rating.guest_id', $uuid);\r\n }\r\n }", "function get_registered_settings()\n{\n}", "public function get_block_display_to_guests()\n\t{\n\t\treturn (isset($this->data['block_display_to_guest'])) ? (bool) $this->data['block_display_to_guest'] : false;\n\t}", "private static function get_wcpay_settings()\n {\n }", "protected function getOpportunityConfig()\n {\n return Opportunity::getSettings();\n }", "public function settings()\n {\n $config = include \"../../../config.php\";\n\n return array(\n \"dataSources\"=>array(\n \"sakila_rental\"=>$config[\"oracle\"]\n )\n );\n }", "public function getOtherSettings()\n {\n return $this->other_settings;\n }", "function gethomepagebottomsettings() {\n $db = $this->getDBO();\n ## Query is to select the home page botom videos settings\n $homepagebottomsettings = \"SELECT dispenable,homethumbview FROM #__hdflv_site_settings\";\n $db->setQuery($homepagebottomsettings);\n $rows = $db->LoadObjectList();\n return $rows;\n }", "function getSettings() { \r\n\tglobal $mysql;\r\n\t$settings = $mysql->query(\"SELECT recaptcha_sitekey,recaptcha_secretkey,g_analytics,avg_pow_time FROM system WHERE id='1'\")->fetch_assoc();\r\n\t$pow_time_parts = explode('|',$settings['avg_pow_time']);\r\n\t$avgPOW_desktop = explode(':',$pow_time_parts[0]);\r\n\t$avgPOW_mobile = explode(':',$pow_time_parts[1]);\r\n\t$settings['pow-desktop'] = round(($avgPOW_desktop[1] / 60000),2); \r\n\t$settings['pow-mobile'] = round(($avgPOW_mobile[1] / 60000),2);\r\n\treturn $settings;\r\n}", "public function get_options() {\n\t\t\treturn WPDM_NETWORK_ACTIVATED ? get_site_option( $this->option_name, array() ) : get_option( $this->option_name, array() );\n\t\t}", "public function getEmailUserInfo()\n\t{\n\t}", "public function getEmailUserInfo()\n\t{\n\t}", "public function get_settings()\n\t{\n\t\t$this->db->select('*');\n\t\t$query = $this->db->get('ems_settings');\n\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getEmailConfig()\n {\n return $this->emailConfig;\n }", "function get_instant_email()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!$this->is_loaded)\n $this->_load_config();\n\n return explode(',', $this->config['instant_email']);\n }" ]
[ "0.59800446", "0.5953498", "0.5948632", "0.5866786", "0.5761053", "0.5582297", "0.5582297", "0.5526887", "0.55221254", "0.55081093", "0.5476647", "0.5453482", "0.5423415", "0.5419681", "0.53761464", "0.5375868", "0.5375855", "0.5357502", "0.5356403", "0.53469574", "0.53265595", "0.53229016", "0.5300546", "0.52880865", "0.52681386", "0.5254419", "0.52277064", "0.5208599", "0.5202378", "0.52000606", "0.5188808", "0.5188111", "0.51833713", "0.51708394", "0.5167318", "0.5153724", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.5144178", "0.51225716", "0.5118161", "0.5116671", "0.51125175", "0.50973845", "0.5091112", "0.5076347", "0.5064419", "0.5053625", "0.5053625", "0.503362", "0.5033566", "0.50276923", "0.50229895", "0.5011407", "0.50085336", "0.5008008", "0.5003616", "0.5002401", "0.50004816", "0.4999829", "0.4983276", "0.49759325", "0.49695772", "0.49688023", "0.49682155", "0.49592453", "0.49572337", "0.49560183", "0.4955265", "0.49547982", "0.49543473", "0.49537793", "0.49521556", "0.49432552", "0.4933247", "0.4923074", "0.4921973", "0.4921973", "0.49185935", "0.49142724", "0.49123302", "0.49035478", "0.49031505", "0.4898314", "0.4897084", "0.48923206", "0.48873478", "0.48852283", "0.48843098", "0.48814496", "0.48814496", "0.48784244", "0.4876777", "0.48758367" ]
0.71698046
0
Get all the versions associated with a content item. The data attribute will also be converted to an array.
Получите все версии, связанные с элементом содержимого. Атрибут данных также будет преобразован в массив.
public function versions() { try { $versions = Version::where('content_name', $this->getAttributeValue('name'))->get(); foreach ($versions as $version) { $version->data = json_decode($version->getAttributeValue('data'), true); } return $versions; } catch (\Exception $e) { echo $e; die; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getVersions() {\n\t\t$cacheKey = tx_egovapi_utility_cache::getCacheKey(array(\n\t\t\t'method' => 'getVersions',\n\t\t\t'includeCHServices' => $this->conf['includeCHServices'],\n\t\t\t'language' => $this->conf['eCHlanguageID'],\n\t\t\t'community' => $this->conf['eCHcommunityID'],\n\t\t\t'organization' => $this->conf['organizationID'],\n\t\t\t'service' => $this->conf['service'],\n\t\t));\n\t\t$data = $this->getCacheData($cacheKey);\n\t\tif ($data !== NULL) {\n\t\t\treturn $data;\n\t\t}\n\t\t$data = array();\n\t\t$services = $this->getDomainServices();\n\n\t\tforeach ($services as $service) {\n\t\t\tif ($service->getId() === $this->conf['service']) {\n\t\t\t\t$versions = $service->getVersions();\n\t\t\t\tforeach ($versions as $version) {\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $version->getId(),\n\t\t\t\t\t\t'name' => $version->getName(),\n\t\t\t\t\t\t'status' => $version->getStatus(),\n\t\t\t\t\t\t'is_default' => $version->isDefault() ? '1' : '0',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$tags = array(\n\t\t\t'ajax',\n\t\t\tsprintf('service-%s', $this->conf['service']),\n\t\t\tstrtoupper($this->conf['eCHlanguageID']),\n\t\t);\n\t\t$this->storeCacheData($cacheKey, $data, $tags);\n\n\t\treturn $data;\n\t}", "public function getVersions();", "public function getVersionsAttribute()\n {\n return (array)unserialize($this->attributes['versions']);\n }", "public function getVersions(){\n\t\n\t\tif( empty($this->_allversions) ){\n\t\t\n\t\t\t$query = \"SELECT a.* \"\n\t\t\t.\"FROM #__zbrochure_client_versions AS a \"\n\t\t\t.\"WHERE a.client_id = \".$this->_id\n\t\t\t;\n\t\t\t\t\t\n\t\t\t$this->_db->setQuery( $query );\n\t\t\t$this->_allversions = $this->_db->loadObjectlist();\n\t\t\n\t\t}\n\t\t\n\t\treturn $this->_allversions;\n\t\t\n\t}", "private function queryVersions()\n {\n static $versions;\n if (is_array($versions)) {\n return $versions;\n }\n\n $this->write('Retrieving WordPress versions info...');\n $content = $this->remoteFilesystem->getContents('wordpress.org', self::RELEASES_URL, false);\n $code = $this->remoteFilesystem->findStatusCode($this->remoteFilesystem->getLastHeaders());\n if ($code !== 200) {\n return [];\n }\n\n $extractVer = function ($package) {\n if (!is_array($package) || empty($package['version'])) {\n return '';\n }\n\n return $this->normalizeVersionWp($package['version']);\n };\n\n try {\n $data = @json_decode($content, true);\n if (!$data || !is_array($data) || empty($data['offers'])) {\n return [];\n }\n\n $parsed = array_unique(array_filter(array_map($extractVer, (array)$data['offers'])));\n $versions = $parsed ? Semver::rsort($parsed) : [];\n\n return $versions;\n } catch (\\Exception $e) {\n return [];\n }\n }", "public function getVersions() {}", "public function getVersions() {}", "public function getVersions() {}", "public function getVersions()\n {\n return $this->sortVersions();\n }", "public function getVersions()\n {\n return $this->versions;\n }", "public function versions()\n {\n return $this->execute('versions');\n }", "public static function versions(Collection $content)\n {\n // First let's get our versions\n $dates = collect(config('changelog.versions'));\n\n // Get keys only\n $versions = $dates->keys();\n\n // Build empty collection\n $releases = collect();\n\n // Let's loop through\n foreach ($versions as $key => $version) {\n\n // current date\n $current = $dates[$version];\n\n // Get the next item key\n $next = !isset($versions[$key + 1]) ? false : $dates[$versions[$key + 1]];\n\n // Build the logs\n $changes = !$next \n ? $content->where('timestamp', '>', self::timestamp($current)) \n : $content->whereBetween('timestamp', [self::timestamp($current), self::timestamp($next)]);\n \n // build the object\n $releases[] = (object)[\n 'version' => $version,\n 'date' => $dates[$version],\n 'changes' => $changes\n ];\n }\n \n // Let's return\n return $releases->reverse();\n }", "public function getRetainedVersions()\n {\n $versions = Versioned::get_all_versions($this->DataClass, $this->DataID)\n ->limit($this->VersionsToKeep)\n ->sort('Version DESC')\n ->column('Version');\n\n $liveVersion = Versioned::get_versionnumber_by_stage($this->DataClass, Versioned::LIVE, $this->DataID);\n if ($liveVersion) {\n $versions[] = $liveVersion;\n }\n\n $draftVersion = Versioned::get_versionnumber_by_stage($this->DataClass, Versioned::DRAFT, $this->DataID);\n if ($draftVersion) {\n $versions[] = $draftVersion;\n }\n\n return array_unique($versions);\n }", "public function getVersionsList() {\n\t\t$versionsList = $this->detailsDialogElement->find(\n\t\t\t\"xpath\", $this->versionsListXpath\n\t\t);\n\t\t$this->assertElementNotNull(\n\t\t\t$versionsList,\n\t\t\t__METHOD__ .\n\t\t\t\" could not find versions list for current file\"\n\t\t);\n\t\t$this->waitTillElementIsNotNull($this->versionsListXpath);\n\t\treturn $versionsList;\n\t}", "public function loadVersions( ContentInfo $contentInfo )\n {\n if ( !$this->repository->canUser( 'content', 'versionread', $contentInfo ) )\n throw new UnauthorizedException( 'content', 'versionread' );\n\n $spiVersionInfoList = $this->persistenceHandler->contentHandler()->listVersions( $contentInfo->id );\n\n $versions = array();\n foreach ( $spiVersionInfoList as $spiVersionInfo )\n {\n $versionInfo = $this->domainMapper->buildVersionInfoDomainObject( $spiVersionInfo );\n if ( !$this->repository->canUser( 'content', 'versionread', $versionInfo ) )\n throw new UnauthorizedException( 'content', 'versionread' );\n\n $versions[] = $versionInfo;\n }\n\n usort(\n $versions,\n function ( $a, $b )\n {\n if ( $a->creationDate->getTimestamp() === $b->creationDate->getTimestamp() ) return 0;\n return ( $a->creationDate->getTimestamp() < $b->creationDate->getTimestamp() ) ? -1 : 1;\n }\n );\n\n return $versions;\n }", "public function get_versions()\n {\n $cards = $this->entityManager->getRepository(Card::class)->findAll();\n\n $versions = [];\n foreach ($cards as $card) {\n $versions[$card->getTitle()][] = $card;\n }\n\n return $versions;\n }", "private function getVersions()\n\t{\n\t\t//wurden schon einmal die versionen ausgelesen wird das nicht noch einmal gemacht\n\t\tif (is_array($this->versions))\n\t\t\treturn $this->versions;\n\n\t\t$this->versions = array($this->data->version);\n\n\t\t//der Projektordner wir ausgelesen und alle versionen gecached\n\t\t$dir = opendir(SYS_SHARE_PROJECTS);\n\t\twhile (($file = readdir($dir)) !== false)\n\t\t{\n\t\t\tif (strpos($file, $this->pid . '-v') !== 0)\n\t\t\t\tcontinue;\n\n\t\t\t$this->versions[] = str_replace($this->pid . '-v', '', $file);\n\t\t}\n\t\tclosedir($dir);\n\t\treturn $this->versions;\n\t}", "public function getProductVersions( $reload = false ) {\r\n\t\tif( sizeof( $this->versions ) && !$reload ) {\r\n\t\t\treturn $this->versions;\r\n\t\t}\r\n\t\t\r\n\t\t$dbr = wfGetDB( DB_SLAVE );\r\n\t\t$revision = $this->pArticle->mRevision;\r\n\r\n\t\t//$res = $dbr->select( 'categorylinks', 'cl_to', \"cl_from = '\" . $revision->mPage . \"'\", __METHOD__ );\r\n\t\t$res = $dbr->select(\r\n\t\t\t'categorylinks', 'cl_to', \"cl_sortkey = '\" . $dbr->strencode( $this->pTitle->__toString( )) . \"'\", __METHOD__ );\r\n\r\n\t\t$this->versions = array();\r\n\t\t\r\n\t\twhile ( $row = $dbr->fetchObject( $res ) ) {\r\n\t\t\tif ( preg_match( '/^v:(.*):(.*)/i', $row->cl_to, $match ) ) {\r\n\t\t\t\t$v = PonyDocsProductVersion::GetVersionByName( $match[1], $match[2] );\r\n\t\t\t\tif ( $v ) {\r\n\t\t\t\t\t$this->versions[] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Sort by the order on the versions admin page\r\n\t\tusort( $this->versions, \"PonyDocs_ProductVersionCmp\" );\t\t\r\n\r\n\t\treturn $this->versions;\r\n\t}", "public static function get_versions()\n\t{\n\t\t$result = array();\n\n\t\t$modules = Module_Manager::get_modules(false);\n\t\tforeach ($modules as $module)\n\t\t{\n\t\t\t$module_id = $module->get_module_info()->id;\n\t\t\t$version = self::get_db_version($module_id);\n\t\t\t$result[$module_id] = $version;\n\t\t}\n\n\t\treturn $result;\n\t}", "function getversionlist() {\n\t\tJRequest::checkToken('request') or jexit( 'Invalid Token' );\n\t\t@ob_end_clean();\n\t\t$id \t\t= JRequest::getInt('id', 0);\n\t\t$active \t= JRequest::getInt('active', 0);\n\t\tif(!$id) return;\n\t\t$revert \t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/arrow_rotate_anticlockwise.png', JText::_( 'FLEXI_REVERT' ) );\n\t\t$view \t\t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/magnifier.png', JText::_( 'FLEXI_VIEW' ) );\n\t\t$comment \t= JHTML::image ( 'administrator/components/com_flexicontent/assets/images/comment.png', JText::_( 'FLEXI_COMMENT' ) );\n\n\t\t$model \t= $this->getModel('item');\n\t\t$model->_id = $id;\n\t\t$item = $model->getItem($id);\n\t\t$cparams =& JComponentHelper::getParams( 'com_flexicontent' );\n\t\t$versionsperpage = $cparams->get('versionsperpage', 10);\n\n\t\t$currentversion = $item->version;\n\t\t$page=JRequest::getInt('page', 0);\n\t\t$versioncount = $model->getVersionCount();\n\t\t$numpage = ceil($versioncount/$versionsperpage);\n\t\tif($page>$numpage) $page = $numpage;\n\t\telseif($page<1) $page = 1;\n\t\t$limitstart = ($page-1)*$versionsperpage;\n\t\t$versions = $model->getVersionList();\n\t\t$versions\t= & $model->getVersionList($limitstart, $versionsperpage);\n\t\tforeach($versions as $v) {\n\t\t\t$class = ($v->nr == $active) ? ' class=\"active-version\"' : '';\n\t\t\techo \"<tr\".$class.\"><td class='versions'>#\".$v->nr.\"</td>\n\t\t\t\t<td class='versions'>\".JHTML::_('date', (($v->nr == 1) ? $item->created : $v->date), JText::_( 'FLEXI_DATE_FORMAT_FLEXI_VERSIONS' )).\"</td>\n\t\t\t\t<td class='versions'>\".(($v->nr == 1) ? $item->creator : $v->modifier).\"</td>\n\t\t\t\t<td class='versions' align='center'><a href='#' class='hasTip' title='Comment::\".$v->comment.\"'>\".$comment.\"</a>\";\n\t\t\t\tif((int)$v->nr==(int)$currentversion) {//is current version?\n\t\t\t\t\techo \"<a onclick='javascript:return clickRestore(\\\"index.php?option=com_flexicontent&view=item&cid=\".$item->id.\"&version=\".$v->nr.\"\\\");' href='#'>\".JText::_( 'FLEXI_CURRENT' ).\"</a>\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"<a class='modal-versions' href='index.php?option=com_flexicontent&view=itemcompare&cid[]=\".$item->id.\"&version=\".$v->nr.\"&tmpl=component' title='\".JText::_( 'FLEXI_COMPARE_WITH_CURRENT_VERSION' ).\"' rel='{handler: \\\"iframe\\\", size: {x:window.getSize().scrollSize.x-100, y: window.getSize().size.y-100}}'>\".$view.\"</a><a onclick='javascript:return clickRestore(\\\"index.php?option=com_flexicontent&task=items.edit&cid=\".$item->id.\"&version=\".$v->nr.\"&\".JUtility::getToken().\"=1\\\");' href='#' title='\".JText::sprintf( 'FLEXI_REVERT_TO_THIS_VERSION', $v->nr ).\"'>\".$revert;\n\t\t\t\t}\n\t\t\t\techo \"</td></tr>\";\n\t\t}\n\t\texit;\n\t}", "public function getVersions() {\r\n\t\t$update_time = ($this->config->get('update') === null) ? 24 : $this->config->get('update');\r\n\t\tif (!$update_time) return array('vq' => $this->vqmver, 'vqm' => $this->version, 'changelog' => '');\r\n\t\t$cache = DIR_CACHE . 'cache.vqmoderator';\r\n\t\tif (!file_exists($cache) && touch($cache)) {\r\n\t\t\tchmod($cache, 0777);\r\n\t\t} elseif (file_exists($cache) && is_readable($cache) && is_writable($cache)) {\r\n\t\t\tif (filemtime($cache) > strtotime('-' . $update_time . ' Hours')) {\r\n\t\t\t\t$version = file_get_contents($cache);\r\n\t\t\t\t$version = (substr($version,1,1) != '.') ? unserialize($version) : false;\r\n\t\t\t\tif (is_array($version) && isset($version['vqm'])) {\r\n\t\t\t\t\t$versions = $version;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$cache = false;\r\n\t\t}\r\n\t\tif (!isset($versions)) {\r\n\t\t\t$versions = array();\r\n\t\t\t// Get the vqmod version from repository\r\n\t\t\t$file = $this->vqtrunk . 'vqmod/vqmod.php';\r\n\t\t\tif ($this->isRemoteFile($file)) {\r\n\t\t\t\t$data = file_get_contents($file);\r\n\t\t\t\t$version = explode('$_vqversion', $data, 2);\r\n\t\t\t\t$version = explode(\"';\", $version[1], 2);\r\n\t\t\t\t$version = trim(str_replace(\"'\", '', str_replace('=', '', $version[0])));\r\n\t\t\t}\r\n\t\t\t// Get vQModerator version from repository\r\n\t\t\tif (isset($version) && $version) {\r\n\t\t\t\t$versions = array('vq' => $version);\r\n\t\t\t\t$file = $this->vqmtrunk . 'version';\r\n\t\t\t\tif ($this->isRemoteFile($file)) {\r\n\t\t\t\t\t$version = file_get_contents($file);\r\n\t\t\t\t\tif ($version) {\r\n\t\t\t\t\t\t$versions['changelog'] = '';\r\n\t\t\t\t\t\t$version = preg_split(\"/\\r\\n|\\n|\\r/\", $version);\r\n\t\t\t\t\t\t$versions['vqm'] = trim($version[0]);\r\n\t\t\t\t\t\t$this_ver = (int)str_replace('.', '', $this->version);\r\n\t\t\t\t\t\tforeach ($version as $i => $ver) {\r\n\t\t\t\t\t\t\tif (strlen(trim($ver)) == 5 && substr_count($ver, '.') == 2) {\r\n\t\t\t\t\t\t\t\t$vqmr_ver = (int)str_replace('.', '', trim($ver));\r\n\t\t\t\t\t\t\t\tif ($vqmr_ver <= $this_ver) break;\r\n\t\t\t\t\t\t\t\t$ver = ($i ? '<br/>' : '') . '<b>' . $ver . '</b>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$versions['changelog'] .= $ver . '<br/>';\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}\r\n\t\t// Save versions to cache if we got both of them\r\n\t\tif ($cache && isset($versions['vqm'])) {\r\n\t\t\tfile_put_contents($cache, serialize($versions));\r\n\t\t} elseif (!$versions || !isset($versions['vqm'])) {\r\n\t\t\t$versions = array('vq' => $this->vqmver, 'vqm' => $this->version, 'changelog' => '');\r\n\t\t}\r\n\t\treturn $versions;\r\n\t}", "public function getVersions(){\n\t\tif(!empty($this->versions)) return array_values($this->versions);\n\t\t$versions = array();\n\t\t$releases = $this->request(\"https://api.github.com/repos/{$this->author_name}/{$this->repo_name}/releases\");\n\t\t$releases = json_decode($releases, true);\n\t\tforeach($releases as $release){\n\t\t\t$versions[] = array(\n\t\t\t\t\"id\" => $release['id'],\n\t\t\t\t\"type\" => \"release\",\n\t\t\t\t\"version_id\" => $release['tag_name'],\n\t\t\t\t\"version_info\" => $release['name'],\n\t\t\t\t\"date\" => strtotime($release['published_at']),\n\t\t\t\t\"zip\" => $release['zipball_url']\n\t\t\t);\n\t\t}\n\t\t$commits = $this->request(\"https://api.github.com/repos/{$this->author_name}/{$this->repo_name}/commits\");\n\t\t$commits = json_decode($commits, true);\n\t\tforeach($commits as $commit){\n\t\t\t$versions[] = array(\n\t\t\t\t\"id\" => $commit['sha'],\n\t\t\t\t\"type\" => \"commit\",\n\t\t\t\t\"version_id\" => 'unofficial',\n\t\t\t\t\"version_info\" => $commit['commit']['message'],\n\t\t\t\t\"date\" => strtotime($commit['commit']['committer']['date']),\n\t\t\t\t\"zip\" => \"https://github.com/{$this->author_name}/{$this->repo_name}/archive/{$commit['sha']}.zip\"\n\t\t\t);\n\t\t}\n\t\tusort($versions, array(__CLASS__,'versionSort'));\n\t\t$this->versions = $versions;\n\t\treturn array_values($versions);\n\t}", "public function appVersions()\n {\n if(empty($this->_publicPropertyArray['app_versions']))\n return array();\n else\n return $this->_publicPropertyArray['app_versions'];\n }", "public function getRevisions() {\n\t\t$listEntries = Temboo_Results::getSubItemByKey($this->base, \"items\");\n\t\t$resultArray = array();\n\t\tif(!is_null($listEntries)) {\n\t\t\tforeach ($listEntries as $entry) {\n\t\t \tarray_push($resultArray, new Google_Drive_Revision_output($entry));\n\t\t\t}\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function APIVersions(){\n $dir = Config::inst()->get('Swagger', 'data_dir');\n $api_data_dir = (isset($dir)) ? Director::baseFolder().$dir : Director::baseFolder().\"/assets/api\";\n if (file_exists($api_data_dir)){\n $dirlist = array();\n foreach (new DirectoryIterator($api_data_dir) as $subdir) {\n if($subdir->isDir() && !$subdir->isDot())\n $dirlist[] = strtolower($subdir->getFileName());\n }\n if (count($dirlist) > 0){\n sort($dirlist);\n $out = new ArrayList();\n for ($pos = 0; $pos < count($dirlist); $pos++){\n $out->push(new ArrayData(array(\n \"Path\" => $dirlist[$pos],\n \"Name\" => str_replace('v', 'version ', $dirlist[$pos]),\n \"Selected\" => (($pos === count($dirlist) - 1) ? 'selected' : '')\n )));\n }\n return $out;\n }\n }\n return null;\n }", "public function getAServiceItemKeyVersions()\n {\n return isset($this->aServiceItemKeyVersions) ? $this->aServiceItemKeyVersions : null;\n }", "public function versions()\n {\n return $this->hasMany(Version::class);\n }", "public static function getVersionList()\n {\n $app = Application::getFacadeApplication();\n $config = $app->make('config');\n $createHightDPIVersions = (bool) $config->get('concrete.file_manager.images.create_high_dpi_thumbnails');\n\n $types = static::getList();\n $versions = [];\n\n foreach ($types as $type) {\n $versions[] = $type->getBaseVersion();\n if ($createHightDPIVersions) {\n $versions[] = $type->getDoubledVersion();\n }\n }\n\n return $versions;\n }", "public function get_list()\n {\n $versions = cfr('Thorin_Version');\n return $versions;\n }", "public function get_versions(): array\n {\n return ['1.0'];\n }", "public function getVersions($mixID);", "public function versions()\n {\n return $this->hasMany(\\App\\Version::class);\n }", "protected function parseVersion($content)\n {\n $data = \\GuzzleHttp\\json_decode($content);\n $res = [];\n foreach ($data as $row) {\n foreach ($row as $column) {\n foreach ($column as $item) {\n if (isset($item->ts)) {\n $res[] = $item->ts[0];\n }\n }\n }\n }\n\n return $res;\n }", "public static function fetch_wordpress_versions() {\n\n\t\t//Cache File name for wordpress version\n\t\t$version_list = get_wp_cli_app_config( 'package', 'version', 'file' );\n\n\t\t//Connect To Wordpress API\n\t\t$list = CLI::http_request( get_wp_cli_app_config( 'wordpress_api', 'version' ) );\n\t\tif ( $list != false ) {\n\n\t\t\t//convert list to json file\n\t\t\t$list = json_decode( $list, true );\n\n\t\t\t//Create Cache file for wordpress version list\n\t\t\tFileSystem::create_json_file( $version_list, $list, false );\n\t\t} else {\n\n\t\t\t//Show Error connect to WP API\n\t\t\treturn array( 'status' => false, 'data' => CLI::_e( 'wordpress_api', 'connect' ) );\n\t\t}\n\n\t\treturn array( 'status' => true, 'data' => $list );\n\t}", "protected function _getFixedVersions()\n {\n /* since there are some tags being supported in Magento versions we already know\n * but not recognized correctly\n * Thats the case, if that tag is neither defined in code nor a database field\n * with a corresponding name, but e.g. by setting a object property via magic setter\n */\n $fixedVersions = json_decode(file_get_contents(\n dirname(__FILE__) . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'fixedVersions.json'\n ));\n foreach ($fixedVersions->{$this->_table} as $candidate) {\n if ($this->getName() == $candidate->name) {\n if (array_key_exists('class', $this->_context)\n && 0 < strlen($this->_context['class'])\n && $candidate->classes\n ) {\n foreach ($candidate->classes as $class) {\n $class = str_replace('*', '.*', $class);\n if (preg_match(\"/$class/\", $this->_context['class'])) {\n return $this->_getMagentoVersionsLike($candidate->versions);\n }\n }\n } else {\n return $this->_getMagentoVersionsLike($candidate->versions);\n }\n }\n }\n }", "public function searchVersions($package)\n {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Searching for versions...');\n $versions = array();\n if (!$this->supportsVersions()) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Provider appears not to support versions listing...');\n return $versions;\n }\n $response = $this->request('package/versions', array(\n 'package' => $package\n ));\n if ($response && $response->response) {\n try {\n $packages = simplexml_load_string($response->response);\n } catch (\\Exception $e) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Provider appears not to support versions');\n $packages = array();\n }\n\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Found versions : '. count($packages));\n foreach ($packages as $version) {\n $this->modx->log(modX::LOG_LEVEL_INFO, (string) $version->display_name);\n $versions[] = $version;\n }\n }\n\n return $versions;\n }", "public function getMigratedVersions() {}", "public function getVersions()\n {\n if (array_key_exists(\"versions\", $this->_propDict)) {\n return $this->_propDict[\"versions\"];\n } else {\n return null;\n }\n }", "function queryVersions($product){\r\n\t\t$toReturn=array();\r\n\t\t$db= new RecordSet($this->dbConnectionInfo);\r\n\t\t$query=\"SELECT version,visible FROM comments WHERE product='\" . $db->sanitize($product) . \"' ORDER by version;\";\r\n\t\tif ($db->Open($query)>0){\r\n\t\t\twhile ($db->MoveNext()) {\r\n\t\t\t\t$toReturn[$db->Field('version')]=$db->Field('visible');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$db->Close();\r\n\t\treturn $toReturn;\r\n\t}", "public function getNodeVersions($id)\n {\n return $this->get(\"nodes/{$id}/versions\");\n }", "public function getMagentoVersions()\n {\n if ($fixedVersions = $this->_getFixedVersions()) {\n return $fixedVersions;\n }\n $query = 'SELECT ' . implode(', ', $this->_getFieldsToSelect()) . '\n FROM [' . $this->_table . '] t\n INNER JOIN [' . $this->_tagType . '_signature] ts ON (t.id = ts.' . $this->_tagType . '_id)\n INNER JOIN [signatures] s ON (ts.signature_id = s.id)\n WHERE t.name = %s\n GROUP BY s.id'\n ;\n try {\n /* find all signatures matching that call */\n $result = dibi::query($query, $this->getName());\n } catch (\\DibiDriverException $e) {\n dibi::test($query, $this->getName());\n throw $e;\n }\n $versions = array();\n if (is_null($result) || 0 == count($result)) {\n return null;\n }\n\n /* get best matching signature id */\n if (1 < count($result)) {\n $signatureIds = $this->_getBestMatching($result->fetchAll());\n } else {\n try {\n $signatureIds = array_keys($result->fetchPairs());\n } catch (\\DibiDriverException $e) {\n dibi::test($query, $signatureId);\n throw $e;\n }\n }\n if (false == is_array($signatureIds) || 0 == count($signatureIds)) {\n Logger::warning('Could not find any matching definition of ' . $this->_name);\n return null;\n }\n\n /* fetch Magento versions */\n $query = 'SELECT CONCAT(edition, \" \", version) AS magento\n FROM [magento_signature] ms\n INNER JOIN [magento] m ON (ms.magento_id = m.id)\n WHERE ms.signature_id IN (%s)\n GROUP BY magento'\n ;\n try {\n return dibi::fetchPairs($query, $signatureIds);\n } catch (\\DibiDriverException $e) {\n dibi::test($query, $signatureId);\n throw $e;\n }\n }", "function api_version_lists(){\n $query = db_select(\"api_code_version\" , \"version\")\n ->fields(\"version\")->execute()->fetchAll();\n\n foreach ($query as $data) {\n $rows[] = array(\n array('data' => $data->url),\n array('data' => $data->method),\n array('data' => $data->source_name),\n array('data' => $data->version),\n array('data' => $data->last_function),\n array('data' => l(t('Edit'), 'admin/structure/services/apiversion/edit/' . $data->id) . ' - ' . l(t('Delete'), 'admin/structure/services/apiversion/delete/' . $data->id)),\n );\n }\n\n return theme('table', array('header'=>array(t('url'), t('method'),t('source'),t('version'), t('last_function'), t('action')), 'rows'=>$rows));\n}", "protected function fetchItemVariants()\n {\n return $this\n ->fetchItemVariantDivider()\n ->fetchItemVariantHeadline()\n ;\n }", "private function fetch_variants(){\n\n $args = array(\n 'post_type' => 'product_variation',\n 'posts_per_page' => -1,\n 'post_parent' => $this->id,\n 'order' => 'ASC',\n 'orderby' => 'menu_order'\n );\n\n $variants = [];\n $parent = new \\WP_Query($args);\n\n if ($parent->have_posts()) {\n while ($parent->have_posts()) : $parent->the_post();\n\n $variant_id = get_the_ID();\n $variant = new Variant_Meta($variant_id);\n $variant->fetch();\n\n $variants[$variant_id] = $variant->get();\n\n endwhile;\n }\n\n wp_reset_postdata();\n\n return $variants;\n }", "private static function getAllVersions($uid) {\n\t\t$view = new View('/' . $uid . '/');\n\t\t$dirs = [self::VERSIONS_ROOT];\n\t\t$versions = [];\n\n\t\twhile (!empty($dirs)) {\n\t\t\t$dir = \\array_pop($dirs);\n\t\t\t$files = $view->getDirectoryContent($dir);\n\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$fileData = $file->getData();\n\t\t\t\t$filePath = $dir . '/' . $fileData['name'];\n\t\t\t\tif ($file['type'] === 'dir') {\n\t\t\t\t\t\\array_push($dirs, $filePath);\n\t\t\t\t} else {\n\t\t\t\t\t$versionsBegin = \\strrpos($filePath, '.v');\n\t\t\t\t\t$relPathStart = \\strlen(self::VERSIONS_ROOT);\n\t\t\t\t\t$version = \\substr($filePath, $versionsBegin + 2);\n\t\t\t\t\t$relpath = \\substr($filePath, $relPathStart, $versionsBegin - $relPathStart);\n\t\t\t\t\t$key = $version . '#' . $relpath;\n\t\t\t\t\t$versions[$key] = ['path' => $relpath, 'timestamp' => $version];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// newest version first\n\t\t\\krsort($versions);\n\n\t\t$result = [];\n\n\t\tforeach ($versions as $key => $value) {\n\t\t\t$size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']);\n\t\t\t$filename = $value['path'];\n\n\t\t\t$result['all'][$key]['version'] = $value['timestamp'];\n\t\t\t$result['all'][$key]['path'] = $filename;\n\t\t\t$result['all'][$key]['size'] = $size;\n\n\t\t\t$result['by_file'][$filename][$key]['version'] = $value['timestamp'];\n\t\t\t$result['by_file'][$filename][$key]['path'] = $filename;\n\t\t\t$result['by_file'][$filename][$key]['size'] = $size;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function fetchVersions($path)\n {\n try {\n //Fetch all contents from repo tree\n $this->setClient(new Client($this));\n $contents = $this->getClient()->createRequest(\"GET\", $this->model_repo_endpoint . '/' . rawurlencode($path));\n $versions = array();\n foreach($contents as $entry) {\n if($entry['type'] === 'dir')\n array_push($versions, $entry);\n }\n\n return $versions;\n\n } catch (\\Exception $e) {\n $this->emError($e->getMessage());\n }\n exit;\n }", "public function getJoomlaVersions(int $extensionId): array\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select('REPLACE(' . $db->quoteName('version') . ', \"0.0\", \"x\")')\n\t\t\t->from($db->quoteName('#__jed_extensions_joomla_versions'))\n\t\t\t->where($db->quoteName('extension_id') . ' = ' . $extensionId);\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadColumn();\n\t}", "public function getVersion(): array;", "public function dataChanges()\n {\n return $this->morphMany(\\App\\Models\\Revision::class, 'model')\n ->orderBy('created_at', 'DESC');\n }", "public function getVersionIds()\n {\n $versions = OrdersVersionsQuery::create()\n ->select('VersionId')\n ->filterByOrdersId($this->getId())\n ->orderByVersionId('desc')\n ->find($this->getDBConnection());\n\n $ids = [];\n foreach ($versions as $version) {\n $ids[$version] = $version;\n }\n\n return $ids;\n }", "public function getRevisions();", "function get_product_list()\n\t{\n\t\t$product_list = $this->object->get_registry()->get_product_list();\n\t\t$version_list = array();\n\n\t\tforeach ($product_list as $product_id)\n\t\t{\n\t\t\t$product = $this->object->get_registry()->get_product($product_id);\n\n\t\t\t$version_list[$product_id] = $product->module_version;\n\t\t}\n\n\t\treturn $version_list;\n\t}", "protected function getContentItems()\n\t{\n\t\t$content = $this->getContent();\n\n\t\treturn $content->get('items', new CartCollection([]));\n\t}", "public function getItems() {\n $db = Zend_Registry::get(\"db\");\n\n $items = $db->fetchAll('SELECT i.lib_channel_item_id, i.item_text_id, i.item_date, '\n . 'i.author_id, i.published, t.cdate, '\n . 'lib_text_revision_id, lib_text_revision_content_id, '\n . 'r.mdate, r.revision, r.author_id as revision_author_id, '\n . 'r.changes, c.content '\n . 'FROM lib_channel_item i '\n . 'LEFT JOIN lib_text t ON i.item_text_id = t.lib_text_id '\n . 'LEFT JOIN lib_text_revision r USING (lib_text_revision_id) '\n . 'LEFT JOIN lib_text_revision_content c USING (lib_text_revision_content_id) '\n . 'WHERE i.lib_channel_id = :lib_channel_id',\n array(':lib_channel_id' => $this->_libChannelId));\n\n $result = array();\n foreach ($items as $i) {\n $revision = array(\n 'lib_text_revision_id' => $i['lib_text_revision_id'],\n 'content_id' => $i['lib_text_revision_content_id'],\n 'content' => $i['content'],\n 'mdate' => App_Date::fromMysqlString($i['mdate']),\n 'revision' => $i['revision'],\n 'changes' => $i['changes']\n );\n $text = array(\n 'lib_text_id' => $i['item_text_id'],\n 'revision' => $revision,\n 'cdate' => App_Date::fromMysqlString($i['cdate'])\n );\n $item = array(\n 'lib_channel_item_id' => $i['lib_channel_item_id'],\n 'lib_channel' => $this,\n 'item_text' => $text,\n 'item_date' => App_Date::fromMysqlString($i['item_date']),\n 'author_id' => $i['author_id'],\n 'published' => $i['published']\n );\n $result[] = new App_Channel_Item($item);\n }\n\n return $result;\n }", "public function getVersions($id = null)\n {\n return $this->getGeneralSubEndpoint($id, 'versions', AddonVersion::class);\n }", "public function getVersions() {\n \n $results = $this->call();\n\n if ($results && $results->builds) {\n return $results->builds;\n }\n\n return FALSE;\n }", "function ls()\n {\n $path = $this->path();\n $versions = [];\n\n if (!dir::exists($path))\n {\n return $versions;\n }\n\n foreach (fs::ls($path) as $filename)\n {\n if (preg_match('#^v([0-9]+)\\.([a-z_]+)\\.(.*?).json$#', $filename, $match))\n {\n list($_, $version, $language, $hash) = $match;\n\n if ($language === $this->language)\n {\n $versions[(int)$version] = [\n 'version' => (int) $version,\n 'filename' => $filename,\n 'hash' => $hash\n ];\n }\n }\n }\n\n ksort($versions);\n return $versions;\n }", "public function getAllVersions($con = null)\n {\n $criteria = new Criteria();\n $criteria->addAscendingOrderByColumn(IncidentVersionTableMap::COL_VERSION);\n\n return $this->getIncidentVersions($criteria, $con);\n }", "public function getRevisions() {\n if (! is_array($this->revisions)) {\n $this->revisions = array();\n\n $clazz = new ReflectionClass(get_class($this));\n $methods = $clazz->getMethods();\n foreach ($methods as $method) {\n if (preg_match('/^upgrade_(.*)/', $method->name, $matches)) {\n $this->revisions[] = $matches[1];\n }\n }\n sort($this->revisions, SORT_NUMERIC);\n }\n\n return $this->revisions;\n }", "public function getChildrenVersion($version, $viralVersioning = false, $unpublished = false) {\n $all_versions = array();\n $all_versions[$version->id] = $version;\n\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select('cv.id, cv.name AS version_name, cr.resourcetype_id, cr.name AS resource_name, cr.id AS resource_id, cm.guid AS fileidentifier, cm.id AS metadata_id, cm.metadatastate_id, rtl.viralversioning');\n $query->from('#__sdi_versionlink vl');\n $query->innerJoin('#__sdi_version pv ON vl.parent_id = pv.id');\n $query->innerJoin('#__sdi_resource pr ON pv.resource_id = pr.id');\n $query->innerJoin('#__sdi_resourcetypelink rtl ON pr.resourcetype_id = rtl.parent_id');\n $query->innerJoin('#__sdi_version cv ON vl.child_id = cv.id');\n $query->innerJoin('#__sdi_metadata cm ON cm.version_id = cv.id');\n $query->innerJoin('#__sdi_resource cr ON cv.resource_id = cr.id AND cr.resourcetype_id = rtl.child_id');\n if ($viralVersioning) {\n $query->where('rtl.viralversioning = 1');\n }\n if ($unpublished) {\n $query->where('cm.metadatastate_id NOT IN (3, 4)'); // @TODO: should be replaced by sdiMetadata::PUBLISHED/ARCHIVED\n }\n $query->where('vl.parent_id = ' . (int) $version->id);\n\n $db->setQuery($query);\n $childs = $db->loadObjectList('id');\n\n if (count($childs) > 0) {\n $version->children = $childs;\n //$all_versions[$version->id]->children = $childs;\n\n foreach ($childs as $key => $child) {\n $this->getChildrenVersion($child, $viralVersioning, $unpublished);\n }\n } else\n $version->children = array();\n\n return $all_versions;\n }", "private function versions(): array\n {\n return array_keys(Config::get('request-migrations.versions'));\n }", "public function SortedVersions()\n {\n $versions = $this->Versions()->toArray();\n\n usort($versions, function ($a, $b) {\n return version_compare($b->Version, $a->Version);\n });\n\n return new ArrayList($versions);\n }", "public static function getJsonVersionInfos()\n {\n return json_decode(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getUrl('http://get.typo3.org/json'), true);\n }", "public function get_valid_versions()\n {\n return $this->valid_versions;\n }", "public function version()\n {\n return(array(\"api\" => array(\"name\" => \"domus.Link.RESTAPI.v\".$this->apiVersion.$this->apiQualifier, \"version\" => $this->apiVersion)));\n }", "public function getPageVersions()\n {\n return BaseIterator::create(NavItemPage::class, $this->_typeData, 'id');\n }", "public function getCoreVersionsList()\n {\n $result = \\XLite\\Upgrade\\Cell::getInstance()->getCoreVersions();\n unset($result[\\XLite::getInstance()->getMajorVersion()]);\n\n return $result;\n }", "public function versionListing($frameworkId) {\n $data = array();\n\n $db = new DBController();\n $conn = $db->connect();\n $sql = \"SELECT * FROM version WHERE framework_id = '$frameworkId'\";\n $result = $conn->query($sql);\n\n if($result->num_rows > 0) {\n $data = mysqli_fetch_all($result, MYSQLI_ASSOC);\n }\n\n $db->close($conn);\n return $data;\n }", "function getVersionsApp()\n{\n require \"version.php\";\n return $versions;\n}", "public function getVariants() {\n\t\treturn $this->variants->toArray();\n\t}", "public function versions()\n {\n return $this->hasMany('App\\PageHistory', 'page_id');\n }", "public function requestVersion(): array\n {\n try {\n return json_decode(file_get_contents($this->apiURL), true)['packages']['orchid/platform'];\n } catch (\\Exception $exception) {\n Log::alert($exception->getMessage());\n\n return [['version' => '0.0.0']];\n }\n }", "public function getVersions($current=true) {\n\t\tif ($current)\n\t\t\treturn array($this->getDBVersion(),$this->getPHPVersion());\n\t\telse\n\t\t\treturn array($this->init_DB_version,$this->getPHPVersion());\n\t}", "public function versionsAction()\n {\n if (!$this->isGranted(['EDIT'], $this->admin->getSubject())) {\n throw new AccessDeniedException;\n }\n\n $versions = $this->container->get('zicht_versioning.manager')->findVersions($this->admin->getSubject());\n\n // todo this probably should be implemented using a serializer in stead.\n $on = new ObjectNormalizer();\n $on->setCallbacks(\n [\n 'data' => function ($var) {\n return json_decode($var, true);\n }\n ]\n );\n $ser = new Serializer(\n [\n $on,\n new DateTimeNormalizer(DateTimeNormalizer::STRATEGY_STRING)\n ]\n );\n return new JsonResponse($ser->normalize($versions));\n }", "public function toArray()\n {\n $content = [\n 'id' => $this->content->id,\n '_content' => $this->content->toArray(),\n '_revision' => $this->revision->toArray(),\n ];\n\n foreach ($this->data as $field => $data) {\n $content[$field] = $data->toArray();\n }\n\n return $content;\n }", "public function getData()\n {\n $items = $this->getItems();\n $data = [];\n $object = new BaseObject();\n foreach ($items as $key => $item) {\n $object->initialize($item)->setItemKey($key);\n $object->validate('itemId', 'title', 'content', 'url');\n $data[] = array_filter($object->toArray(), function ($value) {\n if (is_string($value) && $value !== '0') {\n return !empty($value);\n }\n return true;\n });\n }\n\n return $data;\n }", "public function getAllReleases()\n {\n $sql = $this->database->select()\n ->from(array('e' => 'slicerpackages_extension'), array('release'))\n ->where('e.release != ?', '')\n ->distinct();\n $releases = array();\n $rowset = $this->database->fetchAll($sql);\n foreach($rowset as $row)\n {\n $releases[] = $row['release'];\n }\n return $releases;\n }", "private function getItems(): array\n {\n // Get list of URLs to crawl.\n $urls = $this->getUrls();\n\n // Get request variants to include.\n $request_variants = $this->cache->getRequestVariants();\n\n $items = [];\n\n foreach ($urls as $url) {\n foreach (\\array_keys($request_variants) as $request_variant) {\n $items[] = new Item($url, $request_variant);\n }\n }\n\n return $items;\n }", "private function retrieveItems(): array\n {\n $arguments = $this->objectManagerConfig->getArguments(\n $this->objectManagerConfig->getPreference($this->className)\n );\n\n return $arguments[$this->argumentName]['_v_'] ?? $arguments[$this->argumentName] ?? [];\n }", "public function getVersions($type = 'base')\n {\n return $this->fixVersions->$type;\n }", "protected function _getVersionData()\n {\n if (empty($this->_data)) {\n $filename = $this->_app->getWebrootDir().SELF::VERSION_FILENAME;\n $contents = file_get_contents($filename);\n $contents = json_decode($contents, true);\n if (!$contents) {\n return $this->$NEW;\n }\n $this->_data = $contents;\n }\n return $this->_data;\n }", "public function getVersions($mixID, $blnOnlyActive = false)\n\t{\n\t\tif ($blnOnlyActive)\n\t\t{\n\t\t\t$arrVersion = $this->objDatabase\n\t\t\t\t\t->prepare('SELECT tstamp, version, username, active FROM tl_version WHERE fromTable = ? AND pid = ? AND active = 1')\n\t\t\t\t\t->execute($this->strSource, $mixID)\n\t\t\t\t\t->fetchAllAssoc();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrVersion = $this->objDatabase\n\t\t\t\t\t->prepare('SELECT tstamp, version, username, active FROM tl_version WHERE fromTable = ? AND pid = ? ORDER BY version DESC')\n\t\t\t\t\t->execute($this->strSource, $mixID)\n\t\t\t\t\t->fetchAllAssoc();\n\t\t}\n\n\t\tif (count($arrVersion) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$objCollection = $this->getEmptyCollection();\n\n\t\tforeach ($arrVersion as $versionValue)\n\t\t{\n\t\t\t$objReturn = $this->getEmptyModel();\n\t\t\t$objReturn->setID($mixID);\n\n\t\t\tforeach ($versionValue as $key => $value)\n\t\t\t{\n\t\t\t\tif ($key == \"id\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$objReturn->setProperty($key, $value);\n\t\t\t}\n\n\t\t\t$objCollection->add($objReturn);\n\t\t}\n\n\t\treturn $objCollection;\n\t}", "public function plugin_version_getAll($h)\r\n\t{\r\n\t\t$query_vals = array(\r\n\t\t 'api_key' => '',\r\n\t\t 'format' => 'json',\r\n\t\t 'method' => 'hotaru.plugin.version.getAll'\r\n\t\t);\r\n\r\n\t\t $info = $this->sendApiRequest($h, $query_vals, 'http://hotaruplugins.com/index.php?page=api');\r\n\r\n\t\t if ($info) {\r\n\t\t // save the updated version numbers to the local db so we can display it on the plugin management panel\r\n\t\t $sql = \"SELECT plugin_id, plugin_name, plugin_latestversion FROM \" . TABLE_PLUGINS;\r\n\t\t $plugins = $h->db->get_results($h->db->prepare($sql));\r\n\r\n\t\t if ($plugins) {\r\n\t\t\tforeach ($plugins as $plugin) { \r\n\t\t\t if (array_key_exists($plugin->plugin_name, $info)) {\r\n\t\t\t\t$sql = \"UPDATE \" . TABLE_PLUGINS . \" SET plugin_latestversion = %s WHERE (plugin_id = %d)\";\r\n\t\t\t\t$h->db->query($h->db->prepare($sql, $info[$plugin->plugin_name], $plugin->plugin_id));\r\n\t\t\t\t//print $plugin->plugin_name . ' ' . $info[$plugin->plugin_name] . '<br/>';\r\n\t\t\t }\r\n\t\t\t}\r\n \r\n return true;\r\n\t\t } \r\n\t\t }\r\n\r\n\t\treturn false;\r\n\t}", "public function get_all_releases ()\n\t{\n\t\t$cache_key = '/gitdata/package/' . $this->name . '/all_releases';\n\t\t$releases = \\Cache::get($cache_key);\n\n\t\tif ($releases !== null)\n\t\t{\n\t\t\treturn $releases;\n\t\t}\n\n\t\t$releases = array();\n\t\t$self = $this;\n\n\t\tgit_tree_walk($this->tree, GIT_TREEWALK_PRE, function ($_1, $entry, &$releases)\n\t\t\tuse (&$self)\n\t\t{\n\t\t\t$name = git_tree_entry_name($entry);\n\n\t\t\tif (!preg_match('/^release-(.+)\\.json$/', $name, $match))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t$release = PackageRelease::find_by_package_and_version($self->name, $match[1]);\n\n\t\t\tif ($release)\n\t\t\t{\n\t\t\t\t$releases[] = $release;\n\t\t\t}\n\t\t}, $releases);\n\n\t\tusort($releases, function ($a, $b)\n\t\t{\n\t\t\treturn strcmp($b->version, $a->version);\n\t\t});\n\n\t\t\\Cache::set($cache_key, $releases, array(\n\t\t\t'data_version' => 'current'\n\t\t));\n\n\t\treturn $releases;\n\t}", "public static function getModuleSchemaVersions()\r\n {\r\n $db = DatabaseConnection::getInstance();\r\n\r\n $sql = sprintf(\r\n \"SELECT\r\n name AS name,\r\n version AS version\r\n FROM\r\n module_schema\r\n ORDER BY\r\n name ASC\"\r\n );\r\n\r\n return $db->getAllAssoc($sql);\r\n }", "function getItems()\n\t{\n\t\t\tif (empty( $this->_data ))\n\t\t\t{\n\t\t\t\t $query = $this->_buildQuery();\n\n\t\t\t\t $filter = $this->_buildContentFilter();\n\t\t\t\t $orderby = $this->_buildItemOrderBy();\n\n\t\t\t\t $query .= $filter;\n\t\t\t\t $query .= $orderby;\n\t\t\t\t //$this->_data = $this->_getList( $query );\n\t\t\t\t $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t}\n\n\t\t\treturn $this->_data;\n\t}", "function wc_get_webhook_rest_api_versions()\n {\n }", "function boston_college_get_version_node_list(DOMXPath $mods_xpath, DOMElement $mods_root) {\n return $mods_xpath->query('mods:note[@type=\"version identification\"]', $mods_root);\n}", "private function fetchAll()\n {\n return $this->data = $this->client->listItems('volumes', ['q' => $this->query]);\n }", "public function getVersions($vocab_id, $view='view'){\n\t\theader('Cache-Control: no-cache, must-revalidate');\n\t\theader('Content-type: application/json');\n\n\t\t$jsonData = array();\n\t\t$jsonData['status'] = 'OK';\n\t\t$jsonData['id']=$vocab_id;\n\t\t//vocab versions\n\t\t$this->load->model('vocab_services', 'vocab');\n\t\t$versions= $this->vocab->getVersionsByID($vocab_id);\n\n\n\t\t//get owned vocabs permission\n\t\tif($this->user->loggedIn()){\n\t\t\t$ownedVocabsID = array();\n\t\t\t$ownedVocabs = $this->vocab->getAllOwnedVocabs(true);\n\t\t\tforeach($ownedVocabs as $v){\n\t\t\t\tarray_push($ownedVocabsID, $v->id);\n\t\t\t}\n\t\t\tif(in_array($vocab_id, $ownedVocabsID)) {\n\t\t\t\t$jsonData['item']['owned']=true;\n\t\t\t\tif($view=='edit'){\n\t\t\t\t\t$jsonData['item']['editable']=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$items = array();\n\t\t$currentVersion ='';\n\t\tif($versions)\n\t\t{\n\t\t\t$jsonData['item']['hasVersions']=true;\n\t\t\tforeach($versions as $version){\n\t\t\t\t$item=array();\n\t\t\t\t$item['status']=$version->status;\n\t\t\t\t$item['title']=$version->title;\n\t\t\t\t$item['id']=$version->id;\n\t\t\t\tarray_push($items, $item);\n\t\t\t}\n\t\t\t$jsonData['item']['versions']=$items;\n\t\t}else{\n\t\t\t$jsonData['noVersions']=true;\n\t\t}\n\n\t\t\n\t\t$jsonData = json_encode($jsonData);\n\t\techo $jsonData;\n\t}", "public function test_fetch_current_versions()\n\t{\n\t\t$versions = $this->getModel()\n\t\t\t->fetch_current_versions('location', 'timestamp');\n\n\t\t$this->assertSame(\n\t\t\tarray (\n\t\t\t\t'app' => '20101216080000',\n\t\t\t\t'dblogger' => '20101225000000',\n\t\t\t),\n\t\t\t$versions\n\t\t);\n\t}", "function entity_type_get_versions($entity_type, $module) {\n $registered = entity_registered_versions($entity_type, $module);\n $unregistered = entity_unregistered_versions($entity_type, $module);\n\n return $registered + $unregistered;\n}", "public function getItems(): array;", "public function versions(): Versions\n {\n if ($this->versions !== null) {\n return $this->versions;\n }\n\n $this->validate();\n return $this->versions = new Versions($this);\n }", "public function getData() {\n $max_number_of_items = (int) _ereol_app_feeds_variable_get('ereol_app_feeds_themes', 'max_number_of_items', 50);\n\n $entity_type = NodeHelper::ENTITY_TYPE_NODE;\n $bundle = 'article';\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', $entity_type)\n ->entityCondition('bundle', $bundle)\n ->propertyCondition('status', NODE_PUBLISHED)\n ->fieldCondition('field_show_in_app', 'value', 1)\n ->propertyOrderBy('created', 'DESC')\n ->range(0, $max_number_of_items);\n $result = $query->execute();\n\n if (isset($result[$entity_type])) {\n $nodes = node_load_multiple(array_keys($result[$entity_type]));\n return array_values(array_map(function ($node) {\n return $this->paragraphHelper->getThemeData($node);\n }, $nodes));\n }\n\n return [];\n }", "protected function getNormalizedVersions()\n {\n if ($this->normalizedVersions) {\n return $this->normalizedVersions;\n }\n\n $this->normalizedVersions = [];\n foreach ($this->versions as $version => $date) {\n $this->normalizedVersions[$this->normalizeVersion($version)] = $date;\n }\n return $this->normalizedVersions;\n }", "public function get_craftitems($version){\n\t\t$query = $this->db->query('\n\t\t\tselect items.itemsName, tabs.tabName from craftable_items\n\t\t\tjoin items on items.id = craftable_items.itemId\n\t\t\tjoin tabs on tabs.id = craftable_items.tab\n\t\t\twhere version <= '.$version.';\n\t\t\torder by tabs.id;\n\t\t');\n\t\treturn $query->result();\t\n\t}", "public function getRevisionDataTable();", "public function getAppVersion()\n {\n $arr = [];\n $this->data['version'] = '1.0.20';\n $this->data['isdialogshow'] = true;\n $this->data['showupdatedialog'] = true;\n// $this->data['btntext'] = 'Uninstall';\n\n// $this->data['title'] = 'Zestlog needs an update';\n// $this->data['detail1'] = 'To continue using Zestlog';\n// $this->data['detail2'] = 'please uninstall & reinstall the app.';\n $this->data['btntext'] = 'Update';\n $this->data['title'] = 'Zestlog needs an update';\n $this->data['detail1'] = 'To continue using Zestlog';\n $this->data['detail2'] = 'please update the app.';\n\n// $this->data['btntext_update'] = 'Update';\n// $this->data['title_update'] = 'Zestlog needs an update';\n// $this->data['detail_update1'] = 'To continue using Zestlog';\n// $this->data['detail_update2'] = 'please update the app.';\n\n $arr[]['version'] = '1.0.23';\n $this->data['versionList'] = $arr;\n\n return response()->json(['success' => true, 'data' => $this->data, 'message' => $this->message]);\n }", "public function getContentList()\n {\n $contentList = $this->getEntityValue('contents', '');\n $ret = [];\n foreach ($contentList as $content) {\n $ret[] = new ContentView($content);\n }\n\n return $ret;\n }" ]
[ "0.7002801", "0.6789381", "0.671636", "0.6644547", "0.6637499", "0.66344124", "0.66344124", "0.66344124", "0.65842026", "0.6545418", "0.6443505", "0.6423237", "0.63191324", "0.63057464", "0.6233774", "0.62325203", "0.61969066", "0.6188139", "0.61402327", "0.6053657", "0.6032565", "0.5981006", "0.594864", "0.5945026", "0.5858106", "0.583634", "0.5830341", "0.57914335", "0.5790404", "0.5790212", "0.5773894", "0.5767563", "0.57432956", "0.57362777", "0.570173", "0.56913525", "0.56498986", "0.56422246", "0.5592076", "0.5591517", "0.5584802", "0.55804867", "0.5570451", "0.55161446", "0.5486606", "0.54836893", "0.5481628", "0.54331285", "0.54207313", "0.54148024", "0.5401091", "0.53892887", "0.5380385", "0.53751725", "0.537147", "0.5371464", "0.53702176", "0.53694916", "0.5365164", "0.5360009", "0.53446776", "0.5340337", "0.5328174", "0.53279567", "0.5324552", "0.5322985", "0.5307516", "0.5302778", "0.5299034", "0.5295568", "0.5286679", "0.5274853", "0.5273904", "0.5273022", "0.52723664", "0.52710956", "0.52688265", "0.5260786", "0.5250998", "0.52438617", "0.522935", "0.5217822", "0.5213369", "0.52113956", "0.5207447", "0.5197705", "0.5193322", "0.5177374", "0.5174732", "0.51719445", "0.5171061", "0.51705396", "0.5169734", "0.5166288", "0.51603633", "0.5154984", "0.51491106", "0.5143217", "0.51356256", "0.5126641" ]
0.79226905
0
get the Type entity associated for a particular Content item.
получить сущность Type, связанную с определенным элементом Content.
public function type($contentEntity) { return Type::where('name', $contentEntity->type_name)->firstOrFail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getItemType() {\n return $this->get('type')->value;\n }", "public function getType() {\n return $this->entity->getEntityTypeId();\n }", "public function type()\n {\n return $this->belongsTo(__NAMESPACE__ . '\\ContentType');\n }", "public function get_type()\n {\n return self::class_to_type(\n get_class(\n \\Chamilo\\Core\\Repository\\Storage\\DataManager::retrieve_by_id(\n ContentObject::class_name(), \n $this->get_attachment_id())));\n }", "public function getType(): EntityType\n {\n return $this->type;\n }", "public function getType()\n {\n return Type::findOne($this->type_id);\n }", "public function type()\n {\n return $this->hasOne('App\\Entities\\Type', 'id', 'type_id');\n }", "public function get_entity_type() {\n\t\treturn $this->entity_type;\n\t}", "public function getType() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"type\");\n\t}", "public function getType() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"type\");\n\t}", "public function getType()\n\t{\n\t\tinclude_once(DIR . 'libs/repositories/types.php');\n\n\t\treturn Types::Find($this->getTypeCode());\n\t}", "public function getType()\n {\n return $this->hasOne(Type::className(), ['id' => 'type_id']);\n }", "public function getContentType()\n {\n return self::$_contentTypes[$this->_values['type_id']];\n }", "public function getType()\n {\n $this->loadManyToOne('type');\n return $this->type;\n }", "public function tipoItem() {\r\n\t\treturn $this->dao->getTipoItem();\r\n\t}", "protected abstract function getEntityType();", "public function getType()\n {\n return $this->hasOne(Types::className(), ['id' => 'type_id']);\n }", "public function GetType() {\n\t\treturn get_field('og_type', $this->page_id);\n\t}", "function _content_type_resource_retrieve($value) {\n $content_type = db_query(\"SELECT * FROM node_type WHERE type = '$value' \");\n return db_fetch_object($content_type);\n}", "abstract public function getEntityType();", "protected function getType()\n {\n return $this->typesRegistry->get($this->type());\n }", "public function type()\n {\n return $this->hasOne('App\\Models\\Type');\n }", "public function get_entity_type()\n {\n return $this->get_default_property(self::PROPERTY_ENTITY_TYPE);\n }", "public function getItemType()\n {\n return $this->itemType;\n }", "public abstract function item_type();", "public function get_item_type() {\n\t\treturn wp_cache_get( 'item-type', 'jet-menu' );\n\t}", "public function getItemType()\n {\n return $this->_itemType;\n }", "protected function _getEntityTypeCode()\n {\n return 'rma_item';\n }", "public function content_type()\n {\n return $this->belongsTo('App\\Model\\ContentType');\n }", "function GetType()\r\n\t{\r\n\t\treturn $this->m_type;\r\n\t}", "public function get_order_item_type($item_id);", "public function getType() {\n\t\t# Initialize\n\t\t$typesList =& $this->getParentResult();\n\t\t$result =& $this->getResult();\n\t\t$reader =& $this->getReaderPrototype();\n\t\t# Type attributes\n\t\t$attributes = $reader->getAttributesArray();\n\t\t# Reading properties\n\t\t$result = (array) $this->getDataSource()->children();\n\t\t# Add type to types list\n\t\t$typesList[$attributes['name']] =& $result;\n\t}", "public function getContentType($id) {\n\t\t$model = $this->repository->getContentType($id);\n\t\treturn $model;\n\t}", "public function getTargetEntityType(): ?ContentEntityTypeInterface;", "public function getType() {\n return $this->getChildValue('type');\n }", "public function type()\n {\n return $this->types[$this->type_id];\n }", "public function type()\n {\n return $this->belongsTo(ItemType::class);\n }", "public function getType()\n {\n return $this->m_type;\n }", "public function getEntityType() {\n return $this->entityType;\n }", "public function getEntityType() {\n return $this->entityType;\n }", "public function getItemType() {\n\t\treturn $this->superShare->getNodeType();\n\t}", "function get_type() {\n\t\tglobal $db;\n\t\t$query = \" SELECT id, name \n\t\t\t\tFROM \" . $this->table_types;\n\t\tglobal $db;\n\t\t$sql = $db->query ( $query );\n\t\t$result = $db->getObjectList ();\n\t\treturn $result;\n\t}", "public function getEdmType()\n {\n return $this->_edmType;\n }", "abstract public function get_type();", "public function getType()\n {\n $type = $this->get('type');\n return $type;\n }", "protected abstract function get_type();", "function ItemByContent(Content $content);", "public function getDocumentType()\n {\n return $this->hasOne(DocumentType::className(), ['id' => 'document_type_id']);\n }", "public function getDocumentType()\n {\n return $this->hasOne(DocumentType::className(), ['id' => 'document_type_id']);\n }", "public function getEntityType()\n {\n $value = $this->get(self::ENTITYTYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function get_type();", "public function getType(){\r\n return $this->_type->get();\r\n }", "public function getEntityTypeId() {\n return $this->entity->getEntityTypeId();\n }", "public function getType()\n {\n return $this->_query['type'];\n }", "function TypeObject($itemtype) {\n\n\t\t// TODO: is mixed needed anymore?\n\t\t// include generic type (for mixed itemtypes)\n\t\tif($itemtype == \"mixed\" || !$itemtype) {\n\t\t\t$itemtype = \"mixed\";\n\t\t\t$class = \"TypeMixed\";\n\t\t}\n\t\telse {\n\t\t\t$class = \"Type\".ucfirst($itemtype);\n\t\t}\n\n\t\tif(!isset($this->itemtypes[\"class\"][$itemtype])) {\n\t\t\tinclude_once(\"class/items/type.$itemtype.class.php\");\n\t\t\t$this->itemtypes[\"class\"][$itemtype] = new $class();\n\n\t\t}\n\t\treturn $this->itemtypes[\"class\"][$itemtype];\n\t}", "public static function get_type();", "public function getEntityType()\n {\n return $this->entityType;\n }", "public function getEntityType()\n {\n return $this->entityType;\n }", "public function contentType()\n\t{\n\t\treturn $this->instance->getAttribute(\"{$this->name}_content_type\");\n\t}", "public function getContentType()\n {\n return $this->content_type;\n }", "protected abstract function get_meta_type();", "public function getContentType()\n {\n return $this->get(self::CONTENT_TYPE);\n }", "function getType() {\n\t\treturn $this->getData('type');\t\n\t}", "public function get_content_type()\n\t{\n\t\treturn $this->_content_type;\n\t}", "function getEntitytype() {\n\t\tAPP::import('Model','Entity');\n\t\t$this->Entity = new Entity(); \n\t\treturn $this->Entity->find('list',array('conditions'=>array('publish'=>'yes'),'fields'=>array('id','entity_name')));\n\t}", "abstract function get_type();", "public function type()\n {\n return $this->get('type');\n }", "public function getContentType()\n {\n return $this->_content_type; \n }", "public function getContentType($type);", "public function getContentType()\n {\n return $this->getInfo('content_type');\n }", "public function getByType()\n\t{\n\t\treturn $this->by_type;\t \n\t}", "public function getContentGqlType();", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getContentType()\n {\n if ( $this->exists() ) {\n return $this->object->content_type;\n }\n\n return false;\n }", "private function getContentType () {\n switch ($x = get_parent_class($this)) {\n case 'FetLifeWriting':\n return 'post';\n case 'FetLifeStatus':\n return 'status';\n default:\n return $x;\n }\n }", "public function typeResource()\n {\n return $this->get('rdf:type');\n }", "public function entityType() {\n return $this->decorated->entityType();\n }", "public function getItemType($id)\n {\n if( isset($this->items) )\n {\n return $this->items->getItemType($id);\n }\n else\n {\n throw new E_OTS_NotLoaded();\n }\n }", "public function entityType() {}", "public function entityType() {}", "public function getRefEntityType();", "public function getType()\n {\n return $this->hasOne(AttributesTypes::className(), ['code' => 'type_code']);\n }", "public function getType(): ActiveQueryInterface\n {\n return $this->hasOne(Type::class, ['id' => 'typeId']);\n }", "public function getType()\n\t{\n\t\t$arr = self::getTypes();\n\t\treturn isset( $arr[ $this->Type ] ) ? $arr[ $this->Type ] : null;\n\t}", "public function getEntityType() : string\n {\n return $this->fullObjectSet->getEntityType();\n }", "public abstract function getType();", "public abstract function getType();", "function getType() {\n\t\treturn $this->_Type;\n\t}", "public function getItemTypes()\n {\n //echo time2s().\"eh.getItemTypes()\\n\";\n return $this->client->gatherCached(\n $this->client->getRootEndpoint()->itemTypes->href,\n function ($type) {\n return static::parseTrailingIdFromUrl($type->href);\n },\n null,\n static::ITEM_TYPE_COLLECTION_REPRESENTATION\n );\n }", "public function getEntityTypeId()\n {\n return $this->getAttribute('entity_id');\n }", "function ContentByItem($item);", "function getType() {\n return $this->_type;\n }", "public function getContentType() {\r\n\t\treturn $this->getContentType();\r\n\t}", "public function getType()\n {\n return $this->hasOne(UserType::className(), ['id' => 'type_id']);\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getTypes()\n {\n return $this->hasOne(Types::className(), ['id' => 'types_id']);\n }", "public function getContentType()\n {\n return $this->contentType;\n }", "function getType()\n {\n return $this->type;\n }", "function getType()\n {\n return $this->type;\n }", "function getType()\n {\n return $this->type;\n }" ]
[ "0.67415786", "0.6645148", "0.66101575", "0.6597227", "0.65205646", "0.6503501", "0.64960545", "0.6472154", "0.633279", "0.633279", "0.630454", "0.62328357", "0.6230134", "0.6214428", "0.6180875", "0.61536086", "0.6143435", "0.6135331", "0.6125576", "0.61219716", "0.61187226", "0.6113376", "0.6104782", "0.609529", "0.60340226", "0.6015359", "0.59932715", "0.5983681", "0.5957043", "0.5932734", "0.590944", "0.59093285", "0.5906454", "0.5895848", "0.58714974", "0.58604246", "0.5852399", "0.584577", "0.5828711", "0.5828711", "0.5815538", "0.5799192", "0.57821923", "0.5776292", "0.5765075", "0.5763288", "0.57577354", "0.57567537", "0.57567537", "0.5755408", "0.57534575", "0.57495916", "0.57487434", "0.574354", "0.5742484", "0.5730536", "0.5729111", "0.5729111", "0.57189786", "0.5716739", "0.57152855", "0.5713183", "0.5710101", "0.5709071", "0.56948215", "0.5682373", "0.56790364", "0.56752694", "0.56677413", "0.566547", "0.5663169", "0.56550443", "0.5652005", "0.5651607", "0.5646023", "0.5644781", "0.56358105", "0.5633997", "0.563174", "0.563174", "0.56292", "0.56210196", "0.56197613", "0.56184083", "0.56168634", "0.5616562", "0.5616562", "0.5614924", "0.5610846", "0.56075764", "0.5603664", "0.55994606", "0.55974716", "0.5596873", "0.55923843", "0.5591366", "0.5590383", "0.55863696", "0.55863696", "0.55863696" ]
0.7026854
0
/ function to show client profile recieve parameters $id to show the client data return view
Функция для отображения профиля клиента получает параметр $id для отображения данных клиента и возвращает представление
public function showProfile($id) { $client = Client::find($id); return view('client.profile', compact('client')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function client_profile($id)\n {\n $districts = BdLocation::where('type','2')->get();\n $upazillas = BdLocation::where('type','3')->get();\n $client = ClientInfo::where('id',$id)->first();\n $fee = Fee::where('record_id',$client->record_id)->first();\n\n return view('admin.profile.clientprofile',compact(\n 'client',\n 'districts',\n 'upazillas',\n 'fee'\n )); \n }", "public function show($id)\n {\n $user = $this->loadUser($id);\n return view('client.profile',compact('user')); \n }", "public function show($id)\n {\n $client = Client::find($id);\n\n $client = DB::table('clients')\n ->join('users', 'users.id', '=', 'clients.user_id')\n ->join('types', 'types.id', '=', 'clients.type_id')\n ->select('clients.*', 'users.name As user_name','types.name As type_name')\n ->where('type_info', 'identification')\n ->where('clients.id',$id)\n ->limit(1)->get();\n // ->get()[0];\n\n return view('client.show', compact('client'));\n\n }", "public function profile($id){\n\t\t\t$data['artikel'] = $this->Artikel_model->get_byAuthor($id);\n\t\t\t$data['anggota'] = $this->Anggota_model->get_byID($id);\n\t\t\t$data['comment'] = $this->Comment_model->Comment_BdBaca();\n\t\t\t$data['comment_all'] = $this->Comment_model->Comment_all();\n\t\t\t$data['galery'] = $this->Galery_model->get_BYid($id);\n\t\t\t$this->load->view('backend/template/header');\n\t\t\t$this->load->view('backend/template/menu',$data);\n\t\t\t$this->load->view('backend/anggota/anggota/profile',$data);\n\t\t\t$this->load->view('backend/template/footer');\n\t\t}", "public function client_profile()\n {\n return view('client.profile');\n }", "public function getProfileView($id = null){\n\t\t$this->User->id = $this->Auth->user('id');\n\n\t\t$this->populateVariables();\n\n\t\t$this->layout = 'ajax';\n\t}", "public function show($clientId, $id, Request $request)\n\t{\n\t\tif($this->isLoginRequired)\n\t\t{\n\t\t$user =$request->session()->get(\"userDetails\");\n\t\tif($user==null)\n\t\t\treturn redirect('admin.mlogin', compact(\"clientId\"));\n\t\t$response=$this->service->get($id);\n\t\tif($this->isAuthorized($clientId, 'view',$request, $user,$response)){\n\t\n\t\tif($this->showOnlyYourOwnData && !$user->getAttribute('admin') && !$user->getAttribute('client_admin')){\n\t\t\t\t$item=$this->service->get($id);\n\t\t$this->processResponseBeforeView($item);\n\t\treturn view(isset($this->viewViewName)?$this->viewViewName:$this->editViewName,compact('item','clientId'));\n\t\t}\n\t\telse if($this->showOnlyYourOwnData && $response->getAttribute('user_id')==$user->getAttribute('id')){\n\t\t\t$item=$this->service->get($id);\n\t\t$this->processResponseBeforeView($item);\n\t\treturn view(isset($this->viewViewName)?$this->viewViewName:$this->editViewName,compact('item','clientId'));\n\t\t}\n\t\telse if(!$this->showOnlyYourOwnData)\n\t\t{\n\t\t\t$item=$this->service->get($id);\n\t\t$this->processResponseBeforeView($item);\n\t\treturn view(isset($this->viewViewName)?$this->viewViewName:$this->editViewName,compact('item','clientId'));\n\t\t}\n\t\telse{\n\t\t\treturn view(\"admin.notauthorized\");\n\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn view(\"admin.notauthorized\");\n\t\t}\n\t\t}\n\t\telse{\n\t\t$item=$this->service->get($id);\n\t\t$this->processResponseBeforeView($item);\n\t\treturn view(isset($this->viewViewName)?$this->viewViewName:$this->editViewName,compact('item','clientId'));\n\t\t}\n\t\n\t\t\n\t}", "public function show($id)\n {\n session(['client_id' => $id]);\n $client = Client::findOrFail($id);\n $intake = \\App\\Intake::findOrFail( $client->intake_id); \n return view('clients.show', compact('client','intake'));\n }", "public function show($id){\n $this->usersIndex2 = new SecurityService();\n return $this->usersIndex2->getUser($id);\n /* $conn = mysqli_connect(\"localhost\", \"root\", \"\", \"activity2\");\n $query1 = \"SELECT * FROM usertable ORDER BY id DESC\";\n $query_run = mysqli_query($conn, $query1);\n \n if (mysqli_connect_error()){\n die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());\n }\n \n $sql = \"SELECT id, firstname, lastname FROM usertable WHERE id = '$id'\";\n $result = $conn->query($sql);\n \n if ($result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n }\n }\n else {\n echo \"0 results\";\n }\n \n $conn->close(); */\n }", "public function getProfile($id) {\n $profiles = Profiles::find($id);\n $user = $profiles->user;\n //var_dump($login);\n return view('frontend.profileDetail', [\"profiles\" => $profiles, \"user\" => $user]);\n }", "public function showProfile(){\n\t\t$countries = '';\n\t\tif (Stack::size('all_countries')>0){\n\t\t\t$countries\t= Stack::last('all_countries');\n\t\t}else{\n\t\t\t$this->load->model('CountryModel', 'Country');\n\t\t\t//$countries\t= $this->Country->getList();\n\t\t\t$countries\t= $this->Country->getToCountries();\n\t\t}\n\t\t\n\t\tif (!$this->user){\n\t\t\t$this->showRegistration();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!Check::str('action',6,1)){\n\t\t\t$this->load->model('ClientModel', 'Client');\n\t\t\n\t\t\tView::showChild($this->viewpath. 'pages/profile' , array(\n\t\t\t\t\t'client'\t\t\t=> $this->Client->getById($this->user->user_id),\n\t\t\t\t\t'Countries'\t\t=> $countries,\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tCheck::reset_empties();\n\t\t$this->user->user_login\t\t\t= Check::latin('login',32,1);\n\t\t$this->user->user_email\t\t\t= Check::email(Check::str('email',128,6));\n\t\t\n\t\t$c\t\t\t\t\t\t\t\t\t\t\t= new stdClass();\n\t\t$c->client_user\t\t\t\t\t\t= $this->user->user_id;\n\t\t$c->client_name\t\t\t\t\t\t= Check::latin('name',128,1);\n\t\t$c->client_otc\t\t\t\t\t\t= Check::latin('otc',128,1);\n\t\t$c->client_surname\t\t\t\t\t= Check::latin('surname',128,1);\n\t\t$c->client_country\t\t\t\t\t= Check::int('country');\n\t\t$c->client_index\t\t\t\t\t= Check::int('index');\n\t\t$c->client_town\t\t\t\t\t\t= Check::latin('town',64,1);\n\t\t$c->client_address\t\t\t\t\t= Check::latin('address',512,1);\n\t\t$c->client_phone_country\t\t\t= Check::int('phone_country',99999);\n\t\t$c->client_phone_city\t\t\t\t= Check::int('phone_city',99999);\n\t\t$c->client_phone_value\t\t\t\t= Check::int('phone_value',99999999999);\n\t\t$c->notifications_on\t\t\t\t= Check::chkbox('notifications_on');\n\t\t$empties\t\t\t\t\t\t\t= Check::get_empties();\n\t\t\n\t\t$this->user->user_password\t= Check::latin('password',32,1);\n\t\t$this->user->repassword\t\t= Check::latin('repassword',32,1);\n\t\t\n\t\ttry{\n\n\t\t\tif ($empties && in_array('_latin',$empties)){\n\t\t\t\tthrow new Exception('Данные должны быть введены латиницей!', -14);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->user->user_password !== $this->user->repassword){\n\t\t\t\tthrow new Exception('Пароли не совпадают.', -15);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tif ($empties){\n\t\t\t\tthrow new Exception('Одно или несколько полей не заполнено!', -11);\n\t\t\t}\n\n\t\t\tif (!$this->user->user_email){\n\t\t\t\tthrow new Exception('Не верный E-mail.', -13);\n\t\t\t}\t\n\n\t\t\t$this->load->model('UserModel', 'User');\n\t\t\t\n\t\t\t$nu\t= $this->User->getUserByLogin( $this->user->user_login);\n\t\t\tif ($nu && $nu->user_id != $this->user->user_id){\n\t\t\t\tthrow new Exception('Пользователь с таким логином уже существует!', -17);\n\t\t\t}\n\t\t\t\n\t\t\t$ne\t= $this->User->getUserByEmail( $this->user->user_email);\n\t\t\tif ($ne && $ne->user_id != $this->user->user_id){\n\t\t\t\tthrow new Exception('Пользователь с такой электронной почтой уже существует!', -16);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->user->user_password)\n\t\t\t\t$this->user->user_password = md5($this->user->user_password);\n\t\t\t\n\t\t\t/**\n\t\t\t * transactions\n\t\t\t */\n\t\t\t$this->db->trans_start();\n\t\t\t// something same to lazzy load\n\t\t\t$this->load->model('ClientModel', 'Client');\n\t\t\t$c->client_phone = '+'.$c->client_phone_country.'('.$c->client_phone_city.')'.$c->client_phone_value;\n\t\t\t\n\t\t\t$this->User->_load($this->user);\n\t\t\t$this->Client->_load($c);\n\t\t\t\n\t\t\tif ($this->User->save() && $this->Client->save())\n\t\t\t{\n\t\t\t\t// меняем данные о пользователе в сесии\n\t\t\t\t$this->session->set_userdata((array) $this->user);\n\t\t\t\t\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\t\n\t\t\t\t$this->result->e\t= 1;\n\t\t\t\t$this->result->m\t= 'Данные сохранены.';\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Регистрация невозможна.',-12);\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t\n\t\t\t$this->result->e\t\t= $e->getCode();\t\t\t\n\t\t\t$this->result->m\t= $e->getMessage();\n\t\t\t\n\t\t\tswitch ($this->result->e){\n\t\t\t\tcase -1:\t$this->user->user_login\t\t= '';\tbreak;\t\n\t\t\t\tcase -15:\t\n\t\t\t\t\t$this->user->user_password\t\t\t= '';\n\t\t\t\t\t$this->user->repassword\t\t\t\t= '';\n\t\t\t\tbreak;\n\t\t\t\tcase -2:\n\t\t\t\tcase -13:\t$this->user->user_email\t\t= '';\tbreak;\n\t\t\t\tcase -11:\n\t\t\t\tcase -12:\n\t\t\t\t\t break;\n\t\t\t}\n\t\t}\n\t\t\n\t\tView::showChild($this->viewpath.'pages/profile', array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'client'\t\t=> $c,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Countries'\t\t=> $countries,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'empties'\t\t=> $empties,\n\t\t));\n\t}", "public function profile($id)\n\t{\n\t\t$this->load->model('User_model');\n\t\t$main_data['user'] = $this->User_model->get_user_profile($id);\n\t\t$main_data['lang'] = $this->lang_data;\n\t\t$main_data['is_logged_in'] = $this->login->is_logged_in() && $this->login->get_id() == $id;\n\n\t\t// composing the views\n\t\t$template_data['menu'] = $this->load->view('includes/menu',$this->lang_data, true);\n\t\t$template_data['main_content'] = $this->load->view('user_profile', $main_data, true);\n\t\t$template_data['sidebar_content'] = $this->sidebar->get_standard();\n\t\t$this->load->view('templates/main_template',$template_data);\n\t}", "public function profile($id){\n\t\t$this->config->config['pageTitle']= $data['title']='Researcher profile';\n $this->config->config['notifications']= $this->notification_model->get_unread();\n\n $data['researcher'] = $this->researcher_model->get_researchers($id);\n\t\t$data =[\n\t\t\t'info' =>$this->researcher_model->get_researchers($id),\n\t\t\t'resources' => $this->resources_model->resources_by_researcher($id, 10)\n\t\t];\n\n\t\t// die(print_r($data['resources']));\n\n $this->load->view('templates/header');\n $this->load->view('researchers/profile', $data);\n $this->load->view('templates/footer');\n\t}", "public function show($id = null)\n {\n //$userId = $id != null ? $id : \\Auth::user()->id;\n //$user = User::with('profile')->findOrFail($userId);\n return \\View::make('acl::admin.profiles.profile');\n }", "public function show_profile($id)\n {\n $user = User::where('id', $id)->first();\n return view('profile.show')->with('user', $user);\n }", "public function showprofile($id)\n {\n $user = User::find($id);\n $orders = $user->orders; \n return view('users.users.profile', compact('user','orders'));\n }", "public function _print($id)\n {\n $client = Client::where('id',$id)->first();\n $company = Tenant::where('id',\\Auth::user()->tenant_id)->first();\n return view('report.profile',['people'=>$client, 'company'=> $company , 'type_people' => 'client']);\n }", "function profile()\r\n{\r\n $userManager = new \\Devnetwork\\Blog\\Model\\UserManager();\r\n $profile = $userManager->getProfile($_GET['id']);\r\n\r\n require('views/profile.view.php');\r\n}", "public function showProfile(){\n\n\t}", "public function editProfile($id)\n {\n $client = Client::find($id);\n return view('client.editprofile', compact('client'));\n }", "public function id($id) {\n\t\t\t$left['row'] = $this->left_menu_model->get_user_condtions(); \n\t\t\t$this->load->model('messages_model');\n\t\t\t$mess['count'] = $this->messages_model->unread_mess(); \n\t\t\t$prof = $this->Profile_model->get_profile($id);\n\t\t\t$username = $prof[0]['username'];\n\t\t\t$array['title'] = \"Профил на $username - Bomba+ \"; // Title of the page\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'user' => $prof,\n\t\t\t\t'conv' => $this->Profile_model->get_profile_conv($id)\n\t\t\t);\n\t\t\t\n\t\t\t$this->load->vars($array);\n\t\t\t$this->load->vars($mess);\n\t\t\t$this->load->vars($left);\n\t\t\t$this->load->vars($arr);\n\t\t\t\n\t\t\t$this->load->template('profile_view'); \n\t\t}", "public function profile($id){\n\t\t//echo \"Displays students profile with id = $id\";\n\t\t//load the model.\n\t\t//find the student resourcebundle_get_error_code\n\t\t//load the view\n//\t\t$data['idno'];\n\t$student = $this->students->read(array('idno'=>$id));\n//if (count($student) >0)\n//{\n\n\t$header_data['title'] = \"Student view\";\n\t$data['student']=$student;\n\t\t\t$this->load->view('students/profile',$data);\n\t\t\t$this->load->view('include/header1',$header_data);\n\t\t//,$header_data);\n\n//\t}\n//else{\n\t//redirect('students','refresh');\n//}\n\t}", "public function show($id)\n {\n //\n //Menampilkan data Profil\n }", "public function show($id)\n\t{\n\t\t$profile = Profile::with('users')->where('user_id','=',$id)->first();\n\t\treturn view('profile.fullProfile',compact('profile'));\n\t}", "public function view($id){\n\n if(Auth::user()->rid != 3 && Auth::user()->rid != 2 && Auth::id() != $id ){\n return Redirect::to('/home');\n }\n\n return view('user.viewprofile')->withUser(User::find($id));\n }", "public function showProfile($id)\n {\n return view('welcome');\n// return view('welcome')->with($data);\n }", "public function ProfileInfo($id) {\n $data['footerJs'][0] = base_url('uploads/custom/js/youngperson/youngperson.js');\n $table = YP_DETAILS . ' as yp';\n $match = \"yp.yp_id = \" . $id;\n $fields = array(\"yp.profile_img,yp.yp_id\");\n $data['editRecord'] = $this->common_model->get_records($table, $fields, '', '', $match);\n $data['id'] = $id;\n $data['crnt_view'] = $this->viewname;\n $data['form_action_path'] = $this->viewname . '/updateProfileInfo/' . $id;\n $data['main_content'] = '/profileinfo';\n $this->load->view('/profileinfo', $data);\n }", "public function show($id)\n {\n\n $user = User::all();\n $profile = User::find($id);\n $user_info = Profile::Where('user_id',$id)->first();\n\n return view('profile.show')\n ->with('user_info',$user_info)\n ->with('user',$user)\n ->with('profile',$profile);\n\n\n }", "public function show($id)\n {\n $hocvien = $this->hocvienService->find($id);\n $diem_mon_hocs = $this->hocvienService->diemHV($id);\n $anhHocVien = $hocvien->anhhocvien()->get();\n $anhQuaTrinh = $hocvien->anhquatrinh()->get();\n $hv_taichinh = $hocvien->taichinh;\n if(count($hv_taichinh) !== 0){\n foreach ($hv_taichinh as $key) {\n $taichinh_id = $key->id;\n $hocvien['tong_ngay_nghi'] = $key->tong_ngay_ngi;\n $hocvien['tong_ngay_co_mat'] = $key->tong_ngay_co_mat;\n }\n $data['id'] = $taichinh_id;\n $taichinh = $this->hocvienService->filterTaiChinh($data);\n return view('admin.student.profile',compact('hocvien','taichinh','anhHocVien','anhQuaTrinh','diem_mon_hocs'));\n }\n return view('admin.student.profile',compact('hocvien', 'anhHocVien','anhQuaTrinh','diem_mon_hocs'));\n \n }", "public function show($id) {\n\n\t\t$clients = DB::table('clients')->where('id', $id)->first();\n\n\t\tif ($clients) {\n\t\t\treturn view('vidyaaarambha.masters.clients.show')->with('clients', $clients);\n\t\t}\n\t\t// else{\n\n\t\t// return redirect()->route('vidyaaarambha.masters.principals.index')->with('message','Cannot Edit Deactivated Terms & Condition')->with('er_type','danger');\n\t\t// }\n\t}", "public function show($id)\n {\n //\n $user = User::find($id);\n $profile = $user->profile?$user->profile:null;\n $profile->follow= false;\n if(count(Follow::get()->where('user_id',Auth::user()->id)->where('follow_id',(int)$id)))\n $profile->follow= true;\n if(!empty($profile->location))\n {\n $loc = explode(' ',$profile->location);\n $profile->province = $loc[0];\n $profile->city = $loc[1];\n }\n return view('profile.index',compact('profile'));\n }", "public function index($client_id)\r\n {\r\n if($this->session->userdata('user_id') == '' || $this->session->userdata('administrator') == '0')\r\n {\r\n redirect('error500');\r\n }\r\n\r\n $client_data = $this->clients->get_by_id($client_id);\r\n\r\n $data['client'] = $client_data;\r\n\r\n $data['loan_balance'] = $this->loans->get_client_total_balance($client_id);\r\n\r\n $this->load->helper('url');\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\t\t\t\t\r\n $data['title'] = '<i class=\"far fa-id-card\"></i>';\t\t\t\t\t\r\n $this->load->view('template/dashboard_header',$data);\r\n $this->load->view('profiles/profiles_view',$data);\r\n $this->load->view('template/dashboard_navigation');\r\n $this->load->view('template/dashboard_footer');\r\n\r\n }", "public function show($rec_id)\n\t{\n //$profile = Profile::find($id);\n // die(\"HELLLOOOO \". $this->cu->id);\n\n $data = array();\n $user_id = $this->cu->id;\n $p = new Profile;\n $profile = $p\n ->join('origins', 'profiles.origin_id', '=', 'origins.id')\n ->join('bridges', 'profiles.bridge_id', '=', 'bridges.id')\n ->select('profiles.id', 'profiles.name', 'profiles.local', 'profiles.status','origins.id as origin_id',\n 'origins.number as home_number','bridges.id as bridge_id', 'bridges.number as bridge_number')\n ->where('profiles.id', '=', $rec_id)\n ->first();\n\n //->where('user_id', '=', $user_id)\n\n //die(\"NAME = \".$profile->name);\n\n $data['profile'] = $profile;\n // $data['countries'] = $countries;\n\n // $data['boojam'] = 'wee';\n\n return View::make('profile.show',$data);\n\n //$data['profile'] = $profile;\n\n // show the view and pass the nerd to it\n //return View::make('profile.show')\n // ->with('profile', $p);\n\n\t}", "public function singprofile($id)\n {\n $user_data = DB::table('users')->where('id', $id)->first();\n\n $upersonalinfo = DB::table('u_personal_infos')->where('user_id', $user_data->id)->first();\n \n return view ('admin.singprofile',[\n 'user_data' => $user_data,\n 'upersonalinfo' => $upersonalinfo\n ]);\n }", "public function show($id)\n {\n \n $profile = Profiles::find($id);\n if (!empty($profile->uid)) {\n $user = User::find($profile->uid);\n return view('profile.show')->with([\n 'profile'=>$profile,\n 'user'=>$user,\n ]);\n }else{\n return redirect('/profile');\n }\n \n }", "public function user_profile($id = null) {\r\n\t\t$data['page_title'] = \"User profile\";\r\n\t\t$view_data['user_id'] = $id;\r\n\t\t$data['page_data'] = $this->load->view('web_user/user_profile', $view_data, TRUE);\r\n\t\techo modules::run(AUTH_DEFAULT_TEMPLATE, $data);\r\n\t}", "public function show($id)\n {\n $client = Client::findOrFail($id);\n $data['page'] = 'Client';\n $data['client'] = $client;\n $data['action'] = trans('setup.show_module',['module'=>'Client']);\n $data['model_url'] = route('clients.index');\n return view('clients.show')->with('data',$data);\n }", "public function show($id)\n {\n $user = User::find($id);\n $owner = (Auth::id() == (int) $id);\n return view('profile')->withUser($user)->withOwner($owner);\n \n \n }", "public function viewClient($id) {\n\n\t\tif(Auth::user()->getRole() <= 3) {\n\n\t\t\t$client = Client::with(array('company', 'createdby'))->where('id', '=', $id)->get();\n\n\t\t\tif(!$client->isEmpty()) {\n\t\t\t\t$client = $client->first();\n\t\t\t\treturn View::make('Client.viewClient')\n\t\t\t\t\t\t ->with(array('title' => 'View Client', 'client' => $client));\n\t\t\t} else {\n\n\t\t\t\treturn Redirect::route('dashboard-view');\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn Redirect::route('dashboard-view');\n\t\t}\n\t}", "public function index($id)\n {\n //\n return view('dashboard.profile')->with('User', User::find($id)->first());\n\n }", "public function profileAction($id){\n $user = User::findFirst(\n [\n \"conditions\" => \"id = :id:\",\n \"bind\" => [\n \"id\" => $id\n ]\n ]\n );\n\n $this->view->user = $user;\n }", "public function show($id)\n\t{\n\n\t\t$ch = curl_init(base_url('/api/restUsers/'.$id));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t$data['user'] = json_decode(curl_exec($ch), true);\n\t\tcurl_close($ch);\n\n\t\tif (count($data['user'][0])<=0) {\n\t\t\tredirect('/user/');\n\t\t}\n\n\t\t$this->load->view('theme/header');\n\t\t$this->load->view('user/show', $data);\n\t\t$this->load->view('theme/footer');\n\t}", "function lead_profile($id) {\n $data['lead_details'] = $this->leads_m->fetch_lead($id);\n $data['lead_source'] = $this->leads_m->get_lead_source();\n $data['product'] = $this->product_m->fetch();\n $this->load->view('lead_profile', $data);\n }", "public function show($id)\n {\n $dato = Provider::where( 'person_id', '=', $id)\n ->first();\n return $this->showOne($dato,200);\n }", "public function show($id)\n {\n $invoice=Invoice::find($id);\n $invoice_item=InvoiceItem::with('item')->where(\"invoice_id\",$invoice->id)->get();\n $customer=Customer::find($invoice->customer_id);\n// $invoice=Invoice::find($id)->get();\n return view(\"invoiceitem.profile\",compact(\"invoice\",\"invoice_item\",\"customer\"));\n }", "public function show($id)\n\t\t{\n\t\t $profile = DB::table('profiles')->where('id',$id)->first();\n \n if($profile)\n return View('profile.show',['profile'=>$profile]);\n else\n return view('errors/404');\n\t\t}", "public function show($id)\n\t{\n\t\t$user_info = UserInfo::findOrFail($id);\n\t\t$user= User::findOrFail($user_info->user_id);\n\t\t$city= City::findOrFail($user_info->city_id);\n\t\t$gov= Governorate::findOrFail($user_info->governorate_id);\n\t\tif(Auth::user()->user_type_id == 4){\n \n return view('user_infos.profile', compact('gov','city','user','user_info'));\n }\n else{\n\t\t\treturn view('user_infos.show', compact('gov','city','user','user_info'));\n\t\t}\n\t}", "public function show($id)\n {\n\n $theme = Theme::uses('corex')->layout('layout');\n $sample_data=Sample::where('id',$id)->first();\n $client_data=Client::where('id',$sample_data->client_id)->first();\n\n\n\n //\n // $user = auth()->user();\n // if($user->hasAnyPermission(['view-all-notes'])){\n // $client_notes=ClientNote::where('clinet_id',$id)->orderBy('id', 'desc')->get();\n // }else{\n // $client_notes=ClientNote::where('clinet_id',$id)->where('user_id',Auth::user()->id)->orderBy('id', 'desc')->get();\n // }\n\n $data = ['client_data' => $client_data,'sample_data' => $sample_data];\n return $theme->scope('sample.view', $data)->render();\n\n\n }", "public function show($id)\n {\n $clientes = session('clientes');\n $index = $this->getIndex($id, $clientes);\n $cliente = $clientes[$index];\n return view('clientes.info', compact(['cliente'])); //este 'cliente' vem de $cliente\n }", "public function showProfile($id)\n {\n $user = User::findOrFail($id);\n\t return view('profile.index', compact('user'));\n }", "public function show($id=null)\n {\n\n $user = Auth::user();\n $profile = Profile::with('user')->where('id_user', '=', $user->id)->first();\n return view('profile.detail',compact('profile'));\n\n }", "public function profile($id){\n\t\t//call the model\n\t\t//$students=$this->student->read(array('idno')=>'$id');\n\t\t//find the student record\n\t\t//view\n\t\t$condition = array('idno'=>$id);\n\t\tif($this->student->read($condition)){\n\t\t\t$student = $this->student->read(array('idno'=>$id));\n\t\t\t//find the student record\n\t\t\t$header_data['title'] = \"Students: View Student Profile\";\n\t\t\t$data['student'] = $student;\n\n\t\t\t//load the view\n\t\t\t$this->load->view('include/header',$header_data);\t\t\n\t\t\t$this->load->view('students/profile2',$data);\n\t\t\t$this->load->view('include/footer');\n\t\t}\n\t\telse{\n\t\t\tredirect('boot/');\n\t\t}\n\t}", "public function showUserProfile($id) {\n\n \t$user = User::findOrFail($id);\n\n \treturn view('user.profile')\n \t\t->with('title', \"Profil uživateľa \" . \"<span class = 'text-highlighter'>\" . $user->name . \"</span>\")\n \t\t->with('user', $user);\n }", "public function profile_show_by_id() {\n\t\t\n\t\t$profile = $this->data_profile->get_by_id($_POST['datamodel']); //data_model = primary key\n\t\t $array = array();\n\t\t$index=0;\n foreach ($profile as $tmp) {\n\n $temp['index'] = $index;\n $temp['datamodel'] = $tmp->profile_id;\n $temp['profile_nama'] = $tmp->profile_nama;\n $temp['profile_keterangan'] = $tmp->profile_keterangan;\n $temp['is_delete'] = $tmp->is_delete; \n array_push($array, $temp);\n $index++;\n }\n echo json_encode($array);\n\t}", "public function show($id)\n\t{\n\t\t$client = Client::findOrFail($id);\n $report = new ClientReport();\n\n foreach($client->credits as $credit){\n if($credit->isPaid){ // Paid\n $report->countPaid += $credit->amount;\n $report->nbrPaid++;\n }\n else{ // Not paid\n $report->countNotPaid += $credit->amount;\n $report->nbrNotPaid++;\n }\n }\n\n\n\t\treturn view('admin.clients.show', compact('client', 'report'));\n\t}", "public function show($id)\n {\n $user = DB::table('users')->where('id',$id)->first();\n if($user)\n {\n $profile = DB::table('profiles')->where('user_id',$id)->first();\n return view('user/showinfuser', ['users'=> $user,'profile'=>$profile]);\n }\n else\n return view('errors/404');\n }", "public function show($id)\n {\n //\n return view('dashboard.users.profile');\n\n }", "public function info($id) {\n\n $data['js'] = $this->config->item('userDetail_js');\n $data['css'] = $this->config->item('userDetail_css');\n\n $data['user'] = loginData();\n $data['settings'] = 'active';\n $data['org_name'] = $this->_organization['name'];\n \n $data['info'] = $this->user->userInfo($id);\n $data['id'] = $id;\n if(!isset($data['info']['image']) || empty($data['info']['image'])) {\n $data['info']['image'] = getImage($data['info']);\n } else {\n $data['info']['image'] = '/'.$data['info']['image'];\n }\n\n $this->load->view('settings/userDetail', $data);\n\n }", "public function index($id){\n\n $info = User::find($id);\n \n $consult=\\DB::select(\"SELECT vs.`idv` AS idv,ht.`name` AS nameh,rm.`tipo` AS tipo,rm.`number` AS number, rm.`floor` AS floorr, vs.`fecha`,vs.`visits`\n FROM visits AS vs\n INNER JOIN users AS us ON us.`id` = vs.`idu`\n INNER JOIN hotels AS ht ON ht.`idh` = vs.`idh`\n INNER JOIN rooms AS rm ON rm.`idr` = ht.`idr`\n WHERE us.id = ?\",[$id]);\n\n return view('profileInfo')\n ->with(\"info\",$info)\n ->with(\"consult\",$consult);\n\n }", "public function editprofile()\n {\n $user = (new User)->getUser(Auth::user()->id);\n $client_id = $user->client_id;\n $client_image_url = \"\";\n if ($client_id > 0) {\n $client = (new Client)->getClientinfo($client_id);\n if ($client) {\n $client_image_url = $client->logo;\n }\n\n }\n return view('frontend.user.editprofile', compact('user', 'client_image_url'));\n }", "public function edit($id)\n {\n\n $client=User::where('id',$id)->first();\n\n return view('admin.clients.edit',get_defined_vars());\n }", "function view_profile_info($id){\r\n $username = \"\";\r\n $profile_name = \"\";\r\n $password = \"**********\";\r\n $user_type = \"\";\r\n $user_email = \"\";\r\n $registered_date = \"\";\r\n $profile_picture = \"\";\r\n\r\n $user_rs = getResultSet(\"SELECT user_name, level_id, user_profile_name, user_email, user_registered_date, user_profile_picture FROM tbl_users WHERE user_id = \" . $id);\r\n if(mysql_num_rows($user_rs) != 0){\r\n while($user_info = mysql_fetch_array($user_rs)){\r\n $username = $user_info[0];\r\n $user_type = getValue(\"SELECT level_name FROM tbl_user_level WHERE level_id = \" . $user_info[1]);\r\n $profile_name = $user_info[2];\r\n $user_email = $user_info[3];\r\n $registered_date = $user_info[4];\r\n $profile_picture = $user_info[5];\r\n }\r\n }\r\n $img_style = \"\";\r\n if($profile_picture == \"\"){\r\n $profile_picture = \"app_images/image_not_found.jpg\";\r\n $img_style = \"style='border:1px solid #e3e3e3;' \";\r\n }\r\n echo '<table class=\"user_profile\">\r\n <tr><td class=\"profile_left\" valign=\"top\">\r\n <img class=\"user_profile_picture\" src =\"' . $profile_picture . '\" ' . $img_style . '/>\r\n </td>';//end of first left side-start second side\r\n\r\n\r\n echo '<td valign=\"top\">';\r\n echo '<span class=\"profile_name\">' . $profile_name . '</span><br />';\r\n\r\n echo '<table>';\r\n echo '<tr><td width=\"100\"><span class=\"profile_label\">Username</span></td><td><span class=\"profile_info\">' . $username . '</span></td></tr>';\r\n echo '<tr><td><span class=\"profile_label\">User Type</span></td><td><span class=\"profile_info\">' . $user_type . '</span></td></tr>';\r\n echo '<tr><td><span class=\"profile_label\">Email</span></td><td><span class=\"profile_info\"><a href=\"mailto:' . $user_email . '\">' . $user_email . '</a></span></td></tr>';\r\n echo '<tr><td><span class=\"profile_label\">Registered On</span></td><td><span class=\"profile_info\">' . $registered_date . '</span></td></tr>';\r\n echo '</table>';\r\n\r\n echo '</td>\r\n </tr></table>';\r\n}", "public function show($id)\n {\n $this->logger->info(\"Entering ProfileController::show()\", array('ProfileID'=>$id));\n\n // If user is not admin or the profile being accessed is not their own, reroute to mainpage\n if(session('userRole') != 3 && session('userID') != $id)\n {\n $this->logger->info(\"Exiting ProfileController::show()\");\n\n return redirect('/');\n }\n // Get User Profile and return displayProfile view\n else\n {\n // Get User data\n $user = UserService::getUserById($id);\n\n // Get User's Profile data\n $profileModel = ProfileService::getProfileByUserID($id);\n\n $this->logger->info(\"Exiting ProfileController::show()\");\n\n // Return view ith user and profile data\n return view('profiles/displayProfile')->with('profile', $profileModel)->with('user', $user);\n }\n\n }", "public function show($id)\n {\n \n $profile = Profile::find($id);\n \n if(auth()->user()->id !== $profile->user_id){\n return redirect(route('home'));\n }\n \n return view('profiles.show')->with('profile', $profile);\n }", "public function show($id)\n {\n $client_id=$id;\n $client = Client::findOrFail($id);\n $brands = Brandcontacts::where('client_id',$id)->distinct()->select('id','name')->get();\n $roles = (new Role)->getRolesForClientUser();\n $customFields = Settings::getEnableFields($id);\n $states = Zipcodes::groupBy('state')->get();\n $restrictionFields = SettingTPVnowRestrictedTimeZone::where('client_id',$client_id)->get();\n // dd($states);\n return view('client.edit',compact('client', 'client_id','brands','roles','customFields', 'states','restrictionFields'));\n }", "public function show(int $id_cliente)\n {\n //\n }", "public function detail_user($id_user)\n {\n \n //recupere l'utilisateur connecte\n $user = DB::table('authentifications')->where('id_user', $id_user)->first();\n \n return view('users.profile', compact('user'));\n }", "public function see_profile($user_id=NULL){\n\n\t\t#if user is blank, they're not logged in; redirect to login page\n\t\tif(!$this->user){\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# get this user's data\n\t\t$q = \"SELECT \n\t\t\t\tusers.first_name,\n\t\t\t\tusers.last_name,\n\t\t\t\tusers.location,\n\t\t\t\tusers.bio\n\t\t\tFROM users \n\t\t\tWHERE user_id=\".$user_id;\n\n\t\t$data = DB::instance(DB_NAME)->select_row($q);\n\n\t\t# setup view\n\n\t\t$this->template->content = View::instance('v_users_seeprofile');\n\t\t$this->template->content->user_name = $data['first_name'];\n\t\t$this->template->content->bio = $data['bio'];\n\t\t$this->template->content->location = $data['location'];\n\n\n\t\t# set title in template\n\t\t$this->template->title = \"Profile of \".$data['first_name'];\n\n\t\t# render view\n\t\techo $this->template;\n\n\t}", "public function show($id)\n {\n //\n return view('admin.client.show')\n ->with('client', Client::findOrFail($id));\n }", "public function show($id)\n {\n $client = client::find($id);\n return view('clients.show')->with('client',$client);\n }", "public function actionProfile($id)\n\t{\n\t\t$this->render('profile',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function profile($id = NULL, $number = NULL) {\n $data['result'] = $this->Client_model->perfil($id);\n $data['info'] = $this->Client_info_model->perfil($id);\n $data['visits'] = $this->Client_info_model->visita($id);\n $data['property'] = $this->Client_info_model->propiedad($id);// (fix para compradores con multiples unidades)\n $data['notes'] = $this->Client_info_model->notas($id);\n $data['bank'] = $this->Bank_model->listar();\n\n $data['unity'] = $this->Client_info_model->compra($number);// (fix para compradores con multiples unidades)\n $data['parking'] = $this->Client_info_model->parkeo($data['unity'][0]['property_unity_id']);// (fix para compradores con multiples unidades)\n $data['total'] = $this->Client_info_model->montototal($id, $data['unity'][0]['property_unity_id']);\n $data['transactions'] = $this->Client_info_model->transacciones($id, $data['unity'][0]['property_unity_id']);// (fix para compradores con multiples unidades)\n\n // header\n $this->load->view('templates/header');\n // sidebar\n $this->load->view('templates/menu');\n // main\n $this->load->view('pages/cliente', $data);\n //echo json_encode($data);\n // footer\n $this->load->view('templates/footer');\n }", "public function viewprofile($id = Null,$profile= Null) {\n\t\t\n\t\t$this->layout = \"frontend\";\n\t\t$this->loadmodel(\"Userdetail\");\n\t\t$this->Userdetail->virtualFields = array(\n\t\t\t\"wishlist\"=>\"Select count(*) from user_wishlist_courses as Wishlistcourse where Wishlistcourse.user_id = Userdetail.user_id\",\n\t\t\t\"learning\"=>\"Select count(*) from user_learning_courses as Learningcourse where Learningcourse.user_id = Userdetail.user_id and Learningcourse.completed = 0\",\n\t\t\t\"completed\"=>\"Select count(*) from user_learning_courses as Learningcourse where Learningcourse.user_id = Userdetail.user_id and Learningcourse.completed = 1\",\n\t\t\t\"countcourse\"=>\"Select count(*) from courses as Course where Course.user_id = Userdetail.user_id\"\n\t\t);\n\t\t$user = $this->Userdetail->find(\"all\",array(\"conditions\"=>array(\"User.id\"=>$id),\"fields\"=>array(\"User.id\",\"User.username\",\"User.loginfrom\",\"User.status\",\"User.created\",\"User.profiletype\",\"Userdetail.first_name\",\"Userdetail.user_id\",\"Userdetail.last_name\",\"Userdetail.paypalaccount\",\"Userdetail.about\",\"Userdetail.city\",\"Userdetail.phone\",\"Userdetail.image\",\"Userdetail.wishlist\",\"Userdetail.learning\",\"Userdetail.completed\",\"Userdetail.countcourse\",\"State.name\",\"Country.name\",\"Userdetail.biography\",\"Userdetail.privacy\")),array(\"recursive\"=>0));\n\t\t\n\t\t// count followers\n\t\t$this->loadModel('Follower');\n\t\tif($this->Session->read('Auth.User.id')){\n\t\t\tif($this->Session->read('Auth.User.id') == $id){\n\t\t\t\t$this->Follower->virtualFields = array(\n\t\t\t\t\t\"Followers\"=>\"select count(*) from followers where user_id=\".$this->Session->read('Auth.User.id'),\n\t\t\t\t\t\"Following\"=>\"select count(*) from followers where follower_id=\".$this->Session->read('Auth.User.id')\n\t\t\t\t);\n\t\t\t\t$follower = $this->Follower->find('first', array('fields'=>array('Follower.Followers', 'Follower.Following')));\n\t\t\t} else{\n\t\t\t\t$this->Follower->virtualFields = array(\n\t\t\t\t\t\"Followers\"=>\"select count(*) from followers where user_id=\".$id,\n\t\t\t\t\t\"Following\"=>\"select count(*) from followers where follower_id=\".$id,\n\t\t\t\t\t\"Followed\" => \"select id from followers where follower_id=\".$this->Session->read('Auth.User.id').\" and user_id =\".$id.\" Limit 1\"\n\t\t\t\t);\n\t\t\t\t$follower = $this->Follower->find('first', array('fields'=>array('Follower.Followers', 'Follower.Following','Follower.Followed')));\n\t\t\t}\n\t\t\t$this->set('follower', $follower);\n\t\t} else {\n\t\t\t$this->Follower->virtualFields = array(\n\t\t\t\t\"Followers\"=>\"select count(*) from followers where user_id=\".$id,\n\t\t\t\t\"Following\"=>\"select count(*) from followers where follower_id=\".$id\n\t\t\t);\n\t\t\t\t$follower = $this->Follower->find('first', array('fields'=>array('Follower.Followers', 'Follower.Following')));\n\t\t\t$this->set('follower', $follower);\n\t\t}\n\t\t$privacy = unserialize($user[0]['Userdetail']['privacy']);\n\t\t$this->set(compact(\"privacy\"));\n\t\t\n\t\tif(!empty($user[0])) {\n\t\t\t$this->set(\"title_for_layout\",$user[0][\"Userdetail\"][\"first_name\"].' '.$user[0][\"Userdetail\"][\"last_name\"]);\n\t\t\t$this->set(\"user\",$user[0]);\n\t\t} else { \n\t\t\t$this->Session->setFlash(\"Invalid User.\");\n\t\t\t$this->redirect(\"/dashboard\");\n\t\t}\n\t}", "public function show($id)\n {\n $userdata = User::with('currency')->with('Tbl_user_types')->find($id);\n $data['userdata'] = $userdata;\n return view('admin.users.profile')->with('data', $data);\n }", "public function show($id)\n {\n \n $profile = Profile::find($id);\n if (!empty($profile->uid)) {\n $user = User::find($profile->uid);\n return view('profile.show')->with([\n 'Profile'=>$profile,\n 'user'=>$user,\n ]);\n }else{\n return redirect('/profile');\n }\n \n }", "public function showProfile(Request $request, $id);", "public function show(client $client){}", "public function show($id)\n {\n $client = Client::find($id);\n // $sales_invoices = DB::select(\"SELECT * FROM sales_invoices si JOIN clients c ON si.client_id = c.id WHERE c.id='$id'\");\n // $sales_invoices = SalesInvoice::where('client_id', $id);\n $sales_invoices = SalesInvoice::where('client_id',$id)->orderby('date', 'desc')->paginate(10);\n return view('clients.show', compact('client', 'sales_invoices'));\n }", "public function show($id)\n {\n\n $customer = Customer::find($id);\n $numTreatments=0;\n //$treatments = Treatment::orderBy('name', 'ASC')->get();\n\n $treatments = DB::table('customers')\n ->join('treatments_customers', 'treatments_customers.customers_id', '=', 'customers.id')\n ->join('treatments', 'treatments_customers.treatments_id', '=', 'treatments.id')\n ->join('users', 'treatments_customers.users_id', '=', 'users.id')\n ->select('treatments.name', 'treatments.amount', 'treatments.description', 'users.name as username')->where('treatments_customers.customers_id', '=', $id)\n ->get();\n\n if(isset($treatments)){\n $numTreatments=count($treatments);\n }\n \n //return view('tratamientos_list.index', compact('treatments','numTreatments') );\n return view('clientes.profile', compact('customer','treatments','numTreatments') );\n }", "public function show($id)\n {\n $user = User::find($id);\n\t\t\t//dd($user->toArray());\n\t\t$userProviders = UserProvider::where('is_confirmed', 1)\n ->where('user_id', $user->id)\n ->get();\n\t\t//dd($userProviders->toArray());\n\t\treturn view('admin.clients.show', ['user' => $user, 'userProviders' => $userProviders]);\n }", "public function show($id)\n {\n $user = User::find($id);\n return view('frontend.profile.index',[\n 'active'=>'none',\n 'user'=>$user,\n ]);\n }", "public function edit($id)\n {\n $profile = Client::findOrFail($id);\n\n return view('client_profile.edit', compact('profile'));\n }", "public function profile($id)\n {\n $module_title = $this->module_title;\n $module_name = $this->module_name;\n $module_path = $this->module_path;\n $module_icon = $this->module_icon;\n $module_model = $this->module_model;\n $module_name_singular = str_singular($module_name);\n $module_action = 'Show';\n\n $$module_name_singular = $module_model::findOrFail($id);\n $userprofile = Userprofile::where('user_id', $$module_name_singular->id)->first();\n\n $body_class = 'profile-page';\n\n return view(\"frontend.$module_name.profile\", compact('module_name', 'module_name_singular', \"$module_name_singular\", 'module_icon', 'module_action', 'module_title', 'body_class', 'userprofile'));\n }", "function profile($id = 0){\n\t\t$this->loadModel();\n\t\t$user = $this->Users->findFirst(array(\n\t\t\t'conditions' => array('id_utilisateur' => $id\n\t\t)));\n\n\t\tif(empty($user)){\n\t\t\t$this->session->setFlash('Cet utilisateur n\\'existe pas', 'error');\n\t\t\treturn $this->redirect(WEBROOT);\n\t\t}\n\t\t$this->render(__FUNCTION__, array('user' => $user));\n\t}", "public function show($id){\n\t\t\n\t\t\n\t}", "static function profile_info($id) {\n return self::$db->where('user_id',$id)->get('account_details')->row();\n }", "public function view($id = NULL)\n\t{\n\t\t// No user? Show a 404 error. Easy way for now, instead should show a custom error message\n\t\tif (!$user = $this->ion_auth->get_user($id) )\n\t\t{\n\t\t\tshow_404();\n\t\t}\n\n\t\tforeach ($user as $field => &$data)\n\t\t{\n\t\t\t$data = escape_tags($data);\n\t\t}\n\n\t\t// Render view\n\t\t$this->data->user = $user; //what data used, user or profile?\n\t\t$this->data->profile = $user;\n\t\t$this->template->build('profile/view', $this->data);\n\t}", "public function profileAction($id = null) {\n if($id === null) {\n $user = $this->getUser();\n } else {\n $user = $this->getDoctrine()->getManager()->getRepository('AnticomShowcaseBundle:User')->find($id);\n }\n\n return $this->render(\n 'AnticomShowcaseBundle:User:profile.html.twig',\n array(\n 'user' => $user\n )\n );\n }", "public function show($user_id)\n {\n \n \n \n }", "function getUserProfileByID(){\n $id = $this->input->post('id');\n $data = $this->hotspot->getUserProfileByID(array('id'=> '*'.$id));\n if($data){\n echo json_encode($data);\n }\n }", "public function showUser($id)\n {\n \n $objectUser = Users::getInstancia();\n $users = $objectUser->get($id);\n\n $this->renderHtml('../views/userOnly_view.php', $users);\n }", "public function showprovinsi($id)\n {\n //\n }", "public function show($id){\n\t\t//\n\t}", "public function show($id){\n\t\t//\n\t}", "public function show($id)\n {\n //\n $client=Client::find($id);\n\n\n return view('clients.show',compact('client'));\n }", "public function getProfile($id)\n {\n $title = \"Profil\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"id\", $id);\n\n $data = [\n \"user\" => $user\n ];\n\n $view->add(\"user/profile\", $data);\n \n $pageRender->renderPage([\"title\" => $title]);\n }", "public function show($id)\n {\n $profile = DB::table('users')->where('id', '=', $id)->get();\n return $profile;\n }", "public function show($id)\n {\n $client = User::find($id);\n\n return view('gestionnaire.clients.show')->with('client', $client);\n }", "public function profile() {\n\t\t$this->page->auxiliar['states'] = CepStates::getAlltoSelectList( [ 'id', 'description' ] );\n\t\t$view = view( 'client.profile' )\n\t\t\t->with( 'Data', $this->client )\n\t\t\t->with( 'Page', $this->page );\n\t\treturn $view;\n\t}", "public function profile ( $id ) {\n return view( 'candidate.profile' )->with( 'candidate', $this->candidate->find( $id ) );\n }" ]
[ "0.8315216", "0.7622339", "0.75908226", "0.7438452", "0.73792624", "0.73337406", "0.7301291", "0.7284491", "0.7248948", "0.7246461", "0.72455364", "0.72287434", "0.7227837", "0.7217809", "0.720417", "0.7197577", "0.7192178", "0.7185664", "0.71644944", "0.7144957", "0.7100887", "0.7082731", "0.704513", "0.70397323", "0.7022655", "0.70203847", "0.70182824", "0.7013819", "0.70120686", "0.70100737", "0.7004631", "0.6995208", "0.69921535", "0.69919544", "0.6979268", "0.6978649", "0.6975666", "0.6973495", "0.69587016", "0.6957968", "0.6956138", "0.6947836", "0.69431657", "0.6934727", "0.69245136", "0.6921073", "0.6916502", "0.69138145", "0.6910093", "0.69084466", "0.690767", "0.69064945", "0.6900919", "0.6895528", "0.6895352", "0.68902224", "0.68896604", "0.6889155", "0.6885204", "0.68766373", "0.6876594", "0.68763644", "0.68732", "0.6869102", "0.6859815", "0.68592393", "0.68581784", "0.68497616", "0.68398345", "0.68353426", "0.68350744", "0.6824784", "0.68237746", "0.6820383", "0.68131244", "0.68124187", "0.6802699", "0.6800397", "0.6798871", "0.6792442", "0.67915297", "0.6789667", "0.6788249", "0.6788175", "0.6785552", "0.67836225", "0.6781116", "0.6776543", "0.6774583", "0.67725474", "0.6771338", "0.6768843", "0.6768173", "0.6768173", "0.6767241", "0.6767132", "0.67668957", "0.67664146", "0.6764756", "0.6760472" ]
0.7872422
1
/ function to update quantity of items recieve parameters $request to get the qty number return view
Функция для обновления количества товаров получает параметр $request, чтобы получить число qty и возвращает представление
public function updateQty(Request $request) { // check if we have a cart -> get it's data in session $oldCart = Session::has('cart') ? Session::get('cart') : null; // create an object from Caert class $cart = new Cart($oldCart); // pass parameters to the update() function $cart->updateQty($request->id, $request->quantity); // put the cart data in the session Session::put('cart', $cart); return redirect('/cart'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, $id)\n {\n\n/************************************ */\n // Change the quantity of items\n/************************************ */\n\n }", "public function updateQtyAction()\n {\n try {\n $creditmemo = $this->_initCreditmemo(true);\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update the item\\'s quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }", "public function update(Request $request)\n {\n if($request->get('product_id') && $request->get('increment') == 1 ){\n $get = Cart::get($request->get('product_id'));\n Cart::update($request->get('product_id'), $get->qty + 1);\n }\n\n if($request->get('product_id') && $request->get('decrease') == 1 ){\n $get = Cart::get($request->get('product_id'));\n Cart::update($request->get('product_id'), $get->qty - 1);\n }\n\n $cart = Cart::Content();\n\n \\Session::flash('success_update_cart', 'Qty Berhasil update!');\n return redirect()->route('cart');\n }", "public function updateQuantity(Request $request){\n //Ver si hay que borrar la cantidad y luego añadir o solo actualizar\n $userId = auth()->user()->id;\n \n \\Cart::session($userId)->update($request->id_product, [\n 'quantity' => [\n 'relative' => false,\n 'value' => $request->quantity_product,\n ]\n ]);\n\n $product = \\Cart::session($userId)->get($request->id_product);\n $data = [\n 'subtotal_product' => $product->getPriceSum(),\n 'subtotal_cart' => \\Cart::session($userId)->getSubTotal(),\n 'total_cart' => \\Cart::session($userId)->getTotal(),\n 'cart_quantity' => \\Cart::session($userId)->getTotalQuantity(),\n ];\n \n return json_encode($data);\n }", "public function updateQuantity(Request $request)\n {\n //this functions updates the quantity of the product in the cart when user changes\n $quantity=$request->input('quantity');\n $productName=$request->input('productName');\n $update=Cart::where([\n ['status','=','Pending order'],\n ['product_name','=',$productName]\n ])->update(['quantity'=>$quantity]);\n return true;\n }", "public function update(Request $request)\n {\n $cartCollection = Cart::getContent();\n $totalCart = Cart::getTotal();\n if ( ! $totalCart) {\n $request->session()->flash('error', trans('front.cart.cart_not_found'));\n return redirect(route('cart_list'));\n }\n\n $rules = array();\n foreach($cartCollection as $cart) {\n $product = Product::find($cart->id);\n $max = '';\n if($product !== NULL) {\n $max = '|min:'.$product->quantity_limit.'|max:' . $product->quantity;\n }\n $rules['quantity_'.$cart->id] = 'required|integer'.$max;\n }\n\n // run the validation rules on the inputs from the form\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect(route('cart_list'))\n ->withErrors($validator)\n ->withInput();\n }\n\n $n = 0;\n foreach($cartCollection as $cart) {\n $rowCart = Cart::get($cart->id);\n if($rowCart !== NULL) {\n Cart::update($cart->id, array('quantity' => array('relative' => false, 'value' => $request->get('quantity_' . $cart->id))));\n $n++;\n }\n }\n $request->session()->flash('success', sprintf(trans('common.msg_num_update_success'), $n));\n return redirect(route('cart_list'));\n }", "public function updateCartQuantity(Request $request)\n {\n extract($this->apiDefaultData);\n \n if($request->quantity && $cart = $this->repository->updateCartQuantity($request->quantity)){\n $status = true;\n \n $data = $cart;\n return $this->json(compact($this->apiSystemVars))->withCookie(cookie('cart_id', $cart->id, 365*24*60));\n }else{\n $data = null;\n $message = 'Lỗi không xác định';\n return $this->json(compact($this->apiSystemVars));\n }\n\n \n }", "public function update(Request $request, $id)\n {\n foreach($request->qty as $k=>$q){\n Cart::update($request->id[$k], array(\n 'quantity' => [ 'relative'=>false,'value'=>$q ], // so if the current product has a quantity of 4, another 2 will be added so this will result to 6\n ));\n }\n\n return back();\n\n }", "public function changeQuantity(){\n\t\t$id = Input::get('rowid');\n\t\t$quantity = Input::get('qty');\n\n\t\t$isUpdated = Cart::update($id, $quantity);\n\t\tif(!$isUpdated){\n\t\t\t// is not updated\n\t\t}\n\n\t\treturn Cart::get($id);\n\n\n\t\treturn Redirect::back()->with('success', CART_QUANTITY_CHANGED);\n\t}", "public function update(Request $req)\n {\n $i = 0;\n foreach (Cart::content() as $item) {\n $itemRowId = $item->rowId;\n Cart::update($itemRowId, $req->qty[$i]);\n $i++;\n }\n return redirect()->route('cart.view')->with('message', 'cart updated');\n }", "public function update(Request $request)\n {\n $qty = $request->action == 'plus' ? 1 : -1;\n $product = Product::find($request->pid);\n if($product)\n {\n if($request->qty == 1 && $qty == -1){\n \\Cart::session(session()->getId() ?? Auth::id())->remove($request->pid);\n }else{\n \\Cart::session(session()->getId() ?? Auth::id())->update($request->pid,['quantity' => $qty]);\n }\n return redirect()->route('cart.index');\n }\n }", "public function changeQuantity(Request $request)\n {\n $orderId = $request->session()->get('cart_order_id');\n $cartOrder = CartOrder::find($orderId);\n $cartOrderFoodIds = $cartOrder->cartOrderFoodIds($request);\n\n $this->validate($request, [\n 'food_quantity' => 'required|numeric|min:1|max:15',\n 'cart_order_food_id' =>'required|numeric|in:'.$cartOrderFoodIds\n ]);\n $foodToUpdate = CartOrderFood::find($request->cart_order_food_id);\n $foodToUpdate->food_quantity = $request->food_quantity;\n $foodToUpdate->save();\n $foodId = $foodToUpdate->food_id;\n $discountId = $foodToUpdate->discount_id;\n if(empty($discountId) || is_null($discountId))\n {\n $discountId = 0;\n }\n $mainFood = Food::find($foodId);\n $mainFoodPrice = $mainFood->price;\n $tax = new Tax();\n $salesTax = $tax->getSalesTax();\n $localTax = $tax->getLocalTax();\n\n return response()->json(['foodPrice' => $mainFoodPrice, 'salesTax' => $salesTax, 'localTax' => $localTax, 'discountId' => $discountId ]);\n }", "public function update(Request $request)\n {\n $carts = Cart::content();\n\n $index = 1;\n foreach ($carts as $key => $cart) {\n $rowId = $cart->rowid;\n $qty = Input::get('qty_'.$index);\n $subs = Input::get('subs_'.$index);\n if($subs > 0){\n $price = $cart->price - (15/100*$cart->price);\n }else{\n $price = $cart->price;\n }\n $data = array(\n 'qty' => $qty,\n 'price' => $price,\n 'options' => array(\n 'subs' => $subs,\n ),\n\n );\n Cart::update($rowId,$data);\n $index++;\n }\n //end foreach carts\n return redirect('cart/view')->with('message', 'item updated');\n\n }", "public function updateQuantityP()\n\n {\n\n $item = $this->input->post('rowid');\n\n $qty = $this->input->post('qty');\n\n $total = $this->cart->total_items();\n\n $data = array(\n\n 'rowid' => $item,\n\n 'qty' => $qty\n\n );\n\n $this->cart->update($data);\n\n $data['check'] = true;\n\n $data['count']=$this->cart->total_items();\n\n sleep(1);\n\n $data['items'] = $this->cart->contents();\n\n $this->load->view('carts/update_cartp',$data);\n\n }", "public function update(Request $request)\n {\n // so we are going to have to go throught the cart array and get the number of items and the item ids of each(array)\n // then loop though each one and update the qty by the number passed.\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n\n $cart->totalAdults = $request->adults;\n $cart->totalChildren = $request->children;\n\n return $request->all();\n\n $products = $cart->items;\n foreach($products as $items) {\n\n $id = $items['item']['id'];\n $activity = Activity::find($id);\n $cart->update($activity, $activity->id, $request->adults);\n \n }\n\n $request->session()->put('cart', $cart);\n\n\n //return var_dump($cart);\n \n\n return redirect('/'); \n\n\n\n }", "public function incrementItem(Request $request)\n {\n \n $rowId = $request->rowId;\n $qty =$request->cart_qty;\n $subTotal=$request->subTotal;\n $productPrice = $request->priceu;\n if($qty == null ||$rowId == null){\n $quantityError = \"sorry quantity is empty\";\n return response()->json(['quantityError' =>$quantityError]);\n }\n if(!empty($qty)){\n $qty++;\n }\n $subTotal = $subTotal+$productPrice;\n $couponType=$request->coupontype;\n $couponValue=$request->couponvalue;\n if($couponValue == null){\n $couponValue=0;\n }\n $coupons = Coupon::get();\n if($coupons == null){\n return response()->json(['coupon' =>$coupon]);\n }\n if($couponType == 0){\n $couponAmount = $subTotal-$couponValue; \n $total=$couponAmount;\n }\n else{\n $couponAmount =$subTotal*($couponValue/100);\n $total=$subTotal-$couponAmount;\n }\n $update = Cart::update($rowId, $qty);\n $updateprice= $update->subtotal();\n return response()->json(['quantity' =>$update,'updateprice' =>$updateprice, 'subTotal' => $subTotal,'couponvalue' => $couponValue,'couponamount' =>$couponAmount,'total' =>$total]);\n }", "public function update(Request $request, $id)\n {\n Cart::update($id, [\n 'quantity' => ['relative' => false, 'value' => $request->quantity],\n ]);\n return redirect(route('panier.index'));\n}", "public function update(Request $request, $id) {\n \n //\n \n Cart::update($id, $request->qty);\n }", "public function update(Request $request)\n {\n\n Cart::where('pizza_id', $request->pizza_id)\n ->update([\n 'quantity' => $request->quantity, \n ]);\n \n return redirect('/user/view-cart');\n }", "public function updateQty($id){\n Auth::userAuth();\n Csrf::CsrfToken();\n if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['upQty']){\n $qty = $_POST['qty'];\n\n if ($qty < 1 && empty($qty)) {\n Redirect::to('carts');\n }else {\n $this->cartModel->updateQty($id,$qty);\n Session::set('success', 'Qty has been updated');\n Redirect::to('carts');\n }\n }\n }", "public function update(Request $request, $id)\n {\n //\n $this->validate($request,[\n 'quantity'=>'required|numeric|between:1,5'\n ]);\n $cart= Cart::update($id,$request['quantity']);\n session()->flash('success','quantity of product updated successfully');\n return response()->json(['success'=>true],200);\n }", "public function update(Request $request)\n {\n $bill = $this->billService->findByID($request->id);\n if ($bill instanceof Bill) {\n try {\n $params = $request->all();\n\n // Open transaction\n DB::beginTransaction();\n //\n\n $bill = $this->billService->updateData($params, $bill->id);\n\n // reduct quantity product\n if($bill->status == 3) {\n foreach ($bill->billProducts as $item) {\n $quantity = $item->quantity - $item->pivot->first()->quantity;\n // dd($quantity, $item->quantity, $item->pivot->first()->quantity );\n $this->productService->updateData(['quantity' => $quantity],$item->id);\n }\n }\n // Commit transaction\n DB::commit();\n //\n return $this->responseJSON(true, trans('success'), 200);\n } catch (\\Exception $e) {\n // Rollback transaction\n DB::rollBack();\n return $this->responseJSON(false, trans('fail'));\n }\n } else {\n return $this->responseJSON(false, trans('Not Found Bill'));\n }\n }", "public function update(Request $request)\n {\n // Find the Cart & update it\n $carts = Session::get('cart', []);\n\n // Loop over each cart data\n foreach ($carts as &$cart) {\n // If found the intended\n if ($cart['product_id'] == $request->id) {\n // Update it's value\n $cart['qty'] = $request->qty;\n }\n }\n\n // Update cart data\n Session::put('cart',$carts);\n\n // return response\n return response()->json(Session::get('cart'));\n }", "public function updateProduct(Request $request)\n {\n $param = $request->except('_token');\n $product = Product::where('id', $param['product_id'])->first();\n\n if($param['quantity'] == '1')\n {\n $param['quantity'] = $product->quantity + 1;\n $product->update($param);\n return $this->backWithMessage('success add', 'Quantity of \"' . $product->name . '\" has been increased of 1');\n }\n else\n {\n if(!$product->quantity <= 0)\n {\n $param['quantity'] = $product->quantity - 1;\n $product->update($param);\n }\n return $this->backWithMessage('success delete', 'Quantity of \"' . $product->name . '\" has been decreased of 1');\n }\n }", "public function qtyCommitted(Request $request)\n {\n $update = SalesOrderItems::updatedata($request);\n\n if ($update !== false) {\n return redirect('/reallocate_item')->with('success', 'Successfully reallocated item!');\n } else {\n return Redirect::back()->withErrors('Failed to reallocate items. Please try again.')->withInput();\n }\n }", "public function update(Request $request, $id)\n {\n //\n $borrowedItems = DB::table('event')\n ->select('*')\n ->where('event.event_id', '=', $id)\n ->join('event_inventory', 'event.event_id', '=', 'event_inventory.event_id')\n ->join('inventory', 'event_inventory.inventory_id', '=' ,'inventory.inventory_id')\n ->get();\n\n // foreach($borrowedItems as $i){\n // $item = DB::table('inventory')\n // ->where('inventory_id', '=', $i->inventory_id)\n // ->update([\n // 'quantity' => $request->input('quantity'),\n // ]);\n // }\n // dd($borrowedItems);\n\n $a = array();\n $b = array();\n $i = 0;\n\n // foreach($request->input('qtyReturnArray') as $i){\n // $i\n // }\n $a = $request->input('idReturnArray');\n $b = $request->input('qtyReturnArray');\n\n $c = explode (\",\", $a); \n $d = explode (\",\", $b); \n \n\n $id = $c;\n $number = $d;\n\n // dd($id, $number);\n\n for($i = 0; $i < count($c) ; $i++)\n {\n // $item = inventory::find( $c[$i] );\n // $item->increment('quantity',$d[$i]);\n $number = (int)$d[$i];\n $id = (int)$c[$i];\n\n // dd($id);\n\n // dd($number);\n // dd($number,$id);\n // $item = DB::update('update cvjdb.inventory set quantity = (quantity + '. $number .') where inventory_id = ' . $id . ';');\n \n // $quantity = DB::table('inventory')\n // ->select('quantity')\n // ->where('inventory.inventory_id', '=', $id)\n // ->get();\n\n // $item = inventory::find($id);\n\n // dd($item->quantity);\n\n if($number != null){\n // $item = DB::table('inventory')\n // ->where('inventory_id', '=', $id)\n // ->update([\n // 'quantity' => $quantity[0]->quantity+$number,\n // ]);\n $item = inventory::find($id);\n $item->quantity = ($item->quantity + $number);\n $item->save();\n } \n\n }\n\n // dd($number[1]);\n\n \n \n \n return redirect('/returnInventory')->with('success', 'Item(s) Returned');\n\n }", "public function update(Request $request, $id)\n {\n if($request->quantity < 2000)\n {\n Cart::update($id, $request->quantity);\n session()->flash('successm','quantity was updated succesfully');\n return response()->json(['success'=> true]);\n }\n else\n {\n return redirect()->route('cart.index')->with('success','sorry you cant order more than 5 item');\n }\n }", "public function update(Request $request)\n {\n if($request->id and $request->quantity)\n {\n $cart = Session::get('cart');\n $cart[$request->id][\"quantity\"] = $request->quantity;\n Session::put('cart', $cart);\n return redirect()->back()->with('success', 'Cart updated ');\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'qty' => 'required',\n ]);\n $item = OrderItem::find($id);\n $item->qty = $request->input(\"qty\");\n $item->save();\n\n // update Total price\n $items = OrderItem::where('order_id', $item->order_id)->get();\n $total = 0;\n foreach ($items as $item) {\n $total = $total + ($item->product->price * $item->qty);\n }\n $order = Order::where('id', $item->order_id)->first();\n $order->total_price = $total;\n $order->save();\n\n Session::flash(\"success\", \"berhasil merubah data\");\n Log::desc('mengubah pesanan ' . $item->product->name . ' ' . $request->input('number'));\n\n return redirect()->to('/order/' . $item->order_id);\n }", "public function updateQuantity()\n\n {\n\n $item = $this->input->post('rowid');\n\n $qty = $this->input->post('qty');\n\n $couponcode = $this->input->post('couponcode');\n\n $shipping = $this->input->post('shipping');\n\n $data = array(\n\n 'rowid' => $item,\n\n 'qty' => $qty\n\n );\n\n $this->cart->update($data);\n\n $data['check'] = true;\n\n sleep(1);\n\n $price_shipping = $this->cartmodel->getFirstRowWhere('province',array(\n\n 'id' => $shipping\n\n ));\n\n if($shipping==0){\n\n $price_shipping = 0;\n\n }else{\n\n $data['item'] = $this->cartmodel->getFirstRowWhere('province',array(\n\n 'id' => $shipping\n\n ));\n\n $price_shipping = $data['item']->price;\n\n }\n\n $total1= $this->cart->total() - $this->cart->total()*$couponcode/100;\n\n $data['total_cart'] = $total1 + $price_shipping;\n\n $data['id_province'] = $shipping;\n\n $data['shipping'] = $price_shipping;\n\n $data['couponcode'] = $couponcode;\n\n $data['items'] = $this->cart->contents();\n\n $data['ships'] = $this->cartmodel->get_data('province',null);\n\n $this->load->view('carts/update_cart',$data);\n\n }", "public function updateCart($idproducto)\n{\n //$val=$this->context->cart->updateQty(1, $idproducto);\n return array(\"result\"=>t);\n\n}", "public function update(Request $request, $id)\n {\n Cart::update($id,$request->qty);\n return back();\n }", "public function update(Request $request)\n {\n //si se mando el id y la cantidad en el request\n if($request->id and $request->quantity)\n {\n //se obtiene el carrito de la sesion\n $cart = session()->get('cart');\n \n //se cambia la cantidad del producto por la recibida en el request\n $cart[$request->id][\"quantity\"] = $request->quantity;\n \n //se agrega el carrito creado a la sesion\n session()->put('cart', $cart);\n \n //se redirecciona al usuario a la pagina donde estaba\n session()->flash('success', 'Cart updated successfully');\n }\n }", "public function updateItems(Request $request) { \n $currentUser = JWTAuth::parseToken()->authenticate();\n $id=$currentUser->id;\n $items = json_decode($request->items);\n foreach($items as $item) {\n DB::table('carts')\n ->where('id', $item->product_id)\n ->update(['amount' => $item->amount]);\n }\n\n return response()->json([\n \t\t\"acknowledge\" => 1,\n \t\t\"message\" => 'These items has been updated and ready to checkout'\n \t]);\n }", "public function updateOrderCart(Request $request) \n\t{\n\t\t$id = $request->id;\n\t\t$size = $request->size;\n\t\t$customizable = $request->customizable;\n\t\t$quantity = $request->quantity;\n\t\t$productList = Session::get('OrderCart');\n\t\t\n\t\tforeach($productList as $item => &$value) \n\t\t{\n\t\t\tif ($value['id'] == $id && $value['size'] == $size && $value['customizable'] == $customizable) \n\t\t\t{\n\t\t\t\t$value['quantity'] = $quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSession::forget('OrderCart');\n\t\tSession::put('OrderCart', $productList);\n\t\treturn view('admin.order-content-update');\n\t}", "function update()\n\t{\n\t\tglobal $con;\n $UserID = $_SESSION['user']->getUserId(); \n\t\t$id=$_GET['id'];\n\t\t$quantity=$_GET['quantity'];\n\t $query=\"update shopping_cart set quantity=$quantity where item_id=$id and user_id=$UserID\";\n\t mysqli_query($con,$query);\n\t}", "public function updateCart(Request $request) \n\t{\n\t\t$id = $request->id;\n\t\t$size = $request->size;\n\t\t$customizable = $request->customizable;\n\t\t$quantity = $request->quantity;\n\t\t$productList = Session::get('Cart');\n\t\t\n\t\tforeach($productList as $item => &$value) \n\t\t{\n\t\t\tif ($value['id'] == $id && $value['size'] == $size && $value['customizable'] == $customizable) \n\t\t\t{\n\t\t\t\t$value['quantity'] = $quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSession::forget('Cart');\n\t\tSession::put('Cart', $productList);\n\t\treturn redirect()->route(\"cart\");\n\t}", "public function updateQuantity(ApiMenuItemUpdateQuantityRequest $request, MenuItem $menuItem) {\n $menuItem->fill($request->all());\n $menuItem->save();\n return response()->json($menuItem);\n }", "public function updateCartQuantity($id=null,$quantity=null)\n {\n DB::table('carts')->where('id',$id)->increment('product_quantity',$quantity);\n return redirect('/cart')->with('flash_message_success','Product Quantity has been Updated Successfully!');\n }", "public function update(Request $request, $id)\n {\n $product = OrderItem::find($id);\n //return $item;\n $product->quantity = $request->input('quantity');\n $product->total = $product->quantity * $product->product_price;\n $product->save();\n $product->order->sub_total = ($product->order->sub_total - $product->product_price + $product->total);\n $product->order->total_price = ($product->order->total_price - $product->product_price + $product->total);\n $product->order->save();\n return redirect('order.index');\n }", "public function update(Request $request)\n {\n if($request->id && $request->quantity){\n $cart = session()->get('cart');\n $cart[$request->id][\"quantity\"] = $request->quantity;\n session()->put('cart', $cart);\n session()->flash('info', 'سبد خرید با موفقیت به روزرسانی شد!');\n }\n }", "public function update(Request $request, $id)\n {\n //dd(Cart::content());\n //dd($request->all());\n\n // $id => rowId/product id, qty => qty input name, \n Cart::update($id,['qty'=>$request->qty,\"options\"=>['brand'=>$request->brand]]); // $request->qty is the input data from form\n\n return back(); // Return to index\n }", "public function update(Request $request, $id)\n {\n $validation = Validator::make($request->all(),[\n 'quantity' => 'required|numeric|between:1,5'\n ]);\n\n if($validation->fails()){\n session()->flash('ses_errors', collect(['Quantity must be between 1 and 5']));\n return response()->json(['success' => false], 400);\n }\n\n Cart::instance('cart')->update($id, $request->quantity);\n session()->flash('success', 'Quantity was updated successfully');\n\n return response()->json(['success' => true ]);\n }", "public function update(Request $request, $id)\n {\n cart::where('package_id',$id)->where('customer_mail',auth()->user()->email)->update([\n\n 'qty'=>$request->qty,\n \n ]);\n return Redirect()->back()->with('cart_updated','Product updated in Cart');\n }", "public function increaseItem(ShoppingCartModifyItemRequest $request)\n {\n $data = array();\n $message = array();\n $hasError = true;\n $codeResponse = 200;\n\n try {\n\n $model = $this-> service-> increaseItem($request->validated());\n\n $relationshipNames = array('items');\n $model = $this-> service-> load($model,$relationshipNames);\n\n $data['model'] = new ShoppingCartWebResource($model);\n array_push ( $message , trans('crud.shopping_cart.increase_item_success'));\n $hasError = false;\n\n }catch(\\Exception $e){\n report($e);\n array_push ( $message , $e->getMessage());\n array_push ( $message , trans('crud.shopping_cart.increase_item_error'));\n $codeResponse = $e->getCode();\n }\n\n $data['hasError'] = $hasError;\n $data['message'] = $message;\n return response()->json($data,$codeResponse);\n }", "public function update(Request $request, $id)\n {\n $validator= $this->validate($request, [\n 'quantity' => 'required|numeric|between:1,10',\n ]);\n Cart::update($id, $request->quantity);\n// flash()->message('quantity update');\n return back();\n }", "public function update(Request $request, $id)\n {\n $bl_detail = Bl_Detail::find($id);\n $old_quantity = $bl_detail->quantite_livr;\n $bl_detail->quantite_livr = $request->input('quantite_livr');\n $bl_detail->save();\n\n $bc_detail_id = $bl_detail->bc_detail_id;\n $quantity = $bl_detail->quantite_livr - $old_quantity;\n $this->CalculQuantities($bc_detail_id, $quantity);\n \n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $validate = Validator::make($request->all(), ['quantity' => 'required|numeric|between:1,10']);\n\n if($validate->fails()){\n\n session()->flash('error', 'La quantité doit être inférieur à 11.');\n return response()->json(['success' => false], 500);\n }\n\n Cart::update($id, $request->quantity);\n\n session()->flash('success', 'La quantité du produit mise à jour !');\n return response()->json(['success' => true]);\n }", "public function require_qty_update();", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|numeric|between:1,5'\n ]);\n\n if ($validator->fails()) {\n flash()->error('Quantity must be between 1 and 5.');\n return response()->json(['success' => false]);\n }\n\n $this->cart->update($id, $request->quantity);\n\n flash()->success('Quantity updated successfully!');\n return response()->json(['success' => true]);\n }", "public function update(Request $request, $id)\n {\n $foodbankInventory = DB::select('select * from foodbank_inventory where sFoodBank_id=:sFoodBank_id',[\n \"sFoodBank_id\"=>$id\n ]);\n\n $affected = DB::update('update foodbank_inventory set ItemCount=:ItemCount where sFoodBank_id =:sFoodBank_id and Item_id=:Item_id',[\n \"ItemCount\"=>$request->ItemCount,\n \"sFoodBank_id\"=> $id,\n \"Item_id\"=> $foodbankInventory[0]->Item_id\n ]);\n\n return \"update affected \".$affected. \" rows\";\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|numeric|between:1,5'\n ]);\n\n if ($validator->fails()) {\n session()->flash('errors', collect(['Quantity must be between 1 and 5.']));\n return response()->json(['success' => false], 400);\n }\n\n Cart::update($id, $request->quantity);\n session()->flash('success_message', 'Quantity updated!');\n return response()->json(['success' => true]);\n }", "public function update(Request $request, $id)\n {\n // Validation on max quantity\n $validator = Validator::make($request->all(), [\n 'qty' => 'required|numeric|min:1'\n ]);\n if($request->qty >0)\n {\n Cart::update($id, $request->qty);\n }\n return redirect('/cart');\n }", "public function update(ItemRequest $request, Product $product)\n {\n if(session()->has('cart')){\n $cart = session()->get('cart');\n //$cart->items[$product->id]['Qty'] = $request->qty; \n $cart->updateItem($product->id, $request->qty); \n session()->put('cart', $cart);\n }\n return redirect()->route('cart.show')->with('success', 'Qantitty successfully changed!');\n }", "function change_quantity()\n\t{\n\t\tglobal $IN, $TMPL, $FNS;\n\n\t\t//trigger array mode\n\t\t$entry_ids = $this->_xss_clean($IN->GBL('entry_ids', 'POST'));\n\n\t\t$row_ids = $this->_xss_clean(($IN->GBL('row_ids', 'POST')) ? $IN->GBL('row_ids', 'POST') : $IN->GBL('indexes', 'POST'));\n\n\t\tif (is_array($row_ids) && count($row_ids))\n\t\t{\n\t\t\tforeach ($row_ids as $row_id => $quantity)\n\t\t\t{\n\t\t\t\t$this->_change_quantity(FALSE, $quantity, $row_id);\n\t\t\t}\n\t\t}\n\t\telseif (is_array($entry_ids) && count($entry_ids))\n\t\t{\n\t\t\tforeach ($entry_ids as $entry_id => $quantity)\n\t\t\t{\n\t\t\t\t$this->_change_quantity($entry_id, $quantity);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_id = $this->_xss_clean(($IN->GBL('row_id', 'POST')) ? $IN->GBL('row_id', 'POST') : $IN->GBL('index', 'POST'));\n\n\t\t\t$this->_change_quantity($this->_fetch_param('entry_id'), $this->_fetch_param('quantity'), $row_id);\n\t\t}\n\n\t\t$this->_redirect($this->_get_redirect_url());\n\t}", "public function quantity_update_reject_order(){\n \t\tif (isset($_POST['order_id']) && !is_null($_POST['order_id']) && !empty($_POST['order_id'])){\n\n \t\t\t$this->db->select('item_id, quantity');\n\t\t\t$this->db->from('order_items');\n\t\t\t$this->db->where('order_id', $_POST['order_id']);\n\t\t\t$sql_query = $this->db->get();\n\t\t\tif ($sql_query->num_rows() > 0){\n\t\t\t\t$return_data = $sql_query->result_array();\n\t\t\t\tforeach ($return_data as $key => $value) {\n\n\t\t\t\t\t$this->db->select('quantity');\n\t\t\t\t\t$this->db->from('item');\n\t\t\t\t\t$this->db->where('id', $value['item_id']);\n\t\t\t\t\t$sql_query = $this->db->get();\n\t\t\t\t\tif ($sql_query->num_rows() > 0){\n\t\t\t\t\t\t$item_data = (array)$sql_query->row();\n\t\t\t\t\t\t$quantity = $item_data['quantity'] + $value['quantity'];\n\t\t\t\t\t\t$update_data = array('quantity' => $quantity);\n\t\t\t\t\t\t$this->db->where('id', $value['item_id']);\n\t\t\t\t\t\t$this->db->update('item', $update_data);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\techo json_encode(array(\"is_success\" => true));\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\techo json_encode(array(\"is_success\" => false));\n\t\t\t\treturn TRUE;\n\t\t\t}\n \t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n \t}", "public function update()\n\n {\n\n if($this->input->post('form_key') && $this->input->post('form_key') == $this->session->userdata('form_key'))\n\n {\n\n $total = $this->cart->total_items();\n\n\n\n // Retrieve the posted information\n\n $item = $this->input->post('rowid');\n\n $qty = $this->input->post('qty');\n\n\n\n // Cycle true all items and update them\n\n for($i=0;$i < $total;$i++)\n\n {\n\n // Create an array with the products rowid's and quantities.\n\n $data = array(\n\n 'rowid' => @$item[$i],\n\n 'qty' => @$qty[$i]\n\n );\n\n\n\n // Update the cart with the new information\n\n $this->cart->update($data);\n\n }\n\n }\n\n return redirect($_SERVER['HTTP_REFERER']);\n\n }", "private function updateQuantity()\n {\n $this->shoppingCart->setQuantity(7);\n $this->message = $this->shoppingCart->getResult();\n }", "public function update(ItemRequest $request, $id)\n\t{\n\t\tCartLogic::updateCountItem($id, $request->count);\n\n\t\treturn redirect()->route('shopping.index')->with('status', 'Product updated');\n\t}", "public function update(Request $request, $id)\n {\n // Validation on max quantity\n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|numeric|between:1,15'\n ]);\n\n if ($validator->fails()) {\n session()->flash('error_message', 'Cantidad entre 1 y 15.');\n return response()->json([\n 'success' => false,\n 'cart' => NULL\n ]);\n }\n\n Cart::update($id, $request->quantity);\n $cart = [\n 'subtotal' => '$' . Cart::instance('default')->subtotal(2, '.', ' '),\n 'total' => '$' . Cart::instance('default')->total(2, '.', ' ')\n ];\n\n return response()->json([\n 'success' => true,\n 'msg' => 'La cantidad fue actualizada',\n 'cart' => $cart\n ]);\n\n }", "public function update(Request $request, $id)\n {\n $product = Product::where('id', request()->id)->firstOrFail();\n\n if ($request->wantsJson()){\n\n if($product->stock < $request->quantity) return response()->json('Sorry...out of stock', 306);\n\n Cart::update($id, $request->quantity);\n return response()->json('Quantity updated', 201);\n\n\n\n\n\n\n\n }\n\n }", "public function update(Request $request, $rowId)\n {\n $previousItem = \\Cart::get($rowId);\n $product = Product::find($previousItem->id);\n\n if ($request->quantity > $product->amount) {\n abort(422, 'Invalid quantity');\n }\n\n $increment = $request->quantity - $previousItem->qty;\n\n $updated = \\Cart::update($rowId, $request->quantity);\n\n // DB::table('products')->where('id', '=', $previousItem->id)->decrement('amount', $increment);\n // DB::table('products')->where('id', '=', $previousItem->id)->increment('reserved', $increment);\n \n // switch ($product->category_id) {\n // case 4:\n $product->sizes->decrement($request->size, $increment);\n $product->sizes->increment('reserved' . $request->size, $increment);\n // break;\n\n // }\n\n return ['cart' => ['count' => \\Cart::count(), 'updated' => $updated]];\n }", "function updatePckgList(Request $req)\r\n{\r\n $pno=$req->input('PckgList');\r\n $pid=$req->input('PckgID');\r\n $pc=$req->input('PckgCode');\r\n for ($x = 0; $x <$pno ; $x++) {\r\n $itemID = $req->input('pli-'.$x);\r\n $icode = $req->input('pin-'.$x);\r\n $result = DB::table('inventory')->where('Item_Code', $icode)->first();\r\n $iid = $result->Item_ID;\r\n $iquantity = $req->input('piq-'.$x);\r\n $data=array('item_id'=>$pid,'needed_item'=>$iid,'needed_quantity'=>$iquantity);\r\n DB::table('item_packages')->where('item_id',$pid)->where('needed_item',$itemID)->update($data);\r\n }\r\n\r\n //update packages function\r\n $this->updateAllPackages(); \r\n return redirect()->back()->with('alert', 'Updated Package '.$pc.' item list!');\r\n\r\n}", "public function update(Request $request, $id)\n {\n //dd($request->all());\n $cart = Cart::find($id);\n\n if($cart->variant != 0 )\n {\n $variant = Variant::find($cart->variant);\n $total = $request->number*$variant->price ; \n //return response()->json(['variant'=>$variant]);\n }\n if($cart->variant == 0)\n {\n $priceProduct = Product::find($request->product_id);\n $total = $request->number*$priceProduct->price;\n }\n\n \n //dd($total);\n \n $cart->update(['price'=>$total,'number_product'=>$request->number]);\n $cart['price'] = number_format($cart->price,3) ;\n\n $buy = Buy::where('user_id',Auth::user()->id)->where('product_id',$request->product_id)->update(['quantity'=>$cart->number_product,'total_money'=>$total]);\n \n $total = Buy::where('user_id',Auth::user()->id)->sum('total_money');\n $quantity = Buy::where('user_id',Auth::user()->id)->sum('quantity');\n $total = number_format($total,3);\n\n return response()->json(['success'=>$cart,'total'=>$total,'quantity'=>$quantity]);\n \n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(),[\n 'quantity'=>'required|numeric|between:1,5'\n\n ]);\n if($validator->fails()){\n \n session()->flash('errors',collect(['Please select between 1 and 5']));\n return response()->json(['success'=>false]);//goes to response of axios with json having success false we can use error also for this\n }\n elseif($request->quantity>$request->item_quantity){\n session()->flash('errors',collect(['There is only '.$request->item_quantity.' product(s) left in stock']));\n return response()->json(['success'=>false]);\n }\n Cart::update($id, $request->quantity);\n session()->flash('success_message','Item quantity updated.');\n return response()->json(['success'=>true]);//we cant use view or redirect we can only use response or error if response goes to response if error goes to error \n // success true is just flagging success var to true nothing much\n }", "function update_cart(){\n\t$rowid = $_POST['rowid'];\n\t$price = $_POST['price'];\n\t$amount = $price * $_POST['qty'];\n\t$qty = $_POST['qty'];\n\n\t$data = array(\n\t\t'rowid' => $rowid,\n\t\t'price' => $price,\n\t\t'amount' => $amount,\n\t\t'qty' => $qty\n\t\t);\n\t$this->cart->update($data);\n\techo $data['amount'];\n\t}", "public function update_cart(Request $request)\n {\n\t\t$id = $request->get('id');\n\t\t$quantity = $request->get('quantity');\n \tif (!is_numeric($quantity)) {\n \t\treturn back();\n \t}\n\t\t \n\t\t// make quantity a minimum of 1\n\t\t$quantity=$quantity<=0 ? 1 : $quantity;\n\t\t \n\t\t// read cookie\n\t\t$cookie = $_COOKIE['cart_items_cookie'];\n\t\t$cookie = stripslashes($cookie);\n\t\t$saved_cart_items = json_decode($cookie, true);\n\t\t \n\t\t// remove the item from the array\n\t\tunset($saved_cart_items[$id]);\n\t\t \n\t\t// delete cookie value\n\t\tsetcookie(\"cart_items_cookie\", \"\", time()-3600);\n\t\t \n\t\t// add the item with updated quantity\n\t\t$saved_cart_items[$id]=array(\n\t\t 'quantity'=>$quantity\n\t\t);\n\t\t \n\t\t// enter new value\n\t\t$json = json_encode($saved_cart_items, true);\n\t\tsetcookie(\"cart_items_cookie\", $json, time() + (86400 * 30), '/'); // 86400 = 1 day\n\t\t$_COOKIE['cart_items_cookie']=$json;\n\t\t \n\t\t// redirect to product list and tell the user it was added to cart\n\t\treturn redirect('/cart');\n }", "public function update(Request $request, Sale $sale)\n {\n// dd($request->all());\n //\n\n\n $this->validate($request, [\n 'order_name' => 'required|max:60',\n 'order_phone' => 'required|max:20',\n 'order_address' => 'required|max:70',\n 'order_note' => 'required|max:70',\n 'quantity' => 'integer'\n ]);\n $sale->shipment = $request->shipment;\n $sale->update($request->all());\n foreach (array_keys($request->id) as $id){\n foreach ($sale->salesitems as $item){\n if($id == $item->id){\n $item->quantity = $request->id[$id];\n $item->update();\n }\n }\n }\n return redirect()->route('sales.index');\n }", "public function update(Request $request)\n {\n Order::where('id', '=', $request->order_id)\n ->update([\n 'product_id' => $request->product2,\n 'qty'=> $request->qty2,\n 'total' => $request->total2\n ]);\n\n return redirect()->route('orders.index');\n }", "public function updateItem($rowId, $quantity);", "public function update(Request $request)\n {\n $response = array(\n 'status' => false,\n 'message' => '',\n 'data' => '',\n );\n try {\n $aParam = json_decode($request['data'], true);\n $rowid = $aParam['id'];\n $isBundle = $aParam['isBundle'];\n $qty = $aParam['qty'];\n $cartResponse = $this->getCartModel()->update($rowid, $qty, $isBundle);\n $response['data'] = $cartResponse;\n $response['quantity'] = $this->getTotalQuantity();\n $response['total'] = $this->getTotal($addDriverCharges = true);\n $view = $this->prepareCheckoutProductData();\n $response['html_content'] = $view->render();\n $response['status'] = true;\n } catch (Exception $ex) {\n $response['message'] = $ex->getMessage();\n }\n return $response;\n }", "public function update(Request $request, $id)\n {\n $cart=Cart::find($id);\n\n $quan=$request->quantity;\n $total=$cart->price*$quan;\n $cart->update([\n 'product_id'=>$cart->product_id,\n 'price'=>$cart->price,\n 'quantity'=>$quan,\n 'total'=>$total\n ]);\n return back();\n\n\n }", "public function update(Request $request, $id)\n {\n $item = Item::find($id);\n $item->quantity = $request->quantity;\n $item->price = $request->price;\n $item->save();\n OrderRequest::check();\n return redirect(route('item.index'));\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'name'=>'required',\n 'phone'=>'required',\n 'payment_option'=>'required',\n 'date'=>'required',\n ]);\n \n $itemJson = json_decode($request->items, true);\n $totalFood = 0;\n $totalDrink = 0;\n $totalFoodPrice = 0;\n $totalDrinkPrice = 0;\n foreach($itemJson['items'] as $item){\n $name = $item['name'];\n $quantity = $item['quantity'];\n $instance = DB::table('menu_items')->where('name', $name)->get();\n $type = $instance[0]->type;\n $price = $instance[0]->price;\n if($type == 'food'){\n $totalFood += 1;\n $totalFoodPrice += $price * $quantity;\n }else{\n $totalDrink += 1;\n $totalDrinkPrice += $price * $quantity;\n }\n }\n $transactionUpdate = Transaction::where('id', $id)-> update([\n 'name' => $request->input('name'),\n 'phone' => $request->input('phone'),\n 'address' => $request->input('address'),\n 'date' => $request->input('date'),\n 'payment_option'=>$request->input('payment_option'),\n 'items'=>$request->input('items'),\n 'total' => $request->input('total'),\n 'food' => $totalFood,\n 'drink' => $totalDrink,\n 'food_total' => $totalFoodPrice,\n 'drink_total' => $totalDrinkPrice,\n\n ]);\n\n if($transactionUpdate){\n return redirect()->route('admin.manageTransaction')\n ->with('success', 'Menu item updated successfully');\n }\n return back()->withInput()->with('error' ,'Error updating Item. Please try again.');\n\n }", "public function update(Request $request, $psid)\n {\n // init return value\n $err = 'false';\n $err_msg = '';\n $result = array();\n\n $rules = [\n 'quantity' => 'required|integer',\n ];\n\n $messages = [\n '*.required' => '內容不合法',\n '*.integer' => '內容不合法',\n ];\n\n $validator = Validator::make($request->all(), $rules, $messages);\n\n if ($validator->fails()) {\n // 暫時不做動作\n } else {\n if ($request->session()->has('cart.'.$psid)) {\n $cart = $request->session()->get('cart.'.$psid);\n $cart['quantity'] = $request->input('quantity');\n $cart['total'] = $cart['quantity'] * $cart['price'];\n $quantity = $cart['quantity'];\n\n $request->session()->put('cart.'.$psid, $cart);\n } else {\n // 暫時不做動作\n }\n }\n\n $count = 0;\n $total = 0;\n $itemTotal = 0;\n $allCart = $request->session()->get('cart');\n if (is_array($allCart)) {\n foreach($allCart as $key => $value) {\n $count++;\n $total += $value['total'];\n if ($key == $psid) $itemTotal = $value['total'];\n }\n }\n $result = array('count' => $count, 'total' => '$'.number_format($total), 'itemTotal' => '$'.number_format($itemTotal));\n\n return array('err' => $err, 'err_msg' => $err_msg, 'result' => $result);\n }", "public function update(Request $request)\n {\n DB::table('almacen')\n ->where('id', $request->id)\n ->update(['descripcion' => $request->descripcion, 'stock' => $request->stock,\n 'proveedor' => $request->proveedor]);\n\n return 1;\n }", "public function actionChangeCountOnCart()\n {\n\n $id = $this->request->get('id');\n $count = $this->request->get('count', 1);\n $count = $count < 1 ? 1 : $count;\n $product = Product::findActiveOne($id);\n if($product != null){\n Yii::$app->cart->changeQty($id, $count);\n return $this->success();\n }\n else{\n return $this->error(t('Product not found'));\n }\n }", "public function updateCartQuantity($id = null,$quantityy=null){\n //in our crt page, whwn you click the + or - we are passing the id from cart table, and we are comparing\n //the id from the cart to the id($id) that we are passing whe nyou click the + and -\n //matching them and get the data or information\n $getCartDetails = DB::table('carts')->where('id',$id)->first();\n\n //stock\n\n $getProductStock = Product::where('id',$getCartDetails->product_id)->first();\n //\n //\n //and now we are the getting the products data, matching the products table 'product_code'\n //to $getCartDetails where cart id is equal to the id we aer passing form then getting its product_code from cart tble\n $getProductStock->stock;//and now we are getting the stock of both tables\n\n// wrong way to subtract stock $getproductid= $getCartDetails->product_id;\n\n $updated_quantity = $getCartDetails->quantity+$quantityy; //this is now the quantity that the user wants\n if($getProductStock->stock >=$updated_quantity){\n ////we are now comparing the stocks, the stocks from products should be greater or equal to the quantity the user wants\n //+\n DB::table('carts')->where('id',$id)->increment('quantity',$quantityy);//no need to update,well just have to increment\n\n //\n //in lararvel we have increment,to increase,and decrement to decrease, but you have to pass\n //the something like we do in here so you cann add or decrease\n// DB::table('products')->where('id',$getproductid)->decrement('stock',$quantityy);\n return redirect('/cart')->with('flash_message_success','Product quantity has updated');\n\n // public function updateCartQuantity($id = null){\n // DB::table('cart')->where('id',$id)->increment('quantity',1);\n //we can use this one to increase only,but since we need to decrease,thats why we pass paramenters valu in our cart file like 1 and -1\n //+\n }else{\n return redirect('/cart')->with('flash_message_error','Required Product Quantity is not available');\n }\n }", "public function update(Request $request, InventorySalonUses $inventorySalonUses)\n {\n //\n }", "public function update(Request $request)\n {\n //\n return $this->cart_products_repo->update($request);\n }", "public function update(Request $request, $id1,$id2)\n {\n\n $filling = Filling::find($id2);\n$packing = \\DB::table('packings')->where('id','=',$filling->packing_id)->get();\n\n $filling->qty = $request->qty;\n $filling->weight = $packing[0]->weight * $request->qty;\n $filling->save();\n\n return redirect('/production/batch/'.$id1.'/fill');\n\n }", "public function update(Request $request, $id)\n { \n $purchase = Purchase::find($id);\n if($purchase->book->status == 1)\n {\n $purchase->edit($request->get('qty'));\n } if($purchase->magazin->status == 0)\n {\n $purchase->edit($request->get('qty_m'));\n } \n\n return redirect()->route('cart');\n \n }", "public function update(Request $request, $order_identifier, $inv_id, $item_id)\n {\n //\n }", "public function update(Request $request, int $id)\n {\n Gate::authorize(\"isMember\");\n $this->validateInput($request);\n\n $cart = $this->getCartItem($id);\n $cart->qty = $request->input(\"qty\");\n $cart->save();\n\n return redirect(route(\"cart.index\"));\n }", "public function update_cart()\n {\n $i = 1;\n //explore cart for updation\n\n foreach ($this->cart->contents() as $item)\n {\n\n $this->cart->update(array('rowid'=>$item['rowid'],'qty'=>$_POST[ 'qty'.$i ])); //update quantity of cart\n $i++;\n }\n $this->load->view('user/headeruser');\n $this->load->view('user/cart_user');\n $this->load->view('user/footer_user');\n }", "public function update_quantity($data)\n {\n\n $error = json_encode(array(\"status\" => \"error\"), true);\n $success = json_encode(array(\"status\" => \"success\"), true);\n if(!isset($data[2]) || !isset($data[3]) || !isset($_SESSION['cart']))\n {\n echo $error;\n return;\n }\n\n\n $id = $data[2];\n $quantity = $data[3];\n $cart = $_SESSION['cart'];\n\n $indexInCart = $this -> search_cart($id);\n \n if($indexInCart === false)\n {\n echo $error ;\n return;\n }\n\n $_SESSION['cart'][$indexInCart]['quantity'] = $quantity; \n\n echo $success; return; \n }", "public function update(Request $request, Product $product)\n {\n if(Auth::guard('customer')->check()){\n $logged_id = Auth::guard('customer')->user()->id;\n }\n \\Cart::session($logged_id)->update($product->id, [\n 'quantity' => [\n 'relative' => false,\n 'value' => $request->quantity\n ]\n ]);\n return redirect()->back();\n }", "public function updatecart(){\n\t\t$this->load->library(\"cart\");\n\t\t$data = array(\n\t\t\t'rowid' => $_GET['rowid'],\n\t\t\t'qty' => $_GET['quantity']\n\t\t\t);\n\t\t$this->cart->update($data);\n\t\techo $this->loadcartdetails();\n\t}", "public function updateOrderedProduct($id,Request $request){\n \n $qty = (int)$request->qty;\n $p_id = $request->p_id;\n $order = Order::findOrFail($id);\n $product = Product::findOrFail($p_id);\n\n $orderedProduct = $this->hasProduct($order,$p_id);\n \n $p_qty = $orderedProduct->pivot->qty;\n \n if($qty == 0){\n /**\n * if quantity is set to none then, delete\n * product from pivot table and put the quantity\n * back to that product.\n */\n $this->deleteProduct($order,$product);\n $product->increment('quantity',$p_qty);\n \n /**\n * decrement the total because we a removing\n * the product.\n */\n $total = $product->price * $p_qty;\n $order->decrement('total',$total);\n \n return $this->redirect('Selected product has been deleted from customer order!');\n\n }else{\n /**\n * update the quantity from pivot table.\n */\n $this->updateProduct($order,$product,$qty);\n \n if($qty > $p_qty){\n /**\n * if quantity is greater than the quantity from\n * pivot table then, we want to decrement the quantity\n * of product.\n */\n $product->decrement('quantity',($qty - $p_qty));\n }else{\n /**\n * if less then, we want to put that quantity back\n * to the product.\n */\n $product->increment('quantity',($p_qty - $qty));\n }\n \n $total = $product->price * ($qty - $p_qty);\n $order->increment('total',$total);\n\n return $this->redirect('updated the quantity of selected product!');\n \n }\n\n }", "public function qty(int $qty);", "public function setItemQuantity(Request $request, int $productId, int $quantity): bool\n {\n $this->req = $request;\n $link = OrderItem::where(['product_id' => $productId, 'order_id' => $this->getOrderId()])->first();\n if (!$link) {\n return false;\n }\n \n $link->quantity = $quantity;\n if($link->save()) {\n return true;\n }\n return false;\n }", "function quantity()\n {\n $quantity = $this->input->post('quantity');\n $cart_id = $this->input->post('cart_id');\n $this->db->where('id', $cart_id);\n $ret = $this->db->update('cart', ['quantity' => $quantity]);\n $products = get_cart();\n $total = 0;\n if(!empty($products))\n {\n foreach($products as $one)\n {\n $total += $one->price * $one->quantity;\n }\n }\n $data['total'] = $total;\n if($ret)\n {\n $data['flag'] = 1;\n echo json_encode($data);\n }\n else\n {\n $data['flag'] = 0;\n echo json_encode($data);\n }\n }", "public function update(Request $request, $id)\n {\n $input = $request->except('_token','_method');\n $validator = Validator::make($request->all(),[\n 'created_by' => 'required',\n\n ]);\n if($validator->fails()){\n return redirect()->back()->withErrors($validator)->withInput();\n }\n \n $orderData = InventoryProductOrderChallan::findOrFail($id);\n $orderData->update([\n 'total_amount'=>$input['total_amount'],\n ]);\n for ($i=0; $i < sizeof($input['item_id']); $i++) { \n\n $item_id = $input['item_id'][$i];\n $cost_amount = $input['cost_per_unit'][$i];\n $qty = $input['qty'][$i];\n $amount = $cost_amount*$qty;\n $orderItem = InventoryProductOrderChallanItem::where('id',$item_id)->first();\n $orderItem->update([\n 'qty'=>$qty,\n 'payable_amount'=>$amount,\n ]);\n $inventoryItem=InventoryItem::where('brach_no',$orderItem->batch_no)->first();\n $nowAvailableQty=$qty-($inventoryItem->qty-$inventoryItem->available_qty);\n $inventoryItem->update([\n 'qty'=>$qty,\n 'available_qty'=>$nowAvailableQty,\n ]);\n $inventory=Inventory::where('id',$inventoryItem->fk_inventory_id)->first();\n $inventory->update([\n 'available_qty'=>$inventory->available_qty-$inventoryItem->available_qty+$nowAvailableQty,\n ]);\n }\n try {\n\n $challan=InventoryProductOrderChallanItem::select(DB::raw('SUM(qty) as qty'))->where('fk_order_challan_id',$orderData->id)->first();\n $getProductOrder=InventoryProductOrderItem::select(DB::raw('SUM(qty) as qty'))->where('fk_product_order_id',$orderData->fk_order_id)->first();\n \n if($getProductOrder->qty > $challan->qty){\n InventoryProductOrder::where('id',$orderData->fk_order_id)->update(['status'=>1]);\n }else{\n InventoryProductOrder::where('id',$orderData->fk_order_id)->update(['status'=>0]);\n }\n $bug = 0;\n } catch (\\Exception $e) {\n $bug = $e->errorInfo[1];\n $bug1 = $e->errorInfo[2];\n }\n \n if($bug == 0){\n return redirect()->back()->with('success','Updated successFully.');\n }else{\n return redirect()->back()->with('error','Something Error Found !, Please try again.'.$bug1);\n }\n }", "public function update(Request $request, $id)\n {\n\n Cart::update($id, array(\n 'quantity' => array(\n 'relative' => false,\n 'value' => $request->quantity\n ),\n ));\n session()->flash('success_message', 'La cantidad ha sido actualizada');\n return response()->json([\"mensaje_exito\" => true]);\n }", "public function updateItem($request, $itemId)\n {\n // Buscamos la opcion\n $inventoryItem = InventoryItem::findOrFail($itemId);\n\n // Actualizamos la InventoryItem mediante mass assigment\n $inventoryItem->fill($request->input(\"item\"));\n $inventoryItem->save();\n\n // Todo fue bien, se devuelve el modelo (InventoryItem)\n return $inventoryItem;\n }", "public function editItem(CartEditRequest $request , $id){\n $user = auth('api')->user();\n // check if user is seller or not\n if(!$user->customer()->exists()){ \n return $this->apiResponse(null, HTTPCodesEnum::STATUS_UNAUTHORIZED , \"Unauthorized\");\n }\n // Update record\n $cart = Cart::find($id);\n $cart->quantity += $request->quantity;\n $cart->save();\n // check if quantity is 0\n if($cart->quantity == 0){\n $cart->delete();\n return $this->apiResponse('', HTTPCodesEnum::STATUS_OK, 'Deleted Successfully');\n }\n // return successfully response\n return $this->apiResponse(new CartResource($cart->load('products')), HTTPCodesEnum::STATUS_OK, \"Updated Successfully\");\n }", "public function update(Request $request, $id)\n {\n Cart::update($id,['qty'=>$request->qty]);\n return redirect()->route('cart.index');\n }", "public function updateQuantity($productoId, $cantidad, $qtyFromPost) {\n $em = $this->findProducto($productoId);\n if ($item !== null) {\n $cantidad = ($qtyFromPost === true)?$cantidad:$item->getQuantity();\n $item->setQuantity($cantidad);\n $this->cleanUp();\n }\n}", "public function store(Request $request)\n {\n\t\tforeach($request->input(\"row\") as $rowId=>$quantity):\n\t\tif($quantity == \"0\" || $quantity==\"\"){\n\t\t\tCart::remove($rowId);\n\t\t}else{\n\t\t\t\n\t\t\tCart::update($rowId, ['qty'=>$quantity, 'options'=>['content'=>$request->input(\"content.$rowId\")]]);\n\t\t}\n\t\tendforeach;\nsession()->flash(\"flash_success\", \"Your Cart has been Updated\");\n\t\treturn(back());\n\t}", "public function update(Request $request, Quantity $quantity)\n {\n $quantity->update($this->validateRequest($request));\n\n return $quantity;\n }" ]
[ "0.84565324", "0.7940382", "0.7906509", "0.787306", "0.77928483", "0.76459664", "0.76107395", "0.75888944", "0.75591195", "0.7533589", "0.7513584", "0.75009185", "0.747978", "0.7411923", "0.7365416", "0.7360466", "0.7321895", "0.7290639", "0.7260903", "0.72409034", "0.72187537", "0.72046393", "0.72040117", "0.7200052", "0.7195312", "0.7188024", "0.7187611", "0.71817595", "0.71411955", "0.7119907", "0.71149707", "0.7107635", "0.7094105", "0.7088557", "0.70871294", "0.70794755", "0.70777744", "0.706244", "0.70594865", "0.70536894", "0.7027095", "0.7026091", "0.702436", "0.70215714", "0.70104825", "0.70089835", "0.7008026", "0.69915617", "0.6987963", "0.6976989", "0.697574", "0.6968968", "0.6964028", "0.6959973", "0.6946936", "0.69364005", "0.6929174", "0.69084275", "0.6908154", "0.68990165", "0.6890492", "0.6889665", "0.68823636", "0.6877288", "0.6875014", "0.6854219", "0.6852335", "0.68275905", "0.6822979", "0.6812256", "0.6809695", "0.6796605", "0.6795017", "0.67779213", "0.67738765", "0.6771021", "0.676852", "0.67647463", "0.6762639", "0.6758066", "0.67506593", "0.67503136", "0.6743767", "0.674247", "0.67387843", "0.6727303", "0.6725681", "0.67241406", "0.6719109", "0.6711639", "0.67043227", "0.6699932", "0.66996443", "0.6697637", "0.66893464", "0.66840756", "0.66830695", "0.6671201", "0.6669765", "0.666671" ]
0.80344933
1
Get Agency name from agency id
Получить название агентства по идентификатору агентства
public function getAgencyName($id) { if (is_numeric($id)) { $this->db->where('id', $id); $query = $this->db->get($this->table); if ($query->num_rows() == 1) { $row = $query->row(); return $row->agency_name; } else { return false; } } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bibdk_openuserstatus_agency_name_main($agencies) {\n $named_agencies = array();\n\n foreach ($agencies as $agency) {\n $named_agencies[$agency] = bibdk_openuserstatus_get_agencyname_main($agency);\n }\n\n return $named_agencies;\n}", "public function getAgencyId()\n\t{\n\t\treturn $this->agency_id;\n\t}", "function agency($id){\n $acredits = DB::table('agency_credits')->where('id', '=', $id)->get()->toArray();\n $fname ='';\n foreach($acredits as $name){ \n $fname = $name->name;\n }\n return $fname;\n}", "public function getAgencyNumber(): string\n {\n return $this->agencyNumber;\n }", "function getAgencyDetails($agency_id)\n {\n $agency = $this->leftJoin('companies', 'agencies.agency_id', '=', 'companies.agencies_agent_id')\n ->leftJoin('addresses', 'addresses.address_id', '=', 'companies.addresses_address_id')\n ->select(['agencies.agency_id', 'agencies.description', 'agencies.company_database_name', 'companies.*', 'addresses.*'])\n ->where('agencies.agency_id', $agency_id)\n ->first();\n return $agency;\n }", "function bibdk_openuserstatus_agency_names($agencies) {\n $named_agencies = array();\n\n foreach ($agencies as $agency) {\n $named_agencies[$agency] = bibdk_openuserstatus_get_agencyname($agency);\n }\n\n return $named_agencies;\n}", "public function getAgencyInfo($agency_id)\n {\n\t\t// query agency ID for new owner\n $sql = 'SELECT * FROM agencies WHERE id = '.$agency_id;\n $query = $this->db->prepare($sql);\n $query->execute();\n\t\treturn $query->fetchAll();\n }", "public function getListAgencyName()\n {\n return $this->listAgencyName;\n }", "public function actionAgencydetails($agency_id)\r\n {\r\n $user_helper = new UserHelper();\r\n $agency = $user_helper->getCompany($agency_id);\r\n $agent_information = $user_helper->getAgentInformationFromCompanyId($agency_id);\r\n $agency_offers = $user_helper->getAgencyOffers($agent_information->id);\r\n $featured_property = Generic::getFeaturedProperty();\r\n return $this->render('agency-details',[\r\n 'agency' => $agency,\r\n 'agency_offers' => $agency_offers,\r\n 'featured_property' => $featured_property,\r\n 'agent_information' => $agent_information\r\n ]);\r\n }", "public function get_agency($id=null){\n $result = $this->db->get_where('agency', array('id'=>$id));\n return $result->row(0);\n }", "public function getName($id) {\n $this->db->from('organization');\n $this->db->where(\"id\", $id); \n $query = $this->db->get();\n $record = $query->result_array();\n if(count($record) > 0) {\n return $record[0]['name'];\n } else {\n return '';\n }\n }", "public function getName($openid){\r\n\t\treturn $this->where('openId=\"'.$openid.'\"')->getField('name');\r\n\t}", "function organization_name_from_user_id($user_id)\n {\n $user = \\App\\User::FindOrFail($user_id);\n\n echo($user->organization()->get()[0]->name);\n }", "public function getExtensionAgencyName()\n {\n return $this->extensionAgencyName;\n }", "function country_name_from_id($country_id)\n {\n $cid = ($country_id == !null) ? $country_id : 1;\n //dd($cid);\n $country = DB::table('countries')\n ->where('id', $cid)\n ->select('name')->get()[0]->name;\n //dd($country);\n return (!empty($country)) ? $country : '';\n }", "function wc_attribute_taxonomy_name_by_id($attribute_id)\n {\n }", "function getAdvisorName($row)\n{\n\tglobal $debug; global $COMMON;\n\t$sql2 = \"select * from Proj2Advisors where `id` = '$row[2]'\";\n\t$rs2 = $COMMON->executeQuery($sql2, $_SERVER[\"SCRIPT_NAME\"]);\n\t$row2 = mysql_fetch_row($rs2);\n\treturn $row2[1] .\" \". $row2[2];\n}", "public function getAgencyDigit(): string\n {\n return $this->agencyDigit;\n }", "private function getAgencyFromAbbreviation($abbreviation) {\n $agencies = \\Drupal::entityTypeManager()\n ->getStorage('taxonomy_term')\n ->loadByProperties([\n 'vid' => 'agency',\n 'field_agency_abbreviation' => $abbreviation,\n ]);\n if ($agency = reset($agencies)) {\n return $agency->id();\n }\n return FALSE;\n }", "public function getAgency()\n {\n return $this->agency;\n }", "function get_agency($id)\n {\n return $this->db->get_where('agency',array('id'=>$id))->row_array();\n }", "public function getAgencyID($user_id)\n {\n\t\t// query agency ID for new owner\n $sql = 'SELECT agency_id FROM agencies_users WHERE user_id = '.$user_id;\n $query = $this->db->prepare($sql);\n $query->execute();\n\t\treturn $query->fetch()->agency_id;\n\t\t\n }", "public function getIdName();", "private function getAttributeNameById($a_attr_id) {\r\n\t\tforeach ($this->all_available_attributes as $available_attribute) {\r\n\t\t\tif ($available_attribute['id'] == $a_attr_id) {\r\n\t\t\t\treturn $available_attribute['name'];\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function engagementName($engagement, $client)\n {\n $name = '';\n\n if($engagement->category == 'Personal') {\n $name = $client->fullNameWithSpouse();\n return $name;\n } else if ($engagement->category == 'Business') {\n $name = $engagement->name;\n return $name;\n }\n \n return $name;\n }", "public function agency()\n {\n return $this->belongsTo(Agency::class);\n }", "public function agency()\n {\n return $this->belongsTo(Agency::class);\n }", "public function getCompanyNameIdentifier();", "public function getExtensionAgencyID()\n {\n return $this->extensionAgencyID;\n }", "public function get_organizer_name_by_id( $organizer_id ) {\r\n\t\t\r\n\t\tif( !$organizer_id || $organizer_id == '' ){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$organizer_raw_data = $this->get_facebook_response_data( $organizer_id, array() );\r\n\t\tif( ! isset( $organizer_raw_data->name ) ){\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t\r\n\t\t$oraganizer_name = isset( $organizer_raw_data->name ) ? $organizer_raw_data->name : '';\r\n\t\treturn $oraganizer_name;\r\n\r\n\t}", "function countryname($id=NULL){\n $data = $this->country_masters->query(\"SELECT country_name from country_masters where id = \".$id);\n return $data[0]['country_masters']['country_name'];\n}", "function osc_get_country_name($country_id) {\n $country_array = osc_get_countries($country_id);\n\n return $country_array['countries_name'];\n }", "function checkAgentId($agent_id){\n\t\t$sql = \"SELECT CONCAT(fname,' ',lname), email, work_status FROM agent a WHERE agent_no = $agent_id;\";\n\t\t$result=mysql_query($sql);\n\t\tif(!$result) die (\"Error in Script<br>\".$sql);\n\t\tlist($agent_name,$email, $work_status)=mysql_fetch_array($result);\n\t\tif($work_status == \"AFF\"){\n\t\t\t//return strtoupper($work_status).\" \".$agent_name.\" \".$email; \n\t\t\t// Check to whose Business Partner is this Affiate is?\n\t\t\t$sqlBP=\"SELECT CONCAT(a.fname,' ',a.lname),a.email FROM agent_affiliates f \n\t\t\t\t\tJOIN agent a ON a.agent_no = f.business_partner_id \n\t\t\t\t\tWHERE f.affiliate_id = $agent_id;\";\n\t\t\t//echo $sqlBP;\n\t\t\t$data = mysql_query($sqlBP);\n\t\t\tlist($bp_name,$bp_email) = mysql_fetch_array($data);\n\t\t\t$aff_name=\"<b>Business Partner </b> \".$bp_name.\" ~ \".$bp_email.\"<br>\";\n\t\t\t$aff_name .= \"<b> Affiliate </b>\".$agent_name.\" ~ \".$email;\n\t\t\treturn $aff_name;\n\t\t\t\n\t\t}else{\n\t\t\treturn \"<b>Business Partner </b>\".$agent_name.\" ~ \".$email; \n\t\t}\n\t}", "function tep_get_country_name($country_id) {\n $country_array = tep_get_countries($country_id);\n\n return $country_array['countries_name'];\n }", "function ANet_getCustomerProfileId($coachId)\r\r\n{\r\r\n return 'ccr_' . $coachId;\r\r\n}", "public function getListAgencyID()\n {\n return $this->listAgencyID;\n }", "public function getHotelName()\n {\n global $mysqli;\n $hotel = $mysqli->query(\"SELECT title FROM hotels WHERE id=\".$_GET[\"editID\"]);\n $row = $hotel->fetch_array();\n return $row[\"title\"];\n }", "public function getSponsorname() {}", "public function getAcronym() {\n return $this->data->acronym;\n }", "public function getcalSupName($id){\n\n\t\t$sql = \"select name from sy_calsupplementaries where id=?;\";\n\t\t$data = $this->runRequest($sql, array($id));\n\t\tif ($data->rowCount () == 1){\n\t\t\t$tmp = $data->fetch ();\n\t\t\treturn $tmp[0];\n\t\t}\n\t\telse{\n\t\t\treturn \"not found\";\n\t\t\t}\n\t}", "function getAgency($agencyCode){\n $objConection = new DataConection();\n //Se crea la consulta que va a obtener la agencia\n $sql = \"SELECT a.*, g.name as group_name, g.id as group_code\n\t\t\t\t\tFROM #__agency a\n\t\t\t\t\t\tJOIN #__agency_group g ON a.idagency_group=g.id\n\t\t\t\t\tWHERE a.token='\".$agencyCode.\"'\n\t\t\t\t\t\tAND a.active=1\";\n\n //se envia la consulta a la clase conexion\n $objConection->setQuery($sql);\n //Se ejecuta la consulta\n $result = $objConection->loadObject();\n return($result);\n }", "function getProductNameById($id) {\n \n }", "public function retrieveOne($agency_id)\n {\n $agencyService = new AgenciesService();\n $agency = $agencyService->retrieveOne($agency_id);\n return response()->json($agency);\n }", "function CountryShortName($id) {\n global $DB;\n if (!$id) return '';\n return $DB->StrOneQuery(\"Select Ref From Countries Where Id=$id\");\n}", "function buildingName($building_id){\n\tglobal $_CON;\n\t$sqlSearch = mysqli_query($_CON,\n\t\"SELECT\n\tbuilding_name\n\tFROM\n\tbuilding\n\tWHERE\n\tbuilding_id='$building_id'\");\n\t$count = mysqli_num_rows($sqlSearch);\n\tif($count == 1){\n\t\t$row = mysqli_fetch_array($sqlSearch);\n\t\t$building_name = $row['building_name'];\n\t\treturn $building_name;\n\t}\n}", "public function get_match_name_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('events',array('match_id'=>$id));\n\n\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->home_team . ' - ' . $row->away_team;\n\t\t}\n\t\telse\n\t\t\treturn '';\n\t}", "function subcNameFromID($subcId) {\n\t\t$user_handler = new userHandler();\n\t\t$conn = $user_handler->getConnection();\n\t\tif ($conn != null) {\n\t\t\t$query = mysqli_query($conn, \"SELECT * FROM SubCategory WHERE subcategory_id = '$subcId'\");\n\t\t\tif ($query) {\n\t\t\t\t$row = mysqli_fetch_array($query);\n\t\t\t\tif (count($row) > 0) {\t\t\t\t\n\t\t\t\t\treturn $row[\"subcategory_name\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"\";\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\t\treturn \"\";\t\t\n\t\t}\n\t}", "public static function get_name() {\n\t\treturn \"OpenID/i-name\";\n\t}", "function get_team_name($team_id) {\n\t\treturn \\search\\get_team_name($team_id);\n\t}", "public function getLocationName($location_id){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$sql=\"SELECT name FROM tb_sublocation WHERE id = \".$location_id;\r\n\t\t$row=$db->fetchRow($sql);\r\n\t\treturn $row;\r\n\t}", "public function getInnovationName($id)\n {\n return Innovation::where('id', $id)->first()->innovationTitle;\n }", "function getCampaignName($campaign_id)\n{\n global $log;\n $log->debug(\"Entering getCampaignName(\".$campaign_id.\") method ...\");\n $log->info(\"in getCampaignName \".$campaign_id);\n\n global $adb, $table_prefix;\n $sql = \"select campaignname from \".$table_prefix.\"_campaign where campaignid=?\"; // crmv@39110\n $result = $adb->pquery($sql, array($campaign_id));\n $campaign_name = $adb->query_result($result,0,\"campaignname\");\n $log->debug(\"Exiting getCampaignName method ...\");\n return $campaign_name;\n}", "function vlogfund_organization_id_campaign( $atts, $content = null ){\n\n\t$organization_id = '';\n\n\tif( isset( $_GET['post_id'] ) && !empty( $_GET['post_id'] ) ) :\n\t\t$organization_id = toolset_get_related_post($_GET['post_id'],'organization-campaign','parent');\n\tendif; //Endif\n\n\treturn $organization_id;\n}", "function course_name($id) {\r\n global $DB;\r\n $course = $DB->get_record_sql('SELECT fullname FROM {course} WHERE id = ?', array($id));\r\n $course = format_string($course->fullname);\r\n $course = $course . ' ' . get_string('course', 'block_course_status_tracker');\r\n ;\r\n return $course;\r\n}", "function get_nameid() {\n $xpath = $this->get_xpath();\n\n $signatureQuery = \"//ds:Reference[@URI]\";\n $id = substr($xpath->query($signatureQuery)->item(0)->getAttribute('URI'), 1);\n\n $nameQuery = \"/samlp:Response/saml:Assertion[@ID='$id']/saml:Subject/saml:NameID\";\n $entries = $xpath->query($nameQuery);\n\n return $entries->item(0)->nodeValue;\n }", "public function getIdName() {\n return $this->id_name;\n }", "function getCountryName($country_id) {\n\t\tAPP::import('Model','Country');\n\t\t$this->Country = new Country();\n\t\tif($country_id) {\n\t\t return $this->Country->field('name',array('id'=>$country_id)); \n\t\t}\n\t return false;\t\n\t}", "public function getAttributeName()\n {\n return 'Agent';\n }", "public function getTheStateNameGivenItsId($state_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$state_id);\n $state = State::model()->find($criteria); \n \n return $state['name'];\n }", "function get_course_name($c_id){\n\t\trequire \"config.php\";\n\t $sql=\"SELECT * FROM iitb_discipline WHERE d_id=$c_id\";\n\t $query=mysqli_query($con,$sql);\n\t if ($query->num_rows>0) {\n\t \t$result=mysqli_fetch_assoc($query);\n\t \treturn $result['d_name'];\n\t }\n\t}", "public function getNameLocation($id)\n {\n return $this->locations()->where('location_id', $id)->first()->name;\n }", "public function getAgency($agencyId)\n {\n $dataAgency = $this->sendWithSession('ox.getAgency', array((int) $agencyId));\n $agencyInfo = new AgencyInfo();\n $agencyInfo->readDataFromArray($dataAgency);\n\n return $agencyInfo;\n }", "public function getName($id)\n\t{\n\t\t$dalDepartment = new DALDepartment;\n\t\t$result = $dalDepartment->getById($id);\n\n\t\t$data = \"\";\n\t\twhile ($res = mysqli_fetch_assoc($result))\n\t\t {\n\t\t\t$data.= $res[\"name\"];\n\t\t\t\n\n\t\t }\n\t\t return $data;\n\t}", "function get_organiser_details($id = NULL) {\n $query = \" SELECT organization_id,charity_overview,organization_name,charity_name\";\n $query .= \" FROM \" . $this->config->item('ems_organisers_details', 'dbtables');\n $query .= \" WHERE organization_id = ? \";\n $dataBindArr = array($id);\n $res = $this->db->query($query, $dataBindArr);\n $resArr = $res->result();\n if (isset($resArr['0'])) {\n return $resArr['0'];\n } else {\n $resArr = array();\n return $resArr;\n }\n }", "public function getEmpId()\n\t{\n\t\t$empCode = \\Employee::orderBy('id', 'desc')->first();\n\t\t$empCode = $empCode->empCode;\n\t\t$empCode = \"GT\".(substr($empCode, 2)+1);\n\t\techo $empCode;\n\t}", "function oos_get_country_name($country_id)\n{\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $countriestable = $oostable['countries'];\n $query = \"SELECT countries_name\n FROM $countriestable\n WHERE countries_id = '\" . intval($country_id) . \"'\";\n $countries_name = $dbconn->GetOne($query);\n\n return $countries_name;\n}", "public function getCounterpartyLabel() {\n if ($this->client) {\n return 'Покупатель - ' . $this->client->fullname;\n }\n if ($this->rieltor) {\n return 'Риелтор (' . $this->rieltor->agency->name . ') - ' . $this->rieltor->fullname;\n }\n if ($this->agency) {\n return 'Агентство - ' . $this->agency->name;\n }\n if ($this->user) {\n return $this->user->getRoleLabel() . ' - ' . $this->user->fullname;\n }\n return null;\n }", "public function getCustomerName($customer_id){\n\n $customer=Customers::model()->findByPK($customer_id);\n $fullName = $customer->last_name.\" \".$customer->first_name;\n //$fullName = CHtml::link($fullName, Yii::app()->createUrl(\"customers/view/\",array(\"id\"=>$customer_id)));\n return $fullName;\n\n }", "function getCustomerName($id)\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering getCustomerName(\".$id.\") method ...\");\n \tglobal $adb;\n\t $sql = \"select * from vtiger_portalinfo inner join vtiger_troubletickets on vtiger_troubletickets.contact_id = vtiger_portalinfo.id where vtiger_troubletickets.ticketid=?\";\n \t$result = $adb->pquery($sql, array($id));\n\t $customername = $adb->query_result($result,0,'user_name');\n\t\t$log->debug(\"Exiting getCustomerName method ...\");\n \treturn $customername;\n\t}", "public function getProdName($id){\r\n $dbquery= \"select * from categories where cat_id='$id'\";\r\n return $this->query ($dbquery);\r\n\r\n }", "function get_pricing_option_name($id = null){\n App::import(\"Model\", \"PricingLevel\");\n $model = new PricingLevel();\n if($id != 0){\n $data = $model->find('first', array('fields' => array('eng_name'),'conditions'=>array('PricingLevel.id'=>$id)));\n return $data['PricingLevel']['eng_name'];\n \n }else{\n return 'Same for all staff';\n }\n }", "public function get_location_name($id){\n\t\t$query = \"SELECT * from `location` WHERE `location_id`='$id'\";\n\t\t$result = mysql_query($query);\n\t\tif($result){\n\t\t\t$row = mysql_fetch_array($result);\n\t \t\techo $row['location_name'];\n\t\t}else{\n\t\t\tdie('can not select'. mysql_error());\n\t\t}\n\t }", "function get_location_name_by_id($id=0)\n{\n\t$loc->name = '';\n\tif($id!=0)\n\t{\n\t\tci()->load->library('products');\n\t\t$loc = ci()->products->get_location($id);\t\t\n\t}\n\treturn $loc->name;\n}", "public function exam_name_by_id($exam_id)\n {\n $getExam = $this->db->get_where('exam', array('id' => $exam_id))->row_array();\n if (!empty($getExam['term_id'])) {\n $getTerm = $this->db->get_where('exam_term', array('id' => $getExam['term_id']))->row_array();\n return $getExam['name'] . ' (' . $getTerm['name'] . ')';\n } else {\n return $getExam['name'];\n }\n }", "public function getDeptName($deptid){\n\t\t// Get the Department Name \n\t\t$getDeptNameSQL = \"\n\t\t\tSELECT \n\t\t\t\tdept.dept_name as deptname\n\t\t\tFROM \n\t\t\tmst_departments dept \n\t\t\tWHERE dept.id =:deptid\n\t\t\";\n\t\t\n\t\t$command = Yii::$app->ehms->createCommand($getDeptNameSQL);\n\t\t// Bind the Values - SQL Injection Prevention\n\t\t$command->bindParam(\":deptid\",$deptid);\n\t\t\n\t\t//Query Execute\n\t\t$depname = $command->queryAll();\n\t\t\n\t\treturn $depname[0]['deptname'];\n\t}", "public function getAreaName($id){\n\n\t\t$sql = \"select name from sy_areas where id=?;\";\n\t\t$data = $this->runRequest($sql, array($id));\n\t\tif ($data->rowCount () == 1){\n\t\t\t$tmp = $data->fetch ();\n\t\t\treturn $tmp[0];\n\t\t}\n\t\telse{\n\t\t\treturn \"not found\";\n\t\t\t}\n\t}", "function members_get_skill_name($skillid){\n\t$sql = \"SELECT skill FROM skills WHERE skill_id='$skillid'\";\n\t$rst = mysql_query($sql) or die(mysql_error());\n\t$row = mysql_fetch_assoc($rst);\n\treturn $name = $row['skill'];\n}", "public function get_name($id = \"\")\r\n\t{ \r\n\t\t$result=$this->db->query(\"select name from \".$this->usertable.\" where \".$this->uidfield.\" = '$id'\");\t\r\n\t\treturn $result;\r\n\t}", "function item_name($id) {\n return $this->get_item($id,'name');\n }", "function getLeadName() {\n\t\tif ($this->getValue('name') != '') {\n\t\t\treturn $this->getValue('name');\n\t\t} else if ($this->getValue('fn') != '' || $this->getValue('ln') != '') {\n\t\t\treturn trim($this->getValue('fn') . ' ' . $this->getValue('ln'));\n\t\t} else {\n\t\t\treturn $this->getId();\n\t\t}\n\t}", "function apiGetAgencyAdvert()\n {\n\n $flatID = file_get_contents(codecept_data_dir() . 'advertFlatId.json');\n $agencyToken = file_get_contents(codecept_data_dir('agency_token.json'));\n $this->restModule->haveHttpHeader('token', $agencyToken);\n $this->restModule->haveHttpHeader('Content-Type', 'application/json');\n $this->restModule->sendGET('/profiles/announcements/' . $flatID);\n $this->restModule->seeResponseIsJson();\n $this->restModule->seeResponseCodeIs(200);\n $this->restModule->seeResponseMatchesJsonType([\n 'id' => 'string',\n 'user' => 'array',\n 'status' => 'integer',\n 'realty' => 'array'\n ]);\n }", "public function getAdvertisingIdCode()\n {\n return isset($this->advertising_id_code) ? $this->advertising_id_code : '';\n }", "public function getEntityNameIdentifierValue() {\n $field = $this->getEntityNameIdentifierField();\n // Now get the Attribute name.\n return $this->getCdf()->getAttribute($field)->getValue();\n }", "function masvideos_attribute_taxonomy_name_by_id( $attribute_id ) {\n global $wpdb;\n\n $data = $wpdb->get_row(\n $wpdb->prepare(\n \"\n SELECT attribute_name, post_type\n FROM {$wpdb->prefix}masvideos_attribute_taxonomies\n WHERE attribute_id = %d\n \", $attribute_id\n )\n );\n\n if ( $data && ! is_wp_error( $data ) ) {\n $attribute_name = $data->attribute_name;\n $post_type = $data->post_type;\n return masvideos_attribute_taxonomy_name( $post_type, $attribute_name );\n }\n\n return '';\n}", "private function getConsultantTitle()\n {\n if (version_compare(VERSION, '3.0', '<')) {\n $title = 'online_consultant';\n } else {\n $title = 'analytics_online_consultant';\n }\n\n return $title;\n }", "static public function name($id) {\n $select = new Select(); $select->what(array('ime', 'prezime'));\n $select->from('employe');\n $select->condition(\"id = ?\", array($id));\n $result = $select->execute();\n $row = $result->fetch_assoc();\n\n if($row) {\n return $row['ime'] . \" \" . $row['prezime'];\n } else {\n trigger_error('Employe with id $id not found.');\n }\n }", "function get_emp_name_code($emp_id) {\r\n $sql = 'SELECT full_name FROM employee e where id=' . $emp_id;\r\n $rs = mysql_query($sql);\r\n $row = mysql_fetch_array($rs);\r\n return $row['full_name'];\r\n}", "public function get_country_name($id){\n\t\t$query = \"SELECT * from `country` WHERE `country_id`='$id'\";\n\t\t$result = mysql_query($query);\n\t\tif($result){\n\t\t\t$row = mysql_fetch_array($result);\n\t \t\techo $row['country_name'];\n\t\t}else{\n\t\t\tdie('can not select'. mysql_error());\n\t\t}\n\t }", "function print_country_name($countryid, $slng = 'eng', $shortform = false)\n{\n global $ilance, $myapi, $phrase;\n \n if (empty($slng))\n {\n $slng = 'eng';\n }\n \n $sql = $ilance->db->query(\"\n SELECT location_$slng AS countryname, cc\n FROM \" . DB_PREFIX . \"locations\n WHERE locationid = '\" . intval($countryid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($shortform)\n {\n return $res['cc'];\n }\n \n return $res['countryname'];\n }\n \n return $phrase['_unknown'];\n}", "function tourney_league_page_title($league) {\n return \"$league->entity_name ($league->id)\";\n}", "public function getCommonName()\n {\n return $this->_identity->getValue('fullname');\n }", "public static function getAuthIdentifierName();", "function locNameFromID($locId) {\n\t\t$user_handler = new userHandler();\n\t\t$conn = $user_handler->getConnection();\n\t\tif ($conn != null) {\n\t\t\t$query = mysqli_query($conn, \"SELECT * FROM Location WHERE location_id = '$locId'\");\n\t\t\tif ($query) {\n\t\t\t\t$row = mysqli_fetch_array($query);\n\t\t\t\tif (count($row) > 0) {\t\t\t\t\n\t\t\t\t\treturn $row[\"location_name\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"\";\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\t\treturn \"\";\t\t\n\t\t}\n\t}", "public function getName(int $id);", "public function getTheCountryNameGivenItsId($country_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$country_id);\n $country = Country::model()->find($criteria); \n \n return $country['name'];\n }", "public function requestApprovalName($id)\n {\n $profile = Profile::where('profiles.user_id', $id)\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->leftJoin('departments', 'departments.id', '=', 'profiles.department_id')\n ->leftJoin('positions', 'positions.id', '=', 'profiles.position_id')\n ->select(\n 'users.email',\n 'departments.name as department',\n 'positions.name as position',\n 'profiles.personal_details->title as title',\n 'profiles.personal_details->lastName as lastName',\n 'profiles.personal_details->firstName as firstName',\n 'profiles.personal_details->middleName as middleName',\n 'profiles.personal_details->avatar as avatar',\n\n\n )\n ->first();\n return response()->json(['name' => $profile]);\n }", "public function _get_id_name() {\n return $this->_id_name;\n }", "function getIdName()\n {\n return \"goods_id\";\n }", "public function GetAcronym() \r\n {\r\n return isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\r\n }", "public function get_disciplinename()\n {\n $topic=Discipline::where ( 'id',$this->discipline_id )->first();\n return $topic->discipline_name;\n }" ]
[ "0.6614542", "0.6529375", "0.64506173", "0.6392647", "0.6367512", "0.6279644", "0.6180255", "0.6121068", "0.6109038", "0.60687774", "0.6051044", "0.6036209", "0.6019002", "0.5979777", "0.5974614", "0.5950543", "0.5930645", "0.581207", "0.5804453", "0.574138", "0.57154584", "0.56798136", "0.5636059", "0.5633381", "0.56202495", "0.55543125", "0.55543125", "0.55493134", "0.5518587", "0.5515449", "0.55144465", "0.54992086", "0.549642", "0.54933065", "0.5477775", "0.5465785", "0.5461848", "0.54523134", "0.54422057", "0.54354835", "0.5426649", "0.5425464", "0.54188293", "0.54172736", "0.54169124", "0.5406124", "0.5402294", "0.5388767", "0.53852326", "0.53835714", "0.5364102", "0.5351914", "0.53516513", "0.5351639", "0.5351541", "0.5351333", "0.53502953", "0.53492415", "0.5345227", "0.5345167", "0.53436726", "0.5342197", "0.5339986", "0.5338347", "0.53330576", "0.5322437", "0.53206086", "0.531631", "0.53124523", "0.530563", "0.530375", "0.5294666", "0.52930653", "0.52888453", "0.5281672", "0.52789456", "0.527851", "0.5278085", "0.5274737", "0.52739847", "0.52729404", "0.5269105", "0.5264579", "0.5259727", "0.5257095", "0.52557284", "0.5255499", "0.52540326", "0.525393", "0.5253598", "0.52523696", "0.5250702", "0.52492595", "0.5248974", "0.5247921", "0.52477366", "0.52377886", "0.52363783", "0.52326506", "0.52284765" ]
0.7228171
0
Append a message to current output
Добавить сообщение в текущий вывод
public function output($msg) { $this->_currentOutput .= $msg . "\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add(string $output): void\n {\n $this->stdOut .= $output;\n }", "public function appendOutput( $output ) {\n\t\t$this->output .= $output;\n\t}", "public function append_output($string)\n\t{\n\t\t$this->buffer .= $string;\n\t}", "protected function _write($message) {\n\t\tif (!empty($_GET['debug']) || !empty($_SERVER['argv']) && (in_array('-v', $_SERVER['argv'], true) || in_array('-vv', $_SERVER['argv'], true))) {\n\t\t\tdebug($message);\n\t\t}\n\t\t$this->output[] = $message;\n\t}", "public function appendOutput($str) {\n\t\t\t$this->output .= $str;\n\t\t}", "public function writeMessage($message){\n echo $message . $this->lineFeed;\n }", "function addLog($message)\n {\n if (php_sapi_name() === 'cli') {\n echo $message . \"\\n\";\n }\n\n $this->log[] = $message;\n }", "public function writeln($message)\n {\n }", "public function appendMessage(Message $message)\n {\n $this->messages[] = $message;\n }", "public function writeLine($message = '')\n {\n $this->output->writeln($this->indent . $message);\n }", "public function write(string $message)\n {\n $this->output->write($message);\n }", "public function append($token)\n\t{\n\t\tforeach (func_get_args() as $arg) $this->output[] = $arg;\n\t}", "public function append()\n {\n }", "protected function appendMessage($message) {\n\t\t$this->messages[] = $message;\n\n\t\tif (sizeof($this->messages) > 100) {\n\t\t\tarray_shift($this->messages);\n\t\t}\n\t}", "public function writeln($msg = '') {\n\t\tfwrite(STDOUT, $this->format($msg).PHP_EOL);\n\t}", "private function addLog($msg) {\n $this->logmsg .= $msg.\"\\n\";\n }", "public function writeln($message) {\n\t\t$this->write($message . PHP_EOL);\n\t}", "private function add_output_internal($str) {\n\t\t$this->output[count($this->output) - 1] .= $str;\n\t}", "public function reply($message) {\n\t\tif (is_array($message)) {\n\t\t\t$this->output = array_merge($this->output, $message);\n\t\t} else {\n\t\t\t$this->output []= $message;\n\t\t}\n\t}", "public static function message($input)\n {\n fwrite(STDOUT, $input . PHP_EOL);\n }", "public static function output($message)\n {\n echo $message;\n }", "public function addLog()\n {\n $data = date(\"Y-m-d H:i:s\") . \" client: \" . ($_SERVER['REMOTE_ADDR'] ?? \"\") . \" message: \" . $this->data;\n file_put_contents($this->logFileName, $data . \"\\n\", FILE_APPEND);\n }", "protected static function write($message)\n {\n echo $message, \"\\n\";\n }", "function addOutput(Output\\iOutput $output) {\n $this->_outputs->attach($output);\n }", "private function progressOutput($msg='') {\r\n $logFile = Mage::getBaseDir('media') . DS . 'assurant_processing.log';\r\n file_put_contents($logFile, $msg);\r\n }", "public function addErr(string $output): void\n {\n $this->stdErr .= $output;\n }", "public function writeln($messages, $options = 0);", "public function write($output) {\n\t\t$this->buffer .= $output;\n\t}", "protected function addToOutputString($letter)\n {\n $this->output .= $letter;\n }", "public function output(string $message)\n {\n print_r($message . PHP_EOL);\n }", "public function output($msg)\n {\n return JText::_($this->_output.$msg);\n }", "function output($msg=false,$verbose_level=VERBOSE_SIMPLE,$newline=\"\\n\"){\n if ($this->verbose >= $verbose_level){\n if (empty($msg)){\n echo $this->error_msg.$newline;\n }\n else{\n echo $msg.$newline;\n }\n }\n }", "public function add($text) {\n\t\t\t//if log is enabled and log file was oppened, prints text to it\n\t\t\tif (($this->enabled) && ($this->handler !== false))\n\t\t\t\tfwrite($this->handler, date('[d/m/Y - H:i:s] ').$text.\"\\n\");\n\t\t}", "public function out(string $message)\n {\n $this->climate->out($message);\n }", "function append($message) {\n \n // Check DB\n if($this->is_valid_db() == false) {\n throw new Exception(\"Cannot append to log -- not connected to database\");\n }\n \n // Check table\n if($this->table == '') {\n throw new Exception(\"Cannot append to log -- table not set\");\n }\n\n // Get IP address\n $remote_addr = $this->db->escape_string($_SERVER['REMOTE_ADDR']);\n \n // Get requested script\n $script = $this->db->escape_string($_SERVER['PHP_SELF']);\n \n // Get query string\n $query_string = $this->db->escape_string(urldecode($_SERVER['QUERY_STRING']));\n \n // Escape the message and table name\n $message = $this->db->escape_string($message);\n $table = $this->db->escape_string($this->table);\n \n // Create query (all input has been escaped)\n $sql = \"INSERT INTO $table (remote_addr, script, query_string, message) \";\n $sql .= \"VALUES (INET_ATON('$remote_addr'), '$script', '$query_string', '$message')\";\n \n // Execute query \n $result = $this->db->query($sql);\n \n // Check result\n if($result == false) {\n throw new Exception(\"Unable to write to database -- \" . $this->db->error);\n }\n \n // If e-mail settings have been defined\n if($this->email_settings instanceof StanfordLogEmailSettings) {\n \n // Send via e-mail if it is time to do so\n $this->send_if_delay_is_up();\n \n }\n \n // Return success\n return true;\n \n }", "public function write($msg);", "function output($message, $r=1)\n {\n $n = str_repeat(\"\\n\", $r);\n print($message . $n);\n }", "public function write($msg = '') {\n\t\tfwrite(STDOUT, $this->format($msg));\n\t}", "public function appendMessage($appendingText)\n {\n $this->message = $this->getMessage() . $appendingText;\n }", "function put_line($msg=\"\")\r\n\t\t{\r\n //echo date(\"H:i:s\") . \" SMTP >> $msg\\r\\n <br>\";\r\n fputs($this->con,\"$msg\\r\\n\");\r\n\t\t\treturn;\r\n\t\t}", "public function append_output($out)\n\t\t{\n\t\t\t$this->output .= $out;\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function writeln($messages)\n {\n $this->output->writeln($messages);\n }", "protected final function putline($output = '')\n {\n echo $output . $this->line_break;\n }", "function writeMessage() {\r\n echo \"Presently working with Binaryfolks which is suggested by Adamas University.\";\r\n\t\t\techo \"Thanks to Adamas University for suggesting me such a wonderful company.\";\r\n\t\t\techo \"Thanks to Binaryfolks for offering me the opportunity to work with the organization.\";\r\n }", "protected function add($string = \"\")\n {\n $this->message .= $string . \"\\n\";\n }", "public function writeln(string $message): void;", "function out($msg) {\n global $log;\n\n\t$log->message($msg); \n echo \"$msg\\n\";\n}", "function writeMessage($message){\n \techo \"$message\";\n }", "function append($text = \"\", $level=0){\n\t\tif(!$this->isEnabled() || !$this->isRecording()){\n\t\t\treturn false;\n\t\t}\n\t\t$level++;\n\n\t\t$text = $this->getBacktraceAsString($level).\": \".$text;\n\n\t\t$this->stream .= $text.\"<br />\\n\";\n\n\t\treturn true;\n\t}", "public function write($message)\n {\n\n $this->stack[] = $message;\n\n }", "private function write($msg) {\n file_put_contents($this->logFilePath, $msg . \"\\n\", FILE_APPEND);\n }", "public function lwrite($message){\n\t\t\n\t\tif (!$this->fp) $this->lopen();\n\t\t\n\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t\n\t\t$time = date('H:i:s');\n\t\t\n\t\tfwrite($this->fp, \"$time ($script_name) $message\\n\");\n\t}", "private function display_output($message)\n\t{\n\n\t\t//TODO: check if output medium is cli or api and output accordingly\n\t\tif (!empty($message)) {\n\t\t\t$mode = $this->get_mode();\n\n\t\t\tif ($mode == Config::MODE_CLI) {\n\t\t\t\tfwrite(STDOUT, \"{$message}\\n\");\n\t\t\t} elseif ($mode == Config::MODE_GUI) {\n\t\t\t\techo json_encode([\"message\"=>$message]);\n\t\t\t}\n\t\t}\n\t}", "public function addMessage($msg);", "public function message($string)\n {\n $this->logger->addInfo($string);\n $this->echoer->write($string);\n }", "function writeLog($msg) {\n// file_put_contents('/tmp/bet', $msg . \"\\n\", FILE_APPEND);\n }", "public function writeln($messages, $options = 0) {\n $messages = (array) $messages;\n foreach ($messages as $message) {\n $this->messages[] = ['writeln', $message];\n }\n }", "public function out($message)\n {\n echo $message;\n }", "public function out($message)\n {\n echo $message;\n }", "function write($msg) {\n $stdout = fopen(\"php://stdout\", \"w\");\n fputs($stdout, $msg . \"\\n\");\n fclose($stdout);\n}", "function output($message) {\n echo date('Y/m/d H:i:s') . ' ' . $message . PHP_EOL;\n}", "public function line(): void\n {\n $this->output->write([''], true);\n }", "public function addResult($msg)\n {\n $this->results[] = $msg;\n }", "function log($text)\r\n\t{\r\n\t\t$this->log .= $text . \"</br></br>\";\r\n\t}", "public function toOutput(string $msg, string $type = \"info\"): void\n {\n if ($this->output) {\n $this->output->writeln(\"<$type>\" . $msg . \"</$type>\");\n }\n }", "private function write($message, $foreground = 'white', $background = 'black', $options = 'bold')\n {\n $this->output->writeln('<fg='.$foreground.';options='.$options.';bg='.$background.'>'.\n $message\n .'</fg='.$foreground.';options='.$options.';bg='.$background.'>');\n }", "protected function _write() {\n $message = self::getMessage();\n $priority = $this->priorityList[$this->_logData['severity']];\n syslog($priority, $message);\n }", "private function message(string $message)\n {\n $this->_output->write(\"Ling.Light_UserData: \" . $message);\n }", "public function write($message)\n {\n }", "protected function _append() {}", "public function output($txt)\n {\n $this->m_content.= $txt.\"\\n\";\n }", "public static function out($msg = '', $newLine = true, $exit = false) { \n $output = (\n preg_match('/^-[^-]+/', $msg) ? \n ltrim($msg, '-') : \n self::$outputPrefix.$msg\n ).($newLine ? PHP_EOL : ''); \n echo $output;\n self::log($output);\n if ($exit) exit;\n }", "public function addInfo($message);", "protected function doWrite(string $message, bool $newline)\n {\n $this->output .= $message . ($newline ? \"\\n\" : '');\n }", "public function out($message_type, $message)\r\n {\r\n if ($this->verbocity_options[$message_type])\r\n {\r\n // Erase progress\r\n $this->_erase_progress();\r\n\r\n // Output message to console\r\n echo $message . \"\\n\";\r\n }\r\n\r\n if ($this->logging_options[$message_type])\r\n {\r\n $this->_log($message);\r\n }\r\n }", "private function out($message,$color='',$linebreak=false)\n\t{\n\t\techo ($color ? $this->formatWithColor($color, $message) : $message) . ($linebreak ? \"\\n\" : '');\n\t}", "static function outln( $text, $appendDate = false )\n {\n\n if( $appendDate )\n $text .= date('Y-m-d');\n\n if( IS_CLI )\n echo $text.NL;\n else\n echo $text.NL.\"<br />\";\n\n flush();\n\n }", "public function appendMsg($value)\n {\n return $this->append(self::MSG, $value);\n }", "function AddLog($str) {\n\tglobal $res_str;\n\t$res_str .= $str . \"\\r\\n\";\n}", "public function info($msg) {\r\n\t\t$this->writeLn('INFO', $msg);\r\n\t}", "protected function out($message)\n {\n if ($this->suppressOutput === true) {\n return;\n }\n\n print($message);\n }", "public function echoMessage(): void\n {\n echo $this->message;\n }", "public function printMessage()\n {\n echo self::gMessage(true);\n }", "function writeMessage() {\r\n echo \"You are really a nice person, Have a nice time!\";\r\n }", "public function write($text)\r\n {\r\n $this->current .= $text;\r\n }", "public function append() {\n\t\t$this->prepend = false;\n\t}", "public function writeln(Action $action, string $msg, int $innerLevel = 0);", "public static function outLine($msg = '') {\n // Check for resizing\n self::getScreenSize();\n for ($cnt = 0; $cnt < self::$screen['width']; $cnt++)\n echo ' ';\n echo \"\\r\";\n self::out($msg.\" \\r\", false);\n }", "private function sendOutput(&$output)\n {\n $this->truncateOutput($output);\n $output = preg_replace(\"/\\r\\n|\\r|\\n/\", '\\n', \n sprintf(\"<span>%s</span>\", implode(\"</span><span>\", \n explode(\"\\n\", addslashes(htmlentities($output))))));\n echo \"<script>TERM_receiver(\\\"{$output}\\\");</script>\\n\";\n flush();\n $end = strpos($output, END_DELIMETER);\n if (FALSE !== $end) {\n echo \"<script>TERM_receiver(\\\":q\\\");</script>\\n\";\n }\n return $output;\n }", "public function appendOutput(string $output)\n {\n $this->output = $this->output . $output;\n return $this;\n }", "public function report( $msg ) {\n\t\t$this->output( \"$msg\\n\" );\n\t}", "public function writeln(string|iterable $messages, int $options = 0);", "public function insertLogOverwrite($msg){\n $currentTime = date_format($this->createTimestamp(), \"mdHisu\");\n $elapsedTime = $currentTime - $this->dateTimeLastLog;\n $this->dateTimeLastLog = $currentTime;\n $this->log = \"\\n\".$elapsedTime.\"\\t\\t\".$msg;\n\n if(strlen($this->log) > 10000){\n if(empty($this->noLog)){\n if(file_put_contents($this->logFile, $this->log, FILE_APPEND) !== FALSE){\n chmod($this->logFile, $this->defaultPerms);\n unset($this->log);\n }\n }\n }\n }", "public function beforeOutput() { \n $output = array();\n $logs = $this->object->getMany('fileQueueLogs');\n foreach ($logs as $row) {\n $output[] = '[' . date('d-m-Y H:i', $row->createdon) . '] ' . $row->message;\n }\n $this->object->set('log', implode(\"\\n\", $output));\n }", "function appendText ($text) {\n\t\t$this->content .= $text;\n\t}", "protected function doWrite($message, $newline) {\n $method = 'write' . ($newline ? 'Line' : '');\n\n $this->rideCommandOutput->$method($message);\n }", "public static function print($message)\n {\n $output = self::getOutput();\n $output->writeln($message);\n }", "function append_message() {\n $msg_array = get_message();\n if ($msg_array != NULL) {\n $msg = $msg_array['content'];\n $duration = $msg_array['duration'];\n echo \"<nav id='message' js-timeout='$duration'>$msg</nav>\";\n }\n}", "public function stdoutLn($message)\n {\n $return = parent::stdout($message);\n echo PHP_EOL;\n return $return;\n }", "public function addLogMessage($message)\n\t{\n\t\tif($this->isDebugMode())\n\t\t\t$this->appLog[] = $message;\n\t}" ]
[ "0.6974645", "0.6721728", "0.6692098", "0.6681221", "0.65169495", "0.64799017", "0.6428086", "0.63191736", "0.6253341", "0.62469923", "0.6221392", "0.6215629", "0.6158659", "0.6123753", "0.612201", "0.60718346", "0.60616297", "0.60486114", "0.6035242", "0.600424", "0.5970611", "0.59434867", "0.59303707", "0.59293956", "0.5928818", "0.5924123", "0.592118", "0.5913633", "0.58781797", "0.5852645", "0.58474386", "0.5838653", "0.583378", "0.58075696", "0.57989705", "0.57973534", "0.57890666", "0.5787471", "0.57831484", "0.5782487", "0.5767354", "0.5745189", "0.5742098", "0.57409275", "0.5737725", "0.57368994", "0.5732637", "0.57174295", "0.5708561", "0.56946427", "0.56894463", "0.567848", "0.567127", "0.56682515", "0.5667589", "0.56437975", "0.56376106", "0.5631972", "0.5631972", "0.56078076", "0.5604218", "0.56033504", "0.5600582", "0.5595207", "0.5593288", "0.5589337", "0.55850804", "0.55847466", "0.5581613", "0.5578843", "0.5572628", "0.5561677", "0.55573416", "0.5554128", "0.5552349", "0.55520207", "0.5549704", "0.55453575", "0.55441433", "0.55337054", "0.5529304", "0.5528539", "0.55099905", "0.5499682", "0.54969966", "0.54924667", "0.54797375", "0.5472959", "0.54680604", "0.54581296", "0.5454072", "0.54513144", "0.5450914", "0.544916", "0.544235", "0.54416937", "0.5439879", "0.54350793", "0.54340947", "0.5433797" ]
0.72938645
0
A function to define if build succeeds or not
Функция для определения успешности сборки
abstract public function buildSucceed();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBuilt();", "public static final function BUILD_SUCCESSFUL()\r\n {\r\n if (null === self::$BUILD_SUCCESSFUL)\r\n self::$BUILD_SUCCESSFUL = new Inx_Api_TriggerMail_BuildResultCode(1);\r\n\r\n return self::$BUILD_SUCCESSFUL;\r\n }", "protected function build() : bool\n {\n $this->writeConsole(\"> creating GitHub wiki {cyan}\\\"\" . $this->strTitle . \"\\\"{reset} in {cyan}[\" . $this->strWikiPath . \"]{reset}\", self::MSG_VERBOSE);\n if (!empty($this->strConfigFile)) {\n $this->writeConsole(\"> using config file {cyan}[\" . $this->strConfigFile . \"]{reset}\", self::MSG_VERBOSE);\n }\n\n if (!$this->pullRepo()) {\n return false;\n }\n if (!$this->generateWiki()) {\n return false;\n }\n return $this->pushRepo();\n }", "function doBuild();", "public function buildExisted($data) {\n $version = $data->version;\n $build = $data->build;\n $os = $data->os;\n\n $sql = query_Select_BuildNumber;\n $stmt = $this->con->prepare($sql);\n $stmt->bind_param('sis',$version, $build, $os);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n\n return $num_rows > 0;\n }", "public function isHasBuild()\n {\n return $this->_hasBuild;\n }", "public function isBuilt(): bool\n {\n return (bool) $this->class;\n }", "public function succeeded(): bool;", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function isBuilt()\n\t{\n\t\treturn ($this->dbMap !== null);\n\t}", "public function ok(): bool;", "public function ok(): bool;", "private function build() {\n $extraConfig['edition']\n = \"{$this->language->nativeName()} / {$this->version->name}\";\n $extraConfig['book_home'] = \"/{$this->book->slug}\";\n try {\n $this->mkDocs->build($this->repoPath, $this->publishPath, $extraConfig);\n }\n catch (\\Exception $e) {\n $this->addMessage('CRITICAL',\n \"Build errors encountered. Book not published. Build error message: \"\n . $e->getMessage());\n return FALSE;\n }\n $this->addMessage('INFO', \"Book published successfully at \"\n . \"<a href='{$this->publishURLFull}'>{$this->publishURLFull}</a>.\");\n return TRUE;\n }", "function isSuccessful() ;", "protected function __build()\n {\n // Rewrite the method to do something before the building.\n }", "public function execute()\n {\n $path = $this->builder->buildPath;\n $build = $this->build;\n\n if ($this->directory === $path) {\n return false;\n }\n\n $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename);\n $filename = str_replace('%build.id%', $build->getId(), $filename);\n $filename = str_replace('%build.branch%', $build->getBranch(), $filename);\n $filename = str_replace('%project.title%', $build->getProject()->getTitle(), $filename);\n $filename = str_replace('%date%', date('Y-m-d'), $filename);\n $filename = str_replace('%time%', date('Hi'), $filename);\n $filename = preg_replace('/([^a-zA-Z0-9_-]+)/', '', $filename);\n\n if (!is_array($this->format)) {\n $this->format = [$this->format];\n }\n\n foreach ($this->format as $format) {\n switch ($format) {\n case 'tar':\n $cmd = 'tar cfz \"%s/%s.tar.gz\" ./*';\n break;\n default:\n case 'zip':\n $cmd = 'zip -rq \"%s/%s.zip\" ./*';\n break;\n }\n\n $success = $this->builder->executeCommand($cmd, $this->directory, $filename);\n }\n\n return $success;\n }", "public function isSuccessful(): bool {}", "protected function is_built() {\n\t\treturn file_exists(\n\t\t\t$this->package->get_path( 'build/featured-product.js' )\n\t\t);\n\t}", "function build_failed_msg( $ret )\n{\n\tswitch ( $ret )\n\t{\n\t\tcase _C_WEBPHOTO_ERR_DB:\n\t\t\t$this->set_error_in_head_with_admin_info( 'DB Error' );\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "public function isSuccessful() {}", "function build();", "public function canRebuild()\n\t{\n\t\treturn $this->isInstalled() && $this->isFileVersionValid() && $this->canEdit();\n\t}", "public function isSuccessful();", "public function isSuccessful();", "public function isSuccessful();", "public function isSuccessful();", "public function isSuccessful();", "public function isOk(): bool {}", "abstract public function getIsOk(): bool;", "public function run()\n {\n $slug = $this->getSuite()->getRepositorySlug();\n if (!$slug) {\n return;\n }\n\n $result = $this->checkTravisBuild($slug) || $this->checkCircleCiBuild($slug);\n $this->setSuccessful((bool) $result);\n }", "public function isOk(): bool;", "private static function can_custom_build() {\n\t\t\treturn version_compare( PHP_VERSION, '5.3.0', '>=' );\n\t\t}", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccessful() : bool\n {\n return false;\n }", "public static function build($video,$setup){\n return false;\n }", "function canBuild() {\r\n return ($this->isAdmin()) ? true : $this->perm_canBuild;\r\n }", "private function ConstructBuilding( ResourceBuilder $rb )\n {\n \n if( count($rb->BuildList()->Members()) == 0 ) \n return true; // Nothing to do here\n \n // Get the first item on the list\n $unit = reset( $rb->BuildList()->Members() );\n \n echo \"<br/>Unit about to be built: \";\n echo $unit;\n \n // Construct it (database is updated within)\n return $unit->Construct();\n }", "public function fails(): bool;", "function shouldProceed();", "function isOk(){\n\n $f = XOOPS_ROOT_PATH.((substr(XOOPS_ROOT_PATH, -1) == '/') ? '' : '/')\n .'modules/'.$this->moduleName.'/xoops_version.php';\n return is_readable($f);\n \n }", "function it_should_build(OutputInterface $output)\n {\n $this->dbService->containerExists()->willReturn(false);\n $this->dbService->build($output, Argument::any())\n ->shouldBeCalled()\n ->willReturn(true);\n\n $this->webService->containerExists()->willReturn(false);\n $this->webService->build($output, Argument::any())\n ->shouldBeCalled()\n ->willReturn(true);\n\n $this->build($output)->shouldReturn(true);\n }", "public function is_setup_completed() : bool;", "public function produce(): bool;", "function check_build_name_existence($tplan_id,$build_name,$build_id=null,$case_sensitive=0)\r\n {\r\n $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;\r\n\r\n $sql = \" /* $debugMsg */ SELECT id, name, notes \" .\r\n// \" FROM {$this->tables['builds']} \" .\r\n \" FROM \".$this->db->get_table('builds').\" \" .\r\n \" WHERE testplan_id = {$tplan_id} \";\r\n \r\n \r\n if($case_sensitive)\r\n {\r\n $sql .= \" AND name=\";\r\n }\r\n else\r\n {\r\n $build_name=strtoupper($build_name);\r\n $sql .= \" AND UPPER(name)=\";\r\n }\r\n $sql .= \"'\" . $this->db->prepare_string($build_name) . \"'\";\r\n \r\n if( !is_null($build_id) )\r\n {\r\n $sql .= \" AND id <> \" . $this->db->prepare_int($build_id);\r\n }\r\n \r\n \r\n $result = $this->db->exec_query($sql);\r\n $status= $this->db->num_rows($result) ? 1 : 0;\r\n \r\n return $status;\r\n }", "public function check_build(){\n $builder = new Builder();\n $data_order = $builder->setName('Seva')\n ->setSurname('Karnaukhov')\n ->setNumberOrder(12)\n ->setOrderList(['notebook','iphone','audio device'])\n ->getOrder();\n debug('Шаблон строитель или builder');\n debug($data_order);\n $data_order_1 = $builder->setPaymentForGoods('оплачено')\n ->setEmail('123@gmail.com')\n ->setAdressDelivery('Moscow')\n ->getOrder();\n debug($data_order_1);\n //die();\n \n }", "public function isFail(): bool;", "abstract protected function build();", "abstract protected function build();", "function it_fails_build_when_webservice_build_fails(OutputInterface $output)\n {\n $this->dbService->containerExists()->willReturn(true);\n\n $this->webService->containerExists()->willReturn(false);\n $this->webService->build($output, Argument::any())\n ->shouldBeCalled()\n ->willReturn(false);\n\n $this->build($output)->shouldReturn(false);\n }", "function CheckForManualBuild() {\n\t\tif(!empty($_GET[\"sm_command\"]) && !empty($_GET[\"sm_key\"])) {\n\t\t\t$this->Initate();\n\t\t\tif($this->GetOption(\"b_manual_enabled\")===true && $_GET[\"sm_command\"]==\"build\" && $_GET[\"sm_key\"]==$this->GetOption(\"b_manual_key\")) {\n\t\t\t\t$this->BuildSitemap();\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "public function isSuccess();", "public function isSuccess();", "public function isSuccess();", "public function install_check()\n {\n Artisan::call('optimize:clear');\n\n $passed = true;\n\n // Permissions checker\n $results['permissions'] = [];\n foreach ($this->permissions as $folder => $permission) {\n $results['permissions'][] = [\n 'folder' => $folder,\n 'permission' => substr(sprintf('%o', fileperms(base_path($folder))), -4),\n 'required' => $permission,\n 'success' => substr(sprintf('%o', fileperms(base_path($folder))), -4) >= $permission ? true : false,\n ];\n }\n\n // Extension checker\n $results['extensions'] = [];\n foreach ($this->extensions as $extension) {\n $results['extensions'][] = [\n 'extension' => $extension,\n 'success' => extension_loaded($extension),\n ];\n }\n\n $results['extensions'][] = [\n 'extension' => 'proc_open',\n 'success' => function_exists('proc_open'),\n ];\n\n // PHP version\n $results['php'] = [\n 'installed' => PHP_VERSION,\n 'required' => $this->minPhpVersion,\n 'success' => version_compare(PHP_VERSION, $this->minPhpVersion) >= 0 ? true : false,\n ];\n\n\n // Pass check\n foreach ($results['permissions'] as $permission) {\n if ($permission['success'] == false) {\n $passed = false;\n break;\n }\n }\n\n foreach ($results['extensions'] as $extension) {\n if ($extension['success'] == false) {\n $passed = false;\n break;\n }\n }\n\n try {\n } catch (\\Exception $e) {\n }\n\n if ($results['php']['success'] == false) {\n $passed = false;\n }\n\n return view('project_installer::install', compact(\n 'results',\n 'passed'\n ));\n }", "public function runOk(): bool\n {\n return self::assertBetween(1, 0, 2, $this->error);\n }", "public function isSuccessful() {\n $is_successful = ($this->get('result') == 'succeeded');\n return $is_successful;\n }", "public function isSuccessful()\r\n {\r\n return true;\r\n }", "public function isSuccessful(): bool\n {\n return $this->successful === true;\n }", "private function check()\n\t{\n\t\treturn true;\n\t}", "public function isSuccesful();", "protected function doCompilerBuild() {\n\n $descriptorspec = array(\n 1 => array(\"pipe\", \"w\"), // stdout\n 2 => array(\"file\", $this->buildErrFileName,\"w\") // stderr\n );\n\n $cmd = Control::$pccBinary.' -v -I '.dirname($this->tptFileName).' '.$this->testFileName;\n Control::log(2, $cmd);\n $process = proc_open($cmd, $descriptorspec, $pipes);\n if (is_resource($process)) {\n\n while(!feof($pipes[1])) {\n $this->buildOutput .= fgets($pipes[1]);\n }\n fclose($pipes[1]);\n\n $return_value = proc_close($process);\n\n file_put_contents($this->buildFileName, $this->buildOutput);\n\n // if we have a COMPILER:BUILDFAILEXPECTF, make sure we failed\n if (isset($this->sectionData['COMPILER:BUILDFAILEXPECTF'])) {\n // we expect the build to fail\n if ($return_value == 0) {\n // woops, we built ok\n Control::log(2,'expected test not to build, but it did anyway');\n $this->compileResult = self::RESULT_BUILDFAIL_FAIL;\n }\n else {\n // we did fail, but did our fail output match?\n Control::log(2,'expected test not to build, and it didn\\'t');\n $result = $this->compareOutput('EXPECTF',$this->sectionData['COMPILER:BUILDFAILEXPECTF'],trim(file_get_contents($this->buildErrFileName)));\n if ($result == self::RESULT_PASS)\n $this->compileResult = self::RESULT_BUILDFAIL_PASS;\n else\n $this->compileResult = self::RESULT_BUILDFAIL_FAIL;\n }\n }\n else {\n\n // we expect the build to succeed\n if ($return_value != 0) {\n $this->compileResult = self::RESULT_BUILDFAIL;\n }\n else {\n // release build output mem if we aren't using it\n unset($this->buildOutput);\n }\n \n }\n\n }\n else {\n // couldn't open compiler process\n Command::bomb(\"unable to run compile command:\\n$cmd\");\n }\n\n }", "public function notOk(): bool;", "public abstract function build();", "protected function escortBuild() {\n return NULL;\n }", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "abstract public function build();", "public static function get_build()\n {\n }", "public function build() {\n\t}", "protected function doCompilerBuild() {\n\n $descriptorspec = array(\n 1 => array(\"pipe\", \"w\"), // stdout\n 2 => array(\"file\", $this->buildErrFileName,\"w\") // stderr\n );\n\n //$cmd = Control::$rphpBinary.' -v -I '.dirname($this->tptFileName).' '.$this->testFileName;\n $cmd = Control::$rphpBinary.' -v 2 '.$this->testFileName;\n Control::log(2, $cmd);\n $process = proc_open($cmd, $descriptorspec, $pipes);\n if (is_resource($process)) {\n\n while(!feof($pipes[1])) {\n $this->buildOutput .= fgets($pipes[1]);\n }\n fclose($pipes[1]);\n\n $return_value = proc_close($process);\n\n file_put_contents($this->buildFileName, $this->buildOutput);\n\n // if we have a COMPILER:BUILDFAILEXPECTF, make sure we failed\n if (isset($this->sectionData['COMPILER:BUILDFAILEXPECTF'])) {\n // we expect the build to fail\n if ($return_value == 0) {\n // woops, we built ok\n Control::log(2,'expected test not to build, but it did anyway');\n $this->compileResult = self::RESULT_BUILDFAIL_FAIL;\n }\n else {\n // we did fail, but did our fail output match?\n Control::log(2,'expected test not to build, and it didn\\'t');\n $result = $this->compareOutput('EXPECTF',$this->sectionData['COMPILER:BUILDFAILEXPECTF'],trim(file_get_contents($this->buildErrFileName)));\n if ($result == self::RESULT_PASS)\n $this->compileResult = self::RESULT_BUILDFAIL_PASS;\n else\n $this->compileResult = self::RESULT_BUILDFAIL_FAIL;\n }\n }\n else {\n\n // we expect the build to succeed\n if ($return_value != 0) {\n $this->compileResult = self::RESULT_BUILDFAIL;\n }\n else {\n // release build output mem if we aren't using it\n unset($this->buildOutput);\n }\n \n }\n\n }\n else {\n // couldn't open compiler process\n Command::bomb(\"unable to run compile command:\\n$cmd\");\n }\n\n }", "public function check(){}", "public function testBuild(): void\n {\n $result = $this->pathBuilder->build(['%one%', '%two%', 'four']);\n $this->assertEquals('/one/two/four', $result);\n }", "public function isSuccessful()\n {\n return true;\n }", "public function isSuccessful()\n {\n return true;\n }", "public function getCheckSummaryForBuildRow($row)\n {\n // Check properties to see if this build should be excluded\n // from the check.\n $properties = json_decode($row['properties'], true);\n if (is_array($properties) && array_key_exists('skip checks', $properties)) {\n return null;\n }\n\n $build_name = $row['name'];\n $build_url = \"$this->baseUrl/build/{$row['id']}\";\n $details_url = $build_url;\n if ($row['configureerrors'] > 0) {\n // Build with configure errors.\n $msg = \"{$row['configureerrors']} configure error\";\n if ($row['configureerrors'] > 1) {\n // Pluralize.\n $msg .= 's';\n }\n $details_url = \"$this->baseUrl/build/{$row['id']}/configure\";\n $icon = ':x:';\n $this->numFailed++;\n $this->foundConfigureErrors = true;\n } elseif ($row['builderrors'] > 0) {\n // Build with build errors.\n $msg = \"{$row['builderrors']} build error\";\n if ($row['builderrors'] > 1) {\n // Pluralize.\n $msg .= 's';\n }\n $details_url = \"$this->baseUrl/viewBuildError.php?buildid={$row['id']}\";\n $icon = ':x:';\n $this->numFailed++;\n $this->foundBuildErrors = true;\n } elseif ($row['testfailed'] > 0) {\n // Build with test failures.\n $msg = \"{$row['testfailed']} failed test\";\n if ($row['testfailed'] > 1) {\n // Pluralize.\n $msg .= 's';\n }\n $details_url = \"$this->baseUrl/viewTest.php?buildid={$row['id']}\";\n $icon = ':x:';\n $this->numFailed++;\n $this->foundTestFailures = true;\n } else {\n if ($row['done'] == 1) {\n // Build completed without problems.\n $icon = ':white_check_mark:';\n $msg = 'success';\n $this->numPassed++;\n } else {\n // Build hasn't finished reporting yet.\n $icon = ':hourglass_flowing_sand:';\n $msg = 'pending';\n $this->numPending++;\n // Schedule this check to re-run when the build\n // is finished.\n PendingSubmissions::RecheckForBuildId($row['id']);\n }\n }\n $build_summary = \"[$build_name]($build_url) | $icon | [$msg]($details_url)\";\n return $build_summary;\n }", "public function check(): bool\n {\n $this->output = $this->composer->installDryRun('--no-dev');\n\n return str_contains($this->output, 'Nothing to install or update');\n }", "public function onBuildingFinished() {}", "function onBuildingFinished() ;", "public function build() {}", "function chdbadmin_make_exists($make) {\n $entry = chdbadmin_get_make($make);\n if (sizeof($entry) > 0) {\n return 1;\n }\n return 0;\n}" ]
[ "0.7146451", "0.66728806", "0.64905685", "0.63542104", "0.62388784", "0.62368387", "0.6190656", "0.6133842", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.6115081", "0.60705554", "0.60705554", "0.6005849", "0.59927094", "0.59841067", "0.59823644", "0.5972565", "0.59655935", "0.5955057", "0.5921855", "0.5888523", "0.5854722", "0.5788341", "0.5788341", "0.5788341", "0.5788341", "0.5788341", "0.5778487", "0.57648134", "0.5760231", "0.5704375", "0.56930804", "0.5684818", "0.5684818", "0.5684818", "0.5684818", "0.5665667", "0.56556237", "0.56030715", "0.55973136", "0.5541146", "0.5540999", "0.55163765", "0.54877055", "0.54829794", "0.5481361", "0.54720104", "0.54685044", "0.54461366", "0.54393095", "0.54393095", "0.5428601", "0.54250044", "0.54144245", "0.54144245", "0.54144245", "0.54113966", "0.54098773", "0.5398998", "0.53886414", "0.5387022", "0.5384499", "0.53805006", "0.5379768", "0.5377588", "0.53640777", "0.5362498", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.5361837", "0.535995", "0.53493035", "0.53413326", "0.53125465", "0.5309023", "0.5306816", "0.5306816", "0.5305716", "0.5304087", "0.5301065", "0.5293219", "0.5286734", "0.528492" ]
0.75705993
0
Returns quote numbers by month
Возвращает номера котировок по месяцам
public function getQuotesByMonth() { $monthdata = []; for ($month = 1; $month <= (date('m') + 12); $month++) { $start = mktime(0, 0, 0, $month, 1, date("Y", strtotime('-1 year'))); $end = mktime(23, 59, 0, $month, date('t', $start), date("Y", strtotime('-1 year'))); $this->select('id') ->where('datetime', '>=', $start) ->where('datetime', '<=', $end) ->show(); $quotecount = $this->count(); if ($month >= 13) { $newmonth = $month - 12; $dateObj = \DateTime::createFromFormat('!m', $newmonth); } else { $dateObj = \DateTime::createFromFormat('!m', $month); } $monthName = $dateObj->format('M'); // March $monthdata[$monthName] = $quotecount; } return $monthdata; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function splitByMonth();", "public abstract function get_months();", "private function getNumbersAddToCartMonthly()\n {\n $this->runTest(\n 'Test 22. Get numbers of add to cart by month',\n 'SELECT period, SUM(analytic_shop.products_in_cart_count) as products_in_cart_count\n FROM analytic_data analytic,\n analytic_shop analytic_shop\n WHERE period >= \"2012-10-21 00:00\"\n AND period <= \"2012-11-21 00:00\"\n AND analytic_shop.analytic_id = analytic.id\n GROUP BY period\n ORDER BY period\n LIMIT 100'\n );\n }", "public function getMonth(): int;", "function get_month_orders($month)\n {\n $this->db->where('SUBSTRING(date,1,7)', $month);\n $this->db->order_by('date', 'desc');\n return $this->db->get('orders')->result_array();\n }", "private function getOrdersMonthly()\n {\n $this->runTest(\n 'Test 45. Get orders by month',\n 'SELECT period, SUM(analytic_shop.orders_count) as orders_count\n FROM analytic_data analytic,\n analytic_shop analytic_shop\n WHERE period >= \"2012-10-21 00:00\"\n AND period < \"2012-11-21 00:00\"\n AND analytic_shop.analytic_id = analytic.id\n GROUP BY period\n ORDER BY period\n LIMIT 100'\n );\n }", "public function reportingByMonth(){\n $anneCours = date('Y');\n //$dateM = date('m');\n $this->table = \"transaction\";\n $this->champs =[\"MONTH(date) as mois, sum(montant) as mnt\"];\n $this->condition=[\"YEAR(date) =\"=> $anneCours /*,\"MONTH(date) =\"=> $dateM*/];\n $this->group = [\"MONTH(date)\"];\n return $this->__select();\n }", "public static function month_numbers()\n\t{\n\t\tfor($month = 1; $month <= 12; $month++)\n\t\t{\n\t\t\tif(strlen($month) == 1)\n\t\t\t{\n\t\t\t\t$month = sprintf('%02d', $month);\n\t\t\t}\n\n\t\t\t$array[$month] = $month;\n\t\t}\n\n\t\treturn $array;\n\t}", "function &_getMonths()\n {\n for ( $x = 1; $x < 13; $x++ )\n {\n $val[] = date( \"m\", mktime ( 0,0,0,$x,1,0 ) );\n $values[] = strftime ( \"%B\", mktime ( 0,0,0,$x,1,0 ) );\n }\n $return_array = array( $values, $val );\n return $return_array;\n }", "private function getCartsMonthly()\n {\n $this->runTest(\n 'Test 51. Get carts by month',\n 'SELECT period, SUM(analytic_shop.create_cart_count) as create_carts_count\n FROM analytic_data analytic,\n analytic_shop analytic_shop\n WHERE period >= \"2012-10-21 00:00\"\n AND period < \"2012-11-21 00:00\"\n AND analytic_shop.analytic_id = analytic.id\n GROUP BY period\n ORDER BY period\n LIMIT 100'\n );\n }", "function out_months() {\n return qw('January February March April May June July August September October November December');\n}", "public function getMonthNumber(){\n return date(\"m\", $this->timestamp);\n }", "private function getMonthNames ()\n {\n return Array(\n '01' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'leden'\n ), \n '02' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'únor'\n ), \n '03' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'březen'\n ), \n '04' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'duben'\n ), \n '05' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'květen'\n ), \n '06' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'červen'\n ), \n '07' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'červenec'\n ), \n '08' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'srpen'\n ), \n '09' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'září'\n ), \n '10' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'říjen'\n ), \n '11' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'listopad'\n ), \n '12' => Array(\n 'price' => 0,\n 'invoices' => 0,\n 'month' => 'prosinec'\n ), \n );\n }", "public static function getMonths() {\n $output = [];\n for ($i=1; $i<=12; $i++) {\n $output[$i] = strftime(\"%B\", strtotime(\"2017-{$i}-01\"));\n }\n return $output;\n }", "public static function month()\n\t{\n\t\tfor($month = 1; $month <= 12; $month++)\n\t\t{\n\t\t\t$monthName = date(\"F\", mktime(0, 0, 0, $month, 10));\n\t\t\t$array[$month] = substr($monthName, 0, 3);\n\t\t}\n\n\t\treturn $array;\n\t}", "public function getAccMonth()\n {\n\n }", "public function _getNumberMonth()\n {\n return ceil($this->_getDuration() / 31);\n }", "public function getmonth()\n {\n $db=$this->dbConnect();\n $sql = $db->prepare(\"SELECT MONTH(date_achat) AS mois, YEAR(date_achat) AS year,ROUND(SUM(prix),2) AS prixcat, categorie FROM livres WHERE date_achat BETWEEN '2020-01-01' AND '2020-12-31' GROUP BY mois \");\n $sql->execute();\n $month=$sql->fetchAll();\n return $month;\n }", "public function get_months() {\n $months = array();\n\n for ($i = 1; $i <= 12; $i++) {\n $months[$i] = get_string('month' . $i, 'calendartype_hijri');\n }\n\n return $months;\n }", "public function getMonths($format = 'Y-m');", "function get_month_invoice_count(){\n $year = date('Y');\n $month = date('m');\n $query = $this->db->query(\"SELECT count(id) as scnt FROM invoice WHERE month(`payment_date`) = $month AND year(`payment_date`) = $year\"); \n $res = $query->result();\n $stockCount = 0;\n foreach ($res as $value) {\n $stockCount = $value->scnt;\n }\n return $stockCount;\n }", "public function getMonth()\n {\n return $this->format('n');\n }", "public function discountPriceMonths()\n {\n return $this->get('discount_price_months');\n }", "public static function getFuelperMonth() {\n // Get a db connection.\n $db = JFactory::getDBO();\n $query = \"SELECT SUM(liters) as liter, MONTHNAME(tankdatum) as month FROM #__mdfuel_receipts GROUP BY YEAR(tankdatum), MONTH(tankdatum) ASC\";\n $db->setQuery($query);\n $db->query();\n $result = $db->loadObjectList();\n return $result;\n }", "public function month()\n\t{\n\t\treturn static::$dateTime->format(\"n\");\n\t}", "public function getMonth(): int\n {\n return (int) $this->getData()['month'];\n }", "public function Months() {\r\n// $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\r\n $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');\r\n return $months;\r\n }", "public function findAvailableMonths()\n {\n $query = Doctrine_Query::create()\n ->select('DISTINCT month(entry_date) AS month, year(entry_date) AS year')\n ->from('Entry')\n ->orderBy('entry_date DESC');\n return $query->execute();\n }", "public function thisMonth_invoices()\n {\n $to_date = date('m');\n $query = $this->db->select('COUNT(*) as count')->from('sales')\n ->where('MONTH(sales_date)', $to_date)->get()->row();\n return $query;\n }", "private function months()\n\t{\n\t\treturn array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');\n\t}", "private function months()\n\t{\n\t\treturn array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');\n\t}", "public function getCreatedInvoicebyMonth() {\n\t\t$db = new DBManager();\n $sql = \"SELECT ems_invoices.invoice_id as invoice_id, ems_invoices.created_at as created_at from ems_invoices, ems_invoice_amount where ems_invoices.invoice_id = ems_invoice_amount.invoice_id GROUP BY DATE_FORMAT(ems_invoices.created_at, '%Y%m') order by ems_invoices.id desc\";\n\n $data = $db->getAllRecords($sql);\n $totalSale = $db->getNumRow($sql);\n while ($row = $db->getNextRow()) {\n $this->created_invoice_id[] = $row['invoice_id'];\n $this->created_invoice_date_monthly[] = $row['created_at'];\n }\n return $totalSale;\n }", "public function getMonth(): int\n {\n return (int) $this->format('n');\n }", "public static function getMonths() {\n\t\t$results = array();\n\t\t$current_month = intval(date('m'));\n\n\t\tfor($x = $current_month; $x < $current_month + 12; $x++) {\n\t\t\t$months = array();\n\t\t\t$key = sprintf(\"%02d\", date('n', mktime(0, 0, 0, $x, 1)));\n\t\t\t$value = date('F', mktime(0, 0, 0, $x, 1));\n\n\t\t\t$months['display'] = $value;\n\t\t\t$months['value'] = $key;\n\n\t\t\tarray_push($results, $months);\n\t\t}\n\n\t\treturn $results;\n\t}", "function get_months_array() {\n $output = [];\n\n for ( $i = 1; $i <= 12; $i++) {\n $month = date('F', mktime(0, 0, 0, $i, 1));\n $output[$i] = $month;\n }\n\n return $output;\n}", "public function getMonthlyPosts(){\n $year = date('Y');\n $month = date('m');\n $this->db->query('SELECT created_at FROM ' . $this->table . ' WHERE year(created_at) = :yearN');\n $this->db->bind(':yearN', $year);\n $results = $this->db->resultSet();\n return $results;\n }", "public function getMonths() : array;", "public function getCcMonths()\n {\n //$months[0] = __('Month');\n $months = $this->getMonths();\n return $months;\n }", "function fine_get_month($month) {\r\n\t$month = (int)$month;\r\n\t\r\n\treturn fine_get_common_service(\"month.\".$month);\r\n}", "function getMonths()\n {\n $date = Carbon::createFromFormat('m', '1');\n $months[1] = $date->startOfMonth()->format('F');\n\n foreach (range(2, 12) as $month) {\n $months[$month] = $date->addMonth()->format('F');\n }\n\n return $months;\n }", "public function get_month($month_number)\n {\n }", "public function getMonth()\n {\n return floor($this->convertToDateElement(Phpr_DateTime::elementMonth));\n }", "public function getMonths()\n {\n if (!self::$_months) {\n self::$_months = ['' => __($this->getCheckoutLabelbyCode('CO6') ?\n $this->getCheckoutLabelbyCode('CO6') : 'Month')];\n for ($i = 1; $i < 13; $i++) {\n $month = str_pad($i, 2, '0', STR_PAD_LEFT);\n self::$_months[$month] = date(\"$i - F\", mktime(0, 0, 0, $i, 1));\n }\n }\n\n return self::$_months;\n }", "public function month($date);", "public function get_month_permastruct()\n {\n }", "public function months($format = null);", "public static function getMonths() {\n\t\treturn array(\"\",\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Agu\",\"Sep\",\"Okt\",\"Nop\",\"Dec\");\n\t}", "public function daysInMonth() {\n\t\treturn (int) parent::format('t');\n\t}", "public function days_in_month() {\n\t\treturn $this->formatted('t');\n\t}", "public function getMonthName(): string;", "public function getCcExpMonth()\n {\n $month = $this->getInfo()->getCcExpMonth();\n /* if ($month < 10) {\n $month = '0' . $month;\n } */\n return $month;\n }", "public function getMonths()\n {\n return $this->_getList('month');\n }", "function getCountMonths($taxonKey)\n{\n $returnVal = array();\n for ($i = 1; $i < 13; $i++) {\n $months = json_decode(file_get_contents('http://api.gbif.org/v1/occurrence/search?taxonKey=' . $taxonKey . '&HAS_COORDINATE=true&country=CL&month=' . $i . '&limit=1'));\n $returnVal[$i - 1] = $months->count;\n }\n return $returnVal;\n}", "function countMonths($taxonKey)\n{\n $returnVal = array();\n for ($i = 1; $i < 13; $i++) {\n $months = json_decode(file_get_contents('http://api.gbif.org/v1/occurrence/search?taxonKey=' . $taxonKey . '&HAS_COORDINATE=true&country=CL&month=' . $i . '&limit=1'));\n $returnVal[$i - 1] = $months->count;\n }\n return $returnVal;\n}", "private function getMonth($query)\n {\n\n $count1 = $count2 = $count3 = null;\n foreach ($query as $q) {\n $month = $q['dateCreated'];\n\n $mon = $month->format('n');\n\n if ($mon <= 4) {\n $Apr[] = $mon;\n $count1 = count($Apr);\n } elseif ($mon > 4 || $mon <= 8) {\n\n $Aug[] = $mon;\n $count2 = count($Aug);\n } else {\n\n $Dec[] = $mon;\n $count3 = count($Dec);\n }\n }\n $totalCount = array($count1, $count2, $count3);\n return $totalCount;\n }", "public function getMonth(): int\n {\n return $this->month;\n }", "public function month_num($leading = true) {\n\t\t$leading = ($leading) ? 'm' : 'n';\n\n\t\treturn $this->formatted($leading);\n\t}", "function getMonth() {\n\t\treturn $this->format('m');\n\t}", "static public function getMonthChoices() {\r\n $choices = array();\r\n for($i=1;$i<=12;$i++) {\r\n if($i<10)\r\n $choices[\"0\".$i] = \"0\".$i;\r\n else\r\n $choices[$i] = $i;\r\n }\r\n return $choices;\r\n }", "public function bookingPerMonth()\n {\n $sql = \"SELECT EXTRACT(year_month FROM begin_date) as month, COUNT(*) as reservations FROM $this->table GROUP BY month\";\n try {\n return $this->pdo->query($sql)->fetchAll();\n } catch (\\PDOException $e) {\n return $e;\n }\n }", "function _monthConverter(){\n $mo=strtotime($this->mm);\n if($mo > 0)//don't know why i have to do this not what for because it sets the meladi month to 12 in order to avoid that\n $this->monthGregorian=date('n',$mo);\n for($loop=0;$loop<12;$loop++){\n if($this->im == $this->month1[$loop]){//mathches user input qamari month with the value in the array\n $qamariPosition = $loop+1;//to assing a numeric value for the month\n }\n if($this->sm == $this->month2[$loop]){\n $shamsiPosition=$loop+1;\n } \n }\n $this->monthIslamic=$qamariPosition;\n $this->monthPersian=$shamsiPosition;//works perfect\n ///end of qamari and shamsi months conversion\n }", "public static function getChartMonths()\n {\n $month = Carbon::create(2017, 7, 1);\n $months = Carbon::today()->diffInMonths($month);\n for ($i = 0; $i < $months; $i++){\n $chart_months[] = Carbon::create(2017, 7, 1)->addMonths($i);\n }\n return $chart_months;\n }", "abstract public function getNamesOfMonthsLong(): array;", "public function repaidPerMonthWithRange()\n {\n return DB::select('SELECT DATE_FORMAT(date_paid, \\'%b %y\\') as month, \n SUM(amount) as amount\n FROM billings \n WHERE ' . $this->whereBetweenParams() . ' AND status = \\'paid\\'\n GROUP BY DATE_FORMAT(date_paid, \\'%b %y\\') \n ORDER BY date_paid');\n }", "function month($int) {\n\t\t$month = array(\n \t\" \", \n \t\"January\", \n \t\"February\", \n \t\"March\", \n \t\"April\", \n \t\"May\", \n \t\"June\", \n \t\"July\", \n \t\"August\", \n \t\"September\", \n \t\"October\", \n \t\"November\", \n \t\"December\"\n );\n\n $result = $month[$int];\n return $result;\n\t}", "public static function getMonths()\n {\n $months = array(\n 1 => 'months.january',\n 2 => 'months.february',\n 3 => 'months.march',\n 4 => 'months.april',\n 5 => 'months.may',\n 6 => 'months.june',\n 7 => 'months.july',\n 8 => 'months.august',\n 9 => 'months.september',\n 10 => 'months.october',\n 11 => 'months.november',\n 12 => 'months.december',\n );\n\n return $months;\n }", "public function monthPadded() {\n\t\treturn $this->month(false);\n\t}", "public function months( ) {\n\t\t\t$months = array();\n\t\t\tforeach( range( 1, 12 ) as $month ) {\n\t\t\t\t$months[ $month ] = $month;\n\t\t\t}\n\t\t\treturn $months;\n\t\t}", "public function MonthList()\n\t\t\t{\n\t\t\t\treturn array('january', 'february', 'march', 'april', 'may', 'june', \n\t\t\t\t\t\t\t 'july', 'august', 'september', 'october', 'november', 'december'); \n\t\t\t}", "function formatDateMonth($dataSet, $i , $month){\n $yearAdd = explode('-',$dataSet[$i][\"date\"])[0];\n $oneMonthBefore = explode('-',$dataSet[$i][\"date\"])[1]-1;\n $monthAdd = formatDateMonthMoreNine($oneMonthBefore, $dataSet, $i, 1);\n if ($month == \"twoMonths\"){\n $twoMonthBefore= explode('-',$dataSet[$i][\"date\"])[1]-2;\n $twoMonthBefore = formatDateMonthMoreNine($twoMonthBefore, $dataSet, $i, 2);\n if ( $twoMonthBefore == 11)//si on est revenue en arrière on enlève une année\n $yearAdd --;\n\n $date = $yearAdd.\"-\".$twoMonthBefore.\"/\".$monthAdd;\n }\n if ($month==\"oneMonth\"){\n if (explode('-',$dataSet[$i][\"date\"])[1]-1== \"00\")\n $yearAdd--;\n $date = $yearAdd.\"-\".$monthAdd;\n }\n\n return $date;\n}", "public function get_month(){\n\t\t$this->db->where('cCode','month');\n\t\t$query = $this->db->get('system_parameters');\n\t\treturn $query->result();\n\t}", "public static function select_count_by_current_month()\n {\n return DB::table('tb_invoice')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n ->count();\n }", "private function getOrdersPerMonthForCA()\n {\n $this->runTest(\n 'Test 17. Get orders numbers for the month for the state CA',\n 'SELECT analytic.period, SUM(analytic_shop.orders_count) as orders\n FROM analytic_data analytic,\n analytic_shop analytic_shop,\n customer_entity customer,\n customer_address_entity address_entity,\n customer_address_entity_varchar address_entity_text\n WHERE address_entity_text.value = \"CA\"\n AND address_entity_text.attribute_id = 28\n AND address_entity_text.entity_id = address_entity.entity_id\n AND address_entity.parent_id = customer.entity_id\n AND analytic.customer_id = customer.entity_id\n AND analytic.period >= \"2012-01-21 00:00\"\n AND analytic.period <= \"2012-02-21 23:59\"\n AND analytic_shop.analytic_id = analytic.id\n GROUP BY analytic.period\n ORDER BY analytic.period'\n );\n }", "function getDueOnMonth() {\n if($this->getStatus() > 0) {\n return $this->getDueOn()->getMonth() . ', ' . $this->getDueOn()->getYear();\n }//if\n return 0;\n }", "function mje_get_mjob_order_chart() {\n\t\t$date_format = 'Y-m-d';\n\t\t$current_date = date($date_format, time());\n\t\t$last_week = date($date_format, strtotime('-1 week'));\n\t\t$dates = mje_get_range_of_date($last_week, $current_date, '+1 day', $date_format);\n\t\t$orders = array();\n\t\tforeach ($dates as $date) {\n\t\t\t$orders[] = mje_get_mjob_order_count_by_date($date);\n\t\t}\n\n\t\treturn $orders;\n\t}", "function getMonths() {\n $thisMonths = '';\n for($i = 1; $i <= 12; $i++) {\n $monthName = getMonthName($i, \"F\");\n $thisMonths = $thisMonths. \"<option value='$i'>$monthName</option>\";\n }\n return $thisMonths;\n }", "public function getMonthlyProcessInvoices()\n {\n $date=date(\"Y-m-01\");\n $process_query=\"SELECT *,MONTH(i.created_at + INTERVAL (i.pay_later_month) MONTH) as pay_month From \".$this->_name.\" i\n INNER JOIN Royalties r ON i.invoiceId=r.invoiceId\n WHERE date_format(i.created_at, '%Y-%m-%d')<'\".$date.\"' AND i.Status='Not Paid' \n GROUP BY i.invoiceId \n Having pay_month=date_format(now(), '%m')\n ORDER BY i.created_at DESC\"; \n \n \n //echo $process_query;exit;\n if(($result=$this->getQuery($process_query,true))!=NULL)\n {\n return $result;\n }\n else\n return NULL;\n\n }", "public function thisMonth()\n {\n return date(\"n\");\n }", "function primer_dia_mes() {\n\t $month = date('m');\n\t $year = date('Y');\n\t return date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n\t }", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n $output = array();\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n foreach ($months as $k => $v) {\n if (strlen($k) == 1 && $k != 0) {\n $value = '0' . $k;\n $output[$value] = $v;\n }\n elseif ($v != 'Month') {\n $output[$k] = $v;\n }\n }\n $this->setData('cc_months', $months);\n }\n\n return $output;\n }", "public function monthly($limit = 3)\n {\n return $this->getReputation(date('Y-m-1 00:00:00'), $limit);\n }", "static public function mes() {\r\n\t\treturn date ( \"m\" );\r\n\t}", "public function getExpMonth(): int\n {\n return $this->exp_month;\n }", "function getMonth() {\n return $this->month;\n }", "public function daysInMonth(): int;", "public function month() \r\n {\r\n return $this->month;\r\n }", "public static function select_count_by_current_month(){\n return DB::table('tb_purchase_picking')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n ->count();\n\t}", "function fill_month()\n\t{\n\t\t$this->addField(\"Enero\",\"01\");\n\t\t$this->addField(\"Febrero\",\"02\");\n\t\t$this->addField(\"Marzo\",\"03\");\n\t\t$this->addField(\"Abril\",\"04\");\n\t\t$this->addField(\"Mayo\",\"05\");\n\t\t$this->addField(\"Junio\",\"06\");\n\t\t$this->addField(\"Julio\",\"07\");\n\t\t$this->addField(\"Agosto\",\"08\");\n\t\t$this->addField(\"Septiembre\",\"09\");\n\t\t$this->addField(\"Octubre\",\"10\");\n\t\t$this->addField(\"Noviembre\",\"11\");\n\t\t$this->addField(\"Diciembre\",\"12\");\n\t}", "public function get_month_dash_wallet($condition = NULL) {\n //echo $query;exit;\n\t\t$query = $this->db->query(\"select sum(laabus_comm) as totwallet from transaction where `transaction_status` = '1' and MONTH(CURDATE()) = MONTH(order_date) AND YEAR(CURDATE()) = YEAR(order_date) \");\n return $query->result_array();\n }", "function month($date_start, $date_end)\r\n\t\t\t{\r\n\t\t\t\t//must add 1 to the month\r\n\t\t\t\t$y = $this->db->query(\"SELECT PERIOD_DIFF(EXTRACT(YEAR_MONTH FROM '$date_end'), EXTRACT(YEAR_MONTH FROM '$date_start')) AS month\");\r\n\t\t\t\treturn $y;\r\n\t\t\t}", "public function get_month()\n {\n return $this->month;\n }", "protected function createPostListForMonth() {\n\t\t$content = '';\n\n\t\t$this->periodStart = $this->getMonthStart($this->currentMonth, $this->currentYear);\n\t\t$this->periodEnd = $this->getMonthEnd($this->currentMonth, $this->currentYear);\n\n\t\t$postListForMonth = $this->getPostListForThePeriod();\n\t\t$entriesInTheMonth = count($postListForMonth);\n\n\t\tif ($entriesInTheMonth > 0) {\n\t\t\t$this->years[$this->currentYear]['entries'] += $entriesInTheMonth;\n\t\t\t$content .= $this->outerWrapPostListForMonth($postListForMonth);\n\t\t}\n\t\treturn $content;\n\t}", "public function transactions(\\DateTime $month);", "protected function getCardExpirationMonths()\n {\n return Collection::make(range(1, 12))\n ->mapWithKeys(function ($value) {\n return [Str::padLeft($value, 2, '0') => Str::padLeft($value, 2, '0')];\n })\n ->toArray();\n }", "protected function getMonths($report) {\n $months = array(\n 1 => 'January',\n 2 => 'February',\n 3 => 'March',\n 4 => 'April',\n 5 => 'May',\n 6 => 'June',\n 7 => 'July',\n 8 => 'August',\n 9 => 'September',\n 10 => 'October',\n 11 => 'November',\n 12 => 'December'\n );\n\n $labels = array();\n foreach ($months as $key => $month) {\n $labels[] = array(\n 'name' => $month,\n 'start' => '',\n 'end' => '',\n 'joins' => array(),\n 'conditions' => array(\n 'DimensionDate.month =' => \"$key\"\n )\n );\n }\n return $labels;\n }", "public function getMonth() : string\n {\n return date('m', $this->time);\n }", "public static function getMonth() {\n $date = self::toJalali();\n return $date['month'];\n }", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n return $months;\n }", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n return $months;\n }", "private function getOrdersByReturnedCustomersByMonth()\n {\n $this->runTest(\n 'Test 57. Get orders by returned customers by month',\n 'SELECT analytic_data.period, SUM(analytic_shop.orders_count) as orders_count\n FROM analytic_data analytic_data,\n analytic_customer analytic_customer,\n analytic_shop analytic_shop\n WHERE analytic_data.period >= \"2012-10-01 00:00\"\n AND analytic_data.period <= \"2012-11-01 00:00\"\n AND analytic_shop.analytic_id = analytic_data.id\n AND analytic_shop.orders_count > 0\n AND analytic_data.id = analytic_customer.analytic_id\n AND analytic_customer.is_returned = true\n ORDER BY analytic_data. period\n LIMIT 100'\n );\n }" ]
[ "0.65276307", "0.6413186", "0.63319105", "0.62738407", "0.6232877", "0.6160746", "0.6147851", "0.6100412", "0.6091113", "0.6085604", "0.59700227", "0.5930772", "0.59061664", "0.58904815", "0.5848235", "0.58429456", "0.58393335", "0.5804079", "0.5790904", "0.5747645", "0.57471293", "0.57424146", "0.57360804", "0.57271606", "0.5718188", "0.5716735", "0.57106495", "0.5703955", "0.5679934", "0.5678716", "0.5678716", "0.56776154", "0.5669205", "0.5664667", "0.5647925", "0.5647816", "0.5644805", "0.56378734", "0.56214947", "0.5596655", "0.5594527", "0.5591507", "0.55850923", "0.55839413", "0.5577017", "0.55654705", "0.55464137", "0.5545725", "0.5543107", "0.5527874", "0.55263287", "0.5513661", "0.5513045", "0.55035496", "0.5487963", "0.54835546", "0.5480997", "0.5479674", "0.5470196", "0.5461116", "0.5453313", "0.5434779", "0.54258114", "0.542268", "0.54095", "0.5408989", "0.5406277", "0.5401264", "0.5400496", "0.5400109", "0.5398256", "0.5393711", "0.5389796", "0.53885704", "0.5385217", "0.53796446", "0.5377303", "0.536821", "0.53668785", "0.53580415", "0.5346772", "0.5346628", "0.53460205", "0.5342968", "0.5332164", "0.53240067", "0.53238183", "0.53233427", "0.5317318", "0.53122777", "0.5309859", "0.53017193", "0.52918", "0.52875805", "0.52862567", "0.5283669", "0.5283514", "0.5283477", "0.5283477", "0.52744734" ]
0.8064528
0
Expiration timestamp in ms Generated from protobuf field int64 expiration_ms = 4;
Таймстемп истечения срока действия в миллисекундах, сгенерированный из поля protobuf int64 expiration_ms = 4;
public function getExpirationMs() { return $this->expiration_ms; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExpirationTime( );", "public function getExpirationTime()\n {\n return $this->getPayload(self::JWT_CLAIM_EXPIRATION_TIME);\n }", "public function getExpiration() {}", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration() {\n\t\treturn $this->expiration;\n\t}", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function tokenExpirationTime() {\n\n\t\treturn date('Y-m-d H:i:s', time() + $this->tokenExpirationTime);\n\t}", "public function expirationTimestamp();", "public function get_expiration_time()\n {\n return $this->expiration_time;\n }", "public function get_expiration() ;", "public function setExpirationMs($var)\n {\n GPBUtil::checkInt64($var);\n $this->expiration_ms = $var;\n\n return $this;\n }", "private function expireTime()\n {\n return time() + Config::get('jwt.expiry'); // in seconds\n }", "private static function getTokenExpirationTime()\n {\n return date('Y-m-d H:i:s', strtotime('now + 15 minutes'));\n }", "public function getExpirationTime( )\n {\n return $this->expirationTime;\n }", "final public function get_expiration() {\n\t\treturn $this->expiration;\n\t}", "public function getExpiration()\n {\n if (!$this->expiration) {\n /**\n * as \"timeout\" configuration parameter specifies timeout in minutes - we multiply it on 60 to set\n * expiration in seconds\n */\n $this->expiration = (int)$this->captchaData->getConfig('timeout') * 60;\n }\n return $this->expiration;\n }", "public function GetExpirationIdentity ();", "public function getExpiration() : \\DateTime\n {\n return $this->expiration;\n }", "public function getExpirationPeriod(): int;", "public function expiresAt($expiration) {}", "public function getExpiresTimestamp(): int\n {\n return $this->expires_timestamp;\n }", "public function expiresAt(): int\n {\n return $this->exp;\n }", "public function getExpirationSeconds()\n {\n return $this->ExpirationSeconds;\n }", "public function getTokenExpire()\n\t{\n\t\t//seconds, minutes, hours, days\n\t\t$offset = 60*60*24*30;\n\n\t\treturn time()+$offset;\n\t}", "public function GetExpirationAuthorization ();", "protected function getExpireTime() {\n $now = new \\DateTime();\n try {\n $expiration = $now->add(new \\DateInterval(variable_get('restful_token_auth_expiration_period', 'P1D')));\n }\n catch (\\Exception $e) {\n throw new ServerConfigurationException('Invalid DateInterval format provided.');\n }\n return $expiration->format('U');\n }", "public function getExpiryTime();", "public function getExpirationDate(){\n\t\treturn $this->expiration;\n\t}", "public function get_entry_expire_time();", "public function getExpiresIn(): int\r\n {\r\n return $this->json->{TokenResponseConstants::EXPIRES_IN} ?? 0;\r\n }", "private function getTokenExpiryDateTime()\n {\n $tokenTtl = $this->container->getParameter('lexik_jwt_authentication.token_ttl');\n $now = new \\DateTime();\n $now->add(new \\DateInterval('PT'.$tokenTtl.'S'));\n return $now->format('U');\n }", "public function expiresAt($expiration)\n {\n }", "public function getExpireTime()\n {\n return $this->readOneof(15);\n }", "public function getExpire(): int;", "public function getExpiresIn() : int\n {\n return $this->expiresIn;\n }", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "public function generateExpiredTime()\n {\n\t\tif ($this->accessTokenExpire)\n\t $this->expired_at = date('Y-m-d H:i:s', strtotime('+' . $this->accessTokenExpire . ' SECOND'));\n\n\t return $this->expired_at;\n }", "public function getExpire();", "public function getExpire();", "public function getTimeExpiry()\n {\n return $this->timeExpiry;\n }", "public function getTimeExpiry()\n {\n return $this->timeExpiry;\n }", "public function getExpirationTag() : string;", "public function getDefaultExpiration()\n {\n return $this->default_expiration;\n }", "public function getTimeExpire()\n\t{\n\t\tif( isset( $this->values['expire'] ) ) {\n\t\t\treturn (string) $this->values['expire'];\n\t\t}\n\t}", "protected function _getPassRecoExpirationSeconds()\n\t{\n\t\t// week-long validity as default\n\t\treturn 604800;\n\t}", "public function getExpireTime () {\n return $this->expireTime;\n }", "public function getExpiresIn()\n {\n return $this->expires_in;\n }", "public function getExpirationDate()\n {\n return $this->expiration_date;\n }", "public function get_default_expiration_value() : int\n {\n }", "public function getVerificationExpiration()\n {\n if (! isset($this->verificationExpiration)) {\n //if we don't have one, make one up (mainly for registration)\n //@todo make sure in the end this can't be leveraged in some clever way that the user can set their own\n $this->resetVerificationExpiration();\n }\n return $this->verificationExpiration;\n }", "public function testExpiration()\n {\n $value = microtime();\n $this->adapter->set('expiration_test', $value, time()-1);\n $this->assertFalse($this->adapter->get('expiration_test'));\n }", "public function getExpiryTime()\n {\n return $this->expiryTime;\n }", "public function getExpiryTime()\n {\n return $this->expiryTime;\n }", "public function getExpiresIn()\n {\n return $this->expiresIn;\n }", "public function getExpiresIn()\n {\n return $this->expiresIn;\n }", "public function getExpires(): int\n {\n return $this->expires;\n }", "public function getExpires(): int\n {\n return $this->expires;\n }", "public function getExpirationDate() {\n return $this->expirationDate;\n }", "public function getExpiresAtMs()\n {\n return $this->expires_at_ms;\n }", "public function getUploadExpiration()\n {\n return $this->uploadExpiration;\n }", "public function getExpirationDate()\n {\n return $this->expirationDate;\n }", "public function getExpirationDate()\n {\n return $this->expirationDate;\n }", "public function getTimeout()\n {\n return $this->getExpiration();\n }", "public function getExpireTime() {\n return $this->expireTime;\n }", "public function getExpirationPeriod() {\n return $this->expirationPeriod;\n }", "public function getExpire()\n {\n return $this->expire;\n }", "public function getTokenExpire()\n {\n return $this->tokenExpire;\n }", "public function getExpiry()\n {\n return $this->expiry;\n }", "public function getExpiry()\n {\n return $this->expiry;\n }", "public function getExpiry()\n {\n return $this->expiry;\n }", "public function getExpiresAt()\n {\n return $this->_getKeyValue('exp');\n }", "public function getExpiration() {\n return $this->configFactory->get('elasticsearch_helper_preview.settings')->get('expire');\n }", "public function getAuthenticationExpirationTime() {\n\n $authSession = new Container(self::SESSION_CONTAINER_NAME);\n return $authSession->offsetGet(self::SESSION_VARIABLE_NAME);\n }", "public function expires() {\n return $this->data->expiry_date;\n }", "public function getExpire()\n\t{\n\t\treturn $this->expire;\n\t}", "public function getTrelloExpiresIn()\n {\n return $this->trelloExpiresIn;\n }", "public function getExpirationStatusCode() {\n return 403;\n }", "public function getExpiresOn()\r\n {\r\n return $this->json->{TokenResponseConstants::EXPIRES_ON} ?? null;\r\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiresIn()\n {\n return $this->get('ExpiresIn');\n }", "public function getExpiration(): string\n {\n $payload = json_decode($this->getPayload());\n if (isset($payload->exp)) {\n return $payload->exp;\n }\n\n Helpers::throwError(401, 'Objeto inválido, nenhum conjunto de parâmetros de expiração');\n }", "public function getTokenExpires()\n {\n return $this->getParameter('tokenExpires');\n }" ]
[ "0.7646721", "0.75422126", "0.7531993", "0.7462839", "0.7462839", "0.7406322", "0.7389408", "0.7389408", "0.7389408", "0.7379543", "0.7358251", "0.73184925", "0.730436", "0.7304336", "0.72075087", "0.7185224", "0.71828204", "0.71740943", "0.706497", "0.7060876", "0.69980836", "0.69218683", "0.69186807", "0.68704116", "0.68502367", "0.6821607", "0.68211114", "0.68135023", "0.68132216", "0.678681", "0.67238677", "0.67186207", "0.6716207", "0.6694149", "0.6689936", "0.6654168", "0.66397154", "0.6604678", "0.6593472", "0.6593472", "0.6593472", "0.6593472", "0.657309", "0.65721405", "0.65721405", "0.6568205", "0.6568205", "0.65678185", "0.6531493", "0.6513917", "0.651296", "0.6508264", "0.6506461", "0.6490457", "0.64850366", "0.64812946", "0.6477231", "0.6476472", "0.6476472", "0.64752233", "0.64752233", "0.6473562", "0.6473562", "0.6472508", "0.64659655", "0.6456892", "0.6454018", "0.6454018", "0.6451183", "0.6439728", "0.6433093", "0.64320326", "0.64198583", "0.6412921", "0.6412921", "0.6412921", "0.6408903", "0.63921696", "0.6375911", "0.63723934", "0.6368271", "0.63663065", "0.63458335", "0.63447547", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63444", "0.63397807", "0.63386244" ]
0.8125743
0
Set to return data as collection.
Установить для возврата данных как коллекцию.
public function returnAsCollection() { $this->returnAsCollection = true; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareCollection()\n {\n $collection = $this->getDataColllection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getDataEntityCollection(): Collection;", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function collection(): static\n {\n $this->type = Metadata::TYPE_COLLECTION;\n\n return $this;\n }", "public function requestingCollection();", "public function toCollection() {\n return new Collection($this->toArray());\n }", "public function toCollection() : Collection\n {\n return new Collection($this->all());\n }", "public function collection();", "public function getCollection(){\n\t\treturn $this->_collection;\n\t}", "public function get_collection(){\n\t\treturn $this->collection;\n\t}", "public function get_collection(){\n\t\treturn $this->collection;\n\t}", "public function get_collection(){\n\t\treturn $this->collection;\n\t}", "public function getData()\n {\n $this->sortCollection();\n return $this->collection;\n }", "public function toCollection();", "public function toCollection();", "public function setData(Collection $data)\n {\n $this->data = $data;\n\n return $this;\n }", "public function setData(Collection $data)\n {\n $this->data = $data;\n\n return $this;\n }", "public function getCollection()\n {\n return $this->_collection;\n }", "public function getCollection()\n {\n return $this->_collection;\n }", "public function getCollection()\n {\n return $this->collection;\n }", "public function getCollection()\n {\n return $this->collection;\n }", "public function getCollection()\n {\n return $this->collection;\n }", "public function getCollection()\n {\n return $this->collection;\n }", "public function collection($data = null)\n {\n // If an array was passed, set collection to passed array\n if (is_array($data)) {\n $this->_collection = $data;\n\n return $this;\n }\n\n return (is_array($this->_collection)) ? $this->_collection : array();\n }", "public function __construct()\n {\n $this->data = new Collection();\n }", "public function getCollection()\n\t{\n\t\treturn new Collection($this->items);\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "public function getData()\n {\n if( is_null($this->data) ) return new Collection();\n\n if( is_array($this->data) ) return new Collection($this->data);\n\n return $this->data;\n }", "protected function _prepareCollection() {\n $data = Mage::getModel('membership/membership')->load($this->getEntityId());\n return $data;\n }", "public function getCollection() {\n\t\treturn $this->collection;\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('ml_testimonials/testimonials')->getCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function setCollection()\n {\n //TODO: Get the mapped table name.\n\n $dbTable = DbModelDefinition::getTableName($this->baseClass, $this->collectionClass);\n $sql = \"\n Select \" . (string)$this->collectionClass . \"Id\n From \" . (string)$dbTable . \"\n Where \" . (string)$this->baseClass . \"Id = \" . (int)$this->baseClassId;\n $results = $this->db->query($sql);\n $data = $results->get(1);\n if($data->hasRows())\n {\n foreach($data->getAll() as $result)\n {\n $itemId = $result[$this->collectionClass . 'Id'];\n //$obj = new $this->collectionClass($itemId);\n $obj = ModelFactory::get($this->collectionClass, $itemId);\n $this->items[$itemId] = $obj;\n }\n $t=0;\n }\n }", "public function getCollection()\n\t{\n\t\treturn $this->collection;\n\t}", "protected function data(): Collection\n {\n return $this->collection->transform(function ($supplier) {\n return [\n 'id' => $supplier->id,\n 'name' => $supplier->name,\n 'city_name' => $supplier->city_name,\n 'zip' => $supplier->zip,\n 'address' => $supplier->address,\n 'logo' => $supplier->logo,\n 'admin_email' => $supplier->admin_email,\n 'phone' => $supplier->phone\n ];\n });\n }", "public function getCollectionData() {\n return [\n 'id' => $this->id,\n 'trade_name' => $this->trade_name,\n 'country_id' => $this->country_id,\n 'location_id' => !is_null($this->location_id)?$this->location_id:[],\n 'address' => $this->address,\n 'phone' => $this->phone,\n 'email' => $this->email,\n 'main' => (bool)$this->main,\n\n 'department_id' => $this->department_id,\n 'province_id' => $this->province_id,\n 'district_id' => $this->district_id,\n\n ];\n }", "public function toArray() {\r\n\t return $this->_collection;\r\n\t}", "public function getCollection() {\n\t\treturn $this->onCreateCollection();\n\t}", "public function exampleCollectionObject()\n {\n $data = $this->_exampleCollection();\n return [[\n new Collection([\n 'data' => $data\n ]),\n $data\n ]];\n }", "public function collection()\n {\n $this->type .= '[]';\n\n return $this;\n }", "public function collection(): array\n {\n return $this->collection;\n }", "abstract public function get(): Collection;", "protected function transform(Collection $data) {}", "public function setCollection($collection){\n\t\t$this->_collection = $collection;\n\t\treturn $this;\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setFirstStoreFlag(true);\n //$collection = Mage::getModel('datta_storelocator/store')->getCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function toCollection()\n {\n return new Collection(Arr::dot($this->all()));\n }", "public function toArray()\n {\n return $this->collection; \n }", "public function clear(): Collection\n {\n $this->data = [];\n return $this;\n }", "public function setCollection(array $content)\n {\n $this->_collection = $content;\n return $this;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('catalog/product_collection')\n ->setStoreId(0)\n ->addAttributeToSelect('name', 'type_id', 'attribute_set_id');\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()\n ->addFieldToFilter(\n 'customer_id',\n $this->_getCustomer()->getId()\n );\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public static function &getCollection();", "function collection()\n {\n return self::getCollection(get_class($this));\n }", "public function getCollection()\n {\n //@todo create logic for getting all records from database via Repository (method getList)\n return $this->collectionFactory->create();\n }", "protected function _retrieveCollection()\n {\n $data = $this->_getCollectionForRetrieve()->load()->toArray();\n\n return isset($data['items']) ? $data['items'] : $data;\n }", "public function collection()\n {\n $result = ($this->results['page'] == 'leads') ? $this->getLeadData() : $this->getCcpaData();\n return collect($result);\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('emvcore/account')->getCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getCollectionData()\n {\n if (!isset($this->collectionData)) {\n throw new \\LogicException(\"Data collection has not been set yet - call setDataCollection\");\n }\n\n return $this->collectionData;\n }", "protected function _prepareCollection()\n {\n /** @var Collection $collection */\n $collection = $this->reportCollectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function getCollection()\n {\n try {\n $this->collection = json_decode(file_get_contents($this->sourceFullPath), true)[$this->dataKey];\n } catch (\\Exception $e) {\n \\Yii::error($e);\n }\n\n return $this->collection;\n }", "function collect()\n {\n return self::$data;\n }", "public function getItems(): Collection;", "public function fetch() : Collection {\n if(is_null(static::$query)) {\n return new Collection(static::$client->getItems());\n } else {\n $collection = new Collection(static::$client->getItems(static::$query));\n static::$query = new QueryParams();\n return $collection;\n }\n }", "public function getCollection()\n {\n return $this->items;\n }", "protected function _prepareCollection()\r\n {\r\n $entityId = $this->getRequest()->getParam('id');\r\n $this->sellerId = $this->helper->getCustomerId($entityId);\r\n $collection = $this->collectionFactory->getReport('rakutenconnect_order_map_list_data_source')\r\n ->addFieldToSelect('entity_id')\r\n ->addFieldToSelect('created_at')\r\n ->addFieldToSelect('mage_order_id')\r\n ->addFieldToSelect('rakuten_order_id')\r\n ->addFieldToSelect('purchase_date')\r\n ->addFieldToSelect('status')\r\n ->addFieldToFilter('seller_id', $this->sellerId);\r\n\r\n $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }", "public function testCollectionMethods()\n {\n $data = [1,2,3,4];\n\n $results = $this->newSerializer()->setCollection(collect($data), false)->collection()->all();\n\n $this->assertEquals($data, $results);\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('zitec_branding/branding')->getCollection();\n $collection->addStoresToResult();\n $this->setCollection($collection);\n\n return parent::_prepareCollection($collection);\n }", "protected function _prepareCollection() {\n $gid = Mage::helper ( 'marketplace' )->getGroupId ();\n $collection = Mage::getResourceModel ( 'customer/customer_collection' )->addNameToSelect ()->addAttributeToSelect ( 'email' )->addAttributeToSelect ( 'created_at' )->addAttributeToSelect ( 'group_id' )->addFieldToFilter ( 'group_id', $gid );\n $this->setCollection ( $collection );\n return parent::_prepareCollection ();\n }", "protected function data(): Collection\n {\n return $this->collection->transform(function (Document $document) {\n $uploader = $document->uploader()->withTrashed()->first(['first_name', 'last_name']);\n $uploaderName = $uploader->first_name . ' ' . $uploader->last_name;\n return [\n 'id' => $document->id,\n 'filename' => $document->filename,\n 'size' => FileSizeHelper::getHumanFileSize($document->size),\n 'visible' => $document->visible,\n 'date' => DateHelper::date($document->created_at),\n 'uploader' => $uploaderName,\n 'document_id' => $document->document_id,\n 'document_type' => $document->document_type,\n 'number' => !empty($document->document_id) ? $document->document()->pluck('number')->first() : null\n ];\n });\n }", "public function all()\n {\n return $this->collection;\n }", "protected function _prepareCollection()\n {\n $this->setCollection($this->_galleryCollection);\n return parent::_prepareCollection();\n }", "public function setData($data)\n {\n if (is_array($data)) {\n $data = new IndexedCollection($data);\n }\n\n $this->data = $data;\n return $this;\n }", "protected function _getCollection()\n {\n return $this->_package->getCollection();\n }", "public function getAll()\n {\n return $this->collection;\n }", "public function &toArray() {\n $collectionClass = static::$COLLECTION_CLASS;\n $collectionDomainProperty = $collectionClass::$DOMAIN_PROPERTY;\n \n $data = parent::toArray();\n \n if($this->collection instanceof Enumerable) {\n $data[$collectionDomainProperty] = $this->collection->toArray();\n }\n \n return $data;\n }", "protected function data(): Collection\n {\n return $this->collection->transform(function ($faq) {\n /** @var $faq FAQ */\n\n $portal = Portal::find($faq->portal_id);\n\n return [\n 'id' => $faq->id,\n 'question' => $faq->question,\n 'answer' => $faq->answer,\n 'author' => $faq->author,\n 'visible' => $faq->visible,\n 'portal' => $portal ? $portal->name : 'Alle',\n 'category_id' => $faq->category_id,\n ];\n });\n }", "public function setCollection()\n\t\t{\n\t\t\t$this->collection = new SectionCollection( $this->postId );\n\t\t}", "public function collection()\n {\n $limit = \\Input::get('limit') ?: 10;\n $model = $this->model;\n \n if (\\Request::has('order')) {\n list($orderCol, $orderBy) = explode('|', \\Input::get('order'));\n $model = $model->orderBy($orderCol, $orderBy);\n }\n\n return $this->response->withPaginator($model->paginate($limit), new $this->transformerName, $this->collectionName);\n }", "public function asCollection()\n {\n if (! $this->resource instanceof Collection) {\n throw new \\RuntimeException('The resource needs to be an instance of ' . Collection::class);\n }\n $this->shouldCollect = true;\n return $this;\n }", "public function getDatatableCollection();", "public function _getCollection()\n {\n return Mage::getResourceModel('api/user_collection');\n }", "protected function _prepareCollection()\n {\n // Get and set our collection for the grid\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function collection()\n {\n if ($this->getCurrentAction()->isAffordanceAvailable($this) === false) {\n $this->abort(HttpResponse::HTTP_FORBIDDEN);\n }\n\n $items = [];\n\n // build data\n $builder = $this->createQueryBuilder(true);\n\n foreach ($builder->get() as $item) {\n $items[] = $this->export($item);\n }\n\n // build total\n $builder = $this->createQueryBuilder(true, false);\n $model = $builder->getModel();\n $total = $builder->distinct()->count($model->getTable().'.'.$model->getKeyName());\n\n // create the response\n $factory = $this->getFactory();\n $resourceDefinition = $this->getCurrentContext()->getResourceDefinition();\n $response = $factory->createCollectionResponse(\n $resourceDefinition,\n $this,\n $this->getCurrentContext(),\n $this->getCurrentAction()->getEndpointUrl(),\n $items,\n $total);\n\n return $this->done($response);\n }", "public function toCollection(): ICollection;", "public static function collection()\n {\n $instance = static::newInstance();\n return $instance->getCollection();\n }", "public function getCollection()\n {\n return $this->getDatabase()->{$this->collection};\n }", "public function getCollection(): GeneratedCollection\n {\n return $this->collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceSingleton('eadesign/pdfgenerator_collection');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function collect()\n {\n return self::$data;\n }", "protected function _prepareCollection()\r\n {\r\n $collection = Mage::getResourceModel('catalog/category_attribute_collection')\r\n ->addFieldToFilter('is_user_defined',1)\r\n ;\r\n $this->setCollection($collection);\r\n\r\n return parent::_prepareCollection();\r\n }", "public function getCollection(): JsonApiCollection|JsonApiResponse;", "public function asCollection()\n {\n $class = static::COLLECTION_CLASS;\n return new $class();\n }", "public function getCollection(){\n\t\treturn $this->colectionNow;\n\t}", "public function sets ()\n\t{\n\t\treturn $this->data;\n\t}", "public function setCollectionData(array $collectionData)\n {\n $this->collectionData = $collectionData;\n return $this;\n }", "public function getAll(): Collection;" ]
[ "0.74979657", "0.72662187", "0.72557765", "0.72557765", "0.72557765", "0.72557765", "0.72557765", "0.72557765", "0.7065579", "0.70579803", "0.70546085", "0.7008179", "0.6940562", "0.68922025", "0.6844084", "0.6844084", "0.6844084", "0.6829138", "0.6821332", "0.6821332", "0.6820805", "0.6820805", "0.68165666", "0.68165666", "0.6815879", "0.6815879", "0.6815879", "0.6815879", "0.6812838", "0.6810854", "0.67947614", "0.6764575", "0.67387116", "0.67337763", "0.6698565", "0.667117", "0.66700083", "0.6667925", "0.66606164", "0.6640504", "0.6634817", "0.6625005", "0.6623428", "0.66080695", "0.66035414", "0.6602512", "0.6596297", "0.65827656", "0.65803564", "0.657891", "0.65682614", "0.65340406", "0.6525243", "0.6514017", "0.64976126", "0.6492884", "0.6492209", "0.6489261", "0.64856017", "0.64795667", "0.6472951", "0.6444801", "0.64403576", "0.6408435", "0.63992393", "0.63992316", "0.6383891", "0.6382355", "0.63671505", "0.6362047", "0.63557696", "0.6350492", "0.63442326", "0.63386923", "0.63335", "0.633315", "0.6329764", "0.63285995", "0.6328166", "0.63258785", "0.6323515", "0.63218594", "0.631967", "0.6303942", "0.6296922", "0.6295483", "0.62923104", "0.6288897", "0.62860125", "0.6267923", "0.62642646", "0.62625915", "0.62546736", "0.6252193", "0.62373483", "0.62363034", "0.62264764", "0.622583", "0.6220732", "0.6218803" ]
0.74862784
1
Disable search query logging to DB.
Отключить логирование поисковых запросов в БД.
public function disableSearchQueryLogging() { $this->searchQueryLogging = false; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disableQueryLog() {\n\t\t$this->loggingQueries = false;\n\t}", "public function stopLogging(): void\n {\n DB::disableQueryLog();\n }", "public static function disableQueryLog()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\PostgresConnection $instance */\n $instance->disableQueryLog();\n }", "public function disableQueryLog()\n {\n $this->loggingQueries = false;\n\n return $this;\n }", "public function disableWriting() {\n\t\t$this->writingQueries = false;\n\t}", "public function enableQueryLog() {\n\t\t$this->loggingQueries = true;\n\t}", "static public function enableQueryLogging() {\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = TRUE;\n\t}", "public function clearQueryLog()\n {\n $this->queryLog = array();\n }", "public function disableQueryLog()\n {\n foreach ($this->api as $language => $api) {\n $api->disableQueryLog();\n }\n\n return $this;\n }", "public function startLogging(): void\n {\n DB::enableQueryLog();\n }", "function wpu_disable_search_in_query( $query, $error = true ) {\n if ( !is_search() ) {\n return;\n }\n $query->is_search = false;\n $query->query_vars['s'] = false;\n $query->query['s'] = false;\n // to error\n if ( $error ){\n $query->is_404 = true;\n }\n}", "public static function clearLog()\n\t{\n\t\tself::$_queryLog = array();\n\t}", "public static function enableQueryLog()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\PostgresConnection $instance */\n $instance->enableQueryLog();\n }", "protected function disableRespectOfEnableFields(): void\n {\n if (!self::$defaultQuerySettingsInstance) {\n // @var $querySettings Typo3QuerySettings\n self::$defaultQuerySettingsInstance = GeneralUtility::makeInstance(Typo3QuerySettings::class);\n self::$defaultQuerySettingsInstance->setIgnoreEnableFields(true)->setIncludeDeleted(true);\n }\n $this->setDefaultQuerySettings(self::$defaultQuerySettingsInstance);\n }", "private function logQuery() {\n if (!$this->are_queries_logged) return;\n\n if (sizeof($this->logged_queries) > $this->max_logged_queries) {\n $this->are_queries_logged = false;\n $this->logged_queries[] = 'Number of maximum logged queries exceeded; turning off logging.';\n $this->logged_queries[] = 'Call tx_newspaper::setMaxLoggedQueries() to increase the number of logged queries.';\n } else {\n $this->logged_queries[] = $this->query;\n }\n }", "function noLog ( ) {\n $this->noLog = 1 ;\n }", "private function deactivateSearch()\n\t{\n\t\tadd_action( 'parse_query', 'WAQ2016Site::filterSearchQuery' );\n\t\tadd_filter( 'get_search_form', create_function( '$a', \"return null;\" ) );\n\t}", "public function resetSearch() : void\n\t{\n\t\t$this->eligebleForPermission = collect();\n\t\t$this->query = '';\n\t\t$this->isSearching = false;\n\t}", "public function NonQuery()\n {\n $this->BuildQuery();\n if(!empty($this->_query)) $this->QueryDb();\n }", "public function flushQueryLog() {\n\t\t$this->queryLog = array();\n\t}", "public function clearSearch()\n {\n data_set($this->filters, 'search', '');\n }", "public function logQueries($enable = null);", "public static function disableSearchSyncing(): void\n {\n SearchableBehavior::disableSyncingFor(static::class);\n }", "function ResetSearchParms() {\r\n\r\n\t// Clear search where\r\n\tglobal $logs;\r\n\t$sSrchWhere = \"\";\r\n\t$logs->setSearchWhere($sSrchWhere);\r\n\r\n\t// Clear basic search parameters\r\n\tResetBasicSearchParms();\r\n\r\n\t// Clear advanced search parameters\r\n\tResetAdvancedSearchParms();\r\n}", "public function disableGlobalSearch(): self\n {\n $this->globalSearch = false;\n\n return $this;\n }", "public function skipLogging(): bool;", "public function filterQuery(): void;", "public function disableSearch()\n\t{\n\t\t$this->showSearch = FALSE;\n\n\t\treturn $this;\n\t}", "public static function disableScreenLog()\n {\n self::$print_to_screen = false;\n }", "public static function stopLogging()\n\t{\n\t\tself::debug( FALSE );\n\t}", "public function noLogd()\n {\n $this->option('no-logd');\n\n return $this;\n }", "protected function resetQuery()\n {\n parent::resetQuery();\n $this->showDisabled = false;\n }", "public function suppress_filters( $query ) {\n\t\t$query->set( 'suppress_filters', true );\n\t}", "public function stopQuery(): void\n {\n if (empty($this->recentQuery)) {\n return;\n }\n\n $message = $this->recentQuery['sql'];\n unset($this->recentQuery['sql']);\n $this->recentQuery['finish_time'] = microtime(true);\n $this->logger->info($message, $this->recentQuery);\n $this->recentQuery = [];\n }", "public static function flushQueryLog()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\PostgresConnection $instance */\n $instance->flushQueryLog();\n }", "public static function removeSearchFilter() {\n\t\tremove_filter( 'posts_where', array( __CLASS__, 'searchTermsWhere' ), 10 );\n\t}", "public function findNoSearch ()\n {\n $sql = \"SELECT * FROM `pages` WHERE `no_search` = 1 AND `deleted` = 0 \";\n $query = $this->createQuery();\n $query->statement($sql);\n return $query->execute();\n }", "public function defaultQueryLogger()\n {\n return new Logger('Query', [\n new StreamHandler(\n $this->app->storagePath() . '/logs/db-query.log'\n , Logger::DEBUG\n )\n ]);\n }", "public function ignoreTransaction()\n {\n \\newrelic_ignore_transaction();\n }", "public function stopQuery()\n {\n\n (new DebuggerFactory())->createLogger(new BenchmarkLogger())->addLog('Query finished');\n }", "function filter_search_query( $query, $error = true ) {\n\t$gcse_id = site_uses_google_search();\n\tif ( is_search() && $gcse_id && !is_admin()) {\n\t\t$query->query_vars['s'] = false;\n\t\t$query->query['s'] = false;\n\t}\n}", "public function enableQueryLog()\n {\n $this->loggingQueries = true;\n\n if(!$this->logger)\n {\n $this->logger = new QueryLogger();\n }\n\n return $this;\n }", "protected function disableProfiling(): void\n {\n if (!is_null($this->logger)) {\n $this->logger->hide();\n }\n }", "public function enableWriting() {\n\t\t$this->writingQueries = true;\n\t}", "function drop_log_search_words()\n{\n\t$db_table = db_table();\n\n\t$db_table->drop_table('{db_prefix}log_search_words');\n}", "protected function doLogging() {\r\n\t\ttrace(str_replace(chr(9), '', $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery));\r\n if (TYPO3_DLOG) t3lib_div::devLog('Query from pt_objectstorage', 'pt_objectstorage', 0, array('query' => $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery));\r\n\t}", "public function stopQuery()\n {\n if ($this->lastQuery &&\n ($time = (microtime(true) - $this->lastQuery['start'])) > $this->slowSeconds) {\n file_put_contents(\n $this->logFile,\n sprintf(\n \"[%s] Query took %.2fs seconds:\\n%s\\n%s\\n\\n\",\n date('r'),\n $time,\n $this->lastQuery['sql'],\n var_export($this->lastQuery['params'], true)\n ),\n \\FILE_APPEND\n );\n }\n }", "function ResetBasicSearchParms() {\r\n\r\n\t// Clear basic search parameters\r\n\tglobal $logs;\r\n\t$logs->setBasicSearchKeyword(\"\");\r\n\t$logs->setBasicSearchType(\"\");\r\n}", "public function enableLogging() {}", "public function onSearchNotFound()\n {\n return $this->onResultsNotFound();\n }", "function RestoreSearchParms() {\r\n\tglobal $sSrchWhere, $logs;\r\n\t$sSrchWhere = $logs->getSearchWhere();\r\n\r\n\t// Restore advanced search settings\r\n\tRestoreAdvancedSearchParms();\r\n}", "function logQueries()\n{\n if (App::environment('production') || !config('system.query_log')) {\n return;\n }\n\n \\DB::listen(function($query) {\n \\Log::info(\n $query->sql,\n $query->bindings,\n $query->time\n );\n });\n}", "public function disableDeleteClause() {}", "public function shouldAddToSearchIndex() {\n return false;\n }", "public function disableFilling() {\n\t\t$this->fillQueries = false;\n\t}", "function ResetSearchParms() {\n\t\tglobal $t_tinbai_mainsite_level;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$t_tinbai_mainsite_level->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}", "public function global_search() {\n return false;\n }", "public function disable_debug() {\n $this->debug = false;\n }", "public function stopSQL(){\n\t\t$this->enableSQL=0;\n\t}", "public function modelLogDisable()\n {\n $this->_disabled = true;\n return $this->_model;\n }", "public static function disable_filter()\n\t{\n\t\t$class = get_called_class();\n\t\tstatic::$_disable_filter[$class] = false;\n\t}", "protected function prepareQueryForLogging(string &$query): void\n {\n }", "public function startLoggingQueries() {\n tx_newspaper_ExecutionTimer::start();\n $this->are_queries_logged = true;\n }", "public function disableDebug()\n\t{\n\t\tDebug::getInstance()->disableDebug();\n\t}", "public function ignoreTransaction(): void;", "public static function clearSearchPersistance()\n {\n $_SESSION['search_q'] = '';\n $_GET['search_q'] = '';\n //$_SESSION['search_first_university_id'] = 0;\n $_GET['FilterForm'] = array();\n $_SESSION['FilterForm'] = array();\n }", "protected function logQuery($message = '')\n {\n if($this->getConfig()->getLogging()['active']) {\n Log::info($this->getConfig()->getDomain().': '.$message);\n }\n }", "function ResetAdvancedSearchParms() {\r\n\r\n\t// Clear advanced search parameters\r\n\tglobal $logs;\r\n\t$logs->setAdvancedSearch(\"x_id\", \"\");\r\n\t$logs->setAdvancedSearch(\"x_time\", \"\");\r\n\t$logs->setAdvancedSearch(\"x_client\", \"\");\r\n\t$logs->setAdvancedSearch(\"x_group\", \"\");\r\n\t$logs->setAdvancedSearch(\"x_type\", \"\");\r\n\t$logs->setAdvancedSearch(\"x_message\", \"\");\r\n}", "function ResetSearchParms() {\n\t\tglobal $view_sponsored_student_school;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$view_sponsored_student_school->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}", "public function clearQuerySetting()\n\t{\n\t\t$this->clearWhere();\n\t\t$this->clearLimit();\n\t\t$this->clearSort();\n\t}", "public function optimize()\n {\n // your search index will be smaller and faster if you do it occasionally (nightly is nice)\n $this->initSql();\n $this->sql->query('DELETE asw FROM a_search_word AS asw LEFT JOIN a_search_usage asu ON asu.word_id = asw.id WHERE asu.id IS NULL');\n }", "public function unsetSearch()\r\r\r\n {\r\r\r\n if(Ccc::getModel('admin/session')->has('search'))\r\r\r\n {\r\r\r\n $search = Ccc::getModel('admin/session')->get('search');\r\r\r\n if($search[$this->getModule()][$this->getController()][$this->getAction()])\r\r\r\n {\r\r\r\n unset($search[$this->getModule()][$this->getController()][$this->getAction()]);\r\r\r\n }\r\r\r\n Ccc::getModel('admin/session')->set('search', $search);\r\r\r\n }\r\r\r\n }", "public function customSearch()\n {\n // no action\n }", "function ResetSearchParms() {\n\n\t// Clear search where\n\tglobal $admin;\n\t$sSrchWhere = \"\";\n\t$admin->setSearchWhere($sSrchWhere);\n\n\t// Clear basic search parameters\n\tResetBasicSearchParms();\n}", "public function setQueryLog($flag)\n {\n $this->query_log = (bool) $flag;\n }", "public function quiet()\n {\n if (!empty($this->loggers)) {\n foreach ($this->loggers as $logger) {\n if (is_object($logger) && method_exists($logger, 'quiet')) {\n try {\n $logger->quiet();\n } catch (\\Exception $e) {\n // just ignore, as we can't do anything, not even log it.\n }\n }\n }\n }\n }", "public function boot(): void\n {\n if (!$this->app['config']->get('logging.query.enabled', false)) {\n return;\n }\n\n $trigger = $this->app['config']->get('logging.query.trigger');\n\n if (!empty($trigger) && !$this->requestHasTrigger($trigger)) {\n return;\n }\n\n $this->app['events']->listen(QueryExecuted::class, function (QueryExecuted $query) {\n if ($query->time < $this->app['config']->get('logging.query.slower_than', 0)) {\n return;\n }\n\n $sqlWithPlaceholders = str_replace(['%', '?', '%s%s'], ['%%', '%s', '?'], $query->sql);\n\n $bindings = $query->connection->prepareBindings($query->bindings);\n $pdo = $query->connection->getPdo();\n $realSql = $sqlWithPlaceholders;\n $duration = $this->formatDuration($query->time / 1000);\n\n if (count($bindings) > 0) {\n $realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings));\n }\n\n // 忽略的日志\n if (Str::contains($realSql, config('logging.query.ignore_sql'))){\n return;\n }\n\n $requestUri = request()->getRequestUri();\n\n if (Str::contains($realSql, config('logging.query.admin_str'))) {\n $channel = config('logging.query.admin_channel', config('logging.default'));\n } else {\n $channel = config('logging.query.channel', config('logging.default'));\n }\n\n Log::channel($channel)->debug(sprintf('[%s] [%s] %s | %s: %s', $query->connection->getDatabaseName(), $duration, $realSql, request()->method(), $requestUri));\n });\n }", "function admin_clear() {\n\t\t$this->__clearsearch();\n\t}", "public function disableDebug(): void\n {\n $this->params[self::PARAMETER_DEBUG] = 'false';\n }", "public function logging() {\n\t\treturn $this->loggingQueries;\n\t}", "function ResetSearchParms() {\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$this->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n }", "protected function search_trail()\n {\n }", "protected function get_main_search_query_sql()\n {\n }", "public function searchLog()\n {\n return $this->searchLog;\n }", "function ResetSearchParms() {\n\t\tglobal $student_applicant;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$student_applicant->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}", "function testFalseOnNoSearch() {\r\n\t\t$this->assertFalse($this->instance->FetchRow(99));\r\n\t\t$this->assertFalse($this->instance->getTotalRecordsFound());\r\n\t\t$this->assertFalse($this->instance->getNumRows());\r\n\t\t$this->assertFalse($this->instance->IsMaxrowsReached());\r\n\t\t$this->assertFalse($this->instance->SearchGetFields(null));\r\n\t\t$this->assertFalse($this->instance->SearchGetFields(1));\r\n\t}", "function admin_clear () {\n\t\t$this->__clearsearch();\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n }", "public function clearQueryHistory(): void;", "function ResetSearchParms() {\r\n\t\tglobal $keu_laporan_keuangan;\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$keu_laporan_keuangan->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}", "public function noInjectionLaravelQueryBuilder()\n {\n // Debug for SQL Statements\n DB::enableQueryLog();\n\n $loginUser = request('user');\n $loginPassword = request('password');\n if (!isset($loginUser) || !isset($loginPassword)) {\n abort(301, \"user or password not set.\");\n }\n\n $results = DB::table(\"np_user\")\n ->select(\"id\")\n ->where('id', '=', ':loginUser')\n ->where('password', '=', 'loginPassword')\n ->setBindings(['loginUser' => $loginUser, 'loginPassword' => $loginPassword])\n ->get();\n\n // Debug with Log Facade -> storage/logs/laravel.log\n Log::debug(DB::getQueryLog());\n\n $message = \"Login Failed!!\";\n if (count($results) > 0) {\n $message = \"Login Success!!\";\n }\n return view('sql/injection_result', ['message' => $message, 'query' => json_encode(DB::getQueryLog())]);\n }", "function _rj_make_blank_search ($query){\n\tglobal $wp_query;\n\tif (isset($_GET['s']) && $_GET['s']==''){ //if search parameter is blank, do not return false\n\t\t$wp_query->set('s',' ');\n\t\t$wp_query->is_search=true;\n\t}\n\treturn $query;\n}", "function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}", "function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}", "public function newQueryWithoutScopes()\n {\n }", "function ResetSearchParms() {\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$this->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}", "function ResetSearchParms() {\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$this->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}", "function ResetSearchParms() {\r\n\t\tglobal $tbl_profile;\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->sSrchWhere = \"\";\r\n\t\t$tbl_profile->setSearchWhere($this->sSrchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\r\n\t\t// Clear advanced search parameters\r\n\t\t$this->ResetAdvancedSearchParms();\r\n\t}", "public function enableQueryLog()\n {\n foreach ($this->api as $language => $api) {\n $api->enableQueryLog();\n }\n\n return $this;\n }" ]
[ "0.82651955", "0.7706327", "0.7505154", "0.7296534", "0.7057104", "0.68354034", "0.6812662", "0.64890575", "0.6344968", "0.63110954", "0.63012916", "0.62530077", "0.6195051", "0.6135895", "0.6016289", "0.5970402", "0.5937422", "0.590201", "0.5893885", "0.5824748", "0.5818124", "0.5805798", "0.5717214", "0.5711792", "0.56888765", "0.56841666", "0.5683059", "0.5673868", "0.56686103", "0.5640386", "0.56215036", "0.5616396", "0.5610051", "0.56035423", "0.5601536", "0.5549487", "0.55298626", "0.55227256", "0.55065584", "0.5468706", "0.54675156", "0.5451158", "0.54489297", "0.54440784", "0.5443632", "0.54409146", "0.54389185", "0.5384283", "0.5372201", "0.53613436", "0.5358626", "0.5353315", "0.5349341", "0.53454137", "0.53372574", "0.53354305", "0.5329515", "0.5316043", "0.5292916", "0.52892256", "0.5279986", "0.52654034", "0.5260183", "0.52600014", "0.5254651", "0.52510846", "0.5231594", "0.52305716", "0.5221036", "0.5220233", "0.5213662", "0.51763356", "0.5174857", "0.5173099", "0.5169444", "0.51514006", "0.5138314", "0.5137539", "0.5131391", "0.5131055", "0.51279294", "0.5122909", "0.5116835", "0.51155937", "0.51144445", "0.5114041", "0.5111986", "0.510661", "0.5106277", "0.50993913", "0.5098715", "0.5092767", "0.50752735", "0.5070256", "0.5070256", "0.50555825", "0.5053406", "0.5053406", "0.50419074", "0.5037488" ]
0.7894905
1
Determine if search query logging is enabled.
Определите, включено ли логирование поисковых запросов.
public function logsEnabled(): bool { return (bool)config('netcore.module-search.enable_search_logs'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function enableQueryLog() {\n\t\t$this->loggingQueries = true;\n\t}", "public function isLoggingEnabled();", "public function isLoggingEnabled(): bool;", "static public function enableQueryLogging() {\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = TRUE;\n\t}", "public function isLoggingEnabled()\n {\n return (1 == Mage::getStoreConfig('postident/general/logging_enabled'));\n }", "public function isLoggingEnabled()\n {\n return $this->logging;\n }", "public function hasLogging(){\n return $this->_has(27);\n }", "public function hasLogging(){\n return $this->_has(7);\n }", "public function logging()\n {\n return $this->loggingQueries;\n }", "public function getEnableLogging()\n {\n return isset($this->enable_logging) ? $this->enable_logging : false;\n }", "public function logging() {\n\t\treturn $this->loggingQueries;\n\t}", "public function loggingIsEnabled() {}", "public function isLoggingForced() \n {\n return Mage::getStoreConfigFlag(static::XML_PATH_FORCE_LOG);\n }", "private function log_enabled()\n\t{\n\t\treturn \"yes\" == $this->log;\n\t}", "protected function isLogEnabled() {\n\t\treturn Mage::getStoreConfig('payment/optile/log_enabled');\n\t}", "private static function LOGGING_ENABLED() { return true; }", "public function hasSearchQuery()\n {\n return (bool) $this->searchQuery;\n }", "protected function isSearchQuery(): bool\n {\n return !empty($this->searchFilter);\n }", "function hasLogger();", "public function isSiteSearchEnabled()\n {\n return $this->get('sitesearch') == 1;\n }", "public function logQueries($enable = null);", "public function enableLogging() {}", "static public function log_query( $query ) {\n\n\t\t\tif ( empty( $query ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// don't log anything if logging is not enabled\n\t\t\t$logging_enabled = apply_filters( WP_REST_API_Log_Common::PLUGIN_NAME . '-setting-is-enabled',\n\t\t\t\ttrue,\n\t\t\t\t'elasticpress',\n\t\t\t\t'logging-enabled'\n\t\t\t\t);\n\n\t\t\tif ( ! $logging_enabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$log_query = true;\n\n\t\t\t$route = '';\n\t\t\tif ( ! empty( $query['url'] ) && ! empty( $query['host'] ) ) {\n\t\t\t\t$route = $query['url'];\n\t\t\t\t// don't log the _stats/indexing request by default\n\t\t\t\tif ( false !== strpos( $query['url'], '_stats/indexing' ) ) {\n\t\t\t\t\t$log_query = false;\n\t\t\t\t}\n\n\t\t\t\t// don't log the plugins list\n\t\t\t\tif ( false !== strpos( $query['url'], '_nodes?plugin=true' ) ) {\n\t\t\t\t\t$log_query = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$log_query = apply_filters( WP_REST_API_Log_Common::PLUGIN_NAME . '-elasticpress-log-query', $log_query, $query );\n\n\t\t\tif ( ! $log_query ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\t// set up some defaults\n\t\t\t$args = array(\n\t\t\t\t//'ip_address' => $_SERVER['REMOTE_ADDR'],\n\t\t\t\t'route' => $route,\n\t\t\t\t'method' => '',\n\t\t\t\t'status' => '',\n\t\t\t\t'source' => 'ElasticPress',\n\t\t\t\t'milliseconds' => 0,\n\t\t\t\t'request' => array(\n\t\t\t\t\t'body_params' => array(),\n\t\t\t\t\t'headers' => array(),\n\t\t\t\t\t'body' => '',\n\t\t\t\t\t),\n\t\t\t\t'response' => array(\n\t\t\t\t\t'body' => '',\n\t\t\t\t\t'headers' => array(),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\n\t\t\t// add elapsed time\n\t\t\tif ( ! empty( $query['time_start'] ) && ! empty( $query['time_finish'] ) ) {\n\t\t\t\t$args['milliseconds'] = absint( ( $query['time_finish'] * 1000 ) - ( $query['time_start'] * 1000 ) );\n\t\t\t}\n\n\t\t\tif ( ! empty( $query['args'] ) ) {\n\n\t\t\t\t// store the JSON sent to ElasticSearch\n\t\t\t\tif ( ! empty( $query['args']['body'] ) ) {\n\t\t\t\t\t$args['request']['body'] = base64_encode( $query['args']['body'] );\n\t\t\t\t}\n\n\t\t\t\t// add the method\n\t\t\t\tif ( ! empty( $query['args']['method'] ) ) { \n\t\t\t\t\t$args['method'] = $query['args']['method'];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( ! empty( $query['request'] ) ) {\n\n\t\t\t\t// this is actually the response headers\n\t\t\t\tif ( ! empty( $query['request']['headers'] ) && is_array( $query['request']['headers'] ) ) {\n\n\t\t\t\t\tforeach( $query['request']['headers'] as $header => $value ) {\n\t\t\t\t\t\t$args['response']['headers'][ $header ] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// store the HTTP response code\n\t\t\t\tif ( ! empty( $query['request']['response'] ) && ! empty( $query['request']['response']['code'] ) ) {\n\t\t\t\t\t$args['status'] = $query['request']['response']['code'];\n\t\t\t\t}\n\n\t\t\t\t// store the response body\n\t\t\t\tif ( ! empty( $query['request']['body'] ) ) {\n\t\t\t\t\t$args['response']['body'] = json_decode( $query['request']['body'] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// log the EP request/response\n\t\t\tdo_action( WP_REST_API_Log_Common::PLUGIN_NAME . '-insert', $args );\n\n\t\t}", "public function startLogging(): void\n {\n DB::enableQueryLog();\n }", "public function disableQueryLog() {\n\t\t$this->loggingQueries = false;\n\t}", "public function isSearchActive()\n {\n return Mage::getStoreConfigFlag(static::CONFIG_FLAG_ELASTICGENTO_CATALOGSEARCH_ENABLED);\n }", "public function isLogEnabled()\n {\n return $this->logLevel > self::LOG_LEVEL_DISABLED;\n }", "private function canLog()\n {\n return (boolean)TinyBoard::getConfig('logging/enabled');\n }", "public function hasLog(): bool;", "function getLogSettings()\n {\n \treturn $this->logQueries;\n }", "public function supports_logger(): bool {\n\t\t\treturn true;\n\t\t}", "public function enableQueryLog()\n {\n $this->loggingQueries = true;\n\n if(!$this->logger)\n {\n $this->logger = new QueryLogger();\n }\n\n return $this;\n }", "private function _have_logging_flag($name)\r\n {\r\n return strstr($this->parameters['logging'], $name) !== false;\r\n }", "function is_search() {\n\tglobal $wp_query;\n\n\tif ( ! isset( $wp_query ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );\n\t\treturn false;\n\t}\n\n\treturn $wp_query->is_search();\n}", "public function is_adv_search_on(){\n\t\treturn $this->get_module_variable('adv_search',Base_User_SettingsCommon::get('Utils_GenericBrowser','adv_search'));\n\t}", "public function getSiteSearchEnabled()\n {\n return $this->site_search_enabled;\n }", "private function logQuery() {\n if (!$this->are_queries_logged) return;\n\n if (sizeof($this->logged_queries) > $this->max_logged_queries) {\n $this->are_queries_logged = false;\n $this->logged_queries[] = 'Number of maximum logged queries exceeded; turning off logging.';\n $this->logged_queries[] = 'Call tx_newspaper::setMaxLoggedQueries() to increase the number of logged queries.';\n } else {\n $this->logged_queries[] = $this->query;\n }\n }", "function setLogging($var)\n {\n \tif(is_bool($var))\n \t\t$this->logQueries = $var;\n }", "public static function enableQueryLog()\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\PostgresConnection $instance */\n $instance->enableQueryLog();\n }", "public function hasLog(): bool\n {\n return isset($this->log);\n }", "public function hasSearch() {\n return $this->hasSearch;\n }", "public function startLoggingQueries() {\n tx_newspaper_ExecutionTimer::start();\n $this->are_queries_logged = true;\n }", "public function isForceLog() {\n\t\treturn $this->forceLog;\n\t}", "public function is_enabled() {\n\n\t\treturn (bool) Options::init()->get( 'logs', 'enabled' );\n\t}", "function snax_slog_debug_mode_enabled() {\n\t$enabled = 'standard' === get_option( 'snax_slog_debug_mode', 'none' );\n\n\treturn apply_filters( 'snax_slog_debug_mode_enabled', $enabled );\n}", "function snax_slog_enabled() {\n\t$enabled = 'standard' === get_option( 'snax_slog_enabled', 'none' );\n\n\treturn apply_filters( 'snax_slog_enabled', $enabled );\n}", "private static function is_logging_page(){\r\n $current_page = trim(strtolower(rgget(\"page\")));\r\n $logging_pages = array(\"gf_logging\");\r\n\r\n return in_array($current_page, $logging_pages);\r\n }", "private function _message_log_enabled()\r\n {\r\n return $this->logging_options[self::MESSAGE_STATUS] ||\r\n $this->logging_options[self::MESSAGE_ERROR] || \r\n $this->logging_options[self::MESSAGE_INFORMATION];\r\n }", "public function shouldSearchOnOptions()\n {\n return Mage::getStoreConfigFlag('catalog/search/andidot_enable_options_search');\n }", "public function searchLog()\n {\n return $this->searchLog;\n }", "function emLoggerDebugMode() {\n // Set if debug mode once on the first log call\n if (is_null($this->emLoggerDebug)) {\n $systemDebug = $this->getSystemSetting('enable-system-debug-logging');\n $projectDebug = !empty($_GET['pid']) && $this->getProjectSetting('enable-project-debug-logging');\n $this->emLoggerDebug = $systemDebug || $projectDebug;\n }\n return $this->emLoggerDebug;\n }", "public function setShowDebugInfo(bool $flag): \\SolrQuery {}", "public function setShowDebugInfo(bool $flag): \\SolrQuery {}", "public static function has_log_report() : bool {\n return true;\n }", "public function isQuickSearchEnabled()\n\t{\n\t\treturn true;\n\t}", "public static function getQueryLog()\n\t{\n\t\treturn self::$_queryLog;\n\t}", "public function isLoggingResponsesEnabled(): bool\n {\n return $this->isEnabled(self::getNextFinerLogLevel($this->getAppropriateLogLevel(0)));\n }", "public function disableSearchQueryLogging()\n {\n $this->searchQueryLogging = false;\n\n return $this;\n }", "public function isLoggingEnabled($store_id = 0) {\n return (int)Mage::app()->getStore($store_id)->getConfig(self::SECTION . self::GENERAL_GROUP . 'logging_enabled');\n }", "public function isLoggingEnabled($store_id = 0) {\n return (int) Mage::app()->getStore($store_id)->getConfig(self::SECTION . self::GENERAL_GROUP . 'logging_enabled');\n }", "public function hasSearchFiltersEnabled(): bool\n {\n return $this->searchInputs()->filter->value->isNotEmpty();\n }", "protected function doLogging() {\r\n\t\ttrace(str_replace(chr(9), '', $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery));\r\n if (TYPO3_DLOG) t3lib_div::devLog('Query from pt_objectstorage', 'pt_objectstorage', 0, array('query' => $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery));\r\n\t}", "public function getQueryAdhoc(): bool\n\t{\n\t\treturn $this->_n1ql_query_adhoc;\n\t}", "function isRequiredSearchRunning() \n\t{\n\t\tif( !$this->searchClauseObj )\n\t\t\treturn false;\n\t\t\t\n\t\treturn $this->searchClauseObj->isRequiredSearchRunning();\n\t}", "public static function getIsSearch(){\n return self::getProperty('is_search');\n }", "private function has_menu_search() {\n\t\treturn apply_filters( 'pluton_has_menu_search', true ); // Return true always now since 3.0.0\n\t}", "public function skipLogging(): bool;", "private function is_enabled($log = true) : bool\n {\n }", "private function is_site_in_search_console() {\n\t\t// Early Bail!!\n\t\tif ( Helper::is_localhost() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$sites = Api::get()->get_sites();\n\t\t$home_url = Google_Analytics::get_site_url();\n\n\t\tforeach ( $sites as $site ) {\n\t\t\tif ( trailingslashit( $site ) === $home_url ) {\n\t\t\t\t$profile = get_option( 'rank_math_google_analytic_profile' );\n\t\t\t\tif ( empty( $profile ) ) {\n\t\t\t\t\tupdate_option(\n\t\t\t\t\t\t'rank_math_google_analytic_profile',\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'country' => 'all',\n\t\t\t\t\t\t\t'profile' => $home_url,\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function logQueries()\n{\n if (App::environment('production') || !config('system.query_log')) {\n return;\n }\n\n \\DB::listen(function($query) {\n \\Log::info(\n $query->sql,\n $query->bindings,\n $query->time\n );\n });\n}", "public function defaultQueryLogger()\n {\n return new Logger('Query', [\n new StreamHandler(\n $this->app->storagePath() . '/logs/db-query.log'\n , Logger::DEBUG\n )\n ]);\n }", "public function isEnabled()\n {\n $currentStore = Mage::app()->getStore();\n $helper = Mage::getSingleton('brontosoftware_browse/settings');\n $enabled = $helper->isEnabled('store', $currentStore);\n if ($this->_eventType == 'SEARCH') {\n return $enabled && $helper->isSearchEnabled('store', $currentStore);\n }\n return $enabled;\n }", "private function checkSearch()\n {\n add_filter(\n 'pre_get_posts',\n function ($query) {\n $this->is_search = ($query->is_search() && !is_admin());\n }\n );\n }", "function hasSearch() {\n\n\t\t$options = get_option('themeboy', array());\n\n\t\tif (!array_key_exists('nav_menu_search', $options) || $options['nav_menu_search']) {\n\t\t\t\t$has_search = true;\n\t\t} else {\n\t\t\t\t$has_search = false;\n\t\t}\n\t\t\n\t\treturn $has_search;\n}", "public function isSearchable(): bool\n {\n return $this->request->input('search.value') != '';\n }", "public function setEchoHandler(bool $flag): \\SolrQuery {}", "public function setEchoHandler(bool $flag): \\SolrQuery {}", "public static function isEnabled(){\n global $debug;\n return $debug === true || self::$enabled || BitSensor::$logLevel >= E_USER_NOTICE;\n }", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "public function hasSearch(){\n return ! empty($this->search);\n }", "public function setQueryLog($flag)\n {\n $this->query_log = (bool) $flag;\n }", "public static function is_wp_search() {\n\n\t\tif ( isset( $_SERVER['QUERY_STRING'] ) ) {\n\t\t\tparse_str( $_SERVER['QUERY_STRING'], $url_parameters );\n\n\t\t\treturn isset( $url_parameters[ self::SEARCH_PARAMETER_S ] );\n\t\t}\n\n\t\treturn false;\n\t}", "public function isEnabledLoggingFor(string $apiName): bool\n {\n if (!array_key_exists('enable_database_logging', $this->parameters)) {\n return false;\n }\n\n if ($this->parameters['enable_database_logging'] === null) {\n return true;\n }\n\n $isEnabled = in_array($apiName, $this->parameters['enable_database_logging']['elements'], true);\n\n if ($this->parameters['enable_database_logging']['type'] === 'exclusive') {\n return !$isEnabled;\n }\n\n return $isEnabled;\n }", "public static function is_show_full_log() {\n\t\t$show_full_log = false;\n\t\tif ( defined( 'FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG' ) && FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG ) {\n\t\t\t$show_full_log = true;\n\t\t}\n\n\t\t/**\n\t\t * Filter Flag show full log on entries\n\t\t *\n\t\t * @since 1.2\n\t\t *\n\t\t * @params bool $show_full_log\n\t\t */\n\t\t$show_full_log = apply_filters( 'forminator_addon_activecampaign_show_full_log', $show_full_log );\n\n\t\treturn $show_full_log;\n\t}", "private static function _is_enable()\n {\n self::$_log_path = APPPATH.'/storage/logs/';\n \n if ( ! is_dir(self::$_log_path) OR ! is_really_writable(self::$_log_path))\n {\n self::$_enabled = false;\n return false;\n\n }else{\n \n return true;\n \n }\n\n \n }", "private static function __isDebugKitRunning() {\n\t\treturn self::is(\n\t\t\t'DebugKit.enabled',\n\t\t\tarray('OR' => array(\n\t\t\t\t'DebugKit.automated',\n\t\t\t\t'DebugKit.requested'\n\t\t\t))\n\t\t);\n\t}", "public function getIsSearchable();", "public function isLoggingDeveloper()\n {\n return $this->appState->getMode() == \\Magento\\Framework\\App\\State::MODE_DEVELOPER;\n }", "public function isWriteLog()\n {\n return $this->writeLog;\n }", "protected function logQuery($message = '')\n {\n if($this->getConfig()->getLogging()['active']) {\n Log::info($this->getConfig()->getDomain().': '.$message);\n }\n }", "public function isDebugEnabled(){\n\t\treturn ( $this->priority <= Logger::DEBUG );\n\t}", "public function setLogging($val = false);", "public function isCatalogSearch()\n {\n $pathInfo = $this->_getRequest()->getPathInfo();\n if (stripos($pathInfo, '/catalogsearch/result') !== false) {\n return true;\n }\n return false;\n }", "private static function __isDebugKitRequested() {\n\t\treturn isset($_GET['debug']) && 'true' == $_GET['debug'];\n\t}", "function site_uses_search() {\n\treturn get_theme_mod('uwmadison_use_search', false);\n}", "function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->pr_Barcode->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->pr_PO->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->pr_intStatus->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}", "public static function getQueryLog()\n {\n if (isset(self::$_query_log)) {\n return self::$_query_log;\n }\n return array();\n }", "public function hasLogs(){\n return $this->_has(23);\n }", "function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->Id_Articulo->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->COD_Marca_eq->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->Articulo->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\tif ($this->Codigo->AdvancedSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}", "public function hasQuery()\n {\n return $this->has(self::QUERY);\n }" ]
[ "0.69864607", "0.69748354", "0.69546866", "0.67499894", "0.6739284", "0.6642318", "0.66151816", "0.660071", "0.64425015", "0.63984174", "0.6396661", "0.6275924", "0.6241447", "0.61384606", "0.61322445", "0.6123387", "0.61125124", "0.6096891", "0.60504824", "0.6035031", "0.5975371", "0.5971334", "0.5945277", "0.5909015", "0.5896924", "0.58888876", "0.5882963", "0.5853441", "0.5849091", "0.58294123", "0.5816461", "0.58075297", "0.5805319", "0.5798789", "0.57888365", "0.5752858", "0.57518023", "0.57311773", "0.569346", "0.56896085", "0.5666202", "0.5666144", "0.5618257", "0.5610224", "0.5597894", "0.5591686", "0.558993", "0.5583147", "0.5567449", "0.555789", "0.555025", "0.55334115", "0.55334115", "0.5531362", "0.5521828", "0.5508075", "0.5503704", "0.54968154", "0.5485536", "0.54678893", "0.5463102", "0.5424438", "0.5394982", "0.53923655", "0.53674877", "0.53659517", "0.5357689", "0.5355853", "0.5355655", "0.53521067", "0.53512555", "0.5347864", "0.5336485", "0.53273016", "0.5307845", "0.5300165", "0.5300165", "0.5296509", "0.52944237", "0.5290073", "0.52856255", "0.52784324", "0.5259762", "0.5251351", "0.5223243", "0.5220126", "0.52165395", "0.52146757", "0.519999", "0.51889163", "0.5168413", "0.5167005", "0.5158568", "0.51488924", "0.5146847", "0.51456696", "0.5145564", "0.51424223", "0.5142067", "0.5086494" ]
0.746377
0
Determine if user_id logging is enabled.
Определите, включен ли логирование user_id.
public function logUserId() { return (bool)config('netcore.module-search.log_user_ids'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasUserid()\n {\n return $this->get(self::USERID) !== null;\n }", "function hasCurrentUserId() ;", "public function isLoggingEnabled()\n {\n return (1 == Mage::getStoreConfig('postident/general/logging_enabled'));\n }", "public static function isLoggedIn()\r\n {\r\n $id = self::getVar( self::UserId );\r\n return isset( $id );\r\n }", "public function hasLogid(){\n return $this->_has(11);\n }", "public function is_logged() {\n\t\treturn $this->get_current_user('id');\n\t}", "function isLogged(){\t\t\n\t\tif(isset($_SESSION['userId']))\n\t\t\treturn $_SESSION['userId'];\n\t\telse\n\t\t\treturn false;\n\t}", "public function isLoggingEnabled($store_id = 0) {\n return (int)Mage::app()->getStore($store_id)->getConfig(self::SECTION . self::GENERAL_GROUP . 'logging_enabled');\n }", "public function isLoggingEnabled($store_id = 0) {\n return (int) Mage::app()->getStore($store_id)->getConfig(self::SECTION . self::GENERAL_GROUP . 'logging_enabled');\n }", "public function getActiveUserId()\n {\n // first check if user is \"logged in\" through api\n if ($apiUserId = config('api_user_id'))\n {\n return $apiUserId;\n }\n\n // Next check if user is logged in through sentry\n if ($user = $this->getActiveUser())\n {\n return $user->id;\n }\n\n return false;\n }", "public static function isLoggedIn() {\n\t\treturn (self::$data['userid']);\n\t}", "public function isLoggedIn()\n {\n return ($this->userInfo->userid ? true : false);\n }", "public function isUser()\n\t\t{\n\t\t\tif(is_numeric($this->id()))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "function isLoggined() \n {\n if (!$this->getUserID() || $this->getUserID() == VISITOR_USER) {\n return false;\n } else {\n return true;\n }\n }", "function is_user() { return ( $this->user_id != 0 ); }", "public function logged()\n {\n return $this->user !== null;\n }", "static function checkisLogged() : bool \n {\n return isset($_SESSION['userId']);\n }", "public function is_logged_in()\r\n {\r\n return ($this->id > 0) ? true : false;\r\n }", "public function hasIdentity()\n {\n return ($this->identity->userId != 0);\n }", "public function isLoggingEnabled();", "function is_logged_in_user() {\n\t// echo \"sadasd\";\n\t// echo $GLOBALS ['CI']->entity_user_id;exit;\n\tif (isset ( $GLOBALS ['CI']->entity_user_id ) == true and intval ( $GLOBALS ['CI']->entity_user_id ) > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function isAuth()\n {\n return $this->id ? true : false;\n }", "public static function isLogged() {\n\n if (Session::check('user')) {\n $user_data = Session::get('user');\n if (is_numeric($user_data['id'])) {\n if (Session::get('ip') == $_SERVER['REMOTE_ADDR'] && Session::get('user-agent') == $_SERVER['HTTP_USER_AGENT']) {\n return true;\n }\n }\n }\n return false;\n }", "public function logged_in() {\n return (isset($_SESSION['user_id'])) ? true : false;\n }", "function getUserIdChecking($user_id)\n\t\t{\n\t\t\t$userRow = $this->manage_content->getValue_where(\"user_credentials\",\"*\",\"user_id\",$user_id);\n\t\t\tif(!empty($userRow[0]))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "function userlogined()\n\t{\n\t\tglobal $user_cfg;\n\t\tif ($user_cfg['logined']=='0' || $user_cfg['logined']=='')\n\t\t{\n\t\t\treturn '0';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '1';\n\t\t}\n\t}", "function is_user($user_id) {\n\t\treturn $user_id == $this->Session->read('Auth.User.id');\n\t}", "public function hasLoggedUser(): bool\n {\n return is_object($this->getCurrentUser()) && isset($this->getCurrentUser()->id) && $this->getCurrentUser()->id > 0;\n }", "public function isLoggedIn()\t{\n\t\t\treturn ($this->userId != NULL);\n\t\t}", "public function isUserLevel()\n {\n\n if (isset($_COOKIE['scriptlog_cookie_level'])) {\n\n return $_COOKIE['scriptlog_cookie_level'];\n \n }\n\n if (isset(Session::getInstance()->scriptlog_session_level)) {\n\n return Session::getInstance()->scriptlog_session_level;\n \n }\n \n return false;\n\n }", "public function loggedIn() {\n\t\treturn isset($_SESSION['id']) ? true : false;\n\t}", "private function log_enabled()\n\t{\n\t\treturn \"yes\" == $this->log;\n\t}", "function uga_track_user() {\r\n global $user_level;\r\n uga_debug('Start uga_track_user');\r\n if (!user_level) {\r\n // user nog logged on -> track\r\n uga_debug('User not logged on');\r\n $result = true;\r\n } else {\r\n // user logged on\r\n if (uga_get_option('ignore_users') && \r\n $user_level>=uga_get_option('max_user_level')) {\r\n // ignore user because of userlevel\r\n uga_debug(\"Not tracking user with level $user_level\");\r\n $result = false;\r\n } else {\r\n uga_debug(\"Tracking user with level $user_level\");\r\n $result = true;\r\n }\r\n }\r\n uga_debug(\"Ending uga_track_user: $result\");\r\n return $result;\r\n}", "public function getUserID() {\n\t\treturn isset($this->userID) ? $this->userID : false;\n\t}", "public function is_logged_in(){\n\n return session(\"user_id\") ?: false;\n }", "public static function isUserLoggedIn()\n {\n return isset($_SESSION['id']);\n }", "public function is_loggedin()\n\t{\n\n\t\t// Return true or flase based on the presence of user data\n\t\treturn (bool) $this->ci->session->userdata('identifier');\n\n\t}", "public function checkUserLoggedIn()\n {\n $user_id_config = $this->CI->config->item('user_id');\n if ($this->CI->session->userdata($user_id_config)) {\n \n return true;\n } else {\n \n return false;\n }\n }", "function isLoggedIn()\r\n\t\t{\r\n\t\t\treturn $this->userid;\r\n\t\t}", "private function _isUserLoggedIn() {\n\t\t$data = SBTCookie::get(WP_SESSION_INDICATOR);\n\t\t$this->userID = $data;\n\n\t\treturn $this->userID > 0 || is_user_logged_in();\n\t}", "public static function isAuthUserSet()\n\t\t{\n\t\t\treturn (bool)Authentication::$identity;\n\t\t}", "private static function userIsDebugging()\n {\n return isset($_GET['showUnMatchedTags']) && (PermissionsManager::isUserAdmin(Gatekeeper::getUsername()) || PermissionsManager::isUserSuperUser(Gatekeeper::getUsername()));\n }", "public function getUserId()\n {\n if ($this->logged()) {\n return $this->SESSION[\"auth\"];\n }\n return \\false;\n }", "public function isLoggedIn() {\n return isset($_SESSION['user_id']);\n }", "public function isLoggedIn()\n {\n return $this->get('session')->get('user.id');\n }", "public function isLoggingEnabled(): bool;", "public function logged_in(){\n \treturn $this->currentId!==false;\n }", "public function getIdUserLog() \n\t{\n\t\treturn $this->idUserLog;\n\t}", "public static function isLogged() {\n return (new Session())->has('auth_id');\n }", "public static function is_logged_in()\n {\n return (bool) isset($_SESSION['user_id']);\n }", "public static function is_login() {\n if (self::id()) {\n return true;\n } else {\n return false;\n }\n }", "public function isLoggedIn(): bool\n {\n return !empty($this->session->get('userId'));\n }", "function logIn () {\n $response = $this->connection->logIn();\n if ($this->id = $this->connection->findUserId($response['body'])) {\n return true;\n } else {\n return false;\n }\n }", "function get_signcheck() {\n\t\treturn USER_ID ? 1 : 0;\n\t}", "function get_user_id()\n\t{\n\t\tif(isset($this->user_id))\n\t\t\treturn $this->user_id;\n\n\t\treturn false;\n\t}", "function isloggedin() {\n global $USER;\n\n return (!empty($USER->id));\n}", "protected function isIdinEnabled()\n {\n return $this->configProviderAccount->getIdin($this->storeManager->getStore()) != 0;\n }", "public function logged_in()\n {\n return (isset($_SESSION['id'])) ? true : false;\n }", "public function isLoggedIn() {\n\t\tif (isset($_SESSION['uid'])) {\n\t\t\treturn $_SESSION['uid'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function user_logged_in(){\n\t\treturn isset($_SESSION['id']) || isset($_SESSION['pseudo']);\n\n\t}", "public function is_logged_in() {\n return isset($this->user_id) && isset($_COOKIE['user_id']);\n }", "function user_id() {\n\tglobal $AUTH_USER_ID;\n\tif(!empty($AUTH_USER_ID)) {\n\t\treturn $AUTH_USER_ID;\n\t}\n\n\tif(IS_CLI) {\n\t\treturn 0;\n\t}\n\n\tif(array_key_exists('USER_ID', $_SESSION)) {\n\t\treturn $_SESSION['USER_ID'];\n\t}\n\n\tif(array_key_exists('USER_AUTH', $_COOKIE)) {\n\t\tif($userId = m('user')->find('cookie_auth', $_COOKIE['USER_AUTH'])) {\n\t\t\t$_SESSION['USER_ID'] = $userId;\n\t\t\treturn $_SESSION['USER_ID'];\n\t\t}\n\t}\n\n\tunset($_SESSION[@'USER_ID']);\n\treturn false;\n}", "public function logged_in()\n\t{\n\t\treturn ($this->get_user() !== NULL);\n\t}", "public function logged_in () {\n if (isset($_SESSION['user_id'])) return true;\n else return false;\n }", "public function is_user ()\n { \n if (isset($this->userid))\n {\n if ($this->timeout > 0)\n {\n $curtime = time();\n $oldtime = $this->accessed;\n if (($curtime - $oldtime) > $this->timeout)\n {\n return false;\n }\n $this->accessed = $curtime;\n }\n return $this->userid;\n }\n return False;\n }", "public function getLogEnabled($storeId = null)\n {\n return (bool)$this->getValue(self::CONFIG_KEY_LOG_ENABLED, $storeId);\n }", "public function hasLogging(){\n return $this->_has(7);\n }", "public function isUserLogged(){\n $this->app = \\Slim\\Slim::getInstance();\n\n // Verifying User Authorization\n if((string)$this->app->getCookie('USER_ID',false) !== ''){\n //cookie exists\n return true;\n } else {\n\n //verifica a sessao\n if(isset($_SESSION[\"USER_ID\"])) {\n if($_SESSION[\"USER_ID\"]!=='') {\n return true;\n }else {\n return false;\n }\n }else {\n return false;\n }\n }\n\n return false;\n }", "function logged_in() \n\t{\n\t\treturn (!isset($_SESSION['user_id'])) ? true : false;\n\t}", "public function is_logged_in() {\n\t\tglobal $config;\n\t\treturn ($this->id != $config->get_int('anon_id'));\n\t}", "function estaLog(){\n\t $user = [];\n\tif (isset($_SESSION['userId'])) {\n\t\treturn $_SESSION['userId'];\n\t} elseif (isset($_COOKIE['userId'])) {\n\t\treturn $_COOKIE['userId'];\n\t}\n}", "protected function isLogEnabled() {\n\t\treturn Mage::getStoreConfig('payment/optile/log_enabled');\n\t}", "function checkUser()\n\t{\n\t\tif($this->session->userdata('UsID'))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function is_domain_user() {\n\t// check this based on domain id when the user login\n\t$domain_id = @$GLOBALS ['CI']->entity_domain_id;\n\tif (intval ( $domain_id ) > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function isLoggedIn()\n {\n return isset($_SESSION['user_id']);\n }", "public function loggingIsEnabled() {}", "public function id()\n {\n return ($id = get_current_user_id()) !== 0 ? $id : false;\n }", "public function isLoggedIn() {\n if (!$this->id) return false;\n if (hash('SHA512', $this->id . $this->username . $_SERVER['HTTP_USER_AGENT']) !== $_SESSION['user_token'])\n return false;\n return true;\n }", "public function isLogged(): bool\n {\n return $this->getUser() !== null;\n }", "public function loggedInUser()\n {\n if ($this->id == auth()->user()->id)\n return true;\n\n return false;\n }", "function is_logged_in(){\n\t\t\n\t\tif ( isset($_SESSION['u_id']) && $_SESSION['u_id'] != \"\"){\n\t\t\treturn true;\n\t\t}else return false;\n\t\t\n\t}", "function is_valid_user($id){\n global $_config, $t;\n $user_ids = array_keys($_config['user_prefix']);\n if (in_array($id, $user_ids)) {\n //user is in, return true\n return true;\n } else {\n return false;\n }\n }", "public function isUser() : bool\n {\n return $this->role_id == config('role.user_id');\n }", "public function isLogged() {\n return !empty(\\Vi::$app->session->get($this->identityName));\n }", "function logged_in() {\n\t return isset($_SESSION['user_id']);\n\t }", "public function loggedIn() {\n return empty($this->user) ? $this->whoami() != $this->tag1Parameters['user_account'] : $this->whoami() == $this->user->name;\n }", "public function logged(){\n\t\t$sess_id = $_COOKIE['npsess'];\n\t\t$sess_id = unserialize($sess_id);\n\t\t//Gets session id for non-profits\n\t\tif($sess_id != null || $sess_id != \"\"){\n\t\t\treturn true;\n\t\t}else{\n\t\treturn false;\n\t}\n\t}", "public function isLoggedIn() {\n return $this->getID() !== 0;\n }", "public function isLoggingEnabled()\n {\n return $this->logging;\n }", "public static function check() {\n if(\\Altum\\Routing\\Router::$controller_settings['no_authentication_check']) {\n return false;\n }\n\n /* Already logged in from previous checks */\n if(self::$is_logged_in) {\n return self::$user_id;\n }\n\n /* Check the cookies first */\n if(\n isset($_COOKIE['user_id'])\n && isset($_COOKIE['token_code'])\n && mb_strlen($_COOKIE['token_code']) > 0\n && $user = (new User())->get_user_by_user_id_and_token_code($_COOKIE['user_id'], $_COOKIE['token_code'])\n ) {\n self::$is_logged_in = true;\n self::$user_id = $user->user_id;\n\n self::$user = $user;\n\n return true;\n }\n\n /* Check the Session */\n if(\n isset($_SESSION['user_id'])\n && !empty($_SESSION['user_id'])\n && $user = (new User())->get_user_by_user_id($_SESSION['user_id'])\n ) {\n self::$is_logged_in = true;\n self::$user_id = $user->user_id;\n\n self::$user = $user;\n\n return true;\n }\n\n return false;\n }", "public static function checkLogged()\n {\n if (isset($_SESSION['userId'])) {\n return $_SESSION['userId'];\n }\n\n header(\"Location: /user/login\");\n\n return true;\n }", "static public function isLoggedIn(){\r\n\t\treturn isset($_SESSION['uid']);\r\n\t}", "protected function is_authentificate()\n\t{\n\t\tif(!empty(Yii::app()->user->id) && $this->IssetUser(Yii::app()->user->id)) {\n\t\t\treturn Yii::app()->user->id;\n\t\t} else {\n\t\t\techo json_encode(array('result' => 'not authorized')); exit;\n\t\t}\n\t}", "function isUser() {\n\t\tglobal $O_O;\n\t\treturn $O_O->isUser();\n\t}", "function isUserLogged()\r\n\t{\r\n\t\t// Tomar la referencia al registro\r\n\t\tif ($registry = &$_SESSION['registry'])\r\n\t\t{\r\n\t\t\tif ($registry->getEntry('USERNAME'))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "private static function LOGGING_ENABLED() { return true; }", "public function check_id($user_id){\n\t\tglobal $con;\n\t\t$state=false;\n\t\t$query=\"SELECT user_id FROM system_users WHERE user_id='$user_id'\";\n\t\t$num=$this->rows($con,$query);\n\t\tif($num>0){\n\t\t\t$state=true;\n\t\t}else{\n\t\t\t$state=false;\n\t\t}\n\t\treturn $state;\n\t}", "function userLoggedIn(){\n\n if (isset($_SESSION['idOfUser'])) {\n \n return $_SESSION['idOfUser'];\n }else{\n\n return false;\n }\n }", "final public function isLoginSinglePerUser():bool\n {\n return $this->getAttr('loginSinglePerUser');\n }", "public function isUserLogged() {\n return isset($_SESSION[\"user\"]);\n }" ]
[ "0.71189517", "0.66154534", "0.6533076", "0.6518685", "0.65097165", "0.6501069", "0.64690065", "0.6367276", "0.63405037", "0.63302726", "0.62877625", "0.6282696", "0.62775916", "0.6273311", "0.6254331", "0.6240744", "0.6232202", "0.6212104", "0.6210487", "0.61965793", "0.6176957", "0.6164165", "0.6142002", "0.6141333", "0.6141158", "0.61356205", "0.6118715", "0.61121535", "0.6108364", "0.61017454", "0.60951114", "0.6092989", "0.60870004", "0.6075251", "0.60649395", "0.6064895", "0.60479325", "0.604043", "0.60156626", "0.6007072", "0.6006181", "0.59904474", "0.5990355", "0.5984792", "0.59840083", "0.5966537", "0.5959352", "0.5958361", "0.59409887", "0.5936062", "0.59342504", "0.5933052", "0.59238356", "0.59199965", "0.5907718", "0.5905751", "0.59036565", "0.58970743", "0.58922327", "0.5891794", "0.58910894", "0.58770126", "0.58671147", "0.58636016", "0.5862363", "0.5853156", "0.5850926", "0.585059", "0.58495665", "0.58406454", "0.58389026", "0.5838681", "0.58347064", "0.58318466", "0.58308697", "0.5823595", "0.5817538", "0.5817018", "0.5810175", "0.5807927", "0.5805654", "0.5801522", "0.58007276", "0.5796382", "0.5794342", "0.5788064", "0.5787317", "0.57869655", "0.57836854", "0.5782796", "0.5779101", "0.5779041", "0.57749337", "0.57727325", "0.57698166", "0.5760055", "0.5759626", "0.57590455", "0.57449937", "0.5743766" ]
0.7889862
0
Returns an array of Javascript files to be included for this library.
Возвращает массив файлов JavaScript, которые должны быть включены для этой библиотеки.
public function getJsFiles(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function grabAllJsFiles()\n\t{\n\t\t$jsFiles = array();\n\t\tforeach($this->includes_js as $file)\n\t\t{\n\t\t\t$jsFiles[$file] = array();\n\t\t\tif(array_key_exists($file, $this->includes_jsreq))\n\t\t\t\t$jsFiles[$file] = $this->includes_jsreq[$file];\n\t\t}\n\t\t$this->includes_js = array();\n\t\t$this->includes_jsreq = array();\n\t\treturn $jsFiles;\n\t}", "function grabAllJsFiles()\n\t{\n\t\t$jsFiles = array();\n\t\tforeach($this->includes_js as $file)\n\t\t{\n\t\t\t$jsFiles[$file] = array();\n\t\t\tif(array_key_exists($file,$this->includes_jsreq))\n\t\t\t\t$jsFiles[$file] = $this->includes_jsreq[$file];\n\t\t}\n\t\t$this->includes_js = array();\n\t\t$this->includes_jsreq = array();\n\t\treturn $jsFiles;\n\t}", "public function getJsFiles(): array\n {\n return array();\n }", "public function getBrowserJsFiles();", "public function getScriptFiles() {\n\t\t\treturn $this->_jsFiles;\n\t\t}", "public static function getJsFiles()\n {\n return self::$jsFiles;\n }", "final private function getJavascriptIncludes() {\n\t\t$js_include_tags = [];\n\t\tforeach ($this->js_includes as $source) {\n\t\t\t$js_include_tags[] = \"<script src='\".$source.\"'></script>\";\n\t\t}\n\t\treturn implode($js_include_tags);\n\t}", "public function getJavascriptIncludes() {}", "public function getJavaScriptFiles()\n {\n return $this->_jsFiles;\n }", "public function jsIncludes() {\n $files = array_merge(Config::get($this->package_prefix.'bones.js_urls'), $this->js_urls);\n\n $html = '';\n foreach ($files as $file)\n $html .= '<script src=\"'.$file.'\"></script>'.PHP_EOL;\n\n return $html;\n }", "function getJSIncludeCode() {\n global $_JS;\n\n $html = '';\n\n foreach($_JS as $fileName) {\n $html .= '<script src=\"js/' . $fileName . '.js\"></script>';\n }\n\n return $html;\n }", "public function getJsFiles()\n {\n $html = '';\n\n foreach ($this->jsFiles as $file) {\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . Application::getBaseUrl(Environment::URL_TYPE_JS) . '/' . $file . '\">';\n }\n\n return $html;\n }", "public function getJavascriptFiles() {\n return $this->javascriptFiles;\n }", "protected static function _findFilesToInclude()\n {\n $splitted = preg_split(self::FILES_LIST, self::$_mainCode);\n \n $files = explode(',', $splitted[1]);\n \n unset($splitted[1]);\n self::$_mainCode = implode(\"\\n\", $splitted);\n \n $cleanFiles = array();\n foreach ($files as $file) {\n $file = trim($file, \"'\\n \\t\");\n $file = str_replace('.', DIRECTORY_SEPARATOR, $file);\n $cleanFiles[] = $file . '.js';\n }\n \n return $cleanFiles;\n }", "private function getAdditionalJsFiles(): string\n {\n $code = \"\";\n foreach ($this->getJsFiles() as $file) {\n $code .= sprintf('<script type=\"text/javascript\" src=\"%s\"></script>', $file) . \"\\n\";\n }\n return $code;\n }", "function getScripts () {\n return array();\n }", "public function getJavaScripts()\n {\n // check if jquery is loaded\n $js = array();\n $js[] = sfConfig::get('sf_jquery_web_dir') . '/js/' . sfConfig::get('sf_jquery_core');\n // $culture = $this->getOption('culture');\n $js[] = sfConfig::get('sf_jquery_web_dir') . '/js/jquery.ui.datepicker-fr.js';\n\n return $js;\n }", "public function getJavascripts()\n {\n return array('jquery/jquery-sortable.js');\n }", "public function javascripts() : array {\n\t \n\t $sDefaultPath = 'http://'.$_SERVER['HTTP_HOST'].'/getJs?';\n\t $aJavascript = func_get_args();\n\t $aReturns = array();\n\t \n\t foreach($aJavascript as $aJsCombination) {\n\t \n\t $sJsPath = $sDefaultPath;\n\t \n\t foreach ($aJsCombination as $sJsToAdd) {\n\t \n\t $sJsPath = $sJsToAdd.'&';\n\t }\n\t \n \t if (defined('ASSET_VERSION') && ASSET_VERSION) {\n \t \n \t $sJsPath = ASSET_VERSION;\n \t }\n\t \n\t $aReturns[] = $sJsPath;\n\t }\n\t \n\t return $aReturns;\n\t}", "function include_js_files()\n{\n\tglobal $globals, $user, $theme;\n\t\n\t$js_files_arr = array();\n\t\n\t$g_theme_dir = null;\n\t$g_theme_dir = $globals['themedir'];\n\tif( !isset( $globals['themedir'] ) || empty( $globals['themedir'] ) )\n\t\t$g_theme_dir = 'themes';\n\t\n\t$js_file_list = $g_theme_dir.\"/\".$user['theme_type'].\"/js/include_js_files\";\n\t$js_files_arr = file($js_file_list);\n\t\n\t$theme['js_files'] = array_filter(array_map(\"trim\", $js_files_arr));\n\t//$theme['js_files'] = array_filter($js_files_arr, \"trim\");\n\t$js_files_arr = null;\n\t$g_theme_dir = null;\n\t\n}", "public function getJsPaths() : array {}", "function render_js()\n {\n $out = array();\n foreach($this->js as $path) {\n $out[] = sprintf('<script type=\"text/javascript\" src=\"%s\"></script>', $path );\n }\n return $out;\n }", "public function getJavaScripts() \n {\n return array();\n }", "private function js_include() {\n\t\n\t\t$jsfiles = func_get_args();\n\t\n\t\tif(count($jsfiles) > 0) {\n\t\t\tforeach($jsfiles as $filename) {\n\t\t\t\t$filepath = js_url() . $filename. \".js\";\n\t\n\t\t\t\t//if(file_exists($filepath)) {\n\t\t\t\t\t\n\t\t\t\t//js file must not be cached for development\n\t\t\t\t$suffix = (ENVIRONMENT == 'development') ? '?'. time() : '?'. SOFT_VER;\n\t\t\t\t\t\n\t\t\t\t$this->jquery_ext->add_library($filepath . $suffix);\n\t\t\t\t//}\n\t\t\t}\n\t\t}\n\t}", "public function getJavaScripts()\n {\n return array(\"http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&2.7.0/build/animation/animation-min.js\");\n }", "function getJsPaths() ;", "function return_js_files()\r\n {\r\n $js_string = \"\";\n if(count($this->UI_ecmascript_files) == 0) return \"\t\";\r\n if ($this->UI_ecmascript_files)\r\n {\r\n foreach ($this->UI_ecmascript_files as $script)\r\n {\r\n $js_string .= '<script type=\"text/javascript\" src=\"'.$script.'\"></script>';\r\n }\r\n }\r\n return $js_string;\r\n }", "function get_scripts() {\n\t$result = array();\n\t$scripts = Response::getInstance()->get('scripts', array(), 'head');\n\tforeach ($scripts as $src) {\n\t\t$result[] = '<script type=\"text/javascript\" src=\"'.$src.'\"></script>';\n\t}\n\t\n\treturn implode(\"\\n\", $result);\n}", "public function getJavascripts()\n {\n return array(\n '/zeroMediaManagerPlugin/js/mediaPicker.js'\n );\n }", "public function js()\r\n {\r\n $jquery = glob('js/jquery*.js');\r\n $html = '<script type=\"text/javascript\" src=\"' . $jquery[0] . '\"></script>';\r\n \r\n foreach (glob('js/*.js') as $file) {\r\n if ($file != $jquery[0]) {\r\n $html .= '<script type=\"text/javascript\" src=\"' . $file . '\"></script>';\r\n }\r\n }\r\n \r\n return $html;\r\n }", "function find_js_inits() {\n\t$base_dir = getcwd().\"/../\";\n\t$files = scandir($base_dir);\n\tforeach ($files as $file) {\n\t\tif (is_dir($base_dir.$file)) {\n\t\t\t$js_file = $base_dir.$file.\"/templates/webkit/javascripts/\".$file.\".init.js\";\n\t\t\tif (file_exists($js_file)) {\n\t\t\t\t$js_a[] = \"//\".$file.\"/templates/webkit/javascripts/\".$file.\".init.js\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $js_a;\n}", "public function getScripts($jsPosition = JS_POSITION_END) {\n switch($jsPosition) {\n case JS_POSITION_START:\n return $this->jsStartFiles;\n break;\n case JS_POSITION_END:\n return $this->jsEndFiles;\n break;\n }\n return [];\n }", "public function getJavascripts()\r\n {\r\n return array('/fzTagPlugin/js/jquery.fcbkcomplete.min.js');\r\n }", "public function get_scripts(){\n return [\n 'plugin-dev-script' => [\n 'src' => P_DEV_ASSETS . '/js/frontend.js',\n 'version' => filemtime(P_DEV_PATH . '/assets/js/frontend.js'),\n 'deps' => ['jquery']\n ],\n 'plugin-dev-enquiry-script' => [\n 'src' => P_DEV_ASSETS . '/js/enquiry.js',\n 'version' => filemtime(P_DEV_PATH . '/assets/js/enquiry.js'),\n 'deps' => ['jquery']\n ],\n 'plugin-dev-admin-script' => [\n 'src' => P_DEV_ASSETS . '/js/admin.js',\n 'version' => filemtime(P_DEV_PATH . '/assets/js/admin.js'),\n 'deps' => ['jquery', 'wp-util']\n ]\n ];\n }", "private function _requiredJs() {\n\t\t$appRequired = array(\n\t\t\t$this->settings['lessLib'],\n\t\t\t$this->settings['namespaceJs'],\n\t\t\t$this->settings['scriptJs'],\n\t\t\t$this->settings['cssJs'],\n\t\t\t$this->settings['lessJs'],\n\t\t\t$this->settings['urlJs'],\n\t\t\t\n\t\t);\n\n\t\t$required = array();\n\n\t\tforeach ($appRequired as $path) {\n\t\t\tif (empty($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$required[] = $path;\n\t\t}\n\n\t\treturn $required;\n\t}", "public static function js(){\n return array(new \\SYSTEM\\PSAI('modules/saimod_sys_files/js/saimod_sys_files.js'));}", "public function insertJsFiles()\n\t{\n\t\t$code = '';\n\t\tif (!empty($this->js))\n\t\t{\n\t\t\tforeach ($this->js as $js => $params)\n\t\t\t{\n\t\t\t\tif ($params['loaded'] === false)\n\t\t\t\t{\n\t\t\t\t\t$code .= '<script type=\"text/javascript\" src=\"' . $js . '\"></script>';\n\t\t\t\t\t$this->js[$js]['loaded'] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $code;\n\t}", "public function scripts() {\n\t\t$scripts = array(\n\t\t\tarray(\n\t\t\t\t'handle'\t=> 'scripts_js',\n\t\t\t\t'src'\t\t => $this->get_base_url() . '/js/scripts.js',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'deps'\t\t=> array( 'jquery' ),\n\t\t\t\t/*'strings' => array(\n\t\t\t\t\t'first'\t=> esc_html__( 'First Choice', 'gforms-edc' ),\n\t\t\t\t\t'second' => esc_html__( 'Second Choice', 'gforms-edc' ),\n\t\t\t\t\t'third'\t=> esc_html__( 'Third Choice', 'gforms-edc' )\n\t\t\t\t),*/\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\t// array( 'field_types' => array( 'select', 'radio', 'checkbox', 'html' ) ) // we are not using this method to enqueue at this time\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn array_merge( parent::scripts(), $scripts );\n\t}", "public function js_includes()\n {\n }", "public static function getIncludedFiles() {\n\t\treturn get_included_files();\n\t}", "protected function getScriptfiles()\n {\n $scriptfiles = $this->_early_scriptfiles;\n foreach ($this->_widgets as $widget) {\n foreach ($widget->getScriptfiles() as $scriptfile) {\n $scriptfiles[] = $scriptfile;\n }\n }\n return array_unique($scriptfiles);\n }", "function get_included_files()\n{\n\treturn array();\n}", "public function script_provider()\n {\n return array(\n array(\n '/lib/modernizr/modernizr.dev-v2.8.3.js',\n false,\n false,\n false,\n '<script src=\"/lib/modernizr/modernizr.dev-v2.8.3.js\"></script>'\n ),\n array(\n '/lib/modernizr/modernizr.dev-v2.8.3.js',\n 'text/javascript',\n false,\n false,\n '<script type=\"text/javascript\" src=\"/lib/modernizr/modernizr.dev-v2.8.3.js\"></script>'\n ),\n array(\n '/lib/modernizr/modernizr.dev-v2.8.3.js',\n 'text/javascript',\n true,\n false,\n '<script type=\"text/javascript\" src=\"/lib/modernizr/modernizr.dev-v2.8.3.js\" defer></script>'\n ),\n array(\n '/lib/modernizr/modernizr.dev-v2.8.3.js',\n 'text/javascript',\n true,\n 'UTF-8',\n '<script type=\"text/javascript\" src=\"/lib/modernizr/modernizr.dev-v2.8.3.js\" charset=\"UTF-8\" defer></script>'\n )\n );\n }", "public function getJavascripts()\n {\n return array('/sfGdataPlugin/js/youtube.js');\n }", "public static function getJavaScriptIncludes()\n\t{\n\t $jsFile = GlobalConstants::getJsFile ('dhmltooltip/wz_tooltip.js');\n\t $html = '<script type=\"text/javascript\" src=\"' .$jsFile .'\"></script>'; \n\t return $html;\n\t}", "public static function GetAllJs()\n {\n $script = CacheManager::Find(\"script.js\");\n\n if($script == null)\n {\n //List all Js in the Core\n $script = ScriptManager::GetAll();\n $script = ScriptManager::Minify($script);\n }\n\n return $script;\n }", "public function allJs()\n {\n return $this->js;\n }", "public function allJs()\n {\n return $this->js;\n }", "function js_pluginscripts(){\n $list = array();\n $plugins = plugin_list();\n foreach ($plugins as $p){\n $list[] = DOKU_PLUGIN.\"$p/script.js\";\n }\n return $list;\n}", "public function getAssets()\n {\n $files = $this->getApp()['asset.queue.file']->getQueue();\n $assets = [\n 'css' => [],\n 'js' => []\n ];\n\n foreach ($files['javascript'] as $file) {\n $assets['js'][] = $file->getFileName();\n }\n foreach ($files['stylesheet'] as $file) {\n $assets['css'][] = $file->getFileName();\n }\n\n return $assets;\n }", "public function getServerJsFiles ();", "public function js_scripts()\n {\n return [\n [\n 'id' => 'hbook-sharegroop',\n 'url' => plugin_dir_url(__FILE__) . 'js/sharegroop.js',\n 'version' => $this->version\n ],\n ];\n }", "public static function getIncludedFiles () {\n\t\treturn static::$files;\n\t}", "function JS ($files)\n{\n $links = \"\";\n foreach ($files as $file)\n $links .= \"<script type='text/javascript' src='$file'></script>\\n\";\n return $links;\n}", "public function includeScripts() {\n foreach ($this->js as $script) {\n echo \"<script src='\" . $script . \"' type='text/javascript'></script>\";\n }\n }", "function getFullPathsToAllWidgetJavascriptFiles ()\n\t{\n\t\t$allGalaxySites = getAllInstalledGalaxiesSites();\n\t\t\n\t\t$homeDir = HOME_DIR;\n\t\tif (defined('MAIN_HOME_DIR')) {\n\t\t\t$homeDir = MAIN_HOME_DIR;\n\t\t}\n\t\t\n\t\t$filePathTemplate = $homeDir . '%svar/widgets/js/widget.js';\n\t\t\t\n\t\t$paths = array();\n\t\t\n\t\t$paths[] = sprintf($filePathTemplate, '');\n\t\t\n\t\tforeach ($allGalaxySites as $galaxySite) {\n\t\t\t$paths[] = sprintf($filePathTemplate, 'microsites/' . $galaxySite->homeDirectory . '/');\n\t\t}\n\t\n\t\treturn $paths;\n\t}", "public static function getJs(){\n $str = \"\";\n ksort(self::$js);\n\n foreach (self::$js as $key => $val){\n $str.= \"<script src=\\\"$val\\\"></script>\\n\";\n unset(self::$js[$key]);\n }\n return $str;\n \n }", "function get_included_files()\n{\n return array();\n}", "private static function getJavaScriptFiles($design,$target = 'async') {\n $info = DesignService::getInfo($design);\n $files = [];\n if (isset($info) && isset($info->js)) {\n foreach ($info->js as $file) {\n $type = 'async';\n if (is_object($file)) {\n $type = isset($file->inline) && $file->inline === true ? 'inline' : 'async';\n $file = $file->file;\n }\n if ($type == $target) {\n $files[] = $file;\n }\n }\n }\n return $files;\n }", "public function getJavascripts()\n {\n return array(\n 'dmMediaUploadifyerPlugin.swfobject',\n 'dmMediaUploadifyerPlugin.uploadify',\n 'dmMediaUploadifyerPlugin.sfWidget'\n );\n }", "public function get_scripts()\n {\n return [\n 'amar-kaaz-admin-script' => [\n 'src' => AMAR_KAAZ_PUBLIC . '/js/app.js',\n 'version' => filemtime(AMAR_KAAZ_PATH . '/public/js/app.js'),\n 'deps' => ['jquery', 'wp-util'],\n 'in_footer' => true\n ]\n ];\n }", "protected function loadJavaScripts() {}", "function load_js_files() {\n\tglobal $load_compat_js_files;\n\tglobal $load_js_files;\n\n\tif ( !empty( $load_compat_js_files ) ) {\n\t\tforeach ( $load_compat_js_files as $index => $info ) {\n?>\n\t\t\t<!--[if <?php echo $info['cond']; ?>]><script language=\"javascript\" type=\"text/javascript\" src=\"<?php echo $info['file']; ?>\"></script><![endif]-->\n<?php\n\t\t}\n\t}\n\n\tif ( !empty( $load_js_files ) ) {\n\t\tforeach ( $load_js_files as $file ) {\n?>\n\t\t\t<script src=\"<?php echo $file; ?>\"></script>\n<?php\n\t\t} \n\t}\n}", "function include_js ($includes) {\n $config = get_config();\n $files = explode(',', preg_replace('/\\s+/', '', $includes));\n foreach($files as $file){\n $uri = $config['static_resource_url'].'js/'.auto_version($file, 'js/').'/'.$file;\n echo '<script type=\"text/javascript\" src=\"'.$uri.'\"></script>';\n }\n}", "public function getAssets()\n {\n return [\n 'js' => '/Resources/Public/JavaScript/generic/widget.js',\n ];\n }", "public function getAssets()\n {\n $css = $this->theme->getThemeInfoExtendAware('css');\n $js = $this->theme->getThemeInfoExtendAware('javascript');\n\n return [\n 'css' => $css,\n 'javascript' => $js,\n ];\n }", "private function setJSCalls()\n\t{\n\t\t$js = array(\n\t\t\t'JQUERY' => '<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-%s.min.js\"></script>'.LINE1,\n\t\t\t'JQUERY-MIGRATE' => '<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-migrate-1.2.1.min.js\"></script>'.LINE1,\n\t\t\t'JQUERY-MOBILE' => '<script src=\"http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js\"></script>'.LINE1,\n\t\t\t'JQUERY-GOOGLE' => '<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/%s/jquery.min.js\"></script>'.LINE1,\n\t\t\t'JQUERY-UI' => '<script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js\"></script>'.LINE1,\n\t\t\t'JQUERY-UI-SMOOTHNESS' => '<link rel=\"stylesheet\" type=\"text/css\" href=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/smoothness/jquery-ui.css\" />'.LINE1,\n\t\t\t'GOOGLE-API' => '<script src=\"http://www.google.com/jsapi\"></script>'.LINE1,\n\t\t\t'GOOGLE-ANALYTIC' => '<script>var _gaq=[[\"_setAccount\",\"UA-18780586-1\"],[\"_trackPageview\"]];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;g.src=(\"https:\"==location.protocol?\"//ssl\":\"//www\")+\".google-analytics.com/ga.js\";s.parentNode.insertBefore(g,s)}(document,\"script\"));</script>'.LINE1\n\t\t);\n\t\t\n\t\treturn $js;\n\t}", "public static function get_instance_javascript() {\n return array(\n \"theme/raw/static/script/highlight.pack.js\",\n \"theme/raw/static/script/codeplugin.js\",\n );\n }", "function get_all_scripts()\n{\n\tglobal $label_struct;\n\tphc_assert($label_struct !== null, \"label structure not yet initialized\");\n\n\t// returns an array of arrays\n\t$all_files = array_values($label_struct);\n\n\t// merge into a single array\n\t$result = array();\n\tforeach($all_files as $array)\n\t{\n\t\t$result = array_merge($result, $array);\n\t}\n\treturn $result;\n}", "function scripts()\r\n {\r\n $out = '';\r\n // If we have any js files in buffer then output them using minify\r\n if (count($this->jsFiles)) {\r\n $src = $this->_path($this->jsFiles, 'js');\r\n $out .= \"<script type='text/javascript' src='$src'></script>\";\r\n }\r\n \r\n // If we have any css files in buffer then output them using minify\r\n if (count($this->cssFiles)) {\r\n $src = $this->_path($this->cssFiles, 'css');\r\n $out .= \"<link type='text/css' rel='stylesheet' href='$src'/>\";\r\n }\r\n \r\n return $out;\r\n }", "public function getJavascriptPaths()\r\n {\r\n if (is_null($this->javascriptPaths)) {\r\n $this->javascriptPaths = [];\r\n if (!is_null($this->javascriptPath)) {\r\n $this->javascriptPaths[] = $this->getJavascriptPath();\r\n }\r\n foreach ($this->inheritedThemes as &$themeCode) {\r\n if ($theme = $this->designThemesManager->getTheme($themeCode)) {\r\n $this->javascriptPaths = array_merge($this->javascriptPaths, $theme->getJavascriptPaths());\r\n }\r\n }\r\n }\r\n return $this->javascriptPaths;\r\n }", "public function GetHtmlHeadIncludes()\n {\n $aIncludes = parent::GetHtmlHeadIncludes();\n $aIncludes[] = '<script src=\"'.TGlobal::GetStaticURLToWebLib('/javascript/jquery-ui-1.12.1.custom/jquery-ui.js').'\" type=\"text/javascript\"></script>';\n $aIncludes[] = '<script src=\"'.TGlobal::GetStaticURLToWebLib('/javascript/jquery/cookie/jquery.cookie.js').'\" type=\"text/javascript\"></script>';\n $aIncludes[] = '<script src=\"'.TGlobal::GetStaticURLToWebLib('/javascript/jquery/jsTree/jquery.jstree.js').'\" type=\"text/javascript\"></script>';\n\n return $aIncludes;\n }", "protected function setup_assets() {\n\t\t$base_url = $this->context->url( 'dist/assets/' );\n\n\t\treturn array(\n\t\t\tnew Script(\n\t\t\t\t'googlesitekit-modules-analytics-4',\n\t\t\t\tarray(\n\t\t\t\t\t'src' => $base_url . 'js/googlesitekit-modules-analytics-4.js',\n\t\t\t\t\t'dependencies' => array(\n\t\t\t\t\t\t'googlesitekit-vendor',\n\t\t\t\t\t\t'googlesitekit-api',\n\t\t\t\t\t\t'googlesitekit-data',\n\t\t\t\t\t\t'googlesitekit-modules',\n\t\t\t\t\t\t'googlesitekit-datastore-site',\n\t\t\t\t\t\t'googlesitekit-datastore-user',\n\t\t\t\t\t\t'googlesitekit-datastore-forms',\n\t\t\t\t\t\t'googlesitekit-components',\n\t\t\t\t\t\t'googlesitekit-modules-data',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}", "public function get_scripts( $js )\r\n\t\t{\r\n\t\t\t$html \t= \"\";\r\n\t\t\t\r\n\t\t\t$url = $this->site->url;\r\n\t\t\tglobal $alpha_switch;\r\n\t\t\tif ( $alpha_switch ) {\r\n\t\t\t\t$url = \"http://alpha.wnit.us/\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach( $js as $f )\r\n\t\t\t\t$html .= '<script type=\"text/javascript\" src=\"' . ( strpos( $f, 'http' ) === false ? $url . 'includes/js/' : '' ) . $f . \"\\\"></script>\\n\";\r\n\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "public function getJsInclude()\n\t{\n\t\t$sJsLibURI = $this->getJsLibURI();\n\t\t$sJsCoreUrl = $sJsLibURI . $this->_getScriptFilename('xajax.core.js');\n\t\t$sJsReadyUrl = $sJsLibURI . $this->_getScriptFilename('xajax.ready.js');\n\t\t$sJsDebugUrl = $sJsLibURI . $this->_getScriptFilename('xajax.debug.js');\n\t\t$sJsVerboseUrl = $sJsLibURI . $this->_getScriptFilename('xajax.verbose.js');\n\t\t$sJsLanguageUrl = $sJsLibURI . $this->_getScriptFilename('lang/xajax.' . $this->getOption('core.language') . '.js');\n\n\t\t// Add component files to the javascript file array;\n\t\t$aJsFiles = array($sJsCoreUrl, $sJsReadyUrl);\n\t\tif($this->getOption('core.debug.on'))\n\t\t{\n\t\t\t$this->aJsFiles[] = $sJsDebugUrl;\n\t\t\t$this->aJsFiles[] = $sJsLanguageUrl;\n\t\t\tif($this->getOption('core.debug.verbose'))\n\t\t\t{\n\t\t\t\t$this->aJsFiles[] = $sJsVerboseUrl;\n\t\t\t}\n\t\t}\n\n\t\t$code = $this->render('plugins/includes.js.tpl', array(\n\t\t\t'sJsOptions' => $this->getOption('core.js.options'),\n\t\t\t'aUrls' => $aJsFiles,\n\t\t));\n\t\tforeach($this->aResponsePlugins as $xPlugin)\n\t\t{\n\t\t\t$code .= rtrim($xPlugin->getJsInclude(), \" \\n\") . \"\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "function files_js($dir)\n{\n $js_files = [];\n $files = files_list($dir);\n foreach ($files as $f => $file) {\n if (stristr($f, '.js') !== false || stristr($f, '.json') !== false) {\n if (0 !== filesize($file)) {\n $js_files[$f] = $file;\n }\n }\n }\n\n return $js_files;\n}", "public static function getJavascript(){\n\t\treturn YAHOO_FILES .\n\t\t\twe_html_element::jsScript(JS_DIR . 'we_srcTmpl.js');\n\t}", "public function getAssets(): array\n\t{\n\t\treturn [\n\t\t\t'js' => Uri::root(true) . '/media/plg_system_debug/widgets/info/widget.min.js',\n\t\t\t'css' => Uri::root(true) . '/media/plg_system_debug/widgets/info/widget.min.css',\n\t\t];\n\t}", "public function get_all_js() {\n\t\t$this->js_module = $this->js_linked;\n\t\t$this->js_module .= $this->create_js($this->js);\n\t\t\n\t\t//assemble all javascript for the page in one block\n\t\treturn <<<EOD\n<!-- Common JS -->\n$this->js_common\n<!-- Page JS -->\n$this->js_page\n<!-- Module JS -->\n$this->js_module\nEOD;\n\t}", "public function getIncludedFiles()\n {\n return $this->includedFiles;\n }", "public static function getIncludedFiles()\n {\n $includedFiles = \\get_included_files();\n \\usort($includedFiles, function ($valA, $valB) {\n $dirA = \\dirname($valA);\n $dirB = \\dirname($valB);\n return $dirA == $dirB\n ? \\strnatcasecmp($valA, $valB)\n : \\strnatcasecmp($dirA, $dirB);\n });\n return $includedFiles;\n }", "function getScripts()\n {\n return null;\n }", "public static function getCompressedJs(){\n \n ksort(self::$js); \n if (conf::getMainIni('cached_assets')) {\n self::setJsAsSingleFile();\n }\n return self::getJs(); \n \n }", "public function getScripts() {\n return array_unique($this->scripts);\n }", "protected function _getFilesToInclude()\n {\n return $this->_aFilesToInclude;\n }", "function get_recommendations_js( $content ) {\n\n\n\t\t$files = Minify_Extract::extract_js( $content );\n\n\t\t$files = array_map( array( '\\W3TC\\Util_Environment', 'normalize_file_minify' ), $files );\n\t\t$files = array_unique( $files );\n\t\t$ignore_files = $this->_config->get_array( 'minify.reject.files.js' );\n $ignore_files = str_replace( \"~\", \"\\~\", $ignore_files );\n Util_Rule::array_trim( $ignore_files );\n if ( !empty( $ignore_files ) ) {\n $diff = array();\n foreach( $files as $file ) {\n if ( !@preg_match( '~' . implode( \"|\", $ignore_files ) . '~i', $file ) ) {\n $diff[] = $file;\n }\n }\n $files = $diff; \n }\n\t\treturn $files;\n\t}", "public function get_scripts() {\n\t\treturn $this->scripts;\n\t}", "public function scripts() {\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_editor_block_core',\n\t\t\t\t'src' => gf_gutenberg()->get_base_url() . '/js/blocks/core.min.js',\n\t\t\t\t'deps' => array( 'wp-blocks', 'wp-element' ),\n\t\t\t\t'version' => filemtime( gf_gutenberg()->get_base_path() . '/js/blocks/core.min.js' ),\n\t\t\t\t'callback' => array( $this, 'localize_script' ),\n\t\t\t),\n\t\t);\n\n\t}", "public function getJSResources()\r\n {\r\n return $this->jsResources;\r\n }", "public function js($files, $group = self::GROUP_DEFAULT)\r\n {\r\n return $this->_include((array)$files, 'js', $group);\r\n }", "public static function getScripts() {\n\t\treturn self::$_Configuration->_Script ?? [];\n\t}", "public function scripts() {\n\t\t$scripts = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'gravitychat_js',\n\t\t\t\t'src' => $this->get_base_url() . '/js/gravitychat.js',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'deps' => array( 'jquery' ),\n\t\t\t\t'strings' => array(\n\t\t\t\t\t'first' => esc_html__( 'First Choice', 'gravitychat' ),\n\t\t\t\t\t'second' => esc_html__( 'Second Choice', 'gravitychat' ),\n\t\t\t\t\t'third' => esc_html__( 'Third Choice', 'gravitychat' )\n\t\t\t\t),\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'form_settings' ),\n\t\t\t\t\t\t'tab' => 'gravitychat'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\n\t\t);\n\n\t\treturn array_merge( parent::scripts(), $scripts );\n\t}", "public function getJsPluginList(){\n return config(\"js_plugin_list\");\n }", "function _default_javascripts() {\n\t\t$CI =& get_instance();\n\t\treturn explode(\", \", $CI->config->item('OCU_javascript_default_collection'));\n\t}", "public function getStatic()\n\t{\n\t\t$aFiles = array();\n\t\tif ($hDir = @opendir(PHPFOX_DIR_FILE . 'static' . PHPFOX_DS))\n\t\t{\n\t\t\twhile ($sFile = readdir($hDir))\n\t\t\t{\n\t\t\t\tif (!preg_match(\"/(.*)\\.(js|css)/i\", $sFile))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$aFiles[] = array(\n\t\t\t\t\t'id' => md5($sFile),\n\t\t\t\t\t'name' => $sFile,\n\t\t\t\t\t'size' => filesize(PHPFOX_DIR_FILE . 'static' . PHPFOX_DS . $sFile),\n\t\t\t\t\t'date' => filemtime((PHPFOX_DIR_FILE . 'static' . PHPFOX_DS . $sFile)),\n\t\t\t\t\t'type' => 'Static'\n\t\t\t\t);\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $aFiles;\n\t}", "protected function getScripts()\n {\n return implode( \"\\n\", array(\n '<script type=\"text/javascript\" src=\"lib/plugins/emoticons.js\"></script>',\n ) );\n }", "protected function addJS() {\n\t\t$jsFiles = $this->utilityFuncs->parseResourceFiles($this->settings, 'jsFile');\n\t\tforeach ($jsFiles as $idx => $fileOptions) {\n\t\t\t$file = $fileOptions['file'];\n\t\t\tif(strlen(trim($file)) > 0) {\n\t\t\t\t$file = $this->utilityFuncs->resolveRelPathFromSiteRoot($file);\n\t\t\t\t$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();\n\t\t\t\t$pageRenderer->addJsFile(\n\t\t\t\t\t$file,\n\t\t\t\t\t$fileOptions['type'] ? $fileOptions['type'] : 'text/javascript',\n\t\t\t\t\tempty($fileOptions['disableCompression']),\n\t\t\t\t\t$fileOptions['forceOnTop'] ? TRUE : FALSE,\n\t\t\t\t\t$fileOptions['allWrap'],\n\t\t\t\t\t$fileOptions['excludeFromConcatenation'] ? TRUE : FALSE\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function getJsPaths() {\n\t\treturn $this->jsPaths;\n\t}", "public function getJsPaths() {\n\t\treturn $this->jsPaths;\n\t}", "function loadJS($array=null)\n\t\t{\t\t\t\n\t\t\t$js=array();\n\t\t\tif($array!=null)\n\t\t\t{\n\t\t\t\t if(is_array($array))\n\t\t\t\t {\n\t\t\t\t \tforeach ($array as $key => $value) {\n\t\t\t\t \t\t$this->js[]='<script type=\"text/javascript\" src=\"'.$value.'\"></script>';\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t \t$this->js[]='<script type=\"text/javascript\" src=\"'.$array.'\"></script>';\n\t\t\t\t }\n\t\t\t}\n\t\t\t$js=implode('',$this->js);\n\t\t\treturn $js;\n\t\t}" ]
[ "0.81909406", "0.81800234", "0.7958401", "0.7755227", "0.7748164", "0.76889783", "0.76369125", "0.7629908", "0.76268405", "0.74796075", "0.746081", "0.74017245", "0.7401433", "0.7329919", "0.7312153", "0.7264653", "0.72123456", "0.7189407", "0.7188031", "0.7118735", "0.71166563", "0.71085924", "0.7075673", "0.70640475", "0.7062388", "0.70522887", "0.7033048", "0.70128185", "0.70100975", "0.6999562", "0.6988439", "0.6969297", "0.6962605", "0.695186", "0.69426376", "0.69259226", "0.6905408", "0.69025123", "0.68905735", "0.68673503", "0.6857453", "0.6810768", "0.6772827", "0.6755483", "0.6749831", "0.6746797", "0.67370206", "0.67370206", "0.6708972", "0.6688949", "0.6680429", "0.6676696", "0.66679937", "0.66623026", "0.66549647", "0.66306037", "0.66228306", "0.6597587", "0.65953887", "0.65828705", "0.65725386", "0.6567256", "0.6556886", "0.6531513", "0.65272105", "0.65136385", "0.6501506", "0.6489371", "0.648531", "0.6474688", "0.6459522", "0.6446787", "0.6433996", "0.64328814", "0.64319813", "0.64318204", "0.6421542", "0.64166737", "0.639846", "0.63977", "0.63944757", "0.6371331", "0.6369042", "0.6364271", "0.6360176", "0.6355065", "0.6354431", "0.6339469", "0.6327077", "0.6321205", "0.6317813", "0.63158774", "0.6308627", "0.6299723", "0.62942433", "0.62937176", "0.6292159", "0.62920856", "0.62920856", "0.62775236" ]
0.82788193
0
Returns an array of CSS files to be included for this library.
Возвращает массив CSS-файлов, которые должны быть включены для этой библиотеки.
public function getCssFiles(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCssFiles(): array\n {\n return array();\n }", "function grabAllCssFiles()\n\t{\n\t\t$cssFiles = $this->includes_css;\n\t\t$this->includes_css = array();\n\t\treturn $cssFiles;\n\t}", "function grabAllCSSFiles()\n\t{\n\t\t$cssFiles = $this->includes_css;\n\t\t$this->includes_css = array();\n\t\treturn $cssFiles;\n\t}", "public static function getCssFiles()\n {\n return self::$cssFiles;\n }", "protected function getOwnCSSFilesList()\r\n {\r\n if (is_null($this->cssFiles)) {\r\n $this->cssFiles = [];\r\n if (is_dir($this->cssPath)) {\r\n $directoryContents = scandir($this->cssPath);\r\n foreach ($directoryContents as &$contentFile) {\r\n $extension = strtolower(pathinfo($contentFile, PATHINFO_EXTENSION));\r\n if ($extension == 'css' || $extension == 'less') {\r\n $this->cssFiles[] = $contentFile;\r\n }\r\n }\r\n }\r\n\r\n if (!is_null($this->extraFolder)) {\r\n $extraFolderCssPath = $this->cssPath . $this->extraFolder . \"/\";\r\n if (is_dir($extraFolderCssPath)) {\r\n $directoryContents = scandir($extraFolderCssPath);\r\n foreach ($directoryContents as &$contentFile) {\r\n $extension = strtolower(pathinfo($contentFile, PATHINFO_EXTENSION));\r\n if ($extension == 'css' || $extension == 'less') {\r\n $this->cssFiles[] = $this->extraFolder . '/' . $contentFile;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $this->cssFiles;\r\n }", "public static function get_css() {\n return [];\n }", "public function getStylesheets()\n {\n return array($this->getOption('uploadify_css'));\n }", "public function getCssFiles()\n {\n return $this->_cssFiles;\n }", "public function getCssFiles() {\n return $this->cssFiles;\n }", "public function getCSSFiles()\n {\n $list = parent::getCSSFiles();\n\n $list[] = 'modules/ProaxIT/RequestPriceQuote/request_price_quote/css/style.css';\n\n return $list;\n }", "public function getCssFiles()\n {\n $html = '';\n\n foreach ($this->cssFiles as $file) {\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . Application::getBaseUrl(Environment::URL_TYPE_CSS) . '/' . $file . '\">';\n }\n\n return $html;\n }", "public function getCssPaths() : array {}", "public function getStylesheets()\n {\n return array(\n $this->getOption('swfupload_css_path') => 'all'\n );\n }", "final private function getCssIncludes() {\n\t\t$css_include_tags = [];\n\t\tforeach ($this->css_includes as $source) {\n\t\t\t$css_include_tags[] = \"<link rel='stylesheet' href='\".$source.\"'>\";\n\t\t}\n\t\treturn implode($css_include_tags);\n\t}", "function return_css_files()\r\n {\r\n $css_string = \"\";\r\n\r\n if ($this->UI_css_files)\r\n\r\n {\r\n foreach ($this->UI_css_files as $style)\r\n {\r\n $css_string .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"misc/'.$style.'\"/>';\r\n }\r\n }\r\n\r\n return $css_string;\r\n }", "public function getCSSScripts() {\n return $this->cssFiles;\n }", "function getCssPaths() ;", "public function cssIncludes() {\n $files = array_merge(Config::get($this->package_prefix.'bones.css_urls'), $this->css_urls);\n\n $html = '';\n foreach ($files as $file)\n $html .= '<link type=\"text/css\" rel=\"stylesheet\" href=\"'.$file.'\" />'.PHP_EOL;\n\n return $html;\n }", "private function getAdditionalCssFiles(): string\n {\n $code = \"\";\n foreach ($this->getCssFiles() as $file) {\n $code .= sprintf('<link type=\"text/css\" rel=\"stylesheet\" href=\"%s\"/>', $file) . \"\\n\";\n }\n return $code;\n }", "public function stylesheets() : array {\n\t \n\t $sDefaultPath = 'http://'.$_SERVER['HTTP_HOST'].'/getCss?';\n\t $aCss = func_get_args();\n\t $aReturns = array();\n\t \n\t foreach($aCss as $aCssCombination) {\n\t \n\t $sCssPath = $sDefaultPath;\n\t \n\t foreach ($aCssCombination as $sCssToAdd) {\n\t \n\t $sCssPath = $sCssToAdd.'&';\n\t }\n\t \n \t if (defined('ASSET_VERSION') && ASSET_VERSION) {\n\n $sCssPath = ASSET_VERSION;\n \t }\n\t \n\t $aReturns[] = $sCssPath;\n\t }\n\t \n\t return $aReturns;\n\t}", "public function get_stylesheets() {\n\t\treturn wp_list_pluck(\n\t\t\tarray_filter(\n\t\t\t\t$this->pending_stylesheets,\n\t\t\t\tstatic function( $pending_stylesheet ) {\n\t\t\t\t\treturn $pending_stylesheet['included'] && self::STYLE_AMP_CUSTOM_GROUP_INDEX === $pending_stylesheet['group'];\n\t\t\t\t}\n\t\t\t),\n\t\t\t'serialized'\n\t\t);\n\t}", "public function getCssResources()\r\n {\r\n if (is_null($this->cssResources)) {\r\n $this->cssResources = [];\r\n $this->loadCssResources();\r\n }\r\n return $this->cssResources;\r\n }", "public function stylesheets(): array\n {\n return $this->stylesheets;\n }", "public function getCss(): array\n {\n return $this->css;\n }", "public function getCssLinks() {\n\t\t\t$config = $this->config->get ( 'themecontrol' );\n\t\t\t$compress = $config ['enable_compress_css'];\n\t\t\t\n\t\t\t/**\n\t\t\t * ENABLE COMPRESSION MODE *\n\t\t\t */\n\t\t\tif (trim ( $compress ) && $this->_themeDir && is_dir ( $this->_themeDir )) {\n\t\t\t\t$excludes = explode ( \",\", $config ['exclude_css_files'] );\n\t\t\t\t$output = array ();\n\t\t\t\t\n\t\t\t\t$pcache = new PavCache ();\n\t\t\t\t\n\t\t\t\tif (isset ( $_SERVER ['HTTPS'] ) && (($_SERVER ['HTTPS'] == 'on') || ($_SERVER ['HTTPS'] == '1'))) {\n\t\t\t\t\t$siteURL = HTTPS_SERVER;\n\t\t\t\t} else {\n\t\t\t\t\t$siteURL = HTTP_SERVER;\n\t\t\t\t}\n\t\t\t\t$pcache->setExtension ( 'css' );\n\t\t\t\tif ($compress == 'compress-merge') {\n\t\t\t\t\t$all = '';\n\t\t\t\t\t$aKey = md5 ( serialize ( $this->_cssFiles ) . serialize ( $excludes ) . $siteURL );\n\t\t\t\t\t\n\t\t\t\t\tif (! $pcache->isExisted ( ($aKey) )) {\n\t\t\t\t\t\tforeach ( $this->_cssFiles as $key => $file ) {\n\t\t\t\t\t\t\t$css = preg_match ( \"#^http#\", $file ['href'] ) ? $file ['href'] : $siteURL . $file ['href'];\n\t\t\t\t\t\t\t$t = explode ( \"/\", ($css) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! in_array ( $t [count ( $t ) - 1], $excludes )) {\n\t\t\t\t\t\t\t\t$content = file_get_contents ( $css );\n\t\t\t\t\t\t\t\tif (! empty ( $content )) {\n\t\t\t\t\t\t\t\t\t$content = PavoCompressHelper::process ( $content, $css );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$all .= $content;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pcache->set ( ($aKey), $all );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$_cssFiles = array ();\n\t\t\t\t\tif ($excludes) {\n\t\t\t\t\t\tforeach ( $this->_cssFiles as $key => $file ) {\n\t\t\t\t\t\t\t$css = $file ['href'];\n\t\t\t\t\t\t\t$t = explode ( \"/\", ($css) );\n\t\t\t\t\t\t\tif (in_array ( $t [count ( $t ) - 1], $excludes )) {\n\t\t\t\t\t\t\t\t$_cssFiles [$key] = $file;\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\t$_cssFiles [$aKey] = array (\n\t\t\t\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t\t\t\t'href' => PAV_SUB_PATH . ($aKey) . \".css\",\n\t\t\t\t\t\t\t'media' => '' \n\t\t\t\t\t);\n\t\t\t\t\t$this->_cssFiles = $_cssFiles;\n\t\t\t\t\t$output = $this->_cssFiles;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $this->_cssFiles as $key => $file ) {\n\t\t\t\t\t\t$css = preg_match ( \"#^http#\", $file ['href'] ) ? $file ['href'] : $siteURL . $file ['href'];\n\t\t\t\t\t\t$t = explode ( \"/\", ($css) );\n\t\t\t\t\t\tif (! in_array ( $t [count ( $t ) - 1], $excludes )) {\n\t\t\t\t\t\t\t$content = file_get_contents ( $css );\n\t\t\t\t\t\t\tif (! empty ( $content )) {\n\t\t\t\t\t\t\t\tif (! $pcache->isExisted ( md5 ( $key ) )) {\n\t\t\t\t\t\t\t\t\t$content = PavoCompressHelper::process ( $content, $css );\n\t\t\t\t\t\t\t\t\t$pcache->set ( md5 ( $key ), $content );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_cssFiles [$key] ['href'] = PAV_SUB_PATH . md5 ( $key ) . \".css\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tunset ( $this->_cssFiles [$key] );\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\t$output = $this->_cssFiles;\n\t\t\t\t}\n\t\t\t\treturn $output;\n\t\t\t}\n\t\t\treturn $this->_cssFiles;\n\t\t}", "public function getStylesheets()\r\n {\r\n return array('/fzTagPlugin/css/style.css' => 'all');\r\n }", "public static function getStylesheets() {\n\t\treturn self::$_Configuration->_Stylesheet ?? [];\n\t}", "public function getThemeCustomizableStyleSheets()\n {\n $sheets = [];\n $env = Environment::get();\n if ($this->isThemeCustomizable()) {\n $directory = $env->getPath(\n DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,\n $this->getPackageHandle()\n );\n $dh = Loader::helper('file');\n $files = $dh->getDirectoryContents($directory);\n foreach ($files as $f) {\n if (strrchr($f, '.') == '.less') {\n $sheets[] = $this->getStylesheetObject($f);\n }\n }\n }\n\n return $sheets;\n }", "public function getCSSResources()\r\n {\r\n return $this->cssResources;\r\n }", "public function allCss()\n {\n return $this->css;\n }", "public function getCss()\n {\n $css = $this->css;\n $options = $this->options;\n if($this->isCombineEnabled())\n $this->combine('css', $css);\n\n // avoiding duplicate assets\n $css = array_flip(array_flip($css));\n\n array_walk($css, function(&$value) use($options){\n if(!empty($options['baseUrl'])&&strpos($value,'http://')===false)\n $value = $options['baseUrl'].$value;\n });\n return $css;\n }", "public function getStylesheets() {\n return array_unique($this->stylesheets);\n }", "public function addCssFiles() {}", "public function getCssPaths() {\n\t\treturn $this->cssPaths;\n\t}", "public function getCssPaths() {\n\t\treturn $this->cssPaths;\n\t}", "private function findCssFiles($dom) {\n $cssFiles = array();\n $linkTags = $dom->find('link[rel=stylesheet]');\n\n foreach ($linkTags as $tag) {\n // check if rel is stylesheet (and not e.g. canonical)\n if($this->starts_with($tag->rel,\"stylesheet\")) {\n //echo \"stylesheet found<br>\";\n //echo $tag->href.\"<br>\";\n $cssUrl = $tag->href;\n\n // make absolute url of hrefs starting with //\n if($this->starts_with($cssUrl,\"//\")){\n $cssUrl = \"http:\" . $cssUrl;\n }\n // add site url to relative files\n else if (!$this->starts_with($cssUrl,\"http\")) {\n $cssUrl = $this->page_url.\"/\".ltrim($cssUrl,'/');\n }\n\n // add to list of files\n if(!in_array($cssUrl, $cssFiles)) {\n $cssFiles[] = $cssUrl;\n }\n }\n }\n return $cssFiles;\n }", "public function getAssets()\n {\n $files = $this->getApp()['asset.queue.file']->getQueue();\n $assets = [\n 'css' => [],\n 'js' => []\n ];\n\n foreach ($files['javascript'] as $file) {\n $assets['js'][] = $file->getFileName();\n }\n foreach ($files['stylesheet'] as $file) {\n $assets['css'][] = $file->getFileName();\n }\n\n return $assets;\n }", "public function getCSSAsElements() {\n $cos = Citrus::getInstance();\n \n $cssFiles = '';\n $sheets = array();\n if ( $this->styleSheets ) {\n foreach ( $this->styleSheets as $s ) {\n $media = substr( $s, 0, 1 ) == '@' ? 'print' : 'screen';\n if ( $media == 'print' ) $s = substr( $s, 1 );\n\n $is_absolute = substr( $s, 0, 1 ) == \"/\";\n $is_remote = substr( $s, 0, 4 ) == \"http\";\n\n if ( $is_absolute || $is_remote ) $href = $s;\n else $href = $this->static_path . \"css/$s\";\n\n $rel_less = strpos( $s, '.less' ) !== false ? '/less' : '';\n\n $st = new Element( 'link', array(\n 'attributes' => array(\n 'rel' => 'stylesheet' . $rel_less,\n 'media' => $media,\n 'type' => 'text/css',\n 'href' => $href,\n ), \n 'inline' => true,\n 'closeTag' => false,\n ) );\n $sheets[] = $st;\n }\n }\n if ( count( $this->addedStyleSheets ) ) {\n foreach ( $this->addedStyleSheets as $s ) {\n $media = substr( $s, 0, 1 ) == '@' ? 'print' : 'screen';\n if ( $media == 'print' ) $s = substr( $s, 1 );\n if ( substr( $s, 0, 4 ) == \"http\" ) $href = $s; \n elseif ( substr( $s, 0, 1 ) === '/' ) $href = $s;\n else $href = CITRUS_PROJECT_URL . \"css/$s\";\n $rel_less = strpos( $s, '.less' ) !== false ? '/less' : '';\n $st = new Element( 'link', array(\n 'attributes' => array(\n 'rel' => 'stylesheet' . $rel_less,\n 'media' => $media,\n 'type' => 'text/css',\n 'href' => $href,\n ), \n 'inline' => true,\n 'closeTag' => false\n ) ); \n $sheets[] = $st; \n }\n }\n \n if ( $cos->app && $cos->app->controller ) {\n $src = 'css/' . $cos->app->name . '/modules/' . $cos->app->controller->name . '.css' ;\n if (is_file(CITRUS_WWW_PATH . $src)) {\n $rel_less = strpos( $s, '.less' ) !== false ? '/less' : '';\n $st = new Element( 'link', array(\n 'attributes' => array(\n 'rel' => 'stylesheet' . $rel_less,\n 'media' => $media,\n 'type' => 'text/css',\n 'href' => CITRUS_PROJECT_URL . $src,\n ), \n 'inline' => true,\n 'closeTag' => false\n ) );\n $sheets[] = $st; \n }\n }\n \n return $sheets;\n }", "protected function loadCssResources()\r\n {\r\n $inheritedThemes = array_reverse($this->inheritedThemes);\r\n foreach ($inheritedThemes as &$themeCode) {\r\n if ($theme = $this->designThemesManager->getTheme($themeCode)) {\r\n if (!is_null($this->extraFolder)) {\r\n $theme->setExtraFolder($this->extraFolder);\r\n }\r\n $this->cssResources = array_merge($this->cssResources, $theme->getCssResources());\r\n foreach ($this->cssResources as &$resourceInfo) {\r\n $this->cssResourcesIdIndex[$resourceInfo['id']] = true;\r\n }\r\n }\r\n }\r\n\r\n $filesList = $this->getOwnCSSFilesList();\r\n $imagesPath = $this->getImagesPath();\r\n $imagesUrl = $this->getImagesUrl();\r\n $fontsUrl = $this->getFontsUrl();\r\n $imagesFolder = $this->getImagesFolder();\r\n $fontsFolder = $this->getFontsFolder();\r\n foreach ($filesList as &$file) {\r\n $info = [\r\n 'filePath' => $this->cssPath,\r\n 'fileName' => $file,\r\n 'imagesPath' => $imagesPath,\r\n 'imagesUrl' => $imagesUrl,\r\n 'fontsUrl' => $fontsUrl,\r\n 'imagesFolder' => $imagesFolder,\r\n 'fontFolder' => $fontsFolder,\r\n 'id' => md5($this->cssPath . $file . $imagesFolder),\r\n ];\r\n if (!isset($this->cssResourcesIdIndex[$info['id']])) {\r\n $this->cssResourcesIdIndex[$info['id']] = true;\r\n $this->cssResources[] = $info;\r\n }\r\n }\r\n }", "public function findCssFiles($dom) {\n $cssFiles = array();\n $linkTags = $dom->find('link[rel=stylesheet]');\n\n foreach ($linkTags as $tag) {\n // check if rel is stylesheet (and not e.g. canonical)\n if($this->starts_with($tag->rel,\"stylesheet\")) {\n echo \"stylesheet found<br>\";\n echo $tag->href.\"<br>\";\n $cssUrl = $tag->href;\n\n // make absolute url of hrefs starting with //\n if($this->starts_with($cssUrl,\"//\")){\n $cssUrl = \"http:\" . $cssUrl;\n }\n // add site url to relative files\n else if (!$this->starts_with($cssUrl,\"http\")) {\n $cssUrl = URL.\"/\".ltrim($cssUrl,'/');\n }\n\n // add to list of files\n if(!in_array($cssUrl, $cssFiles)) {\n $cssFiles[] = $cssUrl;\n }\n }\n }\n return $cssFiles;\n }", "public function getCss(): Collection\n {\n return $this->checkAndCreateCollection('css');\n }", "public function getStylesheets()\n {\n return array('/sfGdataPlugin/css/youtube.css' => 'all');\n }", "public function resources() {\n\t\treturn $this->initRes ? array(\n\t\t\t'vimeo/main.css' => new CSSFile(),\n\t\t) : array();\n\t}", "public function getCssIncludePath();", "protected function getStylesheets()\n {\n $stylesheets = array();\n foreach ($this->_widgets as $widget) {\n foreach ($widget->getStylesheets() as $stylesheet) {\n $stylesheets[] = $stylesheet;\n }\n }\n return $stylesheets;\n }", "function load_css_files() {\n\tglobal $load_css_files;\n\n\tif ( !empty( $load_css_files ) ) {\n\t\tforeach ( $load_css_files as $file ) {\n?>\n\t\t\t<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"<?php echo $file; ?>\" />\n<?php\n\t\t}\n\t}\n}", "public function load_all_css_files() {\n $path = APP_ROOT.'/css';\n $dir = opendir($path);\n\n while (($file = readdir($dir)) !== false) {\n if (is_dir(APP_ROOT.'/css/'.$file) && $file != '.' && $file != '..') {\n $d = opendir(APP_ROOT.'/css/'.$file);\n while (($f = readdir($d)) !== false) {\n if (!is_dir(APP_ROOT.'/css/'.$file.'/'.$f) && $f != '.' && $f != '..' && strstr($f, '.css')) {\n echo '<link rel=\"stylesheet\" href=\"http://'.SERVER_NAME.APP_DIR.'/css/'.$file.'/'.$f.'\" type=\"text/css\" />'.\"\\n\";\n }\n }\n closedir($d);\n }\n }\n closedir($dir);\n }", "public function getStylesheetUrls(): Collection\n {\n // TODO: Implement getStylesheetUrls() method.\n return collect();\n }", "public function compile(): array {\n $css = [];\n $js = [];\n\n $assets = Util::determineOrder(array_map(static function(string $key, array $value) {\n return [\n 'name' => $key,\n 'after' => $value['depends'] ?? $value['after'] ?? [],\n 'before' => $value['before'] ?? [],\n ];\n }, array_keys($this->_assets), array_values($this->_assets)));\n\n foreach ($assets as $name) {\n $this->gatherAsset($name, $this->_assets[$name], $css, $js);\n }\n\n return [$css, $js];\n }", "function smd_ebook_get_stylesheets()\n{\n global $smd_ebook_prefs;\n\n $css = get_pref('smd_ebook_stylesheet', $smd_ebook_prefs['smd_ebook_stylesheet']['default']);\n $sheets = array();\n\n if ($css) {\n $css_list = do_list($css);\n\n foreach ($css_list as $sheetref) {\n $css_parts = do_list($sheetref, '.');\n $cskin = doSlash($css_parts[0]);\n $cname = doSlash($css_parts[1]);\n $sheets[] = safe_row('name, css', 'txp_css', \"name = '$cname' AND skin = '$cskin'\");\n }\n }\n\n $sheets = array_filter($sheets);\n\n return $sheets;\n}", "public function getStylesheets()\n {\n $theme = $this->getOption('theme');\n return array($theme => 'screen');\n }", "function render_css()\n {\n $out = array();\n $mediums = array_keys($this->css);\n foreach($mediums as $medium) {\n foreach($this->css[$medium] as $path) {\n $out[] = sprintf('<link href=\"%s\" type=\"text/css\" media=\"%s\" rel=\"stylesheet\" />',$path,$medium);\n }\n }\n return $out;\n }", "public function css()\r\n {\r\n $html = '';\r\n foreach (glob('css/*.css') as $file) {\r\n $html .= '<link href=\"' . $file . '\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />';\r\n }\r\n \r\n return $html;\r\n }", "function CSS ($files)\n{\n $links = \"\";\n foreach ($files as $file)\n $links .= \"<link href='$file' type='text/css' rel='stylesheet'>\\n\";\n return $links;\n}", "public function get_styles(){\n return [\n 'plugin-dev-style' => [\n 'src' => P_DEV_ASSETS . '/css/frontend.css',\n 'version' => filemtime(P_DEV_PATH . '/assets/css/frontend.css')\n ],\n 'plugin-dev-admin-style' => [\n 'src' => P_DEV_ASSETS . '/css/admin.css',\n 'version' => filemtime(P_DEV_PATH . '/assets/css/admin.css')\n ],\n 'plugin-dev-enquiry-style' => [\n 'src' => P_DEV_ASSETS . '/css/enquiry.css',\n 'version' => filemtime(P_DEV_PATH . '/assets/css/enquiry.css')\n ]\n ];\n }", "public function getCSSRequirements() {\n\t\treturn array(\n\t\t\t'flowchart/css/jsPlumb.css',\n\t\t\t'flowchart/css/flowchart.css'\n\t\t);\n\t}", "public function getDesigns() {\n $this->debug->append(\"STA \" . __METHOD__, 4);\n $aTmpDesigns = glob(BASEPATH . 'site_assets/' . THEME . '/css/design/*.css');\n $aDesigns = array();\n $aDesigns['default'] = 'default';\n foreach ($aTmpDesigns as $filename) {\n if (basename($filename) != '.' && basename($filename) != '..') $aDesigns[basename($filename, \".css\")] = basename($filename, \".css\");\n }\n return $aDesigns;\n }", "public function css()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function css_includes()\n {\n }", "public function getStyleSheets()\n {\n return isset($this->links[\"stylesheet\"])?$this->links[\"stylesheet\"]:[];\n }", "public static function getCss(){\n \n $str = \"\";\n ksort(self::$css);\n foreach (self::$css as $key => $val){\n $str.= \"<link rel=\\\"stylesheet\\\" href=\\\"$val\\\" />\\n\";\n unset(self::$css[$key]);\n }\n return $str;\n \n }", "function get_assets() {\n\t$assets = array();\n\t$asset_regex = '/^.+(\\.jpe?g|\\.png|\\.gif|\\.css|\\.ico|\\.js|\\.woff|\\.ttf|\\.svg|\\.json)$/i';\n\t$dirs = [ ABSPATH . WPINC ];\n\tforeach ( wp_get_themes() as $theme ) {\n\t $dirs[] = $theme->get_stylesheet_directory();\n\t}\n\t$dirs = apply_filters( 'static_page_assets_dirs', $dirs );\n\n\tforeach ( $dirs as $dir ) {\n\t\t$directory = new RecursiveDirectoryIterator( $dir );\n\t\t$iterator = new RecursiveIteratorIterator( $directory );\n\t\t$regex = new RegexIterator( $iterator, $asset_regex, RecursiveRegexIterator::GET_MATCH );\n\n\t\tforeach ( $regex as $filename => $r ) {\n\t\t\t$assets[] = $filename;\n\t\t}\n\t}\n\n\treturn apply_filters( 'static_page_assets', $assets );\n}", "public function configAction()\n {\n $styles = array_map(function ($fn) {\n return basename($fn, '.css');\n }, glob(App::locator()->get('highlight:assets/styles').'/*.css'));\n\n return compact('styles');\n }", "public function getStyleSheets()\n {\n return $this->styleSheets;\n }", "public function getCssLinks() {\n\t\tforeach ($this->cssLinks as $media => $links) {\n\t\t\t$this->cssLinks[$media] = array_unique($links);\n\t\t}\n\t\treturn $this->cssLinks;\n\t}", "public static function getLinksCss(): array\n\t{\n\t\treturn self::$linksCss;\n\t}", "public function getAssets()\n {\n $css = $this->theme->getThemeInfoExtendAware('css');\n $js = $this->theme->getThemeInfoExtendAware('javascript');\n\n return [\n 'css' => $css,\n 'javascript' => $js,\n ];\n }", "public function get_styles()\n {\n return [\n 'amar-kaaz-admin-style' => [\n 'src' => AMAR_KAAZ_PUBLIC . '/css/app.css',\n 'version' => filemtime(AMAR_KAAZ_PATH . '/public/css/app.css')\n ]\n ];\n }", "public function get_css_rules()\n {\n static $collector = array();\n\n if (empty($collector)) {\n foreach ($this->sections as $section) {\n foreach ($section['options'] as $option_id => $option_data) {\n if ( ! empty( $option_data['style'] ) ) {\n $collector[$option_id]['style'] = $option_data['style'];\n }\n\n if ( ! isset( $option_data['dom'] ) && isset( $option_data['setting']['default'] ) ) {\n $collector[$option_id]['default'] = $option_data['setting']['default'];\n }\n }\n }\n }\n\n return $collector;\n }", "public function styles() {\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle'\t=> 'styles_css',\n\t\t\t\t'src'\t\t => $this->get_base_url() . '/css/styles.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray( 'field_types' => array( 'select', 'radio', 'checkbox', 'html' ) )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\t}", "public function css()\n {\n $return = array();\n\n $shouldLoadCustomStyle = (bool)config('laravel-adminer.manager.style');\n\n if ($shouldLoadCustomStyle && file_exists(public_path(config('laravel-adminer.manager.style')))) {\n $return[] = \"/\" . config('laravel-adminer.manager.style') . \"?v=\" . crc32(file_get_contents(public_path(config('laravel-adminer.manager.style'))));\n }\n\n return $return;\n }", "public function getJsFiles()\n {\n $html = '';\n\n foreach ($this->jsFiles as $file) {\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . Application::getBaseUrl(Environment::URL_TYPE_JS) . '/' . $file . '\">';\n }\n\n return $html;\n }", "function LoadJS_CSS()\n\t{\n\t\t$this->includes_js = array_unique($this->includes_js);\n\t\t$this->includes_css = array_unique($this->includes_css);\n\t\t$out = \"\";\n\t\tforeach($this->includes_js as $file)\n\t\t{\n\t\t\t$out .= \"Runner.util.ScriptLoader.addJS(['\".$file.\"']\";\n\t\t\tif(array_key_exists($file,$this->includes_jsreq))\n\t\t\t{\n\t\t\t\tforeach($this->includes_jsreq[$file] as $req)\n\t\t\t\t\t$out.=\",'\".$req.\"'\";\n\t\t\t}\n\t\t\t$out.=\");\\r\\n\";\n\t\t}\n\t\t$out.= \" Runner.util.ScriptLoader.load();\";\n\t\treturn $out;\n\t}", "protected function getAssets() {\n $images = $this->findAttributes($this->findTag(\"img\"), \"src\");\n $js = $this->findAttributes($this->findTag(\"script\"), \"src\");\n $stylesheet = $this->findAttributes($this->findTag(\"link\"), \"href\");\n return array_merge($images, $js, $stylesheet);\n }", "public function get_styles() {\n\t\treturn [];\n\t}", "public function getEditmodeCssPaths() : array {}", "public function css($files, $group = self::GROUP_DEFAULT)\r\n {\r\n return $this->_include((array)$files, 'css', $group);\r\n }", "protected function includes() : array\n {\n return ['themes'];\n }", "public function get_css() {\n\t}", "public function get_css_common() {\n\t}", "public static function styles()\n {\n return [];\n }", "public function get_all_css() {\n\t\t$this->css_module = $this->css_linked;\n\t\t$this->css_module .= $this->create_css($this->css);\n\t\t\n\t\t//assemble all css stles for the page in one block\n\t\treturn <<<EOD\n<!-- Common CSS -->\n$this->css_common\n<!-- Page CSS -->\n$this->css_page\n<!-- Module CSS -->\n$this->css_module\nEOD;\n\t}", "function get_recommendations_css( $content ) {\n\t\t$tag_files = Minify_Extract::extract_css( $content );\n\t\t$files = array();\n\t\tforeach ( $tag_files as $tag_file )\n\t\t\t$files[] = $tag_file[1];\n\n\t\t$files = array_map( array( '\\W3TC\\Util_Environment', 'normalize_file_minify' ), $files );\n\t\t$files = array_unique( $files );\n\t\t$ignore_files = $this->_config->get_array( 'minify.reject.files.css' );\n $ignore_files = str_replace( \"~\", \"\\~\", $ignore_files );\n Util_Rule::array_trim( $ignore_files );\n\n if ( !empty( $ignore_files ) ) {\n $diff = array();\n foreach( $files as $file ) {\n if ( !@preg_match( '~' . implode( \"|\", $ignore_files ) . '~i', $file ) ) {\n $diff[] = $file;\n }\n }\n $files = $diff; \n }\n\n\t\treturn $files;\n\t}", "function csslist($template_id = NULL){\r\n\t\t$css_files = $this->Files->php4_scandir(WWW_ROOT.DS.\"css/\");\r\n\t\t$this->set('fileslist', $css_files);\r\n\t\t$this->render('filelist');\r\n\t}", "function shl_get_themes()\n{\n\tglobal $cfg, $theme;\n\t$prefix = 'shCore';\n\t$themes = array();\n\t$files_def = glob($cfg['plugins_dir'] . '/syntaxhighlighter/lib/styles/' . $prefix . '*.css');\n\t$files_cus = glob($cfg['themes_dir'] . '/' . $cfg['defaulttheme'] . '/styles/' . $prefix . '*.css');\n\t$files = array_merge($files_def, $files_cus);\n\tforeach ($files as $path)\n\t{\n\t\t$fname = pathinfo($path, PATHINFO_BASENAME);\n\t\t$themename = preg_replace(\"/$prefix(.*)\\.css/i\", '$1', $fname);\n\t\t$path = pathinfo($path, PATHINFO_DIRNAME);\n\t\tif ($themename && is_file($path . '/shCore' . $themename . '.css')) $themes[] = $themename;\n\t}\n\tsort($themes);\n\treturn array_unique($themes);\n}", "protected function renderCssLibraries() {}", "public static function getIncludedFiles() {\n\t\treturn get_included_files();\n\t}", "public static function getIncludedFiles () {\n\t\treturn static::$files;\n\t}", "public function get_css () {\n\t\tob_start();\n\t\t$this->print_css();\n\t\treturn $this->css_compress(ob_get_clean());\n\t}", "function getThemes() {\r\n \t$themepath = AIGAION_WEBCONTENT_DIR.\"themes/\";\r\n \t$themelist = array();\r\n \tif ($handle = opendir($themepath)) {\r\n \t\twhile (false !== ($nextfile = readdir($handle))) {\r\n \t\t\tif ( ($nextfile != \".\" && $nextfile != \"..\") \r\n \t\t\t && (strtolower($nextfile)!=\"cvs\") \r\n \t\t\t && (strtolower($nextfile)!=\".svn\") \r\n \t\t\t && (is_dir($themepath.\"/\".$nextfile))\r\n \t\t\t && file_exists($themepath.\"/\".$nextfile.\"/css/styling.css\")\r\n \t\t\t ) {\r\n \t\t\t\t$themelist[] = $nextfile;\r\n \t\t\t}\r\n \t\t}\r\n \t\tclosedir($handle);\r\n \t}\r\n \treturn $themelist;\r\n }", "static public function getThemeResourceTypes()\n {\n return array('css');\n }", "public function getSrcPaths(): array;", "public function get_css() {\n\t\treturn file_get_contents( $this->assets_dir . 'css/translation-discussion.css' );\n\t}", "public function getAllCssLink()\n {\n foreach ($this->css as $css)\n {\n echo HtmlHelper::cssLink($css);\n }\n }", "function _default_stylesheets() {\n\t\t$CI =& get_instance();\n\t\treturn explode(\", \", $CI->config->item('OCU_stylesheet_default_collection'));\n\t}", "public static function getCaptionsCssContentArray(){\n\t\t\tif(file_exists(GlobalsRevSlider::$filepath_captions))\n\t\t\t\t$contentCSS = file_get_contents(GlobalsRevSlider::$filepath_captions);\n\t\t\telse if(file_exists(GlobalsRevSlider::$filepath_captions_original))\n\t\t\t\t$contentCSS = file_get_contents(GlobalsRevSlider::$filepath_captions_original);\n\t\t\telse if(file_exists(GlobalsRevSlider::$filepath_backup.'captions.css'))\n\t\t\t\t$contentCSS = file_get_contents(GlobalsRevSlider::$filepath_backup.'captions.css');\n\t\t\telse if(file_exists(GlobalsRevSlider::$filepath_backup.'captions-original.css'))\n\t\t\t\t$contentCSS = file_get_contents(GlobalsRevSlider::$filepath_backup.'captions-original.css');\n\t\t\telse\n\t\t\t\tUniteFunctionsRev::throwError(\"No captions.css found! This installation is incorrect, please make sure to reupload the Slider Revolution plugin and try again!\");\n\n\t\t\t$result = UniteCssParserRev::parseCssToArray($contentCSS);\n\n\t\t\treturn($result);\n\t\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/crosswordr.php',\n 'sources_custom/php-crossword/index.html',\n 'sources_custom/php-crossword/COPYING',\n 'sources_custom/php-crossword/php_crossword.class.php',\n 'sources_custom/php-crossword/php_crossword_cell.class.php',\n 'sources_custom/php-crossword/php_crossword_client.class.php',\n 'sources_custom/php-crossword/php_crossword_grid.class.php',\n 'sources_custom/php-crossword/php_crossword_word.class.php',\n 'sources_custom/miniblocks/main_crossword.php',\n 'themes/default/css_custom/crossword.css',\n 'sources_custom/php-crossword/.htaccess',\n );\n }", "public static function getConfigOutputCssGloballyAdditionalStyles(): array {}", "public function getJsFiles(): array;", "public static function all_css($format = Assets::FORMAT_TAG)\n\t{\n\t\tif (empty(Assets::$css))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$assets = array();\n\n\t\tforeach (self::_sort(Assets::$css) as $handle => $data)\n\t\t{\n\t\t\t$assets[] = Assets::get_css($handle, $format);\n\t\t}\n\n\t\tswitch ($format)\n\t\t{\n\t\t\tcase Assets::FORMAT_TAG:\n\t\t\t\treturn implode(PHP_EOL, $assets).PHP_EOL;\n\t\t\tbreak;\n\n\t\t\tcase Assets::FORMAT_FILENAME:\n\t\t\t\treturn Assets::compile($assets, $format, 'css');\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(\"Unknown format: $format.\");\n\t\t}\n\t}" ]
[ "0.8109408", "0.8105665", "0.80508137", "0.78740644", "0.78523844", "0.7749669", "0.7741947", "0.7713128", "0.75984824", "0.7546447", "0.75040966", "0.7458132", "0.7416798", "0.73747265", "0.736769", "0.7303425", "0.7224916", "0.71995044", "0.716093", "0.71553844", "0.71197987", "0.70719844", "0.7060435", "0.7044673", "0.7016019", "0.7006471", "0.6991997", "0.69741434", "0.6868505", "0.6854558", "0.6842675", "0.6820689", "0.678531", "0.67745894", "0.67745894", "0.677299", "0.672053", "0.67143583", "0.6713757", "0.6710755", "0.6679481", "0.6676075", "0.66578984", "0.66333324", "0.6629854", "0.66210407", "0.66123885", "0.65942526", "0.6575899", "0.65529823", "0.6537836", "0.6537548", "0.6532429", "0.6528454", "0.652389", "0.6507263", "0.6506961", "0.64963424", "0.6485296", "0.6444215", "0.6440556", "0.64266473", "0.64179105", "0.63910645", "0.63845176", "0.63599676", "0.63549364", "0.63530374", "0.6351879", "0.6344647", "0.6340251", "0.6327244", "0.6319596", "0.6316562", "0.6281043", "0.62704635", "0.62649137", "0.6259795", "0.62580764", "0.62395024", "0.623692", "0.62308156", "0.6224635", "0.621623", "0.62126", "0.6205108", "0.6200095", "0.61988986", "0.61891794", "0.6179212", "0.61672306", "0.6165172", "0.6161138", "0.61586326", "0.6154641", "0.6140488", "0.61383295", "0.6137448", "0.6136931", "0.61325586" ]
0.81773144
0
This is a simple script that will extract the exchange rates from the CBvS Website (
Это простой скрипт, который будет извлекать курсы валют с сайта CBvS (
function get_cbvs_rates($base_url) { if (!$base_url) return array(); // Check if PHP CURL module is installed/enabled if (!extension_loaded('curl')) { scriptPrevious("CURL extension not loaded/installed!"); } $curl = curl_init(); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_URL, $base_url); curl_setopt($curl, CURLOPT_REFERER, $base_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $str = curl_exec($curl); curl_close($curl); // Create a DOM object $html_base = new simple_html_dom(); // Load HTML from a string $html_base->load($str); $find = $html_base->find('div[id=accordion1]'); $table_hd = array(); $table_td = array(); // Get all the table th/td elements here and create an array foreach($find as $element) { // Get all tables from div foreach($element->find('table') as $table) { // get table headers foreach($table->find('th') as $tbody) { $table_hd[] = $tbody->plaintext; }// foreach // get table data foreach($table->find('td') as $tbody) { $table_td[] = $tbody->plaintext; }// foreach break;// break out the loop }// foreach }// foreach // Add new line break after every 3 counts $x = 1; $new_array = array(); foreach ($table_td as $td) { $new_array[] = $td; if ($x == 3) { $new_array[] = '\n';// add new line $x = 0; } $x += 1;// increment by one }// foreach // Create array by splitting the new array where new line occures $y = 0; $currency_array = array(); foreach ($new_array as $new) { if ($new != '\n') { $currency_array[$y][] = $new; } else { $y += 1; } }// foreach // Create associatieve array $curr_array = array(); $currency = strtolower($table_hd[0]); $buying = strtolower($table_hd[1]); $selling = strtolower($table_hd[2]); foreach ($currency_array as $curr) { $curr_array[$curr[0]] = array($currency => $curr[0] , $buying => $curr[1] , $selling => $curr[2] ); }// foreach // Generate the return list $x = 0; $return_list = array(); foreach ($curr_array as $key => $value) { $return_list[$x]['date'] = date("Y-m-d"); $return_list[$x]['currency'] = $curr_array[$key]['currency']; $return_list[$x]['buying'] = $curr_array[$key]['buying']; $return_list[$x]['selling'] = $curr_array[$key]['selling']; $x++; }// foreach // Clear the objects $html_base->clear(); unset($html_base); return $return_list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function fetchRates() {\n\t\t\n\t\t# Получаем текущий курс с сайта центробанка\n\t\t//$info = @file_get_contents('http://www.cbr.ru/scripts/XML_daily.asp');\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://www.cbr.ru/scripts/XML_daily.asp\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $info = curl_exec($ch);\n curl_close($ch);\n\n\n\n if ($info === false)\n\t\t\treturn false;\n\t\n\t\tlibxml_use_internal_errors();\n\t\t$xml = simplexml_load_string($info);\n\t\tif ($xml === false)\n\t\t\treturn false;\n\t\n\t\t$usdElements = $xml->xpath('/*/Valute[CharCode=\"USD\"]');\n\t\t$uahElements = $xml->xpath('/*/Valute[CharCode=\"UAH\"]');\n $eurElements = $xml->xpath('/*/Valute[CharCode=\"EUR\"]');\n\t\tif (!isset($uahElements[0]) || !isset($usdElements[0]) || !isset($eurElements))\n\t\t\treturn false;\n\t\n\t\t$usd = (float)str_replace(',', '.', $usdElements[0]->Value / $usdElements[0]->Nominal);\n\t\t$uah = (float)str_replace(',', '.', $uahElements[0]->Value / $uahElements[0]->Nominal);\n $eur = (float)str_replace(',', '.', $eurElements[0]->Value / $eurElements[0]->Nominal);\n\n\t\tif ($usd <= 0 || $uah <= 0 || $eur <=0)\n\t\t\treturn false;\n\n\t\treturn array('usd' => $usd, 'uah' => $uah, 'eur' => $eur);\n\t}", "public function getExchangeRate()\n {\n $url = \"http://currency-api.appspot.com/api/EUR/GBP.json?key=4fa189eaef2b6fef16dbeae44650fc8d6bdaaf23\";\n\n $result = file_get_contents($url);\n $result = json_decode($result);\n\n if ($result->success)\n {\n self::$rates_euros_to_pounds = $result->rate;\n $this->updated = true;\n }\n else\n {\n $this->updated = false;\n self::$rates_euros_to_pounds = 0.7;\n }\n \n $url = \"http://currency-api.appspot.com/api/USD/GBP.json?key=4fa189eaef2b6fef16dbeae44650fc8d6bdaaf23\";\n\n $result = file_get_contents($url);\n $result = json_decode($result);\n\n if ($result->success)\n {\n self::$rates_dollar_to_pounds = $result->rate;\n $this->updated = true;\n }\n else\n {\n $this->updated = false;\n self::$rates_dollar_to_pounds = 0.6;\n }\n }", "protected function getRates()\n {\n $XMLContent= file(\"http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml\");\n //the file is updated daily between 2.15 p.m. and 3.00 p.m. CET\n $exchangeRates = array();\n $date = \"\";\n $found = false;\n foreach ($XMLContent as $line) \n {\n if(!$found && ereg(\"time='([[:graph:]]+)'\",$line,$validityDate))\n {\n $date = $validityDate[1];\n $found = true;\n }\n if (ereg(\"currency='([[:alpha:]]+)'\",$line,$currencyCode)) \n {\n if (ereg(\"rate='([[:graph:]]+)'\",$line,$rate)) \n {\n array_push($exchangeRates, array($currencyCode[1], $rate[1]));\n }\n }\n }\n \n // EUR is not in the exchange rates, but still is a currency; so, we need\n // to add it manually\n $exchangeRates[] = array('EUR', 1.0);\n \n return array($exchangeRates, $date);\n }", "public function downloadExchangeRates() {\n $useEndPoint = (mc_detectSSLConnection($this->settings) == 'yes' ? $this->endpoints['https'] : $this->endpoints['http']);\n $useEndPoint = str_replace('{BASE}', $this->settings->baseCurrency, $useEndPoint);\n // Ping JSON API\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $useEndPoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $json = json_decode(curl_exec($ch), true);\n curl_close ($ch);\n // Update..\n if (!empty($json['rates'])) {\n $q = @mysqli_query($GLOBALS[\"___msw_sqli\"], \"SELECT `currency` FROM `\" . DB_PREFIX . \"currencies` WHERE `enableCur` = 'yes' ORDER BY `currency`\");\n while ($CUR = @mysqli_fetch_object($q)) {\n if (isset($json['rates'][$CUR->currency])) {\n @mysqli_query($GLOBALS[\"___msw_sqli\"], \"UPDATE `\" . DB_PREFIX . \"currencies` SET\n `rate` = '\" . mc_safeSQL(@number_format($json['rates'][$CUR->currency], 2, '.', '')) . \"'\n WHERE `currency` = '{$CUR->currency}'\n \");\n }\n }\n } else {\n if ($this->logErrs == 'yes') {\n file_put_contents(GLOBAL_PATH . 'logs/currency_converter_errors.log', 'No rates could be retrieved @ ' . date('j F Y : H:iA') . PHP_EOL, FILE_APPEND);\n }\n }\n // Make sure no rates are less than 0..\n @mysqli_query($GLOBALS[\"___msw_sqli\"], \"UPDATE `\" . DB_PREFIX . \"currencies` SET\n `rate` = '0'\n WHERE `rate` < 0\n \");\n }", "private function getRates(): array\n {\n // TODO find out where to best make these constants\n $exchangeRateUrl = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';\n $ratesUpdateTime = '14:15';\n\n $ch = curl_init();\n $arr_options = [\n CURLOPT_URL => $exchangeRateUrl,\n CURLOPT_RETURNTRANSFER => TRUE,\n ];\n curl_setopt_array($ch, $arr_options);\n $str_xml = curl_exec($ch);\n\n if (curl_error($ch)) {\n // write error to log\n $this->logger->critical('Curl error: %error', ['%error' => curl_error($ch)]);\n print 'Curl failed to retrieve the data from ' . $exchangeRateUrl;\n print 'Error message: ' . curl_error($ch);\n }\n $xml = simplexml_load_string($str_xml);\n $json = json_encode($xml);\n $array = json_decode($json, TRUE);\n\n // Set a time-stamp for the latest version\n $this->setXmlTime(strtotime($array['Cube']['Cube']['@attributes']['time'] . ' ' . $ratesUpdateTime));\n\n $this->flattenExchangeRateArray($array['Cube']['Cube']['Cube']);\n\n return $this->currencyExchangeRateArray;\n }", "public function getExchangeRates();", "function centrobank_get_valute() {\n //http://www.nbrb.by/Services/XmlExRates.aspx?ondate=3/7/2008 \n $fopen = fopen(\"http://www.nbrb.by/Services/XmlExRates.aspx?ondate=\".date(\"d/m/Y\"), \"r\");\n if (!$fopen) { \n return array('<div style=\"background-color: #f9f9f9; padding:5px; border: 1px solid #a00;\">Не удалось подключиться к центробанку. Валютная цена недоступна.</div>', '', ''); \n exit; \n } else { \n $text = \"\"; \n while (!feof ($fopen)) { \n $text .= fgets($fopen, 4096); \n } \n } \n fclose($fopen); \n preg_match_all(\"#<Currency Id=\\\"([^\\\"]+)[^>]+>[^>]+>([^<]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)[^>]+>[^>]+>([^<]+)#i\", $text, $final_texts, PREG_SET_ORDER);\n \n foreach($final_texts as $final_text) { \n \n \tif($final_text[2] == 840) { \n $kurs_dollar = str_replace(\",\", \".\", $final_text[4]); \n } \n if($final_text[2] == 978) { \n $kurs_euro = str_replace(\",\", \".\", $final_text[4]); \n } \n\t \n } \n return array(null, $kurs_dollar, $kurs_euro);\n \n //return array($final_texts); \n}", "private function get_ecb_rates() {\n if ( ( $data = $this->get_ecb_cache() ) === false ) {\n $res = wp_remote_get( 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml' );\n if ( is_wp_error( $res ) || $res['response']['code'] !== 200 ) {\n return false;\n }\n if ( ( $data = $this->set_ecb_cache( $res['body'] ) ) === false ) {\n return false;\n }\n }\n\n return $data;\n }", "function GetECBCurrencyRates() {\n $xml = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml');\n $parser = xml_parser_create();\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, $xml, $tags);\n xml_parser_free($parser);\n\n $elements = array();\n // the currently filling [child] XmlElement array\n $stack = array();\n foreach ($tags as $tag) {\n $index = count($elements);\n if ($tag['type']==\"complete\" || $tag['type']==\"open\") {\n $elements[$index] = new XmlElement;\n $elements[$index]->name = $tag['tag'];\n $elements[$index]->attributes = $tag['attributes'];\n $elements[$index]->content = $tag['value'];\n if ($tag['type']==\"open\") {// push\n $elements[$index]->children = array();\n $stack[count($stack)] = &$elements;\n $elements = &$elements[$index]->children;\n }\n }\n if ($tag['type']==\"close\") {// pop\n $elements = &$stack[count($stack) - 1];\n unset($stack[count($stack) - 1]);\n }\n }\n\n $Currencies = array();\n foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails) {\n $Currencies[$CurrencyDetails->attributes['currency']] = $CurrencyDetails->attributes['rate'];\n }\n $Currencies['EUR'] = 1;\n //ECB delivers no rate for Euro\n //return an array of the currencies and rates\n return $Currencies;\n}", "function fetch_fidelity_rates(){\r\n\r\n $uri = 'https://www.fidelitybank.com.gh/rates/';\r\n $data = array();\r\n\r\n try{\r\n\t$contents = file_get_contents($uri);\r\n if($contents && strlen($contents)){\r\n $data = parse_rate_table(trim($contents));\r\n }\r\n }catch(Exception $ex){\r\n // ignore\r\n }\r\n\r\n return $data;\r\n}", "function bpCurrencyList() {\n global $bpOptions;\n\n $currencies = array();\n $rate_url = 'https://bitpay.com/api/rates';\n\n try {\n if(function_exists('json_decode'))\n $clist = json_decode(file_get_contents($rate_url),true);\n else\n $clist = bpJSONdecode(file_get_contents($rate_url));\n\n foreach($clist as $key => $value)\n $currencies[$value['code']] = $value['name'];\n\n return $currencies;\n } catch (Exception $e) {\n if($bpOptions['useLogging'])\n bpLog('Error: ' . $e->getMessage());\n return 'Error: ' . $e->getMessage();\n }\n}", "function calculate_cny_exchange_rate()\n{\n $usd_btc = 0;\n $cny_btc = 0;\n $usd_cny = 0;\n \n $url = fopen(\"https://blockchain.info/ticker\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $usd_btc = $json->{\"USD\"}->{\"last\"};\n $cny_btc = $json->{\"CNY\"}->{\"last\"};\n \n $usd_cny = ($usd_btc / $cny_btc);\n \n return $usd_cny;\n}", "public function get_exchange_rate($host_obj, $from_currency, $to_currency)\n\t\t{\n\t\t\t$from_currency = trim(strtoupper($from_currency));\n\t\t\t$to_currency = trim(strtoupper($to_currency));\n\t\t\t\n\t\t\t$feed_content = null;\n\t\t\ttry\n\t\t\t{\n//\t\t\t\t$feed_content = @file_get_contents(self::feed_address);\n\t\t\t\t\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, self::feed_address);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, false);\n\t\t\t\t$feed_content = curl_exec($ch);\n\t\t\t\tcurl_close($ch);\n\t\t\t} catch (Exception $ex) {}\n\n\t\t\tif (!strlen($feed_content))\n\t\t\t\tthrow new Phpr_SystemException('Error loading European Central Bank feed.');\n\n\t\t\t$doc = new DOMDocument('1.0');\n\t\t\t$doc->loadXML($feed_content);\n\t\t\t$xPath = new DOMXPath($doc);\n\t\t\t$xPath->registerNamespace('ns', \"http://www.ecb.int/vocabulary/2002-08-01/eurofxref\");\n\n\t\t\tif ($from_currency == 'EUR')\n\t\t\t\t$from_rate = 1;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$from_rate = $xPath->query(\"//gesmes:Envelope/ns:Cube/ns:Cube/ns:Cube[@currency='$from_currency']\");\n\t\t\t\tif (!$from_rate->length)\n\t\t\t\t\tthrow new Phpr_SystemException('Currency rate for '.$from_currency.' not found');\n\n\t\t\t\t$from_rate = $from_rate->item(0)->getAttribute('rate');\n\t\t\t}\n\t\t\t\n\t\t\tif ($to_currency == 'EUR')\n\t\t\t\t$to_rate = 1;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$to_rate = $xPath->query(\"//gesmes:Envelope/ns:Cube/ns:Cube/ns:Cube[@currency='$to_currency']\");\n\t\t\t\tif (!$to_rate->length)\n\t\t\t\t\tthrow new Phpr_SystemException('Currency rate for '.$to_currency.' not found');\n\n\t\t\t\t$to_rate = $to_rate->item(0)->getAttribute('rate');\n\t\t\t}\n\n\t\t\tif(!is_numeric($to_rate) || !is_numeric($from_rate)){\n\t\t\t\tthrow new Phpr_SystemException('Invalid currency rates received');\n\t\t\t}\n\n\t\t\tif(($to_rate <= 0) || ($from_rate <= 0)){\n\t\t\t\tthrow new Phpr_SystemException('Invalid currency rates received');\n\t\t\t}\n\n\t\t\treturn $to_rate/$from_rate;\n\t\t}", "function get_btc_price($exchange)\n{\n $btc_price = 0; // If the price shows up as 0, then we know there's a problem connecting to the API(s)\n $usd_cny = calculate_cny_exchange_rate();\n \n if($exchange == \"bitstamp\")\n {\n $url = fopen(\"http://www.bitstamp.net/api/ticker/\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = $json->{\"last\"};\n }/*\n // We are not using Cryptsy because of its low BTC/USD volume (<10,000 BTC)\n else if($exchange == \"cryptsy\")\n {\n // We're using the server pubapi2 because at the time of programming, pubapi1 seems to be down. When you remove the \"2\" from pubapi2, either server is randomly selected.\n $url = fopen(\"http://pubapi2.cryptsy.com/api.php?method=singlemarketdata&marketid=2\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = $json->{\"return\"}->{\"markets\"}->{\"BTC\"}->{\"lasttradeprice\"};\n }*/\n else if($exchange == \"cex.io\")\n {\n $url = fopen(\"https://cex.io/api/ticker/BTC/USD\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n var_dump($json);\n \n //$btc_price = $json->{\"return\"}->{\"markets\"}->{\"BTC\"}->{\"lasttradeprice\"};\n }\n else if($exchange == \"coinbase\")\n {\n $url = fopen(\"https://coinbase.com/api/v1/prices/spot_rate\", \"r\");\n \n $data = json_decode(stream_get_contents($url));\n \n $btc_price = $data->amount;\n }\n else if($exchange == \"btc-e\")\n {\n $url = fopen(\"https://btc-e.com/api/3/ticker/btc_usd\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = $json->{\"btc_usd\"}->{\"last\"};\n }\n else if($exchange == \"bitfinex\")\n {\n $url = fopen(\"https://api.bitfinex.com/v1/ticker/btcusd\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = $json->mid;\n }\n else if($exchange == \"kraken\")\n {\n $url = fopen(\"https://api.kraken.com/0/public/Ticker?pair=XXBTZUSD\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = $json->{\"result\"}->{\"XXBTZUSD\"}->{\"a\"}[0];\n }\n else if($exchange == \"btcchina\" && $usd_cny > 0)\n {\n $url = fopen(\"https://data.btcchina.com/data/ticker?market=btccny\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = ($json->{\"ticker\"}->{\"last\"} * $usd_cny);\n }\n else if($exchange == \"huobi\" && $usd_cny > 0)\n {\n $url = fopen(\"http://api.huobi.com/staticmarket/ticker_btc_json.js\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = ($json->{\"ticker\"}->{\"last\"} * $usd_cny);\n }\n else if($exchange == \"okcoin\") // OKCoin has a BTC/USD market\n {\n $url = fopen(\"https://www.okcoin.com/api/ticker.do?ok=1\", \"r\");\n \n $json = json_decode(stream_get_contents($url));\n \n $btc_price = ($json->{\"ticker\"}->{\"last\"});\n }\n else\n // This will be triggered if there is no method to connect to the given exchange's API\n // Remember to create a new table in the database for any new exchanges. Match the structure of the other exchanges by duplicating another exchange's table (including values).\n {\n $btc_price = -1;\n \n $log_message = \"WARNING: No method found to connect to exchange \\\"\" . $exchange . \"\\\"'s API. Please fix this.\";\n log_to_file($log_message);\n }\n \n return (float)number_format($btc_price, 2, \".\", \"\");\n \n}", "private function _getprice()\n\t{\n\t\t$handle=curl_init('https://min-api.cryptocompare.com/data/pricemulti?fsyms=WAN&tsyms=USD');\n\t\tcurl_setopt($handle, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$content = curl_exec($handle);\n\n\t\treturn $content; // show target page\n\t}", "public function getRates();", "public function getRates();", "public function getRates();", "public function testExternalApiForCurrenciesExchangeRates()\n {\n $client = new Client();\n $response = $client->get('http://api.currencylayer.com/live?access_key=0eea08dbc3e1b49e52597bcd2d86b61b&currencies=JPY,GBP,EUR');\n\n $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n $this->assertStringContainsString('quotes', $response->getBody()->getContents());\n }", "public static function getLatestRates()\n {\n return json_decode(file_get_contents(\"https://openexchangerates.org/api/latest.json?app_id='\" . APP_ID . \"'\"), true);\n }", "function kurs(){\n $response = \"\";\n $xml = file_get_contents(\"http://cbu.uz/uzc/arkhiv-kursov-valyut/xml/\");\n $m = new SimpleXMLElement($xml);\n foreach ($m as $val) {\n if($val->Ccy == 'USD'){\n $response .= \"1 USD💵 - \" . $val->Rate . \" so'm\\n\";\n }\n if($val->Ccy == 'EUR'){\n $response .= \"1 EURO💶 - \" . $val->Rate . \" so'm\\n\";\n }\n if($val->Ccy == 'JPY'){\n $response .= \"1 JPY💴 - \" . $val->Rate . \" so'm\\n\";\n } if($val->Ccy == 'RUB'){\n $response .= \"1 RUB💴 - \" . $val->Rate . \" so'm\\n\";\n }\n }\n return $response;\n }", "public function getCurrencies();", "protected function _loadFromEuropeCB()\n {\n $result = array();\n $xmlString = $this->_loadByUrl($this->_serviceEuropecb);\n if (empty($xmlString)) {\n return array();\n }\n\n if ($xml = simplexml_load_string($xmlString)) {\n foreach ($xml->Cube->Cube->Cube as $row) {\n $value = $this->clearValue($row['rate']);\n $code = strtoupper(trim($row['currency']));\n\n $result[$code] = $value;\n }\n\n $result['EUR'] = 1;\n foreach ($result as $code => $value) {\n $result[$code] = $value;\n }\n }\n\n return $result;\n }", "abstract public function retrieveCurrencies();", "public function rates();", "private function _getprice()\n\t{\n\t\t$handle = curl_init('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,EOS,USDT,USDC,WAN,FNX,LINK,UNI&tsyms=USD,CNY');\n\t\tcurl_setopt($handle, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$content = curl_exec($handle);\n\n\t\treturn $content; // show target page\n\t}", "private function fetchRates(): array\n {\n $ch = curl_init($this->conf->ratesUrl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n if(($response == null)||($response == '')) {\n throw new EmptyResponseException(\"Error Processing Request\", 1);\n }\n\n $exchangeRates = json_decode($response, true);\n\n return $exchangeRates['rates'];\n }", "function exchangeRateApi($from = null, $to = null, $apiKey = null) {\n // Fetching JSON\n $req_url = 'https://v6.exchangerate-api.com/v6/' . $apiKey . '/latest/' . $from;\n\n $response_json = file_get_contents($req_url);\n // Continuing if we got a result\n if(false !== $response_json) {\n // Decoding\n $response = json_decode($response_json, true);\n // Check for success\n if('success' === $response['result']) {\n return $response['conversion_rates'][$to];\n }\n }\n}", "public function testShouldReturnExchangeRatesOfAnyCurrencies()\n\t {\n\t\t$responder = new Responder();\n\t\t$html = $responder->getTicker(\"ALL\", \"EUR\");\n//\t\tfile_put_contents(__DIR__ . \"/datasets/bitfinex/expected_eur.html\", $html);\n\n\t\t$expected = file_get_contents(__DIR__ . \"/datasets/bitfinex/expected_eur.html\");\n\n\t\t$this->assertEquals($expected, $html);\n\t }", "function currencyConvert($from,$to)\n {\n $url = \"http://www.exchangerate-api.com/$from/$to/1?k=mhXK9-WknIS-he8My\"; \t//nedd to change after 1500 request per month\n $ch=curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response= curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "public static function getCurrencies()\n {\n $uri = 'http://yasen.aviasales.ru/adaptors/currency.json';\n\n $client = new \\GuzzleHttp\\Client(\n [\n 'headers' =>\n [\n 'Content-Type' => 'application/json',\n ],\n ]\n );\n\n return json_decode((string)$client->get($uri)->getBody(), true);\n }", "public function get_dollar_exchange_rate()\n {\n $dollar_price = 0;\n $dollar_url = 'https://openexchangerates.org/api/latest.json?app_id=d2f88285655f4e3ea528c38aaf301566';\n $json_data = file_get_contents($dollar_url);\n $json_feed = json_decode($json_data);\n $dollar_price = $json_feed->rates->NGN;\n return $dollar_price;\n }", "function fetch_cmc_market_info() {\n // Grab the CMC homepage\n $html = file_get_html(\"http://www.coinmarketcap.com/\");\n // Get Peercoin's table\n $ppc_data = $html->find('#ppc', 0);\n\n // Market cap is stored in the \"data-usd\" tag of a 'td'\n $market_cap_td = $ppc_data->find('td[class=market-cap]', 0);\n if (is_object($market_cap_td)) {\n $market_cap = $market_cap_td->getAttribute('data-usd');\n // Market cap is returned with commas that break floatval()\n $market_cap = str_replace(\",\", \"\", $market_cap);\n }\n else {\n $market_cap = null;\n }\n\n // Individual price is stored in the \"data-usd\" tag of an 'a'\n $ppc_usd_a = $ppc_data->find('a[class=price]', 0);\n if (is_object($ppc_usd_a)) {\n $ppc_usd = $ppc_usd_a->getAttribute('data-usd');\n }\n else {\n $ppc_usd = null;\n }\n \n // Total supply does not have a marking class,\n // but at the time of writing is the 5th <td>\n $total_supply_td = $ppc_data->find('td', 4);\n if (is_object($total_supply_td)) {\n $total_supply = $total_supply_td->plaintext;\n // Ugly hack because CMC doesn't provide a data tag\n // so we have to strip off the text\n $total_supply = str_replace(\",\", \"\", $total_supply);\n $total_supply = str_replace(\" PPC\", \"\", $total_supply);\n }\n else {\n $total_supply = null;\n }\n\n // Prepare an array for the data,\n // returned as floats\n $info = array(\n 'price' => floatval($ppc_usd),\n 'market_cap' => floatval($market_cap),\n 'total_supply' => intval($total_supply),\n );\n \n return $info;\n}", "public function getUseCurrencyExchangeRates();", "function convertcurrency($amount, $source='EUR', $dest='EUR') {\n\n// check if xml file exists, is up to date and is a valid xml\n\n $update = false;\n if (!file_exists('../xmldata/currencyrates.xml') || date('Y-m-d', filemtime('../xmldata/currencyrates.xml')) < date('Y-m-d')) $update = true;\n \n if (!$update) {\n $currencyxml = simplexml_load_file('../xmldata/currencyrates.xml');\n if (!$currencyxml) $update = true;\n } \n \n// update xml\n \n if ($update) {\n \n $currencyxml = simplexml_load_file('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml');\n if (!$currencyxml) { xmlerror(25); $error = 25; }\n else {\n @file_put_contents('../xmldata/currencyrates.xml', formatxml($currencyxml->asXML()));\n }\n }\n \n// load current rates from local file\n \n $currencyxml = simplexml_load_file('../xmldata/currencyrates.xml');\n if (!$currencyxml) { return false; }\n\n// calculate rate\n \n $rate1 = 0;\n $rate2 = 0;\n $found1 = 0;\n $found2 = 0;\n $update_date = $currencyxml->Cube->Cube['time'];\n \n foreach($currencyxml->Cube->Cube->Cube as $cube) {\n if ($cube['currency'] == $source) { $found1 = 1; $rate1 = $cube['rate']; }\n if ($cube['currency'] == $dest) { $found2 = 1; $rate2 = $cube['rate']; }\n }\n\n if ($source == 'EUR') { $found1 = 1; $rate1 = 1; }\n if ($dest == 'EUR') { $found2 = 1; $rate2 = 1; }\n \n if ($found1 == 0 || $found2 == 0) { return false; }\n\n// do real calculation\n \n $return = (((float)$amount / (float)$rate1) * (float)$rate2);\n \n// cut decimals, do rounding if necessary\n\n global $currencies;\n \n if ($currencies[1] == null || $currencies[1] == false) {\n $currencies[1] = simplexml_load_file('../xmldata/currencies_1.xml');\n }\n \n if (!$currencies[1]) { return false; }\n\n $decimals = 2;\n \n foreach($currencies[1] as $currency) {\n if ($dest == $currency['code']) {\n $decimals = (integer)$currency->decimals;\n }\n }\n \n $return = round($return, $decimals);\n return $return;\n\n}", "function fetch_vircurex_market_price() {\n $btc_usd_json = file_get_contents('https://vircurex.com/api/get_highest_bid.json?base=BTC&alt=USD');\n $btc_usd = json_decode($btc_usd_json)->value;\n\n $ppc_btc_json = file_get_contents('https://vircurex.com/api/get_highest_bid.json?base=PPC&alt=BTC');\n $ppc_btc = json_decode($ppc_btc_json)->value;\n\n $ppc_usd = $btc_usd * $ppc_btc;\n return round($ppc_usd, 2);\n}", "public function index()\n {\n $xml = Http::get('http://www.cbr.ru/scripts/XML_daily.asp?date_req=' . date('d/m/Y'));\n\n $xmlObject = simplexml_load_string($xml);\n\n $json = json_encode($xmlObject);\n $array = json_decode($json,TRUE);\n\n $date = date('Y-m-d H:i:s');\n\n foreach ($array['Valute'] as $item) {\n $exchange = new Exchange();\n $exchange->currency = $item['CharCode'];\n $exchange->rate = (float)$item['Value'];\n $exchange->date = $date;\n $exchange->save();\n }\n\n return new ExchangeCollection(Exchange::all()->where('date', '=', $date));\n }", "function currency_changer()\n{\n $ip = geoip()->getLocation(\\Request::getClientIp());\n\n $rate = \\Swap::latest('USD/' . $ip->currency);\n $rate = $rate->getValue();\n return ['rate' => $rate, 'currency' => $ip->currency];\n}", "public function importAndPrepareExchangeRates()\n {\n // Load xml string so that cdata is visible\n $feed = simplexml_load_file(env('RSS_FEED', \"https://www.bank.lv/vk/ecb_rss.xml\"), null, LIBXML_NOCDATA);\n //If data available\n if ($feed != false) {\n $arrayOfItems = [];\n $counter = 0;\n // Loops the rss feed and gets date and rate exchanges aas a string\n foreach ($feed->channel->item as $item) {\n $arrayOfItems[$counter]['desc'] = $item->description[0];\n $arrayOfItems[$counter]['date'] = $item->pubDate[0];\n $counter++;\n }\n //Checks if array of data not empty only then continues\n if (!empty($arrayOfItems)) {\n // Loops the data array to \"beautify\" data for saving\n foreach ($arrayOfItems as &$item) {\n // pregmatch finds the rate in the string of rates\n // 3 capital letters + space + numbers + dot + numbers\n preg_match_all(\"/([A-Z]{3}\\s(\\d+.\\d+))/\", $item['desc'], $matches);\n // Set the matched items into array\n $item['desc'] = $matches[0];\n // Loops the found mathed items and set exchange_rate in array where\n // key = name of currency\n // value = rate\n foreach ($item['desc'] as $key => $match) {\n $explodedData = explode(' ', $match);\n unset($item['desc'][$key]);\n $item['desc'][$explodedData[0]] = $explodedData[1];\n }\n // Change date format to mysql\n $item['date'] = date('Y-m-d', strtotime($item['date']));\n }\n return (((new self())->saveExchangeRates($arrayOfItems)) == true) ? true : false;\n }\n }\n return false;\n }", "function getPriceIntl() {\n if ($this->server == \"\" || is_null($this->server))\n $this->server = \"http://Production.ShippingAPIs.com/ShippingAPI.dll\";\n if ($this->user == \"\" || is_null($this->user))\n $this->user = \"599PRECI6619\";\n if ($this->pass == \"\" || is_null($this->pass))\n $this->pass = \"818VX99OC468\";\n\n $requestIntXML = '\n<IntlRateV2Request USERID=\"' . $this->user . '\">\n\t<Revision>2</Revision>\n\t<Package ID=\"0\">\n\t\t<Pounds>' . $this->pounds . '</Pounds>\n\t\t<Ounces>' . $this->ounces . '</Ounces>\n\t\t<MailType>All</MailType>\n\t\t<GXG>\n\t\t\t<POBoxFlag>N</POBoxFlag>\n\t\t\t<GiftFlag>N</GiftFlag>\n\t\t</GXG>\n\t\t<ValueOfContents>' . $this->item_price . '</ValueOfContents>\n\t\t<Country>' . $this->dest_country . '</Country>\n\t\t<Container>RECTANGULAR</Container>\n\t\t<Size>REGULAR</Size>\n\t\t<Width>' . $this->width . '</Width>\n\t\t<Length>' . $this->length . '</Length>\n\t\t<Height>' . $this->height . '</Height>\n\t\t<Girth>0</Girth>\n\t\t<OriginZip>' . $this->orig_zip . '</OriginZip>\n\t\t<CommercialFlag>Y</CommercialFlag>\n\t\t<ExtraServices>\n\t\t\t<ExtraService>0</ExtraService>\n\t\t\t<ExtraService>1</ExtraService>\n\t\t\t<ExtraService>2</ExtraService>\n\t\t\t<ExtraService>3</ExtraService>\n\t\t\t<ExtraService>5</ExtraService>\n\t\t\t<ExtraService>6</ExtraService>\n\t\t</ExtraServices>\n\t</Package>\n</IntlRateV2Request>\n';\n \n \n $request = 'API=IntlRateV2&XML=' . urlencode($requestIntXML);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->server);\n curl_setopt($ch, CURLOPT_REFERER, SITE_ROOT_URL);\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_VERBOSE, 0);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n curl_setopt($ch, CURLOPT_SSLVERSION, 3);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Tela mela');\n\n $body = curl_exec($ch);\n $info = @curl_getinfo($ch);\n curl_close($ch);\n\n $body_array = simplexml_load_string($body);\n $body_content = json_decode(json_encode($body_array), TRUE);\n\n foreach ($body_content['Package']['Service'] as $usps) {\n if ((float) $usps['CommercialPostage'] > 0)\n $arr[] = array('ServiceType' => $usps['SvcDescription'], 'DeliveryTimestamp' => $usps['SvcCommitments'], 'ShippingCost' => $usps['CommercialPostage']);\n }\n //pre($body_content);\n return $arr;\n }", "function bpGetRate($code = 'USD') {\n global $bpOptions;\n\n $rate_url = 'https://bitpay.com/api/rates';\n\n try {\n if(function_exists('json_decode'))\n $clist = json_decode(file_get_contents($rate_url),true);\n else\n $clist = bpJSONdecode(file_get_contents($rate_url));\n\n foreach($clist as $key => $value) {\n if($value['code'] == $code)\n $rate = number_format($value['rate'], 2, '.', '');\n }\n\n return $rate;\n } catch (Exception $e) {\n if($bpOptions['useLogging'])\n bpLog('Error: ' . $e->getMessage());\n return 'Error: ' . $e->getMessage();\n }\n}", "public function testExchangerate() {\n\n $ex = new CurrencyWebservice();\n\n $result = $ex->getExchangeRate('$');\n\n $this->assertIsNumeric($result);\n\n }", "public function getCurrencyInfo();", "public function get_exchange_rates_json() {\n\n\t\t$from = esc_attr( get_option( 'jcc_exchange_rates_from' ) );\n\t\t$exchange_rates = [];\n\t\t$currency_list = preg_split( \"/[\\r\\n]/\", get_option( 'jcc_exchange_rates' ) );\n\t\tforeach ( $currency_list as $currency ) {\n\t\t\tif ( false === strpos( $currency, ':' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$rate = explode( ':', $currency );\n\t\t\t$title = preg_replace( '/^' . $from . '/', '', $rate[0] );\n\t\t\t$exchange_rates[ $title ] = $rate[1];\n\t\t}\n\n\t\treturn $exchange_rates;\n\t}", "function get_currency($array)\n{\n# OK so far\n$return[0]=True;\n\n# Create the HTTP request\n$src = 'http://finance.yahoo.com/d/quotes.csv?s=';\nforeach ($array as $key=>$value) $src.=$array[$key]['source'].$array[$key]['target'].'=X+';\n\n# Complete the request with the flags\n$src=substr($src,0,-1).'&f=nl1d1t1ab';\n\n# Launch the request\n$fp = @fopen ($src, 'r');\nif($fp)\n\t{\n\twhile (($result[] = fgetcsv($fp,1000)) !== FALSE);\n\tfclose($fp);\n\t}\nelse $return[0]=False;\n\n# Return result\n$return[1]=$result;\nreturn($return);\n}", "function currencyConvert($from, $to, $amount) {\n $url = \"https://voip91.com/currency/index.php?from=$from&to=$to&amount=$amount\"; //nedd to change after 1500 request per month\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $response = curl_exec($ch);\n \n \n curl_close($ch);\n \n \n return $response;\n }", "public function coupons(){\n\t\t$appid = I('appid');\n\n\t\t$url = \"https://api.it120.cc/tz//discounts/coupons\";\n\n\t\t$res = httpRequest($url);\n\t\techo $res;\n\n\t}", "public function getRates(): mixed\n {\n return Http::withHeaders(['User-Agent' => 'PECR@' . $this->version . ',laravel plugin@' . '1.0.0'])\n ->post(Config::get('coinremitter.url', 'https://coinremitter.com/api/') . 'get-coin-rate',)->json();\n }", "public function getAllCurrencies() {\r\n $currencies = [];\r\n $cid = 'currencies_nbrb:' . $this->date;\r\n\r\n if ($cache = \\Drupal::cache()->get($cid)) {\r\n $currencies = $cache->data;\r\n }\r\n else {\r\n // Get Currencies.\r\n try {\r\n $response = $this->httpClient->request('GET', self::CURRENCIES_BNRB_URL, [\r\n 'query' => ['ondate' => $this->date],\r\n ]);\r\n }\r\n catch (RequestException $e) {\r\n watchdog_exception('currencies', $e);\r\n }\r\n\r\n if ($response->getStatusCode() == 200) {\r\n try {\r\n $xml = new \\SimpleXMLElement($response->getBody());\r\n }\r\n catch (ParseException $e) {\r\n watchdog_exception('currencies', $e);\r\n }\r\n\r\n foreach ($xml->Currency as $currency) {\r\n $currencies[(string) $currency->CharCode] = (object) (array) $currency;\r\n }\r\n }\r\n if ($currencies) {\r\n // Cache for 1 day.\r\n \\Drupal::cache()->set($cid, $currencies, mktime(0, 0, 0, date('n'), date('j') + 1));\r\n }\r\n }\r\n\r\n return $currencies;\r\n }", "private function getRate($currency)\n {\n $client = new \\SoapClient(\"http://www.mnb.hu/arfolyamok.asmx?wsdl\");\n $result = $client->GetCurrentExchangeRates()->GetCurrentExchangeRatesResult;\n\n xml_parse_into_struct(xml_parser_create(), $result, $values);\n\n foreach ($values as $item) {\n if (data_get($item, 'attributes.CURR')== $currency) {\n return floatval($item['value']);\n }\n }\n\n return 0;\n }", "public function convertir($base){\r\n $currencyOBJ = new currency(); \r\n $currencyOBJ->base = $base;\r\n\r\n $XML=simplexml_load_file(\"http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml\");\r\n\r\n foreach($XML->Cube->Cube as $fecha){\r\n $currencyOBJ->date = strval($fecha[\"time\"]);\r\n }\r\n\r\n $rateValue=0;\r\n\r\n foreach ($this->baseEUR as $currency => $rate){\r\n if (strval($currency) == strval($base)) {\r\n $tipoCambio = $rate;\r\n }\r\n \r\n }\r\n\r\n foreach ($this->baseEUR as $currency => $rate){\r\n\r\n $rateValue = (1)*(1/$tipoCambio)*($rate/1);\r\n\r\n $rateValue = $this->redondear_dos_decimal($rateValue);\r\n\r\n $rateValue = strval($rateValue);\r\n $CurrencyForech = strval($currency);\r\n\r\n $currencyOBJ->rate[$CurrencyForech]=$rateValue;\r\n \r\n }\r\n\r\n $JsonBase = json_encode($currencyOBJ);\r\n\r\n return $JsonBase;\r\n }", "public function getRates($base)\n {\n\n $ratesJsonData = file_get_contents('http://api.fixer.io/latest?base=' . $base, true);\n\n if (!$ratesJsonData) {\n return 'Sorry I dont know this rate base. Try EUR, USD, CHF...';\n }\n\n $ratesData = json_decode($ratesJsonData);\n\n $rates = $this->removeUnusedRates((array)$ratesData->rates);\n\n return $this->formatRates($ratesData->base, $ratesData->date, $rates);\n }", "public function currencies()\n {\n return $this->httpGet('/api/v4/spot/currencies');\n }", "public function getCurrencyRates($feedUrl = null)\n {\n echo \"Fetching currency rates from xml \" . date(\"Y-m-d H:i:s\") . \"\\n\";\n // if we passed in a feed url lets override our current feed url\n if ($feedUrl) {\n $this->feedUrl = $feedUrl;\n }\n\n // lets try to get the xml from the feed url\n if (($feed = file_get_contents($this->feedUrl)) === false) {\n echo \"Error fetching XML \" . date(\"Y-m-d H:i:s\") . \"\\n\";\n }\n\n // turning this on so we can ouput errors if need be\n libxml_use_internal_errors(true);\n\n // lets load our xml element from our feed\n $xmlElement = simplexml_load_string($feed);\n\n // if we dont have items that means there are errors lets output them\n if (!$xmlElement) {\n echo \"Error loading XML\" . date(\"Y-m-d H:i:s\") . \"\\n\";\n foreach (libxml_get_errors() as $error) {\n echo \"\\t\", $error->message;\n }\n\n // return null there were errors\n return null;\n } else {\n // we have the xml lets return it\n echo \"Finished fetching currency rates from xml \" . date(\"Y-m-d H:i:s\") . \"\\n\";\n return $xmlElement;\n }\n }", "protected function _loadFromCBR()\n {\n $result = array();\n $xmlString = $this->_loadByUrl($this->_serviceCBR);\n if (empty($xmlString)) {\n return array();\n }\n\n if ($xml = simplexml_load_string($xmlString)) {\n\n foreach ($xml as $row) {\n $value = (float)$this->clearValue((string)$row->Value);\n $nominal = (string)$row->Nominal;\n $code = (string)$row->CharCode;\n\n $result[$code] = $value / $nominal;\n }\n\n $result['RUB'] = 1;\n $baseValue = $result[$this->getDefaultCur()];\n\n foreach ($result as $code => $value) {\n $result[$code] = $baseValue / $value;\n }\n\n }\n\n return $result;\n }", "public function search_bcv()\n {\n $urlToGet ='http://www.bcv.org.ve/tasas-informativas-sistema-bancario';\n $pageDocument = @file_get_contents($urlToGet);\n preg_match_all('|<div class=\"col-sm-6 col-xs-6 centrado\"><strong> (.*?) </strong> </div>|s', $pageDocument, $cap);\n\n if ($cap[0] == array()){ // VALIDAR Concidencia\n $titulo = '0,00';\n }else {\n $titulo = $cap[1][4];\n }\n\n $bcv_con_formato = $titulo;\n $bcv = str_replace(',', '.', str_replace('.', '',$bcv_con_formato));\n\n\n /*-------------------------- */\n return $bcv;\n\n \n }", "function getRates($propertyId, $url = false)\n {\n //$results = $this->results;\n\n $results = $this->getWebsite($propertyId, $url);\n\n\n $rates = $this->scrape_between($results, \"<table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\">\", \"</table>\");\n //$rates = htmlentities($rates);\n //preg_replace('\\n\\n','||',$rates);\n $rates = \"<table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"4\\\">\" . $rates . \"</table>\";\n return $rates;\n }", "public function search_bcv()\n {\n $urlToGet ='http://www.bcv.org.ve/tasas-informativas-sistema-bancario';\n $pageDocument = @file_get_contents($urlToGet);\n preg_match_all('|<div class=\"col-sm-6 col-xs-6 centrado\"><strong> (.*?) </strong> </div>|s', $pageDocument, $cap);\n\n if ($cap[0] == array()){ // VALIDAR Concidencia\n $titulo = '0,00';\n } else {\n $titulo = $cap[1][4];\n }\n\n $bcv_con_formato = $titulo;\n $bcv = str_replace(',', '.', str_replace('.', '',$bcv_con_formato));\n\n\n /*-------------------------- */\n return $bcv;\n\n }", "function getDolar() \n{\n\t$feed_dolar = \"http://themoneyconverter.com/rss-feed/ES/USD/rss.xml\";\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL,$feed_dolar);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);\n\t$xmlUsd = curl_exec($curl);\n\tif(curl_errno($curl)==0) \n\t{\n\t\t$xml = simplexml_load_string(str_replace(array(\"&amp;\", \"&\"),array(\"&\", \"&amp;\"),$xmlUsd));\n\t\tif($xml!=false) \n\t\t{\n\t\t\t$dolar=false;\n\t\t\tforeach($xml->channel->item as $item) \n\t\t\t{\n\t\t\t\tif($item->title==\"ARS/USD\"){\n\t\t\t\t\t$cots=explode(\"=\",$item->description);\n\t\t\t\t\tforeach ($cots as $cot){\n\t\t\t\t\t\t$usd[]=floatval(str_replace(\",\",\".\",$cot));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $usd[1];\n\t\t}\n\t}\n\t// Cerrar recurso\n\tcurl_close($curl);\n}", "public function search_bcv()\n {\n $urlToGet ='http://www.bcv.org.ve/tasas-informativas-sistema-bancario';\n $pageDocument = @file_get_contents($urlToGet);\n preg_match_all('|<div class=\"col-sm-6 col-xs-6 centrado\"><strong> (.*?) </strong> </div>|s', $pageDocument, $cap);\n\n if ($cap[0] == array()){ // VALIDAR Concidencia\n $titulo = '0,00';\n }else {\n $titulo = $cap[1][4];\n }\n\n $bcv_con_formato = $titulo;\n $bcv = str_replace(',', '.', str_replace('.', '',$bcv_con_formato));\n\n\n /*-------------------------- */\n return $bcv;\n\n }", "public function testGetExchangeRate()\n {\n $response = $this->call('GET', '/currency', [],[],[]);\n $this->assertEquals(200,$response->status(),\"unexpected status\");\n\n }", "public function currency($from_Currency, $to_Currency, $amount)\n\t{\n \n\t$url = \"https://www.google.com/finance/converter?a=\" . $amount . \"&from=\" . $from_Currency . \"&to=\" . $to_Currency;\n\n $ch = curl_init();\n $timeout = 0;\n curl_setopt ($ch, CURLOPT_URL, $url);\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $rawdata = curl_exec($ch);\n \n\tcurl_close($ch);\n\n preg_match_all(\"|<span class=bld>(.*)</span>|U\", $rawdata, $matches);\n\n $result = explode(\" \", $matches[1][0]);\n\t\n\t/* Currency value */\n\t$con_val = round($result[0], 2);\n\t\n\t/* Get the currency symbole */\n\t$cursym = $this->currencyCode();\n\t\t\n\t/* Currency format */\n\t$format = $cursym[$to_Currency]['format'];\n\t/* Set the cookie currency value */\n\tsetcookie('ccv56598954',$con_val ,time() +3600, '/', $_SERVER['SERVER_NAME'] );\n\t\n\t/* Set currency to currency */\t\n\tsetcookie('ucc34433443',$to_Currency, time() + 3600, '/', $_SERVER['SERVER_NAME'] );\n \n\t/* Set cookie currency format as well */\n\tsetcookie('cf34433443',$format, time() + 3600, '/', $_SERVER['SERVER_NAME'] );\n\n\t/* Round the integer */\t\n\t/* Round the integer */\t\n\treturn round($result[0], 2);\n\t}", "public function getRates() {\n $rand = time().mt_rand(1000,99999);\n $hash = $this->hash(array($rand));\n $array = array('login' => $this->oplid, 'qid' => $rand, 'sign' => $hash);\n $xml = $this->toXml($array);\n $response = $this->fetch($this->ratesUrl, $xml);\n $response = (array)$response;\n $return = array();\n if (is_object($response['systems'])) {\n $rate = (array)$response['systems'];\n $return = array($rate['id'] => $rate);\n } elseif ($response['systems']) {\n foreach ($response['systems'] as $rate) {\n $rate = (array)$rate;\n $return[$rate['id']] = $rate;\n }\n }\n\n return $return;\n }", "function getShippingRate($accesskey, $accountnum, $username, $password, $shipfrom, $shipto, $pkgdetails, $live=''){\n\t\n\t\tif($live == true){\n\t\t\t//$apiurl = \"https://onlinetools.ups.com/ups.app/xml/Rate\";\n\t\t}else{\n\t\t\t$apiurl = \"https://wwwcie.ups.com/ups.app/xml/Rate\";\n\t\t}\n\t\t\n\t\t$request = \"<?xml version=\\\"1.0\\\" ?>\n\t\t<AccessRequest xml:lang='en-US'>\n\t\t\t<AccessLicenseNumber>\" .$accesskey. \"</AccessLicenseNumber>\n\t\t\t<UserId>\" .$username. \"</UserId>\n\t\t\t<Password>\" .$password. \"</Password>\n\t\t</AccessRequest>\n\t\t<?xml version=\\\"1.0\\\" ?>\n\t\t\t<RatingServiceSelectionRequest>\n\t\t\t\t<Request>\n\t\t\t\t\t<RequestAction>Rate</RequestAction>\n\t\t\t\t\t<RequestOption>Rate</RequestOption>\n\t\t\t\t</Request>\n\t\t\t\t<Shipment>\n\t\t\t\t\t<Shipper>\n\t\t\t\t\t\t<Name>\" .$shipfrom['company']. \"</Name>\n\t\t\t\t\t\t<ShipperNumber>\" .$accountnum. \"</ShipperNumber>\n\t\t\t\t\t\t<Address>\n\t\t\t\t\t\t\t<AddressLine1>\" .$shipfrom['address']. \"</AddressLine1>\n\t\t\t\t\t\t\t<City>\" .$shipfrom['city']. \"</City>\n\t\t\t\t\t\t\t<StateProvinceCode>\" .$shipfrom['province']. \"</StateProvinceCode>\n\t\t\t\t\t\t\t<PostalCode>\" .$shipfrom['postalcode']. \"</PostalCode>\n\t\t\t\t\t\t\t<CountryCode>\" .$shipfrom['country']. \"</CountryCode>\n\t\t\t\t\t\t</Address>\n\t\t\t\t\t</Shipper>\n\t\t\t\t\t<ShipTo>\n\t\t\t\t\t\t<Address>\n\t\t\t\t\t\t\t<AddressLine1>\" .$shipto['address']. \"</AddressLine1>\n\t\t\t\t\t\t\t<City>\" .$shipto['city']. \"</City>\n\t\t\t\t\t\t\t<StateProvinceCode>\" .$shipto['province']. \"</StateProvinceCode>\n\t\t\t\t\t\t\t<PostalCode>\" .$shipto['postalcode']. \"</PostalCode>\n\t\t\t\t\t\t\t<CountryCode>\" .$shipto['country']. \"</CountryCode>\n\t\t\t\t\t\t</Address>\n\t\t\t\t\t</ShipTo>\n\t\t\t\t\t<Service>\n\t\t\t\t\t\t<Code>11</Code>\n\t\t\t\t\t\t<Description>UPS Standard</Description>\n\t\t\t\t\t</Service>\n\t\t\t\t\t<Package>\n\t\t\t\t\t\t<PackagingType>\n\t\t\t\t\t\t\t<Code>02</Code>\n\t\t\t\t\t\t\t<Description>Package</Description>\n\t\t\t\t\t\t</PackagingType>\n\t\t\t\t\t\t<Dimensions>\n\t\t\t\t\t\t\t<UnitOfMeasurement>\n\t\t\t\t\t\t\t\t<Code>IN</Code>\n\t\t\t\t\t\t\t</UnitOfMeasurement>\n\t\t\t\t\t\t\t<Length>\" .number_format($pkgdetails['length'], 1). \"</Length>\n\t\t\t\t\t\t\t<Width>\" .number_format($pkgdetails['width'], 1). \"</Width>\n\t\t\t\t\t\t\t<Height>\" .number_format($pkgdetails['height'], 1). \"</Height>\n\t\t\t\t\t\t</Dimensions>\n\t\t\t\t\t\t<PackageWeight>\n\t\t\t\t\t\t\t<UnitOfMeasurement>\n\t\t\t\t\t\t\t\t<Code>LBS</Code>\n\t\t\t\t\t\t\t</UnitOfMeasurement>\n\t\t\t\t\t\t\t<Weight>\" .number_format($pkgdetails['weight'], 1). \"</Weight>\n\t\t\t\t\t\t</PackageWeight>\n\t\t\t\t\t</Package>\n\t\t\t\t</Shipment>\n\t\t\t</RatingServiceSelectionRequest>\";\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $apiurl);\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml;'));\n\t\t\t$result = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t\n\t\t\treturn simplexml_load_string($result);\n\t}", "public function getCurrencyRates()\n\t\t{\n\t\t\t$supported = array('EUR', 'USD', 'RUB', 'GBP', 'CNY');\n//\t\t\tSocketMemcached::create()->mark(DOMAIN)->delete(self::RATES);\n\t\t\t\n\t\t\tif (!($rates = SocketMemcached::create()->mark(DOMAIN)->get(self::RATES))) {\n\t\t\t\tGlobalVar::me()->import('CurrencyFetcher');\n\n\t\t\t\t$rates = array_merge(\n\t\t\t\t\tarray('EUR' => 1),\n\t\t\t\t\tCurrencyFetcher::create()->getRates()\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$rates = array_intersect_key($rates, array_flip($supported));\n\t\t\t\tSocketMemcached::create()->mark(DOMAIN)->set(self::RATES, $rates);\n\t\t\t}\n\n\t\t\treturn $rates;\n\t\t}", "protected function get_rate($base_currency, $currency) {\n\t\t$url = sprintf($this->_webservicex_url,\n\t\t\t\t\t\t\t\t\t strtoupper($base_currency),\n\t\t\t\t\t\t\t\t\t strtoupper($currency));\n\t\t//var_dump($url);\n\n\t\ttry {\n\t\t\t$response = \\Httpful\\Request::get($url)\n\t\t\t\t->expectsXml()\n\t\t\t\t->send();\n\n\t\t\t//var_dump($response); die();\n\t\t\tif($response->hasErrors()) {\n\t\t\t\t// TODO Find out how to determine what error occurred and add it to the Errors list\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn (string)$response->body;\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->add_error(self::ERR_EXCEPTION_OCCURRED,\n\t\t\t\t\t\t\t\t\t\t\t sprintf(__('Error(s) occurred while retrieving the Exchange Rates from WebServiceX. ' .\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Base currency: %s. Target Currency: %s. Error message: %s.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAELIA_CS_PLUGIN_TEXTDOMAIN),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $base_currency,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $currency,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $e->getMessage()));\n\t\t\treturn null;\n\t\t}\n\t}", "function getExchangeRateFromBitcoincharts($currency_code, $rate_type)\n {\n $source_url = \"http://api.bitcoincharts.com/v1/weighted_prices.json\";\n $result = $this->fileGetContents($source_url, false, 10);\n\n $rate_obj = @json_decode(trim($result) , true);\n\n return @$rate_obj[$currency_code]['24h'];\n }", "function conversionRates($values) {\n $returnString = \"\";\n while($value = mysqli_fetch_assoc($values)) {\n $returnString .= \"<li>\" . $value[\"ValueSymbol\"] . \": \" . rtrim(rtrim($value[\"CoinValue\"], \"0\"), \".\") . \"</li>\";\n }\n return $returnString;\n }", "public function testShouldReturnCryptoCurrencyRatesInOtherRealCurrency()\n\t {\n\n\t\t$responder = new Responder();\n\t\t$html = $responder->getTicker(\"ALL\", \"USDT\");\n//\t\tfile_put_contents(__DIR__ . \"/datasets/bitfinex/expected_usdt.html\", $html);\n\n\t\t$expected = file_get_contents(__DIR__ . \"/datasets/bitfinex/expected_usdt.html\");\n\t\t$this->assertEquals($expected, $html);\n\t }", "public function converCurrency($from,$to,$amount){\n\t\t$url = \"http://www.google.com/finance/converter?a=$amount&from=$from&to=$to\"; \n\t\t$request = curl_init(); \n\t\t$timeOut = 0; \n\t\tcurl_setopt ($request, CURLOPT_URL, $url); \n\t\tcurl_setopt ($request, CURLOPT_RETURNTRANSFER, 1); \n\t\tcurl_setopt ($request, CURLOPT_USERAGENT,\"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)\"); \n\t\tcurl_setopt ($request, CURLOPT_CONNECTTIMEOUT, $timeOut); \n\t\t$response = curl_exec($request); \n\t\tcurl_close($request); \n\t\treturn $response;\n\t}", "public function get_price_rates() {\n\n\t\t$portalID = '6827351';\n\t\t$onBoardingTblId = '2033374';\n\n\t\t/*\n\t\t$endpoint = 'https://api.hubapi.com/hubdb/api/v1/tables';\n $queryString = build_query_string(['portalId' => $portalId]);\n return $this->client->request('get', $endpoint, [], $queryString);\n\n\t\t$accessToken = $this->getAccessToken();\n\n\t\tif (!isset($accessToken)) {\n\t\t\treturn array('error' => 'true', 'msg' => 'Error getting access token.');\n\t\t}\n\t\t*/\n\n\t\t$endPoint = \"https://api.hubapi.com/hubdb/api/v2/tables/\";\n\t\t$queryString = $onBoardingTblId.\"/rows?portalId=\".$portalID;\n\n\t\t$header = array( \n 'Content-type: application/json',\n //'Authorization: Bearer '.$accessToken\n\t\t);\n\n\t\t//Curl\n\t\t$session = curl_init();\n\t\tcurl_setopt_array($session, array(\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTPHEADER => $header,\n\t\t\tCURLOPT_URL => $endPoint.$queryString,\n\t\t\tCURLOPT_MAXREDIRS => 10,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t));\n\n\t\t$response = curl_exec($session);\n\n\t\tif (curl_errno($session)) {\n\t\t\treturn array('error' => 'true', 'msg' => 'Error obtaining HubDB tables: '.curl_error($session));\n\t\t}\n\n\t\tcurl_close($session);\t\n\n\t\t//$response = json_decode($response, true);\n\t\treturn $response;\n\n\t}", "public static function scrape($src)\n\t{\n\n\t\t$html = str_get_html($src);\n\n\t\t$new_stamp = 0;\n\n\t\tforeach($html->find('p') as $element)\n\t\t{\n\t\t\tif ($element->class == 'lead')\n\t\t\t//echo $element->plaintext;\n\t\t\t$timestamp = strtotime(substr($element->plaintext, strlen('Pricelist as at ') - 1));\n\t\t\t//mktime int hour, int minute, int second, int month, int day, int year [, int is_dst]\n\t\t\t$new_stamp = convert_date($timestamp);\n\n\t\t\t//mon to fri check\n\t\t\tswitch (strtolower(date('D', $new_stamp)))\n\t\t\t{\n\t\t\t\tcase 'mon':\n\t\t\t\tcase 'tue':\n\t\t\t\tcase 'wed':\n\t\t\t\tcase 'thu':\n\t\t\t\tcase 'fri':\n\t\t\t\t\t//pass, do check on whether this data has been scraped\n\t\t\t\t\tif (transaction::symbolcount($new_stamp) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo 'already scraped';\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\techo 'not mon-fri';\n\t\t\t\t\treturn 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$tag_count = 0;\n\n\t\t$object = R::dispense('transaction');\n\n\t\tforeach ($html->find('table.table-blue td') as $td)\n\t\t{\n\t\t\t$tag_count += 1;\n\t\t\t//echo $td->plaintext . '<br >';\n\n\t\t\t$object->timestamp = $new_stamp;\n\n\t\t\tswitch ($tag_count)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t1. Security\n\t\t\t\t2. Price\n\t\t\t\t3. Change\n\t\t\t\t4. PClose\n\t\t\t\t5. Open\n\t\t\t\t6. High\n\t\t\t\t7. Low\n\t\t\t\t8. Volume\n\t\t\t\t9. Value\n\t\t\t\t*/\n\t\t\t\tcase 1:\n\t\t\t\t\t$symbol = $td->plaintext;\n\t\t\t\t\t$object->symbol = $symbol;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t//price\n\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t//change\n\t\t\t\tbreak;\n\n\t\t\t\tcase 4:\n\t\t\t\t\t$close = $td->plaintext;\n\t\t\t\t\t$object->close = $close;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 5:\t\t\n\t\t\t\t\t$open = $td->plaintext;\t\t\t\n\t\t\t\t\t$object->open = $open;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 6:\t\n\t\t\t\t\t$high = $td->plaintext;\t\t\t\t\n\t\t\t\t\t$object->high = $high;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 7:\t\n\t\t\t\t\t$low = $td->plaintext;\t\t\t\t\n\t\t\t\t\t$object->low = $low;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 8:\t\n\t\t\t\t\t$volume = $td->plaintext;\n\t\t\t\t\t//volume is comma seperated sp\t\t\t\t\n\t\t\t\t\t$object->volume = str_replace(',', '', $volume);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 9:\n\t\t\t\t\t//value\n\t\t\t\t\t$deals = 0;\n\t\t\t\t\t$object->deals = $deals;\n\n\t\t\t\t\t//$object = R::dispense('transaction');\n\t\t\t\t\t/*$object->open = $open;\n\t\t\t\t\t$object->high = $high;\n\t\t\t\t\t$object->low = $low;\n\t\t\t\t\t$object->close = $close;\n\t\t\t\t\t$object->deals = $deals;\n\t\t\t\t\t$object->volume = $volume;*/\n\n\t\t\t\t\t$id = R::store($object);\n\n\t\t\t\t\t//echo $id . '\\n';\n\t\t\t\t\t//echo '-------------<br >';\n\t\t\t\t\t//var_dump($object);\n\t\t\t\t\t$tag_count = 0;\n\t\t\t\t\t$object = R::dispense('transaction');\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/*if ($tag_count == 9)\n\t\t\t{\n\t\t\t\techo '-------------<br >';\n\t\t\t\t$tag_count = 0;\n\t\t\t\t$object = R::dispense('transaction');\n\t\t\t}*/\n\t\t}\n\n\t\techo $new_stamp;\n\t}", "function dksnippets_extract_prices($str = '') {\n $prices = array();\n\n /* Clean string */\n $str = str_replace(array(\"\\n\", \"\\n\"), \" \", strtolower($str));\n\n /* Avoid numbers near \"eur\" */\n $str = preg_replace(\"/([0-9\\.]+)(e|â)/is\", \"$1 $2\", $str);\n\n /* Remove useless numbers and fake results */\n $str = str_replace(array(\"24h\", \"tva 10.00\", \"tva 20.00\", \"7j\", \"00 %\", \".00%\", \"*\"), \"\", $str);\n $str = str_replace(\"eur\", \" eur\", $str);\n $str = str_replace(\":\", \" : \", $str);\n $str = str_replace(\", \", \",\", $str);\n $str = str_replace(\"/ \", \"/\", $str);\n $str = str_replace(\" \", \" \", $str);\n\n /* Remove invalid numbers */\n $str = preg_replace(\"/(capital[a-z ]+[0-9 \\.,]+)/is\", \"\", $str);\n $str = preg_replace(\"/(rcs[a-z ]+[0-9 \\.,]+)/is\", \"\", $str);\n\n /* Extract all numbers surrounded by spaces */\n preg_match_all('/ \\d+([\\.,])\\d+ /', $str, $matches_amount);\n if (isset($matches_amount[0][0])) {\n foreach ($matches_amount[0] as $nb) {\n $prices[] = floatval(trim(str_replace(',', '.', $nb)));\n }\n }\n return $prices;\n}", "public static function getData(){\n\t\t$arResult = &static::$arCacheData;\n\t\tif(is_array($arResult)){\n\t\t\treturn $arResult;\n\t\t}\n\t\t$strXmlUrl = 'http://www.cbr.ru/scripts/XML_daily.asp';\n\t\t$strContent = HttpRequest::get($strXmlUrl, array('TIMEOUT'=>5));\n\t\t$arXml = Xml::xmlToArray($strContent);\n\t\tif(is_array($arXml['ValCurs']['#']['Valute'])){\n\t\t\t#$arResult['DATE'] = $arXml['ValCurs']['@']['Date'];\n\t\t\tforeach($arXml['ValCurs']['#']['Valute'] as $arCurrency){\n\t\t\t\t$strCurrencyCode = $arCurrency['#']['CharCode'][0]['#'];\n\t\t\t\t$strCurrencyNominal = IntVal($arCurrency['#']['Nominal'][0]['#']);\n\t\t\t\t$strCurrencyValue = str_replace(',', '.', $arCurrency['#']['Value'][0]['#']);\n\t\t\t\t$arResult[$strCurrencyCode] = array(\n\t\t\t\t\t'V' => $strCurrencyValue,\n\t\t\t\t\t'N' => $strCurrencyNominal,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($strContent, $arXml);\n\t\treturn $arResult;\n\t}", "public function getRates($params);", "private function bitlish() {\n $res = wp_remote_get( 'https://bitlish.com/api/v1/tickers' );\n if ( is_wp_error( $res ) || $res['response']['code'] !== 200 || ( $rate = json_decode( $res['body'] ) ) == null ) {\n return false;\n }\n\n if ( $this->base_currency === 'GBP' ) {\n $rate = $rate->xrpgbp->last;\n $src = 'GBP';\n } else {\n $rate = $rate->xrpeur->last;\n $src = 'EUR';\n }\n\n return $this->to_base( $rate, $src );\n }", "public function setRates()\n {\n // Cache the currencies\n return $this->rates = $this->cache->remember('currencies', $this->getExpires(), function () {\n if (! $appId = $this->getAppId()) {\n throw new Exception('OpenExchangeRates.org requires an app key.');\n }\n\n $client = new Client(['base_url' => $this->getUrl()]);\n\n $data = $client->get(\"latest.json?app_id={$appId}\")->json();\n\n return $data['rates'];\n });\n }", "public function getDiscountRates();", "function getBalance($currency){\n \n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL,\"https://faucetpay.io/api/v1/balance\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"api_key=YOUR_API_KEY&currency=$currency\");\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n return json_decode(curl_exec($ch));\n\n curl_close ($ch);\n \n\n}", "public function getCurrencies(): array;", "function get_cheapest_call_rate($country_code,$sip_markup,$currency){\r\n\t\tif($sip_markup==true){\r\n\t\t\t$query = \"select ifnull(1+config_value/100,0) as config_value from system_config_options where config_option='sip_mark_up_cost'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tif(mysql_error()!=\"\"){\r\n\t\t\t\treturn \"Error: An error occurred in System_Config_Options.getSIPMarkUpCost. \".mysql_error();\r\n\t\t\t}\r\n\t\t\tif(mysql_num_rows($result)==0){\r\n\t\t\t\treturn \"Error: No System Config record found in System_Config_Options.getSIPMarkUpCost\";\r\n\t\t\t}\r\n\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t$sipMarkUpFactor = $row['config_value'];\r\n\t\t}else{\r\n\t\t\t$sipMarkUpFactor = 1;\r\n\t\t}\r\n\t\t\r\n\t\t//2. Get GBP to AUD rate\r\n\t\tif($currency==\"AUD\"){\r\n\t\t\t$query = \"select ifnull(config_value,0) as config_value from system_config_options where config_option='currency_rate_gbp_to_aud'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tif(mysql_error()!=\"\"){\r\n\t\t\t\treturn \"Error: An error occurred in System_Config_Options.getRateGBPToAUD. \".mysql_error();\r\n\t\t\t}\r\n\t\t\tif(mysql_num_rows($result)==0){\r\n\t\t\t\treturn \"Error: No System Config record found in System_Config_Options.getRateGBPToAUD\";\r\n\t\t\t}\r\n\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t$GBPtoAUDFactor = $row['config_value'];\r\n\t\t}else{\r\n\t\t\t$GBPtoAUDFactor = 1;\r\n\t\t}\r\n\t\t\r\n\t\t//Get the cheapest call cost of the forwarding country\r\n\t\t$query = \"select min(peak_per_min_gbp)*$sipMarkUpFactor*$GBPtoAUDFactor as rate from dcm_destination_costs where prefix like '$country_code%';\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred in get_cheapest_call_rate. \".mysql_error();\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\treturn \"Error: No destination cost found for prefix $country_code\";\r\n\t\t}\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\treturn $row[\"rate\"];\r\n\t\t\r\n\t}", "public function getCurrenciesList()\n\t{\n\t\t// use exchange rates data to get currencies list\n\t\t// alternatively we can get currencies list by calling /v1/cryptocurrency/map (CoinMarketCap ID map), but it costs 1 credit\n\t\t$data = $this->getCurrencyData(\"BTC\");\n\t\t$arr = array();\n\t\tforeach ($data as $currencyDataObj) {\n\t\t\t$currencyObj = new stdClass();\n\t\t\t$currencyObj->name = $currencyDataObj->name;\n\t\t\t$currencyObj->symbol = $currencyDataObj->symbol;\n\t\t\t$arr[] = $currencyObj;\n\t\t}\n\t\treturn $arr;\n\t}", "public function getTickerBtcBrl()\n {\n $negocieCoins = json_decode($this->service->getApiTickerBtcBrl(),true);\n return $negocieCoins;\n \n //return view('negocieCoins.index', compact('negocieCoins'));\n }", "function wppb_get_currencies( $form_location = '' ) {\r\n\r\n $currencies = array(\r\n 'ALL' => __( 'Albania Lek', 'profile-builder' ),\r\n 'AFN' => __( 'Afghanistan Afghani', 'profile-builder' ),\r\n 'ARS' => __( 'Argentina Peso', 'profile-builder' ),\r\n 'AWG' => __( 'Aruba Guilder', 'wkc' ),\r\n 'AUD' => __( 'Australia Dollar', 'profile-builder' ),\r\n 'AZN' => __( 'Azerbaijan New Manat', 'profile-builder' ),\r\n 'BSD' => __( 'Bahamas Dollar', 'profile-builder' ),\r\n 'BBD' => __( 'Barbados Dollar','profile-builder' ),\r\n 'BDT' => __( 'Bangladeshi taka','profile-builder' ),\r\n 'BYR' => __( 'Belarus Ruble','profile-builder' ),\r\n 'BZD' => __( 'Belize Dollar','profile-builder' ),\r\n 'BMD' => __( 'Bermuda Dollar','profile-builder' ),\r\n 'BOB' => __( 'Bolivia Boliviano','profile-builder' ),\r\n 'BAM' => __( 'Bosnia and Herzegovina Convertible Marka','profile-builder' ),\r\n 'BWP' => __( 'Botswana Pula','profile-builder' ),\r\n 'BGN' => __( 'Bulgaria Lev','profile-builder' ),\r\n 'BRL' => __( 'Brazil Real','profile-builder' ),\r\n 'BND' => __( 'Brunei Darussalam Dollar','profile-builder' ),\r\n 'KHR' => __( 'Cambodia Riel','profile-builder' ),\r\n 'CAD' => __( 'Canada Dollar','profile-builder' ),\r\n 'KYD' => __( 'Cayman Islands Dollar','profile-builder' ),\r\n 'CLP' => __( 'Chile Peso','profile-builder' ),\r\n 'CNY' => __( 'China Yuan Renminbi','profile-builder' ),\r\n 'COP' => __( 'Colombia Peso','profile-builder' ),\r\n 'CRC' => __( 'Costa Rica Colon','profile-builder' ),\r\n 'HRK' => __( 'Croatia Kuna','profile-builder' ),\r\n 'CUP' => __( 'Cuba Peso','profile-builder' ),\r\n 'CZK' => __( 'Czech Republic Koruna','profile-builder' ),\r\n 'DKK' => __( 'Denmark Krone','profile-builder' ),\r\n 'DOP' => __( 'Dominican Republic Peso','profile-builder' ),\r\n 'XCD' => __( 'East Caribbean Dollar','profile-builder' ),\r\n 'EGP' => __( 'Egypt Pound','profile-builder' ),\r\n 'SVC' => __( 'El Salvador Colon','profile-builder' ),\r\n 'EEK' => __( 'Estonia Kroon','profile-builder' ),\r\n 'EUR' => __( 'Euro','profile-builder' ),\r\n 'FKP' => __( 'Falkland Islands (Malvinas) Pound','profile-builder' ),\r\n 'FJD' => __( 'Fiji Dollar','profile-builder' ),\r\n 'GHC' => __( 'Ghana Cedis','profile-builder' ),\r\n 'GIP' => __( 'Gibraltar Pound','profile-builder' ),\r\n 'GTQ' => __( 'Guatemala Quetzal','profile-builder' ),\r\n 'GGP' => __( 'Guernsey Pound','profile-builder' ),\r\n 'GYD' => __( 'Guyana Dollar','profile-builder' ),\r\n 'HNL' => __( 'Honduras Lempira','profile-builder' ),\r\n 'HKD' => __( 'Hong Kong Dollar','profile-builder' ),\r\n 'HUF' => __( 'Hungary Forint','profile-builder' ),\r\n 'ISK' => __( 'Iceland Krona','profile-builder' ),\r\n 'INR' => __( 'India Rupee','profile-builder' ),\r\n 'IDR' => __( 'Indonesia Rupiah','profile-builder' ),\r\n 'IRR' => __( 'Iran Rial','profile-builder' ),\r\n 'IMP' => __( 'Isle of Man Pound','profile-builder' ),\r\n 'ILS' => __( 'Israel Shekel','profile-builder' ),\r\n 'JMD' => __( 'Jamaica Dollar','profile-builder' ),\r\n 'JPY' => __( 'Japan Yen','profile-builder' ),\r\n 'JEP' => __( 'Jersey Pound','profile-builder' ),\r\n 'KZT' => __( 'Kazakhstan Tenge','profile-builder' ),\r\n 'KPW' => __( 'Korea (North) Won','profile-builder' ),\r\n 'KRW' => __( 'Korea (South) Won','profile-builder' ),\r\n 'KGS' => __( 'Kyrgyzstan Som','profile-builder' ),\r\n 'LAK' => __( 'Laos Kip','profile-builder' ),\r\n 'LVL' => __( 'Latvia Lat','profile-builder' ),\r\n 'LBP' => __( 'Lebanon Pound','profile-builder' ),\r\n 'LRD' => __( 'Liberia Dollar','profile-builder' ),\r\n 'LTL' => __( 'Lithuania Litas','profile-builder' ),\r\n 'MKD' => __( 'Macedonia Denar','profile-builder' ),\r\n 'MYR' => __( 'Malaysia Ringgit','profile-builder' ),\r\n 'MUR' => __( 'Mauritius Rupee','profile-builder' ),\r\n 'MXN' => __( 'Mexico Peso','profile-builder' ),\r\n 'MNT' => __( 'Mongolia Tughrik','profile-builder' ),\r\n 'MZN' => __( 'Mozambique Metical','profile-builder' ),\r\n 'NAD' => __( 'Namibia Dollar','profile-builder' ),\r\n 'NPR' => __( 'Nepal Rupee','profile-builder' ),\r\n 'ANG' => __( 'Netherlands Antilles Guilder','profile-builder' ),\r\n 'NZD' => __( 'New Zealand Dollar','profile-builder' ),\r\n 'NIO' => __( 'Nicaragua Cordoba','profile-builder' ),\r\n 'NGN' => __( 'Nigeria Naira','profile-builder' ),\r\n 'NOK' => __( 'Norway Krone','profile-builder' ),\r\n 'OMR' => __( 'Oman Rial', 'profile-builder' ),\r\n 'PKR' => __( 'Pakistan Rupee', 'profile-builder' ),\r\n 'PAB' => __( 'Panama Balboa', 'profile-builder' ),\r\n 'PYG' => __( 'Paraguay Guarani', 'profile-builder' ),\r\n 'PEN' => __( 'Peru Nuevo Sol', 'profile-builder' ),\r\n 'PHP' => __( 'Philippines Peso', 'profile-builder' ),\r\n 'PLN' => __( 'Poland Zloty', 'profile-builder' ),\r\n 'QAR' => __( 'Qatar Riyal', 'profile-builder' ),\r\n 'RON' => __( 'Romania New Leu', 'profile-builder' ),\r\n 'RUB' => __( 'Russia Ruble', 'profile-builder' ),\r\n 'SHP' => __( 'Saint Helena Pound', 'profile-builder' ),\r\n 'SAR' => __( 'Saudi Arabia Riyal', 'profile-builder' ),\r\n 'RSD' => __( 'Serbia Dinar', 'profile-builder' ),\r\n 'SCR' => __( 'Seychelles Rupee', 'profile-builder' ),\r\n 'SGD' => __( 'Singapore Dollar', 'profile-builder' ),\r\n 'SBD' => __( 'Solomon Islands Dollar', 'profile-builder' ),\r\n 'SOS' => __( 'Somalia Shilling', 'profile-builder' ),\r\n 'ZAR' => __( 'South Africa Rand', 'profile-builder' ),\r\n 'LKR' => __( 'Sri Lanka Rupee', 'profile-builder' ),\r\n 'SEK' => __( 'Sweden Krona', 'profile-builder' ),\r\n 'CHF' => __( 'Switzerland Franc', 'profile-builder' ),\r\n 'SRD' => __( 'Suriname Dollar', 'profile-builder' ),\r\n 'SYP' => __( 'Syria Pound', 'profile-builder' ),\r\n 'TWD' => __( 'Taiwan New Dollar', 'profile-builder' ),\r\n 'THB' => __( 'Thailand Baht', 'profile-builder' ),\r\n 'TTD' => __( 'Trinidad and Tobago Dollar', 'profile-builder' ),\r\n 'TRY' => __( 'Turkey Lira', 'profile-builder' ),\r\n 'TRL' => __( 'Turkey Lira', 'profile-builder' ),\r\n 'TVD' => __( 'Tuvalu Dollar', 'profile-builder' ),\r\n 'UAH' => __( 'Ukraine Hryvna', 'profile-builder' ),\r\n 'GBP' => __( 'United Kingdom Pound', 'profile-builder' ),\r\n 'UGX' => __( 'Uganda Shilling', 'profile-builder' ),\r\n 'USD' => __( 'US Dollar', 'profile-builder' ),\r\n 'UYU' => __( 'Uruguay Peso', 'profile-builder' ),\r\n 'UZS' => __( 'Uzbekistan Som', 'profile-builder' ),\r\n 'VEF' => __( 'Venezuela Bolivar', 'profile-builder' ),\r\n 'VND' => __( 'Viet Nam Dong', 'profile-builder' ),\r\n 'YER' => __( 'Yemen Rial', 'profile-builder' ),\r\n 'ZWD' => __( 'Zimbabwe Dollar', 'profile-builder' )\r\n );\r\n\r\n $filter_name = ( empty( $form_location ) ? 'wppb_get_currencies' : 'wppb_get_currencies_' . $form_location );\r\n\r\n return apply_filters( $filter_name, $currencies );\r\n\r\n}", "public function actionPb()\n {\n $client = new Client(['baseUrl' => 'https://api.privatbank.ua/p24api/pubinfo?json&exchange']);\n\n $response = $client->createRequest()\n ->setMethod('GET')\n ->setData([\n 'coursid' => 5,\n ])\n ->send();\n\n if ($response->isOk) {\n $list = $response->data;\n } else {\n $list = false;\n }\n if ($list) {\n foreach ($list as $currency) {\n $currencyModel = Currency::findOne(['iso' => $currency['ccy'], 'switch' => 1]);\n if ($currencyModel) {\n $currencyModel->rate = $currency['sale'];\n $currencyModel->save(false);\n echo $this->action->id.' Update currency rate: ' . $this->ansiFormat($currency['ccy'], Console::FG_GREEN) . ' ' . $this->ansiFormat($currency['sale'], Console::FG_PURPLE) . PHP_EOL;\n }\n }\n }\n }", "private function bitfinex() {\n $res = wp_remote_get( 'https://api.bitfinex.com/v1/pubticker/xrpusd' );\n if ( is_wp_error( $res ) || $res['response']['code'] !== 200 || ( $rate = json_decode( $res['body'] ) ) == null ) {\n return false;\n }\n\n return $this->to_base( $rate->last_price, 'USD' );\n }", "public function index()\n {\n /*$url = 'https://api.exchangerate-api.com/v4/latest/USD';\n $response_json = file_get_contents($url);\n if(false !== $response_json) {\n\n // Try/catch for json_decode operation\n try {\n\n $data = json_decode($response_json);\n\n }\n catch(Exception $e) {\n $data = [];\n }\n\n }*/\n return view('Admin.currency',\n [\n 'title'=> trans('admin.currencies'),\n 'data' => currency()->getCurrencies()\n ]);\n }", "public function test_nbg_exchange_rates_service_for_gel(): void\n {\n $this->setFakeHttpResponse();\n\n $this->currency->code = 'GEL';\n\n $rate = $this->service->getExchangeRate($this->currency, $this->date);\n\n $this->assertEquals(1.0, $rate);\n }", "function get_gainers_data() {\n if ($_SERVER['HTTP_USER_AGENT'] == 'B10ckOut') {\n date_default_timezone_set('America/New_York');\n date_default_timezone_get();\n $currenttime = date('H:i:s');\n if (($currenttime >= '09:30:00' && $currenttime <= '16:30:00')) {\n $this->autoRender = false;\n $url1 = \"http://feeds.financialcontent.com/CSVQuote?Account=stox&GetMarketIndex=CHANGEPERCENT:0:NASDAQ&Count=10&Fields=TICKER,EXCHANGE,NAME,PRICE,DAYCHANGE,DAYCHANGEPERCENT&RequireSymbol=1\";\n $string1 = file_get_contents($url1);\n $url2 = \"http://feeds.financialcontent.com/CSVQuote?Account=stox&GetMarketIndex=CHANGEPERCENT:0:NYSE&Count=10&Fields=TICKER,EXCHANGE,NAME,PRICE,DAYCHANGE,DAYCHANGEPERCENT&RequireSymbol=1\";\n $string2 = file_get_contents($url2);\n $url3 = \"http://feeds.financialcontent.com/CSVQuote?Account=stox&GetMarketIndex=CHANGEPERCENT:0:OTCBB&Count=10&Fields=TICKER,EXCHANGE,NAME,PRICE,DAYCHANGE,DAYCHANGEPERCENT&RequireSymbol=1\";\n $string3 = file_get_contents($url3);\n if (!empty($string1) || !empty($string2) || !empty($string3)) {\n $this->Gainer->deleteAllRows();\n }\n if (!empty($string1)) {\n $formatted_array1 = $this->getFormattedDataArray($string1);\n $this->_updateGainersTable($formatted_array1);\n }\n if (!empty($string2)) {\n $formatted_array2 = $this->getFormattedDataArray($string2);\n $this->_updateGainersTable($formatted_array2);\n }\n if (!empty($string3)) {\n $formatted_array3 = $this->getFormattedDataArray($string3);\n $this->_updateGainersTable($formatted_array3);\n }\n }\n }\n exit;\n }", "function SCRAPE_BKCHAIN(){\n\t$Q=file_get_contents('https://bkchain.org/btc');\n\n\t$tx=array(array(),array());\n\t$bx=array(array(),array());\n\t$wx=array();\n\n\tif(preg_match_all('/<a href=\\'\\/btc\\/tx\\/([0-9a-f]+?)\\'>/',$Q,$tx)){\n\t\t//rdisp($tx[1]);\n\t\t$w=$tx[1][0];\n\t\t//print $w;\n\t\t$QW=json_decode(file_get_contents('https://bkchain.org/btc/api/v1/tx/hash/'.$w),true);\n\t\t//rdisp($QW);\n\t\tforeach($QW['outs'] as $ok=>$ov){\n\t\t\t$wx[]=$ov['addr'];\n\t\t}//NEXT PENDING TRANSACTION OUTPUT\n\t\t//rdisp($wx);\n\t}//ENDIF MATCH LIVE TRANSACTIONS\n\n\tif(preg_match_all('/<a href=\\'\\/btc\\/block\\/([0-9a-f]+?)\\'>/',$Q,$bx)){\n\t\t//rdisp($bx[1]);\n\t}//ENDIF MATCH BLOCKS\n\n\treturn(array('tx'=>$tx[1],'blocks'=>$bx[1],'addresses'=>$wx));\n}", "private function _getprice_pair()\n\t{\n\t\t$handle = curl_init('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,EOS,USDT,USDC,WAN,FNX,LINK,UNI&tsyms=USD');\n\t\tcurl_setopt($handle, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$content = curl_exec($handle);\n\n\t\treturn $content; // show target page\n\t}", "function retrieve($cacheLength, $cacheDir) {\r\n\r\n $return['rates'] = array('PLN' => 1.0);\r\n\r\n // retrieve XML address\r\n $htmlpage = $this->retrieveFile($this->feedHTMLUrl, $cacheLength, $cacheDir);\r\n\r\n // Example line is:\r\n // <div class=\"file\"><a href=\"xml/a055z020319.xml\">powysza tabela w formacie .xml</a></div>\r\n if (!preg_match('#href=\"(xml/a\\d+z\\d+\\.xml)\"#', $htmlpage, $match))\r\n {\r\n Services_ExchangeRates::raiseError(\"Retrieved url \" . $this->feedHTMLUrl . \" has no link to XML page\", SERVICES_EXCHANGERATES_RETRIEVAL_FAILED);\r\n return false;\r\n }\r\n $this->feedXMLUrl = $this->feedDir . $match[1];\r\n\r\n $return['source'] = $this->_feedXMLUrl;\r\n\r\n // retrieve the feed from the server or cache\r\n $root = $this->retrieveXML($this->feedXMLUrl, $cacheLength, $cacheDir);\r\n\r\n // get down to array of exchange rates\r\n foreach ($root->children as $rateinfo) {\r\n if ($rateinfo->name == 'pozycja')\r\n {\r\n $rateinfo->children[4]->content = strtr($rateinfo->children[4]->content, ',', '.');\r\n $value = $rateinfo->children[2]->content // przelicznik (conversion rate)\r\n / $rateinfo->children[4]->content; // currency rate\r\n $return['rates'][$rateinfo->children[3]->content] = $value;\r\n } elseif ($rateinfo->name == 'data_publikacji')\r\n {\r\n // set date published\r\n $return['date'] = $rateinfo->content;\r\n }\r\n }\r\n \r\n return $return; \r\n\r\n }", "function get_mobile_other_call_rates($fwd_cntry, $effective_amount){\r\n\t\t$query = \"select ifnull(1+config_value/100,0) as config_value from system_config_options where config_option='sip_mark_up_cost'\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred in System_Config_Options.getSIPMarkUpCost. \".mysql_error();\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\treturn \"Error: No System Config record found in System_Config_Options.getSIPMarkUpCost\";\r\n\t\t}\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\t$sipMarkUpFactor = $row['config_value'];\r\n\t\t\r\n\t\t//2. Get GBP to AUD rate\r\n\t\t$query = \"select ifnull(config_value,0) as config_value from system_config_options where config_option='currency_rate_gbp_to_aud'\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred in System_Config_Options.getRateGBPToAUD. \".mysql_error();\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\treturn \"Error: No System Config record found in System_Config_Options.getRateGBPToAUD\";\r\n\t\t}\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\t$GBPtoAUDFactor = $row['config_value'];\r\n\t\t\r\n\t\t//3. Get the rates in cents\r\n\t\t$query = \"select distinct(dc.destination) as destination, \r\n\t\t\t\t\t\t\tROUND(($effective_amount*100)/ROUND(dc.peak_per_min_gbp*$sipMarkUpFactor*$GBPtoAUDFactor*100)) as minutes, \r\n\t\t\t\t\t\t\tROUND(dc.peak_per_min_gbp*$sipMarkUpFactor*$GBPtoAUDFactor*100) as rate \r\n\t\t\t\t\t\tfrom dcm_destination_costs dc \r\n\t\t\t\t\t\twhere dc.prefix like '$fwd_cntry%' and dc.destination like '%Mobile%' order by rate asc limit 3\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred while getting mobile and other call rates. \".mysql_error().\" Query is: \".$query;\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\treturn \"Error: No destination cost rows for forwarding country code $fwd_cntry\";\r\n\t\t}\r\n\t\t$ret_arr = array();\r\n\t\twhile($row = mysql_fetch_array($result,MYSQL_ASSOC)){\r\n\t\t\t$ret_arr[]=$row;\r\n\t\t}\r\n\t\treturn $ret_arr;\r\n\t\t\r\n\t}", "public function index()\n {\n $exchangeRates = $this->exchangeRate->with(['fromCurrency', 'toCurrency'])->get();\n\n return response()->json(['data' => $exchangeRates]);\n }", "public function getCurrencies()\n {\n $request = $this->publicRequestManager->createGetRequest('/public/getcurrencies');\n\n return $this->get($request);\n }", "public function getCurrencies()\n {\n $data = [\n 'action' => 'GetCurrencies',\n ];\n\n return $this->submitRequest($data);\n }", "public function getRates()\n {\n $response = $this->get('/ticker');\n\n return array_map(function($rate) {\n return new Rate($this,($rate));\n }, $response->getContent());\n }", "private function bxinth() {\n $res = wp_remote_get( 'https://bx.in.th/api/' );\n if ( is_wp_error( $res ) || $res['response']['code'] !== 200 || ( $rate = json_decode( $res['body'] ) ) == null ) {\n return false;\n }\n\n /* ugly? */\n foreach ( $rate as $r ) {\n if ( $r->primary_currency === 'THB' && $r->secondary_currency === 'XRP' ) {\n $rate = $r->last_price;\n break;\n }\n }\n\n return $this->to_base( $rate, 'THB' );\n }", "private function _getGekcoPrice()\n {\n $url = 'https://api.coingecko.com/api/v3/coins/wanchain/tickers';\n\n //Initiate cURL.\n $ch = curl_init($url);\n\n //Disable CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER by\n //setting them to false.\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER , TRUE);\n //Execute the request.\n return curl_exec($ch);\n\n }", "public function actionNb()\n {\n $client = new Client(['baseUrl' => 'https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?json']);\n $response = $client->createRequest()\n ->setMethod('GET')\n ->send();\n\n if ($response->isOk) {\n $list = $response->data;\n } else {\n $list = false;\n }\n if ($list) {\n foreach ($list as $currency) {\n $currencyModel = Currency::findOne(['iso' => $currency['cc'], 'switch' => 1]);\n if ($currencyModel) {\n $currencyModel->rate = $currency['rate'];\n $currencyModel->save(false);\n echo $this->action->id.' Update currency rate: ' . $this->ansiFormat($currency['cc'], Console::FG_GREEN) . ' ' . $this->ansiFormat($currency['rate'], Console::FG_PURPLE) . PHP_EOL;\n }\n }\n }\n }" ]
[ "0.74372315", "0.6983842", "0.6932194", "0.6931511", "0.6910063", "0.6879392", "0.6844369", "0.6807059", "0.6804399", "0.6572471", "0.65672296", "0.6476043", "0.6465387", "0.6433489", "0.6399182", "0.63907504", "0.63907504", "0.63907504", "0.635646", "0.6342871", "0.6334295", "0.6317893", "0.63085425", "0.6254179", "0.62407553", "0.619693", "0.6186031", "0.61371326", "0.6134256", "0.61127096", "0.6101389", "0.60961056", "0.6092136", "0.6017173", "0.60009694", "0.59964854", "0.599411", "0.5978016", "0.5941938", "0.59382313", "0.58867234", "0.583788", "0.5836928", "0.5834891", "0.5812981", "0.58123946", "0.57983243", "0.579822", "0.57979345", "0.5795066", "0.5787485", "0.57765484", "0.5774039", "0.5765279", "0.57613516", "0.5753184", "0.57469827", "0.5739825", "0.57379514", "0.57359284", "0.57165885", "0.57125735", "0.57112986", "0.56904125", "0.5683053", "0.5682909", "0.56488705", "0.56446654", "0.5634287", "0.562937", "0.5629306", "0.56236726", "0.5614276", "0.55987674", "0.5593982", "0.55867237", "0.5580044", "0.5552294", "0.55446815", "0.5540796", "0.5539172", "0.55375403", "0.5535958", "0.5530158", "0.5526798", "0.5523579", "0.5508355", "0.5491407", "0.54904693", "0.5487487", "0.5486965", "0.5479207", "0.54725075", "0.5471617", "0.5462561", "0.5458677", "0.54542047", "0.5451591", "0.5449783", "0.5441203" ]
0.74344146
1
Test we can get all listed users.
Мы можем получить всех перечисленных пользователей.
public function testCanGetAllUsers() { $userRepository = App::make(UserRepositoryInterface::class); $users = $userRepository->all(); // Database is seeded with 50 users $this->assertCount(50, $users); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testgetAllUsersMethod()\n {\n $this->WithoutMiddleware();\n $users = factory('Suyabay\\User', 2)->create();\n $getUsers = self::$userRepository->getAllUsers();\n\n $this->assertTrue(is_array($getUsers->toArray()));\n $this->assertEquals($users[0]['username'], $getUsers[0]['username']);\n }", "public function testShouldReturnAllUsers()\n {\n $this->get('/api/users')\n ->seeStatusCode(200)\n ->seeJsonStructure(['*' => $this->structer]);\n }", "public function testGetAllUsers()\n {\n Sanctum::actingAs(InternalUser::factory()->create(), ['*']);\n\n $response = $this->get('api/user');\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'Leanne Graham'])\n ->assertJsonFragment(['username' => 'Kamren'])\n ->assertJsonFragment(['email' => 'Rey.Padberg@karina.biz']);\n\n // Call it again, it will be cached on the database:\n $response = $this->get('api/user');\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'Leanne Graham'])\n ->assertJsonFragment(['username' => 'Kamren'])\n ->assertJsonFragment(['email' => 'Rey.Padberg@karina.biz']);\n }", "public function testListUser()\n {\n $user = User::inRandomOrder()->where('user-id', '!=', config('app.admin_id'))->first();\n $response = $this->json('GET', '/api/v1/users/'.$user->{'user-id'});\n $response->assertStatus(200);\n }", "public function testGetList()\n\t{\n\t\t$user = TestHelper::createUser(UserStatus::ACTIVE)->user;\n\n\t\t$this->be($user);\n\t\t$this->call('GET', 'user/list');\n\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('users');\n\t}", "public function testListUsers()\n {\n $response = $this->json('GET', '/api/v1/users');\n $response->assertStatus(200);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function getAllUsers();", "public function getAllUsers();", "public function testGetAllUsers()\n {\n $response = $this->json('GET', '/user');\n $response->assertStatus(200);\n }", "public function testListUsers()\n {\n // just to be sure\n $createdUsers = [\n $this->auth->createAnonymousUser(),\n $this->auth->createAnonymousUser(),\n ];\n\n $users = $this->auth->listUsers($maxResults = 2, $batchSize = 1);\n\n $count = 0;\n foreach ($users as $userData) {\n $this->assertInternalType('array', $userData);\n $this->assertArrayHasKey('localId', $userData);\n ++$count;\n }\n\n $this->assertSame($maxResults, $count);\n\n foreach ($createdUsers as $createdUser) {\n $this->auth->deleteUser($createdUser);\n }\n\n $this->assertTrue($noExceptionHasBeenThrown = true);\n }", "public function getListOfUsers() {\n $requestBody = null;\n $inputArray = [];\n $ret = $this->fetch('GET', 'identity/users', $requestBody, $inputArray, array (\n ), array (\n ), array (\n 200 => 'Indicates the requested users were returned.',\n ));\n return $ret;\n }", "public function testUserList()\n {\n $response = $this->call('GET', 'users');\n $this->assertEquals(200, $response->status());\n $data = json_decode($response->getContent())->data;\n return $data;\n }", "public function getAllUsersTest(){\n $client = new Client($_ENV['PUBLIC_URL'], array(\n 'request.options' => array(\n 'exceptions' => false,\n )\n ));\n\n $request = $client->get('/v1/users');\n $response = $request->send();\n\n $this->assertEquals(201, $response->getStatusCode());\n }", "public function test_get_all_users()\n {\n $this->json('GET', '/api/getAllUsers')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at',\n ]\n ],\n 'message'\n ]);\n }", "function apiAdminUsersList()\n {\n $adminToken = file_get_contents(codecept_data_dir('admin_token.json'));\n $this->restModule->haveHttpHeader('token', $adminToken);\n $this->restModule->haveHttpHeader('Content-Type', 'application/json');\n $this->restModule->sendGET('/users/1/25');\n $this->restModule->seeResponseIsJson();\n $this->restModule->seeResponseCodeIs(200);\n $this->restModule->seeResponseMatchesJsonType([\n 'total' => 'integer',\n 'count' => 'integer',\n 'page' => 'integer',\n 'data' => 'array'\n ]);\n }", "public function test_list_user()\n {\n $data = factory(User::class)->create();\n $response = $this->get($this->url, $this->headers());\n $response->assertStatus(200);\n $response->assertJsonStructure(array_keys($data->toarray()), $data->toarray());\n $this->assertDatabaseHas($this->table, $data->toarray());\n }", "function get_all_users(){ // Get all users\n\t\t\n\t}", "protected function fetchAllUsers() {\n return $this->makeGetRequest('http://jsonplaceholder.typicode.com/users');\n }", "function it_shows_the_users_list()\n {\n /* Registro los usuarios esperados usando Model Factories */\n factory( User :: class ) -> create([\n 'name' => 'Elisa',\n 'website' => 'www.matiz.co'\n ]);\n factory( User :: class ) -> create([\n 'name' => 'Juliana',\n 'website' => 'www.juliana.me'\n ]);\n\n $this -> get( '/usuarios' ) # Simula petición a la URL /usuarios\n -> assertStatus( 200 ) # Comprueba el estado de la petición\n -> assertSee( 'Usuarios' ) # Comprueba que el código fuente de la página generada se puede ser ese texto\n -> assertSee( 'Elisa' )\n -> assertSee( 'Juliana' );\n }", "public function test_get_users() {\n global $PAGE;\n\n $this->resetAfterTest();\n\n // All users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course);\n $users = $manager->get_users('id');\n $this->assertCount(6, $users, 'All users must be returned when no filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Student role filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 5);\n $users = $manager->get_users('id');\n $this->assertCount(5, $users, 'Only students must be returned when student role filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Teacher role filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 3);\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only teacher must be returned when teacher role filtering is applied.');\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Search user filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, 'userall');\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only searchable user must be returned when search filtering is applied.');\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Group 1 filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group1']->id);\n $users = $manager->get_users('id');\n $this->assertCount(2, $users, 'Only group members must be returned when group filtering is applied.');\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Group 2 filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group2']->id);\n $users = $manager->get_users('id');\n $this->assertCount(3, $users, 'Only group members must be returned when group filtering is applied.');\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // 'No groups' filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', -1);\n $users = $manager->get_users('id');\n $this->assertCount(2, $users, 'Only non-group members must be returned when \\'no groups\\' filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Active users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_ACTIVE);\n $users = $manager->get_users('id');\n $this->assertCount(5, $users, 'Only active users must be returned when active users filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Suspended users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_SUSPENDED);\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only suspended users must be returned when suspended users filtering is applied.');\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n }", "public function getUserList();", "public function test_users_can_get_list_true()\n {\n $this->seed();\n $user = User::where('email', '=', 'a@a.com')->first();\n $token = JWTAuth::fromUser($user);\n\n $response = $this->json('GET','/api/users/list?token='.$token);\n $response->assertStatus(200)->assertJsonCount(2, 'data');\n\n $name = 'shiller';\n $response = $this->json('GET','/api/users/list?token='.$token.'&name='.$name);\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n\n $user = User::where('email', '=', 'b@b.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users/list?token='.$token);\n $response->assertStatus(403);\n }", "public function test_get_all_users_route()\n {\n $response = $this->call('GET', '/api/getAllUsers');\n $this->assertEquals(200, $response->getStatusCode());\n }", "public function testGetAllUser()\n {\n $response = $this->json('GET', \"api/users\");\n if($this->isAdmin) {\n $response\n ->assertStatus(200)\n ->assertJson([\n 'data' => true\n ]);\n } else {\n $response\n ->assertStatus(200)\n ->assertJson([\n 'error-message' => 'Unauthorized.'\n ]);\n }\n \n }", "public function testList()\n {\n $response = $this->get('/api/users');\n\n $response->assertStatus(200)->assertJson([]);\n }", "public function getUsers() {\n }", "public function testUsersAreListed()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs(factory(User::class)->create())\n ->getJson('api/users')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'name',\n 'email',\n ],\n ],\n ])\n ->assertJsonFragment([\n 'id' => $user->id,\n 'name' => $user->name,\n 'email' => $user->email,\n ]);\n }", "public function testAdminCanGetAllUsers()\n {\n $this->WithoutMiddleware();\n\n $admin = factory('Suyabay\\User')->create(['role_id' => 3]);\n $users = factory('Suyabay\\User', 2)->create();\n\n $this->actingAs($admin)\n ->call(\n 'GET',\n '/dashboard/users'\n );\n $this->assertViewHas('users');\n $this->see($users->toArray()[0]['username']);\n $this->assertEquals(\n $users->toArray()[0]['username'],\n self::$userRepository->getAllUsers()->toArray()[1]['username']\n );\n }", "public function getAllUsers(): array;", "public function getUsers()\n {\n $response = $this->request('GET', self::URI_USERS , [\n 'query' => $this->getQuery([\n 'limit' => 1000,\n ])\n ]);\n \n if($response->getStatusCode() != Response::HTTP_OK) {\n return false;\n }\n $body = json_decode($response->getBody()->getContents(), true);\n \n $users = [];\n foreach($body['resources'] as $user){\n $users [] = [\n 'uuid' => $user['uuid'],\n 'email' => $user['email'],\n ];\n }\n \n return $users;\n }", "public function testGetUsers()\n {\n $this->markTestIncomplete(\n 'Test of \"getUsers\" method has not been implemented yet.'\n );\n }", "public function getAllUsers(){\r\n $this->authorize(true);\r\n $this->load->model(\"UserModel\");\r\n $users = $this->UserModel->getAllUsers();\r\n $this->generate_response($users);\r\n }", "public function getUsers(){\n\t\t\n\t}", "public function get_all_users()\n {\n return $this->request_handler('GET', $url_addon='users/');\n\n }", "public function test_users_can_get_all_true()\n {\n $this->seed();\n $user = User::where('email', '=', 'a@a.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users?token='.$token);\n\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n\n $user = User::where('email', '=', 'b@b.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users?token='.$token);\n $response->assertStatus(403);\n }", "public function testGetUsersByIds()\n {\n $result = self::$accountApi->users(null, [self::$USER_GET_ID, self::$USER_UPDATE_ID]);\n\n self::assertCount(2, $result['users']);\n self::assertValidAccountUser($result['users'][0]);\n self::assertValidAccountUser($result['users'][1]);\n }", "public function getUsers()\n {\n $endpoint = '/users'; \n return $this->doRequest('get',$endpoint, User::class, TRUE);\n }", "public function testGetAllUsers()\n {\n $user1 = \\Phoenix\\Models\\User::create(['email' => 'test1@fake.com','password'=>bcrypt('helloworld')]);\n $user2 = \\Phoenix\\Models\\User::create(['email' => 'test2@fake.com','password'=>bcrypt('helloworld')]);\n $this->json('GET','api/users')->seeJson(['email'=> 'test2@fake.com']);\n }", "public function getUsers() {\n $this->getJson(1, ['name', 'root']);\n }", "public function testGetAllUsers()\n {\n $fakeUsers = factory(\\Ingresse\\User::class, 5)->create();\n $users = $this->repository->all();\n\n $this->assertEquals($users->count(), $fakeUsers->count());\n }", "public function testList(): void\n {\n $data = [\n [\n 'userId' => 'user-id',\n 'type' => 'customer',\n 'email' => 'customer@email.test',\n ],\n ];\n\n $entities = $this->getHandler([\n new Response(200, [], \\json_encode($data) ?: ''),\n ])->executeAndRespond(new UserStub(['userId' => 'user-id']), RequestAwareInterface::LIST, 'api-key');\n\n self::assertCount(1, $entities);\n $this->performAssertion($data[0], $entities[0]);\n }", "Public function getAllUsers(){\n\t\t$userId=$this->checklogin();\n\t\t\t\t\n\t\t\t\tif($userId){\n\t\t\t\t\t\n\t\t\t\t\t$data=$this->ApiModel->getDateFormTable('users',\" role='landlord' or role='tenant'\");\n\t\t\t\t\t$res=array('msg'=>'success','allUsers'=>$data);\n\t\t\t\t\techo json_encode($res);\n\t\t\t\t\thttp_response_code(200); \n\t\t\t\t\n\t\t\t\t}\n\t}", "public function testCanGetUsers()\n {\n $response = $this->getJson('/api/v1.0/users');\n\n $response->assertStatus(200);\n }", "public function getByUsers();", "public static function get_all_user(){\n $data = array(\n 'appid' => self::$app_id,\n 'secret_key' => self::$secret_key,\n );\n $url = self::$endpoint . '/api/user/all';\n $response = self::request($data, $url );\n return $response;\n }", "public function testFindAll()\n\t{\n\t\t$model = $this->getUser();\n\n\t\t$response = Request::factory('api/users')\n\t\t\t\t->method(Request::GET)\n\t\t\t\t->execute();\n\n\t\t$this->assertEquals(200, $response->status());\n\t}", "public function testList(\\FunctionalTester $I)\n {\n $I->amGoingTo('check the list of users');\n $I->sendGET('/users');\n\n $I->seeResponseCodeIs(200);\n $I->seeResponseIsJson();\n $I->seeResponseMatchesJsonType([\n 'id' => 'integer',\n 'name' => 'string',\n ]);\n\n // now let's check each item\n $ids = $I->grabDataFromResponseByJsonPath('$..id');\n foreach ($ids as $id) {\n $this->testItem($I, $id);\n }\n }", "public function testCanGetPaginatedUsers()\n {\n $userRepository = App::make(UserRepositoryInterface::class);\n $users = $userRepository->paginate(25);\n\n $this->assertCount(25, $users);\n }", "private function users()\n {\n\n\n if($this->get_request_method() != \"GET\")\n {\n $this->response('',406);\n }\n $sql = mysql_query(\"SELECT UR_id, UR_Emailid, UR_EmailidDomain, UR_FirstName, UR_LastName FROM Users where UR_Tokenid = ''\", $this->db);\n if(mysql_num_rows($sql) > 0)\n {\n $result = array();\n while($rlt = mysql_fetch_array($sql,MYSQL_ASSOC))\n {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result), 200);\n }\n $this->response('',204); // If no records \"No Content\" status\n \n \n\n }", "public function getUserList()\n {\n $where = [];\n $this->usersModel->setTableName(\"users\");\n \n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n \n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy=\"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "function listAllUsers()\n {\n\t\t$queryParts = array(\n\t\t\t'SELECT' => \"*\",\n\t\t\t'FROM' => \"fe_users\",\n\t\t\t'WHERE' => \"deleted=0\",\n\t\t\t'ORDER BY'=> \"name\"\n\t\t);\n\n\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$queryParts['SELECT'],\n\t\t\t$queryParts['FROM'],\n\t\t\t$queryParts['WHERE'],\n\t\t\t'',\n\t\t\t$queryParts['ORDER BY']\n\t\t) or die(\"ERROR: tx_paeproject.form_tools->listAllUsers(req1): \" . $GLOBALS['TYPO3_DB']->sql_error());\n\n\t\t$users=array();\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($result)){\n\t\t\t$user = t3lib_div::makeInstance('tx_paeproject_fe_user');\n\t\t\t$user->load($row[0]);\n\t\t\t$users[] = $user;\n\t\t}\n\t\treturn $users;\n\n\t}", "private function users(){\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$sql = mysql_query(\"SELECT user_id, user_fullname, user_email FROM users WHERE user_status = 1\", $this->db);\n\t\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t\t$result = array();\n\t\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t\t$result[] = $rlt;\n\t\t\t\t}\n\t\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t\t$this->response($this->json($result), 200);\n\t\t\t}\n\t\t\t$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "public function testGetUsersByRole(): void\n {\n $client = static::createAuthenticatedClient([\n 'email' => TestFixtures::PROCESS_MANAGER['email'],\n ]);\n\n $response = $client->request('GET', '/users', ['query' => [\n 'roles' => User::ROLE_ADMIN,\n ]]);\n\n self::assertResponseIsSuccessful();\n self::assertJsonContains([\n '@context' => '/contexts/User',\n '@id' => '/users',\n '@type' => 'hydra:Collection',\n 'hydra:totalItems' => 1,\n ]);\n\n $result = $response->toArray();\n self::assertCount(1, $result['hydra:member']);\n self::assertSame(TestFixtures::ADMIN['email'],\n $result['hydra:member'][0]['email']);\n }", "public function testListAll() {\n // Get mock\n $stub_user = $this->getMock('User');\n\n // Create\n $this->phactory->create('websites');\n\n // Determine length\n $_GET['iDisplayLength'] = 30;\n $_GET['iSortingCols'] = 1;\n $_GET['iSortCol_0'] = 1;\n $_GET['sSortDir_0'] = 'asc';\n\n $dt = new DataTableResponse( $stub_user );\n $dt->order_by( 'b.`company_id`', 'a.`title`', 'b.`contact_name`', 'c.`contact_name`' );\n $dt->add_where( ' AND a.`status` = 1' );\n\n $accounts = $this->account->list_all( $dt->get_variables() );\n $account = current( $accounts );\n\n $this->assertContainsOnlyInstancesOf( 'Account', $accounts );\n $this->assertEquals( self::TITLE, $account->title );\n\n // Get rid of everything\n unset( $user, $_GET, $dt, $accounts, $account, $rent_king_exists );\n }", "function allUsers() {\n $validator = Validator::getInstance();\n $data = $validator->ValidateAllByMask($_GET, 'usersMask');\n if ($data === FALSE) {\n return USERS_FILTER_VALIDATION_ERROR['text'];\n }\n if (isset($_GET['start'])){\n $start = (int)$_GET['start'];\n } else {\n $start = 0;\n }\n $offset = PAGES_OFFSET;\n $user_data = User::getAllWithFilters($data,$start,$offset);\n include ROOTDIR.'/app/views/all_users.html.php';\n }", "function list_users() {\n\t\t$result = array();\n\t\t$data = array(\n\t\t\t\"enrollment_type[]\" => \"student\",\n\t\t\t\"enrollment_state\" => \"active\",\n\t\t\t\"per_page\" => \"100\",\n\t\t\t\"page\" => 1\n\t\t);\n\t\twhile (count($result) % 100 == 0) {\n\t\t\t$returned = call_canvas_url(\"GET\", \"users\", $data);\n\t\t\t$result = array_merge($result, $returned);\n\t\t\t$data[\"page\"] += 1;\n\t\t\tif (count($returned) == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t echo json_encode($result, JSON_PRETTY_PRINT);\n\t}", "private function getUsers() {\n\n\t\treturn $this->_userService->getUsers();\n\t}", "public function test_users_list_is_accessible()\n {\n $response = $this->get(route('api.v1.users.list'));\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)->get(route('api.v1.users.list'));\n $response->assertStatus(Response::HTTP_FORBIDDEN);\n\n $user->permissions()->create([\n 'name' => 'get-users-list',\n ]);\n\n $response = $this->actingAs($user)->get(route('api.v1.users.list'));\n $response->assertStatus(Response::HTTP_OK);\n\n $this->assertEquals($response->json()['data'][0]['username'], $user->username);\n }", "public function testGetUsersByUsername(): void\n {\n $response = static::createAuthenticatedClient([\n 'email' => TestFixtures::ADMIN['email'],\n ])->request('GET', '/users', ['query' => [\n 'username' => TestFixtures::PROJECT_COORDINATOR['username'],\n ]]);\n\n self::assertResponseIsSuccessful();\n self::assertJsonContains([\n '@context' => '/contexts/User',\n '@id' => '/users',\n '@type' => 'hydra:Collection',\n 'hydra:totalItems' => 1,\n ]);\n\n $result = $response->toArray();\n self::assertCount(1, $result['hydra:member']);\n self::assertSame(TestFixtures::PROJECT_COORDINATOR['email'],\n $result['hydra:member'][0]['email']);\n }", "public function showAllUsers() {\n $results = $this->getAllUsers();\n return $results;\n }", "public function getUsers()\n {\n try\n {\n $users = User::with('role')\n ->select('id', 'full_name', 'email', 'phone')\n ->whereHas('role', function($query) {\n $query->where('role_id', '=', 3);\n })\n ->where('id', '!=', 2)\n ->paginate(30);\n\n return ['status' => 1, 'data' => $users];\n }\n catch (Exception $e)\n {\n return ['status' => 0];\n }\n }", "public static function getUserList(){\n $result = User::userList();\n return [\n 'response' => 200,\n 'message' => 'User list',\n 'result' => $result\n ];\n }", "public function getUsers()\n {\n\n $start = 1;\n $count = $this->pagecount;\n $users = [];\n\n $end = false;\n\n do {\n\n $body = $this->_request('GET', \"Users?startIndex=$start&count=$count\");\n\n $totalResults = $body->totalResults;\n $itemsPerPage = $body->itemsPerPage;\n $startIndex = $body->startIndex;\n\n if ($startIndex + $itemsPerPage - 1 >= $totalResults) {\n $end = true;\n } else {\n $start = $startIndex + $count;\n }\n\n foreach ($body->Resources as $resource) {\n if ($resource->displayName) {\n $users[] = $resource->displayName;\n } elseif ($resource->userName) {\n $users[] = $resource->userName;\n } else {\n continue;\n }\n $this->_cacheUser($resource);\n }\n } while(!$end);\n\n return $users;\n }", "public function testGetUsersById()\n {\n $result = self::$accountApi->users(null, [self::$USER_GET_ID]);\n\n self::assertCount(1, $result['users']);\n self::assertValidAccountUser($result['users'][0], ['id' => self::$USER_GET_ID]);\n }", "public function listUsers() {\n\t\t$query = \"SELECT * FROM users\";\n\t\t$resultatlist = $this->db->getAll($query);\n\t\treturn $resultatlist;\n\t}", "public function users()\n\t{\n\t\t$response = $this->client->get( 'account/users' );\n\t\treturn $response->getBody();\n\n\t}", "private function users(){\t\n\t\t\t// Cross validation if the request method is GET else it will return \"Not Acceptable\" status\n\t\t\t\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t$sql = mysql_query(\"SELECT user_id, user_fullname, user_email FROM users \", $this->db);\n\t\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t\t$result = array();\n\t\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t\t$result[] = $rlt;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t\t$this->response($this->json($result), 200);\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "public function testUsersAreListed()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('users')\n ->assertSuccessful()\n ->assertSee($user->name);\n }", "private function users(){ \n\t\t// Cross validation if the request method is GET else it will return \"Not Acceptable\" status\n\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t$this->response('',406);\n\t\t}\n\t\t$sql = mysql_query(\"SELECT U.USUARIO_ID, U.USUARIO, P.PRIMER_NOMBRE, P.SEGUNDO_NOMBRE, P.PRIMER_APELLIDO, P.SEGUNDO_APELLIDO, P.CEDULA, P.CORREO, P.TELEFONO, P.FECHA_NACIMIENTO FROM NG_USUARIOS as U, NG_PERSONAS as P WHERE U.FK_PERSONA_ID = P.PERSONA_ID AND U.ESTADO = 1;\", $this->db);\n\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t$result = array();\n\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t$result[] = $rlt;\n\t\t\t}\n\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t$this->response($this->json($result), 200);\n\t\t}\n\t\t$this->response('',204); // If no records \"No Content\" status\n\t}", "public function test_api_fetch_all_user()\n {\n\n $this->actingAs($user = User::factory()->create());\n\n $token = $user->tokens()->create([\n 'name' => 'Test Token',\n 'token' => Str::random(40),\n 'abilities' => ['create', 'read'],\n ]);\n\n\n\n $header=[\n 'Authorization' => 'Bearer '.$token,\n 'Accept' => 'application/json',\n 'Access-Control-Allow-Origin' => '*',\n ];\n\n $this->withHeaders($header)->get(route('user.index'))->assertStatus(200);\n }", "function list_users() {\n return $this->DB->get('users', null);\n }", "public function get_list_of_users() {\n $request = $_GET;\n $result = $this->users_model->get_list_of_users_data($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "public function show_users(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/user_api/all_user';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\n\n\t}", "public function pullClientUsers();", "public function readAll(){\n $users = $this->getUsers();\n return $users;\n }", "public function get_users() {\n\t\t\treturn $this->run( 'users' );\n\t\t}", "public function GetUsers()\n\t{\n\t\t$users = UserDAL::GetAllUsers();\n\t\tif($users)\n\t\t\treturn $users;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getTestUsers()\n {\n\n $client = new Client();\n // Get app access token\n $response = $client->request(\n 'GET',\n 'https://graph.facebook.com/'.$this->API_version.\n '/oauth/access_token?client_id='.$this->client_id.'&client_secret='.$this->client_secret.\n '&grant_type=client_credentials'\n );\n $app_access_token = json_decode($response->getBody())->access_token;\n $response = $client->request(\n 'GET',\n 'https://graph.facebook.com/'.$this->API_version.\n '/'.$this->client_id.'/accounts/test-users?access_token='.$app_access_token\n );\n\n return json_decode($response->getBody());\n }", "public function getUserList()\n {\n $requestManager= new ServerRequestManager();\n $requestManager->setDatabase($requestManager->getDatabaseUsers());\n $requestManager->setOperation('WS:OP:GET');\n $requestManager->setCollection('CUser');\n $requestManager->setQuery(Tags::kTAG_USER_DOMAIN,Types::kTYPE_STRING,'TIP', Operators::kOPERATOR_EQUAL);\n \n return $requestManager->sendRequest();\n }", "public function listUsers() {\n\t\t$sql = \"SELECT userName FROM users ORDER BY userName\";\n\t\t$result = $this->executeQuery($sql);\n\t\treturn $result;\n\t}", "public function getAllUsers()\n {\n // sql statement\n $sql = \"SELECT * FROM users AS t1 LEFT JOIN users_info as t2 ON t2.id=t1.id;\";\n return $this->execQuery($sql);\n\n }", "public function testGetUsers()\n {\n $client = new ClinchPadClient('api-key');\n $resource = new ClinchPadUsers($client);\n $resource->getUsers();\n\n $this->assertEquals('GET', $client->getClient()->method);\n $this->assertEquals($client->getEndpoint() . '/users', $client->getClient()->uri);\n }", "public function fetchUsers()\n {\n $this->factory->fetchData();\n }", "public function testGetUsers()\n {\n echo 'Test GetUsers' . \"\\n\";\n $team = self::getTeam('Test');\n $users = $team->getUsers();\n foreach ($users as $user) {\n $this->assertInstanceOf('IBW\\WebsiteBundle\\Entity\\User', $user);\n }\n $this->assertEquals(2, count($users));\n }", "private function getAllUsers() {\n $limit = \"\";\n\n // Pagination\n if($this->hits && $this->page) {\n $limit = \" LIMIT $this->hits OFFSET \" . (($this->page - 1) * $this->hits);\n }\n\n // Create sql-query (only show movies that are published and not deleted)\n $this->query = \"SELECT * FROM user\";\n\n // Set how many rows\n $rowsQuery = $this->db->ExecuteSelectQueryAndFetchAll($this->query);\n $this->rows = $this->setSqlRows($rowsQuery);\n\n $this->query .= \" GROUP BY $this->orderby $this->order\";\n $this->query .= \" $limit\";\n\n // Get data\n return $this->db->ExecuteSelectQueryAndFetchAll($this->query);\n\n }", "public function getAllUserLists()\n {\n return self::get();\n }", "public function list_users() {\n\n\t\tforeach( $this->users as $user ) {\n\n\t\t\techo 'Name: ' . $user['name'];\n\t\t\techo 'Email: ' . $user['email'];\n\n\t\t}\n\t}", "public function users_get()\n {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => 'john@example.com'],\n ['id' => 1, 'name' => 'Jim', 'email' => 'jim@example.com'],\n ];\n\n $id = $this->get('id');\n\n if ($id === null) {\n // Check if the users data store contains users\n if ($users) {\n // Set the response and exit\n $this->response($users, 200);\n } else {\n // Set the response and exit\n $this->response([\n 'status' => false,\n 'message' => 'No users were found'\n ], 404);\n }\n } else {\n if (array_key_exists($id, $users)) {\n $this->response($users[$id], 200);\n } else {\n $this->response([\n 'status' => false,\n 'message' => 'No such user found'\n ], 404);\n }\n }\n }", "protected function retrieveUserList() {\n $model = new aam_View_User;\n\n return $model->retrieveList();\n }", "function getUserList() {\n\n\t$url = COUCH_DB_HOST.\":\".COUCH_DB_PORT.\"/\".COUCH_DB_NAME.\"/_design/users/_view/checkedin\";\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $result;\n\n}", "public function testlListAction()\n {\n $this->client->request('GET', \"/users\");\n $this->assertEquals(302, $this->client->getResponse()->getStatusCode());\n $crawler = $this->client->followRedirect();\n $this->assertGreaterThan(\n 0,\n $crawler\n ->filter('html:contains(\"Créer un utilisateur\")')\n ->count()\n );\n\n // ASSERT 200 LOGIN ADMIN\n $this->logIn($this->client, 'admin');\n $crawler = $this->client->request('GET', \"/users\");\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(\n 0,\n $crawler\n ->filter('html:contains(\"Créer un utilisateur\")')\n ->count()\n );\n\n // ASSERT 403 LOGIN USER\n $this->logIn($this->client, 'user');\n $this->client->request('GET', \"/users\");\n\n $this->assertEquals(403, $this->client->getResponse()->getStatusCode());\n }", "public function all_users(){\n return $this->user::all();\n }", "private function getUsers()\n {\n $get_response = Http::withHeaders([\n 'accept' => 'application/json'\n ])\n ->get('https://eagle-backend-dev.somosagility.com.br/getTeste')\n ->body();\n\n // Busca os dados na API usando o protocolo POST\n $post_response = Http::withHeaders([\n 'accept' => 'application/json'\n ])\n ->post('https://eagle-backend-dev.somosagility.com.br/postTeste?key=%4056a9yRoC%23M56y0tW')\n ->body();\n\n // Decodifica o JSON, e busca a propriedade onde os objetos de usuário estão\n $get_response_users = json_decode($get_response, true)['user'];\n $post_response_users = json_decode($post_response, true)['user']['entries'];\n\n // Une os resultados das duas chamadas em um único array de usuários\n $users = Arr::collapse([$get_response_users, $post_response_users]);\n\n // Cria uma coleção e ordena por empresa\n $collection = collect($users);\n $sorted = $collection->sortBy('customer', SORT_NATURAL);\n\n $sorted_users = $sorted->values()->all();\n\n return $sorted_users;\n }", "public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'mnetservice_enrol';\n\n // Create a user.\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n\n // Create user2.\n $user2 = $this->getDataGenerator()->create_user();\n\n $userlist = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist);\n $this->assertCount(0, $userlist);\n\n // Create a test MNet service enrol enrolments.\n $remotecourseid = 101;\n $this->insert_mnetservice_enrol_courses($remotecourseid);\n $this->insert_mnetservice_enrol_enrolments($user->id, $remotecourseid);\n $this->insert_mnetservice_enrol_enrolments($user2->id, $remotecourseid);\n\n // The list of users within the user context should contain only user.\n provider::get_users_in_context($userlist);\n $this->assertCount(1, $userlist);\n $this->assertFalse(in_array($user2->id, $userlist->get_userids()));\n $this->assertTrue(in_array($user->id, $userlist->get_userids()));\n\n // The list of users within the system context should be empty.\n $systemcontext = context_system::instance();\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }", "public function list()\n {\n try {\n if (!\\Gate::allows('isAdmin')) {\n return $this->unauthorizedResponse();\n }\n $users = User::withTrashed()->get(['name', 'id']);\n return $this->sendResponse($users, trans('actions.get.success'));\n } catch (Exception $ex) {\n return $this->sendError([], trans('actions.get.failed'));\n }\n }", "public function actionListUsers() {\n $access = $this->actionCheckPermissions('UsersAccess');\n $fullAccess = false;\n if ($access)\n $fullAccess = $this->actionCheckPermissions('UsersFullAccess');\n if (!$access)\n $this->sendResponse(403, \"User {$this->user} does not have permission to run UsersIndex\");\n $users = User::model()->findAll();\n $userAttr = User::model()->attributes;\n if (!$fullAccess) {\n unset($userAttr['password']);\n unset($userAttr['userKey']);\n }\n $userAttr = array_keys($userAttr);\n $userList = array();\n foreach ($users as $user) {\n $userList[] = $user->getAttributes($userAttr);\n }\n $this->_sendResponse(200, $userList, true);\n }", "public function getAllUsers()\n {\n return $this->entityManager->getRepository(User::class)\n ->findBy([], ['id' => 'ASC']);\n }" ]
[ "0.79755354", "0.7923177", "0.78963685", "0.7876204", "0.7869654", "0.78542894", "0.7839341", "0.7839341", "0.7839341", "0.7823344", "0.7823344", "0.7811047", "0.78060174", "0.7801998", "0.77962685", "0.77711606", "0.7727126", "0.77125156", "0.769839", "0.7696706", "0.7663316", "0.76277924", "0.7624821", "0.75794244", "0.7561524", "0.75425655", "0.753409", "0.752446", "0.7517984", "0.75057536", "0.74826115", "0.7443739", "0.74291176", "0.7418884", "0.74140584", "0.7408366", "0.7406368", "0.73856324", "0.73499185", "0.73302394", "0.73257226", "0.73151344", "0.7304213", "0.73011625", "0.72881395", "0.7275867", "0.7272238", "0.724549", "0.7239141", "0.7236077", "0.72345203", "0.72220284", "0.7208342", "0.72076666", "0.7206058", "0.7198969", "0.7194545", "0.7187474", "0.717725", "0.71622705", "0.7148873", "0.71467507", "0.7127005", "0.711482", "0.7112773", "0.711025", "0.7100063", "0.70766515", "0.7073728", "0.7066674", "0.70620286", "0.70513314", "0.705005", "0.7044242", "0.7039132", "0.7032449", "0.7032033", "0.7029412", "0.7025862", "0.70210016", "0.70196146", "0.7016036", "0.701378", "0.7010904", "0.7008648", "0.70007795", "0.6994094", "0.6992892", "0.69919854", "0.6989934", "0.6986615", "0.6985405", "0.6981411", "0.6972925", "0.6972337", "0.6971231", "0.6970752", "0.69672287", "0.69651455", "0.69637036" ]
0.79618716
1
Test we can get paginated users.
Мы можем получить пользователей с пагинацией.
public function testCanGetPaginatedUsers() { $userRepository = App::make(UserRepositoryInterface::class); $users = $userRepository->paginate(25); $this->assertCount(25, $users); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetListWithPaginaton()\n {\n //create user\n $teacher = $this->CreateTeacher();\n $lisUser = $this->CreateTeacherUser($teacher);\n\n //now we have created studentuser set to current controller\n $this->controller->setLisUser($lisUser);\n $this->controller->setLisPerson($teacher);\n\n $this->request->setMethod('get');\n\n //set record limit to 1\n $q = 'page=1&limit=1'; //imitate real param format\n $params = [];\n parse_str($q, $params);\n foreach ($params as $key => $value) {\n $this->request->getQuery()->set($key, $value);\n }\n\n $result = $this->controller->dispatch($this->request);\n $response = $this->controller->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(1, $result->success);\n $this->assertLessThanOrEqual(1, count($result->data));\n $this->PrintOut($result, false);\n }", "public function test_list_user_show_in_first_page()\n {\n $userPerPage = config('define.user.limit_rows');\n\n $this->browse(function (Browser $browser) use ($userPerPage) {\n $browser->loginAs($this->admin)\n ->visit($this->listTestPage);\n\n $userPageOne = $browser->elements('@elementGetUser');\n $this->assertEquals(count($userPageOne), $userPerPage);\n });\n }", "public function test_get_all_owners_paginated()\n {\n \n $repo = app(OwnerRepository::class);\n \n $data = $repo->getPaginated();\n \n $expected = $this->createPaginated($data, new OwnerTransformer);\n \n $token = $this->loginAsAdmin();\n \n $link = 'v1/owners';\n \n $this->get($link, $token);\n \n $this->seeJson($expected->toArray());\n \n \n }", "public function test_list_user_show_in_last_page()\n {\n $userPerPage = config('define.user.limit_rows');\n $numOfPage = ceil(self::CREATED_USER / $userPerPage);\n $lastPage = self::CREATED_USER % $userPerPage;\n\n $this->browse(function (Browser $browser) use ($userPerPage, $numOfPage, $lastPage) {\n $browser->loginAs($this->admin)\n ->visit($this->listTestPage->url() .'?page=' . $numOfPage)\n ->assertSee(trans('user.admin.list.title'));\n \n $userLastPage = $browser->elements('@elementGetUser');\n $this->assertEquals(count($userLastPage), ($lastPage + 1));\n });\n }", "public function testGetPaginatedCallList()\n {\n }", "function getUsers($start, $count);", "public function paginate()\n {\n return $this->user->paginate();\n }", "public function testCanGetAllUsers()\n {\n $userRepository = App::make(UserRepositoryInterface::class);\n $users = $userRepository->all();\n\n // Database is seeded with 50 users\n $this->assertCount(50, $users);\n }", "public function testItCanListingEntity()\n {\n $amount = 2;\n factory(User::class, $amount)->create();\n\n $list = $this->userService->paginate();\n $data = current($list->items())->toArray();\n\n $this->assertInstanceOf(LengthAwarePaginator::class, $list);\n $this->assertEquals($amount, $list->total());\n\n foreach ($this->dataStructure() as $key) {\n $this->assertArrayHasKey($key, $data);\n }\n }", "public function testPagination(): void\n {\n $datasource = new DataSource($this->createDriverMock());\n\n $max = 20;\n $first = 40;\n\n $datasource->setMaxResults($max);\n $datasource->setFirstResult($first);\n\n self::assertEquals($max, $datasource->getMaxResults());\n self::assertEquals($first, $datasource->getFirstResult());\n }", "public function testGetUsers()\n {\n $this->markTestIncomplete(\n 'Test of \"getUsers\" method has not been implemented yet.'\n );\n }", "public function getPaginatedList()\n {\n return User::query()\n ->orderBy('created_at', 'desc')\n ->paginate(config('app.extra.users.list_per_page'));\n }", "public function paginate();", "public function paginate();", "function getUsers($page = 1, $order = 'nombre', $filtro = null) {\n }", "public function testGetList()\n\t{\n\t\t$user = TestHelper::createUser(UserStatus::ACTIVE)->user;\n\n\t\t$this->be($user);\n\t\t$this->call('GET', 'user/list');\n\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('users');\n\t}", "public function paginate()\n {\n return $this->userRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "function results_are_paged()\n {\n }", "public function testListUsers()\n {\n // just to be sure\n $createdUsers = [\n $this->auth->createAnonymousUser(),\n $this->auth->createAnonymousUser(),\n ];\n\n $users = $this->auth->listUsers($maxResults = 2, $batchSize = 1);\n\n $count = 0;\n foreach ($users as $userData) {\n $this->assertInternalType('array', $userData);\n $this->assertArrayHasKey('localId', $userData);\n ++$count;\n }\n\n $this->assertSame($maxResults, $count);\n\n foreach ($createdUsers as $createdUser) {\n $this->auth->deleteUser($createdUser);\n }\n\n $this->assertTrue($noExceptionHasBeenThrown = true);\n }", "public function getPagination();", "public function getPagination();", "public function testCanGetUsers()\n {\n $response = $this->getJson('/api/v1.0/users');\n\n $response->assertStatus(200);\n }", "public function testPageOfUsers()\n {\n $this->visit('/')\n ->click('Users managing')\n ->seePageIs('/users');\n }", "public function getPaginate() {}", "public function testgetAllUsersMethod()\n {\n $this->WithoutMiddleware();\n $users = factory('Suyabay\\User', 2)->create();\n $getUsers = self::$userRepository->getAllUsers();\n\n $this->assertTrue(is_array($getUsers->toArray()));\n $this->assertEquals($users[0]['username'], $getUsers[0]['username']);\n }", "public function testShouldReturnAllUsers()\n {\n $this->get('/api/users')\n ->seeStatusCode(200)\n ->seeJsonStructure(['*' => $this->structer]);\n }", "public function getAllUsersTest(){\n $client = new Client($_ENV['PUBLIC_URL'], array(\n 'request.options' => array(\n 'exceptions' => false,\n )\n ));\n\n $request = $client->get('/v1/users');\n $response = $request->send();\n\n $this->assertEquals(201, $response->getStatusCode());\n }", "public function testPaginateMethod()\n {\n Foo::factory(20)->create();\n $foos = $this->app->make(FooRepository::class);\n\n $foosPaginated = $foos->paginate(10);\n\n $this->assertInstanceOf(\\Illuminate\\Pagination\\LengthAwarePaginator::class, $foosPaginated);\n $this->assertCount(10, $foosPaginated);\n }", "public function testListUsers()\n {\n $response = $this->json('GET', '/api/v1/users');\n $response->assertStatus(200);\n }", "public function index()\n {\n $users = User::filtered()->paginate(self::limit());\n\n return $this->response->paginator($users, new UserTransformer());\n }", "function apiAdminUsersList()\n {\n $adminToken = file_get_contents(codecept_data_dir('admin_token.json'));\n $this->restModule->haveHttpHeader('token', $adminToken);\n $this->restModule->haveHttpHeader('Content-Type', 'application/json');\n $this->restModule->sendGET('/users/1/25');\n $this->restModule->seeResponseIsJson();\n $this->restModule->seeResponseCodeIs(200);\n $this->restModule->seeResponseMatchesJsonType([\n 'total' => 'integer',\n 'count' => 'integer',\n 'page' => 'integer',\n 'data' => 'array'\n ]);\n }", "public function testGetAllUsers()\n {\n $response = $this->json('GET', '/user');\n $response->assertStatus(200);\n }", "public function hasPagination(): bool;", "public function test_get_users() {\n global $PAGE;\n\n $this->resetAfterTest();\n\n // All users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course);\n $users = $manager->get_users('id');\n $this->assertCount(6, $users, 'All users must be returned when no filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Student role filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 5);\n $users = $manager->get_users('id');\n $this->assertCount(5, $users, 'Only students must be returned when student role filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Teacher role filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 3);\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only teacher must be returned when teacher role filtering is applied.');\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Search user filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, 'userall');\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only searchable user must be returned when search filtering is applied.');\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Group 1 filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group1']->id);\n $users = $manager->get_users('id');\n $this->assertCount(2, $users, 'Only group members must be returned when group filtering is applied.');\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // Group 2 filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', $this->groups['group2']->id);\n $users = $manager->get_users('id');\n $this->assertCount(3, $users, 'Only group members must be returned when group filtering is applied.');\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n\n // 'No groups' filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', -1);\n $users = $manager->get_users('id');\n $this->assertCount(2, $users, 'Only non-group members must be returned when \\'no groups\\' filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Active users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_ACTIVE);\n $users = $manager->get_users('id');\n $this->assertCount(5, $users, 'Only active users must be returned when active users filtering is applied.');\n $this->assertArrayHasKey($this->users['user0']->id, $users);\n $this->assertArrayHasKey($this->users['user1']->id, $users);\n $this->assertArrayHasKey($this->users['user21']->id, $users);\n $this->assertArrayHasKey($this->users['userall']->id, $users);\n $this->assertArrayHasKey($this->users['usertch']->id, $users);\n\n // Suspended users filtering.\n $manager = new course_enrolment_manager($PAGE, $this->course, null, 0, '', 0, ENROL_USER_SUSPENDED);\n $users = $manager->get_users('id');\n $this->assertCount(1, $users, 'Only suspended users must be returned when suspended users filtering is applied.');\n $this->assertArrayHasKey($this->users['user22']->id, $users);\n }", "public function test_users_can_get_all_true()\n {\n $this->seed();\n $user = User::where('email', '=', 'a@a.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users?token='.$token);\n\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n\n $user = User::where('email', '=', 'b@b.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users?token='.$token);\n $response->assertStatus(403);\n }", "public function index(GetUsersRequest $request)\n {\n $users = User::filters($request);\n\n if (isset($request->items_per_page))\n return $users->paginate($request->items_per_page);\n\n return $users->paginate(20);\n }", "public function test_users_can_get_list_true()\n {\n $this->seed();\n $user = User::where('email', '=', 'a@a.com')->first();\n $token = JWTAuth::fromUser($user);\n\n $response = $this->json('GET','/api/users/list?token='.$token);\n $response->assertStatus(200)->assertJsonCount(2, 'data');\n\n $name = 'shiller';\n $response = $this->json('GET','/api/users/list?token='.$token.'&name='.$name);\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n\n $user = User::where('email', '=', 'b@b.com')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/users/list?token='.$token);\n $response->assertStatus(403);\n }", "public function testGetPages()\n {\n $pages = $this->service->getPages();\n $this->assertTrue(is_array($pages));\n $this->assertLessThanOrEqual(20, count($pages));\n }", "public function testGetItemCountPerPage(): void\r\n {\r\n $page = $this->getPaginator()->getItemCountPerPage();\r\n\r\n // Verifica se o conteudo veio correto\r\n $this->assertEquals(10, $page);\r\n $this->assertTrue(is_int($page));\r\n $this->assertFalse(is_string($page));\r\n }", "public function getUsers()\n {\n\n $start = 1;\n $count = $this->pagecount;\n $users = [];\n\n $end = false;\n\n do {\n\n $body = $this->_request('GET', \"Users?startIndex=$start&count=$count\");\n\n $totalResults = $body->totalResults;\n $itemsPerPage = $body->itemsPerPage;\n $startIndex = $body->startIndex;\n\n if ($startIndex + $itemsPerPage - 1 >= $totalResults) {\n $end = true;\n } else {\n $start = $startIndex + $count;\n }\n\n foreach ($body->Resources as $resource) {\n if ($resource->displayName) {\n $users[] = $resource->displayName;\n } elseif ($resource->userName) {\n $users[] = $resource->userName;\n } else {\n continue;\n }\n $this->_cacheUser($resource);\n }\n } while(!$end);\n\n return $users;\n }", "function list_users() {\n\t\t$result = array();\n\t\t$data = array(\n\t\t\t\"enrollment_type[]\" => \"student\",\n\t\t\t\"enrollment_state\" => \"active\",\n\t\t\t\"per_page\" => \"100\",\n\t\t\t\"page\" => 1\n\t\t);\n\t\twhile (count($result) % 100 == 0) {\n\t\t\t$returned = call_canvas_url(\"GET\", \"users\", $data);\n\t\t\t$result = array_merge($result, $returned);\n\t\t\t$data[\"page\"] += 1;\n\t\t\tif (count($returned) == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t echo json_encode($result, JSON_PRETTY_PRINT);\n\t}", "public function index()\n {\n return User::paginate(25);\n }", "function getAllUserByPagging(){\r\r $logged_in_userid = Auth::instance()->get_user()->id;\r\r $users_list = $this->select('users.*');\r \r if($_POST['lead_user_id']!='')\r $users_list= $users_list->where('id', '=', $_POST['lead_user_id']);\r\r if($_POST['lead_user_first_name']!='')\r $users_list= $users_list->where('first_name', 'like', '%'.$_POST['lead_user_first_name'].'%');\r\r if($_POST['lead_user_last_name']!='')\r $users_list= $users_list->where('last_name', 'like', '%'.$_POST['lead_user_last_name'].'%');\r \r if($_POST['lead_user_email']!='')\r $users_list= $users_list->where('email', 'like', '%'.$_POST['lead_user_email'].'%');\r \r $users_list = $users_list->find_all();\r $users_list = $users_list->as_array();\r\r $count_users_list = count($users_list);\r\r // Create an instance of Pagination class and set values\r $pagination_users = Pagination::factory(array(\r 'total_items' => $count_users_list,\r 'items_per_page' => 10,\r ));\r\r $users_list = $this->select('users.*');\r\r if($_POST['lead_user_id']!='')\r $users_list= $users_list->where('id', '=', $_POST['lead_user_id']);\r\r if($_POST['lead_user_first_name']!='')\r $users_list= $users_list->where('first_name', 'like', '%'.$_POST['lead_user_first_name'].'%');\r\r if($_POST['lead_user_last_name']!='')\r $users_list= $users_list->where('last_name', 'like', '%'.$_POST['lead_user_last_name'].'%');\r\r if($_POST['lead_user_email']!='')\r $users_list= $users_list->where('email', 'like', '%'.$_POST['lead_user_email'].'%');\r \r $users_list = $users_list->limit($pagination_users->items_per_page);\r $users_list = $users_list->offset($pagination_users->offset);\r $users_list = $users_list->find_all();\r $users_list = $users_list->as_array();\r\r $page_links_pagging_users = $pagination_users->render();\r\r $return_users_data['users_list'] = $users_list;\r $return_users_data['count_users_list'] = $count_users_list;\r $return_users_data['page_links_pagging_users'] = $page_links_pagging_users;\r\r return $return_users_data;\r }", "public function testPagination() {\n /** @var \\Drupal\\Component\\Serialization\\JsonapiResourceConfig $resource_config */\n // Unset filters of resource config in this test as those limit the results.\n $this->setResouceConfigValue(['default_filter' => []]);\n $this->createDefaultContent(300, 1, FALSE, TRUE, static::IS_NOT_MULTILINGUAL);\n\n // 1. Check pagination using default page limit of jsonapi.\n $response = $this->drupalGet('/api/articles');\n $this->assertPagination(Json::decode($response), OffsetPage::SIZE_MAX);\n\n // 2. Check with an increased page limit.\n $this->setResouceConfigValue(['page_limit' => static::PAGE_LIMIT_OVERRIDE_VALUE]);\n $response = $this->drupalGet('/api/articles', [\n 'query' => ['page[limit]' => static::PAGE_LIMIT_OVERRIDE_VALUE],\n ]);\n $this->assertPagination(Json::decode($response), static::PAGE_LIMIT_OVERRIDE_VALUE);\n\n // 3. Make sure query values higher than the configured limit won't yield\n // more results.\n $query_override = static::PAGE_LIMIT_OVERRIDE_VALUE + OffsetPage::SIZE_MAX;\n $response = $this->drupalGet('/api/articles', [\n 'query' => ['page[limit]' => $query_override],\n ]);\n $response = Json::decode($response);\n $this->assertArrayHasKey('data', $response);\n $this->assertNotEqual(count($response['data']), $query_override);\n $this->assertEqual(count($response['data']), static::PAGE_LIMIT_OVERRIDE_VALUE);\n }", "public function testGetAllUsers()\n {\n Sanctum::actingAs(InternalUser::factory()->create(), ['*']);\n\n $response = $this->get('api/user');\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'Leanne Graham'])\n ->assertJsonFragment(['username' => 'Kamren'])\n ->assertJsonFragment(['email' => 'Rey.Padberg@karina.biz']);\n\n // Call it again, it will be cached on the database:\n $response = $this->get('api/user');\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'Leanne Graham'])\n ->assertJsonFragment(['username' => 'Kamren'])\n ->assertJsonFragment(['email' => 'Rey.Padberg@karina.biz']);\n }", "public function testListUser()\n {\n $user = User::inRandomOrder()->where('user-id', '!=', config('app.admin_id'))->first();\n $response = $this->json('GET', '/api/v1/users/'.$user->{'user-id'});\n $response->assertStatus(200);\n }", "public function index()\n {\n return UserResource::collection(User::paginate(15));\n }", "public function index()\n {\n $this->authorize('list-users');\n return User::paginate();\n }", "public function index()\n {\n // TODO create middleware to check if user has verified email\n // TODO create eloquent queries to check if the APPROVED USER has verified email\n\n if (request()->query('unverified') == 1) {\n $unverified = User::doesnthave('userProfile')->paginate(10);\n return UserResource::collection($unverified);\n }\n\n if (request()->query('approved') == 1) {\n $approved = User::with('userProfile')->whereHas('userProfile', function($q) {\n return $q->where('membership_status', '=', 'Approved');\n })->where('email', '!=', Auth::user()->email)->paginate(10);\n return UserResource::collection($approved);\n }\n\n if (request()->query('pending') == 1) {\n $pending = User::whereHas('userProfile', function($q){\n $q->where('membership_status', '=', 'Pending');\n })->with('userProfile')->where('email', '!=', Auth::user()->email)->paginate(10);\n\n return UserResource::collection($pending);\n }\n }", "function getUserList() {\n include 'db/config.php';\n require_once 'actPaginator.php';\n\n $role = $_GET[\"role\"];\n\n $query = \"SELECT COUNT(*) FROM $dbName.users\";\n $result = mysql_query($query, $db) or die(mysql_error());\n\n $pages = new Paginator;\n $pages->items_total = $result;\n $pages->mid_range = 7;\n $pages->paginate();\n $query = \"SELECT $dbName.users.userid,\n\t\t\t\t$dbName.users.name,\n\t\t\t\t$dbName.users.email,\n\t\t\t\t$dbName.users.telephone,\n $dbName.users.password,\n\t\t\t\t$dbName.users.role\n\t\t\t\tFROM $dbName.users WHERE role = '\" . $role . \"' $pages->limit\";\n\n $result = mysql_query($query, $db) or die(mysql_error());\n echo $pages->display_pages();\n echo $pages->display_jump_menu();\n //echo $pages->display_items_per_page();\n\n return $result;\n mysql_close($db);\n}", "public function testListFirstPage()\n {\n //Create a ramdom user\n $user = factory(User::class)->create();\n //Creates ramdoms products\n $products = factory(Products::class, 10)->create();\n //acting as first user created\n $this->actingAs($user);\n //make request\n $response = $this->json('GET', '/api/products?items_per_page=5');\n //checks if created 5 products\n $response->assertJsonFragment(['to' => 5]);\n $response->assertStatus(200);\n }", "public function testGetPaginator()\n {\n $request = $this->createMock(Request::class);\n\n $this->assertIsObject($this->resource->paginator($request));\n $this->assertIsObject($this->resource->getPaginator($request));\n }", "public function test_get_all_users_route()\n {\n $response = $this->call('GET', '/api/getAllUsers');\n $this->assertEquals(200, $response->getStatusCode());\n }", "#[Route('/wishmap/users', name: 'find_all_users')]\n public function findAllUsers(PaginatorInterface $paginator, Request $request, UserRepository $userRepository)\n {\n $users = $userRepository->findAllNoPrivate();\n\n $pagination = $paginator->paginate(\n $users,\n $request->query->getInt('page', 1),\n 10 //maximum values of users nicknames on page\n );\n\n return $this->render('user/all_profiles.html.twig', [\n 'users' => $pagination\n ]);\n }", "public function index()\n {\n return $this->responseTrait(UserResource::collection(User::latest()->paginate(10)));\n }", "function allUsers() {\n $validator = Validator::getInstance();\n $data = $validator->ValidateAllByMask($_GET, 'usersMask');\n if ($data === FALSE) {\n return USERS_FILTER_VALIDATION_ERROR['text'];\n }\n if (isset($_GET['start'])){\n $start = (int)$_GET['start'];\n } else {\n $start = 0;\n }\n $offset = PAGES_OFFSET;\n $user_data = User::getAllWithFilters($data,$start,$offset);\n include ROOTDIR.'/app/views/all_users.html.php';\n }", "public function index()\n {\n return User::paginate();\n }", "public function test_get_potential_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers) {\n global $DB, $PAGE;\n $this->resetAfterTest();\n $this->setAdminUser();\n\n $enrol = $DB->get_record('enrol', array('courseid' => $this->course->id, 'enrol' => 'manual'));\n $manager = new course_enrolment_manager($PAGE, $this->course);\n $users = $manager->get_potential_users($enrol->id,\n 'testapiuser',\n true,\n 0,\n $perpage,\n 0,\n $returnexactcount);\n\n $this->assertCount($expectedusers, $users['users']);\n $this->assertEquals($expectedmoreusers, $users['moreusers']);\n if ($returnexactcount) {\n $this->assertArrayHasKey('totalusers', $users);\n $this->assertEquals($expectedtotalusers, $users['totalusers']);\n } else {\n $this->assertArrayNotHasKey('totalusers', $users);\n }\n }", "public function index() {\n return UsersResource::collection(User::paginate(10));\n \n }", "public function testGetAllUser()\n {\n $response = $this->json('GET', \"api/users\");\n if($this->isAdmin) {\n $response\n ->assertStatus(200)\n ->assertJson([\n 'data' => true\n ]);\n } else {\n $response\n ->assertStatus(200)\n ->assertJson([\n 'error-message' => 'Unauthorized.'\n ]);\n }\n \n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function testUsersPage(): void\n {\n $crawler = $this->client->request('GET', '/admin/users');\n\n // Validate a successful response and some content\n $this->assertResponseIsSuccessful();\n $this->assertSelectorTextSame('h1', 'Liste des utilisateurs');\n }", "public function index()\n {\n return GuestUser::latest()->paginate(env('PAGE_NO', '10'));\n }", "public function testSimplePaginateMethod()\n {\n Foo::factory(20)->create();\n $foos = $this->app->make(FooRepository::class);\n\n $foosPaginated = $foos->simplePaginate(10);\n\n $this->assertInstanceOf(\\Illuminate\\Pagination\\Paginator::class, $foosPaginated);\n $this->assertCount(10, $foosPaginated);\n }", "public function index()\n {\n return UserResource::collection(User::paginate());\n }", "public function paginated($paginate);", "public function users_paginated_api(Request $request)\n {\n $search = $request->search;\n $records = $request->records ? $request->records : 100;\n\n if ($search) {\n $users = User::search($search)->paginate($records);\n } else {\n $users = User::latest()->paginate($records);\n }\n\n return fractal()\n ->collection($users)\n ->transformWith(new UserWithReceiptsInfo)\n ->paginateWith(new IlluminatePaginatorAdapter($users))\n ->toArray();\n return $users;\n }", "public function canPaginate()\n {\n return false;\n }", "public function userIndex()\n {\n return auth()->user()->following(User::class)\n ->paginate(RESULTS_PER_PAGE);\n }", "public function testGetUsers()\n {\n $client = new ClinchPadClient('api-key');\n $resource = new ClinchPadUsers($client);\n $resource->getUsers();\n\n $this->assertEquals('GET', $client->getClient()->method);\n $this->assertEquals($client->getEndpoint() . '/users', $client->getClient()->uri);\n }", "public function testGetWithParams() : void\n {\n $fetch = new Fetch();\n $params = [ \"page\" => 2 ];\n $body = $fetch->get(self::API_URL . \"/users\", $params);\n\n $this->assertIsObject($body);\n $this->assertEquals($body->page, 2);\n $this->assertIsArray($body->data);\n\n foreach ($body->data as $item) {\n $this->assertIsInt($item->id);\n $this->assertIsString($item->email);\n }\n }", "public function testGetList()\n {\n $structure = $this->structure;\n $admin = $structure['admin'];\n factory(Pago::class, 5)->create();\n\n $authenticateBody = [\n 'email' => $admin->email,\n 'password' => 'secret',\n ];\n\n $this->authenticateUser($authenticateBody);\n\n $response = $this->withHeaders($this->getAuthHeader())\n ->getJson(self::PAGO_URL);\n\n $response->assertOk();\n\n $jsonStructure = self::PACKAGE_JSON_STRUCTURE;\n $response->assertJsonStructure($jsonStructure);\n }", "function GetUserList($pageSize, $currentPage, $user_search_keywords) {\n //Check the parameters\n if (empty($pageSize) || empty($currentPage) || $pageSize == 0) {\n $data['status'] = 0;\n $data['message'] = 'Failed to get the user list, the parameters are incomplete or wrong';\n return $data;\n }\n //Keyword processing\n $user_search_keywords = \"%$user_search_keywords%\";\n //Paging processing\n $begin = $pageSize * ($currentPage - 1);\n //All user lists\n $list = $this->database_medoo->select('User', [\n \"[>]Role\" => [\"User_roleid\" => \"Role_id\"]\n ], [\n \"User.User_id\",\n \"User.User_username\",\n \"User.User_password\",\n \"User.User_name\",\n \"Role.Role_name\",\n \"Role.Role_id\"\n ], [\n \"AND\" => [\n \"OR\" => [\n \"User.User_username[~]\" => $user_search_keywords,\n \"User.User_password[~]\" => $user_search_keywords,\n \"User.User_name[~]\" => $user_search_keywords,\n \"Role.Role_name[~]\" => $user_search_keywords\n ],\n ],\n \"LIMIT\" => [$begin, $pageSize]\n ]);\n //count\n $total = $this->database_medoo->count('User', [\n \"[>]Role\" => [\"User_roleid\" => \"Role_id\"]\n ], \"*\", [\n \"OR\" => [\n \"User.User_username[~]\" => $user_search_keywords,\n \"User.User_password[~]\" => $user_search_keywords,\n \"User.User_name[~]\" => $user_search_keywords,\n \"Role.Role_name[~]\" => $user_search_keywords\n ],\n ]);\n //Deal with self-incrementing id\n $i = 0;\n foreach ($list as $key => $value) {\n $list[$key][\"id\"] = $i + $begin;\n $i++;\n }\n //return\n $data['status'] = 1;\n $data['message'] = 'Get the user list successfully';\n $data['data'] = $list;\n $data['total'] = $total;\n return $data;\n }", "public function paginateAllResources();", "public function testList()\n {\n $response = $this->get('/api/users');\n\n $response->assertStatus(200)->assertJson([]);\n }", "public function testUserList()\n {\n $response = $this->call('GET', 'users');\n $this->assertEquals(200, $response->status());\n $data = json_decode($response->getContent())->data;\n return $data;\n }", "public function testGetUsersByUsername(): void\n {\n $response = static::createAuthenticatedClient([\n 'email' => TestFixtures::ADMIN['email'],\n ])->request('GET', '/users', ['query' => [\n 'username' => TestFixtures::PROJECT_COORDINATOR['username'],\n ]]);\n\n self::assertResponseIsSuccessful();\n self::assertJsonContains([\n '@context' => '/contexts/User',\n '@id' => '/users',\n '@type' => 'hydra:Collection',\n 'hydra:totalItems' => 1,\n ]);\n\n $result = $response->toArray();\n self::assertCount(1, $result['hydra:member']);\n self::assertSame(TestFixtures::PROJECT_COORDINATOR['email'],\n $result['hydra:member'][0]['email']);\n }", "function it_shows_the_users_list()\n {\n /* Registro los usuarios esperados usando Model Factories */\n factory( User :: class ) -> create([\n 'name' => 'Elisa',\n 'website' => 'www.matiz.co'\n ]);\n factory( User :: class ) -> create([\n 'name' => 'Juliana',\n 'website' => 'www.juliana.me'\n ]);\n\n $this -> get( '/usuarios' ) # Simula petición a la URL /usuarios\n -> assertStatus( 200 ) # Comprueba el estado de la petición\n -> assertSee( 'Usuarios' ) # Comprueba que el código fuente de la página generada se puede ser ese texto\n -> assertSee( 'Elisa' )\n -> assertSee( 'Juliana' );\n }", "public function testList(): void\n {\n $data = [\n [\n 'userId' => 'user-id',\n 'type' => 'customer',\n 'email' => 'customer@email.test',\n ],\n ];\n\n $entities = $this->getHandler([\n new Response(200, [], \\json_encode($data) ?: ''),\n ])->executeAndRespond(new UserStub(['userId' => 'user-id']), RequestAwareInterface::LIST, 'api-key');\n\n self::assertCount(1, $entities);\n $this->performAssertion($data[0], $entities[0]);\n }", "public function hasPaginator(): bool;", "public function testUserList()\n {\n // Define a mock user list API response\n $mockResponse = new Response(\n 200,\n ['Content-Type' => 'application/json'],\n Stream\\create('{\"data\":[{\"fname\":\"Tom\"},{\"fname\":\"awardwinner\"},{\"fname\":\"Social\"},{\"fname\":\"Benny\"},{\"fname\":\"White Hat SEO\"},{\"fname\":\"Rebecca (Dakota Digital Ltd)\"},{\"fname\":\"Chris\"},{\"fname\":\"Guru\"},{\"fname\":\"Michael\"},{\"fname\":\"Aled\"},{\"fname\":\"Matthew\"},{\"fname\":\"Peter\"},{\"fname\":\"Steven\"},{\"fname\":\"Agile Cyber Solutions\"},{\"fname\":\"T\"},{\"fname\":\"Green\"},{\"fname\":\"Fiona\"},{\"fname\":\"Wojtek\"},{\"fname\":\"Darren\"},{\"fname\":\"Natasha\"}],\"count\":630330,\"page\":1,\"pageCount\":20,\"nextUrl\":\"https:\\/\\/api.peopleperhour.com\\/v1\\/user?a=fname&sort=rating&page=2\",\"previousUrl\":null}')\n );\n\n // Create our command client but use a dummy http client that avoids cURLing to the real API\n $pphApi = new PPHApi('dummyID', 'dummyKey', new Client(['adapter' => new MockAdapter($mockResponse)]));\n\n $response = $pphApi->userList();\n $this->assertEquals(20, count($response['data']));\n $this->assertEquals('Tom', $response['data'][0]['fname']);\n\n // The following is pointless because our response is fixed but test other parameters\n $response = $pphApi->userList(['page'=>2]);\n $response = $pphApi->userList(['page'=>2,'sort'=>'fname.desc']);\n }", "public function getPaginator();", "public function getPaginator();", "public function testPaginationWithPermissionsAndPager()\n {\n $sample = DIR_TESTS . '/assets/File/StorageLocation/sample.txt';\n $image = DIR_BASE . '/concrete/images/logo.png';\n $fi = Core::make(FileImporter::class);\n\n $files = [\n 'another.txt' => $sample,\n 'funtime.txt' => $sample,\n 'funtime2.txt' => $sample,\n 'awesome-o.txt' => $sample,\n 'image.png' => $image,\n ];\n\n foreach ($files as $filename => $pointer) {\n $fi->importLocalFile($pointer, $filename);\n }\n\n $nl = new \\Concrete\\Core\\File\\FileList();\n $nl->setPermissionsChecker(function ($file) {\n if ($file->getTypeObject()->getGenericType() == \\Concrete\\Core\\File\\Type\\Type::T_IMAGE) {\n return true;\n } else {\n return false;\n }\n });\n $nl->sortBySearchColumn(new FileVersionFilenameColumn());\n $results = $nl->getResults();\n $factory = new PaginationFactory(\\Request::createFromGlobals());\n $pagination = $factory->createPaginationObject($nl, PaginationFactory::PERMISSIONED_PAGINATION_STYLE_PAGER);\n $this->assertEquals(-1, $nl->getTotalResults());\n $this->assertEquals(-1, $pagination->getTotalResults());\n $this->assertEquals(6, count($results));\n\n // so there are six \"real\" results, and 15 total results without filtering.\n $pagination->setMaxPerPage(4)->setCurrentPage(1);\n\n $this->assertEquals(-1, $pagination->getTotalPages());\n\n $this->assertTrue($pagination->hasNextPage());\n $this->assertFalse($pagination->hasPreviousPage());\n\n // Ok, so the results ought to be the following files, broken up into pages of four, in this order:\n // foobley.png\n // image.png\n // logo1.png\n // logo2.png\n // -- page break --\n // logo3.png\n // test.png\n\n $results = $pagination->getCurrentPageResults();\n\n $this->assertInstanceOf('\\Concrete\\Core\\Search\\Pagination\\PagerPagination', $pagination);\n\n $this->assertEquals(4, count($results));\n\n $this->assertEquals('foobley.png', $results[0]->getFilename());\n $this->assertEquals('image.png', $results[1]->getFilename());\n $this->assertEquals('logo1.png', $results[2]->getFilename());\n $this->assertEquals('logo2.png', $results[3]->getFilename());\n\n $pagination->advanceToNextPage();\n\n $results = $pagination->getCurrentPageResults();\n\n $this->assertEquals('logo3.png', $results[0]->getFilename());\n $this->assertEquals('test.png', $results[1]->getFilename());\n $this->assertEquals(2, count($results));\n\n $this->assertTrue($pagination->hasPreviousPage());\n $this->assertFalse($pagination->hasNextPage());\n }", "public function testUsersAreListed()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs(factory(User::class)->create())\n ->getJson('api/users')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'name',\n 'email',\n ],\n ],\n ])\n ->assertJsonFragment([\n 'id' => $user->id,\n 'name' => $user->name,\n 'email' => $user->email,\n ]);\n }", "public function test_only_users_logged_can_get_users()\n {\n $response = $this->withHeaders(\n []\n )->get('/api/contacts');\n $response\n ->assertStatus(401)\n ->assertJson([\n 'message' => true,\n ]);\n }", "public function index(Request $req){\n return $this->users->paginate(10);\n }", "function findAllPaginated($perPage = 20);", "public function index()\n {\n\n return User::latest()->where('id', '!=', Auth::user()->id)->paginate(5);\n //return $users = User::all()->where('id', '!=', Auth::user()->id); \n }", "public function paginated()\n {\n return $this->repo->paginated(config('cms.pagination', 25));\n }", "public function testGetUsersBySubAccountId()\n {\n $result = self::$accountApi->users(true, [], self::$USER_GET_NAME, self::$SUB_ACCOUNT_GET_ID);\n\n self::assertCount(1, $result['users']);\n }", "public function test_list_user()\n {\n $data = factory(User::class)->create();\n $response = $this->get($this->url, $this->headers());\n $response->assertStatus(200);\n $response->assertJsonStructure(array_keys($data->toarray()), $data->toarray());\n $this->assertDatabaseHas($this->table, $data->toarray());\n }", "public function testIndexPagination()\n {\n factory(Order::class, 9)->create();\n $this->get('/api/orders?page=2&limit=5')\n ->assertJsonFragment(['meta' => ['pagination' => [\n 'total' => 10, 'count' => 5, 'per_page' => 5, 'current_page' => 2, 'total_pages' => 2\n ]]]);\n }", "public function list_all_users(){\n global $data;\n Doo::loadHelper('DooPager');\n Doo::loadModel('User');\n\n $user = new User();\n $user->status=1;\n $totalpages= $user->count(); // Total number of users.\n $data['baseurl']= Doo::conf()->APP_URL;\n $data['title']='Users list';\n $data['listurl']= $data['baseurl'].'index.php/admin/list_all_users';\n \n $pager = new DooPager($data['listurl'], $totalpages, 4, 7);\n $page = intval($this->params['pindex']);\n\n if(isset($this->params['pindex']) && $this->params['pindex']>0)\n $pager->paginate($page);\n else\n $pager->paginate(1);\n/*\n $data['users'] = $user->relateStatus(\n array(\n 'limit'=>$pager->limit,\n 'asc'=>'tag.name'\n )\n );\n*/\n $options['limit']=$pager->limit;\n $data['users'] = $this->db()->find( $user, $options );\n //$data['users'] = $user->find(array('limit'=>$pager->limit));\n //$data['users']=array('john','doo','marie');\n // Pager settings\n $pager->defaultCss;\n $pager->components['prev_link'];\n $data['pager'] =$pager->output;\n //echo $pager->components['page_size'];\n $this->view()->render('list_all_users',$data);\n }", "public function index()\n {\n return new UserCollection(User::paginate(20));\n }", "public function paginatedList(Request $request)\n {\n $limit = (! empty($request->get('limit'))) ? $request->get('limit') : 10;\n $sortBy = (! empty($request->get('sortBy'))) ? $request->get('sortBy') : '';\n $users = User::with('roles');\n /*\n sortByDateDesc\n sortByDateAsc\n sortByUserName\n */\n if ($sortBy == 'sortByDateDesc') {\n $users->orderBy('created_at', 'desc');\n } elseif($sortBy == 'sortByDateAsc') {\n $users->orderBy('created_at', 'asc');\n } elseif($sortBy == 'sortByUserName') {\n $users->orderBy('username', 'asc');\n }\n\n $users = $users->paginate((int) $limit);\n return $users;\n }", "public function getUsers() {\n }", "public function testGetUsers()\n {\n echo 'Test GetUsers' . \"\\n\";\n $team = self::getTeam('Test');\n $users = $team->getUsers();\n foreach ($users as $user) {\n $this->assertInstanceOf('IBW\\WebsiteBundle\\Entity\\User', $user);\n }\n $this->assertEquals(2, count($users));\n }" ]
[ "0.74012715", "0.7050728", "0.70259017", "0.69783884", "0.6915243", "0.6805326", "0.6774718", "0.675242", "0.6739073", "0.67201376", "0.67125744", "0.6693956", "0.6660814", "0.6660814", "0.665234", "0.66269225", "0.6611248", "0.6607217", "0.66033435", "0.65824187", "0.65824187", "0.6569358", "0.6531346", "0.6512884", "0.65088236", "0.6498457", "0.6496203", "0.6473671", "0.6465869", "0.6457999", "0.6452568", "0.64483505", "0.64457524", "0.640864", "0.6393032", "0.63769", "0.6375849", "0.6367061", "0.6362424", "0.635485", "0.63474876", "0.6337245", "0.63362414", "0.63358915", "0.6334606", "0.6325991", "0.63234127", "0.63076365", "0.63075495", "0.62907684", "0.6288936", "0.62876767", "0.62786096", "0.6270816", "0.626991", "0.62695354", "0.6267415", "0.6246855", "0.6246205", "0.623844", "0.6234335", "0.6234335", "0.6234335", "0.62289184", "0.6226191", "0.6209647", "0.6202094", "0.6198328", "0.6192916", "0.6185422", "0.61834496", "0.61498165", "0.61493933", "0.61364216", "0.6120484", "0.61173975", "0.61108106", "0.61084104", "0.6108275", "0.61055297", "0.6105316", "0.6104125", "0.6096117", "0.6095888", "0.6095888", "0.60950786", "0.6089616", "0.60893136", "0.6088172", "0.60839033", "0.60830164", "0.6081808", "0.60736567", "0.6071645", "0.6071608", "0.6069788", "0.6066488", "0.6063131", "0.60542876", "0.6050243" ]
0.8859857
0
//////////////////////////// ajouter citoyen //////////////////////////////////////////////
//////////////////////////// добавить гражданина //////////////////////////////////////////////
function ajouterCitoyen($nom,$prenom,$datenais,$lieunais,$cni,$sexe,$datecnideliv,$datecniexp,$profession,$specialite,$matrimonial,$dateentre,$foto,$teint,$taille,$immatr,$dateimmatr){ $bdd = new PDO('mysql:host=localhost;dbname=gondwana', 'root', 'passer'); //insertion avec requête préparée $sql="INSERT INTO dic_citoyen(cty_prenom, cty_nom, cty_datenaissance, cty_lieunaissance, cty_nci, cty_sexe, cty_datecnidelivre, cty_datecniexpire, cty_profession, cty_specialite, cty_matrimoniale, cty_dateentre, cty_photo, cty_teint, cty_taille, cty_immatricul, cty_dateimmatricul) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $req=$bdd->prepare($sql); $req->execute(array($nom,$prenom,$datenais,$lieunais,$cni,$sexe,$datecnideliv,$datecniexp,$profession,$specialite,$matrimonial,$dateentre,$foto,$teint,$taille,$immatr,$dateimmatr)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertarComentario($cContenido, $cTemaID, $cUsuarioID)\n{\n $nueva = new Comentario;\n $nueva->contenido = $cContenido;\n $nueva->temaid = $cTemaID;\n $nueva->usuarioid = $cUsuarioID;\n $nueva->fecha = date('Y-m-d H:i:s');\n $nueva->save();\n}", "public function createComite()\n {\n //\n }", "public function crearComentario(){\n\n\t\t$sentencia= $GLOBALS['DB']->prepare('INSERT INTO comentarios (usuario_id, pincho_id, comentario) VALUES (:usuario_id, :pincho_id, :comentario)');\n\t\t$sentencia->execute(array(':usuario_id' => $_SESSION['user']['usuario_id'], ':pincho_id' => $_REQUEST['codigo_pincho'], ':comentario' => $_REQUEST['comentario']));\n\t\t\t\n\t\t\n\t}", "public function actionTambahnilai($id_tes){\n $nilai = Yii::$app->request->post('nilai'); \n $customer = Tes::findOne($id_tes);\n $customer->nilai = $nilai;\n $customer->save();\n if($customer->save()){\n $data['status'] = \"ok\"; \n }else{\n $data['status'] = 'error'; \n } \n\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n Yii::$app->response->statusCode = 200;\n return $data;\n }", "public function insertCotizacion($formData){\n date_default_timezone_set('America/Lima');\n $VEN_CAB = new \\models\\venCabClass();\n $tipoDOC = 'PRO';\n\n \n if (!empty($formData)) {\n\n try {\n //Obtenemos informacion de la empresa\n $datosEmpresa = $this->ajaxModel->getDatosEmpresaFromWINFENIX($this->defaulDataBase);\n $serieDocs = $this->ajaxModel->getDatosDocumentsWINFENIXByTypo($tipoDOC, $this->defaulDataBase)['Serie'];\n \n // Informacion extra del cliente\n $datosCliente = $this->getInfoClienteController($formData->cliente->RUC);\n\n //Creamos nuevo codigo de VEN_CAB (secuencial)\n $newCodigo = $this->ajaxModel->getNextNumDocWINFENIX($tipoDOC, $this->defaulDataBase); // Recuperamos secuencial de SP de Winfenix\n $newCodigoWith0 = $this->ajaxModel->formatoNextNumDocWINFENIX($this->defaulDataBase, $newCodigo); // Asignamos formato con 0000X\n\n $new_cod_VENCAB = $datosEmpresa['Oficina'].$datosEmpresa['Ejercicio'].$tipoDOC.$newCodigoWith0;\n \n /* NOTA SE ESTABLECE DESCUENTO EN 0 TANTO PARA CABECERA COMO DETALLE */\n\n $VEN_CAB->setCliente($datosCliente['CODIGO']);\n $VEN_CAB->setTipoPrecio($datosCliente['TIPOPRECIO']);\n $VEN_CAB->setVendedor($datosCliente['VENDEDOR']);\n $VEN_CAB->setPorcentDescuento(0);\n $VEN_CAB->setPcID(php_uname('n'));\n $VEN_CAB->setOficina($datosEmpresa['Oficina']);\n $VEN_CAB->setEjercicio($datosEmpresa['Ejercicio']);\n $VEN_CAB->setTipoDoc($tipoDOC);\n $VEN_CAB->setNumeroDoc($newCodigoWith0);\n $VEN_CAB->setFecha(date('Ymd'));\n \n $VEN_CAB->setBodega('B01');\n $VEN_CAB->setDivisa('DOL');\n $VEN_CAB->setProductos($formData->productos);\n $VEN_CAB->setSubtotal($VEN_CAB->calculaSubtotal());\n $VEN_CAB->setsubtotalBase0($VEN_CAB->calculaSubtotalOfItemsWithIVA0());\n $VEN_CAB->setImpuesto($VEN_CAB->calculaIVA());\n $VEN_CAB->setTotal($VEN_CAB->calculaTOTAL());\n $VEN_CAB->setFormaPago($formData->cliente->formaPago);\n $VEN_CAB->setSerie($serieDocs); \n $VEN_CAB->setSecuencia('0'.$newCodigoWith0); //Agregar 0 extra segun winfenix\n $VEN_CAB->setObservacion('WebForms, ' . $formData->comentario);\n \n //Registro en VEN_CAB y MOV mantenimientosEQ\n $response_VEN_CAB = $this->ajaxModel->insertVEN_CAB($VEN_CAB);\n\n $arrayVEN_MOVinsets = array();\n\n if (!empty($VEN_CAB->getProductos())) {\n\n foreach ($VEN_CAB->getProductos() as $producto) {\n $VEN_MOV = new \\models\\venMovClass();\n \n $VEN_MOV->setCliente($datosCliente['CODIGO']);\n \n $VEN_MOV->setOficina($datosEmpresa['Oficina']);\n $VEN_MOV->setEjercicio($datosEmpresa['Ejercicio']);\n $VEN_MOV->setTipoDoc($tipoDOC);\n $VEN_MOV->setTipoPrecio($datosCliente['TIPOPRECIO']);\n $VEN_MOV->setVendedor($datosCliente['VENDEDOR']);\n $VEN_MOV->setNumeroDoc($newCodigoWith0);\n $VEN_MOV->setFecha(date('Ymd h:i:s'));\n $VEN_MOV->setBodega('B01');\n $VEN_MOV->setCodProducto(strtoupper($producto->codigo));\n $VEN_MOV->setCantidad($producto->cantidad);\n $VEN_MOV->setPrecioProducto($producto->precio);\n $VEN_MOV->setPorcentajeDescuentoProd(0);\n $VEN_MOV->setTipoIVA('T00');\n $VEN_MOV->setPorcentajeIVA($producto->valorIVA);\n $VEN_MOV->setPrecioTOTAL($VEN_MOV->calculaPrecioTOTAL());\n $VEN_MOV->setObservacion('');\n \n $response_VEN_MOV = $this->ajaxModel->insertVEN_MOV($VEN_MOV);\n \n array_push($arrayVEN_MOVinsets, $response_VEN_MOV);\n\n }\n }\n } catch (Exception $e) {\n return array('status' => 'ERROR', \n 'mensaje' => 'No se pudo completar la operacion'. $e->getMessage(),\n ); \n }\n \n return array('status' => 'OK', \n 'mensaje' => 'Documento registrado.',\n 'new_cod_VENCAB' => $new_cod_VENCAB,\n 'newCodigoWith0' => $newCodigoWith0,\n 'response_VEN_CAB' => $response_VEN_CAB,\n 'arrayVEN_MOVinsets' => $arrayVEN_MOVinsets\n ); \n\n }\n \n \n\n \n \n }", "public function insertCuenta()\r\n {\r\n $atributos=array( $this->descripcion );\r\n //descomentarear la línea siguiente y comentarear la anterior si la llave primaria no es autoincremental\r\n //$atributos=array( $this->idcuenta , $this->descripcion );\r\n\r\n return $this->conexionCuenta->insertarRegistro($atributos);\r\n }", "function createC($data){\n\n $this->DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql=\"INSERT INTO carreras(nombre,id_universidad)VALUES (?,?)\";\n\n $query = $this->DB->prepare($sql);\n $query->execute(array($data['nombre'],$data['universidad']));\n Database::disconnect(); \n }", "function ajoutCours($id,$nomCours, $description, $coef, $quantum, $destination, $idUe) {\n\t\tif (verifResponsable($id)) {\n\t\t\t$query1 = 'insert into cours values(\"\",\"'.$nomCours.'\",\"'.$description.\n\t\t\t\t'\",\"'.$coef.'\",\"'.$quantum.'\",\"'.$destination.'\"');\n\t\t\tmysql_query($query1) or die (\"Impossible d'ajouter un cours\");\n\n\t\t\t$query2 = 'insert into coursue values(LAST_INSERT_ID() ,\"'.$idUe.'\")';\n\t\t\tmysql_query($query2) or die(\"Impossible d'ajouter le cours dans une UE\");\n\t\t}\n\t}", "public function store($clase){\n $conn = Connection::connect();\n\n $id = $clase->getId();\n $id_asignatura = $clase->getId_asignatura();\n $id_carrera = $clase->getId_carrera();\n $cuatrimestre = $clase->getCuatrimestre();\n $dia = $clase->getDia();\n $hora = $clase->getHora();\n $grupo = $clase->getGrupo();\n\n $actualizar = ($this->getById($clase->getId()) != NULL);\n\n if($actualizar){\n if (!($sentencia = $conn->prepare(\"UPDATE `clases` SET `id_asignatura` = ?, `cuatrimestre` = ?, `dia` = ?, `hora` = ?, `grupo` = ? WHERE `id` = ?\"))) {\n echo \"Falló la preparación: (\" . $conn->errno . \") \" . $conn->error;\n }\n if (!$sentencia->bind_param(\"iisisi\", $id_asignatura, $cuatrimestre, $dia, $hora, $grupo, $id)) {\n echo \"Falló la vinculación de parámetros: (\" . $sentencia->errno . \") \" . $sentencia->error;\n }\n $sentencia->execute();\n $sentencia->close();\n $conn->close();\n }\n else{\n if (!($sentencia = $conn->prepare(\"INSERT INTO `clases` (`id`, `id_asignatura`, `id_carrera`, `cuatrimestre`, `dia`, `hora`, `grupo`) VALUES (?, ?, ?, ?, ?, ?, ?);\"))) {\n echo \"Falló la preparación: (\" . $conn->errno . \") \" . $conn->error;\n }\n if (!$sentencia->bind_param(\"iiiisis\", $id, $id_asignatura, $id_carrera, $cuatrimestre, $dia, $hora, $grupo)) {\n echo \"Falló la vinculación de parámetros: (\" . $sentencia->errno . \") \" . $sentencia->error;\n }\n $sentencia->execute();\n $sentencia->close();\n $conn->close();\n }\n }", "public function save()\n {\n $conn = new db();\n $conn = $conn->connexion();\n $req = $conn->prepare(\"INSERT INTO service (libelle, COD) VALUES (:libelle, :COD)\");\n $req->bindParam(':libelle', $this->name);\n $req->bindParam(':COD', $this->code);\n $req->execute();\n }", "public function inserirContato() {\n\t\t\t$contatoDAO = new ContatoDAO();\n\t\t\t$estado = $contatoDAO->listarEstados();\n\t\t\trequire_once \"views/insert_contato.php\";\n\n\t\t\tif (isset($_POST[\"save\"])) {\n\t\t\t\tif (!empty($_POST[\"nome\"]) && !empty($_POST[\"celular\"]) && !empty($_POST[\"endereco\"]) && !empty($_POST[\"numero\"]) && !empty($_POST[\"cidade\"]) && !empty($_POST[\"uf\"])) {\n\t\t\t\t\t$contato = new Contato(\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t$_POST[\"nome\"],\n\t\t\t\t\t\t$_POST[\"email\"],\n\t\t\t\t\t\t$_POST[\"telefone\"],\n\t\t\t\t\t\t$_POST[\"celular\"],\n\t\t\t\t\t\t$_POST[\"endereco\"],\n\t\t\t\t\t\t$_POST[\"numero\"],\n\t\t\t\t\t\t$_POST[\"bairro\"],\n\t\t\t\t\t\t$_POST[\"cidade\"],\n\t\t\t\t\t\t$_POST[\"uf\"],\n\t\t\t\t\t\t$_POST[\"cep\"],\n\t\t\t\t\t\t$_POST[\"observacoes\"]\n\t\t\t\t\t);\n\n\t\t\t\t\t$contatoDAO->inserir($contato);\n\n\t\t\t\t\techo \"<script>\n\t\t\t\t\t\talert('Registro inserido com sucesso!');\n\t\t\t\t\t\tlocation='index.php';\n\t\t\t\t\t</script>\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\techo \"<script>alert('PREENCHA OS CAMPOS OBRIGATÓRIOS!');</script>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function adiciona()\n\t {\n\t\t\t$id=$_REQUEST['id'];\n\t\t\t$car=$_REQUEST['car'];\n\t\t\t$fec=$_REQUEST['fec'];\n\t\t\t$obs=$_REQUEST['obs'];\n\t\t\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t\t$carr_data=array();\n\t\t\t$carr_data['id_carrera']=$id;\n\t\t\t$carr_data['carrera']=$car;\n\t\t\t$carr_data['fecha_creacion']=$fec;\n\t\t\t$carr_data['observacion']=$obs;\n\t\t\t\n\t\t\tprint_r($carr_data);\n\t\t\t$carrera=new Carreras;\n\t\t\t$carrera->set($carr_data);\n\t\t\t//print_r($_SERVER['REQUEST_URI']);\n\t\t\t$data1=$carrera->lista();\n\t\t\t$this->principal();\n\t }", "public function ajouter() {\n $this->loadView('ajouter', 'content');\n if(isset($this->post->prixLitre)){\n $tarif = new Tarif($this->post);\n $this->em->save($tarif);\n $this->handleStatus('Tarif ajouté avec succès.');\n }\n }", "function ajouterCommentaire() {\n\t}", "function create($Id_centro,$Id_usuario,$Id_empleado,$Fecha_cita,$Hora,$Jornada)\n\t\t{\n\t\t\t$conexion=fusion_look_DB::Connect();\n\t\t\t$conexion->SetAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\n\t\t\t//Crear el query que se llevara a cabo\n\t\t\t$consulta=\"INSERT INTO cita(Id_centro,Id_usuario,Id_empleado,Fecha_cita,hora,jornada) values (?,?,?,?,?,?)\";\n\t\t\t$query=$conexion->prepare($consulta);\n\t\t\t$query->execute(array($Id_centro,$Id_usuario,$Id_empleado,$Fecha_cita,$Hora,$Jornada));\n\n\t\t\tfusion_look_DB::Disconnect();\n\t\t}", "public function adicionar() {\n \t\n $codproduto = $this->input->post ( \"codproduto\" );\n $codsku = $this->input->post ( \"codsku\" );\n \n $carrinho = $this->session->userdata( \"carrinhoDoeumaCesta\" );\n \n if (!$carrinho) {\n $carrinho = array();\n } else {\n $carrinho = unserialize( $carrinho );\n }\n \n $infoSKU = $this->SkuM->getPorSKU( $codsku );\n \n if ($infoSKU) {\n \n if (! isset ( $carrinho [$codsku] )) {\n if ($infoSKU->quantidade > 0) {\n $carrinho [$codsku] = 1;\n }\n } else {\n \n if ($infoSKU->quantidade > $carrinho [$codsku] + 1) {\n $carrinho [$codsku] = $carrinho [$codsku] + 1;\n }\n }\n }\n \n $carrinho = serialize( $carrinho );\n $this->session->set_userdata( \"carrinhoDoeumaCesta\", $carrinho );\n \n redirect ( \"checkout\" );\n }", "public function insert($cbtKelasRuang);", "public function save(){\n\t\t$conexion = new Database();\n\t\t\n if ($this->codigo){\n $sql = 'UPDATE CAU_USUARIOS SET usuario = ? password = ? WHERE codigo = ?';\n\t\t\t$conexion->prepare( $sql );\n\t\t\t$conexion->bindParam( 1, $this->usuario );\n\t\t\t$conexion->bindParam( 2, $this->password );\n\t\t\t$conexion->bindParam( 3, $this->codigo );\n\t\t\t$conexion->execute();\n }\n else{\n $sql = 'INSERT INTO CAU_USUARIOS ( usuario, password) VALUES (?, ?)';\n\t\t\t$conexion->prepare( $sql );\n\t\t\t$conexion->bindParam( 1, $this->usuario );\n\t\t\t$conexion->bindParam( 2, $this->password );\n\t\t\t$conexion->execute();\n\t\t\t$this->codigo = $conexion->lastInsertId();\n }\n }", "function insertarCuenta(){\n\t\t$this->procedimiento='conta.f_cuenta_ime';\n\t\t$this->transaccion='CONTA_CTA_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_padre','id_cuenta_padre','varchar');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('nombre_cuenta','nombre_cuenta','varchar');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('sw_auxiliar','sw_auxiliar','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta_pat','tipo_cuenta_pat','varchar');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('sw_transaccional','sw_transaccional','varchar');\n\t\t$this->setParametro('id_gestion','id_gestion','int4');\n\t\t$this->setParametro('eeff','eeff','varchar');\n\t\t$this->setParametro('valor_incremento','valor_incremento','varchar');\n\t\t$this->setParametro('sw_control_efectivo','sw_control_efectivo','varchar');\n\t\t$this->setParametro('id_config_subtipo_cuenta','id_config_subtipo_cuenta','int4');\n\t\t$this->setParametro('tipo_act','tipo_act','varchar');\n\t\t\n\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function addOneCours() {\n $message = \"\";\n if (!empty($_POST['code']) && !empty($_POST['titre']) && !empty($_POST['langage'])) {\n addCours($_POST['code'], $_POST['titre'], $_POST['langage']);\n $message = \"Cours ajouté !\";\n } else {\n $message = \"Tous les champs sont requis !\";\n }\n require_once('views/viewAjouterCours.php');\n }", "function ajouterContact($tel,$email,$telGondwana,$adressGondwana,$telSenegal,$adresse,$adresseTravail,$adresseDomicil,$cniCitoyen){\n\n $bdd = new PDO('mysql:host=localhost;dbname=gondwana', 'root', 'passer');\n//insertion avec requête préparée\n $sql=\"INSERT INTO contacts(cty_telephone, cty_email, cty_telGondwana, cty_adresseGondwana, cty_telSenegal, cty_adresse, cty_adresseTravail, cty_adresseDomicile, cty_contact_cni)\n VALUES (?,?,?,?,?,?,?,?,?)\";\n$req=$bdd->prepare($sql);\n$req->execute(array($tel,$email,$telGondwana,$adressGondwana,$telSenegal,$adresse,$adresseTravail,$adresseDomicil,$cniCitoyen));\n}", "function ajouterContact($tel,$email,$telGondwana,$adressGondwana,$telSenegal,$adresse,$adresseTravail,$adresseDomicil,$cniCitoyen){\n\n $bdd = new PDO('mysql:host=localhost;dbname=gondwana', 'root', 'passer');\n//insertion avec requête préparée\n $sql=\"INSERT INTO contacts(cty_telephone, cty_email, cty_telGondwana, cty_adresseGondwana, cty_telSenegal, cty_adresse, cty_adresseTravail, cty_adresseDomicile, cty_contact_cni)\n VALUES (?,?,?,?,?,?,?,?,?)\";\n$req=$bdd->prepare($sql);\n$req->execute(array($tel,$email,$telGondwana,$adressGondwana,$telSenegal,$adresse,$adresseTravail,$adresseDomicil,$cniCitoyen));\n}", "function insertconducteur()\n {\n require_once('config.php');\n $mysqli= new mysqli(db_host,db_user,db_password,db_database);\n $req=\"insert into conducteur(cin,nom,prenom,mdp,telephone,email) values($this->cin,'$this->nom','$this->prenom','$this->mdp','$this->telephone','$this->email')\";\n $mysqli->query($req);\n }", "public function saveOneAction() \n\t{\n\t\t//récupération des informations de connexion\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\t\n\t\tif (empty($customer))\n\t\t{\n\t\t\theader('Location:customers/account');\n\t\t}\n\n\t\t//redirection si le panier est vide\n\t\tif (!isset($_SESSION['shoppingCart']) OR !isset($_SESSION['shoppingCart']['products']) OR empty($_SESSION['shoppingCart']['products']))\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'shoppingCart/show');\n\t\t}\n\n\t\t//ajout dans la BDD des données de commande\n\t\t$requiredData = \n\t\t[\n\t\t\t'billingCivility' => $_SESSION['order']['billingDetails']['civility'],\n\t\t\t'billingFirstName' => $_SESSION['order']['billingDetails']['firstName'],\n\t\t\t'billingLastName' => $_SESSION['order']['billingDetails']['lastName'],\n\t\t\t'billingAddress' => $_SESSION['order']['billingDetails']['address'],\n\t\t\t'billingZipCode' => $_SESSION['order']['billingDetails']['zipCode'],\n\t\t\t'billingCity' => $_SESSION['order']['billingDetails']['city'],\n\t\t\t'billingCountry' => $_SESSION['order']['billingDetails']['country'],\n\t\t\t'billingPhoneNumber' => $_SESSION['order']['billingDetails']['phoneNumber'],\n\t\t\t'deliveryCivility' => $_SESSION['order']['deliveryDetails']['civility'],\n\t\t\t'deliveryFirstName' => $_SESSION['order']['deliveryDetails']['firstName'],\n\t\t\t'deliveryLastName' => $_SESSION['order']['deliveryDetails']['lastName'],\n\t\t\t'deliveryAddress' => $_SESSION['order']['deliveryDetails']['address'],\n\t\t\t'deliveryZipCode' => $_SESSION['order']['deliveryDetails']['zipCode'],\n\t\t\t'deliveryCity' => $_SESSION['order']['deliveryDetails']['city'],\n\t\t\t'deliveryCountry' => $_SESSION['order']['deliveryDetails']['country'],\n\t\t\t'deliveryPhoneNumber' => $_SESSION['order']['deliveryDetails']['phoneNumber'],\n\t\t\t'idCustomer' => $_SESSION['customer']['id']\n\t\t];\n\t\t\n\t\t$ordersManager = new OrdersManager();\n\t\t$idOrder = $ordersManager -> addOne($requiredData);\n\n\t\t//si la commande a bien été enregistrée, le n° de commande a été récupéré\n\t\tif ($idOrder != 0)\n\t\t{\n\t\t\t//récupération des produits du panier\n\t\t\t$orderedProducts = $_SESSION['shoppingCart']['products'];\n\n\t\t\t//pour chaque produit commandé\n\t\t\tforeach ($orderedProducts as $orderedProduct) {\n\t\t\t\t$requiredData['orderLines']['products'][$orderedProduct['productId']] = \n\t\t\t\t[\n\t\t\t\t\t'idProduct' => $orderedProduct['productId'],\n\t\t\t\t\t'idOrder' => $idOrder,\n\t\t\t\t\t'nameProduct' => $orderedProduct['productName'],\n\t\t\t\t\t'priceHTProduct' => $orderedProduct['priceHT'],\n\t\t\t\t\t'quantity' => $orderedProduct['quantity'],\n\t\t\t\t\t'VATRate' => $orderedProduct['VATRate']\n\t\t\t\t];\n\n\t\t\t\t//ajout de la ligne de commande dans la BDD\n\t\t\t\t$orderLinesManager = new OrderLinesManager();\n\t\t\t\t$orderAdded = $orderLinesManager -> addOne($requiredData['orderLines']['products'][$orderedProduct['productId']]);\n\n\t\t\t\t/*\n\t\t\t\t\tVariante avec une seule requête :\n\t\t\t\t\t$orderLinesManager = new OrderLinesManager();\n\t\t\t\t\t$orderAdded = $orderLinesManager -> addMany($requiredData));\n\n\t\t\t\t\t-> mettre en forme $requiredData\n\t\t\t\t*/\n\n\t\t\t\t//si la ligne n'a pas été ajoutée\n\t\t\t\tif ($orderAdded != 1)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['alertMessages']['error'][] = 'La création de la commande a échoué !';\n\t\t\t\t\t/*throw new Exception('La commande n\\'a pas été ajoutée : erreur dans addOrderLines');*/\n\t\t\t\t\t$this -> generateView('orders/order-recap.phtml');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_SESSION['alertMessages']['success'][] = 'La commande a bien été enregistrée !';\n\t\t\t//vidage du panier\n\t\t\tunset($_SESSION['shoppingCart']);\n\t\t\t//affichage de la page de succès de la commande\n\t\t\theader('Location:success');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['alertMessages']['error'][] = 'La création de la commande a échoué !';\n\t\t\t/*throw new Exception('La commande n\\'a pas été ajoutée : erreur dans addOne');*/\n\t\t\t$this -> generateView('orders/order-recap.phtml');\n\t\t}\n\t}", "public function actionAjouter_produit()\n {\n $produit = new Produit();\n if(Yii::$app->request->isAjax){\n $params = Yii::$app->request->post()['produit'];\n if($params['id']!=0){\n $produit = Produit::find()->where(['id'=>(int)$params['id']])->one();\n } \n //exit;\n if(!empty($params['designation'])){\n foreach ($produit as $key => $value) {\n\n if(isset($params[$key])){\n $produit->$key=$params[$key];\n }\n\n }\n\n\n if($produit->id){\n $produit->date_update = date('Y-m-d H:i:s');\n $produit->update_by = Yii::$app->user->identity->id;\n if($produit->save()){\n $data = [\n 'state'=>'ok',\n 'message'=>'Produit modifié avec succès',\n ] ;\n }else{\n $data = [\n 'state'=>'ko',\n 'message'=>'Echec de modification du produit',\n //'results'=>$menu->getErrors(),\n ] ;\n }\n\n }else{\n $exist = Produit::find()->where(['designation'=>$produit->designation])->one();\n if($exist && $exist->statut==0){\n $exist->statut = 1;\n $produit->date_update = date('Y-m-d H:i:s');\n $produit->update_by = Yii::$app->user->identity->id;\n if($exist->save()){\n $data = [\n 'state'=>'ok',\n 'message'=>'Produit enrégistré avec succès',\n ] ;\n }else{\n $data = [\n 'state'=>'ko',\n 'message'=>'Echec d\\'enrégistrement du produit',\n //'results'=>$menu->getErrors(),\n ] ;\n }\n }else{\n $produit->date_create = date('Y-m-d H:i:s');\n $produit->create_by = Yii::$app->user->identity->id;\n if($produit->save()){\n $data = [\n 'state'=>'ok',\n 'message'=>'Produit enrégistré avec succès',\n ] ;\n }else{\n $data = [\n 'state'=>'ko',\n 'message'=>'Echec d\\'enrégistrement du produit',\n //'results'=>$menu->getErrors(),\n ] ;\n }\n\n }\n\n }\n\n }else{\n $data = [\n 'state'=>'ko',\n 'message'=>'Veuillez renseigner le formulaire s\\'il vous plait',\n ] ;\n }\n\n $class = $data['state']=='ok'? 'success':'error';\n $message = $data['message'];\n\n Yii::$app->getSession()->setFlash($class,$message);\n\n return json_encode($data);\n\n }\n\n }", "public function ajoutEnseignant() {\n //on aurait pu utiliser aussi le code suivant : $nom=$this->nom();\n\n $nom = parent::nom();\n $age=parent::age();\n $salaire=$this->_salaire;\n //donne la date et l'heure d'enregistrement du fichier\n date_default_timezone_set(\"Europe/Paris\");\n $date=date(\"d/m/y à H:i:s\");\n //creation du contenu du fichier à créer\n $chaine = $nom . ';' . $age . ';' . $salaire . ';';\n file_put_contents('fichiers/enseignants/' . $nom . '.txt', $chaine);\n echo \"le fichier de l'enseignant :<strong>\" . $nom . \"</strong> \"\n . \"a bien été créé le <strong>\" . $date. \"</strong>\";\n // var_dump($chaine);\n }", "public function crear_coach() {\n\n\n try{\n \n $pdo = AccesoDB::getCon();\n\n $sql_crear_usu = \"INSERT INTO `coach`(`correo_coach`,`pass_coach`,`nom_coach`,`fono_coach`,`vig_coach`,`super`,`fb_coach`,`tipo_coach`)\n VALUES(:correo,:pass,:nom,:fono,:vig,:super,:fb, :tipo)\";\n\n\n $stmt = $pdo->prepare($sql_crear_usu);\n $stmt->bindParam(\":correo\", $this->correo, PDO::PARAM_STR);\n $stmt->bindParam(\":pass\", $this->contraseña, PDO::PARAM_STR);\n $stmt->bindParam(\":nom\", $this->nombre, PDO::PARAM_INT);\n $stmt->bindParam(\":fono\", $this->fono, PDO::PARAM_STR);\n $stmt->bindParam(\":vig\", $this->vigencia, PDO::PARAM_BOOL);\n $stmt->bindParam(\":super\", $this->super, PDO::PARAM_BOOL);\n $stmt->bindParam(\":fb\", $this->fb, PDO::PARAM_STR);\n $stmt->bindParam(\":tipo\", $this->tipo, PDO::PARAM_INT);\n $stmt->execute();\n \n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); window.location='../../index.html';</script>\"; \n }\n }", "function insertarCulto(){\n\t\t$this->procedimiento='ccb.f_culto_ime';\n\t\t$this->transaccion='CCB_CUL_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_casa_oracion','id_casa_oracion','int4');\n\t\t$this->setParametro('dia','dia','varchar');\n\t\t$this->setParametro('hora','hora','time');\n\t\t$this->setParametro('tipo_culto','tipo_culto','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 creerContratAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n \n $session = $request->getSession(); \n\n $form = $this->get('form.factory')->createNamedBuilder('formulaire_creer_contrat')\n ->add('producteur',EntityType::class,array('class' => 'AMAPBundle:Acteur',\n 'choice_label' => 'nom',\n 'query_builder' => $this->getDoctrine()\n ->getRepository('AMAPBundle:Acteur')\n ->getProducteurs(1,$session->get('amap'))))\n ->add('consommateur',EntityType::class,array('class' => 'AMAPBundle:Acteur',\n 'choice_label' => 'nom',\n 'query_builder' => $this->getDoctrine()\n ->getRepository('AMAPBundle:Acteur')\n ->getActeurs(2,$session->get('amap'))))\n ->add('amap',EntityType::class,array('class' => 'AMAPBundle:Amap', \n 'choice_label' => 'libelle',\n 'query_builder' => $this->getDoctrine()\n ->getRepository('AMAPBundle:Amap')\n ->getAmap($session->get('amap'))))\n ->add('panier',EntityType::class,array('class' => 'AMAPBundle:Panier', \n 'choice_label' => 'libelle',\n 'query_builder' => $this->getDoctrine()\n ->getRepository('AMAPBundle:Panier')\n ->getAmap($session->get('amap'))))\n ->add('ajouter', SubmitType::class, array('label' => 'Créer contrat'))\n ->getForm();\n\n if ($form->handleRequest($request)->isSubmitted()){\n if ($form->get('ajouter')->isClicked())\n {\n $data = $form->getData();\n\n $contrat = new Contrat();\n\n $contrat->setProducteur($data['producteur']);\n $contrat->setConsommateur($data['consommateur']);\n\t\t\t\t$contrat->setAmap($data['amap']);\n $contrat->setPanier($data['panier']);\n\n $em->persist($contrat);\n $em->flush();\n }\n }\n \n return $this->render('AMAPBundle:Admin/Contrat:creerContrat.html.twig',array('page_courante' => 'AdminContrats', 'onglet_courant' => 'creerContratAction',\n 'form' => $form->createView()));\n }", "public function AddBitacora($mensaje,$data='',$referencia=null){\n \n\n $bitacorasTable = TableRegistry::get('Bitacoras');\n $bitacora = $bitacorasTable->newEntity();\n \n $bitacora->usuario = $this->Auth->user('login');\n $bitacora->ip =$_SERVER['REMOTE_ADDR'];\n $bitacora->fecha = date(\"Y-m-d H:i:s\");;\n $bitacora->descripcion = $mensaje;\n $bitacora->data = $data;\n $bitacora->referencia = $referencia;\n\n if ($bitacorasTable->save($bitacora)) {\n \n }\n \n }", "public function ajoutLivre()\n {\n $livre = new Livre();\n $livre->titre = 'Le royaume de Zabota';\n $livre->auteur = 'Pulcherie TIENDREBEOGO';\n $livre->dateedit = \"25/04/2021\";\n $livre->exemplaire = 17;\n $livre->save(); \n dd($livre);\n }", "public function SaveColecao() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtNome) $this->objColecao->Nome = $this->txtNome->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Colecao object\n\t\t\t\t$this->objColecao->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t\t$this->lstReferencias_Update();\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "public static function create_incidencia_gerente(){\n\n\t\tsession_start();\n\n\t\tView::set(\"pageTitle\", $_SESSION['logged_user_saludo'] . \" | Creando Incidencia \");\n\n\t\t/* Manager logueado */\n\t\t$user = $_SESSION['logged_user'];\n\t\t$empresaId = $user->empresaId;\n\n\t\tView::set(\"user\", $user);\n\n\t\tif ( isset( $_POST['givenname'] ) ){\n\t\t\ttry {\n\t\t\t\t$usuarioAfectadoId= $_POST['givenname'];\n\t\t\t\t$equipoId \t \t = $_POST['equipos'];\n\t\t\t\t$tipoFalla \t\t = $_POST['tipo_falla'];\n\t\t\t\t$observaciones = $_POST['observaciones'];\n\n\t\t\t\t/* Limpiando campo textual */\n\t\t\t\t$observaciones = stripslashes($observaciones);\n\n\t\t\t\t/* Limpiando seleccion: es USUARIO ó EQUIPO */\n\t\t\t\tif ( $usuarioAfectadoId == 0){\n\t\t\t\t\t$usuarioAfectadoId = \"\";\n\n\t\t\t\t} else if ( $equipoId == 0){\n\t\t\t\t\t$equipoId = \"\";\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 * Datos de Conexion Remota en Partner \n\t\t\t\t * campos: remote, userID y password\n\t\t\t\t */\n\t\t\t\t$json = $_POST['jsonDatosConexion'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/* insertar Falla */\n\t\t\t\t$incidenciaId = Incidencias::insert($usuarioAfectadoId, $equipoId, $tipoFalla, $observaciones, $empresaId, $json);\n\n\t\t\t\tif ( $incidenciaId > 1 ){\n\t\t\t\t\tView::set(\"incidencia_generada_correctamente\",\"inciencia generada correctamente\");\n\t\t\t\t\tView::set(\"user\", $user);\n\n\t\t\t\t\t/**/\n\t\t\t\t\tTransaccion::insertTransaccionIncidencia2(\"Ok\", $user->id,\n\t\t\t\t\t\t\t$_SESSION['role_user'], $empresaId, \"\", $incidenciaId);\n\n\t\t\t\t} else {\n\t\t\t\t\t/**/\n\t\t\t\t\t$info = $equipoId.\" \".$tipoFalla.\" \".$observaciones;\n\n\t\t\t\t\tTransaccion::insertTransaccionIncidencia(\"Not_Ok\", $user->id,\n\t\t\t\t\t\t\t$_SESSION['role_user'], $empresaId, $info);\n\t\t\t\t}\n\n\t\t\t\t/* VISTA */\n\t\t\t\t$opcionMenu = \"incidencia_creada\";\n\t\t\t\tView::set(\"opcionMenu\", $opcionMenu);\n\n\t\t\t\tif ( $_SESSION['role_user'] == \"client\" ) {\t\tView::render( \"portal_client_home\" );\n\t\t\t\t} else if($_SESSION['role_user'] == \"manager\"){\tView::render( \"portal_manager_home\" );\n\t\t\t\t}\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo 'Excepción capturada: ', $e->getMessage(), \"\\n\";\n\t\t\t}\n\n\t\t} else {\n\t\t\t/**/\n\t\t\tTransaccion::insertTransaccionErrorFormulario(\"Incidencia_Crear\",\"Portal.create_incidencia_gerente()\", \n\t\t\t\t\t$user->id, $_SESSION['role_user'], $empresaId, \"No POST() del Formulario\");\n\t\t}\n\t}", "public function addUser(airforcetwo $donnees) {\r\n $pdo=new connexionpdo();\r\n $prepare = $pdo->pdo_start()->prepare(\"INSERT INTO inscription (nom, prenom, phone, adresse, pays, email, mdp, fidelite) VALUES (?,?,?,?,?,?,?,?)\");\r\n $prepare->execute([\r\n $donnees->getNom(),\r\n $donnees->getPrenom(),\r\n $donnees->getPhone(),\r\n $donnees->getAdresse(),\r\n $donnees->getPays(),\r\n $donnees->getEmail(),\r\n $donnees->getMdp(),\r\n $donnees->getFidelite()\r\n\r\n ]);\r\n $this->setMessage('Vous êtes inscrit avec succès','/src/view/login.php');\r\n}", "public function store(Request $request)\n {\n {\n $this->validate($request, [\n 'ragione_sociale' => 'required',\n 'email' => 'required|email',\n ], [\n 'ragione_sociale.required' => 'La ragione sociale è obbligatoria',\n 'email.required' => 'L\\'email è obbligatoria'\n ]);\n\n $societa = new \\App\\societa;\n\n $societa->ragione_sociale= $request->input('ragione_sociale');\n $societa->ateco_id= $request->input('ateco_id');\n $societa->descrizione_attivita = $request->input('descrizione_attivita');\n $societa->ref_aziendale= $request->input('ref_aziendale');\n $societa->n_dipendenti= $request->input('n_dipendenti');\n $societa->piva= $request->input('piva');\n $societa->cod_fiscale= $request->input('cod_fiscale');\n $societa->email= $request->input('email');\n $societa->pec= $request->input('pec');\n $societa->indirizzo_sede_legale= $request->input('indirizzo_sede_legale');\n $societa->telefono= $request->input('telefono');\n $societa->cellulare= $request->input('cellulare');\n $societa->cap= $request->input('cap');\n $societa->regione= $request->input('regione');\n $societa->sito= $request->input('sito');\n $societa->fondo_id= $request->input('fondo_id');\n\n if($request->input('demo')==1)\n $societa->demo= 1;\n\n $societa->save();\n\n\n// CREO L'UTENTE TUTOR DELL'AZIENDA\n $tutor= new \\App\\User;\n $tutor->name= '['.$societa->ragione_sociale.']';\n $tutor->nome = 'Tutor'. '['.$societa->ragione_sociale.']';\n $tutor->cognome = 'Tutor' . '['.$societa->ragione_sociale.']';\n $tutor->email=$societa->email;\n $tutor->societa_id=$societa->id;\n $tutor->password = bcrypt($societa->piva);\n $tutor->attivazione = uniqid();\n \n $tutor->bloccato = 1;\n\n //Mando la mail di attivazione\n Mail::send('emails.attivazione_soc', ['tutor' => $tutor, 'societa' => $societa], function ($m) use ($tutor) {\n $m->from('info@tanitsrl.it', 'TANIT');\n $m->to($tutor->email, $tutor->nome);\n $m->subject('Attivazione account');\n });\n\n\n $tutor->save();\n\n// CREO L'ANAGRAFICA\n $user_profiles= new \\App\\user_profiles();\n $user_profiles->user_id= $tutor->id;\n $user_profiles->id= $tutor->id;\n $user_profiles->save();\n\n// GLI ASSEGNO AI GRUPPI AZIENDA E DEMO OPZIONALE\n $tutor->roles()->attach(['role_id' => 3]); //AZIENDA\n if($request->input('demo')==1)\n $tutor->roles()->attach(['role_id' => 4]); //DEMO\n\n// GLI ASSEGNO COME TUTOR DELL'AZIENDA DEMO\n $tutor->_tutor_societa()->attach(['societa_id' => $societa->id]);\n\n\n// CREO UTENTI DEMO\n if($request->input('demo')==1){\n $nomi = ['Mario', 'Stefano', 'Martina', 'Francesca', 'Angelo', 'Paolo', 'Martina', 'Mattia', 'Massimo'];\n $cognomi = ['Rossi', 'Picasso', 'Cafiero', 'Bianchi', 'Resato', 'Stagnari', 'Ressotti', 'Lombardi', 'Cersoli' ];\n\n for ($i = 0; $i<=3 ; $i++){\n $user_demo= new \\App\\User;\n $user_demo->nome = $nomi[array_rand($nomi)];\n $user_demo->cognome = $cognomi[array_rand($cognomi)];\n $user_demo->name = $user_demo->nome.\".\".$user_demo->cognome;\n $email = strtolower(substr($user_demo->nome, 0 , 1).\".\".$user_demo->nome.\"@test.\".$societa->ragione_sociale.\".it\");\n// $user_demo->email=preg_replace(\"/[^A-Za-z0-9?!]/\",'',$email);\n $user_demo->email = filter_var($email, FILTER_SANITIZE_EMAIL);\n\n $user_demo->societa_id=$societa->id;\n $user_demo->password = bcrypt($user_demo->email);\n $user_demo->save();\n\n\n $user_demo_profiles= new \\App\\user_profiles();\n $user_demo_profiles->user_id= $user_demo->id;\n $user_demo_profiles->id= $user_demo->id;\n $user_demo_profiles->save();\n\n// GRUPPO USER\n $user_demo->roles()->attach(['role_id' => 1]);\n\n\n }\n//NON lo faccio accedere perchè prima deve attivare\n// Auth::login($tutor);\n }\n\n return redirect('attivazione');\n }\n }", "public function crearCita (Request $request, $id) {\n \n $tramite = new Tramite();\n $tramite->opcion_id= $id;\n $tramite->egresado_id=$request->session()->get('LoggedUser');\n $tramite->save();\n \n $opcion = Opcion::find($id);\n return view('egresado.tesis')->with('opcion',$opcion);;\n }", "public function create_company(){\n $data = array(\n 'name' => 'PhotoUp',\n 'description' => 'editing Production',\n 'job_categories_id' => 3,\n 'cities_id' => 100,\n 'address' => 'Talisay City',\n 'contact_number' => '505-5555'\n );\n\n try{\n $this->users->create_company(3,$data);\n echo 'OK';\n }catch(Exception $e){\n die($e->getMessage());\n }\n\n }", "public function create($id_paciente,$hora,$dia)\n {\n $cita =new App\\Cita();\n $cita->id_paciente = $id_paciente;\n $cita->hora= $hora;\n $cita->dia= $dia;\n $cita->save();\n\n }", "public function insertCSalarie()\n {\n extract($_POST);\n $CSalarie = new ClientSalarie();\n\n $CSalarie->setIdClient($this->insertFirstINClient($matricule,$email,$telephone));\n\n $CSalarie->setCni($cni);\n $CSalarie->setNom($nom);\n $CSalarie->setPrenom($prenom);\n $CSalarie->setProfession($profession);\n $CSalarie->setNomEntreprise($nom_Entreprise);\n $CSalarie->setAdresseEntreprise($adresseforCl);\n\n \n if( $this->SalarieRespo->insertSalarie($CSalarie) != 0){\n return $this->view->redirect(\"Pages/getPageCni\");\n }\n\n }", "function ajouterCampagneAction(Request $request) {\n\n $campagne = new Campagne();\n $form = $this->createForm( new CampagneType(), $campagne);\n $form->handleRequest($request);\n\n\n\n\n if($form->isValid()) {\n $numEmails = 0;\n $em = $this->getDoctrine()->getManager();\n $campagne->setPause(true);\n $campagne->setClicks(0);\n $campagne->setOpens(0);\n $campagne->setUnsubs(0);\n $campagne->setNumSent(0);\n $campagne->setNumNoSent(0);\n $campagne->setDate(new \\DateTime());\n $em->persist($campagne);\n $em->flush();\n\n\n $fields = array(\n 'id' => $campagne->getId(),\n 'lienOffre' => urlencode($campagne->getOffre()->getLien()),\n 'lienImage' => urlencode($campagne->getOffre()->getCreative()),\n 'lienUnsub' => urlencode(\"http://newofferz4u.com/unsublist\")\n );\n $fields_string = '';\n $url = 'http://newofferz4u.com/addCamp.php';\n\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string, '&');\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 curl_setopt($ch,CURLOPT_POST, count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n $chemin = $this->container->get('kernel')->getRootdir().'/../web/logs/';\n $chemin = $chemin.$campagne->getId();\n mkdir($chemin);\n\n $fileEmails = $chemin.\"/emails.txt\";\n $file = fopen($fileEmails,\"a\");\n\n for($i=0; $i<count($campagne->getDatas()); $i++)\n {\n foreach($campagne->getDatas()[$i]->getEmails() as $email)\n {\n fwrite($file, $email->getEmail().\",\".$email->getId().\"\\n\");\n $numEmails = $numEmails +1;\n }\n }\n fclose($file);\n $campagne->setNumNoSent($numEmails);\n $em->flush();\n\n $fileNumSent = $chemin.\"/numSent.txt\";\n $file = fopen($fileNumSent,\"a\");\n fwrite($file, $campagne->getNumSent().\"\\n\");\n fclose($file);\n\n $fileNumNoSent = $chemin.\"/numNoSent.txt\";\n $file = fopen($fileNumNoSent,\"a\");\n fwrite($file, $campagne->getNumNoSent().\"\\n\");\n fclose($file);\n\n $filePause = $chemin.\"/pause.txt\";\n $file = fopen($filePause,\"a\");\n fwrite($file, \"1\".\"\\n\");\n fclose($file);\n\n $fileLog = $chemin.\"/log.txt\";\n $file = fopen($fileLog,\"a\");\n fwrite($file, \"---CAMPAGNE CREATED AT : \".date('l jS \\of F Y h:i:s A').\"\\n\");\n fclose($file);\n\n $fileIps = $chemin.\"/ips.txt\";\n $file = fopen($fileIps,\"a\");\n foreach($campagne->getIps() as $ip)\n {\n fwrite($file, $ip->getIp().\",\".$ip->getHost().\",\".$ip->getUsername().\",\".$ip->getPassword().\"\\n\");\n }\n fclose($file);\n\n\n return $this->redirect($this->generateUrl(\"index\"));\n }\n\n return $this->render('MailBundle:Default:ajouter.html.twig', array(\n 'form' => $form->createView() ,\n ));\n\n\n }", "public function create(){\n// \treturn view(\"nuevaCotizacion.create\",[\"clientesJuridico\"=>$clientesJuridico]);\n }", "public function addToDb() {\n parent::addToDb();\n $qry=\"INSERT INTO pracownik VALUES('','','$this->last_id','$this->date','$this->stan','$this->cash')\";\n $db=new baseConfig();\n $id=$this->last_id;\n switch($this->stan) {//tworzenie kwerendy w zależności od rodzaju dodawanego użytkownika\n case 'administracja';\n $qry2=\"UPDATE osoba SET mode=3 WHERE osoba.id_osoba='$id'\";\n break;\n case 'admin';\n $qry2=\"UPDATE osoba SET mode=0 WHERE osoba.id_osoba='$id'\";\n break;\n case 'rejestracja';\n $qry2=\"UPDATE osoba SET mode=4 WHERE osoba.id_osoba='$id'\";\n break;\n default:break;\n }\n if(!$this->error){\n $db->getRes($qry);\n $db->getRes($qry2);\n }\n }", "function ajouterProduit($id_produit, $quantite, $photo, $titre, $prix){\n\t\tif (!isset($_SESSION['panier'])) { // S'il n'existe pas déjà de partie panier dans la session...\n\t\t\t// ...on la crée\n\t\t\t$_SESSION['panier'] = array();\n\t\t}\n\t\tif (isset($_SESSION['panier'][$id_produit])) { //Si le produit qu'on est en train d'ajouter existe déjà dans le panier, nous n'allons pas créer une ligne mais ajouter la nouvelle quantité\n\t\t\t$_SESSION['panier'][$id_produit]['quantite'] += $quantite;\n\t\t}\n\t\telse{ // Sinon on crée les détails du produit\n\t\t\t$_SESSION['panier'][$id_produit] = array();\n\t\t\t$_SESSION['panier'][$id_produit]['quantite'] = $quantite;\n\t\t\t$_SESSION['panier'][$id_produit]['photo'] = $photo;\n\t\t\t$_SESSION['panier'][$id_produit]['prix'] = $prix;\n\t\t\t$_SESSION['panier'][$id_produit]['titre'] = $titre;\n\t\t}\n\t\t\n}", "public function actionCreate()\n {\n $model = new Cuentacorriente();\n $modCli = new Clientes();\n $datos = $modCli->find()->all();//de esta forma obtengo todo los datos de la tabla en array\n \n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idCtaCte]);\n }\n\n return $this->render('create', ['model' => $model,'modCli'=>$modCli,'datos'=>$datos]);\n }", "public function actionCreateColeccionEnComunidad()\n {\n if (Yii::$app->request->isPost) {\n $body = Yii::$app->request->getRawBody();\n $body = Json::decode($body);\n\n $prefijo = '/rest/communities/';\n $host = ConfiguracionDspace::find()->where(\"clave='host'\")->one()->valor;\n $puerto = ConfiguracionDspace::find()->where(\"clave='puerto'\")->one()->valor;\n\n $token = $body['token'];\n $id = $body['id'];\n $final = '/collections';\n $url = $host . ':' . $puerto . $prefijo . $id . $final;\n\n $name = $body['name'];\n $logo = $body['logo'];\n $copyrightText = $body['copyrightText'];\n $introductoryText = $body['introductoryText'];\n $shortDescription = $body['shortDescription'];\n $sidebarText = $body['sidebarText'];\n $license = $body['license'];\n $community = array('name' => \"$name\", \"logo\" => $logo,\"copyrightText\" => \"$copyrightText\",\"introductoryText\" => \"$introductoryText\", \"shortDescription\" => \"$shortDescription\",\"sidebarText\" => \"$sidebarText\",\"license\" => \"$license\");\n $datos = json_encode($community);\n\n $headers = array('Content-Type: application/json', 'Accept: application/json', \"rest-dspace-token: \" . $token);\n\n $curl = curl_init($url);\n $options = array(\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => $datos,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => $headers\n );\n\n curl_setopt_array($curl, $options);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n }\n }", "public function add_data()\n {\n try\n {\n \n $sql=\"INSERT into contacto Values(0,?,?,?,?,?)\";\n \n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->cliente_id_Cliente);\n $consulta->bindParam(2,$this->asunto_contacto);\n $consulta->bindParam(3,$this->date_contacto);\n $consulta->bindParam(4,$this->text_contacto);\n $consulta->bindparam(5,$this->status_contacto);\n $consulta->execute();\n $this->con=null; \n\n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "function ajouterUe($id, $codeUe, $nomUe) {\n\t\tif (verifResponsable($id)) {\n\t\t\t$query = 'insert into ue values(\"\",\"'.$codeUe.'\",\"'.$nomUe.'\")';\n\t\t\tmysql_query($query) or die (\"Impossible d'inserer une UE\");\n\t\t}\n\t}", "public function insert()\n {\n $utenti = $this->dao(\"UtentiDAO\");\n $messaggio = \"crea nuovo utente\";\n //se ci sonoi valori post allora crea utente\n if (isset($_POST['nome']) && isset($_POST['cognome'])) {\n $utente = new utente();\n $utente->nome = filter_var($_POST['nome'], FILTER_SANITIZE_URL);\n $utente->cognome = filter_var($_POST['cognome'], FILTER_SANITIZE_URL);\n //inserisci utente\n if ($utenti->insert($utente)) {\n $messaggio = \"utente inserito\";\n }\n\n //torna all'indice\n }\n $this->view('main/header');\n $this->view('users/put', ['messaggio' => $messaggio]);\n $this->view('main/footer');\n\n }", "function registrarCredito($producto,$cantidad,$nombre,$direccion,$observacion,$precio)\n\t\t{\n\t\t\tdate_default_timezone_set(\"America/Santiago\");//metodo para que la hora sea la de Chile\n\t\t\t$time = time();\n\t\t\t$sql=\"INSERT INTO `chocman`.`creditos` VALUES (NULL, '$producto', '$cantidad', '$nombre', '$direccion','$precio', '\".date(\"Y-m-d (H:i:s)\", $time).\"','\".date(\"H:i:s\").\"', NULL, '$observacion');\";\n\t\t\t$sentencia=mysql_query($sql,$this->id_con);\n\t\t\t//echo $producto.\" \".$cantidad.\" \".$nombre.\" \".$direccion.\" \".$observacion.\" \".$precio;\n\t\t\techo \"Credito Registrado\";\n\t\t}", "public function crear_cliente() {\n\n\n try{\n \n $pdo = AccesoDB::getCon();\n\n $sql_crear_cli = \"INSERT INTO `clientes`(`correo_cli`,`pass_cli`,`nom_cli`,`fono_cli`,`fec_nac_cli`,`fec_plan_cli`,`vig_cli`,`tipo_cli`,`servicio_cli`)\n VALUES(:correo,:pass,:nom,:fono,:fec_nac,:fec_plan,:vig,:gym, :ser)\";\n\n\n $stmt = $pdo->prepare($sql_crear_cli);\n $stmt->bindParam(\":correo\", $this->correo, PDO::PARAM_STR);\n $stmt->bindParam(\":pass\", $this->contraseña, PDO::PARAM_STR);\n $stmt->bindParam(\":nom\", $this->nombre, PDO::PARAM_STR);\n $stmt->bindParam(\":fono\", $this->fono, PDO::PARAM_INT);\n $stmt->bindParam(\":fec_nac\", $this->fec_nac, PDO::PARAM_STR);\n $stmt->bindParam(\":fec_plan\", $this->fec_plan, PDO::PARAM_STR);\n $stmt->bindParam(\":vig\", $this->vigencia, PDO::PARAM_BOOL);\n $stmt->bindParam(\":gym\", $this->gimnasio, PDO::PARAM_INT);\n $stmt->bindParam(\":ser\", $this->servicio, PDO::PARAM_INT);\n $stmt->execute();\n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); window.location='../paginas_usu/clientes.php';</script>\"; \n }\n }", "public function add()\n {\n \t$con = new Conexao();\n //Recebendo a conexao com o bando\n $pdo = $con->getPdo();\n\n \t//QUERY PARA INSERIR USUARIO NO BANCO\n \t$inserir = $pdo->prepare(\"INSERT INTO usuarios(nome,email,senha,status) VALUES(:nome,:email,:senha,:status)\");\n \t$inserir->bindValue(\":nome\", utf8_encode($this->getNome()));\n \t$inserir->bindValue(\":email\", $this->getEmail());\n \t$inserir->bindValue(\":senha\", $this->getSenha());\n \t$inserir->bindValue(\":status\", $this->getStatus());\n \t$inserir->execute();\n\n }", "public function saveO(){\n $order = $this->create(['client_id'=>auth()->user()->id]); \n }", "function insertaProyecto(){\n \t$this->buffer=0;\n \tif(count($this->data) > 0){\n \t\t$this->data['inputNombre'] = $this->limpiaCadenas($this->data['inputNombre']);\n \t\t$this->data['descripcion'] = $this->limpiaCadenas($this->data['descripcion']);\n \t\t$this->data['resultados'] = $this->limpiaCadenas($this->data['resultados']);\n \t\t$this->buffer = $this->altaProyectoCompleto($this->data,$this->session);\n \t}\n }", "function add($cotizacion_id)\n {\n if($this->acceso(37)){\n $data['page_title'] = \"Cotización\";\n $usuario_id = $this->session_data['usuario_id'];\n $data['cotizacion_id'] = $cotizacion_id; \n $this->load->model('Detalle_cotizacion_model');\n $data['detalle_cotizacion'] = $this->Cotizacion_model->get_detalle_cotizacion($cotizacion_id);\n $this->load->model('Producto_model');\n //$data['producto'] = $this->Producto_model->get_all_productos(); \n $data['cotizacion'] = $this->Cotizacion_model->get_cotizacion($cotizacion_id); \n $data['_view'] = 'cotizacion/add';\n $this->load->view('layouts/main',$data);\n \n }\n }", "public function actionCreate() {\n $model = new NotaVenta;\n $transaction = $model->dbConnection->beginTransaction();\n try {\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['NotaVenta'])) {\n $model->attributes = $_POST['NotaVenta'];\n //Agregamos el iva a la nota de venta\n $model->monto = $model->monto * 1.21;\n $model->userStamp = Yii::app()->user->model->username;\n if ($model->save()) {\n //cargamos el debito en la cuenta corriente del cliente\n $ctacte = new CtaCteClientes();\n $ctacte->tipoMov = 0;\n $ctacte->notaVentaId = $model->id;\n $ctacte->fecha = date(\"Y-m-d\");\n $ctacte->conceptoId = 13;\n $ctacte->monto = $model->monto;\n $ctacte->userStamp = Yii::app()->user->model->username;\n $ctacte->timeStamp = Date(\"Y-m-d h:m:s\");\n if ($ctacte->save()) {\n //redireccionamos a la pagina del cliente\n Yii::app()->user->setFlash('success', 'Nota de Venta Procesada Con Exito');\n $transaction->commit();\n $this->redirect(array('clientes/view', 'id' => $model->clienteId));\n } else {\n //redireccionamos a la pagina del cliente\n Yii::app()->user->setFlash('errpr', 'No se Guardo en Cuenta Corriente');\n $transaction->rollBack();\n $this->redirect(array('clientes/view', 'id' => $model->clienteId));\n }\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }", "public function store(ContattiRequest $request)\n {\n $messages = [];\n $data = $request->all();\n $user = User::withTrashed()->where('email', $request->email);\n if ($user->count() > 0) {\n if ($user->first()->tipo_utente == 1) {\n $messages[] = \"Un consulente non può essere associato come contatto <a href='\" . action('ConsulenteController@edit', $user->first()->consulente->id) . \"'> Link al CONSULENTE</a>\";\n\n return redirect()->back()->withErrors($messages);\n } else {\n if ($request->cliente_id)\n ClienteContatto::firstOrCreate(['cliente_id' => $request->cliente_id, 'contatto_id' => $user->first()->contatto->id]);\n\n return redirect()->action('ContattoController@edit', $user->first()->contatto->id)->withErrors($messages);\n }\n } else {\n $user = User::create(['email' => $request->email, 'password' => bcrypt('tksol'), 'tipo_utente' => '2']);\n $contatto = Contatto::create($data);\n $contatto->user()->associate($user->id);\n $contatto->save();\n //crea link cliente-contatto\n if ($request->cliente_id)\n ClienteContatto::firstOrCreate(['cliente_id' => $request->cliente_id, 'contatto_id' => $contatto->id]);\n\n return redirect()->action('ContattoController@edit', $contatto->id)->withErrors($messages);\n }\n }", "public function actionCreate() {\n $model = new Cargos;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Cargos'])) {\n $model->attributes = $_POST['Cargos'];\n if (empty($model->ID_EMPRESA) || $model->ID_EMPRESA == '')\n $model->ID_EMPRESA = Yii::app()->getSession()->get('id_empresa');\n if ($model->save()) {\n Auditoria::model()->registrarAccion('', $model->ID_CARGO, $model->NOMBRE_CARGO);\n $this->redirect(array('view', 'id' => $model->ID_CARGO));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function criar(){\r\n\r\n if(isset($_POST['enviar'])){\r\n \r\n $titulo=$_POST['titulo'];\r\n $texto=$_POST['texto'];\r\n $senha=$_SESSION['senha'];\r\n $data = date('Y-m-d');\r\n $id = $_SESSION['id'];\r\n \r\n\r\n $sql=\"INSERT INTO noticias.noticias (descricao,titulo,data,usuario_id) VALUES ('$texto','$titulo','$data','$id')\";\r\n $conexao=Conexao::getConexao();\r\n $resultado=$conexao->query($sql);\r\n \r\n\r\n header('Location:'.HOME_URI.'noticia');\r\n\r\n }\r\n include HOME_DIR.\"view/paginas/noticias/criar.php\";\r\n}", "public function insert($cbtJadwalUjian);", "static public function ctrCrearCuota(){\n\n if(isset($_POST[\"nuevaFecha\"])){\n\n if(preg_match('/^[0-9]+$/', $_POST[\"nuevoMonto\"])){\n\n $tabla = \"cuotas\";\n\n $datos = array(\"fecha\"=> $_POST[\"nuevaFecha\"],\n \"glosa\"=> $_POST[\"nuevaGlosa\"],\n \"monto\"=> $_POST[\"nuevoMonto\"],\n \"boletin\"=> $_POST[\"nuevoBoletin\"],\n \"idCredito\"=>$_POST[\"idCredito\"]);\n\n $respuesta = ModeloCuota::mdlIngresarCuota($tabla, $datos);\n\n if($respuesta == \"ok\"){\n\n echo'<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 cuota ha sido guardada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n allowEscapeKey: false,\n allowOutsideClick: false,\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=cuotas&idCliente='.$_GET[\"idCliente\"].'&idCredito='.$_GET[\"idCredito\"].'\";\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\n\n }else{\n\n echo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La Cuota no puede ir vacía o llevar caracteres especiales!\",\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\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"index.php?ruta=cuotas&idCliente=\"+idCliente +\"&idCredito=\"+idCredito;\n\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n }\n\n }\n\n }", "function insertarCuenta(){\n\t\t$this->procedimiento='conta.ft_cuenta_ime';// nombre procedimiento almacenado\n\t\t$this->transaccion='CT_CUENTA_INS';//nombre de la transaccion\n\t\t$this->tipo_procedimiento='IME';//tipo de transaccion\n\t\t\n\t\t//Define los parametros para la funcion\t\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\treturn $this->respuesta;\n\t}", "public function InsertarCiclo($nom){\n $resultado = $this->bd->query(\"INSERT INTO snp_cicl (CIC_NOMB) VALUES ('$nom')\");\n return true;\n }", "public function insert($convenio);", "public function store(Request $request)\n {\n\n //////////bitacora////////\n $id=auth()->user()->persona_id;\n $persona=persona::findOrFail($id);\n $bitacora=new bitacora();\n $bitacora->usuario=$persona->nombre;\n $bitacora->tabla='crear de cajero';\n $bitacora->descripcion='el usuario'. $persona->nombre.'ingreso a las '.date(\"Y-m-d H:i:s\");;\n $bitacora->user_id=auth()->user()->id;\n $bitacora->save();\n ////////////////\n $request->validate([\n 'nombre'=>'required',\n 'Apellido'=>'required',\n\n 'fecha_nacimiento'=>'required',\n 'carnet_identidad'=>'required',\n 'profesion'=>'required',\n ]);\n $persona=new persona();\n $persona->nombre=$request->input('nombre');\n $persona->apellido=$request->input('Apellido');\n\n $persona->fecha_nacimiento=$request->input('fecha_nacimiento');\n\n $persona->save();\n\n\n $cajero=new cajero();\n $cajero->profesion=$request->input('profesion');\n $cajero->carnet_identidad=$request->input('carnet_identidad');\n $cajero->persona_id=$persona->id;\n $cajero->save();\n return redirect()->back()->with('status','cajero ya creado');\n\n\n }", "public static function create_incidencia(){\n\n\t\ttry {\n\t\t\tsession_start();\n\n\t\t\t$cantidadEquipos = $_POST['cantidad_equipos'];\n\n\t\t\t$equipoIdIncidencia = 0;\n\n\t\t\tif ( $cantidadEquipos == 0 ){\n\t\t\t\t$equipoIdIncidencia = NULL;\n\n\t\t\t} else if ( $cantidadEquipos == 1 ){\n\t\t\t\t$equipoIdIncidencia = $_POST['equipo_id'];\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$equipoIdIncidencia = $_POST['equipos'];\n\t\t\t}\n\n\t\t\t$tipoFalla \t\t= $_POST['tipo_falla'];\n\t\t\t$observaciones = $_POST['observaciones'];\n\n\t\t\t/* Limpiando campo textual */\n\t\t\t$observaciones = stripslashes($observaciones);\n\t\t\t\n\t\t\t/* usuario logueado */\n\t\t\t$user = $_SESSION['logged_user'];\n\t\t\t$userId\t\t= $user->id;\n\t\t\t$empresaId = $user->empresaId;\n\t\t\t\n\t\t\t\n\t\t\t/* \n\t\t\t * Datos de Conexion Remota en Partner \n\t\t\t * campos: remote, userID y password\n\t\t\t */\n\t\t\t$json = $_POST['jsonDatosConexion'];\n\t\t\t\n\t\t\t\n\t\t\t/* insertar Falla */\n\t\t\t$incidenciaID = Incidencias::insert($userId, $equipoIdIncidencia, $tipoFalla, $observaciones, $empresaId, $json);\n\n\t\t\tif ( $incidenciaID > 1 ){\n\t\t\t\t$incidencia_generada_correctamente = \"inciencia generada correctamente\";\n\n\t\t\t\tView::set(\"incidencia_generada_correctamente\",$incidencia_generada_correctamente);\n\t\t\t\tView::set(\"user\", $user);\n\n\t\t\t\t/**/\n\t\t\t\tTransaccion::insertTransaccionIncidencia2(\"Ok\", $userId,\n\t\t\t\t\t\t$_SESSION['role_user'], $empresaId, \"\", $incidenciaID);\n\n\t\t\t} else {\n\t\t\t\t/**/\n\t\t\t\t$info = $equipoIdIncidencia.\" \".$tipoFalla.\" \".$observaciones;\n\n\t\t\t\tTransaccion::insertTransaccionIncidencia(\"Not_Ok\", $userId,\n\t\t\t\t\t\t$_SESSION['role_user'], $empresaId, $info);\n\n\t\t\t}\n\n\t\t\t/* \n\t\t\t * En este caso se crea una Incidencia: enviar correo a usuario, al Partner (GERENTE) y a LanuzaGroup\n\t\t\t */\n\t\t\tEmailManagement::sendNuevaIncidencia($incidenciaID, $user, $_SESSION['role_user'],\n\t\t\t\t\t$equipoIdIncidencia, $tipoFalla, $observaciones);\n\n\t\t\tView::set(\"pageTitle\", \"Incidencia: Creada\");\n\n\n\t\t\tif ( $_SESSION['role_user'] == \"client\" ) {\n\n\t\t\t\t$opcionMenu = \"incidencia_creada\";\n\t\t\t\tView::set(\"opcionMenu\", $opcionMenu);\n\n\t\t\t\tView::render( \"portal_client_home\" );\n\n\t\t\t} else if ( $_SESSION['role_user'] == \"manager\" ) {\n\n\t\t\t\t$opcionMenu = \"incidencia_creada\";\n\t\t\t\tView::set(\"opcionMenu\", $opcionMenu);\n\n\t\t\t\tView::render( \"portal_manager_home\" );\n\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\t\t\t$internalErrorCodigo = \"Exception in controllers.Portal.create_incidencia()\";\n\t\t\t$internalErrorMessage = $e -> getMessage();\n\t\t\t$internalErrorExtra = $equipoIdIncidencia.\"--\".$tipoFalla.\"--\".$observaciones.\"--\".$observaciones.\"--\".$userId.\"--\".$empresaId;\n\t\t\t\n\t\t\t/**/\n\t\t\tTransaccion::insertTransaccionException(\"Incidencia_Crear\",$internalErrorCodigo, $internalErrorMessage, $internalErrorExtra, $_SESSION['role_user'], $userId);\n\t\t\t\n\t\t\tView::set(\"internalErrorCodigo\", $internalErrorCodigo);\n\t\t\tView::set(\"internalErrorMessage\",$internalErrorMessage);\n\t\t\tView::set(\"internalErrorExtra\",\t $internalErrorExtra);\n\n\t\t\tView::render(\"internalError\");\n\t\t\tdie;\n\t\t}\n\t}", "public function createAction($id_commande) {\n $entity = new DetailCommande();\n $request = $this->getRequest();\n $form = $this->createForm(new DetailCommandeType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager(); \n \n $commande = $em->getRepository('CrossknowledgeOrderManagementBundle:Commande')->find($id_commande);\n \n $entity->setCommande($commande);\n \n /* Enregistrement du créateur de la demande d'achat */\n $user = $this->get('security.context')->getToken()->getUser();\n $entity->setcreatedBy($user);\n \n /* Calcul du prix HT et du prix TTC */\n $prixUHT = $entity->getPrixHT();\n $tva = $entity->getTva() / 100;\n $fournisseur = $entity->getCommande()->getFournisseur();\n if (!isset($prixUHT))\n {\n $prix = $em->getRepository('CrossknowledgeOrderManagementBundle:Tarif')->getPrice($entity->getArticle(), $fournisseur)->getPrix();\n $prixHT = $entity->getQuantite() * $prix;\n $prixTTC = $prixHT * (1 + $tva);\n $entity->setPrixHT($prixHT);\n $entity->setPrixTTC($prixTTC);\n }\n else\n {\n $prixHT = $entity->getQuantite() * $prixUHT;\n $prixTTC = $prixHT * (1 + $tva);\n $entity->setPrixHT($prixHT);\n $entity->setPrixTTC($prixTTC);\n }\n\n /* Mise à jour du CA commandé et lettré du fournisseur */\n $caCom = $fournisseur->getCaCommande() + $prixHT;\n $fournisseur->setCaCommande($caCom);\n if ($entity->getLettrage() == true) {\n $caLett = $fournisseur->getCaLettre() + $prixHT;\n $fournisseur->setCaLettre($caLett);\n }\n $em->persist($fournisseur);\n\n /* Mise à jour du budget du responsable */\n $commande = $entity->getCommande();\n if ($commande->getTypeCommande() == 'Budget') {\n $manager = $entity->getassignedTo();\n $manager->setBudgetRestant($manager->getBudgetRestant() - $prixHT);\n $em->persist($manager);\n }\n\n /* Mise à jour DA/OA */\n if ($entity->getAccordBUM() == true) {\n $entity->setType('OA');\n } else {\n $entity->setType('DA');\n }\n\n $em->persist($entity);\n $em->flush();\n\n /* Envoi d'un e-mail au manager pour validation */\n $username = $this->container->get('security.context')->getToken()->getUser();\n $userManager = $this->get('fos_user.user_manager');\n $user = $userManager->findUserBy(array('username' => $username));\n $manager = $userManager->findUserBy(array('username' => $entity->getassignedTo()));\n \n if ($entity->getAccordBUM() != true)\n {\n $managerMail = $manager->getEmail();\n $recipient = $user->getEmail();\n $message = \\Swift_Message::newInstance()\n ->setSubject('Nouvelle demande d\\'achat')\n ->setFrom('achats@crossknowledge.com')\n ->setTo($managerMail)\n ->setCc($recipient)\n ->setBody($this->renderView('CrossknowledgeOrderManagementBundle:DetailCommande:emailDA.txt.twig', array('name' => $username, 'entity' => $entity, 'manager' => $manager)), 'text/html')\n ;\n $this->get('mailer')->send($message);\n }\n elseif ($entity->getAccordBUM() == true)\n {\n $managerMail = $manager->getEmail();\n $recipient = $user->getEmail();\n $message = \\Swift_Message::newInstance()\n ->setSubject('Validation de votre demande d\\'achat')\n ->setFrom('achats@crossknowledge.com')\n ->setTo($managerMail)\n ->setCc($recipient)\n ->setBody($this->renderView('CrossknowledgeOrderManagementBundle:DetailCommande:emailOA.txt.twig', array('name' => $username, 'entity' => $entity, 'manager' => $manager)), 'text/html')\n ;\n $this->get('mailer')->send($message);\n }\n return $this->redirect($this->generateUrl('detailcommande_show', array('id' => $entity->getId())));\n }\n\n return $this->render('CrossknowledgeOrderManagementBundle:DetailCommande:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function comentar($id){\r\n\r\n if(isset($_POST['enviar'])){\r\n\r\n $comentario = $_POST['comentario'];\r\n\r\n if(isset($_SESSION['login'])){\r\n\r\n $nome=$_SESSION['login'];\r\n\r\n $sql = \"INSERT INTO noticias.comentario (comentario,nome,noticia_id) VALUES ('$comentario','$nome','$id')\";\r\n\r\n $conexao=Conexao::getConexao();\r\n $resultado=$conexao->query($sql);\r\n\r\n }else{\r\n\r\n $sql = \"INSERT INTO noticias.comentario (comentario,nome,noticia_id) VALUES ('$comentario','Anonimo','$id')\";\r\n $conexao=Conexao::getConexao();\r\n $resultado=$conexao->query($sql);\r\n }\r\n\r\n }\r\n include HOME_DIR.\"view/paginas/noticias/noticia.php\";\r\n }", "function tambah_pasien(){\n\t\t$id_pasien = $this->input->post('id_pasien');\n\t\t$nama_pasien = $this->input->post('nama_pasien');\n\t\t$nomorkk_pasien = $this->input->post('nomorkk_pasien');\n\t\t$alamat_pasien = $this->input->post('alamat_pasien');\n\t\t$umur_pasien = $this->input->post('umur_pasien');\n\t\t$jk_pasien = $this->input->post('jk_pasien');\n\t\t$nomorhp_pasien = $this->input->post('nomorhp_pasien');\n\n\t\t//-- menyiapkan baris yang sesuai di database --//\n\t\t$data = array(\n\t\t\t'id_pasien' => $id_pasien,\n\t\t\t'nama_pasien' => $nama_pasien,\n\t\t\t'nomorkk_pasien' => $nomorkk_pasien,\n\t\t\t'alamat_pasien' => $alamat_pasien,\n\t\t\t'umur_pasien' => $umur_pasien,\n\t\t\t'nomorhp_pasien' => $nomorhp_pasien,\n\t\t\t'jk_pasien' => $jk_pasien\n\t\t);\n\t\t//-- memanggil database dari file kadermodel --//\n\t\t$this->kadermodel->input_data($data,'pasien');\n\t\tredirect('kader/index');\n\t}", "public function agregar_curso(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n if(empty($_POST[\"id_programa\"]) or empty($_POST[\"nombre\"]) or empty($_POST[\"id_docente\"])){\r\n header(\"Location:\".Conectar::ruta().\"admin/cursos/crear.php?m=1\");\r\n exit();\r\n }\r\n $contra='activo';\r\n $conectar=parent::conexion();\r\n $sql=\"insert into curso values(null,?,?,?,?,now());\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->bindValue(1, $_POST[\"id_programa\"]);\r\n $sql->bindValue(2, $_POST[\"nombre\"]);\r\n $sql->bindValue(3, $_POST[\"id_docente\"]);\r\n $sql->bindValue(4, $contra);\r\n $sql->execute();\r\n $resultado=$sql->fetch(PDO::FETCH_ASSOC);\r\n \r\n header(\"Location:\".Conectar::ruta().\"admin/cursos/index.php?m=2\");\r\n \r\n }", "function nuevoCausasIncap()\n{\n\tinclude 'conexion.php';\n\t$con = new Conexion();\n\t$sql = \"INSERT INTO causas_incap (causas_incap) VALUES ('$_POST[causas_incap]')\";\n\tif($con->insert($sql))\n\t{\n\t\techo \"La causa ha sido agregado\";\n\t}else{\n\t\techo \"Ocurrió un error en la petición: \".$sql;\n\t}\n}", "public function actionCreate() {\n $model=new curso;\n if(isset($_POST['curso'])) {\n $model->attributes=$_POST['curso'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id_curso));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function add_comentario($nombre,$comenta,$id_not)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$sql=\"INSERT INTO comentario (nombre,comenta,fecha,hora,id_noticia) VALUE('$nombre','$comenta',NOW(),NOW(),'$id_not')\";\n\t\t\t\t$res=mysql_query($sql,conectar::con());\n\t\t\t\t?>\n\t\t\t\t<script type='text/javascript'> \n\t\t\t\t\t\t\talert('Comentario Guardado Exitosamente');\n\t\t\t\t\t\t\twindow.location='det_noticia.php?id=<?php echo $id_not ?>';\n\t\t\t\t\t </script>;\n\t\t\t\t<?php \n\t\t\t}", "function ajouter($libelle, $prix,$photo){\n\n try{\n // connexion db\n $link= connecter_db();\n // preparer une requete SQL \n $rp= $link->prepare(\"insert into produit(libelle,prix,photo) values(?,?,?)\");\n //executer la requete \n $rp->execute([$libelle,$prix,$photo]);\n \n\n } catch(PDOException $e){\n die(\"Erreur d'ajout de produit \".$e->getMessage());\n }\n \n\n}", "public static function crearCosecha($nombre_cosecha, $id_usuario)\n {\n \t\n\n $query = \"INSERT INTO cosecha (nombre_cosecha, id_usuario)\n VALUES ('$nombre_cosecha', '$id_usuario')\";\n \n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n \n \n if ($resultado->execute()) {\n\n return true;\n\n }else{\n return false;\n }\n \n }", "function agregarmovimientocxc($fechacargo,$fechavencimiento,$iddeudor,$idconcepto, $descripcion,$saldoinicial,$abonos,$saldoactual,$iddocumento,$foliodocumento,$activo,$conexion){\n $sqlcl = \"\n insert into admin_cxc\n (fechacargo, fechavencimiento, iddeudor,idconcepto, descripcion,saldoinicial,abonos,saldoactual,iddocumento,foliodocumento,activo)\n values\n ('\".$fechacargo.\"','\".$fechavencimiento.\"',\".$iddeudor.\",\".$idconcepto.\",'\".$descripcion.\"',\".$saldoinicial.\",\".$abonos.\",\".$saldoactual.\",\".$iddocumento.\",\".$foliodocumento.\",\".$activo.\")\n \";\n //echo $sqlcl.\"<br>\";\n $conexion->consultar($sqlcl);\n //exit();\n }", "private function EstCreateur(){\n $m = new UserModele();\n echo $m->peutLancer($_REQUEST[\"IDPartie\"], $_REQUEST[\"IDJoueur\"]);\n }", "function inserirCliente(){\n\n $banco = abrirBancoCliente();\n //declarando as variáveis usadas na inserção dos dados\n $nomeCliente = $_POST[\"nomeCliente\"];\n $cpfCliente = $_POST[\"cpfCliente\"];\n $cidadeCliente = $_POST[\"cidadeCliente\"];\n $tipoCliente = $_POST[\"tipoCliente\"];\n $situacaoCliente = $_POST[\"situacaoCliente\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Clientes(nomeCliente,cpfCliente, cidadeCliente, tipoCliente, situacaoCliente) VALUES ('$nomeCliente','$cpfCliente', '$cidadeCliente', '$tipoCliente', '$situacaoCliente')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndexCliente();\n\n }", "public function create()\n { \n $nome = $this->getNome();\n $nomeCondominio = $this->getNomeCondominio();\n $cpf = $this->getCpf();\n $telefone = $this->getTelefone();\n $email = $this->getEmail();\n $observacoes = $this->getObservacoes();\n $tipoCliente = $this->getTipoCliente();\n \n $conn = $this->connect();\n\n $sql = \"INSERT INTO clientes \n (`id`, `nome`, `nomeCondominio`, `telefone`, `cpf`, `email`, `observacoes`, `tipoCliente`)\n VALUES (DEFAULT, :nome, :nomeCondominio, :telefone, :cpf, :email, :observacoes, :tipoCliente)\";\n\n $stmt = $conn->prepare($sql);\n $stmt->bindParam(\":nome\", $nome); \n $stmt->bindParam(\":nomeCondominio\", $nomeCondominio); \n $stmt->bindParam(\":telefone\", $telefone); \n $stmt->bindParam(\":cpf\", $cpf); \n $stmt->bindParam(\":email\", $email); \n $stmt->bindParam(\":observacoes\", $observacoes); \n $stmt->bindParam(\":tipoCliente\", $tipoCliente); \n \n if ($stmt->execute()) \n {\n $_SESSION['sucesso'] = \"Cliente cadastrado com sucesso!\";\n $destino = header(\"Location: ../../public/endereco.php?id={$conn->lastInsertId()}\");\n }\n else\n {\n $_SESSION['erro'] = \"Cliente já cadastrado!\";\n $destino = header(\"Location: ../../public/clientes.php?recomecar=1\");\n }\n\n }", "public function insertarcitas($arg_fecha, $arg_hora, $arg_paciente, $arg_medico, $arg_consultorio){\r\n $modelo = new Conexion();\r\n $conexion = $modelo->get_conexion();//se guarda la conexion en la variable conexion\r\n $sql = \"insert into citas(citFecha,citHora,citPaciente,citMedico,citConsultorio, citEstado, citObservaciones) values(:fecha, :hora, :paciente, :medico, :consultorio,'Asignado', ' ')\";//se hace la consulta\r\n $statement = $conexion->prepare($sql);//preparar la consulta\r\n //se pasan con binparam para evitar el sqlinyeccion\r\n $statement ->bindParam(':fecha',$arg_fecha);\r\n $statement ->bindParam(':hora',$arg_hora);\r\n $statement ->bindParam(':paciente',$arg_paciente);\r\n $statement ->bindParam(':medico',$arg_medico);\r\n $statement ->bindParam(':consultorio',$arg_consultorio);\r\n \r\n \r\n //mira si el statement esta vacio si esta vacio manda un error y si no lo ejecuta\r\n if(!$statement){\r\n return \"Error al crear el Cita\";\r\n }else{\r\n $statement->execute();\r\n header(\"location: ../Citas.php\");\r\n }\r\n \r\n }", "public function ajouterProduit(){\n\n $produit = new Produit();\n $this->validate(request(),[\n 'titre' => 'required',\n 'description' => 'required',\n 'prix' => 'required',\n 'id_categorie' => 'requiered'\n ]);\n $produit->titre = request('titre');\n $produit->description = request('description');\n $produit->prix = request('prix');\n\n $nomCategorie = request('categorie');\n $idCategorie = Categorie_produit::select('id')\n ->where('nom', $nomCategorie)\n ->first();\n\n $produit->id_categorie = $idCategorie->id;\n $produit->save();\n\n\n /*\n * Permet d'upload un fichier\n */\n $img = new Image();\n $img->alt= request('titre');\n $img->id_utilisateur= \\Auth::user()->id;\n $img->id_produit= $produit->id;\n if (Input::hasFile('image')){\n $file=Input::file('image');\n $file->move(public_path().'/img/',$file->getClientOriginalName());\n\n $img->lien = '/img/'.$file->getClientOriginalName();\n }\n\n $img->save();\n\n return redirect('/boutique');\n\n }", "public function store()\n {\n date_default_timezone_set('America/Sao_Paulo');\n \t\t$date_create_at = date('Y-m-d H:i:s');\n\n $clientesTable = TableRegistry::get('clientes');\n $cliente = $clientesTable->newEntity();\n $cliente->cliente_nome = $this->request->data('cliente_nome');\n $cliente->cliente_sobrenome = $this->request->data('cliente_sobrenome');\n $cliente->cliente_created_at = $date_create_at;\n\n if($clientesTable->save($cliente))\n {\n $msg = \"Cliente cadastrado com sucesso!\";\n }\n else\n {\n $msg = \"Erro ao cadastrar cliente!\";\n }\n $this->set('msg', $msg);\n }", "function createProveedor($connection, $nombre, $tipoPago, $telefono, $direccion){\n $insert = \"INSERT INTO proveedores (Nombre, CuentaSaldar, TipoPago, Telefono, Direccion) \n VALUES ('$nombre', 0,'$tipoPago', '$telefono', '$direccion')\";\n //Check query\n if (mysqli_query($connection, $insert)) {\n echo \"New record created successfully \";\n echo(\"\");\n } else {\n echo \"Error: \" . $sql . \"<br>\" . mysqli_error($connection);\n echo(\"\");\n }\n }", "public function crearCompraEncabezado($data) {\n if ($this->modeloCompraEncabezado->save($data)){}\n }", "function ajouterPanier($connexion, $prId, $quantiteSaisie, $clId)\n{\n try {\n //Récupération de la quantité disponible en stock\n $resultats = $connexion->prepare(\"SELECT prQuantiteStock FROM produit WHERE prId='\" . $prId . \"'\");\n\t\t\t\n\t\tif($resultats->execute()){\n $prQuantiteStock = $resultats->fetch(); //Stockage de la quantite de produit présente dans le panier dans $count\n $prQuantiteStock = $prQuantiteStock['prQuantiteStock'];\n $resultats->closeCursor();\n\n\t\t\tif ($prQuantiteStock == 0){\n\t\t\t\techo 'Produit indisponible !';\n\t\t\t}else {\n\t\t\t\t//Vérification de l'existance du produit dans le panier\n\t\t\t\t\t$resultats = $connexion->prepare(\"SELECT prQuantite FROM panier WHERE clId='\" . $clId . \"' AND prId='\" . $prId . \"'\");\n\t\t\t\t\t\n\t\t\t\t\tif($resultats->execute()){\n\t\t\t\t\t\t$prQuantite = $resultats->fetch(); //Stockage de la quantite de produit présente dans le panier dans $count\n\t\t\t\t\t\t$prQuantite = $prQuantite['prQuantite'];\n\t\t\t\t\t\t$resultats->closeCursor();\n\t\t\t\t\t}\n\n\t\t\t\t//Si le produit n'est pas dans le panier du client, on l'ajoute\n\t\t\t\tif ($prQuantite == null) {\n\t\t\t\t\tif ($quantiteSaisie <= $prQuantiteStock) {\n\t\t\t\t\t\t$resultats = $connexion->prepare(\"INSERT INTO panier (prId, prQuantite, clId) VALUES ('\" . $prId . \"', '\" . $quantiteSaisie . \"', '\" . $clId . \"')\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($resultats->execute()){\n\t\t\t\t\t\t\techo 'Article ajouté';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo 'Il ne reste que ' . $prQuantiteStock . ' en stock !';\n\t\t\t\t\t}\n\n\t\t\t\t//Si le produit est deja dans le panier du client, on met à jour la quantité\n\t\t\t\t} else {\n\t\t\t\t\t$newQuantite = $quantiteSaisie + $prQuantite;\n\t\t\t\t\t//Verification du dépassement de la limite de quantité commandable\n\t\t\t\t\tif ($newQuantite <= $prQuantiteStock) {\n\t\t\t\t\t\tif ($newQuantite < 100) {\n\t\t\t\t\t\t\t$resultats = $connexion->prepare(\"UPDATE panier SET prQuantite='\" . $newQuantite . \"' WHERE prId='\" . $prId . \"' AND clId='\" . $clId . \"'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($resultats->execute()){\n\t\t\t\t\t\t\t\techo 'Article rajouté';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo 'Vous ne pouvez pas ajouter plus 99 mêmes produits à votre panier !';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (($prQuantiteStock - $prQuantite) == 0) {\n\t\t\t\t\t\t\techo 'Produit indisponibles, vous avez les derniers dans votre panier !';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo 'Il ne reste que ' . $prQuantiteStock . ' article(s) en stock ! Vous ne pouvez rajouter que ' . ($prQuantiteStock - $prQuantite) . ' article(s).';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n } catch (PDOException $e) {\n echo 'Erreur lors de l\\'ajout au panier : ' . $e->getMessage();\n }\n\n// \"UPDATE panier, produit SET prQuantite='\" . $prQuantite . \"', prQuantiteStock='\" . $prQuantiteStock . \"' WHERE panier.prId='\" . $prId . \"' AND produitprId='\" . $prId . \"' AND clId='\" . $clId . \"'\"\n}", "function insertarDocCompleto()\n {\n $this->objFunc = $this->create('MODDocCompraVenta');\n if ($this->objParam->insertar('id_doc_compra_venta')) {\n $this->res = $this->objFunc->insertarDocCompleto($this->objParam);\n } else {\n //TODO\n //$this->res=$this->objFunc->modificarSolicitud($this->objParam);\n //trabajar en la modificacion compelta de solicitud ....\n $this->res = $this->objFunc->modificarDocCompleto($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function inserta_cliente($datos){\n\t\t\t//Solo es para acegurarse que se estan enviando los archivos\n\t\t /*echo \"<pre>\";\n\t\t print_r($datos);\n\t\t echo 'Desde Controller Cliente';\n\n\t\t echo \"</pre>\";\n\t\t\tdie();*/\n\t\t \n\t\t\t//Conexion con Equipo el cual continene Modelo y Conexion\n\t\t\t//$status=new Status();\n\n\n\t\t\t$this->set_nombre($datos['nombre_cliente']);\n\t\t\t$this->set_cp($datos['cp_cliente']);\n\t\t\t$this->set_ciudad($datos['ciudad_cliente']);\n\t\t\t$this->set_colonia($datos['colonia_cliente']);\n\t\t\t$this->set_direccion($datos['direccion_cliente']);\n\t\t\t$this->set_telefono($datos['telefono_cliente']);\n\t\t\t$this->set_email($datos['email_cliente']);\n\t\t\t\n\t\t\tif (isset($datos['password_cliente'])) {\n\t\t\t\t$this->set_password($datos['password_cliente']);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Verificar si existen errores\n\t\t\tif(count ($this->errores)>0){\n\t\t\t\t$this->muestra_errores=true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->muestra_exito=true;\n\t\t\t\t//Insertar en la Base de datos\n\t\t\t\t$this->inserta($this->get_atributos());\n\t\t\t\t//$this -> iniciarSesion($datos['email_cliente']);\n\t\t\t}\n\t\t\t//Detener un script *die();\n\n\t\t}", "public function actionCreate()\n {\n $request = Yii::$app->request;\n \n $model = new Viecle();\n $customer = new Customer();\n \n $viecleName = ViecleName::find()->all();\n $viecleModels = ViecleModel::find()->where(['viecle_name' => $viecleName[0]->id])->all();\n \n if($request->isPost){ \n // customer\n if( $customer->load($request->post()) && $customer->validate() ){\n $customer->type = \"GENERAL\";\n $customer->save();\n }\n else{\n var_dump($customer->errors);\n die();\n }\n // viecle\n if ($model->load($request->post()) && $model->validate()) {\n $lastCustomer = Customer::find()->orderBy(['CID' => SORT_DESC])->one(); \n $model->owner = $lastCustomer->CID;\n $model->save();\n } \n else {\n var_dump($model->errors);\n die();\n }\n return $this->redirect(['index']);\n }\n return $this->render('create', [\n 'model' => $model, // viecle\n 'customer' => $customer,\n 'viecleModels' => $viecleModels,\n 'viecleName' => $viecleName,\n ]);\n }", "public function add($id = NULL)\n {\n if (!is_null($id)) {\n $societes = $this->Societes->get($id);\n } else $societes = $this->Societes->newEntity($this->request->getData());\n\n // Si la requête est de type post ou put, alors nous traitons les données reçues du formulaire\n if ($this->request->is(['post',\n 'put'])\n ) {\n if (!is_null($id))\n $this->Societes->patchEntity($societes, $this->request->getData()); else\n $societes = $this->Societes->newEntity($this->request->getData());\n\n // on vérifie si les mots de passe sont identiques\n if ($this->Societes->save($societes)) {\n // on créé le compte comptable associé\n // récupération du compte parent rattaché au type de tiers\n $this->Flash->success(__('Société enregistrée'));\n\n } else {\n $this->Flash->error(__('Erreur dans la sauvegarde'));\n }\n return $this->redirect(['action' => 'index']);\n }\n $this->set(compact('societes'));\n }", "public function insert($cbtSesi);", "function guarda_auditoria_codigo_ccu($auditoria_codigo_ccu){\n\t\t$this->db->insert('tla_auditoria_registro', $auditoria_codigo_ccu);\n\t}", "public function addToCart($idCliente, $codDisco){\r\n\r\n //controllo se l'elemento è già nel carrello\r\n $qta = Carrello::exist($idCliente, $codDisco);\r\n if($qta>0)\r\n {\r\n $query=\"UPDATE `Carrello` SET `quantita`='\". ($qta+1) .\"' WHERE `codDisco` = '\".$codDisco.\"'\";\r\n }\r\n else\r\n {\r\n $qta=1;\r\n $query=\"INSERT INTO `Carrello`(`idCompratore`,`codDisco`,`quantita`) VALUES ('\".$idCliente.\"','\".$codDisco.\"','\".$qta.\"')\";\r\n }\r\n \r\n $mysqli=Database::avviaDatabase();\r\n Database::lanciaQuery($query, $mysqli);\r\n Database::chiudiDatabase($mysqli);\r\n \r\n}", "function addCargoRecord($crcustid,$package,$pkg,$crcprice,$crsprice,$crprofit,$crdesfrom,$crdesto,$crairline,$tdate,$gdate,$rname,$rtell,$raddr,$crdesc,$user_id)\n{\n $stmt= getCnx()->prepare(\"INSERT INTO tbl_cargo(CustomerId, packageTypeId, packageKg, costPrice, sellPrice, profit,destanationFrom,destanationTo,airLineId,takingDate,gettingDate,reciverName,reciverTell,reciverAddress,cargoDescription,cargoCreateBy,cargoCreateDate)\n VALUES(:crcustid,:package,:pkg,:crcprice,:crsprice,:crprofit,:crdesfrom,:crdesto,:crairline,:tdate,:gdate,:rname,:rtell,:raddr,:crdesc,:user_id,now())\");\n\n $stmt->bindParam(':crcustid', $crcustid);\n $stmt->bindParam(':package', $package);\n $stmt->bindParam(':pkg', $pkg);\n $stmt->bindParam(':crcprice', $crcprice);\n $stmt->bindParam(':crsprice', $crsprice);\n $stmt->bindParam(':crprofit', $crprofit);\n $stmt->bindParam(':crdesfrom', $crdesfrom);\n $stmt->bindParam(':crdesto', $crdesto);\n $stmt->bindParam(':crairline', $crairline);\n $stmt->bindParam(':tdate', $tdate);\n $stmt->bindParam(':gdate', $gdate);\n $stmt->bindParam(':rname', $rname);\n $stmt->bindParam(':rtell', $rtell);\n $stmt->bindParam(':raddr', $raddr);\n $stmt->bindParam(':crdesc', $crdesc);\n $stmt->bindParam(':user_id', $user_id);\n \n \n \n \n $stmt->execute();\n}", "function insertarCajero(){\n\t\t$this->procedimiento='tes.ft_cajero_ime';\n\t\t$this->transaccion='TES_CAJERO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo','tipo','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\n\t\t$this->setParametro('id_caja','id_caja','int4');\n\t\t$this->setParametro('fecha_inicio','fecha_inicio','date');\n\t\t$this->setParametro('fecha_fin','fecha_fin','date');\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 store($id, $texto)\n {\n $bitacoras=Bitacora::where('id_user',$id)->get();\n // redirect()->action($bitacoras);\n foreach ($bitacoras as $bitacora){\n Nota::create([\n 'descripcion'=>$texto,\n 'Fecha'=>'2018-02-01',\n 'id_bitacora'=>$bitacora->id,\n ]);\n }\n\n }", "public function create($data)\n {\n $obras = $this->obras();\n $id_obra = $data['id_obra'];\n $id_moneda = 0;\n\n foreach ($obras as $o) {\n if ($o->id_obra == $data['id_obra']) {\n $id_moneda = $o->id_moneda;\n }\n }\n try {\n DB::connection('cadeco')->beginTransaction();\n $record = $this->model->create($data);\n $credito = [\n 'tipo_transaccion' => 83,\n 'fecha' => $data['fecha'] ? $data['fecha'] : date('Y-m-d'),\n 'estado' => 1,\n 'id_obra' => $id_obra,\n 'id_cuenta' => $data['id_cuenta_destino'],\n 'id_moneda' => $id_moneda,\n 'cumplimiento' => $data['cumplimiento'] ? $data['cumplimiento'] : date('Y-m-d'),\n 'vencimiento' => $data['vencimiento'] ? $data['vencimiento'] : date('Y-m-d'),\n 'opciones' => 1,\n 'monto' => $data['importe'],\n 'impuesto' => 0,\n 'referencia' => $data['referencia'],\n 'comentario' => \"I;\". date(\"d/m/Y\") .\" \". date(\"h:s\") .\";\". auth()->user()->usuario,\n 'observaciones' => $data['observaciones'],\n 'FechaHoraRegistro' => date('Y-m-d h:i:s'),\n ];\n\n $debito = $credito;\n $debito['tipo_transaccion'] = 84;\n $debito['id_cuenta'] = $data['id_cuenta_origen'];\n $debito['monto'] = (float) ($data['importe'] * -1);\n\n // Crear transaccion Débito\n $transaccion_debito = Transaccion::create($debito);\n\n // Crear transaccion Crédito\n $transaccion_credito = Transaccion::create($credito);\n\n // Revisa si la transacción se realizó\n $debito_realizo = Transaccion::where('id_transaccion', $transaccion_debito->id_transaccion)->first();\n $credito_realizo = Transaccion::where('id_transaccion', $transaccion_credito->id_transaccion)->first();\n\n // Si alguna de las transacciones no se registró, regresa un error\n if (!$debito_realizo || !$credito_realizo)\n {\n DB::connection('cadeco')->rollBack();\n\n return 'El traspaso no se pudo concretar';\n }\n\n // Enlaza las transacciones con su respectivo traspaso. Debito\n TraspasoTransaccion::create([\n 'id_traspaso' => $record->id_traspaso,\n 'id_transaccion' => $transaccion_debito->id_transaccion,\n 'tipo_transaccion' => $debito['tipo_transaccion'],\n ]);\n\n // Enlaza las transacciones con su respectivo traspaso. Credito\n TraspasoTransaccion::create([\n 'id_traspaso' => $record->id_traspaso,\n 'id_transaccion' => $transaccion_credito->id_transaccion,\n 'tipo_transaccion' => $credito['tipo_transaccion'],\n ]);\n $result = $this->model\n ->with(['cuenta_destino.empresa', 'cuenta_origen.empresa', 'traspaso_transaccion.transaccion_debito'])\n ->where('id_traspaso', '=', $record->id_traspaso)\n ->first();\n DB::connection('cadeco')->commit();\n return $result;\n } catch (\\Exception $e) {\n dd($e->getTraceAsString());\n DB::connection('cadeco')->rollBack();\n throw $e;\n }\n\n }", "public function registrarComentario($datos)\n {\n // Añadimos la fecha actual al registrarlo\n if (!isset($datos['fecha'])) {\n $datos['fecha'] = date('Y-m-d H:i:s');\n }\n $this->db->insert('comentarios', $datos);\n }", "public function store(createComenMueble $request)\n\t{\n\n\t\t$input = $request->all();\n\t\t$input['usu_alta_id']=Auth::user()->id;\n\t\t$input['usu_mod_id']=Auth::user()->id;\n\n\t\t//create data\n\t\tComenMueble::create( $input );\n\n\t\treturn redirect()->route('comenMuebles.index')->with('message', 'Registro Creado.');\n\t}", "function save()\n {\n $GLOBALS['DB']->exec(\n \"INSERT INTO cuisines (name, spicy, price) VALUES (\n '{$this->getName()}',\n {$this->getSpicy()},\n {$this->getPrice()}\n );\"\n );\n $this->id = $GLOBALS['DB']->lastInsertId();\n }", "public function cree(Request $request){\n //Etudiant::create($request->all());\n \n $newEtu=new Etudiant();\n $newEtu->nom=$request->nom;\n $newEtu->prenom=$request->prenom;\n $newEtu->annee=$request->annee;\n $newEtu->grp=$request->grp;\n $newEtu->mat=$request->mat;\n $newEtu->email=$request->email;\n $newEtu->password=$request->password;\n $newEtudiant->save();\n // return response()->json($newEtudiant);\n /* $post = Etudiant::create($request->all());\n return response()->json($post, 201);*/\n \n }" ]
[ "0.69779736", "0.69314474", "0.6850995", "0.6824001", "0.6485538", "0.64396197", "0.6431287", "0.64147186", "0.6412822", "0.6376669", "0.63736993", "0.63521165", "0.6286729", "0.6270753", "0.62707525", "0.6239249", "0.62212354", "0.6213989", "0.62105846", "0.6208924", "0.6202305", "0.6202305", "0.6198558", "0.61965764", "0.6184624", "0.61782765", "0.6155197", "0.6148515", "0.61470497", "0.6141792", "0.6130275", "0.61252004", "0.6117702", "0.61154425", "0.6110006", "0.6107122", "0.6106752", "0.610632", "0.61043024", "0.61025006", "0.6099598", "0.60953933", "0.6082839", "0.6082792", "0.6077173", "0.60754234", "0.60741305", "0.60609704", "0.60597605", "0.6058592", "0.6041918", "0.6038499", "0.60384685", "0.60382247", "0.60288346", "0.6025838", "0.60252684", "0.60244334", "0.60204196", "0.60158736", "0.6015819", "0.6005622", "0.60049987", "0.60034704", "0.59985405", "0.5988107", "0.598531", "0.5985254", "0.59844685", "0.5983415", "0.59833425", "0.5981369", "0.5975944", "0.5974493", "0.59680545", "0.5966171", "0.5959889", "0.59528625", "0.59513533", "0.59508306", "0.5945056", "0.59436697", "0.59419537", "0.5940868", "0.5936561", "0.59348017", "0.5932958", "0.5923723", "0.592294", "0.5917997", "0.5915489", "0.59131235", "0.59108865", "0.5907974", "0.59079385", "0.59076154", "0.59058195", "0.59018683", "0.5901742" ]
0.71118087
0