query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Related to hotel, foreign key hotel
public function hotel() { return $this->belongsTo('App\Hotel', 'hotel', 'id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hotel()\n {\n return $this->hasOne('App\\Hotels');\n }", "public function getHotels()\n {\n return $this->hasOne(Hotel::className(), ['id_hotel' => 'id_hotels']);\n }", "public function hotels()\n {\n return $this->belongsToMany('App\\Models\\Admin\\Hotel\\Hotel');\n }", "public function getHotel()\n {\n return $this->hotel;\n }", "public function __construct($hotel)\n {\n $this->hotel = $hotel;\n }", "public function show(Hotel $hotel)\n {\n //\n }", "public function show(Hotel $hotel)\n {\n //\n }", "function &getHotelId()\r\n\t{\r\n\t\treturn $this->_hotel_id;\r\n\t}", "function setHotelId($hotel_id)\r\n\t{\r\n\t\t$this->_hotel_id\t= $hotel_id;\r\n\t\t$this->_data\t\t= null;\r\n\t\t$this->_hotels\t\t= null;\r\n\t}", "function setHotelId($hotel_id)\r\n\t{\r\n\t\t$this->_hotel_id\t= $hotel_id;\r\n\t\t$this->_data\t\t= null;\r\n\t\t$this->_hotels\t\t= null;\r\n\t}", "public function getHotelRef()\n {\n return $this->hotelRef;\n }", "public function getPartnerHotelId()\n {\n return $this->partner_hotel_id;\n }", "public function edit(Hotel $hotel)\n {\n //\n }", "public function update(Request $request, Hotel $hotel)\n {\n //\n if ((Auth::user()->can('hotel-admin') && auth()->user()->id == $hotel->admin_id) || Auth::user()->can('super-admin')) {\n if ($request['email']) {\n $hotels = Hotel::whereEmail($request['email'])->get();\n\n foreach ($hotels as $existHotel) {\n if ($existHotel->email == $request['email'] && $existHotel->id != $hotel->id)\n return redirect()->back()->withErrors(['email' => 'The email has already been taken.']);\n }\n }\n\n $hotels = Hotel::wherePhone($request['phone'])->get();\n\n foreach ($hotels as $existHotel) {\n if ($existHotel->phone == $request['phone'] && $existHotel->id != $hotel->id)\n return redirect()->back()->withErrors(['phone' => 'The phone has already been taken.']);\n }\n\n $this->validate($request, [\n 'name' => 'required|max:50',\n 'phone' => 'required|numeric',\n 'address1' => 'required|max:100',\n 'address2' => 'required|max:100',\n 'address3' => 'required|max:100',\n 'zip_code' => 'required|max:10',\n 'city' => 'required|max:30',\n 'state' => 'required|max:30',\n 'country' => 'required|max:30',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'total_rooms' => 'required|numeric',\n 'type' => 'required',\n// 'img_url' => 'required',\n 'rooms' => 'required',\n 'top_amenities' => 'required',\n 'top_amenities.*' => 'required',\n 'hotel_amenities' => 'required',\n 'hotel_amenities.*' => 'required',\n 'room_amenities' => 'required',\n 'room_amenities.*' => 'required',\n 'body' => 'required'\n ]);\n\n $type = Type::whereSlug($request['type'])->first();\n\n $i = 0;\n $totalAmenities = count($request['top_amenities']);\n\n $topAmenities = '{\"amenities\":[';\n foreach ($request['top_amenities'] as $amenity) {\n $topAmenities .= '{\"name\": \"' . $amenity . '\"}';\n if ($i + 1 < $totalAmenities) {\n $topAmenities .= ',';\n }\n $i++;\n }\n $topAmenities .= ']}';\n\n $i = 0;\n $totalAmenities = count($request['hotel_amenities']);\n\n $hotelAmenities = '{\"amenities\":[';\n foreach ($request['hotel_amenities'] as $amenity) {\n $hotelAmenities .= '{\"name\": \"' . $amenity . '\"}';\n if ($i + 1 < $totalAmenities) {\n $hotelAmenities .= ',';\n }\n $i++;\n }\n $hotelAmenities .= ']}';\n\n $i = 0;\n $totalAmenities = count($request['room_amenities']);\n\n $roomAmenities = '{\"amenities\":[';\n foreach ($request['room_amenities'] as $amenity) {\n $roomAmenities .= '{\"name\": \"' . $amenity . '\"}';\n if ($i + 1 < $totalAmenities) {\n $roomAmenities .= ',';\n }\n $i++;\n }\n $roomAmenities .= ']}';\n\n $hotel->name = $request['name'];\n $hotel->slug = str_slug($request['name'] . '-' . $request['city'], '-');\n $hotel->phone = $request['phone'];\n $hotel->address1 = $request['address1'];\n $hotel->address2 = $request['address2'];\n $hotel->address3 = $request['address3'];\n $hotel->zip_code = $request['zip_code'];\n $hotel->city = $request['city'];\n $hotel->state = $request['state'];\n $hotel->country = $request['country'];\n $hotel->latitude = $request['latitude'];\n $hotel->longitude = $request['longitude'];\n $hotel->total_rooms = $request['total_rooms'];\n $hotel->type_id = $type->id;\n $hotel->top_amenities = $topAmenities;\n $hotel->hotel_amenities = $hotelAmenities;\n $hotel->room_amenities = $roomAmenities;\n\n if ($request['email']) {\n $hotel->email = $request['email'];\n }\n\n if ($request['website']) {\n $hotel->website = $request['website'];\n }\n\n $roomId = [];\n foreach ($request->rooms as $room) {\n $existRoom = Room::whereSlug($room)->first();\n array_push($roomId, $existRoom->id);\n }\n\n $hotel->rooms()->sync($roomId);\n\n /*if ($request->hasFile('img_url')) {\n foreach ($request->img_url as $url) {\n $img = $url->store('public/photos');\n $hotel->photos()->create(['img_url' => $img]);\n }\n }*/\n\n $hotel->description()->update(['body' => $request['body']]);\n\n if (Auth::user()->can('super-admin')) {\n $hotel->published = 1;\n }\n else {\n $hotel->published = 0;\n }\n\n $hotel->save();\n\n\n return redirect(route('hotel.index'));\n }\n\n else return redirect(route('admin.home'));\n }", "public function createHotelInstance($hotelAttributes): Hotel\n {\n return (new Hotel)\n ->setName($hotelAttributes['hotel'])\n ->setProvider(static::PROVIDER_NAME)\n ->setFare($hotelAttributes['hotelFare'])\n ->setRate($hotelAttributes['hotelRate'])\n ->setAmenities(explode(',', $hotelAttributes['roomAmenities']));\n }", "public function setHotel($hotel)\n {\n $this->hotel = $hotel;\n\n return $this;\n }", "public function show(AvailableHotel $availableHotel)\n {\n //\n }", "public function neighborhood() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\Neighborhood');\n }", "public static function getHotels($hotels) {\n $hotelsColeccion = new ArrayCollection();\n\n // Valida que existan hoteles\n if(count($hotels) >= Generalkeys::NUMBER_ONE){\n // Itera los hoteles encontrados\n foreach($hotels as $hotel){\n // Se crea un nuevo objeto para colocal la informacion de cada uno de los hoteles como array\n $hotelTO = new HotelTO();\n\n //Se anexa la informacion\n $hotelTO->setId($hotel['id']);\n $hotelTO->setNombreHotel($hotel['nombrehotel']);\n $hotelTO->setDescripcion(StringUtils::cutText($hotel['descripcion'], Generalkeys::NUMBER_ZERO, Generalkeys::NUMBER_TWO_HUNDRED, Generalkeys::COLILLA_TEXT, Generalkeys::CIERRE_HTML_P));\n $tarifa = self::getTotalRate($hotel['tarifa'], $hotel['ish'], $hotel['markup'], $hotel['iva'], $hotel['fee'], $hotel['aplicaimpuesto']);\n $hotelTO->setTarifa(number_format(ceil($tarifa)));\n $hotelTO->setSimboloMoneda($hotel['simbolo']);\n $hotelTO->setEstrellas($hotel['estrellas']);\n // Valida imagen hotel si es null coloca imagen not found de lo contrario coloca la imagen\n if(is_null($hotel['imagen'])){\n $hotelTO->setPrincipalImage(Generalkeys::PATH_IMAGE_NOT_FOUND);\n }else{\n $hotelTO->setPrincipalImage($hotel['imagen']);\n }\n\n //Se agrega el objeto a la coleccion\n $hotelsColeccion->add($hotelTO);\n }\n }\n return $hotelsColeccion;\n }", "public function destroy(Hotel $hotel)\n {\n //\n }", "public function getHotelByID($hotelID) {\n return $this->hotel->find($hotelID);\n }", "public function initialize()\n {\n $this->hasMany(\"id\", \"Hotelsfacility\", \"hotel_id\");\n $this->hasMany(\"id\", \"HotelRoom\", \"hotel_id\");\n $this->belongsTo(\"city_id\", \"City\", \"id\");\n $this->belongsTo(\"province_id\", \"Province\", \"id\");\n $this->belongsTo(\"country_id\", \"Country\", \"id\");\n\n }", "public function edit(AvailableHotel $availableHotel)\n {\n //\n }", "public function show(hotel $hotel)\n {\n $hotels = DB::select('select * from hotel_based');\n return view('show',compact('hotel','hotels'));\n }", "public function getHotelClass()\n {\n return $this->hotel_class;\n }", "public function get_ville_fk(){ return $this->_ville_fk;}", "function create_hotel($hotel_data)\n\t{\n\t\t$this->db->insert('sb_hotels',$hotel_data);\n\t\treturn $this->db->insert_id();\n\t}", "public function addHotel($data) {\n \t$hotel = $this->findByUnique($data[self::NAME], $data[self::CITY]);\n \tif (empty($hotel)) {\n \t\t$id = $this->insert($data);\n \t\treturn $this->findById($id);\n \t} else {\n \t\treturn $hotel;\n \t}\n }", "public function village()\n {\n return $this->belongsTo(Village::class);\n }", "public function travel(){\n \treturn $this->hasOne('App\\Models\\Travel', 'eventId');\n }" ]
[ "0.77241504", "0.7102351", "0.65620065", "0.60426694", "0.6011123", "0.6007637", "0.6007637", "0.59874636", "0.5880807", "0.5880807", "0.5847774", "0.57336754", "0.56626666", "0.5577199", "0.55289036", "0.547391", "0.54643494", "0.54601264", "0.5436736", "0.54166824", "0.53760576", "0.5373669", "0.5366196", "0.530586", "0.52807015", "0.5273424", "0.5253323", "0.52362174", "0.51932096", "0.5171971" ]
0.71797615
1
Get template by IP address
public static function getTemplate(string $ip) { return DB::select("SELECT id, hotel, data, scheduled, schedule_start_time, schedule_end_time FROM `templates` WHERE hotel IN (SELECT id from hotels WHERE id IN (SELECT hotel FROM nas WHERE nasname = :ip)) AND `activated`='yes' AND `deleted_at` IS NULL ", ['ip' => $ip]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function get($ipAddress) {}", "function get_template()\n {\n }", "function getTemplate();", "public function getTemplate() {}", "abstract public function getTemplate();", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function getTemplate(): TemplateInterface;", "abstract public function getTemplate($tpl);", "public function template() {\n return labelTemplate::where([\n ['CUSTOMER',$this->CUSTOMER],\n ['TMPCODE',$this->TEMPLATE],\n ])->first();\n }", "private function getTemplate()\n {\n $key = $this->getTemplateKey();\n\n // find template for refused short notice\n if (\n $this->busReg->isShortNoticeRefused() === true\n && isset(self::$templatesRefusedShortNotice[$key])\n ) {\n return self::$templatesRefusedShortNotice[$key];\n }\n\n // find template by status\n if (isset(self::$templates[$key])) {\n return self::$templates[$key];\n }\n\n throw new BadRequestException('Template not found for bus registration');\n }", "function get_template($template){\n\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\n\t\t\treturn $login_arr['template']['path'][$pos];\n\n\t\t}", "public function fetch_template($template)\n\t{\n\t\t$this->EE->load->library('template_helper');\n\t\treturn $this->EE->template_helper->fetch_template($template); \n\t}", "function InfGetEmailTemplate($template_id) {\n $template = Infusionsoft_APIEmailService::getEmailTemplate($template_id);\n\treturn $template;\n}", "function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj) {\n Global $loq;\n $rs = $loq->_adb->Execute(\"select template from \".T_TEMPLATES.\" where templatename='$tpl_id'\");\n if($rs !== false && !$rs->EOF){\n $tpl_source = $rs->fields[0];\n }\n return true;\n}", "public function template();", "function get_template($id, $type)\n{\n\t$query = \"SELECT template from users WHERE id='$id'\";\n\t$result = mysql_query($query) or die('Hiba a lekérdezésben: ' . mysql_error());\n\t$user = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\t\n\t$less = explode(\"<post>\", $user['template']);\n\tif ($type == \"header\")\n\t\treturn $less[0];\n\telse\n\t{\n\t\t$less = explode(\"</post>\", $less[1]);\n\t\tif ($type == \"footer\")\n\t\t\t\treturn $less[1];\n\t\telse\n\t\t\treturn $less[0]; // post\n\t}\n}", "function get_mail_template( $varname ) {\n // based on the received template name\n $query = $this->db->query(\"Select * from email_templates where template_name='$varname'\");\n\n\t return\t$row = $query->row_array(); \n\t\t\n\t}", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "function get_template($template)\n {\n $login_arr = $this->action_parser($this->action, 'template');\n $pos = array_search($template, $login_arr['template']['name']);\n return $login_arr['template']['path'][$pos];\n }", "abstract protected function getEndpoint($ip);", "function get_template($template)\n {\n\n $login_arr = $this->action_parser($this->action, 'template');\n\n $pos = array_search($template, $login_arr['template']['name']);\n\n return $login_arr['template']['path'][$pos];\n }", "private function fetchTemplate($template)\n {\n $resolver = $this->getResolver();\n $content = $resolver->resolve($template);\n\n if (! $content) {\n throw new Exception\\TemplateNotFoundException('Template by name \"' . $template . '\" not found');\n }\n\n return $content;\n }", "public function view_project_template( $template ) {\n\n global $post;\n\n if ( !isset( $post ) ) return $template;\n\n if ( ! isset( $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {\n return $template;\n } // end if\n\n $template_loader = new Uou_Atmf_Load_Template();\n\n if( is_page_template( 'atmf-search.php' ) ){\n $file = $template_loader->locate_template( 'atmf-search.php' );\n }\n\n\n // $file = plugin_dir_path( __FILE__ ) . 'templates/' . get_post_meta( $post->ID, '_wp_page_template', true );\n\n if( file_exists( $file ) ) {\n return $file;\n } // end if\n\n return $template;\n\n }" ]
[ "0.6425553", "0.6425553", "0.6425553", "0.6425553", "0.6425553", "0.6425553", "0.6287556", "0.6238273", "0.6219827", "0.6211844", "0.6171897", "0.6006866", "0.6006292", "0.5945384", "0.59313905", "0.5894317", "0.58938265", "0.5857741", "0.58194596", "0.58075553", "0.58053887", "0.57917905", "0.5784763", "0.57046247", "0.56999314", "0.56991017", "0.5695768", "0.56923836", "0.56778955", "0.560384" ]
0.7429796
0
/ exists() checks if sid cookie exists on user's computer. If so, set id.
function exists() { $this->log .= "exists() called<br />"; if (!isset($_COOKIE['sid'])) { $this->log .= "sid cookie does not exist.<br />"; return false; } $this->id = $_COOKIE['sid']; $this->filename = $this->dir."sid_".$this->id; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exists() {\r\n\t\t$this->log .= \"exists() called<br />\";\r\n\t\tif (!isset($_COOKIE['sid'])) {\r\n\t\t $this->log .= \"sid cookie does not exist.<br />\";\r\n\t\t return false;\r\n\t\t}\r\n\t\t$this->id = $_COOKIE['sid'];\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\treturn true;\r\n\t}", "private static function Detect() {\n\t\n\t\t#print_r($_COOKIE); core_halt();\n\t\t\n\t\t// check to see if a cookie is set\n\t\t$cookie = isset($_COOKIE[self::$variable]) ? strtolower($_COOKIE[self::$variable]) : false;\n\t\tif($cookie !== false && strlen($cookie) == self::$KeyLen && ctype_alnum($cookie)) {\n\t\t\tself::$sid = $cookie;\n\t\t} else {\n\t\t\tself::$sid = FALSE;\n\t\t}\n\t}", "function newId() {\n $this->log .= \"newId() called<br />\";\n $this->id = sha1(uniqid(rand(), true));\n $this->filename = $this->dir.\"sid_\".$this->id;\n if (!setcookie('sid' ,$this->id, null, \"/\", $this->domain_cookie)) {\n $this->log .= \"sid cookie save failed. This may be due to browser output started prior or the user has disabled cookies.<br />\";\n return false;\n }\n return true;\n }", "function newId() {\r\n\t\t$this->log .= \"newId() called<br />\";\r\n\t\t$this->id = md5(uniqid(rand(), true));\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\tif (!setcookie('sid' ,$this->id, null, \"/\")) {\r\n\t\t\t$this->log .= \"sid cookie save failed. This may be due to browser\"\r\n\t\t\t.\" output started prior or the user has disabled cookies.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t}", "private function readSessionId() {\r\n \r\n if ($this->use_cookie==true) { //cookie enabled\r\n \r\n if (isset($_COOKIE[$this->sid_name])) { //there some jam in the cookie\r\n\r\n $this->sessionId=$_COOKIE[$this->sid_name];\r\n //check if the jam can be eated\r\n if ($this->checkSessionId()) {\r\n\r\n\r\n $num = $this->getSidCount($this->sessionId);\r\n if ($num != 1) {\r\n //there is a sessiod in the cookie and no sessid in the DB\r\n //the only thing to do is to generate a new Sid\r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n\r\n } else {\r\n //ok the jam is good!\r\n if (!$this->overwrite) {\r\n setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true); \r\n }\r\n $this->loadSesionVars();\r\n }\r\n \r\n } else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before .. \r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { \r\n\r\n //Damn, no id ... i create some jam!\r\n \r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n \r\n\r\n }\r\n\r\n } else { //no cookie allowed.. bad thing! search elsewhere\r\n\r\n if (isset($_REQUEST[$this->sid_name])) {//bingo!\r\n\r\n $this->sessionId = $_REQUEST[$this->sid_name];\r\n if ($this->checkSessionId()) {\r\n $this->loadSesionVars();\r\n }else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before ..\r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { // create a new SID\r\n\r\n if (!$this->newSid()) die(\"Unable to save session\");\r\n\r\n }\r\n\r\n }\r\n }", "private function exists($id) {\n switch ($this->mode) {\n case 'session' :\n return isset($_SESSION[$id]);\n } \n }", "private function getCurrentPhpSid(){if($this->phpsid=$this->MakeSafe->thisData(\"PHPSESSID\",\"PARANOID_STRING\",26,32,\"COOKIE\")){$this->valid=true;}else{$this->valid=false;}}", "public function checkSession()\n {\n if(isset($_COOKIE['id'])){\n $cookieOrSessionID = $_COOKIE['id'];\n }\n elseif(isset($_SESSION['id'])){\n $cookieOrSessionID = $_SESSION['id'];\n }\n return $cookieOrSessionID;\n }", "function isCookieSet (){\n if (empty ($_COOKIE['id'])){\n header (\"location: error.php\");\n }\n}", "public static function regenerate_sid() {\n\t\t$key = self::generate_sid();\n\t\tdatabase()->start_query('sessions', 'UPDATE')\n\t\t\t->set(array('key' => $key))\n\t\t\t->where(array('key' => self::$sid))\n\t\t\t\t->run();\n\t\tself::setcookie($key);\n\t}", "public function setCookieID($id=NULL)\n {\t\n if($id!==NULL) {\n $this->cookieID = $id;\n } else {\n $this->cookieID = md5($this->time . $this->username . mt_rand(1,25) . $this->getRealIpAddr());\n }\n return $this->cookieID;\n }", "public static function checkSystemCookie(){\n \n if (isset($_COOKIE['system_cookie'])){\n \n // user is in session. Can only be this after first request. \n \n if (isset($_SESSION['in_session'])){\n return;\n }\n\n if (isset($_SESSION['id'])){\n // user is logged in we return\n return;\n }\n \n // get a system cookie if any\n $row = q::select('system_cookie')->\n filter('cookie_id =', @$_COOKIE['system_cookie'])->\n fetchSingle();\n \n // we got a cookie that equals one found in database\n if (!empty($row)){\n $days = self::getCookiePersistentDays();\n \n // delete system_cookies that are out of date. \n $now = date::getDateNow();\n $last = date::substractDaysFromTimestamp($now, $days);\n q::delete('system_cookie')->\n filter('account_id =', $row['account_id'])->condition('AND')->\n filter('last_login <', $last)->\n exec();\n\n // on every cookie login we update the cookie id \n $last_login = date::getDateNow(array('hms' => true));\n $new_cookie_id = random::md5();\n $values = array (\n 'account_id' => $row['account_id'],\n 'cookie_id' => $new_cookie_id,\n 'last_login' => $last_login);\n \n q::delete('system_cookie')->\n filter('cookie_id=', @$_COOKIE['system_cookie'])->\n exec();\n \n q::insert('system_cookie')->\n values($values)->\n exec();\n //filter('cookie_id =' , $new_cookie_id)->condition('AND')->\n //filter('last_login =', $last_login)->exec();\n \n // set the new cookie\n self::setCookie('system_cookie', $new_cookie_id);\n \n // get account which is connected to account id\n $account = self::getAccount($row['account_id']);\n \n // user with account\n if (!empty($account)){\n \n $_SESSION['id'] = $account['id'];\n $_SESSION['admin'] = $account['admin'];\n $_SESSION['super'] = $account['super'];\n $_SESSION['type'] = $account['type'];\n \n } else {\n // keep anon user in session\n $_SESSION['id'] = 0;\n $_SESSION['type'] = 'anon';\n }\n } \n }\n }", "public function hasSid(){\n return $this->_has(4);\n }", "function auth_session_exists() {\n\n // there's an existing session, nothing to do\n if (array_key_exists('user_name', $_SESSION)) {\n return TRUE;\n }\n\n // There's not an existing session, but the user has an auth_key\n // cookie, so see if it matches the database.\n // If it does, create a new session\n if (array_key_exists('auth_userid', $_COOKIE) && array_key_exists('auth_key', $_COOKIE)) {\n require_once '../database/mysql.inc.php';\n $conn = conn();\n\n $auth_userid = $_COOKIE['auth_userid'];\n $auth_key = $_COOKIE['auth_key'];\n $sql = 'SELECT p.name_ingame as name_ingame ' .\n 'FROM player_auth as a, player as p ' .\n 'WHERE a.player_id = :id AND a.auth_key = :auth_key AND a.player_id = p.id';\n $query = $conn->prepare($sql);\n $query->execute(array(':id' => $auth_userid,\n ':auth_key' => $auth_key));\n $resultArray = $query->fetchAll();\n if (count($resultArray) == 1) {\n $name_ingame = $resultArray[0]['name_ingame'];\n session_regenerate_id(TRUE);\n $_SESSION['user_id'] = $auth_userid;\n $_SESSION['user_name'] = $name_ingame;\n $_SESSION['user_lastactive'] = time();\n return TRUE;\n }\n }\n\n // neither session nor cookie lookup worked, so the user is not logged in\n return FALSE;\n}", "function MyApp_Session_SID_Update($sid)\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $time=time();\n $this->Session[ \"Authenticated\" ]=2;\n $this->Session[ \"LastAuthenticationAttempt\" ]=$time;\n $this->Session[ \"LastAuthenticationSuccess\" ]=$time;\n $this->Session[ \"NAuthenticationAttempts\" ]=0;\n $this->Session[ \"ATime\" ]=$time;\n\n $this->MySqlSetItemValues\n (\n $this->GetSessionsTable(),\n array\n (\n \"Authenticated\",\n \"LastAuthenticationAttempt\",\"LastAuthenticationSuccess\",\n \"NAuthenticationAttempts\",\"ATime\",\n ),\n $this->Session\n );\n\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n }", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "function saveCookie($id){\r\n\tsetcookie(\"r$id\", strval(time()), time()+60*60*24*365);\t\r\n}", "function createPersistentSession($sid, $uid) {\n $mysqli = ConnectToDatabase();\n $sql = \"INSERT INTO active_sessions \n (id, uid, expiration)\n VALUES \n ('$sid', '$uid', DATE_ADD(CURRENT_DATE, INTERVAL 1 WEEK))\";\n $exec = $mysqli->query($sql);\n if( !empty($error = $mysqli->error) )\n {\n echo $error;\n return 0;\n }\n else if( isset($mysqli->insert_id) )\n {\n return 1;\n }\n else\n {\n return -1;\n }\n\n }", "function SetUserLogin(string $_id)\n{\n $_SESSION[\"login\"] = \"LOGIN\";\n $_SESSION[\"user_id\"] = $_id;\n\n // set user cookies\n $cookie = [];\n $cookie[\"time\"] = time() + (60*60*24*30*365);\n\n // set cookie for login\n $cookie[\"name\"] = \"login\";\n $cookie[\"value\"] = \"LOGIN\";\n setcookie($cookie[\"name\"], $cookie[\"value\"], $cookie[\"time\"], \"/\");\n\n // set cookie for user details\n $cookie[\"name\"] = \"user_id\";\n $cookie[\"value\"] = $_id;\n setcookie($cookie[\"name\"], $cookie[\"value\"], $cookie[\"time\"], \"/\");\n}", "function ExistsSession($sid) {\n if (empty($sid))\n return false;\n $q = \"SELECT `id` FROM `\" . TblSysSession . \"` where `session_id`='$sid'\";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n $rows = $this->db->db_GetNumRows();\n //echo '<br>$rows='.$rows;\n if (!$this->db->db_GetNumRows())\n return false;\n return true;\n }", "function MyApp_Session_SID_New()\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $sid=rand().rand().rand();\n $time=time();\n $this->Session=array\n (\n \"SID\" => $sid,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $this->LoginData[ \"Login\" ],\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 2,\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => $time,\n \"NAuthenticationAttempts\" => 0,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$this->Session);\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n\n return $sid;\n }", "function checkPersistentSession($sid, $uid) {\n echo 'start cps';\n $mysqli = ConnectToDatabase();\n $sql = \"SELECT * FROM active_sessions \n WHERE uid='$uid' AND id='$sid'\";\n $exec = $mysqli->query($sql);\n echo 'cps queried';\n if( $exec->num_rows > 0 )\n {\n return 1;\n }\n else if( !empty($mysqli->error) )\n {\n return 0;\n }\n else\n {\n return -1;\n }\n }", "public static function exists($name){\n\t\treturn (isset($_COOKIE[$name])) ? true : false;\t\t\t\t// Returns similar to the session method for the name we have defined and see if the cookie has been set.\n\t}", "public static function isExist() {\n return ((self::$_isSessionRunning) && !empty($_COOKIE[session_name()]));\n }", "public static function isLogged()\n {\n $session = Session::Instance();\n\n if ( empty($session->get('uid')) ) {\n return false;\n }\n\n $redis = self::redisInstance();\n\n /** get data from cookie */\n $uid = Cookie::get('uid');\n $sid = Cookie::get('sid');\n $secret = Cookie::get('secret');\n $hash = self::makeHash('sha256', self::SALT . $sid . self::AUTHSALT . $uid);\n\n if ($redis->get($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash) && $hash == $secret) {\n\n // Создаем новую сессию\n $auth = new Model_Auth();\n $auth->recoverById($uid);\n\n $sid = $session->id();\n $uid = $session->get('uid');\n\n $redis->delete($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash);\n\n // генерируем новый хэш c новый session id\n $newHash = self::makeHash('sha256', self::SALT . $sid . self::AUTHSALT . $uid);\n\n // меняем хэш в куки\n Cookie::set('secret', $newHash, Date::MONTH);\n\n // сохраняем в редис\n $redis->set($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash, $sid . ':' . $uid . ':' . Request::$client_ip, array('nx', 'ex' => 2629744));\n\n } else {\n return false;\n }\n\n return true;\n }", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "function checkCookie(){\n global $cookie;\n\n // Check database to see if a user exists with this cookie\n if (getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `cookie` ='\" . $cookie . \"' LIMIT 0 , 1\") != 1){\n // Some user has this cookie, it is valid\n return false;\n }else{\n // Nobody has this cookie, therefore it's invalid\n return true;\n }\n}", "public function onceUsingId($id)\n {\n $user = self::_getUserById($id);\n if (!empty($user)) {\n $this->_session_auth_id = $id;\n return true;\n }\n\n return false;\n }", "function\t\t\t\t// O - Current user ID or \"\"\nauth_current()\n{\n global $_SERVER, $LOGIN_EMAIL, $LOGIN_ID, $LOGIN_IS_ADMIN, $LOGIN_IS_EDITOR,\n $LOGIN_IS_MEMBER, $LOGIN_IS_OFFICER,\n $LOGIN_NAME, $LOGIN_ORGANIZATION, $LOGIN_PAGEMAX, $LOGIN_TIMEZONE, $SITE_SECRET;\n\n\n // See if the SID cookie is set; if not, the user is not logged in...\n if (!array_key_exists(\"PWGSID\", $_COOKIE))\n return (\"\");\n\n // Extract the \"username:hash\" from the SID string...\n $cookie = explode(':', $_COOKIE[\"PWGSID\"]);\n\n // Don't allow invalid values...\n if (count($cookie) != 3)\n return (\"\");\n\n $id = (int)$cookie[0];\n if ($id <= 0)\n return (\"\");\n\n // Don't allow values older than 1 day\n $date = time() - 86400;\n if ((int)$cookie[1] < $date)\n return (\"\");\n\n // Lookup the username in the user table and compare...\n $result = db_query(\"SELECT * FROM user WHERE id=? AND status=2\", array($id));\n if ($row = db_next($result))\n {\n // Compute the session ID...\n $sid = hash(\"sha256\", \"$_SERVER[REMOTE_ADDR]:$cookie[0]:$cookie[1]:\"\n\t\t\t .\"$SITE_SECRET:$row[hash]:\"\n\t\t\t .\"$_SERVER[HTTP_USER_AGENT]\");\n\n // See if it matches the cookie value...\n if ($cookie[2] == $sid)\n {\n // Set globals...\n $LOGIN_EMAIL = $row[\"email\"];\n $LOGIN_ID = $row[\"id\"];\n $LOGIN_IS_ADMIN = $row[\"is_admin\"];\n $LOGIN_IS_EDITOR = $row[\"is_editor\"];\n $LOGIN_IS_MEMBER = $row[\"is_member\"];\n $LOGIN_NAME = $row[\"name\"];\n $LOGIN_ORGANIZATION = $row[\"organization_id\"];\n $LOGIN_PAGEMAX = $row[\"itemsperpage\"];\n $LOGIN_TIMEZONE = $row[\"timezone\"];\n\n $result = db_query(\"SELECT id FROM workgroup WHERE chair_id=? OR vicechair_id=? OR secretary_id=?\", array($LOGIN_ID, $LOGIN_ID, $LOGIN_ID));\n if (db_count($result) > 0)\n $LOGIN_IS_OFFICER = 1;\n else\n $LOGIN_IS_OFFICER = 0;\n\n // Return the current user...\n return ($cookie[0]);\n }\n }\n\n return (\"\");\n}" ]
[ "0.7601705", "0.66602564", "0.6395188", "0.6326357", "0.6237032", "0.6062525", "0.59535915", "0.59106797", "0.59024847", "0.58806455", "0.5870061", "0.5762921", "0.57601804", "0.57526684", "0.57519096", "0.56273353", "0.56094444", "0.5602262", "0.55707526", "0.55632985", "0.5548951", "0.55393344", "0.55192345", "0.55133605", "0.55068284", "0.5505431", "0.5505431", "0.5475187", "0.54748327", "0.5471097" ]
0.74884087
1
/ newId() generates a 40 character identifier that is extremely difficult to predict. Save to a cookie to persist between pages.
function newId() { $this->log .= "newId() called<br />"; $this->id = sha1(uniqid(rand(), true)); $this->filename = $this->dir."sid_".$this->id; if (!setcookie('sid' ,$this->id, null, "/", $this->domain_cookie)) { $this->log .= "sid cookie save failed. This may be due to browser output started prior or the user has disabled cookies.<br />"; return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newId() {\r\n\t\t$this->log .= \"newId() called<br />\";\r\n\t\t$this->id = md5(uniqid(rand(), true));\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\tif (!setcookie('sid' ,$this->id, null, \"/\")) {\r\n\t\t\t$this->log .= \"sid cookie save failed. This may be due to browser\"\r\n\t\t\t.\" output started prior or the user has disabled cookies.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t}", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}", "function getNewId();", "public function newId()\n {\n return md5(microtime());\n }", "public function __newID() {\n\t\treturn ('#'.$this->_fieldid);\n\t}", "function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "static function makeID() {\n return uniqid();\n }", "function get_id() {\n \n $id_okay = true;\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n if(\"\" == ($id = isset($_GET[$this->name]) ? $_GET[$this->name] : \"\")) {\n $id = isset($_POST[$this->name]) ? $_POST[$this->name] : \"\";\n }\n \n ## check if the id consists of chars that make up a session\n if(ereg('[^a-z0-9]', $id)){\n\t\t$id_okay = false;\n\t}\n \n if( \"\" == $id || !$id_okay) {\n $newid=true;\n // I'll have to work on this class to figure out how this link works\n $id = md5(uniqid($this->magic));\n }\n \n if(isset($_SERVER['QUERY_STRING'])) {\n $_SERVER['QUERY_STRING'] = ereg_replace(\"(^|&)\".quotemeta(urlencode($this->name)).\"=(.)*(&|$)\",\"\\\\1\", $_SERVER['QUERY_STRING']);\n }\n \n $this->id = $id;\n }", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "public function newid($str = 'id')\n {\n $this->idgen += 1;\n return $str.$this->idgen;\n }", "private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }", "private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }", "function createQuoteID(){\n\treturn uniqid(\"Q\");\n}", "function db_pwassist_create_id()\n{\n\t// Implementation note: we use the PHP Session id\n\t// generation mechanism to create the session id.\n\t$old_session_id = session_id();\n\tsession_regenerate_id();\n\t$pwassist_id = session_id();\n\tsession_id($old_session_id);\n\n\treturn $pwassist_id;\n}", "public function newIdentifier(): string;", "public function id()\n\t{\n\t\t// If the driver is an instance of the Cookie driver, we are able to\n\t\t// just return any string since the Cookie driver has no real idea\n\t\t// of a server side persisted session with an ID.\n\t\treturn \\Core\\Str::random('alnum', 40);\n\t}", "protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}", "private function settleId($str)\n\t{\n\t\tif (! $this->setId($str) && ! $this->setId($_COOKIE[$this->name]))\n\t\t\t$this->mkNew();\n\t}", "public function generateNewId()\n {\n return Uuid::uuid4();\n }", "protected function generateId()\n {\n }", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "public static function genNewUniqueId() {\n\t\treturn uniqid(mt_rand(), true);\n\t}", "static function newGuid() { \n $s = strtoupper(md5(uniqid(rand(),true))); \n $guidText = \n substr($s,0,8) . '-' . \n substr($s,8,4) . '-' . \n substr($s,12,4). '-' . \n substr($s,16,4). '-' . \n substr($s,20); \n return strtolower($guidText);\n }", "function UniqueID(){\n\t\treturn uniqid ('Depari', true);\n\t}", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "function idfy($name=false){\n if(!$name) $name = uniqid(false, true);\n return 'id'.substr(md5($name),20);\n}", "static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }", "protected function generateId() {\n return $this->id = md5(uniqid());\n }", "public function id() {\n\t\tif ( null === $this->_id ) {\n\t\t\t$this->_id = sha1( mt_rand() . microtime( true ) . mt_rand() );\n\t\t}\n\n\t\treturn $this->_id;\n\t}" ]
[ "0.779311", "0.7669943", "0.7636603", "0.74520034", "0.7220279", "0.71892494", "0.71880186", "0.7143145", "0.71006465", "0.7077581", "0.7062884", "0.70077294", "0.69361633", "0.69304", "0.69249994", "0.6893161", "0.68906635", "0.6887305", "0.688591", "0.67840314", "0.67445654", "0.6735522", "0.6709468", "0.6697115", "0.66819423", "0.6681856", "0.66684455", "0.66502875", "0.6624315", "0.6608857" ]
0.7872879
0
/ cleanAll() will clean up your session dir removing all 'sid_' files with a modified date older than the number of minutes passed in. This method is here as a convenience. You probably want to create a cron job that cleans this up on a daily basis.
function cleanAll($minutes = CLEAN_ALL_MINUTES) { $sessions = @scandir(SESSIONS_DIR); $sess_dir = rtrim(SESSIONS_DIR, '/').'/'; for($n=count($sessions),$i=0;$i<$n;$i++) { if($sessions[$i]!='.' && $sessions[$i]!='..') { $last_modified = @filemtime($sess_dir . $sessions[$i]); $diff = (time() - $last_modified)/60; if($diff > $minutes) { unlink($sess_dir . $sessions[$i]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanAll($minutes) {\r\n\t\t$this->log .= \"cleanAll() called to delete sessions older than \"\r\n\t\t.$minutes.\" minutes<br />\";\r\n\t\tchdir($this->dir);\r\n\t\t$ret = shell_exec(\"find -type f -name 'sid_*' -maxdepth 1 -mmin +\".$minutes.\" -exec rm -f {} \\;\");\r\n\t}", "public static function cleanupTempFolder(){\r\n\t\t$files = glob($_SERVER[\"DOCUMENT_ROOT\"] . \"/tmp/*\");\r\n\t\t$now = time();\r\n\r\n\t\tforeach($files as $file){\r\n\t\t\tif(is_file($file) && basename($file) != \".keep\"){\r\n\t\t\t\tif($now - filemtime($file) >= 60*60*24){\r\n\t\t\t\t\tunlink($file);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function clearSession()\n {\n unset($_SESSION['opencast']['files'][$this->name]);\n if(is_array($_SESSION['opencast']['files'])) \n {\n foreach($_SESSION['opencast']['files'] as $key => $file) {\n if($file['time'] < (time() - \n (60 * 60 * 24 * OC_CLEAN_SESSION_AFTER_DAYS )) )\n {\n unset($_SESSION['opencast']['files'][$key]);\n }\n }\n }\n }", "public function __destruct()\n {\n foreach (glob(\"$this->save_path/sess_*\") as $filename) {\n if (filemtime($filename) + 3600 < time()) {\n @unlink($filename);\n }\n }\n }", "public function clean() {\n\t\t$sess = ORM::for_table($this->session_type)\n\t\t\t->where_lt('expired', date('Y-m-d H:i:s'))\n\t\t\t->find_many();\n\t\tif($sess != false) {\n\t\t\tforeach($sess as $s) {\n\t\t\t\t$s->delete();\n\t\t\t}\n\t\t}\n\t}", "public static function rmExpired()\n\t{\n\t\t$d = dir(ini_get('session.save_path'));\n\n\t\t$deleted = array();\n\n\t\twhile(false !== ($fn = $d->read()))\n\t\t{\n\t\t\tif ($fn === '.' || $fn === '..') continue;\n\n\t\t\t$fname = $d->path . '/' . $fn;\n\t\t\t$fp = fopen($fname, 'r');\n\t\t\tif ($fp === false) continue;\n\t\t\t$stats = fstat($fp);\n\t\t\tfclose($fp);\n\n\t\t\t$buf = file_get_contents($fname);\n\t\t\t$obj = unserialize($buf);\n\n\t\t\tif ($obj === false || get_class($obj) != 'HttpSession')\n\t\t\t\tcontinue;\n\n\t\t\tif\n\t\t\t(\n\t\t\t\t! is_null($obj->expires)\n\t\t\t\t&& time() - $stats['atime'] > $obj->expires * 60\n\t\t\t)\n\t\t\t{\n\t\t\t\tunlink($fname);\n\t\t\t\t$deleted[] = $fname;\n\t\t\t}\n\t\t}\n\n\t\treturn $deleted;\n\t}", "protected function destroy_all_sessions()\n {\n }", "public function temp_gc()\n {\n $tmp = unslashify($this->config->get('temp_dir'));\n $expire = mktime() - 172800; // expire in 48 hours\n\n if ($dir = opendir($tmp)) {\n while (($fname = readdir($dir)) !== false) {\n if ($fname{0} == '.') {\n continue;\n }\n\n if (filemtime($tmp.'/'.$fname) < $expire) {\n @unlink($tmp.'/'.$fname);\n }\n }\n\n closedir($dir);\n }\n }", "public static function clear(){\n $directory = \"bin\";\n\n if(is_dir($directory)) {\n $scan = scandir($directory);\n unset($scan[0], $scan[1]); //unset . and ..\n foreach($scan as $file) {\n $filename = \"$directory/$file\";\n $filedate = date (\"d/m/Y\", filemtime($filename));\n\n if( $filedate < date(\"d/m/Y\") )\n unlink($filename);\n }\n }\n }", "public function cleanupSessions()\n {\n $config = Core::getConfig();\n $backendType = Tinebase_Session_Abstract::getConfiguredSessionBackendType();\n \n if (strpos($backendType, 'File') === 0) {\n $maxLifeTime = ($config->session && $config->session->lifetime) ? $config->session->lifetime : 86400;\n $path = Tinebase_Session_Abstract::getSessionDir();\n \n $unlinked = 0;\n try {\n $dir = new DirectoryIterator($path);\n } catch (Exception $e) {\n if (Core::isLogLevel(LogLevel::NOTICE)) Core::getLogger()->notice(\n __METHOD__ . '::' . __LINE__ . \" Could not cleanup sessions\");\n Tinebase_Exception::log($e);\n return false;\n }\n \n foreach ($dir as $fileinfo) {\n if (!$fileinfo->isDot() && !$fileinfo->isLink() && $fileinfo->isFile()) {\n if ($fileinfo->getMTime() < Tinebase_DateTime::now()->getTimestamp() - $maxLifeTime) {\n unlink($fileinfo->getPathname());\n $unlinked++;\n }\n }\n }\n \n if (Core::isLogLevel(LogLevel::INFO)) Core::getLogger()->info(\n __METHOD__ . '::' . __LINE__ . \" Deleted $unlinked expired session files\");\n \n Config::getInstance()->set(Config::LAST_SESSIONS_CLEANUP_RUN, Tinebase_DateTime::now()->toString());\n }\n\n return true;\n }", "public function cleanup() {\n $dirIt = new DirectoryIterator($this->path);\n // Convert days to seconds\n $lifetimeSeconds = self::$lifetime * 3600 * 24;\n /** @var DirectoryIterator $fileInfo */\n foreach ($dirIt as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n $fileAge = time() - $fileInfo->getMTime();\n if ($fileAge > $lifetimeSeconds) {\n $this->deleteFile();\n }\n }\n }", "public static function RemoveStaleSessions()\n {\n global $SESSDB;\n\n $time = time();\n\n // First delete everything in sdat that is data for an expired session\n $q = $SESSDB->prepare(\"DELETE FROM `sdat` WHERE sdat.id IN(SELECT smap.id FROM `smap` WHERE deleteafter < :time)\");\n $q->bindParam(':time', $time);\n $q->execute();\n\n // Now delete the entries in smap\n $q = $SESSDB->prepare(\"DELETE FROM `smap` WHERE deleteafter < :time\");\n $q->bindParam(':time', $time);\n $q->execute();\n }", "protected abstract function destroy_all_sessions();", "public function cleanupFiles()\n {\n\n echo 'Cleaning ' . $this->accountID . ' - ' . $this->accountName . ' File Directories' . PHP_EOL;\n\n foreach (glob(\"{$this->commissionsOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->dailyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->monthlyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('2 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->metaFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(self::EXPORT_TMP_DIR . \"/*.txt\") as $filename) {\n unlink($filename);\n }\n\n echo 'Finished cleaning ' . $this->accountName . ' File Directories' . PHP_EOL;\n }", "public function delete_old_sessions()\n\t{\n\t\t$expire = ee()->localize->now - $this->session_length;\n\n\t\tsrand(time());\n\n\t\tif ((rand() % 100) < $this->gc_probability)\n\t\t{\n\t\t\tee()->db->where('last_activity < ', $expire)\n\t\t\t\t\t\t ->delete('sessions');\n\t\t}\n\t}", "function clean_old_files(){\n\t$files = scandir(OUTPUT_FOLDER);\n\tforeach($files as $file){\n\t\tif($file != '.' && $file != '..'){\n\t\t\t$ext = substr($file,-4,4);\n\t\t\tif($ext == 'json'){\n\t\t\t\t$filemtime = filemtime(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t$diff = time() - $filemtime;\n\t\t\t\tif($diff >= FILE_LIFETIME){\n\t\t\t\t\t@unlink(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "private function gc()\n\t{\n\t\tif ($handle = opendir(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/'))\n\t\t{ \n\t\t\t$dir_array = array(); \n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{ \n\t\t\t\tif ($file != '.' AND $file != '..')\n\t\t\t\t{\n\t\t\t\t\tif (file_exists(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lastmod = @filemtime(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\n\t\t\t\t\t\tif (($lastmod + ($this->ttl)) < time())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t@unlink(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\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\tclosedir($handle);\n\t\t}\n\t}", "protected function delete_old_sessions () {\n\t\t$this->db_prime()->q(\n\t\t\t\"DELETE FROM `[prefix]sessions`\n\t\t\tWHERE `expire` < \".time()\n\t\t);\n\t}", "public function deleteExpiredFiles(){\r\n $dir = $this->emailVerify->getDataFolder().self::FOLDER_PATH;\r\n foreach (glob($dir.\"*.token\") as $file) {\r\n $uF = unserialize(gzdecode(file_get_contents($file)));\r\n $tee = new TokenExpireEvent($this->emailVerify, $uF[\"token\"]);\r\n $this->emailVerify->getServer()->getPluginManager()->callEvent($tee);\r\n if (!$uF[\"valid\"] and filemtime($file) < time() - 60*60*24*7) {\r\n unlink($file);\r\n }\r\n }\r\n }", "public function clearAll()\n {\n $this->clearDir($this->file_path . '/sb_Cache');\n }", "public function remove_old_tmp_files() {\n global $wpdb;\n\n $older_than = time() - 86400;\n $num = 0; // Number of files deleted\n\n // Locate files not saved in over a day\n $files = $wpdb->get_results($wpdb->prepare(\n \"SELECT path\n FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than)\n );\n\n // Delete files from file system\n foreach ($files as $file) {\n if (@unlink($file->path)) {\n $num++;\n }\n }\n\n // Remove from tmpfiles table\n $wpdb->query($wpdb->prepare(\n \"DELETE FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than));\n\n // Old way of cleaning up tmp files. Needed as a transitional fase and it doesn't really harm to have it here any way.\n $h5p_path = $this->get_h5p_path();\n $editor_path = $h5p_path . DIRECTORY_SEPARATOR . 'editor';\n if (is_dir($h5p_path) && is_dir($editor_path)) {\n $dirs = glob($editor_path . DIRECTORY_SEPARATOR . '*');\n if (!empty($dirs)) {\n foreach ($dirs as $dir) {\n if (!is_dir($dir)) {\n continue;\n }\n\n $files = glob($dir . DIRECTORY_SEPARATOR . '*');\n if (empty($files)) {\n continue;\n }\n\n foreach ($files as $file) {\n if (filemtime($file) < $older_than) {\n // Not modified in over a day\n if (unlink($file)) {\n $num++;\n }\n }\n }\n }\n }\n }\n\n if ($num) {\n // Clear cached value for dirsize.\n delete_transient('dirsize_cache');\n }\n }", "FUNCTION ServiceChat_remove_CleanChatSessions ( &$dbh )\n\t{\n\t\tglobal $DOCUMENT_ROOT ;\n\t\t$sessions = ARRAY() ;\n\t\t$now = time() ;\n\n\t\t$query = \"SELECT chatsessions.* FROM chatsessions LEFT JOIN chatsessionlist ON chatsessions.sessionID = chatsessionlist.sessionID WHERE chatsessions.created < $now AND chatsessionlist.sessionID is NULL\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\twhile ( $data = database_mysql_fetchrow( $dbh ) )\n\t\t\t{\n\t\t\t\t$sessions[] = $data ;\n\t\t\t}\n\n\t\t\tfor ( $c = 0; $c < count( $sessions ); ++$c )\n\t\t\t{\n\t\t\t\t$session = $sessions[$c] ;\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatrequests/$session[initiate]\" ) && $session['initiate'] )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatrequests/$session[initiate]\" ) ;\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_admin.txt\" ) )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_admin.txt\" ) ;\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_visitor.txt\" ) )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_visitor.txt\" ) ;\n\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/w_$session[sessionID]\".\"_admin.txt\" ) )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/w_$session[sessionID]\".\"_admin.txt\" ) ;\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/w_$session[sessionID]\".\"_visitor.txt\" ) )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/w_$session[sessionID]\".\"_visitor.txt\" ) ;\n\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatpolling/$session[sessionID]\".\".txt\" ) )\n\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatpolling/$session[sessionID]\".\".txt\" ) ;\n\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript.txt\" ) && file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript_info.txt\" ) )\n\t\t\t\t{\n\t\t\t\t\t$mod_time = filemtime( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript.txt\" ) ;\n\t\t\t\t\t$transcript_info_array = file( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript_info.txt\" ) ;\n\t\t\t\t\t$transcript_data_array = file( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript.txt\" ) ;\n\t\t\t\t\t$transcript_info = $transcript_info_array[0] ;\n\t\t\t\t\t$transcript_data = join( \" \", $transcript_data_array ) ;\n\t\t\t\t\t// format: adminid<:>visitorname<:>deptid<:>aspid\n\t\t\t\t\tLIST( $userid, $from_screen_name, $email, $deptid, $aspid ) = explode( \"<:>\", $transcript_info ) ;\n\t\t\t\t\t\n\t\t\t\t\tServiceTranscripts_put_ChatTranscript( $dbh, $session['sessionID'], $transcript_data, $userid, $from_screen_name, $email, $deptid, $aspid, $mod_time ) ;\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript.txt\" ) )\n\t\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript.txt\" ) ;\n\t\t\t\t\tif ( file_exists( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript_info.txt\" ) )\n\t\t\t\t\t\tunlink( \"$DOCUMENT_ROOT/web/chatsessions/$session[sessionID]\".\"_transcript_info.txt\" ) ;\n\t\t\t\t}\n\n\t\t\t\t$query = \"DELETE FROM chatsessions WHERE sessionID = $session[sessionID]\" ;\n\t\t\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "public function deleteAll() {\n\n $this->start();\n $_SESSION = array();\n\n }", "public function clean() {\n $this->logger->debug('Deleting of all cache files');\n $list = glob($this->cacheFilePath . '*.cache');\n if (!$list) {\n $this->logger->info('No cache files were found skipping');\n return;\n }\n $this->logger->info('Found [' . count($list) . '] cache files to remove');\n foreach ($list as $file) {\n $this->logger->debug('Processing the cache file [' . $file . ']');\n unlink($file);\n }\n }", "private function deleteOldTempdirs(){\n $dirname = FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH;\n $dircontents = scandir($dirname);\n foreach($dircontents as $file){\n if ( substr($file, 0,5) == 'temp_' &&\n is_dir($dirname.$file) &&\n filemtime( $dirname.$file ) < strtotime('now -2 days')) {\n $this->destroyDir($dirname.$file);\n }\n }\n }", "function cleanup()\n {\n // *Always* clean up the cache after changing configuration, else\n // the configuration change will first be seen after cache time is run out.\n $this->log(\"-------\");\n $cacheDir = $this->getCacheDirectory();\n if (is_dir($cacheDir) && $handle = opendir($cacheDir)) {\n while (false !== ($file = readdir($handle))) {\n $filename = $cacheDir . '/' . $file;\n if (!is_dir($filename)) {\n $this->log(\"CLEANUP CACHE: \" . $filename);\n unlink($filename);\n }\n }\n }\n }", "public function deleteExpiredLogs()\n {\n $client = $this->createLocalStorageDriver();\n\n $allFiles = $client->files();\n\n foreach ($allFiles as $file) {\n $fileDate = new DateTime(str_replace('.json', '', $file));\n\n $currentDate = new DateTime(date('d-m-Y'));\n\n $interval = $fileDate->diff($currentDate);\n\n if ($interval->days > $this->expireDays) {\n $client->delete($file);\n }\n }\n }", "public function cleanTmpFolder() {\n\t\tarray_map('unlink', glob($this->settings->tmp_path . '/*'));\n\t}", "function galaxy_purge_spy() {\n\tglobal $db, $server_config;\n\n\tif (!is_numeric($server_config[\"max_keepspyreport\"])) {\n\t\treturn;\n\t}\n\t$max_keepspyreport = intval($server_config[\"max_keepspyreport\"]);\n\n\t$request = \"select spy_id from \".TABLE_SPY.\" where active = '0' or datadate < \".(time()-60*60*24*$max_keepspyreport);\n\t$result = $db->sql_query($request);\n\n\twhile (list($spy_id) = $db->sql_fetch_row($result)) {\n\t\t$request = \"select * from \".TABLE_USER_SPY.\" where spy_id = \".$spy_id;\n\t\t$result2 = $db->sql_query($request);\n\t\tif ($db->sql_numrows($result2) == 0) {\n\t\t\t$request = \"delete from \".TABLE_SPY.\" where spy_id = \".$spy_id;\n\t\t\t$db->sql_query($request);\n\t\t}\n\t}\n}", "function clear_expired_sessions() {\n $dbh = DB::connect();\n $timeout = config_get_int('options', 'login_timeout');\n $q = \"DELETE FROM Sessions WHERE ts < (UNIX_TIMESTAMP() - \" . $timeout . \")\";\n $dbh->exec($q);\n}" ]
[ "0.8157979", "0.69646955", "0.67480737", "0.6496964", "0.6470797", "0.6399761", "0.63545907", "0.63167936", "0.62228096", "0.6199423", "0.61847603", "0.61825085", "0.6163068", "0.6100363", "0.6086457", "0.6059203", "0.6040604", "0.60269076", "0.5962554", "0.5960793", "0.59602183", "0.5958639", "0.5953481", "0.59373856", "0.59056544", "0.5879902", "0.5868227", "0.5867007", "0.58590245", "0.5852763" ]
0.80489725
1
Returns the related page for the product
function getRelatedPage() { return $this->relatedpage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function relatedProductsAction()\n {\n $productId = Mage::app()->getRequest()->getParam('productId');\n $relatedProducts = [];\n\n if ($productId != null) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $relatedProductsId = $product->getRelatedProductIds();\n foreach ($relatedProductsId as $relatedProductId) {\n $relatedProducts[] = Mage::getModel('catalog/product')->load($relatedProductId)->getData();\n }\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($relatedProducts));\n $this->getResponse()->setHeader('Content-type', 'application/json');\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "function dw_product_quickview(){\r\n\tglobal $product, $post, $woocommerce;\r\n\tif ( ! isset( $_GET['product_id'] ) ) {\r\n\t\twp_die( 0 );\r\n\t}\r\n\t$p_id = $_GET['product_id'];\r\n\t$p = get_product( $p_id );\r\n\t$product = $p;\r\n\t$post = $p;\r\n\r\n\twoocommerce_get_template( 'content-single-product.php' );\r\n\twp_die();\r\n}", "public function isProductPage();", "public function show(Product $product)\n {\n\t\t$pages = Page::get();\n\t\t//$product->load('pages');\n\n\t\treturn view('admin.products.show', compact(['product', 'pages']));\n }", "function lb_show_single_product_page_action() {\n\t$product_id = esc_html( $_GET['id'] );\n\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'single_product',\n\t\t\t'products' => lb_get_products_data( 5 ),\n\t\t\t'this_product' => lb_get_product_data_by_id( $product_id ),\n\t\t\t'category' => lb_get_product_category_by_id( $product_id ),\n\t\t)\n\t);\n}", "public function getViewedProduct();", "function jk_related_products_args( $args ) {\n$args['posts_per_page'] = 8; // 4 related products\nreturn $args;\n}", "public function getProductInPage($product_id, $page_id)\n {\n return $this->with(array(\n 'pages' => function($query) use($page_id){\n $query->where('pub_pages.id', '=', $page_id);\n }\n ))->find($product_id);\n }", "public function get_related_products() {\n if('product' != get_post_type()) {\n\n // Get an array of the resource types\n\n // Query the relationship field on all 'products' associated with the current post type\n $return = get_posts(array(\n 'post_type' => 'product',\n 'suppress_filters' => 0,\n 'meta_query' => array(\n array(\n 'key' => get_post_type(), // name of custom field\n 'value' => '\"' . get_the_ID() . '\"', // matches exactly \"123\", not just 123. This prevents a match for \"1234\"\n 'compare' => 'LIKE'\n )\n )\n ));\n } else {\n $return = get_field('related_products');\n }\n return $return;\n }", "public function relatedProducts (){\n #reviews...\n $product= Product::with('reviews')\n ->whereIndumentariaId($this->indumentaria->id)\n ->where('id', '!=', $this->id)\n ->where('status', Product::PUBLISHED)\n ->latest()\n ->limit(6)\n ->get();\n return $product;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function product()\n {\n $products = Product::latest()->paginate(5);\n return view('admin.product',compact('products'));\n }", "public function product_detail() {\n global $product;\n WC_Gokeep_JS::get_instance()->product_detail( $product );\n }", "public function product_detail() {\n\t\t// double tracking as there could be multiple buy buttons on the page.\n\t\tif ( $this->has_tracked_detail ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->has_tracked_detail = true;\n\n\t\t// If page reload, then return\n\t\tif ( monsterinsights_is_page_reload() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product_id = get_the_ID();\n\n\t\t// Output view product details EE\n\t\t$js = $this->enhanced_ecommerce_add_product( $product_id );\n\n\t\t// Output setAction for EC funnel\n\t\t$js .= $this->get_funnel_js( 'viewed_product' );\n\n\t\t// Add JS to output queue\n\t\t$this->enqueue_js( 'event', $js );\n\n\t\t// Send view product event\n\t\t$properties = array(\n\t\t\t'eventCategory' => 'Products',\n\t\t\t'eventLabel' => esc_js( get_the_title() ),\n\t\t\t'nonInteraction' => true,\n\t\t);\n\n\t\t$this->js_record_event( 'Viewed Product', $properties );\n\t}", "protected function getProductPage($product)\n {\n /** @var \\Magento\\Framework\\View\\Result\\Page $resultPage */\n $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);\n if ($product->getPageLayout()) {\n $resultPage->getConfig()->setPageLayout($product->getPageLayout());\n }\n $urlSafeSku = rawurlencode($product->getSku());\n $resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false);\n $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]);\n $resultPage->addUpdate($product->getCustomLayoutUpdate());\n return $resultPage;\n }", "public function product($url='page',$page=0){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'product';\n\t\t$data['category'] \t\t\t= CategoryBlogModel::desc()->get();\n\t\t$data['tag'] \t\t\t\t= TagModel::desc()->get();\n\t\t$data['popular_news'] \t\t= BlogModel::notDraft()->take(4)->orderBy('view','desc')->get();\n\t\t$data['events']\t\t\t\t= EventPromoModel::notDraft()->take(4)->desc()->get();\n\t\tif($url==\"detail\" && $page!=0){\n\n\t\t\t$product \t\t\t\t= ProductModel::notDraft()->find($page);\n\n\t\t\tif(!$product){\n\t\t\t\tredirect('error');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tProductModel::notDraft()->whereId($page)->increment('view');\n\t\t\t$data['related'] \t\t= ProductModel::notDraft()->where('id_category',$product->id_category)\n\t\t\t\t\t\t\t\t\t\t->where('id','!=',$product->id)->take(3)->desc()->get();\n\t\t\t$data['product'] \t\t= $product;\n\t\t\techo $this->blade->nggambar('website.product.content',$data);\n\t\t}\n\t\telse {\n\t\t\tif(!is_numeric($page)){\n\t\t\t\t$page \t= 0;\n\t\t\t}\n\n\t\t\t$name \t\t\t\t\t\t= (null != $this->input->get('q')) ? $this->input->get('q') : '';\n\n\n\t\t\t$by \t\t\t\t\t\t= $this->input->get('by');\n\n\t\t\t$by_data \t\t\t\t\t= ['newest','oldest','priceasc','pricedesc'];\n\t\t\tif(!in_array($by, $by_data)){\n\t\t\t\t$by \t\t\t\t\t= 'newest';\n\t\t\t}\n\n\t\t\tif($by==\"newest\" || $by==\"pricedesc\"){\n\t\t\t\t$sort \t\t\t\t\t= 'desc';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sort \t\t\t\t\t= 'asc';\n\t\t\t}\n\n\t\t\t// atribute set\n\t\t\t$data['attr_by'] \t\t\t= $by;\n\t\t\t$data['attr_name'] \t\t\t= $name;\n\t\t\t\n\t\t\t$paginate\t\t\t\t\t= new Aksa_pagination;\n\t\t\t$data['page']\t\t\t\t= $page;\n\n\t\t\tif($by==\"newest\" || $by==\"oldest\"){\n\t\t\t\t$by \t\t\t\t\t= 'created_at';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$by \t\t\t\t\t= 'price';\n\t\t\t}\n\n\t\t\t$data['total']\t\t\t\t= ProductModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\t\t\t$data['product']\t\t\t= ProductModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\n\t\t\t$data['total'] \t\t\t\t= $data['total']->get();\n\t\t\t$data['product'] \t\t\t= $data['product']->take(6)->skip($page*6)->orderBy($by,$sort)->get();\n\n\t\t\t$data['pagination'] \t\t= $paginate->paginate(base_url('main/product/page/'),5,6,count($data['total']),$page);\n\t\t\techo $this->blade->nggambar('website.product.index',$data);\n\t\t\treturn;\n\t\t}\n\t}", "public function show($product) {\n \n }", "public function execute()\n {\n $product = $this->initProduct();\n if ($product) {\n $this->coreRegistry->register('productId', $product->getId());\n\n $settings = $this->catalogDesign->getDesignSettings($product);\n if ($settings->getCustomDesign()) {\n $this->catalogDesign->applyCustomDesign($settings->getCustomDesign());\n }\n $resultPage = $this->getProductPage($product);\n // update breadcrumbs\n $breadcrumbsBlock = $resultPage->getLayout()->getBlock('breadcrumbs');\n if ($breadcrumbsBlock) {\n $breadcrumbsBlock->addCrumb(\n 'product',\n ['label' => $product->getName(), 'link' => $product->getProductUrl(), 'readonly' => true]\n );\n $breadcrumbsBlock->addCrumb('reviews', ['label' => __('Product Reviews')]);\n }\n return $resultPage;\n }\n /** @var \\Magento\\Framework\\Controller\\Result\\Forward $resultForward */\n $resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);\n $resultForward->forward('noroute');\n return $resultForward;\n }", "function product()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $product['content'] = Modules::run('product/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('product');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdminProduct',$product);\n \n \n $this->load->view('general',$data);\n \n }\n }", "public function product()\n {\n $titlePage = \"Thêm Loại Sản Phẩm\";\n $types = Type::where('level', Type::PRODUCT)->orderBy('id', 'DESC')->paginate(10);\n return view('add.type_product',compact('titlePage', 'types'));\n }", "public function show(Product $product)\n {\n $products = Product::findOrfail($product);\n $interested = Product::where('id', '!=', $product->id)->get()->random(8);\n\n return view('frontend.pages.show', compact('products', 'interested'));\n }", "public function show($locale, $pid)\n {\n $product = Product::find($pid);\n $listCate = DB::table('categories')\n ->orderBy('id','desc')->get();\n\n // Recommended products\n $recommendedProducts = DB::table('products')\n ->leftJoin('product_images', 'products.id', '=', 'product_images.product_id')\n ->where('products.category_id', $product->category_id)\n ->where('products.id', '<>', $product->id)\n ->orderBy('products.created_at', 'desc')\n ->select('products.id', 'products.name', 'products.price', 'product_images.image_path')\n ->paginate(Config::get('constants.records_per_page.recommended_products'));\n\n $this->data['title'] = __('main.title.home');\n $this->data['listCate'] = $listCate;\n $this->data['product'] = $product;\n $this->data['recommendedProducts'] = $recommendedProducts;\n $this->data['product_image_path'] = Config::get('constants.path.upload_image_path');\n $this->data['currency'] = Config::get('constants.default.currency');\n\n return view('layouts.product.show', $this->data);\n }", "public function show($product)\n {\n //\n }", "public function show($id){\n $product=Product::find($id);\n return view('pages.show')->with('product',$product);\n \n }", "public function show($id)\n {\n $product = Product::where('id','=', $id)->first();\n $menus = Category::where('parent_id', '=', 0)->get();\n $res = new Collection;\n $relateds = Product::where('slug', '!=', $product->slug)->where('category_id', '=', $product->category_id)->orderBy('id', 'DESC')->limit(8)->get();\n // foreach ($menus as $category) {\n\n // //lấy tất cả product\n // // $products = Helper::getProductsByCategory($category);\n // // $top_products = $products->sortByDesc('id')->take(8);\n // // $category->setAttribute('top_products', $top_products);\n // // $res->push($category); \n // }\n return view('home.products.show',compact('menus', 'res','product','relateds'));\n }", "public function get($id){\n $product = Product::where(\"id\", \"=\", $id)->first();\n if($product){\n $migthLove = Product::where([\n [\"category_id\",\"=\", $product->category_id],\n [\"id\",\"<>\",$id]\n ])->limit(4)->get();\n return view(\"products.details\",compact(\"product\",\"migthLove\"));\n }\n return redirect(route(\"produits\"));\n }", "public function listProductPage(){\n\t\t\t$sql = \"SELECT * FROM products\";\n\t\t\t$listProductPage = mysqli_query($this->connect(),$sql);\n\t\t\treturn $listProductPage;\n\t\t}", "public function index()\n {\n $viewproduct = ProductModel::get();\n return view('page.product.detailproduct', compact('viewproduct'));\n }", "public function show($product)\n {\n\n }" ]
[ "0.61975974", "0.61398417", "0.6129385", "0.6117341", "0.6102854", "0.6089641", "0.6079227", "0.60752887", "0.6074358", "0.60701156", "0.60586166", "0.6048265", "0.60357964", "0.60138136", "0.59893435", "0.5917811", "0.58565104", "0.5826479", "0.5821072", "0.57659525", "0.5765762", "0.5742496", "0.5732906", "0.56861794", "0.56858003", "0.5678289", "0.5660256", "0.56602174", "0.56492466", "0.56458664" ]
0.7069329
0
Returns the product teaser
function get_teaser() { return $this->teaser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTeaser()\n {\n return $this->teaser;\n }", "public function getViewedProduct();", "public function product_detail() {\n global $product;\n WC_Gokeep_JS::get_instance()->product_detail( $product );\n }", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "function fe_show_product_image() {\n // wc_get_template( 'single-product/product-image.php' );\n include_once(FESTIVAL_EVENTS_PLUGIN_PATH . 'templates/single-product/product-image.php');\n }", "public function getProduct(){\r\n return Mage::registry('current_product');\r\n }", "public function productDetailsAction()\n {\n $vars['productId'] = $this->route['id'];\n $vars['product'] = $this->model->getById($vars['productId']);\n $vars['colors'] = $this->model->getAvailableColors($vars['productId']);\n $this->view->render('Riding Gear', $vars);\n }", "public function getPreviewUrlProduct()\n {\n return $this->previewUrlProduct;\n }", "public function getTeaserImage()\n {\n $result = null;\n if ($this->getImages() != null && $this->getImages()->count() > 0) {\n foreach ($this->getRaw()->images as $image) {\n if (isset($image->mediaId) && isset($image->main) && (int)$image->main === 1) {\n /** @var Media $media */\n $media = $this->mediaClient->findById($image->mediaId);\n if ($media && is_a($media, Media::class)) {\n $result = $media;\n }\n }\n }\n }\n return $result;\n }", "function get_list_view_html ($product) {\n\t\t//Build HTML output for a single T-Shirt thumbnail\n\t\t$output = \"\";\n\t\t$output .= \"<li>\";\n\t\t$output .= '<a href=\"' . BASE_URL . \"shirts/\" . $product[\"sku\"] .'/\">';\n\t\t$output .= '<img src=\"' . BASE_URL . $product[\"img\"] . '\" alt=\"' . $product[\"name\"]. '\">';\n\t\t$output .= \"<p>View Details</p>\";\n\t\t$output .= \"</a>\";\n\t\t$output .= \"</li>\";\n\t\treturn $output;\n\t}", "function getTeaserImages() \t{\n \t\treturn $this->teaserImagesArray;\n \t}", "public function product_detail() {\n\t\t// double tracking as there could be multiple buy buttons on the page.\n\t\tif ( $this->has_tracked_detail ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->has_tracked_detail = true;\n\n\t\t// If page reload, then return\n\t\tif ( monsterinsights_is_page_reload() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product_id = get_the_ID();\n\n\t\t// Output view product details EE\n\t\t$js = $this->enhanced_ecommerce_add_product( $product_id );\n\n\t\t// Output setAction for EC funnel\n\t\t$js .= $this->get_funnel_js( 'viewed_product' );\n\n\t\t// Add JS to output queue\n\t\t$this->enqueue_js( 'event', $js );\n\n\t\t// Send view product event\n\t\t$properties = array(\n\t\t\t'eventCategory' => 'Products',\n\t\t\t'eventLabel' => esc_js( get_the_title() ),\n\t\t\t'nonInteraction' => true,\n\t\t);\n\n\t\t$this->js_record_event( 'Viewed Product', $properties );\n\t}", "public function getShowInProduct()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/show_product');\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getProductUrl()\n {\n return $this->product_url;\n }", "public function product()\n {\n return $this->m_product;\n }", "function dw_product_quickview(){\r\n\tglobal $product, $post, $woocommerce;\r\n\tif ( ! isset( $_GET['product_id'] ) ) {\r\n\t\twp_die( 0 );\r\n\t}\r\n\t$p_id = $_GET['product_id'];\r\n\t$p = get_product( $p_id );\r\n\t$product = $p;\r\n\t$post = $p;\r\n\r\n\twoocommerce_get_template( 'content-single-product.php' );\r\n\twp_die();\r\n}", "public function get_product()\n {\n return $this->_product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct() {\n return Mage::registry('product');\n }", "function productTeaser($post)\r\n{\r\n ?>\r\n <p>\r\n <span>Embed-cсылка на тизер: </span>\r\n <input type=\"text\" name='extra[teaser]' value=\"<?php echo get_post_meta($post->ID, \"teaser\", 1); ?>\">\r\n </p>\r\n <?php\r\n}", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }" ]
[ "0.6868594", "0.6262404", "0.6100168", "0.6097907", "0.6084796", "0.6075551", "0.60731566", "0.6057142", "0.60148096", "0.6010375", "0.59647626", "0.59148496", "0.5890788", "0.5882187", "0.5855473", "0.5835621", "0.58341163", "0.58336693", "0.58297557", "0.5827447", "0.5827447", "0.5827447", "0.5827447", "0.5827447", "0.5827447", "0.58256143", "0.58165747", "0.58029556", "0.58029556", "0.58029556" ]
0.62890935
1
Depricated, please use getArticleUids()
function getArticles() { return $this->getArticleUids(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArticleUids() \t{\n \t\treturn $this->articles_uids;\n \t}", "function get_author_user_ids()\n {\n }", "function get_nonauthor_user_ids()\n {\n }", "function load_articles() \t{\n \t\tif ($this->articles_loaded==false)\n \t\t{\n\t\t\tif ($this->articles_uids=$this->conn_db->get_articles($this->uid))\n\t \t\t{\n\t \t\t\tforeach ($this->articles_uids as $article_uid)\n\t \t\t\t{\n\t \t\t\t\t// initialise Array of articles \n\t \t\t\t\t$this->articles[$article_uid]=new tx_commerce_article($article_uid,$this->lang_uid);\n\t\t\t\t\t$this->articles[$article_uid]->load_data();\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t$this->articles_loaded=true;\n\t \t\t\treturn $this->articles_uids;\n\t \t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\treturn $this->articles_uids;\n \t\t}\n \t\t\n \t}", "function getArticleObjects() \t{\n \t\treturn $this->articles;\n \t}", "public function getIds()\n {\n return $this->article_ids;\n }", "public function getArticleId(): Uuid {\n\t\treturn ($this->articleId);\n\t}", "public function artIdList()\n {\n return User::where('status', 1)->where('role_id', 3)->get();\n }", "public function getIdArticles(){\n $QueryIdArticle = 'SELECT IDarticle FROM Blog WHERE IDuser =\"' . $this->idUser .'\"';\n\n //On execute la commande\n $prepareIdArticle = SPDO::getInstance()->prepare($QueryIdArticle);\n $prepareIdArticle->execute();\n\n $IdArticles = $prepareIdArticle->fetchAll();\n return $IdArticles;\n }", "function getAffiliateArticles($uID = null,$page =1,$limit = 5)\n\t\t{\t\t\t\n\t\t\t$query = \"select prim_affiliate_id , secondary_affiliates from tbl_subscriber where subscriber_id = '$uID' limit $limit\";\n\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\tif($rs->RecordCount()) \n\t\t\t{\t\t\t\n\t\t\t\t$row = $rs->FetchRow();\n\t\t\t\t$primary_affiliates \t\t= $row['prim_affiliate_id'];\t\t\t\t\n\t\t\t\t$secondary_affiliate_data \t= $row['secondary_affiliates'];\n\t\t\t}\n\t\t\t$arrAffiliates = array();\n\t\t\t\n\t\t\tif(!empty( $primary_affiliates ))\n\t\t\t{\n\t\t\t\t$arrAffiliates[] = \t$primary_affiliates; \n\t\t\t}\n\t\t\t\n\t\t\t$secondary_affiliates = explode(',',\t$secondary_affiliate_data);\n\t\t\t\n\t\t\tif(!empty($secondary_affiliate_data))\n\t\t\t{\n\t\t\t\tforeach($secondary_affiliates as $affiliateIDs){\n\t\t\t\t\t$arrAffiliates[] = $affiliateIDs;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// fetch articles \n\t\t\t$list = implode(\",\" , $arrAffiliates);\n\t\t\t\n\t\t\t$myAffiliateArticles = array();\n\t\t\t$myAffiliate = array();\n\t\t\t\n\t\t\tif(count($list))\n\t\t\t{\n\t\t\t\tif($page)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$start = ($page - 1)*$limit;\t\t\t\n\t\t\t\t\t$query = \"select * from tbl_affiliate_articles where affiliate_id IN (\". $list . \") order by article_id desc limit $start , $limit \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\t## $page =0 i.e. show all elements \n\t\t\t\t\t$query = \"select * from tbl_affiliate_articles where affiliate_id IN (\". $list . \") order by article_id desc\";\n\t\t\t\t}\n\t\t\n\t\t\t\n\t\t\t\t$rs = $this->Execute($query);\n\n\t\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t\t$desc = substr($row['affiliate_comment'],0,100);\n\t\t\t\t\t$row['affiliate_comment'] = $desc;\n\t\t\t\t\t$myAffiliate\t\t= $row;\n\t\t\t\t\tarray_push($myAffiliateArticles,$myAffiliate);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $myAffiliateArticles;\n\t\t}", "protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}", "function _get_all_opponents($uid, $tid) {\n\n}", "public abstract function get_ids();", "function tags() {\n\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRow = $preloader->getPreloadArticleTag($this->id);\n\n\t\tif ($preloadRow) {\n\t\t\t$rows = $preloadRow;\n\t\t} else {\n\t\t\tglobal $polarbear_db;\n\t\t\t$sql = \"SELECT tagID FROM \" . POLARBEAR_DB_PREFIX . \"_article_tag_relation WHERE articleID = '$this->id'\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t}\n\n\t\t$arrTags = array();\n\t\tif ($rows) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$arrTags[] = polarbear_tag::getInstance($row->tagID);\n\t\t\t}\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article tags()\");\n\n\t\treturn $arrTags;\n\t}", "public function getBannedUids() {}", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function getAvailableSlideUIDs(){\n\n $slideUIDs = $this->find( 'list', [\n 'fields' => [\n 'HeaderSlide.uid',\n 'HeaderSlide.uid'\n ]\n ]);\n\n //Return the slide UIDs in a a sequentially indexed array\n return array_values( $slideUIDs );\n\n }", "public function hasArticleId(){\n return $this->_has(2);\n }", "public function getArticles();", "function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}", "function get_article_authors() {\n global $articles;\n $hashmap = array();\n $authors = array();\n foreach ($articles as $index => $article) {\n foreach ($article['authors'] as $author) {\n if (!isset($hashmap[$author])) {\n $hashmap[$author] = true;\n $authors[] = $author;\n }\n }\n }\n sort($authors);\n return $authors;\n}", "function getAffiliateNewsDetail($affiliateID = NULL ,$articleID =NULL)\n\t\t{\n\t\t\n\t\t\t# fetch articles \n\t\t\t$query = \"select * from tbl_affiliate_articles \n\t\t\twhere affiliate_id = $affiliateID and article_id = $articleID\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\t\t\n\t\t\t$myAffiliateArticles = array();\n\t\t\t\n\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t$myAffiliate\t\t= $row;\n\t\t\t\tarray_push($myAffiliateArticles,$myAffiliate);\n\t\t\t}\n\t\t\t\n\t\t\treturn $myAffiliateArticles;\t\t\n\t\t}", "function get_users()\n {\n //Unimplemented\n }" ]
[ "0.84692585", "0.68874484", "0.67708915", "0.66715676", "0.62332135", "0.6205977", "0.61673236", "0.6005042", "0.5933276", "0.5888452", "0.5841136", "0.5722362", "0.5665847", "0.5653537", "0.5648729", "0.5626733", "0.5626733", "0.5626733", "0.5626733", "0.5626733", "0.5626733", "0.5626733", "0.5626733", "0.5625589", "0.56201565", "0.559376", "0.55750215", "0.55533934", "0.55361867", "0.55308515" ]
0.7486598
1
Loads the data and divides comma sparated images in array inherited from parent
function load_data() { $return=parent::load_data(); $this->images_array=t3lib_div::trimExplode(',',$this->images); $this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageArray();", "function images_data_split($all_pic,$folder_name,$size)\r\n{\r\n\t \r\n //image_url + ? + id \r\n $image_url_id=array();\r\n\r\n for($index=0;$index<count($all_pic);$index++)\r\n {\r\n \t\r\n array_push($image_url_id,$all_pic[$index]['images'][$size]['source']);\r\n \r\n }\r\n //split the array in 40 size\t\r\n $select_images_split=array();\r\n $select_images_split=array_chunk($image_url_id,40, true);\r\n \r\n \r\n for($index1=0;$index1<count($select_images_split);$index1++)\r\n { \r\n \t global $folder_name;\r\n \t //images add in folder\r\n \t images_add_folder($select_images_split[$index1],$folder_name);\r\n \t\r\n \t \r\n } \t\t\t\r\n \r\n \r\n}", "public function Images()\n {\n $pngLeftTop = $this->objFromFixture('Image', 'pngLeftTop');\n $pngLeftTop->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightTop = $this->objFromFixture('Image', 'pngRightTop');\n $pngRightTop->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightTop->VerticalSliceBottomRightColor = '0000ff';\n $pngRightTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngRightTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightBottom = $this->objFromFixture('Image', 'pngRightBottom');\n $pngRightBottom->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightBottom->VerticalSliceBottomRightColor = '0000ff';\n $pngRightBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngRightBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n $pngLeftBottom = $this->objFromFixture('Image', 'pngLeftBottom');\n $pngLeftBottom->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftBottom->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngLeftBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n return array($pngLeftTop, $pngRightTop, $pngRightBottom, $pngLeftBottom);\n }", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "private function setImgArray($data)\n {\n //====================================================================//\n // Safety Check\n if (!is_array($data) && !is_a($data, \"ArrayObject\")) {\n return false;\n }\n //====================================================================//\n // Load Object Images List for Whole Product\n $this->imagesCache = Image::getImages(SLM::getDefaultLangId(), $this->object->id);\n\n //====================================================================//\n // UPDATE IMAGES LIST\n //====================================================================//\n\n $this->imgPosition = 0;\n $visibleImageIds = array();\n //====================================================================//\n // Given List Is Not Empty\n foreach ($data as $inValue) {\n //====================================================================//\n // Check Image Array is here\n if (!isset($inValue[\"image\"]) || empty($inValue[\"image\"])) {\n continue;\n }\n $this->imgPosition++;\n //====================================================================//\n // Search For Image In Current List\n $psImage = $this->searchImage($inValue[\"image\"][\"md5\"]);\n if (false == $psImage) {\n //====================================================================//\n // If Not found, Add this object to list\n $psImage = $this->addImageToProduct(\n $inValue[\"image\"],\n $this->getImagePosition($inValue),\n $this->getImageCoverFlag($inValue)\n );\n }\n //====================================================================//\n // Safety Check\n if (!($psImage instanceof Image)) {\n continue;\n }\n //====================================================================//\n // Update Image Position in List\n $this->updateImagePosition($psImage, $inValue);\n $this->updateImageCoverFlag($psImage, $inValue);\n //====================================================================//\n // Update Image Object in Database\n $this->updateImage($psImage);\n //====================================================================//\n // Add Ps Image Id to Visible\n if ($this->getImageVisibleFlag($inValue)) {\n $visibleImageIds[] = $psImage->id;\n }\n }\n\n //====================================================================//\n // Update Combination Images List\n $this->updateAttributeImages($visibleImageIds);\n\n //====================================================================//\n // If Current Image List Is Empty => Clear Remaining Local Images\n $this->cleanImages($this->imagesCache);\n\n //====================================================================//\n // Generate Images Thumbnail\n $this->updateImgThumbnail();\n\n //====================================================================//\n // Flush Images Infos Cache\n $this->flushImageCache();\n\n return true;\n }", "abstract public function loadData();", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "private function makeImageList()\n\t{\n\t\t$images_dir = self::$locator->banner_images_dir($this->trip, $this->slug);\n\t\t$trip = $this->trip;\n\t\t$slug = $this->slug;\n\t\t/// This is a hack so that unit testing does not have to setup Locator\n\t\t/// for every test.\n\t\tif (! is_dir($images_dir)) {\n\t\t\treturn [];\n\t\t}\n\t\t$list = scandir($images_dir);\n\t\t$x = [];\n\t\tforeach ($list as $ent) {\n\t\t\tif (($ent != \".\") && ($ent != \"..\") && (substr($ent, 0, 1) != \".\")) {\n\t\t\t\t$tmp = new \\stdClass();\n\t\t\t\t$tmp->url = self::$locator->url_banner_image($trip, $slug, $ent);\n\t\t\t\t$tmp->path = self::$locator->banner_image_filepath($trip, $slug, $ent);\n\t\t\t\t$x[] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$this->images_list = $x;\n\t}", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "abstract protected function load(): array;", "public function storingImagesDataProvider(){\n\n return [\n [[['path' => 'my/file.png', 'height' => 200, 'width' => 300]]],\n [[['path' => 'my/file.png', 'height' => 200, 'width' => 300]], [['path' => 'test/new.png', 'height' => 500, 'width' => 250]]]\n\n ];\n }", "protected function combineImages() {}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "protected function loadImages() {\r\n $this->images = new \\App\\Table\\ImagesTable(App::getInstance()->getDb());\r\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "private function getImagesInfoArray()\n {\n //====================================================================//\n // Get Images Infos From Cache\n if (!is_null($this->imagesCache)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Load Complete Product Images List\n $productImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->object->id,\n null\n );\n //====================================================================//\n // Images List is Empty\n if (!count($productImages)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Create Images List\n foreach ($productImages as $imgArray) {\n //====================================================================//\n // Add Image t o Cache\n $this->imagesCache[] = $this->buildInfo($imgArray[\"id_image\"]);\n }\n\n return $this->imagesCache;\n }", "public static function loadBackgroundImages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n\n $counter = 0;\n $middleClass = \"\";\n foreach ($slice as $bg) {\n $counter++;\n if ($counter == 1) {\n ?><div class=\"cs-product-row\"><?php\n }\n if ($counter == 2) {\n $middleClass = \"cs-prd-middle\";\n }\n else {\n $middleClass = \"\";\n }\n ?>\n <?php $bg_index = self::parseInt($bg); ?>\n <div class=\"cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>\"\n index_za_pozadina_e=\"<?php echo $bg_index; ?>\"> \n\n <img src=\"img/bgs/<?php echo $bg ?>\" width=\"97\" height=\"126\" data-bgname=\"<?php echo $bg ?>\" class=\"cs-main-bg\" />\n </div>\n <?php\n if ($counter == 3) {\n ?></div><?php\n $counter = 0;\n }\n }\n }", "public function getImagesFromBatch() {\n\t\t$images = array();\n\t\t$images = icms_core_Filesystem::getFileList(ALBUM_UPLOAD_ROOT.'batch/', '', array('gif', 'jpg', 'png'));\n\t\t$ret = array();\n\t\tforeach(array_keys($images) as $i ) {\n\t\t\t$ret[$i] = $images[$i];\n\t\t}\n\t\treturn $ret;\n\t}", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function getDataImages() : ArrayCollection\n {\n $criteria = Criteria::create();\n $criteria->where(Criteria::expr()->eq('type', DatumTypeEnum::TYPE_SIGN))\n ->orWhere(Criteria::expr()->eq('type', DatumTypeEnum::TYPE_IMAGE))\n ->orderBy(['position' => Criteria::ASC]);\n\n return $this->data->matching($criteria);\n }", "function pushImages() \n\t{\n\t\tglobal $imageDir;\n\t\tglobal $studentImageDir;\t\t\n\t\tglobal $countImgs;\n\t\tglobal $countStudents;\n\t\t\n\t\t//Set up arrays of found images\n\t\t//This is being done ahead of the for statements since UNC's system\n\t\t//I think took the empty globs as FALSE instead of an empty array.\n\t\t$slideshow_pngs = glob($imageDir . \"*.png\");\n\t\t$slideshow_bigPNGs = glob($imageDir . \"*.PNG\");\n\t\t$slideshow_jpgs = glob($imageDir . \"*.jpg\");\n\t\t$slideshow_bigJPGs = glob($imageDir . \"*.JPG\");\n\t\t//global $fullImageDir;\n\n\t\t// Build top slideshow array\n\t\tif ($slideshow_pngs and !empty($slideshow_pngs))\n\t\t{\n\t\t\tforeach ($slideshow_pngs as $png) {\n\t\t\t\t//tempAr will be populated into the slideshow javascript\n\t\t\t\t//the first element is the thumbnail\n\t\t\t\t//the second element is the large image file\n\t\t\t\t//echo(\"tempAr = ['$png', '\" . substr_replace($png, $fullImageDir, 0, strlen($imageDir)) . \"'];\");\t\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($slideshow_bigPNGs and !empty($slideshow_bigPNGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigPNGs as $png) {\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_jpgs and !empty($slideshow_jpgs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_jpgs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_bigJPGs and !empty($slideshow_bigJPGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigJPGs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo(\"myImageArray.sort()\"); //sort our slideshow alphabetically\n\t\t\n\t}", "private function getImagesInfoArray(): array\n {\n //====================================================================//\n // Get Images Infos From Cache\n if (!is_null($this->imagesCache)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Load Complete Product Images List\n $productImages = Image::getImages(\n SLM::getDefaultLangId(),\n (int) $this->object->id,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Images List is Empty\n $this->imagesCache = array();\n if (!count($productImages)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Create Images List\n foreach ($productImages as $imgArray) {\n //====================================================================//\n // Add Image t o Cache\n $this->imagesCache[] = $this->buildInfo($imgArray[\"id_image\"]);\n }\n\n return $this->imagesCache;\n }", "public static function data_images() {\n\t\tif ( empty( self::$images ) ) {\n\t\t\tself::$images = glob( dirname( dirname( __FILE__ ) ) . '/images/*' );\n\t\t}\n\n\t\treturn self::$images;\n\t}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "private function getData()\n\t{\n\t\t// get the gallery record\n\t\t$this->record = BackendSlideshowModel::getImage($this->id);\n\t\t$this->record2 = BackendSlideshowModel::getGallery($this->galleryId);\n\t\t\n\t}", "public function exchangeArray($data){\n $this->id \t= (isset($data['id'])) ? $data['id'] : null;\n $this->svg1 \t\t= (isset($data['svg1'])) ? $data['svg1'] : null;\n $this->image1 \t= (isset($data['image1'])) ? $data['image1'] : null;\n $this->svg2 \t\t= (isset($data['svg2'])) ? $data['svg2'] : null;\n $this->image2 \t= (isset($data['image2'])) ? $data['image2'] : null;\n $this->svg3 \t\t= (isset($data['svg3'])) ? $data['svg3'] : null;\n $this->image3 \t= (isset($data['image3'])) ? $data['image3'] : null;\n }", "private function _imageModelCreateData()\n {\n return [\n 'designBlockModel' => [\n 'marginTop' => 10,\n ],\n 'designImageSliderModel' => [\n 'arrowDesignTextModel' => [\n 'size' => 10\n ],\n 'hasAutoPlay' => true,\n 'playSpeed' => 10,\n ],\n 'designImageZoomModel' => [\n 'designBlockModel' => [\n 'marginTop' => 20\n ],\n 'effect' => 0,\n ],\n 'designImageSimpleModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 20\n ],\n 'imageDesignBlockModel' => [\n 'marginTop' => 30\n ],\n 'alignment' => 1\n ],\n 'type' => 1,\n 'viewAutoCropType' => 1,\n 'viewCropX' => 30,\n 'viewCropY' => 40,\n 'thumbAutoCropType' => 1,\n 'thumbCropX' => 20,\n 'thumbCropY' => 30,\n 'useAlbums' => true,\n ];\n }", "private function __prepareRowImages($current_row) {\n \n // extract files from the DB\n $query = $this->__getQueryImage($current_row->id);\n $result = $query->execute();\n $current_row->images = array();\n foreach ($result as $row) {\n \n // check for empty pic string\n if (empty($row->picture)) {\n $current_row->profile_picture_id = 0;\n $current_row->images = array();\n $current_row->image_title = '';\n continue;\n }\n \n // picno 1 is profile pic\n // the rest are field images\n if ($row->picno == 1) {\n $current_row->profile_picture_id = $row->id;\n }\n else {\n $current_row->images[] = $row->id;\n }\n }\n\n }", "private function get_type_img()\n {\n $this->multi_byte_string_to_array();\n foreach($this->strings as $char)\n {\n $this->init_img();\n $this->create_img($char);\n }\n }" ]
[ "0.61604345", "0.61037254", "0.6009878", "0.58669907", "0.58038646", "0.577029", "0.57650214", "0.5764268", "0.5763486", "0.5743982", "0.57312286", "0.57226473", "0.5701011", "0.57004684", "0.56829184", "0.5589712", "0.5576506", "0.5552043", "0.5512154", "0.54844874", "0.54817533", "0.54594386", "0.5449547", "0.54314077", "0.54210764", "0.54183024", "0.54083276", "0.54054123", "0.5400903", "0.5382704" ]
0.7331002
0
Returns list of articles from this product filtered by given attribute UID and Attribute Value
function get_Articles_by_AttributeArray($attribute_Array,$proofUid=1){ if($proofUid){ $whereUid = ' and tx_commerce_articles.uid_product = '.$this->uid; } $first = 1; // Setzen der Arrays damit array_intersect keine Fehlermeldung ausgibt $first_array = array(); $next_array = array(); $addwhere=''; if (is_array($attribute_Array)) { foreach ($attribute_Array as $uid_val_pair) { $addwheretmp = ''; // attribute char wird noch nicht verwendet, dafuer muss eine Pruefung auf die ID if (is_string($uid_val_pair['AttributeValue'])) { $addwheretmp .= " OR (tx_commerce_attributes.uid = ".$uid_val_pair['AttributeUid']." and tx_commerce_articles_article_attributes_mm.value_char='". $GLOBALS['TYPO3_DB']->quoteStr($uid_val_pair['AttributeValue'],'tx_commerce_articles_article_attributes_mm')."' )"; } // Nach dem charwert immer ueberpruefen, solange value_char noch nicht drin ist. if (is_float($uid_val_pair['AttributeValue']) || is_integer(intval($uid_val_pair['AttributeValue']))) { $addwheretmp.= " OR (tx_commerce_attributes.uid = ".$uid_val_pair['AttributeUid']." and tx_commerce_articles_article_attributes_mm.default_value in (". $uid_val_pair['AttributeValue']." ) )"; } if (is_float($uid_val_pair['AttributeValue']) || is_integer(intval($uid_val_pair['AttributeValue']))) { $addwheretmp.= " OR (tx_commerce_attributes.uid = ".$uid_val_pair['AttributeUid']." and tx_commerce_articles_article_attributes_mm.uid_valuelist in (". $uid_val_pair['AttributeValue'].") )"; } $addwhere = ' AND (0 '.$addwheretmp. ') '; $result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles.uid', 'tx_commerce_articles ', 'tx_commerce_articles_article_attributes_mm', 'tx_commerce_attributes', "".$addwhere." and tx_commerce_articles.hidden = 0 and tx_commerce_articles.deleted = 0".$whereUid ); if (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0)){ while ($return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { if($first){ $first_array[] = $return_data['uid']; }else{ $next_array[] = $return_data['uid']; } } $GLOBALS['TYPO3_DB']->sql_free_result($result); } // Es sollen nur Artikel zur?ckgeliefert werden, die in allen Array's vorkommen. // Daher das Erste Array setzen und dann mit Array Intersect nur noch die ?bereinstimmungen // behalten. if($first){ $attribute_uid_list = $first_array; $first = 0; }else{ $attribute_uid_list = array_intersect($attribute_uid_list,$next_array); $next_array = array(); } } if(count($attribute_uid_list)>0){ sort($attribute_uid_list); return $attribute_uid_list; }else{ return false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_Articles_by_Attribute($attributeUid,$attributeValue){\n \t \t\n \t \treturn $this->get_Articles_by_AttributeArray(array(array('AttributeUid'=>$attributeUid,'AttributeValue'=>$attributeValue)));\n \t \t\n \t }", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function getAttributes($args)\n {\n $sql = \"\n SELECT\n agd.name as attribute_group_name,\n ad.name as attribute_name,\n pa.text AS attribute_value,\n pa.attribute_id\n\n FROM \" . DB_PREFIX . \"product_attribute AS pa\n LEFT JOIN \" . DB_PREFIX . \"attribute AS a ON pa.attribute_id = a.attribute_id\n LEFT JOIN \" . DB_PREFIX . \"attribute_description AS ad ON pa.attribute_id = ad.attribute_id\n LEFT JOIN \" . DB_PREFIX . \"attribute_group_description AS agd\n ON a.attribute_group_id = agd.attribute_group_id AND pa.language_id = agd.language_id\n\n WHERE ad.name LIKE '%\" . $args['attribute_name'] . \"%'\n AND pa.language_id = '\" . (int) $this->config->get('config_language_id') . \"'\n AND pa.text LIKE '%\" . $args['attribute_value'] . \"%' \" . $args['extra_conditons'] . \"\n\n GROUP BY pa.text\n ORDER BY ad.name, attribute_value ASC\n LIMIT 100\";\n\n $query = $this->db->query($sql);\n return $query->rows;\n }", "public function onFilterArticle(\\Enlight_Event_EventArgs $args)\n {\n $subject = $args->getSubject();\n $filterBy = $subject->Request()->getParam('filterBy');\n\n list($sqlParams, $filterSql, $categorySql, $imageSQL, $order) = $args->getReturn();\n\n if ($filterBy === 'connect') {\n $imageSQL = '\n LEFT JOIN s_plugin_connect_items as connect_items\n ON connect_items.article_id = articles.id\n ';\n\n $filterSql .= ' AND connect_items.shop_id > 0 ';\n }\n\n return [$sqlParams, $filterSql, $categorySql, $imageSQL, $order];\n }", "function getAttributeValues($filterrecord,$attribute)\n\t{\n\t\t$attributes=array();\n\t\t$attributes[0] = $attribute;\n\n\t\t// We need to search for this user in order to get their entry.\n\t\t$this->result = @ldap_search($this->connection,$this->people,$filterrecord,$attributes);\n\n\t\t// Pourquoi cette ligne ?\n\t\t//$info = ldap_get_entries($this->connection, $this->result);\n\n\t\t// Only one entry should ever be returned (no user will have the same uid)\n\t\t$entry = ldap_first_entry($this->connection, $this->result);\n\n\t\tif (!$entry)\n\t\t{\n\t\t\t$this->ldapErrorCode = -1;\n\t\t\t$this->ldapErrorText = \"Couldn't find user\";\n\t\t\treturn false; // Couldn't find the user...\n\t\t}\n\n\t\t// Get values\n\t\tif (! $values = @ldap_get_values($this->connection, $entry, $attribute))\n\t\t{\n\t\t\t$this->ldapErrorCode = ldap_errno($this->connection);\n\t\t\t$this->ldapErrorText = ldap_error($this->connection);\n\t\t\treturn false; // No matching attributes\n\t\t}\n\n\t\t// Return an array containing the attributes.\n\t\treturn $values;\n\t}", "public function getArticles()\n\t{\n\t$qb = $this ->createQueryBuilder(\"a\")\n\t\t\t\t->leftJoin('a.image','i')\n\t\t\t\t->addSelect('i')\n\n\t\t\t\t->leftJoin('a.categories','c')\n\t\t\t\t->addSelect('c')\n\n\t\t\t\t->where('a.publication = :val')\n\t\t\t\t->setParameter('val', 1)\n\n\t\t\t\t->orderBy('a.datecreation', 'DESC');\n\t$query = $qb->getQuery();\n\treturn $query->getResult();\n\t}", "function get_selectattribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\tif ($articleList==false){\n\t \t\t\t$articleList=$this->load_articles();\n\t \t\t}\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\tif(is_array($articleList) && count($articleList)>0) {\n\t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t\t\t}\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\t \t\t$addwhere = $addwhere2;\n\t\t\t\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\t \n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * only get select attributs, since we don't need any other in selectattribut Matrix and we need the arrayKeys in this case\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t\t\t\t\t$valueUidList = array();\n\t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['article'];\n\t\t\t\t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \t\t\t\t\t\t\t \n\t \t\t\t\t\t\t\t \t $valuelist[$row['uid']] = $row['value'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\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\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n\t \n\t \t\t$return_array=array();\n\t \t\t/**\n\t \t\t * if no list is given, take complate arctile-list from product\n\t \t\t */\n\t \n\t \n\t \t\tif ($this->uid>0) { \n\t \t\t\tif ($articleList==false){\n\t \t\t\t\t$articleList=$this->load_articles();\n\t \t\t\t}\n\t \n\t \t\tif (is_array($attribute_include)){\n\t \t\t\tif (!is_null($attribute_include[0])) {\n\t \t\t\t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t \t\t\t\t}\t\n\t \t\t\t}\n\t \t\t\tif(is_array($articleList) && count($articleList)>0) {\n\t \t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t \t\t\t}\n\t \n\t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t$addwhere = $addwhere2;\n\t \n\t \t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \n\t \t\t\t\t\t/** \n\t \t\t\t\t\t * Do the language overlay\n\t \t\t\t\t\t */\n\t \t\t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t \t\t\t\t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\n\t \t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\n\t \t\t\t\t\t\t\t);\n\t \n\t \n\t \t\t\t\t\t\t// Result should contain only one Dataset\n\t \t\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t \t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\tif (!is_array($return_data)){\n\t \t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t * No Translation possible, so next interation\n\t \t\t\t\t\t\t\t */\t\n\t \t\t\t\t\t\t\t\tcontinue;\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \n\t \n\t \n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$valueshown=false;\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t\t */\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t\t */\n\t \n\t \t\t\t\t\t$valuelist=array();\n\t\t\t\t\t\t$valueUidList = array();\n\t \t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t\t$article=$data['article'];\n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\t{\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t\t{\n\t \n\t \t\t\t\t\t\t\t\tif (strlen($value['value_char'])>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0)\t{\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['value_char'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t\t\t\t}else\t{\n\t \n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t} \t\t\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t{\n\t \n\t \t\t\t\t\t\t\t\tif ($value['default_value']>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0){\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif(strlen($lok_value['value_char'])>0) {\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \n\t \t\t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \n\t \t\t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t\t\t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t\t\tif (!is_array($row)){\n\t \t\t\t\t\t\t\t\t\t\tcontinue;\t\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \n\t \n\t \t\t\t\t\t\t\t\t\t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t\t $valueUidList[] = $row['uid'];\n\t \t\t\t\t\t\t\t\t\t $valueshown=true;\n\t \t\t\t\t\t\t\t\t }\n\t \n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif ($valueshown == false) {\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \n\t \t\t\t\t}\n\t \n\t \t\t\t\treturn $return_array;\n\t \t\t\t}\n\t \t\t}\n\t \t\treturn false;\n\t \n\t}", "private function fetch_filters( $atts ) {\n $filters = get_post_meta( $atts['id'], 'yali_list_filters', true);\n if( !isset($atts['taxonomy']) ) {\n return $filters;\n }\n $taxonomy = $atts['taxonomy'];\n $updatedFilters = array_filter( $filters, function($filter) use ($taxonomy) {\n return $filter !== $taxonomy;\n });\n\n return $updatedFilters;\n }", "public function getListItems()\n {\n return $this->getArticles();\n }", "protected function _getItemsData()\n {\n $isSolr = Mage::helper('layered')->isSolr();\n\n $attribute = $this->getAttributeModel();\n $this->_requestVar = $attribute->getAttributeCode();\n\n if ($isSolr) {//Enterprise_Search_Model_Catalog_Layer_Filter_Attribute\n $engine = Mage::getResourceSingleton('enterprise_search/engine');\n $fieldName = $engine->getSearchEngineFieldName($attribute, 'nav');\n\n $productCollection = $this->getLayer()->getProductCollection();\n $optionsFacetedData = $productCollection\n ->setFacetDataIsLoaded(false)\n ->getFacetedData($fieldName);\n $options = $attribute->getSource()->getAllOptions(false);\n\n $data = array();\n } else {//Mage_Catalog_Model_Layer_Filter_Attribute\n $key = $this->getLayer()->getStateKey().'_'.$this->_requestVar;\n $data = $this->getLayer()->getAggregator()->getCacheData($key);\n\n if ($data !== null) {\n return $data;\n }\n $options = $attribute->getFrontend()->getSelectOptions();\n $optionsCount = $this->_getResource()->getCount($this);\n $data = array();\n }\n\n foreach ($options as $option) {\n if ($isSolr) {\n $optionId = $option['value'];\n // Check filter type\n if ($this->_getIsFilterableAttribute($attribute) != self::OPTIONS_ONLY_WITH_RESULTS\n || !empty($optionsFacetedData[$optionId])\n ) {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['label'],\n 'count' => isset($optionsFacetedData[$optionId]) ? $optionsFacetedData[$optionId] : 0,\n 'checked' => $this->_selected($attribute->getAttributeCode(), $option['label']),\n 'link' => $this->_getLink($option['label'])\n );\n }\n } else {\n if (is_array($option['value'])) {\n continue;\n }\n //TODO:fix code above for Multiple Attributes & ~Solr\n\n if (Mage::helper('core/string')->strlen($option['value'])) {\n // Check filter type\n if ($this->_getIsFilterableAttribute($attribute) == self::OPTIONS_ONLY_WITH_RESULTS) {\n if (!empty($optionsCount[$option['value']])) {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['value'],\n 'count' => $optionsCount[$option['value']],\n 'checked' => $this->_selected($attribute->getAttributeCode(), $option['value']),\n 'link' => $this->_getLink($option['value'])\n );\n }\n } else {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['value'],\n 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,\n );\n }\n }\n }\n }\n\n if (! $isSolr) {\n $tags = array(\n Mage_Eav_Model_Entity_Attribute::CACHE_TAG.':'.$attribute->getId()\n );\n\n $data = $this->_sortArray($data);\n\n $tags = $this->getLayer()->getStateTags($tags);\n $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);\n }\n return $data;\n }", "function getArticles() \t{\n \t\treturn $this->getArticleUids();\n \t}", "abstract public function findBy($attributes, $value);", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function getArticles();", "private function getArticles() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $articles = $this->bankReg->gets($param);\n\n return $articles;\n }", "public function getListeArticles()\n {\n $rowset = $this->tableGateway->select(array('type'=> 'article'));\n return $rowset;\n }", "public function getAllActiveArticleByDeevonaute()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t\t\t->from('tdArticle td_a')\n\t\t\t\t->where('td_a.active = false')\n\t\t\t\t->leftJoin('td_a.Author a')\n\t\t\t\t->where('a.id = ?', $this->getId());\n\t\t\t\t\n\t\t// return Doctrine_Core::getTable('tdArticle')->listAllArticles($q);\n\t\treturn $q->execute();\n\t}", "public function getFilteredDetails();", "public function articles()\n\t{\n\t\treturn $this->morphedByMany(Article::class, 'taggable');\n\t}", "function catalogue_getscolarticles() {\n\tglobal $db;\n\t$a_articles = array();\n\n\t$profondeur = substr($_SESSION['catalogue']['scolratt'], 0, 1);\n\t$famId = intval(substr($_SESSION['catalogue']['scolratt'], 1));\n\n\t$db->query(\"SELECT DISTINCT(PREF) FROM dims_mod_vpc_article_rub_sc WHERE rub{$profondeur} = $famId\");\n\twhile ($row = $db->fetchrow()) {\n\t\t$a_articles[] = $row['PREF'];\n\t}\n\treturn $a_articles;\n}", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function showArticles()\n\t{\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC');\n\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\n\t\treturn $articles;\n\t}", "public function query()\n {\n $attributes = ProductAttribute::join('eav_attribute','eav_attribute.attribute_id','=','catalog_eav_attribute.attribute_id')\n ->where('is_visible','=',1)\n ->where('eav_attribute.entity_type_id','=',4);\n return $this->applyScopes($attributes);\n }", "public function getArticles()\n\t{\n\t\treturn $this->getOptionData('tl_article');\n\t}", "public function where($attribute, $value): ServerObjectCollectionInterface;", "public function findArticles() : Collection\n {\n return $this->model->articles;\n }", "public static function getArticles()\n {\n // $url = \"https://n161.tech/api/dummyapi/post?page=1&limit=100\";\n // $curl = curl_init();\n // curl_setopt($curl, CURLOPT_URL, $url);\n // curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n // $response = curl_exec($curl);\n // $array_data = json_decode($response, true);\n // curl_close($curl);\n // return $array_data;\n return Article::orderBy('updated_at', 'desc')->paginate(5);\n }", "public function allBy($attribute, $value, $columns=['*']) \n\t{\n\t\treturn $this->model->orderBy($attribute, $value)->get($columns);\n\t}", "public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }" ]
[ "0.7506486", "0.5509769", "0.5343589", "0.52791643", "0.52432144", "0.5115444", "0.51121", "0.5098559", "0.505277", "0.5046413", "0.504255", "0.50290954", "0.5028048", "0.5020222", "0.5018201", "0.49758092", "0.49597314", "0.49295214", "0.4906836", "0.49065518", "0.4898856", "0.48723522", "0.4867832", "0.4850865", "0.48406947", "0.48028192", "0.47909674", "0.47788036", "0.4745262", "0.4743818" ]
0.6089569
1
returns the list or articles from this product filtered by given AttributeUID and Attribute Value
function get_Articles_by_Attribute($attributeUid,$attributeValue){ return $this->get_Articles_by_AttributeArray(array(array('AttributeUid'=>$attributeUid,'AttributeValue'=>$attributeValue))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_Articles_by_AttributeArray($attribute_Array,$proofUid=1){\n\t\tif($proofUid){ \t \t\n\t \t \t $whereUid = ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t\t}\n \t \t$first = 1;\n\t\t// Setzen der Arrays damit array_intersect keine Fehlermeldung ausgibt\t\n\t\t$first_array = array();\n\t\t$next_array = array();\n \t \t$addwhere='';\n \t \tif (is_array($attribute_Array))\t {\n\t \t \tforeach ($attribute_Array as $uid_val_pair) \t{\n\t\t\t$addwheretmp = '';\n\t\n\t \t \t\t// attribute char wird noch nicht verwendet, dafuer muss eine Pruefung auf die ID\n\t\t \t \tif (is_string($uid_val_pair['AttributeValue']))\t \t{\n\t\t \t \t\t$addwheretmp .=\t\" OR (tx_commerce_attributes.uid = \".$uid_val_pair['AttributeUid'].\" and tx_commerce_articles_article_attributes_mm.value_char='\".\n\t\t\t\t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->quoteStr($uid_val_pair['AttributeValue'],'tx_commerce_articles_article_attributes_mm').\"' )\";\n\t\t \t \t}\n\t\t\t // Nach dem charwert immer ueberpruefen, solange value_char noch nicht drin ist.\n\t \n\t\t \t \tif (is_float($uid_val_pair['AttributeValue']) || is_integer(intval($uid_val_pair['AttributeValue'])))\t \t{\n\t\t \t \t\t$addwheretmp.=\t\" OR (tx_commerce_attributes.uid = \".$uid_val_pair['AttributeUid'].\" and tx_commerce_articles_article_attributes_mm.default_value in (\".\n\t\t\t\t\t\t\t\t\t\t$uid_val_pair['AttributeValue'].\" ) )\";\n\t\t \t \t}\n\t\t \n\t\t \t \tif (is_float($uid_val_pair['AttributeValue']) || is_integer(intval($uid_val_pair['AttributeValue']))) \t{\n\t\t \t \t\t$addwheretmp.=\t\" OR (tx_commerce_attributes.uid = \".$uid_val_pair['AttributeUid'].\" and tx_commerce_articles_article_attributes_mm.uid_valuelist in (\".\n\t\t\t\t\t\t\t\t\t\t$uid_val_pair['AttributeValue'].\") )\";\n\t\t \t \t}\n\t\t\t\t$addwhere = ' AND (0 '.$addwheretmp. ') ';\t\n\t \t \t\n \t \t\t\t\n \t \t \t \t\t\n \t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles.uid',\n \t \t\t\t\t\t\t\t'tx_commerce_articles ',\n \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\"\".$addwhere.\" and tx_commerce_articles.hidden = 0 and tx_commerce_articles.deleted = 0\".$whereUid \n\t\t\t\t\t\t\t\t);\n\t\t\t\t\n\t \t \t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0)){\n\t \t\t\t\twhile ($return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t\t\t\t\t\tif($first){\n\t\t \t\t\t\t\t$first_array[] = $return_data['uid'];\n\t \t\t\t\t\t}else{\n\t\t\t\t\t\t\t$next_array[] = $return_data['uid'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t \t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result);\n\t \t\t\t}\n\t\n\t\t\t\t// Es sollen nur Artikel zur?ckgeliefert werden, die in allen Array's vorkommen.\n\t\t\t\t// Daher das Erste Array setzen und dann mit Array Intersect nur noch die ?bereinstimmungen\n\t\t\t\t// behalten.\n\t\t\t\tif($first){\n\t\t\t\t\t$attribute_uid_list = $first_array;\n\t\t\t\t\t$first = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$attribute_uid_list = array_intersect($attribute_uid_list,$next_array);\n\t\t\t\t\t$next_array = array();\n\t\t\t\t}\n\t\t \t} \t\t\t\t\n\t \t\tif(count($attribute_uid_list)>0){\n\t \t\t\tsort($attribute_uid_list);\n\t\t\t\treturn $attribute_uid_list;\n \t\t\t}else{\n\t\t\t\treturn false;\t\t\t\n\t\t\t}\t\n\t\t}\n\t\t \t \t \t \t\n \t \t\n \t }", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "function getAttributeValues($filterrecord,$attribute)\n\t{\n\t\t$attributes=array();\n\t\t$attributes[0] = $attribute;\n\n\t\t// We need to search for this user in order to get their entry.\n\t\t$this->result = @ldap_search($this->connection,$this->people,$filterrecord,$attributes);\n\n\t\t// Pourquoi cette ligne ?\n\t\t//$info = ldap_get_entries($this->connection, $this->result);\n\n\t\t// Only one entry should ever be returned (no user will have the same uid)\n\t\t$entry = ldap_first_entry($this->connection, $this->result);\n\n\t\tif (!$entry)\n\t\t{\n\t\t\t$this->ldapErrorCode = -1;\n\t\t\t$this->ldapErrorText = \"Couldn't find user\";\n\t\t\treturn false; // Couldn't find the user...\n\t\t}\n\n\t\t// Get values\n\t\tif (! $values = @ldap_get_values($this->connection, $entry, $attribute))\n\t\t{\n\t\t\t$this->ldapErrorCode = ldap_errno($this->connection);\n\t\t\t$this->ldapErrorText = ldap_error($this->connection);\n\t\t\treturn false; // No matching attributes\n\t\t}\n\n\t\t// Return an array containing the attributes.\n\t\treturn $values;\n\t}", "public function getAttributes($args)\n {\n $sql = \"\n SELECT\n agd.name as attribute_group_name,\n ad.name as attribute_name,\n pa.text AS attribute_value,\n pa.attribute_id\n\n FROM \" . DB_PREFIX . \"product_attribute AS pa\n LEFT JOIN \" . DB_PREFIX . \"attribute AS a ON pa.attribute_id = a.attribute_id\n LEFT JOIN \" . DB_PREFIX . \"attribute_description AS ad ON pa.attribute_id = ad.attribute_id\n LEFT JOIN \" . DB_PREFIX . \"attribute_group_description AS agd\n ON a.attribute_group_id = agd.attribute_group_id AND pa.language_id = agd.language_id\n\n WHERE ad.name LIKE '%\" . $args['attribute_name'] . \"%'\n AND pa.language_id = '\" . (int) $this->config->get('config_language_id') . \"'\n AND pa.text LIKE '%\" . $args['attribute_value'] . \"%' \" . $args['extra_conditons'] . \"\n\n GROUP BY pa.text\n ORDER BY ad.name, attribute_value ASC\n LIMIT 100\";\n\n $query = $this->db->query($sql);\n return $query->rows;\n }", "protected function _getItemsData()\n {\n $isSolr = Mage::helper('layered')->isSolr();\n\n $attribute = $this->getAttributeModel();\n $this->_requestVar = $attribute->getAttributeCode();\n\n if ($isSolr) {//Enterprise_Search_Model_Catalog_Layer_Filter_Attribute\n $engine = Mage::getResourceSingleton('enterprise_search/engine');\n $fieldName = $engine->getSearchEngineFieldName($attribute, 'nav');\n\n $productCollection = $this->getLayer()->getProductCollection();\n $optionsFacetedData = $productCollection\n ->setFacetDataIsLoaded(false)\n ->getFacetedData($fieldName);\n $options = $attribute->getSource()->getAllOptions(false);\n\n $data = array();\n } else {//Mage_Catalog_Model_Layer_Filter_Attribute\n $key = $this->getLayer()->getStateKey().'_'.$this->_requestVar;\n $data = $this->getLayer()->getAggregator()->getCacheData($key);\n\n if ($data !== null) {\n return $data;\n }\n $options = $attribute->getFrontend()->getSelectOptions();\n $optionsCount = $this->_getResource()->getCount($this);\n $data = array();\n }\n\n foreach ($options as $option) {\n if ($isSolr) {\n $optionId = $option['value'];\n // Check filter type\n if ($this->_getIsFilterableAttribute($attribute) != self::OPTIONS_ONLY_WITH_RESULTS\n || !empty($optionsFacetedData[$optionId])\n ) {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['label'],\n 'count' => isset($optionsFacetedData[$optionId]) ? $optionsFacetedData[$optionId] : 0,\n 'checked' => $this->_selected($attribute->getAttributeCode(), $option['label']),\n 'link' => $this->_getLink($option['label'])\n );\n }\n } else {\n if (is_array($option['value'])) {\n continue;\n }\n //TODO:fix code above for Multiple Attributes & ~Solr\n\n if (Mage::helper('core/string')->strlen($option['value'])) {\n // Check filter type\n if ($this->_getIsFilterableAttribute($attribute) == self::OPTIONS_ONLY_WITH_RESULTS) {\n if (!empty($optionsCount[$option['value']])) {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['value'],\n 'count' => $optionsCount[$option['value']],\n 'checked' => $this->_selected($attribute->getAttributeCode(), $option['value']),\n 'link' => $this->_getLink($option['value'])\n );\n }\n } else {\n $data[] = array(\n 'label' => $option['label'],\n 'value' => $option['value'],\n 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,\n );\n }\n }\n }\n }\n\n if (! $isSolr) {\n $tags = array(\n Mage_Eav_Model_Entity_Attribute::CACHE_TAG.':'.$attribute->getId()\n );\n\n $data = $this->_sortArray($data);\n\n $tags = $this->getLayer()->getStateTags($tags);\n $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);\n }\n return $data;\n }", "abstract public function findBy($attributes, $value);", "public function query()\n {\n $attributes = ProductAttribute::join('eav_attribute','eav_attribute.attribute_id','=','catalog_eav_attribute.attribute_id')\n ->where('is_visible','=',1)\n ->where('eav_attribute.entity_type_id','=',4);\n return $this->applyScopes($attributes);\n }", "protected function _getSearchableAttributes()\n {\n if (is_null($this->_searchableAttributes)) {\n /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */\n $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');\n $attributeCollection->addIsSearchableFilter();\n foreach ($attributeCollection as $attribute) {\n $this->_searchableAttributes[] = $attribute->getAttributeCode();\n }\n }\n return $this->_searchableAttributes;\n }", "function _getTagValueFromAttributeList($tag)\n {\n global $application;\n\n /*\n Search the specified tag in the list of attributes\n search by the field a_view_tag\n */\n foreach ($this->_fProductAttributesInfo as $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == strtolower($tag) )\n {\n /*\n First check if the attribute is visible in the product type,\n if it is not, output an empty string\n */\n if ( $attribute['a_visibility'] != 1 )\n {\n if ( strtoupper($attribute['a_input_type_name']) == 'SELECT' )\n {\n /*\n : Magic Number Present\n Number 3 means in this case, that the value of this attribute\n should be selected from the table input_type_values\n */\n if (($attribute['a_input_type_id'] == 3 ||\n $attribute['a_input_type_id'] == 7))\n {\n if(!$this->localized and !in_array('select',$this->_force_localize_attr_types))\n {\n switch($attribute['a_input_type_id'])\n {\n case \"3\":\n return PRODUCT_FREESHIPPING_YES;\n break;\n case \"7\":\n return PRODUCT_STATUS_ONLINE;\n break;\n }\n }\n else\n {\n switch($attribute['a_input_type_id'])\n {\n case \"3\":\n return getMsg('SYS','PRDTYPE_VALUE_YES');\n break;\n case \"7\":\n return getMsg('SYS','PRDTYPE_VALUE_STATUS_ONLINE');\n break;\n }\n }\n }\n /*\n : Magic Number Present\n Number 6 means here, that the value of this attribute\n should be selected from the module Taxes\n */\n elseif ($attribute['a_input_type_id'] == 6)\n {\n return 0.0;\n }\n /*\n : Magic Number Present\n Number 9 means here, that the value of this attribute\n should be selected from customer reviews\n */\n elseif ($attribute['a_input_type_id'] == 9)\n {\n return '';\n }\n else\n {\n return $this->debugmode ? 'Attribute is SELECT type, but the value is NULL or undefined in the database' : '';\n }\n }\n else\n {\n return $this->debugmode ? 'Attribute is hidden in the product type: '.$tag : '';\n }\n }\n\n /*\n If it is an attribute of SELECT type, then its value\n should be procesed differently\n - finish the processing. The code is commented because,\n the current value for the SELECT type attributes is saved to $attribute['pa_value']\n and it will be got then by algorithm. Besides, id values are saved too, i.e.\n get a real value from this id .\n */\n if ( strtoupper($attribute['a_input_type_name']) == 'SELECT' )\n {\n /*\n : Magic Number Present\n Number 3 means in this case, that the value of this attribute\n should be selected from the table input_type_values\n */\n if (($attribute['a_input_type_id'] == 3 ||\n $attribute['a_input_type_id'] == 7 ||\n $attribute['a_input_type_id'] == 9 ||\n $attribute['a_input_type_id'] == CTLG_INPUT_TYPE_MANUFACTURER)\n && $attribute['pa_value'])\n {\n if(!$this->localized and !in_array('select',$this->_force_localize_attr_types))\n {\n return $attribute['pa_value'];\n }\n else\n {\n $params = array('a_input_type_id'=>$attribute['a_input_type_id'],\n 'pa_value'=>$attribute['pa_value']);\n $r = execQuery('SELECT_INPUT_TYPE_VALUES_BY_ATTRIBUTE',$params);\n if (count($r) == 0)\n return '';\n return modApiFunc('Catalog', 'getInputTypeActualValue', $r[0]['value']);\n }\n\n }\n // , ProductType Available Invisible,\n // ,\n // Available (Visible).\n // . select' 3 7. (FreeShipping Available)\n // AZ ProdList\n elseif (($attribute['a_input_type_id'] == 3 ||\n $attribute['a_input_type_id'] == 7 ||\n $attribute['a_input_type_id'] == CTLG_INPUT_TYPE_MANUFACTURER) &&\n !$attribute['pa_value'])\n {\n if(!$this->localized)\n {\n switch($attribute['a_input_type_id'])\n {\n case \"3\":\n return PRODUCT_FREESHIPPING_YES;\n break;\n case \"7\":\n return PRODUCT_STATUS_ONLINE;\n break;\n case \"\". CTLG_INPUT_TYPE_MANUFACTURER:\n \treturn MANUFACTURER_NOT_DEFINED;\n \tbreak;\n }\n }\n else\n {\n switch($attribute['a_input_type_id'])\n {\n case \"3\":\n return getMsg('SYS','PRDTYPE_VALUE_YES');\n break;\n case \"7\":\n return getMsg('SYS','PRDTYPE_VALUE_STATUS_ONLINE');\n break;\n case \"\". CTLG_INPUT_TYPE_MANUFACTURER:\n return getMsg('MNF', 'MANUFACTURER_NOT_DEFINED');\n break;\n }\n }\n }\n /*\n : Magic Number Present\n Number 6 means here, that the value of this attribute\n should be selected from the module Taxes\n */\n elseif ($attribute['a_input_type_id'] == 6 && $attribute['pa_value'])\n {\n $tax_class_info = modApiFunc('Taxes','getProductTaxClassInfo', $attribute['pa_value']);\n return $tax_class_info['value'];\n }\n /*\n : Magic Number Present\n Number 9 means here, that the value of this attribute\n should be selected from customer reviews\n */\n elseif ($attribute['a_input_type_id'] == 9 && $attribute['pa_value'])\n {\n switch($attribute['pa_value'])\n {\n case PRODUCT_CUSTOMER_REVIEWS_MESSAGE_RATE:\n return getMsg('SYS', 'PRDTYPE_VALUE_REVIEW_RATE');\n break;\n case PRODUCT_CUSTOMER_REVIEWS_MESSAGE:\n return getMsg('SYS', 'PRDTYPE_VALUE_REVIEW');\n break;\n case PRODUCT_CUSTOMER_REVIEWS_RATE:\n return getMsg('SYS', 'PRDTYPE_VALUE_RATE');\n break;\n case PRODUCT_CUSTOMER_REVIEWS_NOREVIEW:\n return getMsg('SYS', 'PRDTYPE_VALUE_NOREVIEW');\n break;\n }\n }\n else\n {\n $params = array('a_input_type_id'=>$attribute['a_input_type_id'], 'pa_value'=>$attribute['pa_value']);\n $r = execQuery('SELECT_INPUT_TYPE_VALUES_BY_ATTRIBUTE',$params);\n if (count($r) == 0)\n {\n return $this->debugmode ? 'Attribute is SELECT type, but the value is NULL or undefined in the database' : '';\n }\n return modApiFunc('Catalog', 'getInputTypeActualValue', $r[0]['value']);\n }\n\n }\n\n /*\n IMAGE,\n :\n HTML <IMG>\n */\n if ( strtoupper($attribute['a_input_type_name']) == 'IMAGE' )\n {\n $imagesUrl = $application->getAppIni('URL_IMAGES_DIR');\n if ($application->getCurrentProtocol() == \"https\" && $application->getAppIni('HTTPS_URL_IMAGES_DIR'))\n {\n $imagesUrl = $application->getAppIni('HTTPS_URL_IMAGES_DIR');\n }\n $_src = $imagesUrl.$attribute['image_name'];\n $_width = $attribute['image_width'];\n $_height = $attribute['image_height'];\n $_alt = prepareHTMLDisplay($this->_getTagValueFromAttributeList('ImageAltText'));\n\n if ($attribute['image_name'] != null && $application->isImageFileValid($attribute['image_name']) )\n {\n $_res = 'img src=\"'.$_src.'\" height=\"'.$_height.'\" width=\"'.$_width.'\" alt=\"'.$_alt.'\"';\n return $this->debugmode ? '['.$_res.']' : '<'.$_res.'/>';\n }\n else\n {\n return $this->debugmode ? 'Image Does Not Exist' : '';\n }\n }\n\n # If the tag value is specified, then process it\n if (!($attribute['pa_value'] === NULL))\n {\n /*\n If the output of pure HTML code is inhibited\n and the localization is turned on\n */\n if ($attribute['a_allow_html'] != 1 && $this->localized)\n {\n $_val = modApiFunc(\"Localization\", \"format\", $attribute['pa_value'], $attribute['a_unit_type']);\n\n /*\n change\n Localization::format() itself should substitute a unit\n */\n global $__localization_disable_formatting__;\n if ($attribute['a_unit_type']!='currency' && $__localization_disable_formatting__ == false)\n {\n $_val .= rtrim(' '.modApiFunc(\"Localization\", \"getUnitTypeValue\", $attribute['a_unit_type']));\n //patch to allow single unicode character as currency symbol\n $_val = prepareHTMLDisplay($_val);\n }\n\n return $_val;\n }\n # Otherwise output the attribute value as is\n else\n {\n return $attribute['pa_value'];\n }\n }\n # If the tag value is undefined, return an empty string\n else\n {\n return $this->debugmode ? 'Tag value is NULL or undefined: '.$tag : '';\n }\n\n # Finish the cycle\n break;\n }\n }\n\n /*\n If the attribute with the specified tag is not found, return an empty\n string, i.e. the tag will output null\n */\n return $this->debugmode ? 'Tag Value Not Found: '.$tag : null;\n }", "protected function _getSearchableAttributes()\n {\n if (is_null($this->_searchableAttributes)) {\n /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */\n $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');\n $attributeCollection->addIsSearchableFilter();\n\n foreach ($attributeCollection as $attribute) {\n $this->_searchableAttributes[] = $attribute->getAttributeCode();\n }\n }\n\n return $this->_searchableAttributes;\n }", "public function where($attribute, $value): ServerObjectCollectionInterface;", "private function fetch_filters( $atts ) {\n $filters = get_post_meta( $atts['id'], 'yali_list_filters', true);\n if( !isset($atts['taxonomy']) ) {\n return $filters;\n }\n $taxonomy = $atts['taxonomy'];\n $updatedFilters = array_filter( $filters, function($filter) use ($taxonomy) {\n return $filter !== $taxonomy;\n });\n\n return $updatedFilters;\n }", "function getAttributes( $itemId ) {\r\n\tglobal $db, $site;\r\n\t$sql = \r\n\t\t'SELECT '.\r\n\t\t'a.id as id, v.id as v_id, a.name, a.type, if (v.use_default, a._default, v.value) as value '.\r\n\t\t'FROM '.ATTRIBUTES_TABLE.\" a \".\r\n\t\t'LEFT JOIN '. ATTRVALUES_TABLE.\" v on a.id=v.attr_id and v.product_id='$itemId' \".\r\n\t\t\"WHERE a.visible=1 and v.product_id='$itemId' and v.site_key='$site'\";\r\n\t\r\n\t$attributes = $db->getAll( $sql );\r\n\t\r\n\t$out = array();\r\n\t\r\n\tif ( $attributes )\r\n\tforeach ( $attributes as $idx=>$item ) {\r\n\t\t$out[$item['id']] = $item;\r\n\t\tif ( preg_match( '/^list/', $item['type'] ) ) {\r\n\t\t\t$v = @unserialize( $item['value'] );\r\n\t\t\t$out[$item['id']]['value'] = $v[0];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $out;\r\n}", "public function passes($attribute, $value)\n {\n return is_null(Product::where([\n ['codigo', $value],\n ['id', '<>', $this->except]\n ])->first());\n }", "public function getProductFilter(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n $result = [];\n \n // Collection/products with last filter group removed\n $prevCollection = $this->getPreviousCollection($searchCriteria);\n $prevProducts = $prevCollection->getItems();\n \n // Get the last filter option\n $lastFilter = $this->filterHelper->getLastFilter($searchCriteria);\n \n // Build product collection with search criteria\n $collection = $this->productHelper->buildCollection($searchCriteria);\n $collection->load();\n $collection->addCategoryIds()->addMinimalPrice();\n $products = $collection->getItems();\n \n // Loop through the list of defined filters\n foreach ($this->filterableList AS $filter) \n {\n $attribute = new Attribute();\n $attribute->setHandle($filter->handle);\n $attribute->setName($filter->name);\n if (isset($filter->condition)) $attribute->setCondition($filter->condition);\n \n switch($filter->type) {\n case 'category':\n $parent = $this->getParentFilter($filter);\n $attribute->setField('category_id');\n $attribute->setType('list');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseCategoryFilter($filter, $products, $parent, $this->productHelper->getFiltersByField($searchCriteria, 'category_id')));\n break;\n \n case 'attribute':\n $attribute->setField($filter->id);\n $attribute->setType('list');\n $attribute->setLogicalAnd($filter->logicalAnd ?? false);\n $isLast = $this->filterBehaviour == 'multiple' && $filter->handle == $lastFilter->getField();\n $attributeProducts = $isLast ? $prevProducts : $products;\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseAttributeFilter($filter, $attributeProducts), $isLast);\n break;\n \n case 'price':\n $attribute->setField('price');\n $attribute->setType('slider');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parsePriceFilter($collection));\n break;\n }\n \n // No values? Then lets not show this attribute\n if (count($attribute->getValues()) == 0) continue;\n \n $result[$filter->handle] = $attribute;\n }\n \n return $result;\n }", "protected function _getItemsData()\n {\n if ($this->_filterItems === null) {\n $attribute = $this->getAttributeModel();\n $this->_requestVar = 'filter' . $attribute->getAttributeCode();\n\n $options = $attribute->getItems();\n $this->_filterItems = array();\n if (is_array($options)) {\n foreach ($options as $option) {\n if ($option['selected'] == true) {\n $this->_selectedFilterItems[$attribute->getAttributeCode()][] = $option;\n continue;\n }\n\n $this->_filterItems[] = $option;\n }\n }\n }\n\n return $this->_filterItems;\n }", "function get_selectattribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\tif ($articleList==false){\n\t \t\t\t$articleList=$this->load_articles();\n\t \t\t}\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\tif(is_array($articleList) && count($articleList)>0) {\n\t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t\t\t}\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\t \t\t$addwhere = $addwhere2;\n\t\t\t\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\t \n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * only get select attributs, since we don't need any other in selectattribut Matrix and we need the arrayKeys in this case\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t\t\t\t\t$valueUidList = array();\n\t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['article'];\n\t\t\t\t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \t\t\t\t\t\t\t \n\t \t\t\t\t\t\t\t \t $valuelist[$row['uid']] = $row['value'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\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\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "function get_product_attribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm')\n \t{\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\t\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_products.uid as product ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' '.$addwhere.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\n\t \t\t\t\t\t\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_products_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t \t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['product'];\n\t \t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.default_value, tx_commerce_products.uid product_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif (strlen($value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\tif ($this->lang_uid>0)\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t */\n\t \t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_products',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_products_attributes_mm.default_value',\n\t\t\t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm, tx_commerce_products, tx_commerce_attributes',\n\t\t\t\t\t\t\t\t\t\t\"tx_commerce_products_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products_attributes_mm.uid_local=tx_commerce_products.uid and tx_commerce_products.sys_language_uid=\".$this->lang_uid.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products.uid>0 and tx_commerce_products.l18n_parent=\".$value['product_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t} \t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\"\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist'])\n\t \t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\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\t \t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t $valueUidList[] = $value['uid_valuelist'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==false){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' =>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\n\t \t\t\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function getFilteredDetails();", "private function get_filterItem( $uid, $value )\n {\n static $loop = array();\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( !isset( $loop[ $this->curr_tableField ] ) )\n {\n $loop[ $this->curr_tableField ] = 0;\n }\n else\n {\n $loop[ $this->curr_tableField ] ++;\n }\n\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n }\n\n // Get TS configuration of the current filter / tableField\n $conf_name = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field ];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Make a backup\n $cObjDataBak = $this->pObj->cObj->data;\n // Add elements of current row to cObj->data\n $this->cObjData_updateRow( $uid );\n\n $this->set_markerArrayUpdateRow( $uid );\n\n // IF first_item, set the first item tree view\n if ( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] )\n {\n $this->set_firstItemTreeView();\n }\n // IF first_item, set the first item tree view\n // DEVELOPMENT: Browser engine 4.x\n switch ( $this->pObj->dev_browserEngine )\n {\n case( 3 ):\n // stdWrap the current value\n $item = $this->get_filterItemValueStdWrap( $conf_name, $conf_array, $uid, $value );\n break;\n case( 4 ):\n // #i0112, 141218, dwildt, 1+\n case( 5 ):\n // Wrap the current value by the cObject\n $this->updateWizard( 'filter_cObject' );\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 1' );\n }\n $item = $this->get_filterItemCObj( $uid, $value );\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 2' );\n }\n break;\n default:\n $header = 'FATAL ERROR!';\n $text = 'Sorry, this error shouldn\\'t occure: case is undefined.';\n $this->pObj->drs_die( $header, $text );\n break;\n }\n // DEVELOPMENT: Browser engine 4.x\n\n\n $this->set_itemCurrentNumber();\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, '### 3' );\n }\n\n // Reset cObj->data\n $this->pObj->cObj->data = $cObjDataBak;\n\n if ( $loop[ $this->curr_tableField ] < 2 )\n {\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n }\n return $item;\n }", "public function getActiveAttributesList($attributes_group_id){\n\t\ttry {\n\t\t\tparent::SetDatabaseConnection();\t\t\n\t\t\t//$query = \"call SPattributesetslistactive()\";\n\t\t\t$query = \"SELECT * FROM store_products_attributes pa where statusid=1 AND pa.attribute_id NOT IN (SELECT\n\t\t\t\t\t\tps.attribute_id\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\tstore_products_attributes_groups pag,\n\t\t\t\t\t\tstore_products_attributes_sets pas,\n\t\t\t\t\t\tstore_products_attributes_sets_mapping asm,\n\t\t\t\t\t\tstore_products_attributes ps\n\t\t\t\t\t\twhere\n\t\t\t\t\t\tasm.attributes_set_id = pas.attributes_set_id\n\t\t\t\t\t\tAND asm.attribute_id = ps.attribute_id\n\t\t\t\t\t\tAND pag.attributes_group_id = pas.attributes_group_id\n\t\t\t\t\t\tAND pag.attributes_group_id=\".$attributes_group_id.\"\n\t\t\t\t\t\tORDER BY pas.attributes_set_title ASC);\";\n\t\t\t//exit;\n\t\t\treturn Application_Model_Db::getResult($query);\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "function getUserAttributes( $userid, $frontend = false )\n\t{\n\t\t$success = false;\n\t\t$database = PhplistHelperPhplist::getDBO();\n\t\t$tablename_attributes = PhplistHelperAttribute::getTableName();\n\t\t$tablename_userattributes = PhplistHelperAttribute::getTableName_userattributes();\n\t\tPhplist::load( 'PhplistQuery', 'library.query' );\n\t\tJTable::addIncludePath( JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_phplist' . DS . 'tables' );\n\t\t\n\t\t$query = new PhplistQuery( );\n\t\t$query->select( \"*\" );\n\t\t$query->from( $tablename_userattributes . \" AS tbl\" );\t\t\n\t\t$query->join( 'LEFT', $tablename_attributes.' AS attribs ON tbl.attributeid = attribs.id' );\n\t\t$query->where( 'tbl.userid = '.$userid );\n\t\t\n\t\tif ($frontend)\n\t\t{\n\t\t\t\n\t\t\t// get csv of front end attribute id's from config\n\t\t\t$config = Phplist::getInstance();\n\t\t\t$frontendAttribs = $config->get( 'frontend_attribs', '1' );\n\t\t\tif ($frontendAttribs != '' && $frontendAttribs != '0')\n\t\t\t{\n\t\t\t\t$query->where( \"attribs.id IN (\" . $frontendAttribs .\")\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t$database->setQuery( ( string ) $query );\n\t\t$data = $database->loadObjectList();\n\t\t$success = $data;\n\t\t\n\t\treturn $success;\n\t}", "function GetAttributeDeatilValueDetail($filter=false,$filter2)\n\t{\n\t\t$query=$this->db->query(\"select rp_attribute_details.attrName,rp_property_attribute_value_details.attrDetValue from rp_attribute_details,rp_property_attribute_value_details where rp_attribute_details.attributeID='$filter' and rp_attribute_details.languageID=1 and rp_property_attribute_value_details.attrValueID='$filter2' and rp_property_attribute_value_details.languageID=1\");\n\t\treturn $query->result();\n\t}", "public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }", "function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n\t \n\t \t\t$return_array=array();\n\t \t\t/**\n\t \t\t * if no list is given, take complate arctile-list from product\n\t \t\t */\n\t \n\t \n\t \t\tif ($this->uid>0) { \n\t \t\t\tif ($articleList==false){\n\t \t\t\t\t$articleList=$this->load_articles();\n\t \t\t\t}\n\t \n\t \t\tif (is_array($attribute_include)){\n\t \t\t\tif (!is_null($attribute_include[0])) {\n\t \t\t\t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t \t\t\t\t}\t\n\t \t\t\t}\n\t \t\t\tif(is_array($articleList) && count($articleList)>0) {\n\t \t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t \t\t\t}\n\t \n\t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t$addwhere = $addwhere2;\n\t \n\t \t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \n\t \t\t\t\t\t/** \n\t \t\t\t\t\t * Do the language overlay\n\t \t\t\t\t\t */\n\t \t\t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t \t\t\t\t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\n\t \t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\n\t \t\t\t\t\t\t\t);\n\t \n\t \n\t \t\t\t\t\t\t// Result should contain only one Dataset\n\t \t\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t \t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\tif (!is_array($return_data)){\n\t \t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t * No Translation possible, so next interation\n\t \t\t\t\t\t\t\t */\t\n\t \t\t\t\t\t\t\t\tcontinue;\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \n\t \n\t \n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$valueshown=false;\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t\t */\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t\t */\n\t \n\t \t\t\t\t\t$valuelist=array();\n\t\t\t\t\t\t$valueUidList = array();\n\t \t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t\t$article=$data['article'];\n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\t{\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t\t{\n\t \n\t \t\t\t\t\t\t\t\tif (strlen($value['value_char'])>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0)\t{\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['value_char'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t\t\t\t}else\t{\n\t \n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t} \t\t\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t{\n\t \n\t \t\t\t\t\t\t\t\tif ($value['default_value']>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0){\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif(strlen($lok_value['value_char'])>0) {\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \n\t \t\t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \n\t \t\t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t\t\t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t\t\tif (!is_array($row)){\n\t \t\t\t\t\t\t\t\t\t\tcontinue;\t\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \n\t \n\t \t\t\t\t\t\t\t\t\t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t\t $valueUidList[] = $row['uid'];\n\t \t\t\t\t\t\t\t\t\t $valueshown=true;\n\t \t\t\t\t\t\t\t\t }\n\t \n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif ($valueshown == false) {\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \n\t \t\t\t\t}\n\t \n\t \t\t\t\treturn $return_array;\n\t \t\t\t}\n\t \t\t}\n\t \t\treturn false;\n\t \n\t}", "public function getAttributesToShow($_product , $groupsToSearch) {\r\n $product = Mage::getModel('catalog/product')->load($_product->getId());\r\n $attributeSetId = $product->getAttributeSetId();\r\n\r\n $attributeGroup = Mage::getModel('eav/entity_attribute_group')\r\n ->getResourceCollection()\r\n ->setAttributeSetFilter($attributeSetId)\r\n ->setSortOrder()\r\n ->load();\r\n\r\n foreach ($attributeGroup as $group) {\r\n if (in_array($group->getAttributeGroupName(),$groupsToSearch)) {\r\n $attributes = Mage::getResourceModel('catalog/product_attribute_collection')\r\n ->setAttributeGroupFilter($group->getId())\r\n ->addVisibleFilter()\r\n ->checkConfigurableProducts()\r\n ->load();\r\n\r\n return $this->getAttributesFromGroup($attributes, $product);\r\n }\r\n }\r\n }", "function get_by_key($withSetAttributeValue=FALSE) {\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$query = $this->hr->query($sql, array($this->amph_id));\n\t\tif ( $withSetAttributeValue ) {\n\t\t\t$this->row2attribute( $query->row() );\n\t\t} else {\n\t\t\treturn $query ;\n\t\t}\n\t}", "function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0, $attributeAsArray=array())\n\t{\n\t\t$fulllist=array();\n\n\t\tdol_syslog(get_class($this).\"::getRecords search=\".$search.\" userDn=\".$userDn.\" useridentifier=\".$useridentifier.\" attributeArray=array(\".join(',',$attributeArray).\")\");\n\n\t\t// if the directory is AD, then bind first with the search user first\n\t\tif ($this->serverType == \"activedirectory\")\n\t\t{\n\t\t\t$this->bindauth($this->searchUser, $this->searchPassword);\n\t\t\tdol_syslog(get_class($this).\"::bindauth serverType=activedirectory searchUser=\".$this->searchUser);\n\t\t}\n\n\t\t// Define filter\n\t\tif ($activefilter == 1)\n\t\t{\n\t\t\tif ($this->filter)\n\t\t\t{\n\t\t\t\t$filter = '('.$this->filter.')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$filter='('.$useridentifier.'=*)';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$filter = '('.$useridentifier.'='.$search.')';\n\t\t}\n\n\t\tif (is_array($attributeArray))\n\t\t{\n\t\t\t// Return list with required fields\n\t\t\t$attributeArray=array_values($attributeArray);\t// This is to force to have index reordered from 0 (not make ldap_search fails)\n\t\t\tdol_syslog(get_class($this).\"::getRecords connection=\".$this->connection.\" userDn=\".$userDn.\" filter=\".$filter. \" attributeArray=(\".join(',',$attributeArray).\")\");\n\t\t\t//var_dump($attributeArray);\n\t\t\t$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Return list with fields selected by default\n\t\t\tdol_syslog(get_class($this).\"::getRecords connection=\".$this->connection.\" userDn=\".$userDn.\" filter=\".$filter);\n\t\t\t$this->result = @ldap_search($this->connection, $userDn, $filter);\n\t\t}\n\t\tif (!$this->result)\n\t\t{\n\t\t\t$this->error = 'LDAP search failed: '.ldap_errno($this->connection).\" \".ldap_error($this->connection);\n\t\t\treturn -1;\n\t\t}\n\n\t\t$info = @ldap_get_entries($this->connection, $this->result);\n\n\t\t// Warning: Dans info, les noms d'attributs sont en minuscule meme si passe\n\t\t// a ldap_search en majuscule !!!\n\t\t//print_r($info);\n\n\t\tfor ($i = 0; $i < $info[\"count\"]; $i++)\n\t\t{\n\t\t\t$recordid=$this->convToOutputCharset($info[$i][$useridentifier][0],$this->ldapcharset);\n\t\t\tif ($recordid)\n\t\t\t{\n\t\t\t\t//print \"Found record with key $useridentifier=\".$recordid.\"<br>\\n\";\n\t\t\t\t$fulllist[$recordid][$useridentifier]=$recordid;\n\n\t\t\t\t// Add to the array for each attribute in my list\n\t\t\t\t$num = count($attributeArray);\n\t\t\t\tfor ($j = 0; $j < $num; $j++)\n\t\t\t\t{\n\t\t\t\t\t$keyattributelower=strtolower($attributeArray[$j]);\n\t\t\t\t\t//print \" Param \".$attributeArray[$j].\"=\".$info[$i][$keyattributelower][0].\"<br>\\n\";\n\n\t\t\t\t\t//permet de recuperer le SID avec Active Directory\n\t\t\t\t\tif ($this->serverType == \"activedirectory\" && $keyattributelower == \"objectsid\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectsid = $this->getObjectSid($recordid);\n\t\t\t\t\t\t$fulllist[$recordid][$attributeArray[$j]] = $objectsid;\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(in_array($attributeArray[$j], $attributeAsArray) && is_array($info[$i][$keyattributelower])) {\n\t\t\t\t\t\t\t$valueTab = array();\n\t\t\t\t\t\t\tforeach($info[$i][$keyattributelower] as $key => $value) {\n\t\t\t\t\t\t\t\t$valueTab[$key] = $this->convToOutputCharset($value,$this->ldapcharset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$fulllist[$recordid][$attributeArray[$j]] = $valueTab;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$fulllist[$recordid][$attributeArray[$j]] = $this->convToOutputCharset($info[$i][$keyattributelower][0],$this->ldapcharset);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasort($fulllist);\n\t\treturn $fulllist;\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('attributeID',$this->attributeID);\r\n\t\t$criteria->compare('attributeName',$this->attributeName,true);\r\n\t\t$criteria->compare('description',$this->description,true);\r\n\t\t$criteria->compare('iconID',$this->iconID);\r\n\t\t$criteria->compare('defaultValue',$this->defaultValue);\r\n\t\t$criteria->compare('published',$this->published);\r\n\t\t$criteria->compare('displayName',$this->displayName,true);\r\n\t\t$criteria->compare('unitID',$this->unitID);\r\n\t\t$criteria->compare('stackable',$this->stackable);\r\n\t\t$criteria->compare('highIsGood',$this->highIsGood);\r\n\t\t$criteria->compare('categoryID',$this->categoryID);\r\n\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}" ]
[ "0.6229908", "0.5963848", "0.59376323", "0.58977515", "0.56653094", "0.5633743", "0.5505575", "0.55023515", "0.54793227", "0.5447739", "0.5391966", "0.53627306", "0.5352033", "0.53370327", "0.5314385", "0.53088987", "0.5283806", "0.52602047", "0.52468663", "0.52354735", "0.5230723", "0.5226755", "0.5222359", "0.5208825", "0.5170742", "0.51703906", "0.5146007", "0.5123333", "0.5119015", "0.50946355" ]
0.7741283
0
Generates a Matrix fro these concerning artciles for all Attributes and the values therfor Realy complex array, so have a lokk at the source
function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){ $return_array=array(); /** * if no list is given, take complate arctile-list from product */ if ($this->uid>0) { if ($articleList==false){ $articleList=$this->load_articles(); } if (is_array($attribute_include)){ if (!is_null($attribute_include[0])) { $addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')'; } } if(is_array($articleList) && count($articleList)>0) { $query_article_list= implode(',',$articleList); $addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')'; } $result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting', 'tx_commerce_articles', 'tx_commerce_articles_article_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting' ); $addwhere = $addwhere2; if (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0)) { while ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { /** * Do the language overlay */ if ($this->lang_uid>0) { if(is_object($GLOBALS['TSFE']->sys_page)){ $proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords); } $result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_commerce_attributes', 'uid = '.$data['uid'].' '.$proofSQL ); // Result should contain only one Dataset if ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1) { $return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2); $GLOBALS['TYPO3_DB']->sql_free_result($result2); $return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode); if (!is_array($return_data)){ /** * No Translation possible, so next interation */ continue; } } $data['title']=$return_data['title']; $data['unit']=$return_data['unit']; $data['internal_title']=$return_data['internal_title']; } $valueshown=false; /** * get the different possible values form value_char an value */ /** * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm * @author Ingo Schmitt <[email protected]> */ $valuelist=array(); $valueUidList = array(); $attribute_uid=$data['uid']; $article=$data['article']; $result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid', 'tx_commerce_articles', 'tx_commerce_articles_article_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere ); if (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)) { while ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)) { if (strlen($value['value_char'])>0) { if ($this->lang_uid>0) { /** * Do the lokalization */ $proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords); $proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords); $res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value', 'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes', "tx_commerce_articles_article_attributes_mm.uid_foreign=".$value['attribute_uid']. " and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=".$this->lang_uid. " and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=".$value['article_uid']. " ".$proofSQL_attributes.$proofSQL_articles ); if (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) { while ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){ if (strlen($lok_value['value_char'])>0){ $valuelist[]=$lok_value['value_char']; $valueshown=true; }elseif (strlen($lok_value['default_value'])>0){ $valuelist[]=$lok_value['default_value']; $valueshown=true; } } } }else { $valuelist[]=$value['value_char']; $valueshown=true; } } } } $result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ', 'tx_commerce_articles', 'tx_commerce_articles_article_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_articles.uid_product = '.$this->uid." AND tx_commerce_attributes.uid=$attribute_uid".$addwhere ); if (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){ while ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)) { if ($value['default_value']>0) { if ($this->lang_uid>0){ /** * Do the lokalization */ $proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords); $proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords); $res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char', 'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes', "tx_commerce_articles_article_attributes_mm.uid_foreign=".$value['attribute_uid']. " and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=".$this->lang_uid. " and tx_commerce_articles.l18n_parent=".$value['article_uid']. " ".$proofSQL_attributes.$proofSQL_articles ); if (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) { while ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){ if (strlen($lok_value['default_value'])>0){ $valuelist[]=$lok_value['default_value']; $valueshown=true; }elseif(strlen($lok_value['value_char'])>0) { $valuelist[]=$lok_value['value_char']; $valueshown=true; } } } }else { $valuelist[]=$value['default_value']; $valueshown=true; } } } } $result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ', 'tx_commerce_articles', 'tx_commerce_articles_article_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid." AND tx_commerce_attributes.uid=$attribute_uid".$addwhere ); if (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){ while ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){ if ($value['uid_valuelist']>0){ $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']); $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue); if ($this->lang_uid>0) { $row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode); if (!is_array($row)){ continue; } } if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){ $valuelist[] = $row['value']; $valueUidList[] = $row['uid']; $valueshown=true; } } } } if ($valueshown == false) { $return_array[$attribute_uid]=array('title' => $data['title'], 'unit' => $data['unit'], 'values' => array(), 'valueuidlist' => array(), 'valueformat' => $data['valueformat'], 'Internal_title' => $data['internal_title'], 'icon' => $data['icon'] ); } if ($valueshown==true){ $return_array[$attribute_uid]=array('title' => $data['title'], 'unit' => $data['unit'], 'values' => $valuelist, 'valueuidlist' => $valueUidList, 'valueformat' => $data['valueformat'], 'Internal_title' => $data['internal_title'], 'icon' => $data['icon'] ); } } return $return_array; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_calculation_array_matrix(){\n\t\t/*\n\t\t* Public and private sets of date for more complex frontend managament\n\t\t*/\n\t\t$calculation_array_matrix = array(\n\t\t\t\"public\" => array(\n\t\t\t\t'calc' => array()\n\t\t\t),\n\t\t\t\"auth\" => array(\n\t\t\t\t'calc_details' => array()\n\t\t\t)\n\t\t);\n\t\treturn $calculation_array_matrix;\n\t}", "function get_atrribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\treturn $this->get_attribute_matrix($articleList, $attribute_include, $showHiddenValues,$sortingTable);\n \t}", "function get_product_atrribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm'){\n \t\t\n \t\treturn $this->get_product_attribute_matrix($attribute_include, $showHiddenValues,$sortingTable );\n \t}", "function get_product_attribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm')\n \t{\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\t\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_products.uid as product ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' '.$addwhere.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\n\t \t\t\t\t\t\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_products_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t \t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['product'];\n\t \t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.default_value, tx_commerce_products.uid product_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif (strlen($value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\tif ($this->lang_uid>0)\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t */\n\t \t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_products',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_products_attributes_mm.default_value',\n\t\t\t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm, tx_commerce_products, tx_commerce_attributes',\n\t\t\t\t\t\t\t\t\t\t\"tx_commerce_products_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products_attributes_mm.uid_local=tx_commerce_products.uid and tx_commerce_products.sys_language_uid=\".$this->lang_uid.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products.uid>0 and tx_commerce_products.l18n_parent=\".$value['product_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t} \t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\"\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist'])\n\t \t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\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\t \t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t $valueUidList[] = $value['uid_valuelist'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==false){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' =>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\n\t \t\t\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function getLineMatrix() {}", "public function colorMatrix() {}", "function get_selectattribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\tif ($articleList==false){\n\t \t\t\t$articleList=$this->load_articles();\n\t \t\t}\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\tif(is_array($articleList) && count($articleList)>0) {\n\t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t\t\t}\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\t \t\t$addwhere = $addwhere2;\n\t\t\t\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\t \n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * only get select attributs, since we don't need any other in selectattribut Matrix and we need the arrayKeys in this case\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t\t\t\t\t$valueUidList = array();\n\t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['article'];\n\t\t\t\t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \t\t\t\t\t\t\t \n\t \t\t\t\t\t\t\t \t $valuelist[$row['uid']] = $row['value'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\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\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function getMatrix($asArray = false) {}", "function matrix__toArray($filedestination, $product_info){\r\n $csv_array = array();\r\n $width = array();\r\n $height = array();\r\n $price = array();\r\n \r\n //taking the CSV file and converting into a multi-dimensional array \r\n $f = fopen($filedestination, \"r\");\r\n while (($row = fgetcsv($f))) {\r\n $filtered_row = array_filter($row);\r\n array_push($csv_array, $filtered_row);\r\n } \r\n\r\n //[row][column]\r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i])-1; $j++){\r\n if($i != 0){\r\n array_push($width, $csv_array[$i][0]); \r\n } \r\n }\r\n }\r\n\r\n for($i = 0; $i < sizeof($csv_array)-1; $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if($j != 0){\r\n array_push($height, $csv_array[0][$j]); \r\n } \r\n } \r\n } \r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if(($j != 0) AND ($i != 0)){\r\n array_push($price, $csv_array[$i][$j]); \r\n } \r\n }\r\n }\r\n\r\n insert_price_table($width, $height, $price , $product_info); \r\n}", "public function getTechDataMatrix()\n {\n $machines = $this->getMachines(true);\n $matrix = [];\n $tech_data_arrays = [];\n $tech_data_wildcards = [];\n // Get technical data\n foreach ($machines as $machine) {\n $tech_data_arrays[$machine->machine_id] = $machine->getTechnicalData();\n }\n // Get wildcards\n foreach ($tech_data_arrays as $tech_data_array) {\n foreach ($tech_data_array as $tech_data) {\n /** @var array<string> $tech_data */\n $tech_data_wildcards[$tech_data['description']] = $tech_data['unit'];\n }\n }\n // Create matrix\n foreach ($tech_data_wildcards as $wildcard => $unit) {\n $key = ['description' => $wildcard, 'unit' => $unit];\n $matrix[$wildcard] = ['unit' => $unit, 'machine_ids' => []];\n foreach ($machines as $machine) {\n $tech_data_array = $tech_data_arrays[$machine->machine_id];\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = '';\n foreach ($tech_data_array as $techdata) {\n /** @var array<string> $techdata */\n if ($techdata['description'] === $wildcard) {\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = $techdata['value'];\n break;\n }\n }\n }\n }\n return $matrix;\n }", "public function matrixMaker($words){\n $matrix = [];\n $info = [];\n for($i=0;$i<count($words);$i++){\n $ok = 0;\n while($ok<1){\n $maker = $this->hMaker($matrix, $words[$i]);\n $ok = $maker['status'];\n }\n $matrix = $maker['matrix'];\n $info[$words[$i]] = ['start'=>$maker['start'], 'type'=>$maker['type']];\n }\n for($i=0;$i<15;$i++){\n for($j=0;$j<15;$j++){\n if(empty($matrix[$i][$j])){\n $matrix[$i][$j] = $this->assign_rand_value(rand(1,26));\n }\n }\n }\n return ['matrix'=>$matrix, 'info'=>$info];\n }", "public function getTextMatrix() {}", "abstract function attributes(): array;", "public function Matrix($wine)\n{\n\tfor($i=0; $i<=$wine; $i++)\n\tfor($j=0; $j<=$wine; $j++) \n\t\n\t$this->glasses[$i][$j]=0;\n}", "public function getData(){\n $values = array();\n $attributes = $this->defineAttributes();\n if(property_exists($this, 'handle') && property_exists($this, 'type')){\n $matrixAttributes = anu()->matrix->getMatrixByName($this->handle)->defineAttributes()[$this->type];\n $attributes = array_merge($attributes, $matrixAttributes);\n }\n\n foreach ($attributes as $k => $v){\n if(property_exists($this, $k)){\n $values[$k] = $this->$k;\n }\n }\n return $values;\n }", "protected function aggregate_multidimensional()\n {\n }", "public function maker(): array;", "public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }", "function getMatrixX() {\n // width\n return 15;\n }", "public function __toString(){\n\t\t$str = \"{ \";\n\t\tforeach ( $this->attributes as $name=>$val) {\n\t\t\tif( is_array( $val))\n\t\t\t\t$val = new xo_array($val);\n\t\t\t$str .= \"'$name' = '$val',\";\n\t\t}\n\t\t//print_r( $this->attributes);\n\t\treturn \"$str } \". count( $this->attributes) . \" magic members.\";\t\n\t}", "public function initAttrInfos($cols)\n\t{\n\t\tif($this->prod_etype==null)\n\t\t{\n\t\t\t//Find product entity type\n\t\t\t$tname=$this->tablename(\"eav_entity_type\");\n\t\t\t$this->prod_etype=$this->selectone(\"SELECT entity_type_id FROM $tname WHERE entity_type_code=?\",\"catalog_product\",\"entity_type_id\");\n\t\t}\n\n\t\t$toscan=array_values(array_diff($cols,array_keys($this->attrinfo)));\n\t\tif(count($toscan)>0)\n\t\t{\n\t\t\t//create statement parameter string ?,?,?.....\n\t\t\t$qcolstr=$this->arr2values($toscan);\n\n\t\t\t$tname=$this->tablename(\"eav_attribute\");\n\t\t\tif($this->getMagentoVersion()!=\"1.3.x\")\n\t\t\t{\n\t\t\t\t$extra=$this->tablename(\"catalog_eav_attribute\");\n\t\t\t\t//SQL for selecting attribute properties for all wanted attributes\n\t\t\t\t$sql=\"SELECT `$tname`.*,$extra.is_global FROM `$tname`\n\t\t\t\tLEFT JOIN $extra ON $tname.attribute_id=$extra.attribute_id\n\t\t\t\tWHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql=\"SELECT `$tname`.* FROM `$tname` WHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\n\t\t\t}\n\t\t\t$toscan[]=$this->prod_etype;\n\t\t\t$result=$this->selectAll($sql,$toscan);\n\n\t\t\t$attrinfs=array();\n\t\t\t//create an attribute code based array for the wanted columns\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\t$attrinfs[$r[\"attribute_code\"]]=$r;\n\t\t\t}\n\t\t\tunset($result);\n\n\t\t\t//create a backend_type based array for the wanted columns\n\t\t\t//this will greatly help for optimizing inserts when creating attributes\n\t\t\t//since eav_ model for attributes has one table per backend type\n\t\t\tforeach($attrinfs as $k=>$a)\n\t\t\t{\n\t\t\t\t//do not index attributes that are not in header (media_gallery may have been inserted for other purposes)\n\t\t\t\tif(!in_array($k,$cols))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$bt=$a[\"backend_type\"];\n\t\t\t\tif(!isset($this->attrbytype[$bt]))\n\t\t\t\t{\n\t\t\t\t\t$this->attrbytype[$bt]=array(\"data\"=>array());\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"data\"][]=$a;\n\t\t\t}\n\t\t\t//now add a fast index in the attrbytype array to store id list in a comma separated form\n\t\t\tforeach($this->attrbytype as $bt=>$test)\n\t\t\t{\n\t\t\t\t$idlist;\n\t\t\t\tforeach($test[\"data\"] as $it)\n\t\t\t\t{\n\t\t\t\t\t$idlist[]=$it[\"attribute_id\"];\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"ids\"]=implode(\",\",$idlist);\n\t\t\t}\n\t\t\t$this->attrinfo=array_merge($this->attrinfo,$attrinfs);\n\t\t}\n\t\t$notattribs=array_diff($cols,array_keys($this->attrinfo));\n\t\tforeach($notattribs as $k)\n\t\t{\n\t\t\t$this->attrinfo[$k]=null;\n\t\t}\n\t\t/*now we have 2 index arrays\n\t\t 1. $this->attrinfo which has the following structure:\n\t\t key : attribute_code\n\t\t value : attribute_properties\n\t\t 2. $this->attrbytype which has the following structure:\n\t\t key : attribute backend type\n\t\t value : array of :\n\t\t data => array of attribute_properties ,one for each attribute that match\n\t\t the backend type\n\t\t ids => list of attribute ids of the backend type */\n\t}", "public function initAttrInfos($cols)\n\t{\n\t\tif($this->cat_etype==null)\n\t\t{\n\t\t\t//Find product entity type\n\t\t\t$tname=$this->tablename(\"eav_entity_type\");\n\t\t\t$this->cat_etype=$this->selectone(\"SELECT entity_type_id FROM $tname WHERE entity_type_code=?\",\"catalog_category\",\"entity_type_id\");\n\t\t}\n\n\t\t$toscan=array_values(array_diff($cols,array_keys($this->attrinfo)));\n\t\tif(count($toscan)>0)\n\t\t{\n\t\t\t//create statement parameter string ?,?,?.....\n\t\t\t$qcolstr=$this->arr2values($toscan);\n\n\t\t\t$tname=$this->tablename(\"eav_attribute\");\n\t\t\tif($this->getMagentoVersion()!=\"1.3.x\")\n\t\t\t{\n\t\t\t\t$extra=$this->tablename(\"catalog_eav_attribute\");\n\t\t\t\t//SQL for selecting attribute properties for all wanted attributes\n\t\t\t\t$sql=\"SELECT `$tname`.*,$extra.is_global FROM `$tname`\n\t\t\t\tLEFT JOIN $extra ON $tname.attribute_id=$extra.attribute_id\n\t\t\t\tWHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql=\"SELECT `$tname`.* FROM `$tname` WHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\n\t\t\t}\n\t\t\t$toscan[]=$this->cat_etype;\n\t\t\t$result=$this->selectAll($sql,$toscan);\n\n\t\t\t$attrinfs=array();\n\t\t\t//create an attribute code based array for the wanted columns\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\t$attrinfs[$r[\"attribute_code\"]]=$r;\n\t\t\t}\n\t\t\tunset($result);\n\n\t\t\t//create a backend_type based array for the wanted columns\n\t\t\t//this will greatly help for optimizing inserts when creating attributes\n\t\t\t//since eav_ model for attributes has one table per backend type\n\t\t\tforeach($attrinfs as $k=>$a)\n\t\t\t{\n\t\t\t\t//do not index attributes that are not in header (media_gallery may have been inserted for other purposes)\n\t\t\t\tif(!in_array($k,$cols))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$bt=$a[\"backend_type\"];\n\t\t\t\tif(!isset($this->attrbytype[$bt]))\n\t\t\t\t{\n\t\t\t\t\t$this->attrbytype[$bt]=array(\"data\"=>array());\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"data\"][]=$a;\n\t\t\t}\n\t\t\t//now add a fast index in the attrbytype array to store id list in a comma separated form\n\t\t\tforeach($this->attrbytype as $bt=>$test)\n\t\t\t{\n\t\t\t\t$idlist;\n\t\t\t\tforeach($test[\"data\"] as $it)\n\t\t\t\t{\n\t\t\t\t\t$idlist[]=$it[\"attribute_id\"];\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"ids\"]=implode(\",\",$idlist);\n\t\t\t}\n\t\t\t$this->attrinfo=array_merge($this->attrinfo,$attrinfs);\n\t\t}\n\t\t$notattribs=array_diff($cols,array_keys($this->attrinfo));\n\t\tforeach($notattribs as $k)\n\t\t{\n\t\t\t$this->attrinfo[$k]=null;\n\t\t}\n\t\t/*now we have 2 index arrays\n\t\t 1. $this->attrinfo which has the following structure:\n\t\t key : attribute_code\n\t\t value : attribute_properties\n\t\t 2. $this->attrbytype which has the following structure:\n\t\t key : attribute backend type\n\t\t value : array of :\n\t\t data => array of attribute_properties ,one for each attribute that match\n\t\t the backend type\n\t\t ids => list of attribute ids of the backend type */\n\t}", "function crear_matriz($gmat,$numero){\r\n foreach(range(0,$numero) as $row){\r\n foreach(range(0,$numero) as $col){\r\n $gmat[$row][$col] = 0;\r\n }\r\n }\r\n return $gmat;\r\n}", "private function cardsMatrix(): array {\n\t\t\t\n\t\t\treturn ['big', 'horizontal', 'vertical', 'standard', 'standard', 'standard'];\n\t\t}", "function metastudent()\r\n{\r\n return array(\r\n array(\r\n //Attributes\r\n 'ID','Name','Age','Degree'\r\n ),\r\n array(\r\n //datatypes\r\n 'ID'=>'INT',\r\n 'Name'=>'VARCHAR',\r\n 'Age'=>'INT',\r\n 'Degree'=>'VARCHAR'\r\n ),\r\n array(\r\n //numeric\r\n 'ID',\r\n 'Age'\r\n )\r\n );\r\n}", "function matricularVehiculo(){\r\n $matricula _aleatoria = rand();\r\n\r\n $encontrado = false;\r\n for ($i=0; $i< count ($this->vehiculos) && ($encontrado==false); $i++) {\r\n if ($this->vehiculos[$i] != null) {\r\n if($this->vehiculos[$i]->getMatricula() =='') {}\r\n $this->vehiculos[$i]->getMatricula($matricula_aleatoria);\r\n $encontrado = true;\r\n $pos = $i;\r\n }\r\n }\r\n }", "private function generateAttributeCombinations($arrays) // .. 4\n {\n $result = [[]];\n\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n\n return $result;\n }", "public function printMatrix() {\n echo __CLASS__ . PHP_EOL;\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n printf('%lf ', $this->data[$i * $this->col + $j]);\n }\n echo PHP_EOL;\n }\n }", "abstract protected function _buildCalcRows();", "public static function buildViewModelFields() {\n global $_DIMS;\n global $skin;\n // construction du tableau de présentation des champs\n $data =array();\n $elements=array();\n\n // collecte des données de la base\n $fields=import_fichier_modele::getModelFields();// import_fichier_assureur::getModelFields();\n\n // headers\n $data['headers'][]=$_DIMS['cste']['_DIMS_LABEL'];\n $data['headers'][]=$_DIMS['cste']['_TYPE'];\n $data['headers'][]=$_DIMS['cste']['_FIELD_NEEDED'];\n $data['headers'][]=$_DIMS['cste']['_DIMS_COMMENTS'];\n\n // construction des données à afficher\n foreach ($fields as $f) {\n $elem=array();\n // traduction libelle\n if (isset($_DIMS['cste'][$f['libelle']])) {\n $elem[0]=$_DIMS['cste'][$f['libelle']];\n }\n else {\n $elem[0]=$f['libelle'];\n }\n\n // traduction libelletype\n if (isset($_DIMS['cste'][$f['libelletype']])) {\n $elem[1]=$_DIMS['cste'][$f['libelletype']];\n }\n else {\n $elem[1]=$f['libelletype'];\n }\n\n if ($f['obligatoire']==1) {\n $elem[2]='<img src =\"./common/img/publish.png\">';\n }\n else {\n $elem[2]='&nbsp;';\n }\n\n // traduction help_constant\n if (isset($_DIMS['cste'][$f['help_constant']])) {\n $elem[3]=$_DIMS['cste'][$f['help_constant']];\n }\n else {\n $elem[3]=$f['help_constant'];\n }\n\n $elements[]=$elem;\n }\n\n //elements of table\n $data['data']['elements']=$elements;\n echo '<div style=\"margin-top:10px;clear:both;float:left;width:100%;\">'.$skin->displayArray($data).'</div>';\n }" ]
[ "0.6288993", "0.6130536", "0.6047995", "0.6023179", "0.58509886", "0.57226497", "0.56490713", "0.55420655", "0.5434214", "0.5422168", "0.52839804", "0.5253988", "0.52346957", "0.521133", "0.52035624", "0.5197732", "0.51814145", "0.5169443", "0.51182204", "0.5117354", "0.50972384", "0.50963706", "0.5090726", "0.50589657", "0.5007561", "0.5004444", "0.5001766", "0.49974346", "0.4996384", "0.4983915" ]
0.6130848
1
Generates a Matrix fro these concerning products for all Attributes and the values therfor Realy complex array, so have a lokk at the source
function get_product_attribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm') { $return_array=array(); /** * if no list is given, take complate arctile-list from product */ if ($this->uid>0) { if (is_array($attribute_include)){ if (!is_null($attribute_include[0])) { $addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')'; } } $result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_products.uid as product ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting', 'tx_commerce_products', 'tx_commerce_products_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_products.uid = '.$this->uid.' '.$addwhere.' order by '.$sortingTable.'.sorting' ); if (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0)) { while ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { /** * Do the language overlay */ if ($this->lang_uid>0) { if(is_object($GLOBALS['TSFE']->sys_page)){ $proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords); } $result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_commerce_attributes', 'uid = '.$data['uid'].' '.$proofSQL ); // Result should contain only one Dataset if ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1) { $return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2); $GLOBALS['TYPO3_DB']->sql_free_result($result2); $return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode); if (!is_array($return_data)){ /** * No Translation possible, so next interation */ continue; } } $data['title']=$return_data['title']; $data['unit']=$return_data['unit']; $data['internal_title']=$return_data['internal_title']; } $valueshown=false; /** * get the different possible values form value_char an value */ /** * @since 13.12.2005 Get the lokalized values from tx_commerce_products_attributes_mm * @author Ingo Schmitt <[email protected]> */ $valuelist=array(); $attribute_uid=$data['uid']; $article=$data['product']; $result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.default_value, tx_commerce_products.uid product_uid, tx_commerce_attributes.uid attribute_uid', 'tx_commerce_products', 'tx_commerce_products_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_products.uid = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid ); if (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)) { while ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)) { if (strlen($value['default_value'])>0){ if ($this->lang_uid>0) { /** * Do the lokalization */ $proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords); $proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_products',$GLOBALS['TSFE']->showHiddenRecords); $res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_products_attributes_mm.default_value', 'tx_commerce_products_attributes_mm, tx_commerce_products, tx_commerce_attributes', "tx_commerce_products_attributes_mm.uid_foreign=".$value['attribute_uid']. " and tx_commerce_products_attributes_mm.uid_local=tx_commerce_products.uid and tx_commerce_products.sys_language_uid=".$this->lang_uid. " and tx_commerce_products.uid>0 and tx_commerce_products.l18n_parent=".$value['product_uid']. " ".$proofSQL_attributes.$proofSQL_articles ); if (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) { while ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){ if (strlen($lok_value['default_value'])>0){ $valuelist[]=$lok_value['default_value']; $valueUidList[] = 0; $valueshown=true; } } } }else { $valuelist[]=$value['default_value']; $valueUidList[] = 0; $valueshown=true; } } } } $result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.uid_valuelist ', 'tx_commerce_products', 'tx_commerce_products_attributes_mm', 'tx_commerce_attributes', ' AND tx_commerce_products.uid = '.$this->uid." AND tx_commerce_attributes.uid=$attribute_uid" ); if (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)) { while ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)) { if ($value['uid_valuelist']) { $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']); $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue); if ($this->lang_uid>0) { $row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode); if (!is_array($row)){ continue; } } if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){ $valuelist[] = $row['value']; $valueUidList[] = $value['uid_valuelist']; $valueshown=true; } } } } if ($valueshown==false){ $return_array[$attribute_uid]=array('title' => $data['title'], 'unit' => $data['unit'], 'values' =>array(), 'valueuidlist' => array(), 'valueformat' => $data['valueformat'], 'Internal_title' => $data['internal_title'], 'icon' => $data['icon'] ); } if ($valueshown==true){ $return_array[$attribute_uid]=array('title' => $data['title'], 'unit' => $data['unit'], 'values' => $valuelist, 'valueuidlist' => $valueUidList, 'valueformat' => $data['valueformat'], 'Internal_title' => $data['internal_title'], 'icon' => $data['icon'] ); } } return $return_array; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_product_atrribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm'){\n \t\t\n \t\treturn $this->get_product_attribute_matrix($attribute_include, $showHiddenValues,$sortingTable );\n \t}", "public function create_calculation_array_matrix(){\n\t\t/*\n\t\t* Public and private sets of date for more complex frontend managament\n\t\t*/\n\t\t$calculation_array_matrix = array(\n\t\t\t\"public\" => array(\n\t\t\t\t'calc' => array()\n\t\t\t),\n\t\t\t\"auth\" => array(\n\t\t\t\t'calc_details' => array()\n\t\t\t)\n\t\t);\n\t\treturn $calculation_array_matrix;\n\t}", "public function product() : ColumnVector\n {\n return ColumnVector::quick(array_map('array_product', $this->a));\n }", "function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n\t \n\t \t\t$return_array=array();\n\t \t\t/**\n\t \t\t * if no list is given, take complate arctile-list from product\n\t \t\t */\n\t \n\t \n\t \t\tif ($this->uid>0) { \n\t \t\t\tif ($articleList==false){\n\t \t\t\t\t$articleList=$this->load_articles();\n\t \t\t\t}\n\t \n\t \t\tif (is_array($attribute_include)){\n\t \t\t\tif (!is_null($attribute_include[0])) {\n\t \t\t\t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t \t\t\t\t}\t\n\t \t\t\t}\n\t \t\t\tif(is_array($articleList) && count($articleList)>0) {\n\t \t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t \t\t\t}\n\t \n\t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t$addwhere = $addwhere2;\n\t \n\t \t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \n\t \t\t\t\t\t/** \n\t \t\t\t\t\t * Do the language overlay\n\t \t\t\t\t\t */\n\t \t\t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t \t\t\t\t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\n\t \t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\n\t \t\t\t\t\t\t\t);\n\t \n\t \n\t \t\t\t\t\t\t// Result should contain only one Dataset\n\t \t\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t \t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\tif (!is_array($return_data)){\n\t \t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t * No Translation possible, so next interation\n\t \t\t\t\t\t\t\t */\t\n\t \t\t\t\t\t\t\t\tcontinue;\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \n\t \n\t \n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$valueshown=false;\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t\t */\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t\t */\n\t \n\t \t\t\t\t\t$valuelist=array();\n\t\t\t\t\t\t$valueUidList = array();\n\t \t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t\t$article=$data['article'];\n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\t{\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t\t{\n\t \n\t \t\t\t\t\t\t\t\tif (strlen($value['value_char'])>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0)\t{\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['value_char'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t\t\t\t}else\t{\n\t \n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t} \t\t\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t{\n\t \n\t \t\t\t\t\t\t\t\tif ($value['default_value']>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0){\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif(strlen($lok_value['value_char'])>0) {\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \n\t \t\t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \n\t \t\t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t\t\t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t\t\tif (!is_array($row)){\n\t \t\t\t\t\t\t\t\t\t\tcontinue;\t\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \n\t \n\t \t\t\t\t\t\t\t\t\t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t\t $valueUidList[] = $row['uid'];\n\t \t\t\t\t\t\t\t\t\t $valueshown=true;\n\t \t\t\t\t\t\t\t\t }\n\t \n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif ($valueshown == false) {\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \n\t \t\t\t\t}\n\t \n\t \t\t\t\treturn $return_array;\n\t \t\t\t}\n\t \t\t}\n\t \t\treturn false;\n\t \n\t}", "function wc_cartesian_product_of_attributes_terms( array $attributes ): array { //phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh, Generic.Metrics.NestingLevel.MaxExceeded\n\t\t$result = array( array() );\n\n\t\tforeach ( $attributes as $attribute_name => $attribute_values ) {\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product.\n\t\t\tif ( true === empty( $attribute_values ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$append = array();\n\n\t\t\tforeach ( $result as $attribute ) {\n\t\t\t\tforeach ( $attribute_values as $attribute_value ) {\n\t\t\t\t\t$attribute[ $attribute_name ] = $attribute_value;\n\n\t\t\t\t\t$append[] = $attribute;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = $append;\n\t\t}\n\n\t\treturn $result;\n\t}", "function get_atrribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\treturn $this->get_attribute_matrix($articleList, $attribute_include, $showHiddenValues,$sortingTable);\n \t}", "function get_selectattribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\tif ($articleList==false){\n\t \t\t\t$articleList=$this->load_articles();\n\t \t\t}\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\tif(is_array($articleList) && count($articleList)>0) {\n\t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t\t\t}\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\t \t\t$addwhere = $addwhere2;\n\t\t\t\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\t \n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * only get select attributs, since we don't need any other in selectattribut Matrix and we need the arrayKeys in this case\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t\t\t\t\t$valueUidList = array();\n\t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['article'];\n\t\t\t\t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \t\t\t\t\t\t\t \n\t \t\t\t\t\t\t\t \t $valuelist[$row['uid']] = $row['value'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\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\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function product()\n {\n return array_product($this->data());\n }", "public function product() {\n\t\treturn array_product($this->_value);\n\t}", "public function getMatrix($asArray = false) {}", "private function generateAttributeCombinations($arrays) // .. 4\n {\n $result = [[]];\n\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n\n return $result;\n }", "function matrix__toArray($filedestination, $product_info){\r\n $csv_array = array();\r\n $width = array();\r\n $height = array();\r\n $price = array();\r\n \r\n //taking the CSV file and converting into a multi-dimensional array \r\n $f = fopen($filedestination, \"r\");\r\n while (($row = fgetcsv($f))) {\r\n $filtered_row = array_filter($row);\r\n array_push($csv_array, $filtered_row);\r\n } \r\n\r\n //[row][column]\r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i])-1; $j++){\r\n if($i != 0){\r\n array_push($width, $csv_array[$i][0]); \r\n } \r\n }\r\n }\r\n\r\n for($i = 0; $i < sizeof($csv_array)-1; $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if($j != 0){\r\n array_push($height, $csv_array[0][$j]); \r\n } \r\n } \r\n } \r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if(($j != 0) AND ($i != 0)){\r\n array_push($price, $csv_array[$i][$j]); \r\n } \r\n }\r\n }\r\n\r\n insert_price_table($width, $height, $price , $product_info); \r\n}", "public function getData(){\n $values = array();\n $attributes = $this->defineAttributes();\n if(property_exists($this, 'handle') && property_exists($this, 'type')){\n $matrixAttributes = anu()->matrix->getMatrixByName($this->handle)->defineAttributes()[$this->type];\n $attributes = array_merge($attributes, $matrixAttributes);\n }\n\n foreach ($attributes as $k => $v){\n if(property_exists($this, $k)){\n $values[$k] = $this->$k;\n }\n }\n return $values;\n }", "public function getLineMatrix() {}", "protected function aggregate_multidimensional()\n {\n }", "function cartesian_product($input) {\r\n \t$result = array();\r\n\r\n\t\tforeach ($input as $key => $values) {\r\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product\r\n\t\t\tif (empty($values)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Seeding the product array with the values from the first sub-array\r\n\t\t\tif (empty($result)) {\r\n\t\t\t\tforeach($values as $value) {\r\n\t\t\t\t\t$result[] = array($key => $value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Second and subsequent input sub-arrays work like this:\r\n\t\t\t\t// 1. In each existing array inside $product, add an item with\r\n\t\t\t\t// key == $key and value == first item in input sub-array\r\n\t\t\t\t// 2. Then, for each remaining item in current input sub-array,\r\n\t\t\t\t// add a copy of each existing array inside $product with\r\n\t\t\t\t// key == $key and value == first item of input sub-array\r\n\t\r\n\t\t\t\t// Store all items to be added to $product here; adding them\r\n\t\t\t\t// inside the foreach will result in an infinite loop\r\n\t\t\t\t$append = array();\r\n\t\r\n\t\t\t\tforeach($result as &$product) {\r\n\t\t\t\t\t// Do step 1 above. array_shift is not the most efficient, but\r\n\t\t\t\t\t// it allows us to iterate over the rest of the items with a\r\n\t\t\t\t\t// simple foreach, making the code short and easy to read.\r\n\t\t\t\t\t$product[$key] = array_shift($values);\r\n\t\r\n\t\t\t\t\t// $product is by reference (that's why the key we added above\r\n\t\t\t\t\t// will appear in the end result), so make a copy of it here\r\n\t\t\t\t\t$copy = $product;\r\n\t\r\n\t\t\t\t\t// Do step 2 above.\r\n\t\t\t\t\tforeach($values as $pos_key=>$item) {\r\n\t\t\t\t\t\t$copy[$key] = $item;\r\n\t\t\t\t\t\t$append[] = $copy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Undo the side effecst of array_shift\r\n\t\t\t\t\tarray_unshift($values, $product[$key]);\t\t\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// Out of the foreach, we can add to $results now\r\n\t\t\t\t$result = array_merge($result, $append);\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function colorMatrix() {}", "private function GetPIMaterialsArray() {\n $pi_items = [\n //R0 Materials\n '2073',\n '2667',\n '2268',\n '2270',\n '2272',\n '2286',\n '2287',\n '2288',\n '2305',\n '2306',\n '2307',\n '2308',\n '2309',\n '2310',\n '2311',\n //P1 Materials\n '2389',\n '2390',\n '2392',\n '2393',\n '2395',\n '2396',\n '2397',\n '2398',\n '2399',\n '2400',\n '2401',\n '3645',\n '3683',\n '3779',\n '9828',\n //P2 Materials\n '44',\n '2312',\n '2317',\n '2319',\n '2321',\n '2327',\n '2328',\n '2329',\n '2463',\n '3689',\n '3691',\n '3693',\n '3695',\n '3697',\n '3725',\n '3775',\n '3828',\n '9830',\n '9832',\n '9836',\n '9838',\n '9840',\n '9842',\n '15317',\n //P3 Materials\n '2344',\n '2345',\n '2346',\n '2348',\n '2349',\n '2351',\n '2352',\n '2354',\n '2358',\n '2360',\n '2361',\n '2366',\n '2367',\n '9834',\n '9846',\n '9848',\n '12836',\n '17136',\n '17392',\n '17898',\n '28974',\n //P4 Materials\n '2867',\n '2868',\n '2869',\n '2870',\n '2871',\n '2872',\n '2875',\n '2876',\n ];\n\n return $pi_items;\n }", "public function getTechDataMatrix()\n {\n $machines = $this->getMachines(true);\n $matrix = [];\n $tech_data_arrays = [];\n $tech_data_wildcards = [];\n // Get technical data\n foreach ($machines as $machine) {\n $tech_data_arrays[$machine->machine_id] = $machine->getTechnicalData();\n }\n // Get wildcards\n foreach ($tech_data_arrays as $tech_data_array) {\n foreach ($tech_data_array as $tech_data) {\n /** @var array<string> $tech_data */\n $tech_data_wildcards[$tech_data['description']] = $tech_data['unit'];\n }\n }\n // Create matrix\n foreach ($tech_data_wildcards as $wildcard => $unit) {\n $key = ['description' => $wildcard, 'unit' => $unit];\n $matrix[$wildcard] = ['unit' => $unit, 'machine_ids' => []];\n foreach ($machines as $machine) {\n $tech_data_array = $tech_data_arrays[$machine->machine_id];\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = '';\n foreach ($tech_data_array as $techdata) {\n /** @var array<string> $techdata */\n if ($techdata['description'] === $wildcard) {\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = $techdata['value'];\n break;\n }\n }\n }\n }\n return $matrix;\n }", "function promedio_por_alumno($vector){\n $promedios_alumnos=array();\n foreach ($vector as $key => $value) {\n $promedio=0;\n foreach ($value as $c) {\n $promedio=$promedio+$c;\n }\n $promedio=$promedio/6;\n $alumno=array($key=>$promedio);\n array_push($promedios_alumnos,$alumno);\n }\n return $promedios_alumnos;\n }", "abstract protected function _buildCalcRows();", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }", "public function getProductsArray()\n {\n $result = $this->details->map(function ($item, $key) {\n return [ 'product_id' => $item->product_id,\n 'quantity' => $item->quantity ];\n })->values()->toArray();\n\n return $result;\n }", "public function matrixMaker($words){\n $matrix = [];\n $info = [];\n for($i=0;$i<count($words);$i++){\n $ok = 0;\n while($ok<1){\n $maker = $this->hMaker($matrix, $words[$i]);\n $ok = $maker['status'];\n }\n $matrix = $maker['matrix'];\n $info[$words[$i]] = ['start'=>$maker['start'], 'type'=>$maker['type']];\n }\n for($i=0;$i<15;$i++){\n for($j=0;$j<15;$j++){\n if(empty($matrix[$i][$j])){\n $matrix[$i][$j] = $this->assign_rand_value(rand(1,26));\n }\n }\n }\n return ['matrix'=>$matrix, 'info'=>$info];\n }", "public function getS() {\n// return new Matrix($this->s);\n $S = array();\n for ($i = 0; $i < $this->n; ++$i) {\n for ($j = 0; $j < $this->n; ++$j) {\n $S[$i][$j] = 0.0;\n }\n $S[$i][$i] = $this->s[$i];\n }\n return new Matrix($S);\n }", "public function combinations() : array\n {\n $combinations = [[]];\n\n foreach ($this->grid as $i => $params) {\n $append = [];\n\n foreach ($combinations as $product) {\n foreach ($params as $param) {\n $product[$i] = $param;\n $append[] = $product;\n }\n }\n\n $combinations = $append;\n }\n\n return $combinations;\n }", "public function getProductAttributesGroups()\n {\n $colors = array();\n $groups = array();\n $combinations = array();\n\n $attributes_groups = $this->product->getAttributesGroups($this->context->language->id);\n\n if (is_array($attributes_groups) && $attributes_groups) {\n foreach ($attributes_groups as $row) {\n // Color management\n if (isset($row['is_color_group'])\n && $row['is_color_group']\n && (isset($row['attribute_color']) && $row['attribute_color'])\n || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) {\n $colors[$row['id_attribute']]['value'] = $row['attribute_color'];\n $colors[$row['id_attribute']]['name'] = $row['attribute_name'];\n if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) {\n $colors[$row['id_attribute']]['attributes_quantity'] = 0;\n }\n $colors[$row['id_attribute']]['attributes_quantity'] += (int)$row['quantity'];\n }\n if (!isset($groups[$row['id_attribute_group']])) {\n $groups[$row['id_attribute_group']] = array(\n 'group_name' => $row['group_name'],\n 'name' => $row['public_group_name'],\n 'group_type' => $row['group_type'],\n 'default' => -1,\n );\n }\n\n $attr_g = $row['id_attribute_group'];\n $groups[$attr_g]['attributes'][$row['id_attribute']] = $row['attribute_name'];\n if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {\n $groups[$row['id_attribute_group']]['default'] = (int)$row['id_attribute'];\n }\n if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {\n $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;\n }\n $r_attr = $row['id_attribute_group'];\n $groups[$r_attr]['attributes_quantity'][$row['id_attribute']] += (int)$row['quantity'];\n\n $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute'];\n\n //calculate full price for combination\n $priceDisplay = Product::getTaxCalculationMethod(0); //(int)$this->context->cookie->id_customer\n if (!$priceDisplay || $priceDisplay == 2) {\n $combination_price = $this->product->getPrice(true, $row['id_product_attribute']);\n } else {\n $combination_price = $this->product->getPrice(false, $row['id_product_attribute']);\n }\n $combinations[$row['id_product_attribute']]['price'] = $this->formatPrice($combination_price);\n $combinations[$row['id_product_attribute']]['float_price'] = $combination_price;\n $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity'];\n $combinations[$row['id_product_attribute']]['minimal_quantity'] = (int)$row['minimal_quantity'];\n }\n\n // wash attributes list (if some attributes are unavailables and if allowed to wash it)\n if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock)\n && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {\n foreach ($groups as &$group) {\n foreach ($group['attributes_quantity'] as $key => &$quantity) {\n if ($quantity <= 0) {\n unset($group['attributes'][$key]);\n }\n }\n }\n\n foreach ($colors as $key => $color) {\n if ($color['attributes_quantity'] <= 0) {\n unset($colors[$key]);\n }\n }\n }\n foreach ($combinations as $id_product_attribute => $comb) {\n $attribute_list = '';\n foreach ($comb['attributes'] as $id_attribute) {\n $attribute_list .= '\\'' . (int)$id_attribute . '\\',';\n }\n $attribute_list = rtrim($attribute_list, ',');\n $combinations[$id_product_attribute]['list'] = $attribute_list;\n }\n }\n\n return array(\n 'groups' => $groups,\n 'colors' => (count($colors)) ? $colors : false,\n 'combinations' => $combinations\n );\n }", "function matrix_multiply($m1, $m2){\n\t\t$r = count($m1);\n\t\t$c = count($m2[0]);\n\t\t$p = count($m2);\n\t\tif(count($m1[0]) != $p){\n\t\t\treturn false; //incompatible matrix\n\t\t}\n\t\t$m3 = array();\n\t\tfor($i = 0; $i < $r; $i++){\n\t\t\tfor($j = 0; $j < $c; $j++){\n\t\t\t\t$m3[$i][$j] = 0;\n\t\t\t\tfor($k = 0; $k < $p; $k++){\n\t\t\t\t\t$m3[$i][$j] += $m1[$i][$k]*$m2[$k][$j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($m3);\n\t}", "function Build_Sparse_Array(array $t_args, array $inputs, array $outputs)\n{\n // Class name is randomly generated.\n $className = generate_name('BuildSparseArray');\n\n // Initializiation of argument names.\n $inputs_ = array_combine(['key', 'vector'], $inputs);\n $key = $inputs_['key'];\n\n // Information about the vector type.\n $size = $inputs_['vector']->get('size');\n $type = $inputs_['vector']->get('type');\n\n // Processing of template arguments.\n $scale = get_default($t_args, 'scale', 2);\n $width = get_default($t_args, 'length', 100);\n $type = get_default($t_args, 'type', $type);\n\n // diag is converted to avoid PHP boolean printing issues.\n $diag = intval($diag);\n\n grokit_assert(is_datatype($type),\n \"Build Sparse Array: 'type' ($type) is not a datatype.\");\n\n $sys_headers = ['armadillo', 'limits'];\n $user_headers = [];\n $lib_headers = [];\n $libraries = ['armadillo'];\n $extra = [];\n $result_type = ['state'];\n?>\n\nusing namespace std;\n\nclass <?=$className?>;\n\nclass <?=$className?> {\n public:\n // The type of result.\n using Type = <?=$type?>;\n\n // The type of the indices.\n using Key = <?=$key?>;\n\n // The length of each column in the data matrix.\n static const constexpr int kHeight = <?=$size?>;\n\n // The initial width of the data matrix.\n static const constexpr int kWidth = <?=$width?>;\n\n // The proportion at which the dynamic matrix grows.\n static const constexpr int kScale = <?=$scale?>;\n\n private:\n // The data matrix being constructed item by item. The width of this matrix\n // is increased when necessary as per a dynamic array.\n Mat<Type> data;\n\n // The set of keys processed whose indices correspond to the rows in data.\n Col<Key> keys;\n\n // The number of rows processed by this state.\n int count;\n\n public:\n <?=$className?>()\n : data(kHeight, kWidth),\n keys(kWidth),\n count(0) {\n }\n\n // Basic dynamic array allocation.\n void AddItem(<?=const_typed_ref_args($inputs_)?>) {\n if (count == data.n_cols) {\n data.resize(kHeight, kScale * data.n_cols);\n keys.resize(kScale * keys.n_elem);\n }\n data.col(count) = Col<Type>(vector.data(), kHeight);\n keys(count) = key;\n count++;\n }\n\n // Empty rows are stripped such that white space will only ever be at the end\n // of both keys and data.\n void AddState(<?=$className?> &other) {\n data.resize(kHeight, count);\n keys.resize(count);\n data.insert_cols(count, other.data);\n keys.insert_rows(count, other.keys);\n count += other.count;\n }\n\n void FinalizeState() {\n data.resize(kHeight, count);\n }\n\n const Col<Key>& GetKeys() const {\n return keys;\n }\n\n const Mat<Type>& GetData() const {\n return data;\n }\n\n<?\n return [\n 'kind' => 'GLA',\n 'name' => $className,\n 'system_headers' => $sys_headers,\n 'user_headers' => $user_headers,\n 'lib_headers' => $lib_headers,\n 'libraries' => $libraries,\n 'extra' => $extra,\n 'iterable' => false,\n 'input' => $inputs,\n 'output' => $outputs,\n 'result_type' => $result_type,\n ];\n}" ]
[ "0.6367938", "0.62564725", "0.59367806", "0.59314966", "0.5638131", "0.5596726", "0.55920714", "0.5565269", "0.55633795", "0.55572575", "0.5487172", "0.54164404", "0.54127985", "0.5304511", "0.528347", "0.52666694", "0.5216596", "0.51855856", "0.51298666", "0.51002026", "0.50847894", "0.50654864", "0.5062571", "0.5050885", "0.5010682", "0.49710092", "0.49669462", "0.49652472", "0.49560285", "0.49555618" ]
0.6411709
0
Returns list of articles (from this product) filtered by price
function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){ //first get all real articles, then create objects and check prices //do not get prices directly from DB because we need to take (price) hooks into account $table = 'tx_commerce_articles'; $where = '1=1'; if($proofUid){ $where.= ' and tx_commerce_articles.uid_product = '.$this->uid; } //todo: put correct constant here $where.= ' and article_type_uid=1'; $where.= $this->cObj->enableFields($table); $groupBy = ''; $orderBy = 'sorting'; $limit = ''; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( 'uid', $table, $where, $groupBy, $orderBy,$limit ); $rawArticleUidList = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $rawArticleUidList[] = $row['uid']; } $GLOBALS['TYPO3_DB']->sql_free_result($res); //now run the price test $articleUidList = array(); foreach ($rawArticleUidList as $rawArticleUid) { $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid); $tmpArticle->load_data(); $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net(); if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) { $articleUidList[] = $tmpArticle->get_uid(); } } if(count($articleUidList)>0){ return $articleUidList; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArticlesAction()\n {\n $params = $this->Request()->getParams();\n $search = $params['filter'][0]['value'];\n\n\n if (!isset($params['filter'][0]['value'])) {\n $search = '%' . $this->Request()->get('searchParam') . '%';\n }\n\n $builder = Shopware()->Models()->createQueryBuilder();\n\n /**\n * query to search for article variants or the article ordernumber\n * the query concats the article name and the additional text field for the search\n */\n $builder->select(\n 'articles.id AS articleId,\n details.number,\n articles.name,\n details.id,\n details.inStock,\n articles.taxId,\n prices.price,\n details.additionalText,\n tax.tax'\n );\n $builder->from('Shopware\\Models\\Article\\Article', 'articles')\n ->leftJoin('articles.details', 'details')\n ->leftJoin('details.prices', 'prices')\n ->leftJoin('articles.tax', 'tax')\n ->where(\n $builder->expr()->like(\n $builder->expr()->concat(\n 'articles.name',\n $builder->expr()->concat(\n $builder->expr()->literal(' '),\n 'details.additionalText'\n )\n ),\n $builder->expr()->literal($search)\n )\n )\n ->orWhere('details.number LIKE :number')\n ->andWhere('articles.active = 1')\n ->andWhere('articles.active = 1')\n ->setParameter('number', $search)\n ->orderBy('details.number')\n ->groupBy('details.number')\n ->setMaxResults(8);\n $result = $builder->getQuery()->getArrayResult();\n $total = count($result);\n\n foreach ($result as &$article) {\n $article['price'] = $this->calculateGrossPrice($article['price'], $article['tax']);\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $result,\n 'total' => $total\n ]\n );\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function getArticles()\n\t{\n\t$qb = $this ->createQueryBuilder(\"a\")\n\t\t\t\t->leftJoin('a.image','i')\n\t\t\t\t->addSelect('i')\n\n\t\t\t\t->leftJoin('a.categories','c')\n\t\t\t\t->addSelect('c')\n\n\t\t\t\t->where('a.publication = :val')\n\t\t\t\t->setParameter('val', 1)\n\n\t\t\t\t->orderBy('a.datecreation', 'DESC');\n\t$query = $qb->getQuery();\n\treturn $query->getResult();\n\t}", "public function getPrices()\n {\n }", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function showArticles()\n\t{\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC');\n\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\n\t\treturn $articles;\n\t}", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function modelReadSearchProductPrice($fromPrice,$toPrice,$recordPerPage){\n\t\t\t//lay bien p truyen tu url\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"select * from products where price >= $fromPrice and price <= $toPrice order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\t$result = $query->fetchAll();\t\t\t\n\t\t\t//---\n\t\t\treturn $result;\n\t\t}", "public function getPrices() {\n // get available price information\n $pricesAsDom = $this->product->get(\"SupplyDetail/Price\");\n\n // get child nodes as array\n $pricesAsArray = array_map(array($this,'_childNodes2Array'), $pricesAsDom);\n return $pricesAsArray;\n }", "protected function _getProductCollection()\n {\n $collection = parent::_getProductCollection();\n\n /*\n * Collections using Product Flat index require different processing.\n */\n if (Mage::getStoreConfigFlag('catalog/frontend/flat_catalog_product')) {\n $collection\n ->getSelect()\n ->where(new Zend_Db_Expr('price_index.final_price < price_index.price'));\n } else {\n $today = date('Y-m-d', time());\n $collection\n ->addAttributeToFilter('special_price', array('is' => new Zend_Db_Expr('not null')))\n ->addAttributeToFilter('special_from_date', array(\n 'or' => array(\n 0 => array('date' => true, 'to' => $today),\n 1 => array('is' => new Zend_Db_Expr('null')),\n )), 'left')\n ->addAttributeToFilter('special_to_date', array(\n 'or' => array(\n 0 => array('date' => true, 'from' => $today),\n 1 => array('is' => new Zend_Db_Expr('null')),\n )), 'left');\n }\n\n return $collection;\n }", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public function getPrices($ean) {\n \t// 1. check digits length of EAN number and fill it with zero if necessary\n $ean = $this->checkDigitLen($ean);\n\n // 2. request search page by url\n // Create DOM from URL\n $html = file_get_html($this->host . '/search?hl=nl&output=search&tbm=shop&q=' . $ean);\n\n // 3. find the first product link on this page\n $prodLink = $this->findProdLink($html);\n\n // 4. add /online?hl=nl string to the end of the product link and compose url for product link\n $prodLink .= '/online?hl=nl';\n $prodLink = $this->host . $prodLink; // https://www.google.nl/shopping/product/12115883691353094589/online?hl=nl\n\n // 5. download the product link\n $downloadedProd = file_get_html($prodLink);\n\n // 6. Create an array with the prices\n return $this->createPricesArray($downloadedProd);\n\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}", "public function getArticles();", "public function getProducts()\n {\n $products = [\n [\"name\" => \"Sledgehammer\", \"price\" => 125.75],\n [\"name\" => \"Axe\", \"price\" => 190.50],\n [\"name\" => \"Bandsaw\", \"price\" => 562.131],\n [\"name\" => \"Chisel\", \"price\" => 12.9],\n [\"name\" => \"Hacksaw\", \"price\" => 18.45],\n ];\n return $products;\n }", "public function index()\n {\n return new PriceCollection(Price::orderBy('id', 'desc')->take(20)->get());\n }", "protected function getProductCollection()\r\n {\r\n $searchCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToSelect('*')\r\n ->addAttributeToFilter('status', 1)\r\n ->addAttributeToFilter('visibility', 4);\r\n $searchCollection->getSelect()->limit($this->getProductsCount());\r\n $searchCollection->getSelect()->where(\"'\" . date('Y-m-d') . \"' BETWEEN special_from_date AND special_to_date\");\r\n $searchCollection->getSelect()->orWhere(\"'\" . date('Y-m-d') . \"' >= special_from_date\");\r\n// echo $searchCollection->getSelect()->__toString();\r\n return $searchCollection->load();\r\n }", "public function queryGetPriceAndOldPrice($content){\n $vector = array();\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $atributoValue = \"tiempo-entrega-div\";\n $tag = \"div\";\n $consulta = \"//\".$tag.\"[@class='\".$atributoValue.\"']\";\n $objeto = $xpath->query($consulta);\n if ($objeto->length > 0){\n foreach($objeto as $tiempoEntrega){\n $itemType = $tiempoEntrega->nextSibling->nextSibling;\n $res = $itemType->getElementsByTagName(\"div\");\n if ($res->length > 0){\n foreach($res as $div){\n if ($div->hasAttribute(\"class\") && $div->getAttribute(\"class\") == \"price-box\"){\n $plist = $div->getElementsByTagName(\"p\");\n $contador = 0;\n if ($plist->length > 0){\n foreach($plist as $p){\n if ($p->hasAttribute(\"class\") && $p->getAttribute(\"class\") == \"old-price\"){\n $oldPrecio = $p->nodeValue;\n $oldPrecio = rtrim(ltrim($oldPrecio));\n //echo \"Precio antiguo: \".$oldPrecio.\"<br>\";\n $vector[\"Wholesale price\"] = $oldPrecio;\n }else if ($p->hasAttribute(\"class\") && $p->getAttribute(\"class\") == \"special-price\"){\n $precio = $p->nodeValue;\n //echo \"Precio: \".$precio.\"<br>\";\n $precio = rtrim(ltrim($precio));\n $vector[\"Price\"] = $precio;\n }\n $contador++;\n }\n }\n }\n }\n }\n }\n }\n return $vector;\n }", "function fetch_prices()\n {\n $data = $this->db->query('SELECT * FROM `users_prices` WHERE users_price_order != 999 ORDER BY users_price_order ASC');\n if (!isset($data[0])) {\n return false;\n }\n return $data;\n }", "abstract public function getPrice();", "private function getArticles() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $articles = $this->bankReg->gets($param);\n\n return $articles;\n }" ]
[ "0.6200982", "0.60140014", "0.5939101", "0.59219176", "0.5886626", "0.5885477", "0.5862881", "0.58464456", "0.58153224", "0.58022964", "0.5794529", "0.5792218", "0.5784905", "0.5762046", "0.57498837", "0.57229894", "0.5713007", "0.5704714", "0.5704714", "0.5704714", "0.5704714", "0.57027805", "0.5690881", "0.5677589", "0.5639742", "0.56306934", "0.55949134", "0.5570488", "0.55527455", "0.5532447" ]
0.6764404
0
evaluates the cheapest article for current product by gross price
function getCheapestArticle($usePriceNet=0) { $this->load_articles(); $priceArr = array(); if (!is_array($this->articles_uids)) return false; for($j=0;$j<count($this->articles_uids);$j++) { $priceArr[$this->articles[$this->articles_uids[$j]]->get_uid()] = ($usePriceNet) ? $this->articles[$this->articles_uids[$j]]->get_price_net() : $this->articles[$this->articles_uids[$j]]->get_price_gross(); } asort($priceArr); reset($priceArr); foreach($priceArr as $key => $value) { return $key; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCheapestPriceWithPriceGroupAndFirstGraduation()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, false);\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => false,\n ]);\n\n static::assertEquals(90, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function testCheapestPriceWithPriceGroupAndLastGraduation()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, false, [\n ['key' => $context->getCurrentCustomerGroup()->getKey(), 'quantity' => 1, 'discount' => 10],\n ['key' => $context->getCurrentCustomerGroup()->getKey(), 'quantity' => 20, 'discount' => 20],\n ]);\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n static::assertEquals(80, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "function getPriceMin($game_id, $round_number, $product_number, $region_number, $channel_number){\r\n\t\t\t$prices=new Model_DbTable_Decisions_Mk_Prices();\r\n\t\t\t$min=0;\r\n\t\t\t$min_counter=0;\r\n\t\t\t$companies=$this->getCompaniesInGame($game_id);\r\n\t\t\tforeach ($companies as $company) {\r\n\t\t\t\t$result=$prices->getDecision($game_id, $company['id'], $round_number);\r\n\t\t\t\t$result_product=$result['product_'.$product_number];\r\n\t\t\t\t$result_channel=$result_product['channel_'.$channel_number];\r\n\t\t\t\t$result_region=$result_channel['region_'.$region_number];\r\n\t\t\t\t$price=$result_region;\r\n\t\t\t\tif($min_counter==0){\r\n\t\t\t\t\t$min=$price;\r\n\t\t\t\t\t$min_counter++;\r\n\t\t\t\t}\r\n\t\t\t\tif($price<$min){\r\n\t\t\t\t\t$min=$price;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $min;\r\n\t\t}", "public function getBestPrice() {\n\t\ttry {\n\t\t\treturn Mage::getSingleton ( 'meinpaket/service_productData_requestService' )->requestBestPrices ();\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\treturn null;\n\t}", "public function getMinPrice();", "private function getLowestPrice()\n {\n $prices = array();\n foreach ($this->performances as $performance) {\n $ticketClasses = $performance->getTicketClass();\n foreach ($ticketClasses as $ticketClass) {\n $prices[] = ($ticketClass->getPrice()) ? $ticketClass->getPrice() : 0;\n }\n }\n sort($prices);\n\n return (float)$prices[0];\n }", "public function cheapestProduct()\n {\n return $this->productsSortedByCheapest()[0] ?? null;\n }", "public function testPriceGroupWithVariantsAndFirstGraduation()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => false,\n ]);\n\n static::assertEquals(9, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function get_min_product_price()\n\t{\n\t\t$this->db->select('MIN(product_selling_price) AS price')->from('product')->where(\"product_status = 1\");\n\t\t$query = $this->db->get();\n\t\t$result = $query->row();\n\t\t\n\t\treturn $result->price;\n\t}", "public function getBestBuyPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.pb-hero-price')->each(function($node){\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.pb-regular-price')->each(function($node){\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "function getMinPrice($idGame){\n\n\t\treturn 21;\n\t}", "public function requestBestPrices() {\n\t\t/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */\n\t\t$productDataRequest = Mage::getModel ( 'meinpaketcommon/xml_request_dataRequest' );\n\t\t\n\t\t/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */\n\t\t$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );\n\t\t\n\t\ttry {\n\t\t\t/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */\n\t\t\t$collection = Mage::getModel ( 'catalog/product' )->getCollection ()->addStoreFilter ( Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStoreId () );\n\t\t\t\n\t\t\t$collection->addAttributeToFilter ( 'meinpaket_id', array (\n\t\t\t\t\t'neq' => '' \n\t\t\t) );\n\t\t\t$collection->addAttributeToFilter ( 'sync_with_dhl_mein_paket', array (\n\t\t\t\t\t'gt' => '0' \n\t\t\t) );\n\t\t\t\n\t\t\tforeach ( $collection as $productId ) {\n\t\t\t\t$productDataRequest->addBestPriceProduct ( $productId );\n\t\t\t}\n\t\t\treturn $response = $client->send ( $productDataRequest, true );\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function get_best_sales_info($a) {\n\n $op = new product();\n \n for( $i = 0; $i < BEST_SALES; $i++ ) {\n $op->get_best_sale($a[$i], $i);\n }\n \n return $op;\n \n}", "public function bestProductsAction()\n\t{\n $this->checkShopToken();\n\t\t\n\t\t$config = EasymarketingConfig::getInstance();\n \n $limit = Shopware()->Front()->Request()->getParam('limit');\n $most_sold_since = Shopware()->Front()->Request()->getParam('most_sold_since');\n $most_sold_since_date = date('Y-m-d H:i:s', $most_sold_since);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t$pids = Shopware()->Db()->fetchAll(\"SELECT sacro.articleID AS id, (SELECT SUM(od.quantity) FROM s_order_details od WHERE od.articleID = sacro.articleID AND od.modus = 0) as sales\n\t\t\t\t\t\t\t\t\t\t\t\tFROM s_articles_categories_ro sacro \n INNER JOIN s_order_details od ON sacro.articleID = od.articleID\n \t\t\t\t\t\t\t\tINNER JOIN s_order o ON od.orderID = o.id\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN s_articles sa ON od.articleID = sa.id\n WHERE o.ordertime > '\".$most_sold_since_date.\"' AND sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"')\n GROUP BY sacro.articleID\n \t\t\t\t\t\t\t\tORDER BY SUM(od.quantity) DESC\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \".$limit);\n\t\t\t\t\t\t\t\t\t\t\t\n $i = 0;\n\t\t\n\t\t$productsdata = array();\n\t\t\n\t\tif(count($pids) > 0)\n\t\t{\n\t\t\tforeach ($pids as $key => $val)\n\t\t\t{\n\t\t\t\t$productsdata[$i] = array('id' => $val['id'], 'sales' => (int)$val['sales']);\n\t\t\t\t$i++;\n\t\t\t} \n\t\t} else {\n\t\t\t$test_product_id = Shopware()->Db()->fetchOne(\"SELECT sacro.articleID AS id FROM s_articles_categories_ro sacro LEFT JOIN s_articles sa ON sa.id = sacro.articleID WHERE sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"') GROUP BY sacro.articleID ORDER BY sacro.articleID LIMIT 1\");\n\t\t\t$productsdata[0] = array('id' => $test_product_id['id'], 'sales' => 0);\n\t\t}\n\t\t\n $jsondata = array(\n 'limit' => $limit,\n 'most_sold_since' => $most_sold_since,\n 'products' => $productsdata\n );\n \n\t\t$this->printOutput($jsondata);\n }", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "function best_selling_products_function( $args ) {\n\t$args = [\n\t\t'post_type'\t\t\t=> 'product',\n\t\t'meta_key' \t\t\t=> 'total_sales',\n\t\t'orderby'\t\t\t=> 'meta_value_num',\n\t\t'posts_per_page'\t=> 10\n\t];\n\n\t$loop = new WP_Query($args);\n\n\tif ( $loop->have_posts() ) {\n\t\techo '\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Title</th>\n\t\t\t\t\t<th>Description</th>\n\t\t\t\t\t<th>Price</th>\n\t\t\t\t</tr>\n\t\t';\n\n\t\twhile ( $loop->have_posts() ) : $loop->the_post();\n\t\t\tglobal $product;\n\n\t\t\techo '\n\t\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"'. get_the_permalink() .'\">' . get_the_title() . '</a></td>\n\t\t\t\t\t<td>' . get_the_excerpt() . '</td>\n\t\t\t\t\t<td>' . $product->get_price() . '</td>\n\t\t\t\t</tr>\n\t\t\t';\n\t\tendwhile;\n\n\t\techo '</table>';\t\n\n\t} else {\n\t\techo __( 'No products found' );\n\t}\n\n\twp_reset_postdata();\n}", "public function setBestPrice($product_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta WHERE post_id=:product_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n $tag_prices = $this->productPrice();\n $theBest = ['price' => 0];\n $otherPrices = [];\n $hasChanged = false;\n\n // Obtiene el mejor precio anterior\n foreach ($response as $metadata) {\n // Mejor precio\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'price_best') {\n $theBest['price'] = $metadata['meta_value'];\n }\n\n // Mejor tienda\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'best_shop') {\n $theBest['shop'] = $metadata['meta_value'];\n }\n\n // Obtiene el precio de otras tiendas\n foreach ($tag_prices as $price) {\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == $price) {\n $otherPrices[$price] = (int) $metadata['meta_value'];\n }\n }\n }\n\n $oldPrice = $theBest['price'];\n // Obtiene el nuevo mejor precio\n foreach ($otherPrices as $store => $price) {\n if (($price > 0) && ($price < $theBest['price'])) {\n $theBest['price'] = $price;\n $theBest['shop'] = $store;\n $hasChanged = true;\n }\n }\n\n // Si el mejor precio cambio, lo actualiza y lo guarda en el historial\n if ($hasChanged) {\n $query = \"INSERT INTO dw_historial (product_id, price_old, price_new, created_at) VALUES \n (:product_id, :price_old, :price_new, NOW());\";\n $stm2 = $this->db->prepare($query);\n $stm2->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm2->bindValue(\":price_old\", $oldPrice, PDO::PARAM_INT);\n $stm2->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm2->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:price_new WHERE post_id=:product_id AND meta_key='price_best';\";\n $stm3 = $this->db->prepare($query);\n $stm3->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm3->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm3->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:best_shop WHERE post_id=:product_id AND meta_key='best_shop';\";\n $stm4 = $this->db->prepare($query);\n $stm4->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm4->bindValue(\":best_shop\", $theBest['shop'], PDO::PARAM_STR);\n $stm4->execute();\n }\n }", "public function display_minimum_price( $product = false ) {\r\n\r\n\t\t$product = WC_Name_Your_Price_Helpers::maybe_get_product_instance( $product );\r\n\r\n\t\tif ( ! $product ) {\r\n\t\t\tglobal $product;\r\n\t\t}\r\n\r\n\t\t$minimum_price_html = WC_Name_Your_Price_Helpers::get_minimum_price_html( $product );\r\n\r\n\t\tif ( ! $minimum_price_html && ! WC_Name_Your_Price_Helpers::has_nyp( $product ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get the minimum price template.\r\n\t\twc_get_template(\r\n\t\t\t'single-product/minimum-price.php',\r\n\t\t\tarray(\r\n\t\t\t\t'product_id' => $product->get_id(),\r\n\t\t\t\t'nyp_product' => $product,\r\n\t\t\t\t'counter' => WC_Name_Your_Price_Helpers::get_counter(),\r\n\t\t\t),\r\n\t\t\tfalse,\r\n\t\t\tWC_Name_Your_Price()->plugin_path() . '/templates/'\r\n\t\t);\r\n\r\n\t}", "function getMinOffersPrice($offers) {\n\t$minPrice = 0;\n\tforeach ($offers as $key => $offer) {\n\t\tif ($offer['ITEM_PRICES'][0]['PRICE']) {\n\t\t\tif ($minPrice == 0 || $minPrice > $offer['ITEM_PRICES'][0]['PRICE']) {\n\t\t\t\t$minPrice = $offer['ITEM_PRICES'][0]['PRICE'];\n\t\t\t}\n\t\t}\n\t}\n\treturn $minPrice;\n}", "public function checkTheLatestDiscountOrHotOffer()\n {\n $discount = Product_sale::where('product_id',$this->id)->orderBy('id','desc')->get()->first();\n $hotoffer = Product_HotOffer::where('product_id',$this->id)->orderBy('id','desc')->get()->first();\n\n if ($discount != null && $hotoffer != null) {\n $discountDate = \\Carbon\\Carbon::parse($discount->created_at);\n $hotofferDate = \\Carbon\\Carbon::parse($hotoffer->created_at);\n $result = $hotofferDate->min($discountDate);\n\n if ($result == $discount->created_at) {\n $hotoffer['type'] = 'hotoffer';\n return $hotoffer;\n }else{\n $discount['type'] = 'discount';\n return $discount;\n }\n }\n\n elseif ($discount != null && $hotoffer == null) {\n $discount['type'] = 'discount';\n return $discount;\n }\n\n elseif ($discount == null && $hotoffer != null) {\n $hotoffer['type'] = 'hotoffer';\n return $hotoffer;\n }\n\n else {\n return null;\n }\n \n\n }", "public function testFilterMinimumPrice()\n {\n $this->visit('/properties')\n ->type('4500000', '#minPrice')\n ->press('Update results')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n $this->notSee('Shack in the desert');\n }", "function getMinPrice(){\r\n $q = \"SELECT * FROM minimum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "function cheapest($vendors_id='1') {\n if (is_array($this->modules[$vendors_id])) {\n $rates = array();\n\n reset($this->modules[$vendors_id]);\n foreach ($this->modules[$vendors_id] as $value) {\n $class = substr($value, 0, strrpos($value, '.'));\n\n if ($GLOBALS[$class]->enabled($vendors_id)) {\n $quotes = $GLOBALS[$class]->quote('', '', $vendors_id);\n\n for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {\n if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {\n $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],\n 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',\n 'cost' => $quotes['methods'][$i]['cost']);\n }\n }\n }\n }\n\n $cheapest = false;\n for ($i=0, $n=sizeof($rates); $i<$n; $i++) {\n if (is_array($cheapest)) {\n if ($rates[$i]['cost'] < $cheapest['cost']) {\n $cheapest = $rates[$i];\n }\n } else {\n $cheapest = $rates[$i];\n }\n }\n\n return $cheapest;\n }\n }", "public function getMinimumQuantity()\n {\n $this->load('product');\n $minimum = $this->product->price()\n ->where('date_start', '<=', 'NOW()')\n ->whereRaw('(date_end > NOW() OR date_end IS NULL)')\n ->where('site_id', $this->invoice->getBaseSiteId())\n ->orderBy('min_quantity')\n ->first();\n return $minimum->min_quantity;\n }", "public function getMaxPrice();", "public function resolvePrice();", "public function getFirst(){\n return ($this->page > 1) ? ($this->page * $this->amountArticle) - $this->amountArticle : 0;\n }", "static public function adjustLowestPriceForProducts( $items = false, $verbose = false ) {\n\n $items = $items ? $items : WPLA_ListingQueryHelper::getItemsWithMinMaxAndLowestPrice();\n $changed_product_ids = array();\n $repricing_margin = floatval( get_option('wpla_repricing_margin') );\n $lowest_offer_mode = get_option('wpla_repricing_use_lowest_offer',0);\n $repricing_snh_fee = floatval( get_option('wpla_repricing_shipping') ); // shipping and handling\n\n // loop found listings\n foreach ( $items as $item ) {\n\n // make sure there is a product - and min/max prices are set (0 != NULL)\n if ( ! $item->post_id ) continue;\n if ( ! $item->min_price ) continue;\n if ( ! $item->max_price ) continue;\n if ( ! $item->buybox_price && ! $item->compet_price ) continue;\n \n WPLA()->logger->debug( 'adjustLowestPrice for '. $item->sku );\n\n // build target price from BuyBox and/or competitor price\n if ( $item->buybox_price && ! $item->has_buybox ) {\n \n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // apply undercut to competitor price - if competitor price is different from BuyBox price\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n\n } else {\n\n // apply undercut to BuyBox price - if there is a BuyBox price and it's not the seller's\n $target_price = $item->buybox_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n\n }\n \n } elseif ( $item->buybox_price && $item->has_buybox && $item->compet_price ) {\n\n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // seller has BuyBox and there is competition - apply undercut to competitor price (beta)\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n // seller has BuyBox and there is competition - keep price for now\n $target_price = $item->buybox_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n\n }\n\n } elseif ( $item->buybox_price && $item->has_buybox && ! $item->compet_price ) {\n \n // seller has BuyBox and NO competition - fall back to max_price\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n\n } elseif ( $item->compet_price ) {\n \n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n\n }\n\n $target_price = apply_filters( 'wpla_before_reprice_item', $target_price, $item );\n\n $target_price = round( $target_price, 2 );\n\n\n // update price\n $price_was_changed = self::updateAmazonPrice( $item, $target_price, $verbose );\n if ( $price_was_changed ) {\n $changed_product_ids[] = $item->post_id;\n WPLA()->logger->info('adjustLowestPriceForProducts() - new price for #'.$item->sku.': '.$target_price);\n }\n\n } // foreach item\n\n // echo \"<pre>\";print_r($changed_product_ids);echo\"</pre>\";#die();\n // echo \"<pre>\";print_r($items);echo\"</pre>\";die();\n\n return $changed_product_ids;\n }", "private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }", "static function getSiteMinPrice() {\n return self::getMetaValueRange(PostProperty::META_PRICE);\n }" ]
[ "0.71357703", "0.65849596", "0.65541136", "0.6515964", "0.64531046", "0.64184105", "0.63768584", "0.62288857", "0.60383654", "0.6008195", "0.60037476", "0.59870887", "0.5959846", "0.5954018", "0.5912183", "0.5890451", "0.58872116", "0.58798563", "0.5873852", "0.5779226", "0.57506907", "0.5727128", "0.5714396", "0.56902105", "0.5681266", "0.5670646", "0.56694126", "0.5648751", "0.56215256", "0.5619621" ]
0.68647003
1
Returns the Manufacturer UID of the Product if set
function getManufacturerUid() { if(isset($this->manufacturer_uid)) { return $this->manufacturer_uid; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getManufacturer()\n {\n if (array_key_exists(\"manufacturer\", $this->_propDict)) {\n return $this->_propDict[\"manufacturer\"];\n } else {\n return null;\n }\n }", "public function getManufacturer()\n {\n if (array_key_exists(\"manufacturer\", $this->_propDict)) {\n return $this->_propDict[\"manufacturer\"];\n } else {\n return null;\n }\n }", "private function getManufacturer($product)\n { \n $manufacturers= $product->manufacturers;\n\n if(!$manufacturers->isEmpty())\n {\n $manufacturerName=NULL;\n\n foreach ($manufacturers as $manufacturer) {\n\n $manufacturerName .= $manufacturer->manufacturer_name. '+';\n }\n return trim($manufacturerName,'+');\n }\n else\n {\n return NULL;\n }\n }", "public function getManufacturer()\n {\n if ($this->_oManufacturer === null) {\n $this->_oManufacturer = $this->getProduct()->getManufacturer(false);\n }\n\n return $this->_oManufacturer;\n }", "public function getDeviceManufacturer() {}", "public function getManufacturer()\n {\n return $this->manufacturer;\n }", "public function getDeviceManufacturer()\n {\n return $this->deviceManufacturer;\n }", "public function getManufacturerName()\n {\n $oManufacturer = $this->getManufacturer();\n\n if ($oManufacturer instanceof oxManufacturer) {\n return $oManufacturer->getTitle();\n }\n\n return null;\n }", "public function getManufacturer()\n {\n }", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "function getManufacturerTitle() {\n \tif ($this->getManufacturerUid()) {\n \t\treturn $this->conn_db->getManufacturerTitle($this->getManufacturerUid());\n \t}\n \t\n }", "function getEditableManufacturerID()\n {\n return $this->editableManufacturerID;\n }", "private function getManufacturer($variation):string\n {\n if(isset($this->manufacturerCache) && array_key_exists($variation['data']['item']['manufacturer']['id'], $this->manufacturerCache))\n {\n return $this->manufacturerCache[$variation['data']['item']['manufacturer']['id']];\n }\n return '';\n }", "function getProductuuid()\n {\n return $this->product_uuid;\n }", "public function getProductuuid(){\n return $this->productuuid;\n }", "public function product_manufacturer_check($product_id,$manufacturer_id)\n\t{\n\t $this->db->select('*');\n\t $this->db->from('product_information');\n\t $this->db->where('product_id',$product_id);\n\t $this->db->where('manufacturer_id',$manufacturer_id);\t\n\t $query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn true;\t\n\t\t}\n\t\treturn 0;\n\t}", "public function getProductSKU()\n {\n }", "public function getIosVendorId();", "public function getUniqueKey()\n\t{\n\t\t$product = $this->getCurrent();\n\t\t\n\t\tif (is_null($product)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$sku = $product->getSku();\n\t\tMage::log(\"Got SKU: $sku\");\n\t\t\n\t\treturn $sku;\n\t}", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function getVendor()\n {\n if ($this->_oVendor === null) {\n $this->_oVendor = $this->getProduct()->getVendor(false);\n }\n\n return $this->_oVendor;\n }", "function fetchManufacturer($Hersteller)\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Name FROM \" . PREFIX . \"_modul_shop_hersteller WHERE Id = '$Hersteller' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\treturn @$row->Name;\r\n\t}", "public function getProductOwner()\n {\n return $this->productOwner;\n }", "public function getManufacturerIdByProductDescription($description)\r\n {\r\n Assert::string($description);\r\n $description = ' ' . strtoupper($description) . ' ';\r\n $description = str_replace(',', ' ', $description);\r\n foreach ($this->manufacturers as $name => $id) {\r\n if (preg_match('/\\s' . $name . '\\s/', $description)) {\r\n return $id;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function getProductID()\n {\n if ($product = $this->Product()) {\n return $product->ID;\n }\n return 0;\n }", "public function model()\n {\n return Manufacturer::class;\n }", "public function getVendorId() {}", "public function getDeviceVendor()\n {\n if (array_key_exists(\"deviceVendor\", $this->_propDict)) {\n if (is_a($this->_propDict[\"deviceVendor\"], \"\\Beta\\Microsoft\\Graph\\Networkaccess\\Model\\DeviceVendor\") || is_null($this->_propDict[\"deviceVendor\"])) {\n return $this->_propDict[\"deviceVendor\"];\n } else {\n $this->_propDict[\"deviceVendor\"] = new DeviceVendor($this->_propDict[\"deviceVendor\"]);\n return $this->_propDict[\"deviceVendor\"];\n }\n }\n return null;\n }", "public function Website_Model_Manufacturer ( $idManufacturer = NULL ) {\n\t\tif (! empty ( $idManufacturer )) {\n\t\t\t$table = Website_Model_CbFactory::factory('Website_Model_MysqlTable','manufacturer');\n\t\t\t$manufacturer = $table->fetchRow ( 'id=' . $idManufacturer ) ;\n\t\t\t// if manufacturer does not exist\n\t\t\tif(!$manufacturer){\n\t\t\t\tthrow new Website_Model_ManufacturerException('Id_Wrong');\n\t\t\t}\n\t\t\t$this->id \t\t\t= $manufacturer->id ;\n\t\t\t$this->name \t\t= $manufacturer->name;\n\t\t\t$this->website\t\t= $manufacturer->website;\n\t\t\t$this->country \t\t= $manufacturer->country;\n\t\t\t$this->insertDate \t= $manufacturer->insertDate;\n\t\t\t$this->updateDate \t= $manufacturer->updateDate;\n\t\t}\n\t}", "public function isManufacturer( $manufacturer_name ) {\n $query = $this->db->query( \"SELECT DISTINCT manufacturer_id FROM \" . DB_PREFIX . \"manufacturer WHERE name = '\" . $manufacturer_name . \"'\" );\n\n return $query->row;\n }" ]
[ "0.7528648", "0.7528648", "0.725426", "0.70974326", "0.70958126", "0.70703304", "0.69598025", "0.65373385", "0.6519467", "0.64012724", "0.6361478", "0.60444015", "0.60313296", "0.59812725", "0.59191614", "0.5774094", "0.5754923", "0.57229954", "0.5695732", "0.56614596", "0.5597589", "0.55957055", "0.556213", "0.55541974", "0.5531987", "0.55160266", "0.55035216", "0.5503402", "0.5495153", "0.5486069" ]
0.8239274
0
Returns true if one Article of Product have more than null articles on stock
function hasStock() { $this->load_articles(); foreach ( $this->articles as $articleObj ) { if ( $articleObj->getStock() > 0 ) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inStock()\n {\n return $this->stockCount() > 0;\n }", "public function hasProduct()\n {\n return $this->Product !== null;\n }", "public function isNewPossible()\n {\n // Check if ProductsModels exist\n $productmodels = $this->em->getRepository('ValentinStockBundle:Material')->countRecords();\n\n return ($productmodels > 0) ? true : false;\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function ifConditionement_articleexiste($id_article_en_stock){\n\t\t\t\t\t$sql = \"SELECT * FROM conditionement_article WHERE id_article_en_stock='\".$id_article_en_stock.\"' \";\n\t\t\t\t\tif($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t if($this->db->query($sql)->fetch() != null)\n\t\t\t\t\t {\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t } \n\t\t\t\t\treturn false;\n\t\t\t\t\t }", "public function hasPushedProducts() {\n return sizeof($this->pushedProducts) > 0;\n }", "public function hasArtifacts(): bool {\n return $this->fetchInventory()->filter(function ($slot) {\n return $slot->item->type === 'artifact' && $slot->equipped;\n })->isNotEmpty();\n }", "protected function _usedInSales()\n {\n $rowset = $this->findDependentRowset('\\Ppb\\Db\\Table\\Sales');\n if (count($rowset) > 0) {\n return true;\n }\n\n return false;\n }", "public function hasProductInfos(){\n return $this->_has(1);\n }", "public function getInStockAttribute()\n {\n return $this->quantity > 0;\n }", "public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }", "public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }", "public function IsForSale() {\n\treturn ($this->QtyInStock() > 0) || ($this->QtyAvailable() > 0);\n }", "private function checkProducts()\n {\n $products = Product::with('prices')->get();\n $errors = [];\n foreach ($products as $product) {\n $basePrice = $product->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The product \"%s (%s)\" has no price set for your default currency.',\n $product->name,\n $product->id\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "public function hasEntitiesList()\n {\n return $this->Entities !== null;\n }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isInStock()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED;\n }", "public function checkProductsAvailability()\n {\n if ($this->hasProducts()) {\n $basketProducts = $this->getBasketProductsJoinProduct();\n \n foreach ($basketProducts as $basketProduct) {\n $product = $basketProduct->getProduct();\n $optionIds = null;\n if($basketProduct->getOptionsList() != '')\n $optionIds = explode(',',$basketProduct->getOptionsList());\n if (!$product->getIsActive() || $product->getIsDeleted()) {\n $this->unavailabilityProducts['deleted'] = $product->getId();\n $basketProduct->delete();\n }\n else if($product->getProductQuantity($optionIds) < $basketProduct->getQuantity()) {\n if(!$product->getAllowOutOfStock())\n $this->unavailabilityProducts['insufficiently'] = $product->getId();\n }\n }\n }\n \n if (!empty($this->unavailabilityProducts)) {\n return false;\n }\n else {\n return true;\n }\n }", "private function getExistProductRecount() {\n return false;\n }", "public function testIfStockManagementHasProductId()\n {\n $this->assertNotNull($this->stock->getProductId());\n }", "public function outOfStock($entityIds){\r\n $productSellerId = Mage::getModel ( 'catalog/product' )->load ( $entityIds )->getSellerId ();\r\n if ($productSellerId == Mage::getSingleton ( 'customer/session' )->getCustomerId ()) {\r\n $_Product = Mage::getModel ( 'catalog/product' )->load($entityIds);\r\n $stockData = array ();\r\n $_Product->setStatus('2'); \r\n $_Product->setSeller_product_status('1027'); // sold out status \r\n $stockData ['qty'] = 0;\r\n $stockData ['is_in_stock'] = 0;\r\n $_Product->setStockData ( $stockData );\r\n //Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n //$storeId = Mage::app ()->getStore ()->getStoreId (); \r\n $_Product->save (); \r\n return true;\r\n }\r\n \r\n }", "public function hasQuantity(): bool;", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function hasInvoiceItems(): bool\n {\n return ($this->invoices()->count() !== 0) ? true : false;\n }", "public function checkTransaction()\n {\n $model = $this->hasMany(LogWarehouse::className(),['parts_accessories_id'=>'_id'])->count();\n if($model>0){\n return true;\n } else {\n return false;\n }\n }", "public function hasAmountsInc()\n {\n return $this->AmountsInc !== null;\n }" ]
[ "0.6768415", "0.6678424", "0.6629216", "0.63930917", "0.63930917", "0.63930917", "0.63930917", "0.63930917", "0.61586046", "0.61142856", "0.599915", "0.59983176", "0.5958311", "0.5943573", "0.5891042", "0.58859366", "0.58571535", "0.58548343", "0.5835261", "0.5815653", "0.5802326", "0.5793415", "0.579241", "0.5760233", "0.57542175", "0.5727196", "0.5720414", "0.5713415", "0.5709217", "0.569761" ]
0.75260586
0
gets the category master parent
function get_masterparent_categorie() { return $this->getMasterparentCategorie(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getCatParent() {\r\n $rCat = new Read;\r\n $rCat->ExeRead(\"ml_categories\", \"WHERE category_id = :id\", \"id={$this->Data['post_category']}\");\r\n if ($rCat->getResult()):\r\n return $rCat->getResult()[0]['category_parent'];\r\n else:\r\n return null;\r\n endif;\r\n }", "function getMasterparentCategorie()\n \t{\n \t\treturn $this->conn_db->get_parent_categorie($this->uid);\n \t\t \t\t\t\n \t}", "private function getCurrentParent()\n {\n return $this->getCurrentCategory()->getParentCategory();\n }", "public function Parent()\n\t{\n\t\treturn Category::findOrFail($this->category_id);\n\t}", "public function get_parent();", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function getParentId()\n {\n return $this->getValue('nb_commerce_product_category_parent_id');\n }", "public function parent() { return $this->post->post_parent; }", "protected function parentCategoryTC()\n {\n return PostCategory::parentCategories()->firstOrFail();\n }", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "protected function retrieveParent()\n {\n }", "public function getParentCategoryId()\n {\n return (int) $this->templateContext->getRequest()->getParam('parent');\n }", "public function getParentDc() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(1, $this->_result)) return (string) $this->_result[1];\n\t\t\telse parent::throwGetColException('Not set DiscussCategoriesModel::getParentDc', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From DiscussCategoriesModel::getParentDc', __LINE__, __FILE__);\n\t}", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function getParent_id() {\n\t\treturn $this->parent_id;\n\t}", "function get_parent_cat_info( $parent_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE category_id = \".$parent_id;\n\t\t$r = $this -> db -> getSingleRecord( $q );\n\t\tif( $r != false )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function get_parent_id() {\n\t\treturn $this->post->post_parent;\n\t}", "public function getParentID()\n {\n return $this->parent_id;\n }", "function get_parent_of_category($category_id) {\n\twhile($category_id) {\n\t\t$category = get_category($category_id); // get the object for the catid\n\t\t$category_id = $category->category_parent; // assign parent ID (if exists) to $catid\n\t\t\n\t\t$category_parent = $category->cat_ID;\n\t}\n\treturn get_category($category_parent);\n}", "public function parent()\n {\n return $this->belongsTo(Category::class, 'parent_id', 'id');\n }", "public function parent() {\n\t\treturn $this->hasOne(Forum::getSectionClass(), \"parent_id\");\n\t}", "public function parent()\r\n\t{\r\n\t\treturn $this->parent;\r\n\t}" ]
[ "0.82139903", "0.82107663", "0.81068027", "0.78660554", "0.7817735", "0.75415444", "0.7527914", "0.74861336", "0.7484013", "0.7484013", "0.74028236", "0.7191253", "0.7187461", "0.71427774", "0.70984685", "0.7075503", "0.70521474", "0.70477796", "0.7032655", "0.7028612", "0.7022764", "0.7021246", "0.7021246", "0.70179784", "0.7006598", "0.6995869", "0.6991604", "0.6943818", "0.69348025", "0.6914999" ]
0.8402889
0
returns the attribut matrix
function get_atrribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){ return $this->get_attribute_matrix($articleList, $attribute_include, $showHiddenValues,$sortingTable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_product_atrribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm'){\n \t\t\n \t\treturn $this->get_product_attribute_matrix($attribute_include, $showHiddenValues,$sortingTable );\n \t}", "public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }", "function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n\t \n\t \t\t$return_array=array();\n\t \t\t/**\n\t \t\t * if no list is given, take complate arctile-list from product\n\t \t\t */\n\t \n\t \n\t \t\tif ($this->uid>0) { \n\t \t\t\tif ($articleList==false){\n\t \t\t\t\t$articleList=$this->load_articles();\n\t \t\t\t}\n\t \n\t \t\tif (is_array($attribute_include)){\n\t \t\t\tif (!is_null($attribute_include[0])) {\n\t \t\t\t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t \t\t\t\t}\t\n\t \t\t\t}\n\t \t\t\tif(is_array($articleList) && count($articleList)>0) {\n\t \t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t \t\t\t}\n\t \n\t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t$addwhere = $addwhere2;\n\t \n\t \t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \n\t \t\t\t\t\t/** \n\t \t\t\t\t\t * Do the language overlay\n\t \t\t\t\t\t */\n\t \t\t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t \t\t\t\t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\n\t \t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\n\t \t\t\t\t\t\t\t);\n\t \n\t \n\t \t\t\t\t\t\t// Result should contain only one Dataset\n\t \t\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t \t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\tif (!is_array($return_data)){\n\t \t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t * No Translation possible, so next interation\n\t \t\t\t\t\t\t\t */\t\n\t \t\t\t\t\t\t\t\tcontinue;\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \n\t \n\t \n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$valueshown=false;\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t\t */\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t\t */\n\t \n\t \t\t\t\t\t$valuelist=array();\n\t\t\t\t\t\t$valueUidList = array();\n\t \t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t\t$article=$data['article'];\n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\t{\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t\t{\n\t \n\t \t\t\t\t\t\t\t\tif (strlen($value['value_char'])>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0)\t{\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['value_char'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t\t\t\t}else\t{\n\t \n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t} \t\t\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t{\n\t \n\t \t\t\t\t\t\t\t\tif ($value['default_value']>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0){\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif(strlen($lok_value['value_char'])>0) {\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \n\t \t\t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \n\t \t\t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t\t\t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t\t\tif (!is_array($row)){\n\t \t\t\t\t\t\t\t\t\t\tcontinue;\t\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \n\t \n\t \t\t\t\t\t\t\t\t\t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t\t $valueUidList[] = $row['uid'];\n\t \t\t\t\t\t\t\t\t\t $valueshown=true;\n\t \t\t\t\t\t\t\t\t }\n\t \n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif ($valueshown == false) {\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \n\t \t\t\t\t}\n\t \n\t \t\t\t\treturn $return_array;\n\t \t\t\t}\n\t \t\t}\n\t \t\treturn false;\n\t \n\t}", "public function getTextMatrix() {}", "abstract function attributes(): array;", "public function attributes() : array;", "public function attributions() {\n return $this->hasMany('Rockit\\Models\\Attribution');\n }", "public function getLineMatrix() {}", "function get_product_attribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm')\n \t{\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\t\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_products.uid as product ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' '.$addwhere.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\n\t \t\t\t\t\t\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_products_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t \t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['product'];\n\t \t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.default_value, tx_commerce_products.uid product_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif (strlen($value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\tif ($this->lang_uid>0)\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t */\n\t \t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_products',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_products_attributes_mm.default_value',\n\t\t\t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm, tx_commerce_products, tx_commerce_attributes',\n\t\t\t\t\t\t\t\t\t\t\"tx_commerce_products_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products_attributes_mm.uid_local=tx_commerce_products.uid and tx_commerce_products.sys_language_uid=\".$this->lang_uid.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products.uid>0 and tx_commerce_products.l18n_parent=\".$value['product_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t} \t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\"\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist'])\n\t \t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\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\t \t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t $valueUidList[] = $value['uid_valuelist'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==false){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' =>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\n\t \t\t\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public static function attributeMap();", "public function getFontMatrix() {}", "protected function attributes(): array\n {\n try {\n $attributes = [];\n $i = 0;\n foreach (static::$db_columns as $column) {\n $attributes[$column] = $this->$column;\n $i++;\n }\n return $attributes;\n } catch (Exception $e) {\n die(\"Error \" . $e);\n }\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "function getAttributes()\n {\n }", "public function getAtributos() {\r\n\t\t\t\r\n\t\t\t$atributos = array();\r\n\t\t\t$atributos[0] = \"nombreUnidad\";\r\n\t\t\t$atributos[1] = \"telefono\";\r\n\t\t\treturn $atributos;\r\n\t\t}", "public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }", "public function getAttributes() {}", "public function getAttributes() {}" ]
[ "0.68148863", "0.630815", "0.62820375", "0.61913097", "0.6079845", "0.60049546", "0.5974234", "0.594213", "0.5879482", "0.58509153", "0.58509153", "0.58509153", "0.58509153", "0.58270425", "0.58021057", "0.5724545", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.5715498", "0.56648624", "0.56392664", "0.5593186", "0.55912083", "0.5590903" ]
0.700024
0
Generates a Matrix fro these concerning products for all Attributes and the values therfor Realy complex array, so have a lokk at the source
function get_product_atrribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm'){ return $this->get_product_attribute_matrix($attribute_include, $showHiddenValues,$sortingTable ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_product_attribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm')\n \t{\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\t\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_products.uid as product ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' '.$addwhere.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\n\t \t\t\t\t\t\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_products_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t \t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['product'];\n\t \t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.default_value, tx_commerce_products.uid product_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t \t\t\t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif (strlen($value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\tif ($this->lang_uid>0)\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t */\n\t \t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_products',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_products_attributes_mm.default_value',\n\t\t\t\t\t\t\t\t\t\t'tx_commerce_products_attributes_mm, tx_commerce_products, tx_commerce_attributes',\n\t\t\t\t\t\t\t\t\t\t\"tx_commerce_products_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products_attributes_mm.uid_local=tx_commerce_products.uid and tx_commerce_products.sys_language_uid=\".$this->lang_uid.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_products.uid>0 and tx_commerce_products.l18n_parent=\".$value['product_uid'].\n\t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t\t\t\t\t\t\t\t\t\t$valueUidList[] = 0;\n\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t} \t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_products_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_products',\n\t \t\t\t\t\t\t'tx_commerce_products_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_products.uid = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\"\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\n\t \t\t\t\t{\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist'])\n\t \t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\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\t \t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t $valueUidList[] = $value['uid_valuelist'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==false){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' =>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\n\t \t\t\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function create_calculation_array_matrix(){\n\t\t/*\n\t\t* Public and private sets of date for more complex frontend managament\n\t\t*/\n\t\t$calculation_array_matrix = array(\n\t\t\t\"public\" => array(\n\t\t\t\t'calc' => array()\n\t\t\t),\n\t\t\t\"auth\" => array(\n\t\t\t\t'calc_details' => array()\n\t\t\t)\n\t\t);\n\t\treturn $calculation_array_matrix;\n\t}", "public function product() : ColumnVector\n {\n return ColumnVector::quick(array_map('array_product', $this->a));\n }", "function get_attribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n\t \n\t \t\t$return_array=array();\n\t \t\t/**\n\t \t\t * if no list is given, take complate arctile-list from product\n\t \t\t */\n\t \n\t \n\t \t\tif ($this->uid>0) { \n\t \t\t\tif ($articleList==false){\n\t \t\t\t\t$articleList=$this->load_articles();\n\t \t\t\t}\n\t \n\t \t\tif (is_array($attribute_include)){\n\t \t\t\tif (!is_null($attribute_include[0])) {\n\t \t\t\t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t \t\t\t\t}\t\n\t \t\t\t}\n\t \t\t\tif(is_array($articleList) && count($articleList)>0) {\n\t \t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t \t\t\t}\n\t \n\t \t\t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t$addwhere = $addwhere2;\n\t \n\t \t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \n\t \t\t\t\t\t/** \n\t \t\t\t\t\t * Do the language overlay\n\t \t\t\t\t\t */\n\t \t\t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t \t\t\t\t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\n\t \t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\n\t \t\t\t\t\t\t\t);\n\t \n\t \n\t \t\t\t\t\t\t// Result should contain only one Dataset\n\t \t\t\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t \t\t\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t \t\t\t\t\t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\tif (!is_array($return_data)){\n\t \t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t * No Translation possible, so next interation\n\t \t\t\t\t\t\t\t */\t\n\t \t\t\t\t\t\t\t\tcontinue;\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \n\t \n\t \n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$valueshown=false;\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * get the different possible values form value_char an value\n\t \t\t\t\t\t */\n\t \t\t\t\t\t/**\n\t \t\t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t\t */\n\t \n\t \t\t\t\t\t$valuelist=array();\n\t\t\t\t\t\t$valueUidList = array();\n\t \t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t\t$article=$data['article'];\n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' AND tx_commerce_attributes.uid='.$attribute_uid.$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0))\t{\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t\t{\n\t \n\t \t\t\t\t\t\t\t\tif (strlen($value['value_char'])>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0)\t{\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.value_char, tx_commerce_articles_article_attributes_mm.default_value',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.uid_product>0 and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['value_char'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \n\t \t\t\t\t\t\t\t\t\t}else\t{\n\t \n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t} \t\t\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles.uid article_uid, tx_commerce_attributes.uid attribute_uid ',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value))\t{\n\t \n\t \t\t\t\t\t\t\t\tif ($value['default_value']>0)\t{\n\t \n\t \t\t\t\t\t\t\t\t\tif ($this->lang_uid>0){\n\t \t\t\t\t\t\t\t\t\t\t/**\n\t \t\t\t\t\t\t\t\t\t\t * Do the lokalization\n\t \t\t\t\t\t\t\t\t\t\t */\n\t \n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_attributes = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$proofSQL_articles = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_articles',$GLOBALS['TSFE']->showHiddenRecords);\n\t \t\t\t\t\t\t\t\t\t\t$res_value_lok=$GLOBALS['TYPO3_DB']->exec_SELECTquery('distinct tx_commerce_articles_article_attributes_mm.default_value, tx_commerce_articles_article_attributes_mm.value_char',\n\t \t\t\t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm, tx_commerce_articles, tx_commerce_attributes',\n\t \t\t\t\t\t\t\t\t\t\t\"tx_commerce_articles_article_attributes_mm.uid_foreign=\".$value['attribute_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles_article_attributes_mm.uid_local=tx_commerce_articles.uid and tx_commerce_articles.sys_language_uid=\".$this->lang_uid.\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" and tx_commerce_articles.l18n_parent=\".$value['article_uid'].\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\" \".$proofSQL_attributes.$proofSQL_articles\n\t \t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\t\t\t\tif (($res_value_lok) && ($GLOBALS['TYPO3_DB']->sql_num_rows($res_value_lok)>0)) {\n\t \t\t\t\t\t\t\t\t\t\t\twhile ($lok_value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_value_lok)){\n\t \t\t\t\t\t\t\t\t\t\t\t\tif (strlen($lok_value['default_value'])>0){\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}elseif(strlen($lok_value['value_char'])>0) {\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valuelist[]=$lok_value['value_char'];\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t\t}else\n\t \t\t\t\t\t\t\t\t\t{\n\t \t\t\t\t\t\t\t\t\t\t$valuelist[]=$value['default_value'];\n\t \t\t\t\t\t\t\t\t\t\t$valueshown=true;\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t \t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t \t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t \t\t\t\t\t\t);\n\t \t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \n\t \t\t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \n\t \t\t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t\t\t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t\t\tif (!is_array($row)){\n\t \t\t\t\t\t\t\t\t\t\tcontinue;\t\n\t \t\t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \n\t \n\t \t\t\t\t\t\t\t\t\t $valuelist[] = $row['value'];\n\t\t\t\t\t\t\t\t\t\t $valueUidList[] = $row['uid'];\n\t \t\t\t\t\t\t\t\t\t $valueshown=true;\n\t \t\t\t\t\t\t\t\t }\n\t \n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif ($valueshown == false) {\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => array(),\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}\n\t \n\t \t\t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'valueuidlist' => $valueUidList,\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \n\t \t\t\t\t}\n\t \n\t \t\t\t\treturn $return_array;\n\t \t\t\t}\n\t \t\t}\n\t \t\treturn false;\n\t \n\t}", "function wc_cartesian_product_of_attributes_terms( array $attributes ): array { //phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh, Generic.Metrics.NestingLevel.MaxExceeded\n\t\t$result = array( array() );\n\n\t\tforeach ( $attributes as $attribute_name => $attribute_values ) {\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product.\n\t\t\tif ( true === empty( $attribute_values ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$append = array();\n\n\t\t\tforeach ( $result as $attribute ) {\n\t\t\t\tforeach ( $attribute_values as $attribute_value ) {\n\t\t\t\t\t$attribute[ $attribute_name ] = $attribute_value;\n\n\t\t\t\t\t$append[] = $attribute;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result = $append;\n\t\t}\n\n\t\treturn $result;\n\t}", "function get_atrribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\treturn $this->get_attribute_matrix($articleList, $attribute_include, $showHiddenValues,$sortingTable);\n \t}", "function get_selectattribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\t\n \t\t\n \t\t$return_array=array();\n \t\t/**\n \t\t * if no list is given, take complate arctile-list from product\n \t\t */\n \t\t\n \t\t\n \t\tif ($this->uid>0) { \n\t \t\tif ($articleList==false){\n\t \t\t\t$articleList=$this->load_articles();\n\t \t\t}\n\t\n\t if (is_array($attribute_include)){\n\t \tif (!is_null($attribute_include[0])) {\n\t\t \t\t\t$addwhere.=' AND tx_commerce_attributes.uid in ('.implode(',',$attribute_include).')';\n\t\t\t\t}\t\n\t \t\t}\n\t \t\tif(is_array($articleList) && count($articleList)>0) {\n\t\t\t\t$query_article_list= implode(',',$articleList);\n\t \t\t\t$addwhere2 =' AND tx_commerce_articles.uid in ('.$query_article_list.')';\n\t\t\t}\n\t \t\t\n\t \t\t$result=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_attributes.uid,tx_commerce_attributes.sys_language_uid,tx_commerce_articles.uid as article ,tx_commerce_attributes.title, tx_commerce_attributes.unit, tx_commerce_attributes.valueformat, tx_commerce_attributes.internal_title,tx_commerce_attributes.icon, '.$sortingTable.'.sorting',\n\t \t \t\t\t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t\t\t' AND tx_commerce_articles.uid_product = '.$this->uid.' '.$addwhere.$addwhere2.' order by '.$sortingTable.'.sorting'\n\t\t\t\t\t\t\t\t\t);\n\t \t\t$addwhere = $addwhere2;\n\t\t\t\n\t\t\tif (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result)>0))\t{\n\t \t\t\twhile ($data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t \t\t\t\t/** \n\t \t\t\t\t * Do the language overlay\n\t \t\t\t\t */\n\t \t\t\t\t \n\t \t\t\t\tif ($this->lang_uid>0) {\n\t \t\t\t\t\tif(is_object($GLOBALS['TSFE']->sys_page)){\n\t\t\t \t\t\t\t\t$proofSQL = $GLOBALS['TSFE']->sys_page->enableFields('tx_commerce_attributes',$GLOBALS['TSFE']->showHiddenRecords);\n\t\t\t\t\t\t}\n\t\t\t\t \t\t$result2=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*',\n\t\t\t\t \t\t\t'tx_commerce_attributes',\n\t\t\t\t\t\t\t'uid = '.$data['uid'].' '.$proofSQL\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\t// Result should contain only one Dataset\n\t\t\t\t \t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($result2)==1)\t{\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result2);\n\t\t\t\t \t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result2);\n\t\t\t\t \t\t\t$return_data=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attributes',$return_data,$this->lang_uid,$this->translationMode);\n\t\t\t\t \t\t\tif (!is_array($return_data)){\n\t\t\t\t \t\t\t/**\n\t\t\t\t \t\t\t * No Translation possible, so next interation\n\t\t\t\t \t\t\t */\t\n\t\t\t\t \t\t\t\tcontinue;\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\t$data['title']=$return_data['title'];\n\t \t\t\t\t\t$data['unit']=$return_data['unit'];\n\t \t\t\t\t\t$data['internal_title']=$return_data['internal_title'];\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$valueshown=false;\n\t \t\t\t\t/**\n\t \t\t\t\t * only get select attributs, since we don't need any other in selectattribut Matrix and we need the arrayKeys in this case\n\t \t\t\t\t */\n\t \t\t\t\t/**\n\t \t\t\t\t * @since 13.12.2005 Get the lokalized values from tx_commerce_articles_article_attributes_mm\n\t \t\t\t\t * @author Ingo Schmitt <[email protected]>\n\t \t\t\t\t */\n\t \t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$valuelist=array();\n\t\t\t\t\t$valueUidList = array();\n\t\t\t\t\t$attribute_uid=$data['uid'];\n\t \t\t\t\t$article=$data['article'];\n\t\t\t\t\t\n\t\t\t\t\t$result_value=$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('distinct tx_commerce_articles_article_attributes_mm.uid_valuelist ',\n\t \t \t\t\t\t\t'tx_commerce_articles',\n\t \t\t\t\t\t\t'tx_commerce_articles_article_attributes_mm',\n\t\t\t\t\t\t\t'tx_commerce_attributes',\t\n\t\t\t\t\t\t\t' AND tx_commerce_articles_article_attributes_mm.uid_valuelist>0 AND tx_commerce_articles.uid_product = '.$this->uid.\" AND tx_commerce_attributes.uid=$attribute_uid\".$addwhere\n\t\t\t\t\t\t);\n\t\t\t\t\tif (($valueshown == false) && ($result_value) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result_value)>0)){\n\t \t\t\t\t\t\twhile ($value=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_value)){\n\t \t\t\t\t\t\t\tif ($value['uid_valuelist']>0){\n\t \t\t\t\t\t\t\t \t\n\t \t\t\t\t\t\t\t $resvalue = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_attribute_values','uid = '.$value['uid_valuelist']);\n\t \t\t\t\t\t\t\t $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resvalue);\n\t \t\t\t\t\t\t\t if ($this->lang_uid>0) {\n\t \t\t\t\t\t\t\t \t$row=$GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_commerce_attribute_values',$row,$this->lang_uid,$this->translationMode);\n\t \t\t\t\t\t\t\t \tif (!is_array($row)){\n\t \t\t\t\t\t\t\t \t\tcontinue;\t\n\t \t\t\t\t\t\t\t \t}\n\t \t\t\t\t\t\t\t }\n\t \t\t\t\t\t\t\t if (($showHiddenValues==true) || (($showHiddenValues==false) && ($row['showvalue']==1))){\n\t \t\t\t\t\t\t\t \n\t \t\t\t\t\t\t\t \t $valuelist[$row['uid']] = $row['value'];\n\t \t\t\t\t\t\t\t \t $valueshown=true;\n\t \t\t\t\t\t\t\t }\n\t\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t\tif ($valueshown==true){\n\t \t\t\t\t\t$return_array[$attribute_uid]=array('title' => $data['title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'unit' => $data['unit'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'values' => $valuelist,\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'valueformat' => $data['valueformat'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'Internal_title' => $data['internal_title'],\n\t \t\t\t\t\t\t\t\t\t\t\t\t 'icon' => $data['icon']\n\t \t\t\t\t\t\t\t\t\t\t\t\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\treturn $return_array;\n\t \t\t}\n \t\t}\n \t\treturn false;\n \t\t\n \t}", "public function product()\n {\n return array_product($this->data());\n }", "public function product() {\n\t\treturn array_product($this->_value);\n\t}", "public function getMatrix($asArray = false) {}", "private function generateAttributeCombinations($arrays) // .. 4\n {\n $result = [[]];\n\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n\n return $result;\n }", "function matrix__toArray($filedestination, $product_info){\r\n $csv_array = array();\r\n $width = array();\r\n $height = array();\r\n $price = array();\r\n \r\n //taking the CSV file and converting into a multi-dimensional array \r\n $f = fopen($filedestination, \"r\");\r\n while (($row = fgetcsv($f))) {\r\n $filtered_row = array_filter($row);\r\n array_push($csv_array, $filtered_row);\r\n } \r\n\r\n //[row][column]\r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i])-1; $j++){\r\n if($i != 0){\r\n array_push($width, $csv_array[$i][0]); \r\n } \r\n }\r\n }\r\n\r\n for($i = 0; $i < sizeof($csv_array)-1; $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if($j != 0){\r\n array_push($height, $csv_array[0][$j]); \r\n } \r\n } \r\n } \r\n\r\n for($i = 0; $i < sizeof($csv_array); $i++){\r\n \r\n for($j = 0; $j < sizeof($csv_array[$i]); $j++){\r\n if(($j != 0) AND ($i != 0)){\r\n array_push($price, $csv_array[$i][$j]); \r\n } \r\n }\r\n }\r\n\r\n insert_price_table($width, $height, $price , $product_info); \r\n}", "public function getData(){\n $values = array();\n $attributes = $this->defineAttributes();\n if(property_exists($this, 'handle') && property_exists($this, 'type')){\n $matrixAttributes = anu()->matrix->getMatrixByName($this->handle)->defineAttributes()[$this->type];\n $attributes = array_merge($attributes, $matrixAttributes);\n }\n\n foreach ($attributes as $k => $v){\n if(property_exists($this, $k)){\n $values[$k] = $this->$k;\n }\n }\n return $values;\n }", "public function getLineMatrix() {}", "protected function aggregate_multidimensional()\n {\n }", "function cartesian_product($input) {\r\n \t$result = array();\r\n\r\n\t\tforeach ($input as $key => $values) {\r\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product\r\n\t\t\tif (empty($values)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Seeding the product array with the values from the first sub-array\r\n\t\t\tif (empty($result)) {\r\n\t\t\t\tforeach($values as $value) {\r\n\t\t\t\t\t$result[] = array($key => $value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Second and subsequent input sub-arrays work like this:\r\n\t\t\t\t// 1. In each existing array inside $product, add an item with\r\n\t\t\t\t// key == $key and value == first item in input sub-array\r\n\t\t\t\t// 2. Then, for each remaining item in current input sub-array,\r\n\t\t\t\t// add a copy of each existing array inside $product with\r\n\t\t\t\t// key == $key and value == first item of input sub-array\r\n\t\r\n\t\t\t\t// Store all items to be added to $product here; adding them\r\n\t\t\t\t// inside the foreach will result in an infinite loop\r\n\t\t\t\t$append = array();\r\n\t\r\n\t\t\t\tforeach($result as &$product) {\r\n\t\t\t\t\t// Do step 1 above. array_shift is not the most efficient, but\r\n\t\t\t\t\t// it allows us to iterate over the rest of the items with a\r\n\t\t\t\t\t// simple foreach, making the code short and easy to read.\r\n\t\t\t\t\t$product[$key] = array_shift($values);\r\n\t\r\n\t\t\t\t\t// $product is by reference (that's why the key we added above\r\n\t\t\t\t\t// will appear in the end result), so make a copy of it here\r\n\t\t\t\t\t$copy = $product;\r\n\t\r\n\t\t\t\t\t// Do step 2 above.\r\n\t\t\t\t\tforeach($values as $pos_key=>$item) {\r\n\t\t\t\t\t\t$copy[$key] = $item;\r\n\t\t\t\t\t\t$append[] = $copy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Undo the side effecst of array_shift\r\n\t\t\t\t\tarray_unshift($values, $product[$key]);\t\t\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// Out of the foreach, we can add to $results now\r\n\t\t\t\t$result = array_merge($result, $append);\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function colorMatrix() {}", "private function GetPIMaterialsArray() {\n $pi_items = [\n //R0 Materials\n '2073',\n '2667',\n '2268',\n '2270',\n '2272',\n '2286',\n '2287',\n '2288',\n '2305',\n '2306',\n '2307',\n '2308',\n '2309',\n '2310',\n '2311',\n //P1 Materials\n '2389',\n '2390',\n '2392',\n '2393',\n '2395',\n '2396',\n '2397',\n '2398',\n '2399',\n '2400',\n '2401',\n '3645',\n '3683',\n '3779',\n '9828',\n //P2 Materials\n '44',\n '2312',\n '2317',\n '2319',\n '2321',\n '2327',\n '2328',\n '2329',\n '2463',\n '3689',\n '3691',\n '3693',\n '3695',\n '3697',\n '3725',\n '3775',\n '3828',\n '9830',\n '9832',\n '9836',\n '9838',\n '9840',\n '9842',\n '15317',\n //P3 Materials\n '2344',\n '2345',\n '2346',\n '2348',\n '2349',\n '2351',\n '2352',\n '2354',\n '2358',\n '2360',\n '2361',\n '2366',\n '2367',\n '9834',\n '9846',\n '9848',\n '12836',\n '17136',\n '17392',\n '17898',\n '28974',\n //P4 Materials\n '2867',\n '2868',\n '2869',\n '2870',\n '2871',\n '2872',\n '2875',\n '2876',\n ];\n\n return $pi_items;\n }", "public function getTechDataMatrix()\n {\n $machines = $this->getMachines(true);\n $matrix = [];\n $tech_data_arrays = [];\n $tech_data_wildcards = [];\n // Get technical data\n foreach ($machines as $machine) {\n $tech_data_arrays[$machine->machine_id] = $machine->getTechnicalData();\n }\n // Get wildcards\n foreach ($tech_data_arrays as $tech_data_array) {\n foreach ($tech_data_array as $tech_data) {\n /** @var array<string> $tech_data */\n $tech_data_wildcards[$tech_data['description']] = $tech_data['unit'];\n }\n }\n // Create matrix\n foreach ($tech_data_wildcards as $wildcard => $unit) {\n $key = ['description' => $wildcard, 'unit' => $unit];\n $matrix[$wildcard] = ['unit' => $unit, 'machine_ids' => []];\n foreach ($machines as $machine) {\n $tech_data_array = $tech_data_arrays[$machine->machine_id];\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = '';\n foreach ($tech_data_array as $techdata) {\n /** @var array<string> $techdata */\n if ($techdata['description'] === $wildcard) {\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = $techdata['value'];\n break;\n }\n }\n }\n }\n return $matrix;\n }", "function promedio_por_alumno($vector){\n $promedios_alumnos=array();\n foreach ($vector as $key => $value) {\n $promedio=0;\n foreach ($value as $c) {\n $promedio=$promedio+$c;\n }\n $promedio=$promedio/6;\n $alumno=array($key=>$promedio);\n array_push($promedios_alumnos,$alumno);\n }\n return $promedios_alumnos;\n }", "abstract protected function _buildCalcRows();", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }", "public function getProductsArray()\n {\n $result = $this->details->map(function ($item, $key) {\n return [ 'product_id' => $item->product_id,\n 'quantity' => $item->quantity ];\n })->values()->toArray();\n\n return $result;\n }", "public function matrixMaker($words){\n $matrix = [];\n $info = [];\n for($i=0;$i<count($words);$i++){\n $ok = 0;\n while($ok<1){\n $maker = $this->hMaker($matrix, $words[$i]);\n $ok = $maker['status'];\n }\n $matrix = $maker['matrix'];\n $info[$words[$i]] = ['start'=>$maker['start'], 'type'=>$maker['type']];\n }\n for($i=0;$i<15;$i++){\n for($j=0;$j<15;$j++){\n if(empty($matrix[$i][$j])){\n $matrix[$i][$j] = $this->assign_rand_value(rand(1,26));\n }\n }\n }\n return ['matrix'=>$matrix, 'info'=>$info];\n }", "public function getS() {\n// return new Matrix($this->s);\n $S = array();\n for ($i = 0; $i < $this->n; ++$i) {\n for ($j = 0; $j < $this->n; ++$j) {\n $S[$i][$j] = 0.0;\n }\n $S[$i][$i] = $this->s[$i];\n }\n return new Matrix($S);\n }", "public function combinations() : array\n {\n $combinations = [[]];\n\n foreach ($this->grid as $i => $params) {\n $append = [];\n\n foreach ($combinations as $product) {\n foreach ($params as $param) {\n $product[$i] = $param;\n $append[] = $product;\n }\n }\n\n $combinations = $append;\n }\n\n return $combinations;\n }", "public function getProductAttributesGroups()\n {\n $colors = array();\n $groups = array();\n $combinations = array();\n\n $attributes_groups = $this->product->getAttributesGroups($this->context->language->id);\n\n if (is_array($attributes_groups) && $attributes_groups) {\n foreach ($attributes_groups as $row) {\n // Color management\n if (isset($row['is_color_group'])\n && $row['is_color_group']\n && (isset($row['attribute_color']) && $row['attribute_color'])\n || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) {\n $colors[$row['id_attribute']]['value'] = $row['attribute_color'];\n $colors[$row['id_attribute']]['name'] = $row['attribute_name'];\n if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) {\n $colors[$row['id_attribute']]['attributes_quantity'] = 0;\n }\n $colors[$row['id_attribute']]['attributes_quantity'] += (int)$row['quantity'];\n }\n if (!isset($groups[$row['id_attribute_group']])) {\n $groups[$row['id_attribute_group']] = array(\n 'group_name' => $row['group_name'],\n 'name' => $row['public_group_name'],\n 'group_type' => $row['group_type'],\n 'default' => -1,\n );\n }\n\n $attr_g = $row['id_attribute_group'];\n $groups[$attr_g]['attributes'][$row['id_attribute']] = $row['attribute_name'];\n if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {\n $groups[$row['id_attribute_group']]['default'] = (int)$row['id_attribute'];\n }\n if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {\n $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;\n }\n $r_attr = $row['id_attribute_group'];\n $groups[$r_attr]['attributes_quantity'][$row['id_attribute']] += (int)$row['quantity'];\n\n $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute'];\n\n //calculate full price for combination\n $priceDisplay = Product::getTaxCalculationMethod(0); //(int)$this->context->cookie->id_customer\n if (!$priceDisplay || $priceDisplay == 2) {\n $combination_price = $this->product->getPrice(true, $row['id_product_attribute']);\n } else {\n $combination_price = $this->product->getPrice(false, $row['id_product_attribute']);\n }\n $combinations[$row['id_product_attribute']]['price'] = $this->formatPrice($combination_price);\n $combinations[$row['id_product_attribute']]['float_price'] = $combination_price;\n $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity'];\n $combinations[$row['id_product_attribute']]['minimal_quantity'] = (int)$row['minimal_quantity'];\n }\n\n // wash attributes list (if some attributes are unavailables and if allowed to wash it)\n if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock)\n && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {\n foreach ($groups as &$group) {\n foreach ($group['attributes_quantity'] as $key => &$quantity) {\n if ($quantity <= 0) {\n unset($group['attributes'][$key]);\n }\n }\n }\n\n foreach ($colors as $key => $color) {\n if ($color['attributes_quantity'] <= 0) {\n unset($colors[$key]);\n }\n }\n }\n foreach ($combinations as $id_product_attribute => $comb) {\n $attribute_list = '';\n foreach ($comb['attributes'] as $id_attribute) {\n $attribute_list .= '\\'' . (int)$id_attribute . '\\',';\n }\n $attribute_list = rtrim($attribute_list, ',');\n $combinations[$id_product_attribute]['list'] = $attribute_list;\n }\n }\n\n return array(\n 'groups' => $groups,\n 'colors' => (count($colors)) ? $colors : false,\n 'combinations' => $combinations\n );\n }", "function Build_Sparse_Array(array $t_args, array $inputs, array $outputs)\n{\n // Class name is randomly generated.\n $className = generate_name('BuildSparseArray');\n\n // Initializiation of argument names.\n $inputs_ = array_combine(['key', 'vector'], $inputs);\n $key = $inputs_['key'];\n\n // Information about the vector type.\n $size = $inputs_['vector']->get('size');\n $type = $inputs_['vector']->get('type');\n\n // Processing of template arguments.\n $scale = get_default($t_args, 'scale', 2);\n $width = get_default($t_args, 'length', 100);\n $type = get_default($t_args, 'type', $type);\n\n // diag is converted to avoid PHP boolean printing issues.\n $diag = intval($diag);\n\n grokit_assert(is_datatype($type),\n \"Build Sparse Array: 'type' ($type) is not a datatype.\");\n\n $sys_headers = ['armadillo', 'limits'];\n $user_headers = [];\n $lib_headers = [];\n $libraries = ['armadillo'];\n $extra = [];\n $result_type = ['state'];\n?>\n\nusing namespace std;\n\nclass <?=$className?>;\n\nclass <?=$className?> {\n public:\n // The type of result.\n using Type = <?=$type?>;\n\n // The type of the indices.\n using Key = <?=$key?>;\n\n // The length of each column in the data matrix.\n static const constexpr int kHeight = <?=$size?>;\n\n // The initial width of the data matrix.\n static const constexpr int kWidth = <?=$width?>;\n\n // The proportion at which the dynamic matrix grows.\n static const constexpr int kScale = <?=$scale?>;\n\n private:\n // The data matrix being constructed item by item. The width of this matrix\n // is increased when necessary as per a dynamic array.\n Mat<Type> data;\n\n // The set of keys processed whose indices correspond to the rows in data.\n Col<Key> keys;\n\n // The number of rows processed by this state.\n int count;\n\n public:\n <?=$className?>()\n : data(kHeight, kWidth),\n keys(kWidth),\n count(0) {\n }\n\n // Basic dynamic array allocation.\n void AddItem(<?=const_typed_ref_args($inputs_)?>) {\n if (count == data.n_cols) {\n data.resize(kHeight, kScale * data.n_cols);\n keys.resize(kScale * keys.n_elem);\n }\n data.col(count) = Col<Type>(vector.data(), kHeight);\n keys(count) = key;\n count++;\n }\n\n // Empty rows are stripped such that white space will only ever be at the end\n // of both keys and data.\n void AddState(<?=$className?> &other) {\n data.resize(kHeight, count);\n keys.resize(count);\n data.insert_cols(count, other.data);\n keys.insert_rows(count, other.keys);\n count += other.count;\n }\n\n void FinalizeState() {\n data.resize(kHeight, count);\n }\n\n const Col<Key>& GetKeys() const {\n return keys;\n }\n\n const Mat<Type>& GetData() const {\n return data;\n }\n\n<?\n return [\n 'kind' => 'GLA',\n 'name' => $className,\n 'system_headers' => $sys_headers,\n 'user_headers' => $user_headers,\n 'lib_headers' => $lib_headers,\n 'libraries' => $libraries,\n 'extra' => $extra,\n 'iterable' => false,\n 'input' => $inputs,\n 'output' => $outputs,\n 'result_type' => $result_type,\n ];\n}", "function matrix_multiply($m1, $m2){\n\t\t$r = count($m1);\n\t\t$c = count($m2[0]);\n\t\t$p = count($m2);\n\t\tif(count($m1[0]) != $p){\n\t\t\treturn false; //incompatible matrix\n\t\t}\n\t\t$m3 = array();\n\t\tfor($i = 0; $i < $r; $i++){\n\t\t\tfor($j = 0; $j < $c; $j++){\n\t\t\t\t$m3[$i][$j] = 0;\n\t\t\t\tfor($k = 0; $k < $p; $k++){\n\t\t\t\t\t$m3[$i][$j] += $m1[$i][$k]*$m2[$k][$j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($m3);\n\t}" ]
[ "0.6413275", "0.6256707", "0.59373313", "0.5932432", "0.56400925", "0.55970514", "0.5593403", "0.55668914", "0.5564675", "0.5557003", "0.54878044", "0.54172856", "0.54143184", "0.5304919", "0.5284033", "0.52686626", "0.5215557", "0.51859576", "0.51290166", "0.51006013", "0.508645", "0.5068457", "0.5062293", "0.50527936", "0.50103635", "0.4970836", "0.4968744", "0.49674845", "0.4957377", "0.49564636" ]
0.6368879
1
Markets Landing Settings form
function cmc_framework_markets_landing_settings() { $form = array(); for ($i=1; $i<=5; $i++) { cmc_framework_markets_landing_settings_tab_section($form, $i); } $form['#submit'][] = 'cmc_framework_markets_landing_process_uploaded_file'; $form['#validate'][] = 'cmc_framework_markets_landing_validate_uploaded_file'; return system_settings_form($form); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mda_settings_form() {\n\t$form['mda_resources_access'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => 'Page d\\'infos sur l\\'accès aux ressources MDA',\n\t\t\t'#description' => 'Information affichée à un utilisateur non connecté essayant de voir une ressource dont la visibilité est \"professionnels\".',\n\t);\n\t\n\t$default_text = \"<p>L'accès à cette ressource est réservée aux professionnels possédant un compte sur ce site.</p>\\n\";\n\t$default_text .= \"<p><a href=\" . \"/user\" . \">Accès au formulaire de connexion</a>.</p>\\n\";\n\t$default_text .= '<p>Si vous êtes un professionnel et que vous ne possédez pas de compte,';\n\t$default_text .= ' rendez-vous sur la page de création d\\'un <a href=\"/user/register\">nouveau compte</a>.';\n\n\t$form['mda_resources_access']['mda_restricted_access_text'] = array(\n\t\t\t'#type' => 'text_format',\n\t\t\t'#title' => 'Texte d\\'information',\n\t\t\t'#size' => 100,\n\t\t\t'#default_value' => variable_get('mda_restricted_access_text', $default_text),\n\t\t\t'#format'=> 'full_html',\n\t);\n\n\treturn system_settings_form($form);\n}", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "protected function restMarketsSettingsPostRequest()\n {\n\n $resourcePath = '/rest/markets/settings';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function buildSettingsForm() {}", "function tsz_reservation_page_init()\n{ \n\n $settings = array(\n 'spaces_limit' => 'Spaces per Listing',\n 'past_months_limit' => 'Limit reservations to ? months in the past',\n 'future_months_limit' => 'Limit reservations to ? months in the future'\n );\n\n foreach($settings as $id => $label) {\n register_setting(\n 'tsz_listing_options', // Option group\n $id\n );\n\n add_settings_field(\n $id, // ID\n $label, // Title \n 'render_input_field', // Callback\n 'tsz_listing_options_page', // Page\n 'setting_section_id', // Section \n array(\"id\" => $id) \n ); \n }\n\n}", "public function maz_hspm_settings_content() {\n ?>\n <div class=\"wrap\">\n <h2>Halve Spacers On Mobile Settings</h2>\n <form method=\"post\" action=\"options.php\">\n <br>\n <hr>\n <br>Breakpoint configures the screen width in pixels when the spacers change size.\n <br>Ratio defines the amount of change. For example, 0.5 will halve the size, 2 will double it.\n <br>\n\n <?php\n # Places all the fields defined above and the submit button in the markup\n settings_fields( 'maz_hspm_fields' );\n do_settings_sections( 'maz_hspm_fields' );\n submit_button();\n ?>\n </form>\n <div class=\"\">\n A Plugin by Moritz Zimmer, 2020\n </div>\n </div>\n <?php\n }", "public function settings(){\n if (!$this->students->isLogin()) {\n\n header('Location:/login');\n die();\n }\n\n /**\n * Main Body Section ///////////////////////////////////////////////////////////////////////////////////////////\n */\n\n \n DataManager::getInstance()->addData('Students', $this->students);\n\n /**\n * Render///////////////////////////////////////////////////////////////////////////////////////////////////////\n */\n\n $this->render();\n }", "public function initGeneralPageSettingsForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t\n\t\t$aset = new ilSetting(\"adve\");\n\n\t\t// use physical character styles\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_physical\"), \"use_physical\");\n\t\t$cb->setInfo($this->lng->txt(\"adve_use_physical_info\"));\n\t\t$cb->setChecked($aset->get(\"use_physical\"));\n\t\t$form->addItem($cb);\n\n\t\t// blocking mode\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_blocking_mode\"), \"block_mode_act\");\n\t\t$cb->setChecked($aset->get(\"block_mode_minutes\") > 0);\n\t\t$form->addItem($cb);\n\n\t\t\t// number of minutes\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"adve_minutes\"), \"block_mode_minutes\");\n\t\t\t$ni->setMinValue(2);\n\t\t\t$ni->setMaxLength(5);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setRequired(true);\n\t\t\t$ni->setInfo($this->lng->txt(\"adve_minutes_info\"));\n\t\t\t$ni->setValue($aset->get(\"block_mode_minutes\"));\n\t\t\t$cb->addSubItem($ni);\n\t\t\n\t\t$form->addCommandButton(\"saveGeneralPageSettings\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($lng->txt(\"adve_pe_general\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t \n\t\treturn $form;\n\t}", "abstract function setupform();", "function share_selection_config_services_form() {\n $settings = array();\n\n $services = share_selection_get_links(NULL, TRUE);\n //$settings['show'] = variable_get('share_selection_show', NULL);\n //$settings['weight'] = variable_get('share_selection_weight', NULL);\n //$settings['custom'] = variable_get('share_selection_custom', NULL);\n\n $form['share_selection'] = array('#theme' => 'share_selection_services_drag_table');\n $form['share_selection']['share_selection_show'] = array('#tree' => TRUE);\n $form['share_selection']['share_selection_weight'] = array('#tree' => TRUE);\n // Custom service options.\n $form['share_selection_custom'] = array(\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#title' => t('Custom services options'),\n '#description' => t('Set the custom options per service.'),\n '#tree' => TRUE,\n );\n foreach ($services as $service_id => $service) {\n $icon_path = drupal_get_path('module', $service['module']) . '/images/' . $service['icon'];\n $icon = array(\n 'path' => isset($service['icon']) ? $icon_path : '',\n );\n $weight = isset($settings['weight'][$service_id]) ? $settings['weight'][$service_id] : 0;\n\n $form['share_selection']['share_selection_show'][$service_id] = array(\n '#service' => ucwords(str_replace('_', ' ', $service['module'])),\n '#weight' => $weight,\n '#type' => 'checkbox',\n '#title' => theme('image', $icon) . \" \" . t('Show %name', array('%name' => $service['name'])),\n '#return_value' => 1,\n '#default_value' => isset($settings['show'][$service_id]) ? $settings['show'][$service_id] : 0,\n );\n $form['share_selection']['share_selection_weight'][$service_id] = array(\n '#type' => 'weight',\n '#delta' => 100,\n '#default_value' => $weight,\n );\n\n if (isset($service['custom_options'])) {\n $form['share_selection_custom'][$service_id] = array(\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#title' => $service['name'],\n );\n foreach ($service['custom_options'] as $option_key => $option_label) {\n $form['share_selection_custom'][$service_id][$option_key] = array(\n '#type' => 'textfield',\n '#title' => $option_label,\n '#default_value' => isset($settings['custom'][$service_id][$option_key]) ? $settings['custom'][$service_id][$option_key] : '',\n '#size' => '60',\n );\n }\n }\n }\n $form['replacement_tokens'] = array(\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#title' => t('Replacement tokens'),\n );\n $form['replacement_tokens']['tokens'] = array(\n '#theme' => 'token_tree',\n '#token_types' => array('node'),\n '#global_types' => TRUE,\n '#click_insert' => TRUE,\n );\n return system_settings_form($form);\n}", "public function setupForm()\n {\n\n// if ($this->config['db_name'] != NO_DATABASE)\n // $this->redirect(\"login.php\");\n // login here?\n \n/* if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n*/\n require_once('views/SetupView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SetupView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml();\n $site->printFooter(); \n }", "public function setFieldsetsAndFields() {\n\t\t$Dataset = new FormularFieldset(__('Your Dataset'));\n\t\t$Dataset->setHtmlCode($this->getCode());\n\t\t$Dataset->addInfo( __('You can specify which values show up in the overview of your activities.').'<br>'.\n\t\t\t\t\t\t\t__('This does not influence the detailed activity view, the form or any plugin.') );\n\n\t\t$this->Formular->addFieldset($Dataset);\n\t}", "protected function getConfigForm()\n {\n // toDo: Add config to choose items showed by viewedItems\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'CAPTURELEADSXAVIER_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n array(\n 'type' => 'radio',\n 'label' => $this->l('Column selector'),\n 'name' => 'CAPTURELEADSXAVIER_COL_SEL',\n 'required' => true,\n 'is_bool' => true,\n 'desc' => $this->l('Select on what column you want the module'),\n 'values' => array(\n array(\n 'id' => 'col_left',\n 'value' => \"left\",\n 'label' => $this->l('Left')\n ),\n array(\n 'id' => 'col_right',\n 'value' => \"right\",\n 'label' => $this->l('Right')\n )\n\n ),\n ),\n \n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n )\n )\n );\n }", "public function settings_page() {\n\n\t\t?>\n\n\t\t<div class=\"wrap schedule-a-visit-to-sherpa-settings\">\n\t\t\t\n\t\t\t<form id=\"schedule-a-visit-to-sherpa-form\" method=\"post\" action=\"options.php\">\n\t\t\t\t\n\t\t\t\t<?php echo wp_nonce_field( 'schedule_a_visit_to_sherpa_data', 'schedule_a_visit_to_sherpa_nonce' ); ?>\n\n\t\t\t\t<?php settings_fields( 'schedule_a_visit_to_sherpa_settings_section' ); ?>\n\n\t\t\t\t<?php do_settings_sections( 'schedule-a-visit-to-sherpa' ); ?>\n\t\t\t\t\n\t\t\t\t<?php submit_button(); ?>\n\n\t\t\t</form>\n\n </div>\n\n\t\t<?php\n\n\t}", "function pp_btw2017_uu_admin_settings_form() {\n\t// form\n\t\t$form = array();\n\n\t\t$form['landesliste'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Landesliste'),\n\t\t\t'#description' => t(\"Der UU-Sammelbalken kann am Ende oder am Anfang angezeigt werden.\"),\n\t\t);\n\n\t\t$form['landesliste']['pp_btw2017_landesliste_start'] = array(\n\t\t\t'#type' => 'checkbox',\n\t\t\t'#title' => t('Am Anfang anzeigen'),\n\t\t\t'#default_value' => variable_get('pp_btw2017_landesliste_start', NULL),\n\t\t);\n\n\t\t$form['landesliste']['pp_btw2017_landesliste_end'] = array(\n\t\t\t'#type' => 'checkbox',\n\t\t\t'#title' => t('Am Ende anzeigen'),\n\t\t\t'#default_value' => variable_get('pp_btw2017_landesliste_end', NULL),\n\t\t);\n\n\n\t\t$form['kreiswahlvorschlaege'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Kreiswahlvorschläge'),\n\t\t\t'#description' => t(\"Die UU-Sammelbalken können pro Wahlkreis zur Anzeige ausgewählt werden.\"),\n\t\t);\n\n\t\t$wks = array(\n\t\t\t\t\"167\"\t=>\t\"Waldeck\",\n\t\t\t\t\"168\"\t=>\t\"Kassel\",\n\t\t\t\t\"169\"\t=>\t\"Werra-Meißner – Hersfeld-Rotenburg\",\n\t\t\t\t\"170\"\t=>\t\"Schwalm-Eder\",\n\t\t\t\t\"171\"\t=>\t\"Marburg\",\n\t\t\t\t\"172\"\t=>\t\"Lahn-Dill\",\n\t\t\t\t\"173\"\t=>\t\"Gießen\",\n\t\t\t\t\"174\"\t=>\t\"Fulda\",\n\t\t\t\t\"175\"\t=>\t\"Main-Kinzig – Wetterau II – Schotten\",\n\t\t\t\t\"176\"\t=>\t\"Hochtaunus\",\n\t\t\t\t\"177\"\t=>\t\"Wetterau I\",\n\t\t\t\t\"178\"\t=>\t\"Rheingau-Taunus – Limburg\",\n\t\t\t\t\"179\"\t=>\t\"Wiesbaden\",\n\t\t\t\t\"180\"\t=>\t\"Hanau\",\n\t\t\t\t\"181\"\t=>\t\"Main-Taunus\",\n\t\t\t\t\"182\"\t=>\t\"Frankfurt am Main I\",\n\t\t\t\t\"183\"\t=>\t\"Frankfurt am Main II\",\n\t\t\t\t\"184\"\t=>\t\"Groß-Gerau\",\n\t\t\t\t\"185\"\t=>\t\"Offenbach\",\n\t\t\t\t\"186\"\t=>\t\"Darmstadt\",\n\t\t\t\t\"187\"\t=>\t\"Odenwald\",\n\t\t\t\t\"188\"\t=>\t\"Bergstraße\",\n\t\t);\n\n\t\tforeach ($wks as $wk => $name) {\n\t\t\t$form['kreiswahlvorschlaege']['pp_btw2017_wk'.$wk] = array(\n\t\t\t\t'#type' => 'checkbox',\n\t\t\t\t'#title' => t(\"WK \".$wk.\" (\".$name.\")\"),\n\t\t\t\t'#default_value' => variable_get('pp_btw2017_wk'.$wk, NULL),\n\t\t\t);\n\t\t}\n\n\t// return\n\t\treturn system_settings_form($form);\n}", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "private function _setDefaults() {\r\n\t\t$checked = $selected = '';\r\n\t\t$isAdmin = $hasCart = false;\r\n\t\tif($this->isAdmin()) {\r\n\t\t\t$isAdmin = true;\r\n\t\t}\r\n\t\tif($this->Session->check('Order.id')) {\r\n\t\t\t$hasCart = true;\r\n\t\t}\r\n\t\t$this->set(compact('checked', 'selected', 'isAdmin', 'hasCart'));\r\n\t\t\r\n\t\t$this->layout = 'shop';\r\n\t\tif(isset($this->params['admin'])) {\r\n\t\t\t$this->layout = 'admin';\r\n\t\t}\r\n\t}", "function sss_options () {\n\techo '<div class=\"wrap\"><h2>Social Share Starter by KK</h2>';\n\tif(isset($_POST['submit'])) {\n\t\tupdate_sss_options();\n\t}\n\tprint_sss_form();\n\techo '</div>';\n}", "public function settings( &$form )\n\t{\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'zarinpal_merchant_id', $this->id ?$settings['merchant_id']:'', TRUE ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\YesNo( 'zarinpal_zarin_gate', $this->id ?$settings['zarin_gate']:'', TRUE ) );\n\t}", "protected function restMarketsSettingsGetRequest()\n {\n\n $resourcePath = '/rest/markets/settings';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function settings( &$form )\n\t{\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\t\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'authorizenet_login', $settings['login'], TRUE ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'authorizenet_tran_key', $settings['tran_key'], TRUE ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Radio( 'authorizenet_method', $settings['method'], TRUE, array(\n\t\t\t'options' \t=> array(\n\t\t\t\t'AIM'\t\t=> 'authorizenet_AIM',\n\t\t\t\t'DPM'\t\t=> 'authorizenet_DPM'\n\t\t\t),\n\t\t\t'toggles'\t=> array(\n\t\t\t\t'AIM'\t\t=> array( 'authorizenet_cim' ),\n\t\t\t\t'DPM'\t\t=> array( 'authorizenet_hash' )\n\t\t\t)\n\t\t) ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\YesNo( 'authorizenet_cim', $settings['cim'], FALSE, array(), NULL, NULL, NULL, 'authorizenet_cim' ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'authorizenet_hash', $settings['hash'], FALSE, array(), NULL, NULL, NULL, 'authorizenet_hash' ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'authorizenet_processor', $settings['processor'], FALSE, array( 'options' => array(\n\t\t\t0\t\t=> 'dont_know',\n\t\t\t'North American Payment Processors'\t=> array(\n\t\t\t\t1 \t=> 'Chase Paymentech Tampa Processing Platform',\n\t\t\t\t2\t=> 'Elavon',\n\t\t\t\t3\t=> 'First Data Merchant Services (FDMS) Omaha, Nashville, and EFSNet Processing Platforms',\n\t\t\t\t4\t=> 'Global Payments',\n\t\t\t\t5\t=> 'Heartland Payment Systems',\n\t\t\t\t6\t=> 'TSYS Acquiring Solutions',\n\t\t\t\t7\t=> 'WorldPay Atlanta Processing Platform',\n\t\t\t),\n\t\t\t'European Payment Processors'\t\t=> array(\n\t\t\t\t8\t=> 'AIB Merchant Services',\n\t\t\t\t9\t=> 'Barclaycard',\n\t\t\t\t10\t=> 'First Data Merchant Solutions (MSIP platform)',\n\t\t\t\t11\t=> 'HSBC Merchant Services',\n\t\t\t\t12\t=> 'Lloyds Bank Cardnet',\n\t\t\t\t13\t=> 'Streamline',\n\t\t\t),\n\t\t\t'Asia-Pacific Processors'\t\t\t=> array(\n\t\t\t\t14\t=> 'FDI Australia',\n\t\t\t\t15\t=> 'Westpac',\n\t\t\t)\n\t\t) ) ) );\n\t}", "function ssbd_staticpage_settings_form($form, &$form_state) {\n $form['ssbd_staticpage_simulate_mobile'] = array(\n '#title' => t('Simulate Mobile'),\n '#type' => 'checkbox',\n '#required' => FALSE,\n '#default_value' => variable_get('ssbd_staticpage_simulate_mobile', NULL),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save settings'),\n );\n return $form;\n}", "function mkConfigForm() {\r\n\t\tglobal $database;\r\n\r\n\t\t$database->setQuery(\t\"SELECT lft, rgt FROM #__core_acl_aro_groups WHERE name = 'Public Backend'\" );\r\n\t\t$borders\t\t\t=\t$database->loadRow();\r\n\t\t$database->setQuery(\t\"SELECT group_id AS id, name\" .\r\n\t\t\t\t\t\t\t\t\"\\n FROM #__core_acl_aro_groups\" .\r\n\t\t\t\t\t\t\t\t\"\\n WHERE lft > $borders[0]\" .\r\n\t\t\t\t\t\t\t\t\"\\n AND rgt < $borders[1]\" .\r\n\t\t\t\t\t\t\t\t\"\\n ORDER BY lft DESC\"\r\n\t\t);\r\n\t\t$groups = $database->loadObjectList();\r\n\r\n\t\t//load config values\r\n\t\t\t$database->setQuery(\t\"SELECT params FROM #__components WHERE link = 'ca=eventcal'\" );\r\n\t\t\t$text\t\t\t=\t$database->loadResult();\r\n\t\t\t$config_values\t=\tnew mosParameters( $text );\r\n\t\t\t\r\n\r\n\t\tHTML_admin_eventcal::configPage( $config_values, $groups );\r\n\t}", "public function settingsForm()\n {\n return 'forecastio-form-settings';\n }", "function mustsee_social_settings_box() {\n\t?>\n\n\t<p>Twitter URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[twitter_url]\" value=\"<?php echo esc_attr( genesis_get_option('twitter_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>Facebook URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[facebook_url]\" value=\"<?php echo esc_attr( genesis_get_option('facebook_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>GooglePlus URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[googleplus_url]\" value=\"<?php echo esc_attr( genesis_get_option('googleplus_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>Pinterest URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[pinterest_url]\" value=\"<?php echo esc_attr( genesis_get_option('pinterest_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>LinkedIn URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[linkedin_url]\" value=\"<?php echo esc_attr( genesis_get_option('linkedin_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>YouTube Channel URL:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[youtube_url]\" value=\"<?php echo esc_attr( genesis_get_option('youtube_url') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>Address:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[agent_address]\" value=\"<?php echo esc_attr( genesis_get_option('agent_address') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>Phone:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[agent_phone]\" value=\"<?php echo esc_attr( genesis_get_option('agent_phone') ); ?>\" size=\"50\" />\n\t</p>\n\n\t<p>Email:<br />\n\t\t<input type=\"text\" name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[agent_email]\" value=\"<?php echo esc_attr( genesis_get_option('agent_email') ); ?>\" size=\"50\" />\n\t</p>\n\t<?php\n}", "public function outputSetupForm() {\n\t\t$this->_directFormHtml( 'webinarjamstudio' );\n\t}", "function commerce_marketplace_payment_settings_form($form, &$form_state) {\n\n $options = array(\n 'main_store' => t('main store'),\n 'merchants' => t('merchants'),\n );\n $form['commerce_store_payment_mode'] = array(\n '#type' => 'select',\n '#title' => t('Send payments to'),\n '#description' => t('Select how payments for marketplace orders (orders from multiple stores) should be handled. <em>Merchants</em> will try to send payments directly to relevant merchants (assuming they all have the same payment method supporting parallel payments enabled). <em>Main store</em> will send the payment to the marketplace owner, allowing for processing it manually later.'),\n '#options' => $options,\n '#default_value' => variable_get('commerce_store_payment_mode', COMMERCE_MARKETPLACE_PAYMENT_DEFAULT_MODE),\n );\n\n return system_settings_form($form);\n}", "public function bp_settings_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_centre_landing();\n\t}", "public function form()\n {\n\t\t$xapp = Xapp::findOrFail(request('id'));\n\t\t$xapp_fields = Schema::getColumnListing($xapp->table);\n\t\t$this->hidden('id');\n\t\tforeach(config('xapp.xappset') as $name=>$set){\t\t\n\t\t\tif( empty($set['field']) ){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能');\n\t\t\t}elseif(in_array($set['field'],$xapp_fields)){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能,本功能依赖'.$set['field'].'字段');\n\t\t\t}\n\t\t}\n }" ]
[ "0.59204054", "0.57166463", "0.5694942", "0.56906587", "0.5617515", "0.56134737", "0.55776197", "0.5576366", "0.553818", "0.5523145", "0.55168706", "0.5516498", "0.5513459", "0.5489285", "0.5485056", "0.5484441", "0.54832715", "0.54720855", "0.54560363", "0.5443868", "0.5434555", "0.54221386", "0.5418341", "0.54153043", "0.541347", "0.54080576", "0.53852594", "0.5381726", "0.53679746", "0.5367245" ]
0.7327168
0
/$suggestions = array( ['name' => 'Sip ang Gogh', 'rating' => 5, 'location' => 'Eastwood', 'popularity' => 22, 'weight' => 0.7, 'img_src' => ' ['name' => 'The Bunk', 'rating' => 3, 'location' => 'Shaw Blvd', 'popularity' => 43, 'weight' => 0.33, 'img_src' => ' ['name' => 'Prohibition', 'rating' => 4, 'location'=> 'Greenbelt 5, Makati', 'popularity' => 72, 'weight' => 0.2, 'img_src' => ' ['name' => 'Gatorade Chelsea FC Blue Pitch', 'rating' => 4, 'location' => 'Circuit Makati, Makati', 'popularity' => 55, 'weight' => 0.25, 'img_src' => ' ['name' => 'Ninyo Fusion Cuisine', 'rating' => 5, 'location' => '66 Esteban Abada St, Loyola Heights, Quezon City', 'popularity' => 34, 'weight' => 0.51, 'img_src' => ' ['name' => 'Philippine Center for Creative Imaging', 'rating' => 5, 'location' => '2247 Chino Roces Ave, Makati', 'popularity' => 47, 'weight' => 0.40, 'img_src' => ' ['name' => 'El Chupacabra', 'rating' => 4, 'location' => '5782 Felipe, Makati', 'popularity' => 60, 'weight' => 0.64, 'img_src' => ' ['name' => 'Gandiva Archery Range and Cafe', 'rating' => 4, 'location' => 'Meralco Ave, Pasig', 'popularity' => 80, 'weight' => 0.17, 'img_src' => ' ['name' => 'Carpaccio Ristorante Italiano', 'rating' => 4, 'location' => 'San Antonio Village, Makati', 'popularity' => 28, 'weight' => 0.43, 'img_src' => ' );
public function populateSuggestions(){ $suggestions = array( ['name' => 'Rooftop Bar Hopping', 'rating' => 5, 'location_id' => 1, 'description' => 'Good Memories and Bad Decisions', 'popularity' => 72, 'weight'=> 0.2, 'img_src' => 'http://rochelleabella.com/wp-content/uploads/2016/01/IMG_9107.jpg'] ); foreach($suggestions as $suggestion){ $check = Suggestion::where('name', '=', $suggestion['name'])->first(); if($check === null){ $model = new Suggestion; $model->name = $suggestion['name']; $model->rating = $suggestion['rating']; $model->location_id = $suggestion['location_id']; $model->description = $suggestion['description']; $model->popularity = $suggestion['popularity']; $model->weight = $suggestion['weight']; $model->img_src = $suggestion['img_src']; $model->save(); } } echo 'Suggestion population successful'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findAutocompleteInfo(Request $request)\n {\n //dd($request->all());\n $name = $request->input('query');\n $output = \\Tmdb::getSearchApi()->searchMovies($name, array('language' => 'fr', 'search_type' => 'ngram', 'year' => $request->input('year')));\n //$output = \\Tmdb::getMoviesApi()->getImages($output['results'][0]['id']);\n\n foreach ($output['results'] as $value) {\n $image = \\Tmdb::getMoviesApi()->getImages($value['id']);\n if (isset($image['posters'][0])) {\n $image = $image['posters'][0]['file_path'];\n } else {\n $image = '';\n }\n\n $array = array('image' => $image,'value' => $value['title'].' ('.substr($value['release_date'], 0, 4).')', 'data' => $value['id']);\n $result[] = $array;\n }\n\n $result['suggestions'] = $result;\n echo json_encode($result);\n }", "public function run()\n {\n //\n $brands = [\n [\n 'name'=>'Honda',\n 'desc'=>'Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nemo accusantium exercitationem pariatur nostrum dolore iure facilis quisquam porro magnam. Aspernatur blanditiis quisquam molestias delectus tempore. Libero suscipit veritatis in?',\n 'link'=>[],\n 'img'=>[\"https://pngimage.net/wp-content/uploads/2018/06/honda-logo-moto-png.png\"],\n 'rating'=>5,\n ],[\n 'name'=>'Suzuki',\n 'desc'=>'Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nemo accusantium exercitationem pariatur nostrum dolore iure facilis quisquam porro magnam. Aspernatur blanditiis quisquam molestias delectus tempore. Libero suscipit veritatis in?',\n 'link'=>[],\n 'img'=>[\"https:\\/\\/seeklogo.com\\/images\\/S\\/suzuki-logo-5311518DD9-seeklogo.com.png\"],\n 'rating'=>5,\n ],[\n 'name'=>'Yamaha',\n 'desc'=>'Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nemo accusantium exercitationem pariatur nostrum dolore iure facilis quisquam porro magnam. Aspernatur blanditiis quisquam molestias delectus tempore. Libero suscipit veritatis in?',\n 'link'=>[],\n 'img'=>[\"https:\\/\\/i.ebayimg.com\\/images\\/g\\/dcgAAOxyUylTRpvd\\/s-l300.jpg\"],\n 'rating'=>5,\n ],[\n 'name'=>'Merk 2',\n 'desc'=>'Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nemo accusantium exercitationem pariatur nostrum dolore iure facilis quisquam porro magnam. Aspernatur blanditiis quisquam molestias delectus tempore. Libero suscipit veritatis in?',\n 'link'=>[],\n 'img'=>[\"https://moedah.com/wp-content/uploads/2017/05/Aki-Furukawa11.jpg\",\"https://cdn.pixabay.com/photo/2014/03/25/15/25/car-battery-296788_960_720.png\"],\n 'rating'=>5,\n ],[\n 'name'=>'Merk 3',\n 'desc'=>'Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus nemo accusantium exercitationem pariatur nostrum dolore iure facilis quisquam porro magnam. Aspernatur blanditiis quisquam molestias delectus tempore. Libero suscipit veritatis in?',\n 'link'=>[],\n 'img'=>[\"https://moedah.com/wp-content/uploads/2017/05/Aki-Furukawa11.jpg\",\"https://cdn.pixabay.com/photo/2014/03/25/15/25/car-battery-296788_960_720.png\"],\n 'rating'=>5,\n ],\n ];\n foreach($brands as $d)\n {\n Brand::create($d);\n }\n }", "private function staggeredSearch($inputArray = []) {\n $results = [];\n $exactMatchesResults = [];\n $pinyinResults = [];\n $translationResults = [];\n \n\n // Exact pinyin results, items that match exactly\n foreach ($inputArray as $inputItem) {\n\n $exactMatchesResults = \\App\\Character::where('pinyin', $inputItem)\n ->orWhere('pinyin_normalised', $inputItem)->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($exactMatchesResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // pinyin results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n \n $pinyinResults = \\App\\Character::where('pinyin', 'like', '%' . $inputItem .'%')\n ->orWhere('pinyin_normalised', 'like', '%' . $inputItem .'%')->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($pinyinResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // translation and heisig results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n\n $translationResults = \\App\\Character::where('heisig_keyword', 'like', '%' . $inputItem .'%')\n ->orWhere('translations', 'like', '%' . $inputItem .'%')\n ->orWhere('heisig_number', 'like', '%' . $inputItem .'%')->get();\n\n // for each result in the above collections, add to results array\n foreach($translationResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n return $results;\n }", "function displayResults($arrayName) \n{\n //Display Non-aggregated results: \n //(Non-Aggregated Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Y/N Seen, value[5] Original URL, value[6] Cleaned Snippet placeholder)\n if ($_POST['result_type']==='Non-Aggregated' ) {\n //Loop through Array and check that values have been stored in it:\n foreach ($arrayName as $key => $value) {\n echo \"<p style=\\\"text-align:justify\\\">\n <a href=\\\"$value[5]\\\">$value[1]</a><br />\" \n . $value[2] //snippet\n . \"<br />Score: <strong>\" \n . number_format($value[3], 2, '.', '') //score\n . \"</strong>\" \n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n } else if ($_POST['result_type']==='Aggregated'\n || $_POST['result_type']==='Weighted'\n ) {\n //Display Aggregated or Weighted results:\n //(Aggregated Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Y/N Seen, value[5] Original URL, \n //value[6] Cleaned Snippet placeholder, value[7] coordinate placeholder)\n foreach ($arrayName as $key => $value) {\n echo \"<p class=\\\"text-center\\\">\n <a href=\\\"$value[4]\\\">$value[1]</a><br />\"\n . $value[2] //snippet\n . \"<br />Score: <strong>\" . number_format($value[3], 2, '.', '') \n . \"</strong>\"\n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n } else {\n //Display Clustered Results\n //(Clustered Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Original URL, value[5] Cleaned Snippet, \n //value[6] Coordinate)\n foreach ($arrayName as $key => $value) {\n echo \"<p style=\\\"text-align:justify\\\">\n <a href=\\\"$value[4]\\\">$value[1]</a><br />\"\n . $value[2] //snippet\n . \"<br />Score: <strong>\" . number_format($value[3], 2, '.', '') \n . \"</strong>\"\n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n }\n}", "public function search(Request $request){\n// $data->words = array();\n// $word = new \\stdClass();\n// $word->name = 'Test name';\n// $word->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->words, $word);\n\n// $data->suggests = new \\stdClass();\n// $data->suggests->headline_1 = array();\n//\n// $result = new \\stdClass();\n// $result->name = 'test name 1';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n// $result = new \\stdClass();\n// $result->name = 'test name 2';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n //return response()->json($data);\n\n $search = trim($request->get('search'));\n $searchQuery = '%'.$search.'%';\n if($search && strlen($search) >= 3){\n $users = User::where('username','like',$searchQuery)->orWhere('first_name','like',$searchQuery)->orWhere('last_name','like',$searchQuery)->take(5)->get();\n $tasks = Hug::where('status','=','Active')->where('title','like',$searchQuery)->take(5)->get();\n $events = Event::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $blogs = BlogPost::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $cities = City::where('name','like',$searchQuery)->take(5)->get();\n $tools = ToolsPost::where('title','like',$searchQuery)->take(5)->get();\n }else{\n $users = array();\n $tasks = array();\n }\n\n\n $data = new \\stdClass();\n $data->words = array();\n $word = new \\stdClass();\n $word->name = '';\n array_push($data->words, $word);\n\n $data->suggests = new \\stdClass();\n\n // users\n $heading_1 = \"People\";\n $data->suggests->$heading_1 = array();\n foreach($users as $user){\n $userData = new \\stdClass();\n $status = StatusUpdate::where('user_id', '=', $user->id)->orderBy('created_at', 'desc')->first();\n $userData->name = $user->username;\n $userData->description = $user->first_name.' '.$user->last_name;\n if($status){\n $userData->status = $status->status;\n }\n $userData->image = $user->avatar;\n $userData->link = route('perk::public_profile', array('username' => $user->username));\n array_push($data->suggests->$heading_1, $userData);\n }\n\n // tasks\n $heading_2 = \"Tasks\";\n $data->suggests->$heading_2 = array();\n foreach($tasks as $task){\n $taskData = new \\stdClass();\n $taskData->name = $task->title;\n $taskData->description = substr(strip_tags($task->description), 0, 50);\n $taskData->image = $task->user->avatar;\n $taskData->link = route('hugs::show', array('id'=> $task->id));\n array_push($data->suggests->$heading_2, $taskData);\n }\n\n // tasks\n $heading_3 = \"Events\";\n $data->suggests->$heading_3 = array();\n foreach($events as $event){\n $taskData = new \\stdClass();\n $taskData->name = $event->title;\n $taskData->description = substr(strip_tags($event->description), 0, 50);\n $taskData->image = $event->logo;\n $taskData->link = route('event::show', array('id'=> $event->id));\n array_push($data->suggests->$heading_3, $taskData);\n }\n\n $heading_4 = \"Blogs\";\n $data->suggests->$heading_4 = array();\n foreach($blogs as $blog){\n $taskData = new \\stdClass();\n $taskData->name = $blog->title;\n $taskData->description = substr(strip_tags($blog->description), 0, 50);\n $taskData->image = $blog->cover_photo;\n $taskData->link = route('blog::show', array('id'=> $blog->id));\n array_push($data->suggests->$heading_4, $taskData);\n }\n\n $heading_5 = \"Cities\";\n $data->suggests->$heading_5 = array();\n foreach($cities as $city){\n $taskData = new \\stdClass();\n $taskData->name = $city->name;\n $taskData->description = substr(strip_tags($city->description), 0, 50);\n $taskData->image = $city->city_photo;\n $taskData->link = route('cities::city', array('id'=> $city->name));\n array_push($data->suggests->$heading_5, $taskData);\n }\n $heading_6 = \"Web Tools\";\n $data->suggests->$heading_6 = array();\n foreach($tools as $tool){\n $taskData = new \\stdClass();\n $taskData->name = $tool->title;\n $taskData->description = substr(strip_tags($tool->description), 0, 50);\n $taskData->image = $tool->cover_photo;\n $taskData->link = route('Tools::webpost', array('id'=> $tool->id));\n array_push($data->suggests->$heading_6, $taskData);\n }\n\n\n return response()->json(['results' => $data],200);\n\n }", "public function run()\n {\n $pictures = [\n [\n 'id' => 1,\n 'item_id' => 'Sacha Striped Shirt',\n 'location' => 'women-1-1.jpg',\n ],\n [\n 'id' => 2,\n 'item_id' => 'Sacha Striped Shirt',\n 'location' => 'women-1-2.jpg',\n ],\n [\n 'id' => 3,\n 'item_id' => 'Sacha Striped Shirt',\n 'location' => 'women-1-3.jpg',\n ],\n [\n 'id' => 4,\n 'item_id' => 'Sacha Striped Shirt',\n 'location' => 'women-1-4.jpg',\n ],\n\n [\n 'id' => 5,\n 'item_id' => 'Keirra Midi Dress',\n 'location' => 'women-2-1.jpg',\n ],\n [\n 'id' => 6,\n 'item_id' => 'Keirra Midi Dress',\n 'location' => 'women-2-2.jpg',\n ],\n [\n 'id' => 7,\n 'item_id' => 'Keirra Midi Dress',\n 'location' => 'women-2-3.jpg',\n ],\n [\n 'id' => 8,\n 'item_id' => 'Keirra Midi Dress',\n 'location' => 'women-2-4.jpg',\n ],\n\n [\n 'id' => 9,\n 'item_id' => 'Cavanaugh Layered Dress',\n 'location' => 'women-3-1.jpg',\n ],\n [\n 'id' => 10,\n 'item_id' => 'Cavanaugh Layered Dress',\n 'location' => 'women-3-2.jpg',\n ],\n [\n 'id' => 11,\n 'item_id' => 'Cavanaugh Layered Dress',\n 'location' => 'women-3-3.jpg',\n ],\n [\n 'id' => 12,\n 'item_id' => 'Cavanaugh Layered Dress',\n 'location' => 'women-3-4.jpg',\n ],\n\n [\n 'id' => 13,\n 'item_id' => 'Classic Pullover Jumper',\n 'location' => 'women-4-1.jpg',\n ],\n [\n 'id' => 14,\n 'item_id' => 'Classic Pullover Jumper',\n 'location' => 'women-4-2.jpg',\n ],\n [\n 'id' => 15,\n 'item_id' => 'Classic Pullover Jumper',\n 'location' => 'women-4-3.jpg',\n ],\n [\n 'id' => 16,\n 'item_id' => 'Classic Pullover Jumper',\n 'location' => 'women-4-4.jpg',\n ],\n\n [\n 'id' => 17,\n 'item_id' => 'Chill Pullover',\n 'location' => 'women-5-1.jpg',\n ],\n [\n 'id' => 18,\n 'item_id' => 'Chill Pullover',\n 'location' => 'women-5-2.jpg',\n ],\n [\n 'id' => 19,\n 'item_id' => 'Chill Pullover',\n 'location' => 'women-5-3.jpg',\n ],\n [\n 'id' => 20,\n 'item_id' => 'Chill Pullover',\n 'location' => 'women-5-4.jpg',\n ],\n\n [\n 'id' => 21,\n 'item_id' => 'Amy Button Front Shirt',\n 'location' => 'women-6-1.jpg',\n ],\n [\n 'id' => 22,\n 'item_id' => 'Amy Button Front Shirt',\n 'location' => 'women-6-2.jpg',\n ],\n [\n 'id' => 23,\n 'item_id' => 'Amy Button Front Shirt',\n 'location' => 'women-6-3.jpg',\n ],\n [\n 'id' => 24,\n 'item_id' => 'Amy Button Front Shirt',\n 'location' => 'women-6-4.jpg',\n ],\n\n [\n 'id' => 25,\n 'item_id' => 'Bligh Car Coat',\n 'location' => 'men-1-1.jpg',\n ],\n [\n 'id' => 26,\n 'item_id' => 'Bligh Car Coat',\n 'location' => 'men-1-2.jpg',\n ],\n [\n 'id' => 27,\n 'item_id' => 'Bligh Car Coat',\n 'location' => 'men-1-3.jpg',\n ],\n [\n 'id' => 28,\n 'item_id' => 'Bligh Car Coat',\n 'location' => 'men-1-4.jpg',\n ],\n\n [\n 'id' => 29,\n 'item_id' => 'Phoenix Check Shirt',\n 'location' => 'men-2-1.jpg',\n ],\n [\n 'id' => 30,\n 'item_id' => 'Phoenix Check Shirt',\n 'location' => 'men-2-2.jpg',\n ],\n [\n 'id' => 31,\n 'item_id' => 'Phoenix Check Shirt',\n 'location' => 'men-2-3.jpg',\n ],\n [\n 'id' => 32,\n 'item_id' => 'Phoenix Check Shirt',\n 'location' => 'men-2-4.jpg',\n ],\n\n [\n 'id' => 33,\n 'item_id' => 'Smitty Short Sleeve Tee',\n 'location' => 'men-3-1.jpg',\n ],\n [\n 'id' => 34,\n 'item_id' => 'Smitty Short Sleeve Tee',\n 'location' => 'men-3-2.jpg',\n ],\n [\n 'id' => 35,\n 'item_id' => 'Smitty Short Sleeve Tee',\n 'location' => 'men-3-3.jpg',\n ],\n [\n 'id' => 36,\n 'item_id' => 'Smitty Short Sleeve Tee',\n 'location' => 'men-3-4.jpg',\n ],\n\n [\n 'id' => 37,\n 'item_id' => 'Dunstan Waistcoat',\n 'location' => 'men-4-1.jpg',\n ],\n [\n 'id' => 38,\n 'item_id' => 'Dunstan Waistcoat',\n 'location' => 'men-4-2.jpg',\n ],\n [\n 'id' => 39,\n 'item_id' => 'Dunstan Waistcoat',\n 'location' => 'men-4-3.jpg',\n ],\n [\n 'id' => 40,\n 'item_id' => 'Dunstan Waistcoat',\n 'location' => 'men-4-4.jpg',\n ],\n\n [\n 'id' => 41,\n 'item_id' => 'Jakob Micro Print Shirt',\n 'location' => 'men-5-1.jpg',\n ],\n [\n 'id' => 42,\n 'item_id' => 'Jakob Micro Print Shirt',\n 'location' => 'men-5-2.jpg',\n ],\n [\n 'id' => 43,\n 'item_id' => 'Jakob Micro Print Shirt',\n 'location' => 'men-5-3.jpg',\n ],\n [\n 'id' => 44,\n 'item_id' => 'Jakob Micro Print Shirt',\n 'location' => 'men-5-4.jpg',\n ],\n\n [\n 'id' => 45,\n 'item_id' => 'Maiden Shirt',\n 'location' => 'men-6-1.jpg',\n ],\n [\n 'id' => 46,\n 'item_id' => 'Maiden Shirt',\n 'location' => 'men-6-2.jpg',\n ],\n [\n 'id' => 47,\n 'item_id' => 'Maiden Shirt',\n 'location' => 'men-6-3.jpg',\n ],\n [\n 'id' => 48,\n 'item_id' => 'Maiden Shirt',\n 'location' => 'men-6-4.jpg',\n ],\n\n // new arival\n [\n 'id' => 49,\n 'item_id' => 'Shone Joy',\n 'location' => 'arrival-1-1.png',\n ],\n [\n 'id' => 50,\n 'item_id' => 'Shone Joy',\n 'location' => 'arrival-1-2.png',\n ],\n\n [\n 'id' => 51,\n 'item_id' => 'Sabrina Ruffle Hem Top',\n 'location' => 'arrival-2-1.png',\n ],\n [\n 'id' => 52,\n 'item_id' => 'Sabrina Ruffle Hem Top',\n 'location' => 'arrival-2-2.png',\n ],\n\n [\n 'id' => 53,\n 'item_id' => 'Victoria Front Shirt',\n 'location' => 'arrival-3-1.png',\n ],\n [\n 'id' => 54,\n 'item_id' => 'Victoria Front Shirt',\n 'location' => 'arrival-3-2.png',\n ],\n\n [\n 'id' => 55,\n 'item_id' => 'Reena Mini Dress',\n 'location' => 'arrival-4-1.png',\n ],\n [\n 'id' => 56,\n 'item_id' => 'Reena Mini Dress',\n 'location' => 'arrival-4-2.png',\n ],\n\n [\n 'id' => 57,\n 'item_id' => 'Kori Bomber',\n 'location' => 'arrival-5-1.png',\n ],\n [\n 'id' => 58,\n 'item_id' => 'Kori Bomber',\n 'location' => 'arrival-5-2.png',\n ],\n\n // sale\n [\n 'id' => 59,\n 'item_id' => 'Hawaian Midi Dress',\n 'location' => 'sale-1-1.png',\n ],\n [\n 'id' => 60,\n 'item_id' => 'Kori Bomber',\n 'location' => 'sale-1-2.png',\n ],\n [\n 'id' => 61,\n 'item_id' => 'Dani Active Crop',\n 'location' => 'sale-2-1.png',\n ],\n [\n 'id' => 62,\n 'item_id' => 'Maternity Drawstring Dress',\n 'location' => 'sale-3-1.png',\n ],\n [\n 'id' => 63,\n 'item_id' => 'Maternity Drawstring Dress',\n 'location' => 'sale-3-2.png',\n ],\n \n\n\n ];\n\n foreach($pictures as $picture){\n Picture::create($picture);\n }\n }", "public function suggests() : array;", "public function suggest($count = 1) {\n\n $person = $this->randomItem('Tim Berners-Lee', 'Super Mario', 'Jean-Michel Basquiat', 'Levon Helm', 'Barack Obama', 'Shigeru Miyamoto', 'Eero Aarnio', 'Martin Scorsese', 'Twyla Tharp', 'Edward Tufte');\n\n $safePlaces = array('104 Franklin Street, NYC', 'Grand Central Station', 'Corsica', 'Geneva', 'Portland', 'Tokyo', 'Atlantis', 'Waldo', 'Hot Coffee');\n\n $allPlaces = array_merge($safePlaces, array('Dublin', 'Heaven on Earth'));\n\n $things = array('3d printer', 'planet', 'goat', 'raccoon', 'computer program', 'skyscraper', 'data visualization', 'double-neck guitar', 'vinyl record', 'pdp-11', 'Baobab Tree', 'large hadron collider');\n\n $thingsIncludingIrregulars = array_merge($things, array('arcade game', 'salmon', 'javascript', 'zorbing', 'democracy', 'ARP 2600', 'IBM 701'));\n\n $resourceSearch = $this->randomItem('Find me', 'Search for', 'Get me', 'Run a search for', 'Look for', 'Find');\n\n $randomTypes = array_keys($this->_resourceTypes);\n\n $suggestions = array();\n\n $suggestionCases = array();\n\n for($i = 0; $i < $count; $i++) {\n\n shuffle($randomTypes);\n $type = $randomTypes[0];\n if($type == 'searchImages') {\n $preposition = $this->randomItem('of', 'with');\n } else {\n $preposition = $this->randomItem('of', 'about', 'with');\n }\n if($type == 'searchTweets') {\n $type = \"tweets\"; // No other dignified synonyms\n } else {\n $type = $this->randomItem($this->_resourceTypes[$type]) . 's';\n }\n\n // Don't repeat suggestion types until we have to\n if(count($suggestionCases) < 1) {\n $suggestionCases = range(0, 6);\n }\n shuffle($suggestionCases);\n $suggestionCase = array_shift($suggestionCases);\n\n switch($suggestionCase) {\n case 0:\n $thing = $this->randomItem($things) . 's';\n $number = $this->randomItem('two', 'three', 'four', 'five', 'ten', 'twenty', 'some', 'all the');\n $suggestions[] = implode(' ', array($resourceSearch, $number, $type, $preposition, $thing)) . '.';\n break;\n case 1:\n $thing = $this->randomItem($thingsIncludingIrregulars);\n $number = rand(2, 20);\n $suggestions[] = implode(' ', array($resourceSearch, $number, $thing, $type)) . '.';\n break;\n case 2:\n $suggestions[] = $this->randomItem(\"Define \" . $this->randomItem($thingsIncludingIrregulars) . \".\", \"What is a \" . $this->randomItem($things) . \"?\");\n break;\n case 3:\n $suggestions[] = $this->randomItem('Where is ', 'Where can I find ', 'Locate ') . $this->randomItem($allPlaces) . '?';\n break;\n case 4:\n $suggestions[] = $this->randomItem('Who is ', 'Do you know ') . $person . '?';\n break;\n case 5:\n $suggestions[] = $this->randomItem('How can I ', 'Where can I ') . $this->randomItem('help ', 'donate to ') . $this->randomItem('schools', 'kids', 'teachers') . '?';\n break;\n case 6:\n $suggestions[] = $this->randomItem('Is it safe in', 'Am I safe in', 'How safe is it in') . ' ' . $this->randomItem($safePlaces) . '?';\n }\n }\n return count($suggestions) == 1 ? $suggestions[0] : $suggestions;\n }", "function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function run()\n {\n $items=[['item_name'=>'Stones of Far Speech','item_price'=>'50','item_description'=>'Plain looking stones that allow walkie-talkie-like communication with other stones of far speech. Basically like walkie talkies, but magic','img_path'=>'/img/1.png','keywords'=>'communication,magic walkie talkie,any class','category'=>'Misc'],['item_name'=>'Phantom Fist','item_price'=>'400','item_description'=>'A glove made of spider silk. Makes your unarmed attacks a little bit stronger.Allows you to knock enemies back with unarmed blows','img_path'=>'/img/2.png','keywords'=>'combat, weapon, equipment,hand slot,unarmed,strength,any class','category'=>'Equipment'],['item_name'=>'Xtreme Teen Bible','item_price'=>'75','item_description'=>'A +1 holy symbol whose cover features a rad skateboarder. Can more easily spread the good word to teens.','img_path'=>'/img/3.png','keywords'=>'cleric,paladin,holy,holy symbol,equipment,','category'=>'Equipment'],['item_name'=>'Ring of Pointing','item_price'=>'25','item_description'=>'Copper ring with an inlaid ruby that can shoot a laser out. Can be used as a distraction or highlight salient information during a buisiness meeting','img_path'=>'/img/4.png','keywords'=>',ring,hand slot,equipment,laser pointer,ruby,any class','category'=>'Equipment'],['item_name'=>'Unlimited Pasta Pass','item_price'=>'100','item_description'=>'Can be used at any participating fantasy Olive Garden for free unlimited pasta for the owner and free unlimited soft drinks for the guests','img_path'=>'/img/5.png','keywords'=>',food,any class,olive garden','category'=>'Misc'],['item_name'=>'Wand of Switcharoo','item_price'=>'300','item_description'=>'A wooden wand that poops glitter when used. When pointed at another creature that lies within 100ft, it will switch places with the target if willing. Must make a DC 17 Constitution Saving throw to stay in place. Can only be used once per day.','img_path'=>'/img/6.png','keywords'=>',right,left,main,off,magic,combat,hand slot,equipment,wizard,want','category'=>'Weapon'],['item_name'=>'Scuttle Buddy','item_price'=>'150','item_description'=>'Mechanical beetle that you can use as a spy. It can talk to you, but it won’t have anything interesting to say beyond its primary functions. Can only be wound up four times before it breaks.','img_path'=>'/img/7.png','keywords'=>',communication,beetle,living,insect,spy,mechanical,animal,any class','category'=>'Misc'],['item_name'=>'Tankard of Potent Drink','item_price'=>'100','item_description'=>'A big tankard with pictures of spudz on it. Makes alcoholic beverages more alcoholic. Drinking water from this tankard makes you instantly sober; if sober it can cure a hangover.','img_path'=>'/img/8.png','keywords'=>',food,consumable,container,drink,beverage,alcohol','category'=>'Misc'],['item_name'=>'Glasses of Lightning Comprehension','item_price'=>'100','item_description'=>'A set of glasses with a whole bunch of lenses on them.Allows you to read and understand any language you know ten times as fast.','img_path'=>'/img/9.png','keywords'=>',magic,equipment,head slot,glasses,knowledge,intelligence,language','category'=>'Equipment'],['item_name'=>'Lens of Straight Creepin’','item_price'=>'100','item_description'=>'Glasses that make it look like your eyes are closed. Allows you to find footprints, tracks, or markings of anything that traveled through the air once per day.','img_path'=>'/img/10.png','keywords'=>',magic,equipment,lens,accessory,off,hand,history,arcane','category'=>'Equipment'],['item_name'=>'Ring of Recall','item_price'=>'700','item_description'=>'Gold ring with a purple stone. Allows you to regain a spell slot for a failed spell casting','img_path'=>'/img/11.png','keywords'=>'equipment,magic,non-combat,wizard,hand slot,spell,slot,ring,jewelry,wizard,accessory,arcane','category'=>'Equipment'],['item_name'=>'Bag of Mystery','item_price'=>'300','item_description'=>'Small, patchwork leather bag about the size of a fantasy softball. There appears to be some kind of spherical object inside. What’s in the bag?','img_path'=>'/img/12.png','keywords'=>'magic,bag,mystery,not a fish,random,accessory,???','category'=>'Misc'],['item_name'=>'Pocket Spa','item_price'=>'900','item_description'=>'A bag that when opened magically becomes a small spa. Regain extra hit points whenever you take a short rest.','img_path'=>'/img/13.png','keywords'=>',magic,relax,spa,bag,healing,spatial,restoration','category'=>'Misc'],['item_name'=>'Rusted Can of Cheerwine','item_price'=>'400','item_description'=>'Has seen some shit, but seems to be radiating with vital energies. Grants +5 max HP','img_path'=>'/img/14.png','keywords'=>'magic,food,consumable,healing,can,restoration,cheerwine','category'=>'Consumable'],['item_name'=>'Virtuoso’s Mask','item_price'=>'1100','item_description'=>'Allows you to cast Disguse Self as a Cantrip instead of a 1st Level Spell.','img_path'=>'/img/15.png','keywords'=>'disguise,spy,illusion,cantrip,magic,wizard,rogue,head slot','category'=>'Equipment'],['item_name'=>'Throwing Shield','item_price'=>'1200','item_description'=>'Confers the same AC bonus as a regular shield, and can be used as a thrown weapon. Can travel IN A STRAIGHT LINE up to 30 feet, and deals 1d8 + STR/Prof. Damage. IT DOESN’T COME BACK TO YOU AFTERWARDS. AND DON’T TRY TO RICOCHET THIS SHIT','img_path'=>'/img/16.png','keywords'=>'combat,shield,hand slot,fighter,paladin,off,hand,captain america,armor,ranged','category'=>'Equipment'],['item_name'=>'Alchemist’s Ring','item_price'=>'500','item_description'=>'When the wearer of this ring imbibes a healing potion, they receive 1d6 additional healing.','img_path'=>'/img/17.png','keywords'=>'magic,ring,hand slot,healing,restoration,augmentation,any class,','category'=>'Equipment'],['item_name'=>'Healing Potion','item_price'=>'50','item_description'=>'Heals the imbiber for 2d4+2 HP','img_path'=>'/img/18.png','keywords'=>'non-magic,food,consumable,healing,restoration,any class','category'=>'Consumable'],['item_name'=>'Haunted Doll','item_price'=>'100','item_description'=>'A creepy doll with the soul of a cat lady inside.This doll is very creepy. If its owner ever fails a third death save, the doll will take the hit instead, and will die in place of its owner.','img_path'=>'/img/19.png','keywords'=>'magic,combat,death save,creepy,haunted,doll,spooky,any class','category'=>'Misc'],['item_name'=>'SHIELD OF HEROIC MEMORIES','item_price'=>'1200','item_description'=>'This perfectly round silver shield initially has a mirror finish. As a hero takes it into battle it remembers the enemies encountered, gaining a +1 to AC on any subsequent battle with creatures of that type. The events of the battle are intricately engraved onto the shield’s surface (which has a seemingly endless capacity for detail). The bearer of the shield may also attempt to recount past battles (real or imagined) to the shield. Upon a DC 10 charisma check or DC 15 bluff check, the shield confers a +1 AC against the creatures described in the tall tales. 3 failed attempts at recounting stories cause the shield to be cleared of all of its memories. The engravings disappear. It reverts to its mirror finish. All bonuses are lost.','img_path'=>'/img/20.png','keywords'=>'combat,shield,hand slot,fighter,armor,bluff,memories,paladin','category'=>'Equipment'],['item_name'=>'The Glutton’s Fork','item_price'=>'750','item_description'=>'Once a day this fork will allow the user to eat any non-magical item they can fit in their mouth and gain 2d6 points of health. Just tap the fork on the item and it will turn edible.','img_path'=>'/img/22.png','keywords'=>'magic,healing,restoration,fork,glutton,eating,food,any class','category'=>'Misc'],['item_name'=>'The Champion’s Belt','item_price'=>'800','item_description'=>'This ornate belt is given to someone who has bested all opponents in a test of strength. Once per day the wearer may substitute their Strength score for their Wisdom or Charisma when making a stat check.','img_path'=>'/img/23.png','keywords'=>'magic,waist item,chapion,belt,strength,wisdom,charisma,any class','category'=>'Equipment'],['item_name'=>'Phone a friend scrying bones','item_price'=>'500','item_description'=>'Once per day, can be used to ask a yes, no, or maybe question to the fates (DM). There are three bones carved into people with happy faces and sad faces. All happy faces means yes, all sad faces mean no, anything in between means maybe. The DM can respond or choose not to answer.','img_path'=>'/img/24.png','keywords'=>'magic,communication,divination,friend,bones,any class','category'=>'Equipment'],['item_name'=>'The Nit Picker','item_price'=>'900','item_description'=>'Resembles a miniature garden gnome that carries lock picking tools in his hands. When not in use, looks like a 4\"tall statue.Twice daily, can be placed in front of a locked object to unlock it (functions as the spell Knock). At this point, the statue comes to life in order to pick the lock. After the lock is picked (or if he is unable to open it), reverts back to an inanimate statue. While picking the lock, the Nit Picker critiques any or all members of the party on their recent performance in the campaign. Nothing escapes the critical eye of the Nit Picker, no matter how small the perceived offense.','img_path'=>'/img/25.png','keywords'=>'magic,nit,picker,gnome,any class,spy,lockpick,mean,knock,living,spy','category'=>'Tool'],['item_name'=>'Plastic Sheriff Badge','item_price'=>'500','item_description'=>'Adds +3 to bluff checks when impersonating a person of authority.','img_path'=>'/img/26.png','keywords'=>'magic,bluff,sheriff,any class,badge,spy,impersonating,performance','category'=>'Equipment'],['item_name'=>'Flaming Poisoning Raging Sword of Doom','item_price'=>'60000','item_description'=>'A sword with a gigantic blade, wreathed in flames and with a crooked, oozing scorpion’s stinger affixed to its point. Deals an extra 20 melee damage.','img_path'=>'/img/27.png','keywords'=>'combat,hand slot,weapon,fighter,sword,flaming,poison,doom,fire,paladin','category'=>'Weapon'],['item_name'=>'No-Sodium Salt Shaker','item_price'=>'400','item_description'=>'A simple salt shaker, the contents of which have been bewitched to turn a bright shade of pink if sprinkled over food or drink that contains poison.','img_path'=>'/img/28.png','keywords'=>'magic,non-combat,poison,poison detector,food,drink, salt, sharker,any class','category'=>'Misc'],['item_name'=>'The Immovable Rod','item_price'=>'1100','item_description'=>'This rod is a flat iron bar with a small button on one end. When the button is pushed (a move action), the rod does not move from where it is, even if staying in place defies gravity. Thus, the owner can lift or place the rod wherever he wishes, push the button, and let go. Several immovable rods can even make a ladder when used together (although only two are needed). An immovable rod can support up to 8,000 pounds before falling to the ground. If a creature pushes against an immovable rod, it must make a DC 30 Strength check to move the rod up to 10 feet in a single round.','img_path'=>'/img/29.png','keywords'=>'magic,non-combat,accessory,any class,immoveable,rod,strength,ladder,climb,climbing,strength','category'=>'Tool'],['item_name'=>'Diadem of Fabulous Truthiness!','item_price'=>'900','item_description'=>'Once per long rest, you can channel your terminal fabulousity into this simple circlet and cast a free Zone of Truth, limited to a single target rather than a radius. Confound your enemies, emasculate your friends, and free up your cleric’s spell slots so he can do some actual healing.','img_path'=>'/img/30.png','keywords'=>'magic,non-combat,cleric,zone of truth,arcane,equipment,armor','category'=>'Equipment']];\n foreach ($items as $key => $item) {\n \t$tableItem = new \\App\\Item();\n \t$tableItem->item_name=$item['item_name'];\n \t$tableItem->item_price=$item['item_price'];\n \t$tableItem->item_description=$item['item_description'];\n \t$tableItem->img_path=$item['img_path'];\n \t$tableItem->keywords=$item['keywords'];\n \t$tableItem->category=$item['category'];\n \t$tableItem->save();\n }\n }", "function get_all_reviews_by_map_search() {\nglobal $wpdb;\n/*$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;*/\n$posts_per_page = get_option('posts_per_page');\n$status = escape_check($_GET['status']);\n$listing_country = escape_check($_GET['listing_country']);\n$type = escape_check($_GET['listing_type']);\n$location = escape_check($_GET['location']);\n$l_floor_area = escape_check($_GET['l_floor_area']);\n$l_price = escape_check($_GET['l_price']);\n\n\tif ($status != '') {\n\t\t$status_array = array('key' => 'listing_default_status','value' => $status);\n\t}\n\tif ($listing_country != '') {\n\t\t$listing_country_array = array('key' => 'listing_default_country','value' => $listing_country);\n\t}\n\tif ($type != '') {\n\t\t$type_array = array('key' => 'listing_default_type','value' => htmlentities($type));\n\t}\n\tif ($location != '') {\n\t\t$location_array = array('key' => 'listing_default_location','value' => $location);\n\t}\n\tif($l_price != '') {\n\t\t$min_price_array = array('key' => 'listing_min_price','value' => $l_price,'compare' => '<=','type' => 'numeric');\n\t\t$max_price_array = array('key' => 'listing_max_price','value' => $l_price,'compare' => '>=','type' => 'numeric');\n\t}\n\tif ($l_floor_area != '') {\n\t\t$min_size_array = array('key' => 'listing_min_floor_area','value' => $l_floor_area,'compare' => '<=','type' => 'numeric');\n\t\t$max_size_array = array('key' => 'listing_max_floor_area','value' => $l_floor_area,'compare' => '>=','type' => 'numeric');\n\t}\n\t\n\t$search_types = array('listing');\n\t\n\t$args = array(\n\t\t'post_type' => $search_types,\n\t\t'meta_query' => array(\n\t\t\t/*'relation' => 'AND',*/\n\t\t\t$listing_country_array,\n\t\t\t$type_array,\n\t\t\t$location_array,\n\t\t\t$max_price_array,\n\t\t\t$min_price_array,\n\t\t\t$min_size_array,\n\t\t\t$max_size_array\n\t\t),\n\t\t'paged' => $paged,\n\t);\n\t\n\t$searched_posts = new WP_Query( $args );\n\n\treturn $searched_posts;\n}", "function top_matches($prefs, $p, $dist){\r\n\t//get the top rated books only\r\n\t$topBooks = array();\r\n\tforeach($prefs[$p] as $k => $v){\r\n\t\tif ($v > RATING_MIN){\r\n\t\t\t//add the code to increase the rating if there is a similarity between the users\r\n\t\t\t//checking if the distance is greater that SOMEthING, then bumping up the rating\r\n\t\t\tif ($dist > SIM_NUM){\r\n\t\t\t\t$v += $v*$dist;\t\t\r\n\t\t\t}\r\n\t\t\t$topBooks[$k] = $v;\r\n\t\t}\r\n\t}\r\n\tarsort($topBooks);\r\n\t//print_r($topBooks);\r\n\treturn $topBooks;\r\n}", "public function run()\n {\n $foods = [\n \"1\"=> [\n \"id\"=> \"1\",\n \"foodProduct\"=> \"Абрикосы\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.5\",\n \"foodCalories\"=> \"46.0\"\n ],\n \"2\"=> [\n \"id\"=> \"2\",\n \"foodProduct\"=> \"Абрикосы сушёные - курага\",\n \"foodProteins\"=> \"5.2\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"55.0\",\n \"foodCalories\"=> \"234.0\"\n ],\n \"3\"=> [\n \"id\"=> \"3\",\n \"foodProduct\"=> \"Айва\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.9\",\n \"foodCalories\"=> \"38.0\"\n ],\n \"4\"=> [\n \"id\"=> \"4\",\n \"foodProduct\"=> \"Алыча\",\n \"foodProteins\"=> \"0.2\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"7.4\",\n \"foodCalories\"=> \"34.0\"\n ],\n \"5\"=> [\n \"id\"=> \"5\",\n \"foodProduct\"=> \"Ананас\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.8\",\n \"foodCalories\"=> \"48.0\"\n ],\n \"6\"=> [\n \"id\"=> \"6\",\n \"foodProduct\"=> \"Ананасовый сок\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.8\",\n \"foodCalories\"=> \"51.0\"\n ],\n \"7\"=> [\n \"id\"=> \"7\",\n \"foodProduct\"=> \"Апельсин\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.4\",\n \"foodCalories\"=> \"38.0\"\n ],\n \"8\"=> [\n \"id\"=> \"8\",\n \"foodProduct\"=> \"Апельсиновый сок\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.0\",\n \"foodCalories\"=> \"43.0\"\n ],\n \"9\"=> [\n \"id\"=> \"9\",\n \"foodProduct\"=> \"Арбуз\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.2\",\n \"foodCalories\"=> \"38.0\"\n ],\n \"10\"=> [\n \"id\"=> \"10\",\n \"foodProduct\"=> \"Арихис жареный солёный\",\n \"foodProteins\"=> \"27.6\",\n \"foodFats\"=> \"42.5\",\n \"foodCarbohydrates\"=> \"15.0\",\n \"foodCalories\"=> \"600.0\"\n ],\n \"11\"=> [\n \"id\"=> \"11\",\n \"foodProduct\"=> \"Баклажаны\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"5.5\",\n \"foodCalories\"=> \"24.0\"\n ],\n \"12\"=> [\n \"id\"=> \"12\",\n \"foodProduct\"=> \"Банан\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"22.4\",\n \"foodCalories\"=> \"91.0\"\n ],\n \"13\"=> [\n \"id\"=> \"13\",\n \"foodProduct\"=> \"Белые свежие\",\n \"foodProteins\"=> \"3.2\",\n \"foodFats\"=> \"0.7\",\n \"foodCarbohydrates\"=> \"1.6\",\n \"foodCalories\"=> \"25.0\"\n ],\n \"14\"=> [\n \"id\"=> \"14\",\n \"foodProduct\"=> \"Белые сушёные\",\n \"foodProteins\"=> \"27.6\",\n \"foodFats\"=> \"6.8\",\n \"foodCarbohydrates\"=> \"10.0\",\n \"foodCalories\"=> \"209.0\"\n ],\n \"15\"=> [\n \"id\"=> \"15\",\n \"foodProduct\"=> \"Бобы\",\n \"foodProteins\"=> \"6.0\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"8.3\",\n \"foodCalories\"=> \"58.0\"\n ],\n \"16\"=> [\n \"id\"=> \"16\",\n \"foodProduct\"=> \"Бразильский\",\n \"foodProteins\"=> \"14.3\",\n \"foodFats\"=> \"66.9\",\n \"foodCarbohydrates\"=> \"7.8\",\n \"foodCalories\"=> \"703.0\"\n ],\n \"17\"=> [\n \"id\"=> \"17\",\n \"foodProduct\"=> \"Брусника\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.6\",\n \"foodCalories\"=> \"40.0\"\n ],\n \"18\"=> [\n \"id\"=> \"18\",\n \"foodProduct\"=> \"Брюква\",\n \"foodProteins\"=> \"1.2\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"8.1\",\n \"foodCalories\"=> \"37.0\"\n ],\n \"19\"=> [\n \"id\"=> \"19\",\n \"foodProduct\"=> \"Вафли бисквитные мягкие квадратные\",\n \"foodProteins\"=> \"6.8\",\n \"foodFats\"=> \"25.8\",\n \"foodCarbohydrates\"=> \"55.8\",\n \"foodCalories\"=> \"482.0\"\n ],\n \"20\"=> [\n \"id\"=> \"20\",\n \"foodProduct\"=> \"Вафли бисквитные мягкие толстые круглые\",\n \"foodProteins\"=> \"4.6\",\n \"foodFats\"=> \"18.8\",\n \"foodCarbohydrates\"=> \"52.6\",\n \"foodCalories\"=> \"399.0\"\n ],\n \"21\"=> [\n \"id\"=> \"21\",\n \"foodProduct\"=> \"Вафли бисквитные мягкие тонкие\",\n \"foodProteins\"=> \"8.8\",\n \"foodFats\"=> \"20.3\",\n \"foodCarbohydrates\"=> \"52.0\",\n \"foodCalories\"=> \"426.0\"\n ],\n \"22\"=> [\n \"id\"=> \"22\",\n \"foodProduct\"=> \"Ветчина\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"35.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"355.0\"\n ],\n \"23\"=> [\n \"id\"=> \"23\",\n \"foodProduct\"=> \"Вино белое \",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"108.0\"\n ],\n \"24\"=> [\n \"id\"=> \"24\",\n \"foodProduct\"=> \"Виноград\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"17.5\",\n \"foodCalories\"=> \"69.0\"\n ],\n \"25\"=> [\n \"id\"=> \"25\",\n \"foodProduct\"=> \"Виноградный сок\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"15.0\",\n \"foodCalories\"=> \"60.0\"\n ],\n \"26\"=> [\n \"id\"=> \"26\",\n \"foodProduct\"=> \"Вишнёвый нектар \\\"Я\\\"\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.0\",\n \"foodCalories\"=> \"44.0\"\n ],\n \"27\"=> [\n \"id\"=> \"27\",\n \"foodProduct\"=> \"Вишня\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.3\",\n \"foodCalories\"=> \"49.0\"\n ],\n \"28\"=> [\n \"id\"=> \"28\",\n \"foodProduct\"=> \"Вишня мороженная\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.4\",\n \"foodCarbohydrates\"=> \"10.9\",\n \"foodCalories\"=> \"47.0\"\n ],\n \"29\"=> [\n \"id\"=> \"29\",\n \"foodProduct\"=> \"Вобла - икра\",\n \"foodProteins\"=> \"63.75\",\n \"foodFats\"=> \"3.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"286.5\"\n ],\n \"30\"=> [\n \"id\"=> \"30\",\n \"foodProduct\"=> \"Говядина - тушёнка консервы\",\n \"foodProteins\"=> \"20.5\",\n \"foodFats\"=> \"10.4\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"206.0\"\n ],\n \"31\"=> [\n \"id\"=> \"31\",\n \"foodProduct\"=> \"Говядина копчёно-варёная\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"5.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"113.0\"\n ],\n \"32\"=> [\n \"id\"=> \"32\",\n \"foodProduct\"=> \"Голубика\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"7.7\",\n \"foodCalories\"=> \"37.0\"\n ],\n \"33\"=> [\n \"id\"=> \"33\",\n \"foodProduct\"=> \"Горбуша натуральная консервы\",\n \"foodProteins\"=> \"21.00\",\n \"foodFats\"=> \"6.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"138.0\"\n ],\n \"34\"=> [\n \"id\"=> \"34\",\n \"foodProduct\"=> \"Горох\",\n \"foodProteins\"=> \"23.0\",\n \"foodFats\"=> \"1.2\",\n \"foodCarbohydrates\"=> \"56.3\",\n \"foodCalories\"=> \"303.0\"\n ],\n \"35\"=> [\n \"id\"=> \"35\",\n \"foodProduct\"=> \"Горошек зелёный\",\n \"foodProteins\"=> \"5.0\",\n \"foodFats\"=> \"0.2\",\n \"foodCarbohydrates\"=> \"13.3\",\n \"foodCalories\"=> \"72.0\"\n ],\n \"36\"=> [\n \"id\"=> \"36\",\n \"foodProduct\"=> \"Горошек зелёный консервированный\",\n \"foodProteins\"=> \"5.5\",\n \"foodFats\"=> \"0.6\",\n \"foodCarbohydrates\"=> \"11.5\",\n \"foodCalories\"=> \"73.0\"\n ],\n \"37\"=> [\n \"id\"=> \"37\",\n \"foodProduct\"=> \"Горчица русская\",\n \"foodProteins\"=> \"9.3\",\n \"foodFats\"=> \"8.0\",\n \"foodCarbohydrates\"=> \"11.0\",\n \"foodCalories\"=> \"175.0\"\n ],\n \"38\"=> [\n \"id\"=> \"38\",\n \"foodProduct\"=> \"Горчичное\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.8\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"898.0\"\n ],\n \"39\"=> [\n \"id\"=> \"39\",\n \"foodProduct\"=> \"Гранат\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.8\",\n \"foodCalories\"=> \"52.0\"\n ],\n \"40\"=> [\n \"id\"=> \"40\",\n \"foodProduct\"=> \"Гранатовый сок\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.0\",\n \"foodCalories\"=> \"48.0\"\n ],\n \"41\"=> [\n \"id\"=> \"41\",\n \"foodProduct\"=> \"Грейпфрукт\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"7.3\",\n \"foodCalories\"=> \"35.0\"\n ],\n \"42\"=> [\n \"id\"=> \"42\",\n \"foodProduct\"=> \"Грейпфруктовый сок\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.0\",\n \"foodCalories\"=> \"40.0\"\n ],\n \"43\"=> [\n \"id\"=> \"43\",\n \"foodProduct\"=> \"Грецкий\",\n \"foodProteins\"=> \"14.8\",\n \"foodFats\"=> \"64.0\",\n \"foodCarbohydrates\"=> \"13.7\",\n \"foodCalories\"=> \"698.0\"\n ],\n \"44\"=> [\n \"id\"=> \"44\",\n \"foodProduct\"=> \"Гречиха\",\n \"foodProteins\"=> \"11.6\",\n \"foodFats\"=> \"2.3\",\n \"foodCarbohydrates\"=> \"59.5\",\n \"foodCalories\"=> \"290.0\"\n ],\n \"45\"=> [\n \"id\"=> \"45\",\n \"foodProduct\"=> \"Гречка - крупа ядрица\",\n \"foodProteins\"=> \"12.5\",\n \"foodFats\"=> \"2.1\",\n \"foodCarbohydrates\"=> \"62.0\",\n \"foodCalories\"=> \"351.0\"\n ],\n \"46\"=> [\n \"id\"=> \"46\",\n \"foodProduct\"=> \"Грузди свежие\",\n \"foodProteins\"=> \"1.8\",\n \"foodFats\"=> \"0.8\",\n \"foodCarbohydrates\"=> \"1.1\",\n \"foodCalories\"=> \"19.0\"\n ],\n \"47\"=> [\n \"id\"=> \"47\",\n \"foodProduct\"=> \"Груша\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.7\",\n \"foodCalories\"=> \"42.0\"\n ],\n \"48\"=> [\n \"id\"=> \"48\",\n \"foodProduct\"=> \"Дрожжи\",\n \"foodProteins\"=> \"43.0\",\n \"foodFats\"=> \"5.7\",\n \"foodCarbohydrates\"=> \"38.0\",\n \"foodCalories\"=> \"361.0\"\n ],\n \"49\"=> [\n \"id\"=> \"49\",\n \"foodProduct\"=> \"Дыня\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.6\",\n \"foodCalories\"=> \"39.0\"\n ],\n \"50\"=> [\n \"id\"=> \"50\",\n \"foodProduct\"=> \"Ежевика\",\n \"foodProteins\"=> \"2.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.3\",\n \"foodCalories\"=> \"33.0\"\n ],\n \"51\"=> [\n \"id\"=> \"51\",\n \"foodProduct\"=> \"Земляника\",\n \"foodProteins\"=> \"1.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.1\",\n \"foodCalories\"=> \"41.0\"\n ],\n \"52\"=> [\n \"id\"=> \"52\",\n \"foodProduct\"=> \"Зефир в шоколаде\",\n \"foodProteins\"=> \"2.44\",\n \"foodFats\"=> \"12.71\",\n \"foodCarbohydrates\"=> \"73.44\",\n \"foodCalories\"=> \"326.0\"\n ],\n \"53\"=> [\n \"id\"=> \"53\",\n \"foodProduct\"=> \"Изюм\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"0.2\",\n \"foodCarbohydrates\"=> \"76.5\",\n \"foodCalories\"=> \"321.0\"\n ],\n \"54\"=> [\n \"id\"=> \"54\",\n \"foodProduct\"=> \"Икра лососевая солёная (красная)\",\n \"foodProteins\"=> \"32.0\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"245.0\"\n ],\n \"55\"=> [\n \"id\"=> \"55\",\n \"foodProduct\"=> \"Индейка - рулет копчёно-варёный\",\n \"foodProteins\"=> \"5.0\",\n \"foodFats\"=> \"17.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"190.0\"\n ],\n \"56\"=> [\n \"id\"=> \"56\",\n \"foodProduct\"=> \"Инжир\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"13.9\",\n \"foodCalories\"=> \"56.0\"\n ],\n \"57\"=> [\n \"id\"=> \"57\",\n \"foodProduct\"=> \"Инжир\",\n \"foodProteins\"=> \"3.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"50.0\",\n \"foodCalories\"=> \"210.0\"\n ],\n \"58\"=> [\n \"id\"=> \"58\",\n \"foodProduct\"=> \"Йогурт Активия без добавок\",\n \"foodProteins\"=> \"4.5\",\n \"foodFats\"=> \"3.5\",\n \"foodCarbohydrates\"=> \"6.3\",\n \"foodCalories\"=> \"75.0\"\n ],\n \"59\"=> [\n \"id\"=> \"59\",\n \"foodProduct\"=> \"Йогурт Активия медовый\",\n \"foodProteins\"=> \"3.7\",\n \"foodFats\"=> \"3.0\",\n \"foodCarbohydrates\"=> \"13.7\",\n \"foodCalories\"=> \"105.0\"\n ],\n \"60\"=> [\n \"id\"=> \"60\",\n \"foodProduct\"=> \"Йогурт Активия с мюсли и персиком\",\n \"foodProteins\"=> \"4.0\",\n \"foodFats\"=> \"3.0\",\n \"foodCarbohydrates\"=> \"16.2\",\n \"foodCalories\"=> \"110.0\"\n ],\n \"61\"=> [\n \"id\"=> \"61\",\n \"foodProduct\"=> \"Йогурт Активия с черносливом\",\n \"foodProteins\"=> \"3.7\",\n \"foodFats\"=> \"3.0\",\n \"foodCarbohydrates\"=> \"15.9\",\n \"foodCalories\"=> \"105.0\"\n ],\n \"62\"=> [\n \"id\"=> \"62\",\n \"foodProduct\"=> \"Йогурт молочный полужирный\",\n \"foodProteins\"=> \"3.4\",\n \"foodFats\"=> \"1.5\",\n \"foodCarbohydrates\"=> \"12.3\",\n \"foodCalories\"=> \"74.0\"\n ],\n \"63\"=> [\n \"id\"=> \"63\",\n \"foodProduct\"=> \"Кабачки\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.3\",\n \"foodCarbohydrates\"=> \"5.7\",\n \"foodCalories\"=> \"27.0\"\n ],\n \"64\"=> [\n \"id\"=> \"64\",\n \"foodProduct\"=> \"Какао порошок\",\n \"foodProteins\"=> \"24.7\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"28.5\",\n \"foodCalories\"=> \"364.0\"\n ],\n \"65\"=> [\n \"id\"=> \"65\",\n \"foodProduct\"=> \"Какао сухой растворимый с сахаром\",\n \"foodProteins\"=> \"5.0\",\n \"foodFats\"=> \"3.0\",\n \"foodCarbohydrates\"=> \"83.5\",\n \"foodCalories\"=> \"380.0\"\n ],\n \"66\"=> [\n \"id\"=> \"66\",\n \"foodProduct\"=> \"Кальмар \",\n \"foodProteins\"=> \"18.0\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"98.0\"\n ],\n \"67\"=> [\n \"id\"=> \"67\",\n \"foodProduct\"=> \"Кальмар натуральный консервы\",\n \"foodProteins\"=> \"20.0\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"1.8\",\n \"foodCalories\"=> \"106.0\"\n ],\n \"68\"=> [\n \"id\"=> \"68\",\n \"foodProduct\"=> \"Кальмар сушёный\",\n \"foodProteins\"=> \"70.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"3.0\",\n \"foodCalories\"=> \"293.0\"\n ],\n \"69\"=> [\n \"id\"=> \"69\",\n \"foodProduct\"=> \"Кальмары в масле консервированные\",\n \"foodProteins\"=> \"19.0\",\n \"foodFats\"=> \"5.8\",\n \"foodCarbohydrates\"=> \"2.2\",\n \"foodCalories\"=> \"137.0\"\n ],\n \"70\"=> [\n \"id\"=> \"70\",\n \"foodProduct\"=> \"Капуста белокочанная \",\n \"foodProteins\"=> \"1.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.4\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"71\"=> [\n \"id\"=> \"71\",\n \"foodProduct\"=> \"Капуста брокколи\",\n \"foodProteins\"=> \"2.6\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"4.5\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"72\"=> [\n \"id\"=> \"72\",\n \"foodProduct\"=> \"Капуста брюссельская\",\n \"foodProteins\"=> \"4.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.7\",\n \"foodCalories\"=> \"46.0\"\n ],\n \"73\"=> [\n \"id\"=> \"73\",\n \"foodProduct\"=> \"Капуста кольраби\",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.3\",\n \"foodCalories\"=> \"43.0\"\n ],\n \"74\"=> [\n \"id\"=> \"74\",\n \"foodProduct\"=> \"Капуста краснокочанная\",\n \"foodProteins\"=> \"1.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.1\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"75\"=> [\n \"id\"=> \"75\",\n \"foodProduct\"=> \"Капуста морская\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.2\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"5.0\"\n ],\n \"76\"=> [\n \"id\"=> \"76\",\n \"foodProduct\"=> \"Капуста цветная\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.9\",\n \"foodCalories\"=> \"29.0\"\n ],\n \"77\"=> [\n \"id\"=> \"77\",\n \"foodProduct\"=> \"Карп\",\n \"foodProteins\"=> \"16.0\",\n \"foodFats\"=> \"3.6\",\n \"foodCarbohydrates\"=> \"1.3\",\n \"foodCalories\"=> \"96.0\"\n ],\n \"78\"=> [\n \"id\"=> \"78\",\n \"foodProduct\"=> \"Картофель\",\n \"foodProteins\"=> \"2.0\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"19.7\",\n \"foodCalories\"=> \"83.0\"\n ],\n \"79\"=> [\n \"id\"=> \"79\",\n \"foodProduct\"=> \"Картофель сладкий (батат)\",\n \"foodProteins\"=> \"2.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"13.8\",\n \"foodCalories\"=> \"60.0\"\n ],\n \"80\"=> [\n \"id\"=> \"80\",\n \"foodProduct\"=> \"Картофель хрустящий \\\"Московский\\\"\",\n \"foodProteins\"=> \"4.6\",\n \"foodFats\"=> \"35.6\",\n \"foodCarbohydrates\"=> \"47.2\",\n \"foodCalories\"=> \"532.0\"\n ],\n \"81\"=> [\n \"id\"=> \"81\",\n \"foodProduct\"=> \"Кекс без дрожжей с ягодами и орехами\",\n \"foodProteins\"=> \"7.00\",\n \"foodFats\"=> \"4.00\",\n \"foodCarbohydrates\"=> \"52.00\",\n \"foodCalories\"=> \"274.0\"\n ],\n \"82\"=> [\n \"id\"=> \"82\",\n \"foodProduct\"=> \"Кета слабосолёная\",\n \"foodProteins\"=> \"24.0\",\n \"foodFats\"=> \"9.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"177.0\"\n ],\n \"83\"=> [\n \"id\"=> \"83\",\n \"foodProduct\"=> \"Кефир 1%\",\n \"foodProteins\"=> \"3.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"3.8\",\n \"foodCalories\"=> \"39.0\"\n ],\n \"84\"=> [\n \"id\"=> \"84\",\n \"foodProduct\"=> \"Кефир 3,2%\",\n \"foodProteins\"=> \"3.2\",\n \"foodFats\"=> \"3.2\",\n \"foodCarbohydrates\"=> \"5.4\",\n \"foodCalories\"=> \"64.0\"\n ],\n \"85\"=> [\n \"id\"=> \"85\",\n \"foodProduct\"=> \"Кефир-Био Biomax 1%\",\n \"foodProteins\"=> \"3.6\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"5.6\",\n \"foodCalories\"=> \"47.3\"\n ],\n \"86\"=> [\n \"id\"=> \"86\",\n \"foodProduct\"=> \"Кешью\",\n \"foodProteins\"=> \"17.5\",\n \"foodFats\"=> \"42.2\",\n \"foodCarbohydrates\"=> \"30.5\",\n \"foodCalories\"=> \"572.0\"\n ],\n \"87\"=> [\n \"id\"=> \"87\",\n \"foodProduct\"=> \"Кизил\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.7\",\n \"foodCalories\"=> \"45.0\"\n ],\n \"88\"=> [\n \"id\"=> \"88\",\n \"foodProduct\"=> \"Клубника мороженная\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.4\",\n \"foodCarbohydrates\"=> \"7.7\",\n \"foodCalories\"=> \"41.3\"\n ],\n \"89\"=> [\n \"id\"=> \"89\",\n \"foodProduct\"=> \"Клюква\",\n \"foodProteins\"=> \"0.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.8\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"90\"=> [\n \"id\"=> \"90\",\n \"foodProduct\"=> \"Клюква в сахарной пудре\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"96.0\",\n \"foodCalories\"=> \"384.0\"\n ],\n \"91\"=> [\n \"id\"=> \"91\",\n \"foodProduct\"=> \"Клюква дроблёная с сахаром\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"45.0\",\n \"foodCalories\"=> \"180.0\"\n ],\n \"92\"=> [\n \"id\"=> \"92\",\n \"foodProduct\"=> \"Клюква мороженная\",\n \"foodProteins\"=> \"0.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"3.8\",\n \"foodCalories\"=> \"17.0\"\n ],\n \"93\"=> [\n \"id\"=> \"93\",\n \"foodProduct\"=> \"Кобаса полукопчёная\",\n \"foodProteins\"=> \"13.0\",\n \"foodFats\"=> \"25.5\",\n \"foodCarbohydrates\"=> \"4.0\",\n \"foodCalories\"=> \"321.0\"\n ],\n \"94\"=> [\n \"id\"=> \"94\",\n \"foodProduct\"=> \"Колбаса варёная\",\n \"foodProteins\"=> \"12.0\",\n \"foodFats\"=> \"19.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"226.0\"\n ],\n \"95\"=> [\n \"id\"=> \"95\",\n \"foodProduct\"=> \"Колбаса варёно-копчёная сервелат\",\n \"foodProteins\"=> \"16.1\",\n \"foodFats\"=> \"40.1\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"425.0\"\n ],\n \"96\"=> [\n \"id\"=> \"96\",\n \"foodProduct\"=> \"Колбаса сырокопчённая сервелат\",\n \"foodProteins\"=> \"23.9\",\n \"foodFats\"=> \"47.8\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"526.0\"\n ],\n \"97\"=> [\n \"id\"=> \"97\",\n \"foodProduct\"=> \"Колбаса сырокопчённая сервелат\",\n \"foodProteins\"=> \"24.0\",\n \"foodFats\"=> \"40.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"461.0\"\n ],\n \"98\"=> [\n \"id\"=> \"98\",\n \"foodProduct\"=> \"Колбаски для гриля (говядина и свинина)\",\n \"foodProteins\"=> \"12.2\",\n \"foodFats\"=> \"23.2\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"257.6\"\n ],\n \"99\"=> [\n \"id\"=> \"99\",\n \"foodProduct\"=> \"Конопляное\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.85\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"100\"=> [\n \"id\"=> \"100\",\n \"foodProduct\"=> \"Конфеты \\\"Алёнка\\\"\",\n \"foodProteins\"=> \"6.7\",\n \"foodFats\"=> \"32.2\",\n \"foodCarbohydrates\"=> \"58.9\",\n \"foodCalories\"=> \"527.0\"\n ],\n \"101\"=> [\n \"id\"=> \"101\",\n \"foodProduct\"=> \"Конфеты \\\"Мишка косолапый\\\"\",\n \"foodProteins\"=> \"5.7\",\n \"foodFats\"=> \"32.1\",\n \"foodCarbohydrates\"=> \"60.5\",\n \"foodCalories\"=> \"526.0\"\n ],\n \"102\"=> [\n \"id\"=> \"102\",\n \"foodProduct\"=> \"Конфеты \\\"Суфле в шоколаде\\\"\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"14.4\",\n \"foodCarbohydrates\"=> \"69.3\",\n \"foodCalories\"=> \"392.0\"\n ],\n \"103\"=> [\n \"id\"=> \"103\",\n \"foodProduct\"=> \"Конфеты батончик \\\"рот фронт\\\"\",\n \"foodProteins\"=> \"10.6\",\n \"foodFats\"=> \"30.4\",\n \"foodCarbohydrates\"=> \"52.4\",\n \"foodCalories\"=> \"519.0\"\n ],\n \"104\"=> [\n \"id\"=> \"104\",\n \"foodProduct\"=> \"Конфеты Грильяж в шоколаде\",\n \"foodProteins\"=> \"5.1\",\n \"foodFats\"=> \"26.9\",\n \"foodCarbohydrates\"=> \"64.6\",\n \"foodCalories\"=> \"512.0\"\n ],\n \"105\"=> [\n \"id\"=> \"105\",\n \"foodProduct\"=> \"Конфеты карамель в шоколаде \",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"10.9\",\n \"foodCarbohydrates\"=> \"77.0\",\n \"foodCalories\"=> \"406.0\"\n ],\n \"106\"=> [\n \"id\"=> \"106\",\n \"foodProduct\"=> \"Конфеты шоколадные ассорти с начинкой\",\n \"foodProteins\"=> \"2.7\",\n \"foodFats\"=> \"26.6\",\n \"foodCarbohydrates\"=> \"58.90\",\n \"foodCalories\"=> \"486.0\"\n ],\n \"107\"=> [\n \"id\"=> \"107\",\n \"foodProduct\"=> \"Конфеты шоколадные с вафлями и начинкой \\\"Золотистые орешки\\\"\",\n \"foodProteins\"=> \"6.7\",\n \"foodFats\"=> \"28.9\",\n \"foodCarbohydrates\"=> \"51.8\",\n \"foodCalories\"=> \"470.0\"\n ],\n \"108\"=> [\n \"id\"=> \"108\",\n \"foodProduct\"=> \"Конфеты шоколадные с орехово-сливочной начинкой\",\n \"foodProteins\"=> \"7.2\",\n \"foodFats\"=> \"35.0\",\n \"foodCarbohydrates\"=> \"55.20\",\n \"foodCalories\"=> \"564.0\"\n ],\n \"109\"=> [\n \"id\"=> \"109\",\n \"foodProduct\"=> \"Кофе в зёрных\",\n \"foodProteins\"=> \"13.9\",\n \"foodFats\"=> \"14.4\",\n \"foodCarbohydrates\"=> \"4.1\",\n \"foodCalories\"=> \"223.0\"\n ],\n \"110\"=> [\n \"id\"=> \"110\",\n \"foodProduct\"=> \"Кофе растворимый \",\n \"foodProteins\"=> \"14.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.3\",\n \"foodCalories\"=> \"100.0\"\n ],\n \"111\"=> [\n \"id\"=> \"111\",\n \"foodProduct\"=> \"Краб\",\n \"foodProteins\"=> \"16.0\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"69.0\"\n ],\n \"112\"=> [\n \"id\"=> \"112\",\n \"foodProduct\"=> \"Крабовые палочки имитация\",\n \"foodProteins\"=> \"7.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"10.0\",\n \"foodCalories\"=> \"377.0\"\n ],\n \"113\"=> [\n \"id\"=> \"113\",\n \"foodProduct\"=> \"Крабы натуральные в собственном соку консервированные\",\n \"foodProteins\"=> \"18.0\",\n \"foodFats\"=> \"1.2\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"85.0\"\n ],\n \"114\"=> [\n \"id\"=> \"114\",\n \"foodProduct\"=> \"Креветки\",\n \"foodProteins\"=> \"18.9\",\n \"foodFats\"=> \"0.8\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"83.0\"\n ],\n \"115\"=> [\n \"id\"=> \"115\",\n \"foodProduct\"=> \"Крыжовник\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.9\",\n \"foodCalories\"=> \"44.0\"\n ],\n \"116\"=> [\n \"id\"=> \"116\",\n \"foodProduct\"=> \"Кукуруза\",\n \"foodProteins\"=> \"10.3\",\n \"foodFats\"=> \"4.9\",\n \"foodCarbohydrates\"=> \"67.5\",\n \"foodCalories\"=> \"338.0\"\n ],\n \"117\"=> [\n \"id\"=> \"117\",\n \"foodProduct\"=> \"Кукуруза сладкая консервированная\",\n \"foodProteins\"=> \"4.7\",\n \"foodFats\"=> \"1.6\",\n \"foodCarbohydrates\"=> \"23.6\",\n \"foodCalories\"=> \"128.0\"\n ],\n \"118\"=> [\n \"id\"=> \"118\",\n \"foodProduct\"=> \"Кукурузное\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"119\"=> [\n \"id\"=> \"119\",\n \"foodProduct\"=> \"Курага\",\n \"foodProteins\"=> \"5.5\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"63.5\",\n \"foodCalories\"=> \"291.0\"\n ],\n \"120\"=> [\n \"id\"=> \"120\",\n \"foodProduct\"=> \"Лангуст\",\n \"foodProteins\"=> \"18.4\",\n \"foodFats\"=> \"0.4\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"77.0\"\n ],\n \"121\"=> [\n \"id\"=> \"121\",\n \"foodProduct\"=> \"Лапша яичная\",\n \"foodProteins\"=> \"10.4\",\n \"foodFats\"=> \"1.6\",\n \"foodCarbohydrates\"=> \"70.3\",\n \"foodCalories\"=> \"337.0\"\n ],\n \"122\"=> [\n \"id\"=> \"122\",\n \"foodProduct\"=> \"Ледяная рыба\",\n \"foodProteins\"=> \"15.9\",\n \"foodFats\"=> \"0.9\",\n \"foodCarbohydrates\"=> \"1.3\",\n \"foodCalories\"=> \"104.0\"\n ],\n \"123\"=> [\n \"id\"=> \"123\",\n \"foodProduct\"=> \"Ликёр маленькая рюмка\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"70.0\"\n ],\n \"124\"=> [\n \"id\"=> \"124\",\n \"foodProduct\"=> \"Лимон\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"3.6\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"125\"=> [\n \"id\"=> \"125\",\n \"foodProduct\"=> \"Лисички свежие\",\n \"foodProteins\"=> \"1.6\",\n \"foodFats\"=> \"0.9\",\n \"foodCarbohydrates\"=> \"2.1\",\n \"foodCalories\"=> \"22.0\"\n ],\n \"126\"=> [\n \"id\"=> \"126\",\n \"foodProduct\"=> \"Лосось консервированный натуральный \",\n \"foodProteins\"=> \"21.0\",\n \"foodFats\"=> \"6.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"138.0\"\n ],\n \"127\"=> [\n \"id\"=> \"127\",\n \"foodProduct\"=> \"Лук зелёный\",\n \"foodProteins\"=> \"1.3\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.3\",\n \"foodCalories\"=> \"22.0\"\n ],\n \"128\"=> [\n \"id\"=> \"128\",\n \"foodProduct\"=> \"Лук репчатый\",\n \"foodProteins\"=> \"1.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.5\",\n \"foodCalories\"=> \"43.0\"\n ],\n \"129\"=> [\n \"id\"=> \"129\",\n \"foodProduct\"=> \"Лукум болгарский\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.85\",\n \"foodCarbohydrates\"=> \"89.65\",\n \"foodCalories\"=> \"382.0\"\n ],\n \"130\"=> [\n \"id\"=> \"130\",\n \"foodProduct\"=> \"Майонез любительский\",\n \"foodProteins\"=> \"3.1\",\n \"foodFats\"=> \"47.0\",\n \"foodCarbohydrates\"=> \"3.0\",\n \"foodCalories\"=> \"449.0\"\n ],\n \"131\"=> [\n \"id\"=> \"131\",\n \"foodProduct\"=> \"Майонез салатный \",\n \"foodProteins\"=> \"2.3\",\n \"foodFats\"=> \"55.0\",\n \"foodCarbohydrates\"=> \"4.2\",\n \"foodCalories\"=> \"537.4\"\n ],\n \"132\"=> [\n \"id\"=> \"132\",\n \"foodProduct\"=> \"Макаронные изделия\",\n \"foodProteins\"=> \"10.7\",\n \"foodFats\"=> \"1.3\",\n \"foodCarbohydrates\"=> \"74.2\",\n \"foodCalories\"=> \"333.0\"\n ],\n \"133\"=> [\n \"id\"=> \"133\",\n \"foodProduct\"=> \"Макаронные изделия для Лазаньи Италия\",\n \"foodProteins\"=> \"12.5\",\n \"foodFats\"=> \"1.5\",\n \"foodCarbohydrates\"=> \"73.0\",\n \"foodCalories\"=> \"355.0\"\n ],\n \"134\"=> [\n \"id\"=> \"134\",\n \"foodProduct\"=> \"Макаронные изделия из свежего теста Pasta\",\n \"foodProteins\"=> \"12.0\",\n \"foodFats\"=> \"3.0\",\n \"foodCarbohydrates\"=> \"53.0\",\n \"foodCalories\"=> \"290.0\"\n ],\n \"135\"=> [\n \"id\"=> \"135\",\n \"foodProduct\"=> \"Макаронные изделия Италия с содержанием яиц \",\n \"foodProteins\"=> \"14.0\",\n \"foodFats\"=> \"4.0\",\n \"foodCarbohydrates\"=> \"65.0\",\n \"foodCalories\"=> \"352.0\"\n ],\n \"136\"=> [\n \"id\"=> \"136\",\n \"foodProduct\"=> \"Макаронные изделия лапша с содержанием яиц на отварные 100 гр\",\n \"foodProteins\"=> \"6.0\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"26.0\",\n \"foodCalories\"=> \"146.0\"\n ],\n \"137\"=> [\n \"id\"=> \"137\",\n \"foodProduct\"=> \"Макаронные изделия с добавками моркови\",\n \"foodProteins\"=> \"11.3\",\n \"foodFats\"=> \"0.9\",\n \"foodCarbohydrates\"=> \"77.1\",\n \"foodCalories\"=> \"362.0\"\n ],\n \"138\"=> [\n \"id\"=> \"138\",\n \"foodProduct\"=> \"Макароны Италия твёрдых сортов пшеницы Pasta Zara\",\n \"foodProteins\"=> \"12.0\",\n \"foodFats\"=> \"1.1\",\n \"foodCarbohydrates\"=> \"75.0\",\n \"foodCalories\"=> \"358.0\"\n ],\n \"139\"=> [\n \"id\"=> \"139\",\n \"foodProduct\"=> \"Макароны Италия твёрдых сортов пшеницы с добавками томатов и шпината Maltagliati\",\n \"foodProteins\"=> \"12.0\",\n \"foodFats\"=> \"1.6\",\n \"foodCarbohydrates\"=> \"71.0\",\n \"foodCalories\"=> \"346.0\"\n ],\n \"140\"=> [\n \"id\"=> \"140\",\n \"foodProduct\"=> \"Макароны Италия твёрдых сортов пшеницы с добавками шпината Federici\",\n \"foodProteins\"=> \"13.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"74.0\",\n \"foodCalories\"=> \"357.0\"\n ],\n \"141\"=> [\n \"id\"=> \"141\",\n \"foodProduct\"=> \"Малина\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.0\",\n \"foodCalories\"=> \"41.0\"\n ],\n \"142\"=> [\n \"id\"=> \"142\",\n \"foodProduct\"=> \"Малина мороженная\",\n \"foodProteins\"=> \"1.2\",\n \"foodFats\"=> \"0.3\",\n \"foodCarbohydrates\"=> \"6.1\",\n \"foodCalories\"=> \"38.2\"\n ],\n \"143\"=> [\n \"id\"=> \"143\",\n \"foodProduct\"=> \"Мандарин\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.6\",\n \"foodCalories\"=> \"38.0\"\n ],\n \"144\"=> [\n \"id\"=> \"144\",\n \"foodProduct\"=> \"Мармелад (в сахаре)\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.00\",\n \"foodCarbohydrates\"=> \"80.60\",\n \"foodCalories\"=> \"311.0\"\n ],\n \"145\"=> [\n \"id\"=> \"145\",\n \"foodProduct\"=> \"Маслины солёные\",\n \"foodProteins\"=> \"1.23\",\n \"foodFats\"=> \"16.43\",\n \"foodCarbohydrates\"=> \"4.78\",\n \"foodCalories\"=> \"172.91\"\n ],\n \"146\"=> [\n \"id\"=> \"146\",\n \"foodProduct\"=> \"Масло сливочное Вологодское\",\n \"foodProteins\"=> \"0.5\",\n \"foodFats\"=> \"82.5\",\n \"foodCarbohydrates\"=> \"0.8\",\n \"foodCalories\"=> \"748.0\"\n ],\n \"147\"=> [\n \"id\"=> \"147\",\n \"foodProduct\"=> \"Масло сливочное крестьянское \",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"72.5\",\n \"foodCarbohydrates\"=> \"1.3\",\n \"foodCalories\"=> \"661.0\"\n ],\n \"148\"=> [\n \"id\"=> \"148\",\n \"foodProduct\"=> \"Маслята свежие\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.4\",\n \"foodCarbohydrates\"=> \"3.2\",\n \"foodCalories\"=> \"19.0\"\n ],\n \"149\"=> [\n \"id\"=> \"149\",\n \"foodProduct\"=> \"Мёд\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"71.0\",\n \"foodCalories\"=> \"284.0\"\n ],\n \"150\"=> [\n \"id\"=> \"150\",\n \"foodProduct\"=> \"Миндаль жареный\",\n \"foodProteins\"=> \"25.6\",\n \"foodFats\"=> \"32.2\",\n \"foodCarbohydrates\"=> \"14.8\",\n \"foodCalories\"=> \"635.0\"\n ],\n \"151\"=> [\n \"id\"=> \"151\",\n \"foodProduct\"=> \"Мирабель\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.6\",\n \"foodCalories\"=> \"40.0\"\n ],\n \"152\"=> [\n \"id\"=> \"152\",\n \"foodProduct\"=> \"Молоко 1,5%\",\n \"foodProteins\"=> \"2.9\",\n \"foodFats\"=> \"1.5\",\n \"foodCarbohydrates\"=> \"4.7\",\n \"foodCalories\"=> \"44.0\"\n ],\n \"153\"=> [\n \"id\"=> \"153\",\n \"foodProduct\"=> \"Молоко 3,2% жирности\",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"3.2\",\n \"foodCarbohydrates\"=> \"4.7\",\n \"foodCalories\"=> \"58.0\"\n ],\n \"154\"=> [\n \"id\"=> \"154\",\n \"foodProduct\"=> \"Молоко 3,5% жирности\",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"3.5\",\n \"foodCarbohydrates\"=> \"4.7\",\n \"foodCalories\"=> \"62.0\"\n ],\n \"155\"=> [\n \"id\"=> \"155\",\n \"foodProduct\"=> \"Молоко сгущённое \\\"Сгущёнка Молочная страна\\\"\",\n \"foodProteins\"=> \"4.2\",\n \"foodFats\"=> \"8.5\",\n \"foodCarbohydrates\"=> \"55.7\",\n \"foodCalories\"=> \"307.6\"\n ],\n \"156\"=> [\n \"id\"=> \"156\",\n \"foodProduct\"=> \"Молоко сгущённое \\\"Сгущёнка Смоленская\\\"\",\n \"foodProteins\"=> \"7.4\",\n \"foodFats\"=> \"8.5\",\n \"foodCarbohydrates\"=> \"55.8\",\n \"foodCalories\"=> \"325.0\"\n ],\n \"157\"=> [\n \"id\"=> \"157\",\n \"foodProduct\"=> \"Морковь жёлтая\",\n \"foodProteins\"=> \"1.3\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"6.0\",\n \"foodCalories\"=> \"33.0\"\n ],\n \"158\"=> [\n \"id\"=> \"158\",\n \"foodProduct\"=> \"Морковь красная\",\n \"foodProteins\"=> \"1.3\",\n \"foodFats\"=> \"0.1\",\n \"foodCarbohydrates\"=> \"7.0\",\n \"foodCalories\"=> \"33.0\"\n ],\n \"159\"=> [\n \"id\"=> \"159\",\n \"foodProduct\"=> \"Мороженое сливочное в шоколадной глазури \\\"Лакомка\\\"\",\n \"foodProteins\"=> \"3.2\",\n \"foodFats\"=> \"20.2\",\n \"foodCarbohydrates\"=> \"19.4\",\n \"foodCalories\"=> \"280.0\"\n ],\n \"160\"=> [\n \"id\"=> \"160\",\n \"foodProduct\"=> \"Мороженое сливочное в шоколадной глазури с орехами \\\"Боярское\\\"\",\n \"foodProteins\"=> \"3.9\",\n \"foodFats\"=> \"18.9\",\n \"foodCarbohydrates\"=> \"23.0\",\n \"foodCalories\"=> \"277.0\"\n ],\n \"161\"=> [\n \"id\"=> \"161\",\n \"foodProduct\"=> \"Морошка\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.8\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"162\"=> [\n \"id\"=> \"162\",\n \"foodProduct\"=> \"Мюсли \\\"фруктовый сад\\\"\",\n \"foodProteins\"=> \"14.0\",\n \"foodFats\"=> \"4.0\",\n \"foodCarbohydrates\"=> \"70.0\",\n \"foodCalories\"=> \"370.0\"\n ],\n \"163\"=> [\n \"id\"=> \"163\",\n \"foodProduct\"=> \"Напиток Горячий шоколад сухой растворимый с сахаром\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"12.8\",\n \"foodCarbohydrates\"=> \"72.8\",\n \"foodCalories\"=> \"452.0\"\n ],\n \"164\"=> [\n \"id\"=> \"164\",\n \"foodProduct\"=> \"Нут\",\n \"foodProteins\"=> \"20.1\",\n \"foodFats\"=> \"5.0\",\n \"foodCarbohydrates\"=> \"54.2\",\n \"foodCalories\"=> \"329.0\"\n ],\n \"165\"=> [\n \"id\"=> \"165\",\n \"foodProduct\"=> \"Облепиха\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.5\",\n \"foodCalories\"=> \"30.0\"\n ],\n \"166\"=> [\n \"id\"=> \"166\",\n \"foodProduct\"=> \"Овёс\",\n \"foodProteins\"=> \"10.1\",\n \"foodFats\"=> \"4.7\",\n \"foodCarbohydrates\"=> \"57.8\",\n \"foodCalories\"=> \"300.0\"\n ],\n \"167\"=> [\n \"id\"=> \"167\",\n \"foodProduct\"=> \"Овсянные хлопья \",\n \"foodProteins\"=> \"11.0\",\n \"foodFats\"=> \"6.2\",\n \"foodCarbohydrates\"=> \"51.0\",\n \"foodCalories\"=> \"305.0\"\n ],\n \"168\"=> [\n \"id\"=> \"168\",\n \"foodProduct\"=> \"Огурцы\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"3.0\",\n \"foodCalories\"=> \"15.0\"\n ],\n \"169\"=> [\n \"id\"=> \"169\",\n \"foodProduct\"=> \"Огурцы маринованные\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.0\",\n \"foodCalories\"=> \"18.0\"\n ],\n \"170\"=> [\n \"id\"=> \"170\",\n \"foodProduct\"=> \"Огурцы солёные\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.0\",\n \"foodCalories\"=> \"15.0\"\n ],\n \"171\"=> [\n \"id\"=> \"171\",\n \"foodProduct\"=> \"Оливки фаршированные анчоусами\",\n \"foodProteins\"=> \"2.1\",\n \"foodFats\"=> \"15.7\",\n \"foodCarbohydrates\"=> \"5.2\",\n \"foodCalories\"=> \"171.0\"\n ],\n \"172\"=> [\n \"id\"=> \"172\",\n \"foodProduct\"=> \"Оливки фаршированные красным перцем\",\n \"foodProteins\"=> \"1.39\",\n \"foodFats\"=> \"14.1\",\n \"foodCarbohydrates\"=> \"1.96\",\n \"foodCalories\"=> \"154.3\"\n ],\n \"173\"=> [\n \"id\"=> \"173\",\n \"foodProduct\"=> \"Оливки фаршированные лимоном\",\n \"foodProteins\"=> \"1.6\",\n \"foodFats\"=> \"15.1\",\n \"foodCarbohydrates\"=> \"2.7\",\n \"foodCalories\"=> \"148.2\"\n ],\n \"174\"=> [\n \"id\"=> \"174\",\n \"foodProduct\"=> \"Оливковое\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"898.0\"\n ],\n \"175\"=> [\n \"id\"=> \"175\",\n \"foodProduct\"=> \"Опята свежие\",\n \"foodProteins\"=> \"2.2\",\n \"foodFats\"=> \"0.7\",\n \"foodCarbohydrates\"=> \"1.3\",\n \"foodCalories\"=> \"20.0\"\n ],\n \"176\"=> [\n \"id\"=> \"176\",\n \"foodProduct\"=> \"Осетрина горячего копчения\",\n \"foodProteins\"=> \"22.0\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"13.0\",\n \"foodCalories\"=> \"223.0\"\n ],\n \"177\"=> [\n \"id\"=> \"177\",\n \"foodProduct\"=> \"Пастернак корень\",\n \"foodProteins\"=> \"1.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.0\",\n \"foodCalories\"=> \"47.0\"\n ],\n \"178\"=> [\n \"id\"=> \"178\",\n \"foodProduct\"=> \"Патиссоны\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.3\",\n \"foodCalories\"=> \"19.0\"\n ],\n \"179\"=> [\n \"id\"=> \"179\",\n \"foodProduct\"=> \"Пекан (китайский орех)\",\n \"foodProteins\"=> \"9.2\",\n \"foodFats\"=> \"71.2\",\n \"foodCarbohydrates\"=> \"12.3\",\n \"foodCalories\"=> \"736.0\"\n ],\n \"180\"=> [\n \"id\"=> \"180\",\n \"foodProduct\"=> \"Перец\",\n \"foodProteins\"=> \"1.3\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.7\",\n \"foodCalories\"=> \"27.0\"\n ],\n \"181\"=> [\n \"id\"=> \"181\",\n \"foodProduct\"=> \"Персики\",\n \"foodProteins\"=> \"0.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.4\",\n \"foodCalories\"=> \"44.0\"\n ],\n \"182\"=> [\n \"id\"=> \"182\",\n \"foodProduct\"=> \"Петрушка зелень\",\n \"foodProteins\"=> \"3.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.1\",\n \"foodCalories\"=> \"45.0\"\n ],\n \"183\"=> [\n \"id\"=> \"183\",\n \"foodProduct\"=> \"Петрушка корень\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.0\",\n \"foodCalories\"=> \"47.0\"\n ],\n \"184\"=> [\n \"id\"=> \"184\",\n \"foodProduct\"=> \"Печенье \\\"курабье\\\"\",\n \"foodProteins\"=> \"6.60\",\n \"foodFats\"=> \"28.80\",\n \"foodCarbohydrates\"=> \"19.30\",\n \"foodCalories\"=> \"506.0\"\n ],\n \"185\"=> [\n \"id\"=> \"185\",\n \"foodProduct\"=> \"Печенье сухое\",\n \"foodProteins\"=> \"8.63\",\n \"foodFats\"=> \"12.60\",\n \"foodCarbohydrates\"=> \"72.25\",\n \"foodCalories\"=> \"438.0\"\n ],\n \"186\"=> [\n \"id\"=> \"186\",\n \"foodProduct\"=> \"Печенье типа \\\"Юбилейное\\\"\",\n \"foodProteins\"=> \"7.4\",\n \"foodFats\"=> \"19.7\",\n \"foodCarbohydrates\"=> \"63.2\",\n \"foodCalories\"=> \"461.0\"\n ],\n \"187\"=> [\n \"id\"=> \"187\",\n \"foodProduct\"=> \"Повидло вишнёвое с яблоком\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"50.0\",\n \"foodCalories\"=> \"184.0\"\n ],\n \"188\"=> [\n \"id\"=> \"188\",\n \"foodProduct\"=> \"Подберёзовики свежие\",\n \"foodProteins\"=> \"2.3\",\n \"foodFats\"=> \"0.9\",\n \"foodCarbohydrates\"=> \"3.7\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"189\"=> [\n \"id\"=> \"189\",\n \"foodProduct\"=> \"Подберёзовики сушёные\",\n \"foodProteins\"=> \"24.0\",\n \"foodFats\"=> \"9.3\",\n \"foodCarbohydrates\"=> \"37.2\",\n \"foodCalories\"=> \"319.0\"\n ],\n \"190\"=> [\n \"id\"=> \"190\",\n \"foodProduct\"=> \"Подосиновики свежие\",\n \"foodProteins\"=> \"3.3\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"3.4\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"191\"=> [\n \"id\"=> \"191\",\n \"foodProduct\"=> \"Подосиновики сушёные\",\n \"foodProteins\"=> \"32.5\",\n \"foodFats\"=> \"4.9\",\n \"foodCarbohydrates\"=> \"33.2\",\n \"foodCalories\"=> \"299.0\"\n ],\n \"192\"=> [\n \"id\"=> \"192\",\n \"foodProduct\"=> \"Подсолнечное\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"193\"=> [\n \"id\"=> \"193\",\n \"foodProduct\"=> \"Полено кондитерское \\\"арахисовое\\\"\",\n \"foodProteins\"=> \"5.5\",\n \"foodFats\"=> \"18.2\",\n \"foodCarbohydrates\"=> \"68.0\",\n \"foodCalories\"=> \"433.0\"\n ],\n \"194\"=> [\n \"id\"=> \"194\",\n \"foodProduct\"=> \"Просо\",\n \"foodProteins\"=> \"11.2\",\n \"foodFats\"=> \"3.8\",\n \"foodCarbohydrates\"=> \"60.7\",\n \"foodCalories\"=> \"307.0\"\n ],\n \"195\"=> [\n \"id\"=> \"195\",\n \"foodProduct\"=> \"Простокваша 3,2%\",\n \"foodProteins\"=> \"3.3\",\n \"foodFats\"=> \"3.2\",\n \"foodCarbohydrates\"=> \"5.5\",\n \"foodCalories\"=> \"64.5\"\n ],\n \"196\"=> [\n \"id\"=> \"196\",\n \"foodProduct\"=> \"Пшеница\",\n \"foodProteins\"=> \"11.6\",\n \"foodFats\"=> \"1.6\",\n \"foodCarbohydrates\"=> \"68.7\",\n \"foodCalories\"=> \"318.0\"\n ],\n \"197\"=> [\n \"id\"=> \"197\",\n \"foodProduct\"=> \"Пшеничная мука\",\n \"foodProteins\"=> \"11.0\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"72.0\",\n \"foodCalories\"=> \"350.0\"\n ],\n \"198\"=> [\n \"id\"=> \"198\",\n \"foodProduct\"=> \"Пшено - крупа шлифованная\",\n \"foodProteins\"=> \"11.5\",\n \"foodFats\"=> \"3.3\",\n \"foodCarbohydrates\"=> \"64.8\",\n \"foodCalories\"=> \"348.0\"\n ],\n \"199\"=> [\n \"id\"=> \"199\",\n \"foodProduct\"=> \"Раковые шейки в рассоле\",\n \"foodProteins\"=> \"20.6\",\n \"foodFats\"=> \"1.7\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"98.0\"\n ],\n \"200\"=> [\n \"id\"=> \"200\",\n \"foodProduct\"=> \"Рапсовое\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.85\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"201\"=> [\n \"id\"=> \"201\",\n \"foodProduct\"=> \"Ревень черешковый\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"2.9\",\n \"foodCalories\"=> \"16.0\"\n ],\n \"202\"=> [\n \"id\"=> \"202\",\n \"foodProduct\"=> \"Редис\",\n \"foodProteins\"=> \"1.2\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.1\",\n \"foodCalories\"=> \"20.0\"\n ],\n \"203\"=> [\n \"id\"=> \"203\",\n \"foodProduct\"=> \"Редька\",\n \"foodProteins\"=> \"1.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"7.0\",\n \"foodCalories\"=> \"34.0\"\n ],\n \"204\"=> [\n \"id\"=> \"204\",\n \"foodProduct\"=> \"Репа\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.9\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"205\"=> [\n \"id\"=> \"205\",\n \"foodProduct\"=> \"Рис \",\n \"foodProteins\"=> \"7.3\",\n \"foodFats\"=> \"2.6\",\n \"foodCarbohydrates\"=> \"63.1\",\n \"foodCalories\"=> \"284.0\"\n ],\n \"206\"=> [\n \"id\"=> \"206\",\n \"foodProduct\"=> \"Рис Fitness - смесь дикого и бурого риса\",\n \"foodProteins\"=> \"8.1\",\n \"foodFats\"=> \"4.1\",\n \"foodCarbohydrates\"=> \"63.4\",\n \"foodCalories\"=> \"322.9\"\n ],\n \"207\"=> [\n \"id\"=> \"207\",\n \"foodProduct\"=> \"Рис длиннозерновой шлифованный\",\n \"foodProteins\"=> \"7.0\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"78.5\",\n \"foodCalories\"=> \"347.0\"\n ],\n \"208\"=> [\n \"id\"=> \"208\",\n \"foodProduct\"=> \"Рис коричневый слабошлифованный\",\n \"foodProteins\"=> \"7.4\",\n \"foodFats\"=> \"2.2\",\n \"foodCarbohydrates\"=> \"72.0\",\n \"foodCalories\"=> \"337.0\"\n ],\n \"209\"=> [\n \"id\"=> \"209\",\n \"foodProduct\"=> \"Рожь\",\n \"foodProteins\"=> \"9.9\",\n \"foodFats\"=> \"1.6\",\n \"foodCarbohydrates\"=> \"70.9\",\n \"foodCalories\"=> \"320.0\"\n ],\n \"210\"=> [\n \"id\"=> \"210\",\n \"foodProduct\"=> \"Рыжики свежие\",\n \"foodProteins\"=> \"1.9\",\n \"foodFats\"=> \"0.8\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"22.0\"\n ],\n \"211\"=> [\n \"id\"=> \"211\",\n \"foodProduct\"=> \"Рябина садовая\",\n \"foodProteins\"=> \"1.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.5\",\n \"foodCalories\"=> \"58.0\"\n ],\n \"212\"=> [\n \"id\"=> \"212\",\n \"foodProduct\"=> \"Рябина черноплодная\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.0\",\n \"foodCalories\"=> \"54.0\"\n ],\n \"213\"=> [\n \"id\"=> \"213\",\n \"foodProduct\"=> \"Ряженка 3,2%\",\n \"foodProteins\"=> \"3.2\",\n \"foodFats\"=> \"3.2\",\n \"foodCarbohydrates\"=> \"5.4\",\n \"foodCalories\"=> \"64.0\"\n ],\n \"214\"=> [\n \"id\"=> \"214\",\n \"foodProduct\"=> \"Салака копчёная в масле консервированная\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"32.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"356.0\"\n ],\n \"215\"=> [\n \"id\"=> \"215\",\n \"foodProduct\"=> \"Салат\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"2.2\",\n \"foodCalories\"=> \"14.0\"\n ],\n \"216\"=> [\n \"id\"=> \"216\",\n \"foodProduct\"=> \"Сардины в масле консервированные\",\n \"foodProteins\"=> \"23.0\",\n \"foodFats\"=> \"14.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"218.0\"\n ],\n \"217\"=> [\n \"id\"=> \"217\",\n \"foodProduct\"=> \"Сахар\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"99.8\",\n \"foodCalories\"=> \"374.0\"\n ],\n \"218\"=> [\n \"id\"=> \"218\",\n \"foodProduct\"=> \"Сахар рафинад быстрорастворимый \",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"99.95\",\n \"foodCalories\"=> \"400.0\"\n ],\n \"219\"=> [\n \"id\"=> \"219\",\n \"foodProduct\"=> \"Свекла\",\n \"foodProteins\"=> \"1.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"10.8\",\n \"foodCalories\"=> \"4.8\"\n ],\n \"220\"=> [\n \"id\"=> \"220\",\n \"foodProduct\"=> \"Свинина - балык особый\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"175.0\"\n ],\n \"221\"=> [\n \"id\"=> \"221\",\n \"foodProduct\"=> \"Свинина - буженина\",\n \"foodProteins\"=> \"15.0\",\n \"foodFats\"=> \"23.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"267.0\"\n ],\n \"222\"=> [\n \"id\"=> \"222\",\n \"foodProduct\"=> \"Свинина - карбонад варёно-копчёный\",\n \"foodProteins\"=> \"15.0\",\n \"foodFats\"=> \"20.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"240.0\"\n ],\n \"223\"=> [\n \"id\"=> \"223\",\n \"foodProduct\"=> \"Свинина - корейка сырокопчёная\",\n \"foodProteins\"=> \"12.3\",\n \"foodFats\"=> \"40.6\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"415.0\"\n ],\n \"224\"=> [\n \"id\"=> \"224\",\n \"foodProduct\"=> \"Свиной язык консервированный\",\n \"foodProteins\"=> \"12.0\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"185.0\"\n ],\n \"225\"=> [\n \"id\"=> \"225\",\n \"foodProduct\"=> \"Сельдерей зелень\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"8.0\"\n ],\n \"226\"=> [\n \"id\"=> \"226\",\n \"foodProduct\"=> \"Сельдерей корень\",\n \"foodProteins\"=> \"1.3\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.7\",\n \"foodCalories\"=> \"31.0\"\n ],\n \"227\"=> [\n \"id\"=> \"227\",\n \"foodProduct\"=> \"Сельдь слабосолёная\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"204.0\"\n ],\n \"228\"=> [\n \"id\"=> \"228\",\n \"foodProduct\"=> \"Сельдь слабосолёная филе без кожи\",\n \"foodProteins\"=> \"22.0\",\n \"foodFats\"=> \"13.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"205.0\"\n ],\n \"229\"=> [\n \"id\"=> \"229\",\n \"foodProduct\"=> \"Сёмга\",\n \"foodProteins\"=> \"23.0\",\n \"foodFats\"=> \"13.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"202.0\"\n ],\n \"230\"=> [\n \"id\"=> \"230\",\n \"foodProduct\"=> \"Семечки подсолнечника\",\n \"foodProteins\"=> \"24.0\",\n \"foodFats\"=> \"47.3\",\n \"foodCarbohydrates\"=> \"16.1\",\n \"foodCalories\"=> \"601.0\"\n ],\n \"231\"=> [\n \"id\"=> \"231\",\n \"foodProduct\"=> \"Семечки тыквы\",\n \"foodProteins\"=> \"29.0\",\n \"foodFats\"=> \"46.7\",\n \"foodCarbohydrates\"=> \"13.1\",\n \"foodCalories\"=> \"596.0\"\n ],\n \"232\"=> [\n \"id\"=> \"232\",\n \"foodProduct\"=> \"Слива\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.9\",\n \"foodCalories\"=> \"43.0\"\n ],\n \"233\"=> [\n \"id\"=> \"233\",\n \"foodProduct\"=> \"Сливки 11%\",\n \"foodProteins\"=> \"3.0\",\n \"foodFats\"=> \"11.0\",\n \"foodCarbohydrates\"=> \"4.0\",\n \"foodCalories\"=> \"130.0\"\n ],\n \"234\"=> [\n \"id\"=> \"234\",\n \"foodProduct\"=> \"Сливки 22%\",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"22.0\",\n \"foodCarbohydrates\"=> \"3.7\",\n \"foodCalories\"=> \"220.0\"\n ],\n \"235\"=> [\n \"id\"=> \"235\",\n \"foodProduct\"=> \"Сливки взбитые с заменителем сахара\",\n \"foodProteins\"=> \"2.3\",\n \"foodFats\"=> \"26.5\",\n \"foodCarbohydrates\"=> \"4.60\",\n \"foodCalories\"=> \"266.0\"\n ],\n \"236\"=> [\n \"id\"=> \"236\",\n \"foodProduct\"=> \"Сметана 10%\",\n \"foodProteins\"=> \"3.0\",\n \"foodFats\"=> \"10.0\",\n \"foodCarbohydrates\"=> \"2.9\",\n \"foodCalories\"=> \"116.0\"\n ],\n \"237\"=> [\n \"id\"=> \"237\",\n \"foodProduct\"=> \"Сметана 15%\",\n \"foodProteins\"=> \"2.9\",\n \"foodFats\"=> \"15.0\",\n \"foodCarbohydrates\"=> \"3.0\",\n \"foodCalories\"=> \"142.0\"\n ],\n \"238\"=> [\n \"id\"=> \"238\",\n \"foodProduct\"=> \"Сметана 20%\",\n \"foodProteins\"=> \"2.8\",\n \"foodFats\"=> \"20.0\",\n \"foodCarbohydrates\"=> \"3.2\",\n \"foodCalories\"=> \"210.0\"\n ],\n \"239\"=> [\n \"id\"=> \"239\",\n \"foodProduct\"=> \"Сметана 25%\",\n \"foodProteins\"=> \"2.6\",\n \"foodFats\"=> \"25.0\",\n \"foodCarbohydrates\"=> \"2.7\",\n \"foodCalories\"=> \"294.0\"\n ],\n \"240\"=> [\n \"id\"=> \"240\",\n \"foodProduct\"=> \"Сметана 30%\",\n \"foodProteins\"=> \"2.4\",\n \"foodFats\"=> \"30.0\",\n \"foodCarbohydrates\"=> \"3.1\",\n \"foodCalories\"=> \"346.0\"\n ],\n \"241\"=> [\n \"id\"=> \"241\",\n \"foodProduct\"=> \"Смородина белая\",\n \"foodProteins\"=> \"0.3\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.7\",\n \"foodCalories\"=> \"39.0\"\n ],\n \"242\"=> [\n \"id\"=> \"242\",\n \"foodProduct\"=> \"Смородина красная\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.0\",\n \"foodCalories\"=> \"38.0\"\n ],\n \"243\"=> [\n \"id\"=> \"243\",\n \"foodProduct\"=> \"Смородина чёрная\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.0\",\n \"foodCalories\"=> \"40.0\"\n ],\n \"244\"=> [\n \"id\"=> \"244\",\n \"foodProduct\"=> \"Смородина чёрная мороженная\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.1\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"245\"=> [\n \"id\"=> \"245\",\n \"foodProduct\"=> \"Сморчки свежие\",\n \"foodProteins\"=> \"2.9\",\n \"foodFats\"=> \"0.4\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"22.0\"\n ],\n \"246\"=> [\n \"id\"=> \"246\",\n \"foodProduct\"=> \"Соевое\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"247\"=> [\n \"id\"=> \"247\",\n \"foodProduct\"=> \"Соевый соус\",\n \"foodProteins\"=> \"4.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.0\",\n \"foodCalories\"=> \"39.4\"\n ],\n \"248\"=> [\n \"id\"=> \"248\",\n \"foodProduct\"=> \"Соломка сладкая\",\n \"foodProteins\"=> \"9.2\",\n \"foodFats\"=> \"6.1\",\n \"foodCarbohydrates\"=> \"69.0\",\n \"foodCalories\"=> \"371.0\"\n ],\n \"249\"=> [\n \"id\"=> \"249\",\n \"foodProduct\"=> \"Сом\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"5.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"113.0\"\n ],\n \"250\"=> [\n \"id\"=> \"250\",\n \"foodProduct\"=> \"Сорго\",\n \"foodProteins\"=> \"11.1\",\n \"foodFats\"=> \"3.3\",\n \"foodCarbohydrates\"=> \"66.4\",\n \"foodCalories\"=> \"323.0\"\n ],\n \"251\"=> [\n \"id\"=> \"251\",\n \"foodProduct\"=> \"Соя\",\n \"foodProteins\"=> \"34.9\",\n \"foodFats\"=> \"17.3\",\n \"foodCarbohydrates\"=> \"26.5\",\n \"foodCalories\"=> \"395.0\"\n ],\n \"252\"=> [\n \"id\"=> \"252\",\n \"foodProduct\"=> \"Спаржа\",\n \"foodProteins\"=> \"1.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"3.6\",\n \"foodCalories\"=> \"21.0\"\n ],\n \"253\"=> [\n \"id\"=> \"253\",\n \"foodProduct\"=> \"Судак\",\n \"foodProteins\"=> \"18.4\",\n \"foodFats\"=> \"1.1\",\n \"foodCarbohydrates\"=> \"1.3\",\n \"foodCalories\"=> \"126.0\"\n ],\n \"254\"=> [\n \"id\"=> \"254\",\n \"foodProduct\"=> \"Сыр голландский\",\n \"foodProteins\"=> \"23.5\",\n \"foodFats\"=> \"30.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"360.0\"\n ],\n \"255\"=> [\n \"id\"=> \"255\",\n \"foodProduct\"=> \"Сыр мягкий \\\"Адыгейский\\\"\",\n \"foodProteins\"=> \"16.0\",\n \"foodFats\"=> \"18.0\",\n \"foodCarbohydrates\"=> \"2.7\",\n \"foodCalories\"=> \"238.0\"\n ],\n \"256\"=> [\n \"id\"=> \"256\",\n \"foodProduct\"=> \"Сыр мягкий домашний\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"4.0\",\n \"foodCarbohydrates\"=> \"1.8\",\n \"foodCalories\"=> \"114.3\"\n ],\n \"257\"=> [\n \"id\"=> \"257\",\n \"foodProduct\"=> \"Сыр плавленный President\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"22.2\",\n \"foodCarbohydrates\"=> \"6.5\",\n \"foodCalories\"=> \"266.0\"\n ],\n \"258\"=> [\n \"id\"=> \"258\",\n \"foodProduct\"=> \"Сыр плавленный сливочный Hochland\",\n \"foodProteins\"=> \"9.0\",\n \"foodFats\"=> \"25.0\",\n \"foodCarbohydrates\"=> \"6.0\",\n \"foodCalories\"=> \"285.0\"\n ],\n \"259\"=> [\n \"id\"=> \"259\",\n \"foodProduct\"=> \"Сыр полутвёрдый сливочный\",\n \"foodProteins\"=> \"24.0\",\n \"foodFats\"=> \"33.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"390.0\"\n ],\n \"260\"=> [\n \"id\"=> \"260\",\n \"foodProduct\"=> \"Сыр с плесенью Blue\",\n \"foodProteins\"=> \"21.5\",\n \"foodFats\"=> \"50.0\",\n \"foodCarbohydrates\"=> \"20.0\",\n \"foodCalories\"=> \"347.0\"\n ],\n \"261\"=> [\n \"id\"=> \"261\",\n \"foodProduct\"=> \"Сыр твёрдый \\\"Радамер\\\"\",\n \"foodProteins\"=> \"25.0\",\n \"foodFats\"=> \"26.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"339.0\"\n ],\n \"262\"=> [\n \"id\"=> \"262\",\n \"foodProduct\"=> \"Сыроежки свежие\",\n \"foodProteins\"=> \"1.7\",\n \"foodFats\"=> \"0.3\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"17.0\"\n ],\n \"263\"=> [\n \"id\"=> \"263\",\n \"foodProduct\"=> \"Сырок сладкий глазированный в шоколаде\",\n \"foodProteins\"=> \"7.5\",\n \"foodFats\"=> \"25.5\",\n \"foodCarbohydrates\"=> \"33.0\",\n \"foodCalories\"=> \"391.0\"\n ],\n \"264\"=> [\n \"id\"=> \"264\",\n \"foodProduct\"=> \"Творог жирный\",\n \"foodProteins\"=> \"14.0\",\n \"foodFats\"=> \"18.0\",\n \"foodCarbohydrates\"=> \"2.85\",\n \"foodCalories\"=> \"232.0\"\n ],\n \"265\"=> [\n \"id\"=> \"265\",\n \"foodProduct\"=> \"Творог нежирный сухой\",\n \"foodProteins\"=> \"18.0\",\n \"foodFats\"=> \"0.6\",\n \"foodCarbohydrates\"=> \"1.85\",\n \"foodCalories\"=> \"88.0\"\n ],\n \"266\"=> [\n \"id\"=> \"266\",\n \"foodProduct\"=> \"Творог обезжиренный жидкий\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"1.80\",\n \"foodCalories\"=> \"79.0\"\n ],\n \"267\"=> [\n \"id\"=> \"267\",\n \"foodProduct\"=> \"Творог полужирный\",\n \"foodProteins\"=> \"16.7\",\n \"foodFats\"=> \"9.0\",\n \"foodCarbohydrates\"=> \"2.0\",\n \"foodCalories\"=> \"159.0\"\n ],\n \"268\"=> [\n \"id\"=> \"268\",\n \"foodProduct\"=> \"Тёрн\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"9.3\",\n \"foodCalories\"=> \"47.0\"\n ],\n \"269\"=> [\n \"id\"=> \"269\",\n \"foodProduct\"=> \"Тесто слоёное не дрожжевое\",\n \"foodProteins\"=> \"6.1\",\n \"foodFats\"=> \"20.8\",\n \"foodCarbohydrates\"=> \"41.0\",\n \"foodCalories\"=> \"380.0\"\n ],\n \"270\"=> [\n \"id\"=> \"270\",\n \"foodProduct\"=> \"Томатная паста\",\n \"foodProteins\"=> \"3.5\",\n \"foodFats\"=> \"0.6\",\n \"foodCarbohydrates\"=> \"13.9\",\n \"foodCalories\"=> \"87.0\"\n ],\n \"271\"=> [\n \"id\"=> \"271\",\n \"foodProduct\"=> \"Томатный сок J-7 с солью\",\n \"foodProteins\"=> \"0.8\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.3\",\n \"foodCalories\"=> \"21.0\"\n ],\n \"272\"=> [\n \"id\"=> \"272\",\n \"foodProduct\"=> \"Томаты\",\n \"foodProteins\"=> \"0.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"4.2\",\n \"foodCalories\"=> \"19.0\"\n ],\n \"273\"=> [\n \"id\"=> \"273\",\n \"foodProduct\"=> \"Томаты - кетчуп\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"18.0\",\n \"foodCalories\"=> \"75.0\"\n ],\n \"274\"=> [\n \"id\"=> \"274\",\n \"foodProduct\"=> \"Торт безе с кремом \\\"Графские развалины\\\"\",\n \"foodProteins\"=> \"4.2\",\n \"foodFats\"=> \"8.8\",\n \"foodCarbohydrates\"=> \"65.4\",\n \"foodCalories\"=> \"358.0\"\n ],\n \"275\"=> [\n \"id\"=> \"275\",\n \"foodProduct\"=> \"Торт бисквитный с кремом \\\"Вацлавский\\\"\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"28.0\",\n \"foodCarbohydrates\"=> \"47.10\",\n \"foodCalories\"=> \"460.0\"\n ],\n \"276\"=> [\n \"id\"=> \"276\",\n \"foodProduct\"=> \"Торт бисквитный шоколадный с кремом \\\"Марика\\\"\",\n \"foodProteins\"=> \"6.8\",\n \"foodFats\"=> \"25.1\",\n \"foodCarbohydrates\"=> \"42.50\",\n \"foodCalories\"=> \"425.2\"\n ],\n \"277\"=> [\n \"id\"=> \"277\",\n \"foodProduct\"=> \"Треска\",\n \"foodProteins\"=> \"16.0\",\n \"foodFats\"=> \"0.6\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"69.0\"\n ],\n \"278\"=> [\n \"id\"=> \"278\",\n \"foodProduct\"=> \"Тунец в собственном соку консервы\",\n \"foodProteins\"=> \"23.5\",\n \"foodFats\"=> \"0.6\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"99.0\"\n ],\n \"279\"=> [\n \"id\"=> \"279\",\n \"foodProduct\"=> \"Тыква\",\n \"foodProteins\"=> \"1.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.5\",\n \"foodCalories\"=> \"29.0\"\n ],\n \"280\"=> [\n \"id\"=> \"280\",\n \"foodProduct\"=> \"Укроп\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"4.5\",\n \"foodCalories\"=> \"32.0\"\n ],\n \"281\"=> [\n \"id\"=> \"281\",\n \"foodProduct\"=> \"Утка для жарки\",\n \"foodProteins\"=> \"25.2\",\n \"foodFats\"=> \"11.9\",\n \"foodCarbohydrates\"=> \"0.68\",\n \"foodCalories\"=> \"284.0\"\n ],\n \"282\"=> [\n \"id\"=> \"282\",\n \"foodProduct\"=> \"Фасоль\",\n \"foodProteins\"=> \"22.3\",\n \"foodFats\"=> \"1.7\",\n \"foodCarbohydrates\"=> \"54.5\",\n \"foodCalories\"=> \"309.0\"\n ],\n \"283\"=> [\n \"id\"=> \"283\",\n \"foodProduct\"=> \"Фасоль в томатном соусе (консервированная)\",\n \"foodProteins\"=> \"4.6\",\n \"foodFats\"=> \"0.2\",\n \"foodCarbohydrates\"=> \"13.1\",\n \"foodCalories\"=> \"73.0\"\n ],\n \"284\"=> [\n \"id\"=> \"284\",\n \"foodProduct\"=> \"Фасоль красная\",\n \"foodProteins\"=> \"22.3\",\n \"foodFats\"=> \"1.7\",\n \"foodCarbohydrates\"=> \"54.7\",\n \"foodCalories\"=> \"309.0\"\n ],\n \"285\"=> [\n \"id\"=> \"285\",\n \"foodProduct\"=> \"Финики\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"72.1\",\n \"foodCalories\"=> \"281.0\"\n ],\n \"286\"=> [\n \"id\"=> \"286\",\n \"foodProduct\"=> \"Финики\",\n \"foodProteins\"=> \"2.2\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"66.3\",\n \"foodCalories\"=> \"305.0\"\n ],\n \"287\"=> [\n \"id\"=> \"287\",\n \"foodProduct\"=> \"Фисташки жареные солёные\",\n \"foodProteins\"=> \"21.2\",\n \"foodFats\"=> \"38.8\",\n \"foodCarbohydrates\"=> \"14.3\",\n \"foodCalories\"=> \"655.0\"\n ],\n \"288\"=> [\n \"id\"=> \"288\",\n \"foodProduct\"=> \"Форель\",\n \"foodProteins\"=> \"19.5\",\n \"foodFats\"=> \"5.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"130.0\"\n ],\n \"289\"=> [\n \"id\"=> \"289\",\n \"foodProduct\"=> \"Форель слабосолёная\",\n \"foodProteins\"=> \"23.5\",\n \"foodFats\"=> \"11.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"203.0\"\n ],\n \"290\"=> [\n \"id\"=> \"290\",\n \"foodProduct\"=> \"Фундук жареный\",\n \"foodProteins\"=> \"16.1\",\n \"foodFats\"=> \"66.9\",\n \"foodCarbohydrates\"=> \"9.9\",\n \"foodCalories\"=> \"704.0\"\n ],\n \"291\"=> [\n \"id\"=> \"291\",\n \"foodProduct\"=> \"Халва миндальная\",\n \"foodProteins\"=> \"10.0\",\n \"foodFats\"=> \"28.0\",\n \"foodCarbohydrates\"=> \"53.50\",\n \"foodCalories\"=> \"123.3\"\n ],\n \"292\"=> [\n \"id\"=> \"292\",\n \"foodProduct\"=> \"Хлеб пшеничный\",\n \"foodProteins\"=> \"8.1\",\n \"foodFats\"=> \"1.2\",\n \"foodCarbohydrates\"=> \"42.0\",\n \"foodCalories\"=> \"203.0\"\n ],\n \"293\"=> [\n \"id\"=> \"293\",\n \"foodProduct\"=> \"Хлеб пшеничный \\\"нарезной\\\" батон\",\n \"foodProteins\"=> \"8.2\",\n \"foodFats\"=> \"0.95\",\n \"foodCarbohydrates\"=> \"54.06\",\n \"foodCalories\"=> \"263.0\"\n ],\n \"294\"=> [\n \"id\"=> \"294\",\n \"foodProduct\"=> \"Хлеб пшеничный \\\"особый\\\" батон\",\n \"foodProteins\"=> \"7.4\",\n \"foodFats\"=> \"0.8\",\n \"foodCarbohydrates\"=> \"50.0\",\n \"foodCalories\"=> \"240.0\"\n ],\n \"295\"=> [\n \"id\"=> \"295\",\n \"foodProduct\"=> \"Хлеб пшеничный лепёшка домашняя\",\n \"foodProteins\"=> \"8.98\",\n \"foodFats\"=> \"6.51\",\n \"foodCarbohydrates\"=> \"57.77\",\n \"foodCalories\"=> \"331.3\"\n ],\n \"296\"=> [\n \"id\"=> \"296\",\n \"foodProduct\"=> \"Хлеб ржано-пшеничный\",\n \"foodProteins\"=> \"7.0\",\n \"foodFats\"=> \"1.1\",\n \"foodCarbohydrates\"=> \"40.3\",\n \"foodCalories\"=> \"193.0\"\n ],\n \"297\"=> [\n \"id\"=> \"297\",\n \"foodProduct\"=> \"Хлебные палочки кунжутные\",\n \"foodProteins\"=> \"9.6\",\n \"foodFats\"=> \"11.5\",\n \"foodCarbohydrates\"=> \"59.4\",\n \"foodCalories\"=> \"380.4\"\n ],\n \"298\"=> [\n \"id\"=> \"298\",\n \"foodProduct\"=> \"Хлебцы ржаные из муки грубого помола с полбой\",\n \"foodProteins\"=> \"11.4\",\n \"foodFats\"=> \"1.7\",\n \"foodCarbohydrates\"=> \"64.9\",\n \"foodCalories\"=> \"321.0\"\n ],\n \"299\"=> [\n \"id\"=> \"299\",\n \"foodProduct\"=> \"Хлопковое\",\n \"foodProteins\"=> \"0.0\",\n \"foodFats\"=> \"99.9\",\n \"foodCarbohydrates\"=> \"9.0\",\n \"foodCalories\"=> \"899.0\"\n ],\n \"300\"=> [\n \"id\"=> \"300\",\n \"foodProduct\"=> \"Хлопья кукурузные Gold с мёдом и орешками\",\n \"foodProteins\"=> \"7.0\",\n \"foodFats\"=> \"4.0\",\n \"foodCarbohydrates\"=> \"81.2\",\n \"foodCalories\"=> \"389.0\"\n ],\n \"301\"=> [\n \"id\"=> \"301\",\n \"foodProduct\"=> \"Хрен\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"16.3\",\n \"foodCalories\"=> \"71.0\"\n ],\n \"302\"=> [\n \"id\"=> \"302\",\n \"foodProduct\"=> \"Хрен с майонезом\",\n \"foodProteins\"=> \"2.5\",\n \"foodFats\"=> \"11.7\",\n \"foodCarbohydrates\"=> \"16.3\",\n \"foodCalories\"=> \"178.0\"\n ],\n \"303\"=> [\n \"id\"=> \"303\",\n \"foodProduct\"=> \"Хурьма японская\",\n \"foodProteins\"=> \"0.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"15.9\",\n \"foodCalories\"=> \"62.0\"\n ],\n \"304\"=> [\n \"id\"=> \"304\",\n \"foodProduct\"=> \"Цыплёнок грудки филе\",\n \"foodProteins\"=> \"21.3\",\n \"foodFats\"=> \"2.5\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"107.7\"\n ],\n \"305\"=> [\n \"id\"=> \"305\",\n \"foodProduct\"=> \"Цыплёнок для жарки белое мясо\",\n \"foodProteins\"=> \"25.0\",\n \"foodFats\"=> \"4.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"141.0\"\n ],\n \"306\"=> [\n \"id\"=> \"306\",\n \"foodProduct\"=> \"Цыплёнок для жарки тёмное мясо\",\n \"foodProteins\"=> \"23.0\",\n \"foodFats\"=> \"6.9\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"156.0\"\n ],\n \"307\"=> [\n \"id\"=> \"307\",\n \"foodProduct\"=> \"Чай\",\n \"foodProteins\"=> \"20.0\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.9\",\n \"foodCalories\"=> \"109.0\"\n ],\n \"308\"=> [\n \"id\"=> \"308\",\n \"foodProduct\"=> \"Черемша\",\n \"foodProteins\"=> \"2.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"6.5\",\n \"foodCalories\"=> \"34.0\"\n ],\n \"309\"=> [\n \"id\"=> \"309\",\n \"foodProduct\"=> \"Черешня\",\n \"foodProteins\"=> \"1.1\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.3\",\n \"foodCalories\"=> \"52.0\"\n ],\n \"310\"=> [\n \"id\"=> \"310\",\n \"foodProduct\"=> \"Черника\",\n \"foodProteins\"=> \"1.1\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"8.6\",\n \"foodCalories\"=> \"40.0\"\n ],\n \"311\"=> [\n \"id\"=> \"311\",\n \"foodProduct\"=> \"Чернослив\",\n \"foodProteins\"=> \"1.9\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"59.5\",\n \"foodCalories\"=> \"256.0\"\n ],\n \"312\"=> [\n \"id\"=> \"312\",\n \"foodProduct\"=> \"Чернослив в шоколаде\",\n \"foodProteins\"=> \"3.9\",\n \"foodFats\"=> \"14.2\",\n \"foodCarbohydrates\"=> \"58.40\",\n \"foodCalories\"=> \"358.0\"\n ],\n \"313\"=> [\n \"id\"=> \"313\",\n \"foodProduct\"=> \"Чеснок\",\n \"foodProteins\"=> \"6.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"21.2\",\n \"foodCalories\"=> \"106.0\"\n ],\n \"314\"=> [\n \"id\"=> \"314\",\n \"foodProduct\"=> \"Чечевица\",\n \"foodProteins\"=> \"24.8\",\n \"foodFats\"=> \"1.1\",\n \"foodCarbohydrates\"=> \"53.7\",\n \"foodCalories\"=> \"310.0\"\n ],\n \"315\"=> [\n \"id\"=> \"315\",\n \"foodProduct\"=> \"Чечевица красная\",\n \"foodProteins\"=> \"21.0\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"49.0\",\n \"foodCalories\"=> \"298.0\"\n ],\n \"316\"=> [\n \"id\"=> \"316\",\n \"foodProduct\"=> \"Чина\",\n \"foodProteins\"=> \"25.1\",\n \"foodFats\"=> \"0.9\",\n \"foodCarbohydrates\"=> \"52.1\",\n \"foodCalories\"=> \"304.0\"\n ],\n \"317\"=> [\n \"id\"=> \"317\",\n \"foodProduct\"=> \"Шампиньоны консервированные\",\n \"foodProteins\"=> \"2.3\",\n \"foodFats\"=> \"0.5\",\n \"foodCarbohydrates\"=> \"0.5\",\n \"foodCalories\"=> \"16.0\"\n ],\n \"318\"=> [\n \"id\"=> \"318\",\n \"foodProduct\"=> \"Шампиньоны мороженные\",\n \"foodProteins\"=> \"4.2\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"0.1\",\n \"foodCalories\"=> \"26.0\"\n ],\n \"319\"=> [\n \"id\"=> \"319\",\n \"foodProduct\"=> \"Шелковица\",\n \"foodProteins\"=> \"0.7\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"12.7\",\n \"foodCalories\"=> \"53.0\"\n ],\n \"320\"=> [\n \"id\"=> \"320\",\n \"foodProduct\"=> \"Шиповник свежий\",\n \"foodProteins\"=> \"1.6\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"24.0\",\n \"foodCalories\"=> \"101.0\"\n ],\n \"321\"=> [\n \"id\"=> \"321\",\n \"foodProduct\"=> \"Шиповник сушёный\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"60.0\",\n \"foodCalories\"=> \"253.0\"\n ],\n \"322\"=> [\n \"id\"=> \"322\",\n \"foodProduct\"=> \"Шоколад \",\n \"foodProteins\"=> \"5.4\",\n \"foodFats\"=> \"35.4\",\n \"foodCarbohydrates\"=> \"52.60\",\n \"foodCalories\"=> \"544.0\"\n ],\n \"323\"=> [\n \"id\"=> \"323\",\n \"foodProduct\"=> \"Шоколад с изюмом\",\n \"foodProteins\"=> \"4.5\",\n \"foodFats\"=> \"25.9\",\n \"foodCarbohydrates\"=> \"56.90\",\n \"foodCalories\"=> \"471.0\"\n ],\n \"324\"=> [\n \"id\"=> \"324\",\n \"foodProduct\"=> \"Шоколад с фундуком\",\n \"foodProteins\"=> \"8.8\",\n \"foodFats\"=> \"42.3\",\n \"foodCarbohydrates\"=> \"43.7\",\n \"foodCalories\"=> \"585.0\"\n ],\n \"325\"=> [\n \"id\"=> \"325\",\n \"foodProduct\"=> \"Шпинат\",\n \"foodProteins\"=> \"2.9\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"2.3\",\n \"foodCalories\"=> \"21.0\"\n ],\n \"326\"=> [\n \"id\"=> \"326\",\n \"foodProduct\"=> \"Шпроты в масле\",\n \"foodProteins\"=> \"17.0\",\n \"foodFats\"=> \"32.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"356.0\"\n ],\n \"327\"=> [\n \"id\"=> \"327\",\n \"foodProduct\"=> \"Щавель\",\n \"foodProteins\"=> \"1.5\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"5.3\",\n \"foodCalories\"=> \"28.0\"\n ],\n \"328\"=> [\n \"id\"=> \"328\",\n \"foodProduct\"=> \"Щука\",\n \"foodProteins\"=> \"18.0\",\n \"foodFats\"=> \"1.0\",\n \"foodCarbohydrates\"=> \"0.0\",\n \"foodCalories\"=> \"81.0\"\n ],\n \"329\"=> [\n \"id\"=> \"329\",\n \"foodProduct\"=> \"Яблоки\",\n \"foodProteins\"=> \"0.4\",\n \"foodFats\"=> \"0.0\",\n \"foodCarbohydrates\"=> \"11.3\",\n \"foodCalories\"=> \"46.0\"\n ],\n \"330\"=> [\n \"id\"=> \"330\",\n \"foodProduct\"=> \"Яйца куриные\",\n \"foodProteins\"=> \"12.7\",\n \"foodFats\"=> \"11.5\",\n \"foodCarbohydrates\"=> \"0.7\",\n \"foodCalories\"=> \"157.0\"\n ],\n \"331\"=> [\n \"id\"=> \"331\",\n \"foodProduct\"=> \"Ячмень\",\n \"foodProteins\"=> \"11.5\",\n \"foodFats\"=> \"2.0\",\n \"foodCarbohydrates\"=> \"65.8\",\n \"foodCalories\"=> \"311.0\"\n ]\n ];\n foreach ($foods as $food) {\n \\App\\Foods::create($food);\n }\n }", "function displaySearchResults() {\n $pricemin = isset($_GET['price']) ? $_GET['price'] : 0;\n $ratingmin = isset($_GET['rating']) ? $_GET['rating'] : 0;\n\n $location = isset($_GET['location']) ? $_GET['location'] : NULL;\n $coords = getCoords($location);\n\n $category = getCategory();\n //print_r($category);\n $avgprices = getAvgs(\"price\");\n $avgrating = getAvgs(\"rating\");\n\n $dbc = connectToDB(\"bigginsa\");\n $pred = \"\";\n if (isset( $_GET['type']) && $_GET['type'] !== ''){\n \t$type = $_GET['type'];\n \t$pred = \"r_id in (select restaurant_id from Categories where Category = '$type')\";\n } else {\n \t$pred = \"1\";\n }\n $query = \"select * from restaurants where \" . $pred ;\n $result = performQuery($dbc, $query);\n\n\n ?>\n <div class = \"container\">\n <div id=\"sidebar\"><?php displayWelcomePage() ?></div>\n <table>\n \t<tr>\n \t\t<th>Restaurant</th>\n \t</tr>\n <?php\n while ( @extract( mysqli_fetch_array($result, MYSQLI_ASSOC) ) ) {\n\t$valid = true;\n\n\t$rCoords = getCoords($address);\n\t$distance = haversineGreatCircleDistance($coords[\"lat\"],$coords[\"long\"],\n \t\t\t\t\t\t\t\t$rCoords[\"lat\"],$rCoords[\"long\"]);\n if ($distance>32000) {\n //$valid = false;\n }\n\n if(isset($_GET['price']) && $avgprices[$R_ID]> $_GET['price']){\n \t$valid = false;\n }\n if(isset($_GET['rating']) && $avgrating[$R_ID] < $_GET['rating']){\n \t$valid = false;\n }\n $avgPrice = intval($avgprices[$R_ID]);\n $avgRating = intval($avgrating[$R_ID]);\n if ( $valid ) {\n \techo \"<tr>\n \t \t<td>\n \tName: $name <br>\n \tPrice: $avgPrice <br>\n \tRating: $avgRating<br>\n \tType of food served here: $category[$R_ID] <br>\n \t\t\tLocation: $address <br>\n \t\t\tDistance: $distance <br>\n \t\t\t<a href = 'http://cscilab.bc.edu/~bigginsa/yelp/project/restpage.php'> Click Here To Find Out More About $name</a>\n \t</td>\n \t</tr>\";\n }\n }\n disconnectFromDB($dbc,$result);\n ?>\n </table>\n </div>\n\n <?php\n}", "function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}", "function ting_search_autocomplete_js() {\n\t$items = array();\n\t$query = (isset($_REQUEST['query'])) ? $_REQUEST['query'] : '';\n\t\n\tif (strlen($query) > 0)\n\t{\n\t\t$cache = cache_get(md5($query), 'cache_ting_search_autocomplete');\n\t\tif ($cache)\n\t\t{\n\t\t\t$items = $cache->data;\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\tmodule_load_include('client.inc', 'ting');\n\t\t\t\n\t\t\t$terms = array();\n\n\t\t\t$scanResults = ting_do_scan($query, 10);\n\t\t\tforeach ($scanResults->terms as $term)\n\t\t\t{\n\t\t\t\t$term->score = $term->count;\n\t\t\t\t$terms[strtolower($term->name)] = $term;\n\t\t\t}\n\t\t\t\t\n\t\t\t$suggestions = ting_get_spell_suggestions($query);\n\t\t\tif (is_array($suggestions))\n\t\t\t{\n\t\t\t\tforeach ($suggestions as $suggestion)\n\t\t\t\t{\n\t\t\t\t\tif (!isset($terms[strtolower($suggestion->word)]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$suggestScan = ting_do_scan($suggestion->word, 1);\n\t\t\t\t\t\tif (($term = array_shift($suggestScan->terms)) &&\n\t\t\t\t\t\t\t\t(strtolower($suggestion->word) == strtolower($term->name)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$term->score = $term->count * $suggestion->weight;\n\t\t\t\t\t\t\t$terms[$term->name] = $term;\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\t\n\t\t\tuasort($terms, 'ting_search_autocomplete_term_sort');\n\t\t\t$terms = array_reverse($terms);\n\t\t\n\t\t\t$items = array();\n\t\t\tforeach ($terms as $term)\n\t\t\t{\n\t\t\t\t$items[$term->name] = t('!ord !resultater', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('!ord' => '<span class=\"term\">'.$term->name.'</span>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'!resultater' => '<span class=\"count\">'.format_plural($term->count, t('(1 resultat)'), t('(@count resultater)')))).'</span>';\n\t\t\t}\n\t\t\t\n\t\t\t$items = array_slice($items, 0, 10);\n\t\t\tcache_set(md5($query), $items, 'cache_ting_search_autocomplete', CACHE_TEMPORARY);\n\t\t}\n\t}\n\t$return = array();\n\tforeach ($items as $id => $value)\n\t{\n\t\t$return[] = $value.'|'.$id;\t\t\n\t}\n\techo implode(\"\\n\", $return);\n\texit;\n}", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "function get_foodnames_arr(){\n\n}", "public function getSpoil($array) {\n $client = new \\AlgoliaSearch\\Client('KMJ42U25W4', '1458f0776b9eb5750afc6566782ce6c9');\n $index = $client->initIndex('movies');\n\n $tweets = DB::table('tweet')->get();\n foreach ($array as $key => $value) {\n\n foreach ($tweets as $key => $value) {\n $query = (object) $index->search($value->movie_title);\n\n $spoil = $query->hits[0][\"spoil\"];\n\n if(is_array($spoil)) {\n $rand = array_rand($spoil, 1);\n $response = $spoil[$rand];\n } else {\n $response = $spoil;\n }\n\n DB::table('tweet')->update(\n ['spoil' => $response]\n );\n }\n\n }\n }", "public function getSuggestData()\n {\n if (is_null($this->_suggestData)) {\n\n $picklistEntries = $this->getPicklistEntries();\n $response = array();\n $data = array();\n $counter = 0;\n\n if (is_array($picklistEntries)) {\n foreach ($picklistEntries as $entry) {\n $_data = array(\n 'value' => $entry->Moniker,\n 'title' => $entry->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n } elseif ($picklistEntries && ($picklistEntries->Score > 0)) { // only one result\n $_data = array(\n 'value' => $picklistEntries->Moniker,\n 'title' => $picklistEntries->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n\n $this->_suggestData = $data;\n }\n return $this->_suggestData;\n }", "function gf_fuzz_gps($array) {\n\n if ($array['type'] == 'image/jpeg' || $array['type'] == 'image/jpg') {\n\t\t\tgf_fuzz_gps_file($array['file']);\n }\n\n return $array;\n}", "public function bake()\n {\n $result = array();\n \n foreach( $this->searchResult as $line )\n {\n $id = $line[ 'id' ];\n $title = $line[ 'title' ];\n $score = $line[ 'score' ];\n $name = $line[ 'name' ];\n $value = self::highlight( $this->searchString , $line[ 'value' ] );\n \n if ( ! array_key_exists( $id , $result ) )\n {\n $result[ $id ][ 'score' ] = 0;\n }\n \n $result[ $id ][ 'title' ] = $title;\n $result[ $id ][ 'matches' ][ $name ] = $value;\n $result[ $id ][ 'score' ] += $score;\n }\n \n $sortedResult = array();\n \n foreach( $result as $id => $datas )\n {\n $sortedResult[ $datas[ 'score' ] ][ $id ] = array( 'title' => $datas[ 'title' ]\n , 'matches' => $datas[ 'matches' ] );\n }\n \n krsort( $sortedResult );\n \n return $this->bakedResult = $sortedResult;\n }", "function get_search_suggestions($search,$limit=25)\n\t{\n\t\t$suggestions = array();\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_name', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_name = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->select('skill_name_kh');\n\t\t$this->db->from('skill');\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->distinct();\n\t\t$this->db->like('skill_name_kh', $search);\n\t\t$this->db->limit($limit);\n\t\t$by_name_kh = $this->db->get();\n\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name_kh->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name_kh;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_major_code', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_skill_major_code = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_skill_major_code->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_major_code;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\n\t\treturn $suggestions;\n\t}", "function rat_search($str){\r\n\t\t\r\n\t\t$rating_con = mysqli_connect(\"localhost\",\"root\",\"\",\"product_list\");\r\n\t\t$rating_mov = \"SELECT * FROM `movies` WHERE rating = '$str'\";\r\n\t\t$rating_tv = \"SELECT * FROM `tv` WHERE rating = '$str'\";\r\n\t\t\r\n\t\t$rating_mov_result = mysqli_query($rating_con,$rating_mov);\r\n\t\t$rating_tv_result = mysqli_query($rating_con,$rating_tv);\r\n\r\n\t\tif(mysqli_num_rows($rating_mov_result)>0||mysqli_num_rows($rating_tv_result)>0){\r\n\t\t\techo \"<h2 style='text-align: center;'> MOVIES </h2>\";\r\n\t\t\tif(mysqli_num_rows($rating_mov_result) == 0)\r\n\t\t\t\techo \"\r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<h3 style='text-align: center;'> Nothing came up... </h3>\r\n\t\t\t\t\t\t<br><hr><br>\r\n\t\t\t\t\t\";\r\n\t\t\telse\r\n\t\t\t\twhile ($record = mysqli_fetch_assoc($rating_mov_result)) { \r\n\t\t\t\t\t$id=$record['id'];\r\n\t\t\t\t\t$name=$record['name'];\r\n\t\t\t\t\t$genre=$record['genre'];\r\n\t\t\t\t\t$rating=$record['rating'];\r\n\t\t\t\t\t$imgpath=$record['imgpath'];\r\n\t\t\t\t\t$imdbpath=$record['imdbpath'];\r\n\t\t\t\t\t$bookpath=$record['bookpath'];\r\n\t\t\t\t\techo \"\t\r\n\t\t\t\t\t<div class='container'>\r\n\t\t\t\t\t\t<div class='card'>\r\n\t\t\t\t\t\t\t<div class='card-body'>\r\n\t\t\t\t\t\t\t\t<img src='$imgpath' height='100' style='float: left; border: 0.25px solid grey;'/>\r\n\t\t\t\t\t\t\t\t<div style='float: right;'>\r\n\t\t\t\t \t\t\t\t<h4 class='card-title'>$name</h4>\r\n\t\t\t\t\t\t\t\t\t<p class='card-text'> \r\n\t\t\t\t\t\t\t\t\t\t$genre &nbsp &nbsp &nbsp <div style='font-size: 15px; font-weight: 700;'> $rating </div>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t<a href='$bookpath' class='card-link btn btn-outline-success'>Book Now</a>\r\n\t\t\t\t\t\t\t\t\t<a href='$imdbpath' class='card-link btn btn-outline-danger' target='_blank'>View Info</a>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br>\";\r\n\t\t\t\t}\r\n\t\t\techo \"<h2 style='text-align: center;'> TV SHOWS </h2>\";\r\n\t\t\tif(mysqli_num_rows($rating_tv_result) == 0)\r\n\t\t\t\techo \"\r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<h3 style='text-align: center;'> Nothing came up... </h3>\r\n\t\t\t\t\t\t<br><hr><br>\r\n\t\t\t\t\t\";\r\n\t\t\telse\r\n\t\t\t\twhile ($record = mysqli_fetch_assoc($rating_tv_result)) { \r\n\t\t\t\t\t$id=$record['id'];\r\n\t\t\t\t\t$name=$record['name'];\r\n\t\t\t\t\t$genre=$record['genre'];\r\n\t\t\t\t\t$rating=$record['rating'];\r\n\t\t\t\t\t$imgpath=$record['imgpath'];\r\n\t\t\t\t\t$imdbpath=$record['imdbpath'];\r\n\t\t\t\t\t$bookpath=$record['bookpath'];\r\n\t\t\t\t\techo \"\t\r\n\t\t\t\t\t<div class='container'>\r\n\t\t\t\t\t\t<div class='card'>\r\n\t\t\t\t\t\t\t<div class='card-body'>\r\n\t\t\t\t\t\t\t\t<img src='$imgpath' height='100' style='float: left; border: 0.25px solid grey;'/>\r\n\t\t\t\t\t\t\t\t<div style='float: right;'>\r\n\t\t\t\t \t\t\t\t<h4 class='card-title'>$name</h4>\r\n\t\t\t\t\t\t\t\t\t<p class='card-text'> \r\n\t\t\t\t\t\t\t\t\t\t$genre &nbsp &nbsp &nbsp <div style='font-size: 15px; font-weight: 700;'> $rating </div>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t<a href='$bookpath' class='card-link btn btn-outline-success'>Book Now</a>\r\n\t\t\t\t\t\t\t\t\t<a href='$imdbpath' class='card-link btn btn-outline-danger' target='_blank'>View Info</a>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br>\";\r\n\t\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tnothing_came_up();\r\n\t}", "public function loadPopularSearchImages()\n\t{\n\t\t$query = PopularSearchImages::select('popular_search_images.keyword', \n\t\t\t\t\t\t\t\t\t\t\t\t'popular_search_images.query', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.id', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.short_name', \n\t\t\t\t\t\t\t\t\t\t\t\t'image_details.ratio', \n\t\t\t\t\t\t\t\t\t\t\t\tDB::raw('COUNT(keyword) as total_searched')\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t->leftJoin('images', 'images.id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t->leftJoin('image_details', function($join){\n\t\t\t\t\t\t\t\t\t\t\t$join->on('image_details.image_id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->where('image_details.type', '=', 'main');\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t->groupBy('keyword')\n\t\t\t\t\t\t\t\t\t\t->orderBy('total_searched', 'desc')\n\t\t\t\t\t\t\t\t\t\t->take(16)\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t$arrReturn = [\n\t\t\t\t\t'arrKeywords' \t\t\t => [],\n\t\t\t\t\t'arrPopularSearchImages' => []\n\t\t\t\t];\n\t\tif( !$query->isempty() ) {\n\t\t\t$query = $query->toArray();\n\t\t\t$arrReturn['arrKeywords'] = $query;\n\t\t\t$dataKeywords = array_slice($arrReturn['arrKeywords'], 0, 8);\n\t\t\tforeach($dataKeywords as $keyword) {\n\t\t\t\tif( $keyword['ratio'] > 1 ) {\n\t\t\t\t\t$width = 450;\n\t \t\t\t$height = $width / $keyword['ratio'];\n\t\t\t\t} else {\n\t\t\t\t\t$height = 450;\n\t \t\t\t$width = $height * $keyword['ratio'];\n\t\t\t\t}\n\t\t\t\t$arrReturn['arrPopularSearchImages'][] = [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'path' => '/pic/crop/'.$keyword['short_name'].'-'.$keyword['id'].'.jpg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height' => $height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'keyword' => $keyword['keyword'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'query' => $keyword['query']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$html = View::make('frontend.types.popular-search-images')\n\t\t\t->with($arrReturn)->render();\n\t\treturn $html;\n\n\t}", "public function suggestions()\n\t{\n\n\t\t\t$user_manager = new UserManager();\n\t\t\t$smarty = new Smarty_WinesAlike();\n\n\t\t\tif (isset($_POST['email']) && isset($_POST['passwd']))\n\t\t\t// they have just tried logging in\n\t\t\t{\n\t\t\t \t//create short variable names\n\t\t\t \t$email = $_POST['email'];\n\t\t\t \t$passwd = $_POST['passwd'];\n\t\t\t \ttry\n\t\t\t \t{\n\t\t\t\t\tif ($user_manager->login_exists($email, $passwd))\n\t\t\t\t\t{\n\t\t\t\t \t// if they are in the database register the user id\n\t\t\t\t \t$user_manager->register_valid_user($email);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t \t}\n\t\t\t \tcatch(Exception $e) \n\t\t\t\t{\n\t\t\t\t\t//echo (json_encode(new array());\n\t\t\t\t\texit;\n\t\t\t \t} \n\t\t\t}\n\n\t\t\t// get the ratings this user has entered, or all of them if not user specified\n\t\t\t$ratings = new Ratings();\n\t\t\tif ($user_manager->check_valid_user()) {\n\t\t\t\t$rating_array = $ratings->find_suggestions($user_manager->get_current_user());\n\t\t\t\tif (count($rating_array) == 0) \n\t\t\t\t{\n\t\t\t\t\t$rating_array = $ratings->get_latest_ratings($user_manager->get_current_user(),16);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rating_array = array();\n\t\t\t}\n\t\t\techo (json_encode($rating_array));\n\t}", "function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }", "function search2(){\n\t\t$keyword = $this->uri->segment(5);\n\t\t$keyword2 = preg_replace('/%20/', '', $keyword);\n\t\t$kategori = \"A\";\n\t\t/*print_r($keyword);*/\n\t\t//api kategori bkd\n\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/kategori_bkd_bebankerja';\n\t\t$parameter = array('api_search' => array($keyword2, $kategori));\n\t\t$data['data_bebankerja'] = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t//pengambilan data dan pengrimimannya ke view\n\t\t//print_r($data);\n\t\tforeach($data['data_bebankerja'] as $row)\n\t\t{\n\t\t\t$arr['query'] = $keyword;\n\t\t\t$arr['suggestions'][] = array(\n\t\t\t\t'value'\t=>$row->NM_KAT,\n\t\t\t\t'nilai'=>$row->KD_KAT,\n\t\t\t\t'satuan' =>$row->SATUAN,\n\t\t\t\t'nilai_kat' => $row->NILAI_KAT,\n\t\t\t\t'set_masa_tugas' =>1,\n\t\t\t\t'set_rincian_masa' =>'Semester',\n\t\t\t\t'set_tempat'=>''\n\t\t\t);\n\t\t}\n\t\t// minimal PHP 5.2\n\t\techo json_encode($arr);\n\t}", "public function recommendations($request, $response)\r\n {\r\n {\r\n $params = array();\r\n\r\n // Available Genres to search by on spotify\r\n $avail_genres = [\r\n \"acoustic\", \"afrobeat\", \"alt-rock\", \"alternative\", \"ambient\", \"anime\", \"black-metal\", \"bluegrass\",\r\n \"blues\", \"bossanova\", \"brazil\", \"breakbeat\", \"british\", \"cantopop\", \"chicago-house\", \"children\", \"chill\",\r\n \"classical\", \"club\", \"comedy\", \"country\", \"dance\", \"dancehall\", \"death-metal\", \"deep-house\", \"detroit-techno\",\r\n \"disco\", \"disney\", \"drum-and-bass\", \"dub\", \"dubstep\", \"edm\", \"electro\", \"electronic\", \"emo\", \"folk\", \"forro\",\r\n \"french\", \"funk\", \"garage\", \"german\", \"gospel\", \"goth\", \"grindcore\", \"groove\", \"grunge\", \"guitar\",\r\n \"happy\", \"hard-rock\", \"hardcore\", \"hardstyle\", \"heavy-metal\", \"hip-hop\", \"holidays\", \"honky-tonk\", \"house\",\r\n \"idm\", \"indian\", \"indie\", \"indie-pop\", \"industrial\", \"iranian\", \"j-dance\", \"j-idol\", \"j-pop\", \"j-rock\",\r\n \"jazz\", \"k-pop\", \"kids\", \"latin\", \"latino\", \"malay\", \"mandopop\", \"metal\", \"metal-misc\", \"metalcore\",\r\n \"minimal-techno\", \"movies\", \"mpb\", \"new-age\", \"new-release\", \"opera\", \"pagode\", \"party\", \"philippines-opm\",\r\n \"piano\", \"pop\", \"pop-film\", \"post-dubstep\", \"power-pop\", \"progressive-house\", \"psych-rock\", \"punk\",\r\n \"punk-rock\", \"r-n-b\", \"rainy-day\", \"reggae\", \"reggaeton\", \"road-trip\", \"rock\", \"rock-n-roll\", \"rockabilly\", \"romance\", \"sad\",\r\n \"salsa\", \"samba\", \"sertanejo\", \"show-tunes\", \"singer-songwriter\", \"ska\", \"sleep\", \"songwriter\", \"soul\",\r\n \"soundtracks\", \"spanish\", \"study\", \"summer\", \"swedish\", \"synth-pop\", \"tango\", \"techno\", \"trance\", \"trip-hop\",\r\n \"turkish\", \"work-out\", \"world-music\"\r\n ];\r\n\r\n $spotify_connected = isset($_SESSION['spotify_active']);\r\n $params['connected'] = $spotify_connected;\r\n\r\n $params['music'] = array();\r\n\r\n if (isset($_SESSION['user']) && $spotify_connected)\r\n {\r\n // User is logged in and connected their Spotify account, use their actual data\r\n\r\n // Get their top artists\r\n $artists = $this->getTopArtists();\r\n\r\n // Using top tracks, create an array of their top genres and artist ids\r\n $genres = array();\r\n $artist_arr = array();\r\n\r\n foreach($artists['items'] as $artist)\r\n {\r\n // Save artist id and name to use for artist recommendations\r\n $artist_arr[$artist['id']] = $artist['name'];\r\n\r\n foreach($artist['genres'] as $genre_name)\r\n {\r\n // Filter genres to genres that is available to search by on Spotify $avail_genres\r\n $name = str_replace(' ', '-', $genre_name);\r\n if (in_array($name, $avail_genres))\r\n {\r\n // Add to array of $genres\r\n if (isset($genres[$name]))\r\n {\r\n $genres[$name] += 1;\r\n }\r\n else\r\n {\r\n $genres[$name] = 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sort list of genres by values\r\n arsort($genres);\r\n\r\n // Slice array to get top 4 genres and artists\r\n $genres = array_slice($genres, 0, 4);\r\n $artist_arr = array_slice($artist_arr, 0 , 4);\r\n }\r\n else\r\n {\r\n // Spotify Account not Account, use defaults genres\r\n $genres = array('r-n-b' => 1, 'pop' => 2, 'hip-hop' => 3, 'indie-pop' => 4);\r\n $artist_arr = array('3TVXtAsR1Inumwj472S9r4' => 'Drake', '0C0XlULifJtAgn6ZNCW2eu' => 'The Killers',\r\n '0MeLMJJcouYXCymQSHPn8g' => 'Sleeping At Last');\r\n }\r\n\r\n $genre_tracks = array();\r\n $artist_tracks = array();\r\n\r\n // Get recommendations based on GENRES\r\n foreach ($genres as $gen => $amount)\r\n {\r\n $view_name = ucwords(str_replace('-', ' ', $gen));\r\n $genre_tracks[$view_name] = $this->getTrackRecommendations('seed_genres', $gen);\r\n }\r\n $params['music']['Genres'] = $genre_tracks;\r\n\r\n // Get recommendations based on ARTISTS\r\n foreach ($artist_arr as $art_id => $art_name)\r\n {\r\n $artist_tracks[$art_name] = $this->getTrackRecommendations('seed_artists', $art_id);\r\n }\r\n $params['music']['Artists'] = $artist_tracks;\r\n\r\n return $this->render('recommendations', $params);\r\n }\r\n }" ]
[ "0.57272536", "0.56222004", "0.5598146", "0.55605394", "0.55275416", "0.55166566", "0.5507357", "0.53745264", "0.53550833", "0.533249", "0.53245443", "0.52739054", "0.52474946", "0.5232062", "0.52169013", "0.52103585", "0.5204038", "0.5170687", "0.51572275", "0.51548797", "0.5143908", "0.5114989", "0.51088357", "0.5103804", "0.509876", "0.5079716", "0.50747186", "0.50675136", "0.50339127", "0.50336385" ]
0.60037804
0
Determine if the client should skip the authorization prompt.
public function skipsAuthorization(): bool { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function skipsAuthorization(): bool\n {\n return Gate::allows('skips-authorization', $this);\n }", "function auth_required() {\n $authinconfig = $this->config->taverna->needAuth;\n if (strcasecmp($authinconfig, 'false') == 0) {\n return FALSE; //no authorization required so we are authorized\n }\n return TRUE;\n }", "protected function shouldSkipAuth()\n {\n $config = Config::getInstance();\n $disableAuth = (bool)$config->get('php-censor.security.disable_auth', false);\n $defaultUserId = (int)$config->get('php-censor.security.default_user_id', 1);\n\n if ($disableAuth && $defaultUserId) {\n $user = Factory::getStore('User')->getByPrimaryKey($defaultUserId);\n\n if ($user) {\n return true;\n }\n }\n\n return false;\n }", "public function is_auth_required() {\r\n\r\n\t\treturn false;\r\n\t}", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function requiresAuthentication() {\n return false;\n }", "protected function shouldPrompt()\n {\n return !$this->rocketeer->isLocal();\n }", "public function isUnauthorized(): bool\n {\n $body = trim($this->getBody());\n\n $unauthorizedFlag = (false !== strpos(\"[KEY-DID-NOT-EXIST-OR-USER-IS-NOT-ACTIVE]\", $body));\n\n return parent::isUnauthorized() || $unauthorizedFlag;\n }", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "public function isRequiredAuthorization()\n\t{\n\t\tif(!$this->errorCollection->hasErrors())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn\n\t\t\t(bool)$this->errorCollection->getErrorByCode(self::ERROR_CODE_INSUFFICIENT_SCOPE) ||\n\t\t\t(bool)$this->errorCollection->getErrorByCode(self::ERROR_CODE_INVALID_CREDENTIALS)\n\t\t;\n\t}", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function isUnauthorized(): bool\n {\n return \\in_array($this->getStatusCode(), [401, 403]);\n }", "public function authorize(): bool\n {\n return false;\n }", "public function authorize() {\n\t\treturn false;\n }", "public function authorize(): bool\n {\n return !auth()->check();\n }", "public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function maybeBypassLogin() {\n\t\t$bypass = apply_filters( 'aad_auto_forward_login', false );\n\n\t\t/*\n\t\t * If the user is attempting to logout AND the auto-forward to AAD\n\t\t * login is set then we need to ensure we do not auto-forward the user and get\n\t\t * them stuck in an infinite logout loop.\n\t\t */\n\t\tif ( $this->wantsToLogin() && $bypass && ! isset( $_GET['code'] ) ) {\n\t\t\twp_redirect( $this->getLoginUrl() );\n\t\t\tdie();\n\t\t}\n\t}", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isDenied()\n {\n return isset($this->_data[OAuth::PARAM_DENIED]);\n }", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "public static function requireUnauthorized()\n {\n if(SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "function isDenied() {\n return !empty($this->denied_reasons);\n }", "public function authorize()\n {\n return !Auth::guest();\n }", "protected function unauthorizedArea()\n\t{\n\t\t// Disable if there is a text file there.\n\t\tif ( file_exists(LD_PLUGIN_DIR.'/disable_auth.txt'))\n\t\t\treturn;\n\t\t\n\t\theader('WWW-Authenticate: Basic realm=\"'. $this->instance->relm.'\"');\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\techo '<h1>Authorization Required.</h1>';\n\t\texit;\n\t}", "public function authorize()\n {\n //return false; //return False will stop everything\n\t\treturn true;\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }" ]
[ "0.7358047", "0.6882466", "0.66279286", "0.65275586", "0.6420907", "0.63860667", "0.6327263", "0.6237454", "0.62134314", "0.62134314", "0.6201036", "0.61319274", "0.60520923", "0.5976112", "0.5938668", "0.5919285", "0.5915463", "0.59043014", "0.59003586", "0.58973086", "0.5896703", "0.5893108", "0.5888405", "0.5849909", "0.5847509", "0.58343655", "0.58152604", "0.58105844", "0.5795542", "0.5795542" ]
0.7664686
0
Assert that command return 0 ( no error )
public function testExecute():void { $this->assertEquals(0,$this->commandTester->execute([])); //Assert command display $this->assertEquals( 'Sample command without interactions' . PHP_EOL, $this->commandTester->getDisplay() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetResultPositive()\n {\n $command = $this->getCommandMock();\n $command->expects($this->once())->method('execute');\n\n }", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "protected function testErreurs()\n\t{\n\t\t$cmd = '';\n\t}", "public function testExecute() : void\n {\n $character = new Character();\n $result = $this->command->execute($character);\n\n $this->assertEquals(\"result\", $result);\n }", "public function theExitCodeShouldBeZero()\n {\n if ($this->return_code != 0) {\n throw new \\Exception(\n 'Return code was '.$this->return_code.' with output '\n .$this->output\n );\n }\n }", "public function theExitCodeShouldBeNonZero()\n {\n if ($this->return_code == 0) {\n throw new \\Exception('Return code was 0');\n }\n }", "public function testHandle0()\n{\n\n $actual = $this->retryCommand->handle();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function redis_Scripting_script_invalid_command()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $this->expectException(ScriptCommandException::class);\n $this->assertEquals(1, $this->redis->script('return'));\n }", "public function testCase1()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('110', 'S0');\n $this->assertEquals($ret['status'], 'success');\n }", "public function testAddCommandNegative()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->calc->addCommand(null, $this->getCommandMock());\n }", "public function testCommand(): void\n {\n $process = $this->phpbench('run benchmarks/set4/NothingBench.php');\n $this->assertExitCode(0, $process);\n }", "public function testComputeNegative()\n {\n $this->expectException('');\n $this->calc->init(42)->compute('command not exist', 42);\n }", "public function testAddCommandPositive()\n {\n $this->calc->addCommand();\n }", "public function testGetCommands()\r\n\t{\r\n\t\t$this->assertEquals(\r\n\t\t\t\t\t\t2,\r\n\t\t\t\t\t\tcount($this->steroids->getCommands())\r\n\t\t\t\t\t);\r\n\t}", "public function testCommandWithNoPath(): void\n {\n $process = $this->phpbench('run');\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('You must either specify', $process->getErrorOutput());\n }", "function testPingCommand()\n {\n $console = new Console();\n\n ob_start();\n\n $result = $console->findCommand(\"ping\")->execute();\n\n $out = ob_get_clean();\n\n $this->assertTrue($result);\n $this->assertSame(\"Pong!\\n\", $out);\n }", "public function testExecute()\n {\n $this->commandTester->execute(\n array(\n 'file_path' => __DIR__. '/../Fixtures/stock.csv',\n '--test_run' => true,\n )\n );\n\n $this->assertRegexp('/Validated items/', $this->commandTester->getDisplay());\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "public function testProcessExitCodeDifferFromZero(): void\n {\n $commandLine = 'aspell';\n $process = $this->prophesize(Process::class);\n\n $process->setTimeout(600)->shouldBeCalled()->willReturn($process);\n $process->setEnv([])->shouldBeCalled()->willReturn($process);\n $process->setInput('')->shouldBeCalled()->willReturn($process);\n $process->run()->shouldBeCalled();\n $process->getCommandLine()->shouldBeCalled()->willReturn($commandLine);\n $process->getErrorOutput()->shouldBeCalled()->willReturn('Error');\n $process->getExitCode()->shouldBeCalled()->willReturn(1);\n\n $source = $this->prophesize(EncodingAwareSource::class);\n $source->getAsString()->shouldBeCalled()->willReturn('');\n\n $mock = $this->getMockForAbstractClass(ExternalSpeller::class, ['aspell']);\n $mock->setProcess($process->reveal());\n\n $this->expectException(ExternalProgramFailedException::class);\n $this->expectExceptionCode(1);\n $this->expectExceptionMessage('Failed to execute \"aspell\": Error');\n\n $mock->checkText($source->reveal(), ['en']);\n }", "public function testCanRunValidCommand()\n {\n $dir = __DIR__;\n $command = new Command(\"/bin/ls $dir/Command*\");\n\n $this->assertFalse($command->getExecuted());\n $this->assertTrue($command->execute());\n $this->assertTrue($command->getExecuted());\n $this->assertEquals(\"$dir/CommandTest.php\", $command->getOutput());\n $this->assertEquals(\"$dir/CommandTest.php\\n\", $command->getOutput(false));\n $this->assertEmpty($command->getError());\n $this->assertEmpty($command->getStdErr());\n $this->assertEquals(0, $command->getExitCode());\n }", "function is_ok($cmd = \"\")\n {\n }", "public function testCommandError()\n {\n $timestamp = 1326670266.115;\n $datestamp = new \\DateTime();\n $datestamp->setTimestamp($timestamp);\n\n $attributes = ['scheduledEventId' => 123456];\n $event_id = 'test_'.rand(10000, 99999);\n\n $history = new WorkflowHistory();\n $command = new ActivityTaskStartedCommand($datestamp, $attributes, $event_id);\n\n $command->apply($history);\n }", "public function testExecuteUnexpectedValue()\n {\n $managerMock = $this\n ->getMockBuilder('ONGR\\ElasticsearchBundle\\ORM\\Manager')\n ->disableOriginalConstructor()\n ->setMethods(['getConnection', 'updateMapping'])\n ->getMock();\n\n $managerMock->expects($this->once())->method('getConnection')->willReturnSelf();\n $managerMock->expects($this->once())->method('updateMapping')->willReturn(3);\n\n /** @var TypeUpdateCommand|\\PHPUnit_Framework_MockObject_MockObject $command */\n $command = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\Command\\TypeUpdateCommand')\n ->setMethods(['clearMappingCache'])\n ->getMock();\n $command->expects($this->once())->method('clearMappingCache')->willReturn($managerMock);\n\n $app = new Application();\n $app->add($command);\n\n $commandToTest = $app->find('es:type:update');\n $commandTester = new CommandTester($commandToTest);\n $commandTester->execute(\n [\n 'command' => $command->getName(),\n '--force' => true,\n ]\n );\n }", "function Execute ()\r\n {\r\n return 0; \r\n }", "public function testSetGetCommandFailure()\n {\n $command = new \\stdClass();\n\n $subject = $this->createInstance();\n $_subject = $this->reflect($subject);\n\n $this->setExpectedException('InvalidArgumentException');\n $_subject->_setCommand($command);\n }", "public function testExecuteCommand()\n {\n $this->environment->expects($this->once())\n ->method('sendCommandViaSsh')\n ->with($this->equalTo('dummy arg1 arg2'))\n ->willReturn(['output' => 'dummy output', 'exit_code' => 0]);\n\n $output = $this->command->dummyCommand('site.env', ['arg1', 'arg2']);\n\n $this->assertEquals('dummy output', $output);\n }", "public function testExecuteWithException()\n {\n $this->prepareRequestMock();\n $this->customerRestrictionMock->expects($this->once())->method('isOwner')->willReturn(false);\n $this->customerRestrictionMock->expects($this->once())->method('isSubUserContent')->willReturn(false);\n $this->resultJson->expects($this->once())->method('setJsonData')->willReturnSelf();\n $this->quoteRepositoryMock->expects($this->once())->method('get')->willReturn($this->quote);\n $this->resultFactory->expects($this->once())->method('create')\n ->with(\\Magento\\Framework\\Controller\\ResultFactory::TYPE_JSON)->willReturn($this->resultJson);\n $this->messageManager->expects($this->once())->method('addError')->willReturnSelf();\n $this->assertEquals($this->resultJson, $this->recalculate->execute());\n }", "public function excCommand() {\n $this->_parseArgs();\n\n if ($this->_checkIsArgsSet()) {\n $execResult = $this->exec();\n\n if ($execResult === null) {\n return 0;\n }\n\n return intval($execResult);\n }\n\n return -1;\n }", "public function test_schedule_command()\n {\n $this->artisan('schedule:run')->assertExitCode(0);\n }", "public function testPs()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(), 'ok');\n }" ]
[ "0.7855765", "0.68702686", "0.6827576", "0.6819911", "0.66331655", "0.65977454", "0.6561913", "0.6542994", "0.64559335", "0.64396536", "0.6401967", "0.63811994", "0.6358414", "0.62678", "0.62510604", "0.622485", "0.6220496", "0.6181758", "0.61741674", "0.6162509", "0.61351633", "0.6093748", "0.608847", "0.606037", "0.6060287", "0.5995886", "0.5984839", "0.5970552", "0.59466976", "0.5930188" ]
0.7068776
1
Build a shipment from an IsotopeCollection
protected function buildShipmentFromCollection(IsotopeProductCollection $objCollection) { //Get the Iso Config $Config = Isotope::getConfig(); //Create the shipment $Shipment = new stdClass(); //Apply the service information $Service = new stdClass(); $Service->Code = $this->ups_enabledService; $Service->Description = $GLOBALS['TL_LANG']['tl_iso_shipping']['ups_service'][$this->ups_enabledService]; $Shipment->Service = $Service; //Build Shipper information $Shipper = new stdClass(); $Shipper->ShipperNumber = $Config->UpsAccountNumber; //ShipFrom Address $ShipFromAddress = static::buildAddress($Config); //Assign to Shipper $Shipper->Address = $ShipFromAddress; $Shipment->Shipper = $Shipper; //ShipFrom Object $ShipFrom = new stdClass(); $ShipFrom->Address = $ShipFromAddress; $ShipFrom->Company = $Config->company; $Shipment->ShipFrom = $ShipFrom; //ShipTo Address $objShippingAddress = $objCollection->getShippingAddress(); $ShipToAddress = static::buildAddress($objShippingAddress); //ShipTo Object $ShipTo = new stdClass(); $ShipTo->Address = $ShipToAddress; $ShipTo->AttentionName = $objShippingAddress->firstname . ' ' . $objShippingAddress->lastname; $Shipment->ShipTo = $ShipTo; $Package = static::buildPackage($objCollection); $Shipment->Package = array($Package); return $Shipment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareCollection()\n {\n $collection = Mage::getModel('sales/order_shipment')->getCollection();\n $tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');\n\n $collection->getSelect()->joinLeft(array('o'=>$tableName), 'main_table.order_id=o.entity_id', array(\n 'order_increment_id'=>'o.increment_id',\n 'order_created_date'=>'o.created_at',\n 'o.shipping_description'));\n\n $collection->addFieldToFilter('o.shipping_description', array('like'=>'%canpar%'));\n $tableName = Mage::getSingleton('core/resource')->getTableName('ch_canpar_shipment');\n\n $collection->getSelect()->joinLeft(array('ch_shipment'=>$tableName), 'main_table.entity_id=ch_shipment.magento_shipment_id',array(\n 'canpar_shipment_id'=>'shipment_id',\n 'manifest_id'=>'manifest_id'));\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function prepareIsotope() {\n\n VTCore_Wordpress_Utility::loadAsset('jquery-isotope');\n $this->addClass('js-isotope');\n\n if ($this->getContext('ajax')) {\n $this->addData('ajax-marker', array(\n 'isotope' => true,\n 'id' => $this->getContext('id'),\n 'mode' => 'wp-loop',\n ));\n }\n\n return $this;\n }", "protected function _prepareCollection() {\n $session = Mage::getModel('core/session');\n $filterConditions = $session->getData('rp_conditions');\n if (!$filterConditions)\n $filterConditions = $this->_filterConditions;\n $posorderCollection = Mage::getModel('webpos/posorder')->getCollection();\n /* Jack - create an empty collection */\n $collection = $posorderCollection;\n foreach ($collection->getItems() as $key => $item) {\n $collection->removeItemByKey($key);\n }\n /**/\n\n /* Define variables and set default data */\n $totalsSalesByUser = array();\n $totalSales = 0;\n $incTimeStrings = array('1' => ' +1 week', '2' => ' +1 day', '3' => ' +1 month', '4' => ' +1 day', '5' => ' +1 day', '6' => ' +1 week', '7' => ' +1 week');\n $descTimeStrings = array('4' => ' -1 week', '5' => ' -1 week', '6' => ' -1 month', '7' => ' -1 month');\n $periodFormat = ($filterConditions['period'] == 3 || $filterConditions['period'] == 6 || $filterConditions['period'] == 7 ) ? \"Y-m-d\" : \"Y-m-d\";\n $specialPeriod = array('1', '2', '3', '4');\n $stringTimeFrom = array('1' => 'monday this week', '2' => 'monday last week', '3' => 'first day of this month', '4' => 'first day of previous month');\n $stringTimeTo = array('1' => 'sunday this week', '2' => 'sunday last week', '3' => 'last day of this month', '4' => 'last day of previous month');\n $thisFriday = date($periodFormat, strtotime('friday this week'));\n $today = date($periodFormat);\n $userIds = $this->userIds;\n if (($filterConditions['from'] == '' || $filterConditions['to'] == '' ) && in_array($filterConditions['period'], $specialPeriod) == false) {\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }\n\n $startTime = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeFrom = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeTo = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeTo[$filterConditions['range']]))) : date(\"Y-m-d\", strtotime($filterConditions['to']));\n if ($timeFrom && $timeTo) {\n while ($timeFrom <= $timeTo) {\n $i = 0;\n foreach ($this->userIds as $userId => $displayName) {\n $isSave = true;\n $totalSalesOfPeriod = 0;\n $isEmpty = true;\n if ($filterConditions['period'] == 1) {\n $endTime = $this->lastDayOf('year', new DateTime($timeFrom))->format('Y-m-d');\n } else if ($filterConditions['period'] == 3) {\n $endTime = $this->lastDayOf('month', new DateTime($timeFrom))->format('Y-m-d');\n } else\n $endTime = date('Y-m-d', strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n $endTime = (strtotime($endTime) < strtotime($timeTo)) ? $endTime : $timeTo;\n $itemDataObject = new Varien_Object();\n if ($i == 0) {\n if ($filterConditions['period'] == 1) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0]);\n } else if ($filterConditions['period'] == 3) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0] . '-' . $exTimeFrom[1]);\n } else\n $itemDataObject->setData('period', $timeFrom);\n } else\n $itemDataObject->setData('period', '');\n if ($itemDataObject->getData('period'))\n $itemDataObject->setData('period', date('F j, Y', strtotime($itemDataObject->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeFrom, $endTime, array('user_id' => $userId));\n $totalU = 0;\n if (count($webposOrderCollection) > 0) {\n foreach ($webposOrderCollection as $order) {\n $totalU += $order->getTotals();\n }\n }\n if (!$totalU && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n\n if ($isSave) {\n $itemDataObject->setData('user', $displayName);\n\n $itemDataObject->setData('totals_sales', ($totalU > 0) ? $totalU : '0.00');\n $collection->addItem($itemDataObject);\n }\n $i++;\n }\n if ($filterConditions['period'] == 1)\n $timeFrom = date('Y-m-d', strtotime($endTime));\n else\n $timeFrom = date($periodFormat, strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n }\n /* get last item data \n $i = 0;\n foreach($this->userIds as $userId => $displayName){\n $isSave = true;\n $beforeLastItem = new Varien_Object();\n if($i == 0){\n if($filterConditions['period'] == 1){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0]);\n }\n else if($filterConditions['period'] == 3){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0].'-'.$exTimeFrom[1]);\n }\n else\n $beforeLastItem->setData('period',$timeTo);\n }\n else\n $beforeLastItem->setData('period','');\n if($beforeLastItem->getData('period'))\n $beforeLastItem->setData('period',date('F j, Y', strtotime($beforeLastItem->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeTo,$timeTo,array('user_id' => $userId))->getFirstItem();\n if( !$webposOrderCollection->getTotals() && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n if($isSave){\n $beforeLastItem->setData('user',$displayName);\n $beforeLastItem->setData('totals_sales',$webposOrderCollection->getTotals()?$webposOrderCollection->getTotals():'0.00');\n $collection->addItem($beforeLastItem);\n }\n $i++;\n }\n end last item */\n }\n /* set data for totals row */\n $lastItemDataObject = new Varien_Object();\n $lastItemDataObject->setData('period', 'Totals:');\n $orders = $this->getSalesTotal($startTime, $endTime);\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $lastItemDataObject->setData('totals_sales', $totalU);\n $collection->addItem($lastItemDataObject);\n $this->setCollection($collection);\n /* set session for chart */\n $sessionObject = new Varien_Object();\n foreach ($this->userIds as $userId => $username) {\n $orders = $this->getSalesTotal($startTime, $endTime, array('user_id' => $userId));\n\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $sessionObject->setData($username, $totalU);\n }\n Mage::getSingleton('core/session')->setData('total_sales_by_user', $sessionObject->toArray());\n Mage::getSingleton('core/session')->setType('user');\n $this->setTotalRowByUser($sessionObject->toArray());\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->getSelect()->joinLeft(\n array('sfo' => 'sales_flat_order'),\n 'main_table.order_id = sfo.entity_id',\n array('increment_id')\n );\n\t\t$this->setCollection($collection);\n\n\t\treturn parent::_prepareCollection();\n\t}", "protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected static function buildPackage(IsotopeProductCollection $objCollection)\n {\n $Package = new stdClass();\n \n //Packaging Type\n $PackagingType = new stdClass();\n $PackagingType->Code = '02'; //Box for now\n $PackagingType->Description = '';\n $Package->PackagingType = $PackagingType;\n \n //Package Dimensions\n $Dimensions = new stdClass();\n $UnitOfMeasurementD = new stdClass();\n $UnitOfMeasurementD->Code = 'IN';\n $Dimensions->UnitOfMeasurement = $UnitOfMeasurementD;\n $Dimensions->Length = '12';\n $Dimensions->Width = '12';\n $Dimensions->Height = '12';\n $Package->Dimensions = $Dimensions;\n \n //Package Weight\n $PackageWeight = new stdClass();\n $UnitOfMeasurementW = new stdClass();\n $UnitOfMeasurementW->Code = 'LBS';\n $PackageWeight->UnitOfMeasurement = $UnitOfMeasurementW;\n $PackageWeight->Weight = '1';\n $Package->PackageWeight = $PackageWeight;\n \n return $Package;\n }", "public function prepareCollection()\n {\n $this->_reset();\n\n $this->addAttributeToSelect('*');\n\n // Select cart items\n $this->joinTable(\n array('qi' => 'sales/quote_item'),\n 'product_id = entity_id',\n array(\n 'product_name' => 'name',\n 'counts' => 'COUNT(1)',\n 'sum_qty' => \"SUM(CASE WHEN qip.product_type IN ('configurable', 'bundle') THEN qip.qty * qi.qty ELSE qi.qty END)\",\n 'total' => \"SUM(CASE WHEN qip.product_type='configurable' THEN qip.base_row_total ELSE qi.base_row_total END)\",\n 'product_type',\n 'quote_id' => 'quote_id',\n 'parent_item_id' => 'parent_item_id',\n 'item_created_at' => 'created_at'\n )\n );\n $this->addFilterToMap('parent_item_id', 'qi.parent_item_id');\n $this->addFilterToMap('product_type', 'qi.product_type');\n $this->addFilterToMap('item_created_at', 'item_created_at');\n\n // Retrieve base currency code from parent quote\n $this->joinTable(\n array('q' => 'sales/quote'),\n 'entity_id = quote_id',\n array('currency_code' => 'base_currency_code', 'store_id' => 'store_id')\n );\n\n // Select only cart items attached to a subscription\n $this->joinTable(\n array('s' => 'sheep_subscription/subscription'),\n 'quote_id = quote_id',\n array('subscription_created_at' => 'created_at',)\n );\n\n // re-join sales_flat_quote_item to retrieve parent info (if available)\n $this->joinTable(\n array('qip' => 'sales/quote_item'),\n 'item_id = parent_item_id',\n array('parent_product_type' => 'product_type', 'parent_qty' => 'qty'),\n null,\n 'left'\n );\n $this->addFilterToMap('parent_product_type', 'qip.product_type');\n $this->addFilterToMap('parent_qty', 'qip.qty');\n\n // Filter only cart items created during specified period\n $this->addFieldToFilter('item_created_at', array(\n 'from' => $this->_from,\n 'to' => $this->_to,\n 'datetime' => true\n ));\n\n $this->getSelect()->where(\n \"(qi.parent_item_id is null and qi.product_type NOT IN ('bundle', 'configurable')) OR\" .\n \"(qi.parent_item_id is not null and qip.product_type IN ('bundle', 'configurable'))\"\n );\n\n $this->getSelect()\n ->group('e.entity_id')\n ->order('counts ' . self::SORT_ORDER_DESC)\n ->having('COUNT(qi.product_id) > ?', 0);\n\n\n // Filter only quotes that were created in specified stores\n if ($this->_storeIds) {\n $this->addFieldToFilter('store_id', array('in' => $this->_storeIds));\n }\n }", "public function setShipmentItemsAttribute($value): self\n {\n $items = new Collection();\n collect($value)->each(function ($item) use ($items) {\n $items->push(new ShipmentItem($item));\n });\n $this->shipmentItems = $items;\n\n return $this;\n }", "protected function _prepareCollection()\n {\t\t \n\t\t\n $collection = Mage::getModel('catalog/product')\n \t->getCollection()\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('price')\n \t->addAttributeToSelect('special_price')\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('manufacturer')\n \t->addFieldToFilter('type_id', array('in' => array(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)))\n ->joinField('qty',\n 'cataloginventory/stock_item',\n 'qty',\n 'product_id=entity_id',\n '{{table}}.stock_id=1',\n 'left');\n \t;\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_worksheet/worksheet_collection');\n if ($this->getCurriculum()->getId()) {\n $constraint = 'related.curriculum_id='.$this->getCurriculum()->getId();\n } else {\n $constraint = 'related.curriculum_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_worksheet/worksheet_curriculum')),\n 'related.worksheet_id=main_table.entity_id AND '.$constraint,\n array('position')\n );\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_docwise/docwisement_collection');\n\n if ($this->getExam()->getId()) {\n $constraint = 'related.exam_id='.$this->getExam()->getId();\n } else {\n $constraint = 'related.exam_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_docwise/exam_docwisement')),\n 'related.docwisement_id = main_table.entity_id AND '.$constraint,\n array('position')\n );\n\n\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function _prepareCollection()\n {\n /* @var $collection Scandi_MenuManager_Model_Resource_Item_Collection */\n $collection = Mage::getModel('scandi_menumanager/item')->getResourceCollection()\n ->addMenuFilter(Mage::registry('menumanager_menu'));\n if (!$this->getRequest()->getParam('sort')) { $collection->setPositionOrder(); }\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create()->addVisibleFilter();\n $vendor_attrs = [];\n $vendor_id = $this->customerSession->getVendorId();\n if ($vendor_id) {\n $attr_model = $this->attribute->getProductAttributes($vendor_id)->getData();\n foreach ($attr_model as $key => $attr_id) {\n $vendor_attrs[] = $attr_id['attribute_id'];\n }\n $collection->addFieldToFilter('main_table.attribute_id', ['in' => $vendor_attrs]);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }\n return $this;\n }", "public function getFeedCollection($websiteId)\n {\n // Create collection (of sales order items\n $collection = Mage::getResourceModel('sales/order_item_collection');\n\n $collection // tried to use an array here, but it kept giving an error\n ->addAttributeToSelect('order_id')\n ->addAttributeToSelect('created_at')\n ->addAttributeToSelect('product_id')\n ->addAttributeToSelect('qty_ordered')\n ->addAttributeToSelect('base_price')\n ->addAttributeToSelect('base_row_total')\n ->addAttributeToSelect('base_original_price')\n ->addAttributeToSelect('parent_item_id');\n\n //filter out child products\n $collection->addAttributeToFilter('parent_item_id', array('null' => true));\n\n // Filter collection for current website\n // need to join to core_store table and grab website_id field\n $collection->getSelect()\n ->joinLeft('core_store', 'main_table.store_id = core_store.store_id', 'core_store.website_id')\n ->where('core_store.website_id = ' . $websiteId);\n\n // Join order item up with main order record for subtotals and emails\n $collection->getSelect()\n ->joinLeft('sales_flat_order', 'main_table.order_id = sales_flat_order.entity_id', array('base_subtotal', 'customer_email', 'increment_id'));\n\n //get the visibility data from the product's attribute data\n //thanks Vanai\n $attributeCode = 'visibility';\n $alias = $attributeCode . '_table';\n $attribute = Mage::getSingleton('eav/config')\n ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attributeCode);\n\n $collection->getSelect()\n ->join(\n array($alias => $attribute->getBackendTable()),\n \"main_table.product_id = $alias.entity_id AND $alias.attribute_id={$attribute->getId()}\",\n array($attributeCode => 'value')\n );\n\n\n //addExpressionAttributeToSelect does not work for the order_item_collection model\n //use the send columns function to add the if directly\n $collection\n ->getSelect()->columns(array('calc_product_id' =>\n 'if((product_type=\"grouped\" and `visibility_table`.`value` = ' . Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE . '),\n \t if(LOCATE(\\'super_product_config\\', product_options)>0,\n \t\t CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(product_options,\\'super_product_config\\',-1), \\'product_id\\',-1), \\'\";\\',2),\\':\"\\',-1) AS UNSIGNED),\n \t\t 0),\n \t `main_table`.`product_id`)'));\n\n\t\t// Add alias for entity_id column to use with throttle function\n\t\t$collection->getSelect()\n\t\t\t->columns(array('entity_id' => 'main_table.item_id'));\n\n // order by order item id\n $collection->getSelect()\n ->order('main_table.item_id');\n\n //fix problems with some installs returning multiple identical rows\n $collection->getSelect()\n ->distinct();\n\n // Return collection\n return $collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t//$collection->getSelect()->joinLeft(array('st' => 'core_store'),'main_table.SiteID = st.store_id',array('storename' => 'st.name'));\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "protected function _prepareCollection() {\r\n $store = $this->_getStore();\r\n $collection = Mage::getModel('catalog/product')->getCollection()\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('attribute_set_id')\r\n ->addAttributeToSelect('type_id');\r\n\r\n if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {\r\n $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');\r\n }\r\n if ($store->getId()) {\r\n $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\r\n $collection->addStoreFilter($store);\r\n $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);\r\n $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n } else {\r\n $collection->addAttributeToSelect('price');\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n }\r\n\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n $this->getCollection()->addWebsiteNamesToResult();\r\n return $this;\r\n }", "protected function _prepareCollection($collection)\n {\n return $this;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('solutionpartner/partner')->getCollection();\n $collection->getSelect()->joinLeft(\n array('order' => $collection->getTable('sales/order')),\n 'main_table.email = order.customer_email AND order.status = \"complete\"',\n array(\n 'order_id' => 'entity_id',\n 'order_status' => 'order.status',\n 'number_qtys' => 'count(order.entity_id)'\n ))\n ->group('main_table.solutionpartner_id');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n\n\t\t\n\t\t$collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('sku')\n ->addAttributeToSelect('name');\n\t\t\t\n\t\t$collection->addAttributeToSelect('thumbnail');\n\t\t\n\t\t$collection->addAttributeToFilter('image', array('eq' => 'no_selection'));\n \n\t\t//$collection->joinAttribute('image', 'catalog_product/image', 'entity_id', null, 'left');\n\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n }", "protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }", "protected function _prepareCollection()\n {\n /** @var \\Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addVisibleFilter();\n\n $store = $this->_getStore();\n// $prefix = Mage::getConfig()->getTablePrefix()->__toString();\n// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a\n// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`\n// where b.`store_id` ='.$store->getId().' and a.`version` =1\n// GROUP BY a.`attribute_id`';\n//\n// //join straker job product table to get version for each product\n// $collection->getSelect()->joinLeft(\n//\n// new Zend_Db_Expr('('.$jobAttributeQuery.')'),\n// 'main_table.attribute_id = t.attribute_id',\n// array('version')\n//\n// );\n /** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */\n $strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();\n $strakerJobAttributeCollection->getSelect()\n ->reset(Zend_Db_Select::COLUMNS)\n ->joinLeft(\n ['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],\n '`main_table`.`job_id` = `b`.`id`',\n []\n )->where(\n '`b`.`store_id` = ?', $store->getId()\n )->where(\n '`main_table`.`version` = ?', 1\n )->group(\n 'main_table.attribute_id'\n )->columns(\n ['version' => 'version', 'attribute_id' => 'attribute_id']\n );\n\n $jobAttributeQuery = $strakerJobAttributeCollection->getSelect();\n\n $collection->getSelect()->joinLeft(\n $jobAttributeQuery,\n 'main_table.attribute_id = t.attribute_id',\n array('version')\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }" ]
[ "0.6569434", "0.58940053", "0.55744416", "0.5551138", "0.5482385", "0.54574823", "0.54234946", "0.5356255", "0.5324826", "0.52936304", "0.5262763", "0.5236538", "0.518213", "0.5171952", "0.51173687", "0.5098204", "0.509509", "0.5074327", "0.50539297", "0.5016188", "0.4999141", "0.4997172", "0.498712", "0.49853203", "0.4981985", "0.4977546", "0.49630052", "0.49419284", "0.49000365", "0.4820437" ]
0.7260029
0
Build a UPS Cpmpatible Address Object from a Model
protected static function buildAddress(Model $objModel) { $Address = new stdClass(); $arrSubdivision = explode('-', $objModel->subdivision); $Address = new stdClass(); $Address->AddressLine1 = $objModel->street_1; $Address->AddressLine2 = $objModel->street_2; $Address->AddressLine3 = $objModel->street_3; $Address->City = $objModel->city; $Address->StateProvinceCode = strtoupper($arrSubdivision[1]); $Address->PostalCode = $objModel->postal; $Address->CountryCode = strtoupper($arrSubdivision[0]); return $Address; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAddress()\n {\n $class = $this->getClass();\n\n return new $class;\n }", "public function convertToMagentoAddress($address)\n {\n $addressModel = Mage::getModel('customer/address');\n\n $addressModel->addData(array(\n 'firstname' => $address->firstName,\n 'lastname' => $address->lastName,\n 'street' => $address->streetAddress . (isset($address->extendedAddress) ? \"\\n\" . $address->extendedAddress : ''),\n 'city' => $address->locality,\n 'postcode' => $address->postalCode,\n 'country' => $address->countryCodeAlpha2\n ));\n\n if (isset($address->region)) {\n $addressModel->setData('region_code', $address->region);\n }\n\n if (isset($address->company)) {\n $addressModel->setData('company', $address->company);\n }\n\n return $addressModel;\n }", "public function model()\n {\n return ContactAddress::class;\n }", "public function model()\n {\n return Address::class;\n }", "private function _createAddressField()\n {\n $address = new Zend_Form_Element_Text('address');\n $address->setLabel('bankAddress')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array(2, 150)));\n\n return $address;\n }", "function address($components = 'primary')\n {\n // Check for a configuration reference\n if(is_string($components)) {\n\n // Determine the components from configuration\n $components = config('branding.contacts.addresses.' . $components);\n\n }\n\n // Create and return a new address\n return new Address($components);\n }", "protected function extractAddress()\n {\n if (!$this->getRequest()->getPost('create_address')) {\n return null;\n }\n\n $addressForm = $this->formFactory->create('customer_address', 'customer_register_address');\n $allowedAttributes = $addressForm->getAllowedAttributes();\n\n $addressData = [];\n\n $regionDataObject = $this->regionDataFactory->create();\n foreach ($allowedAttributes as $attribute) {\n $attributeCode = $attribute->getAttributeCode();\n $value = $this->getRequest()->getParam($attributeCode);\n if ($value === null) {\n continue;\n }\n switch ($attributeCode) {\n case 'region_id':\n $regionDataObject->setRegionId($value);\n break;\n case 'region':\n $regionDataObject->setRegion($value);\n break;\n default:\n $addressData[$attributeCode] = $value;\n }\n }\n $addressDataObject = $this->addressDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $addressDataObject,\n $addressData,\n '\\Magento\\Customer\\Api\\Data\\AddressInterface'\n );\n $addressDataObject->setRegion($regionDataObject);\n\n $addressDataObject->setIsDefaultBilling(\n $this->getRequest()->getParam('default_billing', false)\n )->setIsDefaultShipping(\n $this->getRequest()->getParam('default_shipping', false)\n );\n return $addressDataObject;\n }", "public function formExtendModel($model)\n {\n if ($this->action == 'create') {\n $model->address = new LocationAddressModel;\n }\n return $model;\n }", "public function query(UserAddress $model)\n {\n return $model->newQuery();\n }", "public function getBillingAddressModel()\n {\n if (is_null($this->_billingAddressModel)) {\n $object = Mage::getModel('customer/address');\n $this->_billingAddressModel = Mage::objects()->save($object);\n }\n return Mage::objects()->load($this->_billingAddressModel);\n }", "public function getAddr()\n {\n $addr = new Application_Model_Impl_Addr();\n $addr\n ->setId(App_Formatting::emptyToNull($this->addrId->getValue()))\n ->setStreet(App_Formatting::emptyToNull($this->street->getValue()))\n ->setCity(App_Formatting::emptyToNull($this->city->getValue()))\n ->setState(App_Formatting::emptyToNull($this->state->getValue()))\n ->setZip(App_Formatting::emptyToNull($this->zip->getValue()))\n ->setParish(App_Formatting::emptyToNull($this->resideParish->getValue()));\n\n if ($this->_hasAptField) {\n $addr->setApt(App_Formatting::emptyToNull($this->apt->getValue()));\n }\n\n return $addr;\n }", "public static function parseAddress($formatType, $val)\n {\n return new Address();\n }", "public function cassAddress()\n {\n //TODO - Figure out what this is doing\n $address = new UpsAddress();\n $address->setAddressLine1($this->shipping_line1);\n $address->setAddressLine2($this->shipping_line2);\n $address->setCity($this->shipping_city);\n $address->setStateProvinceCode($this->shipping_state);\n $address->setPostalCode($this->shipping_zip);\n\n //todo: Refactor to leverage DI so that we can actually test this.\n $mrtk = new Satori();\n $mrtk->create(0);\n try {\n //Just return a success result if service is down\n $mrtk->connect(config('app.host_config.mailRoomToolKit'), 5150, 5);\n $certifyResponse = $mrtk->certifyAddress($address);\n } catch (Exception $e) {\n (new Log())->logError('Core', 'Could not connect to MRTK');\n // setup success response\n $certifyResponse['status'] = 0;\n $certifyResponse['address'] = $address;\n }\n\n if (intval($certifyResponse['status']) > 100 || in_array($certifyResponse['status'], array(92,93))) {\n throw new Exception($certifyResponse['message']);\n } else {\n $this->shipping_line1 = $certifyResponse['address']->getAddressLine1();\n $this->shipping_line2 = $certifyResponse['address']->getAddressLine2();\n $this->shipping_city = $certifyResponse['address']->getCity();\n $this->shipping_state = $certifyResponse['address']->getStateProvinceCode();\n $this->shipping_zip = $certifyResponse['address']->getPostalCode();\n $this->save();\n }\n }", "public function __construct(\n private string $address,\n private string $type\n ){\n // \n }", "protected function populateContactInformation(ProgramLocation $model)\n {\n if($vendor = data_get($model, 'address.owner') AND $vendor instanceOf Vendor){\n # I imagine we are working on the same model.. right?\n $model->fill([\n 'contact_name' => $vendor->contact_name ?: '' ,\n 'contact_email' => $vendor->contact_email ?: '' ,\n 'contact_phone' => $vendor->contact_phone ?: '' ,\n ]);\n }\n }", "function model()\n {\n return 'Webkul\\Seller\\Models\\OrderAddress';\n }", "public function address($entity, $type = 'billing') {\n\t\tif (!static::hasField(\"{$type}_address_id\")) {\n\t\t\t$message = \"User model has no field `{$type}_address_id`. \";\n\t\t\t$message .= \"You may need to require the ecommerce_core or billing_core library.\";\n\t\t\tthrow new RuntimeException($message);\n\t\t}\n\n\t\tif ($entity->{\"{$type}_address\"}) {\n\t\t\t// Return if directly attached.\n\t\t\treturn $entity->{\"{$type}_address\"};\n\t\t}\n\t\tif (!Libraries::get('base_address')) {\n\t\t\t$message = \"The base_address library is not available. \";\n\t\t\t$message .= \"Require it as a dependency to enable `Users::address()`.\";\n\t\t\tthrow new RuntimeException($message);\n\t\t}\n\t\treturn Addresses::find('first', [\n\t\t\t'conditions' => [\n\t\t\t\t'id' => $entity->{\"{$type}_address_id\"}\n\t\t\t]\n\t\t]) ?: Addresses::create([\n\t\t\t'user_id' => $entity->id,\n\t\t\t'recipient' => $entity->name,\n\t\t\t'country' => $entity->country\n\t\t]);\n\t}", "public function getBillingAddress() : Address;", "public function __construct($address = null, $address2 = null, $birthDate = null, $city = null, $comments = null, $company = null, $completeName = null, $contactType = null, $country = null, array $customFields = array(), $dirty = null, $driversLicenseNumber = null, $email = null, $fax = null, $firstName = null, $gender = null, $homePhone = null, $jobTitle = null, $lastName = null, $middleName = null, $mobilePhone = null, $nameOnCheck = null, $namedOnLease = null, $pager = null, $salutation = null, $searchTag = null, $ssn = null, $state = null, $suffix = null, $webAddress = null, $workPhone = null, $zip = null)\n {\n $this\n ->setAddress($address)\n ->setAddress2($address2)\n ->setBirthDate($birthDate)\n ->setCity($city)\n ->setComments($comments)\n ->setCompany($company)\n ->setCompleteName($completeName)\n ->setContactType($contactType)\n ->setCountry($country)\n ->setCustomFields($customFields)\n ->setDirty($dirty)\n ->setDriversLicenseNumber($driversLicenseNumber)\n ->setEmail($email)\n ->setFax($fax)\n ->setFirstName($firstName)\n ->setGender($gender)\n ->setHomePhone($homePhone)\n ->setJobTitle($jobTitle)\n ->setLastName($lastName)\n ->setMiddleName($middleName)\n ->setMobilePhone($mobilePhone)\n ->setNameOnCheck($nameOnCheck)\n ->setNamedOnLease($namedOnLease)\n ->setPager($pager)\n ->setSalutation($salutation)\n ->setSearchTag($searchTag)\n ->setSsn($ssn)\n ->setState($state)\n ->setSuffix($suffix)\n ->setWebAddress($webAddress)\n ->setWorkPhone($workPhone)\n ->setZip($zip);\n }", "public function collectAddressData()\n {\n try {\n $components = collect($this->response->address_components);\n\n $this->address_data = $components->filter(function ($element) {\n $types = collect($element->types);\n\n return $types->search('street_number') !== false ||\n $types->search('route') !== false ||\n $types->search('locality') !== false ||\n $types->search('administrative_area_level_1') !== false || // province, normalement, short et long form\n $types->search('country') !== false ||\n $types->search('postal_code') !== false;\n })->mapWithKeys(function ($item) {\n return [$item->types[0] => $item->long_name];\n });\n } catch (\\Exception $e) {\n $this->address_data = null;\n }\n\n return $this;\n }", "public function parseAddressesProvider() {}", "public function getAddress() {}", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "public function setAddress($value)\n {\n \t$this->address = $value;\n \treturn $this;\n }", "private function buildAddressFields()\n {\n /**\n * Check if WooCommerce is active\n */\n if (!Local::hasWooCommerce()) {\n return;\n }\n //====================================================================//\n // Customer Full Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company_safe\")\n ->name(\"Customer Fullname\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Company\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company\")\n ->name(__(\"Company\"))\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 1\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_1\")\n ->name(__(\"Address line 1\"))\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 2\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_2\")\n ->name(__(\"Address line 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postOfficeBoxNumber\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address Full\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_full\")\n ->name(__(\"Address line 1 & 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"alternateName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"postcode\")\n ->name(__(\"Postcode / ZIP\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(__(\"City\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country\")\n ->name(__(\"Country\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"state\")\n ->name(__(\"State / County\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Phone Pro\n $this->fieldsFactory()->create(SPL_T_PHONE)\n ->identifier(\"phone\")\n ->name(__(\"Phone\"))\n ->microData(\"http://schema.org/Person\", \"telephone\")\n ->isIndexed()\n ->isReadOnly()\n ;\n }", "public function address() {\n\t\treturn $this->has_one('Address');\n\t}", "function retrieveAddress()\n{\n $usertoken = $_SESSION['usertoken'];\n\n //here is where you can override what the default values were set for your site. If you have a piece of content that\n //should be priced differently, you can set that value here\n $payload = array(\n// 'required_confirmations_override' => 3, //optional, default 0\n// 'amount_override' => 1, //optional\n// 'denomination_override' => 'usd' //optional\n );\n\n //this will return a jsonencoded array with an address, auto created if not found, and payment info if found\n $endpoint = 'https://api.coinbee.io/retrieve/' . $usertoken;\n\n return json_encode(doCurl($endpoint, $payload));\n}", "public function create_model($map) {\n\n $billing_payment_extranet_model = new Billing_Payment_Extranet_Model();\n $billing_payment_extranet_model->populate($map);\n return $billing_payment_extranet_model;\n }", "public function getCounterPartyAddress(): AddressInterface\n {\n return new Address($this->data->counterPartyAddress);\n }", "public function new_address() {\n\t\t$address = new Address();\n\n\t\t/*\n\t\t * Twinfield requires one default address:\n\t\t * \"There has to be one default address.\"\n\t\t */\n\t\tif ( empty( $this->addresses ) ) {\n\t\t\t$address->set_default( true );\n\t\t}\n\n\t\t$this->addresses[] = $address;\n\n\t\treturn $address;\n\t}" ]
[ "0.60683334", "0.5769628", "0.5709196", "0.5638802", "0.56210905", "0.5574394", "0.5570305", "0.5536746", "0.55193716", "0.5398853", "0.53101486", "0.5309378", "0.5290538", "0.52663016", "0.5253676", "0.52383894", "0.52355504", "0.52348", "0.5201772", "0.51940185", "0.5181323", "0.51801044", "0.51229405", "0.5106216", "0.51027024", "0.508374", "0.50834924", "0.5078275", "0.5064039", "0.50635487" ]
0.7080342
0
Build a UPS Cpmpatible Package Object
protected static function buildPackage(IsotopeProductCollection $objCollection) { $Package = new stdClass(); //Packaging Type $PackagingType = new stdClass(); $PackagingType->Code = '02'; //Box for now $PackagingType->Description = ''; $Package->PackagingType = $PackagingType; //Package Dimensions $Dimensions = new stdClass(); $UnitOfMeasurementD = new stdClass(); $UnitOfMeasurementD->Code = 'IN'; $Dimensions->UnitOfMeasurement = $UnitOfMeasurementD; $Dimensions->Length = '12'; $Dimensions->Width = '12'; $Dimensions->Height = '12'; $Package->Dimensions = $Dimensions; //Package Weight $PackageWeight = new stdClass(); $UnitOfMeasurementW = new stdClass(); $UnitOfMeasurementW->Code = 'LBS'; $PackageWeight->UnitOfMeasurement = $UnitOfMeasurementW; $PackageWeight->Weight = '1'; $Package->PackageWeight = $PackageWeight; return $Package; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildPackage()\n {\n list($vendor, $name) = $this->getPackageSegments();\n\n $config = $this->laravel['config']['workbench'];\n\n return new Package($vendor, $name, $config['name'], $config['email']);\n }", "function m_packageBuild()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_MAIN_BLK\", \"main_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAIN_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\tif(!isset($this->request['owner']))\n\t\t{\n\t\t\t$this->request['owner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['type']))\n\t\t{\n\t\t\t$this->request['type']=\"product\";\n\t\t}\n\t\tif(!isset($this->request['otype']))\n\t\t{\n\t\t\t$this->request['otype']=\"department\";\n\t\t}\n\t\tif(!isset($this->request['kitid']))\n\t\t{\n\t\t\t$this->request['kitid']=\"\";\n\t\t}\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OWNER\",$this->request['owner']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$this->request['type']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OTYPE\",$this->request['otype']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"LANG_VAR_BUILDPACKAGE\",LANG_BUILDPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CURRENTPACKAGE\",LANG_CURRENTPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CODE\",LANG_CODE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCT\",LANG_PRODUCTSTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_QTY\",LANG_QTYTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SORT\",LANG_SORT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_REMOVE\",LANG_REMOVE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_HOME\",LANG_HOME);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_ALLORPHAN\",LANG_ALLORPHAN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_RETURNPACK\",LANG_RETURNTOPACK);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_VIEWITEMS\",LANG_VIEWITEMS);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_UPDATEPACKAGE\",LANG_UPDATEPACKAGE);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\t\n\t\t\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t}\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\n\t\t#START DISPLAY PRODUCT BLOCK\n\t\t#IF TYPE IS CONTENT\n\t\tif(isset($this->request['postOwner']))#PRODUCT\n\t\t{#FOR ORPHAN PRODUCT\n\t\t\tif($this->request['postOwner']==\"orphan\")\n\t\t\t{\n\t\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\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\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='\".$this->request['type'].\"'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\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\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t}\n\t\telse#POST OWNER NOT SET\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",\"\");\n\t\t}\n\n\t\t$this->obDb->query=\"SELECT vTitle FROM \".PRODUCTS.\" WHERE iProdId_PK='\".$this->request['kitid'].\"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif(!empty($rs[0]->vTitle))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",$this->libFunc->m_displayContent($rs[0]->vTitle));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",\"\");\n\t\t}\n\t\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$query1 = \"SELECT vSku,vTitle,iProdId_PK,iKitId_PK,iSort,iQty FROM \".PRODUCTS.\", \".PRODUCTKITS.\" WHERE iProdId_PK=iProdId_FK AND iKitId='\".$this->request['kitid'].\"' order by iSort\";\n\t\t$this->obDb->query=$query1;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_QTY\",$queryResult[$j]->iQty);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SORT\",$queryResult[$j]->iSort);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SKU\",$this->libFunc->m_displayContent($queryResult[$j]->vSku));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$str=str_replace(\"'\",\"\\'\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE1\",$str);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_KID\",$queryResult[$j]->iKitId_PK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\n\t\t\t}\n\n\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\tif(empty($this->request['kitid']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"main_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_BUILDPACK);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_ADDTOPACK);\n\t\t}\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "protected function buildPackageNode() {\n\t\t$this->parentNode = $this->node;\n\t\t$this->node = $this->getToken();\n\t\t\n\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_package_installation_node\n\t\t\t\t\t(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)\n\t\t\tVALUES\t\t(?, ?, ?, ?, ?, ?, ?)\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array(\n\t\t\t$this->installation->queue->queueID,\n\t\t\t$this->installation->queue->processNo,\n\t\t\t0,\n\t\t\t$this->node,\n\t\t\t$this->parentNode,\n\t\t\t'package',\n\t\t\t'a:0:{}'\n\t\t));\n\t}", "function createPackage() {\n\n $sql = sprintf(\"INSERT INTO packages_new (name,\n \t\t\t\t\t\t\t\t\t\tprice_per_month,\n \t\t\t\t\t\t\t\t\t\tprice_per_year,\n \t\t\t\t\t\t\t\t\t\tis_agency_or_builder\t\n \t\t\t\t\t\t\t\t\t) VALUES ('%s',\n \t\t\t\t\t\t\t\t\t'%s',\n \t\t\t\t\t\t\t\t\t'%s',\n \t\t\t\t\t\t\t\t\t%d \n )\",\n \t\t\t\t\t\t\t\t\t\t$this->package_name,\n \t\t\t\t\t\t\t\t\t\t$this->price_per_month,\n \t\t\t\t\t\t\t\t\t\t$this->price_per_year,\n \t\t\t\t\t\t\t\t\t\t$this->is_agency_or_builder \t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t);\n $this->conn->setsql($sql);\n $this->package_id = $this->conn->insertDB();\n\n if($this->conn->error) {\n for(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n $this->Error[\"SQL ERROR ClssCmpnCrt-\".$key] = $this->conn->error[$key];\n }\n return false;\n }\n\n \n $sql = sprintf(\"SELECT id FROM supplements_new WHERE in_package = 1 AND is_agency_or_builder = %d \", $this->is_agency_or_builder);\n $this->conn->setsql($sql);\n $this->conn->getTableRows();\n if($this->conn->numberrows > 0 && $this->package_id > 0)\n {\n \tfor ($n=0;$n<$this->conn->numberrows;$n++)\n \t{\n\t\t $sql = sprintf(\"INSERT INTO packages_supliments_new (package_id,\n\t\t \t\t\t\t\t\t\t\t\t \tsuplement_id,\n\t\t \t\t\t\t\t\t\t\t\t \tvalue \t\t\t\t\t\t\t\t\t\t\n\t\t \t\t\t\t\t\t\t\t\t) VALUES (%d,\n\t\t \t\t\t\t\t\t\t\t\t%d,\n\t\t \t\t\t\t\t\t\t\t\t'%s'\n\t\t )\",\n\t\t \t\t\t\t\t\t\t\t\t\t$this->package_id,\n\t\t \t\t\t\t\t\t\t\t\t\t$this->conn->result[$n]['id'],\n\t\t \t\t\t\t\t\t\t\t\t\t'0' \t\t\t\t\t\t\t\t\t\t\n\t\t \t\t\t\t\t\t\t\t\t);\n\t\t $this->conn->setsql($sql);\n\t\t $this->conn->insertDB();\n\t\t\n\t\t if($this->conn->error) {\n\t\t for(reset($this->conn->error); $key = key($this->conn->error); next($this->conn->error)) {\n\t\t $this->Error[\"SQL ERROR ClssCmpnCrt-\".$key] = $this->conn->error[$key];\n\t\t }\n\t\t return false;\n\t\t }\n\t \n \t}\n \t\n }\n\n \n \n \n return true;\n }", "private function packMeta()\n {\n $transport = $this->modx->fromJSON(file_get_contents(__DIR__ . '/../transport.json'));\n unset($transport['support']['db']);\n\n $this->builder->setPackageAttributes([\n 'changelog' => file_get_contents(__DIR__ . '/../meta/changelog.txt'),\n 'license' => file_get_contents(__DIR__ . '/../meta/license.txt'),\n 'readme' => file_get_contents(__DIR__ . '/../meta/readme.txt'),\n 'requires' => $transport['support']\n ]);\n }", "function createPackage() {\n\t\t$package = new ZipArchive();\n\t\t$package->open($this->getPackageFilePath(), ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE);\n\t\tforeach ($this->_files as $fileName => $filePath) {\n\t\t\t$package->addFile($filePath, $fileName);\n\t\t}\n\t\t$package->close();\n\t}", "public function getPackage() {}", "private function makePackage($files, $sword_metadata, $arr, $userid,$assigid ) \n {\n global $CFG,$DB;\n require_once('api/packager_mets_swap.php');\n \n $user=$DB->get_record('user', array('id' => $userid));\n $assignment=$DB->get_record('assignment',array('id'=> $assigid ));\n \n \n // add context metadata \n \n $datos=array(\n \"author\" => $user->firstname . ' '. $user->lastname,\n \"title\" => $assignment->name . ' ' . $user->lastname,\n \"rootin\" => sys_get_temp_dir(), \n \"dirin\" => 'moodle',\n \"rootout\" => sys_get_temp_dir().'/moodle',\n\t\"fileout\" => basename(tempnam(sys_get_temp_dir(), 'sword_').'.zip')\n\t);\n \n $filesdata=array();\n foreach ($files as $file){\n\t $filesdata[] = array (\n\t \"filename\" => $file->get_filename(),\n\t \"mimetype\" => $file->get_mimetype(),\n\t );\n \n }\n \n $datos[\"files\"]=$filesdata;\n \n \n // add default metadata\n \n \n if (($arr!=NULL) && ($sword_metadata->subject != NULL)) { \n $arr[]=$sword_metadata->subject; \n $datos[\"subject\"]=$arr;\n } else {\n if ($arr!=NULL) {\n\t $datos[\"subject\"]=array($arr);\n }\n if ($sword_metadata->subject != NULL) {\n\t $datos[\"subject\"]=array($sword_metadata->subject);\n }\n\t \n }\n \n if($sword_metadata->rights != NULL) {\n $datos[\"rights\"]=$sword_metadata->rights;\n\t error_log(\"hasta aca bien\");\n }\n\telse{\n\t\terror_log(\"no se tomo el campo rights del formulario\");\t\n\t}\n \n if($sword_metadata->language != NULL) {\n $datos[\"language\"]= $sword_metadata->language;\n }\n\telse{\n\t\terror_log(\"no se tomo el campo lenguaje del formulario\");\t\n\t}\n \n if($sword_metadata->publisher != NULL) {\n $datos[\"publisher\"]=$sword_metadata->publisher;\n }\n\t else{\n\t\terror_log(\"no se tomo el campo publicador del formulario\");\t\n\t}\n \n \n $this->makeMets($datos);\n \n return $datos[\"rootout\"].'/'.$datos[\"fileout\"];\n }", "abstract public function getPackage();", "public abstract function build();", "public abstract function build();", "public function __construct($request) {\n\t\tif($request instanceof PENSRequest) {\n\t\t\t$this->_id = 0;\n\t\t\t$this->_pens_version = $request->getPensVersion();\n\t\t\t$this->_package_type = $request->getPackageType();\n\t\t\t$this->_package_type_version = $request->getPackageTypeVersion();\n\t\t\t$this->_package_format = $request->getPackageFormat();\n\t\t\t$this->_package_id = $request->getPackageId();\n\t\t\t$this->_client = $request->getClient();\n\t\t\t$this->_vendor_data = $request->getVendorData();\n\t\t\t$this->_package_name = $request->getFilename();\n\t\t} else if(is_array($request)) {\n\t\t\t$this->_id = $request['id'];\n\t\t\t$this->_pens_version = $request['pens_version'];\n\t\t\t$this->_package_type = $request['package_type'];\n\t\t\t$this->_package_type_version = $request['package_type_version'];\n\t\t\t$this->_package_format = $request['package_format'];\n\t\t\t$this->_package_id = $request['package_id'];\n\t\t\t$this->_client = $request['client'];\n\t\t\t$this->_vendor_data = $request['vendor_data'];\n\t\t\t$this->_package_name = $request['package_name'];\n\t\t\t$this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC'));\n\t\t\tif(!empty($request['updated_at'])) {\n\t\t\t\t$this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC'));\n\t\t\t}\n\t\t}\n\t}", "function preparePool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t\t$this->checkForDistributionSpecificPackageFunction('PKG_preparePool', $I18N_distrHasNoFunctionForPreparingAPool);\n\t\n\t\t// Check, if there are errors (some can be generated by set functions)\n\t\tif (!$this->hasErrors())\n\t\t{\n\t\t\tPKG_preparePool($this->getPoolRelease(), $this->getPoolDistribution(), $this->getPoolArch(), $this->getPoolName(), $this->getPoolDir());\n\t\t\treturn(true);\n\t\t}\n\t\telse\n\t\t\treturn(false);\n\t}", "public function generate()\n {\n $PMRequest = null;\n\n if (!empty($this->configHipay[\"payment\"][\"local_payment\"][$this->params[\"method\"]][\"additionalFields\"])) {\n $sdkClass = $this->configHipay[\"payment\"][\"local_payment\"][$this->params[\"method\"]][\"additionalFields\"][\"sdkClass\"];\n $PMRequest = new $sdkClass();\n\n $this->mapRequest($PMRequest);\n }\n return $PMRequest;\n }", "public function package()\n\t{\n\t\t\n\t}", "abstract public function build();", "abstract public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "abstract function build();", "public function create( $user_id, $author_id ) {\n\t\t\n\t\t$this->publish_date = current_time('mysql', 1);\n\t\t\n\t\t// create new package\n\t\t$db_res = $this->db->insert(\n\t\t\t$this->db->prefix . 'pvmkit_packages', \n\t\t\tarray( \n\t\t\t\t'viewcount' => 0,\n\t\t\t\t'title' => '',\n\t\t\t\t'status' => 1,\n\t\t\t\t'publish_date' => $this->publish_date,\n\t\t\t\t'author' => $author_id,\n\t\t\t\t'user_id' => $user_id\n\t\t\t), \n\t\t\tarray( '%d', '%s', '%d', '%s', '%d' ) \n\t\t);\n\t\t\n\t\t$this->id = $this->db->insert_id;\n\t\t$this->title = '';\n\t\t$this->status = 1;\n\t\t$this->author = new pvmkit_author();\n\t\t$this->author->load_by_author_id( $author_id );\n\t\t$this->user_id = $user_id;\n\t\t\n\t\t// create the text\n\t\t$this->text = new pvmkit_object_text();\n\t\t$this->text->set( (int) $author_id, '' );\n\t\t\n\t\t$this->db->insert(\n\t\t\t$this->db->prefix . 'pvmkit_package_components', \n\t\t\tarray( \n\t\t\t\t'package_id' => $this->id,\n\t\t\t\t'object_id' => $this->text->get_object_id(),\n\t\t\t\t'type' => 'text'\n\t\t\t), \n\t\t\tarray( '%d', '%d', '%s' ) \n\t\t);\n\t\t\n\t\t$this->titleimage = new pvmkit_object_titleimage();\n\t\t$this->image = new pvmkit_object_image();\n\n\t}", "public function build() {}", "public function build() {}", "public function build() {}", "public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}" ]
[ "0.6377547", "0.6184859", "0.5584275", "0.5381355", "0.5377361", "0.52715945", "0.5143979", "0.5140734", "0.5086275", "0.50410455", "0.50410455", "0.5027975", "0.50092715", "0.5007718", "0.49970028", "0.49946192", "0.49946192", "0.49729356", "0.49729356", "0.49729356", "0.49729356", "0.49729356", "0.49729356", "0.49729356", "0.49573737", "0.49302742", "0.48926154", "0.48921812", "0.48921812", "0.4868264" ]
0.6261453
1
Read the post from OKPAY and add 'ok_verify'
public function verify_notification($post) { $request = 'ok_verify=true'; foreach ($post as $key => $value) { $value = urlencode(stripslashes($value)); $request .= "&$key=$value"; } $fsocket = false; $result = false; // Try to connect via SSL due sucurity reason if ($fp = @fsockopen('ssl://www.okpay.com', 443, $errno, $errstr, 30)) { $fsocket = true; } elseif ($fp = @fsockopen('www.okpay.com', 80, $errno, $errstr, 30)) { $fsocket = true; } if ($fsocket == true) { $header = 'POST /ipn-verify.html HTTP/1.0' . "\r\n" . 'Host: www.okpay.com'."\r\n" . 'Content-Type: application/x-www-form-urlencoded' . "\r\n" . 'Content-Length: ' . strlen($request) . "\r\n" . 'Connection: close' . "\r\n\r\n"; @fputs($fp, $header . $request); $string = ''; while (!@feof($fp)) { $res = @fgets($fp, 1024); $string .= $res; // Find verification result in response if ($res == 'VERIFIED' || $res == 'INVALID' || $res == 'TEST') { $result = $res; break; } } @fclose($fp); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "public function verify($params = array())\r\n {\r\n $returnURL = \"http://localhost\"; \r\n $cancelURL = \"http://localhost\"; \r\n $currencyCode = \"USD\";\r\n $startingDate = \"2011-02-24T13:00:00\"; \r\n $endingDate = \"2011-02-28T13:00:00\"; \r\n $maxTotalAmountOfAllPayments = \"2000\"; \r\n $senderEmail = \"\"; \r\n $maxNumberOfPayments = \"\"; \r\n // NO_PERIOD_SPECIFIED\r\n // DAILY - each day\r\n // WEEKLY - each week\r\n // BIWEEKLY - every other week\r\n // SEMIMONTHLY - twice a month\r\n // MONTHLY - each month\r\n // ANNUALLY - each year \r\n $paymentPeriod = \"\"; \r\n \r\n $dateOfMonth = \"\"; \r\n $dayOfWeek = \"\";\r\n $maxAmountPerPayment = \"\"; \r\n $maxNumberOfPaymentsPerPeriod = \"\"; \r\n $pinType = \"\"; \r\n $resArray = $this->CallPreapproval ($returnURL, $cancelURL, $currencyCode, $startingDate, $endingDate, $maxTotalAmountOfAllPayments,\r\n $senderEmail, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, $dayOfWeek,\r\n $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType\r\n );\r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n if($ack==\"SUCCESS\")\r\n {\r\n $this->preapprovalKey = $resArray[\"preapprovalKey\"];\r\n $cmd = \"cmd=_ap-preapproval&preapprovalkey=\" . urldecode($resArray[\"preapprovalKey\"]);\r\n $this->Redirect( $cmd );\r\n //return $resArray[\"preapprovalKey\"];\r\n } \r\n else \r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('verify Error : '. $this->errors);\r\n return false;\r\n }\r\n }", "public function testVerifyUsingPOST()\n {\n\n }", "function PPHttpPost($methodName_, $nvpStr_) \n\t{\n\t\tglobal $environment;\n\t\t$API_UserName = urlencode('fhefoto_api1.yahoo.no');\n\t\t$API_Password = urlencode('N6SEDXLJKPN6PPWY');\n\t\t$API_Signature = urlencode('AlVtORxlymlrQpGY-fnzOdIuxvT1A2nTmy.LlXvPkOP5oU0VdZitgeEV');\n\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\n\t\treturn $httpParsedResponseAr;\n\t}", "function check_bocpay_response() {\n\n if (empty($_POST['notifyMsg'])) {\n wp_die(\"Invalid Requirements\");\n }\n $notifyMsg = $_POST['notifyMsg'];\n\n $fp = @stream_socket_client($this->sock_url, $errno, $errstr, 30);\n $retMsg=\"\";\n $tranCode = \"cb2200_verify\";\n\n if (!$fp) {\n $this->log->add('bocpay', \"code: 999999\\tmessage: $notifyMsg\");\n wp_die(\"Invalid FP\");\n } else {\n $in = \"<?xml version='1.0' encoding='UTF-8'?>\";\n $in .= \"<Message>\";\n $in .= \"<TranCode>\".$tranCode.\"</TranCode>\";\n $in .= \"<merchantID>\".$this->merchantID.\"</merchantID>\";\n $in .= \"<MsgContent>\".$notifyMsg.\"</MsgContent>\";\n $in .= \"</Message>\";\n fwrite($fp, $in);\n while (!feof($fp)) {\n $retMsg = $retMsg.fgets($fp, 1024);\n }\n fclose($fp);\n }\n\n $dom = new DOMDocument;\n @$dom->loadXML($retMsg);\n $retCode = $dom->getElementsByTagName('retCode');\n $retCode_value = $retCode->item(0)->nodeValue;\n \n $errMsg = $dom->getElementsByTagName('errMsg');\n $errMsg_value = $errMsg->item(0)->nodeValue;\n\n if ($retCode_value!='0'){\n $this->log->add('bocpay', \"code: retCode_value\\tmessage: $notifyMsg\");\n wp_die('Invalid Code');\n }\n\n $sources = explode('|', $notifyMsg);\n if ($sources[9]!='1'){\n $this->log->add('bocpay', \"code: 999998\\tmessage: $notifyMsg\");\n wp_die('Payment Failure');\n }\n\n $order_id = $sources[5];\n $order = new WC_Order($order_id);\n if( $order->status != 'completed'){\n $order->payment_complete();\n $order->add_order_note ('支付成功');\n update_post_meta( $order_id, 'Bocpay Trade No.', wc_clean( $sources[8] ) );\n $this->log->add('bocpay', \"code: 000000\\tmessage: \".$notifyMsg);\n echo \"Success\";\n exit;\n }\n\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "public function settings_verify()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n $timestamp = intval(rcube_utils::get_input_value('_timestamp', rcube_utils::INPUT_POST));\n $success = false;\n\n if ($driver = $this->get_driver($method)) {\n $data = @json_decode(rcube_utils::get_input_value('_data', rcube_utils::INPUT_POST), true);\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n if ($value !== '******') {\n $driver->$key = $value;\n }\n }\n }\n\n $success = $driver->verify(rcube_utils::get_input_value('_code', rcube_utils::INPUT_POST), $timestamp);\n $method = $driver->method;\n }\n\n // put session into high-security mode\n if ($success && !empty($_POST['_session'])) {\n $_SESSION['kolab_2fa_secure_mode'] = time();\n }\n\n $this->api->output->command('plugin.verify_response', array(\n 'method' => $method,\n 'success' => $success,\n 'message' => str_replace('$method', $this->gettext($method),\n $this->gettext($success ? 'codeverificationpassed' : 'codeverificationfailed'))\n ));\n\n $this->api->output->send();\n }", "public function actionCheck($param)\n {\n\n /*$json = json_decode($data);\n echo $json->tls_version.'<br />';\n //$curl_info = curl_version();\n //echo $curl_info['ssl_version'];\n printf(\"0x%x\\n\", OPENSSL_VERSION_NUMBER);*/\n\n define(\"LOG_FILE\", __DIR__.\"/Paypal.log\");\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 $req = 'cmd=_notify-validate';\n if(function_exists('get_magic_quotes_gpc')) {\n \t$get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n \t$value = $get_magic_quotes_exists && get_magic_quotes_gpc() == 1\n ? urlencode(stripslashes($value))\n : urlencode($value);\n $req .= \"&$key=$value\";\n }\n $paypal_url = $this->settings->paypal_demo ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';\n $ch = curl_init($paypal_url);\n if ($ch == false) {\n \tdie('no curl init');\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_SSLVERSION, 6);\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 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n $res = curl_exec($ch);\n if (curl_errno($ch) != 0) {\n $error = curl_error($ch);\n \t//error_log(date('[Y-m-d H:i e] '). \"Can't connect to PayPal to validate IPN message: \" . $error . PHP_EOL, 3, LOG_FILE);\n \tcurl_close($ch);\n \tdie($error);\n } else {\n\t\tif(DEBUG == true) {\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL, 3, LOG_FILE);\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP response of validation request: $res\" . PHP_EOL, 3, LOG_FILE);\n\t\t}\n\t\tcurl_close($ch);\n }\n $tokens = explode(\"\\r\\n\\r\\n\", trim($res));\n $res = trim(end($tokens));\n if (strcmp($res, \"VERIFIED\") == 0) {\n if($param->receiver_email == '' || $param->receiver_email != $this->settings->paypal_email\n || !$param->Exists('item_number', true) || $param->mc_currency != 'USD') {\n //error_log('Error 1'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n $this->_table->current = $param->item_number;\n if($this->_table->id != $param->item_number || $this->_table->status != 0\n || (float)$param->mc_gross != (float)$this->_table->sum) {\n //error_log('Error 2'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n if(strtolower($param->payment_status) == 'completed') {\n $this->_table->status = 2;\n $this->_table->message = $param->txn_id;\n $this->_table->date_payed = date(\"Y-m-d H:m:i\");\n $this->_table->Save();\n //error_log(date('[Y-m-d H:i e] '). \"Verified IPN: $req \". PHP_EOL, 3, LOG_FILE);\n die('ok');\n } else {\n //error_log(date('[Y-m-d H:i e] '). \"Status: \".$param->payment_status.PHP_EOL, 3, LOG_FILE);\n }\n } else if (strcmp ($res, \"INVALID\") == 0) {\n \t//error_log(date('[Y-m-d H:i e] '). \"Invalid IPN: $req\" . PHP_EOL, 3, LOG_FILE);\n }\n die('error');\n }", "function pay_fields() {\n\t\t// define(APPKEY ,\"2Wozy2aksie1puXUBpWD8oZxiD1DfQuEaiC7KcRATv1Ino3mdopKaPGQQ7TtkNySuAmCaDCrw4xhPY5qKTBl7Fzm0RgR3c0WaVYIXZARsxzHV2x7iwPPzOz94dnwPWSn\"); //paysign key\n\t\t// define(SIGNTYPE, \"sha1\"); //method\n\t\t// define(PARTNERKEY,\"8934e7d15453e97507ef794cf7b0519d\");//通加密串\n\t\t// define(APPSERCERT, \"09cb46090e586c724d52f7ec9e60c9f8\");\n\t\treturn array (\n\t\t\t\t'APPID' => array (\n\t\t\t\t\t\t'title' => 'APPID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信公众号身份的唯一标识。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'MCHID' => array (\n\t\t\t\t\t\t'title' => 'MCHID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '受理商ID,身份标识' \n\t\t\t\t),\n\t\t\t\t'KEY' => array (\n\t\t\t\t\t\t'title' => 'KEY:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '商户支付密钥Key。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'APPSECRET' => array (\n\t\t\t\t\t\t'title' => 'APPSECRET:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => 'JSAPI接口中获取openid,审核后在公众平台开启开发模式后可查看' \n\t\t\t\t),\n\t\t\t\t'NOTIFY_URL' => array (\n\t\t\t\t\t\t'title' => 'NOTIFY_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '异步通知url,商户根据实际开发过程设定' \n\t\t\t\t),\n\t\t\t\t'JS_API_CALL_URL' => array (\n\t\t\t\t\t\t'title' => 'JS_API_CALL_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '获取access_token过程中的跳转uri,通过跳转将code传入jsapi支付页面' \n\t\t\t\t),\n\t\t\t\t'WEIXIN_PAY_UNIT' => array (\n\t\t\t\t\t\t'title' => 'WEIXIN_PAY_UNIT:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信支付单位,100为元 ,10为角,1为分' \n\t\t\t\t),\n\t\t\t\t'SUCCESS_URL' => array (\n\t\t\t\t\t\t'title' => 'SUCCESS_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '支付成功跳转页面' \n\t\t\t\t),\n\t\t);\n\t}", "public static function check_mondido_response() {\r\n $_GET = stripslashes_deep($_GET);\r\n $expected_fields = array(\r\n \"hash\",\r\n \"payment_ref\",\r\n \"transaction_id\"\r\n );\r\n\r\n foreach($expected_fields as $field){\r\n if(!isset($_GET[$field])) return;\r\n }\r\n\r\n do_action(\"valid-mondido-callcack\", $_GET);\r\n }", "private function readIPN()\n\t{\n\t\t$raw_post_data = file_get_contents('php://input');\n\t\t$raw_post_array = explode('&', $raw_post_data);\n\n\t\t$myPost = array();\n\t\tforeach($raw_post_array as $keyval)\n\t\t{\n\t\t\t$keyval = explode('=', $keyval);\n\t\t\tif(count($keyval) == 2)\n\t\t\t{\n\t\t\t\t$myPost[$keyval[0]] = urldecode($keyval[1]);\n\t\t\t}\n\t\t}\n\n\t\t// Read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'.\n\t\t$req = 'cmd=_notify-validate';\n\n\t\tif(function_exists('get_magic_quotes_gpc'))\n\t\t{\n\t\t\t$get_magic_quotes_exists = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$get_magic_quotes_exists = false;\n\t\t}\n\n\t\tforeach($myPost as $key => $value)\n\t\t{\n\t\t\tif($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n\t\t\t{\n\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = urlencode($value);\n\t\t\t}\n\t\t\t$req .= \"&$key=$value\";\n\t\t}\n\n\t\treturn $req;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function PPHttpPost($methodName_, $nvpStr_, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode) {\n $API_UserName = urlencode($PayPalApiUsername);\n $API_Password = urlencode($PayPalApiPassword);\n $API_Signature = urlencode($PayPalApiSignature);\n\n $paypalmode = ($PayPalMode == 'sandbox') ? '.sandbox' : '';\n\n $API_Endpoint = \"https://api-3t\" . $paypalmode . \".paypal.com/nvp\";\n $version = urlencode('109.0');\n\n // Set the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // Turn off the server and peer verification (TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n // Set the API operation, version, and API signature in the request.\n $nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n // Set the request as a POST FIELD for curl.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Get response from the server.\n $httpResponse = curl_exec($ch);\n\n if (!$httpResponse) {\n exit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n }\n\n // Extract the response details.\n $httpResponseAr = explode(\"&\", $httpResponse);\n\n $httpParsedResponseAr = array();\n foreach ($httpResponseAr as $i => $value) {\n $tmpAr = explode(\"=\", $value);\n if (sizeof($tmpAr) > 1) {\n $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n }\n }\n\n if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n exit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n }\n\n return $httpParsedResponseAr;\n }", "public static function authnet_sp_checkout ()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!empty($_POST[\"s2member_pro_authnet_sp_checkout\"][\"nonce\"]) && ($nonce = $_POST[\"s2member_pro_authnet_sp_checkout\"][\"nonce\"]) && wp_verify_nonce ($nonce, \"s2member-pro-authnet-sp-checkout\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$GLOBALS[\"ws_plugin__s2member_pro_authnet_sp_checkout_response\"] = array(); // This holds the global response details.\n\t\t\t\t\t\t\t\t$global_response = &$GLOBALS[\"ws_plugin__s2member_pro_authnet_sp_checkout_response\"]; // This is a shorter reference.\n\n\t\t\t\t\t\t\t\t$post_vars = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($_POST[\"s2member_pro_authnet_sp_checkout\"]));\n\t\t\t\t\t\t\t\t$post_vars[\"attr\"] = (!empty($post_vars[\"attr\"])) ? (array)unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($post_vars[\"attr\"])) : array();\n\t\t\t\t\t\t\t\t$post_vars[\"attr\"] = apply_filters(\"ws_plugin__s2member_pro_authnet_sp_checkout_post_attr\", $post_vars[\"attr\"], get_defined_vars ());\n\n\t\t\t\t\t\t\t\t$post_vars[\"name\"] = trim ($post_vars[\"first_name\"] . \" \" . $post_vars[\"last_name\"]);\n\t\t\t\t\t\t\t\t$post_vars[\"email\"] = apply_filters(\"user_registration_email\", sanitize_email ($post_vars[\"email\"]), get_defined_vars ());\n\n\t\t\t\t\t\t\t\tif(empty($post_vars[\"card_expiration\"]) && isset($post_vars[\"card_expiration_month\"], $post_vars[\"card_expiration_year\"]))\n\t\t\t\t\t\t\t\t\t$post_vars[\"card_expiration\"] = $post_vars[\"card_expiration_month\"].\"/\".$post_vars[\"card_expiration_year\"];\n\n\t\t\t\t\t\t\t\t$post_vars = c_ws_plugin__s2member_utils_captchas::recaptcha_post_vars($post_vars); // Collect reCAPTCHA™ post vars.\n\n\t\t\t\t\t\t\t\tif (!c_ws_plugin__s2member_pro_authnet_responses::authnet_form_attr_validation_errors ($post_vars[\"attr\"])) // Attr errors?\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (!($error = c_ws_plugin__s2member_pro_authnet_responses::authnet_form_submission_validation_errors (\"sp-checkout\", $post_vars)))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$cp_attr = c_ws_plugin__s2member_pro_authnet_utilities::authnet_apply_coupon ($post_vars[\"attr\"], $post_vars[\"coupon\"], \"attr\", array(\"affiliates-silent-post\"));\n\t\t\t\t\t\t\t\t\t\t\t\t$cost_calculations = c_ws_plugin__s2member_pro_authnet_utilities::authnet_cost (null, $cp_attr[\"ra\"], $post_vars[\"state\"], $post_vars[\"country\"], $post_vars[\"zip\"], $cp_attr[\"cc\"], $cp_attr[\"desc\"]);\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (!($authnet = array())) // Direct payments.\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_type\"] = \"AUTH_CAPTURE\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_method\"] = \"CC\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_email\"] = $post_vars[\"email\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_first_name\"] = $post_vars[\"first_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_last_name\"] = $post_vars[\"last_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_customer_ip\"] = c_ws_plugin__s2member_utils_ip::current();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_invoice_num\"] = \"s2-\" . uniqid ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_description\"] = $cost_calculations[\"desc\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"s2_invoice\"] = $post_vars[\"attr\"][\"sp_ids_exp\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"s2_custom\"] = $post_vars[\"attr\"][\"custom\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_tax\"] = $cost_calculations[\"tax\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_amount\"] = $cost_calculations[\"total\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_currency_code\"] = $cost_calculations[\"cur\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_card_num\"] = preg_replace (\"/[^0-9]/\", \"\", $post_vars[\"card_number\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_exp_date\"] = c_ws_plugin__s2member_pro_authnet_utilities::authnet_exp_date ($post_vars[\"card_expiration\"], 'aim');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_card_code\"] = $post_vars[\"card_verification\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#if (in_array($post_vars[\"card_type\"], array(\"Maestro\", \"Solo\")))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\tif (preg_match (\"/^[0-9]{2}\\/[0-9]{4}$/\", $post_vars[\"card_start_date_issue_number\"]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\t\t$authnet[\"x_card_start_date\"] = preg_replace (\"/[^0-9]/\", \"\", $post_vars[\"card_start_date_issue_number\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\telse // Otherwise, we assume they provided an issue number instead.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\t\t$authnet[\"x_card_issue_number\"] = $post_vars[\"card_start_date_issue_number\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_address\"] = $post_vars[\"street\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_city\"] = $post_vars[\"city\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_state\"] = $post_vars[\"state\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_country\"] = $post_vars[\"country\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_zip\"] = $post_vars[\"zip\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif ($cost_calculations[\"total\"] <= 0 || (($authnet = c_ws_plugin__s2member_pro_authnet_utilities::authnet_aim_response ($authnet)) && empty($authnet[\"__error\"])))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($cost_calculations[\"total\"] <= 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new__txn_id = strtoupper('free-'.uniqid()); // Auto-generated value in this case.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $new__txn_id = $authnet[\"transaction_id\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!($ipn = array())) // Simulated PayPal IPN.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"txn_type\"] = \"web_accept\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"txn_id\"] = $new__txn_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"custom\"] = $post_vars[\"attr\"][\"custom\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"mc_gross\"] = $cost_calculations[\"total\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"mc_currency\"] = $cost_calculations[\"cur\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"tax\"] = $cost_calculations[\"tax\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"payer_email\"] = $post_vars[\"email\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"first_name\"] = $post_vars[\"first_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"last_name\"] = $post_vars[\"last_name\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_user_logged_in () && // Reference a User/Member?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id ()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name1\"] = \"Referencing Customer ID\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection1\"] = $referencing;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse // Otherwise, default to the originating domain.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name1\"] = \"Originating Domain\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection1\"] = $_SERVER[\"HTTP_HOST\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name2\"] = \"Customer IP Address\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection2\"] = c_ws_plugin__s2member_utils_ip::current();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"item_name\"] = $cost_calculations[\"desc\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"item_number\"] = $post_vars[\"attr\"][\"sp_ids_exp\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy\"] = \"authnet\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_use\"] = \"pro-emails\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_coupon\"] = array(\"coupon_code\" => $cp_attr[\"_coupon_code\"], \"full_coupon_code\" => $cp_attr[\"_full_coupon_code\"], \"affiliate_id\" => $cp_attr[\"_coupon_affiliate_id\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_verification\"] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_return_url\"] = $post_vars[\"attr\"][\"success\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_authnet_proxy_return_url\"] = trim (c_ws_plugin__s2member_utils_urls::remote (home_url (\"/?s2member_paypal_notify=1\"), $ipn, array(\"timeout\" => 20)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (($sp_access_url = c_ws_plugin__s2member_sp_access::sp_access_link_gen ($post_vars[\"attr\"][\"ids\"], $post_vars[\"attr\"][\"exp\"])))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetcookie (\"s2member_sp_tracking\", ($s2member_sp_tracking = c_ws_plugin__s2member_utils_encryption::encrypt ($new__txn_id)), time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie (\"s2member_sp_tracking\", $s2member_sp_tracking, time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE[\"s2member_sp_tracking\"] = $s2member_sp_tracking);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => sprintf (_x ('<strong>Thank you.</strong> Your purchase has been approved.<br />&mdash; Please <a href=\"%s\" rel=\"nofollow\">click here</a> to proceed.', \"s2member-front\", \"s2member\"), esc_attr ($sp_access_url)));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($post_vars[\"attr\"][\"success\"]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& (substr($ipn['s2member_authnet_proxy_return_url'], 0, 2) === substr($post_vars['attr']['success'], 0, 2) || stripos($ipn['s2member_authnet_proxy_return_url'], 'http') === 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& ($custom_success_url = str_ireplace (array(\"%%s_response%%\", /* Deprecated in v111106 ». */ \"%%response%%\"), array(urlencode (c_ws_plugin__s2member_utils_encryption::encrypt ($global_response[\"response\"])), urlencode ($global_response[\"response\"])), $ipn[\"s2member_authnet_proxy_return_url\"]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& ($custom_success_url = trim (preg_replace (\"/%%(.+?)%%/i\", \"\", $custom_success_url)))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_redirect($post_vars['attr']['success'] === '%%sp_access_url%%' ? $custom_success_url : c_ws_plugin__s2member_utils_urls::add_s2member_sig ($custom_success_url, \"s2p-v\")) . exit ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse // Else, unable to generate Access Link.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => _x ('<strong>Oops.</strong> Unable to generate Access Link. Please contact Support for assistance.', \"s2member-front\", \"s2member\"), \"error\" => true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse // Else, an error.\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => $authnet[\"__error\"], \"error\" => true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse // Else, an error.\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$global_response = $error;\n\t\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\t\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\n\t\n\t\t// Set up your API credentials, PayPal end point, and API version.\n\t\t$API_UserName = urlencode('eshop_1309605309_biz_api1.gmail.com');\n\t\t$API_Password = urlencode('1309605353');\n\t\t$API_Signature = urlencode('AiPC9BjkCyDFQXbSkoZcgqH3hpacA4TlLrMdwUVOcGq8BK4tNk9Rdji5');\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t\t\n\t\t$version = urlencode('51.0');\n\t\n\t\t// Set the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t// Turn off the server and peer verification (TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\n\t\t// Set the API operation, version, and API signature in the request.\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\t\t// Set the request as a POST FIELD for curl.\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\n\t\t// Get response from the server.\n\t\t$httpResponse = curl_exec($ch);\n\t\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\t\n\t\t// Extract the response details.\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\t\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\t\n\t\treturn $httpParsedResponseAr;\n\t}", "function PPHttpPost($url_, $postFields_, $parsed_)\n\t{\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$url_);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$postFields_);\n\n\t\t//getting response from server\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\treturn array(\"status\" => false, \"error_msg\" => curl_error($ch), \"error_no\" => curl_errno($ch));\n\t\t}\n\n\t\tif(!$parsed_) {\n\t\t\treturn array(\"status\" => true, \"httpResponse\" => $httpResponse);\n\t\t}\n\n\t\t$httpResponseAr = explode(\"\\n\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif(0 == sizeof($httpParsedResponseAr)) {\n\t\t\t$error = \"Invalid HTTP Response for POST request($postFields_) to $url_.\";\n\t\t\treturn array(\"status\" => false, \"error_msg\" => $error, \"error_no\" => 0);\n\t\t}\n\t\treturn array(\"status\" => true, \"httpParsedResponseAr\" => $httpParsedResponseAr);\n\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\t\t\tglobal $gateway_environment;\n\t\t\t$environment = $gateway_environment;\n\n\t\t\t$API_UserName = pmpro_getOption(\"apiusername\");\n\t\t\t$API_Password = pmpro_getOption(\"apipassword\");\n\t\t\t$API_Signature = pmpro_getOption(\"apisignature\");\n\t\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t\t}\n\n\t\t\t$version = urlencode('72.0');\n\n\t\t\t//NVPRequest for submitting to server\n\t\t\t$nvpreq = \"METHOD=\" . urlencode($methodName_) . \"&VERSION=\" . urlencode($version) . \"&PWD=\" . urlencode($API_Password) . \"&USER=\" . urlencode($API_UserName) . \"&SIGNATURE=\" . urlencode($API_Signature) . \"&BUTTONSOURCE=\" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;\n\n\t\t\t//post to PayPal\n\t\t\t$response = wp_remote_post( $API_Endpoint, array(\n\t\t\t\t\t'timeout' => 60,\n\t\t\t\t\t'sslverify' => FALSE,\n\t\t\t\t\t'httpversion' => '1.1',\n\t\t\t\t\t'body' => $nvpreq\n\t\t\t )\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t $error_message = $response->get_error_message();\n\t\t\t die( \"methodName_ failed: $error_message\" );\n\t\t\t} else {\n\t\t\t\t//extract the response details\n\t\t\t\t$httpParsedResponseAr = array();\n\t\t\t\tparse_str(wp_remote_retrieve_body($response), $httpParsedResponseAr);\n\n\t\t\t\t//check for valid response\n\t\t\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $httpParsedResponseAr;\n\t\t}", "function ipn()\r\n {\r\n $paypalInfo = $this->input->post(); \r\n\t\t $order_id= $paypalinfo['custom'];\r\n\t\t $payment_status=$paypalinfo['payment_status'];\r\n $paypalURL = $this->paypal_lib->paypal_url; \r\n $result = $this->paypal_lib->curlPost($paypalURL,$paypalInfo); \r\n //check whether the payment is verified\r\n if(preg_match(\"/VERIFIED/\",$result)){\r\n //insert the transaction data into the database\r\n $this->Order_model->insertTransaction($paypalInfo); \r\n }\r\n }", "function _postPayment( $data )\n {\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n\t\t\n\t\tif ($vars->inline_creditcard_form == 1) \n\t\t{\n\t\t\t$data = $this->_getInlinePaymentResponse($data);\n\t\t\t$result = $data['ssl_result'];\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// Process the payment\n\t\t\t$result = JFactory::getApplication()->input->getString('ssl_result');\n\t\t}\n\n $vars = new JObject();\n\n switch ($result)\n {\n case \"0\":\n \t$errors = $this->_process( $data );\n\n \t// No errors\n \tif($errors == '')\n \t{\n\t $vars->message = JText::_('VIRTUALMERCHANT PAYMENT OK');\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n \t// Errors\n \telse\n \t{\n \t\t$vars->message = $errors;\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n break;\n default:\n case \"1\":\n $vars->message = JText::_('VIRTUALMERCHANT PAYMENT FAILED').': '.$data['ssl_result_message'];\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n break;\n }\n\n return $html;\n }", "function before_process() {\r\n global $response, $db, $order, $messageStack;\r\n\r\n $order->info['cc_owner'] = zen_db_prepare_input($_POST['bank_acct_name']);\r\n $order->info['cc_type'] = 'eCheck';\r\n $order->info['cc_number'] = zen_db_prepare_input($_POST['bank_aba_code'] . '-' . str_pad(substr($_POST['bank_acct_num'], -4), strlen($_POST['bank_acct_num']), \"X\", STR_PAD_LEFT));\r\n $sessID = zen_session_id();\r\n\r\n // DATA PREPARATION SECTION\r\n unset($submit_data); // Cleans out any previous data stored in the variable\r\n\r\n // Create a string that contains a listing of products ordered for the description field\r\n $description = '';\r\n for ($i=0; $i<sizeof($order->products); $i++) {\r\n $description .= $order->products[$i]['name'] . ' (qty: ' . $order->products[$i]['qty'] . ') + ';\r\n }\r\n // Remove the last \"\\n\" from the string\r\n $description = substr($description, 0, -2);\r\n\r\n // Create a variable that holds the order time\r\n $order_time = date(\"F j, Y, g:i a\");\r\n\r\n // Calculate the next expected order id\r\n $last_order_id = $db->Execute(\"select * from \" . TABLE_ORDERS . \" order by orders_id desc limit 1\");\r\n $new_order_id = $last_order_id->fields['orders_id'];\r\n $new_order_id = ($new_order_id + 1);\r\n $new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6);\r\n\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n $submit_data = array(\r\n 'x_login' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN),\r\n 'x_tran_key' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY), \r\n 'x_relay_response' => 'FALSE', // AIM uses direct response, not relay response\r\n 'x_delim_data' => 'TRUE',\r\n 'x_delim_char' => $this->delimiter, // The default delimiter is a comma\r\n 'x_encap_char' => $this->encapChar, // The divider to encapsulate response fields\r\n 'x_version' => '3.1', // 3.1 is required to use CVV codes\r\n 'x_type' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',\r\n 'x_amount' => number_format($order->info['total'], 2),\r\n 'x_currency_code' => $order->info['currency'],\r\n 'x_method' => 'ECHECK',\r\n 'x_bank_aba_code' => $_POST['bank_aba_code'],\r\n 'x_bank_acct_num' => $_POST['bank_acct_num'],\r\n 'x_bank_acct_type' => $_POST['bank_acct_type'],\r\n 'x_bank_name' => $_POST['bank_name'],\r\n 'x_bank_acct_name' => $_POST['bank_acct_name'],\r\n 'x_echeck_type' => 'WEB',\r\n 'x_recurring_billing' => 'NO',\r\n 'x_email_customer' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',\r\n 'x_email_merchant' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',\r\n 'x_cust_id' => $_SESSION['customer_id'],\r\n 'x_invoice_num' => (MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE == 'Test' ? 'TEST-' : '') . $new_order_id,\r\n 'x_first_name' => $order->billing['firstname'],\r\n 'x_last_name' => $order->billing['lastname'],\r\n 'x_company' => $order->billing['company'],\r\n 'x_address' => $order->billing['street_address'],\r\n 'x_city' => $order->billing['city'],\r\n 'x_state' => $order->billing['state'],\r\n 'x_zip' => $order->billing['postcode'],\r\n 'x_country' => $order->billing['country']['title'],\r\n 'x_phone' => $order->customer['telephone'],\r\n 'x_email' => $order->customer['email_address'],\r\n 'x_ship_to_first_name' => $order->delivery['firstname'],\r\n 'x_ship_to_last_name' => $order->delivery['lastname'],\r\n 'x_ship_to_address' => $order->delivery['street_address'],\r\n 'x_ship_to_city' => $order->delivery['city'],\r\n 'x_ship_to_state' => $order->delivery['state'],\r\n 'x_ship_to_zip' => $order->delivery['postcode'],\r\n 'x_ship_to_country' => $order->delivery['country']['title'],\r\n 'x_description' => $description,\r\n 'x_customer_ip' => zen_get_ip_address(),\r\n 'x_po_num' => date('M-d-Y h:i:s'), //$order->info['po_number'],\r\n 'x_freight' => number_format((float)$order->info['shipping_cost'],2),\r\n 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n 'x_tax' => number_format((float)$order->info['tax'],2),\r\n 'x_duty' => '0',\r\n\r\n // Additional Merchant-defined variables go here\r\n 'Date' => $order_time,\r\n 'IP' => zen_get_ip_address(),\r\n 'Session' => $sessID );\r\n // process Wells-Fargo-SecureSource-specific parameters\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n $submit_data['x_customer_organization_type'] = zen_db_prepare_input($_POST['echeck_customer_type']);\r\n if (zen_db_prepare_input($_POST['echeck_customer_tax_id']) != '') {\r\n $submit_data['x_customer_tax_id'] = zen_db_prepare_input($_POST['echeck_customer_tax_id']);\r\n } else {\r\n $submit_data = array_merge($submit_data, \r\n array('x_drivers_license_num' => zen_db_prepare_input($_POST['echeck_dl_num']),\r\n 'x_drivers_license_state' => zen_db_prepare_input($_POST['echeck_dl_state']),\r\n 'x_drivers_license_dob' => zen_db_prepare_input($_POST['echeck_dl_dob']) ));\r\n }\r\n }\r\n unset($response);\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $this->auth_code = $response[4];\r\n $this->transaction_id = $response[6];\r\n $response_msg_to_customer = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n\r\n $response['Expected-MD5-Hash'] = $this->calc_md5_response($response[6], $response[9]);\r\n $response['HashMatchStatus'] = ($response[37] == $response['Expected-MD5-Hash']) ? 'PASS' : 'FAIL';\r\n\r\n $this->_debugActions($response, $order_time, $sessID);\r\n\r\n // If the MD5 hash doesn't match, then this transaction's authenticity cannot be verified.\r\n // Thus, order will be placed in Pending status\r\n if ($response['HashMatchStatus'] != 'PASS') {\r\n $this->order_status = 1;\r\n $messageStack->add_session('header', MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHENTICITY_WARNING, 'caution');\r\n }\r\n\r\n // If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message\r\n if ($response_code != '1') {\r\n $messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DECLINED_MESSAGE, 'error');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));\r\n }\r\n }", "function testSimplePost() {\n \n $curlAdapter = new CurlAdapter();\n \n $post = array (\n 'SECURITY.SENDER' => '31HA07BC8142C5A171745D00AD63D182',\n 'USER.LOGIN' => '31ha07bc8142c5a171744e5aef11ffd3',\n 'USER.PWD' => '93167DE7',\n 'TRANSACTION.MODE' => 'CONNECTOR_TEST',\n 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865',\n 'PAYMENT.CODE' => 'CC.RG',\n 'FRONTEND.MODE' => 'WHITELABEL',\n 'FRONTEND.ENABLED' => 'TRUE',\n 'FRONTEND.LANGUAGE' => 'EN',\n 'FRONTEND.RESPONSE_URL' => 'http://dev.heidelpay.de',\n 'CONTACT.IP' => '127.0.0.1',\n 'REQUEST.VERSION' => '1.0'\n \n );\n \n $result = $curlAdapter->sendPost('https://test-heidelpay.hpcgw.net/ngw/post', $post);\n \n \n $this->assertTrue(is_array($result[0]), 'First result key should be an array.');\n $this->assertTrue(is_object($result[1]), 'Secound result key should be an object.');\n \n \n $this->assertFalse($result[1]->isError(), 'isError should return true');\n $this->assertTrue($result[1]->isSuccess(), 'isSuccess should return false');\n \n }", "public function verify_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('users',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $resp = array(\n 'rccode' => 1,\n 'message' => 'Otp Verify Successfully', \n );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "public function verify() {\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->library( 'encryption' );\n\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t$forbidden\t\t\t= array( 'route', 'hash', 'email_sender', 'email_recipient' );\n\t\t$retData\t\t\t= array();\n\t\t$securityCriteria\t= 0; // integer!\n\t\t$project_id\t\t\t= '0';\n\t\t$err\t\t\t\t= false;\n\n\t\t// filter variables\n\t\tforeach( $this->request->post as $key => $value) {\n\t\t\tif( !in_array( $key, $forbidden ) ) {\n\t\t\t\t$retData[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\n\t\t\t// get value of security_criteria\n\t\t\tif( $key == 'security_criteria' ) {\n\t\t\t\t$securityCriteria = $value;\n\t\t\t}\n\n\t\t\t// decrypt order_id\n\t\t\tif( $key == 'user_variable_3' ) {\n\t\t\t\t$order_id = $encryption->decrypt( $value );\n\t\t\t}\n\n\t\t\t// get hash value\n\t\t\tif( $key == 'hash' ) {\n\t\t\t\t$this->hashValue = $value;\n\t\t\t}\n\n\t\t\t// get project id\n\t\t\tif( $key == 'project_id' ) {\n\t\t\t\t$project_id = $value;\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo '## FUNCTION verify' . \"\\n\";\n\t\t\techo '## calling getNotifyHash:' . \"\\n\";\n\t\t}\n\n\t\t// calculate hash value\n\t\t$hash = $this->getNotifyHash( $retData );\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo \"\\n\" . '## $_POST data from directebanking:' . \"\\n\";\n\t\t\tprint_r( $_POST ) . \"\\n\";\n\t\t\techo 'retData (cleaned POST for calculating hash):' . \"\\n\";\n\t\t\tprint_r( $retData );\n\t\t\techo \"\\n\";\n\n\t\t\techo '--> submitted hash [' . $this->hashValue . ']' . \"\\n\";\n\t\t\techo '--> calculated hash [' . $hash . ']' . \"\\n\";\n\t\t\techo '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']' . \"\\n\";\n\n\t\t\t// write also log entry\n\t\t\t$msg = '## $_POST data from directebanking:<br />'\n\t\t\t. print_r( $_POST, true )\n\t\t\t. '<br />retData (cleaned POST for calculating hash):<br />'\n\t\t\t. print_r( $retData, true )\n\t\t\t. '<br />--> submitted hash [' . $this->hashValue . ']<br />'\n\t\t\t. '--> calculated hash [' . $hash . ']<br />'\n\t\t\t. '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']<br />'\n\t\t\t. '~~~~~~~~~~~~~~~~~~~~~~';\n\n\t\t\t$this->writeLog( $msg );\n\t\t}\n\n\t\t$comment = $this->_param['testMode'] ? $this->language->get( 'text_testOrder') : '';\n\n\t\t// check generated and submitted hash values\n\t\tif( $hash === $this->hashValue ) {\n\t\t\tif( $securityCriteria == 1 && $order_id ) {\n\t\t\t\t// order is okay, set order to predefined directebanking status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'directebanking_order_status_id'),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_okay'), $project_id );\n\t\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_valid'), $project_id, $order_id );\n\t\t\t\t$type\t= 2;\n\t\t\t}else{\n\t\t\t\t// order is not okay, set order to predefined config status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'config_order_status_id' ),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_security_invalid'), $project_id, $order_id );\n\t\t\t\t$msg\t= $msgDb;\n\t\t\t\t$type\t= 3;\n\t\t\t}\n\t\t}else{\n\t\t\t// order is not okay, set order to predefined config status\n\t\t\t$this->model_checkout_order->confirm( $order_id, $this->config->get( 'config_order_status_id' ), $comment );\n\n\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_notokay'), $project_id );\n\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_hash_dif'), $project_id, $order_id );\n\t\t\t$type\t= 3;\n\t\t}\n\n\t\t// write log\n\t\t$this->writeLog( $msg, $type );\n\t\t// echo message at directebanking\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo $msgDb . \"\\n\";\n\t\t}\n\t}", "public function saveAction()\n {\n // TODO: Implement saveAction() method.\n\n $code = $this->getRequest()['verify_code'];\n\n var_dump($code);\n var_dump($this->getVerifyProvider()->check($code));\n\n }", "public function validatePayment()\n\t{\n\t\t$array_result = array();\n\t\t$array_result['verified'] = 0;\n\t\t$array_result['tot_paid'] = 0.0;\n\t\t$array_result['log'] = '';\n\t\t\n\t\t//cURL Method HTTP1.1 October 2013\n\t\t$raw_post_data \t= file_get_contents('php://input');\n\t\t$raw_post_array = explode('&', $raw_post_data);\n\t\t\n\t\t$myPost = array();\n\t\tforeach ($raw_post_array as $keyval)\n\t\t{\n\t\t\t$keyval = explode('=', $keyval);\n\t\t\tif (count($keyval) == 2)\n\t\t\t{\n\t\t\t\t$myPost[$keyval[0]] = urldecode($keyval[1]);\n\t\t\t}\n\t\t}\n\n\t\t// check if the form has been spoofed\n\t\t$against = array(\n\t\t\t'business' \t => $this->account,\n\t\t\t'mc_gross' \t => number_format($this->order_info['total_net_price'], 2, '.', ''),\n\t\t\t'mc_currency' => $this->order_info['transaction_currency'],\n\t\t\t'tax'\t\t => number_format($this->order_info['total_tax'], 2, '.', ''),\n\t\t);\n\n\t\t/**\n\t\t * If the account name contains the merchant code instead\n\t\t * of the e-mail related to the account, the spoofing check will fail\n\t\t * as the merchant code is always converted into the account e-mail.\n\t\t *\n\t\t * For example, if we specify 835383648, PayPal will return the related\n\t\t * account: [email protected]\n\t\t * Then, 2 different values will be compared:\n\t\t * \"835383648\" ($this->account) againt \"[email protected]\" ($myPost['business'])\n\t\t */\n\n\t\t// inject the original values within the payment data\n\t\tforeach ($against as $k => $v)\n\t\t{\n\t\t\tif (isset($myPost[$k]))\n\t\t\t{\n\t\t\t\t$myPost[$k] = $v;\n\t\t\t}\n\t\t}\n\t\t//\n\n\t\t$req = 'cmd=_notify-validate';\n\t\tif (function_exists('get_magic_quotes_gpc'))\n\t\t{\n\t\t\t$get_magic_quotes_exists = true;\n\t\t}\n\n\t\tforeach ($myPost as $key => $value)\n\t\t{\n\t\t\tif ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n\t\t\t{\n\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = urlencode($value);\n\t\t\t}\n\n\t\t\t$req .= \"&$key=$value\";\n\t\t\t$array_result['log'] .= \"&$key=$value\\n\";\n\t\t}\n\t\t\n\t\tif (!function_exists('curl_init'))\n\t\t{\n\t\t\t$array_result['log'] = \"FATAL ERROR: cURL is not installed on the server\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tif ($this->sandbox == 1)\n\t\t{\n\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\t\n\t\t$ch = curl_init($paypal_url);\n\t\tif ($ch == false)\n\t\t{\n\t\t\t$array_result['log'] = \"Curl error: \" . curl_error($ch) . \"\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\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, $req);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\n\t\t/**\n\t\t * Turn on TLS 1.2 protocol in case of safe mode or sandbox enabled.\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\tif (defined('CURLOPT_SSLVERSION') && ($this->sandbox || $this->safemode))\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 6);\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t\t\n\t\t// CONFIG: Please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and copy it in the same folder as this php file\n\t\t// This is mandatory for some environments.\n\t\t// $cert = dirname(__FILE__) . \"/cacert.pem\";\n\t\t// curl_setopt($ch, CURLOPT_CAINFO, $cert);\n\t\t\n\t\t$res = curl_exec($ch);\n\n\t\tif (curl_errno($ch) != 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e] ') . \" Can't connect to PayPal to validate IPN message: \" . curl_error($ch) . PHP_EOL;\n\n\t\t\tcurl_close($ch);\n\n\t\t\treturn $array_result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL;\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP response of validation request: $res\" . PHP_EOL;\n\t\t\t\n\t\t\tcurl_close($ch);\n\t\t}\n\t\t\n\t\tif (strcmp(trim($res), 'VERIFIED') == 0)\n\t\t{\n\t\t\t$array_result['tot_paid'] = $_POST['mc_gross'];\n\t\t\t$array_result['verified'] = 1;\n\t\t\t$array_result['log'] = '';\n\t\t}\n\t\telse if (strcmp(trim($res), 'INVALID') == 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Invalid IPN: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Unknown Error: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\t\n\t\t//END cURL Method HTTP1.1 October 2013\n\t\t\n\t\treturn $array_result;\n\t}", "public function getVerify()\n {\n return $this->data['fields']['verify'];\n }", "function check_ipn_response() {\n\t\t@ob_clean();\n \t\tif ( ! empty( $_POST ) && $responce = $this->check_ipn_request_is_valid() ) {\n\n\t \t\theader( 'HTTP/1.1 200 OK' );\n\t \tdo_action( \"valid-payu-standard-ipn-request\", $_POST );\n\n\t\t\tif ($responce) {\n\t\t\t\techo $responce;\n\t\t\t\t@ob_flush();\n\t\t\t}\n\n\t\t} else {\n\n\t\t\twp_die( \"PayU IPN Request Failure\" );\n\n \t\t}\n\n\t}", "public static function verifyPayment($body)\n {\n $url = URL::getApiUrl('VerifyPay');\n\n $curl = new CURL($url);\n\n $curl->init('post', $body);\n\n $curl->setHeader([\n 'Content-Type:application/json',\n 'Authorization:Bearer ' . config('payping.token'),\n ]);\n\n $result = $curl->exec();\n\n $curl->close();\n\n if (!$result && http_response_code() === 200)\n {\n return ['status' => true];\n }\n\n $result = str_replace('\"', '', $result);\n\n preg_match('/^\\{((\\\"\\d\\\")|(\\d))+\\:([^\\:]+)\\}$/i', $result, $message);\n\n return [\n 'status' => false,\n 'message' => (!empty($message) ? end($message) : $result),\n ];\n }", "function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }" ]
[ "0.6095479", "0.6026982", "0.5897999", "0.58477813", "0.5837336", "0.5717025", "0.56553984", "0.5634265", "0.561128", "0.5605405", "0.5572598", "0.55671394", "0.55408645", "0.5536406", "0.55316293", "0.55243456", "0.5477265", "0.54701096", "0.54640543", "0.5434716", "0.5424037", "0.54219455", "0.53930056", "0.5386454", "0.53855026", "0.53755313", "0.5363255", "0.5362517", "0.5341834", "0.533181" ]
0.6475036
0
Write array content in .env
public static function arrayToEnv(array $array, string $env_path) { if(file_exists($env_path)) { $env = ""; $position = 0; foreach($array as $key => $value) { $position++; // If value isn't blank, or key isn't numeric meaning not a blank line, then add entry if($value !== "" || !is_numeric($key)) { // If passed in option is a boolean (true or false) this will normally // save as 1 or 0. But we want to keep the value as words. if(is_bool($value)) { if($value === true) { $value = "true"; } else { $value = "false"; } } // Always convert $key to uppercase $env .= strtoupper($key) . "=" . $value; // If isn't last item in array add new line to end if($position != count($array)) { $env .= "\n"; } } else { $env .= "\n"; } } if(file_put_contents($env_path, $env) !== false) return true; return false; } else throw new \Exception("Attempt to read '" . $env_path . "' but this file does not exist !"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetEnvArray(): void\n {\n putenv('MY_KEY');\n $_ENV['MY_KEY'] = $this->value2;\n $_SERVER['MY_KEY'] = $this->value3;\n $this->assertSame($this->value2, Env::get('MY_KEY'));\n }", "function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n\n if (count($values) > 0) {\n $str .= \"\\n\"; // In case the searched variable is in the last line without \\n\n foreach ($values as $envKey => $envValue) {\n if ($envValue === true) {\n $value = 'true';\n } elseif ($envValue === false) {\n $value = 'false';\n } else {\n $value = $envValue;\n }\n\n $envKey = strtoupper($envKey);\n $keyPosition = strpos($str, \"{$envKey}=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n $space = strpos($value, ' ');\n $envValue = ($space === false) ? $value : '\"' . $value . '\"';\n\n // If key does not exist, add it\n if (!$keyPosition || !$endOfLinePosition || !$oldLine) {\n $str .= \"{$envKey}={$envValue}\\n\";\n } else {\n $str = str_replace($oldLine, \"{$envKey}={$envValue}\", $str);\n }\n }\n }\n\n $str = substr($str, 0, -1);\n\n if (! file_put_contents($envFile, $str)) {\n return false;\n }\n\n return true;\n }", "public function toEnv(): string\n {\n $salts = $this->getSalts();\n return array_reduce(\n array_keys($salts), function ($saltsString, $key) use ($salts) {\n $saltsString .= \"{$key}='{$salts[$key]}'\" . PHP_EOL;\n return $saltsString;\n }, ''\n );\n }", "public static function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n if(count($values) > 0)\n {\n foreach($values as $envKey => $envValue)\n {\n $keyPosition = strpos($str, \"{$envKey}=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n // If key does not exist, add it\n if(!$keyPosition || !$endOfLinePosition || !$oldLine)\n {\n $str .= \"{$envKey}='{$envValue}'\\n\";\n }\n else\n {\n $str = str_replace($oldLine, \"{$envKey}='{$envValue}'\", $str);\n }\n }\n }\n $str = substr($str, 0, -1);\n $str .= \"\\n\";\n if(!file_put_contents($envFile, $str))\n {\n return false;\n }\n\n return true;\n }", "public function setEnvironmentValue(array $values)\n {\n $envFile = app()->environmentFilePath();\n $str = file_get_contents($envFile);\n $str .= \"\\r\\n\";\n if (count($values) > 0) {\n foreach ($values as $envKey => $envValue) {\n \n $keyPosition = strpos($str, \"$envKey=\");\n $endOfLinePosition = strpos($str, \"\\n\", $keyPosition);\n $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);\n \n if (is_bool($keyPosition) && $keyPosition === false) {\n // variable doesnot exist\n $str .= \"$envKey=$envValue\";\n $str .= \"\\r\\n\";\n } else {\n // variable exist \n $str = str_replace($oldLine, \"$envKey=$envValue\", $str);\n } \n }\n }\n \n $str = substr($str, 0, -1);\n if (!file_put_contents($envFile, $str)) {\n return false;\n }\n \n app()->loadEnvironmentFrom($envFile); \n \n return true;\n }", "function arrayToFile($oldList, $key, $value, $fileName, $name) {\n $oldList[\"$key\"] = $value;\n $newList = http_build_query($oldList, '', ', ');\n $newList = noAscii($newList);\n $newList = str_replace(\"=\", \"=>\", \"$newList\");\n $newList = '\"'.$newList;\n $newList = str_replace(\"=>\", '\"=>\"', $newList);\n $newList = str_replace(\", \", '\", \"', $newList);\n $arrayFile = fopen(\"$fileName\", \"w\");\n fwrite($arrayFile, \"<?php \".'$'.$name.' = array('.$newList.'\"); ?>');\n fclose($arrayFile);\n}", "function updateDotEnv($data = [])\n {\n if (count($data) > 0) {\n $env = file_get_contents(base_path() . '/.env');\n $env = explode(PHP_EOL, $env);\n\n foreach ($data as $key => $value) {\n foreach ($env as $env_key => $env_value) {\n $entry = explode(\"=\", $env_value, 2);\n if ($entry[0] == $key) {\n $env[$env_key] = $key . \"=\" . $value;\n } else {\n $env[$env_key] = $env_value;\n }\n }\n }\n\n $env = implode(\"\\n\", $env);\n file_put_contents(base_path() . '/.env', $env);\n\n return true;\n }\n\n return false;\n }", "function show_content($arr)\n{\n $content = print_r($arr, TRUE);\n file_put_contents('/data1/php_var_contents.log', $content);\n}", "public function testDir_SaveUseArray()\n {\n $config = Config::with('mock:'.sys_get_temp_dir().'/def');\n $config['xyz'] = array('a'=>'b');\n $config->save();\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(sys_get_temp_dir().\"/def\", (string)$config->getPath());\n $this->assertTrue(is_dir((string)$config->getPath()));\n \n $this->assertType('Q\\Config_File', $config['xyz']);\n $this->assertEquals(sys_get_temp_dir().\"/def/xyz.mock\", (string)$config['xyz']->getPath());\n $this->assertTrue(is_file((string)$config['xyz']->getPath()));\n $this->assertEquals('a:1:{s:1:\"a\";s:1:\"b\";}', file_get_contents((string)$config['xyz']->getPath()));\n }", "private function all(): array\n {\n if (!file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n return file($this->envPath);\n }", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "public function testGetServerArray(): void\n {\n putenv('MY_KEY');\n if (array_key_exists('MY_KEY', $_ENV)) {\n unset($_ENV['MY_KEY']);\n }\n $_SERVER['MY_KEY'] = $this->value3;\n $this->assertSame($this->value3, Env::get('MY_KEY'));\n }", "public static function saveEnvironmentValue(string $key, string $value)\n {\n $env_file = app()->environmentFilePath();\n $str = file_get_contents($env_file);\n\n $str .= \"\\n\"; // In case the key is the last line without \\n\n $key_position = strpos($str, \"{$key}=\");\n $end_of_line_position = strpos($str, PHP_EOL, $key_position);\n $old_line = substr($str, $key_position, $end_of_line_position - $key_position);\n $str = str_replace($old_line, \"{$key}={$value}\", $str);\n $str = substr($str, 0, -1);\n\n $handle = fopen($env_file, 'w');\n fwrite($handle, $str);\n fclose($handle);\n }", "public function getEnvContent()\n {\n if (! file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n return file_get_contents($this->envPath);\n }", "function write_array( &$array2store ){\n die('decided to go anohter route - not done');\n // add the settings back at the bottom of the file\n reset($array2store);\n foreach( $array2store as $key => $val ){\n for( $x = 0 ; $x < count($values) ; ++$x ){ //yes count in a loop - only doing it since this is a single user script -- ohh yeah, sue me!\n exec(\"echo '\".$config_value.'['.$x.\"]=\\\"\".$values[$x].\"\\\"' >> '$this->_settings_file'\");\n ++$upcnt;\n }\n }\n\n }", "function init_env() {\n $envs_filename = base_path().DIRECTORY_SEPARATOR.'.env';\n $envs = $envs_array = [];\n \n if ($ressources = fopen($envs_filename, 'r')) {\n while (!feof($ressources)) {\n $element = fgets($ressources);\n\n if (!empty(trim($element))) {\n $element_array = explode('=', $element);\n $envs_array[$element_array[0]] = $element_array[1];\n }\n\n $envs[] = $element;\n }\n\n fclose($ressources);\n }\n\n $_ENV = array_merge($envs_array, $_ENV);\n }", "public function getEnvContent()\n {\n if (!file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n\n return file_get_contents($this->envPath);\n }", "function array_to_file(array $data, $file = DEFAULT_METAFILE)\n{\n try {\n if (!$data || !is_array($data) || !count($data)) {\n return true;\n }\n $dir = ROOT_FOLDER;\n $filename = $file;\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n $file = fopen($filename, \"w\");\n foreach ($data as $key => $value) {\n fwrite($file, (string) $key . \": \" . (string) $value . \"\\n\");\n }\n fclose($file);\n return true;\n } catch (Exception $e) {\n throw new Exception($e->getMessage(), $e->getCode());\n }\n}", "function writeToAFile(string $file,array $array)\n\t{\n\t\treturn file_put_contents($file, implode(\"\\n\",$array));\n\t}", "public static function setEnv($key, $value)\n {\n $file_path = base_path('.env');\n $data = file($file_path);\n $data = array_map(function($data) use ($key, $value) {\n if (stristr($value, \" \")) {\n return stristr($data, $key) ? \"$key='$value'\\n\" : $data;\n } else {\n return stristr($data, $key) ? \"$key=$value\\n\" : $data;\n }\n }, $data);\n\n // Write file\n $env_file = fopen($file_path, 'w') or die('Unable to open file!');\n fwrite($env_file, implode($data, \"\"));\n fclose($env_file);\n }", "private function _modEnvironment($VAR) {\n $keys = array_keys($VAR);\n $sKeys = array_keys($_SESSION['_ENV']);\n for($sCount = 0; $sCount < count($sKeys); $sCount++) {\n for($count = 0; $count < count($keys); $count++) {#\n if($sKeys[$sCount] == $keys[$count]) {\n $_SESSION['_ENV'][$sKeys[$sCount]] = $VAR[$keys[$count]];\n }\n }\n }\n $target = _BASEDIR_.DS.\"environment.ini.\" . date('Ymd');\n if(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd'))) {\n $fileCount=1;\n while(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd') . \"_\" . $fileCount)) {\n $fileCount++;\n }\n $target .= \"_\".$fileCount;\n }\n rename(_BASEDIR_.DS.\"environment.ini\", $target);\n $fp = fopen(_BASEDIR_.DS.\"environment.ini\", \"w+\");\n if($fp != null) {\n $keys = array_keys($_SESSION['_ENV']);\n for($count = 0; $count < count($keys); $count++) {\n if(strlen(trim($keys[$count])) > 0) {\n fwrite($fp, $keys[$count].\"=\".$_SESSION['_ENV'][$keys[$count]].\"\\n\");\n }\n }\n fclose($fp);\n }\n }", "public function encryptedSettings(): array\n {\n return [];\n }", "public function encryptedSettings(): array\n {\n return [];\n }", "function export($array, $file){\n\t$file =fopen($file, 'w');\n\t$data = json_encode($array, FILE_USE_INCLUDE_PATH);\n\tfwrite($file, $data);\n\tfclose($file);\n}", "public static function start()\n {\n $buffer = File::readFile(\".env\");\n $pairs = explode(\"\\n\", $buffer);\n\n foreach ($pairs as $pair) {\n $keyValuePair = explode(\"=\", $pair);\n\n $key = (isset($keyValuePair[0])) ? $keyValuePair[0] : null;\n $value = (isset($keyValuePair[1])) ? $keyValuePair[1] : null;\n\n self::$environment[$key] = $value;\n }\n }", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "protected function getEnvironmentAsArray($pathfile)\n\t{\n\t\treturn $this->getFs()->fileToArray($pathfile);\n\t}", "public function environment()\n {\n $envConfig = $this->EnvironmentManager->getEnvContent();\n //Sets the default values of the .env file!\n $APP_ENV = 'local';\n $APP_DEBUG = 'true';\n $APP_KEY = '4958763498756837942368weufgsdgw3';\n $DB_HOST = 'localhost';\n $DB_DATABASE = 'database';\n $DB_USERNAME = 'Username';\n $DB_PASSWORD = 'Password';\n \n $CACHE_DRIVER = 'file';\n $SESSION_DRIVER = 'file';\n $QUEUE_DRIVER = 'sync';\n $MAIL_DRIVER = 'smtp';\n $MAIL_HOST = 'mailtrap.io';\n $MAIL_PORT= 2525;\n $MAIL_USERNAME = 'null';\n $MAIL_PASSWORD = 'null';\n $MAIL_ENCRYPTION= 'null';\n return view('vendor.installer.environment', \n [\n 'APP_ENV' => $APP_ENV,\n 'APP_DEBUG' => $APP_DEBUG,\n 'APP_KEY' => $APP_KEY,\n 'DB_HOST' => $DB_HOST,\n 'DB_DATABASE' => $DB_DATABASE,\n 'DB_USERNAME' => $DB_USERNAME,\n 'DB_PASSWORD' => $DB_PASSWORD,\n 'CACHE_DRIVER' => $CACHE_DRIVER,\n 'SESSION_DRIVER' => $SESSION_DRIVER,\n 'QUEUE_DRIVER' => $QUEUE_DRIVER,\n 'MAIL_DRIVER' => $MAIL_DRIVER,\n 'MAIL_HOST' => $MAIL_HOST,\n 'MAIL_PORT' => $MAIL_PORT,\n 'MAIL_USERNAME' => $MAIL_USERNAME,\n 'MAIL_PASSWORD' => $MAIL_PASSWORD,\n 'MAIL_ENCRYPTION' => $MAIL_ENCRYPTION,\n ]\n );\n }", "function save_file($file, $array) {\n\t$handle = fopen($file, 'w');\n\t$saveList = implode(\"\\n\", $array);\n\tfwrite($handle, $saveList);\n\tfclose($handle);\n}" ]
[ "0.61526847", "0.59584296", "0.5834722", "0.580451", "0.57252055", "0.56427836", "0.54654706", "0.5434371", "0.54165417", "0.5400318", "0.5396022", "0.5389852", "0.5386874", "0.5380499", "0.5361208", "0.5346561", "0.5335997", "0.5314829", "0.5294554", "0.5286866", "0.527223", "0.52126503", "0.52124286", "0.52124286", "0.5126198", "0.5115004", "0.51040494", "0.5100557", "0.5057098", "0.50401914" ]
0.62569207
0
Create an instance of the APC cache driver
public function createApcDriver() { $prefix = $this->getCacheParameter('prefix'); return new Repository(new ApcStore(new Apc, $prefix)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createApcuDriver(): StoreContract\n {\n return $this->createCacheBased('apcu');\n }", "public function __construct(string $cache) {\n try {\n $this->duration = (int)($_ENV[\"CACHE_DURATION\"] ?? 86400);\n switch ($cache) {\n case \"apcu\":\n $this->driver = new APCuCache($this->duration);\n break;\n }\n } catch (\\Exception $e) {\n $exception = Utilities::parseException($e);\n Nova::log($exception[\"message\"], \"error\");\n }\n }", "private function createApcuDriver(): ApcuDriver\n {\n return new ApcuDriver();\n }", "static function factory()\n {\n if (function_exists('apc_fetch')) {\n $class = new BaseZF_Framework_Cache_Apc();\n } else {\n $class = new BaseZF_Framework_Cache_Apc_Disable();\n }\n\n return $class;\n }", "protected function createApcDriver(array $config)\n\t{\n\t\treturn $this->repository(new ApcStore(new ApcWrapper, $this->getPrefix()));\n\t}", "public static function cache(){\n\n if (!isset(self::$_cache)) {\n if(!GO::isInstalled()){\n self::$_cache=new \\GO\\Base\\Cache\\None();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(!isset(GO::session()->values['cacheDriver'])){\n\t\t\t\t\t\t\t\t$cachePref = array(\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Apcu\",\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Disk\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tforeach($cachePref as $cacheDriver){\n\t\t\t\t\t\t\t\t\t$cache = new $cacheDriver;\n\t\t\t\t\t\t\t\t\tif($cache->supported()){\n\n\t\t\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\t\t\tGO::session()->values['cacheDriver'] = $cacheDriver;\n\t\t\t\t\t\t\t\t\t\tself::$_cache=$cache;\n\t\t\t\t\t\t\t\t\t\tbreak;\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}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cacheDriver = GO::session()->values['cacheDriver'];\n\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\tself::$_cache = new $cacheDriver;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n return self::$_cache;\n }", "public function __construct() {\n $memcached = new Memcached();\n $memcached->addServer('localhost', 11211);\n\n $this->engine = new MemcachedCache();\n $this->engine->setMemcached($memcached);\n }", "protected function _initCache() {\n\t\t$options = $this->getOptions();\n\t\tswitch($options['cache']) {\n\t\t\tcase 'apc':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\ApcCache();\n\t\t\tbreak;\n\n\t\t\tcase 'memcache':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\MemcacheCache();\n\t\t\tbreak;\n\n\t\t\tcase 'xcache':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\XcacheCache();\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\t\t}\n\n// \t\t$this->_config->setMetadataCacheImpl($cache);\n// \t\t$this->_config->setQueryCacheImpl($cache);\n\t}", "function &createCache() {}", "public function __construct() {\r\n $this->cache = new MemCacheInterface(self::$CACHE_HOST, self::$CACHE_PORT, self::$CACHE_PREFIX, self::$CACHE_GROUP);\r\n }", "function __construct() {\n\t\t$this->enabled = extension_loaded('apc');\n\t}", "private function _createCache($cache)\n {\n $defaults = array(\n 'class' => 'Doctrine\\Common\\Cache\\ArrayCache',\n 'namespace' => '__kodefoundry_yiiext_doctrine',\n );\n\n $config = array_merge($defaults, $this->caches[$cache]);\n\n if (class_exists($config['class']) === false) {\n throw new \\Doctrine\\Common\\CommonException(\\Yii::t('kf.ext', 'Unknown class \"{class}\" specified in the cache configuration', array(\n '{class}' => $config['class']\n )));\n }\n\n $driver = new $config['class'];\n\n // Memcache specific\n if ($driver instanceof \\Doctrine\\Common\\Cache\\MemcacheCache) {\n $driver->setMemcache($this->_createMemcacheDriver($config));\n }\n\n // Memcached specific\n if ($driver instanceof \\Doctrine\\Common\\Cache\\MemcachedCache) {\n $driver->setMemcached($this->_createMemcachedDriver($config));\n }\n\n if ($driver instanceof \\Doctrine\\Common\\Cache\\CacheProvider) {\n $driver->setNamespace($config['namespace']);\n $this->_cachedObjects[$cache] = $driver;\n return $driver;\n }\n\n throw new \\Doctrine\\Common\\CommonException(\\Yii::t(\n 'kf.ext',\n 'The cache driver {driver} must implement \\Doctrine\\Common\\Cache\\CacheProvider',\n array('{driver}' => $config['class'])\n ));\n }", "function __construct(Cache $cache) {\n// $client = RedisAdapter::createConnection('redis://localhost');\n// $this->cache = new RedisTagAwareAdapter($client);\n $this->cache = $cache->getCache();\n\n }", "public function __construct()\n {\n $this->driver = \\App::make(\\App::config('cache.driver')); \n }", "public function connect() {\n// $m->addServer('localhost', 11211);\n// $v = $m->get('counter');\n// $m->set('counter', $v + 1);\n//\n// $md = new Memcached();\n// $md->addServer('localhost', 11211);\n// $v = $md->get('counter', null, $token);\n// $v = $md->set('counter', null,1, $token);\n \n \n $_debugMicrotime = microtime(true);\n \n $memcachedClass = 'Memcached';\n if(!auto::autoload($memcachedClass)){\n throw new exception_cache('class not exist for '.$memcachedClass.', check your php extensions~', exception_cache::type_memcache_not_exist);\n }\n \n $this->_memcached = new $memcachedClass();\n $servers = $this->_confs['servers'];\n foreach ($servers as $server) {\n $this->_memcached->addServer($server['host'], $server['port'], $server['weight']);\n }\n ($timeCost = microtime(true) - $_debugMicrotime) && performance::add(__METHOD__, $timeCost, array('alias'=>$this->_alias));\n\n //return $this->_memcached;\n return $this;\n }", "private function memcacheConnect() {\n \n $config = new Cfe_Config_Ini(APPLICATION_CONFIG_PATH . '/application.ini',Cfe_Utils::getPlatform());\n $config = $config->memcache;\n \n $options = $config->frontendOptions->toArray();\n $options['logging'] = $this->logging;\n $options['logger'] = $this->logger;\n $options['lifetime'] = $this->lifetime;\n $this->_memcacheInstance = Zend_Cache::factory($config->frontend,\n $config->backend,\n $options,\n $config->backendOptions->toArray(),\n false,\n false);\n //TODO\n //$this->_memcacheInstance->clean();\n return $this->_memcacheInstance;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance)) {\n switch (CACHE_TYPE) {\n case CacheType::apc:\n self::$cache = new APC();\n break;\n case CacheType::eaccelerator:\n self::$cache = new eAccelerator;\n break;\n case CacheType::xcache:\n self::$cache = new XCache;\n break;\n case CacheType::file:\n self::$cache = new File;\n break;\n\n case CacheType::none:\n default:\n self::$cache = new NoCache;\n break;\n }\n\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }", "public function __construct() {\n include Config::create()->load('cache');\n $this->config = $cache;\n $this->mc = new Memcached();\n foreach ($this->config['server'] as $s) {\n $this->mc->addServer($s['host'], $s['port']);\n }\n }", "public function initCache() {\n $cacheclass = \"corelib_cache_mongoCache\";\n if (self::$_config['caching']['type']) {\n $cacheclass = \"corelib_cache_\" . self::$_config['caching']['type'] . \"Cache\";\n }\n $this->_cache = new $cacheclass(self::$_config['caching']);\n }", "function init_cache_setup()\n\t{\n\t\t//--------------------------------\n\t\t// Eaccelerator...\n\t\t//--------------------------------\n\t\t\n\t\tif( function_exists('eaccelerator_get') AND isset($this->vars['use_eaccelerator']) AND $this->vars['use_eaccelerator'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_eaccelerator.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Turck-mmcache...\n\t\t//--------------------------------\n\t\t\n\t\tif( function_exists('mmcache_get') AND isset($this->vars['use_mmcache']) AND $this->vars['use_mmcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_mmcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// Memcache\n\t\t//--------------------------------\t\n\t\t\t\n\t\telse if( function_exists('memcache_connect') AND isset($this->vars['use_memcache']) AND $this->vars['use_memcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_memcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t\t\n\t\t\t$this->cachelib->connect( $this->vars );\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// XCache...\n\t\t//--------------------------------\n\t\t\n\t\telse if( function_exists('xcache_get') AND isset($this->vars['use_xcache']) AND $this->vars['use_xcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_xcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// APC...\n\t\t//--------------------------------\n\t\t\n\t\telse if( function_exists('apc_fetch') AND isset($this->vars['use_apc']) AND $this->vars['use_apc'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_apc.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// Diskcache\n\t\t//--------------------------------\t\n\t\t\n\t\telse if( isset($this->vars['use_diskcache']) AND $this->vars['use_diskcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_diskcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\n\t\t\n\t\tif( is_object($this->cachelib) AND $this->cachelib->crashed )\n\t\t{\n\t\t\t// There was a problem - not installed maybe?\n\t\t\t\n\t\t\tunset($this->cachelib);\n\t\t\t$this->cachelib = NULL;\n\t\t}\n\t}", "private function __construct() {\n\t\t$this->memcache = new Memcache();\n\t\t$connectResult = $this->memcache->connect('localhost','11211');\n\t\tif ($connectResult === FALSE) {\n\t\t\t$this->memcache = NULL;\n\t\t}\n\t}", "public function __construct()\n {\n $this->init_config();//init cache config set the driver and path/key;\n if($this->driver==\"redis\") {\n $this->redis = new \\Redis();\n $this->redis->connect(\"127.0.0.1\", 6379);\n }\n if($this->driver==\"file\"){\n $this->file=new file();\n $this->path=dirname(dirname(dirname(__FILE__))).\"/$this->path/\";//set file store path\n }\n }", "public function __construct(array $APCOptions = null, array $MemcacheOptions = null)\n\t\t{\n\t\t\tif ($APCOptions && !empty($APCOptions['Enabled']) && (!ini_get('apc.enabled') || !function_exists('apc_store')))\n\t\t\t{\n\t\t\t\tthrow new Exception('APC not available');\n\t\t\t}\n\t\t\telseif ($APCOptions)\n\t\t\t{\n\t\t\t\tself::$APCOptions = array_merge(self::$DefaultAPCOptions, $APCOptions);\n\t\t\t\tself::$APCOn = !empty(self::$APCOptions['Enabled']);\n\t\t\t}\n\n\t\t\tif ($MemcacheOptions && !empty($MemcacheOptions['Enabled']) && !class_exists('Memcached'))\n\t\t\t{\n\t\t\t\tthrow new Exception('Memcached not available (Memcached extension, not Memcache)');\n\t\t\t}\n\t\t\telseif ($MemcacheOptions)\n\t\t\t{\n\t\t\t\tself::$MemcacheOptions = array_merge(self::$DefaultMemcacheOptions, $MemcacheOptions);\n\t\t\t\tself::$MemcacheOn = !empty(self::$MemcacheOptions['Enabled']);\n\n\t\t\t\tself::$Memcache = new Memcached;\n\n\t\t\t\tif (!empty(self::$MemcacheOptions['Consistent']))\n\t\t\t\t{\n\t\t\t\t\tself::$Memcache -> setOptions(array(\n \t\t\t\t\t\tMemcached::OPT_CONNECT_TIMEOUT => 20,\n\t\t\t\t\t\tMemcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,\n\t\t\t\t\t\tMemcached::OPT_SERVER_FAILURE_LIMIT => 5,\n\t\t\t\t\t\tMemcached::OPT_REMOVE_FAILED_SERVERS => true,\n\t\t\t\t\t\tMemcached::OPT_RETRY_TIMEOUT => 1,\n\t\t\t\t\t\tMemcached::OPT_LIBKETAMA_COMPATIBLE => true\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$MemcacheServers = self::ParseMemcacheServers(self::$MemcacheOptions['Servers']);\n\t\t\t\tself::$Memcache -> addServers($MemcacheServers);\n\t\t\t}\n\t\t}", "public static function make()\n {\n return new waCache(new waFileCacheAdapter([]), wa()->getConfig()->getApplication());\n }", "public function __construct() {\n\t\t$this->hasExistsMethod = function_exists('apc_exists');\n\t}", "static public function factory($driver, array$options = array())\n {\n $filename = 'DiggLite/Cache/' . str_replace('_', '/', $driver . '.php');\n $class = 'DiggLite_Cache_' . $driver;\n\n include_once $filename;\n if (!class_exists($class)) {\n throw new DiggLite_Exception(\"Cache driver $class does not exist\");\n }\n\n return new $class($options);\n }", "public function __construct()\n {\n $this->initContrexxCaching();\n $this->initOPCaching();\n $this->initUserCaching();\n $this->getActivatedCacheEngines();\n }", "private function __construct()\r\r\n\t{\t\t\r\r\n\t\t$class_name = sprintf(CPF_CACHE_STORAGE_CLASS_FORMAT, Cpf_Core_Config::get_instance()->value('CACHE.STORAGE'));\t\t\r\r\n\t\t$this->_storage = new $class_name();\r\r\n\t}", "function __construct($config = null) \n\t{\n\t\t// No custom configuration passed? Use default.\n\t\tif(empty($config))\n\t\t\tglobal $config;\n\n\t\t$this->apcu = new Cache\\APCu();\n\t\t$this->redis = new Cache\\Redis();\n\t}", "public function init()\n {\n parent::init();\n $this->_cache = new \\Memcache;\n $this->_cache->connect();\n }" ]
[ "0.67227095", "0.67139655", "0.6647493", "0.65785825", "0.64634156", "0.6386936", "0.6302157", "0.62846684", "0.6225848", "0.6154188", "0.615009", "0.60509837", "0.6037553", "0.5985475", "0.59637004", "0.59535867", "0.5935894", "0.5900436", "0.58835983", "0.58735", "0.58236074", "0.580561", "0.5785721", "0.5753431", "0.575076", "0.57472116", "0.5742291", "0.57019144", "0.56955016", "0.5684179" ]
0.7775853
0
Register cap groups with the Members plugin (if used)
function rordb_register_cap_groups() { members_register_cap_group( 'rordb', array( 'label' => __( 'RoRdb', 'rordb-textdomain' ), 'caps' => array( "rordb_edit_settings", "rordb_view_items", "rordb_edit_items", "rordb_create_items", "rordb_view_categories", "rordb_edit_categories", "rordb_create_categories", "rordb_view_locations", "rordb_edit_locations", "rordb_create_locations", "rordb_view_claimgroups", "rordb_edit_claimgroups", "rordb_create_claimgroups", ), 'icon' => 'dashicons-database', 'priority' => 10 ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mycred_load_buddypress_groups_hook() {\n\tif ( class_exists( 'myCRED_BuddyPress_Groups' ) || ! class_exists( 'BuddyPress' ) ) return;\n\n\tclass myCRED_BuddyPress_Groups extends myCRED_Hook {\n\n\t\t/**\n\t\t * Construct\n\t\t */\n\t\tfunction __construct( $hook_prefs, $type = MYCRED_DEFAULT_TYPE_KEY ) {\n\n\t\t\tparent::__construct( array(\n\t\t\t\t'id' => 'hook_bp_groups',\n\t\t\t\t'defaults' => array(\n\t\t\t\t\t'create' => array(\n\t\t\t\t\t\t'creds' => 10,\n\t\t\t\t\t\t'log' => '%plural% for creating a new group',\n\t\t\t\t\t\t'min' => 0\n\t\t\t\t\t),\n\t\t\t\t\t'delete' => array(\n\t\t\t\t\t\t'creds' => '-10',\n\t\t\t\t\t\t'log' => '%singular% deduction for deleting a group'\n\t\t\t\t\t),\n\t\t\t\t\t'new_topic' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group topic',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'edit_topic' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for updating group topic',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'new_post' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group post',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'edit_post' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for updating group post',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'join' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for joining new group',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'leave' => array(\n\t\t\t\t\t\t'creds' => '-5',\n\t\t\t\t\t\t'log' => '%singular% deduction for leaving group'\n\t\t\t\t\t),\n\t\t\t\t\t'avatar' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group avatar',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'cover' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new cover photo',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'comments' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group comment',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t), $hook_prefs, $type );\n\n\t\t}\n\n\t\t/**\n\t\t * Run\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function run() {\n\n\t\t\tif ( $this->prefs['create']['creds'] != 0 && $this->prefs['create']['min'] == 0 )\n\t\t\t\tadd_action( 'groups_group_create_complete', array( $this, 'create_group' ) );\n\n\t\t\tif ( $this->prefs['create']['creds'] < 0 )\n\t\t\t\tadd_filter( 'bp_user_can_create_groups', array( $this, 'restrict_group_creation' ), 99, 2 );\n\n\t\t\tif ( $this->prefs['delete']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_group_deleted', array( $this, 'delete_group' ) );\n\n\t\t\tif ( $this->prefs['new_topic']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_forums_new_topic', array( $this, 'new_topic' ) );\n\n\t\t\tif ( $this->prefs['edit_topic']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_edit_forum_topic', array( $this, 'edit_topic' ) );\n\n\t\t\tif ( $this->prefs['new_post']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_forums_new_post', array( $this, 'new_post' ) );\n\n\t\t\tif ( $this->prefs['edit_post']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_edit_forum_post', array( $this, 'edit_post' ) );\n\n\t\t\tif ( $this->prefs['join']['creds'] != 0 || ( $this->prefs['create']['creds'] != 0 && $this->prefs['create']['min'] != 0 ) )\n\t\t\t\tadd_action( 'groups_join_group', array( $this, 'join_group' ), 20, 2 );\n\n\t\t\tif ( $this->prefs['join']['creds'] < 0 )\n\t\t\t\tadd_filter( 'bp_get_group_join_button', array( $this, 'restrict_joining_group' ) );\n\n\t\t\tif ( $this->prefs['leave']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_leave_group', array( $this, 'leave_group' ), 20, 2 );\n\n\t\t\tif ( $this->prefs['avatar']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_screen_group_admin_avatar', array( $this, 'avatar_upload_group' ) );\n\n\t\t\tif ( $this->prefs['cover']['creds'] != 0 )\n\t\t\t\tadd_action( 'group_cover_image_uploaded', array( $this, 'cover_change' ) );\n\n\t\t\tif ( $this->prefs['comments']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_groups_posted_update', array( $this, 'new_group_comment' ), 20, 4 );\n\n\t\t}\n\n\t\t/**\n\t\t * Creating Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function create_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'creation_of_new_group',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['create']['creds'],\n\t\t\t\t$this->prefs['create']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Restrict Group Creation\n\t\t * If creating a group costs and the user does not have enough points, we restrict creations.\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function restrict_group_creation( $can_create, $restricted ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $can_create;\n\n\t\t\t// Check if user has enough to create a group\n\t\t\t$cost = abs( $this->prefs['create']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $can_create;\n\n\t\t}\n\n\t\t/**\n\t\t * Restrict Group Join\n\t\t * If joining a group costs and the user does not have enough points, we restrict joining of groups.\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function restrict_joining_group( $button ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $button;\n\n\t\t\t// Check if user has enough to join group\n\t\t\t$cost = abs( $this->prefs['join']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $button;\n\n\t\t}\n\n\t\t/**\n\t\t * Deleting Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function delete_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// If admin is removing deduct from creator\n\t\t\tif ( $bp->loggedin_user->is_super_admin )\n\t\t\t\t$user_id = $bp->groups->current_group->creator_id;\n\n\t\t\t// Else if admin but not the creator is removing\n\t\t\telseif ( $bp->loggedin_user->id != $bp->groups->current_group->creator_id )\n\t\t\t\t$user_id = $bp->groups->current_group->creator_id;\n\n\t\t\t// Else deduct from current user\n\t\t\telse\n\t\t\t\t$user_id = $bp->loggedin_user->id;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'deletion_of_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['delete']['creds'],\n\t\t\t\t$this->prefs['delete']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Forum Topic\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Edit Group Forum Topic\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function edit_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_topic', 'edit_group_forum_topic' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_topic']['creds'],\n\t\t\t\t$this->prefs['edit_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Forum Post\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Edit Group Forum Post\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function edit_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_post', 'edit_group_forum_post' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_post']['creds'],\n\t\t\t\t$this->prefs['edit_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Joining Group\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function join_group( $group_id, $user_id ) {\n\n\t\t\t// Minimum members limit\n\t\t\tif ( $this->prefs['create']['min'] != 0 ) {\n\t\t\t\t$group = groups_get_group( array( 'group_id' => $group_id ) );\n\n\t\t\t\t// Award creator if we have reached the minimum number of members and we have not yet been awarded\n\t\t\t\tif ( $group->total_member_count >= (int) $this->prefs['create']['min'] && ! $this->core->has_entry( 'creation_of_new_group', $group_id, $group->creator_id ) )\n\t\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t\t'creation_of_new_group',\n\t\t\t\t\t\t$group->creator_id,\n\t\t\t\t\t\t$this->prefs['create']['creds'],\n\t\t\t\t\t\t$this->prefs['create']['log'],\n\t\t\t\t\t\t$group_id,\n\t\t\t\t\t\t'bp_group',\n\t\t\t\t\t\t$this->mycred_type\n\t\t\t\t\t);\n\n\t\t\t\t// Clean up\n\t\t\t\tunset( $group );\n\n\t\t\t}\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'join', 'joining_group' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'joining_group', $group_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'joining_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['join']['creds'],\n\t\t\t\t$this->prefs['join']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Leaving Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function leave_group( $group_id, $user_id ) {\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'leaving_group', $group_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'leaving_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['leave']['creds'],\n\t\t\t\t$this->prefs['leave']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Avatar Upload for Group\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function avatar_upload_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'avatar', 'upload_group_avatar' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'upload_group_avatar', $group_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_group_avatar',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['avatar']['creds'],\n\t\t\t\t$this->prefs['avatar']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Group Cover Upload\n\t\t * @since 1.7\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function cover_change( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'cover', 'upload_group_cover', $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_group_cover',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['cover']['creds'],\n\t\t\t\t$this->prefs['cover']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Comment\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_group_comment( $content, $user_id, $group_id, $activity_id ) {\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'comments', 'new_group_comment', $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_comment', $activity_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_comment',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['comments']['creds'],\n\t\t\t\t$this->prefs['comments']['log'],\n\t\t\t\t$activity_id,\n\t\t\t\t'bp_activity',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Preferences\n\t\t * @since 0.1\n\t\t * @version 1.3\n\t\t */\n\t\tpublic function preferences() {\n\n\t\t\t$prefs = $this->prefs;\n\n?>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Group Creation', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-3 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['create']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->core->template_tags_general( __( 'If you use a negative value and the user does not have enough %_plural%, the \"Create Group\" button will be disabled.', 'twodayssss' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-3 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'min' ) ); ?>\"><?php _e( 'No. of Members', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'min' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'min' ) ); ?>\" value=\"<?php echo esc_attr( $prefs['create']['min'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->core->template_tags_general( __( 'The number of members a group must gain before awarding %_plural%. Use zero to award as soon as the group is created.', 'twodayssss' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['create']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Group Deletions', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['delete']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['delete']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Avatar Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['avatar']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['avatar']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Cover Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['cover']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['cover']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Forum Topics', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_topic', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_topic']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_topic', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Editing Forum Topics', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_topic', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['edit_topic']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_topic', 'limit' ) ), $this->field_id( array( 'edit_topic', 'limit' ) ), $prefs['edit_topic']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_topic', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['edit_topic']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Forum Posts', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_post', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_post']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_post', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_post']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Editing Forum Posts', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_post', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['edit_post']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_post', 'limit' ) ), $this->field_id( array( 'edit_post', 'limit' ) ), $prefs['edit_post']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_post', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['edit_post']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Joining Groups', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'join', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['join']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'join', 'limit' ) ), $this->field_id( array( 'join', 'limit' ) ), $prefs['join']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'join', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'join', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['join']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Leaving Groups', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['leave']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['leave']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Comments', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'comments', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['comments']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'comments', 'limit' ) ), $this->field_id( array( 'comments', 'limit' ) ), $prefs['comments']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'comments', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['comments']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<?php\n\n\t\t}\n\n\t\t/**\n\t\t * Sanitise Preferences\n\t\t * @since 1.6\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function sanitise_preferences( $data ) {\n\n\t\t\tif ( isset( $data['new_topic']['limit'] ) && isset( $data['new_topic']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_topic']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_topic']['limit'] = $limit . '/' . $data['new_topic']['limit_by'];\n\t\t\t\tunset( $data['new_topic']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['edit_topic']['limit'] ) && isset( $data['edit_topic']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['edit_topic']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['edit_topic']['limit'] = $limit . '/' . $data['edit_topic']['limit_by'];\n\t\t\t\tunset( $data['edit_topic']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['new_post']['limit'] ) && isset( $data['new_post']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_post']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_post']['limit'] = $limit . '/' . $data['new_post']['limit_by'];\n\t\t\t\tunset( $data['new_post']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['edit_post']['limit'] ) && isset( $data['edit_post']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['edit_post']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['edit_post']['limit'] = $limit . '/' . $data['edit_post']['limit_by'];\n\t\t\t\tunset( $data['edit_post']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['join']['limit'] ) && isset( $data['join']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['join']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['join']['limit'] = $limit . '/' . $data['join']['limit_by'];\n\t\t\t\tunset( $data['join']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['avatar']['limit'] ) && isset( $data['avatar']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['avatar']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['avatar']['limit'] = $limit . '/' . $data['avatar']['limit_by'];\n\t\t\t\tunset( $data['avatar']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['cover']['limit'] ) && isset( $data['cover']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['cover']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['cover']['limit'] = $limit . '/' . $data['cover']['limit_by'];\n\t\t\t\tunset( $data['cover']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['comments']['limit'] ) && isset( $data['comments']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['comments']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['comments']['limit'] = $limit . '/' . $data['comments']['limit_by'];\n\t\t\t\tunset( $data['comments']['limit_by'] );\n\t\t\t}\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t}\n\n}", "function setup_groups() {\n\t$taxonomy_capabilities = array(\n\t\t'manage_terms' => 'manage_categories',\n\t\t'edit_terms' => 'manage_categories',\n\t\t'delete_terms' => 'manage_categories',\n\t\t'assign_terms' => 'edit_posts',\n\t);\n\n\t$taxonomy_labels = array(\n\t\t'name' => esc_html__( 'External Connection Groups' ),\n\t\t'singular_name' => esc_html__( 'External Connection Group' ),\n\t\t'search_items' => esc_html__( 'Search External Connection Groups' ),\n\t\t'popular_items' => esc_html__( 'Popular External Connection Groups' ),\n\t\t'all_items' => esc_html__( 'All External Connection Groups' ),\n\t\t'parent_item' => esc_html__( 'Parent External Connection Group' ),\n\t\t'parent_item_colon' => esc_html__( 'Parent External Connection Group' ),\n\t\t'edit_item' => esc_html__( 'Edit External Connection Group' ),\n\t\t'update_item' => esc_html__( 'Update External Connection Group' ),\n\t\t'add_new_item' => esc_html__( 'Add New External Connection Group' ),\n\t\t'new_item_name' => esc_html__( 'New External Connection Group Name' ),\n\n\t);\n\t$args = array(\n\t\t'labels' => $taxonomy_labels,\n\t\t'public' => false,\n\t\t'show_ui' => true,\n\t\t'meta_box_cb' => false,\n\t\t'show_tagcloud' => false,\n\t\t'show_in_nav_menus' => false,\n\t\t'hierarchical' => true,\n\t\t'rewrite' => false,\n\t\t'capabilities' => $taxonomy_capabilities,\n\n\t);\n\tregister_taxonomy( 'dt_ext_connection_group', 'dt_ext_connection', $args );\n}", "function setup_groups() {\n global $CFG;\n\n /// find out current groups mode\n $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);\n $this->currentgroup = groups_get_course_group($this->course);\n\n if ($this->currentgroup) {\n $this->groupsql = \" LEFT JOIN {$CFG->prefix}groups_members gm ON gm.userid = u.id \";\n $this->groupwheresql = \" AND gm.groupid = $this->currentgroup \";\n }\n }", "public function initUserGroups() {}", "function set_user_groups(){\r\n $groups = _get_user_groups();\r\n $user_name = server(get_sso_option('user_name'));\r\n $user = get_userdatabylogin($user_name);\r\n $inherited_groups = get_usermeta($user->ID, 'wp_capabilities');\r\n $end_groups = $inherited_groups;\r\n $update = FALSE;\r\n for($i=0; $i<count($groups); $i++){\r\n if(!isset($inhereted_groups[$groups[$i]]) OR $inhereted_groups[$groups[$i]] != $end_groups[$groups[$i]]) $update = TRUE;\r\n $end_groups[$groups[$i]] = TRUE;\r\n }\r\n if($update) update_usermeta($user->ID, 'wp_capabilities', $end_groups);\r\n}", "function new_groups()\n {\n \n }", "function addUserGroups()\n {\n Log::add('User groups added in installation script', JLog::DEBUG, 'com_cajobboard');\n\n $db = JFactory::getDbo();\n\n // Get the PK of the \"Registered\" user group\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName(array('id', 'title')))\n ->from ($db->quoteName('#__usergroups'))\n ->where ($db->quoteName('title') . ' = '. $db->quote('Registered'));\n\n $db->setQuery($query);\n\n $registeredGroupId = $db->loadResult();\n\n unset($query);\n\n // Get a list of all of the existing user groups so we don't duplicate adding ones we want\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('title'))\n ->from ($db->quoteName('#__usergroups'));\n\n $db->setQuery($query);\n\n $existingUserGroups = $db->loadColumn();\n\n // Add our new user groups\n foreach ($this->userGroups as $userGroup)\n {\n if (!in_array($userGroup, $existingUserGroups))\n {\n $groupModel = Table::getInstance('Usergroup');\n\n $groupModel->save(array(\n 'title' => $userGroup,\n 'parent_id' => $registeredGroupId\n ));\n }\n }\n\n Table::getInstance('Usergroup')->rebuild();\n }", "public function addGroup($group) {}", "function uc_register_post_group() {\n\n\tregister_post_type( 'uc_group',\n\t\tarray(\n\t\t\t'menu_icon' \t=> 'dashicons-groups',\n\t\t\t'supports' \t\t=> array( 'title', ),\n\t\t\t'show_ui' \t\t=> true,\n\t\t\t'show_in_nav_menus' => false,\n\t\t\t'exclude_from_search' => true,\n\t\t\t'publicly_queryable' => false,\n\t\t\t'labels' => array(\n\t\t\t\t'name' \t=> __( 'Groups', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'singular_name' \t=> __( 'Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'add_new' \t=> __( 'Add New Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'add_new_item' \t=> __( 'Add New Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'menu_name' \t=> __( 'Groups', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'parent_item_colon' \t=> __( 'Parent Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'all_items' \t=> __( 'All Groups', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'view_item' \t=> __( 'View Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'edit_item' \t=> __( 'Edit Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'update_item' \t=> __( 'Update Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'search_items' \t=> __( 'Search Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'not_found' \t\t\t=> __( 'No Group found', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'not_found_in_trash'\t=> __( 'No Group found in Trash', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t\t'parent' \t\t\t\t=> __( 'Parent Group', UPTOWNCODE_PLUGIN_NAME ),\n\t\t\t)\n\t\t)\n\t);\n}", "public function attachGroups($groups);", "function wp_cache_add_global_groups($groups)\n {\n }", "public function add_global_groups($groups)\n {\n }", "public function add_caps() {\n global $wp_roles;\n\n // TODO: see easy-digital-downloads plugin source codes for example implementation.\n }", "public function addGroup(string $group): void;", "protected function set_initial_groups()\n {\n $this->_groups = apply_filters('ngg_admin_requirements_manager_groups', array('phpext' => __('NextGen Gallery requires the following PHP extensions to function correctly. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'phpver' => __('NextGen Gallery has degraded functionality because of your PHP version. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'dirperms' => __('NextGen Gallery has found an issue trying to access the following files or directories. Please ensure the following locations have the correct permissions:', 'nggallery')));\n }", "public function setGroups($groups);", "function egsr_add_group_site_roles()\n{\n // Exit if script is run from other than Admin\n if ( !current_user_can('administrator') ) {\n return;\n }\n $group_site_roles = egsr_custom_site_roles();\n foreach ($group_site_roles as $key => $value) {\n $role = get_role($key);\n // Check if Role doesn't exist already\n if(!isset($role->name) == $key){\n // Add role + capabilities\n add_role(\n $key,\n $value['label'],\n $value['caps']\n );\n }\n }\n}", "function initGroups() {\n $groups = array(0 => array('alias' => 'members',\n 'model' => 'Group',\n 'foreign_key' => 1),\n 1 => array('alias' => 'moderators',\n 'model' => 'Group',\n 'foreign_key' => 2),\n 2 => array('alias' => 'administrators',\n 'model' => 'Group',\n 'foreign_key' => 3));\n\n foreach ($groups as $data) {\n $this->Acl->Aro->create();\n $this->Acl->Aro->save($data);\n }\n }", "function psp_add_role_caps()\n{\n $roles = array('manager');\n\n // Loop through each role and assign capabilities\n foreach ($roles as $the_role) {\n\n $role = get_role($the_role);\n\n $role->add_cap('read');\n $role->add_cap('create_cpt_project');\n $role->add_cap('create_private_cpt_project');\n $role->add_cap('read_cpt_project');\n $role->add_cap('read_private_cpt_project');\n $role->add_cap('edit_cpt_project');\n $role->add_cap('edit_published_cpt_project');\n $role->add_cap('publish_cpt_project');\n $role->add_cap('delete_private_cpt_project');\n $role->add_cap('delete_published_cpt_project');\n\n }\n}", "function CBGroups() {\n global $Cbucket;\n $this->cat_tbl = 'group_categories';\n $this->gp_tbl = 'groups';\n $this->gp_mem_tbl = 'group_members';\n //We will using CB Commenting system as posts\n //$this->gp_post_tbl = 'group_posts';\n $this->gp_topic_tbl = 'group_topics';\n $this->gp_invite_tbl = 'group_invitations';\n $this->gp_vdo_tbl = 'group_videos';\n\n //Adding Actions such Report, share,fav etc\n $this->action = new cbactions();\n $this->action->type = 'g';\n $this->action->name = 'group';\n $this->action->obj_class = 'cbgroup';\n $this->action->check_func = 'group_exists';\n $this->action->type_tbl = $this->gp_tbl;\n $this->action->type_id_field = 'group_id';\n \n \n if (isSectionEnabled('groups'))\n $Cbucket->search_types['groups'] = \"cbgroup\";\n \n }", "public function group_add_member( $args, $assoc_args ) {\n\t\t$r = wp_parse_args( $assoc_args, array(\n\t\t\t'group-id' => null,\n\t\t\t'user-id' => null,\n\t\t\t'role' => 'member',\n\t\t) );\n\n\t\t// Convert --group_id to group ID\n\t\t// @todo this'll be screwed up if the group has a numeric slug\n\t\tif ( ! is_numeric( $r['group-id'] ) ) {\n\t\t\t$group_id = groups_get_id( $r['group-id'] );\n\t\t} else {\n\t\t\t$group_id = $r['group-id'];\n\t\t}\n\n\t\t// Check that group exists\n\t\t$group_obj = groups_get_group( array( 'group_id' => $group_id ) );\n\t\tif ( empty( $group_obj->id ) ) {\n\t\t\tWP_CLI::error( 'No group found by that slug or id.' );\n\t\t}\n\n\t\t// Convert --user_id to user ID\n\t\t// @todo this'll be screwed up if user has a numeric user_login\n\t\t// @todo Have to use user-id because WP_CLI hijocks --user\n\t\tif ( ! is_numeric( $r['user-id'] ) ) {\n\t\t\t$user_id = (int) username_exists( $r['user-id'] );\n\t\t} else {\n\t\t\t$user_id = $r['user-id'];\n\t\t\t$user_obj = new WP_User( $user_id );\n\t\t\t$user_id = $user_obj->ID;\n\t\t}\n\n\t\tif ( empty( $user_id ) ) {\n\t\t\tWP_CLI::error( 'No user found by that username or id' );\n\t\t}\n\n\t\t// Sanitize role\n\t\tif ( ! in_array( $r['role'], array( 'member', 'mod', 'admin' ) ) ) {\n\t\t\t$r['role'] = 'member';\n\t\t}\n\n\t\t$joined = groups_join_group( $group_id, $user_id );\n\n\t\tif ( $joined ) {\n\t\t\tif ( 'member' !== $r['role'] ) {\n\t\t\t\t$the_member = new BP_Groups_Member( $user_id, $group_id );\n\t\t\t\t$member->promote( $r['role'] );\n\t\t\t}\n\n\t\t\t$success = sprintf(\n\t\t\t\t'Added user #%d (%s) to group #%d (%s) as %s',\n\t\t\t\t$user_id,\n\t\t\t\t$user_obj->user_login,\n\t\t\t\t$group_id,\n\t\t\t\t$group_obj->name,\n\t\t\t\t$r['role']\n\t\t\t);\n\t\t\tWP_CLI::success( $success );\n\t\t} else {\n\t\t\tWP_CLI::error( 'Could not add user to group.' );\n\t\t}\n\t}", "function wp_cache_add_global_groups($groups)\r\n\t{\r\n\t\tglobal $wp_object_cache;\r\n\t\tif (!is_array($groups)) {\r\n\t\t\t$groups = array($groups);\r\n\t\t}\r\n\r\n\t\t$wp_object_cache->add_global_groups($groups);\r\n\t}", "public function testAvailableGroupMembersOperations()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function ef_manage_usergroups_cap() {\n\t\treturn 'manage_zones';\n\t}", "function member_groups_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-groups.php\" );\r\n }", "function wp_cache_add_global_groups($groups)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->add_global_groups($groups);\n}", "function egsr_group_admin_cap(){\n return Array ( \n 'add_users' => true,\n 'create_users' => true,\n 'delete_users' => true,\n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'edit_users' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}", "public function add_capabilties_to_roles()\n {\n $post_type_object = get_post_type_object($this->name);\n global $wp_roles;\n $roles = array('administrator');\n foreach( (array)$post_type_object->cap as $capability ){\n foreach( $roles as $role_name ){\n $role = get_role($role_name);\n $role->add_cap($capability);\n }\n }\n }", "function lobby_membersapi_add($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$gid = (int)$args['gid'];\r\n\t$text = $args['text'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$group = pnModAPIFunc('lobby','groups','get',array('id' => $gid));\r\n \t\t$groupOwner = (($group['uid'] == pnUserGetVar('uid')) || (SecurityUtil::checkPermission('lobby::'.$id, '::', ACCESS_ADMIN)));\r\n\t \tif ($group['id'] != $gid) {\r\n\t \t \t// Something went wrong, groups not existent or something like that\r\n\t \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\t return false;\r\n\t\t} else {\r\n\t\t\t$obj = array(\r\n\t\t\t\t'gid' \t=> $gid, \r\n\t\t\t\t'uid' \t=> $uid,\r\n\t\t\t\t'text'\t=> $text,\r\n\t\t\t\t'date'\t=> date(\"Y-m-d H:i:s\",time())\r\n\t\t\t\t);\r\n\t\t\tif (($group['moderated'] == 1) && ($group['uid'] != $uid)) {\r\n\t\t\t \t// is the member already member or pending?\r\n\t\t\t \t$table = pnDBGetTables();\r\n\t\t\t \t$column_pending = $table['lobby_members_pending_column'];\r\n\t\t\t \t$column_members = $table['lobby_members_column'];\r\n\t\t\t \t$where_pending = $column_pending['uid'].\" = \".$uid.\" AND \".$column_pending['gid'].\" = \".$gid;\r\n\t\t\t \t$where_members = $column_members['uid'].\" = \".$uid.\" AND \".$column_members['gid'].\" = \".$gid;\r\n\t\t\t \t$pending_count = (int)DBUtil::selectObjectCount('lobby_members_pending',$where_pending);\r\n\t\t\t \t$members_count = (int)DBUtil::selectObjectCount('lobby_members',$where_members);\r\n\t\t\t \tif ($pending_count > 0) {\r\n\t\t\t \t \t// if the call was done by the group owner we will move the contact from pending status\r\n\t\t\t \t \tif ($groupOwner) {\r\n\t\t\t \t \t \t// get object, add it into member table and delete delte it from pending table\r\n\t\t\t\t\t\t$pending = DBUtil::selectObject('lobby_members_pending',$where_pending);\r\n\t\t\t\t\t\t$result = DBUtil::deleteObject($pending,'lobby_members_pending');\r\n\t\t\t\t\t\tif (!$result) {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($members_count == 0) {\r\n\t\t\t\t\t\t \tif (!$result) {\r\n\t\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_PENDING);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ($members_count > 0) {\r\n\t\t\t\t return LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$result = DBUtil::insertObject($obj,'lobby_members_pending');\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\treturn LogUtil::registerStatus(_LOBBY_GROUP_REQUESTSENT);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_JOINERROR);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t \t// Insert Member now into database\r\n\t\t\t$result = DBUtil::insertObject($obj,'lobby_members');\r\n\t\t\t// Set message\r\n\t\t\tif ($result) {\r\n\t\t\t\tLogUtil::registerStatus(str_replace('%member%',pnUserGetVar('uname', $uid),_LOBBY_GROUPS_MEMBERADDED));\r\n\t\t\t} else {\r\n\t\t\t \tLogUtil::registerError(_LOBBY_GROUPS_ADDERROR);\r\n\t\t\t}\r\n\t\t\t// Send an Email to the user that was added\r\n\t\t\tif ($group['uid'] == $uid) {\r\n\t\t\t\t// ToDo: Email schicken \"wurde hinzugefügt\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}" ]
[ "0.62245727", "0.6145485", "0.6112509", "0.60747296", "0.5959585", "0.59029156", "0.5869927", "0.5846684", "0.5831338", "0.5802345", "0.5800711", "0.57932204", "0.578242", "0.577365", "0.571608", "0.5683773", "0.56493676", "0.56434727", "0.56179786", "0.5581424", "0.5561272", "0.55568534", "0.55534697", "0.5541417", "0.55196685", "0.5494131", "0.54811376", "0.5480252", "0.5471292", "0.54502124" ]
0.7877894
0
System::getRelease Gets release name of operating system
public function getRelease() { return php_uname('r'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _releaseName()\n {\n return \"Version {$this->version}\" . ($this->name ? \": {$this->name}\" : '');\n }", "protected function getSystem()\n {\n $uname = strtolower( php_uname() );\n\n if (str_contains( $uname, 'darwin' )) {\n return 'macosx';\n } elseif (str_contains( $uname, 'win' )) {\n return 'windows';\n } elseif (str_contains( $uname, 'linux' )) {\n return PHP_INT_SIZE === 4 ? 'linux-i686' : 'linux-x86_64';\n } else {\n throw new \\RuntimeException( 'Unknown operating system.' );\n }\n }", "private function osx_system_version () {\n\t\tif ($handle = popen(\"/usr/bin/sw_vers\", \"r\")) {\n\t\t while (!feof($handle)) {\n\t\t\t\t$buffer = fgets($handle, 1024);\n\t\t\t\tif (eregi(\"^ProductVersion:[[:space:]]*(.*)\", $buffer, $captures)) {\n\t\t\t\t\t$parts = explode(\".\", $captures[1]);\n\t\t\t\t\treturn $parts[0].$parts[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\tpclose($handle);\n\t\t}\n\n\t\t// Return 10.0 which is the olden system we can run on\n\t\treturn \"100\";\n\t}", "public function getOperatingSystem() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = '';\n\t\t\t$cmd = 'sw_vers';\n\t\t\t\n\t\t\t// Execute Command/Parse Results\n\t\t\tself::execute($cmd, $output);\n\t\t\t\n\t\t\t$name = explode(':', $output[0]);\n\t\t\t$name = trim($name[1]);\n\t\t\t\n\t\t\t$version = explode(':', $output[1]);\n\t\t\t$version = trim($version[1]);\n\t\t\t\n\t\t\t$result = $name . ' (' . $version . ')';\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function version(): string\n {\n return Version::RELEASE;\n }", "private function lookupDistribution(): string\n {\n $res = self::$wmi->ExecQuery('SELECT * FROM Win32_OperatingSystem');\n\n foreach ($res as $os) {\n return $os->Caption;\n }\n\n return 'Windows NT';\n }", "public static function getSoftwareName()\n\t\t{\n\t\t\treturn 'Wordpress 3.9.1 en WooCommerce 3.0.0+';\n\t\t}", "public function getOS()\n {\n return $this->getParam(self::SOFTWARE_OS_PARAM_NAME);\n }", "public function getVersionString() {\n\t\tif ($this->installedVersion === 'core') {\n\t\t\treturn Cgn_SystemRunner::getReleaseNumber();\n\t\t}\n\t\treturn $this->installedVersion;\n\t}", "public function getRelease($version);", "public function getVersion()\n {\n return php_uname('v');\n }", "public function getOsVersion() : string\n {\n return $this->osVersion;\n }", "public function getName()\n {\n return PHP_OS;\n }", "static public function getOS(): string\n {\n return php_uname('s');\n }", "function determineOSVersion(&$OS)\r\n {\r\n ob_start();\r\n $result = shell_exec('cat /etc/redhat-release');\r\n if ( $OS === ON_METAL_OS_TYPE ) {\r\n $OS = $result;\r\n } else {\r\n if (!is_null($result)) {\r\n $resultArray = explode(' ', $result);\r\n if (count($resultArray) > 2) {\r\n $OS .= ' ' . $resultArray[2];\r\n }\r\n }\r\n }\r\n ob_end_clean();\r\n }", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function latestReleaseVersion()\n {\n // in order to correctly format relative URLs in the readme\n return Arr::get($this->latestRelease(), 'tag_name', 'master');\n }", "public function getInfo()\n {\n return php_uname();\n }", "public static function getOS()\n {\n switch (true) {\n case stristr(PHP_OS, 'DAR'): return 'OSX';\n case stristr(PHP_OS, 'WIN'): return 'WIN';\n case stristr(PHP_OS, 'LINUX'): return 'LINUX';\n default : return 'UNKNOWN';\n }\n }", "public function getOsName()\n {\n return $this->os;\n }", "function GetNameFromVersion($platform)\n {\n return $this->OperatingSystems[$platform];\n }", "public function get_firmwareRelease(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::FIRMWARERELEASE_INVALID;\n }\n }\n $res = $this->_firmwareRelease;\n return $res;\n }", "public function getAppReleaseDate() : string {\n return $this->configVars['version-info']['release-date'];\n }", "public function getRelease() {}", "public function getName()\n {\n return php_uname('s');\n }", "public static function systemVersion()\n {\n return DirPaths::version().\n FileNames::VERSION;\n }", "public function getPoolRelease()\n\t{\n\t\treturn($this->getProperty('release'));\n\t}", "public function getOs() : string\n {\n return $this->os;\n }", "public function platform(): string;", "function sysName(){\n\tglobal $driver;\n\t$sql\t=\t\"SELECT systemname FROM settings\"; //Retrieve the system name\n\tif($appname\t= $driver->perform_request($sql)):\n\t\t$row\t= $driver->load_data($appname);\n\t\t$sysname\t=\t(!empty($row['systemname']))?($row['systemname']):\" Microfinance \";//Retrieved system name\n\telse:\n\t\t\tdie('<p class=\"error\">ERROR Retrieving Application name.<br/>'.mysql_error().'</p>');\n\tendif;\n\treturn $sysname; //The application name\n}" ]
[ "0.6956437", "0.69379556", "0.68139905", "0.67924905", "0.6734099", "0.6637042", "0.6613718", "0.66103786", "0.6498195", "0.6497759", "0.6473067", "0.6468022", "0.63888663", "0.638464", "0.63592863", "0.63353884", "0.6326987", "0.6297551", "0.6267218", "0.6265184", "0.6251841", "0.6231458", "0.62087786", "0.616653", "0.6163513", "0.6163187", "0.61471224", "0.6116871", "0.6113332", "0.59968454" ]
0.81565595
0
System::getMachine Gets machine type.
public function getMachine() { return php_uname('m'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getMachine()\n {\n return $this->machine;\n }", "public function getMachineInformation($machine = null);", "function TypeMachine() { // Test si backuppc est installe en local sur un Se3 ou un Slis ou une machine dediee\n\tif(is_dir(\"/usr/share/se3\")) {\n\t\treturn Se3;\n\t}\t\n\tif(file_exists(\"/etc/version_slis\")) {\n\t\treturn Slis;\n\t}\n\tif(is_dir(\"/usr/share/lcs\")) {\n\t\treturn Lcs;\n\t}\t\n}", "public function getMachineName()\n {\n return $this->machineName;\n }", "protected function generateMachineName() {\n $class_name = get_class($this);\n return self::machineFromClass($class_name);\n }", "public function getMachineTag()\n {\n return $this->getAdapter()->getMachineTag();\n }", "private function registerSystemType() {\r\n return preg_match('/windows/i', getenv('COMSPEC')) ? 'WINDOWS' : 'UNIX';\r\n }", "public function get($project, $machineType, $optParams = array()) {\n $params = array('project' => $project, 'machineType' => $machineType);\n $params = array_merge($params, $optParams);\n $data = $this->__call('get', array($params));\n if ($this->useObjects()) {\n return new Google_MachineType($data);\n } else {\n return $data;\n }\n }", "public function platform(): string;", "function fetch_os()\n\t{\n\t\t$useragent = strtolower($this->my_getenv('HTTP_USER_AGENT'));\n\t\t\n\t\tif ( strstr( $useragent, 'mac' ) )\n\t\t{\n\t\t\treturn 'mac';\n\t\t}\n\t\t\n\t\tif ( preg_match( '#wi(n|n32|ndows)#', $useragent ) )\n\t\t{\n\t\t\treturn 'windows';\n\t\t}\n\t\t\n\t\treturn 'unknown';\n\t}", "public function getResourceMachineName();", "private function getMachineInfo()\n {\n $info = array();\n $info['hostname'] = php_uname('n');\n\n if (empty($info['hostname'])) {\n $this->logger->critical('Unable to identify machine hostname', array($this));\n throw new RuntimeException('Unable to identify machine hostname');\n }\n $info['processId'] = $this->procesId;\n $info['time'] = (int) floor(microtime(true) * 1000);\n\n return $info;\n }", "protected function generateMachineName() {\n return $this->args['machine_name'];\n }", "public function getSystem() {\n\t\treturn $this->system;\n\t}", "function platform(){\n\n\t\treturn (new user_agent)->platform();\n\n\t}", "public function getSystem()\n {\n return $this->system;\n }", "public function getSystem()\n {\n return $this->system;\n }", "public function getInfo()\n {\n return php_uname();\n }", "public function getSystem() {\n return $this->system;\n }", "function RetrieveServerType()\r\n{\r\n\t$serverName = $_SERVER['SERVER_NAME'];\r\n\r\n\tswitch($serverName)\r\n\t{\r\n\t\tcase \"localhost\":\r\n\t\t\t/*\r\n\t\t\t\tLocalhost may be one of two types of servers.\r\n\t\t\t\tIt may be a developer workstation connected to the\r\n\t\t\t\tEchostar system or it may be a stand alone system.\r\n\t\t\t\tThe mechanism for determining this is a variable\r\n\t\t\t\tdeclared in the php.ini file called\r\n\t\t\t\t'catena_offline'.\r\n\t\t\t\tIf this variable is set to 1, then we'll use the\r\n\t\t\t\tlocal connection data instead of the developer data.\r\n\t\t\t*/\r\n\t\t\t$catena_offline = ini_get ( \"catena_offline\");\r\n\r\n\t\t\tif($catena_offline == \"1\")\r\n\t\t\t{\r\n\t\t\t\t$retType = SITE_OFFLINE;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$retType = SITE_WORKSTATION;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"catena.echostar.com\":\r\n\t\t\t/*\r\n\t\t\t\tThis server name appears to the server when\r\n\t\t\t\tthe client connects via the linux boxes. For some\r\n\t\t\t\treason the DNS lists a different name.\r\n\t\t\t*/\r\n\t\t\t$retType = SITE_PRODUCTION;\r\n\t\t\tbreak;\r\n\t\tcase \"catena\":\r\n\t\t\t$retType = SITE_PRODUCTION;\r\n\t\t\tbreak;\r\n\t\tcase \"catena-test\":\r\n\t\t\t$retType = SITE_TEST;\r\n\t\t\tbreak;\r\n\t\tcase \"catena-test.echostar.com\":\r\n\t\t\t$retType = SITE_TEST;\r\n\t\t\tbreak;\r\n\t\tcase \"catena-dev\":\r\n\t\t\t$retType = SITE_DEV;\r\n\t\t\tbreak;\r\n\t\tcase \"catena-dev.echostar.com\":\r\n\t\t\t$retType = SITE_DEV;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t/* someone is running this on an unspecified\r\n\t\t\twebsite and therefore will not run properly.\r\n\t\t\tShutdown();\r\n\t\t\t*/\r\n\t\t\tdie(\"Attempting to run on unconfigured web server [$serverName]. Please go to http://catena-test.echostar.com for the Test Site.\");\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn $retType;\r\n}", "public function isMachine($name);", "function getOSType()\r\n{\r\n\tglobal $garEnvConfig;\r\n\r\n\treturn $garEnvConfig[\"OS_TYPE\"];\r\n}", "public function setMachineType($value)\n {\n return $this->set('MachineType', $value);\n }", "public function setMachineType($value)\n {\n return $this->set('MachineType', $value);\n }", "public function getDeviceType()\n {\n if (array_key_exists(\"deviceType\", $this->_propDict)) {\n return $this->_propDict[\"deviceType\"];\n } else {\n return null;\n }\n }", "public function platform()\n\t{\n\t\t$this->platforms = array(\n\t\t\t'/windows nt 10/i' \t=> 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n\t\t\t'/ubuntu/i' => 'Ubuntu',\n '/linux/i' => 'Linux',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile',\n '/android/i'\t\t\t=> \t'Android'\n\t\t);\n\t\t\n\t\tforeach($this->platforms as $key => $value)\n\t\t{\n\t\t\tif(preg_match($key,$this->ua))\n\t\t\t\treturn $this->platform = $value;\n\t\t}\n\n\t\treturn $this->platform = \"Unknown Platform\";\n\t}", "public function getSystem()\n {\n $value = $this->get(self::system);\n return $value === null ? (integer)$value : $value;\n }", "function determineOs() {\n\t\n\t$ret\t\t\t= \"undef\";\n\t\n\tob_start();\n\teval(\"phpinfo();\");\n\t$info \t\t\t= ob_get_contents();\n\tob_end_clean();\n\t\n\tforeach(explode(\"\\n\", $info) as $line) \t{\n\t \n\t if(strpos($line, \"System\")!== false) {\n\t \n\t $show \t= trim(str_replace(\"System\",\"\", strip_tags($line)));\n\t \n\t }\n\t}\n\t\n\tif( preg_match('/WIN/i', $show) ) {\n\t \n\t $ret\t= \"windows\";\n\t} else {\n\t $ret\t= \"unix\";\n\t}\n\n\treturn( $ret );\n}", "static public function getArch(): string\n {\n return php_uname('m');\n }", "public function getOS() { \n \n $server_data = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"Unknown OS Platform\";\n\n $os_array = array(\n '/windows nt 10/i' => 'Windows',\n '/windows nt 6.3/i' => 'Windows',\n '/windows nt 6.2/i' => 'Windows',\n '/windows nt 6.1/i' => 'Windows',\n '/windows nt 6.0/i' => 'Windows',\n '/windows nt 5.2/i' => 'Windows',\n '/windows nt 5.1/i' => 'Windows',\n '/windows xp/i' => 'Windows',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $server_data)) {\n $os_platform = $value;\n }\n } \n\n return $os_platform;\n }" ]
[ "0.76567346", "0.70827305", "0.70074177", "0.686995", "0.6705365", "0.66833216", "0.6459227", "0.64413685", "0.62704444", "0.6259735", "0.61750305", "0.6092017", "0.606981", "0.6058667", "0.60466933", "0.6034719", "0.6034719", "0.6003156", "0.5985312", "0.59580714", "0.59494936", "0.5945288", "0.59321886", "0.59291553", "0.592241", "0.59062386", "0.5891056", "0.58784044", "0.5838146", "0.58371234" ]
0.7976443
0
System::getPhpSapi Returns a lowercase string that describes the type of interface (the Server API, SAPI) that PHP is using. For example, in CLI PHP this string will be "cli" whereas with Apache it may have several different values depending on the exact SAPI used. Possible values are listed below.
public function getPhpSapi() { return php_sapi_name(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getApiClass(): string\n {\n return $this->apiClass;\n }", "static function Protocol ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn 'cli';\n\t\t\t$x = (isset($_SERVER['HTTPS'])) ? $_SERVER['HTTPS'] : '';\n\t\t\tif ($x == \"off\" or $x == \"\")\n\t\t\t\treturn \"http\";\n\t\t\telse\n\t\t\t\treturn \"https\";\n\t\t}", "public function getOsapi()\n {\n return Controllers\\OsapiController::getInstance();\n }", "public function getApiCode();", "public function tampilSapi()\n {\n return $this->db->get('tb_sapi');\n }", "public function getType(): string\n {\n return Client::QUERY_API;\n }", "protected static function getPhpInfo() {}", "function getApiMode()\n {\n return $this->_props['ApiMode'];\n }", "public function getApiService();", "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "static public function getOS(): string\n {\n return php_uname('s');\n }", "public function getApi();", "public function getApi();", "public function getApi();", "protected static function getFacadeAccessor(): string\n {\n return 'swapi';\n }", "function determineOs() {\n\t\n\t$ret\t\t\t= \"undef\";\n\t\n\tob_start();\n\teval(\"phpinfo();\");\n\t$info \t\t\t= ob_get_contents();\n\tob_end_clean();\n\t\n\tforeach(explode(\"\\n\", $info) as $line) \t{\n\t \n\t if(strpos($line, \"System\")!== false) {\n\t \n\t $show \t= trim(str_replace(\"System\",\"\", strip_tags($line)));\n\t \n\t }\n\t}\n\t\n\tif( preg_match('/WIN/i', $show) ) {\n\t \n\t $ret\t= \"windows\";\n\t} else {\n\t $ret\t= \"unix\";\n\t}\n\n\treturn( $ret );\n}", "public function shopsystemInfoAction()\n\t{\n $this->checkShopToken();\n \n $shopsystem = 'shopware';\n $shopsystem_human = Shopware()->App().' '.Shopware()->Config()->version;\n $shopsystem_version = Shopware()->Config()->version;\n $api_version = Shopware_Plugins_Frontend_EasymIntegration_Bootstrap::getVersion();\n \n $jsondata = array(\n 'shopsystem' => $shopsystem,\n 'shopsystem_human' => $shopsystem_human,\n 'shopsystem_version' => $shopsystem_version,\n 'api_version' => $api_version \n );\n \n $this->printOutput($jsondata);\n }", "public function getApiNameSpace(): string\n {\n if ($this->namespace === null) {\n return Arr::get($this->component->getComponentNameSpace(), 'api');\n }\n\n return $this->namespace;\n }", "public static function findServerOS()\n {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n return 'WIN';\n }\n\n return 'LINUX';\n }", "public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }", "public function getName()\n {\n return PHP_OS;\n }", "public static function detectServerSoftware()\n\t{\n\n\t\tif(preg_match('/^lighttpd/', $_SERVER['SERVER_SOFTWARE']))\n\t\t{\n\t\t\treturn self::LIGHTTPD;\n\t\t}\n\n\t\tif(preg_match('/^Apache/', $_SERVER['SERVER_SOFTWARE']))\n\t\t{\n\t\t\treturn self::APACHE;\n\t\t}\n\n\t\treturn self::OTHER;\n\t}", "public static function isRunningOnCgiServerApi() {}", "public function isPhp() {}", "public function getHeaderTargetAPI()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__TARGET_API];\r\n\t}", "protected function getApiClass(): string {\n\t\treturn CurrentUser::class;\n\t}", "static function getOS(){\n\t\trequire_once(\"knj/functions_array.php\");\n\t\t$bots = array(\n\t\t\t\"yahoo! slurp\",\n\t\t\t\"msnbot\",\n\t\t\t\"googlebot\",\n\t\t\t\"adsbot\",\n\t\t\t\"ask jeeves\",\n\t\t\t\"conpilot crawler\",\n\t\t\t\"yandex\",\n\t\t\t\"exabot\",\n\t\t\t\"hostharvest\",\n\t\t\t\"dotbot\",\n\t\t\t\"ia_archiver\",\n\t\t\t\"httpclient\",\n\t\t\t\"spider.html\",\n\t\t\t\"comodo-certificates-spider\",\n\t\t\t\"sbider\",\n\t\t\t\"speedy spider\",\n\t\t\t\"spbot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"scoutjet\",\n\t\t\t\"com_bot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"robot.html\",\n\t\t\t\"robot.htm\",\n\t\t\t\"catchbot\",\n\t\t\t\"baiduspider\",\n\t\t\t\"setoozbot\",\n\t\t\t\"sslbot\",\n\t\t\t\"browsershots\",\n\t\t\t\"perl\",\n\t\t\t\"wget\",\n\t\t\t\"w3c_validator\"\n\t\t);\n\t\t\n\t\tif (array_key_exists(\"HTTP_USER_AGENT\", $_SERVER)){\n\t\t\t$ua = strtolower($_SERVER[\"HTTP_USER_AGENT\"]);\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t\t\n\t\tif (strpos($ua, \"windows\") !== false){\n\t\t\treturn \"windows\";\n\t\t}elseif(strpos($ua, \"linux\") !== false){\n\t\t\treturn \"linux\";\n\t\t}elseif(strpos($ua, \"mac\") !== false){\n\t\t\treturn \"mac\";\n\t\t}elseif(strpos($ua, \"playstation\") !== false){\n\t\t\treturn \"playstation\";\n\t\t}elseif(strpos($ua, \"nintendo wii\") !== false){\n\t\t\treturn \"wii\";\n\t\t}elseif(knjarray::stringsearch($ua, $bots)){\n\t\t\treturn \"bot\";\n\t\t}elseif(strpos($ua, \"sunos\") !== false){\n\t\t\treturn \"sun\";\n\t\t}elseif(trim($ua) == \"\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t}", "function systype()\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\t$data = ftp_systype($this->_socket);\r\n \t} else {\r\n \t$this->putcmd(\"SYST\");\r\n \t$data = $this->getresp();\r\n \t}\r\n \tif ($data) {\r\n \t\t$DATA = explode(\" \", $data);\r\n \t\treturn $DATA[1];\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}\r\n }", "public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }", "public function getApiBase();" ]
[ "0.5448253", "0.5331873", "0.52882266", "0.52561283", "0.52375215", "0.51974726", "0.5190993", "0.5165048", "0.5122094", "0.5061617", "0.5045423", "0.5019039", "0.5019039", "0.5019039", "0.50107116", "0.50074196", "0.50033766", "0.49921668", "0.4947159", "0.49337086", "0.49284366", "0.4919044", "0.49129364", "0.4910084", "0.4909595", "0.49086493", "0.48959264", "0.48790634", "0.48721504", "0.4860767" ]
0.75939727
0
System::getPhpVersion Gets the current PHP version
public function getPhpVersion() { return phpversion(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPhpVersion() {}", "public static function php_version()\n {\n $ve = phpversion();\n $ve = explode('-', $ve);\n return $ve[0];\n }", "function getPhpVersion() {\n\t\n\t$version \t\t\t\t\t= explode( \".\", PHP_VERSION );\n\n\treturn( $version[0].$version[1] );\t\n}", "public function PHP_version()\n\t{\n\t\tif (defined('HHVM_VERSION')) {\n\t\t\treturn 'HHVM ' .HHVM_VERSION . '<br/>(PHP '.str_replace('-hhvm', '', phpversion()).')';\n\t\t\t//return 'PHP ' . phpversion() . '('. HHVM_VERSION . ')';\n\t\t} else {\n\t\t\treturn 'PHP ' . phpversion() .' (' . php_sapi_name().')';\n\t\t}\n\t}", "public function get_test_php_version()\n {\n }", "protected function checkPhpVersion() {}", "public static function getScannerPhpVersion()\n {\n return self::$scannerPhpVersion;\n }", "public function getVersion()\n {\n return php_uname('v');\n }", "public static function getCurrentPhpName()\n {\n if (self::$currentPhpVersion !== null) {\n return self::$currentPhpVersion;\n }\n\n return getenv('PHPBREW_PHP');\n }", "public function checkPHPVersion() {\n\t\tif (version_compare(phpversion(), self::PHP_DEPRECATING, '>=')) {\n\t\t\treturn self::VERSION_COMPATIBLE;\n\t\t}\n\t\t\n\t\tif (self::PHP_DEPRECATING != self::PHP_MINIMUM && version_compare(phpversion(), self::PHP_MINIMUM, '>=')) {\n\t\t\treturn self::VERSION_DEPRECATED;\n\t\t}\n\t\t\n\t\treturn self::VERSION_UNSUPPORTED;\n\t}", "public function getPhpVersionConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPversion');\n\t}", "public static function get_version()\n {\n return \\Dekode\\GravityForms\\Vendor\\PHP_CodeSniffer\\Config::VERSION;\n }", "protected static function getPhpInfo() {}", "function versionPhp(){\r\n\t\t$test = phpversion();\r\n\t\t// on teste le premier chiffre\r\n\t\t$version = mb_substr($test, 0, 1);\r\n\t\tif ($version == 7) {\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().' (Gepi nécessite php 5.2.x minimum)</span>';\r\n\t\t} elseif ($version == 5) {\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().' (Gepi nécessite php 5.2.x minimum)</span>';\r\n\t\t} elseif($version == 4 AND mb_substr($test, 2, 2) >= 3){\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().'(Attention, Gepi ne fonctionne pas avec cette version, elle est trop ancienne)</span>';\r\n\t\t}else{\r\n\t\t\t$retour = '<span style=\"color: red;\">'.phpversion().'(version ancienne !)</span>';\r\n\t\t}\r\n\t\treturn $retour;\r\n\t}", "private static function check_php() {\n\t\treturn version_compare( phpversion(), self::MINIMUM_PHP_VERSION, '>=' );\n\t}", "private static function getPhpVersionInfo()\n {\n $currentVersionFull = PHP_VERSION;\n preg_match(\"#^\\d+(\\.\\d+)*#\", $currentVersionFull, $filtered);\n $currentVersion = $filtered[0];\n\n return [\n 'full' => $currentVersionFull,\n 'version' => $currentVersion\n ];\n }", "public function getPhpCapVersion()\n {\n return Version::RELEASE_NUMBER;\n }", "public static function version()\r\n {\r\n return self::$version;\r\n }", "public static function checkPhpVersion()\n{\nif (version_compare(PHP_VERSION,'5.3.0') < 0)\n\t{\n\techo PHP_VERSION.': Unsupported PHP version '\n\t\t.'- PHK needs at least version 5.3.0';\n\texit(1);\n\t}\n}", "public function isPhpVersionSupported()\n {\n $app = App::instance();\n $php_value = phpversion();\n $php_error = (version_compare($php_value, App::REQUIRED_PHP_VERSION) != -1) ? false : true;\n $checking_result = ($php_error == false) ? true : false;\n\n if (!$checking_result) {\n $app->setNotification('E', App::instance()->t('error'), $app->t('text_php_version_notice', array('version', App::REQUIRED_PHP_VERSION)), true, 'validator');\n }\n\n return $checking_result;\n }", "public static function systemVersion()\n {\n return DirPaths::version().\n FileNames::VERSION;\n }", "public static function get_version() {\n return self::$version;\n }", "public function version() {\n\t\t$app = $this->app;\n\t\treturn intval($app::VERSION);\n\t}", "function get_version_id(): int\n{\n /** @var positive-int */\n return PHP_VERSION_ID;\n}", "public function get_version();", "public static function getScriptVersion()\n\t\t{\n\t\t\treturn self::VERSION;\n\t\t}", "public function min_php_version_check()\n {\n }", "function GetVersion()\n {\n return '1.0';\n }", "function get_version() {\n return self::VERSION;\n }", "function get_version() {\n return self::VERSION;\n }" ]
[ "0.8807255", "0.81383085", "0.81150204", "0.79493177", "0.7828537", "0.76385677", "0.7600098", "0.7422538", "0.7248716", "0.7247499", "0.7034696", "0.67681015", "0.67405987", "0.67179674", "0.661382", "0.6597687", "0.6593041", "0.6583454", "0.6579763", "0.6572927", "0.65679884", "0.65459347", "0.6520574", "0.65166", "0.64737207", "0.64701563", "0.6461596", "0.6449483", "0.6446152", "0.6446152" ]
0.8642211
1
System::getPhpExtensionVersion Gets php extension version.
public function getPhpExtensionVersion($extension) { return phpversion($extension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getExtensionVersion();", "protected function getPhpVersion() {}", "public function getExtensionVersion()\n {\n $moduleInfo = $this->moduleList->getOne(self::MODULE_CODE);\n\n return $moduleInfo['setup_version'];\n }", "public function getExtensionVersion()\n {\n $moduleInfo = $this->moduleList->getOne(self::MODULE_CODE);\n\n return $moduleInfo['setup_version'];\n }", "function getPhpVersion() {\n\t\n\t$version \t\t\t\t\t= explode( \".\", PHP_VERSION );\n\n\treturn( $version[0].$version[1] );\t\n}", "public function getPhpVersion()\n {\n return phpversion();\n }", "public static function php_version()\n {\n $ve = phpversion();\n $ve = explode('-', $ve);\n return $ve[0];\n }", "public static function getVersion(string $extension = null): string\n {\n $result = $extension ? phpversion($extension) : phpversion();\n\n return (string)$result;\n }", "public function getRequiredPhpExtension() {\n return $this->__requiredPhpExtension;\n }", "function sa_phpInfoLite() // Returns loaded PHP extensions and versions\n{\n $values = array(\n 'php' => phpversion(),\n 'os' => php_uname(),\n 'extensions' => get_loaded_extensions(),\n );\n\n // assign extension version if available\n if ($values['extensions']) {\n foreach ($values['extensions'] as $lkey => $extension) {\n $values['extensions'][$lkey] = phpversion($extension) ? $extension. \n ' ('. phpversion($extension). ')' : $extension;\n }\n }\n\n return $values;\n}", "public static function getPHPExtensionRequired(){\n\t\treturn 'java';\n\t}", "private static function scan_extension( $extension, $php_version ) {\n\t\t$result = array(\n\t\t\t'name' => $extension['basename'],\n\t\t\t'version' => $extension['version'],\n\t\t\t'files' => '',\n\t\t);\n\t\t$descriptors = array(\n\t\t\t0 => STDIN,\n\t\t\t1 => array( 'pipe', 'w' ),\n\t\t\t2 => array( 'pipe', 'w' ),\n\t\t);\n\n\t\t$known_upgrade_version = self::get_extension_known_upgradable( $php_version, $extension['type'], $result['name'] );\n\t\tif ( $known_upgrade_version && version_compare( $result['version'], $known_upgrade_version, '<' ) ) {\n\t\t\t$result['compat'] = 'with-update';\n\t\t\t$result['time'] = 'cached';\n\t\t\t$result['files'] = '';\n\t\t\treturn $result;\n\t\t}\n\n\t\t$php_compat_cache = getenv( 'WP_CLI_PHP_COMPAT_CACHE' );\n\t\tif ( $php_compat_cache ) {\n\t\t\t$cache_file = Utils\\trailingslashit( realpath( $php_compat_cache ) ) . $extension['type'] . 's/' . $extension['basename'] . '/' . $extension['basename'] . '.' . $extension['version'] . '.json';\n\t\t\tif ( file_exists( $cache_file ) ) {\n\t\t\t\t$cache_data = json_decode( file_get_contents( $cache_file ), true );\n\t\t\t\t$greater_than = false;\n\t\t\t\tif ( '-' === substr( $php_version, -1 ) ) {\n\t\t\t\t\t$greater_than = true;\n\t\t\t\t\t$php_version = substr( $php_version, 0, -1 );\n\t\t\t\t}\n\t\t\t\t$result['compat'] = 'success';\n\t\t\t\t$result['time'] = 'cached';\n\t\t\t\tforeach( $cache_data['php_versions'] as $phpv => $scan_data ) {\n\t\t\t\t\tif ( $phpv === $php_version || ( $greater_than && version_compare( $phpv, $php_version, '>' ) ) ) {\n\t\t\t\t\t\t$result['files'] = $scan_data['file_count'];\n\t\t\t\t\t\tif ( ! isset( $scan_data['error_count'] ) || $scan_data['error_count'] > 0 ) {\n\t\t\t\t\t\t\t$result['compat'] = 'failure';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\t$phpcs_exec = self::get_phpcs_exec();\n\n\t\t$base_check = $phpcs_exec . ' --standard=PHPCompatibility --runtime-set testVersion ' . escapeshellarg( $php_version ) . ' --extensions=php --ignore=/node_modules/,/bower_components/,/svn/ --parallel=4 --report=json';\n\t\t$start_time = microtime( true );\n\t\t$r = proc_open( $base_check . ' ' . escapeshellarg( dirname( $extension['path'] ) ), $descriptors, $pipes );\n\t\t$stdout = stream_get_contents( $pipes[1] );\n\t\tfclose( $pipes[1] );\n\t\t$stderr = stream_get_contents( $pipes[2] );\n\t\tfclose( $pipes[2] );\n\t\t$return_code = proc_close( $r );\n\t\t$end_time = microtime( true ) - $start_time;\n\t\t$result['time'] = round( $end_time, 2 ) . 's';\n\t\t$scan_result = json_decode( $stdout, true );\n\t\t$result['files'] = isset( $scan_result['files'] ) ? count( $scan_result['files'] ) : '';\n\t\tif ( isset( $scan_result['totals']['errors'] )\n\t\t\t&& 0 === $scan_result['totals']['errors'] ) {\n\t\t\t$result['compat'] = 'success';\n\t\t} else {\n\t\t\t$result['compat'] = 'failure';\n\t\t}\n\t\treturn $result;\n\t}", "public function get_test_php_version()\n {\n }", "public function getPhpExtensionsConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPextensions');\n\t}", "public function get_extension()\n {\n return $this->m_extension;\n }", "public function getPhpVersionConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPversion');\n\t}", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function PHP_version()\n\t{\n\t\tif (defined('HHVM_VERSION')) {\n\t\t\treturn 'HHVM ' .HHVM_VERSION . '<br/>(PHP '.str_replace('-hhvm', '', phpversion()).')';\n\t\t\t//return 'PHP ' . phpversion() . '('. HHVM_VERSION . ')';\n\t\t} else {\n\t\t\treturn 'PHP ' . phpversion() .' (' . php_sapi_name().')';\n\t\t}\n\t}", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension()\n {\n \treturn $this->_extension;\n }", "public function getPhpExtensions($zendExtensions = false)\n {\n return get_loaded_extensions($zendExtensions);\n }", "public function getExtension()\n {\n return $this->_extension;\n }", "protected function checkPhpVersion() {}", "public static function getScriptExtension(): string {\n return '.php';\n }", "public function ext()\n {\n if (!$this->info) {\n $this->info();\n }\n if (isset($this->info['extension'])) {\n return $this->info['extension'];\n }\n\n return false;\n }", "public function get_extension()\n {\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }" ]
[ "0.7763613", "0.7382882", "0.7342982", "0.7342982", "0.73380846", "0.72011083", "0.7086171", "0.7077336", "0.70646995", "0.6803845", "0.6693413", "0.6548632", "0.65398824", "0.6521994", "0.648378", "0.6462711", "0.64481264", "0.64481264", "0.63626575", "0.62920326", "0.62920326", "0.62841845", "0.62456656", "0.62238896", "0.6211829", "0.6207882", "0.6203035", "0.61897945", "0.6168191", "0.6168191" ]
0.8267087
0
System::isPhpExtensionLoaded Get Status Is Php Extension Loaded.
public function isPhpExtensionLoaded($extension) { return (bool)extension_loaded($extension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }", "protected function checkPhpExtensionEnabled($ext)\n {\n return extension_loaded($ext);\n }", "public function testExtensionLoaded(): void\n {\n $info = $this->createProvider(false)->getInformation();\n $this->assertEquals(true, $info['extension_loaded']);\n }", "public function getRequiredPhpExtension() {\n return $this->__requiredPhpExtension;\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "protected function checkPhpExtensions()\n\t{\n\t\tif (!extension_loaded('pcntl'))\n\t\t{\n\t\t\techo \"Extension pcntl not loaded\";\n\t\t\texit(1);\n\t\t}\n\n\t\t// This is used to kill processes\n\t\tif (!extension_loaded('posix'))\n\t\t{\n\t\t\techo \"Extension posix not loaded\";\n\t\t\texit(1);\n\t\t}\n\t}", "public function testPhpExtensionsAreValid()\n {\n $this->assert->php->extensions\n ->isLoaded('simplexml')\n ->isLoaded('fileinfo')\n ->isLoaded('xsl');\n // validate that fileinfo is loaded and configured properly\n $this->assert->php->extensions->fileinfo->isAlive();\n }", "public function getPhpExtensions($zendExtensions = false)\n {\n return get_loaded_extensions($zendExtensions);\n }", "public function hasExtension()\n {\n \treturn ( $this->_extension !== '' );\n }", "public function isExtensionLoaded($extension)\n {\n $extension = (string) $extension;\n\n if (($is = &$this->staticKey(__FUNCTION__, $extension)) !== null) {\n return $is; // Already cached this.\n }\n return $is = (bool) extension_loaded($extension);\n }", "public static function checkExistsPhp()\n {\n $server_info = AiBolitHelper::getServer()->get_info();\n $php = isset($server_info['phparr'][self::getScannerPhpVersion()]) ? $server_info['phparr'][self::getScannerPhpVersion()] : 0;\n return $php ? true : false;\n }", "public static function extension_loaded(string $name): bool {\n return false;\n }", "public static function getPHPExtensionRequired(){\n\t\treturn 'java';\n\t}", "function knowsExtension ($anExtension)\n\t{\n\t\t$result = in_array ($anExtension, $this->extensions);\n\t\treturn $result;\n\t}", "public function getPhpEnvironmentStatus()\n {\n $ok = true;\n\n if (!version_compare(PHP_VERSION, $this->_minPhpVersion, \">=\")) {\n $phpCheck = Mage::helper('emvcore')->__(\n 'Required PHP version is <strong>%s</strong> - current version <strong>%s</strong>.',\n $this->_minPhpVersion,\n PHP_VERSION\n );\n $ok = false;\n } else {\n $phpCheck = Mage::helper('emvcore')->__('Your PHP version (<strong>%s</strong>) is satisfied.', PHP_VERSION);\n }\n\n $required = array_merge($this->_defaultRequired, $this->_required);\n $missing = array();\n $loaded = array();\n /*\n * Run through PHP extensions to see if they are loaded\n * if no, add them to the list of missing\n */\n foreach ($required as $extName) {\n if (!extension_loaded($extName)) {\n $missing[] = $extName;\n }\n }\n\n if (count($missing)) {\n $ok = false;\n $extensionCheck = Mage::helper('emvcore')->__(\n 'Required Php Extensions are <strong>%s</strong>.',\n implode(', ', $required)\n );\n $extensionCheck .= ' ' . Mage::helper('emvcore')->__(\n 'The followings are missing : <strong>%s</strong>.',\n implode(', ', $missing)\n );\n } else {\n $extensionCheck = Mage::helper('emvcore')->__(\n 'All the required Php Extensions (<strong>%s</strong>) are correctly installed.',\n implode(', ', $required)\n );\n }\n\n if ($ok) {\n $image = $this->_getTickImageLink();\n } else {\n $image = $this->_getUnTickImageLink();\n }\n\n return Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> %s',\n $image,\n $phpCheck . ' ' . $extensionCheck\n );\n }", "public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }", "function sa_phpInfoLite() // Returns loaded PHP extensions and versions\n{\n $values = array(\n 'php' => phpversion(),\n 'os' => php_uname(),\n 'extensions' => get_loaded_extensions(),\n );\n\n // assign extension version if available\n if ($values['extensions']) {\n foreach ($values['extensions'] as $lkey => $extension) {\n $values['extensions'][$lkey] = phpversion($extension) ? $extension. \n ' ('. phpversion($extension). ')' : $extension;\n }\n }\n\n return $values;\n}", "function extension_loaded()\n{\n global $is_curl_mocked, $mocked_extension_loaded;\n return $is_curl_mocked ? $mocked_extension_loaded : call_user_func_array('\\curl_loaded', func_get_args());\n}", "public function ext()\n {\n if (!$this->info) {\n $this->info();\n }\n if (isset($this->info['extension'])) {\n return $this->info['extension'];\n }\n\n return false;\n }", "public function phpInfoActive() {\n\t\treturn $this->phpInfo;\n\t}", "function is_extension_activated( $extension, $autoload = true ) {\n\t\treturn class_exists( $extension, $autoload );\n\t}", "public function extension($ext)\r\n {\r\n self::getInstance();\r\n $loaded = extension_loaded($ext) ? \"TRUE\" : \"FALSE\";\r\n self::queue(\"Extension Loaded\", \"{$ext}: {$loaded}\");\r\n\r\n return self::$instance;\r\n }", "public function getPhpExtensionsConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPextensions');\n\t}", "public function isPHPModule() {\n if(PHP_SAPI == \"apache2handler\") {\n return true;\n } else {\n if(strpos(PHP_SAPI,\"handler\") !== false) {\n return true;\n }\n }\n return false;\n }", "protected function _extensionLoaded() {}", "public static function check_required_ext() {\r\n $shmop = extension_loaded('shmop');\r\n $sysvsem = extension_loaded('sysvsem');\r\n if ($shmop && $sysvsem) {\r\n return true;\r\n }\r\n $missing = array();\r\n if (!$shmop) {\r\n array_push($missing, 'shmop');\r\n }\r\n if (!$sysvsem) {\r\n array_push($missing, 'sysvsem');\r\n }\r\n if (count($missing) == 1) {\r\n throw new Exception('The PHP extension ' . $missing[0] . ' required by class ' . __CLASS__ . ' is not loaded or built into PHP.');\r\n }\r\n throw new Exception('The PHP extensions ' . implode(' and ', $missing) . ' required by class ' . __CLASS__ . ' are not loaded or built into PHP.');\r\n }", "public function hasExtension($name) {\n\t\treturn $this->connections [$this->active]->hasExtension ( $name );\n\t}", "public static function intl_loaded(): bool\n {\n return \\extension_loaded('intl');\n }", "public function hasLoadModule(){\n return $this->_has(6);\n }" ]
[ "0.7574251", "0.7430334", "0.7043803", "0.7029144", "0.6946219", "0.6946219", "0.692978", "0.681018", "0.6620381", "0.65959275", "0.656604", "0.6516076", "0.647203", "0.6459324", "0.6440494", "0.63664746", "0.6323508", "0.62972194", "0.6294766", "0.62927395", "0.62627786", "0.6211287", "0.61958873", "0.61946326", "0.619044", "0.61749804", "0.6167711", "0.61321455", "0.612948", "0.61230457" ]
0.7516038
1
System::getZendVersion Gets the version of the current Zend engine
public function getZendVersion() { return zend_version(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getZendOptimizerVersion()\n {\n return function_exists('zend_optimizer_version') ? zend_optimizer_version() : false;\n }", "public function get_version();", "protected function getPhpVersion() {}", "static public function compareVersion($version)\n {\n return version_compare($version, Zend::VERSION);\n }", "public function PHP_version()\n\t{\n\t\tif (defined('HHVM_VERSION')) {\n\t\t\treturn 'HHVM ' .HHVM_VERSION . '<br/>(PHP '.str_replace('-hhvm', '', phpversion()).')';\n\t\t\t//return 'PHP ' . phpversion() . '('. HHVM_VERSION . ')';\n\t\t} else {\n\t\t\treturn 'PHP ' . phpversion() .' (' . php_sapi_name().')';\n\t\t}\n\t}", "function get_version() {\n return self::VERSION;\n }", "function get_version() {\n return self::VERSION;\n }", "public static function php_version()\n {\n $ve = phpversion();\n $ve = explode('-', $ve);\n return $ve[0];\n }", "public function get_version()\n\t{\n\t\treturn $this->version;\n\t}", "abstract public function get_version();", "public static function get_version() {\n return self::$version;\n }", "function GetVersion()\n {\n return '1.0';\n }", "public function get_version() { \n\n\t\treturn $this->version; \n\n\t}", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public static function get_version()\n {\n return ub_stack::version;\n }", "function getPhpVersion() {\n\t\n\t$version \t\t\t\t\t= explode( \".\", PHP_VERSION );\n\n\treturn( $version[0].$version[1] );\t\n}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version(){\n return $this->_version;\n }", "public function get_version()\n {\n return $this->version;\n }", "public function get_version()\n {\n return $this->version;\n }", "public function getPhpVersion()\n {\n return phpversion();\n }" ]
[ "0.68574494", "0.6145823", "0.60486114", "0.5933849", "0.59260964", "0.5884513", "0.5884513", "0.583563", "0.58053654", "0.57984966", "0.57917696", "0.5765356", "0.5763264", "0.5761135", "0.57569456", "0.57504994", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573251", "0.573015", "0.57299274", "0.57299274", "0.57244325" ]
0.9006257
0
System::getZendOptimizerVersion Gets Version of Zend Optimizer
public function getZendOptimizerVersion() { return function_exists('zend_optimizer_version') ? zend_optimizer_version() : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOptimizerVersion()\n {\n return $this->optimizer_version;\n }", "public function getZendVersion()\n {\n return zend_version();\n }", "public function getCurrentOptimizer()\n {\n return Mage::registry('current_optimizer');\n }", "public function setOptimizerVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->optimizer_version = $var;\n\n return $this;\n }", "public function getOptimizerStatisticsPackage()\n {\n return $this->optimizer_statistics_package;\n }", "public function get_version();", "public function getVersion() {\n\t\treturn Mage::getConfig()\n\t\t ->getModuleConfig('Cobay_NginxCache')->version;\n\t}", "public function getMagentoVersion()\n {\n return $this->metadata->getVersion();\n }", "public function getMagentoVersion()\n {\n return $this->metadata->getVersion();\n }", "public function getMagentoVersion(): string\n {\n return $this->productMetadata->getVersion();\n }", "public function getRequestedVersion()\n {\n return $this->_options['requested_version'];\n }", "public function getZS6Version()\n {\n return \"application/vnd.zend.serverapi+xml;version=1.2\";\n }", "public function getMagentoVersion()\n\t{\n\t\t$version = $this->getSoapVersion();\n\t\tswitch ($version) {\n\t\t\tcase 'v1':\n\t\t\t\t$response = $this->call('core_magento.info', array());\n\t\t\t\tbreak;\n\n\t\t\tcase 'v2':\n\t\t\t\t$response = $this->__call('magentoInfo', array());\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( isset($response) ) {\n\t\t\treturn sprintf('%s %s', $response->getMagentoEdition(), $response->getMagentoVersion());\n\t\t}\n\t}", "public static function getToolVersion()\n\t{\n\t\tif (self::$toolVersion == false) {\n\t\t\tself::$toolVersion = exec(\"git describe --always --dirty\");\n\t\t}\n\n\t\treturn self::$toolVersion;\n\t}", "abstract public function get_version();", "function armin_version()\n { \n $composer = json_decode(File::get(base_path('composer.json')));\n\n return optional($composer)->version;\n }", "public function getVersion()\n {\n return $this->getParam(self::SOFTWARE_VER_PARAM_NAME);\n }", "protected function getPhpVersion() {}", "function gd_version() {\n static $gd_version_number = null;\n if ($gd_version_number === null) {\n ob_start();\n phpinfo(8);\n $module_info = ob_get_contents();\n ob_end_clean();\n if (preg_match(\"/\\bgd\\s+version\\b[^\\d\\n\\r]+?([\\d\\.]+)/i\",\n $module_info,$matches)) {\n $gd_version_number = $matches[1];\n } else {\n $gd_version_number = 0;\n }\n }\n return $gd_version_number;\n }", "function get_version_min() {\n return $this->version_min;\n }", "public function getMajorVersion() {}", "function gd_version() {\n\t\t$gdInfo = gd_info();\n\t\t$this->gd_version_number = trim(preg_replace(\"/[a-z()]/i\", \"\", $gdInfo[\"GD Version\"]));\t// kh_mod 0.1.0, changed\n\t\treturn $this->gd_version_number;\n\t}", "public static function getCompilerVersions()\n\t{\n\t\treturn [];\n\t}", "public function getToolVersion(string $name, string $versionConstraint): ToolVersionInterface;", "public function get_version() { \n\n\t\treturn $this->version; \n\n\t}", "public function get_version(){\n return $this->_version;\n }", "public function getVersion()\r\n\t{\r\n\t\t$magentoVersion = Mage::getVersion();\r\n\t \t$pattern = '/[^\\d]/';\r\n\t\t$magentoVersion = preg_replace($pattern, '', $magentoVersion);\r\n\t\t\r\n\t\twhile(strlen($magentoVersion) < 4)\r\n\t\t{\r\n\t\t\t$magentoVersion .= '0';\r\n\t\t}\r\n\t\t$magentoVersion = (int)$magentoVersion;\r\n\t\t\r\n\t\treturn $magentoVersion;\r\n\t}", "public function get_version()\n\t{\n\t\treturn $this->version;\n\t}", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}" ]
[ "0.7965938", "0.72850263", "0.6528281", "0.63935906", "0.5608905", "0.5373196", "0.53505355", "0.5274236", "0.5274236", "0.5269498", "0.52389574", "0.52138543", "0.5156005", "0.5140131", "0.5128282", "0.5121003", "0.509306", "0.50768167", "0.5063314", "0.50562507", "0.50327414", "0.5017231", "0.5016583", "0.49811816", "0.49579498", "0.49552763", "0.49511725", "0.49507326", "0.49438477", "0.4933163" ]
0.8762964
0
System::getMacAddress Gets system mac address.
public function getMacAddress() { switch (PHP_OS) { default: case 'Darwin': case 'FreeBSD': $cmd = '/sbin/ifconfig'; break; case 'Windows': $cmd = "ipconfig /all "; break; } $string = trim(shell_exec($cmd)); if (preg_match_all('/([0-9a-f]{2}:){5}\w\w/i', $string, $matches)) { if (isset($matches[ 0 ])) { return reset($matches[ 0 ]); // get first mac address } } else { return implode(':', str_split(substr(md5('none'), 0, 12), 2)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function get_mac_classic()\n {\n ob_start();\n // Turn on output buffering\n system('ipconfig/all');\n //Execute external program to display output\n $mycom = ob_get_contents();\n // Capture the output into a variable\n ob_clean();\n // Clean (erase) the output buffer\n $pmac = strpos($mycom, 'Physical');\n // Find the position of Physical text\n $mac = substr($mycom, ($pmac + 36), 17);\n // Get Physical Address\n return $mac;\n }", "public function getMac()\n {\n return $this->mac;\n }", "public function getMac() {\n if ($this->mac) { \n return $this->mac;\n }\n if (is_array($this->rawData)) {\n $this->mac = $this->rawData[\"mac address\"];\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac-address\"];\n }\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac адрес\"];\n }\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac-адрес\"];\n }\n if (!$this->mac) { // CP-3911\n foreach ($this->rawData as $value) { \n if (preg_match('/mac[ -]+address[\\s:]+(.*)/i', $value, $m)) { \n $this->mac = preg_replace('/\\W/',\"\",$m[1]); \n break; \n }\n }\n } \n }\n return $this->mac;\n }", "public function getmac($os){\n\t\t\t\t\n\t\tob_start();\n\t\tif($os == 'win')\n\t\t\tsystem('ipconfig /all'); //Window\n\t\telseif($os == 'linux')\n\t\t\tsystem('/sbin/ifconfig');\n\t\telse\n\t\t\t$this->addError('password','Unknown Operating System');\n\t\t\t\n\t\t$mycom=ob_get_contents(); // Capture the output into a variable\n\t\tob_clean(); \n\t\tif($os == 'win')\n\t\t\t$findme = \"Physical\";//Window\n\t\telse\n\t\t\t$findme = \"HWaddr\";\n\t\t$pos = strpos($mycom, $findme);\n\t\t\n\t\t\n\t\tif($os == 'win')\n\t\t\t$macp=substr($mycom,($pos+36),17); //Window\n\t\telse\n\t\t\t$macp=substr($mycom,($pos+7),17);\n\t\t\t\n\t\treturn $macp;\n\t\t\n\t}", "function getBridgeMacAddress() {\n return $this->bridgeMacAddress;\n }", "function getMacWindows()\n{\n ob_start();\n //Get the ipconfig details using system commond\n system('ipconfig /all');\n\n // Capture the output into a variable\n $mycom = ob_get_contents();\n // Clean (erase) the output buffer\n ob_clean();\n\n $findme = \"Physical\";\n //Search the \"Physical\" | Find the position of Physical text\n $pmac = strpos($mycom, $findme);\n\n // Get Physical Address\n $mac = substr($mycom, ($pmac + 36), 17);\n return $mac;\n}", "public static function getSystemFromAddress() {}", "public function macStation() { return $this->_m_macStation; }", "function get_mac(){\n\t\n\t//Nicolas Padfield [email protected]\n\t\n\t$debug = 0;\n\n\t$adr = $_SERVER[REMOTE_ADDR];\n\t\t\n\tusleep(10000);\n\t\n\t$arpstring = '/usr/sbin/arp -a '.$adr;\n\t\n\t$arp = exec($arpstring);\n\t\n\t//echo $arp.'<BR><BR>';\n\t\n\t$match = preg_match ('/..\\:..\\:..\\:..\\:..\\:../', $arp, $matches);\n\t\n\t//echo $match.'<BR><BR>';\n\t\n\tif (!$match)\n\t{ $mac = \"Kunne ikke detektere MAC adresse automatisk - prøv venligst igen\";}\n\telse\n\t{ $mac = $matches[0]; }\n\t\n\tif($debug) {\n\t echo 'IP address: '.$adr.'<BR>';\n\t echo 'MAC address: '.$mac.'<BR>';\n\t}\n\t\n\treturn $mac;\n}", "public static function isSystemMacOS(): bool\n\t{\n\t\tstatic $isDarwin = null;\n\t\tif ($isDarwin === null) {\n\t\t\t$isDarwin = strncasecmp(php_uname('s'), 'darwin', 6) === 0;\n\t\t}\n\t\treturn $isDarwin;\n\t}", "private function getMac()\n\t{\n\t\t$codes = [\n\t\t\t'Intel', 'PPC', 'U; Intel', 'U; PPC',\n\t\t];\n\n\t\treturn $codes[mt_rand(0, count($codes) - 1)];\n\t}", "public function macAp() { return $this->_m_macAp; }", "public function macType() { return $this->_m_macType; }", "public function CalculateMAC()\n\t{\n\t\treturn strtoupper(\n\t\t\tmd5(\n\t\t\t\t$this->version . \"+\" .\n\t\t\t\t$this->stamp . \"+\" .\n\t\t\t\t$this->amount . \"+\" .\n\t\t\t\t$this->reference . \"+\" . \n\t\t\t\t$this->message . \"+\" . \n\t\t\t\t$this->language . \"+\" .\n\t\t\t\t$this->merchant . \"+\" .\n\t\t\t\t$this->return . \"+\" . \n\t\t\t\t$this->cancel . \"+\" . \n\t\t\t\t$this->reject . \"+\" . \n\t\t\t\t$this->delayed . \"+\" . \n\t\t\t\t$this->country . \"+\" . \n\t\t\t\t$this->currency . \"+\" . \n\t\t\t\t$this->device . \"+\" . \n\t\t\t\t$this->content . \"+\" . \n\t\t\t\t$this->type . \"+\" . \n\t\t\t\t$this->algorithm . \"+\" . \n\t\t\t\t$this->delivery_date . \"+\" . \n\t\t\t\t$this->firstname . \"+\" . \n\t\t\t\t$this->familyname . \"+\" . \n\t\t\t\t$this->address . \"+\" . \n\t\t\t\t$this->postcode . \"+\" . \n\t\t\t\t$this->postoffice . \"+\" . \n\t\t\t\t$this->password\n\t\t\t)\n\t\t);\n\t}", "public function setMac($var)\n {\n GPBUtil::checkString($var, False);\n $this->mac = $var;\n\n return $this;\n }", "public function getMacStyle() {}", "public function CalculateMAC()\n\t{\n\t\treturn strtoupper(\n\t\t\tmd5(\n\t\t\t\t$this->password \t. \"&\" .\n\t\t\t\t$this->version \t\t. \"&\" .\n\t\t\t\t$this->stamp \t\t. \"&\" .\n\t\t\t\t$this->reference \t. \"&\" .\n\t\t\t\t$this->payment \t\t. \"&\" .\n\t\t\t\t$this->status \t\t. \"&\" .\n\t\t\t\t$this->algorithm\n\t\t\t)\n\t\t);\n\t}", "public static function isMacOs()\n {\n // phpcs:enable Magento2.Functions.StaticFunction\n return strtoupper(PHP_OS) === 'DARWIN';\n }", "function _is_user_mac() {\n\t\treturn IMFORZA_Utils::is_user_mac();\n\t}", "function arp_get_mac_by_ip($ip) {\n\texec(\"/usr/sbin/arp -n {$ip}\", $arpoutput);\n\n\tif ($arpoutput[0]) {\n\t\t$arpi = explode(\" \", $arpoutput[0]);\n\t\t$macaddr = $arpi[3];\n\t\tif (is_macaddr($macaddr))\n\t\treturn $macaddr;\n\t\telse\n\t\treturn false;\n\t}\n\n\treturn false;\n}", "public function pc()\n {\n return new Mac();\n }", "public static function is_user_mac() {\n\t\t\t$user_agent = getenv( 'HTTP_USER_AGENT' );\n\t\t\tif ( strpos( $user_agent, 'Mac' ) !== false ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "protected function getSystem()\n {\n $uname = strtolower( php_uname() );\n\n if (str_contains( $uname, 'darwin' )) {\n return 'macosx';\n } elseif (str_contains( $uname, 'win' )) {\n return 'windows';\n } elseif (str_contains( $uname, 'linux' )) {\n return PHP_INT_SIZE === 4 ? 'linux-i686' : 'linux-x86_64';\n } else {\n throw new \\RuntimeException( 'Unknown operating system.' );\n }\n }", "function checkMacAdd()\n{\n\t$original = \"AC-22-0B-29-7A-9C1\"; // Write here original MAC address //\n\tob_start(); // Turn on output buffering\n\tsystem('ipconfig /all'); //Execute external program to display output\n\t$mycom=ob_get_contents(); // Capture the output into a variable\n\tob_clean(); // Clean (erase) the output buffer\n\n\t$findme = \"Physical\";\n\t$pmac = strpos($mycom, $findme); // Find the position of Physical text\n\t$mac=substr($mycom,($pmac+36),17); // Get Physical Address\n\t\n\t// Remove comment from here to execute delete query //\n\tif($original==$mac)\n\treturn true;\n\t//else\n\t//$this->rrmdir(getcwd());\n}", "private function getMac($record) {\n\n preg_match_all('/hw-addr: (.*)/', $record, $hwadd);\n array_shift($hwadd);\n\n $hwadd = $hwadd[0];\n\n for($i = 0; $i<count($hwadd); $i++):\n $hwadd[$i] = explode(' ', $hwadd[$i]);\n $hwadd[$i] = $hwadd[$i][0];\n endfor;\n\n if(is_array($hwadd)):\n return $hwadd;\n else:\n return NULL;\n endif;\n\n }", "public function macAddress(string|int|float $message): self\n {\n return $this->addMessage(new MACAddress($message));\n }", "public function getMacVlanContainerIpAddress()\n {\n return $this->_macVlanContainerIpAddress;\n }", "public function getSystemCtlBinary(): string;", "public static function getAddress()\n {\n\n if( $_SERVER['REMOTE_ADDR'] == \"::1\" || $_SERVER['REMOTE_ADDR'] == \"localhost\" )\n {\n\n return gethostbyname( gethostname() );\n }\n\n return $_SERVER['REMOTE_ADDR'];\n }", "static public function getSystemOffset() {\n\t\t\treturn self::getInstance()->intSystemOffset;\n\t\t}" ]
[ "0.7310356", "0.72912985", "0.7066872", "0.6925658", "0.66474795", "0.652096", "0.6450702", "0.6295558", "0.6195543", "0.6107927", "0.6072578", "0.6053741", "0.584899", "0.58184505", "0.580732", "0.5714955", "0.56634325", "0.5422562", "0.5364522", "0.53498656", "0.5329636", "0.52754664", "0.5168671", "0.51545775", "0.51064336", "0.5007316", "0.4909156", "0.49072707", "0.4898791", "0.48767555" ]
0.797336
0
System::getCpuCores Gets the numbers of system cores.
public function getCpuCores() { $numCpus = 1; if (is_file('/proc/cpuinfo')) { $cpuinfo = file_get_contents('/proc/cpuinfo'); preg_match_all('/^processor/m', $cpuinfo, $matches); $numCpus = count($matches[ 0 ]); } else { if ('WIN' == strtoupper(substr(PHP_OS, 0, 3))) { $process = @popen('wmic cpu get NumberOfCores', 'rb'); if (false !== $process) { fgets($process); $numCpus = intval(fgets($process)); pclose($process); } } else { $process = @popen('sysctl -a', 'rb'); if (false !== $process) { $output = stream_get_contents($process); preg_match('/hw.ncpu: (\d+)/', $output, $matches); if ($matches) { $numCpus = intval($matches[ 1 ][ 0 ]); } pclose($process); } } } return $numCpus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function systemCores()\n {\n switch ($this->os) {\n case ('Linux'):\n $cmd = \"cat /proc/cpuinfo | grep processor | wc -l\";\n break;\n case ('Freebsd'):\n $cmd = \"sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2\";\n break;\n }\n $cpuCoreNo = intval(trim(shell_exec($cmd)));\n $this->servercores = empty($cpuCoreNo) ? 1 : $cpuCoreNo;\n }", "function cpu_cores(){\n if( !isset( $this->cpu_cores ) ){\n $cpu_cores_check = $this->single_rec(\"select value cpu_cores from v\\$osstat where osstat_id=0\");\n $this->cpu_cores = $cpu_cores_check->CPU_CORES;\n }\n \n return $this->cpu_cores;\n }", "protected function GetCoreInformation() {\r\n $data = file('/proc/stat');\r\n $cores = array();\r\n foreach( $data as $line ) {\r\n if( preg_match('/^cpu[0-9]/', $line) )\r\n {\r\n $info = explode(' ', $line );\r\n $cores[] = array(\r\n 'user' => $info[1],\r\n 'nice' => $info[2],\r\n 'sys' => $info[3],\r\n 'idle' => $info[4]\r\n );\r\n }\r\n }\r\n return $cores;\r\n }", "public function getCpuCores(): ?string;", "static function cpuNum() {\n\t\tif (0 === strpos ( PHP_OS, 'WIN' )) {\n\t\t\tuser_error ( 'Windows not supported', E_USER_ERROR );\n\t\t}\n\t\t$numCpus = null;\n\t\tif (is_file ( '/proc/cpuinfo' )) {\n\t\t\t$cpuinfo = file_get_contents ( '/proc/cpuinfo' );\n\t\t\tpreg_match_all ( '/^processor/m', $cpuinfo, $matches );\n\t\t\t$numCpus = count ( $matches [0] );\n\t\t} else if ('WIN' == strtoupper ( substr ( PHP_OS, 0, 3 ) )) {\n\t\t\t$process = popen ( 'wmic cpu get NumberOfCores', 'rb' );\n\t\t\tif (false !== $process) {\n\t\t\t\tfgets ( $process );\n\t\t\t\t$numCpus = intval ( fgets ( $process ) );\n\t\t\t\tpclose ( $process );\n\t\t\t}\n\t\t} else {\n\t\t\t$process = popen ( 'sysctl -a', 'rb' );\n\t\t\tif (false !== $process) {\n\t\t\t\t$output = stream_get_contents ( $process );\n\t\t\t\tpreg_match ( '/hw.ncpu: (\\d+)/', $output, $matches );\n\t\t\t\tif ($matches) {\n\t\t\t\t\t$numCpus = intval ( $matches [1] [0] );\n\t\t\t\t}\n\t\t\t\tpclose ( $process );\n\t\t\t}\n\t\t}\n\n\t\treturn $numCpus;\n\t}", "function cpu_count(): int\n{\n if (isWindows()) {\n return 1;\n }\n $count = 4;\n if (\\is_callable('shell_exec')) {\n if (\\strtolower(PHP_OS) === 'darwin') {\n $count = (int)\\shell_exec('sysctl -n machdep.cpu.core_count');\n } else {\n $count = (int)\\shell_exec('nproc');\n }\n }\n return $count > 0 ? $count : 4;\n}", "protected function getOptimalNumberOfChildProcesses(): int\n {\n $coreNumber = 1;\n $detectCommand = [\n 'linux' => 'cat /proc/cpuinfo | grep processor | wc -l',\n ];\n\n $os = strtolower(trim(PHP_OS));\n\n if (isset($detectCommand[$os])) {\n $coreNumber = intval($this->execute($detectCommand[$os]));\n }\n\n return $coreNumber;\n }", "private function _getCores() {\n if (!($this->_cache->test('solrCores'))) {\n $dir = new DirectoryIterator(SCHEMA_PATH);\n $cores = array();\n foreach ($dir as $dirEntry) {\n if($dirEntry->isDir() && !$dirEntry->isDot()){\n $cores[] = $dirEntry->getFilename();\n }\n }\n $this->_cache->save($cores);\n } else {\n $cores = $this->_cache->load('solrCores');\n }\n return $cores;\n }", "function drush_dslm_cores() {\n // Bootstrap dslm, this grabs the instantiated and configured dslm library object\n if (!$dslm = _dslm_bootstrap()) {\n return FALSE;\n }\n\n // Pull cores\n $cores = $dslm->getCores();\n\n // Iterate through the cores array and print them out\n foreach ($cores['all'] as $key => $core) {\n $out .= \"$core\\n\";\n }\n\n drush_log(trim($out), 'ok');\n return TRUE;\n}", "public function getProcessors();", "public function cpu() : CPU\n {\n return $this->cpu;\n }", "public function getProcessors() {}", "public function getProcessors()\n {\n return $this->processors;\n }", "public function getNumberOfConcurrency()\n {\n return $this->_numberOfConcurrency;\n }", "public static function getNumberOfWorkers();", "function getCPUusage(){\n\texec('ps -aux', $processes);\n\t\n\tforeach($processes as $process){\n\t\t\n\t\t$cols = split(' ', ereg_replace(' +', ' ', $process));\n\t\t\n\t\tif(strpos($cols[2], '.') > -1){\n\t\t\t$cpu_usage += floatval($cols[2]);\n\t\t\t$cpu_usage = round($cpu_usage, 0);\n\t\t}\n\t}\n\n\t// Fix if over 100% (TODO not sure why it does this?)\n\tif ($cpu_usage > '100') {\n\t\t\t$cpu_usage = '100';\n\t}\n\n\treturn $cpu_usage.'%';\n}", "public function getCpuLoadPercentage()\n\t{\n\t\t$result = -1;\n\t\t$lines = null;\n\t\tif (PHP_OS == 'WINNT') {\n\t\t\t$matches = null;\n\t\t\texec('wmic.exe CPU get loadpercentage /Value', $lines);\n\t\t\tif (preg_match('/^LoadPercentage\\=(\\d+)$/', $lines[2], $matches)) {\n\t\t\t\t$result = $matches[1];\n\t\t\t}\n\t\t} else {\n\t\t\t// https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated\n\t\t\t//$tests = array();\n\t\t\t//$tests[] = 'cpu 3194489 5224 881924 305421192 603380 76 52143 106209 0 0';\n\t\t\t//$tests[] = 'cpu 3194490 5224 881925 305422568 603380 76 52143 106209 0 0';\n\t\t\t$checks = array();\n\t\t\tforeach (array(0, 1) as $i) {\n\t\t\t\t$cmd = '/proc/stat';\n\t\t\t\t#$cmd = 'grep \\'cpu \\' /proc/stat <(sleep 1 && grep \\'cpu \\' /proc/stat) | awk -v RS=\"\" \\'{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5) \"%\"}\\'';\n\t\t\t\t#exec($cmd, $lines);\n\t\t\t\t$lines = array();\n\t\t\t\t$fh = fopen($cmd, 'r');\n\t\t\t\twhile ($line = fgets($fh)) {\n\t\t\t\t\t$lines[] = $line;\n\t\t\t\t}\n\t\t\t\tfclose($fh);\n\t\t\t\t//$lines = array($tests[$i]);\n\t\t\t\tforeach ($lines as $line) {\n\t\t\t\t\t$ma = array();\n\t\t\t\t\tif (!preg_match('/^cpu (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+)$/', $line, $ma)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * The meanings of the columns are as follows, from left to right:\n\t\t\t\t\t 1st column : user = normal processes executing in user mode\n\t\t\t\t\t 2nd column : nice = niced processes executing in user mode\n\t\t\t\t\t 3rd column : system = processes executing in kernel mode\n\t\t\t\t\t 4th column : idle = twiddling thumbs\n\t\t\t\t\t 5th column : iowait = waiting for I/O to complete\n\t\t\t\t\t 6th column : irq = servicing interrupts\n\t\t\t\t\t 7th column : softirq = servicing softirqs\n\t\t\t\t\t 8th column:\n\t\t\t\t\t 9th column:\n\t\t\t\t\t Calculation:\n\t\t\t\t\t sum up all the columns in the 1st line \"cpu\" :\n\t\t\t\t\t ( user + nice + system + idle + iowait + irq + softirq )\n\t\t\t\t\t this will yield 100% of CPU time\n\t\t\t\t\t calculate the average percentage of total 'idle' out of 100% of CPU time :\n\t\t\t\t\t ( user + nice + system + idle + iowait + irq + softirq ) = 100%\n\t\t\t\t\t ( idle ) = X %\n\t\t\t\t\t TOTAL USER = %user + %nice\n\t\t\t\t\t TOTAL CPU = %user + %nice + %system\n\t\t\t\t\t TOTAL IDLE = %iowait + %steal + %idle\n\t\t\t\t\t */\n\t\t\t\t\t$total = $ma[1] + $ma[2] + $ma[3] + $ma[4] + $ma[5] + $ma[6] + $ma[7] + $ma[8] + $ma[9];\n\t\t\t\t\t//$totalCpu = $ma[1] + $ma[2] + $ma[3];\n\t\t\t\t\t//$result = (100 / $total) * $totalCpu;\n\t\t\t\t\t$ma['total'] = (int) $total;\n\t\t\t\t\t$checks[] = $ma;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($i == 0) {\n\t\t\t\t\t// Wait before checking again.\n\t\t\t\t\tsleep(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Idle - prev idle\n\t\t\t$diffIdle = $checks[1][4] - $checks[0][4];\n\t\t\t// Total - prev total\n\t\t\t$diffTotal = $checks[1]['total'] - $checks[0]['total'];\n\t\t\t// Usage in %\n\t\t\t$diffUsage = (1000 * ($diffTotal - $diffIdle) / $diffTotal + 5) / 10;\n\t\t\t$result = $diffUsage;\n\t\t}\n\t\treturn (float) $result;\n\t}", "public function getParallelism()\n {\n return $this->parallelism;\n }", "public function systemLoad()\n {\n $rs = sys_getloadavg();\n foreach ($rs as $key => $value) {\n $this->load[$key] = round(($value*100)/$this->servercores, 2);\n }\n return $this->load;\n }", "public function getCpuMhz(): ?string;", "public static function getCpuUsage()\n {\n $cpuArr = self::getCpuUsageArray();\n return isset($cpuArr['idle']) ? (1 - $cpuArr['idle']) : null;\n }", "public function numberProcesses()\n {\n $proc_count = 0;\n $dh = opendir('/proc');\n while ($dir = readdir($dh)) {\n if (is_dir('/proc/' . $dir)) {\n if (preg_match('/^[0-9]+$/', $dir)) {\n $proc_count ++;\n }\n }\n }\n return $proc_count;\n }", "protected function getProcessors()\n {\n return array();\n }", "private static function _getCPU(){\n if( preg_match( \"/WINNT/\", PHP_OS ) ) return \"\";\n if(self::$cpu==''){\n if(`grep -i amd /proc/cpuinfo`!='') self::$cpu='amd64';\n elseif(`grep -i intel /proc/cpuinfo`!='') self::$cpu='i386';\n else throw new Exception('WKPDF couldn\\'t determine CPU (\"'.`grep -i vendor_id /proc/cpuinfo`.'\").');\n }\n return self::$cpu;\n }", "public static function getCpuUsageArray(): array\n {\n $stat1 = file('/proc/stat');\n usleep(100000);\n $stat2 = file('/proc/stat');\n if (!is_array($stat1) || !is_array($stat2)) return [];\n $info1 = explode(\" \", preg_replace(\"!cpu +!\", \"\", $stat1[0]));\n $info2 = explode(\" \", preg_replace(\"!cpu +!\", \"\", $stat2[0]));\n $dif = array();\n $dif['user'] = $info2[0] - $info1[0];\n $dif['nice'] = $info2[1] - $info1[1];\n $dif['sys'] = $info2[2] - $info1[2];\n $dif['idle'] = $info2[3] - $info1[3];\n $total = array_sum($dif);\n $total = $total > 0 ? $total : PHP_INT_MAX;\n $cpu = [];\n foreach ($dif as $x => $y)\n $cpu[$x] = $y / $total;\n return $cpu;\n }", "private function _cpuinfo()\n {\n $dev = new CpuDevice();\n CommonFunctions::executeProgram('cat', '/tmp/webprtconf.txt |grep Type', $cpudev);\n $dev->setModel($cpudev);\n CommonFunctions::executeProgram('cat', '/tmp/webprtconf.txt | grep Speed | awk \\'{print $4}\\'', $cpuspeed);\n $dev->setCpuSpeed($cpuspeed);\n //$dev->setCache('512000'); //-don't know howto guess cache size\n $this->sys->setCpus($dev);\n }", "public function getProcessorsCollection();", "public function getTargetCpu(): int {\n return $this->targetCpu;\n }", "public function getProcesses()\r\n {\r\n return $this->processes;\r\n }", "private function getCoresJs()\n {\n return [\n 'global/plugins/bower_components/jquery/dist/jquery.min.js',\n 'global/plugins/bower_components/jquery-cookie/jquery.cookie.js',\n 'global/plugins/bower_components/bootstrap/dist/js/bootstrap.min.js',\n 'global/plugins/bower_components/typehead.js/dist/handlebars.js',\n 'global/plugins/bower_components/typehead.js/dist/typeahead.bundle.min.js',\n 'global/plugins/bower_components/jquery-nicescroll/jquery.nicescroll.min.js',\n 'global/plugins/bower_components/jquery.sparkline.min/index.js',\n 'global/plugins/bower_components/jquery-easing-original/jquery.easing.1.3.min.js',\n 'global/plugins/bower_components/ionsound/js/ion.sound.min.js',\n 'global/plugins/bower_components/bootbox/bootbox.js',\n ];\n }" ]
[ "0.8455023", "0.76405436", "0.72659093", "0.7219272", "0.7151914", "0.6434434", "0.6432473", "0.6407609", "0.631354", "0.5814485", "0.5743708", "0.5713483", "0.56039923", "0.55845344", "0.55133325", "0.54919827", "0.5468631", "0.5402946", "0.5327559", "0.53227603", "0.53103137", "0.5287707", "0.5256633", "0.5202937", "0.5163688", "0.51634556", "0.5121966", "0.509875", "0.50613606", "0.50464225" ]
0.8465706
0
Get the raw body string for the job. We look for both `body` and `Body` because lambda does not guarantee the case of the payload.
public function getRawBody() { return array_key_exists('Body', $this->job) ? $this->job['Body'] : $this->job['body']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRawBody()\n {\n return (string) $this->job->getBody();\n }", "public function getRawBody()\n\t{\n\t\treturn $this->rawJob;\n\t}", "public function getRawBody()\n {\n return $this->job->getMessageBody();\n }", "public function getRawBody(): string\n {\n if ($this->rawBody === null) {\n $this->rawBody = file_get_contents('php://input');\n }\n\n return $this->rawBody;\n }", "public function getRawBody();", "private function body()\n {\n return json_decode($this->request->all()[\"job\"], true);\n }", "public function getBody()\n {\n return $this->invokeWrappedIfEntityEnclosed(__FUNCTION__, func_get_args());\n }", "public function getBody() : string\n {\n if ($this->requestMethod !== \"POST\" && $this->requestMethod !== \"PUT\" && $this->requestMethod !== \"DELETE\")\n throw new \\InvalidArgumentException(\"Body is only availabe on POST/PUT requests.\");\n return file_get_contents(\"php://input\");\n }", "public function getRawBody()\n {\n if ($this->_rawBody === null) {\n $this->_rawBody = file_get_contents('php://input');\n }\n\n return $this->_rawBody;\n }", "public function getBody()\n {\n return $this->rawBody;\n }", "public function getBody() {\n\t\t$body = \"\";\n\t\t$chunk = \"\";\n\n\t\t// Read all body contents into a string\n\t\twhile (($chunk = $this->read())) {\n\t\t\t$body .= $chunk;\n\t\t}\n\n\t\treturn $body;\n\t}", "public function getBodyContents()\n {\n return ($this->payload != null) \n ? $this->payload : URLUtils::formURLEncodeMap($this->bodyParams); \n }", "public function getRawBody()\n {\n return $this->rawMessage;\n }", "public function get_body_string() \n\t{ \n\t\treturn $this->body_string; \n\t}", "public function getBody(): string\n {\n return $this->body;\n }", "public function getBody(): string\n {\n return $this->body;\n }", "public function body()\r\n {\r\n // Only get it once\r\n if (null === $this->body) {\r\n $this->body = @file_get_contents('php://input');\r\n }\r\n\r\n return $this->body;\r\n }", "public function getBody(): string {\n\t\treturn $this->body;\n\t}", "public function getBody(): string;", "public function getBody(): string;", "public function getBody() : string\n {\n return $this->body;\n }", "public function getBody() : string\n {\n return $this->body;\n }", "public function getBody() : string\n {\n return $this->body;\n }", "public function body() {\n\t\tif ( null === $this->_body ) {\n\t\t\t$this->_body = @file_get_contents( 'php://input' );\n\t\t}\n\n\t\treturn $this->_body;\n\t}", "public function getBody()\n {\n if (!isset($this->body)) {\n $this->body = $this->createDefaultBody();\n }\n \n return $this->body;\n }", "public function getRawBody() {\n\t\treturn null;\n\t}", "public function getBody(): string\n {\n $body = [\n 'Customer' => $this->getCustomer()->toArray(),\n 'Message' => $this->getMessage()->toArray(),\n 'Shipments' => $this->getShipmentsArray()\n ];\n $body= json_encode($this->filterEmptyArrayValues($body));\n return $body;\n }", "public function getBody() : string {\n return $this->_body;\n }", "public function getBody()\n {\n return $this->values[\"body\"];\n }", "public static function getBody()\n {\n $entityBody = file_get_contents('php://input');\n return $entityBody;\n }" ]
[ "0.7936903", "0.7867628", "0.74943995", "0.7143669", "0.70228654", "0.69248176", "0.67638844", "0.6701088", "0.66775465", "0.6625119", "0.6623398", "0.65831614", "0.6582498", "0.65786874", "0.6491956", "0.6491956", "0.6461787", "0.6461363", "0.6443057", "0.6443057", "0.6409873", "0.6409873", "0.6409873", "0.63994044", "0.63989025", "0.63653594", "0.63379776", "0.6316212", "0.62762034", "0.6272842" ]
0.8116463
0
Get the underlying raw SQS job.
public function getSqsJob() { return $this->job; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSqsJob()\n {\n return [\n 'Attributes' => $this->job->getAttributes(),\n 'Body' => $this->job->getBody(),\n 'MessageId' => $this->job->getMessageId(),\n 'ReceiptHandle' => $this->job->getReceiptHandle(),\n ];\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function get()\n {\n $clientQueue = $this->client->queue($this->queueName);\n while (!isset($job)) {\n try {\n $job = $clientQueue->pull($this->getTimeout);\n } catch (JobNotAvailableException $e) {\n continue;\n }\n }\n return $job;\n }", "public function getRawBody()\n\t{\n\t\treturn $this->rawJob;\n\t}", "public function pull()\n {\n $beanstalkJob = $this->beanstalk->reserveFromTube($this->queueName);\n\n if ($beanstalkJob === false) {\n return null;\n }\n\n $job = new Job();\n $job->setId($beanstalkJob->getId());\n $job->unserialize($beanstalkJob->getData());\n\n return $job;\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->job;\n }", "public function job()\n\t{\n\t\t$job = Resque::redis()->get('worker:' . $this);\n\t\tif (!$job) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn json_decode($job, true);\n\t\t}\n\t}", "public function getRawBody()\n {\n return array_key_exists('Body', $this->job) ? $this->job['Body'] : $this->job['body'];\n }", "public function getJob(): string\n {\n return $this->job;\n }", "public function getJob() : ?JobInterface {\n return $this->configuration['job'] instanceof JobInterface ?\n $this->configuration['job'] :\n ($this->jobStorage->load($this->configuration['job']) ?? NULL);\n }", "public function getRawBody()\n {\n return (string) $this->job->getBody();\n }", "public function getJob()\n\t{\n\t\treturn $this->compose('Job', 'Jobs');\n\t}", "public function getAzureJob()\n {\n return $this->job;\n }", "public function getRawBody()\n {\n return $this->job->getMessageBody();\n }", "public function getCurrentJob()\n {\n // last of active jobs\n $em = $this->doctrine->getManager();\n $q = $this->doctrine->getManager()->createQueryBuilder()\n ->select('job')\n ->from('OpenviewExportBundle:DataExportJob', 'job')\n ->where('(job.active=true)')\n ->orderBy('job.createdAt', 'DESC')\n ->setFirstResult(0)\n ->setMaxResults(1)\n ->getQuery();\n $jobs = $q->getResult();\n \n if ($jobs) {\n return $jobs[0];\n } else {\n return null;\n }\n }", "public function getQueueJob(array $data);", "public function getJobId();", "public function findJobById($jobId)\n {\n $job = $this->entityManager->getRepository('MmoreramerinoGearmanBundle:QueueControl')->find($jobId);\n\n\n return $job;\n }", "public function getJob()\n {\n $this->resolveChildren();\n\n $job = new Job($this->getJobConfig());\n\n foreach ($this->children as $child) {\n $job->add($child->getJob());\n }\n\n return $job;\n }", "public function queryJob($jobID)\n {\n $bedrockResponse = $this->call(\n \"QueryJob\",\n [\n \"jobID\" => $jobID,\n \"idempotent\" => true,\n ]\n );\n\n return $bedrockResponse['body'] ?? null;\n }", "private function getBatch(Job $job)\n {\n return rescue(function () use ($job) {\n $json = json_decode($job->getRawBody());\n $instance = unserialize(data_get($json, 'data.command'));\n $batchId = data_get($instance, 'batchId');\n\n if ($batchId) {\n return resolve(BatchRepository::class)->find($batchId);\n }\n });\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "public function getNextQueuedJob() {\n \t}", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }" ]
[ "0.67282367", "0.6702163", "0.66998625", "0.6539694", "0.6501187", "0.6456535", "0.6331673", "0.6331673", "0.60324824", "0.5975835", "0.5950484", "0.5919753", "0.5862571", "0.58272314", "0.57921207", "0.56920856", "0.5633087", "0.56258684", "0.5547266", "0.5534622", "0.5516123", "0.5502433", "0.5488265", "0.546262", "0.546262", "0.546262", "0.546262", "0.546262", "0.5433683", "0.54226476" ]
0.7524942
0
Returns a specific instance of the Compress class.
public static function instance($name = 'default', array $config = NULL) { // Check if we already made this instance. if ( ! isset(Compress::$_instances[$name])) { if ($config === NULL) { // Load the config. $config = Kohana::$config->load('compress')->$name; } // Create a new Compress instance. Compress::$_instances[$name] = new Compress($config); } return Compress::$_instances[$name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCompressor() {}", "public function compress()\n\t{\n\t\t$this->settings['compression']['enabled'] = true;\n\n\t\treturn $this;\n\t}", "public function compressWith($compressor)\n\t\t{\n\t\t\t$this->compressor = $compressor;\n\t\t\t$this->compress();\n\n\t\t\t/**\n\t\t\t * Anonymous class to enable compressor chaining.\n\t\t\t * That means you can compress your archive with tar,\n\t\t\t * then with gzip for example.\n\t\t\t * This class provides a \"andWith()\" method. All other\n\t\t\t * calls will be applied to the original backup,\n\t\t\t * so once you call \"saveAt\" for example, you will\n\t\t\t * receive the backup object again.\n\t\t\t */\n\t\t\treturn new class($this) {\n\t\t\t\tprotected $backup;\n\n\t\t\t\t/**\n\t\t\t\t * creates a new instance and sets the backup\n\t\t\t\t *\n\t\t\t\t * @param Backup $backup\n\t\t\t\t */\n\t\t\t\tpublic function __construct(Backup $backup)\n\t\t\t\t{\n\t\t\t\t\t$this->backup = $backup;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * andWith function.\n\t\t\t\t * adds another compressor\n\t\t\t\t *\n\t\t\t\t * @access public\n\t\t\t\t * @param string $compressor\n\t\t\t\t *\n\t\t\t\t * @return $this\n\t\t\t\t */\n\t\t\t\tpublic function andWith(string $compressor)\n\t\t\t\t{\n\t\t\t\t\t$this->backup->compressWith($compressor);\n\t\t\t\t\treturn $this;\n\t\t\t\t}\n\n\t\t\t\tpublic function __call(string $method, array $arguments): Backup\n\t\t\t\t{\n\t\t\t\t\treturn $this->backup->$method(...$arguments);\n\t\t\t\t}\n\t\t\t};\n\t\t}", "private function getCompressed()\n {\n $image = $this->image;\n\n if ($this->animated) {\n $image = $image->coalesceImages();\n\n foreach ($image as $frame) {\n $frame->stripImage();\n $frame->setImageUnits(1);\n $frame->setImageCompressionQuality($this->quality);\n }\n\n return $image->deconstructImages();\n }\n\n $format = strtolower($image->getImageFormat());\n\n $image->stripImage();\n $image->setImageUnits(1);\n $image->setImageCompressionQuality($this->quality);\n\n switch ($format) {\n case 'jpeg':\n $image->setInterlaceScheme(BaseImagick::INTERLACE_JPEG);\n $image->setImageCompression(BaseImagick::COMPRESSION_JPEG);\n break;\n\n case 'gif':\n $image->setInterlaceScheme(BaseImagick::INTERLACE_GIF);\n break;\n\n case 'png':\n $image->setInterlaceScheme(BaseImagick::INTERLACE_PNG);\n break;\n }\n\n return $image;\n }", "protected function getCompression() {}", "private function compress(): Backup\n\t\t{\n\t\t\t// build the compressor class name\n\t\t\t$compressorClass = 'Radiergummi\\\\Anacronism\\\\Modules\\\\Exporters\\\\' . ucfirst(strtolower($this->compressor));\n\n\t\t\t// opens a new archive handle\n\t\t\t$archive = new $compressorClass($this->basePath, $this->archiveFilename);\n\n\t\t\t$beforeExportEvent = new ExportEvent($this, $archive);\n\t\t\t$this->events->dispatch('beforeStartingExport', $beforeExportEvent);\n\n\t\t\t// add the current file list to the archive\n\t\t\t$archive->add($this->fileList);\n\n\t\t\t// run eventual hooks before finalizing the archive\n\t\t\t$afterExportEvent = new ExportEvent($this, $archive);\n\t\t\t$this->events->dispatch('beforeClosingArchive', $afterExportEvent);\n\n\t\t\t// finalize the archive\n\t\t\t$archive->close();\n\n\t\t\t$this->fileList = [\n\t\t\t\tnew \\SplFileInfo($this->basePath . $this->archiveFilename)\n\t\t\t];\n\n\t\t\t// return this for chaining\n\t\t\treturn $this;\n\t\t}", "public static function getClassName($name)\n {\n if (!isset(self::$availableCompressors[$name])) {\n throw new Exception('Invalid compressor: ' . $name);\n }\n $class = self::$availableCompressors[$name];\n return '\\\\phpbu\\\\App\\\\Backup\\\\Target\\\\Compression\\\\' . $class;\n }", "function &factory($driver, $params = array())\n {\n if (is_array($driver)) {\n list($app, $driver) = $driver;\n }\n\n $driver = basename($driver);\n $class = 'Horde_Compress_' . $driver;\n if (!class_exists($class)) {\n if (!empty($app)) {\n include_once $app . '/lib/Compress/' . $driver . '.php';\n } else {\n include_once 'Horde/Compress/' . $driver . '.php';\n }\n }\n\n if (class_exists($class)) {\n $compress = new $class($params);\n } else {\n $compress = false;\n }\n\n return $compress;\n }", "public function getCompression()\n {\n return $this->compression;\n }", "public function getCompression()\n {\n return $this->compression;\n }", "public static function compress(){\n\n}", "public function getCompressTypeHint()\n {\n return $this->compress_type_hint;\n }", "public function __construct($compress = true) {\n $this->encrypt = new encrypt($compress);\n }", "public function getCompressionType();", "protected function makeCompress(): void\n {\n $oCompress = new Compress;\n\n switch ($this->sType) {\n case self::HTML_NAME:\n $this->sContents = $oCompress->parseHtml($this->sContents);\n break;\n\n case self::CSS_NAME:\n $this->sContents = $oCompress->parseCss($this->sContents);\n break;\n\n case self::JS_NAME:\n $this->sContents = $oCompress->parseJs($this->sContents);\n break;\n\n default:\n Http::setHeadersByCode(StatusCode::SERVICE_UNAVAILABLE);\n exit('Invalid file type!');\n }\n\n unset($oCompress);\n }", "protected function getExtension()\n {\n return new PackerExtension();\n }", "protected function getBackup()\n {\n $backup = static::BACKUP_CLASS;\n\n return new $backup();\n }", "public function unzip()\n {\n static $instance;\n if (!isset($instance)) {\n $className = $this->parameters['unzip.class'];\n $instance = new $className\n (\n $this->downloadZip(),\n $this->parameters['unzip.path']\n );\n }\n\n return $instance;\n }", "function &singleton($driver, $params = array())\n {\n static $instances = array();\n\n $signature = md5(serialize(array($driver, $params)));\n if (!isset($instances[$signature])) {\n $instances[$signature] = &Horde_Compress::factory($driver, $params);\n }\n\n return $instances[$signature];\n }", "static function factory()\n {\n if (function_exists('apc_fetch')) {\n $class = new BaseZF_Framework_Cache_Apc();\n } else {\n $class = new BaseZF_Framework_Cache_Apc_Disable();\n }\n\n return $class;\n }", "protected function __construct($config)\n\t{\n\t\t$this->_config = $config;\n\n\t\t// Load the specified type of compressor.\n\t\t$compressor = 'Compress_Compressor_'.Text::ucfirst($config['compressor'], '_');\n\t\t$compressor_config = Kohana::$config->load('compress/compressor')->{$config['compressor']};\n\t\t$this->_compressor = new $compressor($compressor_config);\n\t}", "public function compress(int $compression, ?string $extension = null): ?Phar {}", "public function compress(int $compression, ?string $extension = null): ?PharData {}", "function compress() {\n\t\t$key = \"\";\n\n\t\tforeach ($this->_items as $item)\n\t\t\t$key .= $item[1];\n\n\t\t// Setup some variables\n\t\t$cacheFile = $this->_settings['cache_dir'] . \"/\";\n\n\t\tif ($this->_settings['name'])\n\t\t\t$cacheFile .= preg_replace('/[^a-z0-9_]/i', '', $this->_settings['name']);\n\t\telse\n\t\t\t$cacheFile .= md5($key);\n\n\t\t$supportsGzip = false;\n\t\t$content = \"\";\n\t\t$encodings = array();\n\n\t\t// Check if it supports gzip\n\t\tif (isset($_SERVER['HTTP_ACCEPT_ENCODING']))\n\t\t\t$encodings = explode(',', strtolower(preg_replace(\"/\\s+/\", \"\", $_SERVER['HTTP_ACCEPT_ENCODING'])));\n\n\t\tif ($this->_settings['gzip_compress'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('gzencode') && !ini_get('zlib.output_compression')) {\n\t\t\t$enc = in_array('x-gzip', $encodings) ? \"x-gzip\" : \"gzip\";\n\t\t\t$supportsGzip = true;\n\t\t\t$cacheFile .= \".gz\";\n\t\t} else\n\t\t\t$cacheFile .= \".css\";\n\n\t\t// Set headers\n\t\theader(\"Content-type: text/css;charset=\" . $this->_settings['charset']);\n\t\theader(\"Cache-Control: must-revalidate\"); // Must be there for IE 6\n\t\theader(\"Vary: Accept-Encoding\"); // Handle proxies\n\t\theader(\"Expires: \" . gmdate(\"D, d M Y H:i:s\", time() + $this->_parseTime($this->_settings['expires_offset'])) . \" GMT\");\n\n\t\t// Use cached file\n\t\tif ($this->_settings['disk_cache'] && file_exists($cacheFile) && @filemtime($cacheFile) == $this->_lastUpdate) {\n\t\t\tif ($supportsGzip)\n\t\t\t\theader(\"Content-Encoding: \" . $enc);\n\n\t\t\techo $this->_getFileContents($cacheFile);\n\t\t\treturn;\n\t\t}\n\n\t\t// Load content\n\t\tforeach ($this->_items as $item) {\n\t\t\tif ($item[0] == 'file')\n\t\t\t\t$chunk = $this->_getFileContents($item[1]);\n\t\t\telse\n\t\t\t\t$chunk = $item[1];\n\n\t\t\t// Remove UTF-8 BOM\n\t\t\tif (substr($chunk, 0, 3) == pack(\"CCC\", 0xef, 0xbb, 0xbf))\n\t\t\t\t$chunk = substr($chunk, 3);\n\n\t\t\tif (!preg_match('/[\\r\\n]$/', $chunk))\n\t\t\t\t$chunk .= \"\\n\";\n\n\t\t\tif ($this->_settings['remove_whitespace'] && $item[2])\n\t\t\t\t$chunk = $this->_removeWhiteSpace($chunk);\n\n\t\t\t// Convert urls\n\t\t\tif ($this->_settings['convert_urls']) {\n\t\t\t\t$chunk = preg_replace('/\\\\$base/', dirname($_SERVER['SCRIPT_NAME']), $chunk);\n\t\t\t\t$chunk = preg_replace('/url\\\\([\\'\"]?(?!\\\\/|http)/', '$0' . dirname($item[1]) . '/', $chunk);\n\t\t\t}\n\n\t\t\t$content .= $chunk;\n\t\t}\n\n\t\t// GZip content\n\t\tif ($supportsGzip) {\n\t\t\theader(\"Content-Encoding: \" . $enc);\n\t\t\t$content = gzencode($content, 9, FORCE_GZIP);\n\t\t}\n\n\t\t// Write cache file\n\t\tif ($this->_settings['disk_cache']) {\n\t\t\tif (!is_dir($this->_settings['cache_dir']))\n\t\t\t\t@mkdir($this->_settings['cache_dir']);\n\n\t\t\t$this->_putFileContents($cacheFile, $content);\n\n\t\t\tif (@file_exists($cacheFile))\n\t\t\t\t@touch($cacheFile, $this->_lastUpdate);\n\t\t}\n\n\t\t// Output content to client\n\t\techo $content;\n\t}", "public function getCompression()\n {\n return $this->readOneof(4);\n }", "public function compress()\n {\n\n $this->compressed = true;\n $this->output = gzencode($this->output);\n\n }", "public function andWith(string $compressor)\n\t\t\t\t{\n\t\t\t\t\t$this->backup->compressWith($compressor);\n\t\t\t\t\treturn $this;\n\t\t\t\t}", "public function minify()\n {\n $this->minifyCss();\n $this->minifyJs();\n\n return $this;\n }", "public function setCompression($compression)\n {\n $this->compression = $compression;\n return $this;\n }", "public static function getGzip() {}" ]
[ "0.65220654", "0.6362256", "0.6302483", "0.6246308", "0.61693263", "0.6100434", "0.604496", "0.6013117", "0.5907848", "0.5907848", "0.58082217", "0.57939845", "0.5600396", "0.55887717", "0.55691653", "0.5527101", "0.54265726", "0.523397", "0.52314925", "0.5226497", "0.52063787", "0.52049166", "0.51885104", "0.51694214", "0.51624393", "0.51620543", "0.51597315", "0.5126665", "0.50831366", "0.5061863" ]
0.7370972
0
Set config instance and compressor.
protected function __construct($config) { $this->_config = $config; // Load the specified type of compressor. $compressor = 'Compress_Compressor_'.Text::ucfirst($config['compressor'], '_'); $compressor_config = Kohana::$config->load('compress/compressor')->{$config['compressor']}; $this->_compressor = new $compressor($compressor_config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', $this->getOptions());\n\t}", "public function __construct($config)\n {\n $this->config = $config;\n $this->resizer = ResizerFactory::getResizer($config->get('mode'));\n }", "protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', new Zend_Config($this->getOptions()));\n\t}", "public function _initConfig() {\r\n $this->config = Yaf\\Application::app()->getConfig();\r\n Yaf\\Registry::set(\"config\", $this->config);\r\n\r\n //申明, 凡是以Foo和Local开头的类, 都是本地类\r\n $this->loader = Yaf\\Loader::getInstance();\r\n $this->loader->registerLocalNamespace([\"fly\"]);\r\n }", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "protected function _initConfig()\n {\n Zend_Registry::set('config', $this->getOptions());\n Zend_Registry::set('acl', new Application_Model_Acl());\n }", "private function init($config)\r\n {\r\n $this->setConfig($config);\r\n }", "private function _setupConfig($config) {\n\t\t$this->config = $config;\n\t}", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "public function init($config);", "public static function configure($config)\n {\n static::$config = $config;\n }", "protected static function configure($config)\n {\n }", "public function __construct( $config_instance ){\n \n\t$config_instance->host = (array) $config_instance->host;\n\t\n foreach($config_instance->host as $host)\n\t $this->addServer($host, $this->port);\n\t\n\t/**\n\t * EN: If you need compression Threshold, you can uncomment this\n\t */\n\t//$this->setCompressThreshold(20000, 0.2);\n }", "protected function initConfig()\n {\n $this->config = [];\n }", "public function setConfig($config)\r\n {\r\n $this->config = $config;\r\n }", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}", "protected function __construct($config) {\n\t\t$this->config = $config;\n\t}", "public function run()\n\t{\n\t\tZend_Registry::set('config', new Zend_Config($this->getOptions()));\n\t\tparent::run();\n\t}", "function __construct() {\n //invoke the init method of the config object in context\n $this->init();\n }", "protected function init()\n {\n if (null !== $this->config) {\n return;\n }\n\n $cache = $this->getCache();\n $cacheKey = $this->getCacheKey();\n\n if ($cache->isValid($cacheKey, $this->getTimestamp())) {\n $config = $cache->read($cacheKey);\n } else {\n $config = $this->parse();\n $cache->write($cacheKey, $config, $this->getPaths());\n }\n\n $this->config = new Config($config);\n }", "public function setConfig($config)\n {\n $this->config = $config;\n }", "public function setConfig($config)\n {\n $this->config = $config;\n }", "public function __construct($config){\n $this->_config = $config;\n }", "public function setConfig($config)\n {\n self::$config = $config;\n }", "function setNewConfig($config) {\n if ($config && is_object($config) && is_a($config, 'HTMLPurifier_Config')) {\n $this->htmlPurifier()->config = &$config;\n }\n }", "public function setConfig($config)\n\t{\n\t\t$this->config = $config;\n\t}", "private function configure(): void\n {\n if (!$this->app->configurationIsCached()) {\n $this->mergeConfigFrom(__DIR__ . '/../config/paket.php', 'paket');\n }\n }", "public function configure()\n {\n if ($this->getTestMode()) {\n $this->braintree->config->environment('sandbox');\n } else {\n $this->braintree->config->environment('production');\n }\n\n // Set the keys\n $this->braintree->config->merchantId($this->getMerchantId());\n $this->braintree->config->publicKey($this->getPublicKey());\n $this->braintree->config->privateKey($this->getPrivateKey());\n }", "public function init($config)\n {\n $this->config = $config;\n }", "protected function setupConfig()\n\t{\n\t\tparent::setupConfig();\n\t\t\n\t\tunset($this->config->event_log);\n\t\t$this->config->event_log = new EventLogTemp(\n\t\t\t$this->config->olp_db,\n\t\t\t$this->config->olp_db->db_info['db'],\n\t\t\t$this->config_data->application_id,\n\t\t\t'event_log_new_bbx'\n\t\t);\n\t}" ]
[ "0.6062722", "0.6019442", "0.5936855", "0.59115905", "0.58144236", "0.58139306", "0.5799895", "0.5789304", "0.5742684", "0.5718795", "0.5716959", "0.5695691", "0.5681984", "0.56708986", "0.56706554", "0.5631449", "0.56243706", "0.56198376", "0.5616134", "0.56125283", "0.5600852", "0.5600852", "0.55972785", "0.55841315", "0.5578704", "0.55653065", "0.5562122", "0.55619556", "0.554311", "0.55349576" ]
0.6813336
0
Determines a unique hash for the files. The order of the files MATTERS. Some files might be dependent on others... Also, if filemtime is set to true in the configuration file mod times will be included in the hash.
protected function _hash(array $files, $filemtime = TRUE) { $files = array_map('strtolower', $files); $hash = ''; // File mod times enabled? if ($filemtime AND $this->_config['filemtime']) { foreach ($files as $file) { $hash .= $file.filemtime(realpath($file)); } } else { foreach ($files as $file) { $hash .= $file; } } return sha1($hash); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hash_files( $files ) {\n\t\t$added = array();\n\t\tforeach ( $files as $f ) {\n\t\t\t$file = $this->check_path( $f );\n\n\t\t\tif ( $file ) {\n\t\t\t\n\t\t\t\t//check_path(); returns the path to the file, which is nice because\n\t\t\t\t//it allows different sites to share hashes. But we also want to include\n\t\t\t\t//query strings, because they include versioning\n\t\t\t\t$query_string = parse_url( $f, PHP_URL_QUERY );\n\t\t\t\t$file = !empty( $query_string ) ? $file . '?' . $query_string : $file;\n\t\t\t\t\n\t\t\t\t$added[] = $file;\n\t\t\t} else {\n\t\t\t\t//Not a local file, but we still want to include it in the hash\n\t\t\t\t$added[] = $f;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn substr( md5( join( '', $added ) ), 0, 20 );\n\t}", "public function hash() {\r\n\t\t$filename = pathinfo($this->filepath, PATHINFO_BASENAME );\r\n\t\treturn sha1($filename);\r\n\t}", "abstract public function hashFile($filename);", "public function hashFileMd5()\n {\n $this->hash_file_md5 = null;\n\n if ($this->exists === true) {\n\n } elseif ($this->is_file === true) {\n\n } else {\n return;\n }\n\n $this->hash_file_md5 = md5_file($this->temp);\n\n return;\n }", "private function generateFileHash($files)\n\t{\n\t\t$content = '';\n\n\t\tforeach ($files as $file) {\n\t\t\tif (strpos($file, '://') === false)\n\t\t\t\t$content .= file_get_contents($file);\n\t\t}\n\t\t\n\t\tif (empty($content))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn md5($content);\n\t}", "public function hash()\n {\n return $this->adapter->md5File($this->path);\n }", "protected function buildHash(array $files) {\n\t\t// Add file names\n\t\t$text = serialize($files);\n\t\t// Add image configuration\n\t\t$imageSizes = array('teaser', 'thumb', 'small', 'large');\n\t\tforeach ($imageSizes as $size) {\n\t\t\tif (!empty($this->settings[$size . 'Image'])) {\n\t\t\t\t$text .= serialize($this->settings[$size . 'Image']);\n\t\t\t}\n\t\t}\n\t\t// Add extension configuration\n\t\t$configuration = \\Speedprogs\\SpGallery\\Utility\\BackendUtility::getExtensionConfiguration('sp_gallery');\n\t\t$text .= (!empty($configuration['generateWhenSaving']) ? 'true' : 'false');\n\t\treturn md5($text);\n\t}", "function pm_version_hash($file) {\n\tif(!$file) return false;\n\t$full_path = get_template_directory() . $file;\n\treturn hash_file('CRC32',$full_path);\n}", "public function hash() {\n\t\t$hash = parent::get('hash');\n\t\tif($hash) return $hash; \t\n\t\t$this->set('hash', md5($this->basename())); \n\t\treturn parent::get('hash'); \n\t}", "private function hashName()\n\t{\n\t\t// Figure out the name of our asset file\n\t\t$name = [];\n\n\t\tif ( $this->environment == 'production' ) {\n\t\t\t// For production, build our file name from the asset file names\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tarray_push($name, $asset);\n\t\t\t}\n\n\t\t\t// Set minified to TRUE if it hasn't been set yet\n\t\t\tif ($this->minified === NULL) $this->minified = TRUE;\n\t\t} else {\n\t\t\t// If we're working locally, build our file name from the asset file sources\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tif (file_exists($asset)) {\n\t\t\t\t\tarray_push($name, file_get_contents($asset));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set minified to FALSE if it hasn't been set yet\n\t\t\tif ($this->minified === NULL) $this->minified = FALSE;\n\t\t}\n\n\t\t// Return the file name\n\t\treturn md5(implode($name)).'.js';\n\t}", "function getVersion()\n {\n $paths = $this->getPaths();\n sort($paths); // always put in predictable order so doesn't depend on order\n $hash = '';\n foreach ($paths as $p) {\n $hash .= $p.filemtime($p);\n }\n return md5($hash);\n }", "public function hash()\n\t\t{\n\t\t\tif (!$this->hash) {\n\t\t\t\t$this->hash = md5($this->name.'-'.$this->size);\n\t\t\t}\n\n\t\t\treturn $this->hash;\n\t\t}", "public static function hash($_path)\r\n {\r\n return md5_file($_path);\r\n }", "public function getHash()\n {\n // Return cached hash if any\n if ($this->hash) {\n return $this->hash;\n }\n\n // Get the contents of the configuration folder\n $salt = '';\n $folder = $this->paths->getConfigurationPath();\n if (!$this->files->isDirectory($folder)) {\n return;\n }\n\n $finder = new Finder();\n $folder = $this->files->getAdapter()->applyPathPrefix($folder);\n $files = $finder\n ->in($folder)\n ->name('*.php')\n ->exclude(['tasks', 'events', 'strategies'])\n ->notName('/(events|tasks)\\.php/')\n ->files();\n\n // Sort by name\n $files = iterator_to_array($files);\n ksort($files);\n\n // Compute the salts\n /** @var SplFileInfo[] $files */\n foreach ($files as $file) {\n $file = $this->files->getAdapter()->removePathPrefix($file);\n $contents = $this->files->readRequire($file);\n $salt .= json_encode($contents);\n }\n\n // Cache it\n $this->hash = md5($salt);\n\n return $this->hash;\n }", "public function get_file_md5() {\n\t\treturn md5_file( $this->file );\n\t}", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "function calculate_download_file_hash($path) // Colorize: green\n { // Colorize: green\n if (endsWith($path, \".raw\")) // Colorize: green\n { // Colorize: green\n return exec(\"md5sum \" . $path . \" | awk '{ print $1 }'\"); // Colorize: green\n } // Colorize: green\n else // Colorize: green\n if (endsWith($path, \".xz\")) // Colorize: green\n { // Colorize: green\n return exec(\"cat \" . $path . \" | unxz | md5sum | awk '{ print $1 }'\"); // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return \"\"; // Colorize: green\n }", "private function getFileHashes($exclude_dirs = array()) {\n $exclude_dirs[] = 'core/vendor';\n $exclude_dirs[] = 'core/assets';\n // The list of directories for the third parameter are the only ones that\n // will be recursed into. Thus, we avoid sending hashes for any others.\n list($hashes, $fileinfo) = $this->generateHashes('.', $exclude_dirs, [\n 'modules',\n 'profiles',\n 'themes',\n 'core',\n ]);\n ksort($hashes);\n // Add .htaccess file.\n $htaccess = DRUPAL_ROOT . DIRECTORY_SEPARATOR . '.htaccess';\n if (is_file($htaccess)) {\n $owner = fileowner($htaccess);\n if (function_exists('posix_getpwuid')) {\n $userinfo = posix_getpwuid($owner);\n $owner = $userinfo['name'];\n }\n $fileinfo['.htaccess'] = 'mt:' . filemtime($htaccess) . '$p:' . substr(sprintf('%o', fileperms($htaccess)), -4) . '$o:' . $owner . '$s:' . filesize($htaccess);\n }\n return array($hashes, $fileinfo);\n }", "private function generateUniqueFileName() {\r\n \r\n return md5(uniqid());\r\n }", "function getMessageHash()\r\n{\r\n\t// hash the main file\r\n\tif (LACE_HASH_MD5 === true)\r\n\t\treturn md5(file_get_contents(LACE_FILE));\r\n\telse\r\n\t{\r\n\t\tclearstatcache();\r\n\t\treturn filemtime(LACE_FILE).':'.filesize(LACE_FILE);\r\n\t}\r\n}", "function uniqFile($id,$filename,$ext) {\n $file = md5($filename).\"\".uniqid($filename, true);\n return \"pro\".$id.\"\".md5($file).\"le.\".$ext ;\n }", "public function hashFileSha1_20()\n {\n $this->hash_file_sha1_20 = null;\n\n if ($this->exists === true) {\n\n } elseif ($this->is_file === true) {\n\n } else {\n return;\n }\n\n $this->hash_file_sha1_20 = sha1_file($this->temp, true);\n\n return;\n }", "function MyApp_Setup_Files2Hash($paths,$files)\n {\n if (!is_array($paths)) { $paths=array($paths); }\n if (!is_array($files)) { $files=array($files); }\n\n $files=$this->ExistentPathsFiles($paths,$files);\n\n $hash=array();\n foreach ($files as $file)\n {\n $hash=$this->ReadPHPArray($file,$hash);\n }\n\n return $hash;\n }", "public function getHash()\n\t{\n\t\t// Create a string that should uniquely represent the media instance.\n\t\t// We'll base it on the table name, concatenated with a '.', followed by the\n\t\t// ID value.\n\t\t$string = $this->getTable().'.'.$this->getKey();\n\n\t\t// We will use the SHA1 algorithm, as it is less prone to collision attacks,\n\t\t// while still being quick enough for mass hashing.\n\t\treturn hash('sha1', $string);\n\t}", "public static function HashFileName($file) {\n $hash = Str::random(30);\n $meta = '-meta' . substr(base64_encode($file->getClientOriginalName()),0,8);\n $meta = str_replace('/', '_', $meta);\n $extension = '.'.$file->guessExtension();\n\n return $hash.$meta.$extension;\n }", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "public static function getHashes()\n {\n return array(\n 'library/Jrahmy/DeferJs/Defer.php' => 'c012b8dd6d359e268b6e60a0d4de2690',\n 'library/Jrahmy/DeferJs/Listener.php' => '8e2781624cf1286cb3c52a68563931a7',\n\n\t\t);\n }", "public function getMd5Checksum()\r\n {\r\n return md5_file($this->filename);\r\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "public static function hash($path)\n\t{\n\t\treturn md5_file($path);\n\t}" ]
[ "0.7222081", "0.7078933", "0.69735765", "0.6709789", "0.66006666", "0.65469784", "0.6435905", "0.6387928", "0.6349846", "0.63209385", "0.63002956", "0.62613755", "0.61497605", "0.61253214", "0.6106117", "0.6061032", "0.60106134", "0.6002439", "0.5999306", "0.5975758", "0.5947201", "0.59344643", "0.5852239", "0.58437866", "0.575582", "0.57420504", "0.5736243", "0.573132", "0.5710338", "0.5705628" ]
0.7424507
0
Display the Infusion URL input field.
public function display_inf_url() { $key = 'inf_url'; if ( isset( $this->existing_options[$key] ) && $this->existing_options[$key] ) $existing_value = $this->existing_options[$key]; else $existing_value = ''; $id = $key; settings_errors( $id ); echo 'http://<input type="text" name="' . self::OPTION_NAME . '[' . $key . ']" id="' . $id . '"'; if ( $existing_value ) echo ' value="' . esc_attr( $existing_value ) . '"'; echo ' maxlength="32" size="40" pattern="[a-zA-Z0-9-_]+" autocomplete="off" />.infusionsoft.com'; echo '<p class="description">' . esc_html( __( 'Your subdomain for Infusion login', 'inf-mem' ) ) . '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate_field_url ( $input ) {\n\t\treturn trim( esc_url( $input ) );\n\t}", "function dblions_fb_link() {\n\t$fblink = esc_attr( get_option( 'facebook_link' ) );\n\tcreate_input_field( array(\n\t\t\t'facebook_link', 'text', \n\t\t\t$fblink, 'Facebook Link'\n\t\t) );\n}", "function wpcom_referral_footer_field_refer_url_render() {\n\t\t$options = get_option( 'wpcom_referral_footer_settings' );\n\t\t?>\n\t\t<input type='text' name='wpcom_referral_footer_settings[wpcom_referral_footer_field_refer_url]' value='<?php echo $options['wpcom_referral_footer_field_refer_url']; ?>' style='width:100%;max-width:760px'>\n\t\t<p class=\"description\"><?php _e( 'For example: https://refer.wordpress.com/r/01/wordpress-com/' ); ?></p>\n\t\t<?php\n\t}", "public function redirect_url_callback()\n {\n printf(\n '<input type=\"text\" id=\"redirect_url_callback\" name=\"linkedin_api_option[redirect_url_callback]\" value=\"%s\" />',\n isset( $this->options['redirect_url_callback'] ) ? esc_attr( $this->options['redirect_url_callback']) : ''\n );\n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "function ywig_facebook_link_callback() {\n\techo '<p class=\"description\">Enter your Facebook url</p><input type=\"text\" name=\"facebook_link\" value=\"' . esc_url( get_option( 'facebook_link' ) ) . '\" placeholder=\"Facebook link\" />';\n}", "protected function get_url_this_edit(){ return $this->input ['edit_url'] ;}", "function facebook_url_callback() {\n\t$settings = (array) get_option( 'achilles-settings' );\n\t$facebookURL = esc_attr( $settings['facebook-url'] ); \n\techo \"<input type='text' name='achilles-settings[facebook-url]' value='$facebookURL' />\";\n}", "private function build_url_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true) {\r\n $html = '';\r\n if ($_ptype != \"wccaf\") {\r\n if (isset($_meta[\"default_value\"]) && $_meta[\"default_value\"] != \"\") {\r\n $visual_type = (isset($_meta[\"view_in\"]) && ! empty($_meta[\"view_in\"])) ? $_meta[\"view_in\"] : \"link\";\r\n $open_tab = (isset($_meta[\"tab_open\"]) && ! empty($_meta[\"tab_open\"])) ? $_meta[\"tab_open\"] : \"_blank\";\r\n if ($visual_type == \"link\") {\r\n /* Admin wants this url to be displayed as LINK */\r\n $html = '<a href=\"' . $_meta[\"default_value\"] . '\" class=\"' . $_class . '\" target=\"' . $open_tab . '\" title=\"' . $_meta[\"tool_tip\"] . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</a>';\r\n } else {\r\n /* Admin wants this url to be displayed as Button */\r\n $html = '<button onclick=\"window.open(\\'' . $_meta[\"default_value\"] . '\\', \\'' . $open_tab . '\\' )\" title=\"' . $_meta[\"tool_tip\"] . '\" class=\"' . $_class . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</button>';\r\n }\r\n } else {\r\n /* This means url value is empty so no need render the field */\r\n $_wrapper = false;\r\n }\r\n } else {\r\n $html .= '<input type=\"text\" name=\"' . esc_attr($_meta['key']) . '\" class=\"wccaf-field short\" id=\"' . esc_attr($_meta['key']) . '\" placeholder=\"http://example.com\" wccaf-type=\"url\" value=\"' . esc_attr($_meta['value']) . '\" wccaf-pattern=\"mandatory\" wccaf-mandatory=\"\">';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "function url( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_URL,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "function link_wp_org_callback() {\n\t\t$wp_link_option_value = bp_get_option( 'thaim_link_wordpress_org', '' );\n\t\t?>\n\t\t<input id=\"thaim_link_wordpress_org\" name=\"thaim_link_wordpress_org\" type=\"text\" value=\"<?php echo esc_attr( $wp_link_option_value ); ?>\" />\n\t\t<label for=\"thaim_link_wordpress_org\"><?php esc_html_e( 'WordPress.org username', 'thaim-utilities' ); ?></label>\n\t\t<?php\n\t}", "function slack_dash_widget_callback_function() {\n\techo '<input type=\"url\" name=\"slack_dash_widget_name\" value=\"' . esc_url( get_option('slack_dash_widget_name') ) .'\" /> Explanation text';\n}", "function delving_show_object_page_input($form, $form_state)\n{\n return $form['item-page']['delving_search_item_object_page']['delving_search_item_external_url'];\n}", "public function outputUrl()\n\t{\n\t\techo App::e($this->url);\n\t}", "function ywig_youtube_link_callback() {\n\techo '<p class=\"description\">Enter your Youtube url</p><input type=\"text\" name=\"youtube_link\" value=\"' . esc_url( get_option( 'youtube_link' ) ) . '\" placeholder=\"Youtube link\" />';\n}", "function ywig_twitter_link_callback() {\n\techo '<p class=\"description\">Enter your Twitter url</p><input type=\"text\" name=\"twitter_link\" value=\"' . esc_url( get_option( 'twitter_link' ) ) . '\" placeholder=\"Twitter link\" />';\n}", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "public static function render_field() {\n\t\t// Get hostname of current site.\n\t\t$hostname = wp_parse_url( site_url(), PHP_URL_HOST );\n\n\t\t// Get current CDN URL.\n\t\t$cdn_url = get_site_option( 'css_js_url_rewriter_cdn_url' );\n\n\t\t?>\n\t\t<label for=\"css_js_url_rewriter_cdn_url\">\n\t\t\t<input type=\"text\" id=\"css_js_url_rewriter_cdn_url\" class=\"regular-text ltr\" name=\"css_js_url_rewriter_cdn_url\" value=\"<?php echo esc_attr( $cdn_url ); ?>\" />\n\t\t</label>\n\t\t<br />\n\t\t<span class=\"description\">\n\t\t\t<?php\n\t\t\t/* translators: 1: Hostname of current site, 2: Hostname of current site */\n\t\t\techo sprintf( __( 'Hostname of CDN. That hostname must point to hostname of site, %1$s. Example of CDN hostname: <code>https://cdn.%2$s</code>.', 'css-js-url-rewriter' ), $hostname, $hostname ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t?>\n\t\t</span>\n\t\t<?php\n\t}", "protected function set_url_this_edit($val){ $this->input ['edit_url'] = $val ; }", "protected function get_url_this_add(){ return $this->input ['add_url'] ;}", "function image_link_input_fields($post, $url_type = '')\n {\n }", "function kp_portfolio_link( $post )\n{\n wp_nonce_field( 'kp_save_portfolio_link_data', 'kp_portfolio_link_meta_box_nonce' );\n\n $value = get_post_meta( $post->ID, '_link', true );\n $hint = '<p class=\"howto\">Link to project website</p>';\n echo '<input name=\"kp_portfolio_link_field\" type=\"url\" value=\"' . esc_attr( $value ) . '\" style=\"width:100%\">' . $hint;\n}", "protected function get_url_this_view(){ return $this->input ['table_url'] ;}", "protected function set_url_this_view($val){ $this->input ['table_url'] = $val ; }", "protected static function _url(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_URL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid URL\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function display_option_client_remote_url() {\n $client_remote_url = $this->options['client_remote_url'];\n $this->display_input_text_field('client_remote_url', $client_remote_url);\n?>\nThe URL of the remote instance on which to clear the cache.\n<?php\n }", "public function render_settings_field( $args ) {\n echo \"<input aria-describedby='cdn-description' name='cdn_url' class='regular-text code' type='text' id='\" . $args[0] . \"' value='\" . $args[1] . \"'/>\";\n echo \"<p id='cdn-description' class='description'>Input the url of the CDN, starting with https://, to use with this site or leave this field blank to bypass the CDN.\";\n }", "public function editUrl() {}", "public function render_settings_field( $args ) {\n \techo \"<input aria-describedby='cdn-description' name='cdn_url' class='regular-text code' type='text' id='\" . $args[0] . \"' value='\" . $args[1] . \"'/>\";\n \techo \"<p id='cdn-description' class='description'>Input the url of the CDN to use with this site or leave this field blank to bypass the CDN.\";\n }", "protected function set_url_this_add($val){ $this->input ['add_url'] = $val ; }" ]
[ "0.6727739", "0.6651108", "0.65993536", "0.6570917", "0.64455575", "0.643784", "0.64063233", "0.6400369", "0.63005614", "0.62640715", "0.62575233", "0.6214456", "0.61953133", "0.6176557", "0.61503834", "0.6121549", "0.6120095", "0.61073273", "0.6091181", "0.607514", "0.6002328", "0.59917426", "0.59819144", "0.5960473", "0.5918649", "0.5914237", "0.59127116", "0.5904502", "0.58971334", "0.5804897" ]
0.82373905
0
Display the Infusion api key input field.
public function display_api_key() { $key = 'inf_key'; if ( isset( $this->existing_options[$key] ) && $this->existing_options[$key] ) $existing_value = $this->existing_options[$key]; else $existing_value = ''; $id = $key; settings_errors( $id ); echo '<input type="password" name="' . self::OPTION_NAME . '[' . $key . ']" id="' . $id . '"'; if ( $existing_value ) echo ' value="' . esc_attr( $existing_value ) . '"'; echo ' size="40" autocomplete="off" pattern="[a-zA-Z0-9-_]+" />'; echo '<p class="description">' . __( 'Not sure what the API key is or where to get it? <a target="_blank" href="http://kb.infusionsoft.com/index.php?/article/AA-00442/0/How-do-I-enable-the-Infusionsoft-API.html">Click here</a>', 'fb-eventpresso' ) . '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showApiKeyInput()\n\t{\n\t\t$id = 'revendless-api-key';\n\t\t$option = 'api_key';\n\n\t\t$value = (isset($this->options[$option]) && $this->options[$option]) ? ' value=\"'.esc_attr($this->options[$option]).'\"' : '';\n\n\t\tsettings_errors($id);\n\n\t\tprint '<input type=\"text\" name=\"'.self::OPTION_NAME.'['.$option.']\"'.$value.' id=\"'.$id.'\" maxlength=\"40\" size=\"45\" autocomplete=\"off\" pattern=\"[a-zA-Z0-9]+\" />';\n\t\tprint '<p class=\"description\">'.esc_html( __('An API Key associates your product integrations with your personal Revendless account.', 'revendless')).'</p>';\n\t}", "public function display_option_client_key() {\n $client_key = $this->options['client_key'];\n $this->display_input_text_field('client_key', $client_key);\n?>\nThe key that the server requires for authentication, passed in the <code><?php esc_attr_e($this->plugin->query_var()); ?></code> parameter.\n<?php\n }", "function sbrb_api_key_field_render() {\n $options = get_option('sbrb_settings');\n $valid_class = 'valid';\n if ( false == check_rebrandly_account() && $options['sbrb_api_key'] != '' ) {\n $feedback = '<p>' . __('Your API Key is invalid.', 'stratabeat_rebrandly_urls') . '</p>';\n $valid_class = 'invalid';\n }\n ?>\n <input type=\"text\" id=\"url-shortener-input-field\" name=\"sbrb_settings[sbrb_api_key]\" value=\"<?php echo $options['sbrb_api_key']; ?>\" class=\"<?php echo $valid_class; ?>\" required> \n <?php\n if ( isset($feedback) ) echo $feedback;\n }", "function bg_AddApiKeySettingsFieldHtml() {\n global $bg_optionGroup, $bg_opts_apiKey, $bg_input_apiKey, $bg_page;\n \n\t$options = get_option($bg_optionGroup);\n\t$apiKey = '';\n\tif (array_key_exists ($bg_opts_apiKey, $options)){\n\t\t$apiKey = $options[$bg_opts_apiKey];\n\t}\n\t\n\techo \"<input id='${$bg_page}_{$bg_opts_apiKey}' name='{$bg_input_apiKey}' size='40' type='text' value='{$apiKey}' />\";\n}", "function access_key_gui() {\n $access_key = get_option('amazon_polly_access_key');\n echo '<input type=\"text\" class=\"regular-text\" name=\"amazon_polly_access_key\" id=\"amazon_polly_access_key\" value=\"' . esc_attr($access_key) . '\" autocomplete=\"off\"> ';\n echo '<p class=\"description\" id=\"amazon_polly_access_key\">Required only if you aren\\'t using IAM roles</p>';\n }", "function lbcb_print_kuler_api( $name ){\n\t$lbcb_options = get_option( 'lbcb_options' );\n\t?>\n\t<input type=\"text\" name=\"lbcb_options[kuler_api_key]\" id=\"lbcb_options[kuler_api_key]\" value=\"<?php echo $lbcb_options['kuler_api_key']; ?>\" /><br /><br />\n\t<span class=\"description\"><a href=\"http://kuler.adobe.com/\">Kuler</a> <?php _e(' is a color palette-sharing web site/service from Adobe. You can sign up for an API key ', 'lbcb_textdomain' ); ?><a href=\"http://kuler.adobe.com/api/\"><?php _e('right here', 'lbcb_textdomain' ); ?></a>.</span>\n\t<?php\n}", "function API_key_field_markup($args)\n {\n $setting = get_option('widget_meteo_settings');\n $value = $setting['API_key'] ?: '';\n?>\n <input class=\"regular-text\" type=\"text\" name=\"widget_meteo_settings[API_key]\" value=\"<?= esc_attr($value); ?>\">\n\n <?php\n }", "public function settings_field_public_key() {\n\t\t?>\n\t\t<input name=\"theme_my_login_recaptcha[public_key]\" type=\"text\" id=\"theme_my_login_recaptcha_public_key\" value=\"<?php echo esc_attr( $this->get_option( 'public_key' ) ); ?>\" class=\"regular-text\" />\n\t\t<?php\n\t}", "public function google_key_callback()\n {\n $faq_url = '#';\n $value = isset( $this->general_options['google_key'] ) ? esc_attr( $this->general_options['google_key']) : '';\n printf(\n '<div class=\"validate\"><input type=\"text\" id=\"google_key\" name=\"fo_general_options[google_key]\" value=\"%s\" class=\"large-text %s %s\" placeholder=\"Ex: AIzaSyB1I0couKSmsW1Nadr68IlJXXCaBi9wYwM\" /><span></span></div>', $value , $this->is_google_static ? '' : 'valid', is_rtl() ? 'rtl' : 'ltr'\n );\n\n if($this->is_google_static){\n echo '<span style=\"color:#0073aa;font-weight: 500;\">' . sprintf( __('The plugin uses static google fonts list. In order to get the most current fonts list, Google requires an API key, generated via their interface. For more information read <a href=\"%s\" target=\"_blank\">our FAQ</a>.'), esc_url( $faq_url )) . '</span>';\n }\n }", "public function settings_field_private_key() {\n\t\t?>\n\t\t<input name=\"theme_my_login_recaptcha[private_key]\" type=\"text\" id=\"theme_my_login_recaptcha_private_key\" value=\"<?php echo esc_attr( $this->get_option( 'private_key' ) ); ?>\" class=\"regular-text\" />\n\t\t<?php\n\t}", "function fj_workflow_api_client_secret_field() {\n echo '<input type=\"text\" name=\"workflow_api[client_secret]\" value=\"' . get_option( 'workflow_api' )['client_secret'] . '\" size=\"80\" /><br />';\n}", "public function render_key_box ($service=false) {\n\t\t$services = $this->get_services();\n\t\tif (!in_array($service, array_keys($services))) return false;\n\n\t\t$value = $this->_model->get($service);\n\n\t\t?>\n<div class=\"api key <?php echo sanitize_html_class($service); ?>\">\n\t<p>\n\t\t<label for=\"api-key-<?php echo esc_attr($service); ?>\">\n\t\t\t<span class=\"label\"><?php echo esc_html($services[$service]['label']); ?></span>\n\t\t\t<input\n\t\t\t\ttype=\"text\" name=\"api-keys[<?php echo esc_attr($service); ?>]\" id=\"api-key-<?php echo esc_attr($service); ?>\"\n\t\t\t\tvalue=\"<?php echo esc_attr($value); ?>\"\n\t\t\t/>\n\t\t\t<?php wp_nonce_field(self::FORM_NONCE_ACTION . $service, self::FORM_NONCE_KEY . $service); ?>\n\t\t<?php if (!empty($services[$service]['help'])) { ?>\n\t\t\t<span class=\"help\"><?php echo $services[$service]['help']; ?></span>\n\t\t<?php } ?>\n\t\t</label>\n\t</p>\n</div>\n\t\t<?php\n\t}", "function secret_key_gui() {\n $secret_key = get_option('amazon_polly_secret_key');\n echo '<input type=\"password\" class=\"regular-text\" name=\"amazon_polly_secret_key\" id=\"amazon_polly_secret_key\" value=\"' . esc_attr($secret_key) . '\" autocomplete=\"off\"> ';\n echo '<p class=\"description\" id=\"amazon_polly_access_key\">Required only if you aren\\'t using IAM roles</p>';\n }", "function auth_apikey($key){\n\t\n}", "function key(){\n\t\t$api_key = '42b85431eba6a84d17266021e817d2a6';\n\t\treturn $api_key;\n\t}", "function mace_gif_setting_s3_keyid() {\n\t?>\n\t<input name=\"mace_gif_s3_keyid\" id=\"mace_gif_s3_keyid\" class=\"regular-text code mace-s3-storage-config\" type=\"text\" value=\"<?php echo esc_attr( mace_get_gif_s3_keyid() ); ?>\" />\n\t<?php\n}", "public function display_option_server_key() {\n $server_key = $this->options['server_key'];\n $this->display_input_text_field('server_key', $server_key);\n?>\nThe secret key that clients must use to clear the cache on this blog, passed in the <code><?php esc_attr_e($this->plugin->query_var()); ?></code> parameter.\n<?php\n }", "function showspace_api_key() {\n $options = get_option('showspace_options');\n return $options['showspace_api_key'];\n}", "public function render_license_key_settings_field() {\n\t\t$settings_field_name = $this->get_settings_field_name();\n\t\t$options = get_option( $settings_field_name );\n\t\t?>\n\t\t<input type='text' name='<?php echo $settings_field_name; ?>[license_key]' value='<?php echo $options['license_key']; ?>' class='regular-text' />\n\t<?php\n\t}", "private function getApikey() {\n\t\treturn $this->_apikey;\n\t}", "public function get_api_key(){\n\t\t$apikey = array_key_exists( 'apikey', $this->bvars) ? $this->bvars['apikey'] : false;\n\t\tif (!$apikey) {\t\t\t\n\t\t\t$this->get_errors()->add( new \\gcalc\\error( 10100 ) );\n\t\t\treturn 'anonymous';\n\t\t}\n\t\treturn $apikey;\n\t}", "function get_api_key()\n{\n return get_global_value('api-key');\n}", "public function show_formidable_key_field_admin_field( $field ) {\n\t\tif ( $field['type'] != 'key_validator' ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"frm_html_field_placeholder\">\n\t\t\t<div class=\"frm_html_field\"><?php echo FormidableKeyFieldManager::t( \"Validate key generated in the set target form.\" ) ?> </div>\n\t\t</div>\n\t\t<?php\n\t}", "private function getApiKey()\n\t{\n\t\treturn Mage::helper('core')->decrypt(Mage::getStoreConfig('whitePages_configuration/options/api_key'));\n\t}", "public function display() {\n\t\techo \"<input id='\" . esc_attr( $this->setting_id ) . \"' type='hidden' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( wp_json_encode( $this->get(), JSON_UNESCAPED_UNICODE ) ) . \"'>\";\n\t}", "public function show(ApiKey $apikey)\n {\n return view('admin.apikey.show', ['model' => $apikey]);\n }", "public function getApiKey()\n {\n return $this->getParameter('appid');\n }", "public function getAPIKey()\n {\n return (string)Mage::getStoreConfig(self::CONFIG_API_KEY);\n }", "public function dbs_client_id_html()\r\n\t{\r\n\t\t?>\r\n\t <input type=\"text\" name=\"dbs_client_id\" value=\"<?php echo get_option('dbs_client_id')?>\" style=\"\r\n width: 600px !important;\"/>\r\n\r\n\t <?php\r\n\t}", "function placester_get_api_key() { return PL_Option_Helper::api_key(); }" ]
[ "0.834101", "0.7331748", "0.7178171", "0.6946439", "0.69116455", "0.6893463", "0.6642264", "0.6632798", "0.6572274", "0.6444198", "0.6419516", "0.63499594", "0.6342872", "0.63209367", "0.6267529", "0.6253189", "0.622157", "0.61636037", "0.6143774", "0.6129837", "0.60782754", "0.6072356", "0.6062284", "0.6002208", "0.59969467", "0.59879917", "0.5967949", "0.5966005", "0.59553003", "0.5953058" ]
0.8547689
0
Returns the beta version
public function getBetaVersion() { return $this->betaVersion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function version()\n {\n return '3.0.0 Beta';\n }", "public function isBetaVersion()\n {\n $blBetaVersion = false;\n\n if (stripos($this->getConfig()->getVersion(), 'beta') !== false) {\n $blBetaVersion = true;\n }\n\n return $blBetaVersion;\n }", "public function get_version();", "public function IsBeta () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::BETA];\n\t}", "public function latest_version();", "abstract public function get_version();", "public function showBetaNote()\n {\n $blBetaNote = false;\n\n if ($this->isBetaVersion() || $this->isRCVersion()) {\n $blBetaNote = true;\n }\n\n return $blBetaNote;\n }", "public function getCurrentVersion();", "function isBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public static function getVersion()\r\n {\r\n \t$i = self::getVersionInfo();\r\n \treturn trim(\"{$i['major']}.{$i['minor']}.{$i['revision']}\" . ($i['patch'] != '' ? \".{$i['patch']}\" : \"\")\r\n \t. \"-{$i['stability']}{$i['number']}\", '.-');\r\n }", "function currentVersion() {\n if($this->current_version === false) {\n $this->current_version = DB::executeFirstCell('SELECT version FROM ' . TABLE_PREFIX . 'update_history ORDER BY created_on DESC LIMIT 0, 1');\n if(empty($this->current_version)) {\n $this->current_version = '1.0';\n } // if\n \t \n \t // activeCollab 2.0.2 failed to record proper version into update \n \t // history so we need to manually check if we have 2.0.2. This is done \n \t // by checking if acx_attachments table exists (introduced in aC 2).\n \t if((version_compare($this->current_version, '2.0') < 0) && DB::tableExists(TABLE_PREFIX . 'attachments')) {\n \t $this->current_version = '2.0.2';\n \t } // if\n } // if\n return $this->current_version;\n }", "function GetVersion()\n {\n return '1.0';\n }", "public function getMinorVersion() {}", "public function getVersion(): string;", "public function getVersion(): string;", "public function getLatestVersion()\n {\n return $this->version;\n }", "public function getOpenBetaDate();", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();" ]
[ "0.7742543", "0.73853207", "0.73174334", "0.7309363", "0.71123105", "0.7059199", "0.7026275", "0.70176", "0.690232", "0.6889793", "0.684558", "0.68064564", "0.676348", "0.6759779", "0.6759779", "0.67482054", "0.6743824", "0.67275345", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526", "0.67136526" ]
0.86589295
0
Returns the BLID of the uploader
public function getBLID() { return $this->blid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFBUID()\n\t{\n\t\treturn $this->fb_uid;\n\t}", "public function getUploadId()\n {\n return $this->data['upload_id'];\n }", "function getBrfId()\n {\n return (int) $this->_iBrfId;\n }", "public function getFileId(): string\n {\n return $this->file_id;\n }", "public function getManagerBLID() {\n\t\treturn $this->blid;\n\t}", "function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}", "public function getFileID()\n {\n return $this->get('FileID');\n }", "public function getId()\n {\n return $this->file->get('id');\n }", "public function getBloggerId()\r\n\t\t{\r\n\t\t\treturn $this->_blogger_id;\r\n\t\t}", "function currentVBUserID() {\n\t\t// This only works if you've clicked 'remember me', and it's really insecure.\n\t\tif(isset($_COOKIE['bbuserid'])) return $_COOKIE['bbuserid'];\n\t}", "public function getFile_id() {\n return (int) $this->_file_id;\n }", "function getBloggerId()\r\n {\r\n return $this->bloggerId;\r\n }", "public static function xms_upload_id(){\r\n\t $type = \"account_details\"; \r\n\t include 'inc/customer-id-uploader.php';\r\n\r\n\t}", "public function getFileId()\n\t{\n\t\treturn $this->fileId; \n\n\t}", "public function getFileId()\n {\n return $this->fileId;\n }", "public function getBankId()\n {\n if (!empty($this->info['bank_id'])) {\n return $this->info['bank_id'];\n }\n }", "public function getUserBreweryId () {\n\t\treturn ($this->userBreweryId);\n\t}", "public function getUploader()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\treturn $sfUsers::fetchUser($this->uploader);\n\t}", "public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}", "public static function xms_checkout_upload_id(){\r\n $type = \"checkout\";\r\n\t include 'inc/customer-id-uploader.php';\r\n\r\n\t}", "public function getLogoBlobId()\n {\n return $this->logo_blob_id;\n }", "public function getBackblazeB2KeyId() {\n return @$this->attributes['backblaze_b2_key_id'];\n }", "public function getUploadName(){\n if( isset( $this->uploadName ) )\n return $this->uploadName;\n }", "public function getBemBlPath()\n {\n return $this->bemBlPath;\n }", "public function getImageid()\n {\n return $this->imageid;\n }", "public function getGalleryProfileId(): string {\n\t\treturn ($this->galleryId);\n\t}", "public function getId()\n\t{\n\t\treturn $this->googleDriveFile->getId();\n\t}", "public function getBrandImgFile()\n {\n return $this->brandImgFile;\n }", "public function getUploadName(){\n\t\treturn $this->uploadName;\n\t}", "public function getWebhookId()\n {\n return Mage::getStoreConfig('trello_api/webhook/id');\n }" ]
[ "0.6774972", "0.6449164", "0.62175846", "0.6155021", "0.60928833", "0.6031803", "0.59978527", "0.59131736", "0.5897171", "0.5814916", "0.57569736", "0.5750019", "0.57484734", "0.57126045", "0.567549", "0.56649595", "0.566209", "0.564601", "0.563442", "0.5608853", "0.55927736", "0.5592663", "0.5591617", "0.556022", "0.55501294", "0.5545499", "0.5532324", "0.553122", "0.5514609", "0.5512072" ]
0.6673975
1
Gets the dependancies of an addon
public function getDependencies() { return DependencyManager::getDependenciesFromAddonID($this->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDependencies();", "function get_dependencies();", "public function getDependencies() {}", "public function getDependencies()\n {\n if (!$this->isDependenciesLoaded)\n {\n $db = Codeli::getInstance()->getDB();\n\n $this->dependencies = array();\n\n $results = $db->query(\"SELECT * FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n while ($res = $db->fetchObject($results))\n {\n $this->dependencies[$res->dependencyGuid] = $res;\n }\n\n $this->isDependenciesLoaded = true;\n }\n\n return $this->dependencies;\n }", "public function getDependencies(): array;", "function GetDependencies()\n {\n return array();\n }", "public function getDependencies()\n {\n return array(\n new ModuleDependency('files'),\n new ModuleDependency('user'),\n new ModuleDependency('db'),\n new ModuleDependency('orm'),\n new ModuleDependency('scriptcollector'),\n new ModuleDependency('search'),\n new ModuleDependency('word')\n );\n }", "public static function getDependencies()\n {\n // This plugin does not depend on others so return an empty array.\n return array();\n }", "public static function getDependencies()\n {\n return [];\n }", "public static function getDependencies()\n {\n return [];\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'JavaScript enabled',\n 'points',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "function GetDependencies() {\n\t\treturn array();\n\t}", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'wiki',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'iotds',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function getDependenciesList();", "public function get_dependencies()\n\t{\n\t\treturn array();\n\t}", "public function getDependencies()\n {\n return [];\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'Conversr',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'chat',\n 'mysql',\n ),\n 'recommends' => array(\n ),\n 'conflicts_with' => array()\n );\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n ],\n ];\n }", "public function getDependencies(): array\r\n {\r\n return [\r\n ];\r\n }", "public function getComposerDependencies(): array;", "public function getModuleDependencies()\n {\n return [\n 'Core42',\n 'Admin42',\n ];\n }", "function getDepends() {\n return $this->depends;\n }", "public function getDependencies(){ return array(); }", "public function getDependencies(): DependencyCollection;", "function getDependency();" ]
[ "0.74302506", "0.7369472", "0.7261551", "0.72138745", "0.7178607", "0.7178341", "0.71124756", "0.7088281", "0.70529395", "0.70529395", "0.7006528", "0.6985244", "0.6962028", "0.6909643", "0.69090545", "0.69017583", "0.68990636", "0.688454", "0.68439144", "0.68439144", "0.68439144", "0.6817584", "0.6775271", "0.676677", "0.6751804", "0.67155117", "0.66505986", "0.6629263", "0.662749", "0.6546236" ]
0.78329563
0
Gets the addon description formatted in TML (Torque Markup Language)
public function getDescriptionTML() { return TML::format($this->description); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "public function getDescription()\n {\n return $this->getNodeText('/p:package/p:description');\n }", "public static function getDescription();", "public function getDescription() {\n\t\t\treturn $this->MODULE_DESCRIPTION;\t\n\t\t}", "function getDescription() {\n\t\treturn __('plugins.themes.ufrn-theme.description');\n\t}", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "function getDescription() {\n return lang('Some description');\n }", "function getDescription() ;", "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = 'Generates a link to a random page.';\n\t\t$txt['html'] = '<p>Generates a link to a random page.</p>';\n\t\treturn $txt['html'];\n\t}", "public function description();", "public function description();" ]
[ "0.68838567", "0.67605674", "0.6690251", "0.66882825", "0.6678195", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6676346", "0.6674464", "0.6660319", "0.66409105", "0.6634092", "0.6634092" ]
0.7747348
0
Gets the addons reason for rejection
public function getRejectReason() { if(isset($this->reviewInfo->rejectReason)) { return $this->reviewInfo->rejectReason; } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReason();", "public function getReason();", "public function getReason()\n {\n return $this->reason;\n }", "public function getReason()\n {\n return $this->reason;\n }", "public function getReason()\n {\n return $this->reason;\n }", "public function getReason()\n {\n return $this->reason;\n }", "public function getReason()\n {\n return $this->reason;\n }", "function getReason()\n\t{\n\t\treturn $this->reason;\n\t}", "public function getReason()\n\t{\n\t\treturn $this->reason;\n\t}", "public function getReason()\n {\n return $this->reason;\n }", "public function getReason(): string\r\n {\r\n return $this->reason;\r\n }", "public function getFailureReason();", "public function getReason()\n {\n }", "public function getReason()\n {\n }", "public function getConsentRejected()\n {\n if ($this->project->offsetExists('consentRejected')) {\n return $this->project->consentRejected;\n }\n\n return 'do not use';\n }", "public function getReason()\r\n {\r\n return $this->message;\r\n }", "public function get_rejection_reasons()\n {\n $results = $this->results();\n\n $rejection_data = array();\n\n foreach($results['SubmitNotificationBatchResult']->NotificationRejections->Rejection as $rejection)\n {\n $rejection_data[] = array\n (\n 'ProposalID' => $rejection->ProposalID,\n 'AgreementNumber' => $rejection->AgreementNumber,\n 'ClientReference' => $rejection->ClientReference,\n 'Reason' => $rejection->Reason\n );\n }\n\n return $rejection_data;\n }", "public function reason()\n {\n return $this->response->getReasonPhrase();\n }", "public function getReasonCode();", "public function getReasonCode()\n {\n return $this->reason_code;\n }", "public function getReasonCode()\n {\n return $this->reason_code;\n }", "public function getFailedReasonMessage(){\n $failedReasonMessages = self::getFailedReasonMessages();\n if(isset($failedReasonMessages[$this->failedReason])){\n return $failedReasonMessages[$this->failedReason];\n }else {\n return $this->failedReason;\n }\n }", "public function getFailReason()\n {\n return $this->get(self::_FAIL_REASON);\n }", "public function getFailureReason()\n {\n return $this->failure_reason;\n }", "public function getConsentRejected()\r\n {\r\n if ($this->project->offsetExists('consentRejected')) {\r\n return $this->project->consentRejected;\r\n }\r\n\r\n // Remove in 1.7.3\r\n if ($this->project->offsetExists('concentRejected')) {\r\n throw new \\Gems_Exception_Coding('project.ini setting was changed from \"concentRejected\" to \"consentRejected\", please update your project.ini');\r\n }\r\n\r\n return 'do not use';\r\n }", "public function getReasonCode()\n {\n return $this->reasonCode;\n }", "public static function reasons()\n {\n return [\n 'VIOLENCE' => static::VIOLENCE,\n 'CHILD_ABUSE' => static::CHILD_ABUSE,\n 'PROMOTES_TERRORISM' => static::PROMOTES_TERRORISM,\n 'COPYRIGHT' => static::COPYRIGHT,\n ];\n }", "public function getReasonReference()\n {\n return $this->reasonReference;\n }", "public function getReasonPhrase();", "function get_ban_reason()\n\t{\n\t\treturn $this->_ban_reason;\n\t}" ]
[ "0.70913875", "0.70913875", "0.69504625", "0.69504625", "0.69504625", "0.69504625", "0.69504625", "0.6929878", "0.6927689", "0.69071263", "0.6889306", "0.68357426", "0.67512685", "0.67512685", "0.6712057", "0.6704697", "0.665209", "0.6588867", "0.6574662", "0.65532136", "0.65532136", "0.65272355", "0.65071595", "0.64776915", "0.6445967", "0.6416082", "0.6404076", "0.63907695", "0.6335323", "0.63278025" ]
0.73665905
0
Gets the screenshot id's associated with the addon
public function getScreenshots() { return ScreenshotManager::getScreenshotsFromAddon($this->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getScreenshotData();", "public function getScreenshotUrl()\n {\n return $this->screenshotUrl;\n }", "public function getScreenshotInfo($screenshot_id)\n {\n $url = $this->target->getUrl(Target::URL_SCREENSHOT, array('id' => $screenshot_id));\n $response = $this->connection->fetch($url, 'get', null);\n\n return array_merge(\n array('success' => true),\n $this->getScreeshotInfoFromData($response)\n );\n }", "function getMonitorIds() {\n\t\t$MonitorElementObject = new MonitorElement('artifact');\n\t\treturn $MonitorElementObject->getMonitorUsersIdsInArray($this->getID());\n\t}", "public function getScreenshotFilePath() {\n $uploadPath = $this->getScreenshotUploadPath();\n if (!is_dir($uploadPath)) {\n mkdir($uploadPath);\n }\n return $uploadPath . $this->id . \".\" . $this->screenshotFile->extension;\n }", "public function getScreenshot(): string\n {\n return $this->screenshot;\n }", "public static function getAlias() {\n return 'Screenshot';\n }", "public function flarumExtensionIds(): array\n {\n if (is_null($this->report)) {\n return [];\n }\n\n $modules = array_get($this->report, 'homepage.modules');\n\n if (!is_array($modules)) {\n return [];\n }\n\n $ids = [];\n\n foreach ($modules as $module) {\n $parts = explode('/', $module);\n\n if (count($parts) >= 2) {\n $ids[] = $parts[0] . '-' . $parts[1];\n }\n }\n\n return $ids;\n }", "public function screenshots($value = null)\n \t{\n \t\tif ($value != null) $this->_screenshots = $value;\n \t\telse return $this->_screenshots;\n \t}", "function getID() {\n\t\treturn $this->data_array['artifact_id'];\n\t}", "public function getScreenshotUploadPath () {\n return \\Yii::$app->params['bugReport']['screenShotPath'];\n }", "public function getShots()\n {\n $events = $this->getEvents('shot');\n return array_key_exists('shot', $events) ? $events['shot'] : array();\n }", "function getImageId();", "function getStoragePageIds() ;", "public function getPageEntryIds();", "public function fetch_screenshot_list() {\n\n\t\t$screenshots = array();\n\n\t\tif ( ! $this->video_url_list ) {\n\n\t\t\treturn $screenshots;\n\t\t}\n\n\t\t$video_url_list = Publisher_Fetch_Screenshot_util::categorize_video_url_list( self::get_video_url_list() );\n\n\n\t\tforeach ( $video_url_list as $provider => $category_videos_list ) {\n\n\t\t\tif ( ! $this->load_service_provider_object( $provider ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$screenshots = array_merge(\n\t\t\t\t$screenshots,\n\t\t\t\t$this->provider_instance->fetch_screenshots_list( $category_videos_list )\n\t\t\t);\n\t\t}\n\n\n\t\treturn $screenshots;\n\t}", "public function get_group_disks_ids()\n {\n $suite_array = $this->album_suite;\n if (!count($suite_array)) {\n $suite_array[] = $this->id;\n }\n\n return $suite_array;\n }", "function get_screen_icon()\n {\n }", "public function getAddonId()\n {\n return $this->addon_id;\n }", "public function getAddonId()\n {\n return $this->addon_id;\n }", "public static function getScreenshot($url = false)\n {\n if ('' == Config\\ApiKeys::THUMBALIZR_API) {\n throw new E('In order to use the THUMBALIZR, you must obtain\n and set an API key first (see seoapi\\Config\\ApiKeys.php).');\n exit(0);\n }\n $url = Helper\\Url::parseWebsite(parent::getUrl($url));\n $domain =sprintf(Config\\Services::THUMBALIZR_URL, $url, Config\\ApiKeys::JSONWHOIS_API);\n\n //$imgTag = '<img src=\"%s\" alt=\"Screenshot for %s\"/>';\n\t\t$imgTag = '<img src=\"'.$domain.\"\\\" alt=Screenshot for \\\"\".$url.\"\\\"/>\";\n \n //return sprintf($imgTag,$domain,$url);\n\t\t\n\t\t$result = array(\"screenshot_url\" => $imgTag);\n return $result;\n \n }", "public function getSpotsIds() {\n $query = \"SELECT \" . $this->prefix . \"id FROM ' . $this->prefix . 'spot WHERE spot_track_id=\" . $this->track_id . \" ORDER BY spot_last_update DESC LIMIT \" . $this->limit_spots;\n\n $result = db_query($query);\n\n $spot_ids = array();\n while($row = mysqli_fetch_array($result)){\n $spot_ids[] = $row['spot_id'];\n }\n\n return $spot_ids;\n }", "public function getExtensionIdentifier();", "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "public function getStoragePageIds() {}", "public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }", "private static function get_critical_screen_ids() {\n\t\treturn array( 'dashboard', 'plugins', 'plugins-network', 'edit-job_listing', 'job_listing_page_job-manager-settings' );\n\t}", "public function getImagesId()\n {\n $url = str_replace(\"[:action]\", \"images/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "function getStringID() {\n\t\treturn '[#'.$this->data_array['artifact_id'].']';\n\t}", "public function getScreenshotDir()\n {\n if (is_null($this->screenshotDir) && defined('SELENIUM_TESTS_SCREENSHOTDIR')) {\n $this->setScreenshotDir(SELENIUM_TESTS_SCREENSHOTDIR);\n }\n return $this->screenshotDir;\n }" ]
[ "0.60230094", "0.5836656", "0.5826459", "0.5701319", "0.5633349", "0.5594444", "0.5578208", "0.54243124", "0.5400457", "0.5371337", "0.53528076", "0.5285388", "0.52161455", "0.51917285", "0.51356876", "0.5135479", "0.5118047", "0.4997365", "0.49910176", "0.49910176", "0.49879417", "0.49778244", "0.49493882", "0.49344936", "0.49248475", "0.49190095", "0.49122065", "0.4909667", "0.48783252", "0.48674068" ]
0.7331117
0
Gets the total downloads of the addon (sum of all download types)
public function getTotalDownloads() { return StatManager::getTotalAddonDownloads($this->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function edd_count_total_file_downloads() {\n global $edd_logs;\n return $edd_logs->get_log_count( null, 'file_download' );\n}", "public function getDownloadCount()\n\t{\n\t\treturn $this->downloads;\n\t}", "function get_all_download_count() {\n\t// the cached count is maintained in PluginProject::updateDownloadCount\n\treturn (int)elgg_get_plugin_setting('site_plugins_downloads', 'community_plugins');\n}", "public function getAlldownloadcounter() {}", "public function getDownloads($type) {\n\t\treturn StatManager::getAddonDownloads($this->id, $type);\n\t}", "public function getNoOfDownloads()\n {\n return $this->noOfDownloads;\n }", "public function totalDownloads()\n\t{\n\t\t$totalDownloadsQuery = $this->_generateColumnSumQuery('primary_accesses');\n\n\t\treturn (int) $this->_runQuery($totalDownloadsQuery);\n\t}", "public function getDownloadcounter() {}", "public function getBaseTotalOfflineRefunded();", "public function get_total()\n\t{\n\t\tif ($this->total === null)\n\t\t{\n\t\t\t$types = $this->get_applicable_types();\n\n\t\t\tif (!empty($types))\n\t\t\t{\n\n\t\t\t\t$sql = 'SELECT COUNT(contrib_id) AS cnt\n\t\t\t\t\tFROM ' . $this->contribs_table . '\n\t\t\t\t\tWHERE ' . $this->db->sql_in_set('contrib_status', array(\n\t\t\t\t\t\t\text::TITANIA_CONTRIB_APPROVED,\n\t\t\t\t\t\t\text::TITANIA_CONTRIB_DOWNLOAD_DISABLED,\n\t\t\t\t\t\t)) . '\n\t\t\t\t\t\tAND ' . $this->db->sql_in_set('contrib_type', $types);\n\t\t\t\t$result = $this->db->sql_query($sql);\n\t\t\t\t$this->total = (int) $this->db->sql_fetchfield('cnt', $result);\n\t\t\t\t$this->db->sql_freeresult($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->total = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->total;\n\t}", "public function downloadsize() {\n return $this->info['size_download'];\n }", "public function getTotalPages() {\n\t\t##\thttps://docs.topspin.net/tiki-index.php?page=Store+API\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe number of total pages of Items\n\t\t$url = 'http://app.topspin.net/api/v1/offers';\n\t\t$post_args = array(\n\t\t\t'artist_id' => $this->artist_id\n\t\t);\n\t\t$data = json_decode($this->process($url,$post_args,false));\n\t\tif(isset($data->total_pages)) { return $data->total_pages; }\n\t}", "public function getTotalProductsByDownloadId($download_id){\n\t\t$sql = \"SELECT COUNT(*) AS total FROM product_download WHERE download_id = '\" . (int)$download_id . \"'\";\n\t\t$query = $this->db->query($sql);\n\t\t\n\t\treturn $query->row['total'];\n\t}", "protected function getTotItems()\n {\n if ($this->exportableHandler !== null) {\n return $this->exportableHandler->getTotItems();\n } else {\n return 0;\n }\n }", "public static function totalAmountOfOffers()\n {\n return Offer::getTotalAmountOfOffers();\n\n }", "public function total()\n {\n $total = 0;\n\n foreach ($this->contents() as $item) $total += (float)$item->total();\n\n return (float)$total;\n }", "public function getTotalOfflineRefunded();", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function get_total_reports() {\n\t\treturn $this->total_reports;\n\t}", "public function getTotal()\n {\n $response = $this->client->post( 'https://idf.intven.com/public_patent_listing.json', [\n 'verify' => false,\n 'json' => [\n \"report_type\" => \"public_patent_listing\",\n \"queryFields\" => new \\stdClass(),\n \"filters\" => new \\stdClass(),\n \"per_page\" => 0,\n \"from\" => 0,\n \"sort\" => \"issued_on\",\n \"sort_order\" => \"desc\"\n ],\n ]);\n $data = json_decode($response->getBody()->getContents());\n return $data->meta_data->total_count;\n }", "function tdc_get_count($filenode){\n return $filenode->downloadcount[0]; \n}", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}", "function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}", "function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "function countUsage_FcFileBtn_DownloadLinks(&$rows)\n\t{\n\t\tif ( !count($rows) ) return;\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$file_id_arr[] = $row->id;\n\t\t}\n\t\t$query\t= 'SELECT a.id as file_id, COUNT(a.id) as count'\n\t\t\t\t. ' FROM #__flexicontent_files AS a'\n\t\t\t\t. ' JOIN #__flexicontent_file_usage AS u ON u.file_id = a.id'\n\t\t\t\t. ' WHERE a.id IN (' . implode(',', $file_id_arr) . ')'\n\t\t\t\t. ' GROUP BY a.id'\n\t\t\t\t;\n\t\t$assigned_data = $this->_db->setQuery($query)->loadObjectList('file_id');\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row->total_usage = isset($row->total_usage) ? $row->total_usage : 0;\n\t\t\t$download_links_count = isset($assigned_data[$row->id]) ? (int) $assigned_data[$row->id]->count : 0;\n\t\t\t$row->total_usage += $download_links_count;\n\t\t}\n\t}", "function cc_progress_total() {\n $campaign_total = file_get_contents(__DIR__ . '/../../../includes/total.txt');\n\n print $campaign_total;\n}", "public function downloadlength() {\n return $this->info['download_content_length'];\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }" ]
[ "0.72393465", "0.70773995", "0.70024073", "0.67012423", "0.6631074", "0.65103567", "0.64630294", "0.6391165", "0.6054727", "0.60199994", "0.6008677", "0.59926826", "0.5961547", "0.59540933", "0.59540164", "0.5905299", "0.58851624", "0.5840934", "0.5839767", "0.5837542", "0.582178", "0.5816896", "0.5804533", "0.5804533", "0.5804533", "0.5787026", "0.5776392", "0.57484806", "0.57036793", "0.56699896" ]
0.8306791
0
Returns a list of updates for this addon
public function getUpdates() { return AddonManager::getUpdates($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdates()\n {\n return $this->updates;\n }", "public function getUpdates() {\n return $this->updates;\n }", "public function getUpdateList()\n {\n return $this->updateList;\n }", "protected function listUpdates() {}", "function list_plugin_updates()\n {\n }", "function get_plugin_updates()\n {\n }", "public function getUpdates()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('updates');\n }", "abstract protected function getAllUpdates();", "public function scanForUpdates() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrVersions = $objManager->getArrLatestVersion();\n\n foreach($arrVersions as $strOneModule => $strOneVersion) {\n $objMetadata = $objManager->getPackage($strOneModule);\n if($objMetadata != null) {\n $objManager->updateAvailable($objManager->getPackageManagerForPath($objMetadata->getStrPath()), $strOneVersion);\n }\n }\n\n return $arrVersions;\n }", "private function getAvailableUpdates()\n\t{\n\t\t$updateArray = array();\n\t\t$updateFiles = get_dir_contents (INCLUDE_FILES . '/updates');\n\n\t\tforeach ($updateFiles as $file)\n\t\t{\n\t\t\t$updateVersion = substr($file, -8, -4);\n\t\t\t// .. and where the version indicator is greater than the current ph version\n\t\t\tif (ctype_digit($updateVersion) && $this->currentVersion < (int)$updateVersion)\n\t\t\t{\n\t\t\t\t$updateArray[$updateVersion] = $file;\n\t\t\t}\n\t\t}\n\n\t\tasort($updateArray); // vital to get them in the correct order!\n\n\t\treturn $updateArray;\n\t}", "function GetUpdatesList($updates_dir)\n\t{\n\t\t$updates = $this->GetUpdatesFilesList($updates_dir);\n\t\t\n\t\t// get statuses from database\n\t\t$this->db->q('SELECT * FROM #_PREF_updates');\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$u_id = $item['rev_num'].'-'.strtoupper($item['type']);\n\t\t\tif (isset($updates[$u_id])) {\n\t\t\t\t$updates[$u_id]['status'] = $item['status'];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tforeach ($updates as $k=>$update) {\n\t\t\t// remove update\n\t\t\tif ($this->do_not_show_included_updates && $update['rev_num'] <= $this->current_revision) {\n\t\t\t\tunset($updates[$k]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// set update status\n\t\t\tif (empty($updates[$k]['status'])) {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t\telse $updates[$k]['status'] = 'not applied';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tswitch ($updates[$k]['status']) {\n\t\t\t\tcase 'ok': $updates[$k]['status_html'] = '<span style=\"color: green; font-weight: bold;\">Ok</span>'; break;\n\t\t\t\tcase 'included': $updates[$k]['status_html'] = '<span style=\"color: silver; font-weight: bold;\">Included</span>'; break;\n\t\t\t\tcase 'not applied': $updates[$k]['status_html'] = '<span style=\"color: #D2D200; font-weight: bold;\">Not Applied</span>'; break;\n\t\t\t\tcase 'error': $updates[$k]['status_html'] = '<span style=\"color: red; font-weight: bold;\">Error!</span>'; break;\n\t\t\t\tdefault: \n\t\t\t\t\t$updates[$k]['status_html'] = $updates[$k]['status'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tuksort($updates, \"compare_updates\");\n\t\t\n\t\t/*echo \"<pre>\";\n\t\tvar_dump($updates);\n\t\techo \"</pre>\";*/\n\t\t\t\t\n\t\treturn $updates;\n\t}", "private function checkPluginUpdates() \n\t{\n\t\t// force WP to check plugins for updates\n\t\tdo_action( \"wp_update_plugins\" );\n\t\t \n\t\t// get information of updates\n\t\t$updatePlugins = get_site_transient( 'update_plugins' ); \n\t\t$updates = array();\n\t\t\n\t\tif (isset($updatePlugins->response))\n\t\t{\n\t\t\tforeach ($updatePlugins->response as $plugin)\n\t\t\t{\n\t\t\t\t$item = new stdClass();\n\t\t\t\t$item->title = $plugin->slug;\n\t\t\t\t$item->update = TRUE;\n\t\t\t\t$item->currentVersion = $updatePlugins->checked[$plugin->plugin];\n\t\t\t\t$item->newVersion = $plugin->new_version;\n\t\t\t\t\n\t\t\t\t$updates[] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $updates;\n\t}", "public function getUpdates()\n {\n $query = \"SELECT * FROM events WHERE id > ? AND game_id = ? AND player = ?\";\n $result = $this->oDB->getAll($query, array(\n $this->oData->getLastIdEvents(),\n $this->oData->getIdGames(),\n $this->oData->getOtherNumber()\n ));\n\n $updates = array();\n foreach ($result as $value) {\n switch ($value['event_type']) {\n case \"name_update\":\n $this->oData->setOtherName($value['event_value']);\n break;\n\n case \"start_game\":\n $this->oData->setOtherShips($value['event_value']);\n break;\n\n case \"shot\":\n $this->oData->appendOtherShots($value['event_value']);\n break;\n }\n\n $lastIdEvents = max($this->oData->getLastIdEvents(), $value['id']);\n $this->oData->setLastIdEvents($lastIdEvents);\n\n if ($value['event_type'] == \"chat\") {\n $eventValue = new \\stdClass();\n $eventValue->text = $value['event_value'];\n $eventValue->timestamp = $value['timestamp'];\n } elseif ($value['event_type'] == 'start_game') {\n $eventValue = true;\n } else {\n $eventValue = $value['event_value'];\n }\n\n $updates[ $value['event_type'] ][] = $eventValue;\n $updates['lastIdEvents'] = array($lastIdEvents);\n }\n\n return $updates;\n }", "function get_updates($includehidden=false) {\n if ($includehidden == true) {\n return $this->updates;\n }\n $updates = array();\n if (!empty($this->updates)) {\n foreach($this->updates as $update) {\n if ($update->hidden == 1) {\n continue;\n }\n $updates[] = $update;\n }\n }\n return $updates;\n }", "public function app_update(){\n return [\n 'update_available' => (new Installer)->web_update_available(),\n ];\n\t}", "public function getUpdatesFromPolling() {\n $updateIdCachePath = __DIR__ . '/last-update-id.txt';\n\n if (file_exists ($updateIdCachePath)) {\n $lastUpdate = file_get_contents($updateIdCachePath);\n $updates = $this->api->getUpdates((int)$lastUpdate + 1);\n } else {\n $updates = $this->api->getUpdates();\n }\n\n $maxUpdateId = 0;\n\n foreach ($updates as $update) {\n $this->processUpdate($update);\n\n $maxUpdateId = $maxUpdateId > $update->getUpdateId() ? $maxUpdateId : $update->getUpdateId();\n }\n\n if ($maxUpdateId) {\n file_put_contents($updateIdCachePath, $maxUpdateId);\n }\n }", "function list_core_update($update)\n {\n }", "public function getUpdated();", "public function getUpdated();", "public function getUpdatesList($force = false)\n {\n static $result;\n\n if ($result) {\n return $result;\n }\n\n $result = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $setting = setting();\n\n if ($force || ($setting->api_checked_at && $setting->api_checked_at->diffInHours() >= 12)) {\n $this->updateVersionsFromApi();\n }\n\n $packages = Package::all();\n $componentsVersions = $this->getPackagesVersions();\n\n foreach ($packages as $package) {\n if (array_get($componentsVersions, $package->type.'.'.$package->namespace) == $package->api_version) {\n continue;\n }\n\n $result[$package->type][$package->namespace] = [\n 'namespace' => $package->namespace,\n 'date' => $package->date,\n 'version' => $package->api_version,\n ];\n }\n\n return $result;\n }", "function get_core_updates($options = array())\n {\n }", "public function getUpdates()\n {\n if (array_key_exists(\"updates\", $this->_propDict)) {\n if (is_a($this->_propDict[\"updates\"], \"\\Beta\\Microsoft\\Graph\\Model\\AdminWindowsUpdates\") || is_null($this->_propDict[\"updates\"])) {\n return $this->_propDict[\"updates\"];\n } else {\n $this->_propDict[\"updates\"] = new AdminWindowsUpdates($this->_propDict[\"updates\"]);\n return $this->_propDict[\"updates\"];\n }\n }\n return null;\n }", "public function update()\n {\n return [\n [self::DRUSH, 'updatedb']\n ];\n }", "public static function get_cached_addons() {\n\n if ( false === ( $addons = get_site_option( 'x_extension_list', false ) ) ) {\n\n \tThemeco_Update_Api::refresh();\n\n \tif ( false === ( $addons = get_site_option( 'x_extension_list', false ) ) ) {\n \t\treturn array(\n \t\t\t'error' => true,\n \t\t\t'message' => __( 'Could not retrieve extensions list. For assistance, please start by reviewing our article on troubleshooting <a href=\"https://community.theme.co/kb/connection-issues/\">connection issues.</a>', '__x__' ),\n \t\t\t'verbose' => Themeco_Update_Api::get_errors()\n \t\t);\n \t}\n\n }\n\n return $addons;\n\n }", "public function getUpdater();", "public function getChangedEntries();", "public function _updateFeeds()\n\t{\n\t\t$EE =& get_instance();\n\n\t\trequire PATH_THIRD . \"nsm_addon_updater/libraries/Epicurl.php\";\n\n\t\t$sources = FALSE;\n\t\t$feeds = FALSE;\n\t\t$mc = EpiCurl::getInstance();\n\n\t\tforeach($EE->addons->_packages as $addon_id => $addon)\n\t\t{\n\t\t\t$config_file = PATH_THIRD . '/' . $addon_id . '/config.php';\n\n\t\t\tif(!file_exists($config_file))\n\t\t\t\tcontinue;\n\n\t\t\tinclude $config_file;\n\n\t\t\t# Is there a file with the xml url?\n\t\t\tif(isset($config['nsm_addon_updater']['versions_xml']))\n\t\t\t{\n\t\t\t\t$url = $config['nsm_addon_updater']['versions_xml'];\n\n\t\t\t\t# Get the XML again if it isn't in the cache\n\t\t\t\tif($this->test_mode || ! $xml = $this->_readCache(md5($url)))\n\t\t\t\t{\n\n\t\t\t\t\tlog_message('debug', \"Checking for updates via CURL: {$addon_id}\");\n\n\t\t\t\t\t$c = FALSE;\n\t\t\t\t\t$c = curl_init($url);\n\t\t\t\t\tcurl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\t\t@curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);\n\t\t\t\t\t$curls[$addon_id] = $mc->addCurl($c);\n\t\t\t\t\t$xml = FALSE;\n\t\t\t\t\tif($curls[$addon_id]->code == \"200\" || $curls[$addon_id]->code == \"302\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$xml = $curls[$addon_id]->data;\n\t\t\t\t\t\t$this->_createCacheFile($xml, md5($url));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t# If there isn't an error with the XML\n\t\t\tif($xml = @simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA))\n\t\t\t{\n\t\t\t\t$feeds[$addon_id] = $xml;\n\t\t\t}\n\n\t\t\tunset($config);\n\t\t}\n\n\t\treturn $feeds;\n\t}", "function list_translation_updates()\n {\n }", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "function GetUpdatesFilesList($updates_dir)\n\t{\n\t\t$updates = array(); \n\t\t\n\t\t$d = dir(\"$updates_dir\");\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif (preg_match('/^update-(.+?) (\\d+)(.*?)\\.php/', $entry, $match)) {\n\t\t\t\t$item = array (\n\t\t\t\t\t'filename' => $entry,\n\t\t\t\t\t'type' => strtoupper($match[1]),\n\t\t\t\t\t'rev_num' => (int)$match[2],\n\t\t\t\t\t'desc' => trim($match[3]),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$updates[$item['rev_num'].'-'.$item['type']] = $item;\n\t\t }\n\t\t}\n\t\t$d->close();\n\t\t\n\t\treturn $updates;\n\t}" ]
[ "0.7739378", "0.77109253", "0.7687507", "0.7665708", "0.7505424", "0.7287254", "0.7219403", "0.70088124", "0.6923479", "0.6901489", "0.68692154", "0.674815", "0.6738253", "0.66978025", "0.6632481", "0.66075665", "0.654447", "0.6520583", "0.6520583", "0.648359", "0.6451416", "0.64196277", "0.63257295", "0.6322824", "0.6293452", "0.62871754", "0.62761134", "0.62733996", "0.62585163", "0.623973" ]
0.8280899
0
Returns the date uploaded
public function getUploadDate() { return $this->uploadDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDocumentUploadDate() {\n return $this->document['uploadDate'];\n }", "public function getDateUpload()\n {\n if (!isset($this->dateUpload)) {\n $this->dateUpload = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getDateUploadQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->dateUpload;\n }", "public function getUploadDate()\n\t{\n\t\treturn new fTimetamp($this->date);\n\t}", "public function uploaded() {\n return $this->created();\n }", "protected function getDateUploadQuery()\n {\n return $this->dateUploadQuery;\n }", "public function getLastUploadDatetime()\n {\n return $this->getValue('nb_domain_zone_last_upload_datetime');\n }", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "public function filetime() {\n return $this->info['filetime'];\n }", "public function getDateImport()\n {\n return $this->date_import;\n }", "public function fileTime() { return $this->_m_fileTime; }", "public function getPostedDate()\n {\n return $this->_fields['PostedDate']['FieldValue'];\n }", "public function getPostedDate()\n {\n return $this->_fields['PostedDate']['FieldValue'];\n }", "public function get_date_modified();", "public function getOriginalDate()\n {\n return $this->originalDate;\n }", "public function getGalleryDate() : \\DateTime {\n\t\treturn($this->galleryDate);\n\t}", "abstract protected function getUploadMtime();", "public function getSignatureDate() {\n return $this->signatureDate;\n }", "public function getSignatureDate() {\n return $this->signatureDate;\n }", "public function get_date_created();", "public function getTransferDate()\n {\n $value = $this->get(self::TRANSFERDATE);\n return $value === null ? (string)$value : $value;\n }", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getTransactionPostedDate()\n {\n return $this->_fields['TransactionPostedDate']['FieldValue'];\n }", "public function getCreateddate()\n {\n return $this->createddate;\n }", "public function getOriginalCreationDate() {\n return $this->originalCreationDate;\n }", "public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}", "public function getCreatedThingTransferDate()\n {\n $value = $this->get(self::CREATEDTHINGTRANSFERDATE);\n return $value === null ? (string)$value : $value;\n }", "public function dateSend()\n {\n if ($this->time) {\n return $this->time->format('m/d/Y');\n }\n }", "public function getDate() {\n if($this->items!==false)\n $date = date('Y-m-d H:i:s',strtotime(@current($this->items)->created_at));\n if(strlen($date)==0)\n $date = date('Y-m-d H:i:s');\n return $date;\n }", "public function getCreationDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->creationDate;\r\n\t}", "public function getUploadedFileName() {\n\t \t return $this->uploadedFileName;\n\t }" ]
[ "0.8442649", "0.77234113", "0.7682997", "0.713413", "0.7060238", "0.68477017", "0.68401027", "0.68391556", "0.6628378", "0.6555828", "0.65443814", "0.65443814", "0.6537988", "0.6477345", "0.6407735", "0.638052", "0.63578296", "0.63578296", "0.6348202", "0.6342542", "0.634099", "0.6331842", "0.6315217", "0.6310099", "0.627785", "0.6277396", "0.62749004", "0.62720305", "0.6265387", "0.6248853" ]
0.8627165
0
Checks if the addon has a beta version
public function hasBeta() { return $this->betaVersion !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBetaVersion()\n {\n $blBetaVersion = false;\n\n if (stripos($this->getConfig()->getVersion(), 'beta') !== false) {\n $blBetaVersion = true;\n }\n\n return $blBetaVersion;\n }", "public static function isStable()\n {\n return (bool) preg_match('/^[0-9\\.]+$/', static::VERSION);\n }", "public function IsBeta () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::BETA];\n\t}", "function isBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "function birdseye_component_checkversion()\n{\n if (!function_exists('get_product_release'))\n return false;\n if (get_product_release() < 207)\n return false;\n\n return true;\n}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "public function isInstalledVersionAReleasedVersion() {}", "public function showBetaNote()\n {\n $blBetaNote = false;\n\n if ($this->isBetaVersion() || $this->isRCVersion()) {\n $blBetaNote = true;\n }\n\n return $blBetaNote;\n }", "public function getBetaVersion() {\n\t\treturn $this->betaVersion;\n\t}", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public function hasVersions(): bool;", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "public static function check_db_version_for_addons(){\n $is_new_addon_db_version_available = false;\n $installed_addons = self::get_installed_addons_list();\n if(empty($installed_addons)) return;\n foreach($installed_addons as $installed_addon){\n $current_addon_db_version = get_option($installed_addon['name'] . '_addon_db_version');\n if(!$current_addon_db_version || version_compare($current_addon_db_version, $installed_addon['db_version'])){\n update_option( $installed_addon['name'] . '_addon_db_version', $installed_addon['db_version'] );\n $is_new_addon_db_version_available = true;\n }\n }\n if($is_new_addon_db_version_available) self::install_database_for_addons();\n }", "public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }", "abstract function has_premium_version();", "public function has_versions()\n {\n return ($this->get_current() != 1);\n }", "function ninja_forms_three_addons_version_check(){\n// $items = wp_remote_retrieve_body( $items );\n $items = file_get_contents( dirname( __FILE__ ) . '/addons-feed.json' );\n $items = json_decode( $items, true );\n\n if( is_array( $items ) ) {\n foreach ($items as $item) {\n\n if (empty($item['plugin'])) continue;\n if (!file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) continue;\n\n $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true);\n\n if (!$plugin_data['Version']) continue;\n if (version_compare($plugin_data['Version'], '3', '>=')) continue;\n\n /*\n * There are non-compatible add-ons installed.\n */\n\n return FALSE;\n }\n }\n\n return TRUE;\n}", "function tidypics_is_upgrade_available() {\n\t// sets $version based on code\n\trequire_once elgg_get_plugins_path() . \"tidypics/version.php\";\n\n\t$local_version = elgg_get_plugin_setting('version', 'tidypics');\n\tif ($local_version === false) {\n\t\t// no version set so either new install or really old one\n\t\tif (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {\n\t\t\t$local_version = 0;\n\t\t} else {\n\t\t\t// set initial version for new install\n\t\t\telgg_set_plugin_setting('version', $version, 'tidypics');\n\t\t\t$local_version = $version;\n\t\t}\n\t} elseif ($local_version === '1.62') {\n\t\t// special work around to handle old upgrade system\n\t\t$local_version = 2010010101;\n\t\telgg_set_plugin_setting('version', $local_version, 'tidypics');\n\t}\n\n\tif ($local_version == $version) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function plugin_chkVersion_jtickets() {\n\tglobal $_JTICKETS_CONF;\n\t\n\treturn $_JTICKETS_CONF['pi_version'];\n}", "function VM_wasVBoxAddonDownloaded($version)\n{\n\treturn(file_exists(VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86-$version.run\"));\n}", "public function isYoungerPatchDevelopmentReleaseAvailable() {}", "function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}", "public function isYoungerReleaseAvailableReturnsFalseIfOnlyADevelopmentReleaseIsYounger() {}", "public function isYoungerPatchReleaseAvailable() {}", "public function isInstallVersionNewer()\n {\n // Get a db connection so we can find the installed version from #__extensions\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('manifest_cache'))\n ->from ($db->quoteName('#__extensions'))\n ->where ($db->quoteName('element') . ' = '. $db->quote('com_cajobboard'));\n\n $db->setQuery($query);\n\n $manifest = json_decode($db->loadResult(), true);\n $installedRelease = $manifest['version'];\n\n if (version_compare($newRelease, $installedRelease, 'le'))\n {\n JFactory::getApplication()->enqueueMessage(\n Text::sprintf('COM_CAJOBBOARD_NO_UPDATE_TO_AN_OLDER_VERSION', $installedRelease, $newRelease), 'error'\n );\n\n return false;\n }\n\n return true;\n }", "public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}", "function has_release_on_freemius() {\n\t\t\treturn ! $this->is_org_repo_compliant() ||\n\t\t\t $this->has_premium_version();\n\t\t}", "public function hasVersion(){\n return $this->_has(1);\n }", "public function isYoungerDevelopmentReleaseAvailableReturnsTrueIfADevelopmentReleaseIsYounger() {}" ]
[ "0.7679029", "0.71599454", "0.71464884", "0.7105199", "0.7060706", "0.67733335", "0.6640061", "0.6628518", "0.6605227", "0.6548789", "0.65316033", "0.6507119", "0.6467984", "0.63854086", "0.6292424", "0.6286186", "0.6275244", "0.62626636", "0.61667186", "0.61641484", "0.615933", "0.61521435", "0.6114674", "0.6110197", "0.61033005", "0.6089646", "0.6085697", "0.60847396", "0.6066211", "0.60625076" ]
0.7698113
0
Convert domain name test.xlinesoft.com return DC=test,DC=xlinesoft,DC=com
function ldap_DomainToDN($aDomain) { $arrDomain = explode(".", $aDomain); for ($i = 0; $i < sizeof($arrDomain); $i++) { $arrDomain[$i] = "dc=".$arrDomain[$i]; } return implode(',', $arrDomain); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _domainName() {\n\t\t$this->CI->load->helper('url');\n\t $url = site_url();\n\t //$parse the url\n\t\t$host = parse_url( $url, PHP_URL_HOST );\n\t\t//reverse array\n\t\t$host = array_reverse( explode( '.', $host ) );\n\t\t//check in_array for .bd domain name\n\t\tif( in_array( 'bd', $host ) == True ) :\n\t\t\t$host = $host[2] . '.' . $host[1] . '.' . $host[0];\n\t\telseif( in_array( 'localhost', $host ) == true ) :\n\t\t\t$host = $host[0];\n\t\telse :\n\t\t\t$host = $host[1] . '.' . $host[0];\n\t\tendif;\n\t\treturn $host;\n\t}", "public static function safeDomainName()\n {\n return implode('.', array(self::domainWord(), self::pickOne(array('example.com', 'example.net', 'example.org'))));\n }", "public function convert_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_load_library('openldap/LDAP_Driver'))\n return;\n\n $ldap = new \\clearos\\apps\\openldap\\LDAP_Driver();\n $ldaph = $ldap->get_ldap_handle();\n $dn = $ldap->get_master_dn();\n \n $attributes = $ldaph->read($dn);\n\n $domain = empty($attributes['clearMasterMailDomain'][0]) ? '' : $attributes['clearMasterMailDomain'][0];\n\n if (!empty($domain))\n $this->set_domain($domain);\n\n return $domain;\n }", "function getDomainName($domain = 0)\n{\n\tif($domain == 0)\n\t\t$domain = ARC_DOMAIN;\n\n\t$name = getDBData('domain_name', $domain, 'domain_id', 'domain');\n\n\tif($name == '')\n\t\treturn '-None-';\n\telse\n\t\treturn $name;\n}", "function getDomainName($url) {\r\n\r\n $matches = parse_url($url);\r\n\r\n if (isset($matches['host'])) {\r\n\r\n $domain = $matches['host'];\r\n\r\n $domain = str_replace(array('www.'), '', $domain);\r\n\r\n return $domain;\r\n }\r\n\r\n return $url;\r\n}", "public static function domainName()\n {\n return implode('.', array(self::domainWord(), self::domainSuffix()));\n }", "function displayFriendlyDomainName($domain_name) {\n\t$new_domain_name = function_exists('idn_to_utf8') ? idn_to_utf8($domain_name) : $domain_name;\n\tif ($new_domain_name != $domain_name) $new_domain_name = $domain_name . ' (' . $new_domain_name . ')';\n\t\n\treturn $new_domain_name;\n}", "function get_domain($url){\n $new_url = parse_url($url, PHP_URL_HOST);\n $url_array = explode('.', $new_url);\n\n if(count($url_array) == 1){\n if($url_array[0] != ''){\n return $url_array[0];\n }else{\n return 'Empty array';\n }\n }\n if(count($url_array) == 2){\n return $url_array[0];\n }\n if(count($url_array) == 3){\n return $url_array[1];\n }\n if(count($url_array) > 3 && $url_array[0] == 'www' && end($url_array) == 'com'){\n $url_str = '';\n $new_array = array_slice($url_array, 1, -1);\n foreach($new_array as $part){\n $url_str .= \"$part.\";\n }\n return rtrim($url_str, '.');\n }\n if(count($url_array) > 3 && end($url_array) == 'com'){\n $url_str = '';\n array_pop($url_array);\n foreach($url_array as $part){\n $url_str .= \"$part.\";\n }\n return rtrim($url_str, '.');\n }\n }", "function aiGet2ndLvlDomainName($url) {\r\n static $doubleTlds = array('co.uk', 'me.uk', 'net.uk', 'org.uk', 'sch.uk', 'ac.uk', 'gov.uk', 'nhs.uk', 'police.uk', 'mod.uk', 'asn.au', 'com.au','net.au', 'id.au', 'org.au', 'edu.au', 'gov.au', 'csiro.au','br.com', 'com.cn', 'com.tw', 'cn.com', 'de.com', 'eu.com','hu.com', 'idv.tw', 'net.cn', 'no.com', 'org.cn', 'org.tw','qc.com', 'ru.com', 'sa.com', 'se.com', 'se.net', 'uk.com','uk.net', 'us.com', 'uy.com', 'za.com');\r\n\r\n // sanitize the URL\r\n $url = trim($url);\r\n\r\n // check if we can parse the URL\r\n if ($host = parse_url($url, PHP_URL_HOST)) {\r\n\r\n // check if we have IP address\r\n if (preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $host)) {\r\n return $host;\r\n }\r\n\r\n // sanitize the hostname\r\n $host = strtolower($host);\r\n\r\n // get parts of the URL\r\n $parts = explode('.', $host);\r\n\r\n // if we have just one part (eg localhost)\r\n if (!isset($parts[1])) {\r\n return $parts[0];\r\n }\r\n\r\n // grab the TLD\r\n $tld = array_pop($parts);\r\n\r\n // grab the hostname\r\n $host = array_pop($parts) . '.' . $tld;\r\n\r\n // have we collected a double TLD?\r\n if (!empty($parts) && in_array($host, $doubleTlds)) {\r\n $host = array_pop($parts) . '.' . $host;\r\n }\r\n\r\n return $host;\r\n }\r\n\r\n return 'unknown domain';\r\n}", "function strip_domain($s) {\n\tglobal $olddomain; // eh.\n\t$s = str_replace($olddomain . '/',$olddomain,$s); // could cause bug if you have http://olddomain.com/olddomain/test.htm \n\t$s = str_replace('http://www.' . $olddomain,'',$s);\n\t$s = str_replace('http://' . $olddomain,'',$s);\n\treturn $s;\n}", "function get_clean_basedomain()\n {\n }", "public function domain_name () {\n\t\t\treturn sprintf(\n\t\t\t\t'%s.%s',\n\t\t\t\t$this->domain_word(),\n\t\t\t\tself::data_rand( 'domain_suffix' )\n\t\t\t);\n\t\t}", "protected function _makeDomain($domain) {\n\t\treturn sprintf(self::ENTANET_DOMAIN, $domain);\n\t}", "public static function domainWord()\n {\n list($first) = explode(' ', Company::name());\n return strtolower(preg_replace('/\\W/', '', $first));\n }", "public function testParseDomainFromUrl()\n\t{\n\t\t$res = $this->object->getDomain('http://www.facebook.com/liren');\n\t\t$exp = 'facebook';\n\n\t $this->assertEquals($res, $exp, 'Domain name was not parsed correctly.');\n\n\t}", "function formatURL($url) {\n $url = trim($url, '/');\n if (!preg_match('#^http(s)?://#', $url)) {\n $url = 'http://' . $url;\n }\n $urlParts = parse_url($url);\n $domain = preg_replace('/^www\\./', '', $urlParts['host']);\n return $domain;\n}", "function normalize_dn($dn){\n $dn = preg_replace('/,/',', ',$dn);\n $dn = preg_replace('/,\\s+/',', ',$dn);\n return $dn;\n}", "function get_domain()\n\t{\n\t\t$http_host = $_SERVER['HTTP_HOST'];\n\t\t$DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];\n\t\t$site_root = str_replace($DOC_ROOT, \"\", SITE_ROOT);\n\t\t// $win = str_replace(\"/\",\"\\\\\",$DOC_ROOT);\n\t\t$site_root = str_replace($DOC_ROOT,\"\",SITE_ROOT);\n\t\t$http_chunk = \"$http_host/$site_root/\";\n\t\treturn \"http://\".str_replace(\"//\", \"/\", $http_chunk);\n\t}", "public static function cleanDomainString($string)\n {\n if(substr($string, 0, 4) === 'www.')\n {\n $string = substr($string, 4);\n }\n\n return $string;\n }", "public static function domainSuffix()\n {\n return self::pickOne(array('com', 'biz', 'info', 'name', 'net', 'org'));\n }", "public function domain_word () {\n\t\t\t$company_name = explode( ' ', Faker::Company()->name() );\n\t\t\treturn strtolower(\n\t\t\t\tpreg_replace(\n\t\t\t\t\t'/\\W/',\n\t\t\t\t\t'',\n\t\t\t\t\t$company_name[0]\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function get_domain(string $prepend = null): string\n {\n [$scheme, $domain] = explode('://', config('app.url'), 2);\n\n return str_replace('www.', '', $prepend ? $prepend.'.'.$domain : $domain);\n }", "private function getRootDomain()\n\t{\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$parts = explode('.', $host);\n\t\tif(count($parts)>1){\n\t\t\t$tld = array_pop($parts);\n\t\t\t$domain = array_pop($parts).'.'.$tld;\n\t\t} else {\n\t\t\t$domain = array_pop($parts);\n\t\t}\n\t\treturn '.'.$domain;\n\t}", "function getRawDomain($url)\n {\n $raw_domain=\"\";\n\n if (!empty($url))\n {\n $url_array=parse_url($url);\n if (empty($url_array['scheme'])) //in case no scheme was provided in url, it will be parsed incorrectly. add http:// and re-parse\n {\n $url=\"http://\".$url;\n $url_array=parse_url($url);\n }\n\n if (!empty($url_array['host']))\n {\n $raw_domain=$url_array['host'];\n\n $raw_domain=trim(str_ireplace(\"www.\", \"\", filter_var($raw_domain, FILTER_SANITIZE_URL)));\n }\n }\n\n return $raw_domain;\n }", "public function getDomain()\n {\n $hostParts = explode('.', $this->getHost());\n array_shift($hostParts);\n\n return implode('.', $hostParts);\n }", "function get_domain()\n{\n global $SITE_INFO;\n $ret = (!empty($SITE_INFO['domain'])) ? $SITE_INFO['domain'] : '';\n\n // Ah, no explicit setting, so derive...\n if ($ret == '') {\n // Derive from base URL\n if (!empty($SITE_INFO['base_url'])) {\n $matches = array();\n if (preg_match('#://([^/\\#:]+)#', $SITE_INFO['base_url'], $matches) != 0) {\n return preg_replace('#^www\\.#', '', $matches[1]);\n }\n }\n\n // Derive from other possibilities. Note that we can't use cms_srv due to bootstrap order (it's in global3.php)\n if (!empty($_SERVER['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['HTTP_HOST']);\n }\n if (!empty($_ENV['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_ENV['HTTP_HOST']);\n }\n if (function_exists('gethostname')) {\n return preg_replace('#^www\\.#', '', gethostname());\n }\n if (!empty($_SERVER['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['SERVER_ADDR']);\n }\n if (!empty($_ENV['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['SERVER_ADDR']);\n }\n if (!empty($_SERVER['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['LOCAL_ADDR']);\n }\n if (!empty($_ENV['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['LOCAL_ADDR']);\n }\n return 'localhost';\n }\n return $ret;\n}", "protected function getDomain($url){\n // return static::DOMAIN;\n return parse_url($url, PHP_URL_HOST);\n }", "function getDNSName($link)\r\n{\r\n\tif(strstr($link,\"www\") || strstr($link,\"http\") || strstr($link,\".com\") || strstr($link,\"https\"))\r\n\t{\r\n\t\t$arr=explode(\"//\",$link);\r\n\t\t$arr1=explode(\".\",$arr[1]);\r\n\t\tif(strstr($arr1[0],\"www\")|| strstr($arr1[0],\"mail\") || strstr($arr1[0],\"in\") || strstr($arr1[0],\"site2\"))\r\n\t\t{\r\n\t\t\treturn $arr1[1];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $arr1[0];\r\n\t\t}\r\n\t}\r\n\telse \r\n\t{\r\n\t\treturn null; \r\n\t}\r\n}", "function get_domain_name_only($url){\r\n $match = preg_match(\"/(.*:\\/\\/)\\w{0,}(.*)\\.(.*)/\",$url,$patterns);\r\n $patterns[2] = str_replace(\".\",\"\",$patterns[2]);\r\n return $patterns[2];\r\n}", "function textdomain($text_domain) {\n }" ]
[ "0.6714948", "0.6647523", "0.6559829", "0.65499985", "0.6472691", "0.646512", "0.64386475", "0.64370614", "0.63291085", "0.63031405", "0.6231646", "0.61433876", "0.61231554", "0.6111101", "0.61097115", "0.60939294", "0.60644037", "0.6062945", "0.60304046", "0.60289186", "0.60215276", "0.5996652", "0.5957163", "0.5915937", "0.5909786", "0.5894569", "0.58885473", "0.58670306", "0.58615375", "0.5817659" ]
0.7166025
0
function for Active Directory This function retrieves and returns CN from given DN $dn = CN=Users,CN=Builtin,DC=test,DC=xlinesoft,DC=com return Users
function ldap_getCN($dn) { preg_match('/[^,]*/', $dn, $matchs, PREG_OFFSET_CAPTURE, 3); return $matchs[0][0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_username_from_dn($dn) {\n global $CFG;\n $dn_tmp1 = explode(\",\", $dn);\n if (count($dn_tmp1) > 1) {\n // Normally the first element is cn=..., or uid=...\n // try a shortcut if the naming attribute is the same\n // unless forced by a 'debug' configuration flag\n $dn_tmp2 = explode(\"=\", trim($dn_tmp1[0], 2));\n\n if ($dn_tmp2[0] == $this->config['user_attribute']) {\n return $dn_tmp2[1];\n }\n else {\n // case when user's DN is NOT xx=maharausername,ou=xxxx,dc=yyyy\n // quite common with AD where DN is cn=user fullname,ou=xxxx\n // we must do another LDAP search to retrieve Mahara username from LDAP\n // since we call ldap_get_users, we do not support groups whithin group\n // (usually added as cn=groupxxxx,ou=....)\n\n $filter = $dn_tmp2[0] . '=' . $this->filter_addslashes($dn_tmp2[1]);\n $matchings = $this->ldap_get_users($filter);\n // return the FIRST entry found\n if (empty($matchings)) {\n return false;\n }\n if (count($matchings) > 1) {\n return false;\n }\n return $matchings[0];\n }\n\n }\n else {\n // If there was only one element returned from explode, then obviously the dn\n // was bad\n return false;\n }\n }", "function getCN($dn)\n{\n preg_match('/[^,]*/', $dn, $matchs, PREG_OFFSET_CAPTURE, 3);\n return $matchs[0][0];\n}", "function ldap_getDN($ad, $samaccountname, $basedn) \r\n\t{\r\n\t\t$attributes = array('dn');\r\n\t\t$result = ldap_search($ad, $basedn, \"(samaccountname={$samaccountname})\", $attributes);\r\n\t\tif ($result === FALSE) \r\n\t\t\treturn ''; \r\n\t\t\t\r\n\t\t$entries = ldap_get_entries($ad, $result);\r\n\t\t\r\n\t\tif ($entries['count'] > 0) \r\n\t\t\t return $entries[0]['dn']; \r\n\t\treturn '';\r\n\t}", "protected function user_dn($username,$isGUID=false){\n $user=$this->user_info($username,array(\"cn\"),$isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n return ($user_dn);\n }", "private function ldap_find_userdn($ldapconnection, $username) {\n // default return value\n $ldap_user_dn = FALSE;\n\n // get all contexts and look for first matching user\n $ldap_contexts = explode(\";\", $this->config['contexts']);\n\n foreach ($ldap_contexts as $context) {\n $context = trim($context);\n if (empty($context)) {\n continue;\n }\n\n if ($this->config['search_sub'] == 'yes') {\n // use ldap_search to find first user from subtree\n $ldap_result = ldap_search($ldapconnection, $context, '(' . $this->config['user_attribute']\n . '=' . $this->filter_addslashes($username) . ')', array($this->config['user_attribute']));\n\n }\n else {\n // search only in this context\n $ldap_result = ldap_list($ldapconnection, $context, '(' . $this->config['user_attribute']\n . '=' . $this->filter_addslashes($username) . ')', array($this->config['user_attribute']));\n }\n if (!$ldap_result) {\n return false;\n }\n\n $entry = ldap_first_entry($ldapconnection,$ldap_result);\n\n if ($entry) {\n $ldap_user_dn = ldap_get_dn($ldapconnection, $entry);\n break ;\n }\n }\n return $ldap_user_dn;\n }", "protected function getUserDn()\n {\n $userName = $this->login->username;\n\n // Translate given e-mail to username\n if (strpos($userName, '@') !== false) {\n $user = User::findOne(['email' => $userName]);\n if ($user !== null) {\n $userName = $user->username;\n }\n }\n\n try {\n $this->getLdap()->bind($userName, $this->login->password);\n return $this->getLdap()->getCanonicalAccountName($userName, Ldap::ACCTNAME_FORM_DN);\n } catch (LdapException $ex) {\n // User not found in LDAP\n }\n return '';\n }", "function lookupUser($uid) {\n\t$host = \"ldap.bath.ac.uk\";\n\t$dn = \"o=bath.ac.uk\";\n\t$con = ldap_connect($host);\n\t// anonymous login\n\tldap_bind($con);\n\t$results = ldap_search($con, $dn, \"uid=\" . $uid);\n\t// get array from search results\n\t$entries = ldap_get_entries($con, $results);\n\t// ensure a user has been found\n\tif ($entries[\"count\"] > 0) {\n\t\treturn Array (\n\t\t\t\"found\" => 1,\n\t\t\t\"uidnumber\" => $entries[0][\"uidnumber\"][0],\n\t\t\t\"accountstate\" => $entries[0][\"accountstate\"][0],\n\t\t\t\"displayname\" => $entries[0][\"displayname\"][0],\n\t\t\t\"mail\" => $entries[0][\"mail\"][0]\n\t\t);\n\t}\n\telse {\n\t\treturn Array (\"found\" => 0);\n\t}\n}", "function employee_by_dn ($dn, $attr = null) {\n\tif ( ! is_array($dn) )\n\t\t$dn = array($dn);\n\t$attr = $attr ? $attr : array('cn', 'mail', 'uid');\n\t$filter = '(objectclass=*)';\n\n\t# setup ldap connection\n\tif ( ! $ds = _ldap_connect() )\n\t\treturn(false);\n\n\t# connect, bind and do a parallel search\n\t$conn = array_fill(0, sizeof($dn), $ds);\n\t$search_result = ldap_read($conn, $dn, $filter, $attr);\n\n\t# process each of the search results\n\t$result = array();\n\tforeach ($search_result as $sr) {\n\t\t# check to see if we have hits for this result\n\t\tif (@ldap_count_entries($ds, $sr) == 0)\n\t\t\tcontinue;\n\n\t\t# get the values of each entry found\n\t\tfor ($entry = @ldap_first_entry($ds, $sr); $entry != false; $entry = @ldap_next_entry($ds, $entry)) {\n\t\t\t# results are a dn keyed hash\n\t\t\t$dn = @ldap_get_dn($ds, $entry);\n\t\t\t$result[$dn]['dn'] = $dn;\n\n\t\t\t# get each attr, missing attrs are stored as null values\n\t\t\tforeach ($attr as $a) {\n\t\t\t\t$val = @ldap_get_values($ds, $entry, $a);\n\t\t\t\t$result[$dn][$a] = $val ? $val[0] : null;\n\t\t\t}\n\t\t}\n\t}\nreturn($result);\n}", "function ldap_DomainToDN($aDomain)\r\n\t{\r\n\t\t$arrDomain = explode(\".\", $aDomain);\r\n\t\tfor ($i = 0; $i < sizeof($arrDomain); $i++)\r\n\t\t{\r\n\t\t\t$arrDomain[$i] = \"dc=\".$arrDomain[$i];\r\n\t\t}\r\n\t\treturn implode(',', $arrDomain);\r\n\t}", "function getDN($ad, $samaccountname, $basedn) {\n $attributes = array('dn');\n $result = ldap_search($ad, $basedn, \"(samaccountname={$samaccountname})\", $attributes);\n\n if ($result === FALSE) {\n return '';\n }\n $entries = ldap_get_entries($ad, $result);\n if ($entries['count'] > 0) {\n return $entries[0]['dn'];\n } else {\n return '';\n }\n }", "function ibm_uid ( $dn ) { return dn2uid($dn); }", "function ldap_get_user($username_or_email, $db) {\n if( is_mail($username_or_email) && $db->mailExists($username_or_email) ) {\n return $db->getUserWithMail($username_or_email);\n }\n if($db->userExists($username_or_email)) {\n return $db->getUser($username_or_email);\n }\n return false;\n}", "public function ldap_find_userdn($ldapconnection, $extusername, $contexts = false, $userattribute = false) {\n if (empty($contexts)) {\n $contexts = $this->config->contexts;\n }\n $ldapcontexts = explode(';', $contexts);\n if (!empty($this->config->create_context)) {\n array_push($ldapcontexts, $this->config->create_context);\n }\n if (empty($userattribute)) {\n $userattribute = $this->config->user_attribute;\n }\n return ldap_find_userdn($ldapconnection, $extusername, $ldapcontexts, $this->config->objectclass,\n $userattribute, $this->config->search_sub);\n }", "function get_users(){\n global $conf;\n global $LDAP_CON;\n\n $sr = ldap_list($LDAP_CON,$conf['usertree'],\"ObjectClass=inetOrgPerson\");\n $result = ldap_get_binentries($LDAP_CON, $sr);\n $users = array();\n if(count($result)){\n foreach ($result as $entry){\n if(!empty($entry['sn'][0])){\n $users[$entry['dn']] = $entry['givenName'][0].\" \".$entry['sn'][0];\n }\n }\n }\n return $users;\n}", "protected function getDomainComponents($dn)\n {\n return DistinguishedName::build($dn)->components('dc');\n }", "function _uid_filter ($dn) { return('(uid='.dn2uid($dn).')'); }", "public function getUser($login) {\r\n \r\n \t$messages = array();\r\n $messages['success'] = 0;\r\n $messages['errors'] = Array();\r\n \r\n \t$LDAP = self::initLDAP(); \t\r\n \t// check settings\r\n \tif(!$LDAP) { return false; } \t\r\n \t \r\n //check params\r\n\t\tif( !isset( $login ) ) $login = '';\r\n\t\t \t\t\r\n\t\tif ( function_exists( 'ldap_connect' ) ) \r\n\t\t{\r\n\t\t\t$ds = ldap_connect( $LDAP['Server'], $LDAP['Port'] );\r\n\t\t} else {\r\n\t\t\teZDebug::writeError( 'Unable to connect to LDAP.', __METHOD__ );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif ( $ds )\r\n\t\t{\r\n\t\t\tldap_set_option( $ds, LDAP_OPT_PROTOCOL_VERSION, $LDAP['Version'] );\r\n\t\t\tldap_set_option( $ds, LDAP_OPT_REFERRALS, $LDAP['FollowReferrals'] );\r\n\r\n\t\t\t//bind anonymous, or as user to fetch user's DN\r\n\t\t\tif ( $LDAP['BindUser'] == '' )\r\n\t\t\t{\r\n\t\t\t $r = ldap_bind( $ds );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t $r = ldap_bind( $ds, $LDAP['BindUser'], $LDAP['BindPassword'] );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !$r )\r\n\t\t\t{\r\n\t\t\t eZDebug::writeError( 'Cannot bind to LDAP server, might be something wrong with connetion or bind user!', __METHOD__ );\t\t\r\n\t\t\t\tldap_close( $ds );\r\n\t\t\t return false;\r\n\t\t\t}\t\t\t\r\n\t\t\r\n\t\t\t$LDAP['Filter'] .= \"(\" .$LDAP['LoginAttribute']. \"=\" .$login. \"))\";\r\n\r\n\t\t\t//ldap_set_option( $ds, LDAP_OPT_SIZELIMIT, 0 );\r\n\t\t\t//ldap_set_option( $ds, LDAP_OPT_TIMELIMIT, 0 );\r\n\r\n\t\t\t$retrieveAttributes = array( $LDAP['LoginAttribute'],\r\n\t\t\t\t\t\t $LDAP['FirstNameAttribute'],\r\n\t\t\t\t\t\t $LDAP['LastNameAttribute'],\r\n\t\t\t\t\t\t $LDAP['EmailAttribute'],\r\n\t\t\t\t\t\t $LDAP['GUIDAttribute']\r\n\t\t\t\t\t\t );\r\n\t\t\t\t\t\t \t\t\t\t\t\t \r\n\t\t\tif ( $LDAP['UserGroupAttributeType'] )\r\n\t\t\t $retrieveAttributes[] = $LDAP['UserGroupAttribute'];\r\n\t\t\tif ( $LDAP['SearchScope'] == \"one\" )\r\n\t\t\t $sr = ldap_list( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\t\t\telse if ( $LDAP['SearchScope'] == \"base\" )\r\n\t\t\t $sr = ldap_read( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\t\t\telse\r\n\t\t\t $sr = ldap_search( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\r\n\t\t\t//fetch records from ldap\r\n\t\t\t$info = ldap_get_entries( $ds, $sr ) ;\r\n\t\t\t\t\r\n\t\t\tif ( $info['count'] > 1 )\r\n\t\t\t{\r\n\t\t\t // More than one user with same uid, not allow login.\r\n\t\t\t eZDebug::writeWarning( 'More then one user with same uid, not allowed to login!', __METHOD__ );\r\n\t\t\t ldap_close( $ds );\r\n \t\treturn $messages;\r\n\t\t\t}\r\n\t\t\telse if ( $info['count'] < 1 )\r\n\t\t\t{\r\n\t\t\t // Increase number of failed login attempts.\r\n\t\t\t if ( isset( $userID ) )\r\n\t\t\t // eZUser::setFailedLoginAttempts( $userID );\r\n\t\t\t // user DN was not found\r\n\t\t\t eZDebug::writeWarning( 'User DN was not found!', __METHOD__ );\r\n\t\t\t $messages['errors']['ldapLoginNotFound'] = 1 ;\r\n\t\t\t ldap_close( $ds );\r\n \treturn $messages;\r\n\t\t\t}\r\n\t\t\telse if ( $LDAP['DebugTrace'] )\r\n\t\t\t{\r\n\t\t\t $debugArray = array( 'stage' => '3/4: real authentication of user',\r\n\t\t\t\t\t'info' => $info\r\n\t\t\t );\r\n\t\t\t eZDebug::writeNotice( var_export( $debugArray, true ), __METHOD__ );\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n // is it real authenticated LDAP user?\r\n if ( @ldap_bind( $ds, $info[0]['dn'], $password ) )\r\n {\r\n \r\n\t\t\t}\r\n \r\n ldap_close( $ds );\r\n\t\t} // END if (ds)\t\r\n\r\n\t\t//failsafe\r\n\t\treturn $user;\r\n }", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "function mrclib_ldapinfo($uid, $ldap_return = array(\"uid\",\"givenName\",\"sn\",\"employeeNumber\",\"mail\")) {\r\n\r\n\t/* test for wildcards in $uid \r\n\tif(strstr($uid, \"*\") != false) {\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: Wildcard NOT ALLOWED in uid string $uid\");\r\n\t\treturn(false);\r\n\t}*/\r\n\r\n\tif(!($conn = ldap_connect(EAS_SERV, EAS_PORT))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not connect to ldap: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\tif(!($r = ldap_bind($conn, EAS_BINDDN, EAS_BINDPW))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not bind to ldap: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\t$search = \"(uid=$uid)\";\r\n\r\n\tif(!($sr = ldap_search($conn,EAS_BASE,$search,$ldap_return))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not search for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n // print_r($ldap_return);echo \"<br>\";\r\n //echo (\"Entries: \". ldap_count_entries($conn, $sr));\r\n print_r(ldap_get_entries($conn,$sr));\r\n echo \"<br>\";\r\n \r\n\tif(ldap_count_entries($conn, $sr) == 0) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP information: no matches found for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t} else {\r\n\t\tif(($info = ldap_first_entry($conn, $sr)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP info for first entry: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\r\n\t\tif(($attrs=ldap_get_attributes($conn, $info)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP info for entry: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(function_exists('array_change_key_case')) {\r\n\t\t\t$attrs = array_change_key_case($attrs, CASE_LOWER);\r\n\t\t}\r\n\t\t$retv = array();\r\n\t\t/* sort through array and return values */\r\n\t\tforeach($ldap_return as $key) {\r\n\t\t\t/* this makes it simply a single value */\r\n\t\t\tif(isset($attrs[\"$key\"])) {\r\n\t\t\t\tif(is_array($attrs[\"$key\"])) {\r\n\t\t\t\t\t$retv[\"$key\"] = $attrs[\"$key\"][0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$retv[\"$key\"] = $attrs[\"$key\"];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tldap_close($conn);\r\n\treturn($retv);\r\n}", "function usernameInvalid($username, $ldapServer, $ldapDN, $ldapGeneralUser, $ldapGeneralPassword){\n\t$username = addslashes($username);\t\n\t\n\t//Authenticate in LDAP\n\t$ldap = ldap_connect($ldapServer);\t\n\t$ldapBind = ldap_bind($ldap, $ldapGeneralUser, $ldapGeneralPassword);\n\tif ($ldapBind){\n\t\t$results = ldap_search($ldap, $ldapDN, \"samaccountname=\".$username);\t\t\n\t\t$data = ldap_get_entries($ldap, $results);\t\n\t\t//$data[0] = true;\n\t\t//print_r($username);\t\t\n\t\tif ( $data[0]){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "public static function extractDnComponent($dn, $component)\n {\n $component = strtoupper($component);\n $components = [];\n $path = self::explodeDn($dn);\n unset($path['count']);\n foreach ($path as $rdn) {\n $pieces = explode('=', $rdn) ?: [];\n if (count($pieces) == 2 && strtoupper($pieces[0]) == $component) {\n $components[] = StringParser::unescape($pieces[1]);\n }\n }\n\n return implode(',', $components);\n }", "public function get_userinfo($username, $notused = false) {\n // Trying to find specified user in LDAP-XTEC and LDAP-GICAR.\n list($ldapconnection, $ldapuserdn, $nif_attribute) = $this->get_userdn($username);\n $search_attribs = array();\n $attrmap = $this->odissea_attributes($nif_attribute);\n foreach ($attrmap as $key => $values) {\n if (!is_array($values)) {\n $values = array($values);\n }\n foreach ($values as $value) {\n if (!in_array($value, $search_attribs)) {\n array_push($search_attribs, $value);\n }\n }\n }\n\n if (!$user_info_result = ldap_read($ldapconnection, $ldapuserdn, '(objectClass=*)', $search_attribs)) {\n $this->ldap_close();\n return false; // Error.\n }\n\n $user_entry = ldap_get_entries_moodle($ldapconnection, $user_info_result);\n if (empty($user_entry)) {\n $this->ldap_close();\n return false; // Entry not found.\n }\n\n $result = array();\n foreach ($attrmap as $key => $values) {\n if (!is_array($values)) {\n $values = array($values);\n }\n $ldapval = null;\n foreach ($values as $value) {\n $entry = array_change_key_case($user_entry[0], CASE_LOWER);\n if (($value == 'dn') || ($value == 'distinguishedname')) {\n $result[$key] = $ldapuserdn;\n continue;\n }\n if (!array_key_exists($value, $entry)) {\n continue; // Wrong data mapping.\n }\n if (is_array($entry[$value])) {\n if ($value == $this->config->nif_attribute || $value == $this->config->gicar_nif_attribute) {\n $entry[$value][0] = str_replace(' ', '', $entry[$value][0]);\n }\n $newval = core_text::convert($entry[$value][0], $this->config->ldapencoding, 'utf-8');\n } else {\n if ($value == $this->config->nif_attribute || $value == $this->config->gicar_nif_attribute) {\n $entry[$value] = str_replace(' ', '', $entry[$value]);\n }\n $newval = core_text::convert($entry[$value], $this->config->ldapencoding, 'utf-8');\n }\n if (!empty($newval)) { // Favour ldap entries that are set.\n $ldapval = $newval;\n }\n }\n if (!is_null($ldapval)) {\n $result[$key] = $ldapval;\n }\n }\n\n $this->ldap_close();\n return $result;\n }", "function buscar_personalxdni($dni){\n\t$dni = textfilter_specialchars($dni);\n\t$cons_pers = \"SELECT apellidos,nombres FROM personal WHERE dni='$dni'\";\n\t$resp_pers = mysql_query($cons_pers);\n\t$name = \"\";\n\tif($row = mysql_fetch_array($resp_pers)){\n\t\t$apellidos = $row['apellidos'];\n\t\t$nombres = $row['nombres'];\n\t\t$name = $apellidos.\", \".$nombres;\n\t\t$name = mb_convert_case($name, MB_CASE_UPPER, \"UTF-8\");\n\t}else{\n\t\t$name = \"Error\";\n\t}\n\treturn $name;\n}", "function authenticate_ldap($user, $password){\n \n $mysqli = mysqli_connect(DB_HOST,DB_USER,DB_PASS,DB_NAME) or die(\"Error \" . mysqli_error($mysqli));\n\n $SearchFor=$user; //What string do you want to find?\n $SearchField=\"samaccountname\"; //In what Active Directory field do you want to search for the string?\n\n $LDAPHost = \"10.2.8.26\"; //Your LDAP server DNS Name or IP Address\n $dn = \"DC=culture,DC=local\"; //Put your Base DN here\n $LDAPUserDomain = \"@culture.local\"; //Needs the @, but not always the same as the LDAP server domain\n $LDAPUser = $user; //A valid Active Directory login\n $LDAPUserPassword = $password;\n $LDAPFieldsToFind = array(\"cn\", \"givenname\", \"samaccountname\", \"homedirectory\", \"telephonenumber\", \"mail\", \"memberof\");\n \n $access = 0;\n $access_admin = 0;\n $cnx = ldap_connect($LDAPHost) or die(\"Could not connect to LDAP\");\n ldap_set_option($cnx, LDAP_OPT_PROTOCOL_VERSION, 3); //Set the LDAP Protocol used by your AD service\n ldap_set_option($cnx, LDAP_OPT_REFERRALS, 0); //This was necessary for my AD to do anything\n $ldapbind = ldap_bind($cnx,$LDAPUser.$LDAPUserDomain,$LDAPUserPassword);\n error_reporting (E_ALL ^ E_NOTICE); //Suppress some unnecessary messages\n $filter=\"($SearchField=$SearchFor)\"; //Wildcard is * Remove it if you want an exact match\n $sr=ldap_search($cnx, $dn, $filter, $LDAPFieldsToFind);\n $info = ldap_get_entries($cnx, $sr);\n //var_dump($info);\n for ($x=0; $x<$info[\"count\"]; $x++) {\n $ldap_sam=$info[$x]['samaccountname'][0];\n $ldap_giv=$info[$x]['givenname'][0];\n\t$ldap_sn=$info[$x]['sn'][0];\n $ldap_tel=$info[$x]['telephonenumber'][0];\n $ldap_email=$info[$x]['mail'][0];\n $ldap_cn=$info[$x]['cn'][0];\n $ldap_dir=$info[$x]['homedirectory'][0];\n $ldap_dir=strtolower($ldap_dir);\n $pos=strpos($dir,\"home\");\n $pos=$pos+5;\n\t$ldap_memof=$info[$x]['memberof'];\n\t$ldap_nummems = count($memof);\n\tif($ldap_nummems > 0){$ldap_nummems = $ldap_nummems - 1;}\n\n if($ldap_sam != \"\" || $ldap_sam != NULL){ \n \n /*********** Check if record has been created for this user, if not create one ************/\n \n\t$search_sql_user = $mysqli->query(\"SELECT users_id FROM users_ldap where user_un='$ldap_sam';\");\n $search_row_cnt = $search_sql_user->num_rows;\n\t\n\t$searchresult = $search_sql_user->fetch_row();\n\t\n\tif($search_row_cnt < 1){\n\t $row_cnt_result = $mysqli->query('SELECT users_id FROM users_ldap ORDER BY users_id DESC LIMIT 1;');\n\t\t/* determine the id to assign to this new user based on the latest id used in the users table +1 */\n\t\t$row_cnt = $row_cnt_result->num_rows;\n\n\t\t$num_of_rows = $row_cnt_result->fetch_row();\n\t\t$this_users_id = $num_of_rows[0] + 1; //Here is where the user id gets assigned\n\t\t\n\t\t$mysqli->query(\"INSERT INTO users_ldap (users_id, user_un, user_full_name, user_level) VALUES ('$this_users_id', '$ldap_sam', '$ldap_giv $ldap_sn', '3')\") or die($mysqli->error);\n\t} else {$this_users_id = $searchresult[0];}\n\t\n \n\t/*********** End of User Creation ************/\n \n session_start();\n session_regenerate_id (true); //prevent against session fixation attacks.\n\n // this sets variables in the session \n $_SESSION['user_id']= $this_users_id; \n $_SESSION['user_name'] = $ldap_sam;\n $_SESSION['user_level'] = '3';\n $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);\n\t\n $_SESSION['cn'] = $ldap_nam;\n $_SESSION['sam'] = $ldap_sam;\n $_SESSION['giv'] = $ldap_giv;\n $_SESSION['mem_of'] = $ldap_memof;\n $_SESSION['num_mems'] = $ldap_nummems;\n \n //update the timestamp and key for cookie\n $stamp = time();\n $ckey = GenKey();\n\t\n $mysqli->query(\"update users_ldap set ctime='$stamp', ckey = '$ckey', last_login_timestamp=NOW() where user_un='$ldap_sam';\") or die($mysqli->error);\n \n //Log the successful login attempt\n\t$browserinfo = getBrowser();\n\t\n\t $logthis =\n\t $mysqli->query(\"INSERT INTO login_tracker\n\t\t(\n\t\tusers_id,\n\t\tusername,\n\t\tfirstname,\n\t\tlastname,\n\t\tip_address,\n\t\tbrowser_type,\n\t\tbrowser_version,\n\t\tos_platform,\n\t\tlogin_timestamp\n\t\t)\n\t\tVALUES\n\t\t(\n\t\t'$this_users_id',\n\t\t'$ldap_sam',\n\t\t'$ldap_giv',\n\t\t'$ldap_sn',\n\t\t'{$_SERVER['REMOTE_ADDR']}',\n\t\t'{$browserinfo['name']}',\n\t\t'{$browserinfo['version']}',\n\t\t'{$browserinfo['platform']}',\n\t\tNOW()\n\t\t);\n\t\t\") or die($mysqli->error);\n\t\t\n\tif(isset($_POST['remember'])){\n\t\t\t\t setcookie(\"user_id\", $_SESSION['user_id'], time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t\t\t\t setcookie(\"user_key\", sha1($ckey), time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t\t\t\t setcookie(\"user_name\",$_SESSION['user_name'], time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t }\n $mysqli->close(); \n \n return true; \n } else { $mysqli->close(); return false; }\n \n } \n\n}", "function get_fullname_by_uid($uid)\r\n\t{\r\n\t\t$this->load->database();\r\n\t\t$str = \"SELECT firstname, lastname\r\n\t\t\t\tFROM users\r\n\t\t\t\tWHERE uid=?;\";\r\n\t\t\t\t\r\n\t\t$data = array($uid);\r\n\t\t\r\n\t\t$query = $this->db->query($str, $data);\r\n\t\t\r\n\t\t// return the single record with this user's name, \r\n\t\t// or return NULL if a user with given uid was not found\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t\treturn $query->row();\r\n\t\telse\r\n\t\t\treturn NULL;\r\n\t}", "public function findUsersFromLDAP($cdt_util)\n {\n $ldap_config = $cdt_util->parse('Seguridad/AdminBundle/Resources/config', 'ldap.yml');\n \n $ds = ldap_connect($ldap_config['host'], $ldap_config['port']);\n \n ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION,3);\n ldap_set_option($ds, LDAP_OPT_REFERRALS,0);\n \n try\n {\n $r = ldap_search( $ds, $ldap_config['basedn'], $ldap_config['ou'], array(\"uid\", \"cn\", \"mail\"));\n \n if($r)\n {\n $user_array = array();\n $user_lista = ldap_get_entries( $ds, $r);\n \n foreach ($user_lista as $user)\n {\n if($user[\"uid\"][0] != '')\n {\n $user_array[] = array(\n 'id' => 'LDAP',\n 'uid' => $user[\"uid\"][0],\n 'cn' => $user[\"cn\"][0],\n 'mail' => $user[\"mail\"][0]\n ); \n }\n }\n return $user_array;\n } \n }\n catch (\\Exception $exc)\n {\n return '0';\n }\n }", "protected function group_cn($gid){ \n if ($gid===NULL){ return (false); }\n $r=false;\n \n $filter=\"(&(objectCategory=group)(samaccounttype=\". ADLDAP_SECURITY_GLOBAL_GROUP .\"))\";\n $fields=array(\"primarygrouptoken\",\"samaccountname\",\"distinguishedname\");\n $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);\n $entries = ldap_get_entries($this->_conn, $sr);\n \n for ($i=0; $i<$entries[\"count\"]; $i++){\n if ($entries[$i][\"primarygrouptoken\"][0]==$gid){\n $r=$entries[$i][\"distinguishedname\"][0];\n $i=$entries[\"count\"];\n }\n }\n\n return ($r);\n }", "public function login() {\n $nombre = $this->input->post('nombre');\n $contrasena = $this->input->post('contrasena');\n $servidor_LDAP = \"10.30.1.48\";\n $servidor_dominio = \"uo.edu.cu\";\n $ldap_dn = \"dc=uo,dc=edu,dc=cu\";\n $usuario_LDAP = $nombre;\n $contrasena_LDAP = $contrasena;\n define(LDAP_OPT_DIAGNOSTIC_MESSAGE, 0x0032);\n $conectado_LDAP = ldap_connect($servidor_LDAP);\n ldap_set_option($conectado_LDAP, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($conectado_LDAP, LDAP_OPT_REFERRALS, 0);\n if ($conectado_LDAP) {\n $autenticado_LDAP = ldap_bind($conectado_LDAP, $usuario_LDAP . \"@\" . $servidor_dominio, $contrasena_LDAP);\n if ($autenticado_LDAP) {\n if ($group)\n $query = \"(&\";\n else\n $query = \"\";\n\n $query .= \"(&(objectClass=user)(objectCategory=person))\";\n\n // Filter by memberOf, if group is set\n if (is_array($group)) {\n // Looking for a members amongst multiple groups\n if ($inclusive) {\n // Inclusive - get users that are in any of the groups\n // Add OR operator\n $query .= \"(|\";\n } else {\n // Exclusive - only get users that are in all of the groups\n // Add AND operator\n $query .= \"(&\";\n }\n\n // Append each group\n foreach ($group as $g)\n $query .= \"(memberOf=CN=$g,$ldap_dn)\";\n\n $query .= \")\";\n } elseif ($group) {\n // Just looking for membership of one group\n $query .= \"(memberOf=CN=$group,$ldap_dn)\";\n }\n\n // Close query\n if ($group)\n $query .= \")\";\n else\n $query .= \"\";\n\n // Uncomment to output queries onto page for debugging\n // print_r($query);\n // Search AD\n $results = ldap_search($ldap, $ldap_dn, $query);\n $entries = ldap_get_entries($ldap, $results);\n\n // Remove first entry (it's always blank)\n array_shift($entries);\n\n $output = array(); // Declare the output array\n\n $i = 0; // Counter\n // Build output array\n foreach ($entries as $u) {\n foreach ($keep as $x) {\n // Check for attribute\n if (isset($u[$x][0]))\n $attrval = $u[$x][0];\n else\n $attrval = NULL;\n\n // Append attribute to output array\n $output[$i][$x] = $attrval;\n }\n $i++;\n }\n\n return $output;\n }\n\n// Example Output\n\n print_r(get_members()); // Gets all users in 'Users'\n\n print_r(get_members(\"Test Group\")); // Gets all members of 'Test Group'\n\n print_r(get_members(\n array(\"Test Group\", \"Test Group 2\")\n )); // EXCLUSIVE: Gets only members that belong to BOTH 'Test Group' AND 'Test Group 2'\n\n print_r(get_members(\n array(\"Test Group\", \"Test Group 2\"), TRUE\n )); // INCLUSIVE: Gets members that belong to EITHER 'Test Group' OR 'Test Group 2'\n }\n else {\n $data['error'] = \"Usuario o Contraseña Incorrectos\";\n\n $this->load->view('welcome_message', $data);\n }\n }", "function UserLastName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['last_name'];\t\t\t\n}", "function getIdentityFromLdap($username, $domain, $identity, $encode = true) {\n $ret_value = $username;\n\n $ldap_conn = null;\n try {\n $ldap_conn = ldap_connect(IMAP_FROM_LDAP_SERVER, IMAP_FROM_LDAP_SERVER_PORT);\n if ($ldap_conn) {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Connected to LDAP\"));\n ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);\n $ldap_bind = ldap_bind($ldap_conn, IMAP_FROM_LDAP_USER, IMAP_FROM_LDAP_PASSWORD);\n\n if ($ldap_bind) {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Authenticated in LDAP\"));\n $filter = str_replace('#username', $username, str_replace('#domain', $domain, IMAP_FROM_LDAP_QUERY));\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Searching From with filter: %s\", $filter));\n $search = ldap_search($ldap_conn, IMAP_FROM_LDAP_BASE, $filter, unserialize(IMAP_FROM_LDAP_FIELDS));\n $items = ldap_get_entries($ldap_conn, $search);\n if ($items['count'] > 0) {\n $ret_value = $identity;\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Found entry in LDAP. Generating From\"));\n // We get the first object. It's your responsability to make the query unique\n foreach (unserialize(IMAP_FROM_LDAP_FIELDS) as $field) {\n $ret_value = str_replace('#'.$field, $items[0][$field][0], $ret_value);\n }\n if ($encode) {\n $ret_value = encodeFrom($ret_value);\n }\n }\n else {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - No entry found in LDAP\"));\n }\n }\n else {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Not authenticated in LDAP server\"));\n }\n }\n else {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendIMAP->getIdentityFromLdap() - Not connected to LDAP server\"));\n }\n }\n catch(Exception $ex) {\n ZLog::Write(LOGLEVEL_WARN, sprintf(\"BackendIMAP->getIdentityFromLdap() - Error getting From value from LDAP server: %s\", $ex));\n }\n\n if ($ldap_conn != null) {\n ldap_close($ldap_conn);\n }\n\n return $ret_value;\n}" ]
[ "0.74021345", "0.7242301", "0.6492867", "0.6420944", "0.6279398", "0.6192482", "0.61751467", "0.61578405", "0.6139376", "0.6119302", "0.61033726", "0.60550916", "0.60528356", "0.59999204", "0.5793205", "0.5776558", "0.5739483", "0.569724", "0.56596607", "0.5606079", "0.5600814", "0.5539167", "0.55330944", "0.54223996", "0.5418604", "0.5410117", "0.5399243", "0.5393249", "0.5372512", "0.53604275" ]
0.7693931
0
This function searchs in LDAP tree ($ad LDAP link identifier) entry specified by samaccountname and returns its DN or epmty string on failure. $samaccountname = Users $basedn = DC=test,DC=xlinesoft,DC=com return CN=Users,CN=Builtin,DC=test,DC=xlinesoft,DC=com
function ldap_getDN($ad, $samaccountname, $basedn) { $attributes = array('dn'); $result = ldap_search($ad, $basedn, "(samaccountname={$samaccountname})", $attributes); if ($result === FALSE) return ''; $entries = ldap_get_entries($ad, $result); if ($entries['count'] > 0) return $entries[0]['dn']; return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDN($ad, $samaccountname, $basedn) {\n $attributes = array('dn');\n $result = ldap_search($ad, $basedn, \"(samaccountname={$samaccountname})\", $attributes);\n\n if ($result === FALSE) {\n return '';\n }\n $entries = ldap_get_entries($ad, $result);\n if ($entries['count'] > 0) {\n return $entries[0]['dn'];\n } else {\n return '';\n }\n }", "private function findViaLDAP($samaccountname)\n {\n $baseDn = $this->ldap_baseDn_users;\n $filter = '(&(&(ObjectClass=user))(samaccountname=' . $samaccountname . '))';\n $attributes = ['samaccountname', 'dn', 'memberof', 'cn', 'mail'];\n $result = $this->ldap->searchEntries($filter, $baseDn, Ldap::SEARCH_SCOPE_SUB, $attributes);\n\n return $result;\n }", "private function get_username_from_dn($dn) {\n global $CFG;\n $dn_tmp1 = explode(\",\", $dn);\n if (count($dn_tmp1) > 1) {\n // Normally the first element is cn=..., or uid=...\n // try a shortcut if the naming attribute is the same\n // unless forced by a 'debug' configuration flag\n $dn_tmp2 = explode(\"=\", trim($dn_tmp1[0], 2));\n\n if ($dn_tmp2[0] == $this->config['user_attribute']) {\n return $dn_tmp2[1];\n }\n else {\n // case when user's DN is NOT xx=maharausername,ou=xxxx,dc=yyyy\n // quite common with AD where DN is cn=user fullname,ou=xxxx\n // we must do another LDAP search to retrieve Mahara username from LDAP\n // since we call ldap_get_users, we do not support groups whithin group\n // (usually added as cn=groupxxxx,ou=....)\n\n $filter = $dn_tmp2[0] . '=' . $this->filter_addslashes($dn_tmp2[1]);\n $matchings = $this->ldap_get_users($filter);\n // return the FIRST entry found\n if (empty($matchings)) {\n return false;\n }\n if (count($matchings) > 1) {\n return false;\n }\n return $matchings[0];\n }\n\n }\n else {\n // If there was only one element returned from explode, then obviously the dn\n // was bad\n return false;\n }\n }", "protected function getAccount($account, $basedn)\n {\n if (is_null($this->conn)) {\n throw new RuntimeException('no LDAP connection bound');\n }\n\n $result = ldap_search(\n $this->conn, $basedn, \"(samaccountname={$account})\",\n array('dn', 'givenname', 'sn', 'cn', 'memberof', 'objectguid')\n );\n\n if ($result === false) {\n return null;\n }\n\n $entries = ldap_get_entries($this->conn, $result);\n\n if ($entries['count'] > 0) {\n return $entries[0];\n }\n }", "private function ldap_find_userdn($ldapconnection, $username) {\n // default return value\n $ldap_user_dn = FALSE;\n\n // get all contexts and look for first matching user\n $ldap_contexts = explode(\";\", $this->config['contexts']);\n\n foreach ($ldap_contexts as $context) {\n $context = trim($context);\n if (empty($context)) {\n continue;\n }\n\n if ($this->config['search_sub'] == 'yes') {\n // use ldap_search to find first user from subtree\n $ldap_result = ldap_search($ldapconnection, $context, '(' . $this->config['user_attribute']\n . '=' . $this->filter_addslashes($username) . ')', array($this->config['user_attribute']));\n\n }\n else {\n // search only in this context\n $ldap_result = ldap_list($ldapconnection, $context, '(' . $this->config['user_attribute']\n . '=' . $this->filter_addslashes($username) . ')', array($this->config['user_attribute']));\n }\n if (!$ldap_result) {\n return false;\n }\n\n $entry = ldap_first_entry($ldapconnection,$ldap_result);\n\n if ($entry) {\n $ldap_user_dn = ldap_get_dn($ldapconnection, $entry);\n break ;\n }\n }\n return $ldap_user_dn;\n }", "function mrclib_ldapinfo($uid, $ldap_return = array(\"uid\",\"givenName\",\"sn\",\"employeeNumber\",\"mail\")) {\r\n\r\n\t/* test for wildcards in $uid \r\n\tif(strstr($uid, \"*\") != false) {\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: Wildcard NOT ALLOWED in uid string $uid\");\r\n\t\treturn(false);\r\n\t}*/\r\n\r\n\tif(!($conn = ldap_connect(EAS_SERV, EAS_PORT))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not connect to ldap: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\tif(!($r = ldap_bind($conn, EAS_BINDDN, EAS_BINDPW))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not bind to ldap: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\t$search = \"(uid=$uid)\";\r\n\r\n\tif(!($sr = ldap_search($conn,EAS_BASE,$search,$ldap_return))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not search for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n // print_r($ldap_return);echo \"<br>\";\r\n //echo (\"Entries: \". ldap_count_entries($conn, $sr));\r\n print_r(ldap_get_entries($conn,$sr));\r\n echo \"<br>\";\r\n \r\n\tif(ldap_count_entries($conn, $sr) == 0) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP information: no matches found for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t} else {\r\n\t\tif(($info = ldap_first_entry($conn, $sr)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP info for first entry: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\r\n\t\tif(($attrs=ldap_get_attributes($conn, $info)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapinfo: could not get LDAP info for entry: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(function_exists('array_change_key_case')) {\r\n\t\t\t$attrs = array_change_key_case($attrs, CASE_LOWER);\r\n\t\t}\r\n\t\t$retv = array();\r\n\t\t/* sort through array and return values */\r\n\t\tforeach($ldap_return as $key) {\r\n\t\t\t/* this makes it simply a single value */\r\n\t\t\tif(isset($attrs[\"$key\"])) {\r\n\t\t\t\tif(is_array($attrs[\"$key\"])) {\r\n\t\t\t\t\t$retv[\"$key\"] = $attrs[\"$key\"][0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$retv[\"$key\"] = $attrs[\"$key\"];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tldap_close($conn);\r\n\treturn($retv);\r\n}", "function employee_by_dn ($dn, $attr = null) {\n\tif ( ! is_array($dn) )\n\t\t$dn = array($dn);\n\t$attr = $attr ? $attr : array('cn', 'mail', 'uid');\n\t$filter = '(objectclass=*)';\n\n\t# setup ldap connection\n\tif ( ! $ds = _ldap_connect() )\n\t\treturn(false);\n\n\t# connect, bind and do a parallel search\n\t$conn = array_fill(0, sizeof($dn), $ds);\n\t$search_result = ldap_read($conn, $dn, $filter, $attr);\n\n\t# process each of the search results\n\t$result = array();\n\tforeach ($search_result as $sr) {\n\t\t# check to see if we have hits for this result\n\t\tif (@ldap_count_entries($ds, $sr) == 0)\n\t\t\tcontinue;\n\n\t\t# get the values of each entry found\n\t\tfor ($entry = @ldap_first_entry($ds, $sr); $entry != false; $entry = @ldap_next_entry($ds, $entry)) {\n\t\t\t# results are a dn keyed hash\n\t\t\t$dn = @ldap_get_dn($ds, $entry);\n\t\t\t$result[$dn]['dn'] = $dn;\n\n\t\t\t# get each attr, missing attrs are stored as null values\n\t\t\tforeach ($attr as $a) {\n\t\t\t\t$val = @ldap_get_values($ds, $entry, $a);\n\t\t\t\t$result[$dn][$a] = $val ? $val[0] : null;\n\t\t\t}\n\t\t}\n\t}\nreturn($result);\n}", "protected function user_dn($username,$isGUID=false){\n $user=$this->user_info($username,array(\"cn\"),$isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n return ($user_dn);\n }", "function authenticate_ldap($user, $password){\n \n $mysqli = mysqli_connect(DB_HOST,DB_USER,DB_PASS,DB_NAME) or die(\"Error \" . mysqli_error($mysqli));\n\n $SearchFor=$user; //What string do you want to find?\n $SearchField=\"samaccountname\"; //In what Active Directory field do you want to search for the string?\n\n $LDAPHost = \"10.2.8.26\"; //Your LDAP server DNS Name or IP Address\n $dn = \"DC=culture,DC=local\"; //Put your Base DN here\n $LDAPUserDomain = \"@culture.local\"; //Needs the @, but not always the same as the LDAP server domain\n $LDAPUser = $user; //A valid Active Directory login\n $LDAPUserPassword = $password;\n $LDAPFieldsToFind = array(\"cn\", \"givenname\", \"samaccountname\", \"homedirectory\", \"telephonenumber\", \"mail\", \"memberof\");\n \n $access = 0;\n $access_admin = 0;\n $cnx = ldap_connect($LDAPHost) or die(\"Could not connect to LDAP\");\n ldap_set_option($cnx, LDAP_OPT_PROTOCOL_VERSION, 3); //Set the LDAP Protocol used by your AD service\n ldap_set_option($cnx, LDAP_OPT_REFERRALS, 0); //This was necessary for my AD to do anything\n $ldapbind = ldap_bind($cnx,$LDAPUser.$LDAPUserDomain,$LDAPUserPassword);\n error_reporting (E_ALL ^ E_NOTICE); //Suppress some unnecessary messages\n $filter=\"($SearchField=$SearchFor)\"; //Wildcard is * Remove it if you want an exact match\n $sr=ldap_search($cnx, $dn, $filter, $LDAPFieldsToFind);\n $info = ldap_get_entries($cnx, $sr);\n //var_dump($info);\n for ($x=0; $x<$info[\"count\"]; $x++) {\n $ldap_sam=$info[$x]['samaccountname'][0];\n $ldap_giv=$info[$x]['givenname'][0];\n\t$ldap_sn=$info[$x]['sn'][0];\n $ldap_tel=$info[$x]['telephonenumber'][0];\n $ldap_email=$info[$x]['mail'][0];\n $ldap_cn=$info[$x]['cn'][0];\n $ldap_dir=$info[$x]['homedirectory'][0];\n $ldap_dir=strtolower($ldap_dir);\n $pos=strpos($dir,\"home\");\n $pos=$pos+5;\n\t$ldap_memof=$info[$x]['memberof'];\n\t$ldap_nummems = count($memof);\n\tif($ldap_nummems > 0){$ldap_nummems = $ldap_nummems - 1;}\n\n if($ldap_sam != \"\" || $ldap_sam != NULL){ \n \n /*********** Check if record has been created for this user, if not create one ************/\n \n\t$search_sql_user = $mysqli->query(\"SELECT users_id FROM users_ldap where user_un='$ldap_sam';\");\n $search_row_cnt = $search_sql_user->num_rows;\n\t\n\t$searchresult = $search_sql_user->fetch_row();\n\t\n\tif($search_row_cnt < 1){\n\t $row_cnt_result = $mysqli->query('SELECT users_id FROM users_ldap ORDER BY users_id DESC LIMIT 1;');\n\t\t/* determine the id to assign to this new user based on the latest id used in the users table +1 */\n\t\t$row_cnt = $row_cnt_result->num_rows;\n\n\t\t$num_of_rows = $row_cnt_result->fetch_row();\n\t\t$this_users_id = $num_of_rows[0] + 1; //Here is where the user id gets assigned\n\t\t\n\t\t$mysqli->query(\"INSERT INTO users_ldap (users_id, user_un, user_full_name, user_level) VALUES ('$this_users_id', '$ldap_sam', '$ldap_giv $ldap_sn', '3')\") or die($mysqli->error);\n\t} else {$this_users_id = $searchresult[0];}\n\t\n \n\t/*********** End of User Creation ************/\n \n session_start();\n session_regenerate_id (true); //prevent against session fixation attacks.\n\n // this sets variables in the session \n $_SESSION['user_id']= $this_users_id; \n $_SESSION['user_name'] = $ldap_sam;\n $_SESSION['user_level'] = '3';\n $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);\n\t\n $_SESSION['cn'] = $ldap_nam;\n $_SESSION['sam'] = $ldap_sam;\n $_SESSION['giv'] = $ldap_giv;\n $_SESSION['mem_of'] = $ldap_memof;\n $_SESSION['num_mems'] = $ldap_nummems;\n \n //update the timestamp and key for cookie\n $stamp = time();\n $ckey = GenKey();\n\t\n $mysqli->query(\"update users_ldap set ctime='$stamp', ckey = '$ckey', last_login_timestamp=NOW() where user_un='$ldap_sam';\") or die($mysqli->error);\n \n //Log the successful login attempt\n\t$browserinfo = getBrowser();\n\t\n\t $logthis =\n\t $mysqli->query(\"INSERT INTO login_tracker\n\t\t(\n\t\tusers_id,\n\t\tusername,\n\t\tfirstname,\n\t\tlastname,\n\t\tip_address,\n\t\tbrowser_type,\n\t\tbrowser_version,\n\t\tos_platform,\n\t\tlogin_timestamp\n\t\t)\n\t\tVALUES\n\t\t(\n\t\t'$this_users_id',\n\t\t'$ldap_sam',\n\t\t'$ldap_giv',\n\t\t'$ldap_sn',\n\t\t'{$_SERVER['REMOTE_ADDR']}',\n\t\t'{$browserinfo['name']}',\n\t\t'{$browserinfo['version']}',\n\t\t'{$browserinfo['platform']}',\n\t\tNOW()\n\t\t);\n\t\t\") or die($mysqli->error);\n\t\t\n\tif(isset($_POST['remember'])){\n\t\t\t\t setcookie(\"user_id\", $_SESSION['user_id'], time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t\t\t\t setcookie(\"user_key\", sha1($ckey), time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t\t\t\t setcookie(\"user_name\",$_SESSION['user_name'], time()+60*60*24*COOKIE_TIME_OUT, \"/\");\n\t }\n $mysqli->close(); \n \n return true; \n } else { $mysqli->close(); return false; }\n \n } \n\n}", "public function ldap_name($name){\n\treturn $this->config['ld_attr'].'='.$name.','.$this->config['basedn'];\n\t}", "function usernameInvalid($username, $ldapServer, $ldapDN, $ldapGeneralUser, $ldapGeneralPassword){\n\t$username = addslashes($username);\t\n\t\n\t//Authenticate in LDAP\n\t$ldap = ldap_connect($ldapServer);\t\n\t$ldapBind = ldap_bind($ldap, $ldapGeneralUser, $ldapGeneralPassword);\n\tif ($ldapBind){\n\t\t$results = ldap_search($ldap, $ldapDN, \"samaccountname=\".$username);\t\t\n\t\t$data = ldap_get_entries($ldap, $results);\t\n\t\t//$data[0] = true;\n\t\t//print_r($username);\t\t\n\t\tif ( $data[0]){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function lookupUser($uid) {\n\t$host = \"ldap.bath.ac.uk\";\n\t$dn = \"o=bath.ac.uk\";\n\t$con = ldap_connect($host);\n\t// anonymous login\n\tldap_bind($con);\n\t$results = ldap_search($con, $dn, \"uid=\" . $uid);\n\t// get array from search results\n\t$entries = ldap_get_entries($con, $results);\n\t// ensure a user has been found\n\tif ($entries[\"count\"] > 0) {\n\t\treturn Array (\n\t\t\t\"found\" => 1,\n\t\t\t\"uidnumber\" => $entries[0][\"uidnumber\"][0],\n\t\t\t\"accountstate\" => $entries[0][\"accountstate\"][0],\n\t\t\t\"displayname\" => $entries[0][\"displayname\"][0],\n\t\t\t\"mail\" => $entries[0][\"mail\"][0]\n\t\t);\n\t}\n\telse {\n\t\treturn Array (\"found\" => 0);\n\t}\n}", "function ldap_getCN($dn) \r\n\t{\r\n\t\tpreg_match('/[^,]*/', $dn, $matchs, PREG_OFFSET_CAPTURE, 3);\r\n\t\treturn $matchs[0][0];\r\n\t}", "protected function getUserDn()\n {\n $userName = $this->login->username;\n\n // Translate given e-mail to username\n if (strpos($userName, '@') !== false) {\n $user = User::findOne(['email' => $userName]);\n if ($user !== null) {\n $userName = $user->username;\n }\n }\n\n try {\n $this->getLdap()->bind($userName, $this->login->password);\n return $this->getLdap()->getCanonicalAccountName($userName, Ldap::ACCTNAME_FORM_DN);\n } catch (LdapException $ex) {\n // User not found in LDAP\n }\n return '';\n }", "private function getDistinguishedName($ADObject) {\n\t\t$Query = sprintf(\"SamAccountName=%s\", $ADObject);\n\t\t$Result = ldap_search($this->Connection, $this->SearchDN, $Query, array('dn'));\n\t\tif(!$Result) {\n\t\t\t/*\n\t\t\t* DN not found, probably login wasn't possible too then.\n\t\t\t*/\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$DNs = ldap_get_entries($this->Connection, $Result);\n\t\t\tif($DNs['count'] > 0) {\n\t\t\t\treturn $DNs[0]['dn'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t/*\n\t\t\t\t* No Entry found!\n\t\t\t\t*/\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function getUser($login) {\r\n \r\n \t$messages = array();\r\n $messages['success'] = 0;\r\n $messages['errors'] = Array();\r\n \r\n \t$LDAP = self::initLDAP(); \t\r\n \t// check settings\r\n \tif(!$LDAP) { return false; } \t\r\n \t \r\n //check params\r\n\t\tif( !isset( $login ) ) $login = '';\r\n\t\t \t\t\r\n\t\tif ( function_exists( 'ldap_connect' ) ) \r\n\t\t{\r\n\t\t\t$ds = ldap_connect( $LDAP['Server'], $LDAP['Port'] );\r\n\t\t} else {\r\n\t\t\teZDebug::writeError( 'Unable to connect to LDAP.', __METHOD__ );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif ( $ds )\r\n\t\t{\r\n\t\t\tldap_set_option( $ds, LDAP_OPT_PROTOCOL_VERSION, $LDAP['Version'] );\r\n\t\t\tldap_set_option( $ds, LDAP_OPT_REFERRALS, $LDAP['FollowReferrals'] );\r\n\r\n\t\t\t//bind anonymous, or as user to fetch user's DN\r\n\t\t\tif ( $LDAP['BindUser'] == '' )\r\n\t\t\t{\r\n\t\t\t $r = ldap_bind( $ds );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t $r = ldap_bind( $ds, $LDAP['BindUser'], $LDAP['BindPassword'] );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !$r )\r\n\t\t\t{\r\n\t\t\t eZDebug::writeError( 'Cannot bind to LDAP server, might be something wrong with connetion or bind user!', __METHOD__ );\t\t\r\n\t\t\t\tldap_close( $ds );\r\n\t\t\t return false;\r\n\t\t\t}\t\t\t\r\n\t\t\r\n\t\t\t$LDAP['Filter'] .= \"(\" .$LDAP['LoginAttribute']. \"=\" .$login. \"))\";\r\n\r\n\t\t\t//ldap_set_option( $ds, LDAP_OPT_SIZELIMIT, 0 );\r\n\t\t\t//ldap_set_option( $ds, LDAP_OPT_TIMELIMIT, 0 );\r\n\r\n\t\t\t$retrieveAttributes = array( $LDAP['LoginAttribute'],\r\n\t\t\t\t\t\t $LDAP['FirstNameAttribute'],\r\n\t\t\t\t\t\t $LDAP['LastNameAttribute'],\r\n\t\t\t\t\t\t $LDAP['EmailAttribute'],\r\n\t\t\t\t\t\t $LDAP['GUIDAttribute']\r\n\t\t\t\t\t\t );\r\n\t\t\t\t\t\t \t\t\t\t\t\t \r\n\t\t\tif ( $LDAP['UserGroupAttributeType'] )\r\n\t\t\t $retrieveAttributes[] = $LDAP['UserGroupAttribute'];\r\n\t\t\tif ( $LDAP['SearchScope'] == \"one\" )\r\n\t\t\t $sr = ldap_list( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\t\t\telse if ( $LDAP['SearchScope'] == \"base\" )\r\n\t\t\t $sr = ldap_read( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\t\t\telse\r\n\t\t\t $sr = ldap_search( $ds, $LDAP['BaseDN'], $LDAP['Filter'], $retrieveAttributes );\r\n\r\n\t\t\t//fetch records from ldap\r\n\t\t\t$info = ldap_get_entries( $ds, $sr ) ;\r\n\t\t\t\t\r\n\t\t\tif ( $info['count'] > 1 )\r\n\t\t\t{\r\n\t\t\t // More than one user with same uid, not allow login.\r\n\t\t\t eZDebug::writeWarning( 'More then one user with same uid, not allowed to login!', __METHOD__ );\r\n\t\t\t ldap_close( $ds );\r\n \t\treturn $messages;\r\n\t\t\t}\r\n\t\t\telse if ( $info['count'] < 1 )\r\n\t\t\t{\r\n\t\t\t // Increase number of failed login attempts.\r\n\t\t\t if ( isset( $userID ) )\r\n\t\t\t // eZUser::setFailedLoginAttempts( $userID );\r\n\t\t\t // user DN was not found\r\n\t\t\t eZDebug::writeWarning( 'User DN was not found!', __METHOD__ );\r\n\t\t\t $messages['errors']['ldapLoginNotFound'] = 1 ;\r\n\t\t\t ldap_close( $ds );\r\n \treturn $messages;\r\n\t\t\t}\r\n\t\t\telse if ( $LDAP['DebugTrace'] )\r\n\t\t\t{\r\n\t\t\t $debugArray = array( 'stage' => '3/4: real authentication of user',\r\n\t\t\t\t\t'info' => $info\r\n\t\t\t );\r\n\t\t\t eZDebug::writeNotice( var_export( $debugArray, true ), __METHOD__ );\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n // is it real authenticated LDAP user?\r\n if ( @ldap_bind( $ds, $info[0]['dn'], $password ) )\r\n {\r\n \r\n\t\t\t}\r\n \r\n ldap_close( $ds );\r\n\t\t} // END if (ds)\t\r\n\r\n\t\t//failsafe\r\n\t\treturn $user;\r\n }", "function findAccountToLink($input)\n\t{\n\t\t$this->db->select('users.id, users.username, users.first_name, users.last_name, users.email_address, user_avatars.avatar_image_url');\n\t\t$this->db->join('user_avatars', 'user_avatars.user_id = users.id', 'left');\n\t\t$this->db->like('users.email_address', $input['query']);\n\t\t$this->db->or_like('users.first_name', $input['query']);\n\t\t$this->db->or_like('users.last_name', $input['query']);\n\t\t$this->db->or_like('users.username', $input['query']);\n\t\treturn $this->db->get('users')->result_array();\n\t}", "function mrclib_ldapauth($uid, $pass) {\r\n\t/* what to search for */\r\n\t$eas_ldap = array(\"dn\",\"uid\");\r\n error_reporting(0);\r\n\r\n\t/* check that password isn't blank, we won't allow anon connections. */\r\n\tif(strlen($pass) == 0) {\r\n\t\treturn(false);\r\n\t}\r\n\r\n\tif(!($conn = ldap_connect(EAS_SERV, EAS_PORT))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\techo(\"<b>The Mount Royal Authentication server is not available. Please try again later.</b>\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\tif(!($r = ldap_bind($conn, EAS_BINDDN, EAS_BINDPW))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\techo(\"<b>The Mount Royal Authentication server is not available. Please try again later.</b> ($terrmsg)\");\r\n\t\tldap_close($conn);\r\n die();\r\n\t\treturn(false);\r\n\t}\r\n\r\n\t$search = \"(uid=$uid)\";\r\n\r\n\tif(!($sr = ldap_search($conn,EAS_BASE,$search,$eas_ldap))) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapauth: could not search for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t}\r\n\r\n\r\n\tif(ldap_count_entries($conn, $sr) == 0) {\r\n\t\t$terrmsg = ldap_error($conn);\r\n\t\tmrclib_prn_r(\"mrclib_ldapauth: could not get LDAP information: no matches found for $search: $terrmsg\");\r\n\t\tldap_close($conn);\r\n\t\treturn(false);\r\n\t} else {\r\n\t\tif(($info = ldap_first_entry($conn, $sr)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapauth: could not get LDAP info for first entry: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(($dn = ldap_get_dn ($conn, $info)) == false) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapauth: could not get LDAP DN for user $uid: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\t/* now bind as the new DN with the password */\r\n\t\tif(!($r = @ldap_bind($conn, $dn, $pass))) {\r\n\t\t\t$terrmsg = ldap_error($conn);\r\n\t\t\tmrclib_prn_r(\"mrclib_ldapauth: could not bind to ldap server as user $dn: $terrmsg\");\r\n\t\t\tldap_close($conn);\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t}\r\n\tldap_close($conn);\r\n\treturn(true);\r\n}", "protected function _ldapsearch($link_identifier, $base_dn, $filter, $scope = 'sub', $attributes = null,\n $attrsonly = 0, $sizelimit = 0) {\n if(is_null($attributes)) $attributes = array();\n\n if($scope == 'base') {\n return @ldap_read(\n $link_identifier, $base_dn, $filter, $attributes,\n $attrsonly, $sizelimit\n );\n } elseif($scope == 'one') {\n return @ldap_list(\n $link_identifier, $base_dn, $filter, $attributes,\n $attrsonly, $sizelimit\n );\n } else {\n return @ldap_search(\n $link_identifier, $base_dn, $filter, $attributes,\n $attrsonly, $sizelimit\n );\n }\n }", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "function ldap_get_user($username_or_email, $db) {\n if( is_mail($username_or_email) && $db->mailExists($username_or_email) ) {\n return $db->getUserWithMail($username_or_email);\n }\n if($db->userExists($username_or_email)) {\n return $db->getUser($username_or_email);\n }\n return false;\n}", "public function ldap_find_userdn($ldapconnection, $extusername, $contexts = false, $userattribute = false) {\n if (empty($contexts)) {\n $contexts = $this->config->contexts;\n }\n $ldapcontexts = explode(';', $contexts);\n if (!empty($this->config->create_context)) {\n array_push($ldapcontexts, $this->config->create_context);\n }\n if (empty($userattribute)) {\n $userattribute = $this->config->user_attribute;\n }\n return ldap_find_userdn($ldapconnection, $extusername, $ldapcontexts, $this->config->objectclass,\n $userattribute, $this->config->search_sub);\n }", "function getPersonByNormalisedName($personLink,$classId=null) {\n $personLink = trim($personLink,\"//\");\n global $db;\n if ($classId!=null) {\n $personlist = $db->getPersonListByClassId($classId);\n foreach ($personlist as $person) {\n if (getPersonLink($person[\"lastname\"], $person[\"firstname\"])==$personLink) {\n return $person;\n }\n }\n }\n $personlist=$db->getPersonList();\n foreach ($personlist as $person) {\n if (getPersonLink($person[\"lastname\"], $person[\"firstname\"])==$personLink) {\n return $person;\n }\n }\n return null;\n}", "public function get_rdn($username) \n\t{\t\n\t\t$accountForm = $this->config['accountCanonicalForm'];\n\t\t$rdn = $this->conn->getCanonicalAccountName($username, $accountForm);\n\t\treturn $rdn;\n\t}", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "function employee_in_group ($group, $employee, $depth = 2) {\n\tif (!is_array($group))\n\t\t$group = array($group);\n\tif (strpos($employee, '@') == true) {\n\t\t# lookup the DN from an email address\n\t\tif (! $record = bluepages_search(\"(mail=$employee)\") )\n\t\t\treturn(false);\n\t\t$user_dn = key($record);\n\t} elseif (strpos($employee, '=') == true) {\n\t\t# use the DN given\n\t\t$user_dn = $employee;\n\t} else {\n\t\t# passed something we don't know how to handle\n\t\treturn(false);\n\t}\n\n\t# setup ldap connection resource\n\t$basedn = 'ou=memberlist,ou=ibmgroups,o=ibm.com';\n\tif ( ! $ds = _ldap_connect() )\n\t\treturn(false);\n\n\t$result = false;\n\twhile ($depth >= 0) {\n\n\t\t# filter to look for $dn in $group list\n\t\t$filter = '';\n\t\tforeach ($group as $cn)\n\t\t\t$filter .= '(cn='.$cn.')';\n\n\t\tif (sizeof($group) > 1)\n\t\t\t$filter = '(|'.$filter.')';\n\t\t$filter = \"(&(objectclass=groupofuniquenames)(uniquemember=$user_dn)$filter)\";\n\n\t\t# connect, bind and search for $dn in $group\n\t\tif (!$sr = @ldap_search($ds, $basedn, $filter, array('cn')))\n\t\t\tbreak;\n\n\t\t# bail out if $dn is found in this $group list\n\t\tif (@ldap_count_entries($ds, $sr) > 0) {\n\t\t\t$result = true;\n\t\t\tbreak;\n\t\t}\n\n\t\t# bail out if there are no sub-groups\n\t\tif (!$group = bluegroups_subgroups($group))\n\t\t\tbreak;\n\t\t$depth--;\n\t}\nreturn($result);\n}", "public function searchWithBadBaseDn()\n {\n $this->ldap->setBaseDn('badDN');\n $this->ldap->bind()->search();\n }", "function getCN($dn)\n{\n preg_match('/[^,]*/', $dn, $matchs, PREG_OFFSET_CAPTURE, 3);\n return $matchs[0][0];\n}", "function ibm_uid ( $dn ) { return dn2uid($dn); }", "public function checkLinkeinAccount($account) {\r\n if ($account <> '' && strpos($account, 'linkedin.') === false) {\r\n $account = 'https://www.linkedin.com/in/' . $account;\r\n }\r\n return $account;\r\n }" ]
[ "0.75904876", "0.65023524", "0.6329517", "0.63089776", "0.63065916", "0.599628", "0.5989025", "0.59706676", "0.5861558", "0.5851783", "0.57341075", "0.5714527", "0.5705161", "0.561168", "0.550764", "0.53671795", "0.5353338", "0.53370076", "0.5289423", "0.52819675", "0.52701634", "0.52676225", "0.5245036", "0.520142", "0.51287556", "0.5123823", "0.50995064", "0.5095618", "0.50922453", "0.5076812" ]
0.76359344
0
Register an adapter with the helper.
public function registerAdapter(SyncAdapterInterface $adapter) { $this->adapters[$adapter->getName()] = $adapter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerAdapterFactory()\n {\n $this->app->singleton('digitalocean.adapterfactory', function () {\n return new AdapterFactory();\n });\n\n $this->app->alias('digitalocean.adapterfactory', AdapterFactory::class);\n }", "public function setAdapter(AdapterInterface $adapter);", "public function createAdapter() : AdapterInterface;", "public function adapter(string $name): AdapterInterface;", "function addAdapter(\\Tecnocreaciones\\Bundle\\BoxBundle\\Model\\Adapter\\AdapterInterface $adapter)\n {\n if($this->adapters === null){\n $this->adapters = array();\n }\n $adapter->setContainer($this->container);\n $this->adapters[] = $adapter;\n }", "abstract protected function createAdapter();", "public function register()\n {\n $this->app->singleton(Adapter::class, function () {\n\n return new Adapter(config('services.sso.id'), config('services.sso.secret'));\n\n });\n }", "public function register()\n {\n $this->registerEntryHelper();\n $this->registerCacheHelper();\n }", "public function getAdapter();", "public function getAdapter();", "public function setAdapterMethod($adapter);", "public function registerAdapter($name, $class)\n {\n $this->validateAdapterName($name);\n $this->validateAdapterClass($class);\n\n $this->list[$name] = $class;\n }", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function register()\n {\n app()->singleton(MusicAdapterInterface::class,function (){\n return new MetAdapter();\n });\n app()->bind(MusicInterface::class,function (){\n return new Music();\n });\n\n }", "public function register()\n {\n $adapter = $this->getContainer()->get(AdapterInterface::class);\n $this->getContainer()->share('repo.user', new UsersRepository($adapter));\n $this->getContainer()->share('repo.media', new MediaRepository($adapter));\n $this->getContainer()->share('repo.comment', new CommentsRepository($adapter));\n $this->getContainer()->share('repo.like', new LikesRepository($adapter));\n $this->getContainer()->share('repo.tag', new TagsRepository($adapter));\n $this->getContainer()->share('repo.location', new LocationsRepository($adapter));\n }", "protected function register()\n {\n $this->setConfig();\n $this->registerEasyWechat();\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n {\n // Bind any implementations.\n }", "public function registerAdapterService($name, $callable)\n {\n $key = 'adapter.'.$name;\n $this->adapterServices[] = $key;\n $this->container[$key] = $this->container->share($callable);\n }", "public function register() {\n\n // Bind any implementations.\n\n }", "public function register()\n {\n //include the active package helpers\n if (count(config('helpers.package_helpers'))) {\n foreach (config('helpers.package_helpers', []) as $active_helper) {\n $file = app_path('Helpers') . '/' . $active_helper . '_helper.php';\n if (file_exists($file)) {\n require_once($file);\n }\n }\n }\n }", "public function add($alias, DataProviderInterface $provider);", "public function adapter( $adapter = null )\n\t{\n\t\treturn $this->useAdapter( $adapter );\n\t}", "public function setConnection(AdapterInterface $adapter);", "protected function bindAdapter($name)\n {\n $alias = static::CONTAINER_ADAPTER_PREFIX . $name;\n $this->container->singleton(\n $alias,\n $this->list[$name]\n );\n }", "public function getAdapter()\r\n {\r\n }", "public function register()\n {\n $this->setupDefaultDriver();\n\n $this->registerSessionManager();\n\n $this->registerSessionDriver();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__ . '/../config/extend.php', 'extend');\n\n $this->app->bind(Extend::class, function () {\n return new Extend(\n config('extend.api_key'),\n config('extend.store_id'),\n config('extend.sandbox'),\n config('extend.api_version')\n );\n });\n\n $this->app->alias(Extend::class, 'extend');\n }", "public function registerHelper($index, ViewHelperInterface $helper);" ]
[ "0.69208837", "0.6569605", "0.6468563", "0.6377118", "0.63553876", "0.63499635", "0.62473184", "0.62434804", "0.6207224", "0.6207224", "0.6186256", "0.6081238", "0.6073555", "0.6073555", "0.60476696", "0.60387766", "0.5847033", "0.5839463", "0.5829548", "0.5815169", "0.58080846", "0.5778859", "0.5744637", "0.57186544", "0.5705281", "0.5696962", "0.56811416", "0.56598866", "0.563988", "0.5620179" ]
0.66591936
1
Synchronize packages in the given configuration.
public function synchronizePackages(Remote $configuration) { $adapter = $this->getAdapter($configuration); $packages = $adapter->synchronizePackages($configuration); foreach ($packages as $package) { $event = new PackageEvent($package); $this->eventDispatcher->dispatch(Events::PACKAGE_CREATE, $event); } return $packages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resync_all_package_configs($show_message = false) {\n\tlog_error(gettext(\"Resyncing configuration for all packages.\"));\n\n\tif ($show_message == true) {\n\t\techo \"Syncing packages:\";\n\t}\n\n\tforeach (config_get_path('installedpackages/package', []) as $idx => $package) {\n\t\tif (empty($package['name'])) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ($show_message == true) {\n\t\t\techo \" \" . $package['name'];\n\t\t}\n\t\tif (platform_booting() != true) {\n\t\t\tstop_service(get_package_internal_name($package));\n\t\t}\n\t\tsync_package($package['name']);\n\t\tupdate_status(gettext(\"Syncing packages...\") . \"\\n\");\n\t}\n\n\tif ($show_message == true) {\n\t\techo \" done.\\n\";\n\t}\n}", "public static function syncConfig()\n {\n $addon = self::addon();\n\n if (!self::isBackwardsCompatible() && !$addon->hasConfig('synchronize')) {\n $addon->setConfig('synchronize', false);\n\n if (\n $addon->getConfig('synchronize_actions') == true ||\n $addon->getConfig('synchronize_modules') == true ||\n $addon->getConfig('synchronize_templates') == true ||\n $addon->getConfig('synchronize_yformemails') == true\n ) {\n $addon->setConfig('synchronize', true);\n\n // Set developer synchronizing actions according to theme settings\n if ($addon->getConfig('synchronize_templates')) {\n rex_addon::get('developer')->setConfig('templates', true);\n }\n if ($addon->getConfig('synchronize_modules')) {\n rex_addon::get('developer')->setConfig('modules', true);\n }\n if ($addon->getConfig('synchronize_actions')) {\n rex_addon::get('developer')->setConfig('actions', true);\n }\n if ($addon->getConfig('synchronize_yformemails')) {\n rex_addon::get('developer')->setConfig('yform_email', true);\n }\n }\n\n $addon->removeConfig('synchronize_actions');\n $addon->removeConfig('synchronize_modules');\n $addon->removeConfig('synchronize_templates');\n $addon->removeConfig('synchronize_yformemails');\n }\n }", "function notes_sync_package() {\n\n\t//global $config;\n\n}", "function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate resolv.conf */\n\tsystem_resolvconf_generate();\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n\n\t/* start dyndns service */\n\tservices_dyndns_configure();\n\n\t/* configure cron service */\n\tconfigure_cron();\n\n\t/* start the NTP client */\n\tsystem_ntp_configure();\n\n\t/* sync pw database */\n\tunlink_if_exists(\"/etc/spwd.db.tmp\");\n\tmwexec(\"/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd\");\n\n\t/* restart sshd */\n\tsend_event(\"service restart sshd\");\n\n\t/* restart webConfigurator if needed */\n\tsend_event(\"service restart webgui\");\n}", "function backup_sync_package() {\n\tglobal $config;\n\tif ($config['installedpackages']['backup']['config'] != \"\") {\n\t\tforeach ($config['installedpackages']['backup']['config'] as $rowhelper) {\n\t\t\tif ($rowhelper['enabled'] != \"false\") {\n\t\t\t\t//$tmp_php = base64_decode($rowhelper['php']);\n\t\t\t\tif (strlen($tmp_php) > 0) {\n\t\t\t\t\t$tmp .= \"// name: \" . $rowhelper['name'] . \" \\n\";\n\t\t\t\t\t$tmp .= \"// description: \" . $rowhelper['description'] . \" \\n\\n\";\n\t\t\t\t\t$tmp .= base64_decode($rowhelper['php']);\n\t\t\t\t\t$tmp .= \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "protected function registerConfigurations()\n {\n $this->mergeConfigFrom($this->packagePath('config/tarpit.php'), 'tarpit');\n $this->publishes([$this->packagePath('config/config.php') => config_path('tarpit.php')], 'tarpit');\n }", "public function setup_sync()\n {\n }", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "protected function packages(): void\n {\n $rootPackages = json_decode(file_get_contents(__DIR__.'/../../../package.json'), true);\n\n if (file_exists($this->laravel->basePath('package.json'))) {\n $packages = json_decode(file_get_contents($this->laravel->basePath('package.json')), true);\n\n $packages['dependencies'] = array_replace(\n $packages['dependencies'] ?? [], $rootPackages['dependencies']\n );\n\n ksort($packages['dependencies']);\n }\n\n file_put_contents(\n $this->laravel->basePath('package.json'),\n json_encode($packages ?? $rootPackages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n\n $this->info('The \"packages.json\" file has been updated.');\n }", "protected function syncSharedFolders()\n\t{\n\t\t$currentRelease = $this->releasesManager->getCurrentReleasePath();\n\t\tforeach ($this->rocketeer->getShared() as $file) {\n\t\t\t$this->share($currentRelease.'/'.$file);\n\t\t}\n\t}", "protected function loadConfigsFromPackage(): void\n {\n $packageConfigs = $this->getConfigsFromPackage();\n foreach ($packageConfigs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "private function synchronize() {\n\t\t$response = $this->send(self::$synchronize_uri, self::SYNC_SIZE);\n\t\t$this->_set_sync($response);\n\t}", "protected function syncSharedFolders()\n\t{\n\t\t$shared = (array) $this->rocketeer->getOption('remote.shared');\n\t\tforeach ($shared as $file) {\n\t\t\t$this->share($file);\n\t\t}\n\t}", "public function daily_sync()\n {\n /** @var $helper Mailigen_Synchronizer_Helper_Data */\n $helper = Mage::helper('mailigen_synchronizer');\n if (!$helper->isEnabled()) {\n return \"Module is disabled\";\n }\n\n /**\n * Synchronize Newsletter\n */\n try {\n if ($helper->canAutoSyncNewsletter()) {\n /** @var $mailigen Mailigen_Synchronizer_Model_Mailigen */\n $mailigen = Mage::getModel('mailigen_synchronizer/mailigen');\n $mailigen->syncNewsletter();\n }\n } catch (Exception $e) {\n Mage::helper('mailigen_synchronizer/log')->logException($e);\n }\n\n /**\n * Synchronize Customers\n */\n try {\n if ($helper->canAutoSyncCustomers() || $helper->getManualSync()) {\n if ($helper->getManualSync()) {\n $helper->setManualSync(0);\n }\n\n /** @var $mailigen Mailigen_Synchronizer_Model_Mailigen */\n $mailigen = Mage::getModel('mailigen_synchronizer/mailigen');\n $mailigen->syncCustomers();\n }\n } catch (Exception $e) {\n Mage::helper('mailigen_synchronizer/log')->logException($e);\n }\n }", "public function sync($force = false) {\n\t\t// do this once per request\n\t\tif ($this->cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $conf;\n\n\t\t$idx_cache = new cache($this->getPluginName(), '.idx');\n\t\t$pkg_cache = new cache($this->getPluginName(), '.txt');\n\t\t$cache_exists = file_exists($pkg_cache->cache);\n\n\t\t// check poldek indexes\n\t\tif (!$cache_exists || !$idx_cache->useCache(array('age' => $conf['locktime'], 'files' => getConfigFiles('main')))) {\n\n\t\t\t// cache is ok, if it exists and is not empty and does not contain errors\n\t\t\t$cache_ok = $cache_exists && filesize($pkg_cache->cache) && !preg_grep('/^error:/', file($pkg_cache->cache));\n\n\t\t\t// without force update indexes only if cache is missing\n\t\t\tif ($force || !$cache_exists) {\n\t\t\t\t$lines = $this->exec(\"--up\");\n\t\t\t\t// process output, if we find \"Writing ...\" line, means we should update ls output as well\n\t\t\t\t// Writing /root/.poldek-cache/[...]/packages.ndir.gz...\n\t\t\t\t// Index patches size too big\n\t\t\t\t// Retrieving whole index ...\n\t\t\t\tif (!$cache_exists || !$cache_ok || preg_grep('/^(Writing|Retrieving whole index) /', $lines)) {\n\t\t\t\t\t$idx_cache->storeCache(time());\n\t\t\t\t} else {\n\t\t\t\t\t// freshen timestamp or we keep updating indexes if index\n\t\t\t\t\t// is older than locktime\n\t\t\t\t\ttouch($idx_cache->cache);\n\t\t\t\t\tif ($force) {\n\t\t\t\t\t\t// sleep, so packages cache be newer\n\t\t\t\t\t\tsleep(1);\n\t\t\t\t\t}\n\t\t\t\t\t// touch also package file, not to trigger it's update\n\t\t\t\t\ttouch($pkg_cache->cache);\n\t\t\t\t\tclearstatcache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// do not update listing, if cache exists and not in cron mode\n\t\tif (($force || !$cache_exists) && !$pkg_cache->useCache(array('files' => array($idx_cache->cache)))) {\n\t\t\t$lines = $this->shcmd(\"ls\", $rc);\n\t\t\t// write cache, unless there was an error\n\t\t\tif (!$rc) {\n\t\t\t\t$pkg_cache->storeCache(join(\"\\n\", $lines));\n\t\t\t}\n\t\t}\n\n\t\t$this->cache = $pkg_cache->cache;\n\t}", "protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/laravel-deploy-helper.php'), 'laravel-deploy-helper'\n );\n $this->publishes([\n $this->packagePath('config/laravel-deploy-helper.php') => config_path('laravel-deploy-helper.php'),\n ], 'ldh-config');\n }", "public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\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\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\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$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}", "protected static function updatePackages()\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['devDependencies'] = static::updatePackageArray(\n $packages['devDependencies']\n );\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_PRETTY_PRINT)\n );\n }", "function pico_sync_all($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t$module_handler = xoops_gethandler('module');\n\t$module = &$module_handler->getByDirname($mydirname);\n\t$config_handler = xoops_gethandler('config');\n\t$configs = $config_handler->getConfigList($module->mid());\n\n\t// sync contents <- content_votes\n\t$result = $db->query('SELECT content_id FROM ' . $db->prefix($mydirname . '_contents'));\n\twhile (list($content_id) = $db->fetchRow($result)) {\n\t\tpico_sync_content_votes($mydirname, (int)$content_id);\n\t\t//pico_sync_content( $mydirname , intval( $content_id ) ) ;\n\t}\n\n\t// sync tags\n\tpico_sync_tags($mydirname);\n\n\t// d3forum comment integration\n\tif (!empty($configs['comment_dirname']) && $configs['comment_forum_id'] > 0) {\n\t\t$target_module = &$module_handler->getByDirname($configs['comment_dirname']);\n\t\tif (is_object($target_module)) {\n\t\t\t$target_dirname = $target_module->getVar('dirname');\n\t\t\t$forum_id = (int)$configs['comment_forum_id'];\n\t\t\t$result = $db->query('SELECT topic_external_link_id,COUNT(*) FROM ' . $db->prefix($target_dirname . '_topics') . \" WHERE topic_external_link_id>0 AND forum_id=$forum_id AND ! topic_invisible GROUP BY topic_external_link_id\");\n\t\t\twhile (list($content_id, $comments_count) = $db->fetchRow($result)) {\n\t\t\t\t$db->queryF('UPDATE ' . $db->prefix($mydirname . '_contents') . \" SET comments_count=$comments_count WHERE content_id=$content_id\");\n\t\t\t}\n\t\t}\n\t}\n\n\t// fix null and '' confusion\n\t$db->queryF('UPDATE ' . $db->prefix($mydirname . '_categories') . \" SET cat_vpath=null WHERE cat_vpath=''\");\n\t$db->queryF('UPDATE ' . $db->prefix($mydirname . '_contents') . \" SET vpath=null WHERE vpath=''\");\n\n\t// serialize_type conversion from PHP built-in serialize() to var_export()\n\tpico_convert_serialized_data($mydirname);\n\n\t// sync category's tree\n\tpico_sync_cattree($mydirname);\n}", "function checkmk_sync_on_changes() {\n\tglobal $config;\n\n\tif (is_array($config['installedpackages']['checkmksync']['config'])) {\n\t\t$checkmk_sync = $config['installedpackages']['checkmksync']['config'][0];\n\t\t$synconchanges = $checkmk_sync['synconchanges'];\n\t\t$synctimeout = $checkmk_sync['synctimeout'] ?: '250';\n\t\tswitch ($synconchanges) {\n\t\t\tcase \"manual\":\n\t\t\t\tif (is_array($checkmk_sync['row'])) {\n\t\t\t\t\t$rs = $checkmk_sync['row'];\n\t\t\t\t} else {\n\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync is enabled but there are no hosts configured as replication targets.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"auto\":\n\t\t\t\tif (is_array($config['hasync'])) {\n\t\t\t\t\t$system_carp = $config['hasync'];\n\t\t\t\t\t$rs[0]['ipaddress'] = $system_carp['synchronizetoip'];\n\t\t\t\t\t$rs[0]['username'] = $system_carp['username'];\n\t\t\t\t\t$rs[0]['password'] = $system_carp['password'];\n\t\t\t\t\t$rs[0]['syncdestinenable'] = FALSE;\n\n\t\t\t\t\t// XMLRPC sync is currently only supported over connections using the same protocol and port as this system\n\t\t\t\t\tif ($config['system']['webgui']['protocol'] == \"http\") {\n\t\t\t\t\t\t$rs[0]['syncprotocol'] = \"http\";\n\t\t\t\t\t\t$rs[0]['syncport'] = $config['system']['webgui']['port'] ?: '80';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rs[0]['syncprotocol'] = \"https\";\n\t\t\t\t\t\t$rs[0]['syncport'] = $config['system']['webgui']['port'] ?: '443';\n\t\t\t\t\t}\n\t\t\t\t\tif ($system_carp['synchronizetoip'] == \"\") {\n\t\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC CARP/HA sync is enabled but there are no system backup hosts configured as replication targets.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rs[0]['syncdestinenable'] = TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC CARP/HA sync is enabled but there are no system backup hosts configured as replication targets.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t}\n\t\tif (is_array($rs)) {\n\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync is starting.\");\n\t\t\tforeach ($rs as $sh) {\n\t\t\t\t// Only sync enabled replication targets\n\t\t\t\tif ($sh['syncdestinenable']) {\n\t\t\t\t\t$sync_to_ip = $sh['ipaddress'];\n\t\t\t\t\t$port = $sh['syncport'];\n\t\t\t\t\t$username = $sh['username'] ?: 'admin';\n\t\t\t\t\t$password = $sh['password'];\n\t\t\t\t\t$protocol = $sh['syncprotocol'];\n\n\t\t\t\t\t$error = '';\n\t\t\t\t\t$valid = TRUE;\n\n\t\t\t\t\tif ($password == \"\") {\n\t\t\t\t\t\t$error = \"Password parameter is empty. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_ipaddr($sync_to_ip) && !is_hostname($sync_to_ip) && !is_domain($sync_to_ip)) {\n\t\t\t\t\t\t$error .= \"Misconfigured Replication Target IP Address or Hostname. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_port($port)) {\n\t\t\t\t\t\t$error .= \"Misconfigured Replication Target Port. \";\n\t\t\t\t\t\t$valid = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tif ($valid) {\n\t\t\t\t\t\tcheckmk_do_xmlrpc_sync($sync_to_ip, $port, $protocol, $username, $password, $synctimeout);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync with '{$sync_to_ip}' aborted due to the following error(s): {$error}\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlog_error(\"[check_mk-agent] XMLRPC sync completed.\");\n\t\t}\n \t}\n}", "protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/config.php'), 'password'\n );\n $this->publishes([\n $this->packagePath('config/config.php') => config_path('password.php'),\n ], 'config');\n }", "protected static function updatePackagesScripts(): void\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['scripts'] = static::updatePackagesScriptsArray(\n array_key_exists('scripts', $packages) ? $packages['scripts'] : []\n );\n\n ksort($packages['scripts']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function publish()\n {\n $this->move('config/auth.php', config_path(), 'auth.php');\n $this->move('config/services.php', config_path(), 'services.php');\n\n $this->notify('Publishing: Config Files');\n }", "protected function registerPackagesFromConfiguration($packageStatesConfiguration): void\n {\n foreach ($packageStatesConfiguration['packages'] as $composerName => $packageStateConfiguration) {\n $this->registerPackageFromStateConfiguration($composerName, $packageStateConfiguration);\n }\n }", "protected function setPackageConfigurationFile()\n {\n $config = __DIR__ . '/Config/recaptcha.php';\n $path = config_path('recaptcha.php');\n \n $this->publishes([$config => $path], 'config'); \n $this->mergeConfigFrom( $config, 'recaptcha');\n }", "function reload_interfaces_sync() {\n\tglobal $config, $g;\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"reload_interfaces_sync() is starting.\"));\n\t}\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Enabling system routing\"));\n\t}\n\n\tif (g_get('debug')) {\n\t\tlog_error(gettext(\"Cleaning up Interfaces\"));\n\t}\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n}", "private function mergeConfig() {\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'sl-upload'\n\t\t);\n\t}", "public function updateConfig()\n {\n $this->aframe_assets_url = $this->composer->getConfig()->get('aframe-url') ?? '/aframe';\n \n $composer_json = $this->getVendorDir() . DIRECTORY_SEPARATOR . 'mkungla' . DIRECTORY_SEPARATOR . 'aframe-php' . DIRECTORY_SEPARATOR . 'composer.json';\n \n if (file_exists($composer_json)) {\n $config = json_decode(file_get_contents($composer_json));\n $config->config->{'aframe-dir'} = $this->getPublicRoot();\n $config->config->{'aframe-url'} = $this->aframe_assets_url;\n $config->version = self::AFRAME_PHP_VERSION;\n file_put_contents($composer_json, json_encode($config, JSON_PRETTY_PRINT));\n }\n }", "public function manualSync()\n {\n // Only run Auto Sync Jobs\n \n $job = Mage::getModel('mailup/job');\n /* @var $job MailUp_MailUpSync_Model_Job */\n \n foreach($job->fetchManualSyncQueuedJobsCollection() as $job) {\n \n }\n }", "public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync process msg\n Mage::helper('connector')->logSyncProcess(\"Starting synchronization task job...\", $sync_type);\n\n try {\n\n //Sync all data\n Mage::getModel('connector/synchronization')->sync_data($sync_type, Minematic_Connector_Model_Config::DATA_TYPE_ALL);\n\n } catch (Exception $e) {\n\n \t// Logging Exceptions\n Mage::helper('connector')->logSyncProcess($e->getMessage(), $sync_type, \"ERROR\");\n \t\n }\n\n //Log Finishing sync process msg\n Mage::helper('connector')->logSyncProcess(\"Finishing synchronization task job.\", $sync_type);\n }\n }" ]
[ "0.6613142", "0.61146903", "0.5932145", "0.5836352", "0.5759114", "0.5540249", "0.55125993", "0.549649", "0.54691786", "0.5465433", "0.54608893", "0.53672594", "0.5358677", "0.53581107", "0.53041923", "0.5297658", "0.5279763", "0.52536625", "0.52358", "0.5235072", "0.52297705", "0.5227289", "0.5224039", "0.5211307", "0.51934135", "0.51905096", "0.5185745", "0.5170703", "0.5158987", "0.51403105" ]
0.64527655
1
Get DB Manager Handler
public function getDBManagerHandler(): DatabaseManager { if (empty($this->dbManager)) { $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory()); } return $this->dbManager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}", "public function getDatabaseHandler();", "public function getHandlerManager()\n {\n return $this->handlerManager;\n }", "private static function GetHandler()\n {\n if(!isset(self::$_mHandler))\n {\n try {\n //Create a new PDO class instance \n self::$_mHandler = new PDO(PDO_DSN, DB_USERNAME, DB_PASSWORD, array(PDO::ATTR_PERSISTENT => DB_PERSISTENCY));\n\n //Configure PDO to throw exceptions\n self::$_mHandler->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n //Close the database handler and trigger an error\n self::Close();\n trigger_error($e->getMessage(), E_USER_ERROR);\n }\n }\n //Return the database handler \n return self::$_mHandler;\n }", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public static function getDBHandler()\r\n\t{\r\n\t\tif(self::$dbHandler === null)\r\n\t\t{\r\n\t\t\tself::$dbHandler = new DBHandler();\r\n\t\t\tif(self::$dbHandler->mysqli->connect_error)\r\n\t\t\t{\r\n\t\t\t\tself::$dbHandler = null;\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$dbHandler;\r\n\t}", "public function getDatabaseHandler() {\n if (is_null($this->__databaseHandler)) {\n throw new \\Exception(\"You did not open any connection to the database!\");\n }\n return $this->__databaseHandler;\n }", "public function db(){\n\treturn Manager::getManager($this);\n }", "function &dbm()\n{\n\treturn dbManager::get_instance();\n}", "public function getDatabaseHandle() {}", "public function &getHandler(){\n return $this->pdo;\n }", "static public function getHandler($id = 'default', $database = '')\n\t{\n\t\treturn self::get($id, $database);\n\t}", "protected function get_handler() {\n\n\t\treturn $this->handler;\n\t}", "private function getDatabaseManager()\n {\n $file = require __DIR__ . '/../../src/settings.php';\n $dbSettings = $file['settings']['db'];\n\n $capsule = new \\Illuminate\\Database\\Capsule\\Manager;\n $capsule->addConnection($dbSettings);\n $capsule->setAsGlobal();\n $capsule->bootEloquent();\n return $capsule->getDatabaseManager();\n }", "private static function getHandler()\n {\n if (self::$config_handler == null) {\n self::$config_handler = new self();\n }\n return self::$config_handler;\n }", "public function get_handler_instance() {\n\n\t\treturn $this->handler;\n\t}", "public function getDataSourceHandler()\n {\n return $this->DataSourceInstance->getDataSourceHandler();\n }", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n\t{\n\t\treturn $this->handler;\n\t}", "public function getHandler(){\n return($this->handle); \n }", "public function getRedisManagerHandler(): RedisManager\n {\n if (empty($this->redisManager)) {\n $this->redisManager = new RedisManager(Config::get('redis'));\n }\n return $this->redisManager;\n }", "public function connect() {\n $this->__databaseHandler = $this->_connect($this->__configuration);\n return $this->__databaseHandler;\n }", "public static function handler()\n {\n return static::$handler;\n }", "public function getHandler() {\n\t\t/** @var \\Cundd\\Rest\\HandlerInterface $handler */\n\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t// Check if an extension provides a Handler\n\t\t$handlerClass = 'Tx_' . $extension . '_Rest_Handler';\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\Handler';\n\t\t}\n\n\t\t// Get the specific builtin handler\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\Handler\\\\' . $extension . 'Handler';\n\t\t\t// Get the default handler\n\t\t\tif (!class_exists($handlerClass)) {\n\t\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\HandlerInterface';\n\t\t\t}\n\t\t}\n\t\t$handler = $this->get($handlerClass);\n\t\t//$handler->setRequest($this->dispatcher->getRequest());\n\t\treturn $handler;\n\t}", "public function getHandler();", "public function getHandler();", "protected 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 }" ]
[ "0.8761655", "0.78724396", "0.7585893", "0.73555136", "0.72392917", "0.7185888", "0.71208847", "0.70777106", "0.6990095", "0.6951328", "0.6848416", "0.6755057", "0.67099756", "0.6621526", "0.64450836", "0.6387809", "0.6381628", "0.6361761", "0.6361761", "0.63507706", "0.6307209", "0.6302263", "0.6270005", "0.6262467", "0.62413496", "0.6222621", "0.6222621", "0.620937", "0.62091", "0.62091" ]
0.84424555
1
Get Redis Manager Handler
public function getRedisManagerHandler(): RedisManager { if (empty($this->redisManager)) { $this->redisManager = new RedisManager(Config::get('redis')); } return $this->redisManager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHandler();", "public function getHandler();", "public function getHandlerManager()\n {\n return $this->handlerManager;\n }", "protected function get_handler() {\n\n\t\treturn $this->handler;\n\t}", "public function getHandler() {}", "public function getHandler(){\n return($this->handle); \n }", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n {\n }", "public function getHandler()\n\t{\n\t\treturn $this->handler;\n\t}", "public function handler()\r\n\t{\r\n\t\treturn $this->handler;\r\n\t}", "public static function handler()\n {\n return static::$handler;\n }", "private static function getHandler()\n {\n if (self::$config_handler == null) {\n self::$config_handler = new self();\n }\n return self::$config_handler;\n }", "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}", "public function getRedisClient( ){\n if( empty( $this->redisHandler ) ){\n $this->redisHandler = new RedisHandler();\n }\n return $this->redisHandler->getConnection();\n }", "public function get_handler_instance() {\n\n\t\treturn $this->handler;\n\t}", "public function get_handler()\n {\n }", "public function getHandler() {\n\t\t/** @var \\Cundd\\Rest\\HandlerInterface $handler */\n\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t// Check if an extension provides a Handler\n\t\t$handlerClass = 'Tx_' . $extension . '_Rest_Handler';\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\Handler';\n\t\t}\n\n\t\t// Get the specific builtin handler\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\Handler\\\\' . $extension . 'Handler';\n\t\t\t// Get the default handler\n\t\t\tif (!class_exists($handlerClass)) {\n\t\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\HandlerInterface';\n\t\t\t}\n\t\t}\n\t\t$handler = $this->get($handlerClass);\n\t\t//$handler->setRequest($this->dispatcher->getRequest());\n\t\treturn $handler;\n\t}", "public function getHandler(): string\n {\n return $this->handler;\n }", "public function getHandler()\n {\n if (!$this->_handler) {\n $this->setHandler(new Rx_Json_Handler_Default());\n }\n return ($this->_handler);\n }", "public function redis_instance()\n {\n return $this->redis;\n }", "public function getActualHandler();", "function &_getHandler()\n\t{\n\t\treturn 0;\n\t}", "public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }", "public function get_handler() {\n global $CFG;\n\n $enablehandler = $this->enablehandler;\n $handlerlabel = $this->shortname;\n\n $handler = null;\n\n if (empty($enablehandler)) {\n return false;\n } else if ($enablehandler == SPECIFIC_HANDLER) {\n $thehandler = $this->itemcode;\n } else {\n $thehandler = $enablehandler;\n }\n\n if (!empty($thehandler) &&\n file_exists($CFG->dirroot.'/local/shop/datahandling/handlers/'.$thehandler.'/'.$thehandler.'.class.php')) {\n include_once($CFG->dirroot.'/local/shop/datahandling/handlers/'.$thehandler.'/'.$thehandler.'.class.php');\n $classtype = \"shop_handler_{$thehandler}\";\n $handler = new $classtype($handlerlabel);\n }\n\n return $handler;\n }", "function get_handler() {\r\n }", "private function getRedis()\r\n {\r\n if ($this->redis === null) {\r\n $this->redis = new PredisClient($this->redis_options);\r\n }\r\n\r\n return $this->redis;\r\n }", "public function getHandler(): ?callable{\n if($this->hasHandler())\n return $this->_handler;\n else\n return null;\n }", "protected function _getManager(Model $Model) {\n\t\treturn $this->settings[$Model->alias]['handler'];\n\t}", "public static function getHandlerClass(): string;" ]
[ "0.7048006", "0.7048006", "0.6991802", "0.69007593", "0.689282", "0.6679183", "0.6634213", "0.6634213", "0.6631946", "0.65716386", "0.65610665", "0.6507912", "0.6374624", "0.6369019", "0.635976", "0.6345224", "0.6319165", "0.62993807", "0.6242241", "0.6216167", "0.61962146", "0.6117394", "0.61098826", "0.6026566", "0.5963471", "0.5901377", "0.58826107", "0.5867139", "0.5804309", "0.57751155" ]
0.81542933
0
Gets query for [[Shares]].
public function getShares() { return $this->hasMany(Share::className(), ['user_id' => 'id']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getShares();", "public function getShares()\n {\n if (array_key_exists(\"shares\", $this->_propDict)) {\n return $this->_propDict[\"shares\"];\n } else {\n return null;\n }\n }", "function getSharings()\n {\n $sharing = new Sharing();\n\n //$sharing->whereAdd(sprintf('profile_id != %d', common_current_user()->getProfile()->id));\n\n $sharing->orderBy('created DESC');\n\n if(!empty($this->pc)) {\n $sharing->whereAdd(sprintf('(lower(displayName) LIKE \"%%%s%%\" OR lower(summary) LIKE \"%%%s%%\")', strtolower($this->pc), strtolower($this->pc)));\n }\n\n if($this->sharing_category_id != 0) {\n $sharing->whereAdd(sprintf('sharing_category_id = %d', $this->sharing_category_id));\n }\n\n if($this->sharing_city_id != 0) {\n $sharing->whereAdd(sprintf('sharing_city_id = %d', $this->sharing_city_id));\n }\n\n if($this->sharing_type_id != 0) {\n $sharing->whereAdd(sprintf('sharing_type_id = %d', $this->sharing_type_id));\n }\n\n if($this->gratuito == true) {\n $sharing->whereAdd('price = 0');\n }\n\n $offset = ($this->page - 1) * PROFILES_PER_PAGE;\n $limit = PROFILES_PER_PAGE + 1;\n \n $sharing->find();\n\n return $sharing;\n }", "public function getShares() {\n\t\tif (!$this->shareManager->shareApiEnabled()) {\n\t\t\treturn new \\OC\\OCS\\Result();\n\t\t}\n\n\t\t$sharedWithMe = $this->request->getParam('shared_with_me', null);\n\t\t$reshares = $this->request->getParam('reshares', null);\n\t\t$subfiles = $this->request->getParam('subfiles');\n\t\t$path = $this->request->getParam('path', null);\n\n\t\t$includeTags = $this->request->getParam('include_tags', false);\n\n\t\tif ($path !== null) {\n\t\t\t$userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID());\n\t\t\ttry {\n\t\t\t\t$path = $userFolder->get($path);\n\t\t\t\t$path->lock(ILockingProvider::LOCK_SHARED);\n\t\t\t} catch (\\OCP\\Files\\NotFoundException $e) {\n\t\t\t\treturn new \\OC\\OCS\\Result(null, 404, $this->l->t('Wrong path, file/folder doesn\\'t exist'));\n\t\t\t} catch (LockedException $e) {\n\t\t\t\treturn new \\OC\\OCS\\Result(null, 404, $this->l->t('Could not lock path'));\n\t\t\t}\n\t\t}\n\n\t\tif ($sharedWithMe === 'true') {\n\t\t\t$stateFilter = $this->request->getParam('state', \\OCP\\Share::STATE_ACCEPTED);\n\t\t\tif ($stateFilter === '') {\n\t\t\t\t$stateFilter = \\OCP\\Share::STATE_ACCEPTED;\n\t\t\t} elseif ($stateFilter === 'all') {\n\t\t\t\t$stateFilter = null; // which means all\n\t\t\t} else {\n\t\t\t\t$stateFilter = (int)$stateFilter;\n\t\t\t}\n\t\t\t$result = $this->getSharedWithMe($path, $includeTags, $stateFilter);\n\t\t\tif ($path !== null) {\n\t\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ($subfiles === 'true') {\n\t\t\t$result = $this->getSharesInDir($path);\n\t\t\tif ($path !== null) {\n\t\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ($reshares === 'true') {\n\t\t\t$reshares = true;\n\t\t} else {\n\t\t\t$reshares = false;\n\t\t}\n\n\t\t// Get all shares\n\t\t$userShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_USER, $path, $reshares, -1, 0);\n\t\t$groupShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_GROUP, $path, $reshares, -1, 0);\n\t\t$linkShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_LINK, $path, $reshares, -1, 0);\n\t\t$shares = \\array_merge($userShares, $groupShares, $linkShares);\n\n\t\tif ($this->shareManager->outgoingServer2ServerSharesAllowed()) {\n\t\t\t$federatedShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_REMOTE, $path, $reshares, -1, 0);\n\t\t\t$shares = \\array_merge($shares, $federatedShares);\n\t\t}\n\n\t\t$formatted = [];\n\t\tforeach ($shares as $share) {\n\t\t\ttry {\n\t\t\t\t$formatted[] = $this->formatShare($share);\n\t\t\t} catch (NotFoundException $e) {\n\t\t\t\t//Ignore share\n\t\t\t}\n\t\t}\n\n\t\tif ($includeTags) {\n\t\t\t$formatted = \\OCA\\Files\\Helper::populateTags($formatted, 'file_source');\n\t\t}\n\n\t\tif ($path !== null) {\n\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t}\n\n\t\treturn new \\OC\\OCS\\Result($formatted);\n\t}", "public function getShares($url);", "public function shares()\n {\n return $this->hasMany('App\\Models\\DocumentShares');\n }", "public function getSharesByUser($type, $user)\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\tswitch ($type){\r\n\t\t\tcase 'shares' :\r\n\t\t\t\t$filter = \"e.action IN (13,14,15,16,17) AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'fbShares' :\r\n\t\t\t\t$filter = \"e.action IN (14,15) AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'twShares' :\r\n\t\t\t\t$filter = \"e.action=16 AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'glShares' :\r\n\t\t\t\t$filter = \"e.action=17 AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mailShares' :\r\n\t\t\t\t$filter = \"e.action=13 AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(e.id) FROM PlaygroundReward\\Entity\\Event e\r\n\t\t\tWHERE e.user = :user\r\n\t\t\tAND ' . $filter . '\r\n\t\t');\r\n\t\t$query->setParameter('user', $user);\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "public function setShares($val)\n {\n $this->_propDict[\"shares\"] = $val;\n return $this;\n }", "public function getShareList($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.common.getlist\");\n\t\t// Get the configuration objects.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$objects = $db->get(\"conf.service.ftp.share\");\n\t\t// Add additional share information.\n\t\t$objectsAssoc = [];\n\t\tforeach ($objects as $objectk => &$objectv) {\n\t\t\t// Add the new property 'sharedfoldername'.\n\t\t\t$objectv->add(\"sharedfoldername\", \"string\", gettext(\"n/a\"));\n\t\t\t// Get the shared folder configuration object.\n\t\t\t$sfObject = $db->get(\"conf.system.sharedfolder\",\n\t\t\t $objectv->get(\"sharedfolderref\"));\n\t\t\t// Update the 'sharedfoldername' property.\n\t\t\t$objectv->set(\"sharedfoldername\", $sfObject->get(\"name\"));\n\t\t\t$objectsAssoc[] = $objectv->getAssoc();\n\t\t}\n\t\t// Filter the result.\n\t\treturn $this->applyFilter($objectsAssoc, $params['start'],\n\t\t $params['limit'], $params['sortfield'], $params['sortdir']);\n\t}", "public function getPostToShare(){\r\n\t\t$sql = 'SELECT *\r\n\t\t\t\tFROM `posts`\r\n\t\t\t\tORDER BY `posts`.`share_count` ASC\r\n\t\t\t\tLIMIT 0 , 10';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function getIsShareLike( Share $share )\n {\n\n if( !empty( Auth::user()->id ) ){\n $result = $this->where( [ 'fk_user_id' => Auth::user()->id, 'fk_share_id' => $share->id ] )->get();\n\n return $result->isNotEmpty();\n }\n\n }", "public function index(Request $request)\n {\n if (!$this->isAuthorized) {\n return prepareResult(false, [], [], \"User not authenticate\", $this->unauthorized);\n }\n\n $share_of_assortment_query = ShareOfAssortment::select('id', 'salesman_id', 'customer_id', 'date', 'no_of_sku', 'added_on')\n ->with(\n 'salesman:id,firstname,lastname',\n 'salesman.salesmanInfo:id,user_id,salesman_code',\n 'customer:id,firstname,lastname',\n 'customer.customerInfo:id,user_id,customer_code',\n 'shareOurBrand:id,share_of_assortment_id,brand_id,captured_sku,brand_share',\n 'shareOurBrand.brand:id,brand_name',\n 'shareCompetitor:id,share_of_assortment_id,competitor_info_id,competitor_sku,brand_share',\n 'shareCompetitor.competitorInfo:id,company,item,price,brand,note'\n );\n\n if ($request->date) {\n $share_of_assortment_query->where('created_at', date('Y-m-d', strtotime($request->date)));\n }\n\n if ($request->salesman_name) {\n $name = $request->salesman_name;\n $exploded_name = explode(\" \", $name);\n if (count($exploded_name) < 2) {\n $share_of_assortment_query->whereHas('salesman', function ($q) use ($name) {\n $q->where('firstname', 'like', '%' . $name . '%')\n ->orWhere('lastname', 'like', '%' . $name . '%');\n });\n } else {\n foreach ($exploded_name as $n) {\n $share_of_assortment_query->whereHas('salesman', function ($q) use ($n) {\n $q->where('firstname', 'like', '%' . $n . '%')\n ->orWhere('lastname', 'like', '%' . $n . '%');\n });\n }\n }\n }\n\n if ($request->customer_name) {\n $name = $request->customer_name;\n $exploded_name = explode(\" \", $name);\n if (count($exploded_name) < 2) {\n $share_of_assortment_query->whereHas('customer', function ($q) use ($name) {\n $q->where('firstname', 'like', '%' . $name . '%')\n ->orWhere('lastname', 'like', '%' . $name . '%');\n });\n } else {\n foreach ($exploded_name as $n) {\n $share_of_assortment_query->whereHas('customer', function ($q) use ($n) {\n $q->where('firstname', 'like', '%' . $n . '%')\n ->orWhere('lastname', 'like', '%' . $n . '%');\n });\n }\n }\n }\n\n if ($request->customer_code) {\n $customerCode = $request->customer_code;\n $share_of_assortment_query->whereHas('customer.customerInfo', function ($q) use ($customerCode) {\n $q->where('customer_code', $customerCode);\n });\n }\n\n $share_of_assortment = $share_of_assortment_query->orderBy('id', 'desc')\n ->get();\n\n $share_of_assortment_array = array();\n if (is_object($share_of_assortment)) {\n foreach ($share_of_assortment as $key => $share_of_assortment1) {\n $share_of_assortment_array[] = $share_of_assortment[$key];\n }\n }\n\n $data_array = array();\n $page = (isset($request->page)) ? $request->page : '';\n $limit = (isset($request->page_size)) ? $request->page_size : '';\n $pagination = array();\n if ($page != '' && $limit != '') {\n $offset = ($page - 1) * $limit;\n for ($i = 0; $i < $limit; $i++) {\n if (isset($share_of_assortment_array[$offset])) {\n $data_array[] = $share_of_assortment_array[$offset];\n }\n $offset++;\n }\n\n $pagination['total_pages'] = ceil(count($share_of_assortment_array) / $limit);\n $pagination['current_page'] = (int)$page;\n $pagination['total_records'] = count($share_of_assortment_array);\n } else {\n $data_array = $share_of_assortment_array;\n }\n\n return prepareResult(true, $data_array, [], \"Share assortment listing\", $this->success, $pagination);\n }", "public function index()\n {\n $shares = Auth::user()->shares;\n return view('shares.index')\n ->with('shares', $shares);\n }", "public function queryAllShared()\n {\n $statement = sprintf(\"SELECT %s, %s, %s, %s FROM %s WHERE %s = 1 AND deleted = 0\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[2], static::FIELDS[4], static::TABLE, static::FIELDS[3]);\n $req = $this->db->query($statement);\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "public function getShare($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.common.objectuuid\");\n\t\t// Get the configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\treturn $db->getAssoc(\"conf.service.ftp.share\", $params['uuid']);\n\t}", "public function share()\n {\n return $this->belongsTo( 'App\\Models\\Share', 'fk_share_id' );\n }", "public function index(Request $request)\n {\n $param = $request->input('type', '');\n\n $category = (!empty($request->input('category', ''))) ?\n Category::findOrFail($request->input('category', '')) : '';\n\n $sharings = (!empty($category)) ? $category->sharings() : Auth::user()->sharings();\n\n switch ($param){\n case 'pending':\n $data = SharingResource::collection($sharings->with(['owner','renewalFrequency'])->pending()->paginate(config('custom.paginate')));\n break;\n case 'approved':\n $data = SharingResource::collection($sharings->with(['owner','renewalFrequency'])->approved()->paginate(config('custom.paginate')));\n break;\n case 'owner':\n $sharings = (!empty($category)) ? $category->sharings() : Auth::user()->sharingOwners();\n $data = SharingResource::collection($sharings->with(['users','renewalFrequency'])->paginate(config('custom.paginate')));\n break;\n case 'joined':\n $data = SharingResource::collection($sharings->with(['owner','renewalFrequency'])->joined()->paginate(config('custom.paginate')));\n break;\n default:\n\n // Create a custom pagination (https://github.com/laravel/framework/issues/3105)\n $perPage = config('custom.paginate');\n $currentPage = $request->input('page', 1);\n $path_url = URL::to(\"/{$request->route()->getPrefix()}/sharings\");\n $paginationOption = ['path' => $path_url];\n\n $sharings = ((!empty($category)) ?\n $category->sharings() :\n Sharing::query()\n )->with(['owner','renewalFrequency'])->public()->latest()->get();\n\n $totalElements = $sharings->count();\n $sharings_paginate = $sharings->slice(($currentPage - 1) * $perPage, $perPage);\n\n $lengthAwarePaginator = new \\Illuminate\\Pagination\\LengthAwarePaginator($sharings_paginate, $totalElements, $perPage, $currentPage, $paginationOption);\n $data = SharingResource::collection($lengthAwarePaginator);\n break;\n }\n\n return $data;\n }", "public function index(Share $share)\n {\n $share = $share->latest()->paginate(8);\n return view('share.index')\n ->with('shares', $share);\n }", "function getRealShare($game_id, $company_id, $round_number, $product_number, $region_number, $channel_number){\r\n\t\t\t$share=new Model_DbTable_Outcomes_Rd_MarketShares();\r\n\t\t\t$result=$share->getRealShare($game_id, $company_id, $round_number, $product_number, $region_number, $channel_number);\r\n\t\t\t//var_dump($result);\r\n\t\t\treturn $result;\r\n\t\t}", "protected function _getQuery()\n {\n return Mage::helper('catalogsearch')->getQuery();\n }", "public function index() : View\n {\n\n $shares = Auth::user()->user->shares()->paginate(10);\n\n return view('stock_shares_dashboard', ['shares' => $shares]);\n }", "public function query()\n {\n $checkouts = Checkout::query()\n ->addSelect('checkouts.id')\n ->addSelect('checkouts.asset_id')\n ->addSelect('checkouts.user_id')\n ->addSelect('checkouts.dealer_id')\n ->addSelect('checkouts.project')\n ->addSelect('checkouts.expected_return_date')\n ->addSelect('checkouts.created_at')\n ->where('checkouts.returned_date', '=', null)\n ->with('user')->with('dealer')->with('dealer.dealership')->with('asset');\n\n return $this->applyScopes($checkouts);\n }", "protected function searchSharees($search, $itemType, array $shareTypes, $page, $perPage) {\n\t\t// Verify arguments\n\t\tif ($itemType === null) {\n\t\t\treturn [ 'statuscode' => Http::STATUS_BAD_REQUEST,\n\t\t\t\t'message' => 'Missing itemType'];\n\t\t}\n\n\t\t// Get users\n\t\tif (\\in_array(Share::SHARE_TYPE_USER, $shareTypes)) {\n\t\t\t$this->getUsers($search);\n\t\t}\n\n\t\t// Get groups\n\t\tif (\\in_array(Share::SHARE_TYPE_GROUP, $shareTypes)) {\n\t\t\t$this->getGroups($search);\n\t\t}\n\n\t\t// Get remote\n\t\tif (\\in_array(Share::SHARE_TYPE_REMOTE, $shareTypes)) {\n\t\t\t$this->getRemote($search);\n\t\t}\n\n\t\t$response = new DataResponse(['data' => $this->result]);\n\n\t\tif (\\sizeof($this->reachedEndFor) < 3) {\n\t\t\t$response->addHeader('Link', $this->getPaginationLink($page, [\n\t\t\t\t'search' => $search,\n\t\t\t\t'itemType' => $itemType,\n\t\t\t\t'shareType' => $shareTypes,\n\t\t\t\t'perPage' => $perPage,\n\t\t\t]));\n\t\t}\n\n\t\treturn $response;\n\t}", "public function actionIndex()\n {\n $searchModel = new ShareUserSearch(); //借助模型属性生成查询的视图\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams); //这里是真正的数据过滤和查询提供\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function gamemaster_index() {\n $this->UserStock->recursive = 0;\n $conditions = '';\n $search = \"\";\n $username = true;\n $portfolio = false;\n $share = false;\n if (isset($this->params['named']['portfolio_id']) && $this->params['named']['portfolio_id'] != \"\") {\n $conditions[] = array('UserStock.portfolio_id' => $this->params['named']['portfolio_id']);\n }\n if (!empty($this->request->query)) {\n $username = trim($this->request->query['username']);\n $portfolio = trim($this->request->query['portfolio']);\n if (!empty($this->request->query['search'])) {\n $search = trim($this->request->query['search']);\n if ($username != 1 && $portfolio != 1 && $share != 1) {\n $conditions['OR'] = array('User.username LIKE' => '%' . $search . '%', 'Portfolio.portfolio_name LIKE' => '%' . $search . '%', 'Share.symbol LIKE' => '%' . $search . '%');\n } else {\n if ($username == 1) {\n $conditions['OR'][] = array('User.username LIKE' => '%' . $search . '%');\n }\n if ($portfolio == 1) {\n $conditions['OR'][] = array('Portfolio.portfolio_name LIKE' => '%' . $search . '%');\n }\n if ($share == 1) {\n $conditions['OR'][] = array('Share.symbol LIKE' => '%' . $search . '%');\n }\n }\n }\n }\n $this->Paginator->settings = array(\n 'conditions' => $conditions,\n 'limit' => 20\n );\n $this->set('userStocks', $this->Paginator->paginate());\n $this->set('search', $search);\n $this->set('username', $username);\n $this->set('portfolio', $portfolio);\n $this->set('share', $share);\n }", "function process_shares($input, $details) {\r\n\t\t$sql = \"SELECT sys_sw_share.share_id\r\n\t\t\t\tFROM sys_sw_share, system \r\n\t\t\t\tWHERE \tsys_sw_share.system_id \t= system.system_id AND \r\n\t\t\t\t\t\tsystem.system_id\t\t= ? AND \r\n\t\t\t\t\t\tsystem.man_status \t= 'production' AND \r\n\t\t\t\t\t\tshare_name\t\t\t= ? AND \r\n\t\t\t\t\t\tshare_path\t\t\t= ? AND \r\n\t\t\t\t\t\t( sys_sw_share.timestamp = ? OR \r\n\t\t\t\t\t\tsys_sw_share.timestamp \t= ? )\";\r\n\t\t$sql = $this->clean_sql($sql);\r\n\t\t$data = array(\"$details->system_id\", \r\n\t\t\t\t\"$input->share_name\", \r\n\t\t\t\t\"$input->share_path\", \r\n\t\t\t\t\"$details->original_timestamp\", \r\n\t\t\t\t\"$details->timestamp\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\tif ($query->num_rows() > 0) {\r\n\t\t\t$row = $query->row();\r\n\t\t\t// the share exists - need to update its timestamp\r\n\t\t\t$sql = \"UPDATE sys_sw_share SET share_size = ?, share_users = ?, timestamp = ? WHERE share_id = ?\";\r\n\t\t\t$data = array(\"$input->share_size\", \"$input->share_users\", \"$details->timestamp\", \"$row->share_id\");\r\n\t\t\t$query = $this->db->query($sql, $data);\r\n\t\t} else {\r\n\t\t\t// the share does not exist - insert it\r\n\t\t\t$sql = \"INSERT INTO sys_sw_share (\tsystem_id, \r\n\t\t\t\t\t\t\t\t\t\tshare_caption, \r\n\t\t\t\t\t\t\t\t\t\tshare_name, \r\n\t\t\t\t\t\t\t\t\t\tshare_path, \r\n\t\t\t\t\t\t\t\t\t\tshare_size, \r\n\t\t\t\t\t\t\t\t\t\tshare_users, \r\n\t\t\t\t\t\t\t\t\t\ttimestamp,\r\n\t\t\t\t\t\t\t\t\t\tfirst_timestamp ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )\";\r\n\t\t\t$sql = $this->clean_sql($sql);\r\n\t\t\t$data = array(\"$details->system_id\", \r\n\t\t\t\t\t\"$input->share_caption\", \r\n\t\t\t\t\t\"$input->share_name\", \r\n\t\t\t\t\t\"$input->share_path\", \r\n\t\t\t\t\t\"$input->share_size\", \r\n\t\t\t\t\t\"$input->share_users\", \r\n\t\t\t\t\t\"$details->timestamp\", \r\n\t\t\t\t\t\"$details->timestamp\");\r\n\t\t\t$query = $this->db->query($sql, $data);\r\n\t\t}\r\n\t}", "public function query()\n {\n $param = $this->list_type;\n $account = Account::paramBasedList($param);\n $account->select([\n 'accounts.id',\n 'accounts.transaction_date',\n 'accounts.transaction_type',\n 'accounts.ref_id',\n 'accounts.amount',\n 'income.purpose as income_purpose',\n 'expense.purpose as expense_purpose'\n ]);\n return $this->applyScopes($account);\n }", "function get_shares_amount ($symbol) {\n $portfolio = load_portfolio_array();\n $shares_amount_available = 0;\n foreach ($portfolio as $record) {\n if ($record[\"symbol\"] == $symbol) {\n $shares_amount_available = $record[\"quantity\"];\n }\n }\n return $shares_amount_available;\n}", "public function list_shared_files_with() {\n $stmt = $this->pdo->prepare('select filename, name from share s, user u, file f where s.user_id = :id and s.owner_id = u.id and s.file_id = f.id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, array('filename' => $f['filename'],\n 'username' => $f['name']));\n }\n return $result;\n }", "public function get_share_urls()\n {\n $s_urls = [];\n\n $urls = $this->share_urls->find_all();\n\n if ($urls) {\n foreach ($urls as $shr) {\n $s_urls[strtolower($shr->url_type->type)] = $shr->url;\n }\n }\n\n return $s_urls;\n }" ]
[ "0.68221873", "0.65782195", "0.63938916", "0.63475734", "0.6241038", "0.57279426", "0.5646168", "0.5610153", "0.5492796", "0.5386871", "0.53193676", "0.5278656", "0.5233423", "0.5121122", "0.5104169", "0.50282484", "0.5011611", "0.4999997", "0.49703354", "0.48686036", "0.48514256", "0.48312", "0.4814362", "0.4803534", "0.48033485", "0.47872916", "0.47818303", "0.47807965", "0.4743891", "0.4741611" ]
0.68831193
0
Gets list [id => name] of companies
public static function getList() { $companies = static::find()->select(['id', 'name'])->asArray()->all(); return array_column($companies, 'name', 'id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}", "function GetCompanies()\n{\n\t$CompArr=array();\n\t$Query = \"SELECT * FROM \".PFX.\"_tracker_client ORDER BY NAME ASC\";\n\t$Sql = new Query($Query);\n\twhile ($Row=$Sql->Row()) {\n\t\t$CompArr[$Sql->Position]['Name']=htmlspecialchars(stripslashes($Row->NAME));\n\t\t$CompArr[$Sql->Position]['Value']=$Row->ID;\n\t}\n\treturn $CompArr;\n}", "public function companies(): Collection\n {\n return Company::all();\n }", "public function allCompanies()\n {\n return Company::all();\n }", "public function getCompaniesForSelect()\n {\n return Company::whereNull('deleted_at')->pluck('name', 'id');\n }", "public function getCompanyList($company_name = null)\n {\n //gen query\n $query = $this->db->getQuery(true)\n ->select(\"name,id FROM #__companies\");\n\n if ($company_name) {\n $company_name = ucwords($company_name);\n $query->where(\"LOWER(name) LIKE '%\".$company_name.\"%'\");\n }\n\n $query->where(\"published=\".$this->published);\n\n return $this->db->setQuery($query)->loadAssocList();\n }", "public function getAllCompanies(){\n\t\t$path=\"../db/data.json\";\n\t\t$file=$this->getData($path);\n\t\n\t\t$arrayFile = json_decode($file, true);\n\t\n\t\treturn $arrayFile['companies'];\n\t}", "public function findCompanies(){\n $data = SCompany::select('id_company', 'name')\n ->get();\n return response()->json($data);\n }", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getCompany();", "public function getCompany() {\n return Companies::findById($this->company_id);\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "private function _getCompanySelector()\n {\n $sSearch = getValue('q');\n if(empty($sSearch))\n return json_encode(array());\n\n $oDB = CDependency::getComponentByName('database');\n\n $sQuery = 'SELECT * FROM company WHERE status = 1 AND lower(company_name) LIKE '.$oDB->dbEscapeString('%'.strtolower($sSearch).'%').' ORDER BY company_name desc';\n $oDbResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oDbResult->readFirst();\n if(!$bRead)\n return json_encode(array());\n\n $asJsonData = array();\n while($bRead)\n {\n $asData['name'] = $oDbResult->getFieldValue('company_name');\n $asJsonData[] = json_encode($asData);\n $bRead = $oDbResult->readNext();\n }\n echo '['.implode(',', $asJsonData).']';\n }", "public function companylist() {\r\n $companies = $this->model->getCompanies();\r\n return $this->view('company/companylist', $companies);\r\n }", "public function getCompany() {}", "public function GetCompaniesArray()\n\t{\n\t\tif (!$this->companies)\n\t\t{\n\t\t\t$this->dbase->Select('job_companies', array('company_id', 'name', 'OPF'), array(), array('name' => 'ASC'));\n\t\t\t$this->companies = array();\n\t\t\twhile ($company = $this->dbase->FetchArray())\n\t\t\t{\n\t\t\t\t$this->companies[$company['company_id']] = $company['name'] . \", \" . $this->lang[$company['OPF'] . \"_short\"];\n\t\t\t}\n\t\t}\n\t\treturn $this->companies;\n\t}", "public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }", "function select_all_company() {\n\t\t$qury=\"SELECT * FROM company\";\n\t\t$requet=mysqli_query($link,$qury);\n\t\t\n\t\twhile($res=mysqli_fetch_assoc($requet)) {\n\t\t\t$data[]=$res;\n\t\t}\n\t\treturn $data;\n\t}", "function getConveyancingCompanies(){\n \n $conveyancingCompanies = array();\n \n $conveyancingLeadTypeCatIds = unserialize(CONVEYANCING_LEAD_TYPE_CATEGORY_IDS);\n foreach($conveyancingLeadTypeCatIds as $id){\n \n $leadTypeCat = new Models_LeadTypeCategory($id);\n $companies = $leadTypeCat->getCompanies();\n \n foreach($companies as $company){\n $conveyancingCompanies[$company[\"id\"]] = trim($company[\"companyName\"]);\n }\n }\n \n natcasesort($conveyancingCompanies);\n \n return $conveyancingCompanies;\n}", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }", "public function getCompanyWithUsers();", "public function get_customers_for_dropdown($company){\r\n\t\theader(\"Access-Control-Allow-Origin: \". base_url());\r\n\t\terror_log(\"get_customers_for_dropdown($company)\");\r\n\r\n\t\t$cid = intval($company);\r\n\t\tif($cid>0){\r\n\t\t\t$cs = $this->customer_model->get_companys_customers($cid);\r\n\t\t}\r\n\t\telse if($cid == 0){\r\n\t\t\t$cs = $this->customer_model->get_customers();\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo \"0\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\t\tforeach($cs as $c){\r\n\t\t\t$id = $c[\"id\"];\r\n\t\t\t$name = $c[\"namn\"];\r\n\t\t\t$data[] = array($id => $name);\r\n\t\t}\r\n\t\terror_log(print_r($data, true));\r\n\t\techo json_encode($data);\r\n\t}", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function list() {\n \n $companies = Companies::all();\n $companies->load('hasUserCompany'); \n // return response()->json($companies);\n\n return response()->json(['companies' => $companies]);\n }", "function listCompaniesByType ( $type ) {\n\t\tglobal $AppUI;\n\t\t$q = new DBQuery;\n\t\t$q->addQuery('company_id, company_name');\n\t\t$q->addTable('companies');\n\t\tforeach ($type as $t) { \n\t\t\t$q->addWhere('company_type ='. $t);\n\t\t}\n\t\t$this->setAllowedSQL($AppUI->user_id, $q);\n\t\t$q->addOrder('company_name');\n\n\t\treturn $q->loadHashList();\n\t}", "public function sitemapCompanies(){\n $links = array();\n $models = ORM::factory('CatalogCompany')->where('enable','=','1')->find_all();\n foreach($models as $model)\n $links[] = $model->getUri();\n return $links;\n }", "public function companies($id)\n {\n $user = User::find($id);\n return view('User.Users.companies_list', ['user' => $user]);\n }" ]
[ "0.7660172", "0.73401713", "0.7269344", "0.72589463", "0.7253848", "0.72444826", "0.72141033", "0.72080827", "0.7206525", "0.71996295", "0.70115834", "0.6966755", "0.6956996", "0.6939887", "0.6892844", "0.6699655", "0.66846484", "0.6676885", "0.66373336", "0.6629977", "0.662234", "0.6607922", "0.6603998", "0.6603922", "0.6599181", "0.6599181", "0.6591987", "0.6584457", "0.65728724", "0.6521738" ]
0.7571351
1
Returns a server ID. We always run "1" (int) if the file was uploaded to the amazon server, if not return "0" (int) so we display the local file instead.
public function getServerId() { return $this->_iServerId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileId(): string\n {\n return $this->file_id;\n }", "public function getServerId()\n {\n return $this->get(self::_SERVER_ID);\n }", "public function getServer() {\n\t\treturn (string) $this->photo['server'];\n\t}", "public function getFile_id() {\n return (int) $this->_file_id;\n }", "public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}", "public function getFileID()\n {\n return $this->get('FileID');\n }", "public function getId()\n {\n return $this->file->get('id');\n }", "public function getFileId()\n {\n return $this->fileId;\n }", "public function getFileId()\n\t{\n\t\treturn $this->fileId; \n\n\t}", "function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}", "public function getUploadId()\n {\n return $this->data['upload_id'];\n }", "public function getClientFilename()\n {\n return $this->fileInfo['name'];\n }", "public function getServerSource()\n {\n return Yii::$app->storage->fileServerPath($this->filter_id . '_' . $this->file->name_new_compound);\n }", "function GetServerIdByName($ServerName) {\n // Problem with this function is that it's a guessing game on what the api will return even with the exact ip it may\n // return the wrong json table for a different server. It's weird.\n \n // Getting server id by name seems to be more accurate than getting it by ip and port\n\n // Battlemetrics Function\n\n // HTTP Requrest ready string\n $HTTPServerName = preg_replace(\"/ /\", \"%20\", $ServerName);\n \n // Request and decode the returned json table\n $SERVERINFO = json_decode(file_get_contents(\"https://api.battlemetrics.com/servers?filter[search]={$HTTPServerName}&fields[server]=name,ip,port&filter[game]=arma3\"), true);\n\n // Make sure theres something to return\n if(!empty($SERVERINFO)) {\n \n // Return the server id\n return $SERVERINFO['data']['0']['id'];\n\n } else {\n \n // Empty table\n \n return 'API Error';\n \n }\n \n}", "function loadServer($db, $file)\n{\n if ((int) $file['serverId'])\n {\n // load from the db\n $db = dbConnect();\n $stmt = $db->query(\"SELECT * FROM file_server WHERE id = \" . (int) $file['serverId']);\n $uploadServerDetails = $stmt->fetch(PDO::FETCH_ASSOC);\n if (!$uploadServerDetails)\n {\n return false;\n }\n\n return $uploadServerDetails;\n }\n\n return false;\n}", "function GetServerId($ServerIP, $ServerName) {\n \n // Servers are all on the same box which makes this function useless for the time being\n // Problem with this function is that it's a guessing game on what the api will return even with the exact ip it may\n // return the wrong json table for a different server. It's weird.\n \n // Battlemetrics Function\n \n // Request and decode the returned json table\n $SERVERINFO = json_decode(file_get_contents(\"https://api.battlemetrics.com/servers?filter[search]={$ServerIP}&fields[server]=name,ip,port&filter[game]=arma3\"), true);\n \n // Check to make sure there isnt a mismatch\n if(GetServerIdByName($ServerName) != $SERVERINFO['data']['0']['id']) {\n \n // Different, api issue\n return 'API Error';\n \n } else {\n \n // Return the server id\n return $SERVERINFO['data']['0']['id'];\n \n }\n \n // Depreciated function\n \n}", "protected function getServerPidPath()\n {\n return config('swoole_http.server.options.pid_file');\n }", "function getDirectFileServerSSHDetails($serverId)\n{\n\t$directFileServers = unserialize(DIRECT_FILE_SERVER_DETAILS);\n\tif(COUNT($directFileServers) == 0)\n\t{\n\t\treturn false;\n\t}\n\t\n\tforeach($directFileServers AS $directFileServer)\n\t{\n\t\tif($directFileServer['file_server_id'] == $serverId)\n\t\t{\n\t\t\treturn $directFileServer;\n\t\t}\n\t}\n\t\n\treturn false;\n}", "private function getAmavisServerId(string $amavisServerName) : int {\n $amavisServerModel = new AmavisServerModel();\n $id = $amavisServerModel->querySpecific($amavisServerModel->getKeyName(), [\n [ \"name\", $amavisServerName ]\n ], true);\n\n // If Amavis server not found in database with its name, throw exception\n if (!$id)\n throw new ExtendedException(\"Amavis server with the name '$amavisServerName' not found in the \" .\n \"database\");\n\n // Return the found id\n return (int) $id;\n }", "function get_segment_id() : string {\n\tif ( defined( 'ALTIS_SEGMENT_ID' ) ) {\n\t\treturn ALTIS_SEGMENT_ID;\n\t}\n\treturn SEGMENT_ID;\n}", "public function getImageid()\n {\n return $this->imageid;\n }", "public function getPartnerID(){\n\t\ttry {\n\t\t\t$fileContents = parse_ini_file(\"editableFiles/configFile.ini\");\n\t\t\treturn $fileContents[\"partnerID\"];\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "function getImageId();", "public function getFileId(string $user, string $spaceName, string $fileName): string {\n\t\t$fileData = $this->getFileData($user, $spaceName, $fileName)->getHeaders();\n\t\treturn $fileData[\"Oc-Fileid\"][0];\n\t}", "static public function getServerStatus() {\n\t\treturn (int)self::$serverstatus;\n\t}", "public static function get_uploaded_file_name(){\n\t\tif(isset($_FILES['localfile']['name'])){\n\t\t\treturn $_FILES['localfile']['name'];\n\t\t}\n\t}", "private function getStreamStatusCode(string $serverResponseFile): int\n {\n $data = $this->getStream($serverResponseFile);\n return $data['statuscode'];\n }", "public static function xms_upload_id(){\r\n\t $type = \"account_details\"; \r\n\t include 'inc/customer-id-uploader.php';\r\n\r\n\t}", "protected function getServer(string $signature): string\n {\n if (\n preg_match(\n '/(apache\\/\\d+\\.\\d+)|(nginx\\/\\d+\\.\\d+)|(iis\\/\\d+\\.\\d+)'\n . '|(lighttpd\\/\\d+\\.\\d+)/i',\n $signature,\n $matches\n )\n ) {\n return $matches[0];\n }\n\n return 'UNKNOWN';\n }", "public function getImageId()\n {\n return $this->imageid;\n }" ]
[ "0.63421696", "0.6261758", "0.6160128", "0.6069207", "0.59595233", "0.5853729", "0.57410467", "0.5732909", "0.5728174", "0.56925696", "0.56085026", "0.55058634", "0.5450792", "0.5401768", "0.5387243", "0.53725463", "0.5353267", "0.5282996", "0.52827674", "0.52593", "0.52435786", "0.5235791", "0.5234962", "0.5231931", "0.52317655", "0.52305925", "0.52124506", "0.5205156", "0.519952", "0.51935464" ]
0.6524757
0
Returns an array for url creation by removing the param keys specified in $remove url order :group/:subgroup/:category/:subcategory/:brand/:collection
public function myurl($params = false, $remove = array(), $add = array()) { $url = array(); if ($params) { if (isset($params['group']) && !in_array('group', $remove)) { $url['group'] = $this->slug($params['group']); } if (in_array('group', $remove)) { unset($url['group']); } if (array_key_exists('group', $add)) { $url['group'] = $this->slug($add['group']); unset($add['group']); } if (isset($params['subgroup']) && !in_array('subgroup', $remove)) { $url['subgroup'] = $this->slug($params['subgroup']); } if (in_array('subgroup', $remove)) { unset($url['subgroup']); } if (array_key_exists('subgroup', $add)) { $url['subgroup'] = $this->slug($add['subgroup']); unset($add['subgroup']); } if (isset($params['category']) && !in_array('category', $remove)) { $url['category'] = $this->slug($params['category']); } if (in_array('category', $remove)) { unset($url['category']); } if (array_key_exists('category', $add)) { $url['category'] = $this->slug($add['category']); unset($add['category']); } if (isset($params['subcategory']) && !in_array('subcategory', $remove)) { $url['subcategory'] = $this->slug($params['subcategory']); } if (in_array('subcategory', $remove)) { unset($url['subcategory']); } if (array_key_exists('subcategory', $add)) { $url['subcategory'] = $this->slug($add['subcategory']); unset($add['subcategory']); } if (isset($params['brand']) && !in_array('brand', $remove)) { $url['brand'] = $this->slug($params['brand']); } if (in_array('brand', $remove)) { unset($url['brand']); } if (array_key_exists('brand', $add)) { $url['brand'] = $this->slug($add['brand']); unset($add['brand']); } if (isset($params['collection']) && !in_array('collection', $remove)) { $url['collection'] = $this->slug($params['collection']); } if (in_array('collection', $remove)) { unset($url['collection']); } if (array_key_exists('collection', $add)) { $url['collection'] = $this->slug($add['collection']); unset($add['collection']); } $url = $url+$add; } return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRemoveUrl()\n {\n\n $request = $this->request;\n $currentValue = $this->getValue();\n $requestValue = $this->getFilter()->getRequestVar();\n\t $requestParam = $request->getParam($requestValue);\n\t $params = $request->getParams();\n unset($params['p']);\n $request->setParams($params);\n\t if(isset($requestParam)){\n\t // make requestParam to be an array if it is not null\n $requestParam = is_array($requestParam)?$requestParam:[$requestParam];\n $currentValue = is_array($currentValue)?$currentValue:[$currentValue];\n // consider the last id of currentValue to be the current attribute id\n $currentParam = [end($currentValue)];\n // compute the difference of the request against 2 arrays, and use the difference to be remove url\n $removeValue = array_diff($requestParam,$currentParam);\n $query = [$this->getFilter()->getRequestVar() => $removeValue];\n $params['_current'] = true;\n $params['_use_rewrite'] = true;\n $params['_query'] = $query;\n $params['_escape'] = true;\n return $this->_url->getUrl('*/*/*', $params);\n }else{\n\t return parent::getRemoveUrl();\n }\n }", "function removeURLQuery($query){\n\t\tif(is_array($query)){\n\t\t\tforeach ($query as $v){\n\t\t\t\tremoveURLQuery($v);\n\t\t\t}\n\t\t}\n\t\t$get = $_GET;\n\t\tif(array_key_exists($query, $get)) {\n\t\t\tunset($get[$query]);\n\t\t} \n\t\treturn $get;\n\t}", "function website_remove($fields){\n\n\tif(isset($fields['url']))\n\tunset($fields['url']);\n\n\treturn $fields;\n}", "public function removeParameters()\n {\n return [\n 'collection' => $this->collection->cart_name,\n 'id' => $this->cart_hash\n ];\n }", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }", "protected function getExcludedURLSegments()\n {\n $excludes = [];\n\n // Build from rules\n foreach (Director::config()->get('rules') as $pattern => $rule) {\n $route = explode('/', $pattern ?? '');\n if (!empty($route) && strpos($route[0] ?? '', '$') === false) {\n $excludes[] = strtolower($route[0] ?? '');\n }\n }\n\n // Build from base folders\n foreach (glob(Director::publicFolder() . '/*', GLOB_ONLYDIR) as $folder) {\n $excludes[] = strtolower(basename($folder ?? ''));\n }\n\n $this->extend('updateExcludedURLSegments', $excludes);\n return $excludes;\n }", "public function without(array $args): UrlManipulatorInterface;", "function rebuild($to_unset=\"block\"){\n\t\t\tglobal $_GET;\n\t\t\tunset($_GET[$to_unset]);\n\t\t\t\t\n\t\t\t$glue = \"?\";\n\t\t\treset($_GET);\n\t\t\twhile(list($key,$val)=each($_GET)){\n\t\t\t\t$val = str_replace(\" \",\"%20\",$val);\n\t\t\t\t$glue .= $key . \"=\" . $val . \"&\";\n\t\t\t}\n\t\t\treturn $glue;\n\t\t}", "public function prep_url_array($array,$unset = 0){\n for($i = 0; $i < $unset; $i++){\n unset($array[$i]);\n }\n return implode($array, '/');\n }", "private function getUrls() {\n\t\t// reassign the array because of a php bug (solved later with php 5.2.x @see: http://bugs.php.net/39449)\n\t\t$arr = $this->formData;\n\n\t\t// build bas URL for replacement variables\n\t\t$protocol\t= 'http'\n . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ? 's' : '' )\n . '://';\n\t\t$url\t\t= $_SERVER['HTTP_HOST'] . dirname( $_SERVER['PHP_SELF'] ) . '/';\n $url = str_replace( '//', '/', $url ); // some server add 2 /\n $url = $protocol . $url . 'index.php?route=payment/directebanking/';\n\n\t\tif( $this->_param['successUrlStd'] ) {\n\t\t\t$arr['user_variable_0'] = $url . 'success'\n\t\t\t. '&transaction=-TRANSACTION-&security_criteria=-SECURITY_CRITERIA-'\n\t\t\t. '&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['successUrl'] ) {\n\t\t\t\t$arr['user_variable_0'] = $this->_param['successUrl'];\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_param['cancelUrlStd'] ) {\n\t\t\t$arr['user_variable_1'] = $url . 'cancel'\n\t\t\t. '&transaction=-TRANSACTION-&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['cancelUrl'] ) {\n\t\t\t\t$arr['user_variable_1'] = $this->_param['cancelUrl'];\n\t\t\t}\n\t\t}\n\n\t\t// and reassign again\n\t\t$this->formData = $arr;\n\n\t\tunset( $arr );\n\t}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }", "public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }", "static public function getUrlArray()\n {\n \tstatic $url_array = NULL;\n \tif( is_null( $url_array ) ) {\n\t\t\t$url_array = explode( '/', ltrim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ) );\n\t\t\tforeach( $url_array as &$url_part ) {\n\t\t\t\t$url_part = ( $url_part !== \"\" ) ? strtolower( $url_part ) : \"index\";\n\t\t\t}\n\t\t}\n\t\treturn $url_array;\n }", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "public function getRemoveUrl()\n {\n if (!$this->helper()->isEnabled()) {\n return parent::getRemoveUrl();\n }\n\n $values = $this->getFilter()->getValues();\n if (!empty($values)) {\n $tmp = array_diff($values, array($this->getValue()));\n if (!empty($tmp)) {\n $values = implode(Catalin_SEO_Helper_Data::MULTIPLE_FILTERS_DELIMITER, $tmp);\n } else {\n $values = null;\n }\n } else {\n $values = null;\n }\n if ($this->helper()->isCatalogSearch()) {\n $query = array(\n 'isLayerAjax' => null,\n $this->getFilter()->getRequestVar() => $values\n );\n $params['_current'] = true;\n $params['_use_rewrite'] = true;\n $params['_query'] = $query;\n $params['_escape'] = true;\n return Mage::getUrl('*/*/*', $params);\n }\n\n return $this->helper()->getFilterUrl(array(\n $this->getFilter()->getRequestVar() => $values\n ));\n }", "public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }", "private static function filter_params($path){\n\t\tforeach($path as $key => $value){\n\t\t\tif(strpos($path[$key],\"?\") !== false) $path[$key] = substr($path[$key],0,strpos($path[$key],\"?\"));\n\t\t\tif(empty($path[$key])){ \n\t\t\t\tunset($path[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}", "private function cleanRequestURI()\r\n\t{\r\n\t\tfor ($i = 0; $i < sizeof($this->scriptPath); $i++)\r\n\t\t{\r\n\t\t\tif ($this->explodedURI[$i] == $this->scriptPath[$i])\r\n\t\t\t{\r\n\t\t\t\tunset($this->explodedURI[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->explodedURI = array_values($this->explodedURI);\r\n\t}", "public function getUrlParts() {\n\t\treturn $this->_urlParts;\n\t}", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$out = new CMS_Navigation3_LinkSet();\n\t\tforeach($this->links as $link) {\n\t\t\t$valid = true;\n\t\t\tforeach($args as $arg) {\n\t\t\t\tif (is_string($arg)&&$arg[0]=='!') {\n\t\t\t\t\t$arg = substr($arg,1);\n\t\t\t\t\tif ($link[$arg]) $valid = false;\n\t\t\t\t}\n\t\t\t\telse if (!$link[$arg]) $valid = false;\n\t\t\t}\t\n\t\t\tif ($valid) $out->links[] = $link;\n\t\t}\n\t\treturn $out;\n\t}", "function cleanQueryString(&$request){\n\tdelParam($request, 'pag');\n\tdelParam($request, 'first');\n\tdelParam($request, 'previous');\n\tdelParam($request, 'next');\n\tdelParam($request, 'last');\n\tdelParam($request, 'reload');\n\tdelParam($request, 'numpags');\n\tdelParam($request, 'regspag');\n}", "private function prepareRuta(){\n\t\t$this->uriArray = array_slice(explode('/',$this->uri), $this->webPathNumber,3);\n\t}", "function remove_website_field($fields) {\n unset($fields['url']);\n return $fields;\n}", "private function __parseUrl()\n {\n if (isset($_GET['url'])) {\n return explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n return [];\n }", "public function implodeArrayForUrlDataProvider() {}", "public static function Zf_URLSanitize() {\n\n /**\n * IF A URL HAS BEEN SET, GET IT FOR SANITIZATION\n */\n $zf_url = isset($_GET['url']) ? $_GET['url'] : null;\n\n\n /**\n * REMOVE THE LAST FORWARD SLASH \"/\" FROM THE URL\n */\n $zf_url = rtrim($zf_url, '/');\n\n\n /**\n * FILTER THE URL TO ONLY REMAIN WITH CLEAN URL\n */\n $zf_url = filter_var($zf_url, FILTER_SANITIZE_URL);\n\n\n /**\n * SPLIT THE URL, WITH \"/\" AS THE DELIMITER WHILE RETURNING EACH PART INTO\n * AN ARRAY\n */\n $zf_url = explode('/', $zf_url);\n\n //print_r($zf_url); echo \"<br><br>\"; //This is strictly for debugging purposes.\n\n\n /**\n * RETURNS AN ARRAY OF THE URL PARTS.\n */\n return $zf_url;\n }", "public function unset_url_field( $fields )\n {\n if( isset( $fields['url'] ) )\n {\n unset( $fields['url'] );\n }\n\n return $fields;\n }", "public function get_url(): array\n {\n // get the full url as an array\n $url['raw'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $url['array'] = explode(\"/\", $url['raw']);\n\n // shift the array to remove the first useless array key and remove blank values\n array_shift($url['array']);\n $url['array'] = array_filter($url['array']);\n\n // return the url array\n return $url['array'];\n }" ]
[ "0.61178637", "0.58263034", "0.573169", "0.572638", "0.571529", "0.5707904", "0.5652515", "0.5633659", "0.55258554", "0.54325134", "0.54228973", "0.53892183", "0.5384605", "0.53122115", "0.53054714", "0.52926445", "0.52917844", "0.52780443", "0.5230323", "0.5212442", "0.5183329", "0.515971", "0.5153716", "0.51396936", "0.5131296", "0.5100569", "0.50912446", "0.5089742", "0.5087059", "0.5083419" ]
0.60047626
1
$serviceAccount = ServiceAccount::fromJsonFile(__DIR__.'/secret/sapiadvertiser35f0fa96e6598d2d9.json'); $firebase = (new Factory) >withServiceAccount($serviceAccount) >create();
public function __construct(){ $acc = ServiceAccount::fromJsonFile('C:/xampp/htdocs/webshop2/secret/sapiadvertiser-35f0f-a96e6598d2d9.json'); $firebase = (new Factory)->withServiceAccount($acc)->create(); $this->database = $firebase->getDatabase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($google_service_account_json = \"\")\n {\n if ($google_service_account_json == \"\") $google_service_account_json = __ROOT__ . '/google-service-account.json';\n $serviceAccount = ServiceAccount::fromJsonFile($google_service_account_json);\n\n $this->firebase = (new Factory)\n ->withServiceAccount($serviceAccount)\n ->create();\n\n $this->database = $this->firebase->getDatabase();\n }", "function __construct()\n {\n parent::__construct();\n\n $serviceAccount = ServiceAccount::fromJsonFile(APPPATH .'libraries/vendor/kreait/firebase_credentials.json');\n $this->firebase = (new Factory)\n ->withServiceAccount($serviceAccount)\n ->create();\n\n $this->database = $this->firebase->getDatabase();\n \n }", "function __construct()\n {\n parent::__construct();\n $serviceAccount = ServiceAccount::fromJsonFile(APPPATH .'libraries/vendor/kreait/firebase_credentials.json');\n $this->firebase = (new Factory)\n ->withServiceAccount($serviceAccount)\n ->create();\n\n $this->database = $this->firebase->getDatabase();\n }", "public function __construct()\n {\n $this->middleware('auth');\n\n $this->serviceAccount = ServiceAccount::fromJsonFile(__DIR__ . '/firebase_credentials.json');\n $this->firebase = (new Factory)\n ->withServiceAccount($this->serviceAccount)\n ->create();\n\n $this->database = $this->firebase->getDatabase();\n\n $this->reference = $this->database->getReference('venues');\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n $this->firebase = new \\Firebase\\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN); //load firebase engine\r\n }", "public function __construct()\n {\n $config = array(\n \"type\"=> \"service_account\",\n \"project_id\"=> \"driverapp-master-bb0a8\",\n \"private_key_id\"=> \"5133dcc7296c8d6c3c5344f2442ac8108958e788\",\n \"private_key\"=> \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJxY02bLvVQMRN\\nSQRwQNjjzzYKx3CTvb418mmg60TYiFCjx8U9EO4JrqtEl6rbttKC55gYD7TTUH3c\\nPQMfhKybk4wEBRYFDtNAVNVlQW+W3EzqoN2sXxCaDbr644CAGW40GIq+MSo+HGxU\\n13TifJ4FB3lCj2xSLY7XtaUAiyCZ9AiW/wlFd5GuF+gjIagkb2kPGuocg9WM1qvs\\nWTDxtIcubnmQXz2xOATnIS1c9s4oNcI7DxfdTxSzB9AZ0bZUvTF+OzEGIz3gARqq\\nlqDyE+LejdBtm18q0uHFSRKrtmfRnr8GWpe1QpoKIZ/kTEKpdlUYGUC97mZFjo7S\\nify8LrV/AgMBAAECggEAGn5/v+VANszV2eYcGJdTQ3qaeIjere+s0c2edBxggmRH\\n3nGlYxLdhtTyNUQLEeWsN7csYABz+IlptWknh1R3C8iwiniWfxyGvbxF9xFEE1Wj\\nHe34naEv/2KNKlOENI3iTCHq2fV/u/8kdHGELhc58qQcFpLZoOLNjmKSI4OhSMWo\\nSS0s6pHF56H3cixgueCTwTAzURcIdvzfFo2PE0QrPbTEoC+0AA+hvfBTtS/Zf94A\\nulg5Eh6TBC1Qzjt6EyuVJ/HldmCRG97XUUY09q99szWmVLO1ANulYlCuRLGeTtlf\\nLWW1YRYJIWJfVVa8vnosl/HAWtt8FKPqJxV2SatobQKBgQDkVeEDiOpZm7ox3zqj\\nbFVv7rTLSjq9hZHk6Gh77oaxnOlmH4gih8mGh/z5Qyi4R9y5zXeOJHuJg72mnqsK\\nGEMZ5nVPpKwRE4N1mSPw0Y/uVeNmyVDhWFmdu9XIpj49XAGMXr54kLjQSZ1IoueE\\nB0WZ7cAxKYu5TzgTnIgQev4BZQKBgQDiN8M2bWpLj0xhlQvlA74e+Ti5YrQkVCiH\\nbi6vIJ9p2mc2qg0ysymxAFiWDAtvnvIhXJ83MI81IUSwWBWLHzMluPh8No10/DVw\\nlqkiqV/YEtJg4qCucar7qQEJsbODjpFQBfXZemE8DD3Q1LhwemOwI94K0Q/nCtWp\\ndHX9eZ3/EwKBgH7B5h5uPZrtRpo1EHp0w6FV5OwOEznvEqT/GDHkosWrFC7rRknV\\nE90pVRiTXeGfkztagwpX2nTmu7vpzY3XFjkkpO9HvXXlXU9Fapxf2gU3jPwcule/\\nElDsW6v+DgNGNl3UouyPeum2VChktx2mY88mG1GvfK+s+LZ6aVas0KG5AoGBAJtn\\nr2XOmL07vj8zQy6a+ZsRntRMaHCkmAshuFR61sjDTzCQdeykhDmigTjjIWAXE0Oz\\n+3TQmTDon+V9PZ+LWXnKrnm2iEsbkCK+fYbgUIWBuKDyT2xHjizAl4PvXeE8qbsN\\nvS0gE3hK+JRj7ijnC2DP4xQPNxuDp/B3ny74w3+dAoGBALjSMp+8nOxWE2sco4wS\\nIzOprQ10K54naiy6xx6VsNamaqe9r4KiXXT9qpSjfCg3yMD5swtWVIcwwk0VM8J3\\nj/8sgwfGCepyzcmXxZKqmJmfHlxr6Hd+/AA4Nm/MEbeWG+o3eMmZ4LzSS0sSH/fC\\nO+f511UqvJxT2UvDVRtJcO70\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\"=> \"[email protected]\",\n \"client_id\"=> \"117555270648372527156\",\n \"auth_uri\"=> \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\"=> \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\"=> \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\"=> \"https://www.googleapis.com/robot/v1/metadata/x509/driverapp-master-bb0a8%40appspot.gserviceaccount.com\"\n );\n\n\n $serviceAccount = ServiceAccount::fromArray($config);\n\n $firebase = (new Factory())\n ->withServiceAccount($serviceAccount)\n ->create();\n\n\n $this->database = $firebase->getDatabase();\n $this->middleware('guest');\n }", "public static function create(string $token): FirebaseBuilder\n {\n return new FirebaseBuilder($token);\n }", "public function __construct()\n {\n $this->firebase = new FirebaseLib(config('firebase.url'), config('firebase.database_secret'));\n parent::__construct();\n }", "public function __construct(EntityManager $entityManager)\n {\n $serviceAccount = ServiceAccount::fromJsonFile(__DIR__.\"/google-service.json\");\n $firebase = (new Factory)\n ->withServiceAccount($serviceAccount)\n ->create();\n $this->message = $firebase->getMessaging();\n\n $this->em = $entityManager;\n\n }", "function initializeAnalytics()\n{\n $KEY_FILE_LOCATION= __DIR__ . '/key_540635147.json';\n $client = new Google_Client();\n $client->setAuthConfig($KEY_FILE_LOCATION);\n $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']);\n $analytics = new Google_Service_Analytics ($client);\n \n return $analytics;\n}", "public function createFSService();", "public static function firebase($serviceAccount = null, bool $getShared = true): Firebase\n {\n if ($getShared) {\n return static::getSharedInstance('firebase', $serviceAccount);\n }\n\n return new Firebase($serviceAccount);\n }", "public function register()\n {\n $this->app->bind(Firebase::class, function () {\n $serviceAccount = Firebase\\ServiceAccount::fromJsonFile(base_path('firebase-admin.json'));\n return (new Factory())->withServiceAccount($serviceAccount)->create();\n });\n }", "function __create_auth_token($email, $password, $account_type, $service) {\n\n return new AuthToken($email, $password, $account_type, $service);\n\n}", "public function creating(Service $Service)\n {\n //code...\n }", "private function PushUsersDataToFireBase($data_to_save){\n $serviceAccount = ServiceAccount::fromJsonFile(APP_PATH.'/firebase/firebase.json');\n $apikey='AIzaSyB7tE9inqqAXZudqpw_4K17RUCswb_AU-o';\n try {\n $firebase = (new Factory)\n ->withServiceAccountAndApiKey($serviceAccount, $apikey)\n ->withDatabaseUri('https://tweetify-app.firebaseio.com/')\n ->create();\n $database = $firebase->getDatabase();\n $newPost = $database->getReference('top_users')->push($data_to_save);\n $message = \"Users Data successfuly uploaded\";\n return $message;\n \n } catch (\\Exception $e) {\n $meessage = 'Users Data failed to upload';\n return $message; \n }\n\n }", "public function callback(SocialGoogleAccountService $service)\n {\n $user = $service->createOrGetUser(Socialite::driver('google')->stateless()->user());\n \n // return $user;\n auth()->login($user);\n $token = $user->createToken('InvoiceAmigo')->accessToken;\n return response()->json(\n [\n 'name' => $user->name,\n 'email' => $user->email,\n 'token' => $token\n ],\n 200\n );\n // return redirect()->to('/dash');\n }", "public function create_service(array $credential=[]){\n \n if(!$credential) {\n $credential = \\Drupal::service('ml_engine.project')->get_credential();\n }\n $client = new \\Google_Client();\n $client->setAuthConfig($credential);\n $client->addScope(\\Google_Service_CloudMachineLearningEngine::CLOUD_PLATFORM);\n $service = new \\Google_Service_CloudMachineLearningEngine($client);\n return $service;\n }", "function createNewSFObject( $firebaseUid, $sfUrl, $sfData, $contactIDFieldName = false ) {\n // Get the ID of the Contact entry in salesforce\n return getSalesforceContactID( $firebaseUid )->then( function($contactID) use ($sfUrl, $sfData, $contactIDFieldName) {\n // we've now verified that the user has a valid Contact ID in salesforce\n if ( $contactIDFieldName ) {\n $sfData[$contactIDFieldName] = $contactID;\n }\n // create a new object in salesforce\n return makeSalesforceRequestWithTokenExpirationCheck( function() use ($sfUrl, $sfData) {\n return salesforceAPIPostAsync( $sfUrl, $sfData );\n });\n });\n}", "function getSpecialRegistrationCodes() {\n // authenticate as the firebase service account\n global $gServiceAccountCredentialsFilepath;\n $firebaseServiceAccount = Firebase\\ServiceAccount::fromJsonFile( $gServiceAccountCredentialsFilepath );\n $firebase = (new Firebase\\Factory)->withServiceAccount( $firebaseServiceAccount )->create();\n $fireDatabase = $firebase->getDatabase();\n $regCodes = $fireDatabase->getReference( 'registration-codes' )->getValue();\n return $regCodes;\n}", "public function run()\n {\n BotAccount::create([\n \t'name' => 'studioapi',\n\t\t\t'password' => '7411328'\n\t\t]);\n }", "public function run()\n {\n factory(OauthClient::class,1)->create();\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createSecret()\n\t{\n\t\treturn $this->secret = (new GoogleAuthenticator())->generateSecret();\n\t}", "public function testCreateService()\n {\n\n }", "public function __construct()\n {\n $this->apiKey = '66122f8ad1adb1c075c75aba3bd503a4a559fc7f';\n }", "public function createCustomToken($uid, array $claims = []);", "public function run()\n {\n factory(OauthClients::class,10)->create();\n }" ]
[ "0.71198434", "0.6965754", "0.68609", "0.633406", "0.5899414", "0.5834478", "0.55554855", "0.55112994", "0.529052", "0.5237222", "0.5219354", "0.5215776", "0.5215045", "0.51095456", "0.5036485", "0.4962875", "0.49497533", "0.49088746", "0.48876867", "0.4859508", "0.48265827", "0.48240268", "0.48201752", "0.48201752", "0.48201752", "0.47898778", "0.4748581", "0.47481033", "0.47249144", "0.4722434" ]
0.79872364
0
Default behavior for destructor. Rollback any pending transaction block. If a class using this trait has a userdefined destructor, the content of this method should be added to it.
public function __destruct() { $this->endTransactions(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __destruct() {\n $this->commit();\n }", "public function __destruct()\n {\n $this->commit();\n }", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function rollBack()\n {\n if ($this->hasActiveTransaction) {\n parent::rollback();\n $this->hasActiveTransaction = false;\n }\n }", "public function commitTransaction() {\n\t\t//noop\n\t}", "public function __destruct() {\n\t\tif ( $this->mTrxLevel && $this->mTrxDoneWrites ) {\n\t\t\ttrigger_error( \"Uncommitted DB writes (transaction from {$this->mTrxFname}).\" );\n\t\t}\n\t\tif ( count( $this->mTrxIdleCallbacks ) || count( $this->mTrxPreCommitCallbacks ) ) {\n\t\t\t$callers = array();\n\t\t\tforeach ( $this->mTrxIdleCallbacks as $callbackInfo ) {\n\t\t\t\t$callers[] = $callbackInfo[1];\n\t\t\t}\n\t\t\t$callers = implode( ', ', $callers );\n\t\t\ttrigger_error( \"DB transaction callbacks still pending (from $callers).\" );\n\t\t}\n\t}", "public function rollbackTransaction(): void;", "public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}", "public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }", "public function __destruct()\n {\n $this->flush();\n }", "public function rollBack()\n\t{\n\t\t$this->c->rollBack();\n\t}", "protected function rollBackTransaction()\n {\n $this->container->make('db')->rollBack();\n }", "public function rollbackTransaction();", "public abstract function rollback();", "public function transactionCommit()\n\t{\n\t\treturn;\n\t}", "public function __destruct()\n\t{\n\t\t$this->forceSave();\n\t}", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "public function __destruct() {\n $this->persist();\n }", "public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "function __destruct()\n {\n $this->entityManager->flush();\n }", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "public function __destruct()\n {\n $this->save();\n }", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();" ]
[ "0.6572504", "0.6566978", "0.6219764", "0.61066717", "0.608447", "0.600847", "0.59553725", "0.5896186", "0.58586806", "0.5844222", "0.58390504", "0.58261055", "0.5800223", "0.579103", "0.57793057", "0.57744974", "0.5766416", "0.5749363", "0.5720321", "0.57106066", "0.5705559", "0.5675202", "0.5675202", "0.56704724", "0.56704724", "0.5669501", "0.5638928", "0.5638928", "0.5638928", "0.5638928" ]
0.66240156
0
Define the TransactionBlockInterface factory
private function setTransactionBlockFactory($callable) { $this->blockFactory = $callable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public static function createBlock($block){\n $fileClass = self::getConfig()->path->path_modules.'/'.self::getPathModule().'/block/'.ucfirst($block).self::getConfig()->path->ext_file;\n if(file_exists($fileClass)){\n\n $block = str_replace('/', '\\\\', self::getPathModule().'/block/'.ucfirst($block));\n $obj = new $block();\n return $obj;\n\n }\n\n }", "public function createTransaction()\n {\n }", "public static function init()\n\t{\n\t\treturn new BlockManager();\n\t}", "public static function createCMSBlockTable()\n\t{\n\t}", "public function getTransactionFactory()\n {\n return $this->transactionFactory;\n }", "public function __construct(Block $block)\n {\n $this->block = $block;\n }", "public function create()/*# : CreateInterface */;", "abstract public function createContract(): ProviderCustomer;", "public function __construct(TransactionInterface $transaction)\n\t{\n $this->transaction = $transaction;\n }", "public function transaction(): Transaction\n {\n return Factory::factory('DatabaseTransaction', null, $this);\n }", "function block_instance($blockname, $instance = NULL) {\n if(!block_load_class($blockname)) {\n return false;\n }\n $classname = 'CourseBlock_'.$blockname;\n $retval = New $classname;\n if($instance !== NULL) {\n $retval->load_instance($instance);\n }\n return $retval;\n}", "public function register_blocks() {\n\t\tif ( function_exists( 'register_block_type' ) ) {\n\t\t\tregister_block_type(\n\t\t\t\t\"civil/{$this->slug}\",\n\t\t\t\t[\n\t\t\t\t\t'editor_script' => 'block-js-' . $this->slug,\n\t\t\t\t\t'render_callback' => function( array $attributes ) {\n\t\t\t\t\t\treturn $this->render_block_data( $attributes );\n\t\t\t\t\t},\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'title' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Title', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Description', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_button_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Button', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter' => [\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter_list' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function createACFBlock()\n {\n if (function_exists('acf_register_block_type')) {\n acf_register_block_type(\n array(\n 'name' => 'acfBlock',\n 'title' => __('ACF Block'),\n 'description' => __('A custom block that incorporates ACF fields.'),\n 'render_callback' => array($this, 'renderACFBlock'),\n 'category' => 'widgets',\n 'icon' => array('background' => '#ecf6f6', 'src' => 'email'),\n 'keywords' => array('example', 'acf'),\n 'mode' => 'edit'\n )\n );\n }\n }", "public function __construct($block, $available_context = array(), $registry = \\null)\n {\n }", "public function register_blocks() {\n\t\t}", "function createBlock( $block_index=null ){\n global $mysqli, $counterparty;\n $data = (object) $counterparty->execute('get_block_info', array('block_index' => $block_index));\n $data->block_hash_id = createTransaction($data->block_hash);\n $data->previous_block_hash_id = createTransaction($data->previous_block_hash);\n $data->ledger_hash_id = createTransaction($data->ledger_hash);\n $data->txlist_hash_id = createTransaction($data->txlist_hash);\n $data->messages_hash_id = createTransaction($data->messages_hash);\n $results = $mysqli->query(\"SELECT block_index FROM blocks WHERE block_index='{$data->block_index}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n $id = $row['id'];\n $sql = \"UPDATE blocks SET\n block_time = '{$data->block_time}',\n block_hash_id = '{$data->block_hash_id}',\n previous_block_hash_id = '{$data->previous_block_hash_id}',\n ledger_hash_id = '{$data->ledger_hash_id}',\n txlist_hash_id = '{$data->txlist_hash_id}',\n messages_hash_id = '{$data->messages_hash_id}',\n difficulty = '{$data->difficulty}'\n WHERE\n block_index='{$block_index}'\";\n $results = $mysqli->query($sql);\n if($results){\n return $id;\n } else {\n byeLog('Error while trying to update block ' . $data->block_index);\n }\n } else {\n // Grab data on the asset from api and set some values before stashing info in db\n $sql = \"INSERT INTO blocks (block_index, block_time, block_hash_id, previous_block_hash_id, ledger_hash_id, txlist_hash_id, messages_hash_id, difficulty) values (\n '{$data->block_index}',\n '{$data->block_time}',\n '{$data->block_hash_id}',\n '{$data->previous_block_hash_id}',\n '{$data->ledger_hash_id}',\n '{$data->txlist_hash_id}',\n '{$data->messages_hash_id}',\n '{$data->difficulty}')\";\n $results = $mysqli->query($sql);\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create block ' . $data->block_index);\n }\n }\n } else {\n byeLog('Error while trying to lookup record in blocks table');\n }\n}", "function pnCPG_blockblock_init()\n{\n // Security\n pnSecAddSchema('pnCPG:block:', 'Block title::');\n}", "public function createTransaction(\n OperationInterface ...$operations\n ): AcceptingTransactionInterface;", "function create_reporting_block($reporting_block)\r\n {\r\n return $this->create($reporting_block);\r\n }", "function __construct(BlockRepository $blockRepository)\n {\n $this->blockRepository = $blockRepository;\n }", "public function create($method, Simulation $simulation)\n {\n $qualifiedClassName = self::INTEGRATION_METHOD_NAMESPACE . $method;\n if (class_exists($qualifiedClassName)) {\n return new $qualifiedClassName($simulation);\n }\n throw new BlockNotFoundException(\"Nije pronađena implementacija datog bloka.\");\n }", "function register_block_core_block()\n {\n }", "function transaction_declarer_tables_interfaces($interface) {\n\t$interface['table_des_tables']['transaction'] = 'transaction';\n\n\treturn $interface;\n}", "public function fakeTransaction($transactionFields = [])\n {\n return new Transaction($this->fakeTransactionData($transactionFields));\n }", "public function getTransactionService();", "public static function create(string $name, SessionManagerInterface $sessionManager): SessionBlock\n {\n return new SessionBlock($name, $sessionManager);\n }", "function newFlowingBlock( $w, $h, $b = 0, $a = 'J', $f = 0 , $is_table = false )\n\t\t{\n\t\t if ($is_table) $this->flowingBlockAttr[ 'width' ] = ($w * $this->k);\n\t\t else $this->flowingBlockAttr[ 'width' ] = ($w * $this->k) - (2*$this->cMargin*$this->k);\n\t\t // line height in user units\n\t\t $this->flowingBlockAttr[ 'is_table' ] = $is_table;\n\t\t $this->flowingBlockAttr[ 'height' ] = $h;\n\t\t $this->flowingBlockAttr[ 'lineCount' ] = 0;\n\t\t $this->flowingBlockAttr[ 'border' ] = $b;\n\t\t $this->flowingBlockAttr[ 'align' ] = $a;\n\t\t $this->flowingBlockAttr[ 'fill' ] = $f;\n\t\t $this->flowingBlockAttr[ 'font' ] = array();\n\t\t $this->flowingBlockAttr[ 'content' ] = array();\n\t\t $this->flowingBlockAttr[ 'contentWidth' ] = 0;\n\t\t}", "public function __construct(EntityStorageInterface $block_content_storage) {\n $this->blockConfigStorage = $block_content_storage;\n }", "public function run()\n {\n \t$data = [\n \t\t'block_type_id' => 1,\n \t\t'description' => 'Esse é o primeiro bloco criado para o blockchain Creddent'\n \t];\n \t$lev = new levCoinClass;\n \t$lev->createBlock($data, true);\n }", "public function construct() {\n $this->initiate(\"skin_bank\");\n\n $code_bank = $this->bank_switch();\n\n return $code_bank;\n }" ]
[ "0.60445017", "0.5985993", "0.5942787", "0.5679155", "0.5660659", "0.554071", "0.54875296", "0.5453793", "0.54528445", "0.5448459", "0.5390541", "0.53656983", "0.53552055", "0.53537214", "0.53300446", "0.5313813", "0.530079", "0.52565986", "0.5230202", "0.52234083", "0.5217341", "0.5212398", "0.5210837", "0.51788735", "0.5178647", "0.51678896", "0.51638275", "0.51438934", "0.5121112", "0.51173985" ]
0.6589961
0
func _rules validasi form
private function _rules() { $this->form_validation->set_rules('nama', 'nama', 'trim|required', [ 'required' => 'Nama wisata tidak boleh kosong!' ]); $this->form_validation->set_rules('jenis_wisata', 'jenis wisata', 'trim|required', [ 'required' => 'Jenis wisata harus dipilih!' ]); $this->form_validation->set_rules('status', 'status', 'trim|required', [ 'required' => 'Status wisata harus dipilih!' ]); $this->form_validation->set_rules('harga', 'harga', 'trim|required|numeric', [ 'required' => 'Harga wisata harus diisi!', 'numeric' => 'Harga harus berupa angka!' ]); $this->form_validation->set_rules('tiket', 'tiket', 'trim|required|numeric', [ 'required' => 'Jumlah tiket harus diisi!', 'numeric' => 'Jumlah tiket harus angka!' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateRules();", "private function _rules()\n\t{\n\t\t$this->form_validation->set_rules('plate_number','plate_number','required',['required' => 'Plat Nomor Wajib Diisi']);\n\t\t$this->form_validation->set_rules('catId','Kategori/Kapasitas','required',['required' => '%s Wajib Diisi']);\n\t\t$this->form_validation->set_rules('brandId','Merek','required',['required' => '%s Wajib Diisi']);\n\t\t$this->form_validation->set_rules('active','active','required',['required' => 'Status Aktif Wajib Diisi']);\n\t}", "public function validation();", "public function _rules()\n\t{\n\t\t$this->form_validation->set_rules('nidn', 'nidn', 'trim|required');\n\t\t$this->form_validation->set_rules('nama_dosen', 'nama dosen', 'trim|required');\n\t\t$this->form_validation->set_rules('alamat', 'alamat', 'trim|required');\n\t\t$this->form_validation->set_rules('jenis_kelamin', 'jenis kelamin', 'trim|required');\n\t\t$this->form_validation->set_rules('email', 'email', 'trim|required');\n\t\t$this->form_validation->set_rules('telp', 'telp', 'trim|required');\n\n\t\t$this->form_validation->set_rules('id_dosen', 'id_dosen', 'trim');\n\t\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n\t}", "public abstract function validation();", "public function validasi()\n {\n $form = $this->setRules();\n $this->form_validation->set_rules($form);\n\n if ($this->form_validation->run()) {\n return TRUE;\n }else{\n return FALSE;\n }\n }", "public function validationRules() {\n\t\treturn [\t \n\t\t\t'nom'=>'required',\n\t\t\t'enonce'=>'required',\n\t\t\t'sur'=>'required'\n\t];\t\n\t}", "private function setRules()\n {\n $form = array(\n array(\n 'field' => 'nama_agen',\n 'label' => 'Nama Agen',\n 'rules' => 'required|max_length[25]'\n ),\n array(\n 'field' => 'alamat_agen',\n 'label' => 'Alamat Agen',\n 'rules' => 'max_length[50]'\n ),\n );\n return $form;\n }", "public function rules()\n {\n $validate = ['nombre' => 'required|min:7|max:50',\n \n 'representante_legal'=>'min:7|regex:/^[\\pL\\s\\-]+$/u|max:50',\n\n 'cargo' =>'min:5|regex:/^[\\pL\\s\\-]+$/u|max:50',\n \n 'comentario'=> 'min:15|max:280',\n\n 'logo'=> 'required',\n\n 'tipoevaluacion'=> 'required']; \n\n return $validate;\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function _rules()\n {\n $this->form_validation->set_rules('kodemerk', 'kode merk', 'trim|required');\n $this->form_validation->set_rules('namamerk', 'nama merk', 'trim|required');\n $this->form_validation->set_rules('kodemerk', 'kodemerk', 'trim');\n $this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n }", "function validarFormulario()\n\t\t{\n\t\t}", "public function validation()\n\t{\n\t\t$tim=$this->form_validation;\n\t \t$data_option = array(\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"name\",\n\t \t\t\t\"label\"=>\"Name\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"firstname\",\n\t \t\t\t\"label\"=>\"Firstname\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"lastname\",\n\t \t\t\t\"label\"=>\"Lastname\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n \"field\" => \"email\", \n \"label\" => \"Email\", \n \"rules\" => \"required|valid_email\"\n ),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"sex\",\n\t \t\t\t\"label\"=>\"Sex\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\t\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"id_card\",\n\t \t\t\t\"label\"=>\"ID_Card\",\n\t \t\t\t\"rules\"=>\"exact_length[13]\"\n\t \t\t),\n\t \t\t\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"fb_id\",\n\t \t\t\t\"label\"=>\"facebookid\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"name_fb\",\n\t \t\t\t\"label\"=>\"facebookname\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"usernameIG\",\n\t \t\t\t\"label\"=>\"intagramname\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"token\",\n\t \t\t\t\"label\"=>\"access_token\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t);\n\t \t$tim->set_rules($data_option);\n\t \t$tim->set_message(\"required\",\"กรุณากรอกข้อมูล %s\");\n\t \t$tim->set_message(\"alpha_numeric\",\"กรุณากรอกข้อมูล %s ให้ถูกต้อง \");\n\t \t$tim->set_message(\"exact_length\",\"กรุณากรอกตัวเลข 13 หลัก\");\n\t \t$tim->set_message(\"valid_email\",\"กรุณากรอก %s ให้ถูกต้อง\");\n\t}", "function ValidaCampos(){\n\t\t\n\t\t $this->form_validation->set_rules(\"id_clase\", \"Id_clase\", \"callback_select_clase\");\n\t\t $this->form_validation->set_rules(\"ofrenda_clase\", \"Ofrenda_clase\", \"trim|required\");\n\t\t $this->form_validation->set_rules(\"fecha_ofrenda\", \"Fecha_ofrenda\", \"trim|required\");\n\t\t \n\t}", "abstract public function validate();", "abstract public function validate();", "public function _rules() \n {\n\n\t$this->form_validation->set_rules('id_kalender', 'id_kalender', 'trim');\n\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n }", "private function form_validation_rules() {\n $this->form_validation->set_rules('nama', 'Nama Lengkap', 'required');\n $this->form_validation->set_rules('telepon', 'Telepon', 'required');\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('alamat', 'Alamat Lengkap', 'required');\n\n //set custom error message\n $this->form_validation->set_message('required', '%s tidak boleh kosong');\n }", "abstract protected function validationRules() : array;" ]
[ "0.77058625", "0.7540695", "0.7433044", "0.7409395", "0.72885334", "0.7214365", "0.71415466", "0.71223617", "0.7115848", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.7111083", "0.70962584", "0.7052723", "0.7035591", "0.7021367", "0.7006885", "0.7006885", "0.70026296", "0.695348", "0.69520974" ]
0.7579986
1
Loads all settings from db and triggers the event 'Settings.afterLoad' that can be listened to by plugins to further modify the settings. Structure: Array( 'PluginName|ScopeName' => Array( 'key1' => 'value1', ... ), ... ) Access via: Configure::read('Settings.ScopeName.key1');
protected function _loadSettings() { $settings = Cache::remember('settings', function () { /** @var SettingsTable $Settings */ $Settings = $this->loadModel('Wasabi/Core.Settings'); return $Settings->getAllKeyValues(); }, 'wasabi/core/longterm'); $event = new Event('Settings.afterLoad', $settings); $this->eventManager()->dispatch($event); if ($event->result !== null) { $settings = $event->result; } Configure::write('Settings', $settings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "private function load_site_settings() {\n\t\t\n\t\t$this->helper->load_editor_settings();\n\t\t$this->settings = array_merge($this->settings,$this->EE->session->cache['eeck']['eeck_settings']);\n\t}", "private function load_settings() {\n\t\t\n\t}", "public function load_settings()\r\n\t{\r\n\t\tif (!$this->_use_cache || !($this->_settings = $this->cache->get('settings')))\r\n\t\t{\r\n\t\t\t// Get settings from database\r\n\t\t\t$this->db->select('setting,value');\r\n\t\t\t$query = $this->db->get('settings');\r\n\r\n\t\t\tforeach ($query->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$this->_settings[$row->setting] = $row->value;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we want to cache the results\r\n\t\t\tif ($this->_use_cache)\r\n\t\t\t{\r\n\t\t\t\t$this->cache->save('settings', $this->_settings, $this->_cache_ttl);\r\n\t\t\t\t$this->_repopulated_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function loadSettings()\n {\n $this->loadJSON($this->settings);\n }", "protected function load_settings() {\n\t\t$this->settings = WP_United_Settings::Create();\n\t\t$this->init_style_keys();\n\t}", "public function settings_load() {\n\t\t\t// First restore settings feedback lost as $parent file is no more options-general.php\n\t\t\tadd_action( 'all_admin_notices', array( $this, 'restore_settings_feedback' ) );\n\n\t\t\t$this->is_plugin_settings = true;\n\t\t}", "function __loadConfig() {\n\t\t$area = $this->__determineArea();\n\t\tConfigure::write('Area', $area);\n\t\t$user = $this->User->findById($this->Session->read('Auth.User.id'));\n\t\tConfigure::write('User', $user['User']);\n\t}", "abstract protected function loadSettings();", "function LoadSettings()\n\t{\n\t\t$stash = IEM_InterspireStash::getInstance();\n\n\t\t/**\n\t\t * Trigger event\n\t\t */\n\t\t\t$tempEventData = new EventData_IEM_SETTINGSAPI_LOADSETTINGS();\n\t\t\t$tempEventData->data = $this;\n\t\t\t$tempEventData->trigger();\n\n\t\t\tunset($tempEventData);\n\t\t/**\n\t\t * -----\n\t\t */\n\n\t\t$areas = $this->Areas;\n\t\tunset($areas['config']);\n\t\tunset($areas['whitelabel']);\n\n\t\t// ----- Obtain the settings value either from the database OR from the stash (ie. cache)\n\t\t\tdo {\n\t\t\t\t// Check if the settings is available in our cache\n\t\t\t\tif ($stash->exists('IEM_SYSTEM_SETTINGS')) {\n\t\t\t\t\t$settings = $stash->read('IEM_SYSTEM_SETTINGS');\n\n\t\t\t\t\tif (!empty($settings) && is_array($settings)) {\n\t\t\t\t\t\tforeach ($settings as $area => $aravalue) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * TODO refactor\n\t\t\t\t\t\t\t * As it stands we are defining constants dynamically. This is a bad programming practice.\n\t\t\t\t\t\t\t * Once you have time, you might want to consider refactoring this code.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * As you may have notice, this is a duplicated code\n\t\t\t\t\t\t\t * (see the codes that fetches this value from database below).\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (!defined('SENDSTUDIO_' . $area)) {\n\t\t\t\t\t\t\t\tdefine('SENDSTUDIO_' . $area, $aravalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t\t// The settings cannot be found in stash cache,\n\t\t\t\t// so we will need to load it from database and put them in our cache\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t\t\t$result = $this->Db->Query(\"SELECT * FROM \" . SENDSTUDIO_TABLEPREFIX . \"config_settings\");\n\n\t\t\t\t\t$settings = array();\n\t\t\t\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t\t\t\t$area = $row['area'];\n\t\t\t\t\t\t// eh? How did a config setting get in the db without it being in the settings api??\n\t\t\t\t\t\tif (!in_array($area, $areas)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// this is for the 'upgrade' process - which moves them from the config file to being in the database.\n\t\t\t\t\t\tif (!defined('SENDSTUDIO_' . $area)) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @todo Remove hacks like these and refactor code that causes us to use these hacks!!!\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ($area == 'CRON_TRIGGEREMAILS_P' && $row['areavalue'] == '') {\n\t\t\t\t\t\t\t\t$row['areavalue'] = 1440;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * TODO refactor\n\t\t\t\t\t\t\t * As it stands we are defining constants dynamically. This is a bad programming practice.\n\t\t\t\t\t\t\t * Once you have time, you might want to consider refactoring this code.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tdefine('SENDSTUDIO_' . $area, $row['areavalue']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$k = array_search($area, $areas);\n\t\t\t\t\t\tunset($areas[$k]);\n\n\t\t\t\t\t\t$settings[$area] = $row['areavalue'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->Db->FreeResult($result);\n\n\n\n\t\t\t\t\t// Cache the settings\n\t\t\t\t\t$stash->write('IEM_SYSTEM_SETTINGS', $settings, true);\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t} while(false);\n\t\t// -----\n\n\n\t\t// ----- Default settings\n\t\t\t// \"Multiple unsubscribe\" feature\n\t\t\tif (!defined('SENDSTUDIO_USEMULTIPLEUNSUBSCRIBE')) {\n\t\t\t\tdefine('SENDSTUDIO_USEMULTIPLEUNSUBSCRIBE', 0);\n\t\t\t}\n\n\t\t\t// As a default you do not want contacts to be able to modify their own email\n\t\t\tif (!defined('SENDSTUDIO_CONTACTCANMODIFYEMAIL')) {\n\t\t\t\tdefine('SENDSTUDIO_CONTACTCANMODIFYEMAIL', '0');\n\t\t\t}\n\n\t\t\t// Number of seconds to sleep when login failed\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_WAIT')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_WAIT', 5);\n\t\t\t}\n\n\t\t\t// Number of attempts threshold\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_COUNT')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_COUNT', 5);\n\t\t\t}\n\n\t\t\t// Number of seconds that wrong login threshold is checking for\n\t\t\t// (ie. 5 failed log in attempts in 300 seconds)\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_DURATION')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_DURATION', 300);\n\t\t\t}\n\n\t\t\t// Ban duration\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_BAN_DURATION')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_BAN_DURATION', 300);\n\t\t\t}\n\n\t\t\t// Autoresponders takes credit\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_INCLUDE_AUTORESPONDERS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_INCLUDE_AUTORESPONDERS', 1);\n\t\t\t}\n\n\t\t\t// Trigger takes credit\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_INCLUDE_TRIGGERS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_INCLUDE_TRIGGERS', 1);\n\t\t\t}\n\n\t\t\t// Whether or not to enable credit warnings\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_WARNINGS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_WARNINGS', 1);\n\t\t\t}\n\n\t\t\t// Triggeremails_P is defaulted to run every 24 hours\n\t\t\tif (!defined('SENDSTUDIO_CRON_TRIGGEREMAILS_P')) {\n\t\t\t\tdefine('SENDSTUDIO_CRON_TRIGGEREMAILS_P', 1440);\n\t\t\t}\n\n\t\t\t// Maintenance will default to run once a day\n\t\t\tif (!defined('SENDSTUDIO_CRON_MAINTENANCE')) {\n\t\t\t\tdefine('SENDSTUDIO_CRON_MAINTENANCE', 1440);\n\t\t\t}\n\t\t// -----\n\n\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\t\t// There is an issue with MySQL database connection whereby most server had it's connection set to latin1\n\t\t// The problem lies when we defaulted our database to UTF8 and the application to use UTF8, non standard\n\t\t// English characters will be transformed to latin1, but stored as UTF8 in the database\n\t\t// See Issue 4807 in RedMine.\n\t\t//\n\t\t// A fix proved to be a bit difficult, assuming that there will be alot of people that were affected by this issue.\n\t\t// Once we set the characterset connection to UTF8, non-English characterset will be BROKEN.\n\t\t//\n\t\t// To make sure that only NEW installation uses this fix, the settings DATABASE_UTF8PATCH is introduced.\n\t\t// It will be set to 1 for newer install, but set to 0 for existing install.\n\t\t//\n\t\t// Once we work out the details for converting existing data out, we can safely remove this.\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\t\t\tif (!defined('SENDSTUDIO_DATABASE_UTF8PATCH')) {\n\t\t\t\tdefine('SENDSTUDIO_DATABASE_UTF8PATCH', '0');\n\t\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\n\n\t\t/**\n\t\t * Addons might define their own things.\n\t\t * To make everything work we need to go through the left over $areas items to define them.\n\t\t * If we don't do this, then we'd get errors when we try to view the settings page\n\t\t * as the option/variable would not be defined yet.\n\t\t *\n\t\t * Set them to null by default.\n\t\t */\n\t\tforeach ($areas as $area) {\n\t\t\t$name = 'SENDSTUDIO_' . $area;\n\t\t\tif (!defined($name)) {\n\t\t\t\tdefine($name, null);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Load the whitelabel settings\n\t\t */\n\t\t$this->LoadWhiteLabelSettings();\n\t\t/**\n\t\t * -----\n\t\t */\n\n\t\t$this->CheckCron();\n\t}", "public function load()\n {\n $this->settings = get_option($this->optionName);\n }", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "protected function loadSettingsIfNotLoaded()\n {\n if ( !$this->loaded ) {\n $this->settings = $this->load();\n $this->loaded = true;\n }\n }", "public static function loadSettingsAfterLogin() {\r\n\t\t//try to load from DB\r\n\t\t$settings=UserSettings::model()->findByAttributes(array('userId'=>Yii::app()->user->getId()));\r\n\t\t\r\n\t\tif(is_null($settings)) {\r\n\t\t\t//if there is nothing in DB, keep what is in session data, if anything is there\r\n\t\t\t$settings=Yii::app()->user->getState('settings');\r\n\t\t\t\r\n\t\t\t//else just use new\r\n\t\t\tif(is_null($settings)) {\r\n\t\t\t\t$settings=new UserSettings();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tYii::app()->user->setState('settings', $settings);\r\n\t}", "public function load() {\n\t\t$statement = $this -> db -> query(\"SELECT * FROM \" . FORUM_DB . \".forum_settings\");\n\t\twhile($settingData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> settings[$settingData['key']] = new ForumSetting($settingData['key'], $settingData['value']);\n\t\t}\n\t}", "private function loadSettings()\n {\n if ($this->settingsLoaded)\n {\n return;\n }\n\n $courseTypeIds = json_decode($this->getBlock()->getSetting(self::CONFIGURATION_COURSE_TYPE));\n\n if (!is_array($courseTypeIds))\n {\n $courseTypeIds = array($courseTypeIds);\n }\n\n $this->courseTypeId = $courseTypeIds[0];\n $this->userCourseCategoryId = $courseTypeIds[1];\n $this->settingsLoaded = true;\n }", "private function _loadGlobalSettings(){\r\n\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.'global_settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->globalSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $globalSettings = new stdClass();\r\n $globalSettings->website_name = '';\r\n $globalSettings->global_script = '';\r\n file_put_contents($settings, json_encode($globalSettings));\r\n }\r\n\r\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "function loadSettings() {\n\tsetupSiteURLs();\n}", "public function load_settings() {\n\t\tadd_action( 'admin_init', [ $this, 'register_option' ] );\n\t\tadd_action( 'admin_init', [ $this, 'license_action' ] );\n\t\tadd_action( 'admin_notices', [ $this, 'show_error' ] );\n\t\tadd_action( 'admin_init', [ $this, 'update_settings' ] );\n\t\tadd_filter( 'http_request_args', [ $this, 'disable_wporg_request' ], 5, 2 );\n\t\tadd_filter( 'edd_sl_updater_add_admin_page', [ $this, 'license_page' ] );\n\t}", "public function load() {\n // Load settings\n\t $this->lookup_title = $this->getProjectSetting('lookup-title');\n\t $this->lookup_header = $this->getProjectSetting('lookup-header');\n\t $this->lookup_field = $this->getProjectSetting('lookup-field');\n\t $this->lookup_event_id = $this->getProjectSetting('lookup-event-id');\n\t $this->validate_mrn = $this->getProjectSetting('validate-mrn');\n\t $this->found_action = $this->getProjectSetting('found-action');\n\t $this->repeating_event_id = $this->getProjectSetting('repeating-event-id');\n\t $this->repeating_form_name = $this->getProjectSetting('repeating-form-name');\n\t $this->is_loaded = true;\n }", "public function loadSettings()\n\t{\n\t\t// Update picto for Dolibarr 12++\n\t\tif (function_exists('version_compare') && version_compare(DOL_VERSION, '12.0.0') >= 0) {\n\t\t\t$this->picto = \"quicknotes_128.png@quicknotes\";\n\t\t}\n\n\t\t$this->addJsFile('quicknotes.js.php');\n\t\t$this->enableHooks(array(\n\t\t\t'toprightmenu',\n\t\t\t'main',\n\t\t\t'login'\n\t\t));\n\t}", "private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMeta('category', 'array');\n //$this->loadMetaCategory();\n $this->loadInitScript();\n }", "public function loadPlugins()\n {\n try {\n $pluginModel = Plugin::model(); \n $records = $pluginModel->findAllByAttributes(array('active'=>1));\n \n foreach ($records as $record) {\n $this->loadPlugin($record->name, $record->id);\n }\n } catch (Exception $exc) {\n // Something went wrong, maybe no database was present so we load no plugins\n }\n\n $this->dispatchEvent(new PluginEvent('afterPluginLoad', $this)); // Alow plugins to do stuff after all plugins are loaded\n }", "public function reloadSettings () \n {\n \t// get the current settings from the database\n \t$this->settings = $this->qdb_object->getSettingsAll();\n \t// perform error checking\n \tif (isset ($this->settings['ERRORS']) && ($this->settings['ERRORS'] != ''))\n \t{\n \t\t// fatal error as we need these settings for everything else to work\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_SETTINGS, \"Error reloading settings \".$this->settings['ERRORS']);\n \t}\n \t\n }", "private function plugin_load_settings() {\r\n\t\tif (empty($this->options)) {\r\n\t\t\t$this->options = get_option( $this->options_name );\r\n\t\t}\r\n\t\tif ( !is_array( $this->options ) ) {\r\n\t\t\t$this->options = array();\r\n\t\t}\r\n\t\t$this->options = wp_parse_args($this->options, $this->defaults);\r\n\t}", "public function reload_settings()\r\n\t{\r\n\t\t$this->clear_cache();\r\n\t\t$this->load_settings();\r\n\t}", "public function refresh_plugin_settings() {\n self::$instance->plugin_settings = self::$instance->get_plugin_settings();\n }" ]
[ "0.6884261", "0.68840927", "0.68840927", "0.6824314", "0.6763245", "0.6751249", "0.6659479", "0.65051454", "0.64170754", "0.6362997", "0.6349048", "0.6329909", "0.63279444", "0.62805814", "0.6247827", "0.61893433", "0.6097472", "0.6064629", "0.59914577", "0.59722704", "0.59708273", "0.59264094", "0.5913633", "0.58871174", "0.5826187", "0.58219784", "0.57821673", "0.5780074", "0.5756964", "0.5747405" ]
0.78986067
0
cleans data using htmlspecialchars($value)
private function Clean($value){ return htmlspecialchars(strip_tags($value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function htmlspecialcarfy(&$value) {\r\n $value = htmlspecialchars($value);\r\n }", "function filter($value){\n return htmlspecialchars($value);\n }", "protected function filterXss($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function cleanInput($data) { \r\n return htmlspecialchars(stripslashes(trim($data)));\r\n }", "function clean($data){\n\t\t$this->data = $data;\n\t\t$data = trim($data);\n\t\t$data = stripcslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "public function filter($value) {\n if (!is_scalar($value)) {\n return $value;\n }\n\n return htmlspecialchars($value, ENT_QUOTES);\n }", "private function parseValue($value) {\n return htmlspecialchars(html_entity_decode($value));\n }", "function htmlspecialchars(&$value)\n\t{\n\t\t$value = htmlspecialchars($value);\n\t}", "function h($value){\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function e($value)\n {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "public function setSafeValue($value)\n {\n return htmlspecialchars(stripslashes($value));\n }", "public function xss_clean($value)\n {\n if(is_array($value)) {\n foreach($value as $k => $v) {\n $value[$k] = htmlentities($v);\n }\n }\n else {\n $value = htmlentities($value);\n }\n return $value;\n }", "public function filter($value)\n {\n return htmlspecialchars((string) $value, $this->quoteStyle, $this->charset, $this->doubleEncode);\n }", "function filter_any_data($data){\n\t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "function cleanInput($data) {\n\t\n\treturn htmlspecialchars(stripslashes(trim($data)));\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "function sanitizeHTMLValue($value) \n{ \treturn (isset($value) ? trim(htmlentities(stripslashes($value), ENT_QUOTES, 'UTF-8')) : NULL);\n}", "function filter_mydata($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function clean($value = \"\") {\r\n $value = trim($value);\r\n $value = stripslashes($value);\r\n $value = strip_tags($value);\r\n $value = htmlspecialchars($value);\r\n \r\n\t\treturn $value;\t\t\r\n}", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function trim_value($value){\n\treturn (strip_tags (htmlspecialchars(trim($value))));\n}", "public function cleanString($value) {\n $data = trim($value);\n \n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n \n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n \n return $data;\n }", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function cleanData($data){\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}" ]
[ "0.81252795", "0.78624403", "0.7615995", "0.75765944", "0.75356185", "0.7488446", "0.74862987", "0.7482319", "0.7419871", "0.7403327", "0.73796016", "0.7334972", "0.73287725", "0.73195016", "0.7316396", "0.7313308", "0.7295194", "0.7286763", "0.7275648", "0.72401476", "0.72372866", "0.7237047", "0.72356856", "0.7210976", "0.7206837", "0.72063726", "0.72041786", "0.72037333", "0.7194117", "0.7184319" ]
0.80848086
1
adds a text field to the form
function addText($name,$display=null,$value=null, $disabled=null, $maxlength=null, $class=null, $id=null){ $this->formFields[$name] = array( "name" => $name, "type" => "text", //defines the type of the input "label" => $display, "value" => $value, "disabled" => $disabled, "maxlength" => $maxlength, "class" => $class, "id" => $id ); //add class if null if($class == null){ $this->formFields[$name]["class"] = "c" . $name; } //add id if($id == null){ $this->formFields[$name]["id"] = "i" . $name; } //add display if($display == null){ $this->formFields[$name]["label"] = ucfirst($name) . ":"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToField(\\Foundation\\Form\\Field $field);", "public function addField();", "public function add_text($content)\n\t{\n\t\tarray_push($this->form_elements, array($content, 0, 'text'));\n\t}", "function text_field($object, $field, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_input_field_tag(\"text\", $options);\n}", "public function text ( \\r8\\Form\\Text $field )\n {\n $this->addField( \"text\", $field );\n }", "function add_form_field($field, $error = \"\", $prefill = \"\"){\n\t\t$this->form_row($field, $error , $prefill );\n\t}", "public function add_text($text)\n {\n }", "function wc_custom_add_custom_fields() {\n woocommerce_wp_textarea_input( \n\tarray( \n\t\t'id' => '_custom_text_field', \n\t\t'label' => __( 'Ingredient and Nutrition values', 'woocommerce' ), \n\t\t'placeholder' => 'If you add text here, a new tab will appear.'\n\t\n ) );\n}", "public function actionAdd()\n\t{\n\t\t$formId = $this->_input->filterSingle('form_id', XenForo_Input::UINT);\n\t\t$type = $this->_input->filterSingle('type', XenForo_Input::STRING);\n\t\t\n\t\t$fieldModel = $this->_getFieldModel();\n\t\t$fieldTypes = $fieldModel->getCountByType();\n\t\t\n\t\t$options = array();\n\t\t$options[] = array(\n\t\t 'value' => 'user',\n\t\t 'label' => new XenForo_Phrase('field'),\n\t\t 'selected' => true\n\t\t);\n\t\t\n\t\t// if global fields exist, include in the types\n\t\tif (array_key_exists('global', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'global',\n\t\t\t 'label' => new XenForo_Phrase('global_field')\n\t\t\t);\n\t\t}\n\t\t\n\t\t// if template fields exist, include in the types\n\t\tif (array_key_exists('template', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'template',\n\t\t\t 'label' => new XenForo_Phrase('template_field') \n\t\t\t);\n\t\t}\n\t\t\n\t\t// if there are no options other than user, just send them to the add field page\n\t\tif (!$type && count($options) == 1)\n\t\t{\n\t\t\t$type = 'user';\n\t\t}\n\t\t\n\t\t// association a field to a form\n\t\tif ($formId && $type)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'field_id' => null,\n\t\t\t\t'form_id' => $this->_input->filterSingle('form_id', XenForo_Input::UINT),\n\t\t\t\t'display_order' => $this->_getFieldModel()->getGreatestDisplayOrderByFormId($formId) + 10,\n\t\t\t\t'field_type' => 'textbox',\n\t\t\t\t'field_choices' => '',\n\t\t\t\t'match_type' => 'none',\n\t\t\t\t'match_regex' => '',\n\t\t\t\t'match_callback_class' => '',\n\t\t\t\t'match_callback_method' => '',\n\t\t\t\t'max_length' => 0,\n\t\t\t\t'min_length' => 0,\n\t\t\t\t'required' => 0,\n\t\t\t\t'type' => $type,\n\t\t\t\t'active' => 1,\n\t\t\t\t'pre_text' => '',\n\t\t\t\t'post_text' => ''\n\t\t\t);\n\t\t\t\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t case 'global':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-global-field');\n\t\t }\n\t\t\t case 'template':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-template-field');\n\t\t }\n\t\t\t default:\n\t\t {\n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// adding a global/template field\n\t\telse if (!$formId && $type)\n\t\t{\n\t\t $default = array(\n\t 'field_id' => null,\n\t 'field_type' => 'textbox',\n\t 'field_choices' => '',\n\t 'match_type' => 'none',\n\t 'match_regex' => '',\n\t 'match_callback_class' => '',\n\t 'match_callback_method' => '',\n\t 'max_length' => 0,\n\t\t \t'min_length' => 0,\n\t 'type' => $type,\n\t\t \t'pre_text' => '',\n\t\t \t'post_text' => ''\n\t\t );\n\t\t \n\t\t if ($type != 'global')\n\t\t {\n\t\t \t$default['display_order'] = 1;\n\t\t \t$default['required'] = 0;\n\t\t \t$default['active'] = 1;\n\t\t }\n\t\t \n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t}\n\t\t\n\t\t// association type\n\t\telse\n\t\t{\n\t\t\t$viewParams = array(\n\t\t\t\t'formId' => $formId,\n\t\t\t\t'options' => $options\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->responseView('KomuKu_SimpleForms_ViewAdmin_Field_AddType', 'kmkform__field_add_type', $viewParams);\n\t\t}\n\t}", "function _field_text($fval) \n {\n $fval = (empty($fval) && !empty($this->opts))? $this->opts : $fval;\n if (is_array($fval) && !empty($this->attribs['multi']))\n $fval = ''; // we can't handle this here. Don't put \"Array\"\n\n return sprintf(\"<input type=\\\"text\\\" id=\\\"%s\\\" name=\\\"%s%s\\\" value=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s />\\n\",\n $this->fname, \n $this->fname, \n (!empty($this->attribs['multi']))? '[]':'', \n $this->_htmlentities($fval), \n $this->_get_field_size(), \n $this->attribs['maxlength'], \n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n }", "public static function textField($name,$value='',$option=array()) {\n\t\t$option['name']=$name;\n\t\t$option['type']='text';\n\t\t$option['value']=$value;\n\t\treturn self::htmltag('input',$option);\n\t}", "public function add(IField $field): IFormBuilder;", "public function edit_field_add($mform) {\n // Create the form field.\n $mform->addElement('editor', $this->inputname, format_string($this->field->name), null, null);\n $mform->setType($this->inputname, PARAM_RAW); // We MUST clean this before display!\n }", "public function addField(Field $field);", "public function addField(Field $field);", "public function addText($name, $label = '', $cols = NULL, $maxLength = NULL)\n\t{\n\t\treturn $this[$name] = new TextInput($label, $cols, $maxLength);\n\t}", "function cmdeals_wp_text_input( $field ) {\n\tglobal $thepostid, $post;\n\t\n\tif (!$thepostid) $thepostid = $post->ID;\n\tif (!isset($field['placeholder'])) $field['placeholder'] = '';\n\tif (!isset($field['class'])) $field['class'] = 'short';\n\tif (!isset($field['value'])) $field['value'] = get_post_meta($thepostid, $field['id'], true);\n\t\n\techo '<p class=\"form-field '.$field['id'].'_field\"><label for=\"'.$field['id'].'\">'.$field['label'].'</label><input type=\"text\" class=\"'.$field['class'].'\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" value=\"'.esc_attr( $field['value'] ).'\" placeholder=\"'.$field['placeholder'].'\" /> ';\n\t\n\tif (isset($field['description'])) echo '<span class=\"description\">' .$field['description'] . '</span>';\n\t\t\n\techo '</p>';\n}", "public function textField($name)\n {\n return new TextField($this, $name);\n }", "function form_text($field, $options) {\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('input', 'text')\n );\n\n $options = array_merge($defaults, $options);\n\n $field = strtolower($field);\n\n $output = '<input type=\"text\" name=\"' . $field . '\" id=\"' . form__field_id($field) . '\"';\n\n if(!empty($_POST[$field])) {\n $output .= ' value=\"'. $_POST[$field] . '\"';\n }\n\n $output .= ' />';\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}", "public static function convert_text_field() {\n\n\t\t// Create a new Text field.\n\t\tself::$field = new GF_Field_Text();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public function add_field(form_item $field) {\n $this->_fields[] = $field;\n }", "function addText($text);", "public function form_field_text ( $args ) {\n\t\t$options = $this->get_settings();\n\t\techo '<input id=\"' . esc_attr( $args['key'] ) . '\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" size=\"40\" type=\"text\" value=\"' . esc_attr( $options[$args['key']] ) . '\" />' . \"\\n\";\n\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\techo '<span class=\"description\">' . $args['data']['description'] . '</span>' . \"\\n\";\n\t\t}\n\t}", "public function addText($str_name)\n {\n return $this->addField($str_name, self::FIELD_TEXT);\n }", "function render_text() {\n\t\t?><input type=\"text\" id=\"<?php echo $this->slug ?>\" name=\"<?php echo $this->settings_page ?>[<?php echo $this->slug ?>]\" value=\"<?php echo $this->value ?>\" ><?php\n\t}", "function text_field_tag($name, $value, array $attributes = array())\r\n{\r\n array_add($attributes, array(\r\n 'id' => $name,\r\n 'name' => $name,\r\n 'type' => 'text',\r\n 'value' => $value\r\n ));\r\n return tag('input', $attributes);\r\n}", "private function display_input_text_field($name, $value, $size = 75) {\n?>\n<input type=\"text\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\" value=\"<?php echo htmlspecialchars($value) ?>\" size=\"<?php echo htmlspecialchars($size); ?>\" /><br />\n<?php\n }", "function acf_text_input($attrs = array())\n{\n}", "function create_custom_field() {\n $args = array(\n 'id' => 'custom_field_brand',\n 'label' => __( 'Detalhes da Marca'),\n 'class' => 'brand-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the brand details.'),\n );\n woocommerce_wp_textarea_input( $args );\n}", "public function getAddForm();" ]
[ "0.71173376", "0.7010082", "0.67111164", "0.6665229", "0.65946543", "0.6570832", "0.65291566", "0.64706016", "0.6444931", "0.6407183", "0.6361391", "0.63384074", "0.6266926", "0.62619895", "0.62619895", "0.6246228", "0.621663", "0.6186998", "0.6174247", "0.6173546", "0.61702913", "0.6160955", "0.6154339", "0.61469525", "0.6142602", "0.612318", "0.6085091", "0.60796523", "0.6051971", "0.60213107" ]
0.71394086
0
>end of add text adds a textarea field to the form
function addTextarea($name,$display=null,$value=null, $disabled=null, $rows=3, $cols=25, $class=null, $id=null){ $this->formFields[$name] = array( "name" => $name, "type" => "textarea", //defines the type of the input "label" => $display, "value" => $value, "disabled" => $disabled, "rows" => $rows, "cols" => $cols, "class" => $class, "id" => $id ); //add class if null if($class == null){ $this->formFields[$name]["class"] = "c" . $name; } //add id if($id == null){ $this->formFields[$name]["id"] = "i" . $name; } //add display if($display == null){ $this->formFields[$name]["label"] = ucfirst($name) . ":"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function textArea ( \\r8\\Form\\TextArea $field )\n {\n $this->addField( \"textarea\", $field );\n }", "function wc_custom_add_custom_fields() {\n woocommerce_wp_textarea_input( \n\tarray( \n\t\t'id' => '_custom_text_field', \n\t\t'label' => __( 'Ingredient and Nutrition values', 'woocommerce' ), \n\t\t'placeholder' => 'If you add text here, a new tab will appear.'\n\t\n ) );\n}", "public function it_shows_textarea_input()\n {\n // configure\n $inputs = [\n [\n 'type' => 'textarea',\n 'name' => 'message'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('textarea')\n ->assertSee('message');\n }", "function AttribTextarea( $id, $value, $name )\n\t{\n\t\t//TODO save doesn't work when ' apostrophies '\n\t\t$success = '<textarea cols=\"30\" rows=\"6\" name=\"'.$name.'\" id=\"'.$id.'\">'. JText::_($value) . '</textarea>';\n\t\treturn $success;\n\t}", "public function form_field_textarea ( $args ) {\n\t\t$options = $this->get_settings();\n\n\t\techo '<textarea id=\"' . esc_attr( $args['key'] ) . '\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" cols=\"42\" rows=\"5\">' . esc_html( $options[$args['key']] ) . '</textarea>' . \"\\n\";\n\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\techo '<p><span class=\"description\">' . $args['data']['description'] . '</span></p>' . \"\\n\";\n\t\t}\n\t}", "function setting_textarea( $option ) {\n\n\t\t$value = $this->pretty_print(get_option( $option ));\n?>\n\t<textarea name=\"<?php echo $option; ?>\"><?php echo $value;\n?></textarea>\n<?php\n\t}", "private function addEmailText(){\n\t\t$element = 'body';\n\t\t$opts = array('label'=>'emailMessage','required'=>true,'validators' => array( array('stringLength', false, array(1, 1000) )\t));\n\t\t$this->addElement('textarea',$element,$opts);\n\t\t$this->getElement($element)->setAttribs(array('rows'=>20,'cols'=>30));\n\t\t//$prefix = array();\n\t\t//$decorator = array('DivForm');\n\t\t//$this->addCustomDecorator($prefix,$decorator,$element);\n\t\t$this->applyDecorator($element,false);\n\t\t$this->addToGroup($element);\n\t}", "function textarea($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\t\techo \"<textarea data-tooltip='\" .$args['tooltip'] . \"' name='\" . $args['formname'] . \"' style='\" . $this->width($args['width']) . \" \" . $this->height($args['height']) . \"' rows='7' cols='50' type='textarea'>\" . $args['value'] . \"</textarea>\";\t\t\t\r\n\t\t\t$this->description($args['description']);\r\n\t\t\t}", "function acf_textarea_input($attrs = array())\n{\n}", "public function add_text($content)\n\t{\n\t\tarray_push($this->form_elements, array($content, 0, 'text'));\n\t}", "function minorite_textarea($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'cols', 'rows'));\n _form_set_class($element, array('form-textarea'));\n\n $wrapper_attributes = array(\n 'class' => array('form-textarea-wrapper'),\n );\n\n // Add resizable behavior.\n if (!empty($element['#resizable'])) {\n drupal_add_library('system', 'drupal.textarea');\n $wrapper_attributes['class'][] = 'resizable';\n }\n\n // Add required attribute.\n if (!empty($element['#required'])) {\n $element['#attributes']['required'] = '';\n }\n\n $output = '<div' . drupal_attributes($wrapper_attributes) . '>';\n $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';\n $output .= '</div>';\n return $output;\n}", "public function callback_textarea( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n\n $html = sprintf( '<textarea rows=\"5\" cols=\"55\" class=\"%1$s-text\" id=\"%2$s\" name=\"%2$s\" %4$s>%3$s</textarea>', $size, $name_id, $value, $disable );\n $html .= $this->get_field_description( $args );\n\n echo $html;\n }", "function textarea( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_TEXTAREA,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "function tep_cfg_textarea($text) {\n return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);\n}", "function olc_cfg_textarea($text) {\n\treturn olc_draw_textarea_field('configuration_value', false, 50, 5, $text);\n}", "public static function convert_textarea_field() {\n\n\t\t// Create a new Textarea field.\n\t\tself::$field = new GF_Field_Textarea();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Textarea specific properties.\n\t\tself::$field->useRichTextEditor = rgar( self::$nf_field, 'textarea_rte' );\n\n\t}", "function tep_cfg_textarea($text, $key = '') {\n $name = tep_not_null($key) ? 'configuration[' . $key . ']' : 'configuration_value';\n\n return HTML::textareaField($name, 35, 5, $text);\n }", "function acf_get_textarea_input($attrs = array())\n{\n}", "function textarea($name='',$class='',$id='',$attrib='',$value = '') {\n\t\t$fldname = str_replace(' ', '_', $name);\n\t\tif(isset($_SESSION[$fldname])) $value = $_SESSION[$fldname];\n\t\tif(isset($_POST[$fldname])) $value = $_POST[$fldname];\n\t\t$txtarea = '<textarea name=\"'.$fldname.'\" class=\"'.$class.'\" id=\"'.$id.'\" '.$attrib.'>'.$value.'</textarea>';\n\t\techo $txtarea;\n\t}", "public function add_widget_area() {\n\t\t\tif ( ! empty( $_POST['wprt-add-widget-input'] ) ) {\n\t\t\t\t$this->widget_areas = $this->get_widget_areas();\n\t\t\t\tarray_push( $this->widget_areas, $_POST['wprt-add-widget-input'] );\n\t\t\t\t$this->save_widget_areas();\n\t\t\t\twp_redirect( admin_url( 'widgets.php' ) );\n\t\t\t\tdie();\n\t\t\t}\n\t\t}", "function hudson_textarea($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'cols', 'rows'));\n _form_set_class($element, array('form-textarea'));\n\n $wrapper_attributes = array(\n 'class' => array('form-textarea-wrapper'),\n );\n\n $output = '<div' . drupal_attributes($wrapper_attributes) . '>';\n $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';\n $output .= '</div>';\n return $output;\n}", "function textarea($fieldName, $options = array(), $tinyoptions = array()) {\n\t\treturn $this->Form->textarea($fieldName, $options) . $this->_build($fieldName, $tinyoptions);\n\t}", "function print_textarea($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo ' <textarea name=\"'.$value['id'].'\" class=\"option-textarea\" cols=\"\" rows=\"\">'.$input_value.'</textarea>';\n\t\t$this->close_option($value);\n\t}", "function addTextarea ($name, $value, $rows = NULL, $cols = NULL, $attributes = array ())\n\t{\n\t\t$rows = (empty($rows) ? '' : ' rows=\"' . $rows . '\"');\n\t\t$cols = (empty($cols) ? '' : ' cols=\"' . $cols . '\"');\n\n\t\t$html = \"<textarea name=\\\"$name\\\"\" . $rows . $cols . \"\";\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= \">$value</textarea>\";\n\n\t\treturn $html;\n\t}", "function wpsites_modify_comment_form_text_area($arg) {\n $arg['comment_field'] = '<p class=\"comment-form-comment\"><label for=\"comment\">' . _x( 'Takk for din tilbakemelding!', 'noun' ) . '</label><textarea id=\"comment\" name=\"comment\" cols=\"55\" rows=\"7\" aria-required=\"true\"></textarea></p>';\n return $arg;\n}", "private function textareaCustomField(): string\n {\n return Template::build($this->getTemplatePath('textarea.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'value' => $this->getValue($this->index),\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "static public function createTextArea($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/textarea.php\";\n }", "function output_textarea_row( string $label, string $key, $val, int $rows = 2 ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t$val = $val ?? '';\n\t?>\n\t<div class=\"wpinc-meta-field-single textarea\">\n\t\t<label>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t\t<textarea <?php name_id( $key ); ?> cols=\"64\" rows=\"<?php echo esc_attr( $rows ); ?>\"><?php echo esc_attr( $val ); ?></textarea>\n\t\t</label>\n\t</div>\n\t<?php\n}", "public function addTextarea($name, $label, array $options=array()) {\n $options['type'] = 'textarea';\n return $this->addInput($name, $label, $options);\n }", "function ctools_export_form($form, &$form_state, $code, $title = '') {\r\n $lines = substr_count($code, \"\\n\");\r\n $form['code'] = array(\r\n '#type' => 'textarea',\r\n '#title' => $title,\r\n '#default_value' => $code,\r\n '#rows' => $lines,\r\n );\r\n\r\n return $form;\r\n}" ]
[ "0.6869719", "0.66468203", "0.6594211", "0.6500564", "0.6487473", "0.6479856", "0.64718026", "0.64642334", "0.646191", "0.6425167", "0.6423354", "0.6407998", "0.6376887", "0.63619083", "0.6353603", "0.6347041", "0.63369834", "0.63158906", "0.6312896", "0.6289889", "0.6289376", "0.62856334", "0.6271112", "0.62673163", "0.6252116", "0.6241436", "0.6237468", "0.6227915", "0.6216088", "0.62073207" ]
0.7041949
0
Drains the source stream into the "sink" client option.
private function drain( StreamInterface $source, StreamInterface $sink, $contentLength ) { // If a content-length header is provided, then stop reading once // that number of bytes has been read. This can prevent infinitely // reading from a stream when dealing with servers that do not honor // Connection: Close headers. Psr7\copy_to_stream( $source, $sink, (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 ); $sink->seek(0); $source->close(); return $sink; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createStream()\n {\n $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']);\n\n // stream the data using UDP and suppress any errors\n $this->stream = @stream_socket_client($host);\n }", "public function setSourceClient($sourceClient);", "function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)\n{\n $bufferSize = 8192;\n\n if ($maxLen === -1) {\n while (!$source->eof()) {\n if (!$dest->write($source->read($bufferSize))) {\n break;\n }\n }\n } else {\n $remaining = $maxLen;\n while ($remaining > 0 && !$source->eof()) {\n $buf = $source->read(min($bufferSize, $remaining));\n if (strlen($buf) === 0) {\n break;\n }\n $remaining -= $buf;\n $dest->write($buf);\n }\n }\n}", "public function setSinkSid(string $sinkSid): self\n {\n $this->options['sinkSid'] = $sinkSid;\n return $this;\n }", "public function setSinkSid(string $sinkSid): self\n {\n $this->options['sinkSid'] = $sinkSid;\n return $this;\n }", "public function sinks()\n {\n if (is_null($this->sinkRequests)) {\n $this->sinkRequests = new SinkRequests($this->client);\n }\n\n return $this->sinkRequests;\n }", "protected\n function setStreamBlocking()\n {\n stream_set_blocking($this->client, 0);\n }", "public function setSource($source)\n {\n $this->opts['source'] = $source;\n }", "public function setOverwriteObjectsAlreadyExistingInSink($var)\n {\n GPBUtil::checkBool($var);\n $this->overwrite_objects_already_existing_in_sink = $var;\n\n return $this;\n }", "public function setDeleteObjectsUniqueInSink($var)\n {\n GPBUtil::checkBool($var);\n $this->delete_objects_unique_in_sink = $var;\n\n return $this;\n }", "public function setOverwriteObjectsAlreadyExistingInSink($var)\n {\n GPBUtil::checkBool($var);\n $this->overwrite_objects_already_existing_in_sink = $var;\n }", "public static function streamCopy($source, $target) {\n\t\tlist($count, ) = \\OC_Helper::streamCopy($source, $target);\n\t\treturn $count;\n\t}", "function com_event_sink($comobject, $sinkobject, $sinkinterface = null) {}", "public function setDeleteObjectsUniqueInSink($var)\n {\n GPBUtil::checkBool($var);\n $this->delete_objects_unique_in_sink = $var;\n }", "public static function onBufferEmpty(\\Swoole\\Client $client)\n {\n $client->close();\n }", "public function save($message, $source = \"\") {\r\n if (!$this->destination) { return; }\r\n \r\n $message = $source . \" : \" . (is_string($message) ? $message : print_r($message, true));\r\n \r\n parent::save($message);\r\n }", "public function pull($source, $destination, $options = ['safe' => false, 'label' => 'sync', 'runner' => null])\n {\n $global_options = Drush::redispatchOptions() + ['strict' => 0];\n\n // @todo If either call is made interactive, we don't get an $return['object'] back.\n $backend_options = ['interactive' => false];\n if (Drush::simulate()) {\n $backend_options['backend-simulate'] = true;\n }\n\n $export_options = [\n // Use the standard backup directory on Destination.\n 'destination' => true,\n 'yes' => null,\n ];\n $this->logger()->notice(dt('Starting to export configuration on Target.'));\n $return = drush_invoke_process($source, 'config-export', [], $global_options + $export_options, $backend_options);\n if ($return['error_status']) {\n throw new \\Exception(dt('Config-export failed.'));\n } else {\n // Trailing slash assures that we transfer files and not the containing dir.\n $export_path = $return['object'] . '/';\n }\n\n $rsync_options = [\n '--remove-source-files',\n '--delete',\n '--exclude=.htaccess',\n ];\n if (strpos($destination, ':') === false) {\n $destination .= ':%config-' . $options['label'];\n }\n $destinationHostPath = HostPath::create($this->siteAliasManager(), $destination);\n\n if (!$runner = $options['runner']) {\n $sourceRecord = $this->siteAliasManager()->get($source);\n $destinationRecord = $destinationHostPath->getAliasRecord();\n $runner = $sourceRecord->isRemote() && $destinationRecord->isRemote() ? $destinationRecord : '@self';\n }\n $this->logger()\n ->notice(dt('Starting to rsync configuration files from !source to !dest.', [\n '!source' => $source,\n '!dest' => $destinationHostPath->getOriginal(),\n ]));\n // This comment applies similarly to sql-sync's use of core-rsync.\n // Since core-rsync is a strict-handling command and drush_invoke_process() puts options at end, we can't send along cli options to rsync.\n // Alternatively, add options like ssh.options to a site alias (usually on the machine that initiates the sql-sync).\n $return = drush_invoke_process($runner, 'core-rsync', array_merge([\n \"$source:$export_path\",\n $destinationHostPath->getOriginal(),\n '--'\n ], $rsync_options), ['yes' => true], $backend_options);\n if ($return['error_status']) {\n throw new \\Exception(dt('Config-pull rsync failed.'));\n }\n\n drush_backend_set_result($return['object']);\n }", "public function setSource($source);", "public function drain(): void;", "function http_send_stream($stream) {}", "public function setStreamTo($stream);", "function write($content, $src = false)\r\n {\r\n if($src)\r\n {\r\n $this->source = $src;\r\n }\r\n \r\n if(empty($this->source))\r\n {\r\n $this->error = \"Source file not specified\";\r\n return;\r\n }\r\n \r\n if(is_array($content))\r\n {\r\n // the user provided lines, let's merge them\r\n $content = implode(\"\",$content);\r\n }\r\n \r\n // The function can be called to write a NEW file, let's create it if needed\r\n if(!is_file($this->source))\r\n {\r\n touch($this->source);\r\n }\r\n \r\n if($handle = fopen($this->source,\"w\"))\r\n {\r\n fwrite($handle,$content);\r\n fclose($handle);\r\n $this->open($this->source);\r\n }\r\n else\r\n {\r\n //failure\r\n $this->error = \"Could not write to file\";\r\n return;\r\n }\r\n }", "protected function setSource($source) {}", "public function stream();", "public function sinkTo(WriterInterface $writerInterface): void;", "public function copy($source) {}", "protected function setDestination() {}", "public function dropDatasource($source);", "protected function before_stream() {\n\t\tGyroHeaders::send();\n\t\tsession_write_close();\n\t\tob_end_clean();//required here or large files will not work\n\t}", "abstract protected function processDataSource(OutputInterface $output, $service, $dataSourceOptions);" ]
[ "0.48846585", "0.48336163", "0.46607745", "0.45921656", "0.45921656", "0.45050144", "0.44092536", "0.4379603", "0.4378212", "0.43487227", "0.42933887", "0.42757732", "0.42443016", "0.4241649", "0.4238601", "0.42364192", "0.4074683", "0.40644178", "0.4034444", "0.40229186", "0.40090555", "0.400635", "0.4000085", "0.39863694", "0.39511976", "0.39458323", "0.3943162", "0.39162165", "0.38918048", "0.3864792" ]
0.5608734
0
Test login without user details Try to validate user without details
public function testLoginWithoutUserDetails() :void { $res = self::$dataService->login("login", null, $this->userEmpty["user"], $this->userEmpty["pass"], [] ); $this->assertIsArray( $res, 'testLoginWithoutUserDetails' ); $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' ); $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' ); $this->assertCount(2, $res, 'testLoginWithoutUserDetails' ); $this->assertEquals( [ "status" => false, "msg" => "Please enter username." ], $res, 'testLoginWithoutUserDetails' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public function testLoginWithoutUserName() : void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userFake[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserName' );\n $this->assertCount(2, $res, 'testLoginWithoutUserName' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserName' );\n }", "public function testLoginWithoutUserPass() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserPass' );\n $this->assertCount(2, $res, 'testLoginWithoutUserPass' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter password.\" ], $res, 'testLoginWithoutUserPass' );\n }", "function testLoginFail()\r\n {\r\n \t$this->User = new User();\r\n \t//check with wrong email and wrong pass\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid password but wrong email\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'password') );\r\n\t\t\r\n\t\t//check with valid email but wrong pass\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid email but no password\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', '') );\r\n\t\t\r\n\t\t//check with empty user-data\r\n\t\t$this->assertFalse( $this->User->login('', '') );\r\n\t}", "public function testLoginUsername(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => 'thisisit'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "function testSimpleLoginRequest() {\n $Record = $this->RecordObj->create(array('active'=>1));\n $this->AuthwellUser->create();\n $this->assertTrue($this->AuthwellUser->save($Record));\n #debug($this->AuthwellUser->invalidFields());\n\n // then call\n $FormData = array(\n 'AuthwellUser' => array(\n 'email_login' => $Record['email'],\n 'password_login' => $Record['password']\n )\n );\n\n $is_logged_in = $this->AuthwellUser->is_valid_login_request($FormData);\n $Cache = $this->AuthwellUser->UserDataCache;\n\n $this->assertTrue($is_logged_in);\n $this->assertEqual($Cache['User']['email'], $Record['email']);\n }", "public function validate_login() {\n\t\t$userid=$_POST['user_id'];\n\t\t$password=$_POST['password'];\n\t\t$compid=$_POST['company_id'];\n\t\t\n\n\t\t$sql=\"SELECT u.id, u.user_name FROM users u, hmz_cust_info ci where ci.id=u.cust_id\n\t\t\tand u.user_id='$userid' and u.password='$password' and ci.cust_id='$compid';\";\n\t\t$result=$this->runQuery(\"getAll\",$sql);\n\t\tif(count($result)>0) {\n\t\t\t$_SESSION['user_id']=$result[0];\n\t\t\t$_SESSION['user_name']=$result[1];\n\t\t\theader('location: ?a=P&b=dashboard');\n\t\t}\n\t\telse\n\t\t\theader('location: ?a=login&b=f');\n\n\t}", "public function testValidUserLogin()\n {\n $this->withoutExceptionHandling();\n\n //Create test user from factory\n User::factory(1)->create();\n\n $credentials = [\n \"email\" => \"[email protected]\",\n \"password\" => \"1234\",\n ];\n\n $response = $this->post(route(\"login.attempt\"),$credentials);\n\n $response->assertRedirect(route(\"account.dashboard\"));\n }", "public function testCanLoginValidUser()\n {\n $user = factory(User::class)->create();\n $user->activate();\n \n $this->post('/api/v1/login', [\n 'email' => $user->email,\n 'password' => 'secret',\n ], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJsonStructure([\n 'token'\n ]);\n \n $this->get('/api/v1/me', ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\"user\" => ['email' => $user->email]]);\n }", "public function testDoLogin()\n {\n $mockUser = new User(\"[email protected]\", \"Some User\", \"asdf\", \"student\");\n $mockUser->insert();\n\n // Invalid email\n $this->assertFalse(User::doLogin(\"nonexistant\", \"lol\"));\n\n // Invalid password\n $this->assertFalse(User::doLogin(\"[email protected]\", \"lol\"));\n\n // Valid everything\n $this->assertTrue(User::doLogin(\"[email protected]\", \"asdf\"));\n }", "public function testLoginname(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function test_valid_user_login()\n {\n Session::start();\n $response = $this->call('POST', '/login', [\n 'email' => '[email protected]',\n 'password' => 'password',\n '_token' => csrf_token()\n ]);\n $response->assertStatus(302);\n $response->assertRedirect('/home');\n }", "public function testLoginValid(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => 'Wrong'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertTrue($validLogin);\r\n\t\t}", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "private function _checkValidUser()\n\t{\n\t\t$user = $this->getUser();\n\t\tif(NULL == $user->getFirstname()) return $this->redirect('/logout');\n\t\tif(NULL <> $user->getEmployerId()) return $this->redirect('/admin');\n\t}", "public function testLoginActionWithUnknowUser()\n {\n $data = [\n '_username' => 'unknowuser',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "private function validateUserInput() {\n\t\ttry {\n\t\t\t$this->clientUserName = $this->loginObserver->getClientUserName();\n\t\t\t$this->clientPassword = $this->loginObserver->getClientPassword();\n\t\t\t$this->loginModel->validateForm($this->clientUserName, $this->clientPassword);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->message = $e->getMessage();\n\t\t}\n\t}", "public function validasi()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function validUser();", "public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }", "public function testUserLogin()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Login')\n ->seePageIs('/dashboard');\n }", "public function testLoginNoCredentials()\n {\n $response = $this->post($this->getLoginSubmitUrl());\n $response->assertSessionHasErrors([\n 'email', 'password'\n ]);\n }", "public function testLoginAtionWithEmptyValue()\n {\n $data = [\n '_username' => '',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n }", "public function validateUser(){\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n\n //Place inputs in valide user function\n $result = $this->LoginModel->loginUser($username, $password);\n\n //Check to see if it is a valide user or not\n if($result == ''){\n\n redirect(base_url());\n }\n else{\n\n echo \"Wrong details\";\n }\n\n }", "public function loginCheck()\n\t{\n\t}", "public function testFakeLogin()\n {\n Auth::attempt(['email'=>'[email protected]','password'=>'fake123']);\n $this->assertNotTrue(Auth::check());\n }", "public function _check_login()\n {\n\n }" ]
[ "0.7501516", "0.7453113", "0.73845613", "0.73630416", "0.73431045", "0.7272726", "0.725035", "0.7197222", "0.7187137", "0.7145777", "0.7135395", "0.7134461", "0.71268976", "0.71257377", "0.71238244", "0.7085704", "0.70580024", "0.7054494", "0.70356387", "0.702758", "0.7024218", "0.7020342", "0.7008045", "0.69912183", "0.69885004", "0.69829917", "0.6974808", "0.6971761", "0.69597137", "0.6957405" ]
0.77804697
0
Test login without username Try to validate user without username
public function testLoginWithoutUserName() : void { $res = self::$dataService->login("login", null, $this->userEmpty["user"], $this->userFake["pass"], [] ); $this->assertIsArray( $res, 'testLoginWithoutUserName' ); $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserName' ); $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserName' ); $this->assertCount(2, $res, 'testLoginWithoutUserName' ); $this->assertEquals( [ "status" => false, "msg" => "Please enter username." ], $res, 'testLoginWithoutUserName' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLoginUsername(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => 'thisisit'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginname(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "function validate_login($username, $password){\n if (empty($this->username) or empty($this->password)){\n // User has not set its credentials\n print 'Error user has not set user and password.';\n return False;\n }\n if (empty($username) or empty($password)){\n // Empty username or password\n print 'Cannot ser username or password as null.';\n return False;\n }\n if ($username == $this->username and $password == $this->password){\n print 'Username and password are correct.';\n return True;\n }\n }", "public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }", "public function testLoginAtionWithEmptyValue()\n {\n $data = [\n '_username' => '',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n }", "public function testLoginValid(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => 'Wrong'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertTrue($validLogin);\r\n\t\t}", "public function validate_username() {\n\n\t\tif(strtolower($this->username) == 'admin')\n\t\t\t$this->addError('username','Usuario no disponible.');\n\t}", "public function testGetInvalidUserByUserName(): void {\n\t\t// Grab an username that does not exist\n\t\t$user = User::getUserByUserName($this->getPDO(), \"doesnotexist\");\n\t\t$this->assertCount(0, $user);\n\t}", "private function validateUserInput() {\n\t\ttry {\n\t\t\t$this->clientUserName = $this->loginObserver->getClientUserName();\n\t\t\t$this->clientPassword = $this->loginObserver->getClientPassword();\n\t\t\t$this->loginModel->validateForm($this->clientUserName, $this->clientPassword);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->message = $e->getMessage();\n\t\t}\n\t}", "function testLoginFail()\r\n {\r\n \t$this->User = new User();\r\n \t//check with wrong email and wrong pass\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid password but wrong email\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'password') );\r\n\t\t\r\n\t\t//check with valid email but wrong pass\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid email but no password\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', '') );\r\n\t\t\r\n\t\t//check with empty user-data\r\n\t\t$this->assertFalse( $this->User->login('', '') );\r\n\t}", "public function usernameEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // set the var equal to function call of username\r\n $username = $this->getUsername();\r\n // If the field is empty\r\n if ( empty($username) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"username\"] = \"Username is missing.\";\r\n // Other test calls the validator class and nameisvalid function to test\r\n // the user name is it returns invalid the message is displayed to the user\r\n } else if ( !Validator::nameIsValid($this->getUsername()) ) {\r\n $this->errors[\"username\"] = \"Username is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"username\"]) ? true : false ) ;\r\n }", "public function testMustEnterUserNameAndPassword()\n {\n $response = $this->post(route('auth.authenticate'));\n\n $response->assertSessionHasErrors(\n [\n 'userName' => 'user name không được để trống.',\n 'password' => 'password không được để trống.'\n ]\n );\n $response->assertStatus(Response::HTTP_FOUND);\n }", "public function validUser();", "public function testLoginActionWithUnknowUser()\n {\n $data = [\n '_username' => 'unknowuser',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "public function testArgumentValidateUserName() {\n $view = Views::getView('test_view_argument_validate_username');\n $this->executeView($view);\n\n $this->assertTrue($view->argument['null']->validateArgument($this->account->getAccountName()));\n // Reset argument validation.\n $view->argument['null']->argument_validated = NULL;\n // Fail for a valid string, but for a user that doesn't exist\n $this->assertFalse($view->argument['null']->validateArgument($this->randomMachineName()));\n }", "public function testLoginWithoutUserPass() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserPass' );\n $this->assertCount(2, $res, 'testLoginWithoutUserPass' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter password.\" ], $res, 'testLoginWithoutUserPass' );\n }", "function validation($userName, $password){\r\n // $query .=\" WHERE userName = '\" . $userName .\"' AND password = '\" . $password . \"'\";\r\n\r\n if(empty($userName) && empty($password)){\r\n $emptyfield = \"Field cannot be empty</br>\";\r\n echo $emptyfield;\r\n echo \"Redirecting to login screen...\";\r\n header( \"Refresh:1; url=index.php\", true, 303);\r\n }\r\n\r\n // $query = \"SELECT * FROM user\";\r\n // $query .=\" WHERE userName = '\" . $userName .\"'\";\r\n\r\n // $result = $connection ->prepare($query);\r\n // $result->execute();\r\n // $result = $result->fetchAll();\r\n\r\n // if(count($result) > 0){\r\n // echo \"Username already exist\";\r\n // //sleep(3);\r\n // header( \"Refresh:1; url=index.php\", true, 303);\r\n // } else {\r\n // inDatabase();\r\n // }\r\n // die;\r\n}", "public function _check_login()\n {\n\n }", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "function login($username, $data) {\n if ($username != 'admin' || $data != 'secret') {\n return false;\n }\n return parent::login($username, $data);\n }", "public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }", "public function testEmptyUsernameLogin() {\n $this->client->setDefaultOption('headers', array('Accept' => 'application/json'));\n try {\n $this->client->post(\"http://localhost:8000/user/login\")\n ->setBody('', 'application/json')\n ->send()\n ->json();\n } catch (ClientErrorResponseException $e) {\n $error = json_decode($e->getResponse()->getBody(TRUE), TRUE);\n $this->assertEquals(\"Username not provided\", $error);\n }\n }", "function validateLogin($data)\r\n\t{\r\n\t\t$user = $this->find(array('username' => $data['username'], 'password' => sha1($data['password'])), array('id', 'username'));\r\n\t\tif(empty($user) == false)\r\n\t\t\treturn $user['User'];\r\n\t\treturn false;\r\n\t}", "public function testDoLogin()\n {\n $mockUser = new User(\"[email protected]\", \"Some User\", \"asdf\", \"student\");\n $mockUser->insert();\n\n // Invalid email\n $this->assertFalse(User::doLogin(\"nonexistant\", \"lol\"));\n\n // Invalid password\n $this->assertFalse(User::doLogin(\"[email protected]\", \"lol\"));\n\n // Valid everything\n $this->assertTrue(User::doLogin(\"[email protected]\", \"asdf\"));\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "function validate_username($username)\n {\n }", "public function username_check($str) {\n // return FALSE;\n return TRUE;\n }" ]
[ "0.80902255", "0.7658984", "0.74814266", "0.73498446", "0.714599", "0.71350527", "0.71150535", "0.7099077", "0.7067175", "0.70501345", "0.7042132", "0.70333046", "0.6980602", "0.6958325", "0.69443095", "0.6930048", "0.6907427", "0.689874", "0.6876509", "0.68755686", "0.68720245", "0.68228215", "0.68218637", "0.6816115", "0.68107134", "0.6797256", "0.67874885", "0.6785674", "0.6776116", "0.6771951" ]
0.7717765
1
Test login again with same user Try to login again with same real user details and get msg "This user already logged in."
public function testLoginAgainWithSameUser() : void { $res = self::$dataService->login( "login", null, $this->userA["user"], $this->userA["pass"], [ "user_agent" => $this->userA["getBrowserName"], "time" => $this->userA["getCurrentDateTime"], "ip" => $this->userA["getReqIp"] ] ); $this->assertIsArray( $res, 'testLoginAgainWithSameUser' ); $this->assertArrayHasKey('status', $res, 'testLoginAgainWithSameUser' ); $this->assertArrayHasKey('msg', $res, 'testLoginAgainWithSameUser' ); $this->assertCount(2, $res, 'testLoginAgainWithSameUser' ); $this->assertEquals( [ "status" => false, "msg" => "This user already logged in." ], $res, 'testLoginAgainWithSameUser' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_login2()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('123456','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }", "function trylogin()\n {\n\t\t$ret = false;\n\t\t\n $err = SHIN_Core::$_models['sys_user_model']->login();\n\n SHIN_Core::$_language->load('app', 'en');\n $err = SHIN_Core::$_language->line($err);\n\t\t\n if ($err != '') {\n SHIN_Core::$_libs['session']->set_userdata('loginErrorMessage', $err);\n } else {\n $this->sessionModel->start(SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\t$ret = true;\n\t\t\t\n\t\t\t// addons for new field added //////////////////////////\n\t\t\t// request by Stefano. Detail: http://binary-studio.office-on-the.net/issues/5287\n\t\t\t// \"host\" and \"lastlogin\" field \n\t\t\t$data = array('lastlogin' => date('Y-m-d H:i:s'), 'host' => SHIN_Core::$_input->ip_address());\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idUser', SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update('sys_user', $data); \t\t\n\t\t\t///////////////////////////////////////////////////////\n }\n\n\t\treturn $ret;\n }", "private function attemptLogin($user){\n\n }", "private function compare_with_login()\n {\n }", "function check_login(){\n\t\tif(!empty(yii::app()->request->cookies['uid']) && !empty(yii::app()->request->cookies['pass'])){\n\t\t\n\t\t\t//get the user's email\n\t\t\t$email=get_user_by_id(yii::app()->request->cookies['uid'])->email;\n\t\t\t\n\t\t\t//log the user in\n\t\t\tif($this->user_login($email,yii::app()->request->cookies['pass'],true)){\n\t\t\t\t//renew cookies for n days more\n\t\t\t\t$this->remember_login(yii::app()->request->cookies['pass'],true);\n\t\t\t}\n\t\t}\n\t}", "function loginDifferentUser( $user_id ) //, $attributes_to_export, $seperationChar )\n {\n $http =& eZHTTPTool::instance();\n $currentuser =& eZUser::currentUser();\n $user =& eZUser::fetch( $user_id );\n\n if ($user==null)\n return false;\n\n //bye old user\n $currentID = $http->sessionVariable( 'eZUserLoggedInID' );\n $http =& eZHTTPTool::instance();\n $currentuser->logoutCurrent();\n\n //welcome new user\n $user->loginCurrent();\n $http->setSessionVariable( 'eZUserAdditionOldID', $user_id );\n\n return true;\n }", "public function check() {\n $check = $this->mysqli->query(\"SELECT * FROM user_info WHERE email='$this->email' && password ='$this->password' LIMIT 1\") or die($this->mysqli->error);\n $count = $check->num_rows;\n\n if ($count) {\n while($rows = $check->fetch_array(MYSQLI_ASSOC)){\n $this->loginID = $rows['loginID'];\n $_SESSION['loginID'] = $this->loginID;\n }\n $_SESSION['email'] = $this->email;\n $this->result .= \"Successfully Logged In\";\n } else {\n $this->result .= \"Sign In error!! Please try again\";\n }\n }", "public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }", "function checkLogin() {\n\t\t$fingerprint = fingerprint();\n\t\tsession_start();\n\t\tif (!isset($_SESSION['log_user']) || $_SESSION['log_fingerprint'] != $fingerprint) logout();\n\t\tsession_regenerate_id();\n\t}", "function log_in($user) {\n session_regenerate_id();\n $_SESSION['user_id'] = $user['id'];\n $_SESSION['username'] = $user['username'];\n $_SESSION['email'] = $user['email'];\n return true;\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "function m_checkLogin()\n\t{\n\t\t$this->libFunc->obDb = $this->obDb;\n\t\t$myreturn = $this->libFunc->m_checkAttempts(trim($this->request['email']));\n\t\tif($myreturn[0] == 0)\n\t\t{\n\t\t\t$this->obDb->query= \"select vFirstName,iCustmerid_PK FROM \".CUSTOMERS.\" WHERE vEmail = '\".$this->request['email'].\"' AND vPassword=PASSWORD('\".$this->request['password'].\"') AND iRegistered=1 \";\n\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t$rCount=$this->obDb->record_count;\n\n\t\t\tif($rCount==1) \n\t\t\t{\n\t\t\t\t$_SESSION['username']=$qryRs[0]->vFirstName;\n\t\t\t\t$_SESSION['userid']=$qryRs[0]->iCustmerid_PK;\n\t\t\t\t$this->m_generateToken();\n\t\t\t\tif(isset($this->request['save_info']))\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"email\",$this->request['email']);\n\t\t\t\t\tsetcookie(\"password\",$this->request['password']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"email\",\"\");\n\t\t\t\t\tsetcookie(\"password\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t$this->libFunc->m_addLoginAttempt($myreturn[0],$myreturn[1],$myreturn[2],trim($this->request['email']));\n\t\t\t\t$this->err=1;\n\t\t\t\t$this->errMsg=MSG_INVALID_USER;\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->libFunc->m_addLoginAttempt($myreturn[0],$myreturn[1],$myreturn[2],trim($this->request['email']));\n\t\t\tswitch($myreturn[0])\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$this->err=1;\n\t\t\t\t\t$this->errMsg=\"You have been temporarily blocked. Please try again in 15 minutes.\";\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->err=1;\n\t\t\t\t\t$this->errMsg=\"You have been temporarily blocked. Please try again in 1 hour. You can unblock your account by resetting your password.\";\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->err=1;\n\t\t\t\t\t$this->errMsg=\"You have been temporarily blocked. Please try again in 24 hours. You can unblock your account by resetting your password.\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}", "public function log_login() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE users SET last_seen = NOW() WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "public function test_login4()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('12345678','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testFakeLogin()\n {\n Auth::attempt(['email'=>'[email protected]','password'=>'fake123']);\n $this->assertNotTrue(Auth::check());\n }", "public function testLogin() {\n $this->assert_title(\"Login\");\n\n //Failed login\n testMacros::login($this->driver, \"[email protected]\", \"passwordwrong\");\n $this->assert_title(\"Login\");\n\n //Successful Login\n testMacros::login($this->driver, \"[email protected]\", \"password1\");\n $this->assert_title(\"CheckinChildren\");\n\n //Logout\n $this->get_element(\"name=profile\")->click();\n $this->get_element(\"name=logout\")->click();\n }", "public function checkFirstLogin();", "public function testLoginActionPass()\n {\n // creating a new user\n $user = $this->Users->newEntity([\n 'email' => '[email protected]',\n 'password' => 'test',\n ]);\n\n $user->set('role_id', 1);\n $user->set('active', 1);\n\n $this->Users->save($user);\n\n $login = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $this->post('/users/login', $login);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/admin/manager/users');\n\n $this->assertSession(5, 'Auth.User.id');\n $this->assertSession('[email protected]', 'Auth.User.email');\n }", "function loginThrowSession()\n {\n\n // define all the global variables\n global $database, $message, $user;\n\n if (isset($_SESSION['user_data']) || !empty($_SESSION['user_data'])) {\n\n // update the user_data that was stored in the session\n $user_data = $_SESSION['user_data'];\n\n // call the database to store the new session data\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE \" . TBL_USERS_ID . \" = \" . $user_data[TBL_USERS_ID] . \" AND \" . TBL_USERS_USERNAME . \" = '\" . $user_data[TBL_USERS_USERNAME] . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n $message->setError(\"Error while puling the user's required fields.\", Message::Error);\n return false;\n }\n\n // check if the user exists\n if ($database->getQueryNumRows($result, true) < 1) {\n return false;\n }\n\n $row = $database->getQueryEffectedRow($result, true);\n\n // ** Update the current session data ** //\n foreach ($row As $rowName => $rowValue) {\n $_SESSION[\"user_data\"][$rowName] = $rowValue;\n }\n\n // check if user has to log in again\n if ($user->mustSignInAgain()) {\n\n // ** Unset the session & cookies ** //\n unset($_SESSION[\"user_data\"]);\n unset($_COOKIE[\"user_data\"]);\n unset($_COOKIE[\"user_id\"]);\n setcookie(\"user_data\", null, -1, '/');\n setcookie(\"user_id\", null, -1, '/');\n\n // update the database so that the user can log in again\n $sql = \"UPDATE \" . TBL_USERS . \" SET \" . TBL_USERS_SIGNIN_AGAIN . \" = '0' WHERE \" . TBL_USERS_ID . \" = '\" . $user->getID() . \"' AND \" . TBL_USERS_USERNAME . \" = '\" . $user->getUsername() . \"'\";\n\n // get the sql results\n $database->getQueryResults($sql);\n if ($database->anyError()) {\n return false;\n }\n\n $message->setError(\"You've been logged out for security reasons\", Message::Error);\n return false;\n }\n\n // initiate the user data\n $user->initUserData();\n\n return true;\n } else {\n return false;\n }\n }", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "function login($user,$pass) {\n\t\t// Success: create session and set\n\t\t// Fail: fuck off and try again\n\t}", "public function testLogin()\n {\n $unUsuario =User::findOrFail(1);\n $this->browse(function ($browser) use ($unUsuario) {\n $browser->visit('/')\n ->type('identity', $unUsuario->name)\n ->type('password', 'secret')\n ->press('Accedeix')\n ->assertTrue(true);\n });\n }", "private function LogIn() : bool\n {\n\n //session::close();\n\n\n $not_specified_user_and_pass = empty($this->username) and empty($this->password);\n\n\n if($not_specified_user_and_pass)\n\n return false;\n\n\n $user = $this->user_details($this->username);\n\n\n $username_not_exists = !$user; //Not user\n\n\n if($username_not_exists)\n\n return false;\n\n\n\n $unrecognized_password = !$this->recognized_password();\n\n\n if($unrecognized_password)\n\n return false;\n\n\n $this->id = $user[\"id\"];\n\n return $this->set_session_key($user);\n\n\n\n }", "public function login()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "protected function checkLogin()\n {\n if (LOCATION == 'Live') {\n $this->markTestSkipped('Cannot run in Live environment');\n return;\n }\n $this->loginPage->open()\n ->navigateToContactUsViaSideButton()\n ->open()\n ->verifyPageIsLoaded()\n ->checkPageTitle('log in to My Account')\n ->enterUserId($this->userData['standard']['uid'])\n ->enterUserPassword($this->userData['standard']['pwd'])\n ->clickButton();\n }" ]
[ "0.69232047", "0.682093", "0.68052745", "0.67917126", "0.6763312", "0.6758325", "0.6706842", "0.6663564", "0.66578543", "0.6635829", "0.6615092", "0.66056216", "0.6552203", "0.65060383", "0.6481534", "0.64775264", "0.64558893", "0.6455745", "0.64354706", "0.64270693", "0.64079", "0.64078784", "0.6400049", "0.6399668", "0.6399489", "0.63968676", "0.6390678", "0.63903475", "0.6389481", "0.63875186" ]
0.8268698
0
Test login is online true Try to change field "is_online" to true with the details of logged in user
public function testLoginIsOnlineTrue() : void { $res = self::$dataService->login( "change_status", $this->userA["id"], "", "", [] ); $this->assertIsArray( $res, 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('status', $res, 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('msg', $res, 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('uid', $res, 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('name', $res, 'testLoginIsOnlineTrue' ); $this->assertCount(4, $res, 'testLoginIsOnlineTrue' ); $this->assertEquals( [ "status" => true, "msg" => "Welcome back test5", "uid" => "112387623", "name" => "test5" ], $res, 'testLoginIsOnlineTrue' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateUserOnline()\n {\n $this->is_online = 1;\n $this->save();\n }", "public function logInUserChangesToLoggedInStatus() {\n\t\t$user = new Tx_Oelib_Model_FrontEndUser();\n\t\t$this->subject->logInUser($user);\n\n\t\t$this->assertTrue(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}", "public function isOnline($me, $isOnline){\r\n $poll = $this->pdo->query(\"UPDATE users SET user_isOnline = '$isOnline' WHERE user_id = '$me'\");\r\n }", "public function ChangeUserOnlineStatus()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->ChangeUserOnlineStatus('online');\n exit(json_encode($output));\n }", "private function compare_with_login()\n {\n }", "function check_login($username,$password){\n\t\t $check=$this->db->prepare(\"SELECT * FROM user WHERE username=:user and password=:pass\");\n\t\t $check->bindParam(\":user\",$username,PDO::PARAM_STR);\n\t\t $check->bindParam(\":pass\",$password,PDO::PARAM_STR);\n\t\t $check->execute();\n\t\t if($check->rowCount()==1)\n\t\t {\n\t\t\t \n\t\t\t $admin=$check->fetch(PDO::FETCH_ASSOC);\n\t\t\t $_SESSION['username']=$admin['username'];\n\t\t\t $_SESSION['user']=$admin['user_id']; \n\t\t\t $this->db->query(\"UPDATE `user` SET `online_status`='1' WHERE user_id=$admin[user_id]\"); \n\t\t }\n\t\t \n\t\t }", "public function online() {\n\n\t\t// Skip when signing in/out to avoid strange Fatal error\n\t\tif (strpos(URI::instance()->string(), 'sign') === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Visitor::instance()->get_user();\n\t\t$online = new Online_User_Model($_SESSION['session_id']);\n\t\tif (!$online->loaded()) {\n\t\t\t$online->session_id = $_SESSION['session_id'];\n\t\t}\n\t\t$online->last_activity = $_SESSION['last_activity'];\n\t\t$online->user_id = $user ? $user->id : null;\n\t\ttry {\n\t\t\t$online->save();\n\t\t} catch (ORM_Validation_Exception $e) {}\n\t}", "public function isOnline($uname,$pass){\n\t\t$user = $this->find('first',array('user_name'=>$uname,'password'=>$pass));\n\t\tif(!empty($user)){\n\t\t\treturn $user['User']['online_flag']== 1;\n\t\t}\t\t\n\t}", "public function changeonlinestatus()\r\n {\r\n \tif ($this->isPost()) {\r\n \t\t$userloginid = session('userloginid');\r\n \t\tif (empty($userloginid)) {\r\n \t\t\t$this->ajaxReturn(0,\"没有登录呢\",'wrong');\r\n \t\t} else {\r\n \t\t\t$onlineValue = (int)$_POST['val_online'];\r\n \t\t\t$IUserLogin = D(\"IUserLogin\");\r\n \t\t\tif ($onlineValue == 2) {\r\n \t\t\t\t$newOnlineData = array(\r\n\t\t \t\t\t'uid' => $userloginid,\r\n\t\t \t\t\t'online' => 1,\r\n \t\t\t\t);\r\n \t\t\t\t$IUserLogin->save($newOnlineData);\r\n \t\t\t\t$this->ajaxReturn(1,\"已经切换为正常在线状态\",'yes');\r\n \t\t\t} else {\r\n \t\t\t\t$newOnlineData = array(\r\n\t\t \t\t\t'uid' => $userloginid,\r\n\t\t \t\t\t'online' => 2,\r\n \t\t\t\t);\r\n \t\t\t\t$IUserLogin->save($newOnlineData);\r\n \t\t\t\t$this->ajaxReturn(2,\"已经切换为潜水状态\",'yes');\r\n \t\t\t}\r\n \t\t\t$this->ajaxReturn(0,\"处理错误\",'wrong');\r\n \t\t}\r\n \t}\r\n }", "public function coustomer_login_data_check(){\n\t\t$dt = new DateTime('now', new DateTimezone('Asia/Dhaka'));\n\t\t$email \t\t\t= \t$this->input->post('email');\n\t\t$password \t\t=\tmd5($this->input->post('password'));\n\n\t\t$attar = array(\n\t\t\t'email'\t\t\t\t=>\t\t\t$email,\n\t\t\t'password'\t\t\t=>\t\t\t$password,\n\t\t\t);\n\t\t$result = $this->db->get_where('users',$attar);\n\t\tif($result->num_rows() == 1){\n\t\t\t$attr\t=\tarray(\n\t\t\t\t'current_user_id'\t\t=>\t$result->row(0)->id,\n\t\t\t\t'current_user_email'\t=>\t$email,\n\t\t\t\t'current_user_name'\t\t=>\t$result->row(20)->username,\n\t\t\t\t);\n\t\t\t$this->session->set_userdata($attr);\n\t\t\t$attard = array(\n\t\t\t\t'name'\t\t=>\t$this->session->userdata('current_user_id'),\n\t\t\t\t'user_name'\t=>\t$this->session->userdata('current_user_name'),\n\t\t\t\t'agent' \t=>\t$this->agent->browser(),\n\t\t\t\t'ip' \t\t=>\t$this->input->ip_address(),\n\t\t\t\t'platform'\t=> $this->agent->platform(),\n\t\t\t\t'date'\t\t=>\t$dt->format('F j, Y'),\n\t\t\t\t'time'\t\t=>\t$dt->format('g:i a'),\n\t\t\t\t'activity' \t=>\t1,\n\t\t\t);\n\t\t\t$this->db->insert('online_user_activity',$attard);\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function isOnline() {}", "function testSimpleLoginRequest() {\n $Record = $this->RecordObj->create(array('active'=>1));\n $this->AuthwellUser->create();\n $this->assertTrue($this->AuthwellUser->save($Record));\n #debug($this->AuthwellUser->invalidFields());\n\n // then call\n $FormData = array(\n 'AuthwellUser' => array(\n 'email_login' => $Record['email'],\n 'password_login' => $Record['password']\n )\n );\n\n $is_logged_in = $this->AuthwellUser->is_valid_login_request($FormData);\n $Cache = $this->AuthwellUser->UserDataCache;\n\n $this->assertTrue($is_logged_in);\n $this->assertEqual($Cache['User']['email'], $Record['email']);\n }", "public function isOnline() {\n }", "function trylogin()\n {\n\t\t$ret = false;\n\t\t\n $err = SHIN_Core::$_models['sys_user_model']->login();\n\n SHIN_Core::$_language->load('app', 'en');\n $err = SHIN_Core::$_language->line($err);\n\t\t\n if ($err != '') {\n SHIN_Core::$_libs['session']->set_userdata('loginErrorMessage', $err);\n } else {\n $this->sessionModel->start(SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\t$ret = true;\n\t\t\t\n\t\t\t// addons for new field added //////////////////////////\n\t\t\t// request by Stefano. Detail: http://binary-studio.office-on-the.net/issues/5287\n\t\t\t// \"host\" and \"lastlogin\" field \n\t\t\t$data = array('lastlogin' => date('Y-m-d H:i:s'), 'host' => SHIN_Core::$_input->ip_address());\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idUser', SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update('sys_user', $data); \t\t\n\t\t\t///////////////////////////////////////////////////////\n }\n\n\t\treturn $ret;\n }", "public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Partner) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }", "function testLoginSuccess()\r\n\t{\r\n \t$state = $this->User->login('[email protected]', 'password');\r\n\t\t$this->assertTrue($state);\r\n\t}", "public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }", "function loggedin() {return $this->login_state!=0;}", "private function setOnline($online)\n {\n $this->online = $online;\n }", "public function addLoginState(){\r\n\t\t$userId = $this->session->userdata('userId');\r\n\t\t$res = $this->curd_m->get_search(\"SELECT login_validate FROM users WHERE id=\".$userId,'object');\r\n\t\tif($res!==NULL && sizeof($res)==1){\r\n\t\t\tif( (time()-$res[0]->login_validate) > $this->config->item('sess_time_to_update')){\r\n\t\t\t\treturn $this->curd_m->get_update(\"users\",array('id'=>$userId,'login_validate'=>time()));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function _check_login()\n {\n\n }", "public function isLogin();", "public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }", "public function testLoggedStatus(){\n Session::flush();\n $user = $this->postuser();\n $status_message = $this->getStatus();\n $this->assertResponseOk();\n $this->assertTrue($status_message['message'] == 'user logged in');\n }", "public function checkFirstLogin();", "function isConnected(){\n if(isset( $_SESSION['user_login'],$_SESSION['password'])){\n return true;\n }\n\t\t//sinon return false \n else{\n return false;\n }\n }", "public function isLogin(): bool;", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "public function log_login() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE users SET last_seen = NOW() WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}" ]
[ "0.6793848", "0.66807455", "0.6678889", "0.6586851", "0.64440435", "0.6391763", "0.6382423", "0.6369644", "0.6298275", "0.6268402", "0.6254587", "0.62088144", "0.619948", "0.61746776", "0.6140125", "0.6139053", "0.6133409", "0.6092596", "0.6079666", "0.60538614", "0.60423124", "0.60268384", "0.6026304", "0.602036", "0.6019454", "0.60130656", "0.5980227", "0.597792", "0.597792", "0.59701633" ]
0.7566575
0
Test fetch all Try to get all online users
public function testFetchAll() : void { $res = self::$dataService->fetchAll(); $this->assertIsArray( $res, 'testFetchAll' ); $this->assertArrayHasKey('status', $res, 'testFetchAll' ); $this->assertArrayHasKey('msg', $res, 'testFetchAll' ); $this->assertCount(2, $res, 'testFetchAll' ); $this->assertEquals( [ "status" => false, "msg" => "Can not find online user(s)" ], $res, 'testFetchAll' ); /** * Try to login user again */ $this->testLogin(); $resB = self::$dataService->fetchAll(); $this->assertIsArray( $resB, 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('id', $resB[0], 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('name', $resB[0], 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('updated_at', $resB[0], 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('time', $resB[0], 'testLoginIsOnlineTrue' ); $this->assertArrayHasKey('ip', $resB[0], 'testLoginIsOnlineTrue' ); $this->assertCount(5, $resB[0], 'testLoginIsOnlineTrue' ); $this->assertEquals( "112387623", $resB[0]["id"], 'testLoginIsOnlineTrue' ); $this->assertEquals( "test5", $resB[0]["name"], 'testLoginIsOnlineTrue' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsersOnline()\r\n {\r\n $result = $this->getBitrixApi(array(\r\n 'FILTER' => array('IS_ONLINE' => 'Y',),\r\n ), 'user.get');\r\n\r\n if ($result) {\r\n if (isset($result['total']) && $result['total'] > 0) {\r\n return $result['result'];\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public static function listOnlineUsers() \n\t{\n\t\t$array = array(); \n\n\t\t$rst = \\Main\\DB::select(\"accounts_online\", \"user\");\n\t\twhile($row = $rst->fetch_object())\n\t\t{\n\t\t\t$accId = $row->user; \n\t\t\t$array[$accId] = self::getUserData($accId); \n\t\t}\n\t\t\n\t\treturn $array; \n\t}", "function fetchAllUsers() {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users order by id desc\");\n\t$results = $query->results();\n\treturn ($results);\n}", "public function fetch_users() : void\n {\n // $this->no_more_users();\n if($this->no_user == 2) {\n $this->page ++;\n $this->cache = 'infinite-users.' . $this->page;\n $skip = ($this->fetch * $this->page) - $this->fetch;\n $users = Cache::remember($this->cache, $this->cache_time, function () use($skip) {\n return DB::table('users')->select('id', 'name', 'phone', 'email', 'gender')\n ->skip($skip)\n ->take($this->fetch)\n ->get();\n });\n \n $page = $this->page + 1;\n $cache = 'infinite-users.' . $page;\n \n infiniteScrollCacheNextPage::dispatchIf(!Cache::has($cache), $cache, $page, $this->fetch, $this->cache_time);\n $this->emit('appendUsers', ['users' => $users]);\n } else {\n $this->no_more_users();\n }\n }", "public function getOnlineUserList(){\n $query = \"select * from $this->onlineUser_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0 ){\n return $result->fetchAll();\n }\n return null;\n }", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "public function obtenerUsuariosOnline(){\n return $this->obtenerUsuarios(\" uid_usuario IN ( SELECT uid_usuario FROM \". TABLE_USUARIO .\" u WHERE u.uid_usuario = uid_usuario AND conexion = 1 ) \");\n }", "public function getAllOnline()\n {\n return $this->query()->online()->get();\n }", "public function getOnlineUsers()\n {\n return $this->onlineUsers->getOnlineUsers();\n }", "abstract function getNonRegisteredUsers();", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "function users() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $query = \"select * from users;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n if ($r->num_rows > 0) {\n $result = array(); \n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200);\n } else {\n $this->response('',204);\n }\n }", "public function getUsersList()\n {\n }", "function get_users()\n {\n //Unimplemented\n }", "public function getAllUsers() {\n try{\n $conn = (new DB)->connect();\n\n $stmt = $conn->query(\"SELECT * FROM user\");\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $connection = null;\n return $result;\n\n }\n catch (PDOException $e) {\n echo json_encode([\n 'error' => $e->getMessage(),\n ]);\n \n print \"Error!: \" . $e->getMessage() . \"<br/>\";\n }\n exit;\n }", "public function fetch_all_users_get(){\n\n header(\"Access-Controll-Allow-Origin: *\");\n\n $data = $this->Users_Model->fetch_all_users();\n\n $this->response($data);\n\n }", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "public function all_user_connected() {\n try\n {\n $max_last_ping = time() - 31;\n $stmt = $this->db->prepare(\"SELECT * FROM connected_user WHERE last_ping > :last_ping\");\n $stmt->execute(array(\n 'last_ping' => $max_last_ping\n ));\n\n while($result = $stmt->fetch()) {\n $listid[] = $result['id_user'];\n }\n \n return $listid;\n }\n catch(PDOException $e) {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "public function get_users_online()\n {\n $logged_in_users = get_transient('agents_online'); //Get the active users from the transient.\n $count = 0;\n\n if($logged_in_users) {\n foreach ($logged_in_users as $logged_in_user) {\n if (isset($logged_in_user['last']) && ($logged_in_user['last'] > (time()-60) )) {\n $count++;\n }\n }\n } \n \n echo $count;\n die();\n }", "protected function GetAllUsers()\r\n {\r\n $sql = \"SELECT * FROM `users`\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n while ($row = $result->fetch_assoc()) {\r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }", "public function GetAllUnite() {\n if ($this->get_request_method() != \"GET\") {\n $this->response('', 406);\n }\n\n $sql = $this->db->prepare(\"SELECT * FROM unite\");\n $sql->execute();\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\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[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n }", "public function getAllUsers() {\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM `tbl_users` WHERE `usr_type` = 0 ORDER BY `usr_id` ASC\");\n\t\t$stmt->execute();\n\t\t$result = getResult($stmt);\n\t\t$stmt->close();\n\t\treturn $result;\n\t}", "protected function getAllUsers() {\n\t\t\t$query = \"SELECT username, f_name, l_name, phone, email FROM Stomper\";\n\t\t\treturn $this->EndpointResponse($query, true);\n\t\t}", "public function get_users()\n {\n $isFetched = $this->User_m->get_users_m();\n \n $res['status'] = $isFetched ? true : false;\n $res['message'] = $isFetched ? 'Users fetched.' : 'Users not found.';\n $res['count'] = $this->count_user();\n $res['data'] = $isFetched;\n \n http_response_code(200);\n\n echo json_encode($res);\n }" ]
[ "0.70183104", "0.68665636", "0.68665636", "0.68665636", "0.6811415", "0.67927295", "0.6779848", "0.6773477", "0.6773205", "0.67714256", "0.67707515", "0.67453784", "0.6730475", "0.6711639", "0.6698908", "0.6695338", "0.6695338", "0.6691031", "0.6678113", "0.66718805", "0.66682595", "0.6651458", "0.6640848", "0.66159457", "0.6603371", "0.6586107", "0.6579181", "0.6568419", "0.6558737", "0.6555617" ]
0.7209962
0
List of all the Custom HTML Pages
public function renderList() { $pages = $this->module->getAllHTMLPages(true /* get inactive as well */); $content = ''; if (!$pages) return $content; foreach ($pages as $i => $page) { $pages[$i]['full_url'] = $this->module->getFullURLForPage($pages[$i], $pages); } $fieldsList = [ 'id_page' => [ 'title' => 'ID', 'align' => 'center', 'class' => 'fixed-width-xs', ], 'name' => [ 'title' => $this->l('Name'), ], 'full_url' => [ 'title' => $this->l('Full URL'), ], 'active' => [ 'title' => $this->l('Active'), 'active' => 'status', 'type' => 'bool', ] ]; $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = true; $helper->actions = ["edit", "delete", ]; $helper->show_toolbar = false; $helper->module = $this; $helper->listTotal = count($pages); $helper->identifier = 'id_page'; $helper->position_identifier = 'id_page'; $helper->title = "Custom Pages"; $helper->orderBy = 'full_url'; $helper->orderWay = 'DESC'; $helper->table = $this->table; $helper->token = Tools::getAdminTokenLite('AdminCustomHTMLPages'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $content .= $helper->generateList($pages, $fieldsList); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionList()\n {\n $this->adminOnly();\n\n $pages = $this->findAll();\n return $this->render('@custom_pages/views/common/list', [\n 'pages' => $pages,\n 'label' => Yii::createObject($this->getPageClassName())->getLabel(),\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()\n ]);\n }", "public function getPages() {}", "public function getPages();", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "public function pagesOnly() {}", "function listAllPages() {\n $PAGES_PATH = $_SERVER['DOCUMENT_ROOT'] . '/pages';\n //Ignore '.', '..', and '.gitkeep' in the returned directory array:\n $files = array_diff(scandir($PAGES_PATH), array('.', '..', '.gitkeep'));\n\n //ignore if there are no pages\n if ($files) {\n foreach($files as $file) {\n $pageName = substr($file, 0, strrpos($file, \".\"));\n echo '<li class=\"pages-menu-item\"><a href=\"/pages/' . $pageName . '.php\" id=\"pages-menu-' . $pageName . '\" style=\"text-decoration: none; color: #FFFFFF;\">' . $pageName . '</a></li>';\n }\n }\n }", "public function getAllPages()\n {\n // Get a list of all viewable pages\n $home = Page::getByID(1);\n $homeStr = $home->getCollectionPath();\n\n $pl = new PageList();\n $pl->filterByPath($homeStr, TRUE);\n $pl->ignoreAliases();\n\n $allowedPages = (array) $pl->get();\n $perm = new Permissions($home);\n\n if($perm->canRead()) array_unshift($allowedPages, $home);\n\n $this->set('allowedPages', $allowedPages);\n }", "function findPageUrls();", "public static function find_all()\n\t{\n\t\t# TODO: return WikirPage instances\n\t\treturn file_list_dir(option('pages_dir'));\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "function shoutbox_pages() {\n\t\tglobal $lang;\n\t\t$pages[] = array(\n\t\t\t'func' => 'posts',\n\t\t\t'title' => $lang['shoutbox']['page posts']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'clean',\n\t\t\t'title' => $lang['shoutbox']['clean shoutbox']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'settings',\n\t\t\t'title' => $lang['shoutbox']['page settings']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'check_updates',\n\t\t\t'title' => $lang['shoutbox']['updates']\n\t\t);\n\t\treturn $pages;\n\t}", "public function allPages()\n {\n $this->get('/', function(Request $request, Response $response) {\n $templates = [];\n foreach(new DirectoryIterator($this->basePath . '/src/views/') as $fileInfo) {\n if ($fileInfo->isFile() && strtolower($fileInfo->getExtension()) === 'twig') {\n $baseName = $fileInfo->getBasename('.twig');\n\n $templates[$baseName] = [\n 'name' => $baseName,\n 'has_data' => file_exists($this->basePath . '/src/data/' . $baseName . '.php'),\n ];\n }\n }\n ksort($templates);\n\n return $this->view->render($response, 'app_pages.twig', ['templates' => $templates, 'css_url' => $cssUrl]);\n })->setName('templates.list');\n\n return $this;\n }", "public function GetPages(){\n\t\t$this->MediaType = 'application/xhtml+xml';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\t\n\t}", "public function indexTypo3PageContent() {}", "public static function get_Pages_For_Globalizing_HTML(): string\n {\n $html = ' <option value=\"883\" selected=\"selected\"> 404</option>\n <option value=\"6086\"> about</option>\n <option value=\"6088\"> about/aims_and_scope</option>\n <option value=\"4967\"> about/article_level_metrics</option>\n <option value=\"323\"> about/article_processing_charges</option>\n <option value=\"307\"> about/contact</option>\n <option value=\"317\"> about/faq</option>\n <option value=\"1786\"> about/financial_support</option>\n <option value=\"7107\"> about/journal_statistics</option>\n <option value=\"308\"> about/journal_subject_areas</option>\n <option value=\"324\"> about/manuscript_types</option>\n <option value=\"10252\"> about/manuscript_types/acp letters</option>\n <option value=\"8798\"> about/mobile_abstracted_indexed</option>\n <option value=\"8797\"> about/mobile_journal_metrics</option>';\n\n return $html;\n }", "function allPagesObject()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php\");\n\t\t\n\t\t$this->addPagesSubTabs();\n\t\t\n\t\t$table_gui = new ilWikiPagesTableGUI($this, \"allPages\",\n\t\t\t$this->object->getId(), IL_WIKI_ALL_PAGES);\n\t\t\t\n\t\t$this->setSideBlock();\n\t\t$tpl->setContent($table_gui->getHTML());\n\t}", "protected function getPage() {}", "protected function getPage() {}", "public function get_admin_pages() {\n\t\treturn apply_filters( 'pslug_admin_pages_object', array(\n\t\t\t'settings' => array(\n\t\t\t\t'general',\n\t\t\t),\n\t\t) );\n\t}", "public function getPages(){\n $defaultTheme = env('THEME', 'default');\n $path = app_path() . \"/../resources/views/themes/$defaultTheme/\";\n $pagePath = $path . \"pages\";\n $metaFilePath = $path . \"$defaultTheme.json\";\n\n try{\n\n $validator = file_exists($metaFilePath) && is_dir($pagePath);\n if ($validator){\n // Read file list from directory\n $pages = [];\n if ($dh = opendir($pagePath)){\n while (($file = readdir($dh)) !== false){\n $filePath = $pagePath . '/' . $file; \n if ($file == '.' || $file == '..') {\n continue;\n }\n $content = file_get_contents($filePath);\n $info = $this->extractInfo($content);\n $pages[] = [\n 'name' => $file,\n 'page-name' => substr($file, 0, strpos($file, '.')),\n 'info' => isset($info[1]) ? json_decode($info[1], true) : null\n ];\n }\n closedir($dh);\n }\n return $pages;\n }\n else{\n return [];\n }\n }\n catch (\\Exception $e){ \n return [];\n }\n }", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "public function pages() {\n\t\t// Build the MindTouch API URL to fetch the pages.\n\t\t$url = \"pages\";\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function action_ajax_get_pages_list() {\n\t\t// Get the media model\n\t\t$plugin_model = new Model_Pages();\n\n\t\t// Get the complete list of Pages\n\t\t$list = array();\n\t\tforeach ($plugin_model->get_all_pages('name_tag ASC') as $item) {\n\t\t\tarray_push($list, $item);\n\t\t}\n\n\t\t// Return\n\t\t$this->auto_render = false;\n\t\t$this->response->body(json_encode($list));\n\t}", "public function index()\n {\n return view('admin.page_contents.page_content_list');\n }", "public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "public function getPages()\n\t{\n\t\treturn $this->dashletdefs['pages'];\n\t}", "public function get_page_info()\n {\n }", "function create_custom_pages() {\n $custom_pages = array(\n 'issues' => 'Issues',\n 'weeklies' => 'Weeklies',\n 'artists' => 'Artists',\n 'contributors' => 'Contributors',\n 'incubator' => 'Incubator',\n 'about' => 'About',\n 'shop' => 'Shop',\n 'contribute' => 'How to Contribute',\n 'contact' => 'Contact Us',\n 'faq' => 'FAQ',\n 'definitions' => 'Definitions',\n 'terms-and-conditions' => 'Terms & Conditions',\n 'bag' => 'Bag',\n );\n foreach($custom_pages as $page_name => $page_title) {\n $page = get_page_by_path($page_name);\n if( empty($page) ) {\n wp_insert_post( array(\n 'post_type' => 'page',\n 'post_title' => $page_title,\n 'post_name' => $page_name,\n 'post_status' => 'publish'\n ));\n }\n }\n}", "protected function _getPages(){\n $pages = array(\n array(\n 'main' => array(\n 'label' => 'Dashboard',\n 'controller' => 'dashboard',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Summary',\n 'controller' => 'dashboard',\n 'action' => 'index',\n ),\n array(\n 'label' => 'Profile',\n 'controller' => 'profile',\n 'action' => 'index',\n ),\n \tarray(\n \t\t'label' => 'Phpinfo',\n \t\t'controller' => 'system',\n \t\t'action' => 'phpinfo',\n \t),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'System',\n 'controller' => 'system',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Groups',\n 'controller' => 'groups',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Users',\n 'controller' => 'users',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Privileges',\n 'controller' => 'privileges',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Flags',\n 'controller' => 'flags',\n 'action' => 'index',\n 'scope' => '*'\n ),\n ),\n\n ),\n array(\n 'main' => array(\n 'label' => 'Parameters',\n 'controller' => 'portails',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Portails',\n 'controller' => 'portails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'PortailUrl',\n 'controller' => 'portailurl',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Paramètres',\n 'controller' => 'params',\n 'action' => 'index',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Mails',\n 'controller' => 'mails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Exporter',\n 'controller' => 'params',\n 'action' => 'exportparam',\n //'scope' => 'export'\n ),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Tools',\n 'controller' => 'tools',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Generate Models',\n 'controller' => 'generate',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Clear Cache',\n 'controller' => 'tools',\n 'action' => 'cleancache',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Bdd',\n 'controller' => 'tools',\n 'action' => 'adminer',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Backups',\n 'controller' => 'backup',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Backup Bdd',\n 'controller' => 'backup',\n 'action' => 'bdd',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Backup Files',\n 'controller' => 'backup',\n 'action' => 'files',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Benchmark',\n 'controller' => 'benchmark',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Benchmark 1',\n 'controller' => 'benchmark',\n 'action' => 'benchmark1',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Benchmark 2',\n 'controller' => 'benchmark',\n 'action' => 'benchmark2',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Examples',\n 'controller' => 'system',\n 'action' => 'example'\n ),\n 'pages' => array(\n array(\n 'label' => 'Theme',\n 'controller' => 'system',\n 'action' => 'example',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Errors',\n 'controller' => 'system',\n 'action' => 'example-errors',\n //'scope' => '*'\n ),\n\n ),\n\n ),\n );\n\n return $pages;\n }" ]
[ "0.7185867", "0.68720776", "0.6846711", "0.67879224", "0.66561687", "0.6653738", "0.6600146", "0.65254563", "0.65117264", "0.65081114", "0.6493634", "0.64551497", "0.645325", "0.6385917", "0.63641644", "0.6349041", "0.63240993", "0.6323212", "0.6311587", "0.63021666", "0.62922436", "0.6290103", "0.62887967", "0.626777", "0.6261372", "0.62545764", "0.62423855", "0.6207863", "0.62066144", "0.6202954" ]
0.69588643
1
Turning a page on or off from the main table
public function toggleStatus() { $pageId = Tools::getValue('id_page'); Db::getInstance()->update( $this->module->table_name, ['active' => !$this->module->getHTMLPageStatus($pageId)], 'id_page = ' . $pageId ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOnPage($value){\n\t\t$this->on_page = $value;\n\t}", "public function switchPagePanel() {\n\t\t$request = GeneralUtility::_GET('request');\n\t\t$arguments = $request['arguments'];\n\n\t\t$GLOBALS['BE_USER']->uc['tx_versaillesutilities_page_panel'] = $arguments['flag'];\n\t\t$GLOBALS['BE_USER']->overrideUC();\n\t\t$GLOBALS['BE_USER']->writeUC();\n\n\t\techo $GLOBALS['BE_USER']->uc['tx_versaillesutilities_page_panel'];\n\t}", "public function table($page = '0') {\n if ($this->SyndicationMethod == SYNDICATION_NONE) {\n $this->View = 'table';\n }\n $this->index($page);\n }", "function BeforeMoveNextList(&$data, &$row, &$record, &$pageObject)\n{\n\n\t\t\nif ($data['mode'])\n$record[\"MyButton\"]=true;\n\n\n;\t\t\n}", "public function switchOn();", "function isOnPage(){\n return $this->on_page != 'f';\n\t}", "function setIsOn($isOn){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE bot_on_off SET isOn = :isOn');\n\t\t$statement->bindValue(':isOn', $isOn, PDO::PARAM_INT);\n\t\t$statement->execute();\n\t}", "public function pageAction(){\n $this->_request->setParam('table', 'Page'); \n \t$this->view->gridIndexRoute = Rhema_Constant::ROUTE_GRID_INDEX ; \t \n \t$this->_helper->displayGrid(); \t \n }", "function extra_tablenav( $which ) {\r\n if ( $which == \"top\" ){\r\n //The code that goes before the table is here\r\n }\r\n if ( $which == \"bottom\" ){\r\n //The code that goes after the table is there\r\n }\r\n }", "function status_activate($page_id)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->db->where('pageid',$page_id);\n\t\t\t\t\t\n\t\t\t\t\t$data \t= \t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->db->update('oxm_pagedetails', $data);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t }", "function toggle($cid)\n\t{\n\t\t/*\n\t\t * We need to update frontpage status for the articles.\n\t\t *\n\t\t * First we include the frontpage table and instantiate an instance of\n\t\t * it.\n\t\t */\n\t\t$fp = & JTable::getInstance('frontpage', 'Table');\n\n\t\tforeach ($cid as $id)\n\t\t{\n\t\t\t// toggles go to first place\n\t\t\tif ($fp->load($id)) {\n\t\t\t\tif (!$fp->delete($id)) {\n\t\t\t\t\t$msg .= $fp->stderr();\n\t\t\t\t}\n\t\t\t\t$fp->ordering = 0;\n\t\t\t} else {\n\t\t\t\t// new entry\n\t\t\t\t$query = 'INSERT INTO #__content_frontpage' .\n\t\t\t\t\t\t' VALUES ('. (int) $id .', 0)';\n\t\t\t\t$this->_db->setQuery($query);\n\t\t\t\tif (!$this->_db->query()) {\n\t\t\t\t\tJError::raiseError(500, $this->_db->stderr());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$fp->ordering = 0;\n\t\t\t}\n\t\t\t$fp->reorder();\n\t\t}\n\t\treturn true;\n\t}", "private function setPageSelect()\n {\n $GLOBALS['TSFE']->sys_page = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_pageSelect');\n $GLOBALS['TSFE']->sys_page->versioningPreview = false;\n $GLOBALS['TSFE']->sys_page->versioningWorkspaceId = false;\n $GLOBALS['TSFE']->where_hid_del = ' AND pages.deleted=0';\n $GLOBALS['TSFE']->sys_page->init(false);\n $GLOBALS['TSFE']->sys_page->where_hid_del .= ' AND pages.doktype<200';\n $GLOBALS['TSFE']->sys_page->where_groupAccess\n = $GLOBALS['TSFE']->sys_page->getMultipleGroupsWhereClause('pages.fe_group', 'pages');\n }", "public function togglePagination($paginate = false)\n\t{\n\t\tif ($paginate === false) {\n\t\t\t$this->paginate = false;\n\t\t} else {\n\t\t\t$this->paginate = (int) $paginate;\n\t\t}\n\t}", "public function set_page($page);", "public function post_on(){\n\n\t\tSettings::where_in('type', 'indira')->and_where('param', '=', 'under_development')->update(array('value' => 'true'));\n\n\t\t$data = array();\n\t\t$data[\"on\"] = 'active';\n\t\t$data[\"off\"] = null;\n\n\t\tIndira::set('indira.under_development');\n\n\t\treturn View::make('admin.development.thumbler', $data);\n\t}", "protected function startTable() {}", "function toggle_active_site()\n{\n\t$this->db->where('id_table',0 );// there is just one row in table site with id \"0\"\n $query = $this->db->get('site');\n $row = $query->row();\n $active = $row->active;\nif ($active)\n{\n $data = array('active' => 0); \n}\nelse \n{\n $data = array('active' => 1); \n}\n \n\t$this->db->where('id_table',0 );\n\t$this->db->update('site', $data); \n}", "function activatePages()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilLMPage.php\");\n\t\tif (is_array($_POST[\"id\"]))\n\t\t{\n\t\t\t$act_items = array();\n\t\t\t// get all \"top\" ids, i.e. remove ids, that have a selected parent\n\t\t\tforeach($_POST[\"id\"] as $id)\n\t\t\t{\n\t\t\t\t$path = $this->tree->getPathId($id);\n\t\t\t\t$take = true;\n\t\t\t\tforeach($path as $path_id)\n\t\t\t\t{\n\t\t\t\t\tif ($path_id != $id && in_array($path_id, $_POST[\"id\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$take = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($take)\n\t\t\t\t{\n\t\t\t\t\t$act_items[] = $id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\tforeach($act_items as $id)\n\t\t\t{\n\t\t\t\t$childs = $this->tree->getChilds($id);\n\t\t\t\tforeach($childs as $child)\n\t\t\t\t{\n\t\t\t\t\tif (ilLMObject::_lookupType($child[\"child\"]) == \"pg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$act = ilLMPage::_lookupActive($child[\"child\"],\n\t\t\t\t\t\t\t$this->content_object->getType());\n\t\t\t\t\t\tilLMPage::_writeActive($child[\"child\"],\n\t\t\t\t\t\t\t$this->content_object->getType(), !$act);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ilLMObject::_lookupType($id) == \"pg\")\n\t\t\t\t{\n\t\t\t\t\t$act = ilLMPage::_lookupActive($id,\n\t\t\t\t\t\t$this->content_object->getType());\n\t\t\t\t\tilLMPage::_writeActive($id,\n\t\t\t\t\t\t$this->content_object->getType(), !$act);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"no_checkbox\"), true);\n\t\t}\n\t\t\n\t\t$this->ctrl->redirect($this, \"view\");\n\t}", "function setActive() ;", "public function setCurrentPage( $page );", "public function post_off(){\n\n\t\tSettings::where_in('type', 'indira')->and_where('param', '=', 'under_development')->update(array('value' => 'false'));\n\n\t\t$data = array();\n\t\t$data[\"on\"] = null;\n\t\t$data[\"off\"] = 'active';\n\n\t\tIndira::set('indira.under_development');\n\n\t\treturn View::make('admin.development.thumbler', $data);\n\t}", "public static function switch_on(PageData $page_data) {\r\n\t\tforeach (self::get_js_paths(self::get_enabled_components()) as $js_path) {\r\n\t\t\t$page_data->head->add_js_file($js_path);\r\n\t\t}\r\n\t\tforeach (self::get_css_paths(self::get_enabled_components()) as $css_path) {\r\n\t\t\t$page_data->head->add_css_file($css_path);\r\n\t\t}\r\n\t}", "public function getPageMode() {}", "public function autrePageEstActif(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['AUTRE'])) return false;\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['AUTRE']['ACTIVE'])) return false;\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['AUTRE']['ACTIVE']==\"1\";\n\t}", "public function makeControl($table, $row)\n {\n \n $rowUid = $row['uid'];\n if (ExtensionManagementUtility::isLoaded('version') && isset($row['_ORIG_uid'])) {\n $rowUid = $row['_ORIG_uid'];\n }\n $cells = [\n 'primary' => [],\n 'secondary' => []\n ];\n // If the listed table is 'pages' we have to request the permission settings for each page:\n $localCalcPerms = 0;\n if ($table === 'pages') {\n $localCalcPerms = $this->getBackendUserAuthentication()->calcPerms(BackendUtility::getRecord('pages', $row['uid']));\n }\n $permsEdit = $table === 'pages'\n && $this->getBackendUserAuthentication()->checkLanguageAccess(0)\n && $localCalcPerms & Permission::PAGE_EDIT\n || $table !== 'pages'\n && $this->calcPerms & Permission::CONTENT_EDIT\n && $this->getBackendUserAuthentication()->recordEditAccessInternals($table, $row);\n $permsEdit = $this->overlayEditLockPermissions($table, $row, $permsEdit);\n // \"Show\" link (only pages and tt_content elements)\n if ($table === 'pages' || $table === 'tt_content') {\n $onClick = $this->getOnClickForRow($table, $row);\n $viewAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"'\n . htmlspecialchars($onClick) . '\" title=\"' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage')) . '\">'\n . $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';\n $this->addActionToCellGroup($cells, $viewAction, 'view');\n }\n // \"Edit\" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id)\n if ($permsEdit) {\n $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';\n $iconIdentifier = 'actions-open';\n if ($table === 'pages') {\n $iconIdentifier = 'actions-page-open';\n }\n $overlayIdentifier = !$this->isEditable($table) ? 'overlay-readonly' : null;\n $editAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '\">' . $this->iconFactory->getIcon($iconIdentifier, Icon::SIZE_SMALL, $overlayIdentifier)->render() . '</a>';\n } else {\n $editAction = $this->spaceIcon;\n }\n $this->addActionToCellGroup($cells, $editAction, 'edit');\n // \"Info\": (All records)\n $onClick = 'top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . (int)$row['uid'] . '); return false;';\n $viewBigAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"' . htmlspecialchars($onClick) . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('showInfo')) . '\">'\n . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '</a>';\n $this->addActionToCellGroup($cells, $viewBigAction, 'viewBig');\n // \"Move\" wizard link for pages/tt_content elements:\n if ($permsEdit && ($table === 'tt_content' || $table === 'pages')) {\n $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element') . '&table=' . $table . '&uid=' . $row['uid']) . ');';\n $linkTitleLL = htmlspecialchars($this->getLanguageService()->getLL('move_' . ($table === 'tt_content' ? 'record' : 'page')));\n $icon = ($table === 'pages' ? $this->iconFactory->getIcon('actions-page-move', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL));\n $moveAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"' . htmlspecialchars($onClick) . '\" title=\"' . $linkTitleLL . '\">' . $icon->render() . '</a>';\n $this->addActionToCellGroup($cells, $moveAction, 'move');\n }\n // If the table is NOT a read-only table, then show these links:\n if ($this->isEditable($table)) {\n // \"Revert\" link (history/undo)\n $moduleUrl = BackendUtility::getModuleUrl('record_history', ['element' => $table . ':' . $row['uid']]);\n $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\\'#latest\\');';\n $historyAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"' . htmlspecialchars($onClick) . '\" title=\"'\n . htmlspecialchars($this->getLanguageService()->getLL('history')) . '\">'\n . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render() . '</a>';\n /**\n * CUSTOM DONT SHOW HISTORY BUTTON\n * $this->addActionToCellGroup($cells, $historyAction, 'history');\n */ \n \n // Versioning:\n if (ExtensionManagementUtility::isLoaded('version') && ExtensionManagementUtility::isLoaded('compatibility7') && !ExtensionManagementUtility::isLoaded('workspaces')) {\n $vers = BackendUtility::selectVersionsOfRecord($table, $row['uid'], 'uid', $this->getBackendUserAuthentication()->workspace, false, $row);\n // If table can be versionized.\n if (is_array($vers)) {\n $href = BackendUtility::getModuleUrl('web_txversionM1', [\n 'table' => $table, 'uid' => $row['uid']\n ]);\n $versionAction = '<a class=\"btn btn-default\" href=\"' . htmlspecialchars($href) . '\" title=\"'\n . htmlspecialchars($this->getLanguageService()->getLL('displayVersions')) . '\">'\n . $this->iconFactory->getIcon('actions-version-page-open', Icon::SIZE_SMALL)->render() . '</a>';\n $this->addActionToCellGroup($cells, $versionAction, 'version');\n }\n }\n // \"Edit Perms\" link:\n if ($table === 'pages' && $this->getBackendUserAuthentication()->check('modules', 'system_BeuserTxPermission') && ExtensionManagementUtility::isLoaded('beuser')) {\n $href = BackendUtility::getModuleUrl('system_BeuserTxPermission') . '&id=' . $row['uid'] . '&tx_beuser_system_beusertxpermission[action]=edit' . $this->makeReturnUrl();\n $permsAction = '<a class=\"btn btn-default\" href=\"' . htmlspecialchars($href) . '\" title=\"'\n . htmlspecialchars($this->getLanguageService()->getLL('permissions')) . '\">'\n . $this->iconFactory->getIcon('actions-lock', Icon::SIZE_SMALL)->render() . '</a>'; \n $this->addActionToCellGroup($cells, $permsAction, 'perms');\n }\n // \"New record after\" link (ONLY if the records in the table are sorted by a \"sortby\"-row\n // or if default values can depend on previous record):\n if (($GLOBALS['TCA'][$table]['ctrl']['sortby'] || $GLOBALS['TCA'][$table]['ctrl']['useColumnsForDefaultValues']) && $permsEdit) {\n if ($table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT || $table === 'pages' && $this->calcPerms & Permission::PAGE_NEW) {\n if ($this->showNewRecLink($table)) {\n $params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';\n $icon = ($table === 'pages' ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));\n $titleLabel = 'new';\n if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {\n $titleLabel .= ($table === 'pages' ? 'Page' : 'Record');\n }\n $newAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL($titleLabel)) . '\">'\n . $icon->render() . '</a>';\n $this->addActionToCellGroup($cells, $newAction, 'new');\n }\n }\n }\n // \"Up/Down\" links\n if ($permsEdit && $GLOBALS['TCA'][$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {\n if (isset($this->currentTable['prev'][$row['uid']])) {\n // Up\n $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']];\n $moveUpAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"'\n . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');')\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('moveUp')) . '\">'\n . $this->iconFactory->getIcon('actions-move-up', Icon::SIZE_SMALL)->render() . '</a>';\n } else {\n $moveUpAction = $this->spaceIcon;\n }\n $this->addActionToCellGroup($cells, $moveUpAction, 'moveUp');\n\n if ($this->currentTable['next'][$row['uid']]) {\n // Down\n $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']];\n $moveDownAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"'\n . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');')\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('moveDown')) . '\">'\n . $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render() . '</a>';\n } else {\n $moveDownAction = $this->spaceIcon;\n }\n $this->addActionToCellGroup($cells, $moveDownAction, 'moveDown');\n }\n // \"Hide/Unhide\" links:\n $hiddenField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];\n\n if (\n !empty($GLOBALS['TCA'][$table]['columns'][$hiddenField])\n && (empty($GLOBALS['TCA'][$table]['columns'][$hiddenField]['exclude'])\n || $this->getBackendUserAuthentication()->check('non_exclude_fields', $table . ':' . $hiddenField))\n ) {\n if (!$permsEdit || $this->isRecordCurrentBackendUser($table, $row)) {\n $hideAction = $this->spaceIcon;\n } else {\n $hideTitle = htmlspecialchars($this->getLanguageService()->getLL('hide' . ($table === 'pages' ? 'Page' : '')));\n $unhideTitle = htmlspecialchars($this->getLanguageService()->getLL('unHide' . ($table === 'pages' ? 'Page' : '')));\n if ($row[$hiddenField]) {\n $params = 'data[' . $table . '][' . $rowUid . '][' . $hiddenField . ']=0';\n $hideAction = '<a class=\"btn btn-default t3js-record-hide\" data-state=\"hidden\" href=\"#\"'\n . ' data-params=\"' . htmlspecialchars($params) . '\"'\n . ' title=\"' . $unhideTitle . '\"'\n . ' data-toggle-title=\"' . $hideTitle . '\">'\n . $this->iconFactory->getIcon('actions-edit-unhide', Icon::SIZE_SMALL)->render() . '</a>';\n } else {\n $params = 'data[' . $table . '][' . $rowUid . '][' . $hiddenField . ']=1';\n $hideAction = '<a class=\"btn btn-default t3js-record-hide\" data-state=\"visible\" href=\"#\"'\n . ' data-params=\"' . htmlspecialchars($params) . '\"'\n . ' title=\"' . $hideTitle . '\"'\n . ' data-toggle-title=\"' . $unhideTitle . '\">'\n . $this->iconFactory->getIcon('actions-edit-hide', Icon::SIZE_SMALL)->render() . '</a>';\n }\n }\n $this->addActionToCellGroup($cells, $hideAction, 'hide');\n }\n // \"Delete\" link:\n $disableDeleteTS = $this->getBackendUserAuthentication()->getTSConfig('options.disableDelete');\n $disableDelete = (bool) trim(isset($disableDeleteTS['properties'][$table]) ? $disableDeleteTS['properties'][$table] : $disableDeleteTS['value']);\n if ($permsEdit && !$disableDelete && ($table === 'pages' && $localCalcPerms & Permission::PAGE_DELETE || $table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT)) {\n // Check if the record version is in \"deleted\" state, because that will switch the action to \"restore\"\n if ($this->getBackendUserAuthentication()->workspace > 0 && isset($row['t3ver_state']) && (int)$row['t3ver_state'] === 2) {\n $actionName = 'restore'; \n $refCountMsg = '';\n } else {\n $actionName = 'delete';\n $refCountMsg = BackendUtility::referenceCount(\n $table,\n $row['uid'],\n ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.referencesToRecord'),\n $this->getReferenceCount($table, $row['uid'])\n ) . BackendUtility::translationCount(\n $table,\n $row['uid'],\n ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.translationsOfRecord')\n );\n }\n\n if ($this->isRecordCurrentBackendUser($table, $row)) {\n $deleteAction = $this->spaceIcon;\n } else {\n $title = BackendUtility::getRecordTitle($table, $row);\n $warningText = $this->getLanguageService()->getLL($actionName . 'Warning') . ' \"' . $title . '\" ' . '[' . $table . ':' . $row['uid'] . ']' . $refCountMsg;\n\n $params = 'cmd[' . $table . '][' . $row['uid'] . '][delete]=1';\n $icon = $this->iconFactory->getIcon('actions-edit-' . $actionName, Icon::SIZE_SMALL)->render();\n $linkTitle = htmlspecialchars($this->getLanguageService()->getLL($actionName));\n $deleteAction = '<a class=\"btn btn-default t3js-record-delete\" href=\"#\" '\n . ' data-l10parent=\"' . htmlspecialchars($row['l10n_parent']) . '\"'\n . ' data-params=\"' . htmlspecialchars($params) . '\" data-title=\"' . htmlspecialchars($title) . '\"'\n . ' data-message=\"' . htmlspecialchars($warningText) . '\" title=\"' . $linkTitle . '\"'\n . '>' . $icon . '</a>';\n }\n } else {\n $deleteAction = $this->spaceIcon;\n }\n DebuggerUtility::var_dump($deleteAction, 'DeleteAction in Test Record List');\n $this->addActionToCellGroup($cells, $deleteAction, 'delete');\n // \"Levels\" links: Moving pages into new levels...\n if ($permsEdit && $table === 'pages' && !$this->searchLevels) {\n // Up (Paste as the page right after the current parent page)\n if ($this->calcPerms & Permission::PAGE_NEW) {\n $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . -$this->id;\n $moveLeftAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"'\n . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');')\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('prevLevel')) . '\">'\n . $this->iconFactory->getIcon('actions-move-left', Icon::SIZE_SMALL)->render() . '</a>';\n $this->addActionToCellGroup($cells, $moveLeftAction, 'moveLeft');\n }\n // Down (Paste as subpage to the page right above)\n if ($this->currentTable['prevUid'][$row['uid']]) {\n $localCalcPerms = $this->getBackendUserAuthentication()->calcPerms(BackendUtility::getRecord('pages', $this->currentTable['prevUid'][$row['uid']]));\n if ($localCalcPerms & Permission::PAGE_NEW) {\n $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prevUid'][$row['uid']];\n $moveRightAction = '<a class=\"btn btn-default\" href=\"#\" onclick=\"'\n . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');')\n . '\" title=\"' . htmlspecialchars($this->getLanguageService()->getLL('nextLevel')) . '\">'\n . $this->iconFactory->getIcon('actions-move-right', Icon::SIZE_SMALL)->render() . '</a>';\n } else {\n $moveRightAction = $this->spaceIcon;\n }\n } else {\n $moveRightAction = $this->spaceIcon;\n }\n $this->addActionToCellGroup($cells, $moveRightAction, 'moveRight');\n }\n }\n /**\n * @hook recStatInfoHooks: Allows to insert HTML before record icons on various places\n */\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {\n $stat = '';\n $_params = [$table, $row['uid']];\n foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {\n $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);\n }\n $this->addActionToCellGroup($cells, $stat, 'stat');\n }\n /**\n * @hook makeControl: Allows to change control icons of records in list-module\n * @usage This hook method gets passed the current $cells array as third parameter.\n * This array contains values for the icons/actions generated for each record in Web>List.\n * Each array entry is accessible by an index-key.\n * The order of the icons is depending on the order of those array entries.\n */\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {\n // for compatibility reason, we move all icons to the rootlevel\n // before calling the hooks\n foreach ($cells as $section => $actions) {\n foreach ($actions as $actionKey => $action) {\n $cells[$actionKey] = $action;\n }\n }\n foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {\n $hookObject = GeneralUtility::getUserObj($classData);\n if (!$hookObject instanceof RecordListHookInterface) {\n throw new \\UnexpectedValueException($classData . ' must implement interface ' . RecordListHookInterface::class, 1195567840);\n }\n $cells = $hookObject->makeControl($table, $row, $cells, $this);\n }\n // now sort icons again into primary and secondary sections\n // after all hooks are processed\n $hookCells = $cells;\n foreach ($hookCells as $key => $value) {\n if ($key === 'primary' || $key === 'secondary') {\n continue;\n }\n $this->addActionToCellGroup($cells, $value, $key);\n }\n }\n $output = '<!-- CONTROL PANEL: ' . $table . ':' . $row['uid'] . ' -->';\n foreach ($cells as $classification => $actions) {\n $visibilityClass = ($classification !== 'primary' && !$module->MOD_SETTINGS['bigControlPanel'] ? 'collapsed' : 'expanded');\n if ($visibilityClass === 'collapsed') {\n $cellOutput = '';\n foreach ($actions as $action) {\n $cellOutput .= $action;\n }\n $output .= ' <div class=\"btn-group\">' .\n '<span id=\"actions_' . $table . '_' . $row['uid'] . '\" class=\"btn-group collapse collapse-horizontal width\">' . $cellOutput . '</span>' .\n '<a href=\"#actions_' . $table . '_' . $row['uid'] . '\" class=\"btn btn-default collapsed\" data-toggle=\"collapse\" aria-expanded=\"false\"><span class=\"t3-icon fa fa-ellipsis-h\"></span></a>' .\n '</div>';\n } else {\n $output .= ' <div class=\"btn-group\" role=\"group\">' . implode('', $actions) . '</div>';\n }\n }\n return $output;\n }", "public function onRun()\n {\n $this->page['visible'] = $this->property('visible');\n $this->page['button'] = $this->property('button');\n }", "public function index()\n {\n $route = \"page\";\n $user = auth()->user();\n if (request()->ajax()) {\n $table = new Datatable('Page', 'page');\n return $table->get()->editColumn('slug', function ($row) {\n return URL::to('/page/' . $row->slug);\n })->addColumn('index', function ($row) {\n return '<div class=\"icheck-primary d-inline\">\n <input data-id=\"' . $row->id . '\" class=\"check-element check-id\" type=\"checkbox\" id=\"checkboxPrimary' . $row->id . '\" >\n <label for=\"checkboxPrimary' . $row->id . '\">\n </label>\n </div>';\n })\n ->addColumn('status', function ($row) {\n $checked = \"\";\n if ($row->active == 1) {\n $checked = \"checked\";\n }\n return '<label class=\"ts-swich-label d-inline\">\n <input data-href=\"' . URL::to('admin/page/status/' . $row->id) . '\" type=\"checkbox\"' . $checked . ' class=\"switch-status switch ts-swich-input\" name=\"status\" id=\"\" value=\"1\">\n <span class=\"ts-swich-body\"></span>\n </label>';\n })\n\n ->addColumn('action', function ($row) use ($user, $route) {\n $btn = '';\n if ($user->can($route . '.edit')) {\n $btn .= '<span class=\"ts-action-btn mr-2\">\n <a href=\"' . route($route . \".edit\", $row->id) . '\"><i class=\"ri-pencil-line\"></i></a>\n </span> ';\n }\n if ($user->can($route . '.destroy')) {\n $btn .= '<span class=\"ts-action-btn\">\n <a class=\"delete-button\" href=\"#\" data-href=\"' . route($route . \".destroy\", $row->id) . '\"><i class=\"ri-delete-bin-line\"></i></a>\n </span>';\n }\n return $btn;\n })->rawColumns(['action', 'index', 'status'])\n ->make(true);\n }\n return view('admin.page.index');\n }", "function admin_index()\n\t{\n\t $this->set('pagetitle',\"Manage Pages\");\n\t $this->paginate=array('order'=>'Page.name ASC');\n\t $lists = $this->paginate('Page');\n\t $this->set('list', $lists);\n\t \n\t if((isset($this->data[\"Page\"][\"setStatus\"])))\n\t {\n\t\t$status = ife($_POST['active'],1,0);\n\t\t$record = $this->data[\"Page\"][\"Record\"];\n\t\t$CheckedList=$_POST['box1'];\n\t\t$controller= $this->params['controller'];\n\t\t$action='index'; \n\t\t$prefix='admin';\n\t\t$model='Page';\n\t\t$relation=null;\n\t\t\n\t\tswitch($status)\n\t\t{ \n\t\t case '1': \n\t\t\t$this->setStatus('1',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break;\n\t\t case '0':\n\t\t\t$this->setStatus('0',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break; \n\t\t}\n\t }\n\t}", "function status_deactivate($page_id)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->db->where('pageid',$page_id);\n\t\t\t\t\t\n\t\t\t\t\t$data \t= \t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'status' => 0\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->db->update('oxm_pagedetails', $data);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t }", "function\tpunchTable( $_lastLine=false) {\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTDataIT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n\t\t$remHeight\t=\t$frm->remHeight() ;\n\t\tif ( $remHeight < mmToPt( $this->saveZone) && !$_lastLine) {\n\t\t\t$this->tableFoot() ;\n\t\t\t$this->myDoc->newPage() ;\n\t\t\t$this->tableHead() ;\n\t\t}\n\t}" ]
[ "0.59542984", "0.5818644", "0.5562295", "0.547263", "0.5366258", "0.5308087", "0.529342", "0.5274105", "0.5251275", "0.5207949", "0.5167911", "0.51554996", "0.51361936", "0.5128101", "0.5122884", "0.5094484", "0.5086526", "0.5084761", "0.50645536", "0.504532", "0.50412124", "0.50202286", "0.5011873", "0.50093144", "0.50050783", "0.49695373", "0.4969254", "0.49540722", "0.4943264", "0.4942298" ]
0.67733526
0
waits until salsify is done preparing the given export, and returns the URL when done. Throws an exception if anything funky occurs.
public function waitForExportRunToComplete() { $this->channelRunDataUrl = null; do { $this->checkExportUrl(); sleep(5); } while (!$this->channelRunDataUrl); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _waitForExportRunToComplete() {\n $this->_channelRunDataUrl = null;\n\n do {\n sleep(5);\n $exportRun = $this->_doSalsifyRequest($this->_channelRunUrl());\n $status = $exportRun['status'];\n if ($status === 'completed') {\n $this->_channelRunDataUrl = $exportRun['product_export_url'];\n } elseif ($status === 'failed') {\n // this would be an internal error in Salsify\n throw new Exception('Salsify failed to produce an export.');\n }\n } while (!$this->_channelRunDataUrl);\n\n return $this;\n }", "function get_file_downloaded_url($id_emetteur) {\n $request = get_file_downloaded($id_emetteur);\n\n $file_url = '';\n\n while($result = $request->fetch()) {\n $file_url = $result['file_url'];\n }\n\n return $file_url;\n}", "private function UrlFileFree($strUrl)\n {\n $ret = false;\n $data = array('submit'=>'Download');\n \n $option = array(CURL_OPTION_POSTDATA => $data, \n CURL_OPTION_HEADER => false);\n \n $curl = GenerateCurl($strUrl,$option);\n $ret = curl_exec($curl);\n curl_close($curl);\n return $ret;\n }", "public function startDownload() {\n if (empty($this->url) || empty($this->destPath)) {\n throw new SFException('No URL or path given. Use setPaths()', ERR_REPORT_APP);\n }\n\n $this->callMethod('startDownload', array($this->destPath, $this->url));\n }", "public function InitiateDownload()\n\t{\n\t\t//Register the download\n\t\t$pdo = new Database();\n\t\t$statement = $pdo->prepare('INSERT INTO download_log SET DownloadID=?');\n\t\t$statement->bindParam(1, $this->ID);\n\t\t$statement->execute();\n\n\t\tif (preg_match('/http(s{0,1}):\\/\\/(.*)/', $this->Link))\n\t\t{\n\t\t\theader('location: ' . $this->Link);\n\t\t}\n\t\telse if (substr($this->Link, 0, 1) == '?')\n\t\t{\n\t\t\t//Get a name to call the file.\n\t\t\t$filePath = dirname(__FILE__) . '/../downloads/' . substr($this->Link, 1);\n\t\t\t$pathInfo = pathinfo($filePath);\n\t\t\t$downloadName = empty($pathInfo['extension']) ?\n\t\t\t\t$this->Name : sprintf('%s.%s', $this->Name, $pathInfo['extension']);\n\n\t\t\t//Transfer the file.\n\t\t\t$stream = fopen($filePath, 'rb');\n\t\t\tDownload::TransferDownload($stream, $downloadName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Unknown download link');\n\t\t}\n\t}", "public function pushDownload()\n\t{\n\t\t$alias = Request::getString('alias', '');\n\n\t\t$this->id = '';\n\t\tif (substr($alias, -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($alias, '/');\n\t\t\t$lastDot = strrpos($alias, '.rdf');\n\n\t\t\t$this->id = substr($alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t$rdfa = $this->getResourceMap();\n\n\t\tif ($rdfa == null)\n\t\t{\n\t\t\tthrow new Exception(Lang::txt('COM_PUBLICATIONS_FILE_NOT_FOUND'), 404);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Creates download headers\n\t\theader('Content-Type: application/rdf+xml');\n\t\theader('Content-Disposition: attachment; filename=' . $alias);\n\t\theader('Content-Length: ' . strlen($rdfa));\n\n\t\t// Push the data for download\n\t\techo $rdfa;\n\t\texit;\n\t}", "function export( $id, $format, $back_url ) {\n\t\t\n\t}", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "public function startDownload() {\n if (!isset($this->destPath)) {\n throw new SFException( 'No destination path. Use setDestinationPath()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath, ($this->data == NULL)) );\n }", "public function getDownloadURL($usage, $saveAs, $resolution, $mediaId)\n {\n $postParams = array(\n AdobeStockParams::API_KEY => $this->apiKey,\n AdobeStockParams::USAGE => $usage,\n AdobeStockParams::SAVE_AS => $saveAs,\n 'resolution' => $resolution,\n 'mediacode' => $mediaId\n );\n $url = $this->getFullURI(AdobeStockParams::GET_DOWNLOAD_URL, $postParams);\n return $this->checkResponse($this->post($url, $postParams));\n }", "public static function fetchNextScheduledExport()\n {\n \t$aDueList = self::fetchDueList();\n \tif ($aDueList)\n \t\treturn $aDueList[0];\n \t\t\n \treturn false;\n }", "public function download() {\t\t}", "protected function generateDownloadLink()\n\t{\n\t\t$params = array(\n\t\t\t'PROCESS_TOKEN' => $this->processToken,\n\t\t\t'EXPORT_TYPE' => $this->exportType,\n\t\t\t'COMPONENT_NAME' => $this->componentName,\n\t\t);\n\n\t\treturn $this->getActionUri(self::ACTION_DOWNLOAD, $params);\n\t}", "public function getTemporaryDownloadLink()\n {\n if (!$this->ID) {\n return false;\n }\n $s3 = $this->getS3Client();\n\n $cmd = $s3->getCommand('GetObject', [\n 'Bucket' => $this->Bucket,\n 'Key' => $this->Key,\n 'ResponseContentDisposition' => 'attachment; filename=\"'. $this->Name .'\"'\n ]);\n\n $request = $s3->createPresignedRequest($cmd, '+60 minutes');\n\n return (string) $request->getUri();\n }", "function ExportData() {\n\t\tglobal $scholarship_package;\n\t\t$utf8 = FALSE;\n\t\t$bSelectLimit = EW_SELECT_LIMIT;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $scholarship_package->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($scholarship_package->ExportAll) {\n\t\t\t$this->lDisplayRecs = $this->lTotalRecs;\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($scholarship_package, \"h\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_package_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->start_date);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->end_date);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->status);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->annual_amount);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->grant_package_grant_package_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->sponsored_student_sponsored_student_id);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_type);\n\t\t\t\t$ExportDoc->ExportCaption($scholarship_package->scholarship_type_scholarship_type);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$scholarship_package->CssClass = \"\";\n\t\t\t\t$scholarship_package->CssStyle = \"\";\n\t\t\t\t$scholarship_package->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('scholarship_package_id', $scholarship_package->scholarship_package_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('start_date', $scholarship_package->start_date->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('end_date', $scholarship_package->end_date->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('status', $scholarship_package->status->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('annual_amount', $scholarship_package->annual_amount->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('grant_package_grant_package_id', $scholarship_package->grant_package_grant_package_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('sponsored_student_sponsored_student_id', $scholarship_package->sponsored_student_sponsored_student_id->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('scholarship_type', $scholarship_package->scholarship_type->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('scholarship_type_scholarship_type', $scholarship_package->scholarship_type_scholarship_type->ExportValue($scholarship_package->Export, $scholarship_package->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_package_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->start_date);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->end_date);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->status);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->annual_amount);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->grant_package_grant_package_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->sponsored_student_sponsored_student_id);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_type);\n\t\t\t\t\t$ExportDoc->ExportField($scholarship_package->scholarship_type_scholarship_type);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($scholarship_package->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($scholarship_package->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($scholarship_package->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($scholarship_package->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($scholarship_package->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}", "function downloadFile($url, $output)\n{\n $readableStream = fopen($url, 'rb');\n if ($readableStream === false) {\n throw new Exception(\"Something went wrong while fetching \" . $url);\n }\n $writableStream = fopen($output, 'wb');\n\n stream_copy_to_stream($readableStream, $writableStream);\n\n fclose($writableStream);\n}", "public function downloadFile();", "private function downloadCSV($downloadUrl)\n\t{\n\t\t$test = round(rand(1, 6));\n\t\techo $test;\n\n\t\t// We are going to throw a random exception sometimes...\n\t\tif ($test == 3)\n\t\t{\n\t\t\tthrow new Exception(\"Could not pretend to download file\");\n\t\t}\n\n\t\t$_file = __DIR__ . '/batch_of_urls.csv.gz';\n\t\tif (!file_exists($_file)) {\n\t\t\tthrow new Exception(\"Oh noes, it looks like your CSV file is missing\");\n\t\t}\n\t\treturn $_file;\n\t}", "public function downloadUrlFile()\r\n\t{\r\n\t\t$url = $this->outputReferenceFile;\r\n\t\t$fileName = explode('.', basename($this->targetFile));\r\n\t\t$this->referenceFile = dirname($this->targetFile) . \"/\" . $fileName[0] . 'ProductionDownload.' . $fileName[1];\r\n\t\tfile_put_contents($this->referenceFile, file_get_contents($url));\t\t\r\n\t}", "public function download(string $url);", "function generate_download_name($compression_method) // Colorize: green\n { // Colorize: green\n do // Colorize: green\n { // Colorize: green\n $res = random_string(249); // Colorize: green\n // Colorize: green\n switch ($compression_method) // Colorize: green\n { // Colorize: green\n case 0: // Colorize: green\n { // Colorize: green\n $res .= \".0.raw\"; // Colorize: green\n } // Colorize: green\n break; // Colorize: green\n // Colorize: green\n case 1: // Colorize: green\n { // Colorize: green\n $res .= \".0.xz\"; // Colorize: green\n } // Colorize: green\n break; // Colorize: green\n // Colorize: green\n default: // Colorize: green\n { // Colorize: green\n die(\"Unknown compression method\"); // Colorize: green\n } // Colorize: green\n break; // Colorize: green\n } // Colorize: green\n // Colorize: green\n if (!file_exists(\"../downloads/\" . $res)) // Colorize: green\n { // Colorize: green\n return $res; // Colorize: green\n } // Colorize: green\n } while(true); // Colorize: green\n }", "public function check_delay_export() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_delay_export() function\n\t\t\t$return = false;\n\t\t\tif ( 0 === strpos( $this->title, 'http' ) ) { // Check for URL in Title\n\t\t\t\t$return = true;\n\t\t\t} // End of Check for URL in Title\n\t\t\treturn $return;\n\t\t}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "public function onJSpaceAssetPrepareDownload($asset)\n {\n $html = null;\n \n $credentials = new Credentials(\n $this->params->get('access_key_id'), \n $this->params->get('secret_access_key')); \n\n $s3 = S3Client::factory(array('credentials'=>$credentials));\n \n $storage = JSpaceArchiveAssetHelper::buildStoragePath($asset->record_id);\n $path = $storage.$asset->hash;\n \n if ($s3->doesObjectExist($this->params->get('bucket'), $path))\n {\n $asset->url = JRoute::_('index.php?option=com_jspace&task=asset.stream&type=jspaces3&id='.$asset->id);\n \n $layout = JPATH_PLUGINS.'/content/jspaces3/layouts';\n $html = JLayoutHelper::render(\"jspaces3\", $asset, $layout);\n }\n\n return $html;\n }", "public function postProcessDownload()\n {\n }", "function writeUrl() {\n\n }", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function fetch() {\r\n if (empty($this->id)) {\r\n throw new Exception(\"Cannot fetch download object - no download ID given\"); \r\n }\r\n \r\n $query = \"SELECT d.*, UNIX_TIMESTAMP(d.date) AS date_unix FROM download_items AS d WHERE d.id = ?\";\r\n \r\n $row = $this->db->fetchRow($query, $this->id);\r\n \r\n if (!is_array($row) || count($row) === 0) {\r\n throw new Exception(\"Requested download not found\");\r\n }\r\n \r\n // Populate the vars\r\n $this->name = $row['title']; \r\n $this->desc = $row['description']; \r\n $this->url_file = $row['url']; \r\n $this->filename = empty($row['filename']) ? basename($row['url']) : $row['filename']; \r\n $this->Date = new DateTime($row['date'], new DateTimeZone(\"Australia/Melbourne\"));\r\n $this->hits = $row['hits'];\r\n $this->filesize = isset($row['filesize']) && $row['filesize'] > 0 ? formatBytes($row['filesize']) : \"Unknown\";\r\n $this->user_id = $row['user_id'];\r\n $this->filepath = $row['filepath'];\r\n \r\n $this->object_id = $row['object_id'];\r\n $this->approved = $row['approved'];\r\n $this->active = $row['active'];\r\n $this->extra_data = $row['extra_data'];\r\n $this->mime = $row['mime'];\r\n \r\n if (empty($this->filepath) && !empty($this->url_file)) {\r\n $pathinfo = parse_url($this->url_file); \r\n $this->filepath = str_replace(\"/uploads/\", \"\", $pathinfo['path']);\r\n \r\n try {\r\n $this->commit(); \r\n } catch (Exception $e) {\r\n // Do nothing\r\n }\r\n }\r\n \r\n if (!preg_match(\"@^(http|https)://@\", $this->url_file)) {\r\n $this->url_file = parent::DOWNLOAD_HOST . parent::DOWNLOAD_DIR . $this->url_file; \r\n }\r\n \r\n if ($row['date'] == \"0000-00-00 00:00:00\") {\r\n $this->Date = new DateTime(\"now\", new DateTimeZone(\"Australia/Melbourne\")); \r\n $this->commit();\r\n }\r\n \r\n if (empty($this->user_id) && !empty($row['submitter'])) {\r\n $this->submitter = $row['submitter'];\r\n }\r\n \r\n /**\r\n * Load the category this download belongs to\r\n */\r\n \r\n $this->Category = new Category($row['category_id']); \r\n \r\n /**\r\n * Load the author\r\n */\r\n \r\n $this->Author = UserFactory::CreateUser($this->user_id);\r\n \r\n if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {\r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $this->mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $this->filepath);\r\n $this->commit(); \r\n }\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n }" ]
[ "0.6420772", "0.5036085", "0.4900713", "0.489959", "0.4889596", "0.4879522", "0.47633955", "0.47430038", "0.47293052", "0.4721029", "0.4635405", "0.4629401", "0.46283156", "0.46255094", "0.45994645", "0.4589981", "0.4587181", "0.45790753", "0.45784125", "0.4571696", "0.45614165", "0.45590597", "0.4546127", "0.45452473", "0.45452473", "0.4543489", "0.45377505", "0.45361218", "0.45326516", "0.45278978" ]
0.5077855
1
Creates the form_ID in the database based on an $update array ($column_name => $value)
protected function create() { $this->db->insertRow($this->table_name, $this->update); storeDbMsg($this->db,"New " . $this->form_ID . " successfully created!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FormUpdateDatabase($table,$id)\n {\n \n //$id = $this->app->DB->GetInsertID();\n \n foreach($this->app->Secure->POST as $key=>$value)\n {\n $this->app->DB->Update(\"UPDATE $table SET $key='$value' WHERE id='$id' LIMIT 1\");\n }\n return $id;\n }", "public function form_add_step_2($update){\n\n $form = array();\n $form['updated_at'] = gmdate(date('Y-m-d h:i:s'),time());\n $form['status'] = $update['status'];\n $form['form_content'] = $update['form_content'];\n //$form['form_api_content'] = '';\n $this->db->where('form_id = '.$update['form_id']);\n $this->db->update('form_details',$form);\n if($this->db->affected_rows()){\n return true;\n }\n else{\n return false;\n }\n }", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "function um_add_form_identifier( $args ) {\r\n\t?>\r\n\t\t<input type=\"hidden\" name=\"form_id\" id=\"form_id_<?php echo $args['form_id']; ?>\" value=\"<?php echo $args['form_id']; ?>\" />\r\n\t<?php\r\n}", "public function form_add_step_1($form){\n //$user_id = $this->session->userdata('user_id');\n $form['created_at'] = gmdate(date('Y-m-d h:i:s'),time());\n $form['updated_at'] = gmdate(date('Y-m-d h:i:s'),time());\n $form['status'] = '0';\n //$form['created_by'] = $user_id;\n $this->db->insert('form_details',$form);\n //echo $this->db->last_query(); exit;\n $form_id = $this->db->insert_id();\n return $form_id;\n }", "function updateChild($child, $form_inputs){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'UPDATE child SET ';\r\n\tforeach($form_inputs as $key => $value){\r\n\t\t$query .= $key .' = \\''. $value .'\\', '; \r\n\t}\r\n\t$query = substr($query, 0, -2);\r\n\t$query .= ' WHERE child_id = \\''. $child .'\\';';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\t$msg = 'Error - not updated '. mysqli_errno($dbc) .'<br />';\r\n\t}\r\n\telse {\r\n\t\t$msg = 'Successfully updated your information';\r\n\t}\r\n\treturn $msg;\r\n}", "function insert_requests_forms($requests_forms_data){\r\n\r\n $this->db->insert('requests_forms', $requests_forms_data);\r\n return $this->db->insert_id();\r\n\t\r\n\t}", "function add( $update_fields ) {\n\n $query = \"INSERT INTO \" . $this->partner_code_table . \" \" .\n \"SET pc_name = '\" . $this->gCI->db->escape_string( $update_fields['pc_name'] ) . \"', \" .\n \"pc_code = '\" . $this->gCI->db->escape_string( $update_fields['pc_code'] ) . \"', \" .\n \"pc_location = '\" . $update_fields['pc_location'] . \"', \" .\n \"pc_order = '\" . $update_fields['pc_order'] . \"', \" .\n \"pc_exclusions = '\" . $update_fields['pc_exclusions'] . \"'\";\n if ( $this->gCI->db->query( $query ) )\n return $this->gCI->db->insert_id();\n else\n return( null );\n }", "private function mod_prep($row){\n $meta = new dbMeta(); \n $cols = $meta->get_tabel_columns(); // array w/ all metadata \n $form_array_mod = $meta->buildFormArray($cols); // make to nice form ready\n // insert the values to the form array for mod form\n foreach($row as $k => $v) {\n $form_array_mod[$k]['VALUE'] = $v;\n } \n \n update_form($form_array_mod); // returns array ready to be processed \n }", "function dbRowInsert($table_name, $form_data)\n{\n $fields = array_keys($form_data);\n\n // build the query\n $sql = \"INSERT INTO \".$table_name.\"\n (`\".implode('`,`', $fields).\"`)\n VALUES('\".implode(\"','\", $form_data).\"')\";\n\n $q = $this->conn->prepare($sql);\n $q->execute() or die(print_r($q->errorInfo()));\n return $this->conn->lastInsertId();\n\n}", "function cp_add_core_fields($form_id) {\r\n\tglobal $wpdb;\r\n\r\n // check to see if any rows already exist for this form. If so, don't insert any data\r\n $wpdb->get_results( $wpdb->prepare( \"SELECT form_id FROM \" . $wpdb->prefix . \"cp_ad_meta WHERE form_id = %s\", $form_id ) );\r\n\r\n // no fields yet so let's add the defaults\r\n if ( $wpdb->num_rows == 0 ) {\r\n\r\n $insert = \"INSERT INTO \" . $wpdb->prefix . \"cp_ad_meta\" .\r\n \" (form_id, field_id, field_req, field_pos) \" .\r\n \"VALUES ('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('1'). \"','\" // post_title\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('1')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('2'). \"','\" // cp_price\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('2')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('3'). \"','\" // cp_street\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('3')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('4'). \"','\" // cp_city\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('4')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('5'). \"','\" // cp_state\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('5')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('6'). \"','\" // cp_country\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('6')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('7'). \"','\" // cp_zipcode\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('7')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('8'). \"','\" // tags_input\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('8')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('9'). \"','\" // post_content\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('9')\r\n . \"')\";\r\n\r\n $results = $wpdb->query( $insert );\r\n\r\n }\r\n}", "function wp_aff_gf_save_ap_id($entry, $form) { \n $aff_id = wp_affiliate_get_referrer();\n wp_affiliate_log_debug(\"GF integration... adding ap_id meta data to entry (\".$entry['id'].\") with value: \" . $aff_id, true);\n gform_update_meta($entry['id'], 'ap_id', $aff_id);\n}", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id, $this->idf_id));\n\t\t\n\t }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "function mb_update_form($fields, $meta, $id, $element_id){\r\n\t\t\r\n\t\t$update_nonce = wp_create_nonce( 'wck-update-entry' );\t\r\n\t\t\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta ) );\t\t\r\n\t\t\r\n\t\t/* Filter primary used for CFC/OPC fields in order to show/hide fields based on type */\r\n\t\t$wck_update_container_css_class = \" class='wck_update_container update_container_$meta'\";\r\n\t\t$wck_update_container_css_class = apply_filters(\"wck_update_container_class_{$meta}\", $wck_update_container_css_class, $meta, $results, $element_id );\r\n\t\t\r\n\t\t$form = '';\r\n\t\t$form .= '<tr id=\"update_container_'.$meta.'_'.$element_id.'\" ' . $wck_update_container_css_class . '><td colspan=\"4\">';\r\n\t\tif($results != null){\r\n\t\t\t$i = 0;\r\n\t\t\t$form .= '<ul class=\"mb-list-entry-fields\">';\t\t\t\r\n\t\t\t\r\n\t\t\tif( !empty( $fields ) ){\r\n\t\t\t\tforeach( $fields as $field ){\t\t\t\t\r\n\t\t\t\t\t$details = $field;\r\n\t\t\t\t\tif( isset( $results[$element_id][Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details )] ) )\r\n\t\t\t\t\t\t$value = $results[$element_id][Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details )];\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\t$value = '';\r\n\r\n\t\t\t\t\t$form = apply_filters( \"wck_before_update_form_{$meta}_element_{$i}\", $form, $element_id, $value );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= '<li class=\"row-'. esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'\">';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= self::wck_output_form_field( $meta, $details, $value, 'edit_form', $id ); \r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form = apply_filters( \"wck_after_update_form_{$meta}_element_{$i}\", $form, $element_id, $value );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$form .= '<li style=\"overflow:visible;\">';\r\n\t\t\t$form .= '<a href=\"javascript:void(0)\" class=\"button-primary\" onclick=\\'updateMeta(\"'.esc_js($meta).'\", \"'.esc_js($id).'\", \"'.esc_js($element_id).'\", \"'.esc_js($update_nonce).'\")\\'><span>'. apply_filters( 'wck_save_changes_button', __( 'Save Changes', 'profile-builder' ), $meta ) .'</span></a>';\r\n\t\t\t$form .= '<a href=\"javascript:void(0)\" class=\"button-secondary\" style=\"margin-left:10px;\" onclick=\\'removeUpdateForm(\"'. esc_js( 'update_container_'.$meta.'_'.$element_id ). '\" )\\'><span>'. apply_filters( 'wck_cancel_button', __( 'Cancel', 'profile-builder' ), $meta ) .'</span></a>';\r\n\t\t\t$form .= '</li>';\t\t\t\r\n\t\t\t\r\n\t\t\t$form .= '</ul>';\r\n\t\t}\t\t\r\n\t\t$form .= '</td></tr>';\r\n\t\t\r\n\t\treturn $form;\r\n\t}", "function updateDatabase($form, $myvalues)\n {\n return TRUE;\n }", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "function student_edit_form_submit($form, &$form_state) {\n $id = arg(1);\n $num_edited = db_update('student')\n ->fields(array(\n 'st_fnm' => check_plain($form_state['input']['st_fnm']),\n 'st_lnm' => check_plain($form_state['input']['st_lnm']),\n 'st_email' => check_plain($form_state['input']['st_email']),\n ))\n ->condition('st_id', $id, NULL, 'IS NOT NULL')\n ->execute();\n drupal_set_message(t('Entry has been updated.')\n );\n}", "function add_registration_form($reg_form_data = array(),$items) \n {\n //$hash_pass = sha1($user_password);\n //echo \"<pre>\";\n // print_r($values_ary);\n $values_ary = array($reg_form_data['form_title'],$reg_form_data['form_intro'],$reg_form_data['form_thank_u'],$reg_form_data['form_menu'],$reg_form_data['form_menu_parent'],$reg_form_data['form_menu_item_text'],$reg_form_data['form_permissions'],$reg_form_data['form_payment_required'],$reg_form_data['form_complete_action'],$reg_form_data['form_publish'],$reg_form_data['form_email_to'],$reg_form_data['form_make_survey']);\n $query_str = \"INSERT INTO registration_form(form_title,form_intro,form_thank_u,form_menu,form_menu_parent,form_menu_item_text,form_permissions,form_payment_required,form_complete_action,form_publish,form_email_to,form_make_survey) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n $this->db->query($query_str,$values_ary );\n \n\n // $id = $this->getLastInserted('registration_form','form_id');\n $id = $this->db->insert_id();\n // adding dynamic manues \n foreach($items as $key => $item)\n { // is_array($items)\n \n $title = $item['title'];\n $type = $item['type'];\n $required = '';\n \n if (array_key_exists('required', $item))\n {\n $required ='Yes';\n }else\n {\n $required = 'No';\n }\n \n $order =$item['order'];\n if(!$item['order'])\n {\n $order = '0'; \n }\n $name =\"field_\".rand(0,9);\n $new_item = array ($id,$title,$name,$type,$required,$order ); \n \n $query = \"INSERT INTO fields(form_id,field_title,field_name,field_type,field_required,field_sequence) VALUES (?,?,?,?,?,?)\";\n $this->db->query($query,$new_item ); \n \n }\n \n }", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "function create_form_table($args) {\n\t\t$table_name = $args[\"singular_code_name\"];\n\t\t$result = $GLOBALS['db']->query(\"DROP TABLE \".$table_name);\n\t\t$result = $GLOBALS['db']->query(\"CREATE TABLE IF NOT EXISTS \".$table_name.\" (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY)\");\n\n\t\t$items = $args[\"items\"];\n\n\t\tforeach($items as $item) {\n\t\t\tif($item[\"type\"] == 'input') {\n\t\t\t\tswitch($item[\"var_type\"][0]) {\n\t\t\t\t\tcase 'varchar':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'string':\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" VARCHAR(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" \".$item[\"var_type\"][0].\"(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD reg_date TIMESTAMP\");\n\t}", "function saveLandLord($formvalues){\n\tif(isset($formvalues['landlord_updateid'])){\n\t\t$query = \"UPDATE referees SET name = '\".$formvalues['landlord_name'].\"', telephone = '\".$formvalues['landlord_tel'].\"', physicaladdress = '\".$formvalues['landlord_physicaladd'].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues['landlord_updateid'].\"'\";\n\t\t\n\t} else {\n\t\t$query = \"INSERT INTO referees (name, telephone, physicaladdress, createdby, date_of_entry) VALUES ('\".$formvalues['landlord_name'].\"', '\".$formvalues['landlord_tel'].\"', '\".$formvalues['landlord_physicaladd'].\"', '\".$_SESSION['userid'].\"', now())\";\n\t}\n\t\n\t$result = mysql_query($query);\n\t$id = \"\";\n\t# check if any errors have occured during the saving the activities to the database\n\tif (mysql_error() == \"\") {\n\t\t# no errors occured, so return the last inserted id\n\t\t$id = mysql_insert_id();\n\t\tif(isset($formvalues['landlord_updateid'])){\n\t\t\t$id = $formvalues['landlord_updateid'];\n\t\t}\n\t} else {\n\t\t# add the error message to the string\n\t\t$_SESSION['error'] = \"ERROR: Couldnot insert the details for previous \".$type.\"s. Please try again. DETAILS: \".\tmysql_error();\n\t}\n\t\n\treturn $id;\n}", "function form_fields_value_save ($field_value, $id)\n {\n $values_ary = array($id,$field_value);\n $query_str = \"INSERT INTO fields_options(field_id,option_value) VALUES (?,?)\";\n $this->db->query($query_str,$values_ary ); \n \n }", "function form_process($db,$action,$table,$pk){\n\t\t// build sql\n\t\tif($action=='new') {\n\t\t\t$sql = \"INSERT INTO `{$table}`(\";\n\n\t\t\tforeach ($_POST as $key => $value) \n\t\t\t{\n\t\t\t\t$sql .= \"`\".$key.\"`,\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql,0,-1).\") VALUES (\";\n\t\t\t\n\t\t\tforeach ($_POST as $key => $value) \n\t\t\t{\n\t\t\t\t$sql .= \"\\\"\".$value.\"\\\",\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql,0,-1).\")\";\n\t\t} elseif($action=='edit') {\n\t\t\t$sql = \"UPDATE `{$table}` SET \";\n\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t$sql .= \"`\".$key.\"` = '\".$value.\"', \";\n\t\t\t\tif($key==$pk) { $pval=$value; }\n\t\t\t}\n\t\t\t$sql = substr($sql,0,-2); \n\t\t\t\n\t\t\t$sql .= \" WHERE `{$pk}` = '\".$pval.\"'\";\n\t\t\t$_SESSION['m'] = \"Item gewijzigd.\";\n\t\t}\n\t\t//echo $sql;\n\t\t$db->query($sql);\n\t}", "function Update($table_name, $form_data, $where_clause='')\n{ \n global $mysqli;\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n return mysqli_query($mysqli,$sql);\n}", "protected function formIds()\n {\n $form = new FormGridIds();\n $form->ids = Yii::$app->request->post('ids', []);\n\n if (! $form->validate()) {\n return false;\n }\n\n return $form;\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "function nf_29_update_form_settings( $form_id ) {\n\tglobal $wpdb;\n\n // Check to see if the conversion has been reset.\n $is_reset = get_option( 'nf_converted_form_reset', 0 );\n\n // Check to see if an object exists with our form id.\n $type = nf_get_object_type($form_id);\n\n if ( $type ) {\n // We have an object with our form id.\n\n if ( $is_reset AND 'form' == $type ) {\n // Give precedence to the most recent form.\n\n // Set a new ID for the form being converted.\n $f_id = nf_insert_object('form');\n\n $fields = $wpdb->get_results(\"SELECT * FROM \" . NINJA_FORMS_FIELDS_TABLE_NAME . \" WHERE form_id = \" . $form_id, ARRAY_A);\n\n foreach ($fields as $field) {\n\n unset($field['id']);\n\n $field['form_id'] = $f_id;\n\n // Copy the Fields to the new ID.\n $wpdb->insert(NINJA_FORMS_FIELDS_TABLE_NAME, $field);\n\n }\n\n $relationships = $wpdb->get_results(\"SELECT * FROM \" . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . \" WHERE parent_id = \" . $form_id, ARRAY_A);\n\n foreach ($relationships as $relationship) {\n\n unset($relationship['id']);\n\n // Copy the object related to the form.\n $object = $wpdb->get_results(\"SELECT * FROM \" . NF_OBJECTS_TABLE_NAME . \" WHERE id = \" . $relationship['child_id'], ARRAY_A);\n\n unset($object['id']);\n\n $wpdb->insert(NF_OBJECTS_TABLE_NAME, $object);\n\n $relationship['child_id'] = $wpdb->insert_id;\n\n $relationship['parent_id'] = $f_id;\n\n // Copy the Relationships to the new ID.\n $wpdb->insert(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, $relationship);\n\n }\n\n } else {\n // Give precedence to the converting form.\n\n // Insert a new object.\n $next_id = nf_insert_object($type);\n\n // Replace all instances of the conflicting object ID with our new one.\n $wpdb->update(NF_OBJECT_META_TABLE_NAME, array('object_id' => $next_id), array('object_id' => $form_id));\n $wpdb->update(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, array('parent_id' => $next_id), array('parent_type' => $type, 'parent_id' => $form_id));\n $wpdb->update(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, array('child_id' => $next_id), array('child_type' => $type, 'child_id' => $form_id));\n\n // Delete the original (conflicting) object\n $wpdb->query('DELETE FROM ' . NF_OBJECTS_TABLE_NAME . ' WHERE id = ' . $form_id);\n\n }\n\n }\n\n // Get the form from the old table.\n $form = $wpdb->get_row( 'SELECT * FROM ' . NINJA_FORMS_TABLE_NAME . ' WHERE id = ' . $form_id, ARRAY_A );\n\n // Set the insert form ID, if not already set.\n $f_id = isset ( $f_id ) ? $f_id : nf_insert_object( 'form', $form['id'] );\n\n // Unpack the converted form's settings\n $settings = maybe_unserialize( $form['data'] );\n $settings['date_updated'] = $form['date_updated'];\n\n\tforeach ( $settings as $meta_key => $value ) {\n\t\tnf_update_object_meta( $f_id, $meta_key, $value );\n\t}\n\tnf_update_object_meta( $f_id, 'status', '' );\n}", "public function formdata_add($posts,$json){\n \n $input = array('radio','select','checkbox');\n $this->db->insert('form_submission',$json);\n foreach($posts as $post){\n if(in_array($post['type'],$input)){\n $form = array(\n 'form_field_id'=>$post['form_field_id'],\n 'user_id'=> $post['user_id'],\n 'form_id'=>$post['form_id'],\n 'form_option_id'=>$post['option_id']\n );\n $this->db->insert('user_form_info_options',$form);\n }else{\n $form = array(\n 'form_field_id'=>$post['form_field_id'],\n 'user_id'=> $post['user_id'],\n 'form_id'=>$post['form_id'],\n 'answer'=>$post['answer']\n );\n $this->db->insert('user_form_info_text',$form);\n }\n }\n //$loc_id = $this->db->insert_id();\n //print_r($country); exit;\n return $post['form_id'];\n }", "function afterUpdate($post_array, $primary_key='0'){\n // $identificador=$primary_key;\n // while(strlen($identificador)<4) $identificador=\"0\".$identificador;\n // $id=$post_array['id_grupo'];\n // $texto_grupo=$this->db->query(\"SELECT texto_grupo FROM c_grupos WHERE id='$id'\")->row()->texto_grupo;\n // $descripcion=$identificador.'-'.$post_array['nombre_actividad'];\n // if($texto_grupo) $descripcion.='-'.$texto_grupo;\n // $this->db->query(\"UPDATE c_actividades_infantiles SET descripcion='$descripcion' WHERE id='$primary_key'\");\n }" ]
[ "0.6581057", "0.6205212", "0.61903334", "0.6139463", "0.57254773", "0.5674798", "0.56383514", "0.561264", "0.5586791", "0.55660486", "0.5525053", "0.5507934", "0.549519", "0.54735416", "0.5472807", "0.5441148", "0.54324454", "0.5416577", "0.54003686", "0.5399972", "0.53759414", "0.53703964", "0.5356294", "0.533528", "0.5330106", "0.53155476", "0.53104824", "0.53009367", "0.5300902", "0.5295075" ]
0.6293725
1
Updates the form_ID in the database identified by $filter with values from $update
protected function update() { $this->db->updateRows($this->table_name, $this->update, $this->filter); storeDbMsg($this->db,ucwords($this->form_ID) . " successfully updated!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function student_edit_form_submit($form, &$form_state) {\n $id = arg(1);\n $num_edited = db_update('student')\n ->fields(array(\n 'st_fnm' => check_plain($form_state['input']['st_fnm']),\n 'st_lnm' => check_plain($form_state['input']['st_lnm']),\n 'st_email' => check_plain($form_state['input']['st_email']),\n ))\n ->condition('st_id', $id, NULL, 'IS NOT NULL')\n ->execute();\n drupal_set_message(t('Entry has been updated.')\n );\n}", "function update_form($form_id,$params)\n {\n $this->db->where('form_id',$form_id);\n $response = $this->db->update('forms',$params);\n if($response)\n {\n return \"form updated successfully\";\n }\n else\n {\n return \"Error occuring while updating form\";\n }\n }", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function index_onUpdateForm()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update($record_id);\n\t\t$this->controller->vars['record_id'] = $record_id;\n\t\treturn $this->makePartial('update');\n\t}", "abstract function performUpdate(Form $arg0);", "function change_form_entry_status() {\n $form_id = $_POST['form_id'];\n $entry_id = $_POST['entry_id'];\n $field_id = $_POST['field_id'];\n $value = $_POST['value'];\n\n // Get needed data to update the value in database\n global $wpdb;\n $form = GFFormsModel::get_form_meta($form_id);\n $entry = GFFormsModel::get_lead($entry_id);\n $field = GFFormsModel::get_field($form, $field_id);\n $entry_meta_table_name = GFFormsModel::get_entry_meta_table_name();\n $sql = $wpdb->prepare(\"SELECT id FROM {$entry_meta_table_name} WHERE entry_id=%d AND meta_key = %s\", $entry_id, $field_id);\n $entry_meta_id = $wpdb->get_var($sql);\n\n // Update the value in database\n GFFormsModel::update_entry_field_value( $form, $entry, $field, $entry_meta_id, $field_id, $value);\n}", "function banner_settings_form_submit($form,&$form_state){\n\n $banner_id = $form_state['values']['banner_id']; // gets the banner id from the form\n\n $allowed_site_json = json_encode(array_filter($form_state['values']['sites'])); // converts array into json\n\n\n $num_updated = db_update('fossee_banner_details')\n ->fields(array(\n 'allowed_sites' => $allowed_site_json, // field in fossee_banner_details table containing list of allowed sites as json string\n ))\n ->condition('id', $banner_id, '=') // matches the banner id\n ->execute();\n\n\n $form_state['redirect'] = $base_url.\"/fossee-site-banner/banners\";\n}", "public function save_entry_update() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-entries' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'update_entry' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tif ( !isset( $_POST['entry_id'] ) )\n\t\t\treturn;\n\n\t\t$entry_id = absint( $_POST['entry_id'] );\n\n\t\tcheck_admin_referer( 'update-entry-' . $entry_id );\n\n\t\t// Get this entry's data\n\t\t$entry = $wpdb->get_var( $wpdb->prepare( \"SELECT data FROM $this->entries_table_name WHERE entries_id = %d\", $entry_id ) );\n\n\t\t$data = unserialize( $entry );\n\n\t\t// Loop through each field in the update form and save in a way we can use\n\t\tforeach ( $_POST['field'] as $key => $value ) {\n\t\t\t$fields[ $key ] = $value;\n\t\t}\n\n\t\tforeach ( $data as $key => $value ) :\n\n\t\t\t$id = $data[ $key ]['id'];\n\n\t\t\t// Special case for checkbox and radios not showing up in $_POST\n\t\t\tif ( !isset( $fields[ $id ] ) && in_array( $data[ $key ][ 'type' ], array( 'checkbox', 'radio' ) ) )\n\t\t\t\t$data[ $key ]['value'] = '';\n\n\t\t\t// Only update value if set in $_POST\n\t\t\tif ( isset( $fields[ $id ] ) ) {\n\t\t\t\tif ( in_array( $data[ $key ][ 'type' ], array( 'checkbox' ) ) )\n\t\t\t\t\t$data[ $key ]['value'] = implode( ', ', $fields[ $id ] );\n\t\t\t\telse\n\t\t\t\t\t$data[ $key ]['value'] = esc_html( $fields[ $id ] );\n\t\t\t}\n\t\tendforeach;\n\n\t\t$where = array( 'entries_id' => $entry_id );\n\t\t// Update entry data\n\t\t$wpdb->update( $this->entries_table_name, array( 'data' => serialize( $data ), 'notes' => $_REQUEST['entries-notes'] ), $where );\n\t}", "function FormUpdateDatabase($table,$id)\n {\n \n //$id = $this->app->DB->GetInsertID();\n \n foreach($this->app->Secure->POST as $key=>$value)\n {\n $this->app->DB->Update(\"UPDATE $table SET $key='$value' WHERE id='$id' LIMIT 1\");\n }\n return $id;\n }", "function UpdateSettings($ValueIntForm, $IdUpdateSettings)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.settings SET ValueInt = '$ValueIntForm' WHERE idSettings = '$IdUpdateSettings'\");\n}", "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "function Update($table_name, $form_data, $where_clause='')\n{ \n global $mysqli;\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n return mysqli_query($mysqli,$sql);\n}", "public function form_add_step_2($update){\n\n $form = array();\n $form['updated_at'] = gmdate(date('Y-m-d h:i:s'),time());\n $form['status'] = $update['status'];\n $form['form_content'] = $update['form_content'];\n //$form['form_api_content'] = '';\n $this->db->where('form_id = '.$update['form_id']);\n $this->db->update('form_details',$form);\n if($this->db->affected_rows()){\n return true;\n }\n else{\n return false;\n }\n }", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "public function update()\n {\n $arg = func_get_args();\n\n foreach ($this->group as $form) {\n if (! is_object($form)) {\n $form = new $form();\n }\n\n if (method_exists($form, 'update')) {\n $form->save(...$arg);\n }\n }\n }", "public function updateForms()\n {\n $this->updateSubmitForms();\n $this->updateSearchForms();\n $this->updateSearchFields();\n $this->updateFeaturedFormFields();\n $this->updateTitlesFormFields();\n $this->updateShortFormFields();\n $this->updateSortingFormFields();\n }", "function psc_edit_form($form_id=null) {\n\tglobal $wpdb, $psc;\n\t\n\tif($form_id) {\n\t\t$form = $wpdb->get_results('SELECT * FROM '.$psc->forms.' WHERE id=\"'.$form_id.'\"');\n\t}\n\t\n\t$categories = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'terms');\n\t$stati = array('pending', 'draft', 'published');\n\t$field_types = array('text', 'textarea', 'hidden', 'select', 'multiselect', 'radio', 'checkbox', 'file');\n\t\n\tif(isset($form) && count($form)===0) {\n\t\techo 'Sorry, but a form with that ID does not exist.';\n\t} else {\n\t\tif(isset($form[0]->data)) {\n\t\t\t$fields = unserialize($form[0]->data);\n\t\t} else {\n\t\t\t$form = array(\n\t\t\t\t(object) array(\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'slug' => '',\n\t\t\t\t\t'default_category' => '',\n\t\t\t\t\t'default_status' => 'pending',\n\t\t\t\t\t'thanks_url' => '',\n\t\t\t\t\t'captcha' => 0\n\t\t\t\t)\n\t\t\t);\n\t\t\t$fields = array();\n\t\t}\n\t\t// Edit the form!!\n\t\techo '\n\t\t<div class=\"wrap\">\n\t\t\t<div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br /></div>\n\t\t\t<h2>Edit Form</h2>';\n\t\t\tif($form_id) {\n\t\t\t\techo '<form name=\"post\" action=\"'.get_bloginfo('siteurl').'/wp-admin/admin.php?page=publicly-submitted-content/admin&action=edit_form&id='.$form_id.'\" method=\"post\" id=\"post\">';\n\t\t\t} else {\n\t\t\t\techo '<form name=\"post\" action=\"'.get_bloginfo('siteurl').'/wp-admin/admin.php?page=publicly-submitted-content/admin&action=new_form\" method=\"post\" id=\"post\">';\n\t\t\t}\n\t\t\twp_nonce_field('psc_nonce_field', 'psc_save');\n\t\t\techo '\n\t\t\t\t<div id=\"post-body\">\n\t\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t\t<div id=\"titlediv\">';\n\t\t\t\t\t\tif($form_id) { echo '<input type=\"hidden\" name=\"psc_id\" value=\"'.$form_id.'\" />'; }\n\t\t\t\t\t\techo '<div id=\"titlewrap\">\n\t\t\t\t\t\t\t\t<label class=\"hide-if-no-js\" style=\"visibility:hidden\" id=\"title-prompt-text\" for=\"title\">Enter name here</label>';\n\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"title\" size=\"30\" tabindex=\"1\" value=\"'.$form[0]->name.'\" id=\"title\" autocomplete=\"off\" />';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"title\" size=\"30\" tabindex=\"1\" value=\"\" id=\"title\" autocomplete=\"off\" />';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t<div id=\"edit-slug-box\">\n\t\t\t\t\t\t\t\t\t<strong>Slug:</strong> ';\n\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"form_slug\" name=\"slug\" value=\"'.$form[0]->slug.'\" /><span id=\"sample-permalink\">'.$form[0]->slug.'</span>';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"form_slug\" name=\"slug\" value=\"\" /><span id=\"sample-permalink\"></span>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"form_edit_options\" class=\"postbox fieldItem\">\n\t\t\t\t\t\t\t\t<h3 class=\"hndle\"><span>Form Options</span></h3>\n\t\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t\t<div class=\"select\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"default_category\">Default Category</label>\n\t\t\t\t\t\t\t\t\t\t<select name=\"default_category\" id=\"default_category\">';\n\t\t\t\t\t\t\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$category->term_id.'\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($category->term_id==$form[0]->default_category) { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tif($category->slug=='publicly_submitted_content') { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '>'.$category->name.'</option>'.\"\\r\\n\";\n\t\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\t\techo '</select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"select\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"default_status\">Default Status</label>\n\t\t\t\t\t\t\t\t\t\t<select name=\"default_status\" id=\"default_status\">';\n\t\t\t\t\t\t\t\t\t\tforeach($stati as $state) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$state.'\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($state==$form[0]->default_status) { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '>'.ucfirst($state).'</option>'.\"\\r\\n\";\n\t\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\t\techo '</select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"checkbox\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\"';\n\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\tif($form[0]->captcha==1) { echo ' checked'; }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' name=\"captcha\" id=\"captcha_option\" />';\n\t\t\t\t\t\t\t\t\t\techo '<label for=\"captcha_option\">Use Captcha?</label>\n\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t\techo '<div id=\"psc_catcha_info\" style=\"display:none\">\n\t\t\t\t\t\t\t\t\t\t<p>You must enter a re:Captcha public &amp; private keys in order to utilize captcha.</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"public_key\" id=\"api_key\" value=\"'.get_option('psc_recaptch_public_key').'\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"private_key\" id=\"private_key\" value=\"'.get_option('psc_recaptch_private_key').'\" />\n\t\t\t\t\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"thanks_url\">Thanks Redirect <span class=\"small\">(leave blank to not use a redirect or if the redirect is causing a blank page.)</span></label>\n\t\t\t\t\t\t\t\t\t\t<div class=\"thanksLink\">\n\t\t\t\t\t\t\t\t\t\t\t'.get_bloginfo('siteurl').'<input type=\"text\" name=\"thanks_url\" id=\"thanks_url\" value=\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) { echo $form[0]->thanks_url; }\n\t\t\t\t\t\t\t\t\t\t\techo '\" />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div id=\"major-publishing-actions\">\n\t\t\t\t\t\t\t\t<div id=\"delete-action\">\n\t\t\t\t\t\t\t\t\t<a class=\"submitdelete deletion\" href=\"#\">Delete Form</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div id=\"publishing-action\">\n\t\t\t\t\t\t\t\t\t<input name=\"save\" type=\"submit\" class=\"button-primary\" id=\"publish\" tabindex=\"5\" accesskey=\"p\" value=\"Save Form\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t<div id=\"normal-sortables\" class=\"meta-box-sortables ui-sortable fieldItems\">\n\t\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\tif(!$form_id) {\n\t\t\t\t\t\t\t\t$key = 0;\n\t\t\t\t\t\t\t\techo '<div id=\"field'.$key.'item\" class=\"postbox fieldItem\">\n\t\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br></div><h3 class=\"hndle\"><span>[Label]</span></h3>\n\t\t\t\t\t\t\t\t<div class=\"inside\" style=\"display:block;\">\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"deleteFieldItem\">Delete Field</a>\n\t\t\t\t\t\t\t\t\t<div class=\"text\"><label for=\"field'.$key.'label\">Label</label><input type=\"text\" name=\"data['.$key.'][label]\" class=\"fieldlabel\" id=\"field'.$key.'label\" value=\"\" /></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"text\"><label for=\"field'.$key.'slug\">Slug/ID/Name</label><input type=\"text\" name=\"data['.$key.'][slug]\" class=\"slugify\" id=\"field'.$key.'slug\" value=\"\" /></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"select\"><label for=\"field'.$key.'type\">Type</label><select name=\"data['.$key.'][type]\" class=\"fieldtype\" id=\"field'.$key.'type\">';\n\t\t\t\t\t\t\t\t\t\tforeach($field_types as $field_type) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$field_type.'\">';\n\t\t\t\t\t\t\t\t\t\t\tif($field_type=='file') { echo 'Image'; } else { echo ucfirst($field_type); }\n\t\t\t\t\t\t\t\t\t\t\techo '</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '</select></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"text options\" style=\"display:none;\"><label for=\"field'.$key.'options\">Options</label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"data['.$key.'][options]\" id=\"field'.$key.'options\" value=\"\" />\n\t\t\t\t\t\t\t\t\t<p class=\"small\">(comma separated list of options for select, multiselect, checkbox, and radio types)</p></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][required]\" id=\"field'.$key.'required\" /><label for=\"field'.$key.'required\">Required</label></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][maps_as]\" id=\"field'.$key.'maps_as\" /><label for=\"field'.$key.'maps_as\">Use this as the \"post content\"</label></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tforeach($fields as $key => $field) {\n\t\t\t\t\t\t\t\t\techo '<div id=\"field'.$key.'item\" class=\"postbox fieldItem closed\">\n\t\t\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br></div><h3 class=\"hndle\"><span>'.$field['label'].'</span></h3>\n\t\t\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"deleteFieldItem\">Delete Field</a>\n\t\t\t\t\t\t\t\t\t\t<div class=\"text\"><label for=\"field'.$key.'label\">Label</label><input type=\"text\" name=\"data['.$key.'][label]\" class=\"fieldlabel\" id=\"field'.$key.'label\" value=\"'.$field['label'].'\" /></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"text\"><label for=\"field'.$key.'slug\">Slug/ID/Name</label><input type=\"text\" name=\"data['.$key.'][slug]\" class=\"slugify\" id=\"field'.$key.'slug\" value=\"'.str_replace('psc_', '', $field['slug']).'\" /></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"select\"><label for=\"field'.$key.'type\">Type</label><select name=\"data['.$key.'][type]\" class=\"fieldtype\" id=\"field'.$key.'type\">';\n\t\t\t\t\t\t\t\t\t\t\tforeach($field_types as $field_type) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$field_type.'\"';\n\t\t\t\t\t\t\t\t\t\t\t\tif($field_type==$field['type']) { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t\techo '>';\n\t\t\t\t\t\t\t\t\t\t\t\tif($field_type=='file') { echo 'Image'; } else { echo ucfirst($field_type); }\n\t\t\t\t\t\t\t\t\t\t\t\techo '</option>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '</select></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"text options\"';\n\t\t\t\t\t\t\t\t\t\tif(!in_array($field['type'], array('select', 'multiselect', 'radio', 'checkbox'))) {\n\t\t\t\t\t\t\t\t\t\t\techo ' style=\"display:none;\"';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '><label for=\"field'.$key.'options\">Options</label>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"data['.$key.'][options]\" id=\"field'.$key.'options\" value=\"';\n\t\t\t\t\t\t\t\t\t\tif(isset($field['options']) && !empty($field['options'])) { echo implode(',', $field['options']); }\n\t\t\t\t\t\t\t\t\t\techo '\" />\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"small\">(comma separated list of options for select, multiselect, checkbox, and radio types)</p>\n\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][required]\" id=\"field'.$key.'required\"';\n\t\t\t\t\t\t\t\t\t\tif($field['required']=='true') {\n\t\t\t\t\t\t\t\t\t\t\techo ' checked';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' /><label for=\"field'.$key.'required\">Required</label></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\"';\n\t\t\t\t\t\t\t\t\t\tif(isset($field['maps_as']) && $field['maps_as']=='content') {\n\t\t\t\t\t\t\t\t\t\t\techo ' checked';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' name=\"data['.$key.'][maps_as]\" id=\"field'.$key.'maps_as\" /><label for=\"field'.$key.'maps_as\">Use this as the \"post content\"</label></div>\n\t\t\t\t\t\t\t\t\t\t</div>\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\techo '\n\t\t\t\t\t\t\t</div><input type=\"hidden\" id=\"psckeycount\" value=\"'.($key+1).'\" />\n\t\t\t\t\t\t\t<a id=\"add_form_field\" class=\"preview button\" href=\"#\">Add form field</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>';\n\t}\n}", "protected function _updatefields() {}", "function updateRecord($f){\n global $db;\n\n $sql= \"UPDATE products SET \"\n .\"description='\".$f['description'].\"' \"\n .\"WHERE id='\".$f['id'].\"'\";\n Basic::EventLog(\"Product->updateRecord: \".$sql);\n //Basic::EventLogDB(\"Usuario modificado - UID:\".$f['uid'].\", Modulo: \".$f['module'].\", Permiso: \".$f['perm']);\n $res =& $db->query($sql);\n return $res;\n }", "function updateDatabase($form, $myvalues)\n {\n return TRUE;\n }", "public function update () {\n reset($this->__fields);\n $pk = key($this->__fields);\n $form = $this->getForm();\n $updates = array();\n\n foreach ($form as $k => $v) {\n $updates[] = sprintf('%s = :%s', $k, $k);\n }\n\n $sql = sprintf(\n 'UPDATE %s SET %s WHERE %s = :%s'\n , $this->getTableName()\n , implode(',', $updates)\n , $pk\n , $pk\n );\n\n $stmt = $this->__db->prepare($sql);\n $stmt->bindValue($pk, $this->__get($pk));\n\n foreach ($form as $k => $v) {\n if (is_object($v->getData()) && get_class($v->getData()) == 'DateTime') {\n $stmt->bindValue($k, $v->getData(), $this->__fields[$k]['type']);\n } else {\n $stmt->bindValue($k, $v->getData());\n }\n }\n\n $stmt->execute();\n\n return $this;\n }", "function mb_update_form($fields, $meta, $id, $element_id){\r\n\t\t\r\n\t\t$update_nonce = wp_create_nonce( 'wck-update-entry' );\t\r\n\t\t\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta ) );\t\t\r\n\t\t\r\n\t\t/* Filter primary used for CFC/OPC fields in order to show/hide fields based on type */\r\n\t\t$wck_update_container_css_class = \" class='wck_update_container update_container_$meta'\";\r\n\t\t$wck_update_container_css_class = apply_filters(\"wck_update_container_class_{$meta}\", $wck_update_container_css_class, $meta, $results, $element_id );\r\n\t\t\r\n\t\t$form = '';\r\n\t\t$form .= '<tr id=\"update_container_'.$meta.'_'.$element_id.'\" ' . $wck_update_container_css_class . '><td colspan=\"4\">';\r\n\t\tif($results != null){\r\n\t\t\t$i = 0;\r\n\t\t\t$form .= '<ul class=\"mb-list-entry-fields\">';\t\t\t\r\n\t\t\t\r\n\t\t\tif( !empty( $fields ) ){\r\n\t\t\t\tforeach( $fields as $field ){\t\t\t\t\r\n\t\t\t\t\t$details = $field;\r\n\t\t\t\t\tif( isset( $results[$element_id][Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details )] ) )\r\n\t\t\t\t\t\t$value = $results[$element_id][Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details )];\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\t$value = '';\r\n\r\n\t\t\t\t\t$form = apply_filters( \"wck_before_update_form_{$meta}_element_{$i}\", $form, $element_id, $value );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= '<li class=\"row-'. esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'\">';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= self::wck_output_form_field( $meta, $details, $value, 'edit_form', $id ); \r\n\t\t\t\t\t\r\n\t\t\t\t\t$form .= '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$form = apply_filters( \"wck_after_update_form_{$meta}_element_{$i}\", $form, $element_id, $value );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$form .= '<li style=\"overflow:visible;\">';\r\n\t\t\t$form .= '<a href=\"javascript:void(0)\" class=\"button-primary\" onclick=\\'updateMeta(\"'.esc_js($meta).'\", \"'.esc_js($id).'\", \"'.esc_js($element_id).'\", \"'.esc_js($update_nonce).'\")\\'><span>'. apply_filters( 'wck_save_changes_button', __( 'Save Changes', 'profile-builder' ), $meta ) .'</span></a>';\r\n\t\t\t$form .= '<a href=\"javascript:void(0)\" class=\"button-secondary\" style=\"margin-left:10px;\" onclick=\\'removeUpdateForm(\"'. esc_js( 'update_container_'.$meta.'_'.$element_id ). '\" )\\'><span>'. apply_filters( 'wck_cancel_button', __( 'Cancel', 'profile-builder' ), $meta ) .'</span></a>';\r\n\t\t\t$form .= '</li>';\t\t\t\r\n\t\t\t\r\n\t\t\t$form .= '</ul>';\r\n\t\t}\t\t\r\n\t\t$form .= '</td></tr>';\r\n\t\t\r\n\t\treturn $form;\r\n\t}", "function handle_memberlist_update() {\r\n\tglobal $wpdb;\r\n\t\r\n\t$table = $wpdb->prefix . 'memberlist';\r\n\t\r\n\tif (isset($_POST['memberid'])) {\r\n\t\t$id = $_POST['memberid'];\r\n\t}\r\n\tif (isset($_POST['name'])) {\r\n\t\t$name = $_POST['name'];\r\n\t}\r\n\tif (isset($_POST['phone'])) {\r\n\t\t$phone = $_POST['phone'];\r\n\t}\r\n\tif (isset($_POST['email'])) {\r\n\t\t$email = $_POST['email'];\r\n\t}\r\n\tif (isset($_POST['extra'])) {\r\n\t\t$extra = $_POST['extra'];\r\n\t}\r\n\t\r\n\t$wpdb->update(\r\n\t\t$table, //table\r\n\t\tarray('name' => $name, 'phone' => $phone, 'email' => $email, 'extra' => $extra ), //variables\r\n\t\tarray('ID'=>$id), // where\r\n\t\tarray('%s','%s','%s','%s'), //data format\r\n\t\tarray('%s') // where format\r\n\t);\r\n}", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "public function noticia_update_form()\r\n {\r\n $array = [\r\n 'user_info' => $this->user->infoUser(),\r\n ];\r\n $post = new PostFix();\r\n $array['info_post'] = $post->getPostId($_GET['id']);\r\n $this->loadTemplate('noticias/update_img', $array);\r\n }", "public function updateForm($formId, $request)\n {\n return $this->start()->uri(\"/api/form\")\n ->urlSegment($formId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function update($id) {\n \n if (Input::only('family')) {\n // Store values from the project form\n $projectInfo = Input::only(\n 'updated_at', 'family', 'build_number', 'street_number', 'postal_code', 'city', 'province', 'start_date', 'end_date', 'comments', 'building_permit_number', 'building_permit_date', 'mortgage_date', 'blueprint_plan_number', 'blueprint_designer');\n // Array of field names\n $fieldNames = array(\n 'updated_at',\n 'family_id',\n 'build_number',\n 'street_number',\n 'postal_code',\n 'city',\n 'province',\n 'start_date',\n 'end_date',\n 'comments',\n 'building_permit_number',\n 'building_permit_date',\n 'mortgage_date',\n 'blueprint_plan_number',\n 'blueprint_designer');\n } else {\n // Store values from the project form\n $projectInfo = Input::only(\n 'updated_at', 'build_number', 'street_number', 'postal_code', 'city', 'province', 'start_date', 'end_date', 'comments', 'building_permit_number', 'building_permit_date', 'mortgage_date', 'blueprint_plan_number', 'blueprint_designer');\n // Array of field names\n $fieldNames = array(\n 'updated_at',\n 'build_number',\n 'street_number',\n 'postal_code',\n 'city',\n 'province',\n 'start_date',\n 'end_date',\n 'comments',\n 'building_permit_number',\n 'building_permit_date',\n 'mortgage_date',\n 'blueprint_plan_number',\n 'blueprint_designer');\n }\n\n //Used to count the field number based on the number of time through\n //the for each loop\n $v= new App\\Libraries\\Validators\\ProjectEditValidator($projectInfo);\n if($v->passes())\n {\n \n $counter = 0;\n //Creating an associate array for the update\n $fieldUpdateValues = array();\n\n //added key value pairs to the array\n foreach ($projectInfo as $fieldValue) {\n $fieldUpdateValues = array_add($fieldUpdateValues, $fieldNames[$counter], $fieldValue);\n $counter++;\n }\n\n //updating the record in the contact table for the contact with the id passed in\n //var_dump($id);\n //var_dump($fieldUpdateValues);\n $affectedRows = Project::where('id', '=', $id)->update($fieldUpdateValues);\n //$affectedRows = 0;\n //var_dump($affectedRows);\n //use affected rows to dertirming if it was a success or not\n if ($affectedRows > 0) {\n // Redirect to view the updated contact info\n $redirectVariable = Redirect::action('ProjectController@show', $id);\n } else {\n //Redirect back to the edit page with an error message\n $redirectVariable = Redirect::action('ProjectController@edit', $id)->withErrors(['Error', 'The Message']);\n }\n // return to redirect\n return $redirectVariable;\n }\n else\n {\n return Redirect::action('ProjectController@edit', $id)->withInput()\n ->withErrors($v->getErrors());\n }\n }", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id, $this->idf_id));\n\t\t\n\t }", "function UpdateRecord($id,$param) {\n $this->db->where('id_form_bd',$id);\n $this->db->update('form_bd',$param);\n }", "function nf_29_update_form_settings( $form_id ) {\n\tglobal $wpdb;\n\n // Check to see if the conversion has been reset.\n $is_reset = get_option( 'nf_converted_form_reset', 0 );\n\n // Check to see if an object exists with our form id.\n $type = nf_get_object_type($form_id);\n\n if ( $type ) {\n // We have an object with our form id.\n\n if ( $is_reset AND 'form' == $type ) {\n // Give precedence to the most recent form.\n\n // Set a new ID for the form being converted.\n $f_id = nf_insert_object('form');\n\n $fields = $wpdb->get_results(\"SELECT * FROM \" . NINJA_FORMS_FIELDS_TABLE_NAME . \" WHERE form_id = \" . $form_id, ARRAY_A);\n\n foreach ($fields as $field) {\n\n unset($field['id']);\n\n $field['form_id'] = $f_id;\n\n // Copy the Fields to the new ID.\n $wpdb->insert(NINJA_FORMS_FIELDS_TABLE_NAME, $field);\n\n }\n\n $relationships = $wpdb->get_results(\"SELECT * FROM \" . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . \" WHERE parent_id = \" . $form_id, ARRAY_A);\n\n foreach ($relationships as $relationship) {\n\n unset($relationship['id']);\n\n // Copy the object related to the form.\n $object = $wpdb->get_results(\"SELECT * FROM \" . NF_OBJECTS_TABLE_NAME . \" WHERE id = \" . $relationship['child_id'], ARRAY_A);\n\n unset($object['id']);\n\n $wpdb->insert(NF_OBJECTS_TABLE_NAME, $object);\n\n $relationship['child_id'] = $wpdb->insert_id;\n\n $relationship['parent_id'] = $f_id;\n\n // Copy the Relationships to the new ID.\n $wpdb->insert(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, $relationship);\n\n }\n\n } else {\n // Give precedence to the converting form.\n\n // Insert a new object.\n $next_id = nf_insert_object($type);\n\n // Replace all instances of the conflicting object ID with our new one.\n $wpdb->update(NF_OBJECT_META_TABLE_NAME, array('object_id' => $next_id), array('object_id' => $form_id));\n $wpdb->update(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, array('parent_id' => $next_id), array('parent_type' => $type, 'parent_id' => $form_id));\n $wpdb->update(NF_OBJECT_RELATIONSHIPS_TABLE_NAME, array('child_id' => $next_id), array('child_type' => $type, 'child_id' => $form_id));\n\n // Delete the original (conflicting) object\n $wpdb->query('DELETE FROM ' . NF_OBJECTS_TABLE_NAME . ' WHERE id = ' . $form_id);\n\n }\n\n }\n\n // Get the form from the old table.\n $form = $wpdb->get_row( 'SELECT * FROM ' . NINJA_FORMS_TABLE_NAME . ' WHERE id = ' . $form_id, ARRAY_A );\n\n // Set the insert form ID, if not already set.\n $f_id = isset ( $f_id ) ? $f_id : nf_insert_object( 'form', $form['id'] );\n\n // Unpack the converted form's settings\n $settings = maybe_unserialize( $form['data'] );\n $settings['date_updated'] = $form['date_updated'];\n\n\tforeach ( $settings as $meta_key => $value ) {\n\t\tnf_update_object_meta( $f_id, $meta_key, $value );\n\t}\n\tnf_update_object_meta( $f_id, 'status', '' );\n}" ]
[ "0.63136214", "0.62342", "0.61995584", "0.61899436", "0.6164805", "0.6125125", "0.6068201", "0.6044993", "0.6005192", "0.5945095", "0.5941684", "0.59333295", "0.5928071", "0.5915425", "0.58686566", "0.5839123", "0.5826951", "0.58019096", "0.5776744", "0.57646894", "0.5762607", "0.57538044", "0.5745996", "0.5733228", "0.572963", "0.5706024", "0.56964934", "0.56943536", "0.5688529", "0.5677236" ]
0.6787624
0
Register a new post action that will call the function identified by the string $function_name when $bool = true All post action functions should take in three arguments: $db, $update and $filter, regardless of whether the function uses them or not since some functions need all three arguments (e.g. update)
protected function registerPostAction($function_name, $bool, $validation_required=true) { if ($validation_required) { $this->post_actions["valid"][$function_name] = $bool; } else { $this->post_actions["no_valid"][$function_name] = $bool; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPostFunction($functionName,$requestData=false){\n\t \t if(!empty($functionName)){\n $this->_CI->ApiModel->{'post'.$functionName}($requestData);\n\t \t }else{\n\t \t generateServerResponse('0', 'W');\n\t \t }\n // switch ($resCode) {\n // \tcase 'accessToken':\n // \t\t $this->_CI->api_model->getAccessToken($requestData);\n // \t\tbreak;\n // \t# If not match function \n // \tdefault:\n // \t\tgenerateServerResponse('0', '100');\n // \tbreak;\n // }\n\t }", "function registerCallback($fieldName, $funcName, $mode = \"post\", $args = \"\"){\n\n\t\tif( @in_array(strtolower($mode), array(\"post\",\"retrieve\",\"both\")) && is_callable($funcName) ){\n\n\t\t\t$this->callback[$fieldName][\"args\"] = $args;\n\n\t\t\tif($mode == \"both\"){\n\t\t\t\t$this->callback[$fieldName][\"post\"] = $this->callback[$fieldName][\"retrieve\"] = $funcName;\n\t\t\t} else {\n\t\t\t\t$this->callback[$fieldName][$mode] = $funcName;\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} else return false;\n\n\t}", "function post_bool($boolean_name) {\n\t$boolean = $_POST[$boolean_name];\n\tif ($boolean == \"true\")\n\t\treturn true;\n\n\treturn false;\n}", "function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }", "function add_field_action($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function post_action_handler($post_id) {\n\t\tif ( current_filter() == 'delete_post' )\n\t\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'delete_post' );\n\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'edit_post' );\n\t}", "function post();", "protected function registerPostActions() {\n $this->registerPostAction(\"create\", isset($_POST[\"submit-btn\"]) && $_POST[\"submit-btn\"] == \"save\" && !isset($_GET[\"edit\"]));\n $this->registerPostAction(\"update\", isset($_POST[\"submit-btn\"]) && $_POST[\"submit-btn\"] == \"save\" && isset($_GET[\"edit\"]));\n $this->registerPostAction(\"delete\", isset($_POST[\"delete-btn\"]) && $_POST[\"delete-btn\"] == \"delete\", false);\n }", "function add_action($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function PostActions()\n {\n }", "function edit_function($postdata,$function_id) {\n\n $query = $this->db->query(\"update functions set function_name=\".$this->db->escape($postdata['name']).\" , description = \".$this->db->escape($postdata['description']).\", status = \".$this->db->escape($postdata['status']).\", category = \".$this->db->escape($postdata['category']).\" where function_id='$function_id'\");\t\n\t\t\treturn 1;\n\t\t\t\n }", "function acf_maybe_add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1)\n{\n}", "public function test_add_action_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, rand_str() );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Specific function name to test with yourls_do_action\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, 'change_one_global' );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}", "function add_action($name, $function, $priority=10){\n return Plugins::instance()->add_action($name, $function, $priority);\n}", "public function updatefuncname() {\n \t\ttry {\n\t\t\t// select mongoDB collection\n \t\t\t$func_collection = $this->mongo_db->db->used;\n\t\t\t// preparing data\n \t\t\t$prepare_data \t = array(\n \t\t\t\t'$set' \t\t=> \t\tarray(\n \t\t\t\t\t'use_funcname' => $this->use_funcname\n \t\t\t\t\t)\n \t\t\t\t);\n\t\t\t// update to database\n \t\t\t$func_collection->update(array(\n \t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t),\n \t\t\t$prepare_data, array(\n \t\t\t\t'multiple' \t=> \ttrue\n \t\t\t\t)\n \t\t\t);\n \t\t\treturn true;\n \t\t} \n \t\tcatch (Exception $e) \n \t\t{\n \t\t\treturn false;\n \t\t}\n \t}", "function acf_doing_action($action)\n{\n}", "public function post($param='', $func = FALSE)\n\t{\n\t\t$result = isset($_POST[$param])?$_POST[$param]:'';\n\t\tif ($func)\n\t\t{\n\t\t\t$filterArr = explode(\"|\", $func);\n\t\t\tforeach ($filterArr as $key => $rules)\n\t\t\t{\n\t\t\t\tif ($rules === '1' || $rules == 'filter' || $rules == 'filter_var')\n\t\t\t\t\t$result = filter_var($result, FILTER_SANITIZE_STRING);\n\t\t\t\t\n\t\t\t\tif ($rules == 'trim')\n\t\t\t\t\t$result = trim($result);\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function post($name, $default = false, $filter = false){\n if (isset($_POST[$name])) {\n if ($filter) {\n switch ($filter) {\n case 'int':\n return is_numeric($_POST[$name]) ? $_POST[$name] : $default;\n break;\n }\n } else {\n return $_POST[$name];\n }\n } else {\n return $default;\n }\n}", "function add_action($hook_name, $callback, $priority = 10, $accepted_args = 1)\n {\n }", "function add_action($actionname, $function, $params = array(), $priority = 10){\r\tglobal $actions;\r\t$actions[$actionname][$function] = array(\r\t\"name\" => $function,\r\t\"parameter\" => $params,\r\t\"priority\" => $priority\r\t);\r\t$actions[$actionname] = array_reverse($actions[$actionname]);\r\tuasort($actions[$actionname], 'action_sort');\r}", "public function chooseFunction(){\n if (isset($this->provided['postLabel'])) {\n echo \"You called the function <b> \".$this->provided['postLabel'].\" </b> if you need to know what this shit does follow it for yourself\n in kikundi/controller/PostController.php <br>\";\n switch($this->provided['postLabel']){\n case 'createProjectPool':\n ProjectController::addProjectPool($this->provided['sessionID'], $this->provided['name'], $this->provided['adminName']);\n setcookie('newCook', '69', 2019-9-11, '/');\n break;\n case 'registerMember':\n $this->joinProjectPool();\n break;\n case 'createProject':\n $this->createProject();\n break;\n case 'addTag':\n TagController::saveTagInDb($this->provided['tag']);\n break;\n case 'checkTag':\n echo \"<h2>All the Tags starting with \".$this->provided['tag'].\"</h2>\";\n var_dump(TagController::searchInDb($this->provided['tag']));\n break;\n case 'joinProjectPool':\n break;\n case 'likeProject':\n $this->likeProject();\n break;\n case 'approve':\n break;\n default:\n echo \"no post with that label found!\";\n }\n } else {\n echo \"You should not be here!\";\n }\n\n }", "public function hook($name, $action, $priority = 10, $accepted_args = 1);", "function addCdtActionFunction(CdtActionFunction $oCdtActionFunction) ;", "function add_action($hook, $functionname, $priority = plugin_default_priority){\n\tglobal $actions;\n\t$actions[$hook][] = ['name' => $functionname, 'priority' => $priority];\n}", "function doing_action($hook_name = \\null)\n {\n }", "public function post($uri, $function) {\n $newRoute = new Route($uri, array(\"POST\"), $function);\n\n $this->collection->addRoute($newRoute);\n }", "function updateCdtActionFunction(CdtActionFunction $oCdtActionFunction);", "public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function post()\n\t{\n\n\t// Process the POST variables like in the parent function.\n\t// Code from file: bludit/bl-kernel/abstract/plugin.class.php\n\t$args = $_POST;\n\tforeach ($this->dbFields as $key=>$value) {\n\t\tif (isset($args[$key])) {\n\t\t\t$value = Sanitize::html($args[$key]);\n\t\t\tif ($value === 'false') {\n\t\t\t$value = false;\n\t\t\t} elseif ($value === 'true') {\n\t\t\t$value = true;\n\t\t\t}\n\t\t\tsettype($value, gettype($this->dbFields[$key]));\n\t\t\t$this->db[$key] = $value;\n\t\t}\n\t}\n\n\t// Save the plugin settings to the database.\n\treturn $this->save();\n\n\t}", "function fl_ajax(){\n $func = $this->input->post('function_name');\n $param = $this->input->post();\n \n if(method_exists($this, $func)){ \n (!empty($param))?$this->$func($param):$this->$func();\n }else{\n return false;\n }\n }" ]
[ "0.5915093", "0.56971455", "0.5457228", "0.54542583", "0.5379469", "0.5322913", "0.5294251", "0.52865887", "0.52838635", "0.52807325", "0.5219794", "0.52039003", "0.5196946", "0.5191648", "0.51658845", "0.5155013", "0.51544225", "0.5100345", "0.5094324", "0.50191504", "0.49710363", "0.4958516", "0.49468592", "0.49429554", "0.49170953", "0.4909347", "0.48842055", "0.48451108", "0.48379773", "0.4831679" ]
0.7175972
0
Sets the $update array variable based on the values in the posted form
protected function setUpdateArray() { $column_names = getColumnNames($this->table_name); foreach ($column_names as $column_name) { if (isset($_POST[$column_name])) { $this->update[$column_name] = Mysql::SQLValue($_POST[$column_name]); } else if (isset($_GET[$column_name])) { $this->update[$column_name] = Mysql::SQLValue($_GET[$column_name]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function modifyDataArrForFormUpdate($inputArr)\t{\n\t\tif (is_array($this->conf[$this->conf['cmdKey'].'.']['evalValues.']))\t{\n\t\t\treset($this->conf[$this->conf['cmdKey'].'.']['evalValues.']);\n\t\t\twhile(list($theField,$theValue)=each($this->conf[$this->conf['cmdKey'].'.']['evalValues.']))\t{\n\t\t\t\t\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'twice':\n\t\t\t\t\t\t\tif (isset($inputArr[$theField]))\t{\n\t\t\t\t\t\t\t\tif (!isset($inputArr[$theField.'_again']))\t{\n\t\t\t\t\t\t\t\t\t$inputArr[$theField.'_again'] = $inputArr[$theField];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->additionalUpdateFields.=','.$theField.'_again';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checkArray':\n\t\t\t\t\t\t\t//echo \"<br>$theField : \".$inputArr[$theField];\n\t\t\t\t\t\t\tif ($inputArr[$theField] && !$this->isPreview())\t{\n\t\t\t\t\t\t\t\tfor($a=0;$a<=30;$a++)\t{\n\t\t\t\t\t\t\t\t\tif ($inputArr[$theField] & pow(2,$a))\t{\n\t\t\t\t\t\t\t\t\t\t$alt_theField = $theField.']['.$a;\n\t\t\t\t\t\t\t\t\t\t$inputArr[$alt_theField] = 1;\n\t\t\t\t\t\t\t\t\t\t$this->additionalUpdateFields.=','.$alt_theField;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//echo ' modifyDataArrForFormUpdate : '.$theField.','.$this->additionalUpdateFields;\n\t\t\t\t\t\tbreak;\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\tif (is_array($this->conf['parseValues.']))\t{\n\t\t\treset($this->conf['parseValues.']);\n\t\t\twhile(list($theField,$theValue)=each($this->conf['parseValues.']))\t{\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = split('\\[|\\]',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'multiple':\n\t\t\t\t\t\t\tif (isset($inputArr[$theField]) && !$this->isPreview())\t{\n\t\t\t\t\t\t\t\t$inputArr[$theField] = explode(',',$inputArr[$theField]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checkArray':\n\t\t\t\t\t\t\tif ($inputArr[$theField] && !$this->isPreview())\t{\n\t\t\t\t\t\t\t\tfor($a=0;$a<=30;$a++)\t{\n\t\t\t\t\t\t\t\t\tif ($inputArr[$theField] & pow(2,$a))\t{\n\t\t\t\t\t\t\t\t\t\t$alt_theField = $theField.']['.$a;\n\t\t\t\t\t\t\t\t\t\t$inputArr[$alt_theField] = 1;\n\t\t\t\t\t\t\t\t\t\t$this->additionalUpdateFields.=','.$alt_theField;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$inputArr = $this->userProcess_alt(\n\t\t\t$this->conf['userFunc_updateArray'],\n\t\t\t$this->conf['userFunc_updateArray.'],\n\t\t\t$inputArr\n\t\t);\n\n\t\treturn $inputArr;\n\t}", "public function update(array $update);", "public function fieldUpdate()\n\t{\n\t\t$fieldUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$fieldUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'max_length'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'type'=>preg_match('/text/',$row['Type']) ? 'Area' : 'Field',\n\t\t\t\t'required'=>$row['Null']=='NO' ? true : false,\n\t\t\t\t'input'=>preg_match('/^(password|pass|passwd|passcode)$/i',$row['Field']) ? 'password' : 'text',\n\t\t\t);\n\t\t}\n\t\treturn $fieldUpdate;\n\t}", "private function _update_if_allowed(&$update, $input, $index, &$validate_array = array()) {\n\t\tif(strlen($this->input->post($input['name'])) == 0 && $input['type'] != 'checkbox') return false;\n\t\tif(!isset($input['disabled'])) { \n\t\t\tif(isset($input['type']) && $input['type'] == 'checkbox') $update[$index] = $this->input->post($input['name']) ? 1 : 0;\n\t\t\telse $update[$index] = $this->input->post($input['name']);\n\t\t\t$validate_array[] = $index;\n\t\t\treturn true; \n\t\t}\n\t\treturn false;\n\t}", "function updateFields($table,$postedArray,$condition) \t{\n\t\tforeach($postedArray as $key=>$val){\n\t\t\t$postedArray[$key] = mysql_real_escape_string($postedArray[$key]); \n\t\t}\n\t\treturn $this->update($this->tablePrefix.$table, $postedArray,$condition);\n\t}", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "public function updateMultiple_data()\n {\n \n }", "protected function _updatefields() {}", "protected function _postUpdate()\n\t{\n\t}", "public function multi_update()\n\t{\n\t\t//menangkap variabel inputan\n\t\t$kelompokprakerin_id = $this->input->post('kelompokprakerin_id');\n\t\t$kelompokprakerin = $this->input->post('kelompokprakerin');\n\t\n\t\tfor($i =0;$i < count($kelompokprakerin_id); $i++)\n\t\t{\n\t\t\t$query = \"update tb_kelompokprakerin set kelompokprakerin='$kelompokprakerin[$i]' WHERE kelompokprakerin_id = \".$kelompokprakerin_id[$i];\n\t\t\t$this->db->query($query);\n\t\t\t\n\t\t}\n\t\t\n\t\tredirect('kelompokprakerin');\n\t\t\n\t}", "function do_update(){\n\t\t$input = $_POST['field-'.$this->id_base][$this->number];\n\t\t// remove all slashed from values\n\t\tforeach($input as $var => $value){\n\t\t\tif( is_string($value) ){\n\t\t\t\t$input[$var] = stripslashes($value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// validate: title should be always there\n\t\tif( empty($input['title']) ){\n\t\t\treturn array('status' => '0', 'error' => __('Title field is required.', JCF_TEXTDOMAIN));\n\t\t}\n\t\t\n\t\t// get values from real class:\n\t\t$instance = $this->update($input, $this->instance);\n\t\t$instance['title'] = strip_tags($instance['title']);\n\t\t$instance['slug'] = strip_tags($input['slug']);\n\t\t$instance['enabled'] = (int)@$input['enabled'];\n\t\t\n\t\t// check for errors\n\t\t// IMPORTANT: experimental function\n\t\tif( !empty($this->field_errors) ){\n\t\t\t$errors = implode('\\n', $this->field_errors);\n\t\t\treturn array('status' => '0', 'error' => $errors);\n\t\t}\n\t\t\n\t\tif( $this->is_new ){\n\t\t\t$this->number = jcf_get_fields_index( $this->id_base );\n\t\t\t$this->id = $this->id_base . '-' . $this->number;\n\t\t}\n\t\t\n\t\t// update fieldset\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\t$fieldset['fields'][$this->id] = $instance['enabled'];\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// check slug field\n\t\tif( empty($instance['slug']) ){\n\t\t\t$instance['slug'] = 'field_' . $this->id_base . '__' . $this->number;\n\t\t}\n\t\t\n\t\t// save\n\t\tjcf_field_settings_update($this->id, $instance);\n\t\t\n\t\t// return status\n\t\t$res = array(\n\t\t\t'status' => '1',\n\t\t\t'id' => $this->id,\n\t\t\t'id_base' => $this->id_base,\n\t\t\t'fieldset_id' => $this->fieldset_id,\n\t\t\t'is_new' => $this->is_new,\n\t\t\t'instance' => $instance,\n\t\t);\n\t\treturn $res;\n\t}", "public function update( $updated_form_values, $old_form_values) {\n\t\t$form_values = array();\n\t\t//Update form values\n\t\t$form_values['zappy_title'] = ( ! empty( $updated_form_values['zappy_title'] ) ) ? strip_tags( $updated_form_values['zappy_title'] ) : '';\n\t\t\n\t\t$form_values['zappy_feed_burner_id'] = ( ! empty( $updated_form_values['zappy_feed_burner_id'] ) ) ? strip_tags( $updated_form_values['zappy_feed_burner_id'] ) : '';\n\t\t\n\t\t$form_values['zappy_feedburner_text'] = ( ! empty( $updated_form_values['zappy_feedburner_text'] ) ) ? strip_tags($updated_form_values['zappy_feedburner_text'] ) : '';\n\t\t\n\t\t//Return All form fields values\t\n\t\treturn $form_values;\n\t}", "function validate_form_fields($array = NULL, $update = false) {\n $fields = $this->load_required_fields($array, $update);\n\n if ($array == NULL)\n $array = $_POST;\n\n if (is_array($_FILES))\n $array = array_merge($array, $_FILES);\n\n //Mergin Array\n $group_fields = array_merge($fields, $this->load_other_fields());\n\n validate_cb_form($group_fields, $array);\n }", "protected function _update()\n\t{\n\t}", "function CollectUpdatedSubmission(&$formvars){\r\n\t\t$formvars['Eid'] = $this->Sanitize($_POST['Eid']);\r\n\t\t$formvars['Evename'] = $this->Sanitize($_POST['Evename']);\r\n\t\t$formvars['EstartDate'] = $this->Sanitize($_POST['EstartDate']);\r\n\t\t$formvars['EendDate'] = $this->Sanitize($_POST['EendDate']);\r\n\t\t$formvars['Eaddress'] = $this->Sanitize($_POST['Eaddress']);\r\n\t\t$formvars['Ecity'] = $this->Sanitize($_POST['Ecity']);\r\n\t\t$formvars['Estate'] = $this->Sanitize($_POST['Estate']);\r\n\t\t$formvars['Ezip'] = $this->Sanitize($_POST['Ezip']);\r\n\t\t$formvars['EphoneNumber'] = $this->Sanitize($_POST['EphoneNumber']);\r\n\t\t$formvars['Edescription'] = $this->Sanitize($_POST['Edescription']);\r\n\t\t$formvars['Etype'] = $this->Sanitize($_POST['Etype']);\r\n\t\t$formvars['Ewebsite'] = $this->Sanitize($_POST['Ewebsite']);\r\n\t\t$formvars['Ehashtag'] = $this->Sanitize($_POST['Ehashtag']);\r\n\t\t$formvars['Efacebook'] = $this->Sanitize($_POST['Efacebook']);\r\n\t\t$formvars['Etwitter'] = $this->Sanitize($_POST['Etwitter']);\r\n\t\t$formvars['Egoogle'] = $this->Sanitize($_POST['Egoogle']);\r\n\t\t$formvars['EtimeStart'] = $this->Sanitize($_POST['EtimeStart']);\r\n\t\t$formvars['EtimeEnd'] = $this->Sanitize($_POST['EtimeEnd']);\r\n\t\t$formvars['Eother'] = $this->Sanitize($_POST['Eother']);\r\n\t\t$formvars['Erank'] = $this->Sanitize($_POST['Erank']);\r\n\t}", "abstract function performUpdate(Form $arg0);", "public function multi_update()\n\t{\n\t\t//menangkap variabel inputan\n\t\t$guru_id = $this->input->post('guru_id');\n\t\t$guru = $this->input->post('guru');\n\t\n\t\tfor($i =0;$i < count($guru_id); $i++)\n\t\t{\n\t\t\t$query = \"update tb_guru set guru='$guru[$i]' WHERE guru_id = \".$guru_id[$i];\n\t\t\t$this->db->query($query);\n\t\t\t\n\t\t}\n\t\t\n\t\tredirect('guru');\n\t\t\n\t}", "public function ParsePostData() {\n\t\t\tif (array_key_exists($this->strControlId, $_POST)) {\n //$this->blnModified = true;\n\t\t\t\t// It was -- update this Control's value with the new value passed in via the POST arguments\n\t\t\t\t$strValue = $_POST[$this->strControlId];\n\n foreach($this->arrListItems as $objListItem){\n if($objListItem->Value == $strValue){\n $objListItem->Selected = true;\n }else{\n $objListItem->Selected = false;\n }\n }\n }\n }", "function settingsupdate() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $wl_data = $this->m_white_label->getById($wl_id);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_settings->update($wl_id, $data)){\n $this->m_settings->createSettingsFile($wl_id, $wl_data);\n $this->advsettings(2); \n }else{\n echo 'error';\n }\n }", "public function update()\n {\n $arg = func_get_args();\n\n foreach ($this->group as $form) {\n if (! is_object($form)) {\n $form = new $form();\n }\n\n if (method_exists($form, 'update')) {\n $form->save(...$arg);\n }\n }\n }", "public function validationUpdate()\n\t{\n\t\t$validationUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$validationUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t);\n\t\t}\n\t\treturn $validationUpdate;\n\t}", "function company_settingsupdate() {\n $this->auth(COMP_ADM_LEVEL);\n $company_id = $this->uri->segment(3);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_company_settings->update($company_id, $data)){\n $this->companyadmin(7);\n }else{\n echo 'error';\n }\n }", "public function getUpdateValues(): array;", "function Update($array){\n\n }", "static function athlates_records_updated(){\n\t\t$data = $_POST['form_data'];\n\t\t\t\n\t\tif(is_array($data)){\n\t\t\t$new_data = array();\n\t\t\tforeach ($data as $key => $value){\n\t\t\t\t$new_data[$value['name']] = $value['value'];\n\t\t\t}\n\t\t\t\n\t\t\t//var_dump($new_data); exit();\n\t\t\t\n\t\t\t$post_id = $new_data['post_id'];\n\t\t\t$class_name = $new_data['class_name'];\n\t\t\t$email = $new_data['ajax-processed-email'];\n\t\t\t$user_id = $new_data['user_id'];\n\t\t\t\n\t\t\tself::$post_id = $post_id;\n\t\t\tself::$class_name = $class_name;\n\t\t\tself::$user_id = $user_id;\n\t\t\t\n\t\t\t//now board data and updated data are to be compaired\n\t\t\t$board_data = get_post_meta($post_id, 'Athlates_White_Board', true);\t\t\t\n\t\t\tforeach($board_data as $key => $data){\n\t\t\t\tif($data['class'] == $class_name){\n\t\t\t\t\t$sanitized_data = array();\n\t\t\t\t\tforeach ($data['component'] as $d){\n\t\t\t\t\t\t$sanitized_data[$d['name']]['result'] = $new_data['result['.$d['name'].']'];\n\t\t\t\t\t\t$sanitized_data[$d['name']]['Rx'] = $new_data['Rx['.$d['name'].']'];\n\t\t\t\t\t\t$sanitized_data[$d['name']]['RxScale'] = $new_data['RxScale['.$d['name'].']'];\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//now database operation\n\t\t\tglobal $wpdb;\n\t\t\t$tables = Athlatics_Board_Admin::get_tables();\n\t\t\textract($tables);\n\t\t\t\n\t\t\t$log_row = $wpdb->get_row(\"SELECT * FROM $user_meta WHERE post_id = '$post_id' AND user_id = '$user_id'\");\n\t\t\t$log[$class_name] = array(\n\t\t\t\t\t'log_time' => current_time('timestamp'),\n\t\t\t\t\t'components' => $sanitized_data\n\t\t\t\t);\n\t\t\t$wpdb->update($user_meta, array('log'=>serialize($log), 'time'=>current_time('mysql')), array('user_id'=>$user_id, 'post_id'=>$post_id), array('%s', '%s'), array('%d', '%d'));\n\t\t}\t\n\n\t\t$updated_data = self::show_athlates_contribution(true);\n\t\t\n\t\techo json_encode($updated_data);\n\t\texit;\n\t}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "function absenrich_update(){\r\n\t\t//POST variable here\r\n\t\t$gudang_id=trim(@$_POST[\"gudang_id\"]);\r\n\t\t$gudang_nama=trim(@$_POST[\"gudang_nama\"]);\r\n\t\t$gudang_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_nama);\r\n\t\t$gudang_nama=str_replace(\"'\", '\"',$gudang_nama);\r\n\t\t$gudang_lokasi=trim(@$_POST[\"gudang_lokasi\"]);\r\n\t\t$gudang_lokasi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_lokasi);\r\n\t\t$gudang_lokasi=str_replace(\"'\", '\"',$gudang_lokasi);\r\n\t\t$gudang_keterangan=trim(@$_POST[\"gudang_keterangan\"]);\r\n\t\t$gudang_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_keterangan);\r\n\t\t$gudang_keterangan=str_replace(\"'\", '\"',$gudang_keterangan);\r\n\t\t$gudang_aktif=trim(@$_POST[\"gudang_aktif\"]);\r\n\t\t$gudang_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_aktif);\r\n\t\t$gudang_aktif=str_replace(\"'\", '\"',$gudang_aktif);\r\n\t\t$gudang_creator=trim(@$_POST[\"gudang_creator\"]);\r\n\t\t$gudang_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_creator);\r\n\t\t$gudang_creator=str_replace(\"'\", '\"',$gudang_creator);\r\n\t\t$gudang_date_create=trim(@$_POST[\"gudang_date_create\"]);\r\n\t\t$absenrich_updater=trim(@$_POST[\"absenrich_updater\"]);\r\n\t\t$absenrich_updater=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$absenrich_updater);\r\n\t\t$absenrich_updater=str_replace(\"'\", '\"',$absenrich_updater);\r\n\t\t$gudang_date_update=trim(@$_POST[\"gudang_date_update\"]);\r\n\t\t$gudang_revised=trim(@$_POST[\"gudang_revised\"]);\r\n\t\t$result = $this->m_absensi_enrichment->absenrich_update($gudang_id ,$gudang_nama ,$gudang_lokasi ,$gudang_keterangan ,$gudang_aktif ,$gudang_creator ,$gudang_date_create ,$absenrich_updater ,$gudang_date_update ,$gudang_revised );\r\n\t\techo $result;\r\n\t}", "public function form_add_step_2($update){\n\n $form = array();\n $form['updated_at'] = gmdate(date('Y-m-d h:i:s'),time());\n $form['status'] = $update['status'];\n $form['form_content'] = $update['form_content'];\n //$form['form_api_content'] = '';\n $this->db->where('form_id = '.$update['form_id']);\n $this->db->update('form_details',$form);\n if($this->db->affected_rows()){\n return true;\n }\n else{\n return false;\n }\n }" ]
[ "0.7219526", "0.7178545", "0.64887655", "0.6357527", "0.6344165", "0.63061184", "0.6269735", "0.61862844", "0.6146527", "0.61085993", "0.6103149", "0.60827994", "0.60818577", "0.607382", "0.60548675", "0.5990711", "0.59838504", "0.5979938", "0.5973769", "0.59622407", "0.5955728", "0.5938876", "0.5920784", "0.5913608", "0.58959913", "0.5863633", "0.58424574", "0.58424574", "0.58423364", "0.58367586" ]
0.72601664
0
Sets the $filter array variable based on the value of the primary keys in the GET variables.
protected function setFilterArray() { $primary_keys = getPrimaryKeys($this->table_name); foreach ($primary_keys as $pk) { if (isset($_GET[$pk])) { $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "protected function setParamsFilters()\n {\n if ($this->arParams['IBLOCK_TYPE'])\n {\n $this->filterParams['IBLOCK_TYPE'] = $this->arParams['IBLOCK_TYPE'];\n }\n\n if ($this->arParams['IBLOCK_ID'])\n {\n $this->filterParams['IBLOCK_ID'] = $this->arParams['IBLOCK_ID'];\n }\n\n if ($this->arParams['SECTION_CODE'])\n {\n $this->filterParams['SECTION_CODE'] = $this->arParams['SECTION_CODE'];\n }\n elseif ($this->arParams['SECTION_ID'])\n {\n $this->filterParams['SECTION_ID'] = $this->arParams['SECTION_ID'];\n }\n\n if ($this->arParams['INCLUDE_SUBSECTIONS'] === 'Y')\n {\n $this->filterParams['INCLUDE_SUBSECTIONS'] = 'Y';\n }\n\n if ($this->arParams['ELEMENT_CODE'])\n {\n $this->filterParams['CODE'] = $this->arParams['ELEMENT_CODE'];\n }\n elseif ($this->arParams['ELEMENT_ID'])\n {\n $this->filterParams['ID'] = $this->arParams['ELEMENT_ID'];\n }\n\n if ($this->arParams['CHECK_PERMISSIONS'])\n {\n $this->filterParams['CHECK_PERMISSIONS'] = $this->arParams['CHECK_PERMISSIONS'];\n }\n\n if (!isset($this->filterParams['ACTIVE']))\n {\n $this->filterParams['ACTIVE'] = 'Y';\n }\n\n if (strlen($this->arParams['EX_FILTER_NAME']) > 0\n && preg_match(\"/^[A-Za-z_][A-Za-z01-9_]*$/\", $this->arParams['EX_FILTER_NAME'])\n && is_array($GLOBALS[$this->arParams['EX_FILTER_NAME']])\n )\n {\n $this->filterParams = array_merge_recursive($this->filterParams, $GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n\n $this->addCacheAdditionalId($GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n }\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "public function setFilter($arrFilter);", "private function _setupFiltering()\n\t{\n\t\tglobal $txt;\n\n\t\t// We'll escape some strings...\n\t\t$db = database();\n\n\t\t// You can filter by any of the following columns:\n\t\t$filters = array(\n\t\t\t'id_member' => $txt['username'],\n\t\t\t'ip' => $txt['ip_address'],\n\t\t\t'session' => $txt['session'],\n\t\t\t'url' => $txt['error_url'],\n\t\t\t'message' => $txt['error_message'],\n\t\t\t'error_type' => $txt['error_type'],\n\t\t\t'file' => $txt['file'],\n\t\t\t'line' => $txt['line'],\n\t\t);\n\n\t\t$filter = $this->_req->getQuery('filter', 'trim', null);\n\t\t$value = $this->_req->getQuery('value', 'trim', null);\n\n\t\t// Set up the filtering...\n\t\tif (isset($value, $filters[$filter]))\n\t\t{\n\t\t\t$filter = array(\n\t\t\t\t'variable' => $filter,\n\t\t\t\t'value' => array(\n\t\t\t\t\t'sql' => in_array($filter, array('message', 'url', 'file'))\n\t\t\t\t\t\t? base64_decode(strtr($value, array(' ' => '+')))\n\t\t\t\t\t\t: $db->escape_wildcard_string($value),\n\t\t\t\t),\n\t\t\t\t'href' => ['filter' => $filter, 'value' => $value],\n\t\t\t\t'entity' => $filters[$filter]\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($filter, $value))\n\t\t\t{\n\t\t\t\tunset($this->_req->query->filter, $this->_req->query->value);\n\t\t\t}\n\n\t\t\t$filter = [];\n\t\t}\n\n\t\treturn $filter;\n\t}", "protected function prepareFilter()\n\t{\n\t\tglobal $USER;\n\t\tglobal $DB;\n\n\t\t$arFilter = array();\n\t\t$arFilter[\"USER_ID\"] = $USER->GetID();\n\t\t$arFilter[\"LID\"] = SITE_ID;\n\n\t\tif (strlen($_REQUEST[\"filter_id\"]))\n\t\t{\n\t\t\tif ($this->options['USE_ACCOUNT_NUMBER'])\n\t\t\t\t$arFilter[\"ACCOUNT_NUMBER\"] = $_REQUEST[\"filter_id\"];\n\t\t\telse\n\t\t\t\t$arFilter[\"ID\"] = intval($_REQUEST[\"filter_id\"]);\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_date_from\"]))\n\t\t\t$arFilter[\"DATE_FROM\"] = trim($_REQUEST[\"filter_date_from\"]);\n\t\tif (strlen($_REQUEST[\"filter_date_to\"]))\n\t\t{\n\t\t\t$arFilter[\"DATE_TO\"] = trim($_REQUEST[\"filter_date_to\"]);\n\n\t\t\tif ($arDate = ParseDateTime(trim($_REQUEST[\"filter_date_to\"]), $this->dateFormat))\n\t\t\t{\n\t\t\t\tif (StrLen(trim($_REQUEST[\"filter_date_to\"])) < 11)\n\t\t\t\t{\n\t\t\t\t\t$arDate[\"HH\"] = 23;\n\t\t\t\t\t$arDate[\"MI\"] = 59;\n\t\t\t\t\t$arDate[\"SS\"] = 59;\n\t\t\t\t}\n\n\t\t\t\t$arFilter[\"DATE_TO\"] = date($DB->DateFormatToPHP($this->dateFormat), mktime($arDate[\"HH\"], $arDate[\"MI\"], $arDate[\"SS\"], $arDate[\"MM\"], $arDate[\"DD\"], $arDate[\"YYYY\"]));\n\t\t\t}\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_status\"]))\n\t\t\t$arFilter[\"STATUS_ID\"] = trim($_REQUEST[\"filter_status\"]);\n\n\t\tif (strlen($_REQUEST[\"filter_payed\"]))\n\t\t\t$arFilter[\"PAYED\"] = trim($_REQUEST[\"filter_payed\"]);\n\n\t\tif(!isset($_REQUEST['show_all']) || $_REQUEST['show_all'] == 'N')\n\t\t{\n\t\t\tif($_REQUEST[\"filter_history\"]!=\"Y\")\n\t\t\t\t$arFilter[\"!@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\n\t\t\tif(isset($_REQUEST[\"filter_history\"]) && $_REQUEST[\"filter_history\"] == \"Y\")\n\t\t\t\t$arFilter[\"@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_canceled\"]))\n\t\t\t$arFilter[\"CANCELED\"] = trim($_REQUEST[\"filter_canceled\"]);\n\n\t\t$this->filter = $arFilter;\n\t}", "public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }", "public function setFilter($filter){ }", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "private function setFilter()\n {\n $this->filter['value'] = $this->getParameter('value') == null ? '' : $this->getParameter('value');\n }", "abstract public function prepareFilters();", "private function filter($filter) {\n\t\tforeach ($filter as $key => $value) {\n\n\t\t\tif (array_key_exists('userID', $filter)) {\n\t\t\t\t$this -> db -> where('userID', $filter['userID']);\n\t\t\t}\n\t\t\tif (array_key_exists('catID', $filter)) {\n\t\t\t\t$this -> db -> where('catID', $filter['catID']);\n\t\t\t}\n\n\t\t\tif (array_key_exists('search', $filter)) {\n\t\t\t\t$array = explode(' ', $value);\n\t\t\t\tforeach ($array as $key => $value)\n\t\t\t\t\t$this -> db -> like('title', $value);\n\n\t\t\t}\n\t\t}\n\t}", "protected function filterParams()\n {\n }", "function _prepareFilter(&$controller){\n \t\n\t\t$filter = array();\n if(isset($controller->data)){\n foreach($controller->data as $model=>$fields){\n foreach($fields as $key=>$field){\n if($field == ''){\n unset($controller->data[$model][$key]);\n }\n }\n }\n \n App::import('Sanitize');\n $sanit = new Sanitize();\n $controller->data = $sanit->clean($controller->data);\n $filter = $controller->data;\n }\n \n if (empty($filter)){\n \t\t$filter = $this->_checkParams($controller); \t\n }\n $controller->data = $filter;\n }", "protected function setFilter(array $filter) {\n $this->filter = array_flip($filter);\n }", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "public function setFilter(string $filter);", "private function loadFiltersFromAttributes(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n foreach ($request->attributes->getIterator() as $key => $value) {\n $key = (string) $key;\n if ($this->getFilterByName($key) === null) {\n continue;\n }\n\n $filterField = new FilterField();\n $filterField->setName($key)\n ->setValue($value)\n ->setComparison(Api\\Filter::COMPARISON_EQUALS)\n ->setFilter($this->getFilterByName($key));\n\n $this->filterFields[] = $filterField;\n }\n }", "public function setFilter(array $filter)\n {\n $model = $this->getModel();\n $model->setFilter($filter);\n }", "public function cleanGet($filter='string'){\n return $this->purify($_GET,$filter);\n }", "function setFilter($filter) {\n\t\t$this->_filter = $filter;\n\t}", "protected function parseFilterParams(): void\n {\n\n $this->parseFilters();\n\n $where = $this->uriParser->whereParameters();\n\n if (empty($where)) {\n return;\n }\n\n /** @scrutinizer ignore-call */\n $tableColumns = $this->getTableColumns();\n $table = $this->getModel()->getTable();\n\n foreach ($where as $whr) {\n if (strpos($whr['key'], '.') > 0) {\n $this->/** @scrutinizer ignore-call */setWhereHasClause($whr);\n continue;\n } elseif (! in_array($whr['key'], $tableColumns)) {\n continue;\n }\n $this->/** @scrutinizer ignore-call */setQueryBuilderWhereStatement($this->getBuilder(), $table . '.' . $whr['key'], $whr);\n }\n }", "private function setGetParameters() {\n\t\tforeach(array_keys($_GET) as $currentKey) {\n\t\t\t$this->getArray[$currentKey] = $_GET[$currentKey];\n\t\t}\n\t}", "function filter(){\n //$_SESSION['filters'] = array('GPA' => ['2.0', '3.0']), 'Nationality' => ['saudi'], 'Company_size' => ['large'], 'Major' => ['Computer Science', 'Marketing', 'Finance']);\n if($_GET['checked'] == \"true\"){\n if(!isset($_SESSION['filters'])){\n $_SESSION['filters'] = array();\n }\n if(isset($_SESSION['filters'][$_GET['category']])){\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n } else{\n $_SESSION['filters'][$_GET['category']] = array();\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }else{\n if(isset($_SESSION['filters'][$_GET['category']])){\n unset($_SESSION['filters'][$_GET['category']][array_search($_GET['value'],$_SESSION['filters'][$_GET['category']])]);\n $_SESSION['filters'][$_GET['category']] = removeGaps($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters'][$_GET['category']]) === 0){\n unset($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters']) === 0){\n unset($_SESSION['filters']);\n }\n }\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }\n }", "public function global_filter_field_expr()\n {\n\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->get($key, $this->_clean_input_field_expr($val));\n }\n }\n\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->post($key, $this->_clean_input_field_expr($val));\n }\n }\n }\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->cookie($key, $this->_clean_input_field_expr($val));\n }\n\n }\n }\n\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->request($key, $this->_clean_input_field_expr($val));\n }\n }\n }\n\n }", "private function param($key, $filter, $type)\n\t{\n if ($key === null || $key === true) {\n return filter_input_array($type, FILTER_SANITIZE_STRING) ?: array();\n } else if ($key === false) {\n return filter_input_array($type, FILTER_UNSAFE_RAW) ?: array();\n } else if ($filter) {\n return filter_input($type, $key, FILTER_SANITIZE_STRING);\n } else {\n return filter_input($type, $key, FILTER_UNSAFE_RAW);\n }\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_articles_statuses2,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"account_type\"\t=> 'select_box(\"account_type\",\t$this->_account_types2,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t\t$selected, 0, 2, \"\", false)',\n\t\t));\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Get user account type\n\t\t$this->_account_types2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_account_types as $k => $v) {\n\t\t\t$this->_account_types2[$k]\t= $v;\n\t\t}\n\t\t// Get user account type\n\t\t$this->_articles_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_articles_statuses as $k => $v) {\n\t\t\t$this->_articles_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"cat_id\",\n\t\t\t\"user_id\",\n\t\t\t\"add_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"id_min\",\n\t\t\t\"id_max\",\n\t\t\t\"date_min\",\n\t\t\t\"date_max\",\n\t\t\t\"nick\",\n\t\t\t\"user_id\",\n\t\t\t\"title\",\n\t\t\t\"summary\",\n\t\t\t\"text\",\n\t\t\t\"account_type\",\n\t\t\t\"status\",\n\t\t\t\"cat_id\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t);\n\t}", "protected function setup_filters()\n\t{\n\t\t$this->orderby = ( !empty($_GET['orderby']) ? $_GET['orderby'] : 'timestamp' );\n\t\t$order = ( !empty($_GET['order']) ? $_GET['order'] : 'asc' );\n\t\t\n\t\tswitch( $order )\n\t\t{\n\t\t\tcase 'asc': case 'desc': break;\n\t\t\tdefault: $order = null; break;\n\t\t}\n\n\t\tswitch( $this->orderby )\n\t\t{\n\t\t\tcase 'timestamp':\n\t\t\t\tif( !$order ) $order = 'asc';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->orderby = 'timestamp';\n\t\t\t\tif( !$order ) $order = 'asc';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\n\t\tif( !isset($_GET) ) $_GET = array();\n\t\t$_GET['orderby'] = $this->orderby;\n\t\t$_GET['order'] = $order;\n\t\t\n\t\t$this->orderby .= ' '.$order;\n\t}", "function get_current_filters () \n{\n if (count($_GET) < 1) \n return array();\n \n foreach ($_GET as $field_name => $value) {\n if (strlen($value) < 1) continue;\n $filters[$field_name] = addslashes($value);\n }\n \n unset($filters[w]);\n \n return $filters;\n}" ]
[ "0.7118917", "0.68524235", "0.65505576", "0.6530183", "0.6527519", "0.64323545", "0.6407445", "0.630372", "0.62913865", "0.6277528", "0.62209946", "0.62091124", "0.6134404", "0.6119843", "0.6101276", "0.6096641", "0.60774136", "0.6029378", "0.6024465", "0.5955177", "0.5915224", "0.5902901", "0.5895695", "0.5842987", "0.5831929", "0.5825418", "0.5824811", "0.5822729", "0.5814914", "0.5811186" ]
0.8286648
0
A user must have one of these access levels if they are to post this form
protected function setRequiredAccessLevelsForPost() { $this->post_required_access_levels = array("owner","admin","collaborator"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function my_pmpro_has_membership_access_filter($access, $post, $user)\n{\n\tif(!empty($user->membership_level) && $user->membership_level->ID == 5)\n\t\treturn true;\t//level 5 ALWAYS has access\n\n\treturn $access;\n}", "function pmprosl_pmpro_has_membership_access_filter( $hasaccess, $post, $user, $post_membership_levels ) {\n\tif ( isset( $_COOKIE['pmprosl_has_access'] ) && $_COOKIE['pmprosl_has_access'] )\n\t\t// Loop through post levels\n\t\tforeach ( $post_membership_levels as $level )\n\t\t\t// If the cookie matches one of the post levels, give them access\n\t\t\tif ( ( int ) $_COOKIE['pmprosl_has_access'] == $level->id ) {\n\t\t\t\t$hasaccess = true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\treturn $hasaccess;\n}", "public function check_access_type() {\n // get users\n $user_list = $this->get_user->get_all_users();\n // check user is in access table\n foreach($user_list as $user) {\n // check if user exists\n $user_access = $this->get_user->user_level($user->user_id);\n // inserts new user into table\n if ($user_access == NULL && $user_access == '') {\n $this->get_user->insert_access($user->user_id,'student');\n } \n // generates new password if default value of 'password' is found\n $this->generate_new_passwords(); \n }\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function authorize() {\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( is_tax() || is_category() || is_tag() ) {\n\t\t\t$term_id = get_queried_object()->term_id;\n\n\t\t\tif ( empty ( $term_id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user = new User();\n\t\t\t$access_type = get_term_meta( $term_id, 'subway_membership_access_type', true );\n\t\t\t$allowed_user_roles = get_term_meta( $term_id, 'subway_membership_access_type_roles', true );\n\t\t\t$current_user_role = $user->get_role( get_current_user_id() );\n\n\t\t\tif ( 'private' === $access_type ) {\n\t\t\t\t// If no user role is found.\n\t\t\t\tif ( ! array_intersect( $allowed_user_roles, $current_user_role ) ) {\n\t\t\t\t\t$options = new Options();\n\t\t\t\t\t$login_page_url = $options->get_redirect_url();\n\t\t\t\t\twp_safe_redirect( $login_page_url, 302 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function can_access($min_level, $redirect = 'bienvenido'){\n if(! $this->CI->session->userdata('user') || $min_level > $this->CI->session->userdata('user')->level){\n redirect($redirect, 'refresh');\n } \n }", "function auth_can_edit_user($user, $target)\n{\n global $min_user_editing_level;\n \n // Always allowed to modify your own stuff\n if(strcasecmp($user, $target) == 0)\n {\n return 1;\n }\n\n if(authGetUserLevel($user) >= $min_user_editing_level)\n {\n return 1;\n }\n\n // Unathorised access\n return 0;\n}", "public function authorize()\n {\n $user = auth()->user()->first();\n $department = Department::findOrFail($this->input('department_id'));\n $semester_type = SemesterType::findOrFail($this->input('semester_type_id'));\n $level = Level::findOrFail($this->input('level_id'));\n return (\n $user->can('view', $department) && \n $user->can('view', $level) &&\n $user->can('view', $semester_type)\n ) &&\n (\n $user->hasRole(Role::ADMIN) || \n ($user->id == $department->hod->first()->user()->first()->id) || // department hod\n ($user->staff()->where('id', $department->faculty()->first()->dean()->first()->id)->exists()) || // faculty dean\n ($user->id == $department->faculty()->first()->school()->first()->owner_id) // school owner\n );\n }", "public function allowAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') )\n\t\t{\tif( $this->db->allowRefund($this->_getParam('user')) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the number for the past term\n\t\t$term = (date('Y') - 1900) * 10 + floor((date('m') - 1) / 4) * 4 + 1;\n\t\tif( $term % 10 == 1 )\n\t\t{\t$term -= 2;\n\t\t}else\n\t\t{\t$term -= 4;\n\t\t}\n\n\t\t// Add list of people who already have been enabled\n\t\t$this->view->user_allowed = implode( \", \", $this->db->getRefunds('REGULAR', $term));\n\n\t\t// Add list of users who got their refunds last term\n\t\t$this->view->user_options = $this->db->getRefunds('RECEIVED', $term);\n\t}", "public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\n }", "function effect() {\n\t\t$request = $this->_request;\n\t\t$context = $request->getContext();\n\t\t$contextId = $context->getId();\n\t\t$user = $request->getUser();\n\t\tif (!is_a($user, 'User')) return AUTHORIZATION_DENY;\n\n\t\t$userId = $user->getId();\n\t\t$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);\n\n\t\t$accessibleWorkflowStages = array();\n\t\t$workflowStages = Application::getApplicationStages();\n\t\tforeach ($workflowStages as $stageId) {\n\t\t\t$accessibleStageRoles = $this->_getAccessibleStageRoles($userId, $contextId, $submission, $stageId);\n\t\t\tif (!empty($accessibleStageRoles)) {\n\t\t\t\t$accessibleWorkflowStages[$stageId] = $accessibleStageRoles;\n\t\t\t}\n\t\t}\n\n\t\t$this->addAuthorizedContextObject(ASSOC_TYPE_ACCESSIBLE_WORKFLOW_STAGES, $accessibleWorkflowStages);\n\n\t\t// Does the user have a role which matches the requested workflow?\n\t\tif (!is_null($this->_workflowType)) {\n\t\t\t$workflowTypeRoles = Application::getWorkflowTypeRoles();\n\t\t\tforeach ($accessibleWorkflowStages as $stageId => $roles) {\n\t\t\t\tif (array_intersect($workflowTypeRoles[$this->_workflowType], $roles)) {\n\t\t\t\t\treturn AUTHORIZATION_PERMIT;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn AUTHORIZATION_DENY;\n\n\t\t// User has at least one role in any stage in any workflow\n\t\t} elseif (!empty($accessibleWorkflowStages)) {\n\t\t\treturn AUTHORIZATION_PERMIT;\n\t\t}\n\n\t\treturn AUTHORIZATION_DENY;\n\t}", "function checkAuthorised($just_check=FALSE)\n{\n global $page_level, $max_level;\n global $day, $month, $year, $area, $room;\n global $PHP_SELF;\n\n $page = this_page();\n \n // Get the minimum authorisation level for this page\n if (isset($page_level[$page]))\n {\n $required_level = $page_level[$page];\n }\n elseif (isset($max_level))\n {\n $required_level = $max_level;\n }\n else\n {\n $required_level = 2;\n }\n \n if ($just_check)\n {\n if ($required_level == 0)\n {\n return TRUE;\n }\n $user = getUserName();\n return (isset($user)) ? (authGetUserLevel($user) >= $required_level): FALSE;\n }\n \n // Check that the user has this level\n if (!getAuthorised($required_level))\n {\n // If we dont know the right date then use today's\n if (!isset($day) or !isset($month) or !isset($year))\n {\n $day = date(\"d\");\n $month = date(\"m\");\n $year = date(\"Y\");\n }\n if (empty($area))\n {\n $area = get_default_area();\n }\n showAccessDenied($day, $month, $year, $area, isset($room) ? $room : null);\n exit();\n }\n \n return TRUE;\n}", "public function allowUser() {\n \t$level = -1;\n\t if ($this->userData !== null){\n\n\t $level = $this->userData->level;\n\n\t\t}\n\t\treturn $level;\n\t \n\t}", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function listsaccessLevelpost()\r\n {\r\n $input = Request::all();\r\n $new_accessLevel = AccessLevel::create($input);\r\n if($new_accessLevel){\r\n return response()->json(['msg' => 'Added a new accessLevel']);\r\n }else{\r\n return response('Oops, it seems like there was a problem adding the accessLevel');\r\n }\r\n }", "static function assertLevelOrUser(int $level, ?User $user) {\n if(!self::$user->hasLevel($level) && !self::$user->equals($user)) {\n header('Location: ../view/ErrorView.php?status=403');\n }\n }", "function getAuthorised($level)\n{\n // If the minimum level is zero (or not set) then they are\n // authorised, whoever they are\n if (empty($level))\n {\n return TRUE;\n }\n\n // Otherwise we need to check who they are\n $user = getUserName();\n if(isset($user) == FALSE)\n {\n authGet();\n return 0;\n }\n\n return authGetUserLevel($user) >= $level;\n}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "function page_require_level($required_level) {\n global $session;\n $current_user = current_user();\n\n /* caution */\n /* === === */\n if ( !$current_user ) {\n redirect('home.php',FALSE);\n return FALSE;\n }\n $login_group = find_by_groupLevel($current_user['nivel_usuario']);\n\n // if user is not logged in\n if (!$session->isUserLoggedIn(TRUE)) {\n $session->msg('d','Por favor Iniciar sesión...');\n redirect('index.php', FALSE);\n }\n // if group status is inactive\n elseif($login_group['estatus_gpo'] === '0') {\n $session->msg('d','Este nivel de usaurio esta inactivo!');\n redirect('home.php',FALSE);\n }\n // checking if (user level) <= (required level)\n elseif($current_user['nivel_usuario'] <= (int)$required_level) {\n return TRUE;\n }\n else {\n $session->msg(\"d\", \"¡Lo siento! no tienes permiso para ver la página.\");\n redirect('home.php', FALSE);\n }\n}", "static public function check_access($level = null)\n\t{\n\n\t\t$user = \\Model_Users::build()->where('user', Session::get('username'))->execute();\n\t\t$user = $user[0];\n\t\tif($level == null)\n\t\t{\n\t\t\treturn $user->access;\n\t\t}\n\t\tif(is_string($level))\n\t\t{\n\t\t\tswitch ($level) \n\t\t\t{\n\t\t\t\tcase 'banned':\n\t\t\t\t\t$level = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'customer':\n\t\t\t\t\t$level = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'privilege':\n\t\t\t\t\t$level = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'admin':\n\t\t\t\t\t$level = 3;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(isset($user->access))\n\t\t{\n\t\t\tif($user->access >= $level)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "function classChosen($req_level) {\n\t$user_level = $_SESSION['privileges'];\n\tif ($user_level > $req_level && $user_level != 0) {\n\t\theader ('Location: index.php?access=restricted');\n\t} else {\n\t\treturn TRUE;\n\t}\n}", "function authorisation($userlvl, $pagelvl)\n{\n\treturn ($userlvl >= $pagelvl);\n}", "function page_require_level($require_level){\n global $session;\n $current_user = current_user();\n $login_level = find_by_groupLevel($current_user['user_level']);\n //if user not login\n if (!$session->isUserLoggedIn(true)):\n $session->msg('d','Please login to AdFlow.');\n redirect('index.php', false);\n //if Group status Deactive\n elseif($login_level['group_status'] === '0'):\n $session->msg('d','This level user has been band!');\n redirect('about.php',false);\n //cheackin log in User level and Require level is Less than or equal to\n elseif($current_user['user_level'] <= (int)$require_level):\n return true;\n else:\n $session->msg(\"d\", \"Sorry! you dont have permission to view the page.\");\n redirect('about.php', false);\n endif;\n\n }", "function formPermissions($branch) {\n\t\tglobal $perm_defaults;\n\n\t\t// Set output text\n\n\t\t// Create a object of the class dynamicControls\n\t\t$dynamic_controls = new we_dynamicControls();\n\t\t// Now we create the overview of the user rights\n\t\t$content = $dynamic_controls->fold_checkbox_groups(\t$this->permissions_slots,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_main_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->Name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$branch,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"administrator\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"we_form\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"perm_branch\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue);\n\n\n\n\t\t$javascript ='\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\"><!--\n\n\t\t\t\tfunction rebuildCheckboxClicked() {\n\t\t\t\t\ttoggleRebuildPerm(false);\n\t\t\t\t}\n\n\t\t\t\tfunction toggleRebuildPerm(disabledOnly) {\n\n\t\t\t\t';\n\t\tif(isset($this->permissions_slots['rebuildpermissions']) && is_array($this->permissions_slots['rebuildpermissions'])) {\n\n\n\n\t\t\tforeach($this->permissions_slots['rebuildpermissions'] as $pname=>$pvalue) {\n\t\t\t\tif($pname!='REBUILD') {\n\t\t\t\t\t$javascript .= '\n\t\t\t\t\tif (document.we_form.' . $this->Name . '_Permission_REBUILD && document.we_form.' . $this->Name . '_Permission_' . $pname . ') {\n\t\t\t\t\t\tif(document.we_form.' . $this->Name . '_Permission_REBUILD.checked) {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = false;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = true;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;\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';\n\t\t\t\t} else {\n\t\t\t\t\t$handler = \"\n\t\t\t\t\tif (document.we_form.\" . $this->Name . \"_Permission_\" . $pname . \") {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = rebuildCheckboxClicked;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = top.content.setHot();\n\t\t\t\t\t}\n\t\t\t\t\ttoggleRebuildPerm(true);\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$javascript .= '\n\t\t\t\t}\n\t\t\t\t\t\t';\n\t\tif(isset($handler)) {\n\t\t\t$javascript .= $handler;\n\t\t}\n\t\t$javascript .= '\n\t\t\t//--></script>';\n\n\t\t$parts = array();\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0,\n\t\t\t\t\t\t\t\t\"noline\"=>1\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\t\t// js to uncheck all permissions\n\t\t$uncheckjs = '';\n\t\t$checkjs = '';\n\t\tforeach($this->permissions_slots as $group) {\n\t\t\tforeach($group as $pname=>$pvalue) {\n\t\t\t\tif($pname!='ADMINISTRATOR') {\n\t\t\t\t\t$uncheckjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;';\n\t\t\t\t\t$checkjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$we_button = new we_button();\n\t\t$button_uncheckall = $we_button->create_button('uncheckall', 'javascript:' . $uncheckjs);\n\t\t$button_checkall = $we_button->create_button('checkall', 'javascript:' . $checkjs);\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'headline'=>'',\n\t\t\t\t\t\t\t\t'html'=>$we_button->create_button_table(array($button_uncheckall,$button_checkall)),\n\t\t\t\t\t\t\t\t'space'=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\t// Check if user has right to decide to give administrative rights\n\t\tif(is_array($this->permissions_slots[\"administrator\"]) && we_hasPerm(\"ADMINISTRATOR\") && $this->Type==0) {\n\t\t\tforeach($this->permissions_slots[\"administrator\"] as $k=>$v) {\n\t\t\t\t$content='\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"500\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . getPixel(1, 5) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . we_forms::checkbox(($v ? $v : \"0\"), ($v ? true : false), $this->Name . \"_Permission_\" . $k , $this->permissions_titles[\"administrator\"][$k], false, \"defaultfont\", ($k==\"REBUILD\"?\"setRebuidPerms();\":\"\")) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>';\n\t\t\t}\n\t\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$this->formInherits(\"_ParentPerms\",$this->ParentPerms,$GLOBALS['l_users'][\"inherit\"]),\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\treturn we_multiIconBox::getHTML(\"\",\"100%\",$parts,30).$javascript;\n\t}", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "public function checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }" ]
[ "0.6499559", "0.63835377", "0.62850654", "0.6264078", "0.62082493", "0.6139527", "0.60873264", "0.60821533", "0.6003797", "0.5991259", "0.5978252", "0.59432805", "0.5907075", "0.5888768", "0.5876836", "0.58171606", "0.5815755", "0.57903427", "0.57903427", "0.5783683", "0.57766026", "0.5759238", "0.57573044", "0.57538605", "0.5738001", "0.572969", "0.57291", "0.57279176", "0.57164997", "0.5712561" ]
0.76484525
0
Set use default on error
public function setUseDefaultOnError($flag) { return $this->setOption('use_default_on_error', $flag); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUseDefaultOnError()\n {\n return $this->getOption('use_default_on_error');\n }", "function setDefaultValue ($defaultValue) {\n\t\t$r = checkType ($defaultValue, $this->getType ());\n\t\tif (! isError ($r)) {\n\t\t\t$this->defaultValue = $defaultValue;\n\t\t} else {\n\t\t\treturn $r;\n\t\t}\n\t}", "protected function func_default() {}", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "public function setDefault($value);", "public function firstError($default=null) {\n if (isset($this->errorMsg[0])) {\n return $this->errorMsg[0];\n }\n return $default;\n }", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "public function getDefault();", "protected function setDefaults()\n {\n return;\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function getDefaultValue() {}", "public function getDefaultValue() {}", "function _cmd_redirectToDefault(SGL_Registry $input, SGL_Output $output)\n {\n // must not logmessage here\n\n // if no errors have occured, redirect\n if (!SGL_Error::count()) {\n SGL_HTTP::redirect(array('cLang' => $input->cLang));\n\n // else display error with blank template\n } else {\n $output->template = 'error.html';\n }\n }", "function _setDefaults() {}", "public function firstErrorOrWarning($default=null) {\n $r=$this->firstError();\n if ($r===null) $r=$this->firstWarning();\n return ($r===null)?$default:$r;\n }", "public function setDefaultValue ($name, $value) {\n // xxx finish\n }", "public function default() {\n return \"No param given...\";\n }", "public function getDefault($var);", "public function errorMode(){}", "function set_error() \n {\n $this->error_state = FORMEX_FIELD_ERROR;\n }", "protected function useDefaultValuesForNotConfiguredOptions() {}", "public function getDefaultValue();", "public function getDefaultValue();", "public function setDefaultValue($value);", "public function __default()\n\t{\n\n\t}", "protected function get_default() {\n\t\treturn false;\n\t}", "function login_error_override() {\n\tglobal $errors;\n\t$err_codes = $errors->get_error_codes();\n\n\t// Invalid username.\n\t// Default: '<strong>ERROR</strong>: Invalid username. <a href=\"%s\">Lost your password</a>?'\n\tif ( in_array( 'invalid_username', $err_codes ) ) {\n\t\t$error = '<strong>ERROR</strong>: Invalid username.';\n\t}\n\n\t// Incorrect password.\n\t// Default: '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href=\"%2$s\">Lost your password</a>?'\n\tif ( in_array( 'incorrect_password', $err_codes ) ) {\n\t\t$error = '<strong>ERROR</strong>: The password you entered is incorrect.';\n\t}\n\n\treturn $error;\n}", "public function getDefaultValue(): mixed;", "function setDefaults()\n {\n }", "function define_default($param, $value) {\n\t\t//\n\t}" ]
[ "0.70009977", "0.6358465", "0.6179887", "0.61792564", "0.6123312", "0.6079653", "0.60613775", "0.5995562", "0.5980921", "0.594453", "0.59426683", "0.59421575", "0.5911713", "0.5886813", "0.5870045", "0.58605796", "0.5838965", "0.5806167", "0.5799278", "0.5779204", "0.5756662", "0.5756501", "0.5756501", "0.5738822", "0.573571", "0.5720693", "0.5707318", "0.5695657", "0.56822544", "0.5646989" ]
0.67489165
1
Get use default on error
public function getUseDefaultOnError() { return $this->getOption('use_default_on_error'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function firstErrorOrWarning($default=null) {\n $r=$this->firstError();\n if ($r===null) $r=$this->firstWarning();\n return ($r===null)?$default:$r;\n }", "public function firstError($default=null) {\n if (isset($this->errorMsg[0])) {\n return $this->errorMsg[0];\n }\n return $default;\n }", "public static function getDefault()\r\n {\r\n return self::get('default');\r\n }", "public function getDefault();", "private function get($key, $default = null)\n {\n if (isset($this->responseData['error'][$key])) {\n return $this->responseData['error'][$key];\n }\n\n return $default;\n }", "public function get_default(){\n\t\treturn $this->default;\n\t}", "public static function get_fallback()\n {\n }", "public function getDefault(): ?string;", "public function getDefaultValue() {}", "public function getDefaultValue() {}", "public function getDefault($var);", "public static function getDefault()\n {\n return self::$default;\n }", "public function getDefaultValue(): mixed;", "public function getOrError(string $key)\n {\n $default = function() {}; // a function object for strict uniqueness\n\n $value = array_get($this->raw, $key, $default);\n\n if ($value === $default) {\n throw new \\Error('Unable to find option ' . $key);\n }\n\n return $value;\n }", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "protected function func_default() {}", "public function getDefaultValue()\n {\n\treturn $this->default;\n }", "public function getDefault()\n {\n return $this->get($this->default);\n }", "protected function get_default() {\n\t\treturn false;\n\t}", "public function default() {\n return \"No param given...\";\n }", "public function getDefault()\n {\n return $this->default;\n }", "public function getDefaultValue();", "public function getDefaultValue();", "public function getOrElse($default);", "function getDefault() {\n return $this->records[2];\n }", "public function getDefault()\n {\n return $this->getOption('default');\n }", "public function getValidationDefault(): mixed\n {\n return $this->getDataItem('validation.default');\n }", "public function defaultValue()\n {\n // TODO: More cases required.\n if ($this->isClass()) {\n return null;\n } else {\n switch ($this->name) {\n case 'int': return 0;\n case 'string': return '';\n default: throw new \\Exception('No default value available');\n }\n }\n }", "public function setUseDefaultOnError($flag)\n {\n return $this->setOption('use_default_on_error', $flag);\n }", "public function findDefault();" ]
[ "0.70128495", "0.68864816", "0.67106473", "0.6703547", "0.6631589", "0.6522719", "0.6482986", "0.64619404", "0.6456318", "0.6455671", "0.6421437", "0.63695353", "0.63393015", "0.6306268", "0.62422323", "0.62318265", "0.621139", "0.6200078", "0.6194783", "0.6173369", "0.61595833", "0.61356246", "0.61356246", "0.61194927", "0.60994446", "0.6091317", "0.60881025", "0.60434455", "0.6023208", "0.6012362" ]
0.7439112
0
Update existent crop entity properties.
public function updateCropProperties(Crop $crop, array $crop_properties) { // Parse all properties if this crop have changed. foreach ($crop_properties as $crop_coordinate => $value) { // Edit the crop properties if he have changed. $crop->set($crop_coordinate, $value, TRUE) ->save(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateCrop(array $properties, $field_value, CropType $crop_type) {\n // Get Original sizes and position of crop zone.\n $crop_properties = $this->getCropOriginalDimension($field_value, $properties);\n\n // Get all imagesStyle used this crop_type.\n $image_styles = $this->getImageStylesByCrop($crop_type->id());\n\n if (!empty($image_styles)) {\n $crops = $this->loadImageStyleByCrop($image_styles, $crop_type, $field_value['file-uri']);\n }\n\n // If any crop exist add new crop.\n if (empty($crops)) {\n $this->saveCrop($crop_properties, $field_value, $image_styles, $crop_type);\n return;\n }\n\n foreach ($crops as $crop_element) {\n // Get Only first crop entity @see https://www.drupal.org/node/2617818.\n /** @var \\Drupal\\crop\\Entity\\Crop $crop */\n $crop = $crop_element;\n\n if (!$this->cropHasChanged($crop_properties, array_merge($crop->position(), $crop->size()))) {\n return;\n }\n\n $this->updateCropProperties($crop, $crop_properties);\n $this->imageStylesOperations($image_styles, $field_value['file-uri']);\n drupal_set_message(t('The crop \"@cropType\" were successfully updated for image \"@filename\".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));\n }\n }", "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "abstract function crop($properties);", "public static function update()\n {\n if (self::checkIfSpecifiedTimePassed()) {\n DB::table('apimo_properties')->truncate();\n self::addOrEditPropertiesToDB(self::getAllRealEstate('properties'));\n }\n }", "public function applyCrop(array $properties, $field_value, CropType $crop_type) {\n // Get Original sizes and position of crop zone.\n $crop_properties = $this->getCropOriginalDimension($field_value, $properties);\n // Get all imagesStyle used this crop_type.\n $image_styles = $this->getImageStylesByCrop($crop_type->id());\n\n $this->saveCrop($crop_properties, $field_value, $image_styles, $crop_type, FALSE);\n }", "private function _setCrop()\n {\n if (isset($this->crop) && $this->crop && $this->bbox_rubberband && $this->_isResize()) {\n\n $bbox_rubberband = explode(',', $this->bbox_rubberband);\n\n //lower-left coordinate\n $ll_point = new \\stdClass();\n $ll_point->x = $bbox_rubberband[0];\n $ll_point->y = $bbox_rubberband[3];\n $ll_coord = $this->pix2Geo($ll_point);\n\n //upper-right coordinate\n $ur_point = new \\stdClass();\n $ur_point->x = $bbox_rubberband[2];\n $ur_point->y = $bbox_rubberband[1];\n $ur_coord = $this->pix2Geo($ur_point);\n\n //set the size as selected\n $width = abs($bbox_rubberband[2]-$bbox_rubberband[0]);\n $height = abs($bbox_rubberband[3]-$bbox_rubberband[1]);\n\n $this->map_obj->setSize($width, $height);\n if ($this->_isResize() && $this->_download_factor > 1) {\n $this->map_obj->setSize($this->_download_factor*$width, $this->_download_factor*$height);\n }\n\n //set the extent to match that of the crop\n $this->map_obj->setExtent($ll_coord->x, $ll_coord->y, $ur_coord->x, $ur_coord->y);\n }\n }", "protected function setCropBoxProperties() {\n foreach ($this->configuration as $element => $value) {\n if (array_key_exists($element, $this->cropBox) && !empty($value)) {\n $this->cropBox[$element] = (int) $value;\n }\n }\n\n return $this;\n }", "public function update() {\n\t\t// When loaded, fully sync the property array.\n\t\tif ($this->loadedSettings !== false) {\n\t\t\t$properties = array();\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$properties[] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->bean->ownProperty = $properties;\n\t\t\t// When loaded, only add and modify properties, but do not delete any\n\t\t} elseif (!empty($this->properties)) {\n\t\t\t$ownProperties = $this->bean->ownProperty;\n\t\t\tforeach ($this->properties as $k => $v) {\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($ownProperties as $property) {\n\t\t\t\t\tif ($property->name === $k) {\n\t\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t$this->bean->ownProperty[$property->id] = $property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found) {\n\t\t\t\t\t$property = R::dispense('property');\n\t\t\t\t\t$property->name = $k;\n\t\t\t\t\t$property->value = $v;\n\t\t\t\t\t$this->bean->ownProperty[] = $property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function update(Request $request, Person $person)\n {\n\n $validatedData = $this->validating($request);\n\n\n // Delete Photo if checkboxes are true\n\n if ($request->delete_cover OR $request->file('cover'))\n {\n $image_path = public_path(\"images/\".$request->delete_cover_filename); // Value is not URL but directory file path\n $thumbpath_path = public_path(\"thumbnails/\".$request->delete_cover_filename); // Value is not URL but directory file path\n if (File::exists($image_path)) {\n File::delete($image_path);\n $person->cover = null;\n }\n if (File::exists($thumbpath_path)) {\n File::delete($thumbpath_path);\n $person->cover = null;\n }\n }\n if ($request->delete_photo OR $request->file('photo'))\n {\n $image_path = public_path(\"images/\".$request->delete_photo_filename); // Value is not URL but directory file path\n $thumbpath_path = public_path(\"thumbnails/\".$request->delete_photo_filename); // Value is not URL but directory file path\n if (File::exists($image_path)) {\n File::delete($image_path);\n $person->photo = null;\n }\n if (File::exists($thumbpath_path)) {\n File::delete($thumbpath_path);\n $person->photo = null;\n }\n }\n\n\n $photo = $this->upload($request, 'photo');\n $cover = $this->upload($request, 'cover');\n\n // dd($request);\n\n // $person = new Person;\n $person->fullname = $request->fullname;\n $person->stage_name = $request->stage_name;\n $person->title = $request->title;\n $person->profile = $request->profile;\n $person->website = $request->website;\n $person->mobile = $request->mobile;\n $person->facebook = $request->facebook;\n $person->twitter = $request->twitter;\n $person->youtube = $request->youtube;\n $person->instagram = $request->instagram;\n if ($photo)\n $person->photo = $photo;\n if ($cover)\n $person->cover = $cover;\n\n $person->save();\n return back()->with('success', 'Record Updated successfully');\n }", "public function update(Request $request, $id)\n\n {\n\n\n\n $hasFile = $request->hasFile('cover') && $request->cover->isValid();\n\n $product = Product::find($id);\n\n $product->title = $request->title;\n\n $product->category = '';\n\n $product->category_id = $request->category_id;\n\n $product->description = $request->description;\n\n\n\n $category = Category::where('id', $request->category_id)->first();\n\n\n\n if($category->slug == 'Promociones'){\n\n $product->pricing = '0.0';\n\n $product->promotion_pricing = $request->pricing;\n\n }else{\n\n $product->pricing = $request->pricing;\n\n $product->promotion_pricing = '0.0';\n\n }\n\n\n\n\n\n if ($hasFile) {\n\n $extension = $request->cover->extension();\n Storage::delete(\"images/$product->id.$extension\");\n \n $product->extension = $extension;\n\n }\n\n\n\n ////////////////////////\n\n if ($product->save()) {\n\n\n if ($hasFile) {\n\n $request->cover->storeAs('images', \"$product->id.$extension\");\n\n }\n return redirect(\"/products\");\n \n\n } else {\n\n return view(\"products.edit\", [\"product\" => $product]);\n\n }\n\n }", "public function update(Request $request, Product $product)\n {\n try {\n\n $product->update([\n 'user_id' => Auth::id(),\n 'category_id' => $request->category_id,\n 'name' => $request->name,\n 'short_text' => $request->short_text,\n 'description' => $request->description,\n ]);\n\n if (isset($request->img)) {\n if ($product->img){\n File::delete($product->img);\n }\n $product->img = file_store($request->img, 'assets/uploads/photos/product_img/', 'photo_');\n $product->save();\n }\n\n if (!isset($request->old_property_id) and count($product->properties)){\n $product->properties()->delete();\n }\n\n if (isset($request->property_value)) {\n foreach ($request->property_value as $key => $property_value) {\n if (isset($request->old_property_id[$key])){\n $pp = ProductProperty::findOrFail($request->old_property_id[$key]);\n if ($property_value){\n $pp->update([\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }else{\n $pp->delete();\n }\n }else {\n if ($property_value) {\n $pp = ProductProperty::create([\n 'product_id' => $product->id,\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }\n }\n }\n }\n\n if (isset($request->photo)) {\n foreach ($request->photo as $key => $photo) {\n if (isset($request->photo[$key])) {\n if (isset($request->photo_id[$key])) {\n $ph = Photo::findOrFail($request->photo_id[$key]);\n if ($ph->path){\n File::delete($ph->path);\n }\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $ph->save();\n\n } else {\n if (isset($photo) and $photo) {\n $ph = new Photo();\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $product->photo()->save($ph);\n }\n }\n }\n }\n }\n\n return redirect()->route('product.index')->with('flash_message', 'با موفقیت انجام شد');\n }catch (\\Exception $e){\n return redirect()->back()->withInput()->with('err_message', 'خطایی رخ داده است، لطفا مجددا تلاش نمایید');\n }\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n\n //validazione\n $request->validate([\n \"title\" => \"required|max:255\",\n \"street\" => \"required\",\n \"metropolis\" => \"required\",\n \"country\" => \"required\",\n \"description\" => \"max:400\",\n \"rooms_number\" => \"required|integer\",\n \"beds_number\" => \"required|integer\",\n \"bathrooms_number\" => \"required|integer\",\n \"flat_image\" => \"image\",\n \"square_meters\" => \"required|integer\",\n \"latitude\" => \"required|between:-90,90\",\n \"longitude\" => \"required|between:-180,180\",\n \"active\" => \"boolean\"\n ]);\n\n //vado a prendere quella proprietà da modificare tramite id\n $property = Property::find($id);\n\n //modifico i dati\n $property->title = $data[\"title\"];\n $property->street = $data[\"street\"];\n $property->metropolis = $data[\"metropolis\"];\n $property->country = $data[\"country\"];\n $property->description = $data[\"description\"];\n $property->rooms_number = $data[\"rooms_number\"];\n $property->beds_number = $data[\"beds_number\"];\n $property->bathrooms_number = $data[\"bathrooms_number\"];\n if(isset($data[\"flat_image\"])){\n //cancelliamo path immagine precedente\n $path = Storage::disk(\"public\")->delete(\"images\", $property->flat_image);\n //storiamo la nuova immagine\n $path = Storage::disk(\"public\")->put(\"images\", $data[\"flat_image\"]);\n //assegniamo il valore\n $property->flat_image = $path;\n }\n $property->square_meters = $data[\"square_meters\"];\n $property->latitude = $data[\"latitude\"];\n $property->longitude = $data[\"longitude\"];\n if(isset($data[\"active\"])){\n $property->active = $data[\"active\"];\n } else {\n $property->active = 0;\n }\n // dd($request->flat_image);\n\n //faccio l'update dei Dati\n $property->update();\n\n if(isset($data[\"extras\"])){\n $property->extras()->sync($data[\"extras\"]);\n } else {\n $property->extras()->detach();\n }\n\n //redirect verso la pagina show della proprietà appena modificata\n return redirect()->route(\"admin.properties.show\", $property);\n }", "public function update(Request $request, $id) {\n\n\n $requestProfile;\n if (is_array($request[\"profile\"])) {\n $requestProfile = $request[\"profile\"];\n } else {\n $requestProfile = json_decode($request[\"profile\"], true);\n }\n\n\n $profile = Profile::where('profile_id', $id)->first();\n $pathCloudinary = \"\";\n\n\n if ($profile->profile_type == \"pet\") {\n\n\n $breed_id = $requestProfile[\"breed_id\"];\n if ($breed_id != null) {\n $profile->breed_id = $breed_id;\n }\n\n $pet_birthday = $requestProfile[\"pet_birthday\"];\n if ($pet_birthday != null) {\n $profile->pet_birthday = $pet_birthday;\n }\n $pet_gender = $requestProfile[\"pet_gender\"];\n if ($pet_gender != null) {\n $profile->pet_gender = $pet_gender;\n }\n\n $pet_type = $requestProfile[\"pet_type\"];\n if ($pet_type != null) {\n $profile->pet_type = $pet_type;\n }\n\n if (isset($requestProfile[\"pet_image_vaccine\"])) {\n\n $petImageVaccine = $requestProfile[\"pet_image_vaccine\"];\n $pathCloudinaryVaccine = \"profiles/pets/vaccine/pet\";\n $pathImage = ImageController::base64_to_jpeg($petImageVaccine, public_path('images/profile/vaccine' . $profile->profile_id . \".jpg\"));\n\n $imagePathCloudinary = ImageController::saveImageOnCloudinary($pathImage, $profile->profile_id, $pathCloudinaryVaccine);\n unlink($pathImage);\n $profile->pet_image_vaccine = $imagePathCloudinary;\n }\n\n\n\n if (isset($requestProfile[\"pet_image_pedigree\"])) {\n $petImagePedigree = $requestProfile[\"pet_image_pedigree\"];\n\n\n $pathCloudinaryPedigree = \"profiles/pets/pedigree/pet\";\n $pathImage = ImageController::base64_to_jpeg($petImagePedigree, public_path('images/profile/pedigree' . $profile->profile_id . \".jpg\"));\n\n $imagePathCloudinary = ImageController::saveImageOnCloudinary($pathImage, $profile->profile_id, $pathCloudinaryPedigree);\n unlink($pathImage);\n $profile->pet_image_pedigree = $imagePathCloudinary;\n }\n $pathCloudinary = \"profiles/pets/pet\";\n } else {\n\n if (isset($requestProfile[\"company_categoriesa\"])) {\n $profile->company_categories = json_encode($requestProfile[\"company_categoriesa\"]);\n }\n\n if (isset($requestProfile[\"company_address\"])) {\n $profile->company_address = $requestProfile[\"company_address\"];\n }\n\n if (isset($requestProfile[\"company_description\"])) {\n $profile->company_description = $requestProfile[\"company_description\"];\n }\n\n if (isset($requestProfile[\"company_email\"])) {\n $profile->company_email = $requestProfile[\"company_email\"];\n }\n\n if (isset($requestProfile[\"company_hour_office_start\"])) {\n $profile->company_hour_office_start = $requestProfile[\"company_hour_office_start\"];\n }\n if (isset($requestProfile[\"company_hour_office_end\"])) {\n $profile->company_hour_office_end = $requestProfile[\"company_hour_office_end\"];\n }\n\n $pathCloudinary = \"profiles/companies/company\";\n }\n\n if (isset($requestProfile[\"profile_image\"])) {\n $profileImage = $requestProfile[\"profile_image\"];\n $pathImage = ImageController::base64_to_jpeg($profileImage, public_path('images/profile/profile' . $profile->profile_id . \".jpg\"));\n $imagePathCloudinary = ImageController::saveImageOnCloudinary($pathImage, $profile->profile_id, $pathCloudinary);\n unlink($pathImage);\n $profile->profile_image = $imagePathCloudinary;\n }\n\n\n\n $profile_name = $requestProfile[\"profile_name\"];\n\n $profile->profile_name = $profile_name;\n\n $profile->save();\n $profileNew = Profile::where('profile_id', $id)->with(\"breed\")->first();\n\n return JsonObjects::responseJsonObject(\"profile\", 'profile_udpated', $profileNew, 'Profile sucessfully updated');\n }", "public function update(Request $request, $id)\n {\n// dd($request);\n $this->validate($request, [\n 'description' => 'required',\n 'price' => 'required',\n ]);\n $property = Property::findOrFail($id);\n $property->price = $request->price;\n $property->description = $request->description;\n if (isset($request->showPrice)) $property->showPrice = $request->showPrice; else $property->showPrice = 0;\n\n if ($request->bedroomsNumber != -1) {\n $property->bedroomsNumber = $request->bedroomsNumber;\n }\n if ($request->bathroomsNumber != -1) {\n $property->bathroomsNumber = $request->bathroomsNumber;\n }\n if ($request->parkingNumber != -1) {\n $property->parkingNumber = $request->parkingNumber;\n }\n $property->accepted = 0;\n $property->categoryId = $request->category;\n $property->typeId = $request->type;\n $property->contactInfo = null;\n\n $property->save();\n // Handle File Upload\n if (isset($request->images)) {\n if (count($request->images) > 0) {\n $this->deleteImages($id);\n foreach ($request->images as $image) {\n if ($image->getClientOriginalExtension() == 'mp4') {\n // Get filename with the extension\n $filenameWithExt = $image->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $image->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore = $filename . '_' . time() . '.' . $extension;\n // Upload Image\n $path = $image->storeAs('public/properties_images', $fileNameToStore);\n\n $image = new PropertyImage;\n $image->propertyId = $property->id;\n $image->url = $fileNameToStore;\n $image->save();\n } else {\n $Name = time() . '.' . $image->getClientOriginalExtension();\n\n $destinationPath = public_path('storage/properties_images/');\n\n $img = Image::make($image->getRealPath());\n $img->resize(650, 650, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath . '/' . time() . $image->getClientOriginalName());\n\n /*$user->profileImg = time().$image->getClientOriginalName();*/\n $fileNameToStore = time() . $image->getClientOriginalName();\n $image = new PropertyImage;\n $image->propertyId = $property->id;\n $image->url = $fileNameToStore;\n $image->save();\n\n\n $destinationPath = public_path('/storage/images');\n //$image->move($destinationPath, $Name);\n }\n }\n }\n }\n\n $history = new History;\n $history->propertyId = $property->id;\n $history->post_description = $property->description;\n $history->post_price = $property->price;\n $history->post_roomsNumber = $property->roomsNumber;\n $history->post_bathroomsNumber = $property->bathroomsNumber;\n $history->post_parkingNumber = $property->parkingNumber;\n $history->post_bedroomsNumber = $property->bedroomsNumber;\n $history->post_accepted = $property->accepted;\n $history->post_userId = $property->userId;\n $history->post_category = Category::findOrFail($property->categoryId)->title;\n $history->post_type = PropertyType::findOrFail($property->typeId)->title;\n $history->post_locationDescription = $property->locationDescription;\n $history->post_contactInfo = $property->contactInfo;\n $history->post_longitude = $property->longitude;\n $history->post_latitude = $property->latitude;\n $history->isCreated = 0;\n $history->isUpdated = 1;\n $history->isDeleted = 0;\n $history->save();\n Mail::to('[email protected]')->send(new PropertyUpdated());\n return redirect('/properties/' . $property->id)->with('message', 'Property Updated!');\n }", "public function edit()\n {\n if(isset($_POST['cropimg'])&& !empty($_POST['cropimg']))\n {\n // save the new Promo data table //\n $cropimg_data = $_POST['cropimg'];\n // smth like:- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array1 = explode(\";\", $cropimg_data);\n // smth like:- base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array2 = explode(\",\", $cropimg_remove_array1[1]);\n // smth like:- iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg = base64_decode($cropimg_remove_array2[1]);\n\n $imageName = 'promo_'.time() . '.png';\n\n $dir_to_save = \"./assets/jollof_banners/fashionhompage_banner/\";\n if (!is_dir($dir_to_save)) {\n mkdir($dir_to_save);\n }\n file_put_contents($dir_to_save.$imageName, $cropimg);\n \n \n $input_date=$_POST['promo_date'];\n $date_start=date(\"Y-m-d H:i:s\",strtotime($input_date));\n \n $promo_duration = $this->promo->promodurationinfo($_POST['promo_duration']);\n \n if($promo_duration->durationname == '1 Day'){$date_end= date('Y-m-d H:i:s',strtotime('+1 day',$input_date));}\n else if($promo_duration->durationname == '1 Week') {$date_end= date('Y-m-d H:i:s',strtotime('+1 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+1 month',strtotime($input_date)));}\n else if($promo_duration->durationname == '3 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+3 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '6 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+6 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Year') {$date_end= date('Y-m-d H:i:s',strtotime('+1 year',strtotime($input_date)));}\n \n $data_New = array( \n 'imageurl' => $_POST['promo_url'],\n 'imagename' => $imageName,\n 'bannertypeid' => $_POST[\"promotype\"],\n 'promodurationid'=> $_POST[\"promo_duration\"],\n 'usertype' => $this->session->Type,\n 'merchantid' => $this->session->merchant_id,\n 'userid' => $this->session->User_id,\n 'username' => $this->session->companyname,\n 'payment' => 'FREE',\n 'startdate' => $date_start,\n 'enddate' => $date_end,\n 'status' => 0\n );\n }\n else\n {\n \n $input_date=$_POST['promo_date'];\n $date_start=date(\"Y-m-d H:i:s\",strtotime($input_date));\n \n $promo_duration = $this->promo->promodurationinfo($_POST['promo_duration']);\n \n if($promo_duration->durationname == '1 Day'){$date_end= date('Y-m-d H:i:s',strtotime('+1 day',$input_date));}\n else if($promo_duration->durationname == '1 Week') {$date_end= date('Y-m-d H:i:s',strtotime('+1 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+1 month',strtotime($input_date)));}\n else if($promo_duration->durationname == '3 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+3 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '6 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+6 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Year') {$date_end= date('Y-m-d H:i:s',strtotime('+1 year',strtotime($input_date)));}\n \n \n $data_New = array( \n 'imageurl' => $_POST['promo_url'],\n 'bannertypeid' => $_POST[\"promotype\"],\n 'promodurationid'=> $_POST[\"promo_duration\"],\n 'payment' => 'FREE',\n 'startdate' => $date_start,\n 'enddate' => $date_end,\n 'status' => 0\n );\n\n $data_Where = array( \n 'id' => $this->input->post('promoid')\n );\n\n // update to db\n $insert_data = $this->Generic->editByConditions($data_New, $data_Where , $tablename=\"img_ads\"); \n \n }\n if($insert_data)\n {\n $this->session->set_flashdata('success','Promo Info Updated');\n $this->session->set_flashdata('message', 'Promo Info Updated');\n $Json_resultSave = array ('status' => '1');\n echo json_encode($Json_resultSave);\n exit();\n\n }\n else {\n $this->session->set_flashdata('error','error');\n $this->session->set_flashdata('message', 'An error occur when Updated Promo Info');\n $Json_resultSave = array ('status' => '0');\n echo json_encode($Json_resultSave);\n exit();\n }\n }", "public function update(PropertyRequest $request, $id)\n {\n\n $property=Property::find($id);\n $property->cost=$request->cost;\n $property->type_id=$request->type;\n $property->reference=$request->reference;\n $property->room=$request->room;\n $property->bathroom=$request->bathroom;\n $property->map=$request->map;\n $property->user_id=Auth::user()->id;\n $property->region_id=$request->region;\n $property->area=$request->area;\n $property->type=$request->display;\n $property->save();\n PropertyDescription::where('property_id',$id)->delete();\n PropertyDescription::create([\n 'name'=>$request->descEn,\n 'lang'=>'en',\n 'property_id'=>$id\n ]);\n PropertyDescription::create([\n 'name'=>$request->descAr,\n 'lang'=>'ar',\n 'property_id'=>$id\n ]);\n PropertyHeader::where('property_id',$id)->delete();\n PropertyHeader::create([\n 'name'=>$request->headerEn,\n 'lang'=>'en',\n 'property_id'=>$id\n ]);\n PropertyHeader::create([\n 'name'=>$request->headerAr,\n 'lang'=>'ar',\n 'property_id'=>$id\n ]);\n PropertyLabel::where('property_id',$id)->delete();\n PropertyLabel::create([\n 'name'=>$request->labelEn,\n 'lang'=>'en',\n 'property_id'=>$id\n ]);\n PropertyLabel::create([\n 'name'=>$request->labelAr,\n 'lang'=>'ar',\n 'property_id'=>$id\n ]);\n $packages=Input::get('feature');\n $property->feature()->sync($packages);\n $destinationPath=\"uploads/\";\n if($files=$request->file('Images'))\n {\n \tforeach($files as $file)\n {\n \t $name=$file->getClientOriginalName();\n \t $file->move($destinationPath,$file->getClientOriginalName());\n \t $img=new PropertyImage;\n \t $img->property_id=$id;\n \t $img->path=$destinationPath.$file->getClientOriginalName();\n \t $img->save();\n \t}\n }\n return redirect()->route('property.index');\n }", "public function store()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n if($this->crop())\n {\n try {\n $this->_propertyImage->pid = $this->_pid;\n $this->_propertyImage->image_full_path = $this->_imageOut;\n $this->_propertyImage->save();\n }catch(Exception $e) {\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'success',\n 'url' => $this->_imageOut\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }", "public function update(Request $request)\n {\n\n\n $validator = Validator::make($request->all(), [\n 'file-multiple-input' => 'required',\n 'file-multiple-input.*' => 'mimes:jpg,png,jpeg'\n\n ]);\n if ($validator->passes()) {\n\n\n $photos = $request->file('file-multiple-input');\n if (!is_array($photos)) {\n $photos = [$photos];\n }\n\n if (!is_dir($this->photos_path)) {\n mkdir($this->photos_path, 0777);\n }\n $deleteImages = Image::where('property_id', $request->input('property_id'))\n ->delete();\n\n for ($i = 0; $i < count($photos); $i++) {\n $photo = $photos[$i];\n $name = sha1(date('YmdHis') . Str::random(30));\n $save_name = $name . '.' . $photo->getClientOriginalExtension();\n $resize_name = $name . Str::random(2) . '.' . $photo->getClientOriginalExtension();\n\n InterventionImage::make($photo)\n ->encode('jpg', 75)\n ->resize(1000, 750)\n ->crop(1000, 750)\n ->save($this->photos_path . '/' . $resize_name);\n\n $photo->move($this->photos_path, $save_name);\n $upload = new Image();\n $upload->file = $save_name;\n $upload->resizedfilename = $resize_name;\n $upload->originalfilename = basename($photo->getClientOriginalName());\n $upload->property_id = $request->input('property_id');\n $upload->save();\n }\n }\n\n return redirect()->route('property_details', ['id' => $request->input('property_id')]);\n }", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "public function saveCrop(array $crop_properties, $field_value, array $image_styles, CropType $crop_type, $notify = TRUE) {\n /** @var \\Drupal\\image\\Entity\\ImageStyle $image_style */\n foreach ($image_styles as $image_style) {\n $values = [\n 'type' => $crop_type->id(),\n 'entity_id' => $field_value['file-id'],\n 'entity_type' => 'file',\n 'uri' => $field_value['file-uri'],\n 'x' => $crop_properties['x'],\n 'y' => $crop_properties['y'],\n 'width' => $crop_properties['width'],\n 'height' => $crop_properties['height'],\n 'image_style' => $image_style->getName(),\n ];\n\n // Save crop with previous values.\n /** @var \\Drupal\\crop\\CropInterface $crop */\n $crop = $this->cropStorage->create($values);\n $crop->save();\n }\n $this->imageStylesOperations($image_styles, $field_value['file-uri'], TRUE);\n\n if ($notify) {\n drupal_set_message(t('The crop \"@cropType\" was successfully added for image \"@filename\".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));\n }\n }", "public function testUpdateValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//edit the property and update it in MySQL\n\t\t$property->setPropertyValue($this->VALID_PROPERTYVALUE2);\n\t\t$property->update($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE2);\n\t}", "public function update(Request $request, Rental $rental)\n {\n if (!$request->hasFile('propertyCoverPhoto') && !$request->hasFile('propertyPhoto')) {\n $validated = $request->validate([\n \t\t 'name' => ['required', 'min:3','string'],\n \t\t 'description'=>['required','min:10','max:255'],\n 'bedrooms'=>['required','integer','min:1'],\n 'bathrooms'=>['required','integer','min:1'],\n 'parking_slots'=>['required','integer','min:0'],\n 'rent'=>['required','integer','min:0'],\n 'units_available'=>['required','integer','min:0'],\n 'location' =>['required' ,'string','min:0'],\n ]);\n $rental->update($validated);\n }\n if ($request->hasFile('propertyCoverPhoto')) {\n $request->validate([\n 'propertyCoverPhoto' =>['required','image','mimes:jpeg,jpg,png','max:6000'],\n ]);\n Storage::delete($rental->coverImage);\n $coverImagePath = $request->file('propertyCoverPhoto')->store('public/RentalCoverPhotos');\n $rental->update(['coverImage' => $coverImagePath]);\n }\n if ($request->hasFile('propertyPhoto')) {\n $request->validate([\n 'propertyPhoto' =>['required','image','mimes:jpeg,jpg,png','max:6000'],\n ]);\n $path = $request->file('propertyPhoto')->store('public/rentalPhotos');\n $newImage = new Image(['url' => $path]);\n $newImage = $rental->images()->save($newImage);\n $image = $newImage;\n return view('properties.owner.partials.image',compact('image'))->render();\n }\n $rental->load('images');\n\n return view('properties.owner.partials.rentals',compact('rental'))->render();\n }", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function cropHasChanged(array $crop_properties, array $old_crop) {\n if (!empty(array_diff_assoc($crop_properties, $old_crop))) {\n return TRUE;\n }\n return FALSE;\n }", "public function update(Request $request,$user_id, $apropos_id)\n {\n //\n \n $a=Apropos::find($apropos_id); \n $a->update($request->all()); \n\n\n $image = $request->source_profil;\n $name = $request->photo_profil.\"-\".time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n \\Image::make($request->source_profil)->save(public_path('photos_profils/').$name);\n\n\n $a->photo_profil='http://127.0.0.1:8887/photos_profils/'.$name;\n $a->save();\n\n return response()->json($image,200);\n }", "public function update_picture(Request $request)\n {\n $cropData = $request->input('cropData');\n $image = Image::make($request->input('file'));\n $image->crop(round($cropData['width']), round($cropData['height']), round($cropData['x']), round($cropData['y']))\n ->resize(250, 250, function ($constraint) {\n $constraint->aspectRatio();\n });\n\n // save uploaded image\n do {\n $filename = str_random(12);\n } while (file_exists(public_path('/uploads/user-pictures/') . $filename . '.png'));\n if (!file_exists(public_path('/uploads/user-pictures')))\n mkdir(public_path('/uploads/user-pictures'), 0755, true);\n $image->save(public_path('/uploads/user-pictures/') . $filename . '.png', 80);\n\n // delete old profile picture\n if (Auth::user()->picture && file_exists(public_path('/uploads/user-pictures/') . Auth::user()->picture))\n unlink(public_path('/uploads/user-pictures/') . Auth::user()->picture);\n\n // update profile picture\n Auth::user()->picture = $filename . '.png';\n Auth::user()->save();\n\n // set response and flash messages\n $request->session()->flash('alerts', [\n (object) [\n 'type' => 'success',\n 'title' => trans('chronos.scaffolding::alerts.Success.'),\n 'message' => trans('chronos.scaffolding::alerts.Profile picture successfully updated.'),\n ]\n ]);\n\n echo json_encode([\n 'redirect' => route('chronos.auth.profile')\n ]);\n }", "abstract protected function updateSpecificProperties($row);", "function add_updatecrop() {\n $post_data = json_decode(file_get_contents('php://input'), true); \n if($post_data['update_type'] == 1) { \n $variety_id = $post_data['nutrient_variety'];\n\t\t\t\t$name = $post_data['nutrient_name'];\n $process_date = ($post_data['nutrient_dosage_date'] != \"\")? explode(\"/\",$post_data['nutrient_dosage_date'])[2].'-'.explode(\"/\",$post_data['nutrient_dosage_date'])[1].'-'.explode(\"/\",$post_data['nutrient_dosage_date'])[0] : \"0000-00-00\";\n $dosage = ($post_data['nutrient_dosage'])?$post_data['nutrient_dosage']:\"\";\n $qty = $post_data['nutrient_quantity'];\n\t\t\t\t$qty_uom = $post_data['nutrient_quantity_uom'];\n\t\t\t\t$brand_name = $post_data['nutrient_brand_name'];\n //$brand_name = implode(',', $post_data['nutrient_brand_name']);\n $process_cost = ($post_data['cost_of_nutrient'])?$post_data['cost_of_nutrient']:\"\";\n \n $feed_type=\"\";$weed_type=\"\";$man_days=\"\";$machine_hours=\"\";\n \n } else if($post_data['update_type'] == 2) { \n $name \t\t = $post_data['fertilizer_name'];\n $variety_id \t\t = $post_data['fertilizer_variety'];\n $process_date = ($post_data['fertilizer_dosage_date'] != \"\")? explode(\"/\",$post_data['fertilizer_dosage_date'])[2].'-'.explode(\"/\",$post_data['fertilizer_dosage_date'])[1].'-'.explode(\"/\",$post_data['fertilizer_dosage_date'])[0] : \"0000-00-00\";\n $dosage \t\t = ($post_data['fertilizer_dosage'])?$post_data['fertilizer_dosage']:\"\";\n $feed_type \t\t = $post_data['fertilizer_feed_type'];\n $qty \t\t = $post_data['fertilizer_quantity'];\n\t\t\t\t$qty_uom \t\t = $post_data['fertilizer_quantity_uom'];\n\t\t\t\t$brand_name = $post_data['fertilizer_brand_name'];\n $process_cost = ($post_data['cost_of_fertilizer'])?$post_data['cost_of_fertilizer']:\"\";\n \n $weed_type=\"\";$man_days=\"\";$machine_hours=\"\";\n } else if($post_data['update_type'] == 3) {\n $name \t\t = $post_data['pesticide_name'];\n $variety_id \t\t = $post_data['pesticide_variety'];\n $process_date = ($post_data['pesticide_dosage_date'] != \"\")? explode(\"/\",$post_data['pesticide_dosage_date'])[2].'-'.explode(\"/\",$post_data['pesticide_dosage_date'])[1].'-'.explode(\"/\",$post_data['pesticide_dosage_date'])[0] : \"0000-00-00\";\n $dosage \t\t = ($post_data['pesticide_dosage'])?$post_data['pesticide_dosage']:\"\";\n $feed_type \t\t = $post_data['pesticide_feed_type'];\n $qty \t = $post_data['pesticide_quantity'];\n\t\t\t\t$qty_uom = $post_data['pesticide_quantity_uom'];\n\t\t\t\t$brand_name = $post_data['pesticide_brand_name'];\n //$brand_name = implode(',', $post_data['pesticide_brand_name']);\n $process_cost = ($post_data['cost_of_pesticide'])?$post_data['cost_of_pesticide']:\"\";\n \n $weed_type=\"\";$man_days=\"\";$machine_hours=\"\";\n } else {\n if($post_data['type_weeding'] == 3) {\n\n $brand_nameData = $post_data['weeding_brand_name'];\n } else {\n $brand_nameData = \"\";\n }\n //$crop_id = $post_data['weeding_crop'];\n $variety_id = $post_data['weeding_variety'];\n $process_date = ($post_data['weeding_dosage_date'] != \"\")? explode(\"/\",$post_data['weeding_dosage_date'])[2].'-'.explode(\"/\",$post_data['weeding_dosage_date'])[1].'-'.explode(\"/\",$post_data['weeding_dosage_date'])[0] : \"0000-00-00\";\n $dosage = ($post_data['weeding_dosage'])?$post_data['weeding_dosage']:\"\";\n $qty = $post_data['weeding_quantity'];\n\t\t\t\t$qty_uom = $post_data['weeding_quantity_uom'];\n $brand_name = $post_data['weeding_brand_name'];\n $name=\"\";\n $weed_type = $post_data['type_weeding'];\n $man_days = $post_data['weeding_no_of_man'];\n $machine_hours = $post_data['weeding_machine_hrs'];\n $process_cost = ($post_data['cost_of_weeding'])?$post_data['cost_of_weeding']:\"\";\n $feed_type=\"\";\n }\n \n $crop_details = array(\n\t\t\t 'farmer_id' => $post_data['farmer_id'],\t\n\t 'update_type' => $post_data['update_type'],\n 'name' => $name,\n\t\t\t 'crop_id' => $post_data['crop_id'],\n 'variety_id' => $variety_id,\n 'process_date' => $process_date,\n 'brand_name' => $brand_name,\n 'dosage' => $dosage,\n 'feed_type' => $feed_type,\n 'qty' => $qty,\n\t\t\t 'qty_uom' => $qty_uom,\n 'weed_type' => $weed_type,\n 'man_days' => $man_days,\n 'machine_hours' => $machine_hours,\n 'process_cost' => $process_cost,\n 'status' => 1,\n 'updated_on' => date('Y-m-d H:i:s'),\n 'updated_by' => \"\"\n );\n $this->db->insert('trv_update_crop', $crop_details);\n \n $getrow=$this->db->select('trv_update_expense.*')->where(array('trv_update_expense.farmer_id' =>$post_data['farmer_id'] ,'trv_update_expense.crop_id'=> $variety_id))->from('trv_update_expense')->get()->row_array();\n \n if(!empty($getrow)){\n $cost_details = array(\t\n 'crop_id' => $variety_id, \n 'farmer_id' => $post_data['farmer_id'],\n 'nutrient_cost' => !empty($post_data['cost_of_nutrient']) ? $post_data['cost_of_nutrient'] : 0,\n 'fertilizer_cost' => !empty($post_data['cost_of_fertilizer']) ? $post_data['cost_of_fertilizer'] : 0,\n 'pesticide_cost' => !empty($post_data['cost_of_pesticide']) ? $post_data['cost_of_pesticide'] : 0,\n 'weeding_cost' => !empty($post_data['cost_of_weeding']) ? $post_data['cost_of_weeding'] : 0,\n );\n return $this->db->update('trv_update_expense', $cost_details,array('id' => $getrow['id']));\n }\n else {\n $cost_details = array(\t\n 'crop_id' => $variety_id, \n 'farmer_id' => $post_data['farmer_id'],\n 'nutrient_cost' => !empty($post_data['cost_of_nutrient']) ? $post_data['cost_of_nutrient'] : 0,\n\t\t\t\t'fertilizer_cost' => !empty($post_data['cost_of_fertilizer']) ? $post_data['cost_of_fertilizer'] : 0,\n\t\t\t\t'pesticide_cost' => !empty($post_data['cost_of_pesticide']) ? $post_data['cost_of_pesticide'] : 0,\n\t\t\t\t'weeding_cost' => !empty($post_data['cost_of_weeding']) ? $post_data['cost_of_weeding'] : 0,\n \n );\n return $this->db->insert('trv_update_expense', $cost_details);\n }\n }", "public function update(UpdateRequest $request)\n {\n $errors = [];\n // your additional operations before save here\n $size = $this->getBase64ImageSize($request->input('cover'));\n try {\n if ($size > 5200) {\n array_push($errors, '.حجم تصویر انتخاب شده بیشتر از 5 مگابایت است');\n }\n } catch (Exception $e) {\n abort(500);\n }\n\n if (sizeof($errors) > 0)\n return back()->withErrors(['custom_fail' => true, 'errors' => $errors]);\n\n $redirect_location = parent::updateCrud($request);\n // your additional operations after save here\n // use $this->data['entry'] or $this->crud->entry\n return $redirect_location;\n }", "public function crop()\n {\n }" ]
[ "0.60672784", "0.596229", "0.59594154", "0.58817345", "0.5595783", "0.55094934", "0.54406816", "0.5282936", "0.5233423", "0.5225922", "0.5203808", "0.5190483", "0.5169995", "0.5169646", "0.5165727", "0.5114183", "0.5099895", "0.5096839", "0.50961614", "0.5084675", "0.50777376", "0.50473315", "0.50399715", "0.49822152", "0.49775505", "0.49745226", "0.49580613", "0.4953453", "0.49521166", "0.49447024" ]
0.6072915
0
Load all crop using the ImageStyles.
public function loadImageStyleByCrop(array $image_styles, CropType $crop_type, $file_uri) { $crops = []; /** @var \Drupal\image\Entity\ImageStyle $image_style */ foreach ($image_styles as $image_style) { // Get Only first crop entity @see https://www.drupal.org/node/2617818. /** @var \Drupal\crop\Entity\Crop $crop */ $crop = current($this->cropStorage->loadByProperties(['type' => $crop_type->id(), 'uri' => $file_uri])); if (!empty($crop)) { $crops[$image_style->id()] = $crop; } } return $crops; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function crop($properties);", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public function getImageStylesByCrop($crop_type_name) {\n $styles = [];\n $image_styles = $this->imageStyleStorage->loadMultiple();\n\n /** @var \\Drupal\\image\\Entity\\ImageStyle $image_style */\n foreach ($image_styles as $image_style) {\n $image_style_data = $this->getEffectData($image_style, 'crop_type');\n if (!empty($image_style_data) && ($image_style_data == $crop_type_name)) {\n $styles[] = $image_style;\n }\n }\n\n return $styles;\n }", "public function crop()\n {\n }", "function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}", "private function _setCrop()\n {\n if (isset($this->crop) && $this->crop && $this->bbox_rubberband && $this->_isResize()) {\n\n $bbox_rubberband = explode(',', $this->bbox_rubberband);\n\n //lower-left coordinate\n $ll_point = new \\stdClass();\n $ll_point->x = $bbox_rubberband[0];\n $ll_point->y = $bbox_rubberband[3];\n $ll_coord = $this->pix2Geo($ll_point);\n\n //upper-right coordinate\n $ur_point = new \\stdClass();\n $ur_point->x = $bbox_rubberband[2];\n $ur_point->y = $bbox_rubberband[1];\n $ur_coord = $this->pix2Geo($ur_point);\n\n //set the size as selected\n $width = abs($bbox_rubberband[2]-$bbox_rubberband[0]);\n $height = abs($bbox_rubberband[3]-$bbox_rubberband[1]);\n\n $this->map_obj->setSize($width, $height);\n if ($this->_isResize() && $this->_download_factor > 1) {\n $this->map_obj->setSize($this->_download_factor*$width, $this->_download_factor*$height);\n }\n\n //set the extent to match that of the crop\n $this->map_obj->setExtent($ll_coord->x, $ll_coord->y, $ur_coord->x, $ur_coord->y);\n }\n }", "function _crop(){\n echo_array($_POST);\n\n if (!empty($_POST['x'])) { $x=$_POST['x'];}else{$x=100;}\n if (!empty($_POST['y'])) { $y=$_POST['y'];}else{$y=100;}\n if (!empty($_POST['w'])) { $w=$_POST['w'];}else{$w=100;}\n if (!empty($_POST['h'])) { $h=$_POST['h'];}else{$h=100;}\n $data['raw_name']=$_POST['raw_name'];\n $data['file_ext']=$_POST['file_ext'];\n $targ_w =$w; $targ_h = $h;\n $jpeg_quality = 90;\n $src = './uploads/'.trim($_POST['image']);\n $img_r = imagecreatefromjpeg($src);\n $dst_r = ImageCreateTrueColor( $targ_w, $targ_h );\n imagecopyresampled($dst_r,$img_r,0,0,$x,$y,\n $targ_w,$targ_h,$w,$h);\n $dst=imagefilter($dst_r, IMG_FILTER_GRAYSCALE);\n imagefilter($dst_r,IMG_FILTER_COLORIZE,80,60,40); //sepia\n imagejpeg($dst_r, './uploads/'.'crop_'.trim($_POST['image']), 80);\n //echo_array($data);\n $this->load->library('tcontrol');\n $this->load->library('tpanel');\n $class=\"tpanel\";\n $s=$this->tpanel->get('date',$data);\n $s.=$this->tpanel->get('navigation_menu',$data);\n $s.=$this->tpanel->get('ajax_menu',$data);\n $s.=$this->tpanel->get('spacer',$data);\n\n $s.=$this->load->view('image_lab_view',$data,TRUE);\n $data['title']='The Tlist Class';\n $data['content']=$s;\n $data['panel']='';\n\n $this->template($data) ;\n //$this->load->view('image_crop_view', $data);\n\n ;}", "public static function process($element, FormStateInterface $form_state, $form) {\n if ($element['#files']) {\n foreach ($element['#files'] as $file) {\n $element['image_crop'] = [\n '#type' => 'image_crop',\n '#file' => $file,\n '#crop_type_list' => $element['#crop_list'],\n '#crop_preview_image_style' => $element['#crop_preview_image_style'],\n '#show_default_crop' => $element['#show_default_crop'],\n '#warn_multiple_usages' => TRUE,\n ];\n }\n }\n\n return parent::process($element, $form_state, $form);\n }", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "public static function loadFilterImages() {\n $dir = scandir('../img/effects');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/effects/\" . $file)) {\n $currFileExt = pathinfo(\"../img/effects/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n echo json_encode($slice);\n }", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "public function crop(array $dimensions, array $coordinates) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// do the dimensions have and coordinates have the appropriate values to work with (checking the keys)? \n if (array_keys($dimensions) == array(\"width\", \"height\") && array_keys($coordinates) == array(\"x1\", \"x2\", \"y1\", \"y2\")) {\n $is_all_int = true;\n foreach (array_merge($dimensions, $coordinates) as $value) {\n if (is_int($value) == false) {\n $is_all_int = false;\n }\n }\n if ($is_all_int == true) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n $x1 = $coordinates[\"x1\"];\n $x2 = $coordinates[\"x2\"];\n $y1 = $coordinates[\"y1\"];\n $y2 = $coordinates[\"y2\"];\n\n// generating the placeholder resource\n $cropped_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and cropping it accordingly\n imagecopyresampled($cropped_image, $this->_resource, 0, 0, $x1, $y1, $width, $height, ($x2 - $x1), ($y2 - $y1));\n\n// assigning the new image attributes\n $this->_resource = $cropped_image;\n $this->_width = $width;\n $this->_height = $height;\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was provided values that were not integers (check the dimensions or coordinates for strings or floats)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was not provided the appropriate arguments (first given parameter must be an array and must contain \\\"width\\\" and \\\"height\\\" elements, and the second given parameter must be an array and contain \\\"x1\\\", \\\"x2\\\", \\\"y2\\\", and \\\"y2\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function providerBuildImage()\n {\n\n return [\n [\n ['action' => 'scale_and_crop', 'width' => 40, 'height' => '25%'],\n ['action' => 'scale_and_crop', 'width' => 40, 'height' => 125],\n ],\n [\n ['action' => 'scale', 'width' => 40],\n ['action' => 'scale', 'width' => 40],\n ],\n [\n ['action' => 'scale', 'width' => '50%'],\n ['action' => 'scale', 'width' => 250],\n ],\n [\n ['action' => 'crop', 'height' => '50%', 'yoffset' => 20],\n ['action' => 'crop', 'height' => 250, 'yoffset' => 20],\n ],\n [\n ['action' => 'crop', 'height' => 20, 'yoffset' => 'bottom'],\n ['action' => 'crop', 'height' => 20, 'yoffset' => 480],\n ],\n [\n ['action' => 'crop', 'width' => '50%', 'xoffset' => 'center'],\n ['action' => 'crop', 'width' => '250', 'xoffset' => 125],\n ],\n [\n ['action' => 'crop', 'width' => '20', 'xoffset' => 'left'],\n ['action' => 'crop', 'width' => '20', 'xoffset' => 0],\n ],\n ];\n }", "function wp_ajax_crop_image()\n {\n }", "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "public static function loadBackgroundImages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n\n $counter = 0;\n $middleClass = \"\";\n foreach ($slice as $bg) {\n $counter++;\n if ($counter == 1) {\n ?><div class=\"cs-product-row\"><?php\n }\n if ($counter == 2) {\n $middleClass = \"cs-prd-middle\";\n }\n else {\n $middleClass = \"\";\n }\n ?>\n <?php $bg_index = self::parseInt($bg); ?>\n <div class=\"cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>\"\n index_za_pozadina_e=\"<?php echo $bg_index; ?>\"> \n\n <img src=\"img/bgs/<?php echo $bg ?>\" width=\"97\" height=\"126\" data-bgname=\"<?php echo $bg ?>\" class=\"cs-main-bg\" />\n </div>\n <?php\n if ($counter == 3) {\n ?></div><?php\n $counter = 0;\n }\n }\n }", "public function Images()\n {\n $pngLeftTop = $this->objFromFixture('Image', 'pngLeftTop');\n $pngLeftTop->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightTop = $this->objFromFixture('Image', 'pngRightTop');\n $pngRightTop->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightTop->VerticalSliceBottomRightColor = '0000ff';\n $pngRightTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngRightTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightBottom = $this->objFromFixture('Image', 'pngRightBottom');\n $pngRightBottom->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightBottom->VerticalSliceBottomRightColor = '0000ff';\n $pngRightBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngRightBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n $pngLeftBottom = $this->objFromFixture('Image', 'pngLeftBottom');\n $pngLeftBottom->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftBottom->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngLeftBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n return array($pngLeftTop, $pngRightTop, $pngRightBottom, $pngLeftBottom);\n }", "public function getCrops(){\n return $this->crops->crops(); \n }", "function image_crop(){\n\n\t\t\t$imgUrl = $_POST['imgUrl'];\n\t\t\t/*explored image URL and get image name*/\n\t\t\t$expImgUrl=explode(\"/\", $imgUrl);\n\t\t\t$LengthOfArray = sizeof($expImgUrl);\n\t\t\t$imageName = $LengthOfArray-1;\n\t\t\t$imgName = $expImgUrl[$imageName];\n\t\t\t$imgInitW = $_POST['imgInitW'];\n\t\t\t$imgInitH = $_POST['imgInitH'];\n\t\t\t$imgW = $_POST['imgW'];\n\t\t\t$imgH = $_POST['imgH'];\n\t\t\t$imgY1 = $_POST['imgY1'];\n\t\t\t$imgX1 = $_POST['imgX1'];\n\t\t\t$cropW = $_POST['cropW'];\n\t\t\t$cropH = $_POST['cropH'];\n\n\t\t\t$jpeg_quality = 100;\n\t\t\t$rand = rand();\n\t\t\t$output_filename = \"../webroot/img/uploads/croppedImg_\".$rand;\n\t\t\t$oname = \"img/uploads/croppedImg_\".$rand;\n\t\t\t$Pname = \"img/uploads/\";\n\t\t\t$path = BASE_PATH;\n\n\t\t\t$what = getimagesize($Pname.\"/\".$imgName);\n\t\t\t\n\t\t\tswitch(strtolower($what['mime']))\n\t\t\t{\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$img_r = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.png';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t$img_r = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$img_r = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: die('image type not supported');\n\t\t\t}\n\t\t\t\t\n\t\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, \n\t\t\t\t\t\t$imgH, $imgInitW, $imgInitH);\t\n\t\t\t\n\t\t\t\n\t\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\t\timagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, \n\t\t\t\t\t\t$cropH, $cropW, $cropH);\t\n\n\n\t\t\timagejpeg($dest_image, $output_filename.$type, $jpeg_quality);\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t\t\"status\" => 'success',\n\t\t\t\t\t\"url\" => $oname.$type, \n\t\t\t\t\t\"base\" => $path \n\t\t\t\t );\n\t\t\t print json_encode($response);\n\t\t\t exit;\n\t}", "public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}", "function admin_cropImage()\r\n {\r\n // setting the layout for admin\r\n $this->layout = 'admin';\r\n \r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Image Crop\");\r\n \r\n }", "public static function crop(){\n\n}", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "public function user_crop()\r\n\t{\r\n\t\t// Get uploaded photo\r\n\t\t$uploaded_photo = $this->input->post('uploaded_photo');\r\n\r\n\t\t// Get image width, height\r\n\t\tlist($width, $height) = @getimagesize('./assets/uploads/' . $uploaded_photo);\r\n\r\n\t\t// Calculate ratio\r\n\t\t$ratio = $width / 536;\r\n\r\n\t\t// Get chosen crop coordinates\r\n\t\t$coords_x1 = round($ratio * $this->input->post('coords-x1'));\r\n\t\t$coords_y1 = round($ratio * $this->input->post('coords-y1'));\r\n\t\t$coords_x2 = round($ratio * $this->input->post('coords-x2'));\r\n\t\t$coords_y2 = round($ratio * $this->input->post('coords-y2'));\r\n\t\t$coords_w = round($ratio * $this->input->post('coords-w'));\r\n\t\t$coords_h = round($ratio * $this->input->post('coords-h'));\r\n\r\n\t\t// Profile thumbnail crop config\r\n\t\t$config['source_image'] = './assets/uploads/' . $uploaded_photo;\r\n\t\t$config['new_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = $coords_w;\r\n\t\t$config['height'] = $coords_h;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\t\t$config['x_axis'] = $coords_x1;\r\n\t\t$config['y_axis'] = $coords_y1;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Crop the image\r\n\t\tif (!$this->image_lib->crop())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\r\n\t\t// Clear the config to start next thumbnail\r\n\t\t$config = array();\r\n\t\t$this->image_lib->clear();\r\n\r\n\t\t// Profile thumbnail resize config\r\n\t\t$config['source_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = 385;\r\n\t\t$config['height'] = 465;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Resize the image\r\n\t\tif (!$this->image_lib->resize())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\t}", "public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "function imagecropper($source_path, $max_width, $max_height, $bili) {\n $source_info = getimagesize($source_path); //获取原始图片信息\n $source_width = $source_info[0]; //获取原始图片的宽度\n $source_height = $source_info[1]; //获取原始图片的高度\n $source_mime = $source_info['mime']; //获取原始图片的文件类型\n\n //先计算出要裁剪后的图片尺寸是多大\n if($source_width<=$max_width) { //1、如果原始图片的宽,小于最大允许的宽\n $newwidth = $source_width;\n $newheight = $source_width*$bili;\n }elseif($source_height<=$max_height) {//2、如果原始图片的高,小于最大允许的高\n $newheight = $source_height;\n $newwidth = $newheight/$bili;\n }else {\n $b1 = $max_width/$source_width;\n $b2 = $max_height/$source_height;\n $b3 = $b1<$b2 ? $b1 : $b2;\n $newwidth = ceil($source_width*$b3);\n $newheight = ceil($source_height*$b3);\n }\n\n $target_width = $newwidth>$newheight ? $newwidth : $newheight;\n $target_height = $newwidth<$newheight ? $newwidth : $newheight;\n\n if($target_width*$bili>$target_height) {\n $target_width = $target_height/$bili;\n }\n if($target_height*$bili>$target_width) {\n $target_height = $target_width/$bili;\n }\n\n $source_ratio = $source_height / $source_width;\n $target_ratio = $target_height / $target_width;\n\n if ($source_ratio > $target_ratio) {\n $cropped_width = $source_width;\n $cropped_height = $source_width * $target_ratio;\n $source_x = 0;\n $source_y = ($source_height - $cropped_height) / 2;\n }elseif ($source_ratio < $target_ratio) {\n $cropped_width = $source_height / $target_ratio;\n $cropped_height = $source_height;\n $source_x = ($source_width - $cropped_width) / 2;\n $source_y = 0;\n }else {\n $cropped_width = $source_width;\n $cropped_height = $source_height;\n $source_x = 0;\n $source_y = 0;\n }\n\n switch ($source_mime) {\n case 'image/gif':\n $source_image = imagecreatefromgif($source_path);\n break;\n case 'image/jpeg':\n $source_image = imagecreatefromjpeg($source_path);\n break;\n case 'image/png':\n $source_image = imagecreatefrompng($source_path);\n break;\n default:\n return false;\n break;\n }\n\n $target_image = imagecreatetruecolor($target_width, $target_height);\n $cropped_image = imagecreatetruecolor($cropped_width, $cropped_height);\n\n // 裁剪\n imagecopy($cropped_image, $source_image, 0, 0, $source_x, $source_y, $cropped_width, $cropped_height);\n // 缩放\n imagecopyresampled($target_image, $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);\n\n imagejpeg($target_image,$source_path);\n imagedestroy($source_image);\n imagedestroy($target_image);\n imagedestroy($cropped_image);\n}", "private function getImageStylesConfig() {\n static $styles = [];\n if (!empty($styles)) {\n return $styles;\n }\n $image_style_config_files = Utils::getConfigFiles($this->scaffolder->getConfigDir() . '/image_style');\n if (!empty($image_style_config_files)) {\n foreach ($image_style_config_files as $image_style_config_file) {\n $config_data = Utils::getConfig($image_style_config_file);\n if ($config_data) {\n if (!empty($config_data['image_styles'])) {\n $prefix_machine_name = isset($config_data['prefix']['machine_name']) ? $config_data['prefix']['machine_name'] : '';\n $prefix_name = isset($config_data['prefix']['name']) ? $config_data['prefix']['name'] : '';\n $multiplier_config = isset($config_data['multiplier']) ? $config_data['multiplier'] : ['1x' => '1x'];\n $multiplier = [];\n foreach ($multiplier_config as $key => $value) {\n $multiplier[$value] = floatval(str_replace('x', '', $value));\n }\n\n $new_image_styles = [];\n foreach ($multiplier as $suffix => $scale) {\n foreach ($config_data['image_styles'] as $config) {\n $config['name'] = empty($config['name']) ? $config['machine_name'] : $config['name'];\n $config['name'] = $prefix_name . $config['name'];\n $config['machine_name'] = $prefix_machine_name . $config['machine_name'];\n if (count($multiplier) > 1) {\n $config['name'] .= '@' . $suffix;\n $config['machine_name'] .= '_' . $suffix;\n }\n $config['machine_name'] = preg_replace(\"/[^a-z0-9_]/\", '_', $config['machine_name']);\n\n if ($config['effects']) {\n foreach ($config['effects'] as $key => &$effects) {\n $index = $key + 1;\n $effects['index'] = $index;\n $effects['weight'] = empty($effects['weight']) ? $index : $effects['weight'];\n foreach (array('width', 'height') as $k) {\n if (isset ($effects['data'][$k])) {\n $effects['data'][$k] = round($effects['data'][$k] * $scale);\n }\n }\n }\n }\n $styles[$config['machine_name']] = $this->getImageData($config);\n }\n }\n }\n }\n }\n }\n return $styles;\n }", "private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }", "protected function combineImages() {}", "function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }" ]
[ "0.57363474", "0.566653", "0.5626273", "0.5509117", "0.5484915", "0.5450332", "0.53552485", "0.5355123", "0.5334698", "0.53291494", "0.5305921", "0.5296444", "0.5287697", "0.52774084", "0.52462417", "0.5216647", "0.52152807", "0.5209703", "0.5208981", "0.5207384", "0.51727116", "0.5155919", "0.5114665", "0.5113606", "0.5106378", "0.5096103", "0.5090551", "0.5073823", "0.5053059", "0.5048642" ]
0.5837391
0
Compare crop zone properties when user saved one crop.
public function cropHasChanged(array $crop_properties, array $old_crop) { if (!empty(array_diff_assoc($crop_properties, $old_crop))) { return TRUE; } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "private function _setCrop()\n {\n if (isset($this->crop) && $this->crop && $this->bbox_rubberband && $this->_isResize()) {\n\n $bbox_rubberband = explode(',', $this->bbox_rubberband);\n\n //lower-left coordinate\n $ll_point = new \\stdClass();\n $ll_point->x = $bbox_rubberband[0];\n $ll_point->y = $bbox_rubberband[3];\n $ll_coord = $this->pix2Geo($ll_point);\n\n //upper-right coordinate\n $ur_point = new \\stdClass();\n $ur_point->x = $bbox_rubberband[2];\n $ur_point->y = $bbox_rubberband[1];\n $ur_coord = $this->pix2Geo($ur_point);\n\n //set the size as selected\n $width = abs($bbox_rubberband[2]-$bbox_rubberband[0]);\n $height = abs($bbox_rubberband[3]-$bbox_rubberband[1]);\n\n $this->map_obj->setSize($width, $height);\n if ($this->_isResize() && $this->_download_factor > 1) {\n $this->map_obj->setSize($this->_download_factor*$width, $this->_download_factor*$height);\n }\n\n //set the extent to match that of the crop\n $this->map_obj->setExtent($ll_coord->x, $ll_coord->y, $ur_coord->x, $ur_coord->y);\n }\n }", "public function saveCroppedAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $width = $size->getWidth();\n $height = $size->getHeight();\n\n $cropData = explode(';', $this->cropData);\n\n if(count($cropData) == 4)\n {\n $point = new Point($cropData[0]*$width, $cropData[1]*$height);\n $box = new Box($cropData[2]*$width, $cropData[3]*$height);\n $imagine->crop($point, $box);\n // $imageBox = $this->getImageBox($size);\n // $imagine->resize($imageBox);\n }\n $imagine->save($this->getFilePath());\n\n return $this->save(false);\n }", "public function crop(){\n return $this->zajlib->json(['status'=>'ok']);\n }", "abstract public function calculateCropBoxCoordinates();", "abstract function crop($properties);", "abstract public function calculateCropBoxSize();", "public function applyCrop(array $properties, $field_value, CropType $crop_type) {\n // Get Original sizes and position of crop zone.\n $crop_properties = $this->getCropOriginalDimension($field_value, $properties);\n // Get all imagesStyle used this crop_type.\n $image_styles = $this->getImageStylesByCrop($crop_type->id());\n\n $this->saveCrop($crop_properties, $field_value, $image_styles, $crop_type, FALSE);\n }", "public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}", "public function lastCrop() : Crop\n {\n if($this->lastCrop) {\n return $this->lastCrop;\n }\n return $this->lastCrop = Crop::orderBy('id', 'desc')->first();\n }", "public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "public function saveCrop(array $crop_properties, $field_value, array $image_styles, CropType $crop_type, $notify = TRUE) {\n /** @var \\Drupal\\image\\Entity\\ImageStyle $image_style */\n foreach ($image_styles as $image_style) {\n $values = [\n 'type' => $crop_type->id(),\n 'entity_id' => $field_value['file-id'],\n 'entity_type' => 'file',\n 'uri' => $field_value['file-uri'],\n 'x' => $crop_properties['x'],\n 'y' => $crop_properties['y'],\n 'width' => $crop_properties['width'],\n 'height' => $crop_properties['height'],\n 'image_style' => $image_style->getName(),\n ];\n\n // Save crop with previous values.\n /** @var \\Drupal\\crop\\CropInterface $crop */\n $crop = $this->cropStorage->create($values);\n $crop->save();\n }\n $this->imageStylesOperations($image_styles, $field_value['file-uri'], TRUE);\n\n if ($notify) {\n drupal_set_message(t('The crop \"@cropType\" was successfully added for image \"@filename\".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));\n }\n }", "public function updateCrop(array $properties, $field_value, CropType $crop_type) {\n // Get Original sizes and position of crop zone.\n $crop_properties = $this->getCropOriginalDimension($field_value, $properties);\n\n // Get all imagesStyle used this crop_type.\n $image_styles = $this->getImageStylesByCrop($crop_type->id());\n\n if (!empty($image_styles)) {\n $crops = $this->loadImageStyleByCrop($image_styles, $crop_type, $field_value['file-uri']);\n }\n\n // If any crop exist add new crop.\n if (empty($crops)) {\n $this->saveCrop($crop_properties, $field_value, $image_styles, $crop_type);\n return;\n }\n\n foreach ($crops as $crop_element) {\n // Get Only first crop entity @see https://www.drupal.org/node/2617818.\n /** @var \\Drupal\\crop\\Entity\\Crop $crop */\n $crop = $crop_element;\n\n if (!$this->cropHasChanged($crop_properties, array_merge($crop->position(), $crop->size()))) {\n return;\n }\n\n $this->updateCropProperties($crop, $crop_properties);\n $this->imageStylesOperations($image_styles, $field_value['file-uri']);\n drupal_set_message(t('The crop \"@cropType\" were successfully updated for image \"@filename\".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));\n }\n }", "public function getDst(): bool\n {\n return $this->format('I') === '1'; // 1 if Daylight Saving Time, 0 otherwise.\n }", "public function crop()\n {\n }", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public function hasZone() : bool;", "public function secondCrop() : Crop\n {\n if($this->secondCrop) {\n return $this->secondCrop;\n }\n return $this->secondCrop = Crop::find(2);\n }", "public function getZone()\n {\n return $this->zone;\n }", "public function user_crop()\r\n\t{\r\n\t\t// Get uploaded photo\r\n\t\t$uploaded_photo = $this->input->post('uploaded_photo');\r\n\r\n\t\t// Get image width, height\r\n\t\tlist($width, $height) = @getimagesize('./assets/uploads/' . $uploaded_photo);\r\n\r\n\t\t// Calculate ratio\r\n\t\t$ratio = $width / 536;\r\n\r\n\t\t// Get chosen crop coordinates\r\n\t\t$coords_x1 = round($ratio * $this->input->post('coords-x1'));\r\n\t\t$coords_y1 = round($ratio * $this->input->post('coords-y1'));\r\n\t\t$coords_x2 = round($ratio * $this->input->post('coords-x2'));\r\n\t\t$coords_y2 = round($ratio * $this->input->post('coords-y2'));\r\n\t\t$coords_w = round($ratio * $this->input->post('coords-w'));\r\n\t\t$coords_h = round($ratio * $this->input->post('coords-h'));\r\n\r\n\t\t// Profile thumbnail crop config\r\n\t\t$config['source_image'] = './assets/uploads/' . $uploaded_photo;\r\n\t\t$config['new_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = $coords_w;\r\n\t\t$config['height'] = $coords_h;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\t\t$config['x_axis'] = $coords_x1;\r\n\t\t$config['y_axis'] = $coords_y1;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Crop the image\r\n\t\tif (!$this->image_lib->crop())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\r\n\t\t// Clear the config to start next thumbnail\r\n\t\t$config = array();\r\n\t\t$this->image_lib->clear();\r\n\r\n\t\t// Profile thumbnail resize config\r\n\t\t$config['source_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = 385;\r\n\t\t$config['height'] = 465;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Resize the image\r\n\t\tif (!$this->image_lib->resize())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\t}", "function captiveportal_ha_is_node_in_backup_mode($cpzone) {\n\t$cpinterfaces = explode(\",\", config_get_path(\"captiveportal/{$cpzone}/interface\", \"\"));\n\n\tforeach ($cpinterfaces as $interface) {\n\t\tforeach (config_get_path('virtualip/vip', []) as $vip) {\n\t\t\tif (($vip['interface'] == $interface) && ($vip['mode'] == \"carp\")) {\n\t\t\t\tif (get_carp_interface_status(\"_vip{$vip['uniqid']}\") != \"MASTER\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function crop($value) {\n return $this->setProperty('crop', $value);\n }", "function checkCover($X_langArray) {\n\tglobal $errorField;\n\t$bean = isset($_SESSION[\"COUNTRY_REVIEWN_BEAN\"]) ? unserialize($_SESSION[\"COUNTRY_REVIEWN_BEAN\"]) : null;\n\tif ( $bean == null || $bean->getCoverFileName() == null || $bean->getCoverFileName() == '' ) {\n\t\t$errorField .= \"&loadCovImgErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_COVER_ERR']);\n\t}\n}", "public static function crop()\n {\n return new CropMode(CropMode::CROP);\n }", "function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }", "public function hasZoneid(){\n return $this->_has(3);\n }", "public function testDimensionsOutboundsCrop()\n {\n $dimensions = Dimensions::create(\n 450,\n 450,\n 300,\n 150,\n ElcodiMediaImageResizeTypes::OUTBOUND_CROP\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(112.5, $dimensions->getSrcY());\n $this->assertEquals(450, $dimensions->getSrcWidth());\n $this->assertEquals(225, $dimensions->getSrcHeight());\n\n $this->assertEquals(0, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(300, $dimensions->getDstWidth());\n $this->assertEquals(150, $dimensions->getDstHeight());\n $this->assertEquals(300, $dimensions->getDstFrameX());\n $this->assertEquals(150, $dimensions->getDstFrameY());\n }", "public function save()\n {\n // save the new Promo data table //\n $cropimg_data = $_POST['cropimg'];\n // smth like:- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array1 = explode(\";\", $cropimg_data);\n // smth like:- base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array2 = explode(\",\", $cropimg_remove_array1[1]);\n // smth like:- iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg = base64_decode($cropimg_remove_array2[1]);\n\n $imageName = 'promo_'.time() . '.png';\n\n $dir_to_save = \"./assets/jollof_banners/fashionhompage_banner/\";\n if (!is_dir($dir_to_save)) {\n mkdir($dir_to_save);\n }\n file_put_contents($dir_to_save.$imageName, $cropimg);\n \n \n \n $input_date=$_POST['promo_date'];\n $date_start=date(\"Y-m-d H:i:s\",strtotime($input_date));\n \n $promo_duration = $this->promo->promodurationinfo($_POST['promo_duration']);\n \n if($promo_duration->durationname == '1 Day'){$date_end= date('Y-m-d H:i:s',strtotime('+1 day',$input_date));}\n else if($promo_duration->durationname == '1 Week') {$date_end= date('Y-m-d H:i:s',strtotime('+1 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+1 month',strtotime($input_date)));}\n else if($promo_duration->durationname == '3 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+3 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '6 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+6 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Year') {$date_end= date('Y-m-d H:i:s',strtotime('+1 year',strtotime($input_date)));}\n \n $data_New = array( \n 'imageurl' => $_POST['promo_url'],\n 'imagename' => $imageName,\n 'bannertypeid' => $_POST[\"promotype\"],\n 'promodurationid'=> $_POST[\"promo_duration\"],\n 'usertype' => $this->session->Type,\n 'merchantid' => $this->session->merchant_id,\n 'userid' => $this->session->User_id,\n 'username' => $this->session->companyname,\n 'payment' => 'FREE',\n 'startdate' => $date_start,\n 'enddate' => $date_end,\n 'status' => 0\n );\n $insert_data = $this->Generic->add($data_New, $tablename=\"img_ads\");// insert to db\n\n if($insert_data) \n {\n $this->session->set_flashdata('success','success');\n $this->session->set_flashdata('message', 'Promo Saved');\n $Json_resultSave = array (\n 'status' => '1',\n 'content' => $imageName\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n else \n { \n $this->session->set_flashdata('error','error');\n $this->session->set_flashdata('message', 'An error occur when Adding New Promo');\n $Json_resultSave = array (\n 'status' => '0',\n 'content' => 'There was a problem!! Pls Try Again.....'\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n }", "public function actionSaveCroppedImage() {\n\n if ($_REQUEST['output_filename'] == '') {\n $output_filename = \"media/croppic/croppedimg/croppedImg_\" . time();\n } else {\n $output_filename = $_REQUEST['output_filename'] . time();\n }\n $output_filename2 = Yii::app()->request->baseUrl . '/' . $output_filename;\n\n $imgUrl = Yii::app()->basePath.'/..'.str_replace(Yii::app()->request->baseUrl,'',$_POST['imgUrl']);\n $imgInitW = $_POST['imgInitW'];\n $imgInitH = $_POST['imgInitH'];\n $imgW = $_POST['imgW'];\n $imgH = $_POST['imgH'];\n $imgY1 = $_POST['imgY1'];\n $imgX1 = $_POST['imgX1'];\n $cropW = $_POST['cropW'];\n $cropH = $_POST['cropH'];\n\n $jpeg_quality = 100;\n\n $what = getimagesize($imgUrl);\n \n switch (strtolower($what['mime'])) {\n case 'image/png':\n $img_r = imagecreatefrompng($imgUrl);\n $source_image = imagecreatefrompng($imgUrl);\n $type = '.png';\n break;\n case 'image/jpeg':\n $img_r = imagecreatefromjpeg($imgUrl);\n $source_image = imagecreatefromjpeg($imgUrl);\n $type = '.jpeg';\n break;\n case 'image/gif':\n $img_r = imagecreatefromgif($imgUrl);\n $source_image = imagecreatefromgif($imgUrl);\n $type = '.gif';\n break;\n default: die('image type not supported');\n }\n\n $resizedImage = imagecreatetruecolor($imgW, $imgH);\n imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, $imgH, $imgInitW, $imgInitH);\n\n\n $dest_image = imagecreatetruecolor($cropW, $cropH);\n imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, $cropH, $cropW, $cropH);\n\n\n imagejpeg($dest_image, $output_filename . $type, $jpeg_quality);\n\n $response = array(\n \"status\" => 'success',\n \"url\" => $output_filename2 . $type\n );\n print json_encode($response);\n }", "protected function associateZonesOnCompletenessChange($request)\n {\n $this->logInfo(__METHOD__, $this->id.\":\".$this->key);\n if ($this->completeness === \"Complete\")\n {\n try {\n $sb = SkeletalBone::find($this->sb_id);\n $zones = $sb->zones()->get();\n $arr_zones = [];\n foreach($zones as $zone) {\n $arr_zones[$zone->id]['id'] = $zone->id;\n $arr_zones[$zone->id]['presence'] = true;\n }\n $this->zones()->sync($this->populateCreateFieldsOrgProjectFieldsForSyncWithData($arr_zones,\"presence\", $this, 'boolean'));\n $this->logInfo(__METHOD__, \"Complete Successful \".$this->id.\":\".$this->key);\n return true;\n } catch (QueryException $ex) {\n $this->logQueryException(__METHOD__, $request, $ex);\n }\n } else {\n try {\n $sb = SkeletalBone::find($this->sb_id);\n $zones = $sb->zones()->get();\n $arr_zones = [];\n foreach($zones as $zone) {\n $arr_zones[$zone->id]['id'] = $zone->id;\n $arr_zones[$zone->id]['presence'] = false;\n }\n $this->zones()->sync([]);\n $this->logInfo(__METHOD__, \"Not Complete Successful \".$this->id.\":\".$this->key);\n return true;\n } catch (QueryException $ex) {\n $this->logQueryException(__METHOD__, $request, $ex);\n }\n }\n return false;\n }" ]
[ "0.57781464", "0.52611005", "0.5253908", "0.5167224", "0.5132991", "0.5047226", "0.49342763", "0.49145108", "0.4896651", "0.48536643", "0.47805074", "0.47767347", "0.4751232", "0.4722512", "0.47208574", "0.4716559", "0.47063917", "0.45918715", "0.45825166", "0.45586103", "0.4557625", "0.454628", "0.45395303", "0.45367554", "0.45349967", "0.45342624", "0.4493304", "0.44871277", "0.44824892", "0.4479215" ]
0.5622773
1
/ Makes incoming info "safe" Parse _GET _POST data Clean up and unHTML
function parseIncoming(){ # THIS NEEDS TO BE HERE! $this->get_magic_quotes = @get_magic_quotes_gpc(); if(is_array($_GET)){ while(list($k, $v) = each($_GET)){ if(is_array($_GET[$k])){ while(list($k2, $v2) = each($_GET[$k])){ $this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2); } }else{ $this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v); } } } // Overwrite GET data with post data if(is_array($_POST)){ while(list($k, $v) = each($_POST)){ if(is_array($_POST[$k])){ while(list($k2, $v2) = each($_POST[$k])){ $this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2); } }else{ $this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v); } } } $this->input['requestMethod'] = strtolower($_SERVER['REQUEST_METHOD']); // echo '<pre>'.print_r($this->input, 1).'</pre>';exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function santitise_input($data) {\n $data = trim($data);\n //Removing backslashes.\n $data = stripslashes($data);\n //Removing HTML special/control characters.\n $data = htmlspecialchars($data);\n return $data; \n }", "function test_input($data) {\n $data = trim($data);\n $data = strip_tags($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function valid_get($data) {\n\t\t\t$data = trim($data); //trim - функция удаляет пробелы до и после слова но в самом слове пробелы не удаляет\n\t\t\t$data = stripslashes($data); //stripslashes — Удаляет экранирование символов\n\t\t\t$data = strip_tags($data); //strip_tags — Удаляет теги HTML и PHP из строки\n\t\t\t$data = htmlspecialchars($data); //htmlspecialchars — Преобразует специальные символы в HTML-сущности\n\t\t\treturn $data;\n\t }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function clean_input($data) {\n $data = trim($data); // strips whitespace from beginning/end\n $data = stripslashes($data); // remove backslashes\n $data = htmlspecialchars($data); // replace special characters with HTML entities\n return $data;\n}", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitizeInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n return $data;\n}", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function format_input($data) { \n $data = trim($data); // Strips unnecessary characters (extra space, tab, newline) from the user input data\n $data = stripslashes($data); // Removes backslashes from the user input data\n $data = htmlspecialchars($data); // When a user tries to submit in a text \n // field. The code is now safe to be displayed on a page or inside an e-mail.\n return $data;\n}", "protected function _sanitize_globals()\n {\n // Is $_GET data allowed? If not we'll set the $_GET to an empty array\n if ($this->_allow_get_array === FALSE)\n {\n $_GET = array();\n }\n elseif (is_array($_GET) && count($_GET) > 0)\n {\n foreach ($_GET as $key => $val)\n {\n $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_POST Data\n if (is_array($_POST) && count($_POST) > 0)\n {\n foreach ($_POST as $key => $val)\n {\n $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_COOKIE Data\n if (is_array($_COOKIE) && count($_COOKIE) > 0)\n {\n // Also get rid of specially treated cookies that might be set by a server\n // or silly application, that are of no use to a CI application anyway\n // but that when present will trip our 'Disallowed Key Characters' alarm\n // http://www.ietf.org/rfc/rfc2109.txt\n // note that the key names below are single quoted strings, and are not PHP variables\n unset(\n $_COOKIE['$Version'],\n $_COOKIE['$Path'],\n $_COOKIE['$Domain']\n );\n\n foreach ($_COOKIE as $key => $val)\n {\n if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE)\n {\n $_COOKIE[$cookie_key] = $this->_clean_input_data($val);\n }\n else\n {\n unset($_COOKIE[$key]);\n }\n }\n }\n\n // Sanitize PHP_SELF\n $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);\n\n // CSRF Protection check\n if ($this->_enable_csrf === TRUE && ! is_cli())\n {\n $this->security->csrf_verify();\n }\n }", "function rec_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function cleanInput($data)\n\t{\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}", "function clean_input($data){\r\n\t$data = trim($data);\r\n\t$data = stripslashes($data);\r\n\t$data = htmlspecialchars($data);\r\n\treturn $data;\t\r\n}", "function clean_form_input($form_data){\n\t$temp = str_ireplace(\",\",\"@\", $form_data);\n\t$temp = str_ireplace(\"\\\"\",\"|\", $temp); \n\t$temp = str_ireplace(\"<\", \"$\", $temp);\n\t$temp = str_ireplace(\">\", \"?\", $temp);\n return $temp;\n}", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }" ]
[ "0.6389007", "0.63756335", "0.6365992", "0.6357755", "0.6301067", "0.6285136", "0.627973", "0.627973", "0.62678367", "0.6258196", "0.6197212", "0.6195201", "0.6183802", "0.6174071", "0.61475915", "0.61278707", "0.61265343", "0.61254466", "0.6115586", "0.6112385", "0.6101948", "0.6099365", "0.60877126", "0.60720855", "0.60693705", "0.60693705", "0.6068987", "0.6067276", "0.6062373", "0.6047342" ]
0.6690136
0
/ Clean evil tags Clean possible javascipt codes
function cleanEvilTags($t){ $t = preg_replace("/javascript/i" , "j&#097;v&#097;script", $t); $t = preg_replace("/alert/i" , "&#097;lert" , $t); $t = preg_replace("/about:/i" , "&#097;bout:" , $t); $t = preg_replace("/onmouseover/i", "&#111;nmouseover" , $t); $t = preg_replace("/onclick/i" , "&#111;nclick" , $t); $t = preg_replace("/onload/i" , "&#111;nload" , $t); $t = preg_replace("/onsubmit/i" , "&#111;nsubmit" , $t); $t = preg_replace("/<body/i" , "&lt;body" , $t); $t = preg_replace("/<html/i" , "&lt;html" , $t); $t = preg_replace("/document\./i" , "&#100;ocument." , $t); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function xss_clean($var) {\r\n\treturn preg_replace('/(java|vb)script/i', '\\\\1 script', utf8_htmlspecialchars($var));\r\n}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "function remove_php_tags(&$code) {\r\n\r\n\t\t\t\t// This matches the information gathered from the internal PHP lexer\r\n\t\t\t\t$match = array(\r\n\t\t\t\t\t'#<([\\?%])=?.*?\\1>#s',\r\n\t\t\t\t\t'#<script\\s+language\\s*=\\s*([\"\\']?)php\\1\\s*>.*?</script\\s*>#s',\r\n\t\t\t\t\t'#<\\?php(?:\\r\\n?|[ \\n\\t]).*?\\?>#s'\r\n\t\t\t\t);\r\n\r\n\t\t\t$code = preg_replace($match, '', $code);\r\n\t}", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "function clean_extraneous_inline() {\r\n\t}", "function xss_html_clean( $html )\n\t{\n\t\t//-----------------------------------------\n\t\t// Opening script tags...\n\t\t// Check for spaces and new lines...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\" , \"&lt;script\" , $html );\n\t\t$html = preg_replace( \"#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\", \"&lt;/script\", $html );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Basics...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $html );\n\t\t$html = preg_replace( \"/alert/i\" , \"&#097;lert\" , $html );\n\t\t$html = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $html );\n\t\t$html = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $html );\n\t\t$html = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $html );\n\t\t$html = preg_replace( \"/onload/i\" , \"&#111;nload\" , $html );\n\t\t$html = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $html );\n\t\t$html = preg_replace( \"/<body/i\" , \"&lt;body\" , $html );\n\t\t$html = preg_replace( \"/<html/i\" , \"&lt;html\" , $html );\n\t\t$html = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $html );\n\t\t\n\t\treturn $html;\n\t}", "function clean_script_tag($input) {\n $input = str_replace(\"type='text/javascript' \", '', $input);\n return str_replace(\"'\", '\"', $input);\n}", "function smarty_postfilter_strip($compiled, &$smarty)\n{\n\treturn preg_replace('/<\\?php\\s+\\?>/', '', $compiled);\n}", "public function removeCode()\n\t{\n\t\t// This is useful for saving space.\n\t\t// This function is useful when dealing with \"composite pages\" i.e.\n\t\t// the processor would:\n\t\t// -- fetch the code from the content,\n\t\t// -- load the code in the PHP machine using \"eval\"\n\t\t// -- strip the content from the code\n\t\t// -- invoke the callback with, as parameters, the source page & \n\t\t// this page's content \n\t\t$content = preg_replace(\"/\\<php(.*)php\\>/siU\",\"\", $this->content);\n\t\t$this->content = $content;\n\t}", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function clean_script_tag( $input ) {\n\t$input = str_replace( \"type='text/javascript' \", '', $input );\n\n\treturn str_replace( \"'\", '\"', $input );\n}", "function wpse_allowedtags() {\n return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>';\n}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function codeTagFilter($text)\r\n{\r\n\t$pattern = '%(<code>)(.*?)(</code>)%se';\r\n\t$replace = \"'\\\\1'.htmlentities(codeTagFilter('\\\\2')).'\\\\3'\";\r\n\treturn stripslashes(preg_replace($pattern, $replace, $text));\r\n}", "function cleanLeftoverJunk(&$string)\n\t{\n\t\t$string = preg_replace('#<\\!-- (START|END): SRC_[^>]* -->#', '', $string);\n\n\t\tif (strpos($string, $this->src_params->tag_character_start . '/' . $this->src_params->syntax_word) === false)\n\t\t{\n\t\t\t$this->unprotectTags($string);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$regex = $this->src_params->regex;\n\t\tif (@preg_match($regex . 'u', $string))\n\t\t{\n\t\t\t$regex .= 'u';\n\t\t}\n\n\t\t$string = preg_replace(\n\t\t\t$regex,\n\t\t\t'<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::_('SRC_CODE_REMOVED_NOT_ENABLED') . ' -->',\n\t\t\t$string\n\t\t);\n\n\t\t$this->unprotectTags($string);\n\t}", "function dumb($data){\n highlight_string(\"<?php\\n \" . var_export($data, true) . \"?>\");\n echo '<script>document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\")[1].remove() ;document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\")[document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\").length - 1].remove() ; </script>';\n die();\n }", "function unescape_invalid_shortcodes($content)\n {\n }", "function cleanInput($input) \n{\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n $output = preg_replace($search, '', $input);\n return $output;\n}", "public static function cleanOut($s) {\n $s = str_replace('//<?php', '//', $s);\n $s = str_replace('<?php', '', $s);\n return $s;\n }", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "function cleanInput ($input) {\n\t \n\t\t$search = array(\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t\t);\n\n\t\treturn preg_replace($search, '', $input);\n\t}", "function limpiahtml($salida){\n $regex = \"/<script.*?>.*?<\\/script>/ims\";\n preg_match_all($regex, $salida, $matches, null, 0);\n if(count($matches)>0){\n $tags2add = \"\"; \n foreach($matches[0] as $tag){\n if(!strstr($tag, \"inmovil\")){\n $retag = $tag;\n $tag = JSMin::minify($tag);\n $tags2add .= $tag;\n $salida = str_replace($retag, \"\", $salida);\n }\n }\n } \n $salida = minify_html($salida);\n\n\n $salida = str_replace(array(\"</body>\"),array($tags2add.\"</body>\"),$salida);\n return $salida;\n echo preg_last_error();\n}", "function tep_sanitize_javascript($str){\n $farr = array(\n \"/\\s+/\", //过滤多余的空白\n \"/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU\",//过滤script等\n \"/(<[^>]*)on[a-zA-Z]+\\s*=([^>]*>)/isU\", //过滤on开头的时间,防止js调用\n \"/(<[^>]*)(href|src)\\s*=.*(javascript|vbscript).*([^>]*)(>)/isU\",//去掉链接中调用js\n \"/expression\\((.*)\\);?/is\" //去掉css调用js\n );\n $tarr = array(\n \" \",\n \"<\\\\1\\\\2\\\\3>\",\n \"\\\\1\\\\2\",\n \"\\\\1\\\\5\",\n \"\"\n );\n\n $str = preg_replace( $farr,$tarr,$str);\n return $str;\n }", "public function doXHTML_cleaning() {}", "function tac_tidy_scrip_tag( $tag, $handle ) {\n\treturn preg_replace( \"/type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}", "function cleanInput($input) {\n\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $output = preg_replace($search, '', $input);\n return $output;\n}", "public function clean_script_tag($input) {\n\t\t$input = str_replace(\"type='text/javascript' \", '', $input);\n\t\treturn str_replace(\"'\", '\"', $input);\n\t}", "function comcode_text_to_tempcode($comcode,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$is_all_semihtml,$structure_sweep,$check_only,$highlight_bits=NULL,$on_behalf_of_member=NULL)\n{\n\tglobal $ADVERTISING_BANNERS,$ALLOWED_ENTITIES,$POTENTIALLY_EMPTY_TAGS,$CODE_TAGS,$REVERSABLE_TAGS,$PUREHTML_TAGS,$DANGEROUS_TAGS,$VALID_COMCODE_TAGS,$BLOCK_TAGS,$POTENTIAL_JS_NAUGHTY_ARRAY,$TEXTUAL_TAGS,$LEET_FILTER,$IMPORTED_CUSTOM_COMCODE,$REPLACE_TARGETS;\n\n\t$wml=false; // removed feature from ocPortal now\n\t$print_mode=get_param_integer('wide_print',0)==1;\n\n\t$len=strlen($comcode);\n\n\tif ((function_exists('set_time_limit')) && (ini_get('max_execution_time')!='0')) @set_time_limit(300);\n\n\t$allowed_html_seqs=array('<table>','<table class=\"[^\"]*\">','<table class=\"[^\"]*\" summary=\"[^\"]*\">','<table summary=\"[^\"]*\">','</table>','<tr>','</tr>','<td>','</td>','<th>','</th>','<pre>','</pre>','<br />','<br/>','<br >','<br>','<p>','</p>','<p />','<b>','</b>','<u>','</u>','<i>','</i>','<em>','</em>','<strong>','</strong>','<li>','</li>','<ul>','</ul>','<ol>','</ol>','<del>','</del>','<dir>','</dir>','<s>','</s>','</a>','</font>','<!--','<h1 id=\"main_page_title\">','<h1 class=\"main_page_title\">','<h1 id=\"main_page_title\" class=\"main_page_title\">','</h1>','<img (class=\"inline_image\" )?alt=\"[^\"]*\" src=\"[^\"]*\" (complete=\"true\" )*/>','<img src=[\"\\'][^\"\\'<>]*[\"\\']( border=[\"\\'][^\"\\'<>]*[\"\\'])?( alt=[\"\\'][^\"\\'<>]*[\"\\'])?( )?(/)?'.'>','<a href=[\"\\'][^\"\\'<>]*[\"\\']( target=[\"\\'][^\"\\'<>]*[\"\\'])?'.'>'); // HTML tag may actually be used in very limited conditions: only the following HTML seqs will come out as HTML. This is, unless the blacklist filter is used instead.\n\tif ($as_admin)\n\t{\n\t\t$comcode_dangerous=true;\n\t\t$comcode_dangerous_html=true;\n\t} else\n\t{\n\t\t$comcode_dangerous=($GLOBALS['MICRO_BOOTUP']==0) && (has_specific_permission($source_member,'comcode_dangerous'));\n\t\t$comcode_dangerous_html=false;\n\t\tif ((has_specific_permission($source_member,'allow_html')) && (($is_all_semihtml) || (strpos($comcode,'[html')!==false) || (strpos($comcode,'[semihtml')!==false)))\n\t\t{\n\t\t\t$comcode_dangerous_html=true;\n\t\t\t/*foreach (array_keys($POTENTIALLY_EMPTY_TAGS) as $tag) // Find whether we really need to enable the computational-expensive filtering. Code disabled, not sure why this would have ever worked!\n\t\t\t{\n\t\t\t\tif (($tag!='html') && ($tag!='semihtml') && (strpos($comcode,'['.$tag)!==false))\n\t\t\t\t{\n\t\t\t\t\t$comcode_dangerous_html=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t}\n\tif (is_null($pass_id)) $pass_id=strval(mt_rand(0,32000)); // This is a unique ID that refers to this specific piece of comcode\n\tglobal $COMCODE_ATTACHMENTS;\n\tif (!array_key_exists($pass_id,$COMCODE_ATTACHMENTS)) $COMCODE_ATTACHMENTS[$pass_id]=array();\n\n\t// Tag level\n\t$current_tag='';\n\t$attribute_map=array();\n\t$tag_output=new ocp_tempcode();\n\t$continuation='';\n\t$close=mixed();\n\n\t// Properties that come from our tag\n\t$white_space_area=true;\n\t$textual_area=true;\n\t$formatting_allowed=true;\n\t$in_html=false;\n\t$in_semihtml=$is_all_semihtml;\n\t$in_separate_parse_section=false; // Not escaped because it has to be passed to a secondary filter\n\t$in_code_tag=false;\n\t$code_nest_stack=0;\n\n\t// Our state\n\t$status=CCP_NO_MANS_LAND;\n\t$lax=$GLOBALS['LAX_COMCODE'] || function_exists('get_member') && $source_member!=get_member() || count($_POST)==0; // if we don't want to produce errors for technically invalid Comcode\n\t$tag_stack=array();\n\t$pos=0;\n\t$line_starting=true;\n\t$just_ended=false;\n\t$none_wrap_length=0;\n\t$just_new_line=true; // So we can detect lists starting right away\n\t$just_title=false;\n\tglobal $NUM_LINES;\n\t$NUM_LINES=0;\n\t$queued_tempcode=new ocp_tempcode();\n\t$mindless_mode=false; // If we're doing a semi parse mode and going over a tag we don't actually process\n\t$tag_raw='';\n\n\tif ((!is_null($wrap_pos)) && (strtolower(get_charset())=='utf-8'))\n\t\t$wrap_pos*=2;\n\n\t$b_all=(get_option('admin_banners',true)==='1');\n\n\t$stupidity_mode=get_value('stupidity_mode'); // bork or leet\n\tif ($comcode_dangerous) $stupidity_mode=get_param('stupidity_mode','');\n\tif ($stupidity_mode=='leet')\n\t{\n\t\t$LEET_FILTER=array(\n\t\t'B'=>'8',\n\t\t'C'=>'(',\n\t\t'E'=>'3',\n\t\t'G'=>'9',\n\t\t'I'=>'1',\n\t\t'L'=>'1',\n\t\t'O'=>'0',\n\t\t'P'=>'9',\n\t\t'S'=>'5',\n\t\t'U'=>'0',\n\t\t'V'=>'\\/',\n\t\t'Z'=>'2'\n\t\t);\n\t}\n\n\t$smilies=$GLOBALS['FORUM_DRIVER']->find_emoticons(); // We'll be needing the smiley array\n\t$shortcuts=array('(EUR-)'=>'&euro;','{f.}'=>'&fnof;','-|-'=>'&dagger;','=|='=>'&Dagger;','{%o}'=>'&permil;','{~S}'=>'&Scaron;','{~Z}'=>'&#x17D;','(TM)'=>'&trade;','{~s}'=>'&scaron;','{~z}'=>'&#x17E;','{.Y.}'=>'&Yuml;','(c)'=>'&copy;','(r)'=>'&reg;','---'=>'&mdash;','--'=>'&ndash;','...'=>'&hellip;','-->'=>'&rarr;','<--'=>'&larr;');\n\n\t// Text syntax possibilities, that get maintained as our cursor moves through the text block\n\t$list_indent=0;\n\t$list_type='ul';\n\n\tif ($is_all_semihtml) filter_html($as_admin,$source_member,$pos,$len,$comcode,false,false); // Pre-filter the whole lot (note that this means during general output we do no additional filtering)\n\n\twhile ($pos<$len)\n\t{\n\t\t$next=$comcode[$pos];\n\t\t++$pos;\n\n\t\t// State machine\n\t\tswitch ($status)\n\t\t{\n\t\t\tcase CCP_NO_MANS_LAND:\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t// Look ahead to make sure it's a valid tag. If it's not then it's considered normal user input, not a tag at all\n\t\t\t\t\t$dif=(($pos<$len) && ($comcode[$pos]=='/'))?1:0;\n\t\t\t\t\t$ahead=substr($comcode,$pos+$dif,MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH);\n\t\t\t\t\t$equal_pos=strpos($ahead,'=');\n\t\t\t\t\t$space_pos=strpos($ahead,' ');\n\t\t\t\t\t$end_pos=strpos($ahead,']');\n\t\t\t\t\t$lax_end_pos=strpos($ahead,'[');\n\t\t\t\t\t$cl_pos=strpos($ahead,chr(10));\n\t\t\t\t\tif ($equal_pos===false) $equal_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($space_pos===false) $space_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($end_pos===false) $end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($lax_end_pos===false) $lax_end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($cl_pos===false) $cl_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\t$use_pos=min($equal_pos,$space_pos,$end_pos,$lax_end_pos,$cl_pos);\n\n\t\t\t\t\t$potential_tag=strtolower(substr($ahead,0,$use_pos));\n\t\t\t\t\tif (($use_pos!=22) && ((!$in_semihtml) || ($dif==1) || (($potential_tag!='html') && ($potential_tag!='semihtml'))) && ((!$in_html) || (($dif==1) && ($potential_tag=='html'))) && ((!$in_code_tag) || ((isset($CODE_TAGS[$potential_tag])) && ($potential_tag==$current_tag))) && ((!$structure_sweep) || ($potential_tag!='contents')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($in_code_tag)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($dif==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack--;\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$ok=($code_nest_stack==-1);\n\t\t\t\t\t\t} else $ok=true;\n\n\t\t\t\t\t\tif ($ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!isset($VALID_COMCODE_TAGS[$potential_tag]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$IMPORTED_CUSTOM_COMCODE)\n\t\t\t\t\t\t\t\t\t_custom_comcode_import($connection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((isset($VALID_COMCODE_TAGS[$potential_tag])) && (strtolower(substr($ahead,0,2))!='i ')) // The \"i\" bit is just there to block a common annoyance: [i] doesn't take parameters and we don't want \"[i think]\" (for example) being parsed.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($comcode[$pos]!='/') || (count($tag_stack)==0))\n\t\t\t\t\t\t\t\t\t$mindless_mode=($semiparse_mode) && /*(!isset($CODE_TAGS[$potential_tag])) && */((!isset($REVERSABLE_TAGS[$potential_tag])) || ((is_string($REVERSABLE_TAGS[$potential_tag])) && (preg_match($REVERSABLE_TAGS[$potential_tag],substr($comcode,$pos,100))!=0))) && (!isset($PUREHTML_TAGS[$potential_tag]));\n\t\t\t\t\t\t\t\telse $mindless_mode=$tag_stack[count($tag_stack)-1][7];\n\n\t\t\t\t\t\t\t\t$close=false;\n\t\t\t\t\t\t\t\t$current_tag='';\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\tif ((/*(($potential_tag=='html') || ($potential_tag=='semihtml')) && */($just_new_line)) || (isset($BLOCK_TAGS[$potential_tag])))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$status=CCP_STARTING_TAG;\n\t\t\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]!='/')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists($potential_tag,$BLOCK_TAGS))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep_block\">[';\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep\">[';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tag_raw='[';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tag_raw='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\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{\n\t\t\t\t\t\tif (($use_pos!=22) && ((($in_semihtml) || ($in_html)) && (($potential_tag=='html') || ($potential_tag=='semihtml'))) && (!$in_code_tag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ahc=strpos($ahead,']');\n\t\t\t\t\t\t\tif ($ahc!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pos+=$ahc+1;\n\t\t\t\t\t\t\t\tcontinue;\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\tif ((($in_html) || ((($in_semihtml) && (!$in_code_tag)) && (($next=='<') || ($next=='>') || ($next=='\"')))))\n\t\t\t\t{\n\t\t\t\t\tif ($next==chr(10)) ++$NUM_LINES;\n\n\t\t\t\t\tif ((!$comcode_dangerous_html) && ($next=='<')) // Special filtering required\n\t\t\t\t\t{\n\t\t\t\t\t\t$close=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t$portion=substr($comcode,$pos-1,$close-$pos+2);\n\t\t\t\t\t\t$seq_ok=false;\n\t\t\t\t\t\tforeach ($allowed_html_seqs as $allowed_html_seq)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (preg_match('#^'.$allowed_html_seq.'$#',$portion)!=0) $seq_ok=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$seq_ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// $next='&lt;'; //OLD STYLE\n\t\t\t\t\t\t\tif ($close!==false) $pos=$close+1; // NEW STYLE\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (substr($comcode,$pos-1,4)=='<!--') // To stop shortcut interpretation\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.='<!--';\n\t\t\t\t\t\t$pos+=3;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // Not in HTML\n\t\t\t\t{\n\t\t\t\t\t// Text-format possibilities\n\t\t\t\t\tif (($just_new_line) && ($formatting_allowed) && (!$wml))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($continuation!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List\n\t\t\t\t\t\t$found_list=false;\n\t\t\t\t\t\t$old_list_indent=$list_indent;\n\t\t\t\t\t\tif (($pos+2<$len) && (is_numeric($next)) && (((is_numeric($comcode[$pos])) && ($comcode[$pos+1]==')') && ($comcode[$pos+2]==' ')) || (($comcode[$pos]==')') && ($comcode[$pos+1]==' '))) && ((($list_type=='1') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n\\d+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='1'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($pos+2<$len) && (ord($next)>=ord('a')) && (ord($next)<=ord('z')) && ($comcode[$pos]==')') && ($comcode[$pos+1]==' ') && ((($list_type=='a') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n[a-z]+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='a'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='a';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($next==' ')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($old_list_indent!=0) && ($list_type!='ul'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$scan_pos=$pos-1;\n\t\t\t\t\t\t\t$list_indent=0;\n\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\tif (($scan_next=='-') && ($scan_pos+1<$len) && ($comcode[$scan_pos+1]==' '))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($scan_next==' ') ++$list_indent; else break;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$found_list) $list_indent=0; else $list_type='ul';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Rule?\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t$old_list_indent=0;\n\n\t\t\t\t\t\t\tif (($next=='-') && (!$just_title))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t\t$found_rule=true;\n\t\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\t\tif ($scan_next!='-')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($scan_next==chr(10))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else $found_rule=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($found_rule)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$_temp_tpl=do_template('COMCODE_TEXTCODE_LINE');\n\t\t\t\t\t\t\t\t\t$tag_output->attach($_temp_tpl);\n\t\t\t\t\t\t\t\t\t$pos=$scan_pos+1;\n\t\t\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t\tcontinue;\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// List handling\n\t\t\t\t\t\tif (($list_indent==$old_list_indent) && ($old_list_indent!=0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ($i=$list_indent;$i<$old_list_indent;++$i) // Close any ended\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$temp_tpl=($list_type=='ul')?'</ul>':'</ol>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (($list_indent<$old_list_indent) && ($list_indent!=0)) // Go down one final level, because the list tag must have been nested within an li tag (we closed open li tags recursively except for the final one)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($found_list)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((($list_indent-$old_list_indent)>1) && (!$lax))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_LIST_JUMPYNESS'),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($i=$old_list_indent;$i<$list_indent;++$i) // Or open any started\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch ($list_type)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'ul':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ul><li>'; else $temp_tpl='<ul>';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"1\"><li>'; else $temp_tpl='<ol type=\"1\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"a\"><li>'; else $temp_tpl='<ol type=\"a\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$temp_tpl='<li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t$next='';\n\t\t\t\t\t\t\t$pos=$scan_pos+2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && ($print_mode) && ($list_indent==0)) // We might need to put some queued up stuff here: when we print, we can't float thumbnails\n\t\t\t\t\t{\n\t\t\t\t\t\t$tag_output->attach($queued_tempcode);\n\t\t\t\t\t\t$queued_tempcode=new ocp_tempcode();\n\t\t\t\t\t}\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && (!$in_semihtml) && ((!$just_ended) || ($semiparse_mode) || (substr($comcode,$pos,3)==' - '))) // Hard-new-lines\n\t\t\t\t\t{\n\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t$line_starting=true;\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\tif (($list_indent==0) && (!$just_ended))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\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$just_new_line=false;\n\n\t\t\t\t\t\tif (($next==' ') && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($line_starting) || (($pos>1) && ($comcode[$pos-2]==' '))) // Hard spaces\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$next='&nbsp;';\n\t\t\t\t\t\t\t\t++$none_wrap_length;\n\t\t\t\t\t\t\t} else $none_wrap_length=0;\n\t\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($next==\"\\t\") && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t$tab_tpl=do_template('COMCODE_TEXTCODE_TAB');\n\t\t\t\t\t\t\t$_tab_tpl=$tab_tpl->evaluate();\n\t\t\t\t\t\t\t$none_wrap_length+=strlen($_tab_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($tab_tpl);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($next==' ') || ($next==\"\\t\") || ($just_ended)) $none_wrap_length=0; else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((!is_null($wrap_pos)) && ($none_wrap_length>=$wrap_pos) && ((strtolower(get_charset())!='utf-8') || (preg_replace(array('#[\\x09\\x0A\\x0D\\x20-\\x7E]#','#[\\xC2-\\xDF][\\x80-\\xBF]#','#\\xE0[\\xA0-\\xBF][\\x80-\\xBF]#','#[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}#','#\\xED[\\x80-\\x9F][\\x80-\\xBF]#','#\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}#','#[\\xF1-\\xF3][\\x80-\\xBF]{3}#','#\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}#'),array('','','','','','','',''),$continuation)=='')) && ($textual_area) && (!$in_semihtml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t} elseif ($textual_area) ++$none_wrap_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$line_starting=false;\n\t\t\t\t\t\t\t$just_ended=false;\n\n\t\t\t\t\t\t\t$differented=false; // If somehow via lookahead we've changed this to HTML and thus won't use it in raw form\n\n\t\t\t\t\t\t\t// Variable lookahead\n\t\t\t\t\t\t\tif ((!$in_code_tag) && (($next=='{') && (isset($comcode[$pos])) && (($comcode[$pos]=='$') || ($comcode[$pos]=='+') || ($comcode[$pos]=='!'))))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($comcode_dangerous)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_code_tag) && ((!$semiparse_mode) || (in_tag_stack($tag_stack,array('url','img','flash')))))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='+')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_end=$pos+5;\n\t\t\t\t\t\t\t\t\t\t\twhile ($p_end<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_end-($pos-1)+5);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count($p_portion,'{+START')==substr_count($p_portion,'{+END')) break;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_end++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len=1;\n\t\t\t\t\t\t\t\t\t\t\twhile ($pos+$p_len<$len)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos-1,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count(str_replace('{',' { ',$p_portion),'{')==substr_count(str_replace('}',' } ',$p_portion),'}')) break; // str_replace is to workaround a Quercus bug #4494\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len--;\n\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos+$p_len,$p_end-($pos+$p_len));\n\t\t\t\t\t\t\t\t\t\t\trequire_code('tempcode_compiler');\n\t\t\t\t\t\t\t\t\t\t\t$ret=template_to_tempcode(substr($comcode,$pos-1,$p_len+1).'{DIRECTIVE_EMBEDMENT}'.substr($comcode,$p_end,6));\n\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t$ret->singular_bind('DIRECTIVE_EMBEDMENT',comcode_text_to_tempcode($p_portion,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=$pos+$p_len;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_end+6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif ($comcode[$pos]=='!')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t\tif (($ret->parameterless(0)) && ($pos<$len)) // We want to take the lang string reference as Comcode if it's a simple lang string reference with no parameters\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\{\\!([\\w\\d\\_\\:]+)(\\}|$)#U',substr($comcode,$less_pos,$p_len-$less_pos),$matches)!=0) // Hacky code to extract the lang string name\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp_lang_string=$matches[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret=comcode_lang_string($temp_lang_string); // Recreate as a Comcode lang string\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\tif (($pos<=$len) || (!$lax))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($ret);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($comcode[$pos]=='$') && ($pos<$len-2) && ($comcode[$pos+1]==',') && (strpos($comcode,'}',$pos)!==false))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$pos=strpos($comcode,'}',$pos)+1;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Escaping of comcode tag starts lookahead\n\t\t\t\t\t\t\tif (($next=='\\\\') && (!$in_code_tag)) // We are changing \\[ to [ with the side-effect of blocking a tag start. To get \\[ literal, we need the symbols \\\\[... and add extra \\-pairs as needed. We are only dealing with \\ and [ (update: and now {) here, it's not a further extended means of escaping.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($pos!=$len) && (($comcode[$pos]=='\"') || (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=$mindless_mode?'&quot;':'\"';\n\t\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='&quot;';\n\t\t\t\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='['))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='[';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='{'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='{';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos==$len) || ($comcode[$pos]=='\\\\'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((($textual_area) || ($in_semihtml)) && (trim($next)!='') && (!$wml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Emoticon lookahead\n\t\t\t\t\t\t\t\t\tforeach ($smilies as $smiley=>$imgcode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($in_semihtml) $smiley=' '.$smiley.' ';\n\n\t\t\t\t\t\t\t\t\t\tif ($next==$smiley[0]) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($comcode,$pos-1,strlen($smiley))==$smiley)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($smiley)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_emoticon($imgcode));\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((trim($next)!='') && (!$in_code_tag) && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// CEDI pages\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='[') && ($pos+1<$len) && ($comcode[$pos]=='[') && (!$semiparse_mode) && (addon_installed('cedi')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\[([^\\[\\]]*)\\]\\]#',substr($comcode,$pos,200),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cedi_page_name=$matches[1];\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t$hash_pos=strpos($cedi_page_name,'#');\n\t\t\t\t\t\t\t\t\t\tif ($hash_pos!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$jump_to=substr($cedi_page_name,$hash_pos+1);\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_name=substr($cedi_page_name,0,$hash_pos);\n\t\t\t\t\t\t\t\t\t\t} else $jump_to='';\n\t\t\t\t\t\t\t\t\t\t$cedi_page_url=build_url(array('page'=>'cedi','type'=>'misc','find'=>$cedi_page_name),get_module_zone('cedi'));\n\t\t\t\t\t\t\t\t\t\tif ($jump_to!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_url->attach('#'.$jump_to);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_CEDI_LINK',array('_GUID'=>'ebcd7ba5290c5b2513272a53b4d666e5','URL'=>$cedi_page_url,'TEXT'=>$cedi_page_name)));\n\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Usernames\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='{') && ($pos+1<$len) && ($comcode[$pos]=='{') && (!$in_code_tag) && (!$semiparse_mode))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\{([^\"{}&\\'\\$<>]+)\\}\\}#',substr($comcode,$pos,80),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$username=$matches[1];\n\n\t\t\t\t\t\t\t\t\t\tif ($username[0]=='?')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$username_info=true;\n\t\t\t\t\t\t\t\t\t\t\t$username=substr($username,1);\n\t\t\t\t\t\t\t\t\t\t} else $username_info=false;\n\t\t\t\t\t\t\t\t\t\t$this_member_id=$GLOBALS['FORUM_DRIVER']->get_member_from_username($username);\n\t\t\t\t\t\t\t\t\t\tif ((!is_null($this_member_id)) && (!is_guest($this_member_id)))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\n\t\t\t\t\t\t\t\t\t\t\t$poster_url=$GLOBALS['FORUM_DRIVER']->member_profile_url($this_member_id,false,true);\n\t\t\t\t\t\t\t\t\t\t\tif ((get_forum_type()=='ocf') && ($username_info))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('ocf');\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('ocf_members2');\n\t\t\t\t\t\t\t\t\t\t\t\t$details=ocf_show_member_box($this_member_id);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('HYPERLINK_TOOLTIP',array('_GUID'=>'d8f4f4ac70bd52b3ef9ee74ae9c5e085','TOOLTIP'=>$details,'CAPTION'=>$username,'URL'=>$poster_url,'NEW_WINDOW'=>false)));\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(hyperlink($poster_url,$username));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Shortcut lookahead\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($in_semihtml) && (substr($comcode,$pos-1,3)=='-->')) // To stop shortcut interpretation\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='-->';\n\t\t\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tforeach ($shortcuts as $code=>$replacement)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (($next==$code[0]) && (substr($comcode,$pos-1,strlen($code))==$code))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($code)-1;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($replacement);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($replacement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Table syntax\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($pos<$len) && ($comcode[$pos]=='|'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$end_tbl=strpos($comcode,chr(10).'|}',$pos);\n\t\t\t\t\t\t\t\t\t\tif ($end_tbl!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$end_fst_line_pos=strpos($comcode,chr(10),$pos);\n\t\t\t\t\t\t\t\t\t\t\t$caption=substr($comcode,$pos+2,max($end_fst_line_pos-$pos-2,0));\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($caption)+1;\n\n\t\t\t\t\t\t\t\t\t\t\t$rows=preg_split('#(\\|-|\\|\\})#Um',substr($comcode,$pos,$end_tbl-$pos));\n\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)floats($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$caption=preg_replace('#(^|\\s)floats($|\\s)#','',$caption);\n\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $h=>$row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($h!=0) $tag_output->attach(do_template('BLOCK_SEPARATOR'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$num_cells_in_row=count($cells)/2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inter_padding=3.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_box_width=(100.0-$inter_padding*($num_cells_in_row-1));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Find which to float\n\t\t\t\t\t\t\t\t\t\t\t\t\t$to_float=NULL;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!$spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((strpos($cell,'!')!==false) || (is_null($to_float))) $to_float=$i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do floated one\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_1=(($to_float==1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_2=(($to_float!=1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($num_cells_in_row===1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount='0';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=($to_float===1)?0:(count($cells)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE_START',array('_GUID'=>'ced8c3a142f74296a464b085ba6891c9','WIDTH'=>$width,'FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_START',array('_GUID'=>'90be72fcbb6b9d8a312da0bee5b86cb3','WIDTH'=>array_key_exists($to_float,$ratios)?$ratios[$to_float]:'','FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(isset($cells[$to_float])?rtrim($cells[$to_float]):'',$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cells[$to_float],$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do non-floated ones\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i%2==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i!=$to_float)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE2_START',array('_GUID'=>'9bac42a1b62c5c9a2f758639fcb3bb2f','WIDTH'=>$width,'PADDING_AMOUNT'=>$padding_amount,'FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'')));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_2_START',array('_GUID'=>'0f15f9d5554635ed7ac154c9dc5c72b8','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START',array('SUMMARY'=>preg_replace('#(^|\\s)wide($|\\s)#','',$caption))));\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START_SUMMARY',array('_GUID'=>'0c5674fba61ba14b4b9fa39ea31ff54f','CAPTION'=>$caption)));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $table_row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$table_row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type=(strpos($cell,'!')!==false)?'th':'td';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_mid=comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_CELL',array('_GUID'=>'6640df8b503f65e3d36f595b0acf7600','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','C_TYPE'=>$c_type,'MID'=>$_mid,'PADDING'=>($cell_i==0)?'':'-left','PADDING_AMOUNT'=>(count($cells)==2)?'0':float_to_raw_string(5.0/(floatval(count($cells)-2)/2.0),2))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos=$end_tbl+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Advertising\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$semiparse_mode) && (!$in_code_tag) && (addon_installed('banners')) && (($b_all) || (!has_specific_permission($source_member,'banner_free'))))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Pick up correctly, including permission filtering\n\t\t\t\t\t\t\t\t\tif (is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ADVERTISING_BANNERS=array();\n\n\t\t\t\t\t\t\t\t\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.get_table_prefix().'banners b LEFT JOIN '.get_table_prefix().'banner_types t ON b.b_type=t.id WHERE t_comcode_inline=1 AND '.db_string_not_equal_to('b_title_text',''),NULL,NULL,true);\n\t\t\t\t\t\t\t\t\t\tif (!is_null($rows))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Filter out what we don't have permission for\n\t\t\t\t\t\t\t\t\t\t\tif (get_option('use_banner_permissions',true)=='1')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('permissions');\n\t\t\t\t\t\t\t\t\t\t\t\t$groups=_get_where_clause_groups($source_member);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($groups))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$perhaps=collapse_1d_complexity('category_name',$GLOBALS['SITE_DB']->query('SELECT category_name FROM '.get_table_prefix().'group_category_access WHERE '.db_string_equal_to('module_the_name','banners').' AND ('.$groups.')'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_rows=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (in_array($row['name'],$perhaps)) $new_rows[]=$row;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rows=$new_rows;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$trigger_text=$row['b_title_text'];\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (explode(',',$trigger_text) as $t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (trim($t)!='') $ADVERTISING_BANNERS[trim($t)]=$row;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Apply\n\t\t\t\t\t\t\t\t\tif (!is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($ADVERTISING_BANNERS as $ad_trigger=>$ad_bits)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($ad_trigger[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($ad_trigger)))==strtolower($ad_trigger))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('banners');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ad_text=show_banner($ad_bits['name'],$ad_bits['b_title_text'],get_translated_tempcode($ad_bits['caption']),$ad_bits['img_url'],'',$ad_bits['site_url'],$ad_bits['b_type']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('tooltip',array('param'=>$ad_text,'url'=>(url_is_local($ad_bits['site_url']) && ($ad_bits['site_url']!=''))?(get_custom_base_url().'/'.$ad_bits['site_url']):$ad_bits['site_url']),substr($comcode,$pos-1,strlen($ad_trigger)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($ad_trigger)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Search highlighting lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!is_null($highlight_bits)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($highlight_bits as $highlight_bit)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($highlight_bit[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($highlight_bit)))==strtolower($highlight_bit))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('highlight',array(),escape_html(substr($comcode,$pos-1,strlen($highlight_bit))),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($highlight_bit)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Link lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_semihtml) && ($next=='h') && ((substr($comcode,$pos-1,strlen('http://'))=='http://') || (substr($comcode,$pos-1,strlen('https://'))=='https://') || (substr($comcode,$pos-1,strlen('ftp://'))=='ftp://')))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_9=strpos($comcode,', ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_10=strpos($comcode,'. ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_11=strpos($comcode,\"'\",$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_12=strpos($comcode,'&nbsp;',$pos-1);\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_10!==false) && (($link_end_pos===false) || ($link_end_pos_10<$link_end_pos))) $link_end_pos=$link_end_pos_10;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_11!==false) && (($link_end_pos===false) || ($link_end_pos_11<$link_end_pos))) $link_end_pos=$link_end_pos_11;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_12!==false) && (($link_end_pos===false) || ($link_end_pos_12<$link_end_pos))) $link_end_pos=$link_end_pos_12;\n\t\t\t\t\t\t\t\t\t\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t\t\t\t\t\t\t\t\t\t$auto_link=preg_replace('#(keep|for)_session=[\\d\\w]*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-3)!='://')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-1)=='.')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$auto_link=substr($auto_link,0,strlen($auto_link)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t$link_end_pos--;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode->attach($auto_link);\n\t\t\t\t\t\t\t\t\t\t\tif (!$check_only)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$GLOBALS['SITE_DB']->query_value_null_ok('url_title_cache','t_title',array('t_url'=>$auto_link));\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ((is_null($link_captions_title)) || (substr($link_captions_title,0,1)=='!'))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['COMCODE_PARSE_URLS_CHECKED']++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (($GLOBALS['NO_LINK_TITLES']) || ($GLOBALS['COMCODE_PARSE_URLS_CHECKED']>=MAX_URLS_TO_READ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$downloaded_at_link=http_download_file($auto_link,3000,false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((is_string($downloaded_at_link)) && ($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE']!==NULL) && (strpos($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE'],'html')!==false) && ($GLOBALS['HTTP_MESSAGE']=='200'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#miU',$downloaded_at_link,$matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('character_sets');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=trim(str_replace('&ndash;','-',str_replace('&mdash;','-',@html_entity_decode(convert_to_internal_encoding($matches[1]),ENT_QUOTES,get_charset()))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (((strpos(strtolower($link_captions_title),'login')!==false) || (strpos(strtolower($link_captions_title),'log in')!==false)) && (substr($auto_link,0,strlen(get_base_url()))==get_base_url()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=''; // don't show login screen titles for our own website. Better to see the link verbatim\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['SITE_DB']->query_insert('url_title_cache',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_url'=>substr($auto_link,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_title'=>substr($link_captions_title,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),false,true); // To stop weird race-like conditions\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=mixed();\n\t\t\t\t\t\t\t\t\t\t\t\t$link_handlers=find_all_hooks('systems','comcode_link_handlers');\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (array_keys($link_handlers) as $link_handler)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('hooks/systems/comcode_link_handlers/'.$link_handler);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_handler_ob=object_factory('Hook_comcode_link_handler_'.$link_handler,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($link_handler_ob)) continue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=$link_handler_ob->bind($auto_link,$link_captions_title,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($embed_output)) break;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($embed_output))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$page_link=url_to_pagelink($auto_link,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($link_captions_title=='') $link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($page_link!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('page',array('param'=>$page_link),make_string_tempcode(escape_html($link_captions_title)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('url',array('param'=>$link_captions_title),$auto_link_tempcode,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t$pos+=$link_end_pos-$pos;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($stupidity_mode!='') && ($textual_area))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($stupidity_mode=='leet') && (mt_rand(0,1)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists(strtoupper($next),$LEET_FILTER)) $next=$LEET_FILTER[strtoupper($next)];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telseif (($stupidity_mode=='bork') && (mt_rand(0,60)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$next.='-bork-bork-bork-';\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\tif ((!$in_separate_parse_section) && ((!$in_semihtml) || ((!$comcode_dangerous_html)/*If we don't support HTML and we haven't done the all_semihtml pre-filter at the top*/ && (!$is_all_semihtml)))) // Display char. We try and support entities\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($next=='&')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ahead=substr($comcode,$pos,20);\n\t\t\t\t\t\t\t\t\t\t$ahead_lower=strtolower($ahead);\n\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t$entity=preg_match('#^(\\#)?([\\w]*);#',$ahead_lower,$matches)!=0; // If it is a SAFE entity, use it\n\n\t\t\t\t\t\t\t\t\t\tif (($entity) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (($matches[1]=='') && (($in_semihtml) || (isset($ALLOWED_ENTITIES[$matches[2]]))))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+1;\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t} elseif ((is_numeric($matches[2])) && ($matches[1]=='#'))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matched_entity=intval(base_convert($matches[2],16,10));\n\t\t\t\t\t\t\t\t\t\t\t\tif (($matched_entity<127) && (array_key_exists(chr($matched_entity),$POTENTIAL_JS_NAUGHTY_ARRAY)))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&#'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$continuation.=$next;\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}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\t\t$current_attribute_name='param';\n\t\t\t\t}\n\t\t\t\telseif (trim($next)=='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$next=']';\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($close)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($formatting_allowed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($tag_stack)==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lax)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE',$current_tag),strrpos(substr($comcode,0,$pos),'['),$comcode,$check_only);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$has_it=false;\n\t\t\t\t\t\tforeach (array_reverse($tag_stack) as $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($t[0]==$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$has_it=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\tif (($in_semihtml) && (($current_tag=='html') || ($current_tag=='semihtml'))) // Only search one level for this\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($has_it)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\tif ($_last[0]!=$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$lax)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\n\t\t\t\t\t\t\t\t\tif (count($tag_stack)==0) // Hmm, it was never open. So let's pretend this tag close never happened\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twhile ($_last[0]!=$current_tag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extraneous_semihtml=((!$is_all_semihtml) && (!$in_semihtml)) || (($current_tag!='html') && ($current_tag!='semihtml'));\n\t\t\t\t\t\t\tif ((!$lax) && ($extraneous_semihtml))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do the comcode for this tag\n\t\t\t\t\t\tif ($in_semihtml) // We need to perform some magic to clean up the Comcode sections\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($_last[1] as $index=>$conv)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last[1][$index]=@html_entity_decode(str_replace('<br />',chr(10),$conv),ENT_QUOTES,get_charset());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mindless_mode=$_last[7];\n\n\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$embed_output=$tag_output;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (!$check_only)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\t\t\tif ($structure_sweep)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_structure_sweep=!in_tag_stack($tag_stack,array('title'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$_structure_sweep,$semiparse_mode,$highlight_bits,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\n\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t\t\t\tif (($print_mode) && ($_last[0]=='exp_thumb'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$queued_tempcode->attach($embed_output);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$just_ended=isset($BLOCK_TAGS[$current_tag]);\n\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((strlen($comcode)>$pos+1) && ($comcode[$pos]==chr(10)) && ($comcode[$pos+1]==chr(10))) // Linux newline\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$NUM_LINES+=2;\n\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($current_tag=='html') $in_html=false;\n\t\t\t\t\t\telseif ($current_tag=='semihtml') $in_semihtml=false;\n\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\tif (($close) && ($mindless_mode))\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp_tpl='</kbd>&#8203;';\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($status==CCP_IN_TAG_NAME) $current_tag.=strtolower($next);\n\t\t\t\tbreak;\n\t\t\tcase CCP_STARTING_TAG:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actual occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t}\n\t\t\t\telseif ($next=='/')\n\t\t\t\t{\n\t\t\t\t\t$close=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_tag.=strtolower($next);\n\t\t\t\t\t$status=CCP_IN_TAG_NAME;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTES:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_NAME;\n\t\t\t\t\t$current_attribute_name=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif (($attribute_map==array()) && (!$lax))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($attribute_map!=array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$at_map_keys=array_keys($attribute_map);\n\t\t\t\t\t\t$old_attribute_name=$at_map_keys[count($at_map_keys)-1];\n\t\t\t\t\t\t$attribute_map[$old_attribute_name].=' '.$current_attribute_name;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif ($next!=' ') $current_attribute_name.=strtolower($next);\n\t\t\t\telse $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT;\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_ATTRIBUTE_ERROR',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($next=='[')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($next==']')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE;\n\t\t\t\t\t$current_attribute_value='';\n\t\t\t\t}\n\t\t\t\telseif ($next!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE;\n\t\t\t\t\t$current_attribute_value=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE:\n\t\t\t\tif (($mindless_mode) && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==' ')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE:\n\t\t\t\tif ($mindless_mode) $tag_raw.=($next);\n\n\t\t\t\tif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($next=='\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='\"';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} elseif (substr($comcode,$pos-1,6)=='&quot;')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='&quot;';\n\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($comcode[$pos]=='\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='\\\\';\n\t\t\t\t\t\t\t$current_attribute_value.='\\\\';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t$tag_output->attach($continuation);\n\t$continuation='';\n\n\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t$tag_output->attach($close_list);\n\n\tif (($status!=CCP_NO_MANS_LAND) || (count($tag_stack)!=0))\n\t{\n\t\tif (!$lax)\n\t\t{\n\t\t\t$stack_top=array_pop($tag_stack);\n\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_BROKEN_END',is_null($stack_top)?$current_tag:$stack_top[0]),$pos,$comcode,$check_only);\n\t\t} else\n\t\t{\n\t\t\twhile (count($tag_stack)>0)\n\t\t\t{\n\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t/*if ($_last[0]=='title') Not sure about this\n\t\t\t\t{\n\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t$in_code_tag=false;\n\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t}\n\t\t}\n\t}\n\n//\t$tag_output->left_attach('<div class=\"xhtml_validator_off\">');\n//\t$tag_output->attach('</div>');\n\n\treturn $tag_output;\n}", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}" ]
[ "0.75879073", "0.6836279", "0.6560045", "0.6512015", "0.64986885", "0.648426", "0.64113957", "0.64052916", "0.63962847", "0.6372323", "0.6360447", "0.63493556", "0.63247764", "0.63210285", "0.6313644", "0.62955445", "0.62814236", "0.62360847", "0.62146384", "0.6199648", "0.6186059", "0.6176998", "0.61756575", "0.6168891", "0.6157705", "0.6120818", "0.6068063", "0.60591716", "0.6033305", "0.6016441" ]
0.7344383
1
/ krand rand number param int min param int max param boolean seed 1, 0 return int
function krand($min, $max, $seed = 1){ if(!defined('RAND_SEEDED')){ if($seed == 1){ $seed = (double) microtime() * 1000000; } mt_srand($seed); define('RAND_SEEDED', true); } return mt_rand($min, $max); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rand($min,$max);", "function SM_randomint($max) {\n static $startseed = 0; \n if (!$startseed) {\n $startseed = (double)microtime()*getrandmax(); \n srand($startseed); \n }\n return(rand()%$max); \n}", "function random( $min = 0, $max = 0 ) {\n\tglobal $rnd_value;\n\n\t// Reset $rnd_value after 14 uses\n\t// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value\n\tif ( strlen($rnd_value) < 8 ) {\n\t\tstatic $seed = 'jimmy';\n\t\t$rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );\n\t\t$rnd_value .= sha1($rnd_value);\n\t\t$rnd_value .= sha1($rnd_value . $seed);\n\t\t$seed = md5($seed . $rnd_value);\n\t}\n\n\t// Take the first 8 digits for our value\n\t$value = substr($rnd_value, 0, 8);\n\n\t// Strip the first eight, leaving the remainder for the next call to wp_rand().\n\t$rnd_value = substr($rnd_value, 8);\n\n\t$value = abs(hexdec($value));\n\n\t// Reduce the value to be within the min - max range\n\t// 4294967295 = 0xffffffff = max random number\n\tif ( $max != 0 )\n\t\t$value = $min + (($max - $min + 1) * ($value / (4294967295 + 1)));\n\n\treturn abs(intval($value));\n}", "function psuedo_random_number($min, $max) {\n $bytes = openssl_random_pseudo_bytes(4);\n $int = unpack('l', $bytes);\n return $min + abs($int[1] % ($max-$min+1));\n}", "function dd_generate($min, $max, $int = FALSE) {\n $func = 'rand';\n if (function_exists('mt_rand')) {\n $func = 'mt_rand';\n }\n $number = $func($min, $max);\n if ($int || $number === $min || $number === $max) {\n return $number;\n }\n $decimals = $func(1, pow(10, 5)) / pow(10, 5);\n return round($number + $decimals, 5);\n }", "function random($max) {\r\n\t// create random number between 0 and $max\r\n\tsrand((double)microtime() * 1000000);\r\n\t$r = round(rand(0, $max));\r\n\tif ($r!=0) $r=$r-1;\r\n\treturn $r;\r\n}", "public static function seedRand() {\r\n\t\tsrand((int)((($m=microtime(true))-((int)$m))*pow(10,(int)log10(PHP_INT_MAX)))); \r\n\t}", "function rand_num() {\n\t\t\t\t\n\t\t\t\t$r = rand(1000000, 9999999);\n\t\t\t\treturn $r;\n\t\t\t\n\t\t\t}", "function olc_rand_x($min = null, $max = null) {\n\tstatic $seeded;\n\n\tif (!$seeded) {\n\t\tmt_srand((double)microtime()*1000000);\n\t\t$seeded = true;\n\t}\n\n\tif (isset($min) && isset($max)) {\n\t\tif ($min >= $max) {\n\t\t\treturn $min;\n\t\t} else {\n\t\t\treturn mt_rand($min, $max);\n\t\t}\n\t} else {\n\t\treturn mt_rand();\n\t}\n}", "function tep_rand($min = null, $max = null) {\n static $seeded;\n\n if (!isset($seeded)) {\n mt_srand((double)microtime()*1000000);\n $seeded = true;\n }\n\n if (isset($min) && isset($max)) {\n if ($min >= $max) {\n return $min;\n } else {\n return mt_rand($min, $max);\n }\n } else {\n return mt_rand();\n }\n }", "function rand_option($min,$max,$amount){\r\n\r\n $num = range($min,$max);\r\n shuffle($num);\r\n return array_slice($num,0,$amount);\r\n\r\n}", "public function randomize()\n {\n return mt_rand(1, $this->maxnumber());\n }", "private function generate_random_number($min, $max)\n\t{\n\t\treturn rand($min, $max);\n\t}", "function random_numbers($ms) {\n\t\t\t\t\n\t\t\t\t$n = rand(0, $ms);\n\t\t\t\t\n\t\t\t\treturn $n;\n\t\t\t\t\n\t\t\t}", "function devurandom_rand($min = 0, $max = 0x7FFFFFFF) {\n $diff = $max - $min;\n if ($diff < 0 || $diff > 0x7FFFFFFF) {\n\tthrow new RuntimeException(\"Bad range\");\n }\n $bytes = mcrypt_create_iv(4, MCRYPT_DEV_URANDOM);\n if ($bytes === false || strlen($bytes) != 4) {\n throw new RuntimeException(\"Unable to get 4 bytes\");\n }\n $ary = unpack(\"Nint\", $bytes);\n $val = $ary['int'] & 0x7FFFFFFF; // 32-bit safe \n $fp = (float) $val / 2147483647.0; // convert to [0,1] \n return round($fp * $diff) + $min;\n}", "function tep_rand($min = null, $max = null) {\n static $seeded;\n\n if (!$seeded) {\n mt_srand((double)microtime()*1000000);\n $seeded = true;\n }\n\n if (isset($min) && isset($max)) {\n if ($min >= $max) {\n return $min;\n } else {\n return mt_rand($min, $max);\n }\n } else {\n return mt_rand();\n }\n}", "public function generateRandomNumber(int $min = 1, int $max = 1000): int {\n $seed = mt_rand();\n \n mt_srand($seed);\n \n $randomNumbers = array();\n \n for ($i = 0; $i < 10; $i++) {\n $randomNumbers[] = mt_rand($min, $max);\n }\n \n $selectedNumberIndex = array_rand($randomNumbers);\n\n return $randomNumbers[$selectedNumberIndex];\n }", "function wp_rand($min = \\null, $max = \\null)\n {\n }", "function generate_random_number($start, $end, $flag){\r\n\tglobal $g_var;\r\n\tsrand((double)microtime()*1000000);\r\n\t$random = (rand($start,$end));\r\n\t\r\n\treturn $random;\r\n}", "function random_int($min, $max) {\n\n\t\t$attempts = $bits = $bytes = $mask = $valueShift = 0;\n\n\t\t$range = $max - $min;\n\n\t\tif (!is_int($range)) {\n\n\t\t\t$bytes = PHP_INT_SIZE;\n\t\t\t$mask = ~0;\n\n\t\t} else {\n\n\t\t\twhile ($range > 0) {\n\t\t\t\tif ($bits % 8 === 0) {\n\t\t\t\t ++$bytes;\n\t\t\t\t}\n\t\t\t\t++$bits;\n\t\t\t\t$range >>= 1;\n\t\t\t\t$mask = $mask << 1 | 1;\n\t\t\t}\n\t\t\t$valueShift = $min;\n\n\t\t}\n\n\t\tdo {\n\n\t\t\tif ($attempts > 128) {\n\t\t\t\tthrow new Exception('random_int: RNG is broken - too many rejections');\n\t\t\t}\n\n\t\t\t$randomByteString = random_bytes($bytes);\n\n\t\t\tif ($randomByteString === false) {\n\t\t\t\tthrow new Exception('Random number generator failure');\n\t\t\t}\n\n\t\t\t$val = 0;\n\t\t\tfor ($i = 0; $i < $bytes; ++$i) {\n\t\t\t\t$val |= ord($randomByteString[$i]) << ($i * 8);\n\t\t\t}\n\n\t\t\t$val &= $mask;\n\t\t\t$val += $valueShift;\n\n\t\t\t++$attempts;\n\n\t\t} while (!is_int($val) || $val > $max || $val < $min);\n\n\t\treturn (int) $val;\n\n\t}", "function rand($min = null, $max = null)\n{\n if ($min == null && $max == null) {\n return \\Genesis\\SQLExtension\\Tests\\Context\\SQLHandlerTest::INT_NUMBER;\n }\n\n return \\Genesis\\SQLExtension\\Tests\\Context\\SQLHandlerTest::TINY_INT_NUMBER;\n}", "function randNumber($len=6,$start=false,$end=false) {\n\n mt_srand ((double) microtime() * 1000000);\n $start=(!$len && $start)?$start:str_pad(1,$len,\"0\",STR_PAD_RIGHT);\n $end=(!$len && $end)?$end:str_pad(9,$len,\"9\",STR_PAD_RIGHT);\n \n return mt_rand($start,$end);\n }", "public static function rand($min=0, $max=self::RAND_MAX)\n\t{\n\t\t# Generate random numbers\n\t\tstatic $BUFFER;\n\t\tif (empty($BUFFER))\n\t\t{\n\t\t\t$BUFFER = openssl_random_pseudo_bytes(1024);\n\t\t}\n\t\t\n\t\t# Take 4 bytes and unpack to a signed int\n\t\t$n = unpack('L', substr($BUFFER, 0, 4));\n\t\t# thx to dloser we convert to unsigned on 32 bit arch\n\t\t$n = PHP_INT_SIZE === 4 ? $n[1] + 2147483648 : $n[1]; \n\t\t\n\t\t# Eat from random buffer\n\t\t$BUFFER = substr($BUFFER, 4);\n\t\t\n\t\t# Evenly distributed\n\t\treturn (int) ( $min + ($max-$min+1) * ($n/(self::RAND_MAX+1)) );\n\t}", "function Gen(){\n\t$res=rand(0, 680);\n\tif( $res<50 ){ $n=6; }\n\tif( ($res>=50)&&($res<250) ){ $n=5; }\n\tif( ($res>=250)&&($res<400) ){ $n=4; }\n\tif( ($res>=400)&&($res<500) ){ $n=3; }\n\tif( ($res>=500)&&($res<600) ){ $n=2; }\n\tif($res>=600){ $n=1; }\n\treturn $n;\n}", "function php05($min,$max){\n\t$random = rand($min,$max);\n\treturn $random;\n}", "public function rnum( $min, $max ) {\r\n\t\t$num = 0;\r\n\t\twhile ( $num < $min || $num > $max || null == $num ) {\r\n\t\t\t$num = mt_rand( $min, $max );\r\n\t\t}\r\n\t\treturn $num;\r\n\t}", "function randomGen($min, $max, $quantity) {\n $numbers = range($min, $max);\n shuffle($numbers);\n return array_slice($numbers, 0, $quantity);\n }", "function random(int $min, int $max){\n\treturn \"Random entre \".$min.\" et \".$max;\n}", "function frand($min = 0, $max = 1) {\n\treturn $min + mt_rand() / mt_getrandmax() * ($max - $min);\n}", "public static function getSecureRand($max = 9, $min = 1)\n\t{\n\t\tif (function_exists('random_int')) {\n\t\t\treturn random_int($min, $max);\n\t\t\t\n\t\t} else {\n\t\t\tif (function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t\t$isStrict = true;\n\t\t\t\t$diff = $max - $min;\n\t\t\t\tif ($diff <= 0) return $min;\n\t\t\t\t$range = $diff + 1;\n\t\t\t\t$bits = ceil( log( ($range), 2) );\n\t\t\t\t$bytes = ceil($bits / 8.0);\n\t\t\t\t$bitsMax = 1 << $bits;\n\t\t\t\t$num = 0;\n\t\t\t\tdo {\n\t\t\t\t\t$num = hexdec( bin2hex( openssl_random_pseudo_bytes($bytes) ) ) % $bitsMax;\n\t\t\t\t\tif ($num >= $range) {\n\t\t\t\t\t\tif ($isStrict) continue;\n\t\t\t\t\t\t$num = $num % $range;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} while (true);\n\t\t\t\treturn $num + $min;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\treturn rand($min, $max);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.76461524", "0.744063", "0.7001686", "0.6798131", "0.6765813", "0.6744068", "0.67419934", "0.6723724", "0.67105734", "0.669349", "0.668691", "0.661817", "0.6617897", "0.66038924", "0.65856314", "0.6567721", "0.6562407", "0.65594816", "0.6548884", "0.6545387", "0.65327024", "0.6490891", "0.6488929", "0.6487734", "0.64424837", "0.6422277", "0.64220065", "0.6410703", "0.64046794", "0.6375607" ]
0.8168883
0