query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
/ Function hour () / / Returns current hour / in hh:mm format.
function hour() { return gmdate ("H:i", time() + (3600 * $this->desfase)); }
[ "public static function hour()\n\t{\n\t\treturn date('H');\n\t}", "public function hour() { return 0; }", "public static function getCurrentHour(){\r\n\r\n return (int) (new DateTime())->format('H');\r\n }", "public function hour()\n\t{\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\treturn gmdate('G', $this->ee_date());\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->localize->format_date('%G');\n\t\t}\n\t}", "function get_hour()\n {\n return floor($this->time);\n }", "public function getHour()\n\t{\n\t\treturn date(\"G\", $this->dateTime);\n\t}", "public function getHour()\n {\n return $this->toLocalizedFormatter('H');\n }", "function hour_ed ($hour)\n {\n $hour = $this->ceros ($hour, 4, 0);\n $h = substr ($hour, 0, 2); // hour\n $m = substr ($hour, 2); // Minuto\n if ($h == 24) $h = \"0\";\n return $h.\":\".$m;\n }", "public function get_hour()\n {\n return $this->_hour;\n }", "private function getHourString(): string\n {\n $hour = $this->time->format('H');\n if ($hour == '23') {\n $hour = '00';\n } elseif ($this->time->format('i') > '30') {\n $hour++;\n $hour = str_pad($hour, 2, '0', STR_PAD_LEFT);\n }\n\n return $this->language->getHourString($hour);\n }", "public function getHour()\n {\n return $this->hour;\n }", "function getHour()\n {\n return $this->hour;\n }", "public function getHour()\n {\n return $this->_hour;\n }", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "public function getHour() {\n\t\tif(!is_null($this->hour))\n\t\t{\n\t\t\treturn AddZeros($this->hour);\t\n\t\t} \t\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}", "public function hourPadded() {\n\t\treturn $this->hour(false);\n\t}", "function get_time_hour( $time ) {\n\t\t$time_pieces = explode(\":\", $time);\n\n\t\treturn $time_pieces[0];\n\t}", "public function getStartHour() {return substr($this->startTime, 0, 2);}", "public function get24hrTime()\n\t{\n\t\treturn sprintf(\"%02d:%02d\", $this->hour, $this->minute);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field area_name
public function getAreaName() { return $this->area_name; }
[ "function getAreaName() {\n\t\treturn $this->getData('areaName');\n\t}", "public function getGeoAreaName()\n {\n return $this->geo_area_name;\n }", "function get_area_code()\n {\n return ($this->area_code);\n }", "public function getAreaString(){\n\t \t$this->loadObject('Area');\n\t\t$this->Area->loadObject('ParentArea');\n\t\tif(is_object($this->Area)){\n\t\t\tif(is_object($this->Area->ParentArea)){\n\t\t\t\treturn $this->Area->ParentArea->getAttr('name').' - '.$this->Area->getAttr('name');\n\t\t\t}\n\t\t\treturn $this->Area->getAttr('name');\n\t\t}\n\t\treturn 'NO AREA AVAILABLE'; \n\t }", "public function getAreaShortName()\n {\n return $this->area_short_name;\n }", "public function getAreaCode() {\n return $this->area_code;\n }", "public function getGeoAreaSlug()\n {\n return $this->geo_area_slug;\n }", "public function getArea(): string;", "public function getAreaCode()\n {\n return $this->areacode;\n }", "public function getArea_id(){\n return $this->area_id;\n }", "public function get_area_id() {\n return $this->areaid;\n }", "public function getLocationName()\n {\n if(Yii::$app->language == 'en') {\n return isset($this->location->location) ? $this->location->location : $this->area_id;\n } else{\n return isset($this->location->location_ar) ? $this->location->location_ar : $this->area_id;\n }\n }", "public function getAreaId()\n {\n return $this->area_id;\n }", "public function getAreaIdentifier()\n {\n return $this->areaIdentifier;\n }", "function osc_premium_city_area() {\n return (string) osc_premium_field(\"s_city_area\");\n }", "public function getAreaInfo()\n {\n return $this->area_info;\n }", "public function getAlArea()\n {\n return $this->alArea;\n }", "public function getAreaId()\n {\n\n return $this->area_id;\n }", "public function getAdministrativeAreaName () {\n return $this->_administrativeAreaName;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get email_confirmation status from datbase
public static function getemailConfirmationStatus() { $status = false; $data = Doctrine_Query::create() ->select('p.id,p.email_confirmation') ->from('Signupmaxaccount p') ->where('id=1') ->fetchArray(); if(count($data) > 0) { $status = $data[0]['email_confirmation']; } return $status; }
[ "public function get_email_status() {\r\r\n\r\r\n\t\treturn $this->email_status;\r\r\n\t}", "public function getUser_email_status(){\n return $this->user_email_status;\n }", "public function confirmed($email) {\n\n try {\n\n $dbh = new \\PDO($this->settings['database.dsn'], $this->settings['database.username'], $this->settings['database.password'], $this->settings['database.options']);\n\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n $sql = 'SELECT * FROM ' . $this->settings['table'] . ' WHERE ' . $this->settings['column.email'] . ' = :email AND ' . $this->settings['column.registerKey'] . ' IS NULL';\n\n $sth = $dbh->prepare($sql);\n\n $sth->bindParam(':email', $email);\n\n $sth->execute();\n\n $confirmed = $sth->fetch() === false ? false : true;\n\n $dbh = null;\n\n return $confirmed;\n\n } catch (\\PDOException $e) {\n\n $this->app->error($e);\n\n }\n\n }", "public function getVerifyStatusByEmail($email){\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user_info WHERE email = ?\");\n\n $stmt->bind_param(\"s\", $email);\n\n if ($stmt->execute()) {\n $user = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n\n return $user;\n } else {\n return NULL;\n }\n\t}", "public static function getConfirmed()\n {\n $objects = self::getTable();\n return $objects->select('[deleted=0 and email_confirmed=1]', 'all', null, null, 'timestamp', 'DESC');\n }", "function emailConfirmationStatus($status, $id)\t{\n\n\t\t$sql = \"UPDATE users SET emailConfirmed=? WHERE id=?\";\n\t\t$statement = $this->conn->prepare($sql);\n\n\t\tif (!$statement) {\n\t\t\tthrow new Exception($statement->error);\n\t\t}\n\n\t\t$statement->bind_param(\"ii\", $status, $id);\n\t\t$returnValue = $statement->execute();\n\t\n\t\treturn $returnValue;\n\t}", "public function getEnableOnEmailConfirmation() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_status === null)\n\t\t\t$this->load();\n\t\treturn $this->_status == 'waitForEmail';\t\n\t}", "public function check_activation_status()\n {\n $uid=$this->session->userdata('uid');\n $this->db->select('*');\n $this->db->from('users');\n $this->db->where(array('user_id'=>$uid));\n $query=$this->db->get();\n $user=$query->row();\n if (!empty($user)) {\n $activation_status=$user->activation;\n //proceed to the following 'if branch' if the user's email account has not been verified\n if ($activation_status==0) {\n // set session variable verify_email_message to let the user know to verify the email again.\n $this->session->set_userdata(\n \"verify_email_message\",\n \"<div class='alert alert-danger alert-dismissible fade in'>\n <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>\n Your email hasn't been verified yet. Click <a href='\".site_url().\"/user/send_link'>here</a> to send again.</div>\"\n );\n }\n }\n }", "private function _emailPendingVerification() {\n\t\tif(!check($this->_email)) return;\n\t\t$result = $this->we->queryFetchSingle(\"SELECT * FROM \"._WE_REGISTER_.\" WHERE registration_email = ?\", array($this->_email));\n\t\tif(!is_array($result)) return;\n\t\treturn true;\n\t}", "public function getNewsletterConfirmed () {\n\t$preValue = $this->preGetValue(\"newsletterConfirmed\"); \n\tif($preValue !== null && !Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->newsletterConfirmed;\n\treturn $data;\n}", "public function getEmailForConfirmation();", "function get_tiva_user_email_activation_status()\n{\n global $wpdb, $table_prefix;\n $html = '';\n if (isset($_GET['key']) && isset($_GET['user'])) {\n $table = $table_prefix . 'users';\n $result = $wpdb->update(\n $table,\n array('user_status' => 1,),\n array('ID' => $_GET['user'],\n 'user_activation_key' => $_GET['key']\n ),\n array('%d',)\n );\n if ($result === 1) {\n $html = '<div class=\" alert-box alert alert-success\">\n <strong> تبریک ! </strong><span class=\"msg-box\">حساب کاربری شما فعال شد لطفا وارد شوید</span>\n </div>';\n $tiva_options = get_option('tiva_options');\n if ($tiva_options['send-msg-user']['send_msg_on'] == 'true') {\n global $wpdb;\n $date = new jDateTime(true, true, 'Asia/Tehran');\n $db_prefix = $wpdb->prefix;\n $tiva_msg_table = $db_prefix . 'tiva_msg';\n $tiva_user_msg_table = $db_prefix . 'tiva_user_msg_handel';\n $result = $wpdb->query(\"SELECT MAX(id) FROM {$db_prefix}tiva_msg GROUP BY id\");\n $id = $result + 1;\n $code_g_u = $_GET['user'];\n $status = 'u';\n $msg = $tiva_options['send-msg-user']['msg_text'];\n $msg_url_att = $tiva_options['send-msg-user']['msg_att'];\n $current_date = $date->date('Y-m-d', current_time('timestamp', 1));\n $current_time = $date->date('h:i:s', current_time('timestamp', 1));\n $subject = $tiva_options['send-msg-user']['msg_subject'];\n $admin_id = $tiva_options['send-msg-user']['msg_sender_admin'];\n $msg_data = array(\n 'id' => $id,\n 'code_g_u' => $code_g_u,\n 'status' => $status,\n 'msg' => $msg,\n 'send_at_date' => $current_date,\n 'send_at_time' => $current_time,\n 'subject' => $subject,\n 'admin_id' => $admin_id,\n 'msg_att' => $msg_url_att\n );\n// var_dump($msg_data);\n $result_insert = $wpdb->insert($tiva_msg_table, $msg_data, array('%d', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s'));\n// var_dump($result_insert);\n if ($result_insert == 1) {\n $msg_data_user = array(\n 'id' => $id,\n 'user_id' => $_GET['user'],\n 'read_msg' => 'n'\n );\n $wpdb->insert($tiva_user_msg_table, $msg_data_user);\n }\n }\n } elseif ($result === 0) {\n $html =\n '\n <div class=\" alert-box alert alert-warning\">\n <strong> هشدار ! </strong><span class=\"msg-box\">حساب کاربری شما قبلا فعال شده است لطفا وارد شوید</span>\n </div>\n ';\n } elseif ($result === false) {\n $html =\n '\n <div class=\" alert-box alert alert-error\">\n <strong> خطا ! </strong><span class=\"msg-box\">مشکلی پیش آمده است با مدیر سایت تماس بگیرید</span>\n </div>\n ';\n }\n\n return $html;\n }\n}", "function check_user_activation($uid=0,$email_verification_code='')\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM \".$this->db->dbprefix('user').\" where email_verification_code='\".$email_verification_code.\"' and user_id = '\".$uid.\"' and verify_email = '0'\");\n\t //echo $this->db->last_query();exit;\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t\t$data = array('verify_email'=>'1','status'=>'0');\n\t\t\t$this->db->where('user_id',$uid);\n\t\t\t$this->db->update('user',$data);\n\t\t\treturn 1;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t} \n\t}", "public function get_email_verification()\n {\n $row = $this->db\n ->select('value, token')\n ->from($this->_table_name_email_verification_token)\n ->where('login_id', $this->id)\n ->get()->current();\n return (empty($row)) ? null : $row;\n }", "function check_account_activation($sha1_email)\n\t{\n\t\t$this->db->from('user');\n\t\t$this->db->where( array('STATUS'=>$sha1_email));\n\t\t$query = $this->db->get();\t\n\t\t\n\t\tif($query->num_rows == 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isEmailConfirmed(){\n return !($this->status==-1);\n }", "public static function getStatusByEmail($email)\n {\n static $returns;\n\n if (isset($returns[$email])) {\n return $returns[$email];\n }\n\n $stmt = \"SELECT\n usr_status\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"user\n WHERE\n usr_email='\" . Misc::escapeString($email) . \"'\";\n $res = DB_Helper::getInstance()->getOne($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return '';\n } else {\n $returns[$email] = $res;\n return $res;\n }\n }", "function activateUserEmail(){\n\t\t\n\t\tif(!empty($this->data['Admin']['id'])){\n\t\t\t$existingStatus = $this->User->find('first', array('conditions' => array('User.id' => $this->data['Admin']['id'])));\n\t\t\t$emailstatus = $existingStatus['User']['email_confirmation'];\n\t\t\tif($emailstatus == 1){\n\t\t\t\t$finalStatus = 0;\n\t\t\t}else{\n\t\t\t\t$finalStatus = 1;\n\t\t\t}\n\t\t\t$this->User->id = $this->data['Admin']['id'];\n\t\t\t$data['User']['email_confirmation'] = $finalStatus;\n\t\t\tif($this->User->save($data)){\n\t\t\t\techo $data['User']['email_confirmation']; \n\t\t\t\tdie;\n\t\t\t}\n\t\t}\n\t}", "public function checkEmailBalance()\n {\n return $this->_get('api_v2/check_email_balance/');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add location fields to form if activated
function addLocationToForm(ilPropertyFormGUI $a_form, ilObjUser $a_user) { global $ilCtrl; // check map activation include_once("./Services/Maps/classes/class.ilMapUtil.php"); if (!ilMapUtil::isActivated()) { return; } // Don't really know if this is still necessary... $this->lng->loadLanguageModule("maps"); // Get user settings $latitude = $a_user->getLatitude(); $longitude = $a_user->getLongitude(); $zoom = $a_user->getLocationZoom(); // Get Default settings, when nothing is set if ($latitude == 0 && $longitude == 0 && $zoom == 0) { $def = ilMapUtil::getDefaultSettings(); $latitude = $def["latitude"]; $longitude = $def["longitude"]; $zoom = $def["zoom"]; } $street = $a_user->getStreet(); if (!$street) { $street = $this->lng->txt("street"); } $city = $a_user->getCity(); if (!$city) { $city = $this->lng->txt("city"); } $country = $a_user->getCountry(); if (!$country) { $country = $this->lng->txt("country"); } // location property $loc_prop = new ilLocationInputGUI($this->lng->txt("location"), "location"); $loc_prop->setLatitude($latitude); $loc_prop->setLongitude($longitude); $loc_prop->setZoom($zoom); $loc_prop->setAddress($street.",".$city.",".$country); $a_form->addItem($loc_prop); }
[ "public function addLocationElements()\n {\n $hat = $this->options['auth']->getIdentity()->hat;\n /** @var \\InterpretersOffice\\Entity\\Repository\\LocationRepository $repo*/\n $repo = $this->objectManager->getRepository(Entity\\Location::class);\n\n $options = $repo->getLocationOptionsForHat($hat);\n array_unshift($options, ['label' => ' ','value' => '']);\n $this->add(\n [\n 'type' => 'Laminas\\Form\\Element\\Select',\n 'name' => 'location',\n 'options' => [\n 'label' => 'location',\n 'value_options' => $options,\n ],\n 'attributes' => ['class' => 'custom-select text-muted', 'id' => 'location'],\n ]\n );\n $this->add([\n 'type' => 'textarea',\n 'name' => 'comments',\n 'attributes' => ['id' => 'comments', 'class' => 'form-control',\n 'placeholder' => 'any noteworthy details or special instructions'\n ]\n ]);\n\n return $this;\n }", "function add_location_metaboxes() {\n\t\t\tadd_meta_box( 'wpseo_locations', __( 'Business address details', 'yoast-local-seo' ), array(\n\t\t\t\t&$this,\n\t\t\t\t'metabox_locations',\n\t\t\t), 'wpseo_locations', 'normal', 'high' );\n\t\t}", "public function add()\n {\n $this->title = _('New Location');\n unset($this->headerData);\n $this->attributes = array(\n array(),\n array(),\n );\n $this->templates = array(\n '${field}',\n '${input}',\n );\n $sgbuild = self::getClass('StorageGroupManager')->buildSelectBox();\n $snbuild = self::getClass('StorageNodeManager')->buildSelectBox();\n $fields = array(\n _('Location Name') => sprintf(\n '<input class=\"smaller\" type=\"text\" name=\"name\" />'\n ),\n _('Storage Group') => $sgbuild,\n _('Storage Node') => $snbuild,\n _('Use inits and kernels from this node') => sprintf(\n '<input type=\"checkbox\" name=\"tftp\" value=\"on\"%s/>',\n (\n isset($_REQUEST['tftp']) ?\n ' checked' :\n ''\n )\n ),\n '&nbsp;' => sprintf(\n '<input name=\"add\" class=\"smaller\" type=\"submit\" value=\"%s\"/>',\n _('Add')\n ),\n );\n array_walk($fields, $this->fieldsToData);\n unset($fields);\n self::$HookManager\n ->processEvent(\n 'LOCATION_ADD',\n array(\n 'headerData' => &$this->headerData,\n 'data' => &$this->data,\n 'templates' => &$this->templates,\n 'attributes' => &$this->attributes\n )\n );\n printf('<form method=\"post\" action=\"%s\">', $this->formAction);\n $this->render();\n echo '</form>';\n }", "public function pre_selected_location($form)\n {\n wp_enqueue_script('wdm_location_gravityform_js', plugins_url('assets/js/wdm-sensei-content-drip.js', __FILE__));\n wp_localize_script('wdm_location_gravityform_js', 'location_meta', array('ajax_url'=> admin_url('admin-ajax.php')));\n $user_id = get_current_user_id();\n $default_location = get_user_meta($user_id, 'wdm_location', true);\n if (!$default_location) {\n $args = array(\n 'post_type' => 'shop_order',\n 'posts_per_page' => '1',\n 'meta_query' => array(\n array(\n 'key' => '_customer_user',\n 'value' =>$user_id,\n )\n )\n );\n $postslist = get_posts($args);\n\n foreach ($postslist as $order) {\n $order = new WC_Order($order->ID);\n $items = $order->get_items();\n foreach ($items as $item) {\n if (isset($item['Which location would you like to train?']) && !empty($item['Which location would you like to train?'])) {\n $default_location = $item['Which location would you like to train?'];\n break 2;\n }\n }\n }\n }\n\n foreach ($form['fields'] as $field) {\n if ($field['type'] != 'select') {\n continue;\n }\n $test_field = array();\n foreach ($field['choices'] as $location) {\n $location['isSelected'] = 0;\n if (isset($default_location) && $location['value'] == $default_location) {\n $location['isSelected'] = 1;\n }\n array_push($test_field, $location);\n }\n $form['fields'][0]['choices'] = $test_field;\n }\n return $form;\n }", "public function add()\n {\n if ($this->access->hasWriteAccess()) {\n $this->ctrl->saveParameter($this, self::IDENTIFIER);\n $xlcdLocationFormGUI = new xlcdLocationFormGUI($this, new xlcdLocation());\n $this->tpl->setContent($xlcdLocationFormGUI->getHTML());\n }\n }", "function createString_LocationInfoForm($sl_value, $locID, $addform=false) {\n if (!$this->setParent()) { return; }\n $this->addingLocation = $addform;\n\n // TODO: currentLocation can be replaced with the plugin.currentLocation object\n // make sure to transfer the filter down to the plugin setup first.\n //\n $this->currentLocation = apply_filters('slp_edit_location_data',$sl_value);\n $this->plugin->currentLocation->set_PropertiesViaArray($this->currentLocation);\n $this->idString =\n $this->plugin->currentLocation->id .\n (!empty($this->plugin->currentLocation->linked_postid)?\n ' - '. $this->plugin->currentLocation->linked_postid :\n ''\n );\n if (\n is_numeric($this->plugin->currentLocation->latitude) &&\n is_numeric($this->plugin->currentLocation->longitude)\n ) {\n $this->idString .= __(' at ').$this->plugin->currentLocation->latitude.','.$this->plugin->currentLocation->longitude;\n }\n\n // Hook in our filters that generate the form.\n //\n add_filter('slp_edit_location_left_column' ,array($this,'filter_EditLocationLeft_Address') , 5);\n add_filter('slp_edit_location_left_column' ,array($this,'filter_EditLocationLeft_Submit') ,99);\n add_filter('slp_edit_location_right_column' ,array($this,'filter_EditLocationRight_Address') , 5);\n\n // Create the form.\n //\n // FILTER: slp_add_location_form_footer\n // FILTER: slp_edit_location_left_column\n // FILTER: slp_edit_location_right_column\n //\n $content =\n \"<form id='manualAddForm' name='manualAddForm' method='post' enctype='multipart/form-data'>\" .\n \"<input type='hidden' name='locationID' \" .\n \"id='locationID' value='{$this->plugin->currentLocation->id}' />\" .\n \"<input type='hidden' name='linked_postid-{$this->plugin->currentLocation->id}' \" .\n \"id='linked_postid-{$this->plugin->currentLocation->id}' value='\" .\n $this->plugin->currentLocation->linked_postid .\n \"' />\" .\n \"<a name='a{$this->plugin->currentLocation->id}'></a>\" .\n \"<table cellpadding='0' class='slp_locationinfoform_table'>\" .\n \"<tr>\" .\n\n // Left Cell\n \"<td id='slp_manual_update_table_left_cell' valign='top'>\" .\n \"<div id='slp_edit_left_column' class='add_location_form'>\" .\n apply_filters('slp_edit_location_left_column','') .\n '</div>' .\n '</td>' .\n\n // Right Cell\n \"<td id='slp_manual_update_table_right_cell' valign='top'>\" .\n \"<div id='slp_edit_right_column' class='add_location_form'>\" .\n apply_filters('slp_edit_location_right_column','') .\n '</div>' .\n '</td>' .\n '</tr></table>' .\n ($this->addingLocation?apply_filters('slp_add_location_form_footer', ''):'') .\n '</form>'\n ;\n\n // FILTER: slp_locationinfoform\n //\n return apply_filters('slp_locationinfoform',$content);\n }", "function renderPage_AddLocations() {\n $this->initialize_variables();\n\n print \"<div class='wrap'>\n <div id='icon-add-locations' class='icon32'><br/></div>\n <h2>Store Locator Plus - \".\n __('Add Locations', 'csa-slplus').\n \"</h2>\" .\n $this->parent->AdminUI->create_Navbar()\n ;\n\n //Inserting addresses by manual input\n //\n $locationData = array();\n if ( isset($_POST['store-']) && $_POST['store-']) {\n foreach ($_POST as $key=>$sl_value) {\n if (preg_match('#\\-$#', $key)) {\n $fieldName='sl_'.preg_replace('#\\-$#','',$key);\n $locationData[$fieldName]=stripslashes($this->slp_escape($sl_value));\n }\n }\n $resultOfAdd = $this->plugin->AdminUI->add_this_addy($locationData);\n print \"<div class='updated fade'>\".\n $_POST['store-'] .\" \" .\n __(\"Added Successfully\",'csa-slplus') . '.</div>';\n\n /** Bulk Upload\n **/\n } elseif ( \n isset($_FILES['csvfile']['name']) &&\n ($_FILES['csvfile']['name']!='') &&\n ($_FILES['csvfile']['size'] > 0)\n ) {\n do_action('slp_addlocations_with_csv');\n }\n\n $this->addingLocation = true;\n print \n '<div id=\"location_table_wrapper\">'.\n \"<table id='manage_locations_table' class='slplus wp-list-table widefat fixed posts' cellspacing=0>\" .\n '<tr><td class=\"slp_locationinfoform_cell\">' .\n $this->plugin->AdminUI->createString_LocationInfoForm(array(),'', true) .\n '</td></tr>' .\n '</table>' .\n '</div>'\n ;\n }", "function add_location_and_tag_fields($input, $field, $value, $lead_id, $form_id) {\n \n $field_css_class = $field['cssClass'];\n $input_name_id = $field['id'];\n $location = \t\t'gp_google_geo_location';\n $latitude = \t\t'gp_google_geo_latitude';\n $longitude = \t\t'gp_google_geo_longitude';\n $country = \t\t\t'gp_google_geo_country';\n $admin_lvl_one = \t'gp_google_geo_administrative_area_level_1';\n $admin_lvl_two = \t'gp_google_geo_administrative_area_level_2';\n $admin_lvl_three = \t'gp_google_geo_administrative_area_level_3';\n $locality = \t\t'gp_google_geo_locality';\n $locality_slug = \t'gp_google_geo_locality_slug';\n $user_tags = 'gp_user_tags';\n $notification_set = 'notification_setting';\n $weekly_email = 'weekly_email';\n $monthly_email = 'monthly_email';\n $type = 'type=\"hidden\"';\n $read_only = \t\t'readonly=\"readonly\"'; \n \n # Check css class name for match with location class names above and define id on match\n switch ($field_css_class) {\n case $location:\n $type = 'type=\"text\"';\n $read_only = '';\n $input_id = $location;\n break;\n case $latitude:\n $input_id = $latitude;\n break;\n case $longitude:\n $input_id = $longitude;\n break;\n case $country:\n $input_id = $country;\n break;\n case $admin_lvl_one:\n $input_id = $admin_lvl_one;\n break;\n case $admin_lvl_two:\n $input_id = $admin_lvl_two;\n break;\n case $admin_lvl_three:\n $input_id = $admin_lvl_three;\n break;\n case $locality:\n $input_id = $locality;\n break;\n case $locality_slug:\n $input_id = $locality_slug;\n break;\n case $user_tags:\n $type = 'type=\"text\"'; \n $read_only = '';\n $input_id = $user_tags;\n break;\n case $notification_set:\n $type = 'type=\"radio\"';\n $read_only = '';\n $input_id = $notification_set;\n break;\n }\n\n switch ($type) {\n case 'type=\"radio\"':\n $input = (isset($input_id)) ? get_correct_radio_buttons($input_name_id, $input_id, $type, $read_only) : '';\n break;\n default:\n $input = (isset($input_id)) ? get_correct_input_field($input_name_id, $input_id, $type, $read_only) : '';\n }\n \n return $input;\n}", "function wf_crm_location_fields() {\n return array('address', 'email', 'phone', 'website', 'im');\n}", "public function add_location_metaboxes() {\n\t\t\t$post_type = PostType::get_instance()->get_post_type();\n\t\t\tadd_meta_box(\n\t\t\t\t$post_type,\n\t\t\t\t__( 'Yoast Local SEO', 'yoast-local-seo' ),\n\t\t\t\t[ $this, 'metabox_locations' ],\n\t\t\t\t$post_type,\n\t\t\t\t'normal',\n\t\t\t\t'high'\n\t\t\t);\n\t\t}", "public function add_product_location_field() {\n\t\t$args = array(\n\t\t\t'id' => '_product_location',\n\t\t\t'label' => __( 'Product Location', 'wc-product-location' ),\n\t\t\t'class' => 'select short',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Select the Location where this product is available', 'wc-product-location' ),\n\t\t\t// 'options' => array(\n\t\t\t// \t'FL' => __( 'Florida', 'wc-product-location' ),\n\t\t\t// \t'LA' => __( 'Louisiana', 'wc-product-location' ),\n\t\t\t// ),\n\t\t\t// 'options' => WC()->countries->get_countries(),\n\t\t\t'options' => WC()->countries->get_states( 'US' ),\n\t\t);\n\n\t\twoocommerce_wp_select( $args );\n\t}", "public function edit()\n {\n //It cannot retrieve an id for the location so it wants to create a new one. (is_new) {SOLVED}\n if ($this->access->hasWriteAccess()) {\n $xlcdLocationFormGUI = new xlcdLocationFormGUI($this, xlcdLocation::find($_GET[self::IDENTIFIER]));\n $xlcdLocationFormGUI->fillForm();\n $this->tpl->setContent($xlcdLocationFormGUI->getHTML());\n } else {\n $this->ctrl->redirect(ilMyTableGUI::class);\n }\n }", "function includeMapForm() {\r\n $this->pi_initPIflexForm();\r\n $map_search = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'map_search', 'options');\r\n $map_search_anchor = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'map_search_anchor', 'options');\r\n \r\n if ($map_search == 1) {\r\n return \"map.addControl(new google.maps.LocalSearch(), new GControlPosition(\".$map_search_anchor.\", new GSize(10,20)));\"; \r\n }\r\n \r\n else {\r\n \r\n }\r\n}", "public function add_location()\r\n {\r\n if (!$this->session->userdata('is_admin'))\r\n {\r\n // No access if not admin.\r\n redirect('/not_admin');\r\n }\r\n \r\n $this->data['page_body'] = 'locations/add_location';\r\n $this->render();\r\n }", "function hrb_get_project_form_location_fields() {\n\n\t// main location fields / meta keys\n\t$fields = array(\n\t\t'location'\t=> '_hrb_location',\n\t\t'location_type'\t=> '_hrb_location_type'\n\t);\n\n\t// other location fields / meta keys\n\tforeach ( hrb_get_geocomplete_attributes() as $location_att ) {\n\t\t$meta_key = \"_hrb_location_{$location_att}\";\n\t\t$fields[ $meta_key ] = $meta_key;\n\t}\n\n\treturn $fields;\n}", "public function register_company_location_field() {\n // add field in \"front-end\"\n function frontend_company_location_field( $fields ) {\n $fields['company']['company_location'] = array(\n 'label' => esc_html__( 'Location', 'wp-job-manager-company-profiles' ),\n 'type' => 'text',\n 'required' => false,\n 'placeholder' => esc_html__( 'e.g. Paris', 'wp-job-manager-company-profiles' ),\n 'priority' => 4\n );\n return $fields;\n }\n add_filter( 'submit_job_form_fields', 'frontend_company_location_field' );\n\n // add field in \"back-end\"\n function admin_company_location_field( $fields ) {\n $fields['_company_location'] = array(\n 'label' => esc_html__( 'Company Location', 'wp-job-manager-company-profiles' ),\n 'type' => 'text',\n 'required' => false,\n 'placeholder' => esc_html__( 'e.g. Paris', 'wp-job-manager-company-profiles' ),\n 'description' => ''\n );\n return $fields;\n }\n add_filter( 'job_manager_job_listing_data_fields', 'admin_company_location_field' );\n\t}", "public function multiple_locations_settings() {\n\t\t\tWPSEO_Local_Admin_Page::section_before( 'multiple-locations-settings', 'clear: both; ' . ( wpseo_has_multiple_locations() ? '' : 'display: none;' ) );\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_slug', __( 'Locations slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location pages. Default slug is <code>locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . get_post_type_archive_link( 'wpseo_locations' ) . '\" target=\"_blank\">' . __( 'View them all', 'yoast-local-seo' ) . '</a> ' . __( 'or', 'yoast-local-seo' ) . ' <a href=\"' . admin_url( 'edit.php?post_type=wpseo_locations' ) . '\">' . __( 'edit them', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_singular', __( 'Locations label singular', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The singular label for your location pages. Default label is <code>Location</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_label_plural', __( 'Locations label plural', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The plural label for your location pages. Default label is <code>Locations</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Wrappers::textinput( 'locations_taxo_slug', __( 'Locations category slug', 'yoast-local-seo' ) );\n\t\t\techo '<p class=\"desc label\" style=\"border: 0; margin-bottom: 0; padding-bottom: 0;\">' . __( 'The slug for your location categories. Default slug is <code>locations-category</code>.', 'yoast-local-seo' ) . '<br>';\n\t\t\tif ( wpseo_has_multiple_locations() ) {\n\t\t\t\techo '<a href=\"' . admin_url( 'edit-tags.php?taxonomy=wpseo_locations_category&post_type=wpseo_locations' ) . '\">' . __( 'Edit the categories', 'yoast-local-seo' ) . '</a>';\n\t\t\t}\n\t\t\techo '</p>';\n\t\t\tWPSEO_Local_Admin_Page::section_after();\n\t\t}", "function commerce_pos_location_float_form($form, &$form_state, $location_id = 0) {\n $form['#location_id'] = $location_id;\n\n $form['amount'] = array(\n '#type' => 'textfield',\n '#title' => t('Amount'),\n '#required' => TRUE,\n '#size' => 10\n );\n\n $form['actions'] = array(\n '#type' => 'actions',\n );\n\n $form['actions']['save'] = array(\n '#type' => 'submit',\n '#value' => t('Continue')\n );\n\n // Add module CSS.\n $form['#attached']['css'][] = drupal_get_path('module', 'commerce_pos') . '/css/commerce_pos_style.css';\n\n return $form;\n}", "public function buildForm()\n {\n $this\n ->addCollection('recipient_region', 'Activity\\RecipientRegion', 'recipient_region')\n ->addAddMoreButton('add_recipient_region', 'recipient_region');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Using DOMDocument, parse the content and add anchors to headers (H1H6)
public static function add_the_anchor_links( $content ) { if ( ! is_singular( array( 'commands', 'handbook', 'post' ) ) || '' == $content ) { return $content; } $anchors = array(); $doc = new \DOMDocument(); // START LibXML error management. // Modify state $libxml_previous_state = libxml_use_internal_errors( true ); $doc->loadHTML( mb_convert_encoding( $content, 'HTML-ENTITIES', 'UTF-8' ) ); // handle errors libxml_clear_errors(); // restore libxml_use_internal_errors( $libxml_previous_state ); // END LibXML error management. foreach ( array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ) as $h ) { $headings = $doc->getElementsByTagName( $h ); foreach ( $headings as $heading ) { $a = $doc->createElement( 'a' ); $newnode = $heading->appendChild( $a ); $newnode->setAttribute( 'class', 'anchorlink dashicons-before' ); // @codingStandardsIgnoreStart // $heading->nodeValue is from an external libray. Ignore the standard check sinice it doesn't fit the WordPress-Core standard $node_value = preg_replace( "/[^A-Za-z0-9\- ]/", '', $heading->nodeValue ); $slug = $tmpslug = sanitize_title( $node_value ); // @codingStandardsIgnoreEnd $i = 2; while ( false !== in_array( $slug, $anchors ) ) { $slug = sprintf( '%s-%d', $tmpslug, $i ++ ); } $anchors[] = $slug; $heading->setAttribute( 'id', $slug ); $newnode->setAttribute( 'href', '#' . $slug ); } } return $doc->saveHTML(); }
[ "private function addAnchors() {\n\t\t// Ignore <h1> as it is the title of the page\n\t\t$headings = $this->pageDOM->find('h2, h3, h4, h5, h6');\n\t\t$htexts = array();\n\n\t\tfor($h = 0, $hs = count($headings); $h < $hs; $h++) {\n\t\t\t$anchor = Utils::urlencode($headings[$h]->plaintext);\n\t\t\t$htexts[$h] = $headings[$h]->tag . ':' . $headings[$h]->plaintext;\n\t\t\t$headings[$h]->id = $anchor;\n\t\t\t$headings[$h]->innertext = $headings[$h]->plaintext.'<a class=\"permalink\" href=\"#'.$anchor.'\" title=\"Permalink to this section\">§</a>';\n\t\t}\n\t\treturn $headings;\n\t}", "public function create_content_anchors() {\r\n\r\n\t\t$this->increment = 0;\r\n\r\n\t\tforeach( $this->headings as $heading ) {\r\n\r\n\t\t\t$pattern = '/<' . $heading . '[^>]*>(.*?)<\\/' . $heading . '>/i';\r\n\t\t\r\n\t\t\t$this->content = preg_replace_callback( $pattern, array( &$this, 'get_section_headings' ), $this->content );\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "function addAnchors(&$page_dom) {\n\t// Ignore <h1> as it is the title of the page\n\t$headings = $page_dom->find('h2, h3, h4, h5, h6');\n\t$htexts = array();\n\t\n\tfor($h = 0, $hs = count($headings); $h < $hs; $h++) {\n\t\t$anchor = anchorencode($headings[$h]->plaintext);\n\t\t$htexts[$h] = $headings[$h]->tag . ':' . $headings[$h]->plaintext;\n\t\t$headings[$h]->id = $anchor;\n\t\t$headings[$h]->innertext = $headings[$h]->plaintext.' <a class=\"permalink\" href=\"#'.$anchor.'\" title=\"Permalink to this section\">§</a>';\n\t}\n\treturn $headings;\n}", "function hashed_heading($content) {\n\n\t\t$content .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />';\n\n\t\t$dom = new DOMDocument('1.0', 'UTF-8');\n\t\t@$dom->loadHTML($content);\n\n\t\t$tags = array('h1','h2','h3','h4','h5','h6');\n\n\t\tforeach($tags as $tag) {\n\n\t\t\t$elements = $dom->getElementsByTagname($tag);\n\n\t\t\tif($elements) {\n\n\t\t\t\tforeach($elements as $el) {\n\n\t\t\t\t\tif($el->getElementsByTagname('a')->length)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t$name = $el->nodeValue;\n\n\t\t\t\t\t$el->setAttribute('id', base64_encode($name));\n\t\t\t\t\t$el->setAttribute('class', 'summary-item');\n\t\t\t\t\t$link = $dom->createElement('a');\n\t\t\t\t\t$link->setAttribute('href', '#' . base64_encode($name));\n\t\t\t\t\t$link->setAttribute(\"title\", $name);\n\t\t\t\t\t//$link->nodeValue = htmlspecialchars($name);\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Enable link for now\n\t\t\t\t\t *\n\t\t\t\t\t$link = $dom->createElement('span');\n\t\t\t\t\t$link->setAttribute('data-href', '#' . sanitize_title($name));\n\t\t\t\t\t$link->nodeValue = $name;\n\t\t\t\t\t*/\n\n\t\t\t\t\t$el->nodeValue = htmlspecialchars($name);\n\t\t\t\t\t$el->appendChild($link);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t$content = $dom->saveHTML();\n\n\t\treturn $content;\n\n\t}", "protected function padHeadings($content) {\n\t\t$content = phpQuery::newDocumentHTML($content);\n\t\t$headers = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6');\n\t\tforeach ($headers as $header) {\n\t\t\tforeach ($content->find($header) as $h) {\n\t\t\t\t$h = pq($h);\n\t\t\t\t$h_text = $h->text();\n\t\t\t\tif (preg_match('/[0-9][0-9.]*/', $h_text, $matches) > 0) {\n\t\t\t\t\t$h_original = $matches[0];\n\t\t\t\t\t$h_split = explode('.', $h_original);\n\t\t\t\t\tforeach ($h_split as $key => $item) {\n\t\t\t\t\t\tif ((int) $item < 10 && (int) $item[0] != 0) {\n\t\t\t\t\t\t\t$h_split[$key] = '0' . $item;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$h_new = implode('.', $h_split);\n\t\t\t\t\t$h_text = str_replace($h_original, $h_new, $h_text);\n\t\t\t\t\t$h->text($h_text);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content->html();\n\t}", "public function tocify($content, $options = [])\n {\n // Change regex, i.e. allow headers in (block-)quotes being parsed\n $regex = str_replace('blockquote|q|cite|', '', $this->regex['html']);\n\n $counter = [];\n $content = preg_replace_callback($regex,\n function($match) use ($options, &$counter) {\n $tag = strtolower($match['tag']);\n $text = trim($match['text']);\n\n // Don't consider headings in code or pre environments\n if (($tag{0} !== 'h') || (mb_strlen($text) == 0)) {\n // Ignore empty headers, too\n return $match[0];\n }\n\n // Extract informations from HTML tags\n $level = $indent = (int) mb_substr($tag, 1);\n\n // Expand tag attributes\n $attributes = $this->parseAttributes($match['attr']);\n $id = isset($attributes['id']) ? $attributes['id'] : $this->hyphenize($text);\n\n // Replace empty id with hash of text\n if (strlen($id) == 0) {\n $id = substr(md5($text), 0, 6);\n }\n\n // Increment counter on same heading names\n if (isset($counter[$id])) {\n $id = $id.'-'.$counter[$id]++;\n } else {\n $counter[$id] = 1;\n }\n\n // Add permalink\n if ($options->get('permalink')) {\n // Compile custom configurations for header link\n $extra = ' ';\n if ('left' !== ($placement = $options->get('placement', ' '))) {\n $extra .= 'headeranchor-link-' . $placement . ' ';\n }\n if ('hover' !== ($visible = $options->get('visible', ' '))) {\n $extra .= 'headeranchor-visible-' . $visible . ' ';\n }\n $extra .= ltrim(implode(' ', [\n $options->get('hover', ''),\n implode(' ', $options->get('class', []))])\n );\n\n // Load header anchor link icon\n $icon = $options->get('icon', '#');\n\n $text = sprintf('<a class=\"headeranchor-link%4$s\" aria-hidden=\"true\" href=\"#%s\" name=\"%1$s\" title=\"Permanent link: %2$s\" data-icon=\"%5$s\">%3$s</a>',\n $id, strip_tags($text), $text, rtrim($extra), $icon);\n }\n\n // Add id attribute if permalinks or anchorlinks are used\n $link = $options->get('anchorlink', $options->get('permalink'));\n $attributes += $link ? ['id' => $id] : [];\n\n // Prevent TOC and MINITOC insertion in headings\n $text = str_ireplace(['[TOC]', '[MINITOC]'],\n ['&#91;TOC&#93;', '&#91;MINITOC&#93;'], $text);\n\n // Stringify HTML attributes\n $attributes = $this->htmlAttributes($attributes);\n\n // Return tag with its text content\n return \"<$tag$attributes>$text</$tag>\";\n }, $content);\n\n return $content;\n }", "private function updateHeadings() {\n\t\t// Match all headings\n\t\t$regex = '~<h[1-6]>.*<\\/h[1-6]>~im';\n\t\t$this->html = preg_replace($regex, \"\\n\\n$0\",\n\t\t\t$this->html);\n\n\t\t// No space after the tag (match '<h2>\tTEXT'\n\t\t// and replace by '<h2>TEXT')\n\t\t$regex = '~(<h[1-6^>]+>)(\\s*)~im';\n\t\t$this->html = preg_replace($regex, \"$1\",\n\t\t\t$this->html);\n\n\t\t// No space after the text (match '<h2>TEXT\t</h2>'\n\t\t// and replace by '<h2>TEXT</h2>')\n\t\t$regex = '~(<h[1-6^>]+>)(.*)(\\s*)(</h[1-6^>]+>)~im';\n\t\tif (preg_match_all($regex, $this->html, $matches)) {\n\t\t\t$j = count($matches);\n\n\t\t\tfor ($i=0; $i<$j; $i++) {\n\t\t\t\t// Remove end-of-line and other spaces\n\t\t\t\tif (isset($matches[1][$i])) {\n\t\t\t\t\t$start_tag = trim($matches[1][$i]);\n\t\t\t\t\t$content = trim($matches[2][$i]);\n\t\t\t\t\t$end_tag = $matches[4][$i];\n\t\t\t\t\t$this->html = str_replace($matches[0][$i],\n\t\t\t\t\t\t$start_tag.$content.$end_tag, $this->html);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "function add_id_to_headings( $content )\n {\n if (strlen($content) <= 0) {\n return;\n }\n\n $content = HtmlDomParser::str_get_html($content);\n\n foreach ($content->find('h2, h3, h4') as $element) {\n $slug = sanitize_title($element->innertext);\n $element->id = $slug;\n }\n\n return $content;\n }", "function add_ids_to_headings( $content ) {\n\n\tif ( !is_main_query() || !has_block( 'core/heading' ) ) { return $content; }\n\n\t$pattern = '#(?P<full_tag><(?P<tag_name>h\\d)(?P<tag_atts>[^>]*)>(?P<tag_contents>.*)<\\/h\\d>)#i';\n\n if ( preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ) ) {\n\n $find\t\t\t= array();\n $replace\t= array();\n\n foreach( $matches as $match ) {\n\n if ( strlen( $match[ 'tag_atts' ] ) && false !== stripos( $match[ 'tag_atts' ], 'id=' ) ) {\n\t\t\t\tcontinue;\n }\n\n $find[] = $match[ 'full_tag' ];\n $id = sanitize_title( $match[ 'tag_contents' ] );\n $id_attr = sprintf( ' id=\"%s\"', $id );\n $replace[] = sprintf(\n\t\t\t\t'<%1$s%2$s%3$s>%4$s</%1$s>',\n\t\t\t\t$match[ 'tag_name' ],\n\t\t\t\t$match[ 'tag_atts' ],\n\t\t\t\t$id_attr,\n\t\t\t\t$match[ 'tag_contents' ]\n\t\t\t);\n\n }\n\n $modified_content = str_replace( $find, $replace, $content );\n\n }\n\n\treturn $modified_content;\n\n}", "function smash_filter_the_content_add_ids_to_headlines( $content ) {\n\n\tif ( ! is_single() ) {\n\t\treturn $content;\n\t}\n\n\t$pattern = '#(?P<full_tag><(?P<tag_name>h\\d)(?P<tag_extra>[^>]*)>(?P<tag_contents>.*)<\\/h\\d>)#i';\n\t$has_matched = preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER );\n\n\tif ( $has_matched ) {\n\n\t\t/**\n\t\t * %1$s = TAG\n\t\t * %2$s = additional classes/ids\n\t\t * %3$s = custom ID\n\t\t * %4$s = innerHTML\n\t\t * %5$s = escaped and sanitized innerHTML for aria-label=\"\"\n\t\t */\n\t\t$template = '<%1$s %2$s id=\"%3$s\">';\n\t\t$template .= '%4$s';\n\t\t$template .= ' <a href=\"#%3$s\" aria-label=\"' . __(\n\t\t\t\t'Link to section', 'smashing'\n\t\t\t) . ' \\'%5$s\\'\" class=\"sr hsl\">';\n\t\t$template .= __( 'Link', 'smashing' );\n\t\t$template .= '</a>';\n\t\t$template .= '</%1$s>';\n\n\t\t$search = array();\n\t\t$replace = array();\n\t\tforeach ( $matches as $match ) {\n\t\t\tif ( strlen( $match[ 'tag_extra' ] ) && stripos( $match[ 'tag_extra' ], 'id=' ) !== FALSE ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$search[] = $match[ 'full_tag' ];\n\t\t\t$id = wp_strip_all_tags( $match[ 'tag_contents' ] );\n\t\t\t$id = sanitize_title( $id );\n\t\t\t$replace[] = sprintf(\n\t\t\t\t$template,\n\t\t\t\t$match[ 'tag_name' ],\n\t\t\t\t$match[ 'tag_extra' ],\n\t\t\t\t$id,\n\t\t\t\t$match[ 'tag_contents' ],\n\t\t\t\tesc_attr( wp_strip_all_tags( $match[ 'tag_contents' ] ) )\n\t\t\t);\n\t\t}\n\t\t$content = str_replace( $search, $replace, $content );\n\t}\n\n\treturn $content;\n}", "function auto_id_headings($content) {\n $content = preg_replace_callback( '/(\\<h[1-6](.*?))\\>(.*)(<\\/h[1-6]>)/i', function($matches) {\n if ( ! stripos( $matches[0], 'id=' ) ) :\n $matches[0] = $matches[1] . $matches[2] . ' id=\"' . sanitize_title( $matches[3] ) . '\">' . $matches[3] . $matches[4];\n endif;\n return $matches[0];\n }, $content );\n\n return $content;\n }", "function auto_id_headings( $content ) {\n\n\t$content = preg_replace_callback( '/(\\<h[1-6](.*?))\\>(.*)(<\\/h[1-6]>)/i', function( $matches ) {\n\t\tif ( ! stripos( $matches[0], 'id=' ) ) :\n\t\t\t$matches[0] = $matches[1] . $matches[2] . ' id=\"' . sanitize_title( $matches[3] ) . '\">' . $matches[3] . $matches[4];\n\t\tendif;\n\t\treturn $matches[0];\n\t}, $content );\n\n return $content;\n\n}", "public function getHeadingLinks($html) {\n $dom = new \\DOMDocument();\n\n // Load HTML but suppress warnings.\n $libxml_previous_state = libxml_use_internal_errors(TRUE);\n $dom->loadHTML($html);\n libxml_clear_errors();\n libxml_use_internal_errors($libxml_previous_state);\n\n $finder = new \\DomXPath($dom);\n $elements = $finder->query(\"//h2\");\n $links = [];\n foreach ($elements as $el) {\n if ($el->hasAttribute('id')) {\n $links[] = [\n 'title' => $el->textContent,\n 'url' => '#' . $el->getAttribute('id'),\n ];\n }\n }\n return $links;\n }", "function _doAutoSections($text, $heading)\n\t{\n\t\t/*\n\t\t * Attributes\n\t\t */ \n\t\t$attr = '\n\t\t\t(?:[ ]+\\{\n\t\t\t\t(\n\t\t\t\t\t(div|aside)? \t\t\t#Get tag, default is section\n\t\t\t\t\t(\\#[-_:a-zA-Z0-9]+)? \t#Get id\n\t\t\t\t\t((\\.[-_:a-zA-Z0-9]+)+)? #Get Classes\n\t\t\t)\\})? \n\t\t';\n\t\t\n\t\t/*\n\t\t * Define Open And close tags\n\t\t */\n\t\t$h2 = array(\n\t\t\t'open' => '\n\t\t\t\t(^(.+?)'.$attr.'[ ]*\\n(-+)[ ]*\\n)\t# h2 dashed, \n\t\t\t\t|\t\t\t\t\t\t\t\t\t# or\n\t\t\t\t(^\\#{2}[ ]*(.+?)[ ]*\\#*'.$attr.'\\n)\t# h2 whith number sign\n\t\t\t',\n\n\t\t\t'close' => '\n\t\t\t\t(^(.+?)[ ]*\\n(-+)[ ]*\\n+)\t\t\t# h2 dashed, only start to avoid been swallowed\n\t\t\t\t|\t\t\t\t\t\t\t\t\t# nor\n\t\t\t\t(^\\#{2}[ ]*(.+?))\t\t\t\t\t# h2 whith number sign, only starting\n\t\t\t'\n\t\t);\n\n\t\t$h3 = array(\n\t\t\t'open' => '(^\\#{3}[ ]*(.+?)[ ]*\\#*'.$attr.'\\n)',\n\n\t\t\t'close' => '(^\\#{3}[ ]*(.+?)[ ]*\\#*\\n)'\n\t\t\t\t\t. \t'|' . $h2['close']\t\t\t//Add h2 because is the parent\n\t\t);\n\n\t\t$h4 = array(\n\t\t\t'open' => '(^\\#{4}[ ]*(.+?)[ ]*\\#*'.$attr.'\\n)',\n\n\t\t\t'close' => '(^\\#{4}[ ]*(.+?)[ ]*\\#*\\n)'\n\t\t\t\t\t. '|' . $h2['close']\n\t\t\t\t\t. '|' . $h3['close']\n\t\t);\n\n\t\t$h5 = array(\n\t\t\t'open' => '(^\\#{5}[ ]*(.+?)[ ]*\\#*'.$attr.'\\n)',\n\n\t\t\t'close' => '(^\\#{5}[ ]*(.+?)[ ]*\\#*\\n)'\n\t\t\t\t\t. '|' . $h2['close']\n\t\t\t\t\t. '|' . $h3['close']\n\t\t\t\t\t. '|' . $h4['close']\n\t\t);\n\t\t\n\t\t$h6 = array(\n\t\t\t'open' => '(^\\#{6}[ ]*(.+?)[ ]*\\#*'.$attr.'\\n)',\n\n\t\t\t'close' => '(^\\#{6}[ ]*(.+?)[ ]*\\#*\\n)'\n\t\t\t\t\t. '|' . $h2['close']\n\t\t\t\t\t. '|' . $h3['close']\n\t\t\t\t\t. '|' . $h4['close']\n\t\t\t\t\t. '|' . $h5['close']\n\t\t);\n\n\n\t\t/*\n\t\t * Get heading open and close using variable variable of level\n\t\t */ \n\t\t\n\t\t$h = $$heading;\n\t\t$callback = '_doAutoSections_Callback' . $heading;\n\n\t\t/*\n\t\t * Since we have two ways of declaring an h2\n\t\t * we need to perform doble check\n\t\t */ \n\t\t$text = preg_replace_callback('{\n\t\t\t(?:\\n|\\A)\n\t\t\t# 1: Opening marker\n\t\t\t(\n\t\t\t\t'. $h['open'] . '\n\t\t\t)\n\t\t\n\t\t\t# 7: Content\n\t\t\t(\n\t\t\t\t(?>\n\t\t\t\t\t[ ]*\n\t\t\t\t\t(.*\\n+)?\t\t\t\t\t\t\t\t\t# Content\n\t\t\t\t\t(?!\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(' . $h['close'] . ' ) | \\.{4,} \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 }mx', array(&$this, $callback), $text);\n\n\t\treturn $text;\n\t}", "public function getHtmlAnchors()\n {\n // Parse the anchors out of the page content\n // They should be found in the format '<a id=\"\" name=\"\"></a>'\n $anchors = [];\n $content = $this->content;\n preg_match_all('/<a id=\"([^\\\"]+)\" name=\"([^\\\"]+)\">[^<]*<\\/a>/', $content, $matches);\n\n // The 'id' tag is used as key and the 'name' tag as value of the anchors array\n if (isset($matches[1]) && isset($matches[2])) {\n $anchors = array_combine($matches[1], $matches[2]);\n }\n\n return $anchors;\n }", "function create_content_anchors ($content) {\n\t\t\n\t\tglobal $post;\n\t\t\n\t\t$disable_on_post = get_post_meta ( $post->ID, 'wpsi_disable_index', true);\n\t\t\n\t\t// $pattern = '/<' . $this->tag . '>([^<]+)<\\/' . $this->tag . '>/i';\n\t\t// $pattern = '/<' . $this->tag . '>([^<]+)<\\/' . $this->tag . '>/i';\n\t\t$pattern = '/<' . $this->tag . '[^>]*>(.*?)<\\/' . $this->tag . '>/i';\t\n\t\t\n\t\tif ( $disable_on_post == false ) {\n\t\t\t\n\t\t\tif ( (is_page() && $this->use_pages == 1) || (is_single() && $this->use_posts == 1) ) {\n\t\t\t\n\t\t\t\treturn preg_replace_callback($pattern, array(&$this, 'get_section_headings'), $content);\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn $content;\n\t\t\t\t\n\t\t\t} // End IF Statement\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\treturn $content;\n\t\t\t\n\t\t} // End IF Statement\n\t\n\t}", "function getAnchorsFromContent( &$content ) {\n\t\t$tag_regex = '/{'.$this->name.' .*?title=\"(.*?)\".*?}/';\n\t\t$anchors = $matches = array();\n\t\tpreg_match_all( $tag_regex, $content, $matches );\n\t\tif( !empty( $matches[1] ) ) {\n\t\t\tforeach ( $matches[1] as $match ) {\n\t\t\t\t$anchors[] = new NavItemAnchor( array( 'title' => $match, 'slug' => $this->getAnchorId( $match ) ) );\n\t\t\t}\n\t\t}\n\t\treturn $anchors;\n\t}", "static function linkH1( $content, $url ) {\n // wrap the <h1> tag in an anchor?\n if( \\c::get( 'blog.link.title', TRUE )) {\n $pattern = '/(<h1[^>]*>)([^<]*)(<\\/h1>)/i';\n $replacement = '$1<a href=\"' . url( $url ) . '\">$2</a>$3';\n $content = preg_replace( $pattern, $replacement, $content );\n }\n return $content;\n }", "function minimall_auto_id_headings( $content ) {\n if( is_page() || is_single() ){\n $content = preg_replace_callback( '/(\\<h[1-6](.*?))\\>(.*)(<\\/h[1-6]>)/i', function( $matches ) {\n if ( ! stripos( $matches[0], 'id=' ) ) :\n $matches[0] = $matches[1] . $matches[2] . ' id=\"' . sanitize_title( $matches[3] ) . '\">' . $matches[3] . $matches[4];\n endif;\n return $matches[0];\n }, $content );\n }\n\t\n return $content;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch all bundle products by bundle ids
private function fetchBundleProducts(array $ids): array { $query = $this->connection->createQueryBuilder(); $query->from('s_bundle_products', 'bundleProducts'); $this->addTableSelection($query, 's_bundle_products', 'bundleProducts'); $query->where('bundleProducts.bundle_id IN (:ids)'); $query->setParameter('ids', $ids, Connection::PARAM_INT_ARRAY); return $query->execute()->fetchAll(\PDO::FETCH_GROUP | \PDO::FETCH_COLUMN); }
[ "public function getBundleProducts($productId) \n {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select('prod_id AS product_id, var_id, name AS product_name, quantity') \n\t ->from('#__ketshop_prod_bundle')\n\t ->join('INNER', '#__ketshop_product ON id=prod_id')\n\t ->where('bundle_id='.$productId)\n\t ->order('name');\n $db->setQuery($query);\n\n return $db->loadAssocList();\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function getAllProducts();", "public function get_all_prod_by_id() {\r\n global $database;\r\n $query = $database->query(\"SELECT * FROM products WHERE product_id = '{$this->product_id}'\");\r\n return $query;\r\n }", "public function getProducts();", "public static function fetch_all_product_ids() {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$product_ids = $wpdb->get_results( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'product' AND post_status = 'publish';\" );\r\n\r\n\t\t\treturn $product_ids;\r\n\t\t}", "public function fetchProducts($uri);", "public function getProducts(){\n Bugzilla_DAO::connectDatabase();\n $handler = Bugzilla_DAO::getDB()->prepare(\"SELECT p.name as name, GROUP_CONCAT( c.name SEPARATOR '~' ) as comps FROM products p, components c WHERE c.product_id = p.id GROUP BY p.name\");\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n\n $results = array();\n while ($row = $handler->fetch(PDO::FETCH_ASSOC)) {\n array_push($results, Product::invokePlainComponents($row['name'], $row['comps']));\n }\n return $results;\n }", "public function readAllProducts(){\r\n $sql = 'SELECT * FROM products';\r\n $param = array();\r\n include_once __DIR__.'/../objects/Product.php';\r\n return $this->crud->readMultiRows($sql, $param, 'product_id', 'Product');\r\n }", "function fetch_products(){\n $str_query=\"select * FROM mw_product\";\n return $this->query($str_query);\n }", "public function products()\n {\n return Product::whereIn('id', $this->transformKeys(explode(\",\", $this->subscription->product_ids)))->get();\n }", "function release_load_multiple(array $ids) {\n return entity_load('release', $ids);\n}", "public function productIDs() {\n // Get all ID's from all products and returns it\n $db = new db();\n $sql = \"SELECT idProduct FROM Product WHERE status=1\";\n $input = array();\n\n return($db->readData($sql, $input));\n }", "public function getProductsById($id) {\n }", "private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }", "function getBookProducts($bookId){\t\r\n\t\t$results = NULL;\r\n\t\t$lang = $this->lang;\r\n\t\t$bookId = \"%\".$bookId.\"%\";\r\n\t\t$q= \"SELECT t.id, t.title_$lang, t.price, t.data, t.storage FROM (SELECT \".TB_PRODUCT.\".id, \".TB_PRODUCT.\".title_$lang, \".TB_PRODUCT.\".price, \".TB_PRODUCT_PHOTO.\".data, \".TB_PRODUCT.\".displayOrder, \".TB_PRODUCT.\".state, \".TB_PRODUCT.\".storage, \".TB_PRODUCT.\".book_id FROM \".TB_PRODUCT.\" LEFT JOIN \".TB_PRODUCT_PHOTO.\" ON \".TB_PRODUCT.\".id=\".TB_PRODUCT_PHOTO.\".pid AND \".TB_PRODUCT_PHOTO.\".isProfile = 1 ORDER BY \".TB_PRODUCT.\".displayOrder DESC ) AS t WHERE t.displayOrder !=0 AND t.state!=0 AND (t.book_id like ?)\";\r\n\t\tif($stmt = $this->connection->prepare($q)){\r\n\t\t\t$stmt->bind_param(\"s\", $bookId);\r\n\t\t\t$stmt->execute();\r\n\t\t\t$stmt->store_result();\r\n\t\t\tif($stmt->num_rows == 0){\r\n\t\t\t\t$results = 0;\r\n\t\t\t}else{\r\n\t\t\t\t$stmt->bind_result($id, $title, $price, $pic, $storage);\r\n\t\t\t\t$results = array();\r\n\t\t\t\twhile($stmt->fetch()){\r\n\t\t\t\t\t$result = array();\r\n\t\t\t\t\t$result['id'] = $id;\r\n\t\t\t\t\t$result['title'] = $title;\r\n\t\t\t\t\t$result['price'] = $price;\r\n\t\t\t\t\t$result['pic'] = $pic;\r\n\t\t\t\t\t$result['storage'] = $storage;\r\n\t\t\t\t\tarray_push($results, $result);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $results;\r\n\t}", "public function showBundleItemsAction()\n {\n $response = false;\n $orderId = $this->getRequest()->getParam('order_id');\n $itemId = $this->getRequest()->getParam('item_id');\n\n try {\n if ($orderId && $itemId) {\n /** @var $items Enterprise_Rma_Model_Resource_Item */\n $items = Mage::getResourceModel('enterprise_rma/item')->getOrderItems($orderId, $itemId);\n if (empty($items)) {\n Mage::throwException($this->__('No items for bundle product.'));\n }\n } else {\n Mage::throwException($this->__('Wrong order id or item id requested.'));\n }\n\n Mage::register('current_rma_bundle_item', $items);\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage(),\n );\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot display item attributes.')\n );\n }\n\n $this->loadLayout();\n $response = $this->getLayout()\n ->getBlock('enterprise_rma_bundle')\n ->toHtml()\n ;\n\n if (is_array($response)) {\n $response = Mage::helper('core')->jsonEncode($response);\n $this->getResponse()->setBody($response);\n } else {\n $this->getResponse()->setBody($response);\n }\n }", "public function getImportedProducts();", "public function loadProducts();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new isListVisible
public function setIsListVisible($isListVisible) { $this->isListVisible = $isListVisible; return $this; }
[ "public function setHiddenList($list) {\r\n\t\t$this->hiddenList = $list;\r\n\t\treturn $this;\r\n\t}", "public function setShowInList($showInList)\n\t{\n\t\t$this->showInList = $showInList;\n\t}", "public function isVisibleInAdminList();", "protected function setHideInListFlag() {\r\n\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_groups', 'tx_begroups_kind NOT IN(0,3) AND deleted = 0', array('hide_in_lists' => 1));\r\n\t}", "public function setList($var)\n {\n GPBUtil::checkBool($var);\n $this->list = $var;\n\n return $this;\n }", "public function setVisible() {\r\n\t\t$this->visible_initial = true;\r\n\t}", "public function setVisible($visible)\n {\n $this->visible = $visible;\n $this->setAttributes(\"Visible\");\n }", "public function setShowInAddressList(?bool $value): void {\n $this->getBackingStore()->set('showInAddressList', $value);\n }", "public function areAttributesVisibleInList( $aAttributes, $iListId );", "public function setIsVisible($is_visible)\n {\n $this->container['is_visible'] = $is_visible;\n\n return $this;\n }", "public function lists_AddShow( int $id, string $list, $isNotification = false ): bool {\n\t\t\treturn $this->call( __FUNCTION__, 'bool', [ 'id' => $id, 'list' => $list, ], $this->getRequestId( $isNotification ) );\n\t\t}", "public function set_visible($visible)\n {\n $this->set_default_property(self::PROPERTY_VISIBLE, $visible);\n }", "function toggle_visibility()\r\n {\r\n $this->set_hidden(! $this->is_hidden());\r\n }", "function estVisible(){\r\n\t\t\tif($this->visible == 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "function tribe_is_list_view() {\n\t\t$is_list_view = 'list' == Tribe__Events__Main::instance()->displaying ? true : false;\n\t\treturn apply_filters( 'tribe_is_list_view', $is_list_view );\n\t}", "public function setIsVisibleInGrid($isVisibleInGrid);", "public function setStartMenuAppListVisibility(?WindowsStartMenuAppListVisibilityType $value): void {\n $this->getBackingStore()->set('startMenuAppListVisibility', $value);\n }", "public function setList($list)\n {\n $this->list = $list;\n }", "public function isRenderList();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a html response we will check for certian phrases to suggest if the sql executed succesfully or not.
private function confirmSuccessfulImport($html) { $html = s::create($html); if ($html->contains('Your SQL query has been executed successfully')) { if ($html->contains('Query took')) { return true; } } return false; }
[ "function is_html_response($response){\n\t\tif((substr($response,0,5) == '<html') || (substr($response,0,9) == '<!DOCTYPE')){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function SQLInjectionAudit($pageResponseData){\n\n $pageResponse = $pageResponseData['data']['response'];\n\n \n $reg = '/SELECT (.+)/';\n \n \n preg_match($reg, $pageResponse, $match);\n if(!empty($match)){\n\n \n foreach($match as $m){\n \n $dataLeakage = strip_tags($m);\n\n //Remove Error message Noise form SQL query\n\n $exDataLeak = explode(\"Error description:\",$dataLeakage);\n $parser = new PHPSQLParser\\PHPSQLParser($exDataLeak[0], true);\n\n $tableName = \"\";\n $whereClause = $parser->parsed['WHERE'];\n $columnName = \"\";\n\n if(isset($parser->parsed['FROM']['0']['table'])){\n $tableName = $parser->parsed['FROM']['0']['table'];\n }\n\n\n if(isset($whereClause['0']['base_expr'])){\n $columnName = $whereClause['0']['base_expr'];\n }\n \n\n // Degault SQL detector Pattern \n $detectorPattern = $this->detectorPatterns['SQL-INJECTION']['s1'];\n\n if($tableName != \"\") {\n $detectorPattern = $this->detectorPatterns['SQL-INJECTION']['s2'];\n $detectorPatterns = str_replace(\"TABLE_NAME\",$tableName,$detectorPattern); \n }\n \n/* if($columnName != \"\") {\n $detectorPattern = $this->detectorPatterns['SQL-INJECTION']['s3'];\n $detectorPatterns = str_replace(\"TABLE_NAME\",$tableName,$detectorPattern); \n $detectorPatterns = str_replace(\"COLUMN_NAME\",$tableName,$detectorPattern); \n } \n*/\n /*\n $createdSQL = new PHPSQLParser\\PHPSQLCreator($parser->parsed);\n if($createdSQL == $exDataLeak[0]) {\n echo \"SQL match\";\n }\n */\n $this->inspectSourceFiles($detectorPattern,$exDataLeak[0],$pageResponseData);\n\n }\n\n \n } \n\n}", "function checkSearchResponse($response)\n{\n // CODE SAMPLE search-check-results BEGIN\n if (!$response->getMakesSense()) {\n echo 'We did not understand your query' . PHP_EOL;\n }\n $spellingSuggestions = $response->getSpellingSuggestions();\n if (!empty($spellingSuggestions)) {\n $queries = array_map(\n function ($suggestion) {\n return $suggestion->getQuery();\n },\n $spellingSuggestions\n );\n $suggestions = join(', ', $queries);\n echo 'Did you mean: ' . $suggestions . '?' . PHP_EOL;\n }\n // CODE SAMPLE END\n}", "public function queryResultConfirmed($response);", "private function confirm_query($result) {\r\n\t\tif (!$result) {\r\n\t\t\t$output = \"We are not able to process your request, Please try again later\";\r\n\t\t\t//$output .= \"Last SQL query: \" . $this->last_query;\r\n\t\t\t$this->json_response_basic(ERROR_CODE,$output);\r\n\t\t}\r\n\t}", "public function parseLoadDBRet( $resultSet ) {\n //print $resultSet;\n $row_label_len = $this->row_label_len; // length of the first column (for number of row).\n $output = \"\";\n $hasError = 0;\n $ct = 0;\n \n if ( isset( $resultSet ) ) { \n ///$output = \"<table align= \\\"center\\\" border=\\\"1\\\" cellspacing=\\\"0\\\">\\n\";\n // Parse $resultSet.\n // Note: $resultSet's only key is 'return'.\n foreach ($resultSet as $key => $val) {\n // Split the query results using \"\\n\".\n $queryResult = explode (\"\\n\", $val);\n\n // Count the number of rows returned.\n $numRows = count ($queryResult);\n \n // Count the number of fields.\n $numFields = substr_count ($queryResult[0], \":\");\n \n ///$output .= \"<tr><th colspan =\\\"$numFields\\\"> $queryTitle </th></tr>\";\n // Skip $queryResult[0], because that is column the header.\n for ($row = 0; $row < $numRows; $row++) {\n $data = explode (\",\", $queryResult[$row]);\n ///$output .= \"<tr>\\n\";\n for ($i = 0; $i < $numFields; $i++) {\n if ($row == 0) {\n if ($i == 0) {\n $output .= $this->writeField( $this->row_label, $row_label_len );\n }\n // Display the header. Remove the \"[XXX]:String\" and\n // just show \"XXX\".\n $data[$i] = preg_replace ('/^\\[/', '', $data[$i]);\n //$data[$i] = preg_replace ('/\\]:String$/', '', $data[$i]);\n $data[$i] = preg_replace ('/\\]:\\S+$/', '', $data[$i]);\n ///$output .= \"<th align=\\\"center\\\">$data[$i]</th>\\n\";\n $title = $this->updateTitle( $data[$i], $i );\n $output .= $this->writeField( $title );\n }\n else {\n // Remove the leading and trailing double quotes, except\n // for in the \"column_defaults\" column.\n if ($i != 2) { \n $data[$i] = preg_replace ('/^\"/', '', $data[$i]);\n $data[$i] = preg_replace ('/\"$/', '', $data[$i]);\n }\n //$output .= \"<td>$data[$i]</td>\\n\";\n $s = PSIHTMLGoodiesClass::htmlEncode( PSIHTMLGoodiesClass::decode( $data[$i] ) );\n ///$output .= \"<td>$s</td>\\n\"; \n // Error validation.\n if ($i == 0 || $i == 1) {\n if ( ! preg_match('/^[-+]?[0-9]*\\.?[0-9]+([eE][-+][0-9]+)?$/', $s) ) {\n $this->uploadErrStr = \"Invalid \" . (($i == 0) ? \"Ra\" : \"Dec\" ) . \" format, should be a float number\";\n $hasError = 1;\n }\n }\n else if ($i == 2) {\n if ( strlen($s) == 1 && strstr(\"gripza\", $s) ) {}\n else if ( strlen($s) == 1 && strstr(\"012345\", $s) ) { $s = $this->filterConversion($s); }\n else if ($s == '') { $s = 'a'; }\n else {\n $this->uploadErrStr = \"Invalid filter value: should be one of g, r, i, z, y, w or a; or an integer 0 to 6, which is automatically converted to a, g, r, i, z, y, w\";\n $hasError = 1;\n }\n //if ($filterConvStatus < $status) $filterConvStatus = $status;\n }\n else if ($i == 3 || $i == 4) {\n if ( $s != \"\" && ! preg_match('/^[0-9]{0,5}\\.?[0-9]{1,5}$/', $s) ) {\n $this->uploadErrStr = \"Invalid date. Should be in MJD format\";\n $hasError = 1;\n }\n }\n else {\n // shouldn't happen.\n }\n\n if ($i == 0) {\n $output .= $this->writeField($ct + 1, $row_label_len);\n }\n\n $output .= $this->writeField($s);\n\n if ($hasError == 1) {\n $output .= \" <-- First error happens here\";\n break;\n }\n } // if ($row == 0)\n } // for $i\n ///$output .= \"</tr>\\n\";\n $output .= \"\\n\";\n\n if ($row == 0) $output .= str_repeat(\"-\", $numFields * 20 + $row_label_len) . \"\\n\"; \n else ++ $ct;\n\n if ($hasError == 1) break;\n } #for\n } #foreach\n ///$output .= \"</table>\\n\";\n ///$output .= \"</center>\\n\";\n ///$output .= \"<br/>\\n\"; \n }\n\n if ( $this->uploadErrStr != '' ) { \n $this->uploadErrStr = \"<font color=\\\"red\\\">Load Error: $this->uploadErrStr. Please load again.</font>\";\n }\n\n //return $output;\n $this->dbContent = $output;\n $this->coordCount_db = $ct;\n }", "public function checkErrorInResponse($response);", "public function evaluateResponse($raw_response)\r\n {\r\n $this->initializeProperties();\r\n\r\n $this->raw_response = $raw_response;\r\n\r\n $this->wpErrorCheck();\r\n\r\n if ($this->continue_evaluate_response) {\r\n\r\n $this->extractInsertRecordBody();\r\n\r\n $this->insertRecordRejectionDetection();\r\n }\r\n\r\n if ($this->continue_evaluate_response) {\r\n\r\n $this->extractInsertRecordResponse();\r\n }\r\n }", "public static function SafeString($response)\n {\n $upper_string = strtoupper($response);\n $parameters = array(\"<SCRIPT\", \"ALERT(\", \"<IFRAMW\", \".CCS\", \".JS\", \"<META\", \"<FRAME\", \"<EMBED\", \"<XML\", \"<IMG\");\n foreach ($parameters as $parameter){\n if (strpos($upper_string,$parameter) !== false){\n return true;\n }\n }\n }", "public function hasValidHtmlRedirect($row, $query_path, array $redirect_texts = []) {\n $destination = self::getRedirectFromHtml($row, $query_path, $redirect_texts);\n if ($destination) {\n // This page is being redirected via the page.\n // Is the destination still good?\n $real_destination = self::urlExists($destination);\n if ($real_destination) {\n // The destination is good. Message and return.\n $message = \"Found redirect in html -> !destination\";\n $variables = ['!destination' => $real_destination];\n Message::make($message, $variables, FALSE, 2);\n\n return $destination;\n }\n else {\n // The destination is not functioning. Message and bail with 'skip'.\n $message = \"Found broken redirect in html-> !destination\";\n $variables = ['!destination' => $destination];\n Message::make($message, $variables, Message::ERROR, 2);\n\n return 'skip';\n }\n }\n else {\n // No redirect destination found.\n return FALSE;\n }\n }", "protected function setSuccessResultContent()\n {\n $content = file_get_contents(\"http://translate.reference.com/english/\" . self::getLanguageTranslate() . \"/hello-world/tSGVsbG8gV29ybGQ%3D\");\n preg_match('/placeholder=\"Translation\".*<\\//', $content, $result);\n preg_match('/>.*</', $result[0], $resultWord);\n $result = str_replace(\">\", \"\", $resultWord[0]);\n $word = str_replace(\"<\", \"\", $result);\n http_response_code(200);\n self::$resultContent['success']['message'] = 'success request';\n self::$resultContent['success']['code'] = '200';\n self::$resultContent['message'] = $word;\n }", "function __check_ok_yahoo($response = null){\r\n if( is_null($response) || !is_array($response) || empty($response) ) {\r\n return false;\r\n }\r\n if(\r\n isset($response['status']['code']) && $response['status']['code'] == '200' &&\r\n isset($response['status']['reason-phrase']) && $response['status']['reason-phrase'] == 'OK' &&\r\n isset($response['body']) && !empty($response['body']) &&\r\n strpos(strtolower($response['body']), \"successfully submitted\") != false) {\r\n return true;\r\n }\r\n return false;\r\n }", "function check_query($result)\n\t{\n\t\tif(!$result)\n\t\t{\n\t\t\tdie(\"Sorry the query was Unsuccessful\");\n\t\t}\n\t}", "static function can_extract(Biriani_Response $response);", "function validate_html($html)\n {\n \n $parser=xml_parser_create();\n xml_parse_into_struct($parser,\"<div>\" . str_replace(\"&\",\"&amp;\",$html) . \"</div>\",$vals,$index);\n $errcode=xml_get_error_code($parser);\n if ($errcode!==0)\n {\n $line=xml_get_current_line_number($parser);\n \n $error=htmlspecialchars(xml_error_string($errcode)) . \"<br />Line: \" . $line . \"<br /><br />\";\n $s=explode(\"\\n\",$html);\n $error.= \"<pre>\" . trim(htmlspecialchars(@$s[$line-2])) . \"<br />\";\n $error.= \"<strong>\" . trim(htmlspecialchars(@$s[$line-1])) . \"</strong><br />\";\n $error.= trim(htmlspecialchars(@$s[$line])) . \"<br /></pre>\"; \n return $error;\n }\n else\n {\n return true;\n }\n }", "function serendipity_pingback_is_success($resp) {\n // This is very rudimentary, but the fault is printed later, so what..\n if (preg_match('@<fault>@', $resp, $matches)) {\n return false;\n }\n return true;\n}", "function chkQuery($conn, $result)\r\n {\r\n // * This function will only return when the query is successful.\r\n\r\n if(!$result)\r\n {\r\n // The query was unsuccessfull.\r\n throwError($error = \"Database error ---- $conn->error\", $message = 'There was some problem with the database.');\r\n }\r\n }", "public function check() {\n \n // Initialise curl\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $this->url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HEADER, 1);\n curl_setopt($curl, CURLOPT_TIMEOUT, 10);\n curl_setopt($curl, CURLOPT_USERAGENT, \"Agile Collective time reporting\");\n \n // Get URL and info\n $this->response = curl_exec($curl);\n $this->info = curl_getinfo($curl);\n $this->error = curl_errno($curl);\n curl_close($curl);\n \n // If error, return curl error code\n if ($this->error) {\n return $this->error;\n }\n \n // Check for check string\n if (strpos($this->response, $this->checkString) !== FALSE) {\n $this->checkFound = TRUE;\n $this->error = 0;\n }\n else {\n $this->checkFound = FALSE;\n $this->error = -1;\n }\n \n return $this->error;\n }", "function check_results($results) {\n\t\tglobal $dbc;\n\t \tif($results != true)\n\t \techo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Total amount of unbilled time
public function unbilled() { $total = 0; foreach ($this->timesheets->where('billable', 1)->where('billed', 0) as $time) { $total += $time->worked; } return $total; }
[ "public function getBilledHours()\n {\n $hours = 0;\n foreach ($this->getWorks() as $work) {\n if ($work->getBilled())\n $hours += $work->getHours();\n }\n\n return $hours;\n }", "public function getTimeused()\n {\n return $this->timeused;\n }", "public function getTotalTime()\n {\n return $this->total_time;\n }", "public function getTotalTimeLock()\n {\n return $this->total_time_lock;\n }", "public function getTotalTime(): float\n\t{\n\t\treturn $this->app['send']->getTotalTime();\n\t}", "public function getTotalTime()\n {\n return $this->totalTime;\n }", "public static function getRemainingBanTime(){\n\t\treturn self::get(BANNED) - time();\n\t}", "public function getTotalTimeSpent() {\n return $this->totalTimeSpent;\n }", "private function calculateSpentTime()\n {\n $this->time = microtime(true) - $this->startTime;\n }", "public function getTotalOccupiedLots() {}", "public function getSettleTime()\n {\n return 0;\n }", "public function timeUntillFull() : int\n {\n if ($this->deltaBlocks() <= 0) {\n return PHP_INT_MAX;\n }\n\n return ($this->end->blocks - $this->end->used) / $this->deltaBlocks()\n * $this->deltaT();\n }", "public function getBaseTotalCanceled();", "public function getTimeTaken()\n {\n return $this->time_taken;\n }", "function total_demand() {\n \t\t\n \t\treturn $this->players['housing_assoc_1']->water_demand() +\n \t\t $this->players['housing_assoc_2']->water_demand();\n \t}", "public function remaining(): int {\n $alert = $this->alert();\n return is_null($alert) ? 1 : ($alert['created'] + $alert['expiry'] * 60) - time();\n }", "public function billable()\n {\n $total = 0;\n foreach ($this->timesheets->where('billable', 1) as $time) {\n $total += $time->worked;\n }\n return $total;\n }", "public function getFreeTimes()\n {\n $value = $this->get(self::FREE_TIMES);\n return $value === null ? (integer)$value : $value;\n }", "public function getTotalBilled() {\n\t\t$total = 0;\n\t\t\n\t\tforeach($this->invoice->all as $invoice) {\n\t\t\tforeach($invoice->lineitem->get()->all as $lineitem) {\n\t\t\t\t$total += $lineitem->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If false then it won't generate an error. If true (default), then on error, it behaves normally If false, then the error is captured and store in $this::$errorText This command is specific for generation of query and its reseted when the query is executed.
public function genError(bool $error = false): PdoOneQuery { return (new PdoOneQuery($this))->genError($error); }
[ "public function errorCommand()\n {\n trigger_error('oo, this is a runtime error!', E_USER_ERROR);\n }", "private function trigger_error(){\n $last_error = error_get_last();\n $this->error = true;\n $this->error_number = $last_error[\"number\"];\n $this->error_message = $last_error[\"message\"];\n \n }", "#[NoReturn]\n public function errorCommand(): void\n {\n trigger_error('oo, this is a runtime error!', E_USER_ERROR);\n }", "public function isQueryError(): bool\n {\n return ($this->errno==1064);\n }", "private function executeError()\n {\n echo \"[ERROR] Wrong script arguments.\\n\";\n $this->executeHelp();\n }", "public function sql_error()\n {\n if ($this->lastUsedLink === self::LINK_SLAVE) {\n return $this->linkRead->error;\n }\n return $this->link->error;\n }", "final public function isError() {\n\t\t\treturn $this->is_query_failed;\n\t\t}", "public function table_error_occured() {\n $this->error = true;\n }", "public function error()\n\t{\n\t\tif($this->db_error() === TRUE || ( get_class($this->query_object) === $this->query_object_class_name && $this->query_object->error() === TRUE ))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "private function _setErrorMode()\n {\n // get PDO object and enable exception error mode\n $pdo = $this->_getPdo();\n $this->_errMode = $pdo->getAttribute(PDO::ATTR_ERRMODE);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "private function _logError()\n\t{\n\t\tself::$_debugger->logQuery($this->_pattern, $this->_vars, $this->_result, 0, false);\n\t\treturn false;\n\t}", "abstract protected function setErrors();", "protected abstract function report_error($query);", "public function setError( $boolean )\n\t{\n\t\t$this->_isError = $boolean;\n\t}", "public function sql_error() {\n\t\treturn $this->lastUsedDatabaseConnection->sql_error();\n\t}", "public function setError() {\n $this->status = QueueManager::STATUS_ERROR;\n }", "public static function SHOW_ERROR()\n {\n return true;\n }", "protected function setErrorsExist() {}", "public function isError()\n {\n return $this->getName() === 'error';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter of Suggested Max Age Maximal age recommended for viewing content
public function setSuggestedMaxAge($value) { $this->suggestedMaxAge = $value; }
[ "function setMaxAge($maxAge)\n {\n $this->__maxAge = $maxAge ;\n }", "public function getSuggestedMaxAge()\n {\n return $this->suggestedMaxAge;\n }", "public function getSuggestedMaxAge();", "public function setMaxAge($var)\n {\n GPBUtil::checkInt64($var);\n $this->maxAge = $var;\n\n return $this;\n }", "public function setMaxAge($var)\n {\n GPBUtil::checkInt32($var);\n $this->maxAge = $var;\n\n return $this;\n }", "public function getMaximumAge()\n {\n return $this->maximumAge;\n }", "private function setFilterForAge(){\n $selfAge = $this->loggedInProfileObj->getAGE();\n $othersAge = $this->ProfileObj->getAGE();\n if($this->loggedInProfileObj->getGENDER()==self::maleProfile){\n $LAgeToSet = min($selfAge-self::AgeConstantToBeSub,$othersAge);\n $HAgeToSet = max($selfAge,$othersAge);\n }\n else{\n $LAgeToSet = min($selfAge,$othersAge);\n $HAgeToSet = max($selfAge+self::AgeConstantToBeSub,$othersAge);\n }\n $this->setLAGE($LAgeToSet);\n $this->setHAGE($HAgeToSet);\n }", "public function setGroupMaxAge($value) {\n\t\t$this->_group_max_age = $value;\n\t}", "public function getForcedMaxAge()\n {\n return $this->forcedMaxAge;\n }", "public function setMaxAge($maxAge)\n {\n $this->maxAge = $maxAge;\n return $this;\n }", "public function setMaxAge(int $maxAge) {\n $this->setExpiryTime(\\time() + $maxAge);\n return $this;\n }", "function setting_popular_max_age() {\n\t$options_num = get_option('nrelate_popular_options');\n\t$options_frame = get_option('nrelate_popular_options');\n\t$items = array(\n\t\t\"Hour(s)\" => __(\"Hour(s)\",\"nrelate\"),\n\t \t\"Day(s)\" => __(\"Day(s)\",\"nrelate\"), \n\t\t\"Week(s)\" => __(\"Week(s)\",\"nrelate\"),\n\t\t\"Month(s)\" => __(\"Month(s)\",\"nrelate\"), \n\t\t\"Year(s)\" => __(\"Year(s)\",\"nrelate\")\n\t);\n\techo \"<input id='popular_max_age_num' name='nrelate_popular_options[popular_max_age_num]' size='4' type='text' value='{$options_num['popular_max_age_num']}' />\";\n\t\n\techo \"<select id='popular_max_age_frame' name='nrelate_popular_options[popular_max_age_frame]'>\";\n\tforeach($items as $type => $item) {\n\t\t$selected = ($options_frame['popular_max_age_frame']==$item) ? 'selected=\"selected\"' : '';\n\t\techo \"<option value='$type' $selected>$item</option>\";\n\t}\n\t\techo \"</select>\";\n}", "function getMaxAgeUnit() {\n\t\treturn $this->getData('maxAgeUnit');\n\t}", "public function getMaxAge()\n {\n return $this->maxAge;\n }", "public function setMaximumAge($maximumAge)\n {\n $this->maximumAge = $maximumAge;\n return $this;\n }", "private function getMaximumBreedAge() { \n return $this->current_animal->getSpecies()->maximum_breeding_age;\n }", "function set_age_calc($new_age)\r\n {\r\n $this->age = $new_age;\r\n }", "public function getMaxAge()\n {\n return $this->expiry;\n }", "public function getMaxPriceDataAge()\n {\n return $this->maxPriceDataAge;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will put an object (stool or chair) on the table
public function putObjectOnTable(Object $object) { if ($object instanceof Stool or $object instanceof Chair) { printf("Object %s has been placed on the table<br>", strval(get_class($object))); } }
[ "public function insertObject($table, &$object, $key = null);", "public abstract function putRow( $row );", "function insertObject( $table, &$object, $keyName = NULL ) {\n\t\t$fmtsql = 'INSERT INTO '.$this->nameQuote($table).' ( %s ) VALUES ( %s ) ';\n\t\t$fields = array();\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\n\t\t\tif (is_array($v) or is_object($v) or $v === NULL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($k[0] == '_') { // internal field\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fields[] = $this->nameQuote( $k );\n\t\t\t$values[] = $this->isQuoted( $k ) ? $this->Quote( $v ) : (int) $v;\n\t\t}\n\t\t$this->setQuery( sprintf( $fmtsql, implode( \",\", $fields ) , implode( \",\", $values ) ) );\n\t\tif (!$this->query()) {\n\t\t\treturn false;\n\t\t}\n\t\t$id = $this->insertid();\n\t\tif ($keyName && $id) {\n\t\t\t$object->$keyName = $id;\n\t\t}\n\t\treturn true;\n\t}", "function insertObject( $table, &$object, $keyName = NULL )\r\n\t{\r\n\t\t$fmtsql = 'INSERT INTO '.$this->nameQuote($table).' ( %s ) VALUES ( %s ) ';\r\n\t\t$fields = array();\r\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\r\n\t\t\tif (is_array($v) or is_object($v) or $v === NULL) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif ($k[0] == '_') { // internal field\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$fields[] = $this->nameQuote( $k );\r\n\t\t\t$values[] = $this->isQuoted( $k ) ? $this->Quote( $v ) : (int) $v;\r\n\t\t}\r\n\t\t$result=$this->query( sprintf( $fmtsql, implode( \",\", $fields ) , implode( \",\", $values ) ) );\r\n\t\tif (!$result) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$id = $this->insertid();\r\n\t\tif ($keyName && $id) {\r\n\t\t\t$object->$keyName = $id;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function insertObject($table, &$object, $keyName = NULL)\n\t{\n\t\t$db =& $this->getDb();\n\t\t$secret = JFactory::getConfig()->getValue('secret');\n\t\t$fmtsql = 'INSERT INTO '.$db->nameQuote($table).' ( %s ) VALUES ( %s ) ';\n\t\t$fields = array();\n\t\tforeach (get_object_vars($object) as $k => $v) {\n\t\t\tif (is_array($v) or is_object($v) or $v === NULL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($k[0] == '_') {\n\t\t\t\t// internal field\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fields[] = $db->nameQuote($k);\n\t\t\t$val = $db->isQuoted($k) ? $db->Quote($v) : (int) $v;\n\t\t\tif (in_array($k, $this->encrypt)) {\n\t\t\t\t$val = \"AES_ENCRYPT($val, '$secret')\";\n\t\t\t}\n\t\t\t$values[] = $val;\n\t\t}\n\t\t$db->setQuery(sprintf($fmtsql, implode(\",\", $fields) , implode(\",\", $values)));\n\t\tif (!$db->query()) {\n\t\t\treturn false;\n\t\t}\n\t\t$id = $db->insertid();\n\t\tif ($keyName && $id) {\n\t\t\t$object->$keyName = $id;\n\t\t}\n\t\treturn true;\n\t}", "function insert($object)\n {\n if (is_a($object, 'Turba_Object')) {\n $key = $object->getSource() . ':' . $object->getValue('__key');\n if (!isset($this->objects[$key])) {\n $this->objects[$key] = $object;\n }\n }\n }", "public function insertObject( $table, $object, $keyName = NULL )\r\r\n\t{\r\r\n\t\t$fmtsql = 'INSERT INTO '.$this->nameQuote($table).' ( %s ) VALUES ( %s ) ';\r\r\n \r\r\n \r\r\n\t\t$fields = array();\r\r\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\r\r\n\t\t\tif (is_array($v) or is_object($v) or $v === NULL) {\r\r\n\t\t\t\tcontinue;\r\r\n\t\t\t}\r\r\n\t\t\tif ($k[0] == '_') { // internal field\r\r\n\t\t\t\tcontinue;\r\r\n\t\t\t}\r\r\n\t\t\t$fields[] = $this->nameQuote( $k );\r\r\n\t\t\t$values[] = $this->isQuoted( $k ) ? $this->Quote( $v ) : (int) $v;\r\r\n\t\t}\r\r\n\t\t$sql = sprintf( $fmtsql, implode( \",\", $fields ) , implode( \",\", $values ) ) ;\r\r\n //echo $sql;\r\r\n //exit;\r\r\n\t\tif (!$this->query($sql)) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t\treturn true;\r\r\n\t}", "public function addObject($object)\n\t{\n\t\t$this->tableObjects[$this->count++] = $object;\n\t}", "public function insert($object)\n {\n\n }", "public function newRow($class_name, $object, $row);", "function add_table($table)\r\n {\r\n if (!is_object($table))\r\n die(\"invalid argument in add_table()\");\r\n\r\n $this->element[$this->number_of_elements] = $table;\r\n\r\n $this->number_of_elements++;\r\n }", "public function _insertar($objeto);", "function addHike($hikeObj, $user)\r\n {\r\n $dbh = $this->_dbh;\r\n // define the query\r\n $sql = \"INSERT INTO hikes(title, address, enjoyability, length, elevationChange, difficulty, scenery, date, user)\r\n VALUES (:title, :address, :enjoyability, :length, :elevationChange, :difficulty, :scenery, :date , :user)\";\r\n\r\n\r\n\r\n // prepare the statement\r\n $statement = $dbh->prepare($sql);\r\n\r\n $statement->bindParam(':title', $hikeObj->getTitle(),PDO::PARAM_STR );\r\n $statement->bindParam(':address', $hikeObj->getAddress(), PDO::PARAM_STR);\r\n $statement->bindParam(':enjoyability', $hikeObj->getEnjoyability(),PDO::PARAM_STR);\r\n $statement->bindParam(':length', $hikeObj->getLength(),PDO::PARAM_STR);\r\n $statement->bindParam(':elevationChange', $hikeObj->getElevationChange(),PDO::PARAM_STR);\r\n $statement->bindParam(':difficulty', $hikeObj->getDifficulty(),PDO::PARAM_STR);\r\n $statement->bindParam(':scenery', $hikeObj->getScenery(),PDO::PARAM_STR);\r\n $statement->bindParam(':date', $hikeObj->getDate(),PDO::PARAM_STR);\r\n $statement->bindParam(':user', $user,PDO::PARAM_STR);\r\n\r\n\r\n\r\n $statement->execute();\r\n\r\n\r\n\r\n\r\n }", "public static function insertObject(IDBStorable $object)\n {\n //insert into cram_cards (name, value) values (?, ?)\n $fields = $object->getFields();\n unset($fields[$object->getPrimaryKeyName()]);\n $questionMarks = implode(', ', array_fill(0, count($fields), '?'));\n $sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $object->getTableName(), implode(', ', array_keys($fields)), $questionMarks);\n\n $result = self::query($sql, array_values($fields));\n\n $object->setPrimaryKeyValue($result);\n }", "static public function inserer($unObjet);", "public function save($obj)\n {\n DB::table('position_working_conditions')->insert($obj);\n }", "function storeObj(){\n\t\t$this->superStore();\n\t\t$strSQL = \"\" .\n\t\t\t\t\"INSERT INTO images \" .\n\t\t\t\t\"(id, width, height, align, alt) \" .\n\t\t\t\t\"VALUES (\" .\n\t\t\t\t\t\"\".$this->getId().\", \" .\n\t\t\t\t\t\"\".$this->getWidth().\", \" .\n\t\t\t\t\t\"\".$this->getHeight().\", \" .\n\t\t\t\t\t\"'\".$this->getAlign().\"',\" .\n\t\t\t\t\t\"'\".$this->getAlt().\"')\";\n\t\t$this->id = $this->DB->exe(\"MyImage :: function storeObj()\",$strSQL);\n\t}", "public function save()\n {\n $this->insert(array_keys($this->rowData), $this->rowData);\n }", "public function save($obj)\n {\n DB::table('pos_structure_hierarchies')->insert($obj);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a note to an item.
public function add($item, stdClass $note) { $id = $this->guessId($item); $data = json_encode($note); $resp = $this->makeRequest( "/items/{$id}/notes.json", HTTP_Request2::METHOD_POST, $data ); $data = $this->parseResponse($resp); if ($data !== null) { $this->lastCreated = $data; return true; } return false; }
[ "public function addNote(Note $note);", "public function addNote($note)\n {\n $notes = trim($this->getNodeText('/p:package/p:notes'));\n if ($notes != '*') {\n $new_notes = \"\\n* \" . $note . \"\\n\" . $notes . \"\\n \";\n } else {\n $new_notes = \"\\n* \" . $note . \"\\n \";\n }\n $this->replaceTextNode('/p:package/p:notes', $new_notes);\n\n $release = $this->_fetchCurrentRelease();\n if ($release !== null) {\n $this->replaceTextNodeRelativeTo(\n './p:notes', $release, $new_notes . ' '\n );\n }\n }", "public function add_note($note)\n {\n\n $this->set_notes(array_merge($this->get_notes('edit'), (array) $note));\n $this->save();\n }", "public function addItem(Item $item);", "public function setItemNotes($notes);", "public function addNote(NotesNotes_Model_Note $note)\n {\n // Firstly, set page object into note\n $note->setPage($this);\n \n // Add note to the notes array\n $this->_notes[] = $note;\n }", "public function setItemNote($value)\n {\n return $this->set('ItemNote', $value);\n }", "public function addNote( $note ){\n $arr = $this->notes;\n $x = array_push($arr, $note);\n $this->notes = $arr;\n return $this->notes;\n }", "public function add( $item );", "public function addToNote_Data(\\WorkdayWsdl\\\\StructType\\Safety_Incident_Note_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Safety_Incident_Note_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Note_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Safety_Incident_Note_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Note_Data[] = $item;\n return $this;\n }", "public static function add_order_note() {\n check_ajax_referer('iwj-security');\n\n if (!current_user_can('manage_options')) {\n wp_die(- 1);\n }\n\n $post_id = absint($_POST['post_id']);\n $note = wp_kses_post(trim(stripslashes($_POST['note'])));\n $note_type = $_POST['note_type'];\n\n $is_customer_note = ( 'customer' === $note_type ) ? 1 : 0;\n\n if ($post_id > 0) {\n $order = IWJ_Order::get_order($post_id);\n $comment_id = $order->add_order_note($note, $is_customer_note, true);\n\n echo '<li rel=\"' . esc_attr($comment_id) . '\" class=\"iwj-note ';\n if ($is_customer_note) {\n echo 'customer-note';\n }\n echo '\"><div class=\"iwj-note-content\">';\n echo wpautop(wptexturize($note));\n echo '</div><p class=\"meta\"><a href=\"#\" class=\"iwj-delete-note\">' . __('Delete note', 'iwjob') . '</a></p>';\n echo '</li>';\n }\n wp_die();\n }", "public function ajouteNote($note)\n {\n }", "function ncn_admin_note_add_note($claim_id, $uid, $note) {\nglobal $user;\n $note = trim($note);\n if (empty($note)) { return false; }\n\n $capcrm_history_id = 0;\n if (module_exists('ncn_capsulecrm')) {\n $capcrm_history_id = ncn_capsulecrm_note_add_note($claim_id, $note);\n }\n\n $msg = \"Note: \".$note;\n\n ncn_chatter_auto_post_in_claim($claim_id, 0, $note);\n return ncn_admin_note_db_insert_note($claim_id, $uid, $note, $capcrm_history_id);\n}", "public function setNote($note);", "public function addNoteAction()\n {\n $this->_disableLayout();\n\n $jobNoteForm = new Job_Form_JobNote(array('job' => $this->_request->getParam('jobId')));\n\n if ($this->_request->isPost() && $jobNoteForm->isValid($this->_request->getPost())) {\n $zfDate = new Zend_Date();\n $jobNote = Doctrine_Core::getTable('ECB_Model_JobNote')->create(\n array_merge($jobNoteForm->getValues(),\n array(\n 'dateCreated' => $zfDate->get(Zend_Date::ISO_8601),\n 'userId' => $this->_request->user->userId\n )\n )\n );\n $jobNote->save();\n $this->_flash('Note Added');\n }\n\n $job = Doctrine_Core::getTable('ECB_Model_Job')->findOneBy('jobId', $this->_request->getParam('jobId'));\n\n $this->view->notes = $job->notes;\n\n $this->renderScript('partials/job-note.phtml');\n }", "public function setNote($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\Note::class);\n $this->note = $var;\n\n return $this;\n }", "public function add()\r\n {\r\n $note = $this->real_escape_string(trim($_POST['note']));\r\n $this->query('INSERT INTO notes (notes) VALUES (\"'.$note.'\")');\r\n unset($_POST['note']);\r\n }", "public function create(Note $postBody, $optParams = [])\n {\n $params = ['postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('create', [$params], Note::class);\n }", "public function addItem(\\Yana\\RSS\\Item $item);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test __invoke with customized Firewall
public function testInvokeCustom() { $middleware = new FirewallMiddleware([ 'whitelist' => [ '192.168.211.12' ], 'blacklist' => [ '*', ] ]); $response = new Response(); $request = new ServerRequest([ 'environment' => [ 'REMOTE_ADDR' => '192.168.211.12' ] ]); $result = $middleware( $request, $response, function (ServerRequestInterface $request, ResponseInterface $response) { return $response; } ); $this->assertInstanceOf('Cake\Http\Response', $result); $this->assertEquals(200, $result->getStatusCode()); $response = new Response(); $request = new ServerRequest([ 'environment' => [ 'REMOTE_ADDR' => '192.168.214.11' ] ]); $result = $middleware( $request, $response, function (ServerRequestInterface $request, ResponseInterface $response) { return $response; } ); $this->assertInstanceOf('Cake\Http\Response', $result); $this->assertEquals(403, $result->getStatusCode()); }
[ "public function __invoke() {}", "public function __invoke(){\n \n echo \"trying to call object as method __invoke method \"; \n\n }", "public function __invoke();", "public function testGetNetworkApplianceFirewallFirewalledServices()\n {\n }", "public function testInvoke()\n {\n $rfc = new RemoteFunctionCall(new ConfigA());\n $rfc->getFunction()->results = ['gpgtowzq' => 'C5AWVD1h'];\n $results = $rfc->invoke();\n static::assertSame(['gpgtowzq' => 'C5AWVD1h'], $results);\n }", "public function testInvoke()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testGetNetworkApplianceFirewallL7FirewallRules()\n {\n }", "public function testInvoke()\n {\n $resource = 'nP24u6HZ';\n $function = new RemoteFunction($resource, 'HPOjsyFm');\n $function->results = ['tnvqmfNU' => 91];\n $result = $function->invoke();\n static::assertSame(['tnvqmfNU' => 91], $result);\n }", "function __invoke()\n {\n echo 'Este objeto nao pode ser chamado como funcao';\n //obj\n }", "public function testAllowsAccessFor() {\n // $interceptor->setSession();\n // $user = new UserIndexMock;\n // $target = [$user, 'onGet'];\n // $invocation = new ReflectiveMethodInvocation($target, [], [$interceptor]);\n // $result = $interceptor->invoke($invocation);\n }", "public function testGetNetworkApplianceSingleLan()\n {\n }", "abstract public function invoke($method,$params);", "public function testGetOrganizationApplianceVpnVpnFirewallRules()\n {\n }", "public function invoke($proxy, $method, $args);", "public function testGetNetworkApplianceFirewallOneToOneNatRules()\n {\n }", "function invoke_method() {\n\t\t$this->debug('entering invoke_method');\n\t\t// does method exist?\n\t\tif(!function_exists($this->methodname)){\n\t\t\t// \"method not found\" fault here\n\t\t\t$this->debug(\"method '$this->methodname' not found!\");\n\t\t\t$this->result = 'fault: method not found';\n\t\t\t$this->fault('Server',\"method '$this->methodname' not defined in service\");\n\t\t\treturn;\n\t\t}\n\t\tif($this->wsdl){\n\t\t\tif(!$this->opData = $this->wsdl->getOperationData($this->methodname)){\n\t\t\t//if(\n\t\t \t$this->fault('Server',\"Operation '$this->methodname' is not defined in the WSDL for this service\");\n\t\t\t\treturn;\n\t\t }\n\t\t $this->debug('opData is ' . $this->varDump($this->opData));\n\t\t}\n\t\t$this->debug(\"method '$this->methodname' exists\");\n\t\t// evaluate message, getting back parameters\n\t\t// verify that request parameters match the method's signature\n\t\tif(! $this->verify_method($this->methodname,$this->methodparams)){\n\t\t\t// debug\n\t\t\t$this->debug('ERROR: request not verified against method signature');\n\t\t\t$this->result = 'fault: request failed validation against method signature';\n\t\t\t// return fault\n\t\t\t$this->fault('Server',\"Operation '$this->methodname' not defined in service.\");\n\t\t\treturn;\n\t\t}\n\n\t\t// if there are parameters to pass\n $this->debug('params var dump '.$this->varDump($this->methodparams));\n\t\tif($this->methodparams){\n\t\t\t$this->debug(\"calling '$this->methodname' with params\");\n\t\t\tif (! function_exists('call_user_func_array')) {\n\t\t\t\t$this->debug('calling method using eval()');\n\t\t\t\t$funcCall = $this->methodname.'(';\n\t\t\t\tforeach($this->methodparams as $param) {\n\t\t\t\t\t$funcCall .= \"\\\"$param\\\",\";\n\t\t\t\t}\n\t\t\t\t$funcCall = substr($funcCall, 0, -1).')';\n\t\t\t\t$this->debug('function call:<br>'.$funcCall);\n\t\t\t\t@eval(\"\\$this->methodreturn = $funcCall;\");\n\t\t\t} else {\n\t\t\t\t$this->debug('calling method using call_user_func_array()');\n\t\t\t\t$this->methodreturn = call_user_func_array(\"$this->methodname\",$this->methodparams);\n\t\t\t}\n\t\t} else {\n\t\t\t// call method w/ no parameters\n\t\t\t$this->debug(\"calling $this->methodname w/ no params\");\n\t\t\t$m = $this->methodname;\n\t\t\t$this->methodreturn = @$m();\n\t\t}\n $this->debug('methodreturn var dump'.$this->varDump($this->methodreturn));\n\t\t$this->debug(\"leaving invoke_method: called method $this->methodname, received $this->methodreturn of type \".gettype($this->methodreturn));\n\t}", "function w32api_set_call_method($method)\n{\n}", "public function testGetNetworkSwitchStormControl()\n {\n }", "public function testGetNetworkSwitchStackRoutingInterface()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function: validatePoints Checks if the calculated data is correct up against SKAT Bowling API Adds value Validated to array. The SKAT Bowling API is not designed for live play mode, so it fails if for example a spare or strike is the last value.
public function validatePoints($framearray) { $json_data = array( 'token' => $framearray['token'], 'points' => $framearray['points'] ); $json = json_encode($json_data, true); $req_url = "http://37.139.2.74/api/points"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $req_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, count($json)); curl_setopt($curl, CURLOPT_HTTPHEADER, array( "Content-Type: application/json" )); curl_setopt($curl, CURLOPT_POSTFIELDS, $json); $result = curl_exec($curl); curl_close($curl); $result = json_decode($result); $framearray['validated'] = $result->success == 1 ? "true" : "false"; if ($result->success != 1) { Log::notice("Calculation doesn't match API? Is that right? - " . json_encode($framearray)); // We only notice, because the verify API is not designed to Live Play mode. } return $framearray; }
[ "public function validatePoints()\n {\n if ( $this->points_awarded > 100 ) {\n $this->addError('points_awarded', 'Marks should be less than a hundred');\n }\n }", "public function TestFunctionSetInvalidPointsGeneratedReturnsGivenPoints(){\r\n\t\tglobal $wgOut;\r\n\t\t$Point = new Point();\r\n\t\t$result = $Point->setPointsGenerated(500);\r\n\t\t// displays the result\r\n\t\t$wgOut->addHTML($result);\r\n\t}", "public function check_valid_user_point() {\r\n\t\tif($this->input->post('point') != '') {\r\n\t\t\t$user_point = $this->Company_model->get_point_user($this->input->post('introduce_uid'));\r\n\t\t\tif($user_point != FALSE) {\r\n\t\t\t\tif($user_point < $this->input->post('point')) {\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function addpoints(){\n\t\t$this->autoRender = false;\n\t\t\n\t\t//Login Check\n\t\tif (!$this->Session->read('userData')){\n\t\t\t$this->redirect(array('controller' => 'user', 'action' => 'login'));\n\t\t\t$this->set('loggedIn',false);\n\t\t}else{\n\t\t\t$this->set('loggedIn',true);\n\t\t}\n\t\tif ($this->request->is('post')) {\n\t\t\t$data = $this->request->data;\n\t\t\t\n\t\t\t//Validation of input data\n\t\t\t$this->Player->set($this->request->data);\n\t\t\tif ($this->Player->validates(array('fieldList' => array('id', 'points')))) {\n\t\t\t\t// validated inputs\n\t\t\t\ttry {\n\t\t\t\t\t$updated = $this->Player->addPoints($data);\n\t\t\t\t\t$this->redirect(array('controller' => 'player', 'action' => 'index'));\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->Session->setFlash('Error adding points', 'default', array('class' => 'bg-danger'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// invalid inputs\n\t\t\t\t$msg = '';\n\t\t\t\t$errors = $this->Player->validationErrors;\n\t\t\t\tforeach ($errors as $error){ $msg .= $error[0].'<br />'; };\n\t\t\t\t$this->Session->setFlash($msg, 'default', array('class' => 'bg-danger'));\n\t\t\t\t$this->redirect(array('controller' => 'player', 'action' => 'index'));\n\t\t\t}\n\t\t}\n\t}", "public function validate_point_product_purchase_order()\n {\n $points_used = $this->get_points_used();\n if (!$this->has_enough_points(get_current_user_id(), $points_used)) {\n $error = $this->text_no_point . ' The vendor may just changed the point to redeem an item.';\n\n if (current_action() === 'woocommerce_check_cart_items') {\n wc_add_notice(__($error, 'woocommerce'), 'error');\n return false;\n }\n if (current_action() === 'woocommerce_before_checkout_process') {\n throw new Exception(sprintf(__($error . ' <a href=\"%s\" class=\"wc-backward\">Return to cart</a>', 'woocommerce'), esc_url(wc_get_page_permalink('cart'))));\n }\n\n }\n }", "public function user_has_correct_amount_of_points()\n {\n $user = factory(User::class)->create();\n\n $subscriber = new Subscriber();\n\n $this->assertCount(0, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $user->givePoints($subscriber);\n\n $this->assertCount(1, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $this->assertEquals($subscriber->getModel()->points, $user->points()->number());\n }", "public function isEnoughPoints()\n\t{\n\t\t$baseGrandTotal = $this->getQuote()->getBaseGrandTotal()+$this->getQuote()->getBaseRewardCurrencyAmount();\n\t\treturn $this->getReward()->isEnoughPointsToCoverAmount($baseGrandTotal);\n\t}", "function InsertPlayerPoints(){\r\n\t\tglobal $sql;\r\n\r\n\t\t$guildid = $this->guild->id;\r\n\r\n\t\t//while were were scanning in dkp history data\r\n\t\t//we picked up a running total of each players dkp and lifetime dkp\r\n\t\t//we need to add that to the table now\r\n\r\n\t\t//each entry in dkpToAdd holds information for a single tableid\r\n\t\tforeach($this->dkpToAdd as $tableid => $table) {\r\n\t\t\tif($tableid == \"\")\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t//each entry for a tableid holds an array of all the players\r\n\t\t\t//in that table and what their dkp and total dkp should be\r\n\t\t\tforeach($table as $playerid => $entry){\r\n\r\n\t\t\t\t//load data from the structure\r\n\t\t\t\t$points = $entry[\"dkp\"];\r\n\t\t\t\t$totaldkp = $entry[\"totaldkp\"];\r\n\r\n\t\t\t\t$this->log .= \"Updating points for $playerid to $points / $totaldkp <br />\";\r\n\r\n\t\t\t\t//check to see if the user already exists with data\r\n\t\t\t\t$exists = $sql->QueryItem(\"SELECT id FROM dkp_points WHERE guild='$guildid' AND tableid='$tableid' AND user='$playerid'\");\r\n\r\n\t\t\t\t//if they do not exist, set their dkp and total dkp to what we calculated\r\n\t\t\t\tif($exists==\"\"){\r\n\t\t\t\t\t$sql->Query(\"INSERT INTO dkp_points SET user='$playerid',tableid='$tableid', guild='$guildid', lifetime='$totaldkp', points='$points'\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if the user already exists in the dkp table, just update their current values\r\n\t\t\t\telse {\r\n\t\t\t\t\t$sql->Query(\"UPDATE dkp_points set points=points+'$points', lifetime=lifetime+'$totaldkp' WHERE user='$playerid' AND tableid='$tableid' AND guild='$guildid'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function isEnoughPoints()\n\t{\n\t\t$baseGrandTotal = df_quote()->getBaseGrandTotal() + df_quote()->getBaseRewardCurrencyAmount();\n\t\treturn $this->getReward()->isEnoughPointsToCoverAmount($baseGrandTotal);\n\t}", "public function testAddPoints()\n {\n $game = new Game([\"Computer\", \"Me\"], 100, 2);\n $this->assertInstanceOf(\"\\Peo\\Dice\\Game\", $game);\n\n // Roll the dices\n $game->roll();\n $res = $game->getSumCurrent();\n\n // First check that points are null for both players\n $players = $game->getPlayers();\n $this->assertNull($players[\"Computer\"]);\n $this->assertNull($players[\"Me\"]);\n\n // Add the $points\n $game->addPoints(\"Computer\");\n $game->addPoints(\"Me\");\n\n // Check that points are correct after adding\n $players = $game->getPlayers();\n $this->assertEquals($res, $players[\"Computer\"]);\n $this->assertEquals($res, $players[\"Me\"]);\n }", "function checkSeatData(){\n global $seatsErrors;\n global $totalTickets;\n global $pricesObject;\n if(isset($_POST['seats'])) { //maybe don't need this check\n if(!is_array($_POST['seats']) || !count($_POST['seats']>0)){\n $seatsErrors++;\n }\n else{\n foreach($_POST['seats'] as $seatCode => $qty) {\n if(!isset($pricesObject['MT'][$seatCode])) {\n $seatsErrors++;\n }\n else {\n if(!preg_match(\"#[0-9]$#\",$qty)) {\n $seatsErrors++;\n }\n else {\n $totalTickets += $qty;\n }\n }\n }\n }\n }\n }", "public function calculateNHLPointsFunctions($plrData){\n \n $points = array();\n $i = 0;\n \n foreach ($plrData as $plrstat){ \n \n $goals = 0;\n $assists = 0;\n $shots_on_goal = 0;\n $blocked_shots = 0;\n $ShortHandedPointBonus = 0;\n $HatTrickBonus = 0;\n $sh_goals = 0;\n $Win = 0;\n $saves = 0;\n $goals_against = 0;\n $Shutout_Bonus = 0;\n \n if(isset($plrstat['goals'])){\n \n $goals = $plrstat['goals'] * 3;\n $points[$plrstat['id']]['scroing']['G'] = $plrstat['goals'];\n \n if ($plrstat['goals'] >= 3) {\n \n $hatTric = intval($plrstat['goals'] / 3);\n $HatTrickBonus = intval($hatTric) * 1.5;\n $points[$plrstat['id']]['scroing']['HAT']= intval($hatTric);\n } \n }\n \n if(isset($plrstat['assists'])){\n \n $assists = $plrstat['assists'] * 2;\n $points[$plrstat['id']]['scroing']['A'] = $plrstat['assists'];\n }\n \n if(isset($plrstat['shots_on_goal'])){\n \n $shots_on_goal = $plrstat['shots_on_goal'] * 0.3;\n $points[$plrstat['id']]['scroing']['SOG']=$plrstat['shots_on_goal'];\n }\n \n if(isset($plrstat['blocked_shots'])){\n \n $blocked_shots = $plrstat['blocked_shots'] * 0.5;\n $points[$plrstat['id']]['scroing']['BS']=$plrstat['blocked_shots'];\n }\n \n if(isset($plrstat['goals']) && isset($plrstat['assists'])){\n \n $ShortHandedPointBonus = $plrstat['goals'] + $plrstat['assists'];\n $points[$plrstat['id']]['scroing']['ShPB']=$ShortHandedPointBonus;\n }\n \n if(isset($plrstat['sh_goals'])){\n \n $sh_goals = $plrstat['sh_goals'] * 0.2; \n $points[$plrstat['id']]['scroing']['SH']=$plrstat['sh_goals'];\n }\n \n if(isset($plrstat['credit']) && $plrstat['credit'] = \"W\"){\n \n $Win = 3;\n $points[$plrstat['id']]['scroing']['W']= 1;\n }\n \n if(isset($plrstat['saves'])){\n \n $saves = $plrstat['saves'];\n $points[$plrstat['id']]['scroing']['SV']=$saves;\n }\n \n if(isset($plrstat['goals_against'])){\n \n $goals_against = $plrstat['goals_against'] * (-1);\n $points[$plrstat['id']]['scroing']['GA']=$plrstat['goals_against'];\n }\n \n if(isset($plrstat['so'])){\n \n $Shutout_Bonus = $plrstat['so'] * 2;\n $points[$plrstat['id']]['scroing']['SO']=$plrstat['so'];\n }\n \n $points[$plrstat['id']]['fpts'] = $goals + $assists + $shots_on_goal\n + $blocked_shots + $ShortHandedPointBonus \n + $HatTrickBonus + $sh_goals + $Win + $saves \n + $goals_against + $Shutout_Bonus;\n \n }\n\n if (!empty($points)) {\n return $points;\n }\n }", "public function a_point_has_correct_points()\n {\n $points = 100;\n\n $point = factory(Point::class)->create(['name' => 'Green', 'key' => 'green', 'points' => $points]);\n\n $this->assertEquals($points, $point->points);\n }", "function culturefeed_userpoints_ui_exchange_form_validate($form, &$form_state) {\n\n $count = CultureFeedUserpointsWishlist::getIds();\n if ($count <= 0) {\n form_set_error('', t('You must choose at least one promotion.'));\n }\n\n try {\n\n $user_points = DrupalCultureFeed::getLoggedInUser()->points;\n $form_state['points_left'] = CultureFeedUserpointsWishlist::getPointsLeft($user_points);\n if ($form_state['points_left'] < 0) {\n form_set_error('', t('You do not have enough points to order this'));\n }\n\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_userpoints_ui', $e);\n }\n\n try {\n $cf_user = DrupalCultureFeed::getLoggedInUser();\n $form_state['pointsPromotions'] = DrupalCultureFeed::cashInPromotion($cf_user->id, CultureFeedUserpointsWishlist::getIds(), CultureFeedUserpointsWishlist::getCounts());\n }\n catch (CultureFeed_Exception $e) {\n\n if ($e->getCode() == CultureFeed_PointsPromotion::CASHIN_PROMOTION_NOT_ALLOWED) {\n form_set_error('', t('You are not allowed to cashin this promotions because the allowed amount has been exceeded.'));\n }\n else {\n form_set_error('', t('It is not possible to process the order'));\n }\n watchdog_exception('culturefeed_userpoints_ui', $e);\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_userpoints_ui', $e);\n form_set_error('', t('It is not possible to process the order'));\n }\n}", "public function check_enough_point()\n {\n // Check ajax\n if (!$this->input->post() || !$this->input->is_ajax_request() || !$this->session->userdata('switch_student_id') || !$this->input->post('pack')) {\n return $this->_render_404();\n }\n\n $target_id = $this->session->userdata('switch_student_id');\n\n // Get contract monthly payment of this student\n $contract = $this->_api('user_contract')->get_detail([\n 'user_id' => $target_id\n ]);\n\n if (isset($contract['result']) && $contract['result']['status'] != 'under_contract') {\n return $this->_render_404();\n }\n\n // Call API check enough point to exchange\n $res = $this->_api('point_exchange')->confirm_exchange([\n 'user_id' => $this->current_user->id,\n 'target_id' => $target_id,\n 'pack' => $this->input->post('pack'),\n 'ip_address' => $this->input->ip_address()\n ]);\n\n // Return\n if (isset($res['result'])) {\n return $this->_true_json();\n }\n\n return $this->_false_json(APP_Response::BAD_REQUEST);\n }", "public function getCanUseRewardPoints()\n {\n /** @var $helper \\Magento\\Reward\\Helper\\Data */\n $helper = $this->_rewardData;\n if (!$helper->getHasRates() || !$helper->isEnabledOnFront()) {\n return false;\n }\n\n $minPointsToUse = (double)$helper->getGeneralConfig(\n 'min_points_balance',\n (int)$this->_storeManager->getWebsite()->getId()\n );\n $pointsBalance = (double)$this->getPointsBalance();\n if ((double)$this->getCurrencyAmount() > 0\n && $pointsBalance >= $minPointsToUse\n && (double)$this->getQuote()->getBaseRewardCurrencyAmount()\n ) {\n return true;\n };\n\n if (!min($pointsBalance, (double)$this->getQuote()->getBaseGrandTotal())) {\n return false;\n };\n\n return true;\n }", "protected function _validateAddedData()\n {\n //check need product data params\n foreach ($this->_needParams as $key => $value) {\n if ($this->_isKittingProduct && array_key_exists($key, $this->_kittingProductAutoAdd)) {\n continue;\n }\n\n if ($key == 'product_code') {\n $product = Product::where('product_code', $this->_productParams[$key])->get();\n if (!$product->isEmpty()) {\n $this->errorMessage .= \"SKU have existed in system . \\n\";\n echo $this->errorMessage;\n }\n }\n\n if (is_null($this->_productParams[$key])) {\n $this->errorMessage .= \"need {$key} data .\\n\";\n echo $this->errorMessage;\n }\n }\n\n //check need additional data params\n foreach ($this->_needAdditionalParams as $key => $value) {\n if ($this->_isKittingProduct && array_key_exists($key, $this->_kittingProductAutoAdd)) {\n continue;\n }\n\n if (is_null($this->_productAdditionalParams[$key])) {\n $this->errorMessage .= \"need {$key} data .\\n\";\n }\n }\n\n //validate some data\n $validateDataResult = $this->_product->validateData();\n if ($validateDataResult != true) {\n $this->errorMessage .= $validateDataResult;\n }\n\n //check price and cost\n $cost = trim($this->_productAdditionalParams['cost']);\n $price = trim($this->_productParams['Price']);\n\n if (!is_null($cost)) {\n $cost = round(floatval($cost), 2);\n $this->_productAdditionalParams['cost'] = $cost;\n }\n\n if (!is_null($price)) {\n $price = round(floatval($cost), 2);\n $this->_productParams['Price'] = $price;\n }\n\n if (!is_null($price) && !is_null($cost) && ($cost > $price)) {\n $this->errorMessage .= \"Price is lower than cost .\\n\";\n echo $this->errorMessage;\n }\n\n if (!is_null($price) && $price <= 0) {\n $this->errorMessage .= \"Only gift item can be set $0.\\n\";\n }\n\n $result = $this->errorMessage != '' ? $this->errorMessage : true;\n\n return $result;\n\n\n }", "function add_points(){\r\n \tif(empty($this->data['User']['points'])){\r\n \t\t$this->Session->setFlash('The quantity of points cannot be empty');\r\n \t\t$this->redirect(array('controller' => 'admin_points', 'action' => 'listUsersPoints'));\r\n \t}\r\n \tif(!is_numeric($this->data['User']['points'])){\r\n \t\t$this->Session->setFlash('The quantity of points must be numbers');\r\n \t\t$this->redirect(array('controller' => 'admin_points', 'action' => 'listUsersPoints'));;\r\n \t}\r\n\r\n \t$user = $this->getConnectedUser();\r\n\r\n \t$crit = $this->Criteria->getCriteriabyUser($this->data['Criteria']['id'], $user['User']['id']);\r\n\r\n \tif(empty($crit)){\r\n \t\t$this->Session->setFlash('Permission Denied', 'flash_errors');\r\n \t\t$this->redirect('/');\r\n \t}\r\n\r\n \t/*Get criterias user*/\r\n \t$crit_user = $this->Criteria->getCriteriabyUser($this->data['Criteria']['id'], $this->data['User']['id'], array(1, 2));\r\n\r\n \t/*If crit_user is empty, then there wasn't a criterias_user and we create it, otherwise we only modify the points*/\r\n \tif(empty($crit_user)){\r\n \t\t$row['criteria_id'] = $this->data['Criteria']['id'];\r\n \t\t$row['user_id'] = $this->data['User']['id'];\r\n \t\t$row['score_obtained'] = $this->data['User']['points'] >= 0 ? $this->data['User']['points'] : 0;\r\n \t\t$row['quality_user_id'] = 2;\r\n \t\t$row['successful_evaluation'] = 0;\r\n \t\t$row['negative_evaluation'] = 0;\r\n \t\t$row['activation_id'] = 'A';\r\n \t\t$row['internalstate_id'] = 'A';\r\n \t}\r\n \telse{\r\n \t\t$this->CriteriasUser->id = $crit_user[0]['CriteriasUser']['id'];\r\n \t\t$row['score_obtained'] = $crit_user[0]['CriteriasUser']['score_obtained'] + $this->data['User']['points'];\r\n \t\tif($row['score_obtained'] < 0)\r\n \t\t\t$row['score_obtained'] = 0;\r\n \t}\r\n\r\n \tif($this->CriteriasUser->save($row)){\r\n \t\t$this->Session->setFlash('Points successfully added to user', 'flash_green');\r\n \t}\r\n \telse{\r\n \t\t$this->Session->setFlash('There was an error, please blame the developer', 'flash_errors');\r\n \t}\r\n\r\n \t$this->redirect(array('controller' => 'admin_points', 'action' => 'listUsersPoints'));\r\n }", "private function processControlPoints()\n {\n $previousPoint = new Point(-101.111, -2345234.333);\n\n $removed = 0;\n /* @var $cp Point */\n foreach ($this->controlPoints as $key => $cp) {\n if ($cp->closeEnough($previousPoint)) {\n MapUtility::debug(\"Dumping useless duplicate point on curve ($previousPoint =~ $cp)\\n\");\n unset($this->controlPoints[$key]);\n $removed++;\n }\n $previousPoint = $cp;\n }\n\n if ($removed > 0) {\n // if points are removed, there are gaps in the index values. Other things assume they are in sequence\n $this->controlPoints = array_values($this->controlPoints);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation replaceCustomerByIdAsync Replace Customer
public static function replaceCustomerByIdAsync($customer_id, $customer) { return self::replaceCustomerByIdAsyncWithHttpInfo($customer_id, $customer) ->then( function ($response) { return $response[0]; } ); }
[ "public function testReplace(): void {\n $ids = [];\n $model = $this->getModel('customer');\n\n if(!($this instanceof \\codename\\core\\tests\\model\\schematic\\mysqlTest)) {\n $this->markTestIncomplete('Upsert is working differently on this platform - not implemented yet!');\n }\n\n $model->save([\n 'customer_no' => 'R1000',\n 'customer_notes' => 'Replace me'\n ]);\n $ids[] = $firstId = $model->lastInsertId();\n\n $model->replace([\n 'customer_no' => 'R1000',\n 'customer_notes' => 'Replaced'\n ]);\n\n $dataset = $model->load($firstId);\n $this->assertEquals('Replaced', $dataset['customer_notes']);\n\n foreach($ids as $id) {\n $model->delete($id);\n }\n }", "protected static function replaceCustomerByIdRequest($customer_id, $customer) \n {\n // verify the required parameter 'customer_id' is set\n if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_id when calling replaceCustomerById'\n );\n }\n // verify the required parameter 'customer' is set\n if ($customer === null || (is_array($customer) && count($customer) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer when calling replaceCustomerById'\n );\n }\n\n $resourcePath = '/customers/{customerId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n '{' . 'customerId' . '}',\n ObjectSerializer::toPathValue($customer_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($customer)) {\n $_tempBody = $customer;\n }\n\n if ($multipart) {\n $headers = self::getHeaderSelector()->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = self::getHeaderSelector()->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\n $defaultHeaders = [];\n if (self::getConfig()->getUserAgent()) {\n $defaultHeaders['User-Agent'] = self::getConfig()->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 'PUT',\n self::getConfig()->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateCustomer($customer)\n {\n }", "public function setCustomerId($value);", "public function customersIdReplacePostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling customersIdReplacePost');\n }\n // parse inputs\n $resourcePath = \"/Customers/{id}/replace\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Customer',\n '/Customers/{id}/replace'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Customer', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Customer', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "protected static function replaceCustomerByIdWithHttpInfo($customer_id, $customer)\n {\n $returnType = '\\Tradenity\\SDK\\Resources\\Customer'; \n $request = self::replaceCustomerByIdRequest($customer_id, $customer); \n\n try {\n $options = self::createHttpClientOption();\n try {\n $response = self::getHttpClient()->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Tradenity\\SDK\\Resources\\Customer',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function patch($customerId, Customer $postBody, $optParams = array()) {\n $params = array('customerId' => $customerId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('patch', array($params));\n if ($this->useObjects()) {\n return new Customer($data);\n } else {\n return $data;\n }\n }", "public function update_put(){\n $response = $this->CustomerModel->update_customer(\n $this->put('id'),\n $this->put('name'),\n\t\t$this->put('email'),\n\t\t$this->put('password'),\n\t\t$this->put('gender'),\n\t\t$this->put('is_married'),\n $this->put('address')\n );\n $this->response($response);\n }", "public function testUpdateCustomer() {\n $store_id = 'MC001';\n $customer = [\n 'id' => 'cust0001',\n 'email_address' => 'freddie@freddiesjokes.com',\n 'opt_in_status' => TRUE,\n ];\n\n $mc = new MailchimpEcommerce();\n $mc->updateCustomer($store_id, $customer);\n\n $this->assertEquals('PATCH', $mc->getClient()->method);\n $this->assertEquals($mc->getEndpoint() . '/ecommerce/stores/' . $store_id . '/customers/' . $customer['id'], $mc->getClient()->uri);\n\n $this->assertNotEmpty($mc->getClient()->options['json']);\n\n $request_body = $mc->getClient()->options['json'];\n\n $this->assertEquals($customer['id'], $request_body->id);\n $this->assertEquals($customer['email_address'], $request_body->email_address);\n $this->assertEquals($customer['opt_in_status'], $request_body->opt_in_status);\n }", "function update_customer($data, $id)\n\t{\n\t\t$this->path = \"/api/customers/update/id/$id\";\n\t\treturn $this->_send_request($data);\n\t}", "public function setCustomerId(?string $customerId): void\n {\n $this->customerId = $customerId;\n }", "private function registerCustomerId(int $customerId): void\n {\n $this->registry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID);\n $this->registry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId);\n }", "public function createOrUpdateCustomer(Mage_Customer_Model_Customer $customer)\n {\n // Get API Helper\n /** @var SFC_Autoship_Helper_Api $apiHelper */\n $apiHelper = Mage::helper('autoship/api');\n\n // Query for current customer\n $response = $apiHelper->fetchCustomers(\n array(\n 'email' => $customer->getData('email'),\n ));\n // Check response for HTTP status code\n if ($response['code'] != 200) {\n Mage::throwException('Failed to find ');\n }\n // Parse customer id out of response\n $result = $response['result'];\n $platformCustomers = $result['customers'];\n // Check that we have found exactly 1 customer\n if (!is_array($platformCustomers)) {\n Mage::throwException($this->__('Failed to read response from platform while querying for customer!'));\n }\n if (count($platformCustomers) > 1) {\n Mage::throwException($this->__('Found more than 1 matching customer on platform!'));\n }\n if (count($platformCustomers) == 1) {\n // Found customer, now lets update him\n // Get id of found customer\n $platformCustomer = $platformCustomers[0];\n if (!is_array($platformCustomer) || !isset($platformCustomer['id'])) {\n Mage::throwException($this->__('Failed to read response from platform while querying for customer!'));\n }\n\n // Update this customer\n return $this->updateCustomer($platformCustomer['id'], $customer);\n }\n else {\n // Didn't find existing customer, lets create him\n return $this->createCustomer($customer);\n }\n }", "public function asyncModifyExistingCustomer(ModifyExistingCustomerRequest $request): PromiseInterface\n {\n return $this->httpClient->sendAsync(\n $request->toResourceRequest(),\n $request->toRequestOptions()\n );\n }", "private function updateNaturalCustomerAction($customer_id, $frozen)\n {\n //query\n\t\t$natural_customer = $this->getDoctrine()\n ->getRepository('StockAccountBundle:NaturalCustomer')\n ->find($customer_id);\n\t\t//response if not found\n if(!isset($natural_customer)){\n throw $this->createNotFoundException('No natural customer found for customer_id ' .$customer_id);\n }\n\t\t//freeze or thaw\n $natural_customer->setFrozen($frozen);\n\n $em = $this->getDoctrine()->getManager();\n $em->flush();\n }", "public function customerShouldBeFetchedByCustomerIdAndUpdatedIfItAlreadyExists(): void\n {\n $customerId = str_replace(' ', '', microtime());\n\n try {\n // fetch non-existing customer by customerId\n $this->heidelpay->fetchCustomerByExtCustomerId($customerId);\n $this->assertTrue(false, 'Exception should be thrown here.');\n } catch (HeidelpayApiException $e) {\n $this->assertEquals(ApiResponseCodes::API_ERROR_CUSTOMER_CAN_NOT_BE_FOUND, $e->getCode());\n $this->assertNotNull($e->getErrorId());\n }\n\n // create customer with api\n $customer = $this->heidelpay->createOrUpdateCustomer($this->getMaximumCustomer()->setCustomerId($customerId));\n $this->assertNotEmpty($customer->getCustomerId());\n $this->assertEquals($customerId, $customer->getCustomerId());\n $this->assertEquals('Peter', $customer->getFirstname());\n\n $newCustomerData = $this->getMaximumCustomer()->setCustomerId($customerId)->setFirstname('Petra');\n $this->heidelpay->createOrUpdateCustomer($newCustomerData);\n\n $this->assertEquals('Petra', $newCustomerData->getFirstname());\n $this->assertEquals($customerId, $newCustomerData->getCustomerId());\n $this->assertEquals($customer->getId(), $newCustomerData->getId());\n }", "public function testUpdateCustomer()\n {\n }", "public function update($customerId, Google_Service_Reseller_Customer $postBody, $optParams = array())\r\n {\r\n $params = array('customerId' => $customerId, 'postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('update', array($params), \"Google_Service_Reseller_Customer\");\r\n }", "public function testUpdateCustomerPrimaryCardToken(): void\n {\n $cardToken = $this->createCardToken('master');\n\n $customerToken = $this->createCardCustomerToken('test_update_customer_card@example.com', 'visa');\n\n $parameter = new UpdateCustomerPrimaryCardTokenParameter($cardToken);\n $response = $this->pinClient->updateCustomer($customerToken, $parameter);\n\n $this->assertSame(200, $response->getStatusCode());\n $this->assertSame('master', $response->toArray()['response']['card']['scheme']);\n\n $this->pinClient->deleteCustomer($customerToken);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the mapping from filename to ImageInfo
public function getUserImageMapping() { $images = Image::get(); $mapping = []; foreach ($images as $image) { /* @var Image $image */ $filename = $image->Filename; if (!strpos($filename, 'assets/')) { $filename = 'assets/' . $filename; } $mapping[$filename] = (new ImageInfo) ->setID($image->ID) ->setFilename($image->Filename) ->setURL($image->getURL()); } return $mapping; }
[ "public function getImageInfo(string $file): ImageInfo\n {\n return new $this->imageInfoClass($file);\n }", "private function imageInfo()\n\t{\n\t\t// imagem de origem\n\t\t$pathinfo = pathinfo($this->path);\n\t\t$this->extension = strtolower($pathinfo['extension']);\n\t\t$this->file \t = $pathinfo['basename'];\n\t\t$this->dir \t\t = $pathinfo['dirname'];\n\t\t$this->size \t = filesize($this->path);\n\t\t\n\t}", "public function createInfo($imageName)\n {\n return new ImageInfo($imageName);\n }", "function image_info($file = null, $out = null) \r\n{\r\n // If $file is not supplied or is not a file, warn the user and return false.\r\n if (is_null($file) || !is_file($file)) \r\n {\r\n return false;\r\n }\r\n\r\n // Defines the keys we want instead of 0, 1, 2, 3, 'bits', 'channels', and 'mime'.\r\n $redefine_keys = array(\r\n 'width',\r\n 'height',\r\n 'type',\r\n 'attr',\r\n 'bits',\r\n 'channels',\r\n 'mime',\r\n );\r\n\r\n // If $out is supplied, but is not a valid key, nullify it.\r\n if (!is_null($out) && !in_array($out, $redefine_keys)) $out = null;\r\n\r\n // Assign usefull values for the third index.\r\n $types = array(\r\n 1 => 'GIF',\r\n 2 => 'JPG',\r\n 3 => 'PNG',\r\n 4 => 'SWF',\r\n 5 => 'PSD',\r\n 6 => 'BMP',\r\n 7 => 'TIFF(intel byte order)',\r\n 8 => 'TIFF(motorola byte order)',\r\n 9 => 'JPC',\r\n 10 => 'JP2',\r\n 11 => 'JPX',\r\n 12 => 'JB2',\r\n 13 => 'SWC',\r\n 14 => 'IFF',\r\n 15 => 'WBMP',\r\n 16 => 'XBM'\r\n );\r\n $temp = array();\r\n $data = array();\r\n\r\n // Get the image info using getimagesize().\r\n // If $temp fails to populate, warn the user and return false.\r\n if (!$temp = getimagesize($file)) {\r\n return false;\r\n }\r\n\r\n // Get the values returned by getimagesize()\r\n $temp = array_values($temp);\r\n\r\n // Make an array using values from $redefine_keys as keys and values from $temp as values.\r\n foreach ($temp AS $k => $v) {\r\n $data[$redefine_keys[$k]] = $v;\r\n }\r\n\r\n // Make 'type' usefull.\r\n $data['type'] = strtolower($types[$data['type']]);\r\n\r\n // Return the desired information.\r\n return !is_null($out) ? $data[$out] : $data; \r\n}", "function getMapImage(){\n\t\t$out\t= null;\n\t\t\n\t\t/**\n\t\t * Check of image type.\n\t\t * @var Integer hods the typ of image ([1] Graphics Interchange, [2] Joint Photographic Experts Group, [3] Portable Network Graphics)\n\t\t */\n\t\t$type\t= exif_imagetype( $this->config->getConfig( 'MAP_PATH' ) );\n\n\t\t/**\n\t\t * Loding the image with the applicable method.\n\t\t */\n\t\tswitch ($type) { \n\t\t\tcase 1 : \n\t\t\t\t$out = imageCreateFromGif( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t\tcase 2 : \n\t\t\t\t$out = imageCreateFromJpeg( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t\tcase 3 : \n\t\t\t\t$out = imageCreateFromPng( $this->config->getConfig( 'MAP_PATH' ) ); \n\t\t\tbreak; \n\t\t} \n\n\t\treturn $out;\n\t}", "public function addImageMapping($filename, $newFilename);", "private function imageInfo() {\n\n $image = getimagesize($this->image);\n\n $info = array();\n\n $info['width'] = $image[0];\n $info['height'] = $image[1];\n $info['ratio'] = $image[0]/$image[1];\n $info['mime'] = $image['mime'];\n\n return $info;\n\n }", "function ag_imageInfo($imageURL){\n\n list($width, $height, $type, $attr) = getimagesize($imageURL);\n\n $types = Array(\n 1 => 'GIF',\n 2 => 'JPG',\n 3 => 'PNG',\n 4 => 'SWF',\n 5 => 'PSD',\n 6 => 'BMP',\n 7 => 'TIFF(intel byte order)',\n 8 => 'TIFF(motorola byte order)',\n 9 => 'JPC',\n 10 => 'JP2',\n 11 => 'JPX',\n 12 => 'JB2',\n 13 => 'SWC',\n 14 => 'IFF',\n 15 => 'WBMP',\n 16 => 'XBM'\n );\n\n if($type){\n\n return $imageInfo = array(\n \"width\" => $width,\n \"height\" => $height,\n \"type\" => $types[$type],\n \"size\" => filesize($imageURL)\n );\n\n }\n\n }", "public function getImageMap() \n\t{\n\t\treturn $this->_imageMap;\n\t}", "public function getImageInfo()\r\n\t{\r\n\t\treturn $this->image_info;\r\n\t}", "public function getImageInfo() \n {\n \treturn $this->imageInfo;\n }", "protected function getMenuItem_ImageInfo()\t{\n\t\tglobal $LANG;\n\t\t$HTML = '';\n\t\t$HTML .= '<div class=\"kb_imageedit-dynTab\">'.chr(10);\n\t\t$HTML .= '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"kb_imageedit-actiontable\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"label\">\n\t\t\t\t\t\t'.$LANG->getLL('filename').'\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"value\">\n\t\t\t\t\t\t'.$this->baseFile.'\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"label\">\n\t\t\t\t\t\t'.$LANG->getLL('image_size').'\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"value\">\n\t\t\t\t\t\t'.$this->x.' x '.$this->y.' '.$LANG->getLL('pixels').'\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"label\">\n\t\t\t\t\t\t'.$LANG->getLL('format').'\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"value\">\n\t\t\t\t\t\t'.$this->format.'\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>'.chr(10);\n\t\t$HTML .= '</div>'.chr(10);\n\t\treturn array(\n\t\t\t'label' => $LANG->getLL('imageinfo_label'),\n\t\t\t'description' => $LANG->getLL('imageinfo_description'),\n\t\t\t'linkTitle' => $LANG->getLL('imageinfo_description'),\n\t\t\t'content' => $HTML,\n\t\t\t'stateIcon' => 2,\n\t\t);\n\t}", "public function getFileAssignMap()\n {\n return [\n 'contentHash' => 'filename',\n ];\n }", "function _image_info_imagick($file_path = \"\") {\n\t\t$result = array();\n\t\tif (!$file_path || !file_exists($file_path)) {\n\t\t\treturn $result;\n\t\t}\n\t\t$PATH_TO_IMAGICK = $this->FOUND_IMAGICK_PATH;\n\n\t\t$identify_result = exec($PATH_TO_IMAGICK.'identify -format %m#%w#%h* '.$file_path);\n\n\t\t// Parse result\n\t\tlist($result[\"type\"], $result[\"width\"], $result[\"height\"]) = explode(\"#\", substr($identify_result, 0, strpos($identify_result, \"*\")));\n\t\t$result[\"type\"] = strtolower($result[\"type\"]);\n\n\t\treturn $result;\n\t}", "public function get_file_info($file)\n\t{\n\t\tee()->load->library('image_lib');\n\n\t\treturn ee()->image_lib->get_image_properties($file, TRUE);\n\t}", "function image_URL_metadata($file_path) {\n $image_info = array();\n $ext = get_file_extension($file_path);\n $image_info['guid'] = get_guid();\n $image_info['name'] = basename($file_path, \".\".$ext);\n $image_info['type'] = get_file_extension($file_path);\n $image_info['width'] = getimagesize($file_path)[0];\n $image_info['height'] = getimagesize($file_path)[1];\n $image_info['size'] = remote_filesize($file_path);\n $image_info['timeCreated'] = remote_time($file_path);\n $image_info['timeEntered'] = time();\n $image_info['path'] = $file_path;\n\n return $image_info;\n}", "function getImageFilename(){}", "public function _image_info_imagick($file_path = '')\n {\n $img = new Imagick($file_path);\n $type_by_mime = [\n 'image/jpeg' => 'jpeg',\n 'image/pjpeg' => 'jpeg',\n 'image/png' => 'png',\n 'image/gif' => 'gif',\n ];\n return [\n 'type' => $type_by_mime[$img->getImageMimeType()],\n 'width' => $img->getImageWidth(),\n 'height' => $img->getImageHeight(),\n ];\n }", "private function gatherImageMeta() {\n \t//only attempt to retrieve info if exif exists\n \tif(function_exists(\"exif_read_data\") && $this->format == 'JPG') {\n\t\t\t$imageData = exif_read_data($this->fileName);\n\t\t\tif(isset($imageData['Make'])) \n\t\t\t\t$this->imageMeta['make'] = ucwords(strtolower($imageData['Make']));\n\t\t\tif(isset($imageData['Model'])) \n\t\t\t\t$this->imageMeta['model'] = $imageData['Model'];\n\t\t\tif(isset($imageData['COMPUTED']['ApertureFNumber'])) {\n\t\t\t\t$this->imageMeta['aperture'] = $imageData['COMPUTED']['ApertureFNumber'];\n\t\t\t\t$this->imageMeta['aperture'] = str_replace('/','',$this->imageMeta['aperture']);\n\t\t\t}\n\t\t\tif(isset($imageData['ExposureTime'])) {\n\t\t\t\t$exposure = explode('/',$imageData['ExposureTime']);\n\t\t\t\t$exposure = round($exposure[1]/$exposure[0],-1);\n\t\t\t\t$this->imageMeta['exposure'] = '1/' . $exposure . ' second';\n\t\t\t}\n\t\t\tif(isset($imageData['Flash'])) {\n\t\t\t\tif($imageData['Flash'] > 0) {\n\t\t\t\t\t$this->imageMeta['flash'] = 'Yes';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->imageMeta['flash'] = 'No';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($imageData['FocalLength'])) {\n\t\t\t\t$focus = explode('/',$imageData['FocalLength']);\n\t\t\t\t$this->imageMeta['focalLength'] = round($focus[0]/$focus[1],2) . ' mm';\n\t\t\t}\n\t\t\tif(isset($imageData['DateTime'])) {\n\t\t\t\t$date = $imageData['DateTime'];\n\t\t\t\t$date = explode(' ',$date);\n\t\t\t\t$date = str_replace(':','-',$date[0]) . ' ' . $date[1];\n\t\t\t\t$this->imageMeta['dateTaken'] = date('m/d/Y g:i A',strtotime($date));\n\t\t\t}\n \t}\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optional. The ID of the `base` model. If it is specified, the new model will be created based on the `base` model. Otherwise, the new model will be created from scratch. The `base` model must be in the same `project` and `location` as the new model to create, and have the same `model_type`. Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL];
public function setBaseModelId($var) { GPBUtil::checkString($var, True); $this->base_model_id = $var; return $this; }
[ "public function setBaseId($base_id)\n {\n $this->base_id = $base_id;\n\n return $this;\n }", "public function setBaseId( $baseid );", "function get_base_id()\n\t{\n\t\treturn( $this->base_id );\n\t}", "public function getBaseId()\n\t{\n\t\treturn $this->base_id;\n\t}", "private function setBaseId($id) {\n $this->base_id = $id;\n }", "public function getIdBase()\n\t {\n\t return $this->IdBase;\n\t }", "public function baseModel()\n {\n return $this->model;\n }", "public function getBaseId()\n {\n return $this->baseId;\n }", "public function loadBaseModel(){ \n $this->baseDTO = new Steam_DTO('baseModel', $this->baseData, $this->convert);\n $baseForm = new Steam_Model_BaseForm();\n if ($baseForm->isValid($this->baseDTO->unload())){\n $this->sMc->loadBaseModel($this->baseDTO);\n $this->sMc->setStatus('Base Model Loaded'); \n }else{ \n $this->sMc->setStatus('Base Model Invalid. Manual re-entry required.',true); \n $this->corruptUpload = true;\n }\n }", "public function setBaseId( $value );", "public function _setIdBase($IdBase)\n\t {\n\t $this->IdBase = $IdBase;\n\t }", "public function setBase($var)\n {\n GPBUtil::checkMessage($var, \\Grpc\\Common\\BaseRequest::class);\n $this->base = $var;\n\n return $this;\n }", "protected function getBaseId()\n\t{\n\t\t$base_id = \"{$this->getPrefix()}-{$this->getIdSuffix()}\";\n\t\treturn strtolower($base_id);\n\t}", "public function generateBaseModalAction()\n {\n $base_id = $this->_getParam('base_id');\n $site_id = $this->_getParam('site_id');\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $site_id);\n $newDefault = false;\n\n // if we didn't get an actual id, that means we have a new default clinical department to add\n if ($base_id && !is_numeric($base_id)) {\n $base_name = array_shift(explode(\"_\", \"$base_id\"));\n $new_base = new \\Fisdap\\Entity\\BaseLegacy;\n $new_base->name = $base_name;\n $new_base->site = $site;\n\n // default the address to the site's address\n $new_base->address = $site->address;\n $new_base->city = $site->city;\n $new_base->state = $site->state;\n $new_base->zip = $site->zipcode;\n\n $new_base->save();\n\n // if we're creating the default clinical department on modal launch, it is not active, by definition\n // because it would have been created when it first activated\n $this->view->program->addBase($new_base, false);\n\n $base_id = $new_base->id;\n $newDefault = true;\n }\n\n $form = new Account_Form_Modal_BaseModal($site, $base_id);\n $this->_helper->json(array(\"modalHTML\" => $form->__toString(), \"baseId\" => $base_id, \"newDefault\" => $newDefault));\n }", "public static function getObjectTypeId( $baseType )\n {\n $types = self::getCMISTypes();\n $result = $baseType;\n\n foreach ( $types as $objectTypeId => $type )\n {\n if ( $type == $baseType )\n {\n $result = $objectTypeId;\n break;\n }\n }\n\n return $objectTypeId;\n }", "protected function get_file_base_from_id_base( string $id_base ): string {\n\t\treturn str_replace( '_', '-', $id_base );\n\t}", "public function setModelTypeId($var)\n {\n GPBUtil::checkString($var, True);\n $this->model_type_id = $var;\n\n return $this;\n }", "public function getIdBaseName()\n {\n if (empty($this->idBaseName)) {\n $this->idBaseName = lcfirst($this->getModelName());\n }\n return $this->idBaseName;\n }", "public function setModelId($var)\n {\n GPBUtil::checkString($var, True);\n $this->model_id = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the viewPath parameter. The value needs to be string or null.
public static function setViewPath($value): void { self::isOfType('string', $value, self::INVALID_VIEW_PATH_TYPE); self::$viewPath = $value; }
[ "public function setViewPath($path)\n {\n $len = strlen($path) - 1;\n if ($path[$len] == '/') {\n $path = substr($path, 0, -1);\n }\n $realpath = realpath($path);;\n $this->_path = $realpath === false ? $path : $realpath;\n }", "public function setDefaultViewPath($value)\n {\n $this->setProperty(\"DefaultViewPath\", $value, true);\n }", "public final function setDefaultView($path) {\n\t\t$this->default_view_path = $path;\n\t\t$this->view_path = $path;\n\t}", "public function setView(string $viewPath){\n\t\t\tif(file_exists($viewPath)){\n\t\t\t\t$this->views[] = $viewPath;\n\t\t\t}\n\t\t}", "protected function setDefaultViewPath($path)\n {\n $this->view->setDefaultView($path);\n $this->structure->setDefaultView($path);\n }", "public function setViewScriptPathSpec($path)\n {\n $this->_viewScriptPathSpec = (string) $path;\n return $this;\n }", "public function setDefaultViewBasePath($path)\n\t{\n\t\t$this->_defaultViewBasePath = $path;\n\t}", "function setView($value) {\r\n $this->view = $value;\r\n }", "public function setPath(?string $path): void {\r\n\r\n if(null !== $path && 0 === strlen(trim($path))) {\r\n $path = null;\r\n }\r\n\r\n $this -> url -> path = $path;\r\n }", "public function setViewFile(string $value);", "function SetViewDirectory(string $Value){\n $this->ViewDirectory = $Value;\n }", "public function setLayoutPath(string $path): ViewInterface;", "protected function setCustomViewPath()\n {\n Config::set('view.paths', [__DIR__ . '/Stubs/views']);\n }", "function setViewCacheFolderPath(string $path): void\n {\n View::setCacheFolderPath($path);\n }", "function setViewDir($viewDir)\r\n {\r\n }", "public function setPath($path);", "public function setPath(string $path = null)\n {\n if ($path === null) {\n $uri = $this->server->get('REQUEST_URI');\n\n if (empty($uri)) {\n // Default to a slash\n $this->path = '/';\n } else {\n $uriParts = explode('?', $uri);\n $this->path = $uriParts[0];\n }\n } else {\n $this->path = $path;\n }\n }", "public function setPath($path)\n {\n $this->default['path'] = $path;\n }", "public static function setViewerPath($path) {\n\t\tself::getInstance()->codeviewer->baseurl = $path;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get url to cancel order changes (unset all changes data)
public function getCancelChangesUrl() { return Mage::getModel('adminhtml/url')->getUrl('adminhtml/mageworx_ordersedit_edit/cancelChanges', array('order_id' => $this->getOrderId())); }
[ "function get_cancel_order_url() {\n\t\tglobal $cmdeals;\n\t\treturn $cmdeals->nonce_url( 'cancel_order', add_query_arg('cancel_order', 'true', add_query_arg('order', $this->order_key, add_query_arg('order_id', $this->id, trailingslashit( home_url() )))));\n\t}", "function get_cancel_url() {\n\t\t$order = get_order();\n\t\treturn ( $order ) ? get_post_meta( $order->get_id(), 'cancel_url', true ) : '';\n\t}", "function the_order_cancel_url( $order_id = null ) {\n\techo get_the_order_cancel_url( $order_id );\n}", "public function getCancelUrl(): string\n {\n return $this->_urlBuilder->getUrl('monei/order/cancel');\n }", "function hrb_get_the_order_cancel_url( $order ) {\n\t$args = array(\n\t\t'action' => 'mo',\n\t\t'p_action' => 'cancel_order',\n\t\t'order_id' => $order->get_id()\n\t);\n\treturn add_query_arg( $args, hrb_get_dashboard_url_for( 'payments' ) );\n}", "function get_the_order_cancel_url( $order_id = null ) {\n\n\treturn get_order( $order_id )->get_cancel_url();\n}", "public function getCancelUrl()\n {\n return $this->getUrl(\n '*/*/changeStatus',\n [\n 'id' => $this->getSubscription()->getId(),\n 'status' => StatusSource::STATUS_CANCELED,\n 'form_key' => $this->formKey->getFormKey(),\n ]\n );\n }", "public function getCancelUrl() {\n\t\treturn Mage::getUrl('plationline/api/cancel');\n\t}", "protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }", "public function get_cancel_url() {\n\t\treturn $this->get_field( Pronamic_Pay_Gateways_Ogone_Parameters::CANCEL_URL );\n\t}", "public function get_cancel_url()\n {\n return $this->cancel_url;\n }", "public function cancelUrl()\n {\n return $this->paddleInfo()['cancel_url'];\n }", "public static function getCanceledUrl()\n {\n return self::get('canceled_url');\n }", "public function getRemoveUrl()\r\n {\r\n $query = array($this->getFilter()->getRequestVar()=>$this->getFilter()->getResetValue());\r\n $params['_current'] = true;\r\n $params['_use_rewrite'] = true;\r\n $params['_query'] = $query;\r\n $params['_escape'] = true;\r\n return Mage::getUrl('*/*/*', $params);\r\n }", "public function getCustomerCancelUrl() {\n return $this->_customerCancelUrl;\n }", "public function getCancelURL() {\n\t\treturn $this->cancelurl;\n\t}", "public function getPayPalCancelURL()\n {\n }", "public static function cancel_order()\n {\n }", "public function getCancelUrl() {\n return $this->getReturnUrl();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END: save_incident_comments() This method retrieves the list of SMSes from the database If the flag for ignoring the SMSes that have been used with incidents is set to true, the method will filter out those SMSes
public function sms_listing($ignore_incident_sms = FALSE) { // Check for the ignore flag // If it is set to TRUE, we get a list of SMSes from the incident_sms table, // create an array of the IDs and then we pass it to the ignore list of the query // that will be run agains the SMS table // If the ignore flag is not set OR is false (default), then simply retrieve all // SMSes from the SMS table $array_incident_sms = array(); if ($ignore_incident_sms) { // get list of IDs from the incident_sms table $this->db->select('sms_id id'); $query = $this->db->get($this->tbl_incident_sms); $array_incident_sms = $query->result_array(); $sms_id_array = array(); foreach ($array_incident_sms as $sms) { $sms_id_array[] = $sms['id']; } } // Arrgghhh ... but it still worked; getting the array of used SMS IDs so that one SMS is not used by two or more incidents // Now run the actual query that we wanted in order to get the list of SMSes that can be used for a new incident // Note that already used SMSes ... found in table 'incident_sms' will not be shown if(count($sms_id_array)>0) { $this->db->where_not_in('id', $sms_id_array); } $this->db->order_by('date_received', 'desc'); $sms_query = $this->db->get($this->tbl_sms); // return the database object that was sent over return $sms_query; }
[ "protected function saveRequests() {\n\t\t$bundle = array_get($this->requests, 'bundle_shifts', '');\n\t\t$table = SCHEDULE_COMMENTS_TABLE;\n\t\t$sql = <<<EOSQL\nreplace into {$table}\n\tvalues(\n\t\t{$this->worker_id},\n\t\tdatetime('now'),\n\t\t'{$this->requests['comments']}',\n\t\t'{$this->avoid_list}',\n\t\t'{$this->prefer_list}',\n\t\t'{$this->requests['clean_after_self']}',\n\t\t'{$this->requests['bunch_shifts']}',\n\t\t'{$bundle}'\n\t)\nEOSQL;\n\t\t$this->dbh->exec($sql);\n\t}", "abstract public function getListOfReportedComments();", "public function getAllInvoiceComments($invoice_id = NULL)\n {\n\treturn $this->setRequestData(sprintf(self::RESOURCE_INVOICE_COMMENTS, $invoice_id));\n }", "abstract public function getListCommentsReported();", "public function getAllSignalComments()\n {\n $db = $this->dbConnect();\n\n $req = $db->prepare('SELECT id, author, comment, signal_comment, DATE_FORMAT(comment_date, \"%d/%m/%Y à %Hh%i\") AS comment_date_fr FROM comments WHERE signal_comment=0 OR signal_comment=1 ORDER BY comment_date DESC');\n $req->execute();\n $allComments = $req->fetchAll();\n $req->closeCursor();\n return $allComments;\n }", "public function removeAllComments() {\n\t\t$this->comments = $this->objectManager->create('\\\\TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\t}", "function backup_tracker_issuecomments($bf, $preferences, $trackerid) {\n global $CFG;\n\n $status = true;\n\n $comments = get_records('tracker_issuecomment', 'trackerid', $trackerid);\n if ($comments) {\n //Write start tag\n $status = $status && fwrite ($bf, start_tag('COMMENTS', 4, true));\n //Iterate over each comment\n foreach ($comments as $comment) {\n //Start comment\n $status = $status && fwrite ($bf, start_tag('COMMENT', 5, true));\n //Print comment data\n fwrite ($bf, full_tag('ID', 6, false, $comment->id));\n fwrite ($bf, full_tag('TRACKERID', 6, false, $comment->trackerid)); \n fwrite ($bf, full_tag('USERID', 6, false, $comment->userid)); \n fwrite ($bf, full_tag('ISSUEID', 6, false, $comment->issueid)); \n fwrite ($bf, full_tag('COMMENT', 6, false, $comment->comment));\n fwrite ($bf, full_tag('COMMENTFORMAT', 6, false, $comment->commentformat)); \n fwrite ($bf, full_tag('DATECREATED', 6, false, $comment->datecreated));\n //End comment\n $status = $status && fwrite ($bf, end_tag('COMMENT', 5, true));\n }\n //Write end tag\n $status = $status && fwrite($bf, end_tag('COMMENTS', 4, true));\n }\n return $status;\n }", "function save_incident()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 's', 't'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\t\n\n\t\t\n\n\t\t$data = restore_bad_chars($data);\t\n\n\t\t\n\n\t\tif($_POST['save_incident'])\n\n\t\t{\n\n\t\t\t$data['formdata'] = $_POST;\n\n $required_fields = array('incidentdate', 'student', 'reportedby', 'response', 'incidentdetails', 'actiontaken');\n\n\t\t\t$_POST = clean_form_data($_POST);\n\n\t\t\t$validation_results = validate_form('', $_POST, $required_fields);\n\n \n\n\t\t\t#set status as editing on destination if updating\n\n if($this->input->post('editid')) $data['editid'] = $_POST['editid'];\t\t\t\n\n\t\t\t\n\n\t\t\t#Only proceed if the validation for required fields passes\n\n\t\t\tif($validation_results['bool'] && !(empty($data['editid']) && !empty($user_details)))\n\n\t\t\t{ \n\n if(!empty($_POST['editid']))\n\n {\t\t\t\t\t\n\n\t\t\t\t\t#Add the school id and author to the data array\n\n\t\t\t\t\t$_POST = array_merge($_POST, array('author' => $this->session->userdata('userid')));\n\n\t\t\t\t\t\n\n\t\t\t\t\t$result = $this->disciplineobj->update_incident(array_merge($_POST, array('id'=> $data['editid'])));\n\n \t \t}\n\n\t\t\t \telse \n\n \t{\t\t\t \n\n \t#Add the school id and author to the data array\n\n\t\t\t\t\t$_POST = array_merge($_POST, array('author' => $this->session->userdata('userid')));\n\n\n\n #decrypt student and reported by values\n\n $_POST['student'] = decryptValue($_POST['student']);\n\n $_POST['reportedby'] = decryptValue($_POST['reportedby']);\n\n\n\n\t\t\t\t\t$result = $this->disciplineobj->add_incident($_POST );\n\n \t\t}\n\n\t\t\t\t\n\n \t\t#Format and send the errors\n\n \tif(!empty($result) && $result)\n\n\t\t\t\t{\t\t\t\t\t\n\n\t\t\t\t\t$data['msg'] = \"The incident data has been successfully saved.\";\n\n\t\t\t\t\t$data['formdata'] = array();\n\n \t }\n\n \t else if(empty($data['msg']))\n\n \t {\n\n\t\t\t\t \t$data['msg'] = \"ERROR: The incident could not be saved or was not saved correctly.\".$classname_error.$rank_error;\n\n \t }\n\n }\n\n \n\n\t\t\t#Prepare a message in case the user already exists for another school\n\n\t\t\telse if(empty($data['editid']) && !empty($class_details))\n\n\t\t\t{\n\n\t\t\t\t #$addn_msg = (!empty($user_details['isactive']) && $user_details['isactive'] == 'N')? \"<a href='\".base_url().\"admin/load_user_form/i/\".encryptValue($user_details['id']).\"/a/\".encryptValue(\"reactivate\").\"' style='text-decoration:underline;font-size:17px;'>Click here to activate and edit</a>\": \"<a href='\".base_url().\"admin/load_user_form/i/\".encryptValue($user_details['id']).\"' style='text-decoration:underline;font-size:17px;'>Click here to edit</a>\";\n\n\t\t\t\t \n\n\t\t\t\t $data['msg'] = \"WARNING: A class with the same name already exists.<br />\"; \n\n\t\t\t}\n\n\t\t\t \n\n if((empty($validation_results['bool']) || (!empty($validation_results['bool']) && !$validation_results['bool'])) \n\n\t\t\t&& empty($data['msg']) )\n\n\t\t\t{\n\n\t\t\t\t$data['msg'] = \"WARNING: The highlighted fields are required.\";\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$data['requiredfields'] = $validation_results['requiredfields'];\n\n\t\t}\n\n\n\n #get the student info\n\n if(!empty($data['s'])):\n\n $data['student_details'] = $this->Query_reader->get_row_as_array('get_students_list',\n\n array('isactive'=>'Y', 'searchstring'=>' AND id=\\'' . decryptValue($data['s']) .'\\'', 'limittext'=>''));\n\n endif;\n\n \n\n\t\t$this->load->view('discipline/incident_form_view', $data);\n\n\t}", "function mbt_getComments()\n{\n //im not planning to implement note_type [like reminders] - unless asked?\n//need to update the comment authors in two places once added.\n// maniphest_transaction_comment\n// maniphest_transaction\n $pdo = dbpdo();\n $data = array();\n\n $results = $pdo->query('SELECT mantis_bugnote_table.*,\n mantis_bugnote_text_table.note\n FROM mantis_bugnote_table\n LEFT JOIN mantis_bugnote_text_table\n ON mantis_bugnote_table.bugnote_text_id = mantis_bugnote_text_table.id');\n\n // data['bug number'] = array( \"bugnote number\" => array(note data), ... )\n foreach ($results as $row) {\n $data[$row['bug_id']][$row['id']]['id'] = $row['id'];\n $data[$row['bug_id']][$row['id']]['bug_id'] = $row['bug_id'];\n $data[$row['bug_id']][$row['id']]['reporter_id'] = $row['reporter_id'];\n $data[$row['bug_id']][$row['id']]['last_modified'] = $row['last_modified'];\n $data[$row['bug_id']][$row['id']]['date_submitted'] = $row['date_submitted'];\n $data[$row['bug_id']][$row['id']]['note'] = base64_encode($row['note']);\n }\n\n $_SESSION['mbt']['mantis_bugnote_table'] = $data;\n return;\n}", "public static function debug_commentid() {\n\t\t$query = mysql_query(\"SELECT `cid`,`datetime`,`text` FROM comments WHERE `cid` = ''\");\n\t\twhile($r = mysql_fetch_assoc($query))\n\t\t\tif(!$r['cid'])\n\t\t\t\tmysql_query(\"UPDATE comments SET `cid` = '\".uniqid().\"' WHERE `datetime` = '{$r['datetime']}' AND `text` = '\".addslashes($r['text']).\"' LIMIT 1\");\n\t\tmysql_free_result($query);\n\t\tunset($query);\n\t}", "public function getAllInvoiceCommentById($id)\n {\n return DB::table( Database::COMMENT)->where('invoice_id', $id)->get();\n }", "public static function getCommentsPendingList()\n {\n $commentRepository = Database::getEntityManager()->getRepository(\"Models\\\\Comment\");\n $commentsList = $commentRepository->findBy(\n array(\n \"commentPending\" => true\n )\n );\n\n return $commentsList;\n }", "function get_board_comments( $message_ids = array() ){\n\tglobal $CONFIG;\n\tif(!count( $message_ids )){\n\t\treturn array();\n\t}\n\t\n\t$in = implode( ',' , $message_ids );\n\t\n\t$comments = get_data(\" SELECT a.id as id, a.entity_guid , a.owner_guid, \"\n\t.\"\\n a.time_created, s.string , u.name , u.username from {$CONFIG->dbprefix}annotations as a \"\n\t.\"\\n INNER JOIN {$CONFIG->dbprefix}metastrings as s on a.value_id = s.id \"\t\n\t.\"\\n INNER JOIN {$CONFIG->dbprefix}users_entity as u on a.owner_guid = u.guid \"\n\t.\"\\n WHERE a.entity_guid IN ( $in ) \"\n\t.\"\\n ORDER BY time_created DESC\tLIMIT 0 , 1000 \"\n\t);\n\t\n\t$comments_array = array();\n\t\n\tforeach( $comments as $comment ){\n\t\t$guid = $comment->entity_guid;\n\t\t$comments_array[ $guid ][] = $comment; \t\n\t}\n\t\n\treturn $comments_array;\n}", "public function getComments()\n {\n $comments = array();\n\n $sql = 'SELECT id_comment, usercomment, comment';\n $sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_comments';\n $sql.= \" WHERE id_sondage='\".$this->db->escape($this->id_sondage).\"'\";\n $sql.= \" ORDER BY id_comment\";\n $resql = $this->db->query($sql);\n\n if ($resql)\n {\n $num_rows=$this->db->num_rows($resql);\n\n if ($num_rows > 0)\n {\n while ($obj = $this->db->fetch_object($resql))\n {\n $comments[] = $obj;\n }\n }\n }\n\n return $comments;\n }", "function ConvertComments()\n\t{\n\t\t$log = \"\";\n\t\t// process KB Comments\n\t\t$db\t= JFactory::getDBO();\n\n\t\t$existingtables = $this->GetExistingTables();\n\t\t\n\t\t// copy old kb comments table into new general comments table\n\t\tif (array_key_exists('#__fsf_kb_comment',$existingtables))\n\t\t{\n\t\t\t$qry = \"INSERT INTO #__fsf_comments (ident, itemid, name, email, website, body, created, published) SELECT 1 as ident, kb_art_id as itemid, name, email, website, body, created, published FROM #__fsf_kb_comment\";\n\t\t\t$db->SetQuery($qry);\n\t\t\t$db->Query();\n\n\t\t\t$count = $db->getAffectedRows();\n\t\t\t$qry = \"DROP TABLE #__fsf_kb_comment\";\n\t\t\t$db->SetQuery($qry);\n\t\t\t$db->Query();\n\t\t\t\n\t\t\t$log .= \"Converting $count KB Comments to new combined comments<br>\";\n\t\t} else {\n\t\t\t$log .= \"KB Comments ok<br>\";\t\n\t\t}\n\t\n\t\t// copy old kb comments table into new general comments table\n\t\tif (array_key_exists('#__fsf_test',$existingtables))\n\t\t{\n\t\t\t$qry = \"INSERT INTO #__fsf_comments (ident, itemid, name, email, website, body, created, published) SELECT 5 as ident, prod_id as itemid, name, email, website, body, added as created, published FROM #__fsf_test\";\n\t\t\t$db->SetQuery($qry);\n\t\t\t$db->Query();\n\n\t\t\t$count = $db->getAffectedRows();\n\t\t\t$qry = \"DROP TABLE #__fsf_test\";\n\t\t\t$db->SetQuery($qry);\n\t\t\t$db->Query();\n\t\t\t\n\t\t\t$log .= \"Converting $count Testimonials to new combined comments<br>\";\n\t\t} else {\n\t\t\t$log .= \"Testimonials ok<br>\";\t\n\t\t}\n\t\n\t\t$qry = \"UPDATE #__fsf_comments SET published = 2 WHERE published = -1\";\n\t\t$db->SetQuery($qry);\n\t\t$db->Query();\n\t\t\n\t\treturn $log;\n\t}", "private function allComments(){\n\t\t$modelComment = $this->factory->getModel('Comment'); \n\t\treturn $modelComment->all();\n\t}", "public function getInvoiceComments()\n\t{\n\t\treturn $this->arrElements[\"Comentarii\"];\n\t}", "public function getReportedComment()\n {\n $reqComment = $this->conn->prepare('SELECT * FROM commentaires WHERE approved = 0 ORDER BY id DESC');\n $reqComment->execute([]);\n return $reqComment->fetchAll();\n }", "function CMT_updateCommentcodes()\n{\n global $_CONF, $_TABLES;\n\n if ($_CONF['comment_close_rec_stories'] > 0) {\n $results = DB_query(\"SELECT sid FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0) ORDER BY date DESC LIMIT {$_CONF['comment_close_rec_stories']}\");\n while ($A = DB_fetchArray($results)) {\n $allowedcomments[] = $A['sid'];\n }\n // update comment codes\n $sql = ' AND ';\n if (count($allowedcomments) > 1) {\n $sql .= \"sid NOT IN ('\" . implode(\"','\", $allowedcomments) . \"')\";\n } else {\n $sql .= \"sid <> '$sid'\";\n }\n $sql = \"UPDATE {$_TABLES['stories']} SET commentcode = 1 WHERE (commentcode = 0) AND (date < NOW()) AND (draft_flag = 0)\" . $sql;\n DB_query($sql);\n }\n\n $sql = \"UPDATE {$_TABLES['stories']} SET commentcode = 1 WHERE UNIX_TIMESTAMP(comment_expire) < UNIX_TIMESTAMP() AND UNIX_TIMESTAMP(comment_expire) <> 0\";\n DB_query($sql);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add hooks to the queue and update the node stack when we enter a node. If we are entering a class, function or method, we push it to the location stack. This is just so that we know whether we are in the file scope or not, so that hooks in the main file scope can be added to the file. We also check function calls to see if there are any actions or hooks. If there are, they are added to the file's hooks if in the global scope, or if we are in a function/method, they are added to the queue. They will be assigned to the function by leaveNode(). We also check for any other function calls and treat them similarly, so that we can export a list of functions used by each element. Finally, we pick up any docblocks for nodes that usually aren't documentable, so they can be assigned to the hooks to which they may belong.
public function enterNode( \PHPParser_Node $node ) { parent::enterNode( $node ); switch ( $node->getType() ) { // Add classes, functions, and methods to the current location stack case 'Stmt_Class': case 'Stmt_Function': case 'Stmt_ClassMethod': array_push( $this->location, $node ); break; // Parse out hook definitions and function calls and add them to the queue. case 'Expr_FuncCall': $function = new Function_Call_Reflector( $node, $this->context ); // Add the call to the list of functions used in this scope. $this->getLocation()->uses['functions'][] = $function; if ( $this->isFilter( $node ) ) { if ( $this->last_doc && ! $node->getDocComment() ) { $node->setAttribute( 'comments', array( $this->last_doc ) ); $this->last_doc = null; } $hook = new Hook_Reflector( $node, $this->context ); // Add it to the list of hooks used in this scope. $this->getLocation()->uses['hooks'][] = $hook; } break; // Parse out method calls, so we can export where methods are used. case 'Expr_MethodCall': $method = new Method_Call_Reflector( $node, $this->context ); // Add it to the list of methods used in this scope. $this->getLocation()->uses['methods'][] = $method; break; // Parse out method calls, so we can export where methods are used. case 'Expr_StaticCall': $method = new Static_Method_Call_Reflector( $node, $this->context ); // Add it to the list of methods used in this scope. $this->getLocation()->uses['methods'][] = $method; break; // Parse out `new Class()` calls as uses of Class::__construct(). case 'Expr_New': $method = new \WP_Parser\Method_Call_Reflector( $node, $this->context ); // Add it to the list of methods used in this scope. $this->getLocation()->uses['methods'][] = $method; break; } // Pick up DocBlock from non-documentable elements so that it can be assigned // to the next hook if necessary. We don't do this for name nodes, since even // though they aren't documentable, they still carry the docblock from their // corresponding class/constant/function/etc. that they are the name of. If // we don't ignore them, we'll end up picking up docblocks that are already // associated with a named element, and so aren't really from a non- // documentable element after all. if ( ! $this->isNodeDocumentable( $node ) && 'Name' !== $node->getType() && ( $docblock = $node->getDocComment() ) ) { $this->last_doc = $docblock; } }
[ "public function register_hooks() {\n\t\tadd_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );\n\t\tadd_filter( 'block_categories', array( $this, 'add_block_category' ) );\n\n\t\t$block_integrations = array(\n\t\t\tnew WPSEO_How_To_Block(),\n\t\t\tnew WPSEO_FAQ_Block(),\n\t\t);\n\n\t\tforeach ( $block_integrations as $block_integration ) {\n\t\t\t$block_integration->register_hooks();\n\t\t}\n\t}", "function hook() {\n\t\tglobal $fpdb, $fp_params;\n\t\tif(empty($fp_params['tag'])) {\n\t\t\t# We stop here\n\t\t\treturn true;\n\t\t}\n\t\t$tag=$fp_params['tag'];\n\n\t\t# Load the database\n\t\t$file=$this->tag_db->open_file($this->tag_db->tagfile($tag));\n\n\t\tif(!count($file[$tag])) { \n\t\t\t# No entries or no tag: 404 error\n\t\t\t$fp_params['entry']='entry000000-000000';\n\t\t\treturn false;\n\t\t}\n\n\t\t# Sets the entries to $this->walker_array (with ids shifted\n\t\t# with keys) and sort them\n\t\t$this->walker_array=array_map('entry_idtokey', $file[$tag]);\n\t\trsort($this->walker_array);\n\n\t\t$l=count($this->walker_array);\n\n\t\tif(isset($fp_params['count'])) {\n\t\t\t$fp_params['count']=$fp_params['count']>$l ? $l : $fp_params['count'];\n\t\t}\n\n\t\t# Create the fake walker and the fake cat\n\t\t$fp_params['cat']=-0xFF;\n\t\t$fpdb->_indexer[-0xFF]=&$this;\n\t\t$this->fpdb_len=$l;\n\t\treset($this->walker_array);\n\n\t\t# Solve problems with Frontpage plugin\n\t\tif(isset($fp_params['not']) && @!constant('PLUGIN_TAG_ALLOW_NOT')) {\n\t\t\tunset($fp_params['not']);\n\t\t}\n\n\t\t# We have to do it the dirty PrettyURLs paging\n\t\tif(class_exists('Plugin_PrettyURLs')) {\n\t\t\tglobal $plugin_prettyurls;\n\t\t\t$puBackup=$plugin_prettyurls;\n\t\t\t$plugin_prettyurls=new tag_prettyurls($puBackup);\n\t\t\t$plugin_prettyurls->tag_link=apply_filters('tag_link', $fp_params['tag']);\n\t\t}\n\n\t\treturn true;\n\t}", "private function register_hooks() {\n\t\tforeach ( $this->get_hooking_classes() as $class ) {\n\t\t\t$full_class_name = ( $this->namespace . '\\\\' . $class );\n\t\t\t$reflection = new \\ReflectionClass( $full_class_name );\n\n\t\t\tif ( $reflection->implementsInterface( 'UTEC\\Common\\Interfaces\\Has_Hooks' ) ) {\n\t\t\t\t( new $full_class_name() )->hooks();\n\t\t\t}\n\t\t}\n\t}", "private static function hooks()\n\t{\n\t\t// check for shortcut in url\n\t\tEvent::add('system.post_routing', array('Webgrind_Hooks', 'detect_shortcut'));\n\t\t// hook for javascript redirect\n\t\tEvent::add('system.display', array('Webgrind_Hooks', 'webgrind_redirect'));\n\t\t// webgrind path constant\n\t\tdefine('WEBGRIND', url::site().str_replace(DOCROOT, '', MODPATH).'webgrind/');\n\t}", "protected function add_hooks() {\n\t\tif ( ! $this->is_disabled() ) {\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'add_theme_support' ), 999 );\n\t\t\tadd_filter( 'block_editor_settings', array( $this, 'enqueue' ) );\n\t\t}\n\t}", "private function initHooks() {\r\n if (!is_dir(BotHooks::HOOK_DIR)) {\r\n throw new Slackbot\\Exception\\ConfigException('Cannot locate hook directory \"' . BotHooks::HOOK_DIR . '\"');\r\n }\r\n \r\n $hookFiles = glob(BotHooks::HOOK_DIR . '/[A-Z][a-z]*Hook.php');\r\n foreach ($hookFiles as $hookFile) {\r\n // include the file\r\n require_once $hookFile;\r\n \r\n // load a class that has the same name as the file\r\n $fileName = substr($hookFile, strrpos($hookFile, '/') + 1);\r\n $className = 'Slackbot\\\\Hooks\\\\' . substr($fileName, 0, strlen($fileName) - 4);\r\n $hookInstance = new $className();\r\n if (!class_exists($className) && is_subclass_of($hookInstance, 'Slackbot\\\\Hooks\\\\Hook')) {\r\n unset($hookInstance);\r\n continue;\r\n }\r\n \r\n // store the hook\r\n $this->hooks[$hookInstance->getName()] = $hookInstance;\r\n // process the triggers supported by the hook\r\n $this->loadHookTriggers($hookInstance);\r\n }\r\n \r\n\t\t// process the tokens supported for the hooks\r\n\t\t$this->loadHookConfig();\r\n }", "private function loadHooks()\n {\n $arrHooks = $this->_confCurrentRepository['arrHooks'];\n\n LogUtil::debug(\"'\" . sizeof($arrHooks) .\"' hooks assigned for this repository\");\n\t\t$thisDir = dirname(__FILE__);\n\t\t\n\t\twhile(list($hook, $arrHookConfig) = each($arrHooks))\n\t\t{\n\t\t\tif ($hook == '' && !is_array($arrHookConfig)) {\n\t\t\t\t$hook = $arrHookConfig;\n\t\t\t\t$arrHookConfig = array();\n\t\t\t}\n\n $path = $thisDir . \"/hooks/\" . $hook . \"/\" . $hook . \".php\";\n\n if (file_exists($path))\n {\n include_once($path);\n LogUtil::debug(\"Hook file '$hook'' loaded\");\n\n if (class_exists($hook))\n {\n $clazz = new $hook();\n\n if ($clazz instanceof ISvnPostCommitHook )\n {\n $this->_executeHooks[] = $clazz;\n\t\t\t\t\t\t$this->_configHooks[] = $arrHookConfig;\n\t\t\t\t\t\t\n LogUtil::info(\"Hook '$hook' ready for use\");\n }\n else\n {\n LogUtil::error(\"Hook '$hook' does not implement ISvnPostCommitHook\");\n }\n }\n else\n {\n LogUtil::error(\"Clazz '$hook' does not exists in file '\" . $path . \"'\");\n }\n }\n else\n {\n LogUtil::error(\"Could not load hook '\" . $hook . \"': file '\" . $path . \"' not found\");\n }\n }\n }", "public function initHooks() {\n\t\t\tif (AppLoader::includeHooks('CommonHooks')) {\n\t\t\t\t$objCommonHooks = new CommonHooks();\n\t\t\t\t$this->registerPreRunHook(array($objCommonHooks, 'verifyToken'));\n\t\t\t\t$this->registerPostRunHook(array($objCommonHooks, 'trackHistory'), array(5, array('css', 'js', 'xml', 'json', 'jsonp', 'html')));\n\t\t\t}\n\t\t\t\t\n\t\t\tif (AppLoader::includeHooks('CacheHooks')) {\n\t\t\t\t$objCacheHooks = new CacheHooks();\n\t\t\t\t$this->registerPreRunHook(array($objCacheHooks, 'serveCache'));\n\t\t\t\t$this->registerPostRunHook(array($objCacheHooks, 'saveCache'));\n\t\t\t}\n\t\t}", "public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}", "private static function hooks()\n {\n $hooks = NFramework::import('app.config.hooks');\n if($hooks)\n foreach($hooks as $hook)\n {\n $class = NFramework::klass($hook[0]);\n Nano::import($hook[0]);\n NFramework::invoke($class, $hook[1], $hook[3]);\n }\n }", "private function scanForFunctions() {\n foreach ($this->lines as $lineno => $line) {\n if ($line->type != 'def') continue; // not a function def\n\n $tokens = $line->tokens;\n // there must be at least 4 tokens: \"def\", FUNCTIONNAME, \"(\" and \")\"\n if (count($tokens) < 4 ||\n !$this->isValidName($tokens[1]) ||\n $tokens[2] != '(' ||\n $tokens[count($tokens)-1] != ')')\n return $this->err('Invalid def of '.$tokens[1].'()', $lineno);\n if (in_array($tokens[1], self::$reserved))\n return $this->err($tokens[1].' is a reserved keyword', $lineno);\n\n // anything between () is a list of argument names seperated by , \n $args = [];\n for ($i = 3; $i < count($tokens)-1; $i++) {\n $argname = $tokens[$i];\n if (!$this->isValidName($argname))\n return $this->err('Invalid arg name: '.$argname, $lineno);\n if (in_array($argname, $args))\n return $this->err(\"Duplicate arg name ($argname)\", $lineno);\n $args[] = $argname;\n \n // check for , between args\n if ($i < count($tokens)-2 && $tokens[$i+1] != ',') return $this->err('Invalid arg list', $lineno);\n $i++; // skip the ,\n }\n $line->data = $args;\n self::log(\"Found def \".$tokens[1].\"(\".implode(',',$args).\")\");\n\n // foreach ($block->lines as $lineidx => $line) {\n // TODO further checking...\n // }\n // register the function\n $this->functions[$tokens[1]] = $lineno;\n }\n return true;\n }", "private function enableHooks()\n\t{\n\t\tif(static::$hookEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\t// injecting hooks as late as possible to ensure they will be called before other hooks so that they will get\n\t\t// the parsed template\n\t\tarray_unshift($GLOBALS['TL_HOOKS']['parseFrontendTemplate'], array('TemplateExtended\\TemplateEngine', 'parse'));\n\t\tarray_unshift($GLOBALS['TL_HOOKS']['parseBackendTemplate'], array('TemplateExtended\\TemplateEngine', 'parse'));\n\n\t\tstatic::$hookEnabled = true;\n\t}", "abstract public function hook();", "public function execHooks(): void\n {\n $hooksExec = [];\n\n foreach (Hook::getForSite($this->block->getSiteId()) as $hook) {\n if ($hook->enabled()) {\n $hooksExec[$hook->getCode()] = $hook;\n }\n }\n\n foreach (Hook::getForLanding($this->block->getLandingId()) as $hook) {\n if ($hook->enabled()) {\n $hooksExec[$hook->getCode()] = $hook;\n }\n }\n\n foreach ($hooksExec as $hook) {\n if ($hook->enabledInEditMode()) {\n $hook->exec();\n }\n }\n }", "public function add_page_hooks() {\n\t\t\t$hookname = current_filter();\n\n\t\t\tif ( strpos( $hookname, 'load-' ) === 0 ) {\n\t\t\t\t$this->pagehook = substr( $hookname, 5 );\n\t\t\t}\n\n\t\t\t$this->filter_pointers();\n\t\t\tadd_action( 'admin_print_scripts', array( $this, 'enqueue_scripts' ) );\n\t\t\tadd_action( 'admin_print_styles', array( $this, 'enqueue_styles' ) );\n\t\t\tadd_action( $this->prefix . 'settings_header', array( $this, 'display_tabs' ) );\n\t\t}", "private function hooks() {\n\t\tadd_action( 'edd_tools_tab_fraud_monitor', array( $this, 'tools_tab_callback' ) );\n\n\t\t// General Section\n\t\tadd_action( 'edd_fraud_monitor_section-general', array( $this, 'general_fraud_settings' ) );\n\t\tadd_action( 'edd_fm_save_general', array( $this, 'save_general' ), 10, 1 );\n\n\t\t// IP Section\n\t\tadd_action( 'edd_fraud_monitor_section-ip', array( $this, 'ip_blacklist_admin' ) );\n\t\tadd_action( 'edd_save_banned_ips', array( $this, 'save_ips' ), 10, 1 );\n\n\t\t// Country Section\n\t\tadd_action( 'edd_fraud_monitor_section-country', array( $this, 'country_blacklist_admin' ) );\n\t\tadd_action( 'edd_save_banned_countries', array( $this, 'save_countries' ), 10, 1 );\n\n\t\t// Email Section\n\t\tadd_action( 'edd_fraud_monitor_section-email', array( $this, 'email_settings_admin' ) );\n\t\tadd_action( 'edd_save_fm_email_settings', array( $this, 'save_email_settings' ), 10, 1 );\n\n\t\t// Behavior Section\n\t\tadd_action( 'edd_fraud_monitor_section-behavior', array( $this, 'behavior_admin' ) );\n\t\tadd_action( 'edd_save_fm_behaviors', array( $this, 'save_behaviors' ), 10, 1 );\n\n\t}", "protected static function setupHooks()\n\t{\n\t\tglobal $wgHooks;\n\t\t\n\t\tforeach ( self::$hookList as $index => $hookName)\n\t\t\tif ( method_exists( $this, 'h'.$hookName ) )\t\t\t\t\t\n\t\t\t\t\t$wgHooks[$hookName][] = array( &$this, 'h'.$hookName );\n\t\t\n\t}", "function genesis_extender_list_hooks( $selected = '' )\r\n{\r\n\t$genesis_hooks = array(\r\n\t\t'-- <head> Hooks --' => array(\r\n\t\t\t'genesis_doctype',\r\n\t\t\t'genesis_title',\r\n\t\t\t'genesis_meta',\r\n\t\t\t'wp_head'\t\r\n\t\t),\r\n\t\t'-- Page Hooks --' => array(\r\n\t\t\t'genesis_before',\r\n\t\t\t'genesis_after'\t\t\r\n\t\t),\r\n\t\t'-- Header Hooks --' => array(\r\n\t\t\t'genesis_before_header',\r\n\t\t\t'genesis_header',\r\n\t\t\t'genesis_after_header',\r\n\t\t\t'genesis_site_title',\r\n\t\t\t'genesis_site_description',\r\n\t\t\t'genesis_header_right'\r\n\t\t),\r\n\t\t'-- Content Hooks --' => array(\r\n\t\t\t'genesis_before_content_sidebar_wrap',\r\n\t\t\t'genesis_after_content_sidebar_wrap',\r\n\t\t\t'genesis_before_content',\r\n\t\t\t'genesis_after_content',\r\n\t\t\t'genesis_extender_before_ez_home',\r\n\t\t\t'genesis_extender_after_ez_home'\r\n\t\t),\r\n\t\t'-- HTML5 Content Hooks --' => array(\r\n\t\t\t'genesis_before_entry',\r\n\t\t\t'genesis_after_entry',\r\n\t\t\t'genesis_entry_header',\r\n\t\t\t'genesis_before_entry_content',\r\n\t\t\t'genesis_entry_content',\r\n\t\t\t'genesis_after_entry_content',\r\n\t\t\t'genesis_entry_footer'\r\n\t\t),\r\n\t\t'-- XHTML Content Hooks --' => array(\r\n\t\t\t'genesis_before_post',\r\n\t\t\t'genesis_after_post',\r\n\t\t\t'genesis_before_post_title',\r\n\t\t\t'genesis_post_title',\r\n\t\t\t'genesis_after_post_title',\r\n\t\t\t'genesis_before_post_content',\r\n\t\t\t'genesis_post_content',\r\n\t\t\t'genesis_after_post_content'\r\n\t\t),\r\n\t\t'-- Loop Hooks --' => array(\r\n\t\t\t'genesis_before_loop',\r\n\t\t\t'genesis_loop',\r\n\t\t\t'genesis_after_loop',\r\n\t\t\t'genesis_after_endwhile',\r\n\t\t\t'genesis_loop_else'\r\n\t\t),\r\n\t\t'-- Comment Hooks --' => array(\r\n\t\t\t'genesis_before_comments',\r\n\t\t\t'genesis_comments',\r\n\t\t\t'genesis_after_comments',\r\n\t\t\t'genesis_list_comments',\r\n\t\t\t'genesis_before_pings',\r\n\t\t\t'genesis_pings',\r\n\t\t\t'genesis_after_pings',\r\n\t\t\t'genesis_before_comment',\r\n\t\t\t'genesis_after_comment',\r\n\t\t\t'genesis_before_comment_form',\r\n\t\t\t'genesis_comment_form',\r\n\t\t\t'genesis_after_comment_form'\r\n\t\t),\r\n\t\t'-- Sidebar Hooks --' => array(\r\n\t\t\t'genesis_sidebar',\r\n\t\t\t'genesis_before_sidebar_widget_area',\r\n\t\t\t'genesis_after_sidebar_widget_area',\r\n\t\t\t'genesis_sidebar_alt',\r\n\t\t\t'genesis_before_sidebar_alt_widget_area',\r\n\t\t\t'genesis_after_sidebar_alt_widget_area'\r\n\t\t),\r\n\t\t'-- Footer Hooks --' => array(\r\n\t\t\t'genesis_before_footer',\r\n\t\t\t'genesis_footer',\r\n\t\t\t'genesis_after_footer'\r\n\t\t)\r\n\t);\r\n\t\r\n\tforeach( $genesis_hooks as $optgroup => $options )\r\n\t{\r\n\t\techo '<optgroup style=\"font-size:14px;color:#57A18D;\" label=\"' . $optgroup . '\">';\r\n\t\tforeach( $options as $option )\r\n\t\t{\r\n\t\t\t$output = '<option style=\"color:#000000;\" value=\"' . $option . '\"';\r\n\t\t\t\t\r\n\t\t\tif( $option == $selected )\r\n\t\t\t{\r\n\t\t\t\t$output .= ' selected=\"selected\"';\r\n\t\t\t}\r\n\r\n\t\t\t$output .= '>' . $option . '</option>';\r\n\t\t\t\r\n\t\t\techo $output;\r\n\t\t}\r\n\t\techo '</optgroup>';\r\n\t}\r\n}", "function add_block_from_stack($end_offset = \\null)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the icon name belongs to the Fontello icon font
function is_valid_icon( $name ) { return self::$isvalid===true && (substr( $name, 0, 9) === 'fontello-' || substr( $name, 0, 5 ) === 'icon-' || substr( $name, 0, 12 ) === 'tf_fontello-' ); }
[ "function is_valid_icon( $name ) {\n\t\tif ( substr( $name, 0, 5 ) === 'icon-' || substr( $name, 0, 12 ) === 'tf_fontello-' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function isFaIcon(string $txt): bool\n {\n return $this->utStr->strSearch($txt, ' fa-'); // fas far fab fal...\n }", "private function isGlyphiconIcon(string $txt): bool\n {\n return $this->utStr->strSearch($txt, 'glyphicon glyphicon-');\n }", "abstract public function get_font_icon();", "function has_font() {\n\t\treturn self::$has_icon;\n\t}", "function HasFontFaceName(){}", "public function getIconName() {}", "public static function hasIcons() {\n return \\Drupal::service('module_handler')->moduleExists('micon');\n }", "public function get_font_icon() {\n\t\t$icons = array(\n\t\t\t'twitter' => 'twitter',\n\t\t\t'instagram' => 'instagram'\n\t\t\t);\n\t\tif ( isset( $icons[ $this->get_embed_type() ] ) ) {\n\t\t\treturn $icons[ $this->get_embed_type() ];\n\t\t} else {\n\t\t\treturn 'flickr';\n\t\t}\n\t}", "function _is_it_ico($file)\r\n{\r\n $ext = substr($file, -4);\r\n if ($ext === '.ico') {\r\n return true;\r\n }\r\n return false;\r\n}", "public function get_font_icon() {\n\t\treturn 'link';\n\t}", "public function get_glyphicons_icon( $icon ) {\n\n\t\tswitch ( $icon ) {\n\n\t\t\tcase 'glass': return '\\e001';\n\t\t\tcase 'leaf': return '\\e002';\n\t\t\tcase 'dog': return '\\e003';\n\t\t\tcase 'user': return '\\e004';\n\t\t\tcase 'girl': return '\\e005';\n\t\t\tcase 'car': return '\\e006';\n\t\t\tcase 'user_add': return '\\e007';\n\t\t\tcase 'user_remove': return '\\e008';\n\t\t\tcase 'film': return '\\e009';\n\t\t\tcase 'magic': return '\\e010';\n\t\t\tcase 'envelope': return '\\2709';\n\t\t\tcase 'camera': return '\\e012';\n\t\t\tcase 'heart': return '\\e013';\n\t\t\tcase 'beach_umbrella': return '\\e014';\n\t\t\tcase 'train': return '\\e015';\n\t\t\tcase 'print': return '\\e016';\n\t\t\tcase 'bin': return '\\e017';\n\t\t\tcase 'music': return '\\e018';\n\t\t\tcase 'note': return '\\e019';\n\t\t\tcase 'heart_empty': return '\\e020';\n\t\t\tcase 'home': return '\\e021';\n\t\t\tcase 'snowflake': return '\\2744';\n\t\t\tcase 'fire': return '\\e023';\n\t\t\tcase 'magnet': return '\\e024';\n\t\t\tcase 'parents': return '\\e025';\n\t\t\tcase 'binoculars': return '\\e026';\n\t\t\tcase 'road': return '\\e027';\n\t\t\tcase 'search': return '\\e028';\n\t\t\tcase 'cars': return '\\e029';\n\t\t\tcase 'notes_2': return '\\e030';\n\t\t\tcase 'pencil': return '\\270F';\n\t\t\tcase 'bus': return '\\e032';\n\t\t\tcase 'wifi_alt': return '\\e033';\n\t\t\tcase 'luggage': return '\\e034';\n\t\t\tcase 'old_man': return '\\e035';\n\t\t\tcase 'woman': return '\\e036';\n\t\t\tcase 'file': return '\\e037';\n\t\t\tcase 'coins': return '\\e038';\n\t\t\tcase 'airplane': return '\\2708';\n\t\t\tcase 'notes': return '\\e040';\n\t\t\tcase 'stats': return '\\e041';\n\t\t\tcase 'charts': return '\\e042';\n\t\t\tcase 'pie_chart': return '\\e043';\n\t\t\tcase 'group': return '\\e044';\n\t\t\tcase 'keys': return '\\e045';\n\t\t\tcase 'calendar': return '\\e046';\n\t\t\tcase 'router': return '\\e047';\n\t\t\tcase 'camera_small': return '\\e048';\n\t\t\tcase 'dislikes': return '\\e049';\n\t\t\tcase 'star': return '\\e050';\n\t\t\tcase 'link': return '\\e051';\n\t\t\tcase 'eye_open': return '\\e052';\n\t\t\tcase 'eye_close': return '\\e053';\n\t\t\tcase 'alarm': return '\\e054';\n\t\t\tcase 'clock': return '\\e055';\n\t\t\tcase 'stopwatch': return '\\e056';\n\t\t\tcase 'projector': return '\\e057';\n\t\t\tcase 'history': return '\\e058';\n\t\t\tcase 'truck': return '\\e059';\n\t\t\tcase 'cargo': return '\\e060';\n\t\t\tcase 'compass': return '\\e061';\n\t\t\tcase 'keynote': return '\\e062';\n\t\t\tcase 'paperclip': return '\\e063';\n\t\t\tcase 'power': return '\\e064';\n\t\t\tcase 'lightbulb': return '\\e065';\n\t\t\tcase 'tag': return '\\e066';\n\t\t\tcase 'tags': return '\\e067';\n\t\t\tcase 'cleaning': return '\\e068';\n\t\t\tcase 'ruller': return '\\e069';\n\t\t\tcase 'gift': return '\\e070';\n\t\t\tcase 'umbrella': return '\\2602';\n\t\t\tcase 'book': return '\\e072';\n\t\t\tcase 'bookmark': return '\\e073';\n\t\t\tcase 'wifi': return '\\e074';\n\t\t\tcase 'cup': return '\\e075';\n\t\t\tcase 'stroller': return '\\e076';\n\t\t\tcase 'headphones': return '\\e077';\n\t\t\tcase 'headset': return '\\e078';\n\t\t\tcase 'warning_sign': return '\\e079';\n\t\t\tcase 'signal': return '\\e080';\n\t\t\tcase 'retweet': return '\\e081';\n\t\t\tcase 'refresh': return '\\e082';\n\t\t\tcase 'roundabout': return '\\e083';\n\t\t\tcase 'random': return '\\e084';\n\t\t\tcase 'heat': return '\\e085';\n\t\t\tcase 'repeat': return '\\e086';\n\t\t\tcase 'display': return '\\e087';\n\t\t\tcase 'log_book': return '\\e088';\n\t\t\tcase 'adress_book': return '\\e089';\n\t\t\tcase 'building': return '\\e090';\n\t\t\tcase 'eyedropper': return '\\e091';\n\t\t\tcase 'adjust': return '\\e092';\n\t\t\tcase 'tint': return '\\e093';\n\t\t\tcase 'crop': return '\\e094';\n\t\t\tcase 'vector_path_square': return '\\e095';\n\t\t\tcase 'vector_path_circle': return '\\e096';\n\t\t\tcase 'vector_path_polygon': return '\\e097';\n\t\t\tcase 'vector_path_line': return '\\e098';\n\t\t\tcase 'vector_path_curve': return '\\e099';\n\t\t\tcase 'vector_path_all': return '\\e100';\n\t\t\tcase 'font': return '\\e101';\n\t\t\tcase 'italic': return '\\e102';\n\t\t\tcase 'bold': return '\\e103';\n\t\t\tcase 'text_underline': return '\\e104';\n\t\t\tcase 'text_strike': return '\\e105';\n\t\t\tcase 'text_height': return '\\e106';\n\t\t\tcase 'text_width': return '\\e107';\n\t\t\tcase 'text_resize': return '\\e108';\n\t\t\tcase 'left_indent': return '\\e109';\n\t\t\tcase 'right_indent': return '\\e110';\n\t\t\tcase 'align_left': return '\\e111';\n\t\t\tcase 'align_center': return '\\e112';\n\t\t\tcase 'align_right': return '\\e113';\n\t\t\tcase 'justify': return '\\e114';\n\t\t\tcase 'list': return '\\e115';\n\t\t\tcase 'text_smaller': return '\\e116';\n\t\t\tcase 'text_bigger': return '\\e117';\n\t\t\tcase 'embed': return '\\e118';\n\t\t\tcase 'embed_close': return '\\e119';\n\t\t\tcase 'table': return '\\e120';\n\t\t\tcase 'message_full': return '\\e121';\n\t\t\tcase 'message_empty': return '\\e122';\n\t\t\tcase 'message_in': return '\\e123';\n\t\t\tcase 'message_out': return '\\e124';\n\t\t\tcase 'message_plus': return '\\e125';\n\t\t\tcase 'message_minus': return '\\e126';\n\t\t\tcase 'message_ban': return '\\e127';\n\t\t\tcase 'message_flag': return '\\e128';\n\t\t\tcase 'message_lock': return '\\e129';\n\t\t\tcase 'message_new': return '\\e130';\n\t\t\tcase 'inbox': return '\\e131';\n\t\t\tcase 'inbox_plus': return '\\e132';\n\t\t\tcase 'inbox_minus': return '\\e133';\n\t\t\tcase 'inbox_lock': return '\\e134';\n\t\t\tcase 'inbox_in': return '\\e135';\n\t\t\tcase 'inbox_out': return '\\e136';\n\t\t\tcase 'cogwheel': return '\\e137';\n\t\t\tcase 'cogwheels': return '\\e138';\n\t\t\tcase 'picture': return '\\e139';\n\t\t\tcase 'adjust_alt': return '\\e140';\n\t\t\tcase 'database_lock': return '\\e141';\n\t\t\tcase 'database_plus': return '\\e142';\n\t\t\tcase 'database_minus': return '\\e143';\n\t\t\tcase 'database_ban': return '\\e144';\n\t\t\tcase 'folder_open': return '\\e145';\n\t\t\tcase 'folder_plus': return '\\e146';\n\t\t\tcase 'folder_minus': return '\\e147';\n\t\t\tcase 'folder_lock': return '\\e148';\n\t\t\tcase 'folder_flag': return '\\e149';\n\t\t\tcase 'folder_new': return '\\e150';\n\t\t\tcase 'edit': return '\\e151';\n\t\t\tcase 'new_window': return '\\e152';\n\t\t\tcase 'check': return '\\e153';\n\t\t\tcase 'unchecked': return '\\e154';\n\t\t\tcase 'more_windows': return '\\e155';\n\t\t\tcase 'show_big_thumbnails': return '\\e156';\n\t\t\tcase 'show_thumbnails': return '\\e157';\n\t\t\tcase 'show_thumbnails_with_lines': return '\\e158';\n\t\t\tcase 'show_lines': return '\\e159';\n\t\t\tcase 'playlist': return '\\e160';\n\t\t\tcase 'imac': return '\\e161';\n\t\t\tcase 'macbook': return '\\e162';\n\t\t\tcase 'ipad': return '\\e163';\n\t\t\tcase 'iphone': return '\\e164';\n\t\t\tcase 'iphone_transfer': return '\\e165';\n\t\t\tcase 'iphone_exchange': return '\\e166';\n\t\t\tcase 'ipod': return '\\e167';\n\t\t\tcase 'ipod_shuffle': return '\\e168';\n\t\t\tcase 'ear_plugs': return '\\e169';\n\t\t\tcase 'phone': return '\\e170';\n\t\t\tcase 'step_backward': return '\\e171';\n\t\t\tcase 'fast_backward': return '\\e172';\n\t\t\tcase 'rewind': return '\\e173';\n\t\t\tcase 'play': return '\\e174';\n\t\t\tcase 'pause': return '\\e175';\n\t\t\tcase 'stop': return '\\e176';\n\t\t\tcase 'forward': return '\\e177';\n\t\t\tcase 'fast_forward': return '\\e178';\n\t\t\tcase 'step_forward': return '\\e179';\n\t\t\tcase 'eject': return '\\e180';\n\t\t\tcase 'facetime_video': return '\\e181';\n\t\t\tcase 'download_alt': return '\\e182';\n\t\t\tcase 'mute': return '\\e183';\n\t\t\tcase 'volume_down': return '\\e184';\n\t\t\tcase 'volume_up': return '\\e185';\n\t\t\tcase 'screenshot': return '\\e186';\n\t\t\tcase 'move': return '\\e187';\n\t\t\tcase 'more': return '\\e188';\n\t\t\tcase 'brightness_reduce': return '\\e189';\n\t\t\tcase 'brightness_increase': return '\\e190';\n\t\t\tcase 'circle_plus': return '\\e191';\n\t\t\tcase 'circle_minus': return '\\e192';\n\t\t\tcase 'circle_remove': return '\\e193';\n\t\t\tcase 'circle_ok': return '\\e194';\n\t\t\tcase 'circle_question_mark': return '\\e195';\n\t\t\tcase 'circle_info': return '\\e196';\n\t\t\tcase 'circle_exclamation_mark': return '\\e197';\n\t\t\tcase 'remove': return '\\e198';\n\t\t\tcase 'ok': return '\\e199';\n\t\t\tcase 'ban': return '\\e200';\n\t\t\tcase 'download': return '\\e201';\n\t\t\tcase 'upload': return '\\e202';\n\t\t\tcase 'shopping_cart': return '\\e203';\n\t\t\tcase 'lock': return '\\e204';\n\t\t\tcase 'unlock': return '\\e205';\n\t\t\tcase 'electricity': return '\\e206';\n\t\t\tcase 'ok_2': return '\\e207';\n\t\t\tcase 'remove_2': return '\\e208';\n\t\t\tcase 'cart_out': return '\\e209';\n\t\t\tcase 'cart_in': return '\\e210';\n\t\t\tcase 'left_arrow': return '\\e211';\n\t\t\tcase 'right_arrow': return '\\e212';\n\t\t\tcase 'down_arrow': return '\\e213';\n\t\t\tcase 'up_arrow': return '\\e214';\n\t\t\tcase 'resize_small': return '\\e215';\n\t\t\tcase 'resize_full': return '\\e216';\n\t\t\tcase 'circle_arrow_left': return '\\e217';\n\t\t\tcase 'circle_arrow_right': return '\\e218';\n\t\t\tcase 'circle_arrow_top': return '\\e219';\n\t\t\tcase 'circle_arrow_down': return '\\e220';\n\t\t\tcase 'play_button': return '\\e221';\n\t\t\tcase 'unshare': return '\\e222';\n\t\t\tcase 'share': return '\\e223';\n\t\t\tcase 'chevron-right': return '\\e224';\n\t\t\tcase 'chevron-left': return '\\e225';\n\t\t\tcase 'bluetooth': return '\\e226';\n\t\t\tcase 'euro': return '\\20AC';\n\t\t\tcase 'usd': return '\\e228';\n\t\t\tcase 'gbp': return '\\e229';\n\t\t\tcase 'retweet_2': return '\\e230';\n\t\t\tcase 'moon': return '\\e231';\n\t\t\tcase 'sun': return '\\2609';\n\t\t\tcase 'cloud': return '\\2601';\n\t\t\tcase 'direction': return '\\e234';\n\t\t\tcase 'brush': return '\\e235';\n\t\t\tcase 'pen': return '\\e236';\n\t\t\tcase 'zoom_in': return '\\e237';\n\t\t\tcase 'zoom_out': return '\\e238';\n\t\t\tcase 'pin': return '\\e239';\n\t\t\tcase 'albums': return '\\e240';\n\t\t\tcase 'rotation_lock': return '\\e241';\n\t\t\tcase 'flash': return '\\e242';\n\t\t\tcase 'google_maps': return '\\e243';\n\t\t\tcase 'anchor': return '\\2693';\n\t\t\tcase 'conversation': return '\\e245';\n\t\t\tcase 'chat': return '\\e246';\n\t\t\tcase 'male': return '\\e247';\n\t\t\tcase 'female': return '\\e248';\n\t\t\tcase 'asterisk': return '\\002A';\n\t\t\tcase 'divide': return '\\00F7';\n\t\t\tcase 'snorkel_diving': return '\\e251';\n\t\t\tcase 'scuba_diving': return '\\e252';\n\t\t\tcase 'oxygen_bottle': return '\\e253';\n\t\t\tcase 'fins': return '\\e254';\n\t\t\tcase 'fishes': return '\\e255';\n\t\t\tcase 'boat': return '\\e256';\n\t\t\tcase 'delete': return '\\e257';\n\t\t\tcase 'sheriffs_star': return '\\e258';\n\t\t\tcase 'qrcode': return '\\e259';\n\t\t\tcase 'barcode': return '\\e260';\n\t\t\tcase 'pool': return '\\e261';\n\t\t\tcase 'buoy': return '\\e262';\n\t\t\tcase 'spade': return '\\e263';\n\t\t\tcase 'bank': return '\\e264';\n\t\t\tcase 'vcard': return '\\e265';\n\t\t\tcase 'electrical_plug': return '\\e266';\n\t\t\tcase 'flag': return '\\e267';\n\t\t\tcase 'credit_card': return '\\e268';\n\t\t\tcase 'keyboard-wireless': return '\\e269';\n\t\t\tcase 'keyboard-wired': return '\\e270';\n\t\t\tcase 'shield': return '\\e271';\n\t\t\tcase 'ring': return '\\02DA';\n\t\t\tcase 'cake': return '\\e273';\n\t\t\tcase 'drink': return '\\e274';\n\t\t\tcase 'beer': return '\\e275';\n\t\t\tcase 'fast_food': return '\\e276';\n\t\t\tcase 'cutlery': return '\\e277';\n\t\t\tcase 'pizza': return '\\e278';\n\t\t\tcase 'birthday_cake': return '\\e279';\n\t\t\tcase 'tablet': return '\\e280';\n\t\t\tcase 'settings': return '\\e281';\n\t\t\tcase 'bullets': return '\\e282';\n\t\t\tcase 'cardio': return '\\e283';\n\t\t\tcase 't-shirt': return '\\e284';\n\t\t\tcase 'pants': return '\\e285';\n\t\t\tcase 'sweater': return '\\e286';\n\t\t\tcase 'fabric': return '\\e287';\n\t\t\tcase 'leather': return '\\e288';\n\t\t\tcase 'scissors': return '\\e289';\n\t\t\tcase 'bomb': return '\\e290';\n\t\t\tcase 'skull': return '\\e291';\n\t\t\tcase 'celebration': return '\\e292';\n\t\t\tcase 'tea_kettle': return '\\e293';\n\t\t\tcase 'french_press': return '\\e294';\n\t\t\tcase 'coffe_cup': return '\\e295';\n\t\t\tcase 'pot': return '\\e296';\n\t\t\tcase 'grater': return '\\e297';\n\t\t\tcase 'kettle': return '\\e298';\n\t\t\tcase 'hospital': return '\\e299';\n\t\t\tcase 'hospital_h': return '\\e300';\n\t\t\tcase 'microphone': return '\\e301';\n\t\t\tcase 'webcam': return '\\e302';\n\t\t\tcase 'temple_christianity_church': return '\\e303';\n\t\t\tcase 'temple_islam': return '\\e304';\n\t\t\tcase 'temple_hindu': return '\\e305';\n\t\t\tcase 'temple_buddhist': return '\\e306';\n\t\t\tcase 'bicycle': return '\\e307';\n\t\t\tcase 'life_preserver': return '\\e308';\n\t\t\tcase 'share_alt': return '\\e309';\n\t\t\tcase 'comments': return '\\e310';\n\t\t\tcase 'flower': return '\\2698';\n\t\t\tcase 'baseball': return '\\e312';\n\t\t\tcase 'rugby': return '\\e313';\n\t\t\tcase 'ax': return '\\e314';\n\t\t\tcase 'table_tennis': return '\\e315';\n\t\t\tcase 'bowling': return '\\e316';\n\t\t\tcase 'tree_conifer': return '\\e317';\n\t\t\tcase 'tree_deciduous': return '\\e318';\n\t\t\tcase 'more_items': return '\\e319';\n\t\t\tcase 'sort': return '\\e320';\n\t\t\tcase 'filter': return '\\e321';\n\t\t\tcase 'gamepad': return '\\e322';\n\t\t\tcase 'playing_dices': return '\\e323';\n\t\t\tcase 'calculator': return '\\e324';\n\t\t\tcase 'tie': return '\\e325';\n\t\t\tcase 'wallet': return '\\e326';\n\t\t\tcase 'piano': return '\\e327';\n\t\t\tcase 'sampler': return '\\e328';\n\t\t\tcase 'podium': return '\\e329';\n\t\t\tcase 'soccer_ball': return '\\e330';\n\t\t\tcase 'blog': return '\\e331';\n\t\t\tcase 'dashboard': return '\\e332';\n\t\t\tcase 'certificate': return '\\e333';\n\t\t\tcase 'bell': return '\\e334';\n\t\t\tcase 'candle': return '\\e335';\n\t\t\tcase 'pushpin': return '\\e336';\n\t\t\tcase 'iphone_shake': return '\\e337';\n\t\t\tcase 'pin_flag': return '\\e338';\n\t\t\tcase 'turtle': return '\\e339';\n\t\t\tcase 'rabbit': return '\\e340';\n\t\t\tcase 'globe': return '\\e341';\n\t\t\tcase 'briefcase': return '\\e342';\n\t\t\tcase 'hdd': return '\\e343';\n\t\t\tcase 'thumbs_up': return '\\e344';\n\t\t\tcase 'thumbs_down': return '\\e345';\n\t\t\tcase 'hand_right': return '\\e346';\n\t\t\tcase 'hand_left': return '\\e347';\n\t\t\tcase 'hand_up': return '\\e348';\n\t\t\tcase 'hand_down': return '\\e349';\n\t\t\tcase 'fullscreen': return '\\e350';\n\t\t\tcase 'shopping_bag': return '\\e351';\n\t\t\tcase 'book_open': return '\\e352';\n\t\t\tcase 'nameplate': return '\\e353';\n\t\t\tcase 'nameplate_alt': return '\\e354';\n\t\t\tcase 'vases': return '\\e355';\n\t\t\tcase 'bullhorn': return '\\e356';\n\t\t\tcase 'dumbbell': return '\\e357';\n\t\t\tcase 'suitcase': return '\\e358';\n\t\t\tcase 'file_import': return '\\e359';\n\t\t\tcase 'file_export': return '\\e360';\n\t\t\tcase 'bug': return '\\e361';\n\t\t\tcase 'crown': return '\\e362';\n\t\t\tcase 'smoking': return '\\e363';\n\t\t\tcase 'cloud-upload': return '\\e364';\n\t\t\tcase 'cloud-download': return '\\e365';\n\t\t\tcase 'restart': return '\\e366';\n\t\t\tcase 'security_camera': return '\\e367';\n\t\t\tcase 'expand': return '\\e368';\n\t\t\tcase 'collapse': return '\\e369';\n\t\t\tcase 'collapse_top': return '\\e370';\n\t\t\tcase 'globe_af': return '\\e371';\n\t\t\tcase 'global': return '\\e372';\n\t\t\tcase 'spray': return '\\e373';\n\t\t\tcase 'nails': return '\\e374';\n\t\t\tcase 'claw_hammer': return '\\e375';\n\t\t\tcase 'classic_hammer': return '\\e376';\n\t\t\tcase 'hand_saw': return '\\e377';\n\t\t\tcase 'riflescope': return '\\e378';\n\t\t\tcase 'electrical_socket_eu': return '\\e379';\n\t\t\tcase 'electrical_socket_us': return '\\e380';\n\t\t\tcase 'pinterest': return '\\e381';\n\t\t\tcase 'dropbox': return '\\e382';\n\t\t\tcase 'google_plus': return '\\e383';\n\t\t\tcase 'jolicloud': return '\\e384';\n\t\t\tcase 'yahoo': return '\\e385';\n\t\t\tcase 'blogger': return '\\e386';\n\t\t\tcase 'picasa': return '\\e387';\n\t\t\tcase 'amazon': return '\\e388';\n\t\t\tcase 'tumblr': return '\\e389';\n\t\t\tcase 'wordpress': return '\\e390';\n\t\t\tcase 'instapaper': return '\\e391';\n\t\t\tcase 'evernote': return '\\e392';\n\t\t\tcase 'xing': return '\\e393';\n\t\t\tcase 'zootool': return '\\e394';\n\t\t\tcase 'dribbble': return '\\e395';\n\t\t\tcase 'deviantart': return '\\e396';\n\t\t\tcase 'read_it_later': return '\\e397';\n\t\t\tcase 'linked_in': return '\\e398';\n\t\t\tcase 'forrst': return '\\e399';\n\t\t\tcase 'pinboard': return '\\e400';\n\t\t\tcase 'behance': return '\\e401';\n\t\t\tcase 'github': return '\\e402';\n\t\t\tcase 'youtube': return '\\e403';\n\t\t\tcase 'skitch': return '\\e404';\n\t\t\tcase 'foursquare': return '\\e405';\n\t\t\tcase 'quora': return '\\e406';\n\t\t\tcase 'badoo': return '\\e407';\n\t\t\tcase 'spotify': return '\\e408';\n\t\t\tcase 'stumbleupon': return '\\e409';\n\t\t\tcase 'readability': return '\\e410';\n\t\t\tcase 'facebook': return '\\e411';\n\t\t\tcase 'twitter': return '\\e412';\n\t\t\tcase 'instagram': return '\\e413';\n\t\t\tcase 'posterous_spaces': return '\\e414';\n\t\t\tcase 'vimeo': return '\\e415';\n\t\t\tcase 'flickr': return '\\e416';\n\t\t\tcase 'last_fm': return '\\e417';\n\t\t\tcase 'rss': return '\\e418';\n\t\t\tcase 'skype': return '\\e419';\n\t\t\tcase 'e-mail': return '\\e420';\n\n\t\t}\n\t}", "function HasFont(){}", "function acquia_ajax_fontello_css($path, $font){\n\t$loaded = drupal_add_css();\n\tdrupal_add_css($path .'/css/' .$font .'.css');\n\t$new = drupal_add_css($path .'/css/' .$font .'-ie7.css', array('browsers' => array('IE' => 'IE 7', '!IE' => FALSE)));\n\treturn array_diff_key($new, $loaded);\n}", "private function check_icon_font_usage() {\n\n global $wp_version;\n\n if ( ( version_compare( $wp_version, '3.8', '>=' ) == TRUE ) ) {\n $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n wp_enqueue_style( 'wpsl-admin-38', plugins_url( '/css/style-3.8'. $min .'.css', __FILE__ ), false );\n }\n }", "function av_icon_char($char)\n{\n\tglobal $avia_config;\n\treturn avia_font_manager::frontend_icon($avia_config['font_icons'][$char]['icon'], $avia_config['font_icons'][$char]['font'], false);\n}", "public function hasIcon()\n {\n $metadata = $this->getFieldMetadata('icon');\n return (strlen($this->getValue('icon')) &&\n isset($metadata['mimeType']));\n }", "function bootstrap_icon_fontawesome( $icon ) {\t \n\t$array_bootstrap = array( \"circle-arrow-right\" ,\n\t\t\t\t\t\t\t\t \"move\",\n \"transfer\",\n \"question-sign\",\n\t\t\t\t\t\t\t\t \"ok\",\n\t\t\t\t\t\t\t\t \"info-sign\",\n\t\t\t\t\t\t\t\t \"check\",\n\t\t\t\t\t\t\t\t \"clock\",\n\t\t\t\t\t\t\t\t \"ok-sign\",\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \"th\",\n\t\t\t\t\t\t\t\t \"screenshot\",\n\t\t\t\t\t\t\t\t \"remove-sign\",\n\t\t\t\t\t\t\t\t \"folder-open\",\n\t\t\t\t\t\t\t\t \"list-alt\",\n\t\t\t\t\t\t\t\t \"th-list\",\n\t\t\t\t\t\t\t\t \"disk\",\n\t\t\t\t\t\t\t\t \"transfer\",\n\t\t\t\t\t\t\t\t \"remove-circle\",\n\t\t\t\t\t\t\t\t \"ok-circle\",\n\t\t\t\t\t\t\t\t \"ban-circle\",\n\t\t\t\t\t\t\t\t \"sort-by-alphabet\",\n\t\t\t\t\t\t\t\t \"sort-by-alphabet-alt\",\n\t\t\t\t\t\t\t\t \"sort-by-order\",\n\t\t\t\t\t\t\t\t \"sort-by-order-alt\",\n\t\t\t\t\t\t\t\t \"triangle-bottom\",\n\t\t\t\t\t\t\t\t \"triangle-top\",\n\t\t\t\t\t\t\t\t \"eye-open\",\n\t\t\t\t\t\t\t\t \"equalizer\",\n\t\t\t\t\t\t\t\t \"import\",\n\t\t\t\t\t\t\t\t \"open\",\n\t\t\t\t\t\t\t\t \"log-in\") ;\n\t$array_font = array( \"arrow-circle-o-right\",\n\t\t\t\t\t\t\t \"sign-out\",\n\t\t\t\t\t\t\t \"random\",\n\t\t\t\t\t\t\t \"question\",\n\t\t\t\t\t\t\t \"check-square-o\",\n\t\t\t\t\t\t\t \"info-circle\",\n\t\t\t\t\t\t\t \"check-square-o\",\n\t\t\t\t\t\t\t \"clock-o\",\n\t\t\t\t\t\t\t \"check-circle\",\n\t\t\t\t\t\t\t \"th-large\",\n\t\t\t\t\t\t\t \"paperclip\",\n\t\t\t\t\t\t\t \"times-circle\",\n\t\t\t\t\t\t\t \"unlock\",\n\t\t\t\t\t\t\t \"list-ol\",\n\t\t\t\t\t\t\t \"money\", \n\t\t\t\t\t\t\t \"server\",\n\t\t\t\t\t\t\t \"forward\",\n\t\t\t\t\t\t\t \"times-circle-o\",\n\t\t\t\t\t\t\t \"plus-circle\",\n\t\t\t\t\t\t\t \"trash\",\n\t\t\t\t\t\t\t \"sort-alpha-asc\",\n\t\t\t\t\t\t\t \"sort-alpha-desc\",\n\t\t\t\t\t\t\t \"sort-amount-asc\",\n\t\t\t\t\t\t\t \"sort-amount-desc\",\n\t\t\t\t\t\t\t \"caret-down\",\n\t\t\t\t\t\t\t \"caret-up\",\n\t\t\t\t\t\t\t \"eye\",\n\t\t\t\t\t\t\t \"bar-chart\",\n\t\t\t\t\t\t\t \"external-link\",\n\t\t\t\t\t\t\t \"upload\",\n\t\t\t\t\t\t\t \"sign-in\") ;\n\t$key = array_search($icon, $array_bootstrap ) ;\t\n\tif ( $key !== false ) { \t\t\n\t\t $name = $array_font[$key] ;\n } else {\n\t\t $name = $icon ;\n\t} \t \n return $name;\n}", "function HasCharacterStyleName(){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purposesame as setting_TEXT_BOX() except for it stores data in encrypted way Inputs $dataType = 0 string $dataType = 1 float $dataType = 2 int Remarks Returns
function setting_TEXT_BOX_SECURE($dataType, $settingsID) { $q = db_phquery("select settings_constant_name from ". SETTINGS_TABLE." where settingsID=?",$settingsID); $row = db_fetch_row( $q ); $settings_constant_name = $row["settings_constant_name"]; if ( isset($_POST["save"]) && isset($_POST["setting".$settings_constant_name]) ) { if ( $dataType == 0 ) $value = $_POST["setting".$settings_constant_name]; else if ( $dataType == 1 ) $value = (float)$_POST["setting".$settings_constant_name]; else if ( $dataType == 2 ) $value = (int)$_POST["setting".$settings_constant_name]; _setSettingOptionValue( $settings_constant_name, Crypt::CCNumberCrypt ( $value , NULL ) ); } return "<input type=text value='".Crypt::CCNumberDeCrypt( _getSettingOptionValue( $settings_constant_name ) , NULL ). "' name='setting".$settings_constant_name."' size='40' >"; }
[ "function TextField3($strLabel, $strField, $strValue, $nSize, $nMaxLength, $bPassword , $callBack = '')\n\t{\n\t\techo \"<tr>\";\n\t\techo \"\t<td>\";\n\t\techo\t\t$strLabel;\n\t\techo \"\t</td>\";\n\t\techo \"\t<td align=center>\";\n\n\t\tif($bPassword)\n\t\t\techo \"\t\t<input type=password name=$strField value='$strValue' size=$nSize maxlength=$nMaxLength $callBack>\";\n\t\telse\n\t\t\techo \"\t\t<input type=text name=$strField value='$strValue' size=$nSize maxlength=$nMaxLength $callBack>\";\n\n\t\techo \"\t</td>\";\n\t\techo \"</tr>\";\n\t}", "private function prepareTextbox(){\n\t\techo (isset($this->settings['before_field']))? $this->settings['before_field']:null;\n\t\techo '<input type=\"text\" ';\n\t\techo 'name = \"'.$this->name.'\" ';\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\n\t\t\n\t\techo (isset($this->settings['datatype']))? 'datatype = \"'.$this->settings['datatype'].'\" ':null;\n\t\techo($this->settings['required_mark'])? ' required ':null;\n\t\t\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\n\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\n\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? 'disabled=\"disabled\"':null;\t\n\t\techo ' />';\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null;\n\t\techo $this->display_field_msg($this->name, $this->settings['field_msg']);\n\t}", "private function prepareTextbox(){\r\n\t\r\n\t\techo (isset($this->settings['before_field']))? $this->settings['before_field']:null;\r\n\t\techo '<input type=\"text\" ';\r\n\t\techo 'name = \"'.$this->name.'\" ';\r\n\t\techo (isset($this->settings['id']))? 'id = \"'.$this->settings['id'].'\" ':null;\r\n\t\techo (isset($this->settings['value']))? 'value = \"'.$this->settings['value'].'\" ':null;\r\n\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\r\n\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? 'disabled=\"disabled\"':null;\t\r\n\t\techo ' />';\r\n\t\techo (isset($this->settings['after_field']))? $this->settings['after_field']:null;\r\n\t\techo $this->display_field_msg($this->name, $this->settings['field_msg']);\r\n\t\t\r\n\t}", "function text($data, $name, $default = \"\", $maxLength = \"\", $id = \"\")\n{\n $retString = \"<input type=\\\"text\\\" name=\\\"$name\\\" value=\\\"\";\n\n if (array_key_exists($name, $data)){\n $retString .= \"$data[$name]\";\n }\n else if ($default != \"\"){\n $retString .= \"$default\";\n }\n\n $retString .= \"\\\"\";\n \n if ($maxLength != \"\"){\n $retString .= \" size=\\\"$maxLength\\\"\";;\n }\n\n if ($id != \"\"){\n $retString .= \" id=\\\"$id\\\"\";;\n }\n\n // $retString .= \" style=\\\"width:100%\\\">\";\n $retString .= \">\";\n return ($retString);\n}", "function doSettingControl( $type = \"default\" )\n {\n $settingKey = $this->getKey();\n $settingWho = $this->who;\n $pluginSlug = $this->_slug();\n $settingInputName = \"{$pluginSlug}[{$settingWho}/{$settingKey}]\";\n $settingInputID = \"{$pluginSlug}-{$settingWho}-{$settingKey}\";\n $settingValue = $this->getValue( true );\n $settingPlaceholder = $this->getProperty( \"placeholder\" );\n if( \"default\" == $type )\n {\n $type = $this->getType();\n }\n \n switch( $type )\n {\n \n case \"hidden\":\n $settingControl = \"<input data-actual='true' id='{$settingInputID}' type='hidden' name='{$settingInputName}' value='{$settingValue}' />\";\n break;\n case \"radio\":\n $theOptions = $this->getProperty( \"radio-values\" );\n if( !is_array( $theOptions ) )\n {\n $theOptions = array();\n }\n $settingControl = \"\";\n foreach( $theOptions as $option )\n {\n $settingControl .= \"<input type='radio' name='{$settingInputName}' value='{$option}' />\";\n }\n break;\n case \"color\"://Bloody American spelling\n case \"colour\":\n $settingControl = \"<input class='color-input' data-actual='true' id='{$settingInputID}' type='text' name='{$settingInputName}' value='{$settingValue}' />\";\n break;\n case \"checkbox\":\n $checked = \"\";\n if( \"on\" == $settingValue )\n {\n $checked = 'checked=\"checked\"';\n }\n $settingControl = \"<input id='{$settingInputID}-backup' type='hidden' name='{$settingInputName}' value='off' />\";\n $settingControl .= \"<input data-actual='true' {$checked} id='{$settingInputID}' type='checkbox' name='{$settingInputName}' value='on' />\";\n break;\n\n case \"password\":\n $settingControl = \"<input class='lava-focus-inner lava-auto-resize' placeholder='{$settingPlaceholder}' data-actual='true' id='{$settingInputID}' type='password' name='{$settingInputName}' value='{$settingValue}' />\";\n break;\n\n case \"timeperiod\":\n $settingControl = \"<input data-actual='true' id='{$settingInputID}' type='text' name='{$settingInputName}' value='{$settingValue}' />\";\n\t\t\tcase \"skin\":\n case \"text\":\n default:\n $settingControl = \"<input data-actual='true' id='{$settingInputID}' type='text' name='{$settingInputName}' value='{$settingValue}' />\";\n }\n\n $settingControl = $this->runFilters( \"settingControl\", $settingControl );\n\n return $settingControl;\n }", "function storeTpe()\r\n\t{\r\n\t\t$input_def['id'] = 'storeTpe';\r\n\t\t$input_def['name'] = 'storeTpe';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}", "function changeDataType() {\n\n}", "private function char_type($data, $num, $value = \"\"){ \n if(in_array($data[\"name\"], array_keys($this->lang))) \n { \n $this->forms[$num][\"html\"] .= \"<tr><td class='char_label'>\".$this->lang[$data[\"name\"]].\": </td>\"; \n } \n else \n { \n $this->forms[$num][\"html\"] .= \"<tr><td class='char_label'>\".$data[\"name\"].\": </td>\"; \n } \n $this->forms[$num][\"html\"] .= \"<td class='char_input'>\"; \n $this->forms[$num][\"html\"] .= \"<input type='text' \"; \n $this->forms[$num][\"html\"] .= \"name='\".$data[\"name\"].\"_\".$num.\"' id='\".$data[\"name\"].\"_\".$num.\"'\"; \n if(trim($value) != \"\") \n { \n $this->forms[$num][\"html\"] .= \" value='\".$value.\"'\"; \n } \n else if(trim($data[\"default\"]) != \"\") \n { \n $this->forms[$num][\"html\"] .= \" value='\".$data[\"default\"].\"'\"; \n } \n if(trim($data[\"size\"]) != \"\") \n { \n $this->forms[$num][\"html\"] .= \" maxlength='\".$data[\"size\"].\"'\"; \n } \n $this->forms[$num][\"html\"] .= \"/>\"; \n $this->forms[$num][\"html\"] .= \"</td></tr> \\n\"; \n }", "function clients_userpage_storeInput($ctlData,$clientID) {\n\t## we dont' store anything because the user editor can't change anything\n}", "function TextField($strLabel, $strField, $strValue, $nSize, $nMaxLength, $bPassword , $callBack = '', $strReadonly='')\n\t{\n\t\techo \"<tr>\";\n\t\techo \"\t<td>\";\n\t\techo\t\t$strLabel;\n\t\techo \"\t</td>\";\n\t\techo \"\t<td>\";\n\n\t\tif($bPassword)\n\t\t\techo \"\t\t<input type=password $strReadonly name=$strField value='$strValue' size=$nSize maxlength=$nMaxLength $callBack>\";\n\t\telse\n\t\t\techo \"\t\t<input type=text $strReadonly name=$strField value='$strValue' size=$nSize maxlength=$nMaxLength $callBack>\";\n\n\t\techo \"\t</td>\";\n\t\techo \"</tr>\";\n\t}", "function vui_el_input_text( $f_params = NULL ){\n\t\n\t// -------------------------------------------------\n\t// Parsing vars ------------------------------------\n\t\n\t$text = $f_params['text'] =\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['text'] ) ? $f_params['text'] : '';\n\t$icon = $f_params['icon'] =\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['icon'] ) ? $f_params['icon'] : '';\n\t$title = $f_params['title'] =\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['title'] ) ? $f_params['title'] : '';\n\t$wrapper_class = $f_params['wrapper_class'] =\t\t\t\t\t\t\t\tisset( $f_params['wrapper_class'] ) ? $f_params['wrapper_class'] : '';\n\t$class = $f_params['class'] =\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['class'] ) ? $f_params['class'] : '';\n\t$id = $f_params['id'] =\t\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['id'] ) ? $f_params['id'] : '';\n\t$value = $f_params['value'] =\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['value'] ) ? $f_params['value'] : '';\n\t$name = $f_params['name'] =\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['name'] ) ? $f_params['name'] : '';\n\t$label = $f_params['label'] =\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['label'] ) ? $f_params['label'] : NULL;\n\t$form = $f_params['form'] =\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['form'] ) ? $f_params['form'] : '';\n\t$attr = $f_params['attr'] =\t\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params['attr'] ) ? $f_params['attr'] : '';\n\t$minify = $f_params['minify'] =\t\t\t\t\t\t\t\t\t\t\t\tisset( $f_params[ 'minify' ] ) ? $f_params[ 'minify' ] : TRUE;\n\t$autofocus = $f_params['autofocus'] =\t\t\t\t\t\t\t\t\t\tisset( $f_params[ 'autofocus' ] ) ? $f_params[ 'autofocus' ] : FALSE;\n\t$layout = $f_params[ 'layout' ] =\t\t\t\t\t\t\t\t\t\t\tisset( $f_params[ 'layout' ] ) ? $f_params[ 'layout' ] : 'default';\n\n\t// Parsing vars ------------------------------------\n\t// -------------------------------------------------\n\t\n\t$CI =& get_instance();\n\t\n\t// verificando se o tema atual possui a view\n\tif ( file_exists( THEMES_PATH . theme_helpers_views_path() . 'vui_el' . DS . $layout . DS . 'input_text.php' ) ){\n\t\t\n\t\t$view = $CI->load->view( theme_helpers_views_path() . 'vui_el' . DS . $layout . DS . 'input_text', $f_params, TRUE );\n\t\t\n\t}\n\t// verificando se a view existe no diretório de views padrão\n\telse if ( file_exists( VIEWS_PATH . HELPERS_DIR_NAME . DS . 'vui_el' . DS . $layout . DS . 'input_text.php' ) ){\n\t\t\n\t\t$view = $CI->load->view( HELPERS_DIR_NAME . DS . 'vui_el' . DS . $layout . DS . 'input_text', $f_params, TRUE);\n\t\t\n\t}\n\t\n\treturn $minify ? minify_html( $view ) : $view;\n\t\n}", "public function textpassword() {\r\n $this->defaultOption();\r\n $textbox = '';\r\n// $textbox = '<div class=\"col-xs-3\">';\r\n $minlength = \"\";\r\n $maxlength = \"\";\r\n if ($this->formOption['MINLENGTH'] != null) {\r\n $minlength = ' minlength=\"' . $this->formOption['MINLENGTH'] . '\"';\r\n }\r\n\r\n if ($this->formOption['MAXLENGTH'] != null) {\r\n $maxlength = ' maxlength=\"' . $this->formOption['MAXLENGTH'] . '\"';\r\n }\r\n $textbox .= '<input type=\"password\"\r\n placeholder=\"' . $this->formOption['PLACEHOLDER'] . '\"\r\n name=\"' . $this->formOption['NAME'] . '\"\r\n id=\"' . $this->formOption['ID'] . '\"\r\n ' . $this->formOption['REQUIRED'] . '\r\n ' . $this->formOption['MANUAL_ATTRIBUT'] . '\r\n value=\"' . $this->formOption['VALUE'] . '\"\r\n ' . $minlength . $maxlength . '\r\n class=\"form-control\">';\r\n// $textbox .= '<div>';\r\n $rs = $this->formGroup($textbox);\r\n $this->ResetObject();\r\n return $rs;\r\n }", "function yab_shop_text_input($name, $val, $size = '')\n{\n\treturn fInput('text', $name, $val, 'edit', '', '', $size, '', $name);\n}", "abstract protected function textField();", "function acf_encrypt($data = '') {}", "function cek_input($data) {\r\n\t$data = trim($data); //variabel data menyimpan nilai trim($data), trim memiliki fungsi untuk menghapus spasi pada variabel data\r\n\t$data = stripslashes($data); //variabel data menyimpan nilai stripslashes($data), stripslashes($data) untuk membersihkan data\r\n\t$data = htmlspecialchars($data); // variabel data menyimpan nilai htmlspecialchars($data), htmlspecialchars($data) untuk mengkonversi beberapa data\r\n\treturn $data; //untuk mengembalikan nilai variabel data\r\n}", "public function setDataType($dataType);", "function acf_encrypt($data = '')\n{\n}", "function storeRang()\r\n\t{\r\n\t\t$input_def['id'] = 'storeRang';\r\n\t\t$input_def['name'] = 'storeRang';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Replace post count manually for each category or tag, instead of using the count stored in database
function wppriv_fix_post_count ($terms, $taxonomies, $args) { global $wpdb; if ( !in_array( 'category', $taxonomies ) && !in_array( 'post_tag', $taxonomies ) ) return $terms; foreach ($terms as $term) { $term->count = $wpdb->get_var( $wpdb->prepare( "SELECT count(ID) FROM " . "$wpdb->term_relationships AS tr INNER JOIN " . "$wpdb->posts AS p ON (tr.object_id = p.ID) INNER JOIN " . "$wpdb->term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) " . "WHERE tt.term_id = %s AND p.post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ), $term->term_id ) ); } return $terms; }
[ "function foodog_post_update_count( $pid ) {\n\n $countKey = '_foodog_post_views_count';\n $count = get_post_meta($pid, $countKey, true);\n\n if($count == '') {\n $count = 1;\n delete_post_meta($pid, $countKey);\n } else\n $count++;\n \n update_post_meta($pid, $countKey, $count);\n\n}", "public function _resetPostCount() {\n\t\t$this->postCount = 0;\n\t\tforeach ($this->topics as $topic) {\n\t\t\t/** @var $topic Tx_MmForum_Domain_Model_Forum_Topic */\n\t\t\t$this->postCount += $topic->getPostCount();\n\t\t}\n\t}", "public function updateCount()\n {\n $this->count = $this->posts()->count();\n\n $this->save();\n }", "private function update_post_views() {\n\t\t\n\t\t//Init vars\n\t\tglobal $post;\n\t\t$count_meta_key = '_prso_theme_view_count';\n\t\t$count\t\t\t= NULL;\n\t\t\n\t\tif( isset($post->ID) && !is_admin() && !is_front_page() && !is_home() && !is_user_logged_in() ) {\n\t\t\t\n\t\t\t$count = get_post_meta( $post->ID, $count_meta_key, TRUE );\n\t\t\t\n\t\t\tif( empty($count) ) {\n\t\t\t\t\n\t\t\t\t$count = 1;\n\t\t\t\t\n\t\t\t\t//Ensure old meta value is deleted - just incase\n\t\t\t\t//delete_post_meta( $post->ID, $count_meta_key );\n\t\t\t\t\n\t\t\t\t//Add our new zeroed count\n\t\t\t\tupdate_post_meta( $post->ID, $count_meta_key, $count );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Sanitize count var\n\t\t\t\t$count = (int) $count;\n\t\t\t\t\n\t\t\t\t//Increase by 1\n\t\t\t\t$count++;\n\t\t\t\t\n\t\t\t\t//Update our meta value for the post\n\t\t\t\tupdate_post_meta( $post->ID, $count_meta_key, $count );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function recountContent()\n\t{\n\t\t$this->member_posts = 0;\n foreach ( \\IPS\\Content::routedClasses( $this, TRUE, TRUE, FALSE ) as $class )\n\t\t{\t\t\t\n\t\t\t$this->member_posts += $class::memberPostCount( $this );\n\t\t}\n\t\t\n\t\t$this->save();\n\t}", "function set_count_when_post( $post_id ) {\n\n $count_key = 'social_count';\n $count = get_post_meta($post_id, $count_key, true);\n if ($count =='') {\n delete_post_meta($post_id, $count_key);\n add_post_meta($post_id, $count_key, '0');\n }\n\n $count_key = 'post_views_count';\n $count = get_post_meta($post_id, $count_key, true);\n if ($count =='') {\n delete_post_meta($post_id, $count_key);\n add_post_meta($post_id, $count_key, '0');\n }\n}", "function better_the_post(){\r\n\r\n\t\t// If count customized\r\n\t\tif( better_get_prop( 'posts-count', null ) != null ){\r\n\t\t\tbetter_set_prop( 'posts-counter', absint( better_get_prop( 'posts-counter', 1 ) ) + 1 );\r\n\t\t}\r\n\r\n\t\t// Do default the_post\r\n\t\tbetter_get_query()->the_post();\r\n\r\n\t}", "function quasar_set_post_views(){\n\tglobal $post;\n\tif(!$post) return;\n\t\n\tif(!is_single()) return;\n\t\n\t$count_key = 'post_views_count';\n\t$count = get_post_meta($post->ID, $count_key, true);\n\tif ($count == '') {\n\t\t$count = 0;\n\t\tdelete_post_meta($post->ID, $count_key);\n\t\tadd_post_meta($post->ID, $count_key, '0');\n\t} else {\n\t\t$count++;\n\t\tupdate_post_meta($post->ID, $count_key, $count);\n\t}\n}", "function updateNumbers() {\nglobal $wpdb;\n$querystr = \"SELECT $wpdb->posts.* FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' \";\n$pageposts = $wpdb->get_results($querystr, OBJECT);\n$counts = 0 ;\nif ($pageposts):\nforeach ($pageposts as $post):\nsetup_postdata($post);\n$counts++;\nadd_post_meta($post->ID, 'incr_number', sprintf('%02d' ,$counts), true);\nupdate_post_meta($post->ID, 'incr_number', sprintf('%02d' ,$counts));\nendforeach;\nendif;\n}", "function rebuild_post_counts()\n\t{\n\t\t//-----------------------------------------\n\t\t// Forums not to count?\n\t\t//-----------------------------------------\n\t\t\n\t\t$forums = array();\n\t\t\n\t\tforeach( $this->ipsclass->cache['forum_cache'] as $data )\n\t\t{\n\t\t\tif ( ! $data['inc_postcount'] )\n\t\t\t{\n\t\t\t\t$forums[] = $data['id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\t\t\n\t\t$done = 0;\n\t\t$start = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;\n\t\t$end = intval( $this->ipsclass->input['pergo'] ) ? intval( $this->ipsclass->input['pergo'] ) : 100;\n\t\t$dis = $end + $start;\n\t\t$output = array();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Got any more?\n\t\t//-----------------------------------------\n\t\t\n\t\t$tmp = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'id', 'from' => 'members', 'limit' => array($dis,1) ) );\n\t\t$max = intval( $tmp['id'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Avoid limit...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name', 'from' => 'members', 'order' => 'id ASC', 'limit' => array($start,$end) ) );\n\t\t$outer = $this->ipsclass->DB->simple_exec();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Process...\n\t\t//-----------------------------------------\n\t\t\n\t\twhile( $r = $this->ipsclass->DB->fetch_row( $outer ) )\n\t\t{\n\t\t\tif ( ! count( $forums ) )\n\t\t\t{\n\t\t\t\t$count = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'posts', 'where' => 'queued != 1 AND author_id='.$r['id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->build_query( array( 'select' \t=> 'count(p.pid) as count',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from'\t\t=> array( 'posts' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where'\t=> 'p.queued <> 1 AND p.author_id='.$r['id'].' AND t.forum_id NOT IN ('.implode(\",\",$forums).')',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'add_join'\t=> array( 1 => array( 'type'\t=> 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t 'from'\t=> array( 'topics' => 't' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t 'where'\t=> 't.tid=p.topic_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t)\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\t\t);\n\t\t\t\t$this->ipsclass->DB->exec_query();\n\t\t\t\t\t\t\t\t\n\t\t\t\t$count = $this->ipsclass->DB->fetch_row();\n\t\t\t}\n\t\t\t\n\t\t\t$new_post_count = intval( $count['count'] );\n\t\t\t\n\t\t\t$this->ipsclass->DB->do_update( 'members', array( 'posts' => $new_post_count ), 'id='.$r['id'] );\n\t\t\t\n\t\t\t$done++;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Finish - or more?...\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $done and ! $max )\n\t\t{\n\t\t \t//-----------------------------------------\n\t\t\t// Done..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$text = \"<b>Rebuild completed</b><br />\".implode( \"<br />\", $output );\n\t\t\t$url = \"{$this->ipsclass->form_code}\";\n\t\t\t$time = 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// More..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$text = \"<b>Up to $dis processed so far, continuing...</b><br />\".implode( \"<br />\", $output );\n\t\t\t$url = \"{$this->ipsclass->form_code}&code=\".$this->ipsclass->input['code'].'&pergo='.$this->ipsclass->input['pergo'].'&st='.$dis;\n\t\t\t$time = 0;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Bye....\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->redirect( $url, $text, 0, $time );\n\t}", "public function increasePostCount() {\n\t\t$this->postCount++;\n\t\t$this->increasePostCountSession(1);\n\t}", "function merge_comment_count($count, $post_ID) {\n\n if ( !is_admin() ){\n global $polylang;\n\n $translationIds = PLL()->model->post->get_translations($post_ID);\n\n foreach ( $translationIds as $key=>$translationID ){\n if( $translationID != $post_ID ) {\n $translatedPost = get_post($translationID);\n if ( $translatedPost ) {\n $count = $count + $translatedPost->comment_count;\n }\n }\n }\n }\n return $count;\n}", "public function incrementNumPosts()\n {\n $this->numPosts++;\n }", "public function decrease_post_count()\n\t{\n\t\tif (--$this->post_count === 0)\n\t\t\t$this->tag_status = Model_Tag::DELETED;\n\t}", "function setPostViews($postID) {\n $countKey = 'post_views_count';\n $count = get_post_meta($postID, $countKey, true);\n if($count==''){\n $count = 0;\n delete_post_meta($postID, $countKey);\n add_post_meta($postID, $countKey, '0');\n }else{\n $count++;\n update_post_meta($postID, $countKey, $count);\n }\n}", "function count_cat_post($category) {\nif(is_string($category)) {\n\t$catID = get_cat_ID($category);\n} \nelseif(is_numeric($category)) {\n\t$catID = $category;\n} else {\n\treturn 0;\n}\n$cat = get_category($catID);\nreturn $cat->count;\n}", "public function decreasePostCount() {\n\t\t$this->postCount--;\n\t}", "function spi_build_postcounts()\n{\n\tglobal $wpdb;\n\n\t# Get user list\n\t$users = $wpdb->get_col(\"SELECT ID FROM \".$wpdb->prefix.\"users\");\n\tif($users)\n\t{\n\t\tforeach($users as $user)\n\t\t{\n\t\t\t$postcount = $wpdb->get_var(\"SELECT COUNT(post_id) FROM \".$wpdb->prefix.\"sfposts WHERE user_id=\".$user);\n\t\t\tif(empty($postcount)) $postcount = 0;\n\t\t\tsp_update_member_item($user, 'posts', $postcount);\n\t\t}\n \techo '<p>Members <b>Post Counts</b> Updated</p>';\n\t}\n}", "function theme_c4m_ds_group_posts_count(array $field) {\n if (!isset($field['entity'])) {\n return NULL;\n }\n\n $posts = c4m_og_get_posts_count($field['entity']);\n\n $tag['element'] = array(\n '#tag' => 'span',\n '#value' => format_plural(\n $posts,\n '1 post',\n '@count posts',\n array('@count' => $posts)\n ),\n );\n\n return theme_html_tag($tag);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isMandatory returns true if the given field can not be null and has no default value
public function isMandatory($field) { if($this->isField($field)) { $field_desc = $this->getFieldDesc($field); if($field_desc->isPrimary() && $this->hasAutoIncrement()) return false; return $field_desc->Null == 'NO' && !$this->hasDefaultValue($field); } else throw new Exception($field.' is not a field of the table '.$this->_table); }
[ "public function isMandatory(): bool\n\t{\n\t\treturn ($this->visibility[FieldTable::VISIBILITY_MANDATORY] ?? false);\n\t}", "public function isMandatory()\n\t{\n\t\treturn true;\n\t}", "public function isMandatory()\n {\n return $this->mandatory === true;\n }", "public function isIsMandatory() {\n\t\treturn $this->getIsMandatory();\n\t}", "public function isRequired($field): bool\n {\n return false;\n }", "static private function isMandatory($attribute) {\n if (isset($attribute['mandatory']) and $attribute['mandatory']) {\n return true;\n }\n\n return false;\n }", "public function isRequiredField($field_name, $node_type) {\n $bundle_fields = \\Drupal::getContainer()->get('entity_field.manager')->getFieldDefinitions('node', $node_type);\n $field_definition = $bundle_fields[$field_name];\n $setting = $field_definition->isRequired();\n Assert::assertNotEmpty($setting, 'Field ' . $field_name . ' is not required.');\n }", "public function getIsMandatory()\n {\n if (array_key_exists(\"isMandatory\", $this->_propDict)) {\n return $this->_propDict[\"isMandatory\"];\n } else {\n return null;\n }\n }", "protected function is_required() {\n\n\t\treturn ! empty( $this->field_data['required'] );\n\t}", "public function setMandatory($var)\n {\n GPBUtil::checkBool($var);\n $this->mandatory = $var;\n\n return $this;\n }", "public function hasMandatoryData();", "public function getMandatory()\n {\n $value = $this->get(self::MANDATORY);\n return $value === null ? (boolean)$value : $value;\n }", "public function isEntityFieldOptional() {\n return $this->definition['entity_field_optional'] === TRUE;\n }", "final public function isRequired():bool\n {\n return $this->col()->isRequired();\n }", "public function testIsFieldRequired()\n {\n $aArray = array('test' => 'isset');\n\n $oUBase = $this->getProxyClass('oxUBase');\n $oUBase->setNonPublicVar('_aMustFillFields', $aArray);\n\n $this->assertTrue($oUBase->isFieldRequired('test'));\n $this->assertFalse($oUBase->isFieldRequired('testFalse'));\n $this->assertFalse($oUBase->isFieldRequired(null));\n }", "public function isRequired()\n {\n return (!$this->nullable() && !$this->increments());\n }", "public function getMandatory()\n\t{\n\t\treturn $this->mandatory; \n\n\t}", "public function setMandatory($Mandatory)\r\n {\r\n $this->Mandatory = $Mandatory;\r\n }", "public function isRequiredField($field)\n {\n $field = $this->getField($field);\n if ($field['fieldType'] === 'required' || $field['fieldType'] === 'key') {\n return true;\n } else {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Selects referenced row from $table where = $throughColumn
protected function ref(string $table, ?string $throughColumn = null) : ?\Nette\Database\Table\ActiveRow { return $this->row->ref($table, $throughColumn); }
[ "function getParentReferences(&$table, $childColumn) {\r\n\t\t\t$ownTable = $this->getTable();\r\n\t\t\t$primKey = $ownTable->getPrimaryKey();\r\n\t\t\t$keyValue = $this->getValue($childColumn);\r\n\r\n\t\t\t$filter = new DataFilter();\r\n\t\t\t$filter->addEquals($primKey, $keyValue);\r\n\t\t\t$table->selectRows($filter, new ColumnSorting());\r\n\t\t}", "public function getReferencedTable();", "public function getReferencedColumn();", "public function getReferencingForColumns($table, $column) {\n $result = $this->_referencedColumns[$table][$column]; \n \n if ( ! isset($result)) {\n $sql = \"SELECT TABLE_NAME as tableName, COLUMN_NAME as columnName\"\n . self::FROM_PART_OF_SQL \n . \"AND REFERENCED_TABLE_NAME = :table AND REFERENCED_COLUMN_NAME = :column\";\n $preparedResult = Database::getConnection()->prepare($sql);\n $preparedResult->execute(array(':table' => Database::getConnection()->quote($table), ':column' => Database::getConnection()->quote($column)));\n $result = $preparedResult->fetch(PDO::FETCH_ASSOC);\n $this->_referencedColumns[$table][$column] = $result; \n }\n \n return $result; \n }", "private function _findThroughRelations(array $relation=array()) {\n $results = array();\n $results2 = array();\n $property = $relation[\"property\"];\n $throughModel = $relation[\"throughTable\"];\n $througDstColumn = $relation[\"throughTableDstColumn\"];\n $model = $relation[\"dstTable\"];\n\n $fkey = $relation[\"srcColumn\"];\n $value = $this->$fkey;\n $query = self::$_builder->getSQLForRelation($relation);\n\n\n $queryA = $query[0];\n $queryA = str_replace(\"?\",$value,$queryA);\n $queryB = $query[1];\n $queryB = str_replace(\"?\",$value,$queryB);\n\n $database = FW_Database::getInstance();\n $database->query($queryA);\n\n self::$_database->query($queryB);\n\n while($result=($database->fetchAssoc())) {\n $object = new $throughModel($result,true,$this);\n while($result2=(self::$_database->fetchAssoc())) {\n $object2 = new $model($result2,true,$this);\n if (method_exists($object2,\"afterFind\")) {\n $object2->afterFind();\n }\n $results2 []= $object2;\n }\n $rel2 = new FW_ActiveRecord_Relation();\n $rel2->configure($relation);\n $rel2->setData($results2);\n $rel2->setOldValue($object->$througDstColumn);\n $object->$througDstColumn = $rel2;\n\n $results []= $object;\n }\n $rel = new FW_ActiveRecord_Relation();\n $rel->configure($relation);\n $rel->setData($results);\n $rel->setOldValue($this->$fkey);\n $this->$property = $rel;\n }", "protected function getUserDataRowByJoinTableAndColumn($table, $column)\n {\n return $this->dbClass->where($this->joinColumn, $column)->get($table)->row();\n }", "static public function findWhere($col, $relation, $value);", "function getReferencedTable($name, $table);", "public function getReferencedColumn($name, $table);", "public function has_many_trough($from_table, $to_table, $trough_table) {\r\n $this->change_exception();\r\n $ret = $this->driver->has_many_trough($from_table, $to_table, $trough_table);\r\n return $ret;\r\n // remove columns $trough_table\r\n }", "function get_join() {\n // get the join from this table that links back to the base table.\n // Determine the primary table to seek\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n\n $join = views_get_table_join($this->table, $base_table);\n if ($join) {\n return drupal_clone($join);\n }\n }", "private function get_fk_rows($foreign_table, $value)\r\n\t{\r\n\t\t$foreign_table->reset_filters();\r\n\t\t$foreign_table->add_filter($foreign_table->get_title_column()->get_name(), '=', $value);\r\n\t\treturn $foreign_table->get_rows();\r\n\t}", "function getRelatedTable()\n {\n }", "function get_row_from_table($table,$condition)\n\t{\n\t\t$sql = \"SELECT * FROM $table WHERE $condition\";\n\t\treturn mysql_query($sql);\n\t}", "public function getViaTableCondition();", "abstract protected function getTargetColumn();", "public function findDependentRowset($dependentTable, $ruleKey = null, $order = \"\", $count = 0, $offset = 0, $_where=\"\") {\r\n $db = $this->_getTable ()->getAdapter ();\r\n\r\n if (is_string ( $dependentTable )) {\r\n try {\r\n Zend_Loader::loadClass ( $dependentTable );\r\n } catch ( Zend_Exception $e ) {\r\n require_once 'Zend/Db/Table/Row/Exception.php';\r\n throw new Zend_Db_Table_Row_Exception ( $e->getMessage () );\r\n }\r\n $dependentTable = new $dependentTable ( array ('db' => $db ) );\r\n }\r\n if (! $dependentTable instanceof Zend_Db_Table_Abstract) {\r\n $type = gettype ( $dependentTable );\r\n if ($type == 'object') {\r\n $type = get_class ( $dependentTable );\r\n }\r\n require_once 'Zend/Db/Table/Row/Exception.php';\r\n throw new Zend_Db_Table_Row_Exception ( \"Dependent table must be a Zend_Db_Table_Abstract, but it is $type\" );\r\n }\r\n\r\n $map = $this->_prepareReference ( $dependentTable, $this->_getTable (), $ruleKey );\r\n\r\n $where = array ( );\r\n for($i = 0; $i < count ( $map [Zend_Db_Table_Abstract::COLUMNS] ); ++ $i) {\r\n $parentColumnName = $db->foldCase ( $map [Zend_Db_Table_Abstract::REF_COLUMNS] [$i] );\r\n $value = $this->_data [$parentColumnName];\r\n $dependentColumnName = $db->foldCase ( $map [Zend_Db_Table_Abstract::COLUMNS] [$i] );\r\n $dependentColumn = $db->quoteIdentifier ( $dependentColumnName, true );\r\n $dependentInfo = $dependentTable->info ();\r\n $type = $dependentInfo [Zend_Db_Table_Abstract::METADATA] [$dependentColumnName] ['DATA_TYPE'];\r\n $where [] = $db->quoteInto ( \"$dependentColumn = ?\", $value, $type );\r\n }\r\n if ($map[Zrails_Db_Table::REF_WHERE]) $where[] = $map[Core_Model_Models::REF_WHERE];\r\n if ($_where) $where[] = $_where;\r\n return $dependentTable->fetchAll ( $where, $order, $count, $offset );\r\n }", "public function crossJoin($table);", "abstract protected function getIndirectLinksViaLinkTableByLinkTableName();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the stored routine into the instance of SQLite and returns the metadata of the stored routine.
public function loadStoredRoutine(): array { $this->routineName = pathinfo($this->sourceFilename, PATHINFO_FILENAME); $this->io->text(sprintf('Loading routine <dbo>%s</dbo>', OutputFormatter::escape($this->routineName))); $this->readSourceCode(); $this->createDocBlockReflection(); $this->extractParameters(); $this->extractPlaceholders(); $this->extractDesignationType(); $this->extractReturnType(); $this->validateReturnType(); $this->loadRoutineFile(); $this->updateMetadata(); return $this->phpStratumMetadata; }
[ "public function loadStoredRoutine()\n {\n try\n {\n // We assume that the basename of the routine file and routine name are equal.\n $this->myRoutineName = basename($this->mySourceFilename, $this->mySourceFileExtension);\n\n // Save old metadata.\n $this->myPhpStratumOldMetadata = $this->myPhpStratumMetadata;\n\n // Get modification time of the source file.\n $this->myMTime = filemtime($this->mySourceFilename);\n\n // Load the stored routine into MySQL only if the source has changed or the value of a placeholder.\n $load = $this->getMustReload();\n if ($load)\n {\n // Read the stored routine source code.\n $this->myRoutineSourceCode = file_get_contents($this->mySourceFilename);\n\n // Split the stored routine source code into lines.\n $this->myRoutineSourceCodeLines = explode(\"\\n\", $this->myRoutineSourceCode);\n if ($this->myRoutineSourceCodeLines===false) return false;\n\n // Extract placeholders from the stored routine source code.\n $ok = $this->getPlaceholders();\n if ($ok===false) return false;\n\n // Extract the designation type and key or index columns from the stored routine source code.\n $ok = $this->getDesignationType();\n if ($ok===false) return false;\n\n // Extract the stored routine type (procedure or function) and stored routine name from the source code.\n $ok = $this->getName();\n if ($ok===false) return false;\n\n // Load the stored routine into MySQL.\n $this->loadRoutineFile();\n\n // If the stored routine is a bulk insert stored procedure, enhance metadata with table columns information.\n if ($this->myDesignationType=='bulk_insert')\n {\n $this->getBulkInsertTableColumnsInfo();\n }\n\n // Get info about parameters with specific layout like cvs string etc. form the stored routine.\n $this->getExtendedParametersInfo();\n\n // Get the parameters types of the stored routine from metadata of MySQL.\n $this->getRoutineParametersInfo();\n\n // Compose the DocBlock parts to be used by the wrapper generator.\n $this->getDocBlockPartsWrapper();\n\n // Validate the parameters found the DocBlock in the source of the stored routine against the parameters from\n // the metadata of MySQL.\n $this->validateParameterLists();\n\n // Update Metadata of the stored routine.\n $this->updateMetadata();\n }\n\n return $this->myPhpStratumMetadata;\n }\n catch (\\Exception $e)\n {\n echo $e->getMessage(), \"\\n\";\n\n return false;\n }\n }", "private function _loadUDF()\n\t{\n\t\t/* encryptions */\n\t\t// md5\n\t\tsqlite_create_function($this->_resource, 'md5', 'md5', 1);\n\t\t// sha1\n\t\tsqlite_create_function($this->_resource, 'sha1', 'sha1', 1);\n\t\t\n\t\t/* string functions */\n\t\t// CONCAT\n\t\tsqlite_create_function($this->_resource, 'CONCAT', 'sqlite__CONCAT');\n\t\t// SUBSTRING_INDEX\n\t\tsqlite_create_function($this->_resource, 'SUBSTRING_INDEX', 'sqlite__SUBSTRING_INDEX', 3);\n\t\t\n\t\t/* conditional statements */\n\t\t// IF\n\t\tsqlite_create_function($this->_resource, 'IF', 'sqlite__IF', 3);\n\t\t// IFNULL\n\t\tsqlite_create_function($this->_resource, 'IFNULL', 'sqlite__IFNULL');\n\t\t\n\t\t/* dates */\n\t\t// DATEDIFF\n\t\tsqlite_create_function($this->_resource, 'DATEDIFF', 'sqlite__DATEDIFF', 2);\n\t\t// YEAR\n\t\tsqlite_create_function($this->_resource, 'YEAR', 'sqlite__YEAR', 1);\n\t\t// MONTH\n\t\tsqlite_create_function($this->_resource, 'MONTH', 'sqlite__MONTH', 1);\n\t\t// DAY\n\t\tsqlite_create_function($this->_resource, 'DAY', 'sqlite__DAY', 1);\n\t\t// NOW\n\t\tsqlite_create_function($this->_resource, 'NOW', 'sqlite__NOW');\n\t\t// DATE_FORMAT\n\t\tsqlite_create_function($this->_resource, 'DATE_FORMAT', 'sqlite__DATE_FORMAT', 2);\n\t\t// LAST_DAY\n\t\tsqlite_create_function($this->_resource, 'LAST_DAY', 'sqlite__LAST_DAY', 1);\n\t}", "abstract public function loadFromDb();", "private function loadStoredRoutines()\n {\n // Sort the sources by routine name.\n usort($this->mySources, function ($a, $b)\n {\n return strcmp($a['routine_name'], $b['routine_name']);\n });\n\n // Process all sources.\n foreach ($this->mySources as $filename)\n {\n $routine_name = $filename['routine_name'];\n\n $helper = new RoutineLoaderHelper($filename['path_name'],\n $this->mySourceFileExtension,\n isset($this->myPhpStratumMetadata[$routine_name]) ? $this->myPhpStratumMetadata[$routine_name] : null,\n $this->myReplacePairs,\n isset($this->myRdbmsOldMetadata[$routine_name]) ? $this->myRdbmsOldMetadata[$routine_name] : null,\n $this->mySqlMode,\n $this->myCharacterSet,\n $this->myCollate);\n\n $meta_data = $helper->loadStoredRoutine();\n if ($meta_data===false)\n {\n # An error occurred during the loading og the stored routine.\n $this->myErrorFileNames[] = $filename['path_name'];\n unset($this->myPhpStratumMetadata[$routine_name]);\n }\n else\n {\n # Stored routine is successfully loaded.\n $this->myPhpStratumMetadata[$routine_name] = $meta_data;\n }\n }\n }", "function loadFromDB() {\n\n\t}", "private function create_load()\n\t{\n\t\tself::$class[] = '\tpublic function Load($'.self::$table.'_id = null)';\n\t\tself::new_line();\n\t\tself::$class[] = '\t{';\n\t\tself::new_line();\n\t\tself::$class[] = '\t\tif($'.self::$table.'_id !== null)';\n\t\tself::new_line();\n\t\tself::$class[] = '\t\t{';\n\t\tself::new_line();\n\t\tself::$class[] = '\t\t\tself::Init($'.self::$table.'_id);';\n\t\tself::new_line();\n\t\tself::$class[] = '\t\t}';\n\t\tself::new_line();\n\t\tself::$class[] = '\t\treturn self::$data;';\n\t\tself::new_line();\n\t\tself::$class[] = '\t}';\n\t}", "public function loadFromDB()\n {\n }", "public function load_meta()\n\t{\n\t\tif ( !is_empty($this->_table_name) ) {\n\t\t\tif ( !$this->has_meta() ) {\n\t\t\t\t$this->_meta = $this->db->field_data($this->_table_name);\n\t\t\t}\n\t\t} else {\n\t\t\tlog_message('error', 'Function EB_Model::load called without specifying the table\\'s name. Model name: ' . get_class($this));\n\t\t\tshow_error(lang('_error_db_table_name_not_specified'));\n\t\t}\n\t}", "protected function loadMetaData()\r\n\t{\r\n\t\t$rows = (new Query)\r\n\t\t ->select('*')\r\n\t\t ->from($this->metaTableName())\r\n\t\t ->where([\r\n\t\t \t'record_id'\t=> $this->{$this->getPkName()}\r\n\t\t ])\r\n\t\t ->all();\r\n\r\n\t\t$this->metaData = $rows;\r\n\t}", "protected function loadTableColumnData()\n {\n $sql = 'SELECT \"name\" FROM \"sqlite_master\" WHERE \"type\" = \\'table\\'';\n $tables = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n $tables = $tables->toArray();\n\n foreach ($tables as $table) {\n $sql = 'PRAGMA table_info(\"' . $table['name'] . '\")';\n $columns = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n $this->tableData[$table['name']] = $columns->toArray();\n }\n }", "public function getProcedureLoader();", "function load(){\r\n\t\t$db=Factory::getDB();\r\n\t\tFactory::debug(\"loading object\");\r\n\t\t$db->loadObject($this);\r\n\t\tFactory::debug_r($this);\r\n\t}", "public function load() : Persistable;", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "private function loadTableInfo()\n {\n self::$tableMeta = $this->context->getCache()->getValue(\"db_meta\", \"table_field_meta\");\n if (!isset(self::$tableMeta[$this->getEntityName()])) {\n\n $s = R::getAll(\"SELECT COLUMN_NAME,DATA_TYPE\n FROM INFORMATION_SCHEMA.COLUMNS\n WHERE TABLE_NAME = ?\", [$this->getEntityName()]);\n $newArr = array();\n foreach ($s as $value) {\n $newArr[$value['COLUMN_NAME']] = $value['DATA_TYPE'];\n }\n self::$tableMeta[$this->getEntityName()] = $newArr;\n $this->context->getCache()->storeValue(\"db_meta\", \"table_field_meta\", self::$tableMeta, 60 * 60 * 24);\n }\n }", "public function meta() {\n $table = $this->table;\n\n if( !array_key_exists($table, $this->meta_data) ) {\n $path = $this->dir . $table . '/meta.php';\n if( !file_exists($path) )\n return NULL;\n\n $this->meta_data[$table] = $this->read($path, false);\n }\n\n return $this->meta_data[$table];\n }", "function load() {\n\t\t# Global Variables\n\t\tglobal $_db;\n\t\t\n\t\t# Load Attributes\n\t\t$this->get_attributes();\n\t\t\n\t\t# Check if Object exists in Database\n\t\tif ($this->exists()) {\n\t\t\t# Get Data\n\t\t\t$query\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"\tSELECT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`{$this->table}`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`{$this->uid_field}` = '{$this->uid}'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\t\t\t$data\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $_db->fetch_one($query);\n\t\t\t\n\t\t\t# Load Data\n\t\t\t$data_bits\t\t\t\t\t\t\t\t\t\t\t\t\t= get_object_vars($data);\n\t\t\tforeach ($data_bits as $key => $value) {\n\t\t\t\t$this->$key\t\t\t\t\t\t\t\t\t\t\t\t= $value;\n\t\t\t}\n\t\t}\n\t}", "public function loadColumnMetadata() {\n\t\t//\tgetCleanData() will use this to prepare data for SQL query.\n\t\t$result = $this->dbconn->query(\"DESC {$this->table}\");\n\t\twhile ($row = $result->fetch_assoc()) $this->columnType[$row['Field']] = $row['Type'];\n\t}", "private function Load()\n\t{\n\t\t$sql = \"show tables\";\n\t\t$rs = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// first pass load all the tables. this will initialize each object. we have to\n\t\t// do this first so that we can correctly determine and store \"Set\" information\n\t\twhile ($row = $this->Server->Connection->Next($rs))\n\t\t{\n\t\t\t$this->Tables[$row[\"Tables_in_\" . $this->Name]] = new DBTable($this,$row);\n\t\t}\n\t\t\n\t\t// now load all the keys and constraints for each table\n\t\tforeach ($this->Tables as $table)\n\t\t{\n\t\t\t$table->LoadKeys();\n\t\t}\n\n\t\t$this->Server->Connection->Release($rs);\n\t\t\n\t\t$sql = \"show table status from `\" . $this->Name . \"`\";\n\t\t$rs2 = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// load the extra data\n\t\twhile ($row = $this->Server->Connection->Next($rs2))\n\t\t{\n\t\t\t$this->Tables[$row[\"Name\"]]->Engine = $row[\"Engine\"]; \n\t\t\t$this->Tables[$row[\"Name\"]]->Comment = $row[\"Comment\"];\n\t\t}\n\t\t$this->Server->Connection->Release($rs2);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a basic CoAP DELETE request with optional given URI path
public function create_basic_delete_request($uri_path){ $coap_message = $this->create_message_with_header_and_token("CON", "DELETE", 0); if(isset($uri_path) && $uri_path != ''){ $uri_path = str_replace('/', '//', $uri_path); $coap_message->add_uri_path($uri_path); } return $coap_message; }
[ "function delete($uri, array $headers = array(), $content = \"\");", "public function delete($uri, $params = null);", "function sendDELETE(){\n //builds the string with the parameters to send\n $content = '';\n foreach($this->params as $k=>$val)\n $content .= '&'.$k.'='.rawurlencode($val);\n $content .= '&src=sdk-php-1.0';\n $content = substr($content, 1, strlen($content));//removes the first &\n $context = stream_context_create(array('http'=>array('method' =>'DELETE', 'ignore_errors' => 1)));\n $r = @file_get_contents($this->url.'?'.$content, false, $context);\n if($r !== false)\n $response = array('http-response' => $http_response_header, 'api-response' => $r);\n else $response = array('http-response' => $http_response_header);\n return $response;\n }", "public function httpDelete($request)\n\t\t{\t\n\t\t\t$deleteRequest = $this->httpRequest('receive', 'DELETE', $request, '');\n\t\t\treturn $deleteRequest;\n\t\t}", "public function asDeleteRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('DELETE', $url, [], $this->fqb_access_token, $this->fqb_etag);\n }", "function call_rest_delete($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_delete($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}", "public function delete()\n {\n return $this->make_http_request('DELETE');\n }", "public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }", "protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function testDelete()\n {\n $env = \\Slim\\Environment::mock(array(\n 'REQUEST_METHOD' => 'DELETE',\n 'slim.input' => 'foo=bar&abc=123',\n 'CONTENT_TYPE' => 'application/x-www-form-urlencoded',\n 'CONTENT_LENGTH' => 15\n ));\n $req = new \\Slim\\Http\\Request($env);\n $this->assertEquals(2, count($req->delete()));\n $this->assertEquals('bar', $req->delete('foo'));\n $this->assertEquals('bar', $req->params('foo'));\n $this->assertNull($req->delete('xyz'));\n }", "public static function delete($encode = true) {\n return self::_curl('delete', $encode); \n }", "public function delete($path, $action) {\n\t\t\treturn $this->route('DELETE', $path, $action);\n\t\t}", "private function deleteRequest($uri,$params = \"\")\t{\n\t\t$url = API_PATH . $uri;\n\t\t\n\t\tif (is_array($params)) $params = http_build_query($params);\n\t\t\n\t\t$this->auth(\"DELETE\", $uri, $params);\n\t\t\n\t\tcurl_setopt($this->handle, CURLOPT_URL, $url . \"?\" . $params);\n\t\tcurl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\t$out = curl_exec($this->handle);\n\t\t\n\t\tif ($out === false)\t{\n\t\t\t$this->errorCode = curl_errno($this->handle);\n\t\t\t$this->errorMessage = curl_error($this->handle);\n\t\t\treturn false;\n\t\t}\n\t\treturn $out;\n\t}", "public function testDELETECustomRouteOneParamRequest()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/post/testing/1',\n\t\t\t'type'\t\t=> 'DELETE',\n\t\t\t'data'\t\t=> '{\"test\":\"data\"}',\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\t\t\n\t\t$request->addEvent('req.delete.testing.render', function($param1) {\n\t\t\techo '{\"test\":\"' . $param1 . '\"}';\n\t\t});\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"test\":\"1\"}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function testDeleteRoute()\n {\n print \"\\nTesting delete route.\\n\";\n\n $passingWrongParameters = $this\n ->withHeaders(['Accept' => 'application/json'])\n ->json(\"delete\", route('api.v1.products.index').\"/28?api_token=kxBDR7b01xC4VNg2o97F5SSs4XCcJyn9y6dxkaYkwF5odjeL9OpQDAMjW7cS\");\n\n $passingWrongParameters\n ->assertStatus(204);\n }", "function testRunMethodWithParamsDelete() {\n\t\t$_SERVER['REQUEST_METHOD'] = 'DELETE';\n\t\t$_SERVER['REQUEST_URI'] = '/exposeFunc2/123456del';\n\n\t\t$r = new \\KungFoo\\Routing\\Router();\n\t\t$result = $r->addFromController(ControllerWithAnnotationsDispatch::class);\n\t\t$this->assertTrue($result);\n\n\t\t$r->run();\n\t}", "public function deleteWithBody()\n {\n $adapter = new FakeAdapter(\n function (RequestInterface $request) {\n if (substr($request->getUri(), -5) === 'token') {\n return new Psr7Response(\n 200,\n ['Content-Type' => ['application/json']],\n json_encode(['access_token' => 'a token', 'expires_in' => 1])\n );\n }\n\n if ($request->getMethod() === 'DELETE'\n && (string)$request->getUri() === 'baseUrl/v1/resource+name/the+id'\n && $request->getHeaders() === [\n 'Content-Type' => ['application/json'],\n 'Accept-Encoding' => ['gzip'],\n 'Authorization' => ['Bearer a token'],\n ]\n ) {\n $body = (string)$request->getBody();\n\n if ($body === '' || $body === '{\"the key\":\"the value\"}') {\n return new Psr7Response(204, ['Content-Type' => ['application/json']], json_encode([]));\n }\n }\n }\n );\n $client = new Client($adapter, $this->getAuthentication(), 'baseUrl/v1');\n\n $response = $client->delete('resource name', 'the id', ['the key' => 'the value']);\n\n $this->assertSame(204, $response->getHttpCode());\n $this->assertSame([], $response->getResponse());\n $this->assertSame(['Content-Type' => ['application/json']], $response->getResponseHeaders());\n }", "public function doDelete(En_HttpRequest $request, En_HttpResponse $response){}", "function delete($url, $vars = array()) {\n\t\treturn $this->request('DELETE', $url, $vars);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the tournaments played by a specific player.
public function getTournamentsByPlayerID($playerID) { return $this->model->join('matches', 'tournaments.id', '=', 'matches.tournament_id') ->join('teams', function ($join) { $join->on('matches.first_team_id', '=', 'teams.id') ->orOn('matches.second_team_id', '=', 'teams.id'); }) ->join('player_team', 'teams.id', '=', 'player_team.team_id') ->where('player_team.player_id', $playerID) ->get(['tournaments.*']); }
[ "public function getTournaments() {\n $response = Guzzle::get('tournaments');\n\n $tournaments = [];\n foreach ($response as $tourney) {\n $tournaments[] = new Tournament($tourney->tournament);\n }\n\n return $tournaments;\n }", "public function getTeamTournaments()\n {\n return $this->teamTournaments;\n }", "public function getTournaments() {\n\t\treturn $this->library['tournaments'];\n\t}", "public function getTournaments() {\n $wrapper = entity_metadata_wrapper('tourney_series', $this);\n return $wrapper->tournaments->value();\n }", "public function getPlayers();", "public function getPlayers()\n {\n return $this->players;\n }", "public function getPlayers ()\r\n {\r\n return $this->players;\r\n }", "public function getPlayers()\n {\n return $this->_players;\n }", "public function getTournamentPlayerStats() {\n\t\treturn new TournamentPlayerStats($this->getMediator(), 'GetTournamentPlayerStats', 'V001');\n\t}", "public function getPlayers()\n {\n return $this->getProperty('players');\n }", "private function get_players()\n\t{\n\n\t\treturn $this->players;\n\t}", "public function getPlayers()\n {\n return Wrapper\\National::players($this->getId());\n }", "public function listQuests($playerId, $optParams = array())\n {\n $params = array('playerId' => $playerId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Games_QuestListResponse\");\n }", "private function getTeamsForPlayer(int $playerUid) {\n return $this->entityTypeManager->getStorage('node')->getQuery()\n ->condition('type', 'team')\n ->condition('status', 1)\n ->condition('field_players.target_id', $playerUid)\n ->addMetaData('uid', 1)\n ->execute();\n }", "public function tournaments()\n {\n return $this->hasMany('App\\Models\\Tournament');\n }", "public function players()\n {\n return $this->hasMany(Player::class);\n }", "public function findAllByPlayer(User $player) {\n $player_id = $player->getId();\n return $this->getEntityManager()\n ->createQueryBuilder('d')\n ->select('d')\n ->from('AppBundle:DowntimePeriod','d')\n ->innerJoin('d.game', 'g')\n ->innerJoin('g.characters', 'c')\n ->where('c.player = :player')\n ->setParameter('player', $player)\n ->orderBy('d.close', 'DESC')\n ->getQuery()\n ->getResult();\n }", "public function getParticipants($tournament)\n {\n return $this->get(\"tournaments/{$tournament}/participants\");\n }", "function list_teams_captof($player) {\n\tglobal $Connection;\n\t$result = array();\n\t$ret = $Connection->query(\"SELECT name FROM team WHERE {$player->queryof('capt')} ORDER BY name\");\n\tif ($ret and $ret->num_rows > 0) {\n\t\twhile ($row = $ret->fetch_array()) {\n\t\t\t$team = new Team($row[0]);\n\t\t\t$team->fetchdets();\n\t\t\tarray_push($result, $team);\n\t\t}\n\t}\n\treturn $result;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroy the instance of Storage
public function destroy() { if ($this->instance instanceof Storage) { $this->instance->destroy(); } $this->instance = null; }
[ "public function destroy_storage();", "public static function DeleteStorage(): void\n {\n session_unset();\n }", "public static function _unsetStorage()\n {\n self::$storage = null;\n }", "public static function remove()\n {\n self::$storage = null;\n }", "function destroyDataStorage(){ }", "public function clear()\n {\n \tunlink($this->_storage);\n }", "public function delete()\n {\n parent::delete();\n Storage::delete($this->filepath);\n }", "public static function destroy()\r\n {\r\n self::$instance = null;\r\n }", "public function unsetStorageId();", "public function unsetStorageId()\r\n\t{\r\n\t\tunset($this->_storage_id);\r\n\t}", "public function delete()\r\n {\r\n shmop_delete($this->shmId);\r\n }", "private function resetStorage()\n {\n exec('rm -rf public/storage');\n Storage::disk('public')->deleteDirectory('icons');\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function __destruct()\n {\n @unlink($this->path);\n }", "public function clear()\n {\n $this->getStorage()->clear();\n }", "public function destroy()\n {\n $this->container = null;\n\n App::clearResolvedInstances();\n App::setFacadeApplication(null);\n\n self::$instance = null;\n }", "protected function deleteTempStorage()\r\n {\r\n $directory = $this->getTempStoragePath() . $this->getUserDirectoryName();\r\n\r\n if (Storage::exists($directory)) {\r\n Storage::deleteDirectory($directory);\r\n }\r\n }", "private function destroy(): void\n {\n $this->skill->delete();\n }", "public function removeStorage()\n\t{\n\t\t$this->taskExec('docker rm chrome-print-storage')->run();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compile the query to determine the list of columns.
public function compileColumnListing() { return 'select column_name as "column_name", data_type as "column_type", lower(is_nullable) as "is_nullable" from information_schema.columns where table_catalog = ? and table_name = ?'; }
[ "public function compileColumnListing()\n {\n return \"SELECT \\\"column_name\\\" \"\n .\"FROM \\\"system_schema\\\".\\\"columns\\\" \"\n .\"WHERE table_name = :\\\"table_name\\\" \"\n .\"AND keyspace_name = :\\\"keyspace_name\\\"\";\n }", "public function compileColumnListing(): string\n {\n return 'select column_name as `column_name` from information_schema.columns where table_schema = ? and table_name = ?';\n }", "protected function _compile_columns()\r\n\t{\r\n\t\t// Get a list of columns\r\n\t\t$columns = $this->columns();\r\n\t\t\r\n\t\t// Loop through every column and change the object to an array\r\n\t\tforeach($columns as $name => & $column)\r\n\t\t{\r\n\t\t\t// Compile the column and set it\r\n\t\t\t$column = $column->compile();\r\n\t\t}\r\n\t\t\r\n\t\t// Return the column array\r\n\t\treturn $columns;\r\n\t}", "protected function compileSelect()\n\t{\n\t\t$params = [];\n\n\t\t// select\n\t\t$query = 'SELECT ';\n\n\t\t// values\n\t\tif (count($this->select) === 0) {\n\t\t\t$query .= '* ';\n\t\t} else {\n\t\t\t$separator = '';\n\t\t\tforeach ($this->select as $identifier) {\n\t\t\t\tif (is_array($identifier)) {\n\t\t\t\t\tlist($identifier, $alias) = $identifier;\n\t\t\t\t} else {\n\t\t\t\t\t$alias = false;\n\t\t\t\t}\n\t\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t\t} else {\n\t\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t}\n\t\t\t\tif ($alias) {\n\t\t\t\t\t$query.= ' AS ' . $this->quoteIdentifier($alias);\n\t\t\t\t}\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t}\n\n\t\t//distinct\n\t\tif (count($this->distinct) > 0) {\n\t\t\t$query.= ' DISTINCT ';\n\t\t\t$separator = '';\n\t\t\tforeach ($this->distinct as $identifier) {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// from\n\t\tif (is_array($this->table)) {\n\t\t\tlist($table, $alias) = $this->table;\n\t\t} else {\n\t\t\t$table = $this->table;\n\t\t\t$alias = false;\n\t\t}\n\n\t\tif ($table instanceof \\Base\\Database\\Query) {\n\t\t\tlist($subQuery, $subParams) = $table->compile();\n\t\t\t$params = array_merge($params, $subParams);\n\t\t\t$query.= ' FROM (' . $subQuery . ')';\n\t\t} else {\n\t\t\t$query.= ' FROM ' . $this->quoteTable($table);\n\t\t}\n\t\tif ($alias) {\n\t\t\t$query.= ' AS ' . $this->quoteTable($alias);\n\t\t}\n\n\n\t\t// join\n\t\tif (count($this->joins) > 0) {\n\t\t\tforeach ($this->joins as $join) {\n\t\t\t\tif (in_array(strtoupper($join['type']), ['INNER', 'OUTER', 'LEFT', 'RIGHT', 'FULL'])) {\n\t\t\t\t\t$query .= ' ' . strtoupper($join['type']) . ' JOIN ';\n\n\t\t\t\t\tif (is_array($join['table'])) {\n\t\t\t\t\t\tlist($table, $alias) = $join['table'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$table = $join['table'];\n\t\t\t\t\t\t$alias = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$query.= $this->quoteTable($table) . ' ';\n\t\t\t\t\tif ($alias) {\n\t\t\t\t\t\t$query.= 'AS ' . $this->quoteTable($alias);\n\t\t\t\t\t}\n\n\t\t\t\t\t$on = false;\n\t\t\t\t\tif (count($join['on']) > 0) {\n\t\t\t\t\t\t$on = true;\n\t\t\t\t\t\tlist($onQuery, $onParams) = $this->compileConditions($join['on'], true);\n\t\t\t\t\t\t$query .= 'ON ' . $onQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onParams);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (count($join['where']) > 0) {\n\t\t\t\t\t\tlist($onWhereQuery, $onWhereParams) = $this->compileConditions($join['where']);\n\t\t\t\t\t\tif ($on === true) {\n\t\t\t\t\t\t\t$query .= ' ' . $join['where'][0]['logic'] . ' ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$query.= $onWhereQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onWhereParams);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// where\n\t\tif (count($this->where) > 0) {\n\t\t\tlist($whereQuery, $whereParams) = $this->compileConditions($this->where);\n\t\t\t$query.= ' WHERE ' . $whereQuery;\n\t\t\t$params = array_merge($params, $whereParams);\n\t\t}\n\n\t\t// group by\n\t\t$separator = ' GROUP BY ';\n\t\tforeach ($this->group as $identifier) {\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// having\n\t\tif (count($this->having) > 0) {\n\t\t\tlist($havingQuery, $havingParams) = $this->compileConditions($this->having);\n\t\t\t$query.= ' HAVING ' . $havingQuery;\n\t\t\t$params = array_merge($params, $havingParams);\n\t\t}\n\n\t\t// order\n\t\t$separator = ' ORDER BY ';\n\t\tforeach ($this->order as $identifier => $direction) {\n\t\t\t$direction = strtoupper($direction) === 'DESC' ? 'DESC' : 'ASC';\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression() . ' ' . $direction;\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier) . ' ' . $direction;\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// limit\n\t\tif ($this->limit !== false) {\n\t\t\t$query .= ' LIMIT ' . (int) $this->limit;\n\t\t}\n\n\t\t// offset\n\t\tif ($this->offset !== false) {\n\t\t\t$query .= ' OFFSET ' . (int) $this->offset;\n\t\t}\n\n\t\t// union / union_all\n\t\t$unioned = false;\n\t\tforeach ($this->union as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ')';\n\t\t\t}\n\t\t\t$query.= ' UNION (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\t\tforeach ($this->unionAll as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ') ';\n\t\t\t}\n\t\t\t$query.= ' UNION ALL (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\n\t\treturn [$query, $params];\n\t}", "private function compile_select()\n\t{\n\t\t$sql = $this->select.' '.$this->from.' '.$this->where;\n\n\t\tif (count($this->orderings) > 0)\n\t\t{\n\t\t\t$sql .= ' ORDER BY '.implode(', ', $this->orderings);\n\t\t}\n\n\t\tif ( ! is_null($this->limit))\n\t\t{\n\t\t\t$sql .= ' LIMIT '.$this->limit;\n\t\t}\n\n\t\tif ( ! is_null($this->offset))\n\t\t{\n\t\t\t$sql .= ' OFFSET '.$this->offset;\n\t\t}\n\n\t\treturn $sql;\n\t}", "protected function compileSQL() { }", "protected function compileSelect() {\n\t\t\n\t\t$pivots = $this->query->getPivots();\n\t\t\n\t\t// add in what we want to select\n\t\t$sql = 'SELECT '. $this->compileFields();\n\n\t\t$aliases = &$this->query->getAliases();\n\t\t$relations = &$this->query->getRelations();\n\t\t\n\t\t// create a graph of the\n\t\t$graph = $this->relations->getRelationDependencies(\n\t\t\t$aliases,\n\t\t\t$relations,\n\t\t\t$this->models\n\t\t);\n\t\t\n\t\tif(!empty($graph)) {\n\t\t\t\n\t\t\t// pivots are being used, flatten the graph and translate the\n\t\t\t// nested joins into a flat set of inner joins with the conditions\n\t\t\t// in the WHERE clause\n\t\t\tif(!empty($pivots) && !empty($relations)) {\n\t\t\t\t$graph = $this->flattenRelationsGraph($graph);\n\t\t\t\t$this->compileRelationsAsPredicates();\n\t\t\t}\n\t\t\t\n\t\t\t$joins = trim($this->recursiveJoin(NULL, $graph, ''));\n\t\t\tif($joins[0] == '(') {\n\t\t\t\t$joins = substr($joins, 1, -1);\n\t\t\t}\n\t\t\t$sql .= ' FROM '. $joins;\n\t\t}\n\t\t\n\t\t\n\t\t// get parts of the query\n\t\t$this->compilePivots();\n\t\t\t\t\n\t\t$where = $this->compilePredicates('where');\n\t\t$order = $this->compilePredicates('order');\n\t\t$limit = $this->compilePredicates('limit');\n\t\t$group = $this->compilePredicates('group');\n\t\t\n\t\tif(!empty($where)) $sql .= \" WHERE \". implode(' ', $where);\n\t\tif(!empty($group)) $sql .= \" GROUP BY \". implode(' ', $group);\n\t\tif(!empty($order)) $sql .= \" ORDER BY \". implode(' ', $order);\n\t\tif(!empty($limit)) $sql .= \" LIMIT \". implode(' ', $limit);\n\t\t\n\t\t// add in the predicates and return\n\t\treturn $sql;\n\t}", "public function compileSelect()\n {\n if (is_null($this->columns)) {\n $this->columns = array('*');\n }\n\n $select = $this->distinct ? 'SELECT DISTINCT' : 'SELECT';\n\n return $select .' ' .$this->columnize($this->columns) .' FROM {' .$this->table .'}' .$this->constraints();\n }", "public function compile()\n {\n // Start a selection query\n $query = array();\n\n $query['Context'] = $this->_from;\n\n $query['Select'] = $this->_compile_select($this->_select);\n\n $query['Where'] = $this->_compile_where($this->_where);\n\n if (!empty($this->_group_by)) {\n // Add grouping\n $query['GroupBy'] = $this->_group_by;\n }\n\n if (!empty($this->_order_by)) {\n // Add sorting\n $query['SortBy'] = $this->_order_by;\n\n $query['SortDir'] = $this->_order_dir ? strtoupper($this->_order_dir) : 'ASC';\n }\n\n if ($this->_limit !== NULL) {\n // Add limiting\n $query['Limit'] = $this->_limit;\n }\n\n if ($this->_offset !== NULL) {\n // Add offsets\n $query['Offset'] = $this->_offset;\n }\n\n\n if ($this->_float_mode === true)\n {\n $query['FloatMode'] = true;\n }\n\n $this->_query = $query;\n\n return $this;\n }", "protected function _build_select() {\n\t\t$columns = array();\n\n\t\tif (isset($this->_table_columns['password_confirm'])) {\n\t\t\t$password_confirm_column = $this->_table_columns['password_confirm'];\n\t\t\tunset($this->_table_columns['password_confirm']);\n\t\t}\n\n\t\tforeach ($this->_table_columns as $column => $_) {\n\t\t\t$columns[] = array($this->_object_name . '.' . $column, $column);\n\t\t}\n\n\t\tif (isset($password_confirm_column)) {\n\t\t\t$this->_table_columns['password_confirm'] = $password_confirm_column;\n\t\t}\n\n\t\treturn $columns;\n\t}", "private static function get_columns_sql()\n {\n $columns = '';\n\n foreach (self::get_columns() as $name => $type) :\n $columns .= $name . ' ' . $type . ', ';\n endforeach;\n\n // Append created_at column.\n $columns .= 'created_at DATETIME DEFAULT CURRENT_TIMESTAMP, ';\n $columns .= 'updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP, ';\n\n // Append primary key definition.\n $columns .= 'PRIMARY KEY (' . self::get_primary_key() . ')';\n\n return $columns;\n }", "protected function generateSqlColumnStringForQuery()\n {\n $sqlColumns = \"\";\n if (count($this->sqlSelectColumn) <= 0) {\n $sqlColumnsArray = array();\n foreach ($this->getFieldNames() as $fieldName) {\n $sqlColumnsArray[] = \" \" . $fieldName . \" AS '\" . $fieldName . \"' \";\n }\n $sqlColumns .= (count($sqlColumnsArray)) ? implode(\",\", $sqlColumnsArray) : \"\";\n\n foreach ($this->sqlJoin as $tableJoin => $joinCondition) {\n $phpJointTableName = $this->getPhpName($tableJoin).\"Query\";\n $this->joinTable[$tableJoin] = new $phpJointTableName();\n $joinTableColumnArray = array();\n foreach ($this->joinTable[$tableJoin]->getFieldNames() as $fieldName) {\n $joinTableColumnArray[] = \" \" . $fieldName . \" AS '\" . $fieldName . \"' \";\n }\n $sqlColumns .= (count($joinTableColumnArray)) ? \",\" . implode(\",\", $joinTableColumnArray) : \"\";\n }\n } else {\n $sqlColumnsArray = array();\n foreach ($this->sqlSelectColumn as $fieldName) {\n $sqlColumnsArray[] = \" \" . $fieldName . \" AS '\" . $fieldName . \"' \";\n }\n $sqlColumns .= (count($sqlColumnsArray)) ? implode(\",\", $sqlColumnsArray) : \"\";\n }\n return $sqlColumns;\n }", "private function columnList()\n\t{\n\t\t$table = $this->query->table();\n\t\t$joins = $this->query->joins();\n\t\t$fields = [];\n\t\t\n\t\tforeach ($this->query->columns() as $name => $alias) {\n\t\t\t$fields[] = $this->_columnName($table, $name, $alias);\n\t\t}\n\t\tforeach ($joins as $join) {\n\t\t\t$foreignTable = $join->foreignTable();\n\t\t\tforeach ($join->columns() as $name => $alias) {\n\t\t\t\t$fields[] = $this->_columnName($foreignTable, $name, $alias);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn count($fields) ? implode(\", \", $fields) : \"*\";\n\t}", "protected function buildQuery()\n {\n $sql = '';\n $sql = 'SELECT';\n if (count($this->getSelectColumns()) > 0) {\n $sql .= $this->proccessParts($this->getSelectColumns());\n } else {\n $sql .= ' * ';\n }\n $sql .= 'FROM `' . $this->table->getName() . '`';\n if (count($this->getWhere()) > 0) {\n $sql .= ' WHERE ' . $this->proccessParts($this->getWhere());\n }\n if (count($this->getGroupBy()) > 0) {\n $sql .= ' GROUP BY ' . $this->proccessParts($this->getGroupBy());\n }\n if (!empty($this->having)) {\n $sql .= ' HAVING ' . $this->getHaving() . ' ';\n }\n if (!empty($this->orderBy)) {\n $sql .= ' GROUP BY ' . $this->proccessParts($this->getOrderBy());\n }\n if (!empty($this->limit)) {\n $sql .= ' LIMIT ' . $this->getLimit();\n }\n $this->sql = trim($sql);\n }", "private function prepareSelect()\n {\n $sql = 'SELECT ' . $this->select;\n $sql .= $this->from != '' ? ' FROM ' . $this->from : '';\n $sql .= $this->where != '' ? ' WHERE ' . $this->where : '';\n\n $sql .= $this->prepareIn();\n\n //GROUP BY clause\n $groupBy = '';\n foreach($this->groupby as $col) {\n $groupBy .= \"`{$col}`,\";\n }\n $groupBy = substr($groupBy, 0, -1);\n \n $sql .= $groupBy != '' ? ' GROUP BY ' . $groupBy : '';\n \n //ORDER BY clause\n $order = '';\n foreach($this->order as $o) {\n $order .= \"{$o['column']} {$o['direction']},\";\n }\n\n $order = substr($order, 0, -1);\n\n $sql .= $order != '' ? ' ORDER BY ' . $order : '';\n\n $sql .= $this->limit != '' ? ' LIMIT ' . $this->limit : '';\n\n foreach ($this->parameters as $key => $value) {\n if (is_callable($value)) {\n $v = $value($key);\n $sql = str_replace(':' . $key, $v, $sql);\n unset($this->parameters[$key]);\n }\n }\n return $sql;\n\n }", "protected function selectColumns() {}", "function columnBuilder()\n {\n $query = '';\n\n foreach($this->columns as $column)\n {\n extract($column);\n\n\n $options = [];\n\n if(is_array($length))\n foreach($length as $single)\n if(is_int($single))\n $options[] = $single;\n else\n $options[] = \"'$single'\";\n\n $options = empty($options) ? '' : implode(\", \", $options);\n\n /**\n * Column name\n */\n\n $query .= \"`$name` \";\n\n /**\n * Data types\n */\n\n /** VARCHAR(30) */\n if($type && $length && !is_array($length))\n $query .= \"$type($length) \";\n\n /** FLOAT(1, 2) or ENUM(1, 2, 'A', 'B') */\n elseif($type && $length && is_array($length) && isset($length[0]))\n $query .= \"$type($options) \";\n\n /** DATETIME */\n else\n $query .= \"$type \";\n\n /**\n * Unsigned\n */\n\n if($unsigned)\n $query .= 'UNSIGNED ';\n\n /**\n * Nullable\n */\n\n if(!$nullable)\n $query .= 'NOT NULL ';\n\n /**\n * Auto increment\n */\n\n if($autoIncrement)\n $query .= 'AUTO_INCREMENT ';\n\n /**\n * Default\n */\n\n if($default !== false)\n {\n if(is_int($default))\n $default = $default;\n elseif(is_null($default))\n $default = \"NULL\";\n else\n $default = \"'$default'\";\n\n $query .= \"DEFAULT $default \";\n }\n\n /**\n * Keys\n */\n\n if($primary && !is_array($primary))\n $query .= 'PRIMARY KEY ';\n\n if($unique && !is_array($unique))\n $query .= 'UNIQUE ';\n\n if($index && !is_array($index))\n $query .= 'INDEX ';\n\n /**\n * Comment\n */\n\n if($comment)\n $query .= \"COMMENT '$comment' \";\n\n /**\n * End\n */\n\n $query .= ', ';\n }\n\n /** Remove the last unnecessary comma */\n $query = rtrim($query, ', ');\n\n return $query;\n }", "protected function _compile_parameters()\r\n\t{\r\n\t\t// Return the column's parameters\r\n\t\treturn $this->parameters;\r\n\t}", "private function _createColumns()\n {\n /*\n * creates the action column if its activated and\n * sets the keys if they aren´t set manually yet\n */\n if (!$this->getAction()->isRemoved()) {\n if (count($this->getAction()->getKeys()) == 0) {\n $keys = $this->mapper->getPrimaryAndUniqueKey($this->query->getFrom());\n $this->getAction()->setKeys($keys);\n }\n $this->query = $this->getAction()->createActionColumn($this->query);\n }\n\n //var_dump('COLUMNS_'.md5($this->query->getFrom()));\n\n //parse the query\n $query = $this->query->getQuery()->parse();\n $this->mapper->addAliasFromQuery($query);\n //column positions\n\n $cache = $this->getDI()->get('cache');\n if ($cache->get('COLUMNS_' . md5($this->query->getFrom())) === null) {\n\n $position = 0;\n $colPosition = 0;\n $columns = $this->query->getColumns();\n /** @var \\FhpPhalconGrid\\Grid\\Source\\SourceInterface $validator */\n $validator = __NAMESPACE__ . \"\\\\Source\\\\\" . ucfirst($this->getDI()->get('db')->getType());\n\n\n foreach ($query['columns'] as $name => $sqlColumns) {\n\n\n $buildColumns = array();\n $alias = null;\n $field = null;\n $tableAlias = null;\n $type = Column::TYPE_QUERY;\n\n switch ($sqlColumns['type']) {\n\n //for \"select *\"\n case \"object\":\n //needed to map the $query->getColumns() to this array\n foreach ($columns as $key => $col) {\n if (stristr($col, '*')) {\n unset($columns[$key]);\n }\n }\n $columns = array_values($columns);\n $colPosition = $colPosition - 1;\n\n $tableAlias = $sqlColumns['column'];\n $buildColumns = $this->mapper->getEntity($sqlColumns['model'])->getColumns();\n\n break;\n //for single columns\n case \"scalar\":\n if ($sqlColumns['column']['type'] == \"qualified\") {\n $tableAlias = $sqlColumns['column']['domain'];\n $name = $sqlColumns['column']['name'];\n }\n\n //functions\n if ($sqlColumns['column']['type'] == \"functionCall\") {\n $field = (is_string($columns) ? $columns : $columns[$colPosition]);\n $type = Column::TYPE_FUNCTION;\n }\n\n //sub selects\n if ($sqlColumns['column']['type'] == \"parentheses\") {\n $type = Column::TYPE_SUBQUERY;\n $field = $columns[$colPosition];\n }\n\n //get the column description\n $buildColumns[$name] = array();\n if ($type === Column::TYPE_QUERY) {\n $buildColumns[$name] = $this->mapper->getEntity($this->mapper->getModelNameFromAlias($tableAlias))->getColumn($name);\n }\n\n //set alias if its not the same as the column name\n if (isset($sqlColumns['balias']) AND $sqlColumns['balias'] != $field) {\n $alias = $sqlColumns['balias'];\n }\n\n break;\n }\n\n\n //build the columns\n foreach ($buildColumns as $fieldName => $column) {\n\n //TODO - delete Group\n $relationAlias = Group::getRelationAlias($fieldName, 1);\n $keys = $this->mapper->getKeysToHideFromModelName($this->mapper->getModelNameFromAlias(($relationAlias) ? $relationAlias : $this->query->getFrom()), 1);\n\n\n //TODO create a function for the relations\n //TODO create a function to check if its a Group\n\n $col = new Column();\n $col->setName($fieldName)\n ->setType($type)\n ->setDefault((isset($column['default']) ? $column['default'] : null))\n ->setTable((isset($column['table']) ? $column['table'] : null))\n ->setSchema((isset($column['schema']) ? $column['schema'] : null))\n ->setTableAlias($tableAlias)\n ->setField($field)\n ->setAlias($alias);\n\n\n //hiden id and related fields\n if (in_array(($relationAlias) ? Group::getColumnName($fieldName) : $fieldName, $keys)) {\n $col->setRemove(true);\n $col->setRemove(false, array(), Grid::EDIT);\n $col->setHidden(true, array(), Grid::EDIT);\n $col->setRemove(true, array(), Grid::NEW);\n }\n\n\n if (isset($column['type']) && ($column['type'] == 'enum' || $column['type'] == 'set')) {\n $col->setFieldValue($column['length']);\n }\n\n if (isset($column['type'])) {\n $col->setFieldType($column['type'])->setValidator($validator::getValidator($column['type'], $column));\n if ($column['type'] == \"datetime\" || $column['type'] == \"timestamp\") {\n $col->setCallback(array(new Callback(), 'datetime'), Grid::EDIT);\n $col->setCallback(array(new Callback(), 'datetime'), Grid::NEW);\n\n }\n }\n\n\n $this->_columnHasOneRelation($this->mapper->getModelNameFromAlias(($relationAlias) ? $relationAlias : $this->query->getFrom()), $fieldName, $col);\n\n //add Callback to the action field and remove it from the details and edit view\n if ($fieldName == Action::COLUMNALIAS) {\n $col->setCallback(array(new \\FhpPhalconGrid\\Grid\\Action\\Callback(), 'render'), Grid::TABLE);\n $col->setRemove(true, array(), Grid::DETAILS);\n $col->setRemove(true, array(), Grid::EDIT);\n $col->setRemove(true, array(), Grid::NEW);\n $col->setSortable(false);\n $col->setFilterable(false);\n }\n\n //Create the Group fields and modify the columns to correct them\n if (Text::startsWith($alias, Group::GROUP_PREFIX)) {\n $relationAlias = Group::getRelationAlias($alias);\n\n //TODO put it into own\n $test = $this->mapper->getModelNameFromAlias(Group::getRelationAlias($alias, true));\n\n //use it when its a belongto table\n if ($this->_skipBelongsToAndHasOneRelationsOfFrom($test)) {\n $col->setSqlRemove(true);\n }\n\n if (!isset($this->columns[$relationAlias])) {\n\n $relations = $this->modelsManager->getBelongsTo(new $test);\n\n $this->columns[$relationAlias] = new Group();\n $this->columns[$relationAlias]->setPosition($position++);\n $this->columns[$relationAlias]->setField(Group::getRelationAlias($alias, true));\n $this->columns[$relationAlias]->setName(Group::getRelationAlias($alias, true));\n\n\n //TODO put it into own\n $test = $this->mapper->getModelNameFromAlias(Group::getRelationAlias($alias, true));\n $relations = $this->modelsManager->getBelongsTo(new $test);\n\n\n $rel = $this->mapper->getEntity($this->query->getFrom())->getRelations();\n\n if (count($relations) == 2) {\n\n $hasFromTable = false;\n $relatedArr = array();\n foreach ($relations as $relation) {\n\n if ($relation->getReferencedModel() == $this->query->getFrom() &&\n $relation->getFields() == $rel[$test.Group::getRelationAlias($alias, true)]->getReferencedFields()\n ) { //and from table related field\n $hasFromTable = true;\n } else {\n $relatedArr = new ConnectedTable();\n $relatedArr->setAlias($relation->getOptions()['alias'])\n ->setConnectedFromField($rel[$test.Group::getRelationAlias($alias, true)]->getReferencedFields())\n ->setConnectedField($rel[$test.Group::getRelationAlias($alias, true)]->getFields())\n ->setConnectedTable($test)\n ->setSourceTable($relation->getReferencedModel())\n ->setConnectedToField($relation->getFields())\n ->setSourceField($relation->getReferencedFields());\n }\n }\n //related table\n if ($hasFromTable == true && count($relatedArr) > 0) {\n $this->columns[$relationAlias]->setConnectionTable($relatedArr);\n }\n }\n //add a group callback for a better handling in angular\n $this->columns[$relationAlias]->setCallback(array(new Callback(), 'groupRender'));\n }\n $cTable = $this->columns[$relationAlias]->getConnectionTable();\n\n\n $col->setModelName($this->mapper->getModelNameFromAlias(Group::getRelationAlias($alias, true)));\n\n //TODO check if its added automatically and not manually - then it will not work\n $groupColumn = $this->mapper->getEntity($this->mapper->getModelNameFromAlias(Group::getRelationAlias($alias, true)))->getColumn(str_replace(Group::getRelationAlias($alias) . Group::SPLIT, '', $fieldName));\n if (isset($groupColumn['type'])) {\n\n if ($col->getFieldType() == null) {\n $col->setFieldType($groupColumn['type'])->setValidator($validator::getValidator($groupColumn['type'], $groupColumn));\n }\n\n if ($groupColumn['type'] == \"datetime\" || $groupColumn['type'] == \"timestamp\") {\n $col->setCallback(array(new Callback(), 'datetime'), Grid::EDIT);\n $col->setCallback(array(new Callback(), 'datetime'), Grid::NEW);\n\n }\n\n if ($groupColumn['type'] == 'enum' || $groupColumn['type'] == 'set') {\n $col->setFieldValue($groupColumn['length']);\n }\n }\n\n //TODO put it to a own method\n if ($cTable) {\n if ($relationAlias . '__' . $cTable->getConnectedToField() != $fieldName) {\n continue;\n } else {\n $col->setRemove(false);\n $col->setFieldType('set');\n $col->setValidator(null);\n\n $permission = new Permission();\n $config = new Config(false, array());\n $permission->allowAdd($config)->allowRemove($config);\n $this->columns[$relationAlias]->setPermission($permission);\n }\n }\n\n $this->columns[$relationAlias]->addColumn($col);\n } else {\n $col->setPosition($position++)\n ->setModelName($this->mapper->getModelNameFromTable($col->getTable()))\n ->build();\n $this->columns[$col->getAliasOrField()] = $col;\n }\n }\n $colPosition++;\n }\n\n //$cache->save('COLUMNS_' . md5($this->query->getFrom()), serialize($this->columns));\n } else {\n $this->columns = unserialize($cache->get('COLUMNS_' . md5($this->query->getFrom())));\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create CreateFundRequestForm from associative array of its fields
public static function fromArray(array $array) { return new CreateFundRequestForm($array['h1'], AmountForm::fromArray($array['amount']), (isset($array['feesPayer']) ? FeesPayerForm::fromString($array['feesPayer']) : null), (isset($array['using']) ? $array['using'] : null), (isset($array['securePay']) ? SecurePayForm::fromArray($array['securePay']) : null), (isset($array['description']) ? $array['description'] : null), (isset($array['foreignId']) ? $array['foreignId'] : null), (isset($array['foreignData']) ? $array['foreignData'] : null)); }
[ "protected function createFormFields() {\n\t}", "protected function createRequestForm()\n {\n return new InnTouchApiForm();\n }", "protected function arrayToForm($array) {\n $this->createForm();\n foreach ($array as $name=>$value) {\n $this->Form->$name = $array[$name];\n }\n }", "protected function createRequestForm()\n {\n return new InnTouchOrderGetForm();\n }", "function create_form($fields) {\n\t$form_elements = new MultiPageElement();\n\tforeach ($fields as $id => $info) {\n\t\t$form_element = new PageElement('formfield.html');\n\t\t$form_element->bind('name', $id);\n\t\t$form_element->bind('label', $info['caption']);\n\t\t$form_element->bind('type', $info['type']);\n\t\t$form_elements->addElement($form_element);\n\t}\n\t\n\treturn $form_elements;\n}", "protected function createRequestForm()\n\t{\n\t\treturn new SetOrderItemForm();\n\t}", "function populate_form_array()\n {\n $arr = array(\n 'provider_email' => 'provider_email',\n 'name_first' => 'name_first',\n 'name_last' => 'name_last',\n 'personal_message' => 'personal_message',\n 'practitiner_type' => 'practitiner_type' \n );\n return $arr; \n }", "protected function createRequestForm()\n\t{\n return new GetCustomFieldsForm();\n\t}", "public static function get_form_builder_from_post() {\n $_POST = array_map('stripslashes_deep', $_POST);\n $fields = $_POST['fb_field'];\n $inputs = $_POST['form_fields'];\n\n return array('fields' => $fields, 'inputs' => $inputs);\n }", "protected function createRequestForm()\n\t{\n\t\treturn new CorpSetUserForm();\n\t}", "protected function createInputFields()\n {\n $inputFields = new \\PayPal\\Api\\InputFields();\n\n $inputFields->setNoShipping(1)\n ->setAddressOverride(1);\n\n return $inputFields;\n }", "function fill( &$formArray )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $this->ID = $formArray[$db->fieldName( \"ID\" )];\r\n $this->Name = $formArray[$db->fieldName( \"Name\" )];\r\n $this->CC = $formArray[$db->fieldName( \"CC\" )];\r\n $this->Receiver = $formArray[$db->fieldName( \"Receiver\" )];\r\n $this->CompletedPage = $formArray[$db->fieldName( \"CompletedPage\" )];\r\n $this->InstructionPage = $formArray[$db->fieldName( \"InstructionPage\" )];\r\n $this->Counter = $formArray[$db->fieldName( \"Counter\" )];\r\n $this->SendAsUser = $formArray[$db->fieldName( \"SendAsUser\" )];\r\n $this->Sender = $formArray[$db->fieldName( \"Sender\" )];\r\n }", "public function formBuilder() {\n $options = $this->getOptions();\n $form = array();\n foreach ($options as $field_name => $field) {\n $this->_formBuilder($options, $field_name);\n }\n }", "public function createFormFields()\n {\n return array(\n 'tab' => 'CreditCard',\n 'fields' => array(\n array(\n 'name' => 'enabled',\n 'label' => $this->getTranslatedString('text_enable'),\n 'type' => 'onoff',\n 'doc' => $this->getTranslatedString('enable_heading_title_creditcard'),\n 'default' => 0,\n ),\n array(\n 'name' => 'psd_two',\n 'label' => $this->getTranslatedString('config_PSD2_information'),\n 'type' => 'hint',\n 'doc' => $this->getTranslatedString('config_PSD2_information_desc_prestashop'),\n ),\n array(\n 'name' => 'title',\n 'label' => $this->getTranslatedString('config_title'),\n 'type' => 'text',\n 'default' => $this->getTranslatedString('heading_title_creditcard'),\n 'required' => true,\n ),\n array(\n 'name' => 'merchant_account_id',\n 'label' => $this->getTranslatedString('config_merchant_account_id'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getMerchantAccountId(),\n 'required' => true,\n ),\n array(\n 'name' => 'secret',\n 'label' => $this->getTranslatedString('config_merchant_secret'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getSecret(),\n 'required' => true,\n ),\n array(\n 'name' => 'three_d_merchant_account_id',\n 'label' => $this->getTranslatedString('three_d_merchant_account_id'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getThreeDMerchantAccountId(),\n 'required' => true,\n ),\n array(\n 'name' => 'three_d_secret',\n 'label' => $this->getTranslatedString('config_three_d_merchant_secret'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getThreeDSecret(),\n 'required' => true,\n ),\n array(\n 'name' => 'ssl_max_limit',\n 'label' => $this->getTranslatedString('config_ssl_max_limit'),\n 'type' => 'text',\n 'default' => '300.0',\n 'required' => true,\n ),\n array(\n 'name' => 'three_d_min_limit',\n 'label' => $this->getTranslatedString('config_three_d_min_limit'),\n 'type' => 'text',\n 'default' => '100.0',\n 'required' => true,\n ),\n array(\n 'name' => 'base_url',\n 'label' => $this->getTranslatedString('config_base_url'),\n 'type' => 'text',\n 'doc' => $this->getTranslatedString('config_base_url_desc'),\n 'default' => $this->credentialsConfig->getBaseUrl(),\n 'required' => true,\n ),\n array(\n 'name' => 'wpp_url',\n 'label' => $this->getTranslatedString('config_wpp_url'),\n 'type' => 'text',\n 'doc' => $this->getTranslatedString('config_wpp_url_desc'),\n 'default' => $this->credentialsConfig->getWppUrl(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_user',\n 'label' => $this->getTranslatedString('config_http_user'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpUser(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_pass',\n 'label' => $this->getTranslatedString('config_http_password'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpPassword(),\n 'required' => true,\n ),\n array(\n 'name' => 'payment_action',\n 'type' => 'select',\n 'default' => 'pay',\n 'label' => $this->getTranslatedString('config_payment_action'),\n 'options' => array(\n array('key' => 'reserve', 'value' => $this->getTranslatedString('text_payment_action_reserve')),\n array('key' => 'pay', 'value' => $this->getTranslatedString('text_payment_action_pay')),\n ),\n ),\n array(\n 'name' => 'requestor_challenge',\n 'type' => 'select',\n 'default' => ChallengeInd::NO_PREFERENCE,\n 'label' => $this->getTranslatedString('config_challenge_indicator'),\n 'options' => array(\n array(\n 'key' => ChallengeInd::NO_PREFERENCE,\n 'value' => $this->getTranslatedString('config_challenge_no_preference')\n ),\n array(\n 'key' => ChallengeInd::NO_CHALLENGE,\n 'value' => $this->getTranslatedString('config_challenge_no_challenge')\n ),\n array(\n 'key' => ChallengeInd::CHALLENGE_THREED,\n 'value' => $this->getTranslatedString('config_challenge_challenge_threed')\n )\n ),\n ),\n array(\n 'name' => 'descriptor',\n 'label' => $this->getTranslatedString('config_descriptor'),\n 'type' => 'onoff',\n 'default' => 0,\n ),\n array(\n 'name' => 'send_additional',\n 'label' => $this->getTranslatedString('config_additional_info'),\n 'type' => 'onoff',\n 'default' => 1,\n ),\n array(\n 'name' => 'ccvault_enabled',\n 'label'=> $this->getTranslatedString('enable_vault'),\n 'type' => 'onoff',\n 'default' => 0\n ),\n array(\n 'name' => 'test_credentials',\n 'type' => 'linkbutton',\n 'required' => false,\n 'buttonText' => $this->getTranslatedString('test_config'),\n 'id' => 'creditcardConfig',\n 'method' => 'creditcard',\n 'send' => array(\n 'WIRECARD_PAYMENT_GATEWAY_CREDITCARD_BASE_URL',\n 'WIRECARD_PAYMENT_GATEWAY_CREDITCARD_WPP_URL',\n 'WIRECARD_PAYMENT_GATEWAY_CREDITCARD_HTTP_USER',\n 'WIRECARD_PAYMENT_GATEWAY_CREDITCARD_HTTP_PASS'\n )\n )\n )\n );\n }", "public abstract function createFields();", "public function build_elis_field_data($inputarray) {\n $field = new field((object)$inputarray['field']);\n $field->save();\n $fieldcontext = new field_contextlevel();\n $fieldcontext->fieldid = $field->id;\n $fieldcontext->contextlevel = $inputarray['context'];\n $fieldcontext->save();\n if (isset($inputarray['manual'])) {\n $manual = new field_owner();\n $manual->fieldid = $field->id;\n $manual->plugin = 'manual';\n foreach ($inputarray['manual'] as $key => $val) {\n $manual->{'param_'.$key} = $val;\n }\n $manual->save();\n }\n if (isset($inputarray['moodle_profile'])) {\n $moodleprofile = new field_owner();\n $moodleprofile->fieldid = $field->id;\n $moodleprofile->plugin = 'moodle_profile';\n foreach ($inputarray['moodle_profile'] as $key => $val) {\n $moodleprofile->{$key} = $val;\n }\n $moodleprofile->save();\n }\n $field->load(); // TDB.\n return $field;\n }", "abstract protected function createFields();", "function populate_form_array()\n\t\t{\n\t\t\t$arr = array(\n\t\t\t\t\t\t\t'clinic_name'\t\t=> 'clinic_name',\n\t\t\t\t\t\t\t'name_first' \t\t\t=> 'name_first',\n\t\t\t\t\t\t\t'name_last' \t\t\t=> 'name_last',\n\t\t\t\t\t\t\t'email' \t\t\t=> 'email',\n\t\t\t\t\t\t\t'practitiner_type' \t=> 'practitiner_type',\n\t\t\t\t\t\t\t'clinic_zip' \t\t=> 'clinic_zip' \n\t\t\t\t\t\t);\n\t\t\treturn $arr;\t\t\t\n\t\t}", "private function makeAttributes(){\n\n foreach ($this->fields as $key => $field) {\n\n $key = strtolower($key);\n\n if (is_array($field)) {\n $this->{$key} = new Field($key);\n if (isset($field['validates'])) {\n\n $validates = $field['validates'];\n //correção para forçar um array de validades\n if (!isset($validates[0])) {\n $validates = [$validates];\n }\n\n foreach ($validates as $key1 => $validate) {\n if (isset($validate['require'])) {\n $this->{$key}->setRequired((bool)$validate['require']);\n break;\n }\n }\n }\n if (isset($field['type'])) {\n $this->{$key}->setType($field['type']);\n }\n if( isset($field['ignore']) ){\n $this->{$key}->setIgnore($field['ignore']);\n }\n if( isset($field['date_format']) ){\n $this->{$key}->setDateFormat($field['date_format']);\n }\n if( isset($field['empty_value']) ){\n $this->{$key}->setEmptyValue($field['empty_value']);\n }\n } else {\n $this->{strtolower($field)} = new Field(strtolower($field));\n }\n }\n\n $this->created_at = new Field('created_at', date('Y-m-d H:i:s'));\n $this->created_at->setValue(date('Y-m-d H:i:s'));\n $this->id = new Field('id');\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation createCampaignUsingPostAsyncWithHttpInfo Create a campaign
public function createCampaignUsingPostAsyncWithHttpInfo($campaign_request) { $returnType = '\com\hydrogen\nucleus\Model\Campaign'; $request = $this->createCampaignUsingPostRequest($campaign_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } ); }
[ "public function marketingCampaignsPostWithHttpInfo($campaign)\n {\n // verify the required parameter 'campaign' is set\n if ($campaign === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $campaign when calling marketingCampaignsPost');\n }\n // parse inputs\n $resourcePath = \"/marketing/campaigns\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($campaign)) {\n $_tempBody = $campaign;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires HTTP basic authentication\n if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {\n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Spinen\\ConnectWise\\Clients\\Marketing\\Model\\Campaign',\n '/marketing/campaigns'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Spinen\\ConnectWise\\Clients\\Marketing\\Model\\Campaign', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Marketing\\Model\\Campaign', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Spinen\\ConnectWise\\Clients\\Marketing\\Model\\Error', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function createEmailCampaignWithHttpInfo($email_campaigns)\n {\n // verify the required parameter 'email_campaigns' is set\n if ($email_campaigns === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $email_campaigns when calling createEmailCampaign');\n }\n // parse inputs\n $resourcePath = \"/emailCampaigns\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($email_campaigns)) {\n $_tempBody = $email_campaigns;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');\n if (strlen($apiKey) !== 0) {\n $headerParams['api-key'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\CreateModel',\n '/emailCampaigns'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\CreateModel', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\CreateModel', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ErrorModel', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function createEmailCampaignAsyncWithHttpInfo($emailCampaigns)\n {\n $returnType = '\\SendinBlue\\Client\\Model\\CreateModel';\n $request = $this->createEmailCampaignRequest($emailCampaigns);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createCampaignAsyncWithHttpInfo($campaign_resource = null)\n {\n $returnType = '\\KnetikCloud\\Model\\CampaignResource';\n $request = $this->createCampaignRequest($campaign_resource);\n\n return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }", "public function createClientCampaignUsingPostAsync($campaign_mapping_request)\n {\n return $this->createClientCampaignUsingPostAsyncWithHttpInfo($campaign_mapping_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createCampaignUsingPost($campaign_request)\n {\n list($response) = $this->createCampaignUsingPostWithHttpInfo($campaign_request);\n return $response;\n }", "public function campaignCreate(array $data = array()) {\r\n $type = isset($data['campaign_type'])? $data['campaign_type'] : 'regular';\r\n $options = array();\r\n $content = array();\r\n $segmentOptions = null;\r\n $typeOptions = null;\r\n $this->mc->campaignCreate($type, $options, $content, $segmentOptions, $typeOptions);\r\n }", "protected function createCampaignUsingPostRequest($campaign_request)\n {\n // verify the required parameter 'campaign_request' is set\n if ($campaign_request === null || (is_array($campaign_request) && count($campaign_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_request when calling createCampaignUsingPost'\n );\n }\n\n $resourcePath = '/campaign';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($campaign_request)) {\n $_tempBody = $campaign_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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 }", "public function createCampaignPlanUsingPostAsyncWithHttpInfo($campaign_plan_request)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\CampaignPlan';\n $request = $this->createCampaignPlanUsingPostRequest($campaign_plan_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function advCreateCampaignAsyncWithHttpInfo($adv_campaign_request)\n {\n $returnType = '\\Adserver\\Model\\Campaign';\n $request = $this->advCreateCampaignRequest($adv_campaign_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function createAction()\n {\n if (!$this->request->isAjax()) {\n $this->redirect('/anunciante');\n }\n $post = $this->getPost();\n $errors = [];\n if (!isset($post['name']) || !strlen(trim($post['name']))) {\n $errors[] = Translate::_('Please specify a unique campaign name');\n }\n if (!isset($post['budget']) || !preg_match('/^\\$?\\d+(,\\d{3})*\\.?[0-9]?[0-9]?$/', $post['budget'])) {\n $errors[] = Translate::_('Please enter a valid budget amount');\n }\n if (count($errors)) {\n $this->response->setContent(\n json_encode(['error' => true, 'msg' => $errors])\n );\n\n return $this->response;\n } else {\n $errors = [];\n $post['budget'] = preg_replace('/[^\\d\\.]/', '', $post['budget']);\n $campaign = Campaign::count('id_factor = '.$this->get('id').' AND name =\"'.$post['name'].'\"');\n if (intval($campaign) > 0) {\n $errors[] = Translate::_('Please specify a unique campaign name');\n }\n if ((float)$post['budget'] < Pricing::STANDARD_MARKUP) {\n $errors[] = Translate::_('You haven\\'t met the minimum amount required to start a campaign');\n }\n $availableFunds = FactorBalance::findFirst('id_factor = '.$this->get('id'));\n if ((float)$post['budget'] > $availableFunds->getBalance()) {\n $errors[] = Translate::_('You cannot create a campaign with more funds then you have available');\n }\n if (count($errors)) {\n $this->response->setContent(\n json_encode(['error' => true, 'msg' => $errors])\n );\n\n return $this->response;\n } else {\n $campaign = new Campaign();\n $campaign\n ->setBudget((float)$post['budget'])\n ->setIdFactor($this->get('id'))\n ->setIsArchived(0)\n ->setCreatedAt(date('Y-m-d H:i:s'))\n ->setName(trim($post['name']))\n ->create();\n\n //We reduce the advertisers balance and reserve it for the campaign, but no transaction actually takes place yet.\n $factorBalance = FactorBalance::findFirst('id_factor = '.$this->get('id'));\n $factorBalance->setBalance($factorBalance->getBalance() - (float)$post['budget']);\n $factorBalance->setReserved((float)$factorBalance->getReserved() + (float)$post['budget']);\n $factorBalance->update();\n\n $factorActivity = new FactorActivity();\n $factorActivity\n ->setCreatedAt(date('Y-m-d H:i:s'))\n ->setIdFactor($this->get('id'))\n ->setMessage(\n Translate::_(\n 'You have created a new campaign called \"%campaign%\" and the budget has been reserved from your account balance',\n ['campaign' => trim($post['name'])]\n )\n )\n ->save();\n\n $this->success(\n Translate::_(\n '$%amount% USD has been reserved from your balance for this campaign',\n ['amount' => $post['budget']]\n )\n );\n $this->refreshSession();\n $this->response->setContent(\n json_encode(['error' => false, 'redirect' => '/anunciante/campana/'.$campaign->getId().'/oportunidad/crear'])\n );\n\n return $this->response;\n }\n }\n }", "protected function create()\n\t{\n\t\t$data = array(\n\t\t\t\"type\" => $this->settings[\"type\"],\n\t\t\t\"settings\" => $this->getCampaignSettings(),\n\t\t\t\"recipients\" => array(\n\t\t\t\t\"list_id\" => $this->settings[\"list_id\"]\n\t\t\t)\n\t\t);\n\n\t\t$response = $this->api->request(\"campaigns\", \"post\", $data);\n\n\t\t$this->id = $response->id;\n\n\t\t$this->addContentToCampaign();\n\t}", "public function createClientCampaignUsingPost($campaign_mapping_request)\n {\n list($response) = $this->createClientCampaignUsingPostWithHttpInfo($campaign_mapping_request);\n return $response;\n }", "public function createCampaignAsyncWithHttpInfo($applicationId, $body)\n {\n $returnType = '\\TalonOne\\Client\\Model\\Campaign';\n $request = $this->createCampaignRequest($applicationId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createOrUpdateCampaignAsyncWithHttpInfo($name = null, $campaign_id = null, $template_campaign_id = null, $login_options = null, $ssid = null, $text_color = null, $background = null, $footer_text = null, $title_text = null, $custom_terms = null, $redirect_url = null, $login_facebook = null, $login_custom = null, $login_twitter = null, $login_instagram = null, $login_linkedin = null)\n {\n $returnType = '';\n $request = $this->createOrUpdateCampaignRequest($name, $campaign_id, $template_campaign_id, $login_options, $ssid, $text_color, $background, $footer_text, $title_text, $custom_terms, $redirect_url, $login_facebook, $login_custom, $login_twitter, $login_instagram, $login_linkedin);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createEmailCampaignAsyncWithHttpInfo($email_campaign_create, string $contentType = self::contentTypes['createEmailCampaign'][0])\n {\n $returnType = '\\EgoiClient\\EgoiModel\\HashcodeCampaign';\n $request = $this->createEmailCampaignRequest($email_campaign_create, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }", "public function createCampaign($data)\n {\n list($response) = $this->createCampaignWithHttpInfo($data);\n return $response;\n }", "public function testCreatingACampaign()\n {\n // Create a campaign.\n $firstCampaignTitle = $this->faker->sentence;\n $firstCampaignStartDate = $this->faker->date($format = 'm/d/Y');\n // Make sure the end date is after the start date.\n $firstCampaignEndDate = date('m/d/Y', strtotime('+3 months', strtotime($firstCampaignStartDate)));\n\n $this->actingAsAdmin()->postJson('campaign-ids', [\n 'internal_title' => $firstCampaignTitle,\n 'cause' => ['animal-welfare'],\n 'impact_doc' => 'https://www.google.com',\n 'start_date' => $firstCampaignStartDate,\n 'end_date' => $firstCampaignEndDate,\n ]);\n\n // Make sure the campaign is persisted.\n $this->assertDatabaseHas('campaigns', [\n 'internal_title' => $firstCampaignTitle,\n ]);\n\n // Try to create a second campaign with the same title and make sure it doesn't duplicate.\n $this->actingAsAdmin()->postJson('campaign-ids', [\n 'internal_title' => $firstCampaignTitle,\n ]);\n\n $response = $this->getJson('api/v3/campaigns');\n $decodedResponse = $response->decodeResponseJson();\n\n $this->assertEquals(1, $decodedResponse['meta']['pagination']['count']);\n }", "function createCampaign($data=array())\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'name' => 'New Campaign Test'\n\t\t\t\t\t\t,'type' => 'banner'\n\t\t\t\t\t\t,'interface' => 'network'\n\t\t\t\t\t\t,'status' => 'active'\n\t\t\t\t\t\t,'height' => '300'\n\t\t\t\t\t\t,'width' => '250'\n\t\t\t\t\t);\n\t\t$params = array(\n\t\t\t\t\t'Target' => 'AdManager',\t\t\t\t\n\t\t\t\t\t'Method' => 'createCampaign',\n\t\t\t\t\t'data' => $data\t\t\t\t\t\n\t\t\t\t);\n\t\t$result = $this->makeRequest($params);\n\t\t$result = $this->object_to_array($result);\t\t\t\t \t\t\n\t\treturn $result;\t\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executed by all Checks for all ussd SMS messages for those in pending state and send SMS
public function ussdSmsUpdater(){ $this->fileLogAction('7018', 'BatchOperationService::ussdSmsUpdater', 'ussdSmsUpdater STARTED'); // Get all USSD messages in state pending $ussdMessages = $this->Ussdsmsnotification_model->get_ussdsmsnotificationByStatus(smsState::PENDING); $this->fileLogAction('7018', 'BatchOperationService::ussdSmsUpdater', 'Preparing SMS update for ' . count($ussdMessages) . ' USSD messages'); foreach ($ussdMessages as $ussdMessage){ $ussdNotificationId = $ussdMessage['ussdSmsNotificationId']; $message = $ussdMessage['message']; $msisdn = $ussdMessage['msisdn']; $this->db->trans_start(); $this->fileLogAction('7018', 'BatchOperationService::ussdSmsUpdater', 'Sending USSD SMS for ' . $ussdNotificationId); // Send USSD SMS and save in DB $response = SMS::USSD_SMS($message, $msisdn); $smsNotificationparams = []; if($response['success']){ $this->fileLogAction('7018', 'BatchOperationService::ussdSmsUpdater', 'USSD SMS successful for ' . $ussdNotificationId); // Update SMS in USSDNotificationTable in state SENT $smsNotificationparams = array( 'status' => smsState::SENT, 'attemptCount' => $ussdMessage['attemptCount'] + 1, 'sendDateTime' => date('c') ); }else{ $this->fileLogAction('7018', 'BatchOperationService::ussdSmsUpdater', 'USSD SMS failed for ' . $ussdNotificationId); $smsNotificationparams = array( 'attemptCount' => $ussdMessage['attemptCount'] + 1, ); } $this->Ussdsmsnotification_model->update_ussdsmsnotification($ussdNotificationId, $smsNotificationparams); $this->db->trans_complete(); } }
[ "public function sendSmsMessages() {\n $sms = new Jsms\\Sms;\n $sms->delayInSeconds = 10; // so far setting to 10 doesn't have an issue with the modem.\n print \"Set device: \" . $sms->setDevice(config('app.device_port')) . \"\\n\";\n print \"Open device: \" . $sms->openDevice() . \"\\n\";\n print \"Set baud rate: \" . $sms->setBaudRate(config('app.baud_rate')) . \"\\n\";\n\n while (true) {\n $records = DB::table('smsMessages')->select('id', 'alertId', 'recipient', 'message', 'status')->whereIn('status', ['draft', 'outbox'])->get();\n\n $smsMessages = [];\n foreach ($records as $record)\n $smsMessages[] = ['id'=> $record->id, 'alertId' => $record->alertId, 'recipient' => $record->recipient, 'message' => $record->message, 'status' => $record->status];\n\n foreach ($smsMessages as $smsMessage) {\n $mobilePrefix = substr($smsMessage['recipient'], 0, 4);\n $telco = DB::table('telcos')->select('network')->where('mobilePrefix', $mobilePrefix)->first();\n\n if ($telco) { // We do not send to unknown TelCo\n $simCards = DB::table('simCards')->select('allowedToBeSent', 'allowedToSameNetwork', 'allowedToOtherNetwork', 'sentToSameNetwork', 'sentToOtherNetwork', 'sentMessages')->where('id', 1)->first();\n\n $consideredAsOtherNetwork = explode(',', config('app.considered_as_other_network'));\n if (!in_array($telco->network, $consideredAsOtherNetwork) &&\n ($simCards->allowedToSameNetwork >= $simCards->sentToSameNetwork) &&\n ($simCards->allowedToBeSent >= $simCards->sentMessages)) { // meaning they're in the same network because I currently use TnT\n $allowedToSendMessage = true;\n } elseif (in_array($telco->network, $consideredAsOtherNetwork) &&\n ($simCards->allowedToOtherNetwork >= $simCards->sentToOtherNetwork) &&\n ($simCards->allowedToBeSent >= $simCards->sentMessages)) { // meaning they're not in the same network because I currently use TnT\n $allowedToSendMessage = true;\n } else {\n $allowedToSendMessage = false;\n }\n\n if ($allowedToSendMessage) {\n $sentMessage = $sms->sendSMS($smsMessage['recipient'], $smsMessage['message']);\n\n print \"Message sent: ${sentMessage}; id: ${smsMessage['id']} \\n\";\n\n if ($sentMessage) {\n DB::beginTransaction();\n if ($smsMessage['alertId'])\n DB::table('alerts')->where('id', $smsMessage['alertId'])->update(['sentToSms' => 1]);\n\n DB::table('smsMessages')->where('id', $smsMessage['id'])->update(['status' => 'sent']);\n\n $simCards = DB::table('simCards')->where('id', 1);\n if (!in_array($telco->network, $consideredAsOtherNetwork))\n $simCards->increment('sentToSameNetwork');\n else\n $simCards->increment('sentToOtherNetwork');\n\n DB::table('simCards')->where('id', 1)->increment('sentMessages');\n\n switch ($telco->network) {\n case 'Smart':\n $simCards->increment('sentToSmart');\n break;\n case 'Tnt':\n $simCards->increment('sentToTnt');\n break;\n case 'Sun':\n $simCards->increment('sentToSun');\n break;\n case 'Globe':\n $simCards->increment('sentToGlobe');\n break;\n case 'Tm':\n $simCards->increment('sentToTm');\n break;\n default:\n // make sure that network is known i.e., if you add new network in the telcos table, add column for it in order to be counted on every sms sent\n break;\n }\n DB::commit();\n } else {\n DB::table('smsMessages')->where('id', $smsMessage['id'])->update(['status' => 'outbox']);\n }\n }\n }\n }\n\n sleep(30);\n }\n\n // This is unreachable due to new implementation instead of running this with cron job.\n print \"Device closed: \" . $sms->closeDevice() . \"\\n\";\n }", "private function sendSmsNotification()\n {\n // TODO: Not yet implemented since we have no transport/Gateway for SMS in Netric\n }", "function schedulesms() {\n \t\t\n \t\tConfigure::write('debug', 0);\n \t\t\n \t\t$this->send(true, $_REQUEST['message'], $_REQUEST['mobile'], $_REQUEST['skey'], $_REQUEST['senderid'], \n \t\t\t\t\t\t\t$_REQUEST['group'], $_REQUEST['tag'], $_REQUEST['date'], $_REQUEST['response']);\n \t\t\n \t}", "public function run_sms_queue( )\n {\n \n \n set_time_limit(0);\n $cycle_time = 1;\n \n //10 sms every 5 minutes\n $smslist = $this->system->pushnotification->pop_sms_priority( 10 , True , $this->_shop['shop_id'] );\n \n if( empty($smslist ) )\n die('SMS queue is empty');\n \n $sender_id = $this->contact['sms_sender_id'];\n \n echo '[=] Starting SMS Queue at ' . date('r') . \"\\n\";\n echo '[=] Account has ' . account_can('sms') . ' credit left' . \"\\n\";\n\n \n $sms_left = account_can('sms');\n foreach( $smslist as $sms )\n {\n if( $sms_left == 0 )\n {\n echo '[!] Account ran out of sms credit ' . date('r') . \"\\n\";\n }\n if( $sms['phone_number'] == '*' or empty($sms['phone_number'] ) )\n {\n $sms['phone_number'] = $this->_shop['contact']['notify_sms'];\n }\n \n if(! $this->system->is_valid_phone_number( $sms['phone_number'] ) )\n {\n echo \"[!] Target phone number is not valid - \\n\" . $sms['phone_number']; \n\n $try_2 = $this->system->make_international_number( $sms['phone_number'] );\n if( $try_2 == False or $this->system->is_valid_phone_number($try_2) == False )\n {\n //invalid none zim number\n $sms['log'] .= '[!] Target phone number is invalid '; \n $sms['status'] = 'failed';\n $sms['is_sent'] = True;\n $this->system->pushnotification->update( $sms['notification_id'] , $sms );\n continue;\n }\n echo \"[+] Maybe target number was... trying \" . $try_2; \n $sms['phone_number'] = $try_2; \n \n }\n echo '[+] Notification ID: ' . $sms['notification_id'] . \"\\n\" ;\n echo '[+] Receipient: ' . $sms['phone_number'] . '( '. $this->system->sms->sms_pages( $sms['message'] ) . ' pages ) :: ' . \"\\n\" ;\n \n $response = False;\n if( account() == 'free' )\n {\n echo \"[=] Subscribed to free account. cannot send sms. \\n\";\n \n }\n else\n {\n $response = $this->system->sms->send_sms( $sms['phone_number'] , $sms['message'] , $sender_id ); \n }\n if( $response === FALSE )\n\t\t\t{\n\t\t\t\t$log = \"[!] Error sending SMS message. Response was false, SMS flagged as FAILED [ SMS ID: \" . $sms['notification_id'] . \" ] \\n\";\n\t\t\t\t$sms['log'] .= ( $log . $response['raw'] );\n $sms['is_sent'] = true;\n\t\t\t\techo $log;\n\t\t\t\t$this->system->pushnotification->update( $sms['notification_id'] , $sms );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$log = \"\";\n\t\t\t\t$do_exit = FALSE;\n\t\t\t\tswitch( $response['status'] )\n\t\t\t\t{\n\t\t\t\t\t//update\n\t\t\t\t\tcase 'failed':\n\t\t\t\t\t{\n\t\t\t\t\t\t$sms['status'] = 'failed';\n $sms['is_sent'] = True;\n\t\t\t\t\t\t$log = \"[!] Failed to send SMS Message to [SMS ID: {$sms['notification_id']} ] \\n\";\n\t\t\t\t\t\t$sms['log'] = $log . $response['raw'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t//all is well\n\t\t\t\t\tcase 'sent':\n\t\t\t\t\t{\n\t\t\t\t\t\t$sms['status'] = 'sent';\n $sms['is_sent'] = True;\n\t\t\t\t\t\t$log = \"[+] Message sent [ SMS ID: {$sms['notification_id']} ] \\n\";\n\t\t\t\t\t\t$sms['log'] .= $response['raw'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t//Odd, but still allowed\n\t\t\t\t\tcase 'delivered':\n\t\t\t\t\t{\n\t\t\t\t\t\t$sms['status'] = 'delivered';\n $sms['is_sent'] = True;\n\t\t\t\t\t\t$log = \"[+] Message delivered [ SMS ID: {$sms['notification_id']} ] \\n\"; \n\t\t\t\t\t\t$sms['log'] .= $response['raw'] ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t//Message was not sent because of too many requests.\n\t\t\t\t\t//have to quit process\n\t\t\t\t\tcase 'throttled':\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$sms['status'] = 'queued';\n\t\t\t\t\t\t$sms['priority'] += 1;\n\t\t\t\t\t\t$log = \"[!] Messsages to SMS gateway throttled down. Ending cron job [ SMS ID: {$sms['notification_id']} ] {$response['raw']} \\n\";\n\t\t\t\t\t\t$sms['log'] .= $response['raw'];\n\t\t\t\t\t\t$do_exit = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t//error on the side of the gateway, we must retry\n\t\t\t\t\tcase 'internal_error':\n\t\t\t\t\t{\n\t\t\t\t\t\t$sms['status'] = 'queued';\n\t\t\t\t\t\t$sms['priority'] += 1;\n\t\t\t\t\t\t$sms['log'] .= $response['raw'];\n\t\t\t\t\t\t$log = \"[FATAL] An internal error occured on the side of the SMS gateway, Job will be terminated \\n\";\n\t\t\t\t\t\t$do_exit = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t//unknown error occured but whatever it is, its not good\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$sms['log'] .= $response['raw'];\n\t\t\t\t\t\t$sms['status'] ='failed';\n $sms['is_sent'] = True; \n\t\t\t\t\t\t$log = \"[FATAL] An unknwon error has occured and forced the job to terminate. \\n\";\n\t\t\t\t\t\t$do_exit = TRUE; \n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo $log . \"\\n\";\n\t\t\t\t//update sms\n\t\t\t\t$this->system->pushnotification->update( $sms['notification_id'] , $sms );\n\t\t\t\t//if we should quit\n\t\t\t\tif( $do_exit )\n\t\t\t\t{\n\t\t\t\t\techo \"[ERROR] Job will now terminate as requested ! \" . date('r') . \"\\n\";\n\t\t\t\t\t$this->shop->account->set_credit($sms['shop_id'] , 'sms' , $sms_left );\n \n return;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//each sms is 140 charcaters\n $sms_pages = $this->system->sms->sms_pages( $sms['shop_id'] , $sms['message'] , 140 );\n\t if( $sms_pages <= 0 ) $sms_pages = 1;\n\t $sms_left = $sms_left - $sms_pages;\t\n\n\n\t\t\t\t\n\t\t\t//sleep\n\t\t\tsleep( $cycle_time );\n }\n\n //reduce account sms credit\n $this->shop->account->set_credit('sms' , $sms_left );\n \n echo '[=] Ended SMS queue at ' . date('r') . \"\\n\";\n }", "public function processAndSend() {\n if(! empty($this->_messages)) {\n foreach($this->_messages as $message) {\n \n $destinations = unserialize($message->destinations);\n \n foreach($destinations as $destination) {\n $this->sendSMS($destination, $message->message);\n }\n \n $this->_queue->_db->update($this->_queue->_tableName, array('sent' => current_time('mysql')), array('id' => $message->id));\n }\n \n return true;\n }\n }", "private function deletePendingSms() {\r\n $sms2del = $this->session->userdata('sms_delete');\r\n if (!$sms2del) {\r\n return;\r\n }\r\n\r\n foreach ($sms2del as $smsid) {\r\n self::deleteSmsAttributes($smsid);\r\n $sql = \"DELETE FROM smart_message WHERE smart_message_id = ? \";\r\n $this->db->query($sql, array($smsid));\r\n }\r\n $this->session->unset_userdata('sms_delete');\r\n }", "static function wcap_send_sms_reminders() {\n \n // check if all the details are correctly filled\n $sid = get_option( 'wcap_sms_account_sid' );\n $token = get_option( 'wcap_sms_auth_token' );\n $from_phone = get_option( 'wcap_sms_from_phone' );\n \n if( $sid == '' || $token == '' || $from_phone == '' ) {\n return;\n } else {\n $twilio_details = array( 'sid' => $sid,\n 'token' => $token,\n 'from_phone' => $from_phone\n );\n }\n \n // require the common functions file\n require_once( WP_PLUGIN_DIR . '/woocommerce-abandon-cart-pro/includes/wcap_functions.php' );\n require_once( WP_PLUGIN_DIR . '/woocommerce-abandon-cart-pro/includes/wcap_tiny_url.php' );\n \n // get the SMS Templates\n $sms_templates = wcap_get_notification_templates( 'sms' );\n \n if( is_array( $sms_templates ) && count( $sms_templates ) > 0 ) {\n \n $current_time = current_time( 'timestamp' );\n $registered_cut_off = get_option( 'ac_cart_abandoned_time' ) * 60;\n $guest_cut_off = get_option( 'ac_cart_abandoned_time_guest' ) * 60;\n \n foreach( $sms_templates as $frequency => $template_data ) {\n \n // template ID\n $template_id = $template_data[ 'id' ];\n \n $time_check_registered = $current_time - $frequency - $registered_cut_off;\n $time_check_guest = $current_time - $frequency - $guest_cut_off;\n // get abandoned carts\n $carts = wcap_get_notification_carts( $time_check_registered, $time_check_guest, $template_id );\n \n if( is_array( $carts ) && count( $carts ) > 0 ) {\n foreach( $carts as $cart_data ) {\n if( $cart_data->user_id > 0 ) {\n // SMS Reminders\n self::wcap_send_sms( $cart_data, $template_data, $twilio_details ); \n }\n // Delete the cart ID from notifications meta\n $cart_id = $cart_data->id;\n wcap_update_meta( $template_id, $cart_id );\n \n }\n }\n }\n }\n }", "public function _incoming_sms()\n\t{\n\t\t$sms = Event::$data;\n\t\t\n\t\t//get all of the whitelisted numbers and see if there's a match\n\t\t$numbers = ORM::factory(\"simplegroups_groups_number\")->find_all();\n\t\tforeach($numbers as $number)\n\t\t{\n\t\t\tif($number->number)\n\t\t\t{\n\t\t\t\t//makes it a fuzzy search\n\t\t\t\tif( !(strpos($sms->message_from, $number->number) === false) ||\n\t\t\t\t\t($number->number == $sms->message_from))\n\t\t\t\t{\n\t\t\t\t\t$group_message = ORM::factory(\"simplegroups_groups_message\");\n\t\t\t\t\t$group_message->simplegroups_groups_id = $number->simplegroups_groups_id;\n\t\t\t\t\t$group_message->message_id = $sms->id;\n\t\t\t\t\t$group_message->number_id = $number->id;\n\t\t\t\t\t$group_message->save();\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//check and see if it needs to be forwarded\n\t\t\t\t\tgroups::forward_message_to_own_instance($sms->message, $sms->message_from, $number->simplegroups_groups_id);\n\t\t\t\t\t\n\t\t\t\t\t//check and see if we need to assign some categories to this\n\t\t\t\t\t$group_categories = ORM::factory(\"simplegroups_category\")\n\t\t\t\t\t\t->where(\"simplegroups_groups_id\", $number->simplegroups_groups_id)\n\t\t\t\t\t\t->where(\"applies_to_message\", \"1\")\n\t\t\t\t\t\t->where(\"selected_by_default\", \"1\")\n\t\t\t\t\t\t->find_all();\n\t\t\t\t\tforeach($group_categories as $group_category)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_instance = ORM::factory(\"simplegroups_message_category\");\n\t\t\t\t\t\t$category_instance->simplegroups_category_id = $group_category->id;\n\t\t\t\t\t\t$category_instance->message_id = $sms->id;\n\t\t\t\t\t\t$category_instance->save();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//break; //more than one number can match? good or bad?\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract protected function doSend(ullSms $sms);", "public static function sendSMS(){\n }", "function twilio_rules_action_send_sms_to_user($account, $message) {\n if (!empty($account->twilio_user['number']) && $account->twilio_user['status'] == 2) {\n twilio_send($account->twilio_user['number'], $message);\n }\n}", "public function sendSMS()\n {\n }", "function sms_send($mesasage,$off)\n{\n}", "public static function sendSmsToBulkReceiver()\n {\n if (isset($_POST['persianwoosms_send_sms'])) {\n if ($_POST['wp_woo_send_to'] == \"wp_woo_customer_club_contacts\") {\n if (empty($_POST['persianwoosms_buyer_sms_body'])) {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'error'), admin_url('admin.php')));\n exit;\n } else {\n $receiver_sms_data['sms_body'] = esc_textarea($_POST['persianwoosms_buyer_sms_body']);\n $receiver_response_sms_club = WoocommerceIR_Gateways_SMS::init()->sendSMStoCustomerclubContacts($receiver_sms_data);\n if ($receiver_response_sms_club) {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'success'), admin_url('admin.php'))); \n exit;\n } else {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'sending_failed'), admin_url('admin.php'))); \n exit;\n }\n }\n } else {\n if (empty($_POST['persianwoosms_receiver_number'])) {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'error'), admin_url('admin.php')));\n exit;\n } else {\n $receiver_sms_data['number'] = isset($_POST['persianwoosms_receiver_number']) ? explode(',', sanitize_text_field($_POST['persianwoosms_receiver_number'])) : '';\n $receiver_sms_data['number'] = fa_en_mobile_woo_sms($receiver_sms_data['number']);\n $receiver_sms_data['sms_body'] = esc_textarea($_POST['persianwoosms_buyer_sms_body']); \n $receiver_response_sms = WoocommerceIR_Gateways_SMS::init()->sendSMSir($receiver_sms_data);\n\n if ($receiver_response_sms) {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'success' ), admin_url('admin.php'))); \n exit;\n } else {\n wp_redirect(add_query_arg(array('page'=> 'WoocommercePluginSMSIR', 'send'=>'true', 'message' => 'sending_failed' ), admin_url('admin.php'))); \n exit;\n }\n }\n }\n }\n }", "public function smsreport() {\n\n\t\t// load config\n\t\t$this->config->load('textlocal', TRUE);\n\n\t\t// get vars\n\t\t$number = $this->input->post('number');\n\t\t$status = $this->input->post('status');\n\t\t$customID = $this->input->post('customID');\n\n\t\t// validate\n\t\tif (!empty($number) && !empty($status) && !empty($customID)) {\n\n\t\t\t// switch status\n\t\t\tswitch ($status) {\n\t\t\t\tcase 'D':\n\t\t\t\t\t$status = \"delivered\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'U':\n\t\t\t\t\t$status = \"undelivered\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'I':\n\t\t\t\t\t$status = \"invalid\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '?':\n\t\t\t\tdefault:\n\t\t\t\t\t$status = \"unknown\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$where = array(\n\t\t\t\t'notificationID' => $customID,\n\t\t\t\t'destination' => $number\n\t\t\t);\n\n\t\t\t$data = array(\n\t\t\t\t'status' => $status,\n\t\t\t\t'modified' => mdate('%Y-%m-%d %H:%i:%s')\n\t\t\t);\n\n\t\t\t$res = $this->db->update('family_notifications', $data, $where, 1);\n\n\t\t\tif ($this->db->affected_rows() > 0) {\n\t\t\t\techo 'OK';\n\t\t\t} else {\n\t\t\t\techo 'NOTFOUND';\n\t\t\t}\n\n\t\t} else {\n\t\t\techo \"INVALIDPARAMS\";\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function sendBulkSMS()\n {\n if (app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::where('status', 'unblock')->get();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sid->sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $sender_ids = array_unique($all_ids);\n\n } else {\n $sender_ids = false;\n }\n\n $phone_book = ImportPhoneNumber::where('user_id', Auth::guard('client')->user()->id)->get();\n $client_group = ClientGroups::where('created_by', Auth::guard('client')->user()->id)->where('status', 'Yes')->get();\n $sms_templates = SMSTemplates::where('status', 'active')->where('cl_id', Auth::guard('client')->user()->id)->orWhere('global', 'yes')->get();\n $country_code = IntCountryCodes::where('Active', 1)->select('country_code', 'country_name')->get();\n\n $gateways = json_decode(Auth::guard('client')->user()->sms_gateway);\n $sms_gateways = SMSGateways::whereIn('id', $gateways)->where('status', 'Active')->get();\n $keyword = Keywords::where('user_id', Auth::guard('client')->user()->id)->where('status', 'assigned')->get();\n $schedule_sms = false;\n\n return view('client.send-bulk-sms', compact('client_group', 'sms_templates', 'sender_ids', 'phone_book', 'schedule_sms', 'country_code', 'sms_gateways', 'keyword'));\n }", "public function sendScheduleSMS()\n {\n if (app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::where('status', 'unblock')->get();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sid->sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $sender_ids = array_unique($all_ids);\n\n } else {\n $sender_ids = false;\n }\n\n $phone_book = ImportPhoneNumber::where('user_id', Auth::guard('client')->user()->id)->get();\n $client_group = ClientGroups::where('created_by', Auth::guard('client')->user()->id)->where('status', 'Yes')->get();\n $sms_templates = SMSTemplates::where('status', 'active')->where('cl_id', Auth::guard('client')->user()->id)->orWhere('global', 'yes')->get();\n $country_code = IntCountryCodes::where('Active', 1)->select('country_code', 'country_name')->get();\n\n $gateways = json_decode(Auth::guard('client')->user()->sms_gateway);\n $sms_gateways = SMSGateways::whereIn('id', $gateways)->where('status', 'Active')->get();\n $keyword = Keywords::where('user_id', Auth::guard('client')->user()->id)->where('status', 'assigned')->get();\n $schedule_sms = true;\n\n return view('client.send-bulk-sms', compact('client_group', 'sms_templates', 'sender_ids', 'phone_book', 'schedule_sms', 'country_code', 'sms_gateways', 'keyword'));\n }", "public function postSendBulkSMS(Request $request)\n {\n\n if (function_exists('ini_set') && ini_get('max_execution_time')) {\n ini_set('max_execution_time', '-1');\n }\n\n if ($request->schedule_sms_status) {\n $v = \\Validator::make($request->all(), [\n 'schedule_time' => 'required', 'message_type' => 'required', 'remove_duplicate' => 'required', 'country_code' => 'required', 'sms_gateway' => 'required', 'delimiter' => 'required'\n ]);\n\n $redirect_url = 'user/sms/send-schedule-sms';\n } else {\n $v = \\Validator::make($request->all(), [\n 'message_type' => 'required', 'remove_duplicate' => 'required', 'country_code' => 'required', 'sms_gateway' => 'required', 'delimiter' => 'required'\n ]);\n\n $redirect_url = 'user/sms/send-sms';\n }\n\n if ($v->fails()) {\n return redirect($redirect_url)->withInput($request->all())->withErrors($v->errors());\n }\n\n\n $client = Client::find(Auth::guard('client')->user()->id);\n\n $sms_count = $client->sms_limit;\n $sender_id = $request->sender_id;\n $message = $request->message;\n $msg_type = $request->message_type;\n\n if (app_config('sender_id_verification') == '1') {\n if ($sender_id == null) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n\n if ($sender_id != '' && app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::all();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $all_ids = array_unique($all_ids);\n\n if (!in_array($sender_id, $all_ids)) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n $gateway = SMSGateways::find($request->sms_gateway);\n\n if ($gateway->status != 'Active') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n\n $gateway_credential = null;\n if ($gateway->custom == 'Yes') {\n if ($gateway->type == 'smpp') {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n } else {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n\n $keywords = $request->keyword;\n\n if ($keywords) {\n if ($gateway->two_way != 'Yes') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => 'SMS Gateway not supported Two way or Receiving feature',\n 'message_important' => true\n ]);\n }\n\n if (isset($keywords) && is_array($keywords)) {\n $keywords = implode(\"|\", $keywords);\n } else {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => 'Invalid keyword selection',\n 'message_important' => true\n ]);\n }\n }\n\n if ($msg_type != 'plain' && $msg_type != 'unicode' && $msg_type != 'voice' && $msg_type != 'mms' && $msg_type != 'arabic') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Invalid message type', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($msg_type == 'voice') {\n if ($gateway->voice != 'Yes') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported Voice feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n if ($msg_type == 'mms') {\n\n if ($gateway->mms != 'Yes') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported MMS feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $image = $request->image;\n\n if ($image == '') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('MMS file required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if (app_config('AppStage') != 'Demo') {\n if (isset($image) && in_array(strtolower($image->getClientOriginalExtension()), array(\"png\", \"jpeg\", \"gif\", 'jpg', 'mp3', 'mp4', '3gp', 'mpg', 'mpeg'))) {\n $destinationPath = public_path() . '/assets/mms_file/';\n $image_name = $image->getClientOriginalName();\n $image_name = str_replace(\" \", \"-\", $image_name);\n Input::file('image')->move($destinationPath, $image_name);\n $media_url = asset('assets/mms_file/' . $image_name);\n\n } else {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Upload .png or .jpeg or .jpg or .gif or .mp3 or .mp4 or .3gp or .mpg or .mpeg file', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n } else {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('MMS is disable in demo mode', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n $media_url = null;\n if ($message == '') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Message required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n\n $get_cost = 0;\n $total_cost = 0;\n $get_inactive_coverage = [];\n $results = [];\n\n if ($request->contact_type == 'phone_book') {\n if (isset($request->contact_list_id) && is_array($request->contact_list_id) && count($request->contact_list_id)) {\n $get_data = ContactList::whereIn('pid', $request->contact_list_id)->select('phone_number', 'email_address', 'user_name', 'company', 'first_name', 'last_name')->get()->toArray();\n foreach ($get_data as $data) {\n array_push($results, $data);\n }\n }\n }\n\n if ($request->contact_type == 'client_group') {\n $get_group = Client::whereIn('groupid', $request->client_group_id)->select('phone AS phone_number', 'email AS email_address', 'username AS user_name', 'company AS company', 'fname AS first_name', 'lname AS last_name')->get()->toArray();\n foreach ($get_group as $data) {\n array_push($results, $data);\n }\n }\n\n if ($request->recipients) {\n\n if ($request->delimiter == 'automatic') {\n $recipients = multi_explode(array(\",\", \"\\n\", \";\", \" \", \"|\"), $request->recipients);\n } elseif ($request->delimiter == ';') {\n $recipients = explode(';', $request->recipients);\n } elseif ($request->delimiter == ',') {\n $recipients = explode(',', $request->recipients);\n } elseif ($request->delimiter == '|') {\n $recipients = explode('|', $request->recipients);\n } elseif ($request->delimiter == 'tab') {\n $recipients = explode(' ', $request->recipients);\n } elseif ($request->delimiter == 'new_line') {\n $recipients = explode(\"\\n\", $request->recipients);\n } else {\n return redirect($redirect_url)->with([\n 'message' => 'Invalid delimiter',\n 'message_important' => true\n ]);\n }\n\n\n foreach ($recipients as $r) {\n\n $phone = str_replace(['(', ')', '+', '-', ' '], '', $r);\n if ($request->country_code != 0) {\n $phone = $request->country_code . ltrim($phone, '0');\n } else {\n $phone = ltrim($phone, '0');\n }\n\n if (validate_phone_number($phone)) {\n $data = [\n 'phone_number' => $phone,\n 'email_address' => null,\n 'user_name' => null,\n 'company' => null,\n 'first_name' => null,\n 'last_name' => null\n ];\n array_push($results, $data);\n }\n }\n }\n\n if (isset($results) && is_array($results)) {\n\n if (count($results) > 0) {\n $campaign_id = uniqid('C');\n\n if ($request->remove_duplicate == 'yes') {\n $results = unique_multidim_array($results, 'phone_number');\n }\n\n $filtered_data = [];\n $blacklist = BlackListContact::select('numbers')->where('user_id', Auth::guard('client')->user()->id)->get()->toArray();\n\n if ($blacklist && is_array($blacklist) && count($blacklist) > 0) {\n\n $blacklist = array_column($blacklist, 'numbers');\n\n array_filter($results, function ($element) use ($blacklist, &$filtered_data) {\n if (!in_array($element['phone_number'], $blacklist)) {\n array_push($filtered_data, $element);\n }\n });\n\n $results = array_values($filtered_data);\n unset($filtered_data);\n unset($blacklist);\n }\n\n if (count($results) <= 0) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Recipient empty', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $results = array_values($results);\n\n\n $spam_word = [];\n $block_message = [];\n $final_insert_data = [];\n\n if (app_config('fraud_detection') == 1) {\n $spam_word = SpamWord::all()->toArray();\n if (isset($spam_word) && is_array($spam_word) && count($spam_word) > 0) {\n $spam_word = array_column($spam_word, 'word');\n }\n }\n\n if ($request->send_later == 'on') {\n\n if ($request->schedule_time == '') {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Schedule time required'),\n 'message_important' => true\n ]);\n }\n\n $schedule_time = date('Y-m-d H:i:s', strtotime($request->schedule_time));\n\n if (new \\DateTime() > new \\DateTime($schedule_time)) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => 'Select a valid time',\n 'message_important' => true\n ]);\n }\n\n $campaign_type = 'scheduled';\n $campaign_status = 'Scheduled';\n $subscription_status = 'scheduled';\n $block_message_schedule = date('Y-m-d H:i:s', strtotime($request->schedule_time));\n } else {\n $schedule_time = date('Y-m-d H:i:s');\n $campaign_type = 'regular';\n $campaign_status = 'Running';\n $block_message_schedule = null;\n $subscription_status = 'queued';\n }\n\n foreach (array_chunk($results, 50) as $chunk_result) {\n foreach ($chunk_result as $r) {\n $msg_data = array(\n 'Phone Number' => $r['phone_number'],\n 'Email Address' => $r['email_address'],\n 'User Name' => $r['user_name'],\n 'Company' => $r['company'],\n 'First Name' => $r['first_name'],\n 'Last Name' => $r['last_name'],\n );\n\n\n $get_message = $this->renderSMS($message, $msg_data);\n\n if ($msg_type == 'plain' || $msg_type == 'voice' || $msg_type == 'mms') {\n $msgcount = strlen(preg_replace('/\\s+/', ' ', trim($get_message)));\n if ($msgcount <= 160) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 157;\n }\n }\n if ($msg_type == 'unicode' || $msg_type == 'arabic') {\n $msgcount = mb_strlen(preg_replace('/\\s+/', ' ', trim($get_message)), 'UTF-8');\n\n if ($msgcount <= 70) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 67;\n }\n }\n\n $msgcount = ceil($msgcount);\n\n $phone = str_replace(['(', ')', '+', '-', ' '], '', $r['phone_number']);\n\n if ($request->country_code == 0) {\n if ($gateway->settings == 'FortDigital') {\n $c_phone = 61;\n } else {\n $c_phone = PhoneNumber::get_code($phone);\n }\n } else {\n $c_phone = $request->country_code;\n }\n\n $sms_cost = IntCountryCodes::where('country_code', $c_phone)->where('active', '1')->first();\n if ($sms_cost) {\n\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberObject = $phoneUtil->parse('+' . $phone, null);\n $area_code_exist = $phoneUtil->getLengthOfGeographicalAreaCode($phoneNumberObject);\n\n if ($area_code_exist) {\n $format = $phoneUtil->format($phoneNumberObject, PhoneNumberFormat::INTERNATIONAL);\n $get_format_data = explode(\" \", $format);\n $operator_settings = explode('-', $get_format_data[1])[0];\n\n } else {\n $carrierMapper = PhoneNumberToCarrierMapper::getInstance();\n $operator_settings = $carrierMapper->getNameForNumber($phoneNumberObject, 'en');\n }\n\n $get_operator = Operator::where('operator_setting', $operator_settings)->where('coverage_id', $sms_cost->id)->first();\n if ($get_operator) {\n\n $sms_charge = $get_operator->plain_price;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $get_operator->plain_price;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $get_operator->voice_price;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $get_operator->mms_price;\n }\n\n $get_cost += $sms_charge;\n } else {\n $sms_charge = $sms_cost->plain_tariff;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $sms_cost->plain_tariff;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $sms_cost->voice_tariff;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $sms_cost->voice_tariff;\n }\n\n $get_cost += $sms_charge;\n }\n } else {\n array_push($get_inactive_coverage, $phone);\n continue;\n }\n\n $total_cost = $get_cost * $msgcount;\n\n if ($total_cost == 0) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($total_cost > $sms_count) {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n\n if (isset($spam_word) && is_array($spam_word) && count($spam_word) > 0) {\n\n $check = array_filter($spam_word, function ($word) use ($get_message) {\n if (strpos($get_message, $word)) {\n return true;\n }\n return false;\n });\n\n if (isset($check) && is_array($check) && count($check) > 0) {\n array_push($block_message, [\n 'user_id' => Auth::guard('client')->user()->id,\n 'sender' => $sender_id,\n 'campaign_id' => $campaign_id,\n 'receiver' => $phone,\n 'message' => $get_message,\n 'scheduled_time' => $block_message_schedule,\n 'use_gateway' => $gateway->id,\n 'status' => 'block',\n 'type' => $msg_type,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]);\n\n continue;\n }\n }\n\n $push_data = [\n 'campaign_id' => $campaign_id,\n 'number' => $phone,\n 'message' => $get_message,\n 'amount' => $msgcount,\n 'status' => $subscription_status\n ];\n\n if ($campaign_type == 'scheduled') {\n $push_data['submitted_time'] = $schedule_time;\n }\n\n array_push($final_insert_data, $push_data);\n }\n }\n\n if (isset($final_insert_data) && is_array($final_insert_data) && count($final_insert_data) > 0) {\n\n $campaign = Campaigns::create([\n 'campaign_id' => $campaign_id,\n 'user_id' => Auth::guard('client')->user()->id,\n 'sender' => $sender_id,\n 'sms_type' => $msg_type,\n 'camp_type' => $campaign_type,\n 'status' => $campaign_status,\n 'use_gateway' => $gateway->id,\n 'total_recipient' => count($results),\n 'run_at' => date('Y-m-d H:i:s'),\n 'media_url' => $media_url,\n 'keyword' => $keywords\n ]);\n\n\n if ($campaign) {\n\n if (app_config('fraud_detection') == 1) {\n if (isset($block_message) && is_array($block_message) && count($block_message) > 0) {\n\n $store_block_message = BlockMessage::insert($block_message);\n if ($store_block_message) {\n\n $sysUrl = url('clients/view/' . Auth::guard('client')->user()->id);\n $user_name = Auth::guard('client')->user()->username;\n $client_email = Auth::guard('client')->user()->email;\n $spam_message = 'Message contain spam word';\n\n \\Mail::to(app_config('Email'))->send(new \\App\\Mail\\BlockMessage($user_name, $client_email, $spam_message, $sysUrl));\n\n }\n }\n }\n\n $campaign_list = CampaignSubscriptionList::insert($final_insert_data);\n\n if ($campaign_list) {\n\n $remain_sms = $sms_count - $total_cost;\n $client->sms_limit = $remain_sms;\n $client->save();\n\n if (isset($get_inactive_coverage) && is_array($get_inactive_coverage) && count($get_inactive_coverage) > 0) {\n $inactive_phone = implode('; ', $get_inactive_coverage);\n return redirect($redirect_url)->with([\n 'message' => 'This phone number(s) ' . $inactive_phone . ' not send for inactive coverage issue'\n ]);\n }\n\n return redirect($redirect_url)->with([\n 'message' => language_data('SMS added in queue and will deliver one by one', Auth::guard('client')->user()->lan_id)\n ]);\n }\n\n $campaign->delete();\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Something went wrong please try again'),\n 'message_important' => true\n ]);\n }\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Something went wrong please try again'),\n 'message_important' => true\n ]);\n }\n\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Recipient empty', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n\n } else {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Recipient empty', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n return redirect($redirect_url)->withInput($request->all())->with([\n 'message' => language_data('Invalid Recipients', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n }", "public function send_enquiry_sms() {\n\t\t// Get user data.\n\t\t$this->db->select('contact');\n\t\t$this->db->from('admin');\n\t\t$ObjUser = $this->db->get()->row();\n\t\t// Get Enquiry date,time,details and sms count.\n\t\t$this->db->select('enq_date,enq_time,details,sms_count');\n\t\t$this->db->from('customer_enquiries_tbl');\n\t\t$this->db->where('sms_notify',1);\n\t\t$this->db->where('isdelete',0);\n\t\t$ArrEnqSms = $this->db->get()->result_array();\n\t\tif (isset($ArrEnqSms) && !empty($ArrEnqSms)) {\n\t\t\tforeach ($ArrEnqSms as $value) {\n\t\t\t\t$a \t\t= explode('-',$value['enq_date']);\n\t\t\t\t$day \t= date('d');\n\t\t\t\t$month \t= date('m');\n\t\t\t\t// match today's date with DB stored date.\n\t\t\t\tif ($day == $a[0] && $month == $a[1]) { \n\t\t\t\t\t\t// match current time with DB stored\n\t\t\t\t\tif (date('h:i A',$value['enq_time']) == date('h:i A')) { \n\t\t\t\t\t\t$nos = explode(' ', $ObjUser->contact);\n\t\t\t\t\t\t$sent_date = date('d-m-Y');\n\t\t\t\t\t\t$time = strtotime(date('h:i:s'));\n\t\t\t\t\t\t$user = \"chlorodots\"; \n\t\t\t\t\t\t$api_key = \"70651465-1dfb-4f53-9d5b-6b8786ff073e\"; \n\t\t\t\t\t\t$baseurl = \"http://sms.hspsms.com\";\n\t\t\t\t\t\t$message = urlencode($value['details']);\n\t\t\t\t\t\t$to = $ObjUser->contact;\n\t\t\t\t\t\t$sender = \"CHLORO\";\n\t\t\t\t\t\t$url = \"$baseurl/sendSMS?username=$user&message=$message&sendername=$sender&smstype=TRANS&numbers=$to&apikey=$api_key\"; \n\t\t\t\t\t\t// Send SMS \n\t\t\t\t\t\t$ret = file_get_contents($url); \n\t\t\t\t\t\tif(isset($ret) && !empty($ret)) {\n\t\t\t\t\t\t\tforeach ($nos as $row) {\n\t\t\t\t\t\t\t\t$data =\tarray('sms_recepients'=>$row,'no_of_sms'=>$value['sms_count'],'sms_body'=>$value['details'],'time'=>$time,'sms_sent_date'=>$sent_date);\n\t\t\t\t\t\t\t\t\t// store sent sms record in DB.\n\t\t\t\t\t\t\t\t$this->db->insert('sent_sms_data',$data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo 'SMS not sent.';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo 'time not matched'.'<br/>';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo 'date not match';\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new productReferenceID In an Add/Revise/Relist call, this field is used to pass in the eBay Product ID (e.g. ePID), which is the unique identifier of an eBay catalog product. Although an eBay catalog product match can be found using one or more GTIN values, passing in an ePID value is the best way to try and discover the appropriate eBay catalog product. This field is also returned in GetItem if the listing is associated with a eBay catalog product.
public function setProductReferenceID($productReferenceID) { $this->productReferenceID = $productReferenceID; return $this; }
[ "public function getProductReferenceID()\n {\n return $this->productReferenceID;\n }", "function set_reference_id($theReferenceId) {\n\t\t$this->myReferenceId = $theReferenceId;\n\t}", "public function updateReferenceID( $referenceID );", "public function set_product_id($val)\n {\n $this->_product_id = (int)$val;\n }", "public function setProductReference($value)\n {\n return $this->setParameter('productReference', $value);\n }", "function setProduct( &$value )\r\n {\r\n if ( is_a ( $value, \"eZProduct\" ) )\r\n $this->ProductID = $value->id();\r\n else\r\n $this->ProductID = $value;\r\n }", "public function setReferenceId(?string $referenceId): void\n {\n $this->referenceId['value'] = $referenceId;\n }", "public function setIdProduct($idProduct){\n \t$this->idProduct = $idProduct;\n }", "public function setProductId($product_id){\n $this->product_id = $product_id;\n }", "protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}", "function setRefId($a_refid)\n\t{\n\t\t$this->refid = $a_refid;\n\t}", "public function setProductReferenceType($product_reference_type)\n {\n $this->product_reference_type = $product_reference_type;\n }", "public function setReferenceId(?string $referenceId): void\n {\n $this->referenceId = $referenceId;\n }", "public function setProductIds($productIds) {\n $this->productIds = $productIds;\n $this->getDataProvider()->setParam('ids', implode(';',$this->productIds));\n $this->attributesUpToDate = false;\n $this->recordsUpToDate = false;\n }", "public function getProductReference()\n {\n return $this->product_reference->getValue();\n }", "public function setReferenceContext(ReferenceContext $context);", "public function setProductIds($productIds) {\n\t\t$this->productIds = $productIds;\n\t\t$this->getDataProvider()->setArrayParam('id', $productIds);\n\t\t$this->recommendationUpToDate = false;\n\t}", "public function setSellerProductReference(?string $sellerProductReference = null): self\n {\n // validation for constraint: string\n if (!is_null($sellerProductReference) && !is_string($sellerProductReference)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerProductReference, true), gettype($sellerProductReference)), __LINE__);\n }\n if (is_null($sellerProductReference) || (is_array($sellerProductReference) && empty($sellerProductReference))) {\n unset($this->SellerProductReference);\n } else {\n $this->SellerProductReference = $sellerProductReference;\n }\n \n return $this;\n }", "function ciniki_merchandise_productAddObjRef(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'product_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Product'),\n 'object'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Object'),\n 'object_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Object ID'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'merchandise', 'private', 'checkAccess');\n $rc = ciniki_merchandise_checkAccess($ciniki, $args['tnid'], 'ciniki.merchandise.productAddObjRef');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check to make sure the product exists\n //\n $strsql = \"SELECT id, code, permalink \"\n . \"FROM ciniki_merchandise \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['product_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['item']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.14', 'msg'=>'Unable to find product.'));\n }\n\n //\n // Check to make sure the object ref does not already exist\n //\n $strsql = \"SELECT id \"\n . \"FROM ciniki_merchandise_objrefs \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND product_id = '\" . ciniki_core_dbQuote($ciniki, $args['product_id']) . \"' \"\n . \"AND object = '\" . ciniki_core_dbQuote($ciniki, $args['object']) . \"' \"\n . \"AND object_id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['item']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.15', 'msg'=>'This product already exists.'));\n }\n\n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.merchandise');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // If the object is specified\n //\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.merchandise.objref', array(\n 'product_id'=>$args['product_id'],\n 'object'=>$args['object'],\n 'object_id'=>$args['object_id'],\n 'sequence'=>1), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.merchandise');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.merchandise');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'merchandise');\n\n return array('stat'=>'ok');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new spy verifier for a global function and declare it in the specified namespace.
public function createGlobal( string $function, string $namespace ): SpyVerifier { if (false !== strpos($function, '\\')) { throw new InvalidArgumentException( 'Only functions in the global namespace are supported.' ); } $namespace = trim($namespace, '\\'); if (!$namespace) { throw new InvalidArgumentException( 'The supplied namespace must not be empty.' ); } $spy = $this->spyFactory->create($function); $this->functionHookManager->defineFunction($function, $namespace, $spy); return new SpyVerifier( $spy, $this->matcherFactory, $this->matcherVerifier, $this->generatorVerifierFactory, $this->iterableVerifierFactory, $this->callVerifierFactory, $this->assertionRecorder, $this->assertionRenderer ); }
[ "function spyGlobal(string $function, string $namespace): SpyVerifier\n{\n return Globals::$container->spyVerifierFactory\n ->createGlobal($function, $namespace);\n}", "public static function spy()\n {\n }", "public static function get_spy_for( $function_name ) {\n\t\t$spy = GlobalSpies::get_global_spy( $function_name );\n\t\tif ( isset( $spy ) ) {\n\t\t\treturn $spy;\n\t\t}\n\t\treturn GlobalSpies::create_global_spy( $function_name );\n\t}", "public function allow_replacing_a_non_defined_namespaced_function()\n {\n $f = 'Some\\Name\\Space\\func' . uniqid(rand(1, 9999));\n\n $spy = FunctionMocker::replace($f, 2324);\n\n $this->assertTrue(function_exists($f));\n $this->assertEquals(2324, $f());\n $spy->wasCalledOnce();\n }", "public function allow_replacing_a_non_defined_non_namespaced_function()\n {\n $f = 'func' . uniqid(rand(1, 9999));\n\n $spy = FunctionMocker::replace($f, 2324);\n\n $this->assertTrue(function_exists($f));\n $this->assertEquals(2324,$f());\n $spy->wasCalledOnce();\n }", "function testSenseiGlobalAccessFunction(){\n\n // make sure the function is loaded\n $this->assertTrue( function_exists( 'Sensei' ), \"The global Sensei() function does not exist.\");\n\n // make sure it return an instance of class WooThemes_Sensei\n $this->assertTrue( 'WooThemes_Sensei' == get_class( Sensei() ),\n 'The Sensei() function does not return an instance of class WooThemes_Sensei' );\n\n }", "static function setGlobalNamespace($namespace)\r\n {\r\n $GLOBALS[\"mxRNs\"] = $namespace;\r\n }", "function restoreGlobalFunctions()\n{\n return SimpletestFacadeDriver::instance()->functionHookManager\n ->restoreGlobalFunctions();\n}", "public function testCreateGLClosure()\n {\n }", "public function inNamespace () {}", "public function inNamespace(){}", "public function testReflectFunction2()\n {\n $reflection = Zend_Server_Reflection::reflectFunction('Zend_Server_Reflection_testFunction', false, 'zsr');\n $this->assertEquals('zsr', $reflection->getNamespace());\n }", "static function unittest_namespaceContext () {\n PhlintTest::assertNoIssues('\n namespace a {\n $x = 1;\n }\n namespace b {\n $y = $x;\n }\n ');\n }", "public function testReflectFunction2()\n {\n $reflection = Reflection::reflectFunction('ZendTest\\Server\\TestAsset\\reflectionTestFunction', false, 'zsr');\n $this->assertEquals('zsr', $reflection->getNamespace());\n }", "function functionRegister($short_name,$ns_called_from=false,$namespaced_function=false)\n{\n static $functions=[];\n if(!$namespaced_function) {\n return functionRegisterGet($functions, $short_name,$ns_called_from);\n // return $functions[$short_name][$ns_called_from];\n }\n return functionRegisterSet($functions,$short_name,$ns_called_from,$namespaced_function);\n // echo \"Registering `$short_name` as `$namespaced_function`\n // for calls from `$ns_called_from`\",\"\\n\";\n\n}", "public function testFunction();", "public function testReplaceNamespaceFinalize()\n {\n }", "public function testGlobalMethods()\n {\n $app = new GlobalMethodAppMock();\n\n $m = new GlobalMethodObjectMock();\n $m->app = $app;\n\n $m2 = new GlobalMethodObjectMock();\n $m2->app = $app;\n\n $m->addGlobalMethod('sum', function ($m, $obj, $a, $b) {\n return $a + $b;\n });\n $this->assertEquals(true, $m->hasGlobalMethod('sum'));\n\n $res = $m2->sum(3, 5);\n $this->assertEquals(8, $res);\n\n $m->removeGlobalMethod('sum');\n $this->assertEquals(false, $m2->hasGlobalMethod('sum'));\n }", "protected function makeDetector(): NamespaceDetectorInterface\n {\n return new NamespaceDetector();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
tim USCLN cua 2 so
function USCLN($a, $b) { //neu phan so am thi doi dau cua tu so if ($a < 0) $a = (-1) * $a; $sonho = ($a < $b) ? $a : $b; for ($i = $sonho; $i > 0; $i--) if (($a % $i) == 0 && ($b % $i) == 0) { //return $i; break; } return $i; }
[ "function mPN_CHARS(){\n try {\n // Tokenizer11.g:557:3: ( PN_CHARS_U | MINUS | ( '0' .. '9' ) | '\\\\u00B7' | '\\\\u0300' .. '\\\\u036F' | '\\\\u203F' .. '\\\\u2040' ) \n $alt29=6;\n $LA29_0 = $this->input->LA(1);\n\n if ( ($LA29_0==$this->getToken('95')||($LA29_0>=$this->getToken('97') && $LA29_0<=$this->getToken('122'))||($LA29_0>=$this->getToken('192') && $LA29_0<=$this->getToken('214'))||($LA29_0>=$this->getToken('216') && $LA29_0<=$this->getToken('246'))||($LA29_0>=$this->getToken('248') && $LA29_0<=$this->getToken('767'))||($LA29_0>=$this->getToken('880') && $LA29_0<=$this->getToken('893'))||($LA29_0>=$this->getToken('895') && $LA29_0<=$this->getToken('8191'))||($LA29_0>=$this->getToken('8204') && $LA29_0<=$this->getToken('8205'))||($LA29_0>=$this->getToken('8304') && $LA29_0<=$this->getToken('8591'))||($LA29_0>=$this->getToken('11264') && $LA29_0<=$this->getToken('12271'))||($LA29_0>=$this->getToken('12289') && $LA29_0<=$this->getToken('55295'))||($LA29_0>=$this->getToken('63744') && $LA29_0<=$this->getToken('64975'))||($LA29_0>=$this->getToken('65008') && $LA29_0<=$this->getToken('65533'))) ) {\n $alt29=1;\n }\n else if ( ($LA29_0==$this->getToken('45')) ) {\n $alt29=2;\n }\n else if ( (($LA29_0>=$this->getToken('48') && $LA29_0<=$this->getToken('57'))) ) {\n $alt29=3;\n }\n else if ( ($LA29_0==$this->getToken('183')) ) {\n $alt29=4;\n }\n else if ( (($LA29_0>=$this->getToken('768') && $LA29_0<=$this->getToken('879'))) ) {\n $alt29=5;\n }\n else if ( (($LA29_0>=$this->getToken('8255') && $LA29_0<=$this->getToken('8256'))) ) {\n $alt29=6;\n }\n else {\n $nvae = new NoViableAltException(\"\", 29, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt29) {\n case 1 :\n // Tokenizer11.g:558:3: PN_CHARS_U \n {\n $this->mPN_CHARS_U(); \n\n }\n break;\n case 2 :\n // Tokenizer11.g:559:5: MINUS \n {\n $this->mMINUS(); \n\n }\n break;\n case 3 :\n // Tokenizer11.g:560:5: ( '0' .. '9' ) \n {\n // Tokenizer11.g:560:5: ( '0' .. '9' ) \n // Tokenizer11.g:560:6: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n\n }\n break;\n case 4 :\n // Tokenizer11.g:561:5: '\\\\u00B7' \n {\n $this->matchChar(183); \n\n }\n break;\n case 5 :\n // Tokenizer11.g:562:5: '\\\\u0300' .. '\\\\u036F' \n {\n $this->matchRange(768,879); \n\n }\n break;\n case 6 :\n // Tokenizer11.g:563:5: '\\\\u203F' .. '\\\\u2040' \n {\n $this->matchRange(8255,8256); \n\n }\n break;\n\n }\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function convertToC($t) {\r\n return ($t - 32) * 5 / 9;\r\n }", "public static function tc2ms($_timecode);", "function _numatri(){\n\n\t\t$numero = $this->datasis->prox_numero('ncodcli');\n\t\t$residuo= $numero;\n\t\t$mbase = 36;\n\t\t$conve='';\n\t\twhile($residuo > $mbase-1){\n\t\t\t$mtempo = $residuo % $mbase;\n\t\t\t$residuo = intval($residuo/$mbase);\n\t\t\tif($mtempo >9 ){\n\t\t\t\t$conve .= chr($mtempo+55);\n\t\t\t}else{\n\t\t\t\t$conve .= $mtempo;\n\t\t\t}\n\t\t}\n\t\tif($mtempo >9 ){\n\t\t\t$conve .= chr($mtempo+55);\n\t\t}else{\n\t\t\t$conve .= $mtempo;\n\t\t}\n\t\treturn $conve;\n\t}", "public static function tc2ms(string $_timecode): int\n {\n return 0;\n }", "function IMuPort()\n {\n\n return 40082;\n }", "function cislo_z_rc($rc)\n{\n if(!(is_numeric($rc[2]))) // konverzia prvych styroch typov na cislo\n {\n $rcislo = $rc[0].$rc[1].$rc[3].$rc[4].$rc[6].$rc[7].$rc[9].$rc[10].$rc[11];\n if(strlen($rc)>12) $rcislo=$rcislo.$rc[12];\n return $rcislo; break;\n }\n elseif(!(is_numeric($rc[6]))) // konverzia typov 4 a 5\n { $rcislo = $rc[0].$rc[1].$rc[2].$rc[3].$rc[4].$rc[5].$rc[7].$rc[8].$rc[9];\n if(strlen($rc)>10) $rcislo=$rcislo.$rc[10];\n\n return $rcislo; break;\n }\n else return $rc; // ak vstupil typ 6 vrat to iste\n}", "function arabic2chinese($num){\n $chFgr = ''; //The unsigned chinese figure converted by this method\n $sign = ''; //The sign of chinese figure\n $intPart = '';\n $decPart = '';\n // This class does not validate the number given , but converts it into a string directly\n $num = strval($num);\n // Get the sign\n if (substr($num, 0, 1) == '-'){\n $sign = '負';\n $num = substr($num, 1);\n }\n // Split a floating number into two parts , integer part and decimal part\n $numInfo = explode(\".\", $num);\n $intPart = $numInfo[0];\n $decPart = $numInfo[1];\n // Transform the integer part\n $tmp = $intPart;\n $flagBigUnit = -1; //Indicate which big unit is going to be used\n while (strlen($tmp)){\n $seg = substr($tmp, - (strlen($tmp) <4 ? strlen($tmp): 4)); //Get a new segment from the end to the begining\n $chSeg = $this -> _parseSeg($seg);\n $chSegWithBigUnit = $chSeg . (strlen($chSeg) == 0 ? '' : $this -> chBigUnit[$flagBigUnit]); \n//Deside which big unit is to be used here\n $withZero = false; \n//Deside whether a chinese figure 0 should be added by the end of the segment that was just transformed\n if (substr($seg, -1) == '0' && strlen($chFgr) != 0 && substr($chFgr, 0, 2) != '零'){\n $withZero = true;\n }\n $chFgr = $chSegWithBigUnit . ($withZero ? '零' : '') . $chFgr;\n $flagBigUnit = $flagBigUnit == -1 ? 0 : ($flagBigUnit == 0 ? 1 : 0); \n//Switch between the two big units\n $tmp = substr($tmp, 0, - (strlen($tmp) <4 ? strlen($tmp) : 4)); \n//Truncate the integer part\n }\n // In case that the integer part is zero\n if (strlen($chFgr) == 0){\n $chFgr = '零';\n }\n // Transform the decimal part\n if (strlen($decPart)> 0){\n $chFgr .= '點';\n for($i = 0;$i <strlen($decPart);$i++){\n $chFgr .= $this -> chFigure[$decPart[$i]];\n }\n }\n\n return $sign . $chFgr;\n }", "public static function micro_id() {\n\t $str = explode(' ', microtime(false));\n $str = $str[1] . $str[0];\n $str = preg_replace('/\\D/', '', $str);\n\t return $str;\n\t}", "function b60to10($s)\n{\n $n = 0;\n for($i = 0; $i < strlen($s); $i++) // iterate from first to last char of $s\n {\n $c = ord($s[$i]); // put current ASCII of char into $c\n if ($c>=48 && $c<=57) { $c=$c-48; }\n else if ($c>=65 && $c<=72) { $c-=55; }\n else if ($c==73 || $c==108) { $c=1; } // typo capital I, lowercase l to 1\n else if ($c>=74 && $c<=78) { $c-=56; }\n else if ($c==79) { $c=0; } // error correct typo capital O to 0\n else if ($c>=80 && $c<=90) { $c-=57; }\n else if ($c==95) { $c=34; } // underscore\n else if ($c>=97 && $c<=107) { $c-=62; }\n else if ($c>=109 && $c<=122) { $c-=63; }\n else { $c = 0; } // treat all other noise as 0\n $n = (60 * $n) + $c;\n }\n return $n;\n}", "function __getDigitoVerificador($lcBloque) {\n\t\t$Pond = 9713;\n\t\t$lnSuma = 0;\n\t\t$lnLargo = strlen($lcBloque);\n\t\t$j=3;\n\t\tfor($i=1;$i<=$lnLargo;$i++){\n\t\t\t$lnSuma = $lnSuma + (substr($lcBloque, $lnLargo - $i, 1)) * (substr($Pond, $j, 1));\n\t\t\tif ($j==0) {\n\t\t\t\t$j=3;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$j--;\n\t\t\t}\n\t\t}\n\t\treturn ((10 - ($lnSuma%10))%10);\n\t}", "public function getDigicode2();", "function hum2str(&$nybs, $startn)\n{\n return bcd2int($nybs, $startn, 2);\n}", "function slm($input)\n{\n\t/* \n\t\tThis returns an array of lines with a built text banner which uses \".\"\n\t\t for 'transparent' blocks, and letters for coloured blocks (a=0, b=1, c=2 ...)\n\t\t The output from this function can then be fed to another function for\n\t\t conversion to IRC character codes, or conversion to HTML, etc.\n\t*/\n\n\tglobal $multicolour, $rainbow, $shadow, $dimensions, $allcolours, $upsidedown;\n\tglobal $widthmult, $heightmult, $background, $foreground, $greys, $greycolours;\n\tglobal $colours, $shadows, $shadowwidth, $brightcolours, $rainbowcolours;\n\tglobal $fliphoriz, $darkcolours, $darkonly, $darkrainbowcolours;\n\n\t// Define character set:\n\n\t$characters = array(\n\t\t\t\t\" \" => \"......,......,......,......,......\",\n\t\t\t\t\"!\" => \"#,#,#,.,#\",\n\t\t\t\t\"\\\"\" => \"#..#,....,....,....,....\",\n\t\t\t\t\"#\" => \".#..#.,######,.#..#.,######,.#..#.\",\n\t\t\t\t\"$\" => \".#####,#.##..,.####.,..##.#,#####.\",\n\t\t\t\t\"%\" => \"#...#,...#.,..#..,.#...,#...#\",\n\t\t\t\t\"&\" => \".###..,#...#.,.###..,#...##,.#####\",\n\t\t\t\t\"'\" => \"#,.,.,.,.\",\n\t\t\t\t\"(\" => \".#,#.,#.,#.,.#\",\n\t\t\t\t\")\" => \"#.,.#,.#,.#,#.\",\n\t\t\t\t\"*\" => \"#.#.#,.###.,#####,.###.,#.#.#\",\n\t\t\t\t\"+\" => \"...,.#.,###,.#.,...\",\n\t\t\t\t\",\" => \"..,..,..,.#,#.\",\n\t\t\t\t\"-\" => \"....,....,####,....,....\",\n\t\t\t\t\".\" => \".,.,.,.,#\",\n\t\t\t\t\"/\" => \"....#,...#.,..#..,.#...,#....\",\n\t\t\t\t\"0\" => \".###.,##.##,##.##,##.##,.###.\",\n\t\t\t\t\"1\" => \".##.,###.,.##.,.##.,####\",\n\t\t\t\t\"2\" => \".####.,#...##,..###.,.##...,######\",\n\t\t\t\t\"3\" => \"#####.,...###,.####.,...###,#####.\",\n\t\t\t\t\"4\" => \"..###.,.#.##.,#..##.,######,...##.\",\n\t\t\t\t\"5\" => \"######,##....,#####.,....##,#####.\",\n\t\t\t\t\"6\" => \".####.,##....,#####.,##..##,.####.\",\n\t\t\t\t\"7\" => \"######,....##,...##.,..##..,.##...\",\n\t\t\t\t\"8\" => \".####.,##..##,.####.,##..##,.####.\",\n\t\t\t\t\"9\" => \".####.,##..##,.#####,....##,.####.\",\n\t\t\t\t\":\" => \".,#,.,#,.\",\n\t\t\t\t\";\" => \"..,.#,..,.#,#.\",\n\t\t\t\t\"<\" => \"..#,.#.,#..,.#.,..#\",\n\t\t\t\t\"=\" => \"....,####,....,####,....\",\n\t\t\t\t\">\" => \"#..,.#.,..#,.#.,#..\",\n\t\t\t\t\"?\" => \".####.,#....#,..###.,......,..#...\",\n\t\t\t\t\"@\" => \".#####,#.###.,#.#..#,#..#.#,.####.\",\n\t\t\t\t\"A\" => \".####.,##..##,######,##..##,##..##\",\n\t\t\t\t\"B\" => \"#####.,##..##,#####.,##..##,#####.\",\n\t\t\t\t\"C\" => \".#####,##....,##....,##....,.#####\",\n\t\t\t\t\"D\" => \"#####.,##..##,##..##,##..##,#####.\",\n\t\t\t\t\"E\" => \"######,##....,######,##....,######\",\n\t\t\t\t\"F\" => \"######,##....,######,##....,##....\",\n\t\t\t\t\"G\" => \".#####,##....,##.###,##..##,.#####\",\n\t\t\t\t\"H\" => \"##..##,##..##,######,##..##,##..##\",\n\t\t\t\t\"I\" => \"######,..##..,..##..,..##..,######\",\n\t\t\t\t\"J\" => \".######,...##..,...##..,##.##..,.###...\",\n\t\t\t\t\"K\" => \"##..##,##.##.,####..,##.##.,##..##\",\n\t\t\t\t\"L\" => \"##....,##....,##....,##....,######\",\n\t\t\t\t\"M\" => \"##....##,###..###,##.##.##,##....##,##....##\",\n\t\t\t\t\"N\" => \"###...##,####..##,##.##.##,##..####,##...###\",\n\t\t\t\t\"O\" => \".#####.,##...##,##...##,##...##,.#####.\",\n\t\t\t\t\"P\" => \"#####.,##..##,#####.,##....,##....\",\n\t\t\t\t\"Q\" => \".####.,##..##,##..##,##.###,.#####\",\n\t\t\t\t\"R\" => \"#####.,##..##,#####.,##..##,##..##\",\n\t\t\t\t\"S\" => \".#####,##....,.####.,....##,#####.\",\n\t\t\t\t\"T\" => \"######,..##..,..##..,..##..,..##..\",\n\t\t\t\t\"U\" => \"##..##,##..##,##..##,##..##,.####.\",\n\t\t\t\t\"V\" => \"##....##,##....##,.##..##.,.##..##.,...##...\",\n\t\t\t\t\"W\" => \"##....##,##....##,##.##.##,###..###,##....##\",\n\t\t\t\t\"X\" => \"##...##,.##.##.,..###..,.##.##.,##...##\",\n\t\t\t\t\"Y\" => \"##..##,##..##,.####.,..##..,..##..\",\n\t\t\t\t\"Z\" => \"######,...##.,..##..,.##...,######\",\n\t\t\t\t\"[\" => \"##,#.,#.,#.,##\",\n\t\t\t\t\"\\\\\" => \"#....,.#...,..#..,...#.,....#\",\n\t\t\t\t\"]\" => \"##,.#,.#,.#,##\",\n\t\t\t\t\"^\" => \".#.,#.#,...,...,...\",\n\t\t\t\t\"_\" => \"......,......,......,......,######\",\n\t\t\t\t\"`\" => \"#.,.#,..,..,..\",\n\t\t\t\t\"{\" => \"..#,.#.,##.,.#.,..#\",\n\t\t\t\t\"|\" => \"#,#,#,#,#\",\n\t\t\t\t\"}\" => \"#..,.#.,.##,.#.,#..\",\n\t\t\t\t\"~\" => \".....,.#...,#.#.#,...#.,.....\",\n\t\t\t\t\"£\" => \"..###.,.#...#,####..,.#....,######\",\n\t\t\t\t\"¬\" => \"......,......,######,.....#,......\"\n\t\t\t);\n\n\n\t// Load the above charset into a 2D array:\n\t$maxlines=0;\n\tforeach ( $characters as $key=>$value )\n\t{\n\t\t// Split character into second dimension by comma:\n\t\t$charset[$key] = explode(\",\", $value);\n\n\t\t// Update maximum possible height of this charset:\n\t\tif( count($charset[$key]) > $maxlines ) $maxlines = count($charset[$key]);\n\t}\n\n\n\t// Place input characters into an array e.g. == array(\"H\",\"E\",\"L\",\"L\",\"O\"):\n\t$letters = str_split(strtoupper($input));\n\n\t// If there's a shadow it will require additional rows:\n\tif ( $shadow ) $maxlines += $shadowwidth;\n\n\t// Init some colour-related variables:\n\t$lastcolour = 0; $bow = 0; $grey = 0;\n\n\t// Cycle through our input string and add each letter:\n\tforeach ( $letters as $letter )\n\t{\n\n\t\t// ------------ Begin colour selection ------------ //\n\n\t\tif ( $multicolour )\n\t\t{\n\t\t\t// Pick a random colour from colours which is different to the last one\n\t\t\t$colour = newcolour($lastcolour);\n\t\t\t$lastcolour = $colour;\n\t\t}\n\n\t\tif ( $rainbow )\n\t\t{\n\t\t\t// Cycle through rainbow colours\n\t\t\t$colour = ($darkonly && $rainbow)? $darkrainbowcolours[$bow] : $rainbowcolours[$bow];\n\n\t\t\t$bow++;\n\t\t\tif ( $bow >= count($rainbowcolours) ) $bow = 0;\n\t\t}\n\n\t\tif ( $greys )\n\t\t{\n\t\t\t// Cycle through grey colours\n\t\t\t$colour = $greycolours[$grey];\n\t\t\t$grey++;\n\t\t\tif ( $colour == 0 && $background == 0 ) $colour = 1;\t// If bg && colour are white use black instead\n\t\t\tif ( $grey >= count($greycolours) ) $grey = 0;\n\t\t}\n\n\t\tif ( !$multicolour && !$rainbow && !$greys )\n\t\t{\n\t\t\t// Use a single foreground colour\n\t\t\t$colour = $foreground;\n\t\t}\n\n\t\t// ------------ End of colour selection ------------ //\n\n\n\t\t// Build up the letters:\n\t\tfor ( $n=0; $n < $maxlines; $n++ )\n\t\t{\n\t\t\tif ( $n < count($charset[$letter]) )\n\t\t\t{\n\t\t\t\t// Add part of letter to total\n\t\t\t\t\n\t\t\t\t// Current row of current character e.g.\"##..##\"\n\t\t\t\t$letterline = $charset[$letter][$n];\n\n\t\t\t\t// Apply selected colour:\n\t\t\t\t$letterline = str_replace(\"#\", chr($colour + 97), $letterline);\n\n\t\t\t\tif ( !isset($total[$n]) ) $total[$n] = \"\";\t// Prevent 'unset' notices\n\t\t\t\t$total[$n] = $total[$n] . $letterline . \".\";\t// Add to total\n\n\n\t\t\t} else {\n\n\t\t\t\t// We're beyond the height of this character, so add a blank part:\n\t\t\t\tif ( !isset($total[$n]) ) $total[$n] = \"\";\t// Prevent 'unset' notices\n\t\t\t\t\n\t\t\t\t// Add blank space to match width of current character:\n\t\t\t\t$total[$n] = $total[$n] . str_repeat(\".\", strlen($charset[$letter][0])+1);\n\n\t\t\t}\n\t\t}\n\t}\n\n\t// Trim last 'space' from each line:\n\tif ( !$shadow ) for ( $n=0; $n < count($total); $n++ ) $total[$n] = substr($total[$n], 0, -1);\n\t\n\tif ( $dimensions > 2 ) $total = add_3d($total);\t\t\t// Add 3D\n\tif ( $shadow ) $total = add_shadow($total);\t\t\t// Add shadow\n\tif ( $upsidedown ) $total = flip_it($total);\t\t\t// Flip horizontal and vertical\n\tif ( $fliphoriz ) $total = flip_h($total);\n\t$total = stretch_it($total, $widthmult, $heightmult);\t\t// Stretch it\n\n\treturn $total;\n\n}", "function getMoneda($precio){\n return \"S/\". number_format($precio,2);\n}", "function uniord($c)\n{\n// $k = mb_convert_encoding($c, 'UCS-2LE', 'UTF-8');\n// $k1 = ord(substr($k, 0, 1));\n// $k2 = ord(substr($k, 1, 1));\n// return $k2 * 256 + $k1;\n \n\t$h = ord($c[0]);\n\tif ($h <= 0x7F) {\n\t\treturn $h;\n\t} else if ($h < 0xC2) {\n\t\treturn false;\n\t} else if ($h <= 0xDF) {\n\t\treturn ($h & 0x1F) << 6 | (ord($c[1]) & 0x3F);\n\t} else if ($h <= 0xEF) {\n\t\treturn ($h & 0x0F) << 12 | (ord($c[1]) & 0x3F) << 6\n\t\t\t\t\t\t\t\t | (ord($c[2]) & 0x3F);\n\t} else if ($h <= 0xF4) {\n\t\treturn ($h & 0x0F) << 18 | (ord($c[1]) & 0x3F) << 12\n\t\t\t\t\t\t\t\t | (ord($c[2]) & 0x3F) << 6\n\t\t\t\t\t\t\t\t | (ord($c[3]) & 0x3F);\n\t} else {\n\t\treturn false;\n\t}\n}", "function Compute_ArmourClass_Char() {\r\n\t\t$arm_bonus = 0;\r\n\t\t$ac = 10 + $arm_bonus + $_SESSION['modifiers']['dex'];\r\n\t\treturn $ac;\r\n\t}", "function ttc($prixht){\n\t$prixttc=$prixht*1.2;\n\t /* Elle remplace les points par la virgule et elle arrondit à 2 décimales. Elle retourne le prix TTC */\n\treturn number_format($prixttc,2,\",\", \".\");\n}", "function GHTCChineseMonth($year,$month) {\n\t// on trouve le solstice d'hiver precedent\n\t$YMD = GHGetSeason($year, 0);\n\n\t// on se decale de 8h pour avoir l'heure de Chine\n\tlist ( $Y,$M,$D, $h, $m, $s) = GHPosix2YMD( GHYMD2Posix($YMD)+8*3600 );\n\n\t// mois embolismique\n\t$e = GHEmbol($year);\n\n\t// est ce qu'il y a une lune intercalaire ?\n\t$n=$month;\n\tif (($e > 0) and ($e < $month)) {\n\t\t$n++;\n\t}\n\n\t// on recupere la deuxieme prochaine lune\n\t$YMD = GHGetNextMoon($Y,$M,$D,$h,$m,$s,$n+1);\n\n\t// on decale de 8h\n\t$t = GHYMD2Posix($YMD)+8*3600;\n\nreturn GHPosix2YMD($t);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Editing a diagnosis_prescription
function edit($diagnosis_reference_number) { // check if the diagnosis_prescription exists before trying to edit it $data['diagnosis_prescription'] = $this->Diagnosis_prescription_model->get_diagnosis_prescription($diagnosis_reference_number); if(isset($data['diagnosis_prescription']['diagnosis_reference_number'])) { if(isset($_POST) && count($_POST) > 0) { $params = array( 'prescription_instructions' => $this->input->post('prescription_instructions'), 'prescription_comment' => $this->input->post('prescription_comment'), ); $this->Diagnosis_prescription_model->update_diagnosis_prescription($diagnosis_reference_number,$params); redirect('diagnosis_prescription/index'); } else { $data['_view'] = 'diagnosis_prescription/edit'; $this->load->view('layouts/main',$data); } } else show_error('The diagnosis_prescription you are trying to edit does not exist.'); }
[ "function update_diagnosis_prescription($diagnosis_reference_number,$params)\n {\n $this->db->where('diagnosis_reference_number',$diagnosis_reference_number);\n $response = $this->db->update('diagnosis_prescriptions',$params);\n if($response)\n {\n return \"diagnosis_prescription updated successfully\";\n }\n else\n {\n return \"Error occuring while updating diagnosis_prescription\";\n }\n }", "static public function ctrEditDiagnosis(){\n\n\t\tif(isset($_POST[\"editDiagnosis\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ក-អ ]+$/', $_POST[\"editDiagnosis\"])){\n\n\t\t\t \t$table = \"diagnosis\";\n\n\t\t\t \t$data = array(\"id\"=>$_POST[\"diagnosisId\"],\n\t\t\t \t\t\t\t \"name\"=>$_POST[\"editDiagnosis\"]); \n\n\n\t\t\t \t$answer = ModelDiagnosis::mdlEditDiagnosis($table, $data);\n\n\t\t\t \tif($answer == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"The Diagnosis has been edited\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Close\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"diagnosis\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"Diagnosis cannot be blank or special characters\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Close\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"diagnosis\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function edit($diagnosis_reference_number)\n { \n // check if the disease_diagnoses_summary_matrix exists before trying to edit it\n $data['disease_diagnoses_summary_matrix'] = $this->Disease_diagnoses_summary_matrix_model->get_disease_diagnoses_summary_matrix($diagnosis_reference_number);\n \n if(isset($data['disease_diagnoses_summary_matrix']['diagnosis_reference_number']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n );\n\n $this->Disease_diagnoses_summary_matrix_model->update_disease_diagnoses_summary_matrix($diagnosis_reference_number,$params); \n redirect('disease_diagnoses_summary_matrix/index');\n }\n else\n {\n $data['_view'] = 'disease_diagnoses_summary_matrix/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The disease_diagnoses_summary_matrix you are trying to edit does not exist.');\n }", "function editPrescription(){\n\n global $pdo;\n\n if (REQUEST_METHOD == 'POST') {\n\n //Check if the required data have been set\n if (isset($_POST[\"prescription_id\"]) && isset($_POST[\"aged_id\"]) && isset($_POST[\"prescription_title\"])) {\n $prescription_id = $_POST[\"prescription_id\"];\n $aged_id = $_POST[\"aged_id\"];\n $prescription_title = pg_escape_string($_POST[\"prescription_title\"]);\n $prescription_title = \"'\".$prescription_title.\"'\";\n\n //TODO Comment code\n // region Check Data\n if (isset($_POST[\"geriatrician_id\"])){\n $geriatrician_id = $_POST[\"geriatrician_id\"];\n if(strcmp($geriatrician_id, \"null\") == 0 || strcmp($geriatrician_id, \"\") == 0) {\n $geriatrician_id = \"NULL\";\n }\n } else {\n $geriatrician_id = \"NULL\";\n }\n if (isset($_POST[\"prescription_text\"])){\n $prescription_text = $_POST[\"prescription_text\"];\n if(strcmp($prescription_text, \"null\") == 0 || strcmp($prescription_text, \"\") == 0){\n $prescription_text = \"NULL\";\n } else {\n $prescription_text = pg_escape_string($prescription_text);\n $prescription_text = \"'\".$prescription_text.\"'\";\n }\n } else {\n $prescription_text = \"NULL\";\n }\n if (isset($_POST[\"prescription_urgency\"])){\n // the type intervention_status requires all character to be lower.\n $prescription_urgency = strtoupper($_POST[\"prescription_urgency\"]);\n if(strcmp($prescription_urgency, \"null\") == 0 || strcmp($prescription_urgency, \"\") == 0){\n $prescription_urgency = \"NULL\";\n } else {\n $prescription_urgency = \"'\".$prescription_urgency.\"'\";\n }\n } else {\n $prescription_urgency = \"NULL\";\n }\n if (isset($_POST[\"prescription_status\"])){\n // the type intervention_status requires all character to be lower.\n $prescription_status = strtolower($_POST[\"prescription_status\"]);\n if(strcmp($prescription_status, \"null\") == 0 || strcmp($prescription_status, \"\") == 0){\n $prescription_status = \"NULL\";\n } else {\n $prescription_status = \"'\".$prescription_status.\"'\";\n }\n } else {\n $prescription_status = \"NULL\";\n }\n if (isset($_POST[\"valid_from\"])){\n $valid_from = $_POST[\"valid_from\"];\n if(strcmp($valid_from, \"null\") == 0 || strcmp($valid_from, \"\") == 0){\n $valid_from = \"NULL\";\n } else {\n $valid_from = \"'\".$valid_from.\"'\";\n }\n } else {\n $valid_from = \"NULL\";\n }\n if (isset($_POST[\"valid_to\"])){\n $valid_to = $_POST[\"valid_to\"];\n if(strcmp($valid_to, \"null\") == 0 || strcmp($valid_to, \"\") == 0){\n $valid_to = \"NULL\";\n } else {\n $valid_to = \"'\".$valid_to.\"'\";\n }\n } else {\n $valid_to = \"NULL\";\n }\n if (isset($_POST[\"additional_notes\"])){\n $additional_notes = $_POST[\"additional_notes\"];\n if(strcmp($additional_notes, \"null\") == 0 || strcmp($additional_notes, \"\") == 0){\n $additional_notes = \"NULL\";\n } else {\n $additional_notes = pg_escape_string($additional_notes);\n $additional_notes = \"'\".$additional_notes.\"'\";\n }\n } else {\n $additional_notes = \"NULL\";\n }\n\n //endregion\n\n //Query to UPDATE the prescription WITH additional notes\n $queryUpdate = \"UPDATE c4a_i_schema.prescription SET (aged_id) = (\".$aged_id.\"), \n (geriatrician_id) = (\".$geriatrician_id.\"), text = (\".$prescription_text.\"), \n (urgency) = (\".$prescription_urgency.\"), (prescription_status) = (\".$prescription_status.\"),\n (valid_from) = (\".$valid_from.\"), (valid_to) = (\".$valid_to.\"), \n (additional_notes) = (\".$additional_notes.\"), (title) = (\".$prescription_title.\")\n WHERE prescription_id = \".$prescription_id.\" \";\n\n $queryUpdate_results = $pdo->query($queryUpdate);\n\n } else {\n generate400(\"The key-value data are not set correctly\");\n }\n\n //If the query succeeded return a response with No Content, otherwise generate an internal error\n if ($queryUpdate_results == TRUE) {\n $sjes = new Jecho($prescription_id);\n $sjes -> server_code = 200;\n $sjes -> message = \"Updated DB - The database has been correctly updated\";\n echo $sjes -> encode(\"prescription_id\");\n } else {\n generate500(\"It has not been possible to update the database.\");\n }\n\n } else {\n generate400(\"The prescription_id has not been set\");\n }\n}", "static public function ctrCreateDiagnosis(){\n\n\t\tif(isset($_POST[\"newDiagnosis\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ក-អ ]+$/', $_POST[\"newDiagnosis\"])){\n\n\t\t\t \t$table = \"diagnosis\";\n\n\t\t\t \t$data = array(\"name\"=>$_POST[\"newDiagnosis\"]); \n\n\t\t\t \t$answer = ModelDiagnosis::mdlAddDiagnosis($table, $data);\n\n\t\t\t \tif($answer == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"The Diagnosis has been saved\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Save\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"diagnosis\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"Diagnosis information cannot be blank or special characters!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Close\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"diagnosis\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "protected function postEditTranscript(Request $request, $questionnaire_id, $id){\n $video = Video::where('id',$id)->firstOrFail();\n $questionnaire = $video->questionnaires()->where('questionnaire_id', $questionnaire_id)->get()->first();\n\n $this->authorize('video-edit-transcript', $questionnaire);\n\n $video->transcript = $request->transcript;\n $video->save();\n\n return Redirect::action('Observation\\VideoController@getVideo', array($questionnaire->id, $video->id));\n }", "function savephysicalexam(){\n//\t\t$data[\"recept_id\"] = $_POST['recept_id'];\n\t\t$data[\"cons_id\"] = $_POST['cons_id'];\n//\t\t$data[\"patient_id\"] = $_POST['patient_id'];\n\t\t$data[\"content\"] = $_POST['content'];\n\t\t$this->crud_model->save_physical_exam_for_patient($data);\n\t\techo \"success\"; \n\t}", "function edit_diagnois_record($id) {\n $this->db->where(\"pdr_id\", $id);\n $q = $this->db->get($this->diagnosis_table);\n if ($q->num_rows() >= 1) {\n return $q->result_array();\n }\n }", "function edit($diagnosis_symptom_code)\n { \n // check if the diagnosis_symptom exists before trying to edit it\n $data['diagnosis_symptom'] = $this->Diagnosis_symptom_model->get_diagnosis_symptom($diagnosis_symptom_code);\n \n if(isset($data['diagnosis_symptom']['diagnosis_symptom_code']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n );\n\n $this->Diagnosis_symptom_model->update_diagnosis_symptom($diagnosis_symptom_code,$params); \n redirect('diagnosis_symptom/index');\n }\n else\n {\n $data['_view'] = 'diagnosis_symptom/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The diagnosis_symptom you are trying to edit does not exist.');\n }", "public function updatedisplayPurpose($regno) {\r\n\t\t$con=$this->connect_db();\r\n $sql=\"INSERT INTO displayPurpose (TURegCode) values ('$regno')\";\r\n $con->query($sql);\r\n if($con->error){\r\n echo $con->error;\r\n }\r\n\t}", "function updateDiagDesc($idDiag,$newDesc,$db)\n {\n $req=$db->prepare('UPDATE diag SET desc_diag=:DESC WHERE id_diag=:DIAG;');\n\t\t$req->execute(array(\n\t\t\t'DESC' => $newDesc,\n\t\t\t'DIAG' => $idDiag\n\t\t));\n }", "public function edit(IpdDiagnosis $ipdDiagnosis)\n {\n return $this->sendResponse($ipdDiagnosis, 'IPD Diagnosis retrieved successfully.');\n }", "function save_inpatient_admission_diag($id){\n $list = $this->db->get_where(\"inpatient_admit_info\",array(\"patient_id\"=>$id));\n $admit_id = \"\";\n if ($list->num_rows()>0){\n $admit_id = $list->row()->admission_id;\n }else{\n $this->db->insert(\"inpatient_admit_info\",array(\"patient_id\"=>$id));\n $admit_id = $this->db->insert_id();\n }\n $data[\"type\"] = $this->input->post(\"type\");\n $data[\"date\"] = $this->input->post(\"date\");\n $data[\"diag_note\"] = $this->input->post(\"diag_note\");\n $data[\"remark_on_discharge\"] = $this->input->post(\"remark_note\");\n $data[\"admission_id\"] = $admit_id;\n $this->db->insert(\"inpatient_admission_diag\",$data);\n }", "function islandora_transcription_file_update($transcription, $filename) {\n $transcription['TRANSCRIPTION']->setContentFromFile($filename);\n unlink($filename);\n}", "function update_study_table($d)\n{\n $query = \"UPDATE studies SET subject=\\\"\".mysql_escape_string($d[\"subject\"]).\"\\\", description=\\\"\".mysql_escape_string($d[\"description\"]).\"\\\", notes=\\\"\".mysql_escape_string($d[\"notes\"]).\"\\\" WHERE studyid=\\\"\".$d[\"studyid\"].\"\\\"\";\n $q = mysql_query($query);\n if (strlen(mysql_error())) { echo mysql_error(); exit(); }\n}", "public function save_diagnosa(){\n\t\t$post = $this->input->post();\n\t\tif($post[\"kd_icdx\"] !=\"\" && $post[\"kd_icdx2\"] == \"\" && $post[\"kd_icdx3\"] == \"\"){\n\t\t\t$data = array(\"id_diagnosa\" => $post[\"id_diagnosa\"],\n\t\t \t\t\t\t \"kd_icdx\" \t=> $post[\"kd_icdx\"]\n\t\t \t\t\t);\n\t\t}else if($post[\"kd_icdx\"] !=\"\" && $post[\"kd_icdx2\"] != \"\" && $post[\"kd_icdx3\"] == \"\"){\n\t\t\t$data = array(\"id_diagnosa\" => $post[\"id_diagnosa\"],\n\t\t\t\t\t\t \"kd_icdx\"\t\t=> $post[\"kd_icdx\"],\n\t\t\t\t\t\t \"kd_icdx2\"\t=> $post[\"kd_icdx2\"]\n\t\t\t\t\t);\n\t\t}else if($post[\"kd_icdx\"] !=\"\" && $post[\"kd_icdx2\"] == \"\" && $post[\"kd_icdx3\"] != \"\"){\n\t\t\t$data = array(\"id_diagnosa\" => $post[\"id_diagnosa\"],\n\t\t\t\t\t\t \"kd_icdx\"\t\t=> $post[\"kd_icdx\"],\n\t\t\t\t\t\t \"kd_icdx3\"\t=> $post[\"kd_icdx3\"]\n\t\t\t\t\t);\n\t\t}else{\n\t\t\t$data = array(\"id_diagnosa\" => $post[\"id_diagnosa\"],\n\t\t\t\t\t\t \"kd_icdx\"\t\t=> $post[\"kd_icdx\"],\n\t\t\t\t\t\t \"kd_icdx2\"\t=> $post[\"kd_icdx2\"],\n\t\t\t\t\t\t \"kd_icdx3\"\t=> $post[\"kd_icdx3\"]\n\t\t\t\t\t);\n\t\t}\n\n\t\t$this->db->insert(\"tb_diagnosa\", $data);\n\t}", "function dialplaninjection_edit($injection,$description,$destination,$exten) {\n\tglobal $db;\n\tif (!get_magic_quotes_gpc()) {\n\t$description = addslashes($description);\n\t$exten = ((!isset($exten)) || ($exten == ''))?null:$exten; \n\t}\n\t$sql = \"update dialplaninjection_dialplaninjections set description = '$description', destination = '$destination', exten = '$exten' where id = $injection\";\n\t$db->query($sql);\n\tneedreload();\n}", "public function test_prescription_update_bad_data()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/prescription/{prescription_id}');\n\n $data = [\n 'multiplier' => 9999,\n 'clinic_id' => 9999,\n 'provider_id' => 9999,\n 'diagnosis_id' => 9999,\n 'name' => '',\n 'profile_id' => 9999,\n 'strike_through' => '',\n 'custom_units' => '',\n 'extracts' => [\n [\n 'extract_id' => 2,\n 'name' => 'Glycerinated Diluent',\n 'is_diluent' => 'T'\n ],\n [\n 'extract_id' => 4,\n 'name' => 'Aqueous Dil',\n 'is_diluent' => 'Q'\n ],\n [\n 'extract_id' => 9999,\n 'name' => 'Alternaria',\n 'is_diluent' => 'F'\n ]\n ]\n ];\n\n // update the prescription\n $response = $this->putJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n 'clinic_id' => [\n 'The selected clinic id is invalid.'\n ],\n 'provider_id' => [\n 'The selected provider id is invalid.'\n ]\n ]\n ]);\n }", "function reeditSurvey() {\n $this->layout = 'survey'; // use the more basic survey layout\n $this->Session->write('Survey.progress', GDTA_ENTRY); // change the progress back to GDTA entry\n $this->redirect(array('action' => 'enterGdta'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'updateMembershipUsingPUT'
protected function updateMembershipUsingPUTRequest($membership_dto) { // verify the required parameter 'membership_dto' is set if ($membership_dto === null || (is_array($membership_dto) && count($membership_dto) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $membership_dto when calling updateMembershipUsingPUT' ); } $resourcePath = '/api/memberships'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // body params $_tempBody = null; if (isset($membership_dto)) { $_tempBody = $membership_dto; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['*/*'] ); } else { $headers = $this->headerSelector->selectHeaders( ['*/*'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function UpdateMembership(\\Google\\Cloud\\GkeHub\\V1alpha2\\UpdateMembershipRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.gkehub.v1alpha2.GkeHub/UpdateMembership',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }", "public function updated(Membership $membership)\n {\n //\n }", "public function testUpdateSiteMembershipRequestForPerson()\n {\n }", "protected function updateMembershipTypeUsingPUTRequest($membership_type_dto)\n {\n // verify the required parameter 'membership_type_dto' is set\n if ($membership_type_dto === null || (is_array($membership_type_dto) && count($membership_type_dto) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $membership_type_dto when calling updateMembershipTypeUsingPUT'\n );\n }\n\n $resourcePath = '/api/membership-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($membership_type_dto)) {\n $_tempBody = $membership_type_dto;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateSettings(array $request, $team_id,$member_id);", "public function testBasicUpdate()\n {\n $this->asSuper();\n\n // Update a non-existant membership\n $this->putJson(\"/api/memberships/1\")->assertStatus(404);\n\n /** @var Membership $membership */\n $membership = factory(Membership::class)->create();\n /** @var Person $person */\n $person = $membership->person;\n\n // Send an empty update request\n $this->putJson(\"/api/memberships/{$membership->id}\", [])->assertStatus(200);\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $membership->application->toDateString(),\n 'start' => $membership->start->toDateString(),\n 'end' => $membership->end->toDateString(),\n 'remarks' => $membership->remarks,\n ]);\n\n // Update just the remarks\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'remarks' => 'NEWLY UPDATED REMARKS'\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $membership->application->toDateString(),\n 'start' => $membership->start->toDateString(),\n 'end' => $membership->end->toDateString(),\n 'remarks' => 'NEWLY UPDATED REMARKS'\n ]);\n\n // Set start to null\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'start' => null\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $membership->application->toDateString(),\n 'start' => null,\n 'end' => $membership->end->toDateString()\n ]);\n\n // Set end to null\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'end' => null\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $membership->application->toDateString(),\n 'start' => null,\n 'end' => null,\n ]);\n\n // Do not allow the last one to be removed\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'application' => null\n ])->assertStatus(422);\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $membership->application->toDateString(),\n 'start' => null,\n 'end' => null,\n ]);\n\n // Do allow delete a date if another one is added in the same request\n $newEndDate = Carbon::now();\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'application' => null,\n 'end' => $newEndDate->toDateString(),\n ])->assertStatus(200);\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => null,\n 'start' => null,\n 'end' => $newEndDate->toDateString(),\n ]);\n\n\n\n // Change to other date\n $date_wrong_low = Carbon::now()->subMonths(12)->toDateString();\n $date_before = Carbon::now()->subMonths(10)->toDateString();\n $date_a = Carbon::now()->subMonths(8)->toDateString();\n $date_b = Carbon::now()->subMonths(6)->toDateString();\n $date_c = Carbon::now()->subMonths(2)->toDateString();\n $date_after = Carbon::now()->addMonths(2)->toDateString();\n $date_wrong_high = Carbon::now()->addMonths(4)->toDateString();\n\n\n // Keep the chronology with itself\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'application' => $date_b,\n 'start' => $date_a,\n 'end' => $date_c\n ])->assertStatus(422);\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'application' => $date_b,\n 'start' => $date_c,\n 'end' => $date_a\n ])->assertStatus(422);\n $this->putJson(\"/api/memberships/{$membership->id}\",[\n 'application' => $date_a,\n 'start' => $date_c,\n 'end' => $date_b\n ])->assertStatus(422);\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'application' => $date_a,\n 'start' => $date_b,\n 'end' => $date_c\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $date_a,\n 'start' => $date_b,\n 'end' => $date_c,\n ]);\n\n // Do not overlap a membership below\n /** @var Membership $lowerMembership */\n $lowerMembership = $person->memberships()->create(['end' => $date_before]);\n $this->assertDatabaseHas('memberships', [\n 'id' => $lowerMembership->id,\n 'person_id' => $membership->person_id,\n 'application' => null,\n 'start' => null,\n 'end' => $date_before\n ]);\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'application' => $date_wrong_low\n ])->assertStatus(422);\n\n $lowerMembership->delete();\n\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'application' => $date_wrong_low\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $date_wrong_low,\n 'start' => $date_b,\n 'end' => $date_c,\n ]);\n\n // Do not overlap a membership above\n /** @var Membership $upperMembership */\n $upperMembership = $person->memberships()->create(['start' => $date_after]);\n $this->assertDatabaseHas('memberships', [\n 'id' => $upperMembership->id,\n 'person_id' => $membership->person_id,\n 'application' => null,\n 'start' => $date_after,\n 'end' => null\n ]);\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'end' => $date_wrong_high\n ])->assertStatus(422);\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'end' => null\n ])->assertStatus(422);\n\n $upperMembership->delete();\n\n $this->putJson(\"/api/memberships/{$membership->id}\", [\n 'end' => null\n ])->assertStatus(200);\n\n $this->assertDatabaseHas('memberships', [\n 'id' => $membership->id,\n 'person_id' => $membership->person_id,\n 'application' => $date_wrong_low,\n 'start' => $date_b,\n 'end' => null,\n ]);\n\n }", "protected function updateMembershipPeriodUsingPUTRequest($membership_period_dto)\n {\n // verify the required parameter 'membership_period_dto' is set\n if ($membership_period_dto === null || (is_array($membership_period_dto) && count($membership_period_dto) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $membership_period_dto when calling updateMembershipPeriodUsingPUT'\n );\n }\n\n $resourcePath = '/api/membership-periods';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($membership_period_dto)) {\n $_tempBody = $membership_period_dto;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update_put(){\n $response = $this->user_model->update_person(\n $this->put('id'),\n $this->put('name'),\n $this->put('address'),\n $this->put('phone')\n );\n $this->response($response);\n }", "public function test_update_nonexistent_membership() {\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t// Setup membership.\n\t\t$membership_id = $this->factory->membership->create();\n\n\t\t$response = $this->perform_mock_request(\n\t\t\t'POST',\n\t\t\t$this->route . '/' . $membership_id . '42',\n\t\t\t$this->sample_membership_args\n\t\t);\n\n\t\t// Not found.\n\t\t$this->assertEquals( 404, $response->get_status() );\n\t}", "public function update() {\n if(!$this->request->is('restful')) {\n $targetCoPersonId = $this->request->data['CoGroupMember']['co_person_id'];\n $userCoPersonId = $this->Session->read('Auth.User.co_person_id');\n $requesterIsAdmin = $this->Role->isCoAdmin($userCoPersonId, $this->cur_co['Co']['id'])\n || $this->Role->identifierIsCmpAdmin($this->Session->read('Auth.User.username'));\n \n try {\n $this->CoGroupMember->updateMemberships($targetCoPersonId,\n $this->request->data['CoGroupMember']['rows'],\n $userCoPersonId,\n $requesterIsAdmin);\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n $redir = array();\n $redir['controller'] = 'co_groups';\n $redir['action'] = 'select';\n $redir['co'] = $this->cur_co['Co']['id'];\n\n // If the current user is not the same as the target CO Person for whom\n // memberships are being managed then include the copersonid parameter.\n if($targetCoPersonId != $userCoPersonId) {\n $redir['copersonid'] = $targetCoPersonId;\n }\n\n $this->redirect($redir);\n }\n }", "public function update_put(){\n $response = $this->MitraM->update_mitra(\n $this->put('id'),\n $this->put('name'),\n $this->put('address'),\n $this->put('phone'),\n //$this->post('email'),\n $this->post('gender'),\n );\n $this->response($response);\n }", "public function setMembership($var)\n {\n GPBUtil::checkString($var, True);\n $this->membership = $var;\n\n return $this;\n }", "public function test_update_forbidden_membership() {\n\t\t// create a membership first.\n\t\twp_set_current_user( $this->user_allowed );\n\t\t$membership = $this->factory->membership->create_and_get();\n\n\t\twp_set_current_user( $this->user_forbidden );\n\n\t\t$request = new WP_REST_Request( 'POST', $this->route . '/' . $membership->get( 'id' ) );\n\t\t$request->set_body_params( $this->sample_membership_args );\n\t\t$response = $this->server->dispatch( $request );\n\n\t\t// Bad request.\n\t\t$this->assertEquals( 403, $response->get_status() );\n\t}", "function command_member_membership_update () {\n global $esc_post;\n \n // Verify permissions\n if (!user_access('member_edit')) {\n error_register('Permission denied: member_edit');\n return 'index.php?q=members';\n }\n if (!user_access('member_membership_edit')) {\n error_register('Permission denied: member_membership_edit');\n return 'index.php?q=members';\n }\n \n // Update membership\n $sql = \"\n UPDATE `membership`\n SET\n `pid`='$esc_post[pid]'\n \";\n if (!empty($esc_post['start'])) {\n $sql .= \", `start`='$esc_post[start]'\";\n } else {\n $sql .= \", `start`=NULL\";\n }\n if (!empty($esc_post['end'])) {\n $sql .= \", `end`='$esc_post[end]'\";\n } else {\n $sql .= \", `end`=NULL\";\n }\n $sql .= \"\n WHERE `sid`='$esc_post[sid]'\n \";\n \n $res = mysql_query($sql);\n if (!$res) die(mysql_error());\n \n return \"index.php?q=member&cid=$_POST[cid]&tab=plan\";\n}", "public function update_put(){\n $response = $this->PersonM->update_person(\n $this->put('id'),\n $this->put('name'),\n $this->put('hp'),\n $this->put('email'),\n $this->put('message')\n );\n $this->response($response);\n }", "public function update_put(){\n\t $response = $this->PersonM->update_person(\n\t $this->put('id'),\n\t $this->put('name'),\n\t $this->put('address'),\n\t $this->put('phone')\n\t );\n\t $this->response($response);\n \t}", "public function update_put(){\n $response = $this->CustomerModel->update_customer(\n $this->put('id'),\n $this->put('name'),\n\t\t$this->put('email'),\n\t\t$this->put('password'),\n\t\t$this->put('gender'),\n\t\t$this->put('is_married'),\n $this->put('address')\n );\n $this->response($response);\n }", "public function testUpdateSupportTicketUsingPut()\n {\n }", "function createExamplePutRequest()\n{\n\treturn new Request(\n\t\t'put',\n\t\t'user/measures',\n\t\t['Content-Type' => 'application/json'],\n\t\t'[{\"id\": \"bodyHeight\", \"value\": 200}]'\n\t);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setPointer Sets collection pointer.
public function setPointer($pointer) { $this->pointer = $pointer; }
[ "public function setPointer(?string $pointer): void\n {\n $this->pointer = $pointer;\n }", "function setCollection($collection)\n {\n $this->_collection = $collection;\n }", "public function setCollection($collection)\r\n {\r\n $this->collection = $collection;\r\n }", "public function setPointer($position)\n {\n $this->_pointer = $position;\n }", "public function setCollection($collection) {\n $this->collection = $this->db->selectCollection($collection);\n }", "function set_collection($collection)\r\n {\r\n $this->set_additional_property(self :: PROPERTY_COLLECTION, $collection);\r\n }", "public function storePointerForPath($path, $pointer);", "public function getCollectionPointerID()\n {\n /** @var Concrete\\Core\\Page\\Page $instance */\n return $instance->getCollectionPointerID();\n }", "public function setCollection($collection)\r\n {\r\n $collection->addAttributeToSelect('thumbnail')\r\n ->addAttributeToSelect('url_key')\r\n ->addAttributeToSelect('meta_title');\r\n $this->_collection = $collection;\r\n }", "public function resetPointer() {\n\t\t$this->_pointer = -1;\n\t}", "protected function resetPointer() \n {\n $this->pointer = array('x' => 0, 'y' => 0);\n }", "function setDbcoll($collection){\n $this->collection = $collection;\n $this->dbdotcoll = $this->mdb.'.'.$this->collection;\n }", "public function setParentCollection(Collection $collection)\n\t{\n\t\t$this->parentCollection = $collection;\n\t}", "public function setPointHelper(PointHelper $pointHelper)\n {\n $this->pointHelper = $pointHelper;\n }", "protected function setParent(DumperCollection $parent)\r\n {\r\n $this->parent = $parent;\r\n }", "public function setCursor(string $cursor): void;", "public function addPointerItem($value) {\n return $this->add('pointer', func_get_args());\n }", "public function set(array $collection);", "public function getPointer()\n {\n return $this->pointer;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes a data storage
public function deleteDataStorage($name);
[ "function destroyDataStorage(){ }", "public function destroy_storage();", "public function deleted(Storage $storage)\n {\n //\n }", "public static function DeleteStorage(): void\n {\n session_unset();\n }", "function delete($storage_master_id=null, $storage_coordinate_id=null) {\r\n\t\t\r\n\t\t// ** Parameters check **\r\n\t\t// Verify parameters have been set\r\n\t\tif(empty($storage_master_id) || empty($storage_master_id)) {\r\n\t\t\t$this->redirect('/pages/err_sto_funct_param_missing'); \r\n\t\t\texit;\r\n\t\t}\r\n\t\t\t\r\n\t\t// ** get STORAGE info **\r\n\t\t$this->StorageMaster->id = $storage_master_id;\r\n\t\t$storage_master_data = $this->StorageMaster->read();\r\n\t\t\r\n\t\tif(empty($storage_master_data)) {\r\n\t\t\t$this->redirect('/pages/err_sto_no_stor_data'); \r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\t//Look for storage control\r\n\t\t$this->StorageControl->id = $storage_master_data['StorageMaster']['storage_control_id'];\r\n\t\t$storage_control_data = $this->StorageControl->read();\r\n\r\n\t\tif(empty($storage_control_data)){\r\n\t\t\t$this->redirect('/pages/err_sto_no_stor_cont_data'); \r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t// ** Get Storage Coordinate Data **\t\t\t\r\n\t\t$this->StorageCoordinate->id = $storage_coordinate_id;\r\n\t\t$storage_coordinate_data = $this->StorageCoordinate->read();\r\n\t\t\r\n\t\tif(empty($storage_coordinate_data)){\r\n\t\t\t$this->redirect('/pages/err_sto_no_stor_coord_data'); \r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\tif(strcmp($storage_coordinate_data['StorageCoordinate']['storage_master_id'], $storage_master_id) != 0) {\r\n\t\t\t$this->redirect('/pages/err_sto_no_storage_id_map'); \r\n\t\t\texit;\t\t\t\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\t// ** check if the storage can be deleted **\r\n\t\tif(!$this->allowStorageCoordinateDeletion($storage_master_id, $storage_coordinate_data['StorageCoordinate']['coordinate_value'])){\r\n\t\t\t// Content exists, the storage can not be deleted\r\n\t\t\t$this->redirect('/pages/err_sto_stor_Coord_del_forbid'); \r\n\t\t\texit;\t\t\t\r\n\t\t} \r\n\r\n\t\t// look for CUSTOM HOOKS, \"validation\"\r\n\t\t$custom_ctrapp_controller_hook \r\n\t\t\t= APP . 'plugins' . DS . $this->params['plugin'] . DS . \r\n\t\t\t'controllers' . DS . 'hooks' . DS . \r\n\t\t\t$this->params['controller'].'_'.$this->params['action'].'_validation.php';\r\n\t\t\r\n\t\tif (file_exists($custom_ctrapp_controller_hook)) {\r\n\t\t\trequire($custom_ctrapp_controller_hook);\r\n\t\t}\r\n\t\t\r\n\t\t//Delete storage\r\n\t\t$bool_delete_storage_coord = TRUE;\r\n\t\t\r\n\t\tif(!$this->StorageCoordinate->del( $storage_coordinate_id )){\r\n\t\t\t$bool_delete_storage_coord = FALSE;\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\tif(!$bool_delete_storage_coord){\r\n\t\t\t$this->redirect('/pages/err_sto_stor_coord_del_err'); \r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t$this->flash('Your data has been deleted.', '/storage_coordinates/listAll/'.$storage_master_id.'/');\r\n\t\t\r\n\t}", "public function deleteData($data);", "public function deleteDataStorage($name) {\n $this->_tableDeleteQueue[$name] = $name;\n \n // fluent interface\n return $this;\n }", "public function clear()\n {\n \tunlink($this->_storage);\n }", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp . DS . 'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp . DS . 'file1.txt');\n $this->assertTrue(!is_file(self::$temp . DS . 'file1.txt'));\n }", "public function delete()\r\n {\r\n shmop_delete($this->shmId);\r\n }", "public function delete()\n\t{\n\t\t$this->get(true, true);\n\t\tforeach ($this->data as $key => $value)\n\t\t{\n\t\t\t$value->delete();\n\t\t}\n\t\trmdir($this->root);\n\t}", "public function delete()\n {\n parent::delete();\n Storage::delete($this->filepath);\n }", "public function forceDeleted(Storage $storage)\n {\n //\n }", "public function removeStorage()\n\t{\n\t\t$this->taskExec('docker rm chrome-print-storage')->run();\n\t}", "public function delete() {\n\n\t\tif ($shmid = shmop_open($this->id, 'w', 0, 0)) {\n\n\t\t\tshmop_delete($shmid);\n\t\t}\n\t}", "public function unsetStorageId();", "public function deleteDatastore($name);", "public function removeAll ($storage) {}", "protected function deleteStore()\n {\n $keys = ['name', 'email'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the stub banner comment.
public function getStubBanner() { if (isset($this->raw->{'banner'})) { return $this->raw->{'banner'}; } return null; }
[ "public function getVersionComment()\n {\n return $this->version_comment;\n }", "public function getDocComment();", "public function getBanner() {\n\t\t$ls = DBModel::getByFields('cernet_contest');\n\t\treturn $ls[0]['h_banner'];\n\t}", "public function getRawDocComment();", "private function getHeaderComment()\n {\n return '# Begin ' . $this->baseComment;\n }", "public function getBanner()\n {\n return $this->banner;\n }", "public function getBannerMessage(): string\n {\n return $this->banner_message;\n }", "public function getBanner()\n {\n return $this->_banner;\n }", "private function getHeaderComment(){\n\t\t\t$source= \"\";\n\t\t\t\n\t\t\t$source .= FileManager::getTab() . FileManager::getComment(58, true) . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" **** File generated by fitzlucassen\\DALGenerator tool ****\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" * All right reserved to fitzlucassen repository on github*\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . \" ************* https://github.com/fitzlucassen ************\" . FileManager::getBackSpace();\n\t\t\t$source .= FileManager::getTab() . FileManager::getComment(58, false) . FileManager::getBackSpace();\n\t\t\t\n\t\t\treturn $source;\n\t\t}", "public function getComment(): string\n {\n return $this->comment;\n }", "public function getBanner()\n {\n return $this->banner;\n }", "function getBannerMessage()\n {\n return $this->banner_message;\n }", "protected function getHeaderComment()\n {\n return '# Begin ' . $this->getBaseComment() . ' for [' . $this->getIdentifier() . ']';\n }", "protected function getDocblock()\n\t{\n\t\treturn $this->property->getDocComment();\n\t}", "public function getHttpBanner()\n {\n return $this->http_banner;\n }", "public function getCamberBanner()\n {\n return $this->get(self::camber_banner);\n }", "public function comment() {\n if ($this->main_comment == \"\") {\n if ($this->page[\"Title\"] == \"\") $this->openpage (\"Title\");\n $this->main_comment = html_entity_decode($this->page[\"Title\"]->{'long_description'});\n }\n return $this->main_comment;\n }", "public function getServiceBanner()\n {\n return $this->service_banner;\n }", "public function getCommentText(): string {\n\t\treturn ($this->commentText);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get GitLab Client object
protected function getGitLabClient() { return $this->client; }
[ "private function connectGitlabClient() {\n //instanciate the Gitlab Client connection\n $this->client = new Client(self::$GITLAB_HOST);\n $this->client->authenticate(self::$GITLAB_TOKEN, Client::AUTH_HTTP_TOKEN, self::$GITLAB_USER_NAME);\n }", "protected function getGitLab()\n {\n return new GitLab();\n }", "protected function getClient()\n {\n static $client;\n\n if (empty($client)) {\n $client = new Client('https://api.github.com');\n\n $client->setDefaultOption('auth', [\n $this->parameters['user'],\n $this->parameters['token'],\n 'Basic'\n ]);\n }\n\n return $client;\n }", "public function getClient()\n\t{\n\t\t$client = new \\Github\\Client;\n\n\t\t$client->authenticate($this->config['token'], null, \\Github\\Client::AUTH_HTTP_TOKEN);\n\n\t\treturn $client;\n\t}", "public static function client()\n {\n if (is_null(static::$client)) {\n static::$client = new Client();\n static::$client->authenticate(config('github.token'), Client::AUTH_HTTP_TOKEN);\n }\n\n return static::$client;\n }", "public function getClient()\n {\n return $this->getContainer()->get('test.client');\n }", "public function getGuzzleClient();", "public function getClient(): \\GearmanClient\n {\n return $this->client;\n }", "protected function getHttp()\n\t{\n\t\treturn new \\Guzzle\\Http\\Client;\n\t}", "public function getGuzzleInstance()\n {\n return $this->client;\n }", "protected function getHttp()\n {\n return new \\Guzzle\\Http\\Client;\n }", "private function getGithubClient(Project $project): Client\n {\n\n $user = $project->getParentUser();\n\n if (null === $user) {\n $user = $project->getParentOrganization()->getCreator();\n }\n\n return $this->githubApiService->getAuthenticatedClientForUser($user);\n }", "public function getClient()\n\t{\n\t\t// *** rewrite to return a MongoClient instance\n\t\tif (!$this->client) {\n\t\t\ttry {\n\t\t\t\t$this->client = NULL;\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t}\n\t\treturn $this->client;\n\t}", "public function httpClient() {\n if (!isset($this->httpClient)) {\n $this->httpClient = \\Drupal::getContainer()\n ->get('http_client');\n }\n return $this->httpClient;\n }", "private function getRequestClient()\n {\n return new Client([\n 'base_uri' => $this->baseUrl\n ]);\n\n }", "protected function getClient() {\n $this->client = $this->client ?? $this->sdk_connector->getClient();\n return $this->client;\n }", "protected function getHttpClient()\n\t{\n\t\treturn new Client;\n\t}", "public static function client(){\n\t\tif(!self::$client){\n\t\t\tself::$client = new self();\n\t\t}\n\t\treturn self::$client;\n\t}", "public function getClient()\n\t{\n\t\t$client = new \\HipChat\\HipChat($this->config['token']);\n\n\t\treturn $client;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set path of library directory
public static function setLibraryDirectory($dir) { self::$_libDir = rtrim($dir, '/'); }
[ "public function getLibraryPath(){\n\t\treturn $this->getBasePath().$this->getLibraryFolder().DIRECTORY_SEPARATOR;\n\t}", "function zbase_path_library($path)\r\n{\r\n\treturn zbase_path() . 'library/' . $path;\r\n}", "function setLibdir($libdir) {\n\n\tif (substr($libdir, -1) == \"/\") {\n\n\t\t$libdir = substr($libdir, 0, -1);\n\n\t}\n\n\tif (str_replace(\"/\", \"\", $libdir) == $libdir) {\n\n\t\t$libdir = $this->dirroot . $libdir;\n\n\t}\n\n\tif (!is_dir($libdir)) {\n\n\t\t$this->error(\"setLibdir: $libdir is not a directory.\");\n\n\t\treturn false;\n\n\t}\n\n\t$this->libdir = $libdir . \"/\";\n\n\treturn true;\n\n}", "private function getPathForLibraryInit() {\n return $this->getPath('__phutil_library_init__.php');\n }", "public static final function getLibPath()\n {\n return self::getRootPath() . '/lib';\n }", "public static function add_library_path($path)\n {\n self::$_library_paths[] = $path;\n }", "public static function LibraryFolder()\n {\n return ROOT.DS.Configuration::getApplicationFolder().DS.'library';\n }", "private static function define_library_path($path)\n {\n if (!defined('BDCLIB_PATH')) {\n define('BDCLIB_PATH', dirname($path) . DS . 'botdetect/');\n }\n }", "private function _setWorkingDir()\n {\n Utility\\SessionManage::set('workingDir', str_replace('/Lib', '', __DIR__));\n }", "public function addLibrariesDir ( $path )\n\t{\n\t\tif ( is_dir ( $path ) )\n\t\t\t$this->librariesDirs[] = $path;\n\t}", "private function getLibraryRootPath()\n {\n return dirname(__FILE__) . \"/../../../\";\n }", "function setLibjsdir($libjsdir) {\n\tif (substr($libjsdir, -1) == \"/\") {\n\t\t$libjsdir = substr($libjsdir, 0, -1);\n\t}\n\tif (str_replace(\"/\", \"\", $libjsdir) == $libjsdir) {\n\t\t$libjsdir = $this->dirroot . $libjsdir;\n\t}\n\tif (!is_dir($libjsdir)) {\n\t\t$this->error(\"setLibjsdir: $libjsdir is not a directory.\");\n\t\treturn false;\n\t}\n\t$this->libjsdir = $libjsdir . \"/\";\n\treturn true;\n}", "public function setLibBase($libBase = null)\n {\n $this->_libBase = $libBase == null ? dirname(__FILE__) . DIRECTORY_SEPARATOR : $libBase;\n }", "function getPathIncLib() { return ( isset (getCfg(\"paths\")['inc_lib']) && getCfg(\"paths\")['inc_lib'] ? getCfg(\"paths\")['inc_lib'] : sixtythreeklabs_php_app_private_directory_location . \"lib/\" ) ; }", "public function setModulesDir($path) {\n\t\t$this->registerAutoloader($path);\n\t\t$this->_moduleDirPath = $path;\n\t}", "public function _initIncludePath(){\n set_include_path(get_include_path() . PATH_SEPARATOR . $this->_config->application->library->directory);\n }", "public static function getLibsFolder(){\r\n return self::$paths[\"libraries\"];\r\n }", "public function getLibDir() {\n if($this->config->lib_dir) {\n return $this->config->lib_dir;\n }\n\n return $this->getBaseDir() . DIRECTORY_SEPARATOR . 'lib';\n }", "protected function _initLibs()\n {\n set_include_path(implode(PATH_SEPARATOR, array(\n realpath('custom/library/'),\n get_include_path()\n )));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns customer's all phone number objects in an object_list
public function get_phones();
[ "function get_phones()\n\t{\n\t\t$this->require_state(\"saved\");\n\n\t\t$list = new object_list(array(\n\t\t\t\"class_id\" => CL_CRM_PHONE,\n\t\t\t\"CL_CRM_PHONE.RELTYPE_PHONE(CL_CRM_PERSON)\" => $this->id(),\n\t\t));\n\t\treturn $list;\n\t}", "public function getPhones()\n {\n return ContactsItem::find()->where(['type' => ContactsItem::TYPE_PHONE])->all();\n }", "public function getPhoneNumbers()\r\n {\r\n return $this->phone_numbers;\r\n }", "public function phoneNumbers()\n {\n return $this->hasMany(PhoneNumber::class, 'customer_id');\n }", "public function getPhoneList()\n {\n try {\n $phoneList = User::with('phones', 'company')->get()\n ->makeHidden(['id', 'email_verified_at', 'admin', 'created_at', 'updated_at', 'company_id'])\n ->each(function($user) {\n optional($user->phones)->makeHidden(['id', 'user_id', 'created_at', 'updated_at']);\n optional($user->company)->makeHidden(['id', 'created_at', 'updated_at']);\n });\n\n return response()->json([\n 'success' => true,\n 'phone_list' => $phoneList,\n ]);\n } catch (\\Throwable $th) {\n return response()->json([\n 'success' => false,\n 'message' => $th->getMessage(),\n ]);\n }\n\n }", "public static function getPhoneNumbers()\n {\n $array = [];\n $entries = self::find()->all();\n /** @var self[] $entries */\n foreach ($entries as $entry) {\n array_push($array, [\n 'code' => strtolower($entry->country_code),\n 'name' => $entry->name,\n 'number' => '+' . $entry->number,\n ]);\n }\n return $array;\n }", "public function get_all_contacts_from_list( $list_id = 0 ) {\n\t\treturn $this->get_contacts_from_list( 'all', $list_id );\n\t}", "public function getList() {\n $result = parent::getList([], sprintf('customers/%s/contactpersons', $this['customer_id']));\n return $this->buildEntitiesFromArray($result);\n }", "public function get_list()\n\t\t{\n\t return $this->curl( 'Customer/get_customer_list', $this->data );\n\t\t}", "public function lstCustomerContactList(){\n\t\t$Sql = \"SELECT\n\t\t\t\tb.first_name\n\t\t\t\t, b.last_name\n\t\t\t\t, a.customer_id\n\t\t\t\t, a.contact_id\n\t\t\t\t, a.customer_msg_contact_id\n\t\t\t\t, a.is_active\n\t\t\tFROM\n\t\t\t\trs_tbl_customer_mail_contact_list as a\n\t\t\t\tINNER JOIN rs_tbl_customer as b\n\t\t\t\t\tON (a.contact_id = b.customer_id)\";\n\t\t\n\t\tif($this->isPropertySet(\"customer_id\", \"V\"))\n\t\t\t$Sql .= \" AND a.customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t\n\t\tif($this->isPropertySet(\"contact_id\", \"V\"))\n\t\t\t$Sql .= \" AND a.contact_id=\" . $this->getProperty(\"contact_id\");\n\t\t\t\n\t\tif($this->isPropertySet(\"customer_msg_contact_id\", \"V\"))\n\t\t\t$Sql .= \" AND a.customer_msg_contact_id=\" . $this->getProperty(\"customer_msg_contact_id\");\n\t\t\n\t\tif($this->isPropertySet(\"search_by_name\", \"V\")){\n\t\t\t$Sql .= \" AND b.first_name LIKE '%\" . $this->getProperty(\"search_by_name\") . \"%'\";\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\t\t\n\t\t$this->dbQuery($Sql);\n\t}", "function getCardHolderPhoneNumbers() {\n\t\treturn $this->m_cardHolderPhoneNumbers;\n\t}", "public function getPhoneNumbers()\n\t{\n\t\t$this->authorize('get-users-phonenumbers');\n\n\t\t$phones = [];\n\n\t\t// Getting recruiters\n\t\t$recruiters = Recruiter::with(['user', 'company'])->get();\n\t\tforeach($recruiters as $recruiter)\n\t\t\tif (!empty($recruiter->user->phone))\n\t\t\t\t$phones[] = [\n\t\t\t\t\t'user_ido' => $recruiter->user->ido,\n\t\t\t\t\t'phone' => $recruiter->user->phone,\n\t\t\t\t\t'phone_formatted' => $recruiter->user->phone_formatted,\n\t\t\t\t\t'identity' => $recruiter->user->firstname . ' ' . $recruiter->user->lastname,\n\t\t\t\t\t'profile' => $recruiter->company->name\n\t\t\t\t];\n\n\t\t// Getting candidates\n\t\t$candidates = Candidate::with('user')->get();\n\t\tforeach($candidates as $candidate)\n\t\t\tif (!empty($candidate->user->phone))\n\t\t\t\t$phones[] = [\n\t\t\t\t\t'user_ido' => $candidate->user->ido,\n\t\t\t\t\t'phone' => $candidate->user->phone,\n\t\t\t\t\t'phone_formatted' => $candidate->user->phone_formatted,\n\t\t\t\t\t'identity' => $candidate->user->firstname . ' ' . $candidate->user->lastname,\n\t\t\t\t\t'profile' => 'Étudiant ' . trim($candidate->grade . ' ' . $candidate->education)\n\t\t\t\t];\n\n\t\treturn response()->json($phones);\n\t}", "public function phoneNumbers() {\n return $this->hasMany(PersonPhoneNumber::class, 'person_id')->orderBy('index');\n }", "function _cmisro_result_objects($result)\n{\n $list = [];\n foreach ($result->objects as $row) {\n $list[] = _cmisro_object($row->object);\n }\n return $list;\n}", "public function getAllPhoneNumbers() {\n $query = \"SELECT phone_no FROM users;\";\n $dbResult = $this->CONN->query($query);\n $result = array();\n while($row = $dbResult->fetch_assoc()) {\n array_push($result, $row['phone_no']);\n }\n return $result;\n }", "public function telephones()\n {\n return $this->hasMany(Telephone::class, 'entity_id', 'id')\n ->whereIn('entity_type', [Telephone::TYPE_USER_PHONE, Telephone::TYPE_USER_FAX, Telephone::TYPE_USER_TOLL_FREE]);\n }", "function customerAllList() {\n $arrClms = array(\n 'pkCustomerID',\n 'CustomerFirstName',\n 'CustomerLastName',\n 'CustomerEmail'\n );\n $varOrderBy = \" CustomerFirstName ASC \";\n $arrRes = $this->select(TABLE_CUSTOMER, $arrClms, '', $varOrderBy);\n foreach ($arrRes as $k => $v) {\n $arrRow[$v['pkCustomerID']] = $v;\n }\n\n return $arrRow;\n }", "public function getContacts();", "public function getWithAvailablePhones()\n {\n // return $this->model->with('available_phones')->get();\n return $this->model->get();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses out all the response codes from given header
private function parseResponseCodes() { foreach($this->header as $k => $v) { if( is_numeric($k) ) { preg_match_all( "/HTTP\/\d\.\d\s(\d{3})\s.*/", $v, $matches, PREG_SET_ORDER ); if( is_array($matches[0]) && count($matches[0]) > 1 ) { $this->responseCodes[$k] = (int)$matches[0][1]; } else { $this->responseCodes[$k] = 0; } } } }
[ "function checkHTTPResponse( $header ) {\n $rVal = 0;\n \n if(preg_match_all('!HTTP/1.1 ([0-9a-zA-Z]*) !', $header, $matches, PREG_SET_ORDER)) {\n \tforeach($matches as $match) {\n $rVal = nullInt( $match[1] );\n \t}\n }\n\n // Return the HTTP Response Code\n return $rVal;\n }", "function checkHTTPResponse( $header ) {\n $rVal = 0;\n\n if(preg_match_all('!HTTP/1.1 ([0-9a-zA-Z]*) !', $header, $matches, PREG_SET_ORDER)) {\n foreach($matches as $match) {\n $rVal = nullInt( $match[1] );\n }\n }\n\n // Return the HTTP Response Code\n return $rVal;\n }", "protected function _extractHttpCode($header) {\n\t\tpreg_match(\n\t\t\t'#^HTTP/[0-9\\.]+\\s(?P<code>[0-9]+)#i',\n\t\t\t$header,\n\t\t\t$matches\n\t\t);\n\n\t\treturn isset($matches['code'])\n\t\t\t? $matches['code']\n\t\t\t: $this->_defaultCode;\n\t}", "function get_headers_from_curl_response($out){\n \n $headers = array();\n \n // may be multiple header blocks - we want the last\n $headers_block = substr($out['response'], 0, $out['info'][\"header_size\"]-1);\n $blocks = explode(\"\\r\\n\\r\\n\", $headers_block);\n $header_text = trim($blocks[count($blocks) -1]);\n\n foreach (explode(\"\\r\\n\", $header_text) as $i => $line){\n if ($i === 0){\n $headers['http_code'] = $line;\n }else{\n list ($key, $value) = explode(': ', $line);\n $headers[$key] = $value;\n }\n }\n\n return $headers;\n}", "function parseHTTPResponse( $header ) {\n $rVal = array();\n $fields = explode(\"\\r\\n\", preg_replace('/\\x0D\\x0A[\\x09\\x20]+/', ' ', $header));\n\n // Parse the Fields\n foreach( $fields as $field ) {\n if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {\n $match[1] = preg_replace('/(?<=^|[\\x09\\x20\\x2D])./e', 'strtoupper(\"\\0\")', strtolower(trim($match[1])));\n\n if( isset($rVal[$match[1]]) ) {\n $rVal[$match[1]] = array($rVal[$match[1]], $match[2]);\n } else {\n $rVal[$match[1]] = trim($match[2]);\n }\n }\n }\n\n // Return the Array of Headers\n return $rVal;\n }", "public function getResponseHeaderHttpCode();", "private function getResponseCode($headers) {\n\n $tmp = explode(\"\\n\", $headers);\n $firstLine = array_shift($tmp);\n\n if(substr($headers, 0, 8) == 'HTTP/1.1') {\n\n return substr($headers, 9, 3);\n }\n\n return null;\n }", "public static function getHTTPStatusCode($header) {\n $first_line = strtok($header, \"\\n\");\n\n preg_match(\"# [0-9]{3}#\", $first_line, $match);\n\n if (isset($match[0]))\n return (int) trim($match[0]);\n else\n return null;\n }", "public static function parseHttpStatus($header)\r\n {\r\n preg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|',$header,$match);\r\n return intval( $match[1] );\r\n }", "function get_all_response_codes() \n {\n\t\treturn $this->_response;\n\t}", "private function readHeaders() {\n $headers = $this->status->getHeaders();\n\n foreach ($headers as $key => $value) {\n switch ($key) {\n case \"Location\":\n $this->response['location'] = $value[0];\n break;\n\n case \"Content-Type\":\n $this->response['content_type'] = $value[0];\n break;\n\n case \"Content-Length\":\n $this->response['content_length'] = $value[0];\n break;\n\n default:\n break;\n }\n }\n }", "private function parseHttp($header) {\n list($version,$code,$message) = explode(\" \", $header);\n\n $this->response->setStatusCode($code,$message);\n\n $version_parts = explode(\"/\",$version);\n $this->response->setProtocolVersion(array_pop($version_parts));\n }", "public function getResponseCodes() {\n return [\n [\n 'code' => 200,\n 'others' => [300, 400, 500],\n ],\n [\n 'code' => 300,\n 'others' => [200, 400, 500],\n ],\n [\n 'code' => 400,\n 'others' => [200, 300, 500],\n ],\n [\n 'code' => 500,\n 'others' => [200, 300, 400],\n ],\n ];\n }", "function decodeStatusCode()\n {\n return [\n 1 => 'authorised',\n 2 => 'decline',\n 3 => 'refunded'\n ];\n }", "function http_header_lookup($num)\n{\n\tlog_debug(\"inc_misc\", \"Executing http_header_lookup($num)\");\n\n\t$return_codes = array (\n\t\t100 => \"HTTP/1.1 100 Continue\",\n\t\t101 => \"HTTP/1.1 101 Switching Protocols\",\n\t\t200 => \"HTTP/1.1 200 OK\",\n\t\t201 => \"HTTP/1.1 201 Created\",\n\t\t202 => \"HTTP/1.1 202 Accepted\",\n\t\t203 => \"HTTP/1.1 203 Non-Authoritative Information\",\n\t\t204 => \"HTTP/1.1 204 No Content\",\n\t\t205 => \"HTTP/1.1 205 Reset Content\",\n\t\t206 => \"HTTP/1.1 206 Partial Content\",\n\t\t300 => \"HTTP/1.1 300 Multiple Choices\",\n\t\t301 => \"HTTP/1.1 301 Moved Permanently\",\n\t\t302 => \"HTTP/1.1 302 Found\",\n\t\t303 => \"HTTP/1.1 303 See Other\",\n\t\t304 => \"HTTP/1.1 304 Not Modified\",\n\t\t305 => \"HTTP/1.1 305 Use Proxy\",\n\t\t307 => \"HTTP/1.1 307 Temporary Redirect\",\n\t\t400 => \"HTTP/1.1 400 Bad Request\",\n\t\t401 => \"HTTP/1.1 401 Unauthorized\",\n\t\t402 => \"HTTP/1.1 402 Payment Required\",\n\t\t403 => \"HTTP/1.1 403 Forbidden\",\n\t\t404 => \"HTTP/1.1 404 Not Found\",\n\t\t405 => \"HTTP/1.1 405 Method Not Allowed\",\n\t\t406 => \"HTTP/1.1 406 Not Acceptable\",\n\t\t407 => \"HTTP/1.1 407 Proxy Authentication Required\",\n\t\t408 => \"HTTP/1.1 408 Request Time-out\",\n\t\t409 => \"HTTP/1.1 409 Conflict\",\n\t\t410 => \"HTTP/1.1 410 Gone\",\n\t\t411 => \"HTTP/1.1 411 Length Required\",\n\t\t412 => \"HTTP/1.1 412 Precondition Failed\",\n\t\t413 => \"HTTP/1.1 413 Request Entity Too Large\",\n\t\t414 => \"HTTP/1.1 414 Request-URI Too Large\",\n\t\t415 => \"HTTP/1.1 415 Unsupported Media Type\",\n\t\t416 => \"HTTP/1.1 416 Requested range not satisfiable\",\n\t\t417 => \"HTTP/1.1 417 Expectation Failed\",\n\t\t500 => \"HTTP/1.1 500 Internal Server Error\",\n\t\t501 => \"HTTP/1.1 501 Not Implemented\",\n\t\t502 => \"HTTP/1.1 502 Bad Gateway\",\n\t\t503 => \"HTTP/1.1 503 Service Unavailable\",\n\t\t504 => \"HTTP/1.1 504 Gateway Time-out\" \n\t);\n\n\treturn $return_codes[$num];\n}", "function _captchme_get_http_status($response) {\n $headers=explode(\"\\r\\n\", $response[0]);\n return substr($headers[0],9,3);\n}", "protected function _parseHeader() {}", "public function getResponseCode()\r\n {\r\n return $this->header->get('rcode');\r\n }", "private function lookupResponseCode($code = null)\n {\n $responseCodes = array(\n '200' => '200: OK.',\n '201' => '201: The request has been accepted for processing, but the processing has not been completed.',\n '203' => '203: The server successfully processed the request, but is returning information that may be from another source.',\n '204' => '204: The server successfully processed the request, but is not returning any content.',\n '205' => '205: The server successfully processed the request, but is not returning any content. Requires the requester to reset the document view.',\n '206' => '206: The server is delivering only part of the resource due to a range header sent by the client.',\n '207' => '207: The message body that follows is an XML message and can contain a number of separate response codes.',\n '208' => '208: The members of a DAV binding have already been enumerated in a previous reply to this request, and are not being included again.',\n '226' => '226: The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.',\n '300' => '300: Indicates multiple options for the resource that the client may follow.',\n '301' => '301: This and all future requests should be directed to the given URI.',\n '302' => '302: Required the client to perform a temporary redirect',\n '303' => '303: The response to the request can be found under another URI using a GET method.',\n '304' => '304: Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-Match.',\n '305' => '305: The requested resource is only available through a proxy, whose address is provided in the response.',\n '307' => '307: The request should be repeated with another URI',\n '308' => '308: The request, and all future requests should be repeated using another URI.',\n '400' => '400: The request cannot be fulfilled due to bad syntax.',\n '401' => '401: Authentication faild.',\n '403' => '403: The request was a valid request, but the server is refusing to respond to it.',\n '404' => '404: The requested resource could not be found but may be available again in the future.',\n '405' => '405: A request was made of a resource using a request method not supported by that resource.',\n '406' => '406: The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request',\n '407' => '407: The client must first authenticate itself with the proxy.',\n '408' => '408: The server timed out waiting for the request.',\n '409' => '409: Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.',\n '410' => '410: Indicates that the resource requested is no longer available and will not be available again.',\n '411' => '411: The request did not specify the length of its content, which is required by the requested resource.',\n '412' => '412: The server does not meet one of the preconditions that the requester put on the request.',\n '413' => '413: The request is larger than the server is willing or able to process.',\n '414' => '414: The URI provided was too long for the server to process',\n '415' => '415: The request entity has a media type which the server or resource does not support.',\n '416' => '416: The client has asked for a portion of the file, but the server cannot supply that portion.',\n '417' => '417: The server cannot meet the requirements of the Expect request-header field.',\n '419' => '419: Authentication Timeout denotes that previously valid authentication has expired.',\n '422' => '422: The request was well-formed but was unable to be followed due to semantic errors',\n '423' => '423: The resource that is being accessed is locked.',\n '424' => '424: The request failed due to failure of a previous request',\n '426' => '426: The client should switch to a different protocol such as TLS/1.0',\n '428' => '428: The origin server requires the request to be conditional.',\n '429' => '429: The user has sent too many requests in a given amount of time.',\n '431' => '431: The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.',\n '440' => '440: Your session has expired.',\n '444' => '444: The server did not return any information to the client and close the connection.',\n '449' => '449: The request should be retried after performing the appropriate action.',\n '450' => '450: Windows Parental Controls are turned on and are blocking access to the given webpage.',\n '451' => '451: If there either is a more efficient server to use or the server cannot access the users\\' mailbox.',\n '500' => '500: Internal Server Error.',\n '501' => '501: The server either does not recognize the request method, or it lacks the ability to fulfill the request.',\n '502' => '502: The server was acting as a gateway or proxy and received an invalid response from the upstream server.',\n '503' => '503: The server is currently unavailable.',\n '504' => '504: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.',\n '505' => '505: The server does not support the HTTP protocol version used in the request.',\n '507' => '507: The server is unable to store the representation needed to complete the request.',\n '508' => '508: The server detected an infinite loop while processing the request.',\n '509' => '509: Bandwidth Limit Exceeded.',\n '510' => '510: Further extensions to the request are required for the server to fulfill it.',\n '511' => '511: The client needs to authenticate to gain network access.',\n '598' => '598: The network read timeout behind the proxy to a client in front of the proxy.',\n '599' => '599: Network connect timeout behind the proxy to a client in front of the proxy.',\n );\n\n if (!empty($responseCodes[$code])) {\n return $responseCodes[$code];\n }\n\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'debug.file_link_formatter' shared service.
protected function getDebug_FileLinkFormatterService() { return $this->services['debug.file_link_formatter'] = new \Symfony\Component\HttpKernel\Debug\FileLinkFormatter(NULL); }
[ "protected function getDebug_FileLinkFormatterService()\n {\n return $this->privates['debug.file_link_formatter'] = new \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter(NULL, ($this->services['request_stack'] ?? ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())), \\dirname(__DIR__, 4), function () {\n return ($this->privates['debug.file_link_formatter.url_format'] ?? $this->load('getDebug_FileLinkFormatter_UrlFormatService.php'));\n });\n }", "protected function getDebug_FileLinkFormatterService()\n {\n return $this->privates['debug.file_link_formatter'] = new \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter(NULL, ($this->services['request_stack'] ?? ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())), \\dirname(__DIR__, 4), function () {\n return ($this->privates['debug.file_link_formatter.url_format'] ?? $this->getDebug_FileLinkFormatter_UrlFormatService());\n });\n }", "protected function getDebug_FileLinkFormatterService()\n {\n return $this->privates['debug.file_link_formatter'] = new \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter(NULL, ($this->services['request_stack'] ?? $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack()), $this->targetDirs[3], function () {\n return ($this->privates['debug.file_link_formatter.url_format'] ?? $this->load('getDebug_FileLinkFormatter_UrlFormatService.php'));\n });\n }", "protected function getDebug_FileLinkFormatterService()\n {\n return $this->services['debug.file_link_formatter'] = new \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter(NULL, ${($_ = isset($this->services['request_stack']) ? $this->services['request_stack'] : $this->get('request_stack', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'}, $this->targetDirs[3], '/_profiler/open?file=%f&line=%l#line%l');\n }", "protected function getDebug_FileLinkFormatterService()\n {\n return $this->services['debug.file_link_formatter'] = new \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter(NULL, ${($_ = isset($this->services['request_stack']) ? $this->services['request_stack'] : ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())) && false ?: '_'}, $this->targetDirs[4], function () {\n return ${($_ = isset($this->services['debug.file_link_formatter.url_format']) ? $this->services['debug.file_link_formatter.url_format'] : $this->load('getDebug_FileLinkFormatter_UrlFormatService.php')) && false ?: '_'};\n });\n }", "protected function getDebug_FileLinkFormatter_UrlFormatService()\n {\n return $this->privates['debug.file_link_formatter.url_format'] = \\Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter::generateUrlFormat(($this->services['router'] ?? $this->getRouterService()), '_profiler_open_file', '?file=%f&line=%l#line%l');\n }", "protected function getDiff_FormatterService()\n {\n return $this->services['diff.formatter'] = new \\Drupal\\Core\\Diff\\DiffFormatter($this->get('config.factory'));\n }", "protected function getApp_FormatterService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php';\n include_once \\dirname(__DIR__, 4).'/src/Service/Formatter.php';\n\n $a = ($this->services['monolog.logger.trace'] ?? $this->getMonolog_Logger_TraceService());\n\n if (isset($this->services['app.formatter'])) {\n return $this->services['app.formatter'];\n }\n\n return $this->services['app.formatter'] = new \\App\\Service\\Formatter($a, ($this->services['lexik_jwt_authentication.jwt_manager'] ?? $this->getLexikJwtAuthentication_JwtManagerService()));\n }", "public function getFormatter()\n {\n }", "public function getFormatter()\n {\n\n }", "protected function getEntryFormatter()\n {\n if (!$this->entryFormatter) {\n $this->entryFormatter = Application::getFacadeApplication()->make(EntryFormatterInterface::class);\n }\n\n return $this->entryFormatter;\n }", "public function pathFormatter()\n {\n return $this->formatPathUsing ?: function ($path) {\n return $path;\n };\n }", "public static function formatService(): FormatService {\n return self::getContainer()->get(FormatService::class);\n }", "public function getUrlFormatter(): \\Yana\\Views\\Helpers\\Formatters\\UrlFormatter;", "protected function getCopyCutFileViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Filelist\\ViewHelpers\\Uri\\CopyCutFileViewHelper::class);\n }", "protected function getTextFormatter_S9e_LinkHelperService()\n {\n return $this->services['text_formatter.s9e.link_helper'] = new \\phpbb\\textformatter\\s9e\\link_helper();\n }", "protected function getTwig_Extension_CodeService()\n {\n return $this->privates['twig.extension.code'] = new \\Symfony\\Bridge\\Twig\\Extension\\CodeExtension(($this->privates['debug.file_link_formatter'] ?? $this->getDebug_FileLinkFormatterService()), \\dirname(__DIR__, 4), 'UTF-8');\n }", "public function getFormatter()\n\t{}", "public function formatterManager()\n {\n return $this->formatterManager;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of payment_date.
public function getPaymentDate() { return $this->payment_date; }
[ "public function getPaymentDate();", "public function getPaymentdate()\n\t{\n\t\treturn $this->paymentdate;\n\t}", "function getPaymentDate(){\n return $this->paymentDate; \n }", "public function getPaymentDueToDate();", "protected function getPaymentForDate(){\n }", "public function getSalaryPaymentDate($date);", "public function getPaidDate();", "function getDatePaid() {\n\t\treturn $this->getData('datePaid');\n\t}", "static public function paymentDueByDate()\n {\n return Utility::lastDayOfCurrentMonth();\n }", "public function getNextPaymentDate()\n {\n return $this->nextPaymentDate;\n }", "public function getDepositpaiddate()\n {\n return $this->depositpaiddate;\n }", "public function setPaymentDate($value) { $this->PaymentDate = $value; return $this; }", "public function getPaymentDueDate() {\n\t\treturn $this->paymentDueDate;\n\t}", "public function getLastPaymentDate()\n {\n return $this->last_payment_date;\n }", "public function getDatePaid()\n\t\t{\n\t\t\tif(isset($this->_date_paid)){\n\t\t\t\treturn $this->_date_paid;\t\n\t\t\t}\n\t\t}", "public function Get_Pay_Date_Calc() { return $this->pdc; }", "public function nextPaymentDate()\n\t{\n\t\t$data = $this->_getData();\n\t\t\n\t\treturn new \\IPS\\DateTime( $data['agreement_details']['next_billing_date'] );\n\t}", "public function getDate()\n {\n if ($this->type != PropertyType::DATE) {\n return PropertyType::convertType($this->value, PropertyType::DATE);\n }\n return $this->value;\n }", "abstract public function getPayoutDate(\\DateTime $date);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the user's Twitter followers count.
public function getTwitterFollowersCount() { $val = $this->_get(self::TWITTER_FOLLOWER_COUNT); return $val[self::COUNT]; }
[ "public function getFollowersCount() {\n\t\treturn $this->user->followers_count;\n\t}", "public static function twFollowers()\n {\n $consumerKey = Data::get('twConKey');\n $consumerSecret = Data::get('twConSec');\n $accessToken = Data::get('twToken');\n $tokenSecret = Data::get('twTokenSec');\n\n try {\n\n\n $twitter = new \\Twitter($consumerKey, $consumerSecret, $accessToken, $tokenSecret);\n $followerCount = $twitter->load(\\Twitter::ME);\n $fc = $followerCount[0]->user->followers_count;\n return $fc; // count twitter followers\n } catch (\\TwitterException $e) {\n\n return \"error\";\n }\n }", "public function getFollowersCount() {\n return (int)$this->getCounts()->followed_by;\n }", "public function followerCount(): int\n {\n $key = 'campaign_' . $this->campaign->id . '_follower_count';\n if ($this->has($key)) {\n return $this->get($key);\n }\n\n $data = $this->campaign->followers()->count();\n $this->forever($key, $data);\n return $data;\n }", "public static function getFollowersCount()\n {\n $user = Auth::user()->id;\n $f_id = Follow::where('follow_id', Auth::user()->id)->get();\n return sizeof($f_id);\n }", "public function follower_count() {\n return intval($this->redis->sCard($this->user_followed_by_db.$this->id));\n }", "public function getFollowersCount() {\n $query = $this->con->prepare(\"SELECT * FROM followers WHERE userTo=:userTo\");\n $query->bindParam(\":userTo\", $username);\n $username = $this->getUsername();\n\n $query->execute();\n return $query->rowCount();\n }", "public function getNumberOfFollowersAttribute(): int\n {\n return $this->getNumberOfFollowers();\n }", "function getFollowersAmount(): int\n {\n return $this->db->query('SELECT * FROM friends WHERE friend = ?', $this->userObject['id'])->numRows();\n }", "protected function get_num_following() {\n global $dbh;\n \n $query = \"\n SELECT COUNT(*) AS `num_following` FROM `follows`\n WHERE `from_id` = :from_id\";\n $sth = $dbh->prepare($query);\n $sth->bindValue('from_id', $this->id);\n $sth->execute();\n return (int)$sth->fetchColumn();\n }", "function ft_twitter_followwer_count($username){\n\n\t\n\n\t$tw = get_option(\"twitterfollowerscount\");\n\n\t\n\n\tif($tw['lastcheck'] < mktime() - 3600)\n\n\t{\n\n\t\t$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name='.$username);\n\n\t\tif (preg_match('/followers_count>(.*)</',$xml,$match)!=0) \n\n\t\t{\n\n\t\t\t$tw['count'] = $match[1];\n\n\t\t}\n\n\t\t$tw['lastcheck'] = mktime();\n\n\t\tupdate_option(\"twitterfollowerscount\",$tw);\n\n\t}\n\n\t\n\n\treturn $tw['count'];\n\n}", "public function followsHowMany(){\n return $this->blogs->count();\n }", "public function getStatisticsFollowers()\n {\n return $this->statistics_followers;\n }", "function getNumFollowing(){\n\t\tif ($this->validUser){\n\t\t\t$this->numFollowing = $this->getNumbers(NUM_FOLLOWING_POSITION);\n\t\t\treturn $this->numFollowing;\n\t\t}\n\t\telse\n\t\t\treturn ERROR_INVALID_USER; // the user is not valid\n\t}", "function get_twitter_count() {\n return $this->twitter_count;\n }", "function twounter_followers($username) {\n\t global $wpdb;\n\t \n\t $sql = 'SELECT *\n\t FROM ' . $wpdb->prefix . 'twounter\n\t WHERE twounter_twitter_id = \"' . $username . '\"';\n\t $followers = $wpdb->get_results($sql);\n\t $now = strtotime(date('Y-m-d H:i:s'));\n\t $api_call = strtotime($followers[0]->twounter_time);\n\t $difference = $now - $api_call;\n\t $api_time_seconds = 18000;\n\t \n\t if(!$followers || $difference >= $api_time_seconds) {\n\t $api_page = 'http://twitter.com/users/show/' . $username;\n\t $xml = file_get_contents($api_page);\n\t \n\t $profile = new SimpleXMLElement($xml);\n\t \n\t $sql = 'INSERT into ' . $wpdb->prefix . 'twounter\n\t (twounter_twitter_id, twounter_followers, twounter_time)\n\t VALUES(\"' . $username . '\", ' . $profile->followers_count . ', \"' . date('Y-m-d H:i:s') . '\")';\n\t @$query = $wpdb->query($sql);\n\t \n\t if(!$query) {\n\t $sql = 'UPDATE ' . $wpdb->prefix . 'twounter \n\t SET twounter_followers = ' . $profile->followers_count . ',\n\t twounter_time = \"' . date('Y-m-d H:i:s') . '\" \n\t WHERE twounter_twitter_id = \"' . $username . '\"';\n\t $query = $wpdb->query($sql);\n\t }\n\t } else {\n\t $profile->followers_count = $followers[0]->twounter_followers;\n\t }\n\t \n\t return number_format($profile->followers_count);\n}", "public function followFollowers()\r\n {\r\n $this->debug('Checking for followers');\r\n \r\n $nbFollowers = 0;\r\n \r\n $limit = self::MAX_FOLLOWING;\r\n \r\n foreach ($this->client->getFollowers() as $follower)\r\n {\r\n if ($this->getBotAccountInfo('friends_count') >= $limit - $nbFollowers)\r\n {\r\n $this->debug('Max followers number reached, skipped mass following process');\r\n \r\n return 0;\r\n }\r\n \r\n if ($this->client->existsFriendship($this->getUsername(), $follower['screen_name']))\r\n {\r\n continue;\r\n }\r\n\r\n try\r\n {\r\n $this->client->createFriendship($follower['screen_name'], true);\r\n \r\n $this->debug(sprintf('Following new follower: \"%s\"', $follower['screen_name']));\r\n \r\n $nbFollowers++;\r\n }\r\n catch (Exception $e)\r\n {\r\n $this->debug(sprintf('Skipping following \"%s\": \"%s\"', $follower['screen_name'], $e->getMessage()));\r\n }\r\n }\r\n \r\n $this->debug(sprintf('%s follower%s added', 0 === $nbFollowers ? 'No' : (string) $nbFollowers, $nbFollowers > 1 ? 's' : ''));\r\n \r\n return $nbFollowers;\r\n }", "function pwuf_increase_followed_by_count( $user_id ) {\n do_action( 'pwuf_pre_increase_followed_count', $user_id );\n\n $followed_count = pwuf_get_follower_count( $user_id );\n \n if ( $followed_count !== false ) {\n \n $new_followed_count = update_user_meta( $user_id, '_pwuf_followed_by_count', $followed_count + 1 );\n \n } else {\n \n $new_followed_count = update_user_meta( $user_id, '_pwuf_followed_by_count', 1 );\n \n }\n\n do_action( 'pwuf_post_increase_followed_count', $user_id );\n\n return $new_followed_count;\n}", "private function getNumberOfTweets()\n {\n return $this->_helper->getNumberOfTweets();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the size of the resulting table. The table will be forced to this size, regardless of whether or not there is enough (or too much) data to fill it up. If the table size (rows cols) is smaller than the amount of data given to us, only (rows cols) items are laid out.
function setTableSize($rows = 0, $cols = 0) { $this->_rows = $rows; $this->_cols = $cols; }
[ "function SetDefaultColSize($width, $resizeExistingCols=false){}", "public function resizeTable(int $size = null)\n {\n if ($size !== null) {\n $this->currentMaxSize = \\max(0, \\min($size, $this->hardMaxSize));\n }\n while ($this->size > $this->currentMaxSize) {\n list($name, $value) = \\array_pop($this->headers);\n $this->size -= 32 + \\strlen($name) + \\strlen($value);\n }\n }", "function set_table_width( $width = 400 )\n {\n $this->_table_width = $width;\n return true;\n }", "public function resizeTable(int $size = null) /* : void */\n {\n if ($size !== null) {\n $this->currentMaxSize = \\max(0, \\min($size, $this->hardMaxSize));\n }\n\n while ($this->size > $this->currentMaxSize) {\n [$name, $value] = \\array_pop($this->headers);\n $this->size -= 32 + \\strlen($name) + \\strlen($value);\n }\n }", "function _setWidthTable($font,$fontSize)\n {\n global $svg;\n\n foreach ($this->fields as $field) {\n $this->width = max($this->width, $svg->getStringWidth($field,$font,$fontSize));\n }\n $this->width += $svg->getStringWidth(' ',$font,$fontSize);\n /*\n * it is unknown what value must be added, because\n * table title is affected by the tabe width value\n */\n while ($this->width < $svg->getStringWidth($this->_getTitle(),$font,$fontSize)) {\n $this->width += 7;\n }\n }", "function GetDefaultColSize(){}", "function _populateSizesTable()\n {\n $this->out('Gathering current \"size\" column information from old column ...');\n $speakers = $this->Speaker->find(\"all\");\n $sizes = array();\n foreach ($speakers as $speaker) {\n $size = $speaker['Speaker'][$this->oldColumn];\n $sizes[$size] = $size;\n }\n ksort($sizes,SORT_STRING);\n $this->out(\"Inserting data into table ....\");\n $key = 1;\n foreach ($sizes as $size) {\n $data = array('Size' => array(\n \"description\" => $size,\n \"id\" => $key++,\n ));\n $this->Size->create();\n if ( ! $this->Size->save($data) ) {\n $this->err('Error saving size information');\n exit;\n }\n $this->out('Saved size: '.$size);\n }\n }", "function _calculateSize()\n {\n reset($this->_data);\n $n = count($this->_data);\n\n if (!$this->_rows && $this->_cols) {\n $this->_rows = ceil($n / $this->_cols);\n } else if (!$this->_cols && $this->_rows) {\n $this->_cols = ceil($n / $this->_rows);\n }\n }", "function _setHeightTable($fontSize)\n {\n $this->heightCell = $fontSize + 4;\n $this->height = (count($this->fields) + 1) * $this->heightCell;\n }", "private function setArrayOfTableCells()\n {\n $arrayOfTableCells = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $arrayOfTableCells[$i] = $i;\n }\n $this->arrayOfTableCells = $arrayOfTableCells;\n }", "public function setAllTablesSameWidth($value)\n {\n $this->sameWide = $value;\n }", "public function setTableSizeLimit(int $maxSize) /* : void */\n {\n $this->hardMaxSize = $maxSize;\n }", "public function resetColumnSize()\n {\n $this->indexColumnSizes = array();\n }", "private function buildTable()\n\t{\t\t\n\t\t// Build the type (adding all columns).\n\t\t$this->tableType->buildTable($this->tableBuilder);\n\n\t\t// Build the filters, if the table type implements \n\t\t// the FilterInterface\n\t\tif($this->isFilterProvider())\n\t\t{\n\t\t\t$this->tableType->buildFilter($this->filterBuilder);\n\t\t}\n\t\t\n\t\t// Resolve all options, defined in the table type.\n\t\t$this->resolveOptions();\n\t\t\n\t\t// Initialise the row counter, raise the counter,\n\t\t// if the table uses pagination.\n\t\t// For example, the counter should start at 11, if \n\t\t// the table is on page 2 and uses 10 rows per page.\n\t\t$count = 0;\n\t\tif($this->pagination !== null)\n\t\t{\n\t\t\t$count = $this->pagination->getCurrentPage() * $this->pagination->getItemsPerRow();\n\t\t}\n\n\t\t// Store the data items as Row-Object in the $rows class var.\n\t\t// Additional increment the counter for each row.\n\t\t$data = $this->dataSource->getData(\n\t\t\t$this->container,\n\t\t\t$this->tableBuilder->getColumns(),\n\t\t\t$this->getFilters(),\n\t\t\t$this->pagination, \n\t\t\t$this->order\n\t\t);\n\n\t\tforeach($data as $dataRow)\n\t\t{\n\t\t\t$row = new Row($dataRow, ++$count);\n\t\t\t$row->setAttributes( $this->tableType->getRowAttributes($row) );\n\t\t\t\n\t\t\t$this->rows[] = $row;\n\t\t}\n\t\t\n\t\tif($this->options['hide_empty_columns'] === true && $this->totalItems > 0)\n\t\t{\n\t\t\tforeach($this->tableBuilder->getColumns() as $name => $column)\n\t\t\t{\n\t\t\t\t/* @var $column ColumnInterface */\n\n\t\t\t\tforeach($this->rows as $row)\n\t\t\t\t{\n\t\t\t\t\t/* @var $row Row */\n\t\t\t\t\t$content = $column->getContent($row);\n\t\t\t\t\tif($content !== null && $content !== \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->tableBuilder->removeColumn($name);\n\t\t\t}\n\t\t}\n\t}", "function GetRowSizes(){}", "function AutoSizeRow($row, $setAsMin=true){}", "public function setDefaultSize($size);", "private function _setHeightTable($fontSize)\n {\n $this->heightCell = $fontSize + 4;\n $this->height = (count($this->fields) + 1) * $this->heightCell;\n }", "protected function setPageSize(){\n $this->data['size'] = isset($this->data['size'] ) ? (int)$this->data['size'] : $this->default_size; \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creating a handler with too long of a name but using the v2 api doesn't matter.
public function testCreateWithTooLongNameV2() { $hipChatHandler = new HipChatHandler('token', 'room', 'SixteenCharsHere', false, Logger::CRITICAL, true, true, 'test', 'api.hipchat.com', 'v2'); }
[ "private function getHandlerName() {\n return '_h';\n }", "function handlerName(): string;", "static function getHandlerName ();", "public function testIfTooLongEntityTypeNamesAreCaughtInTime() {\n $this->createEntityType([], 'a27CharacterLongNameIssLong');\n $label = 'a28CharacterLongNameIsLonger';\n $edit = [\n 'label' => $label,\n 'id' => $id = strtolower($label),\n ];\n\n $this->drupalPostForm(Url::fromRoute('eck.entity_type.add'), $edit, $this->t('Create entity type'));\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->responseContains(\"Machine name cannot be longer than <em class=\\\"placeholder\\\">27</em> characters but is currently <em class=\\\"placeholder\\\">28</em> characters long.\");\n }", "public function testTooLongPersonalizer() {\n new HMAC_DRBG('', 256, str_repeat('*', 33));\n }", "public function getHandlerName();", "static function getHandlerId ()\n {\n return 'internal';\n }", "protected static function handlerName( string $name ) : string {\n\t\treturn \n\t\t\\PubCabin\\Handler::subclass( \n\t\t\t[ 'Modules', $name, 'Module' ] \n\t\t);\n\t}", "public function testInvalidDefinitionDuplicateLongName() {\n $def = new TestCommandLineArgumentDefinition(array(\n 'help|h' => 'help',\n 'help|v' => 'help2',\n ));\n\n $def->parseDefinitions();\n }", "public function testEntryValidationTokenNameTooLong()\n {\n // stops notification being physically sent when a user is created\n Notification::fake();\n\n $user = $this->loginAsFakeUser(true, 'reader');\n\n // stops events being fired\n Event::fake();\n\n $token_name = str::random(41);\n $this->followingRedirects()\n ->from('tokens/create')\n ->post('tokens', [\n 'name' => $token_name\n ])\n ->assertSee('Name must be between 3 and 40 characters.');\n }", "function createAccessHandler($handler) {\n new Accesshandler($handler);\n return;\n}", "public function getHandler($sName);", "function maxIdentifierLength()\n {\n return 30;\n }", "public function testCreateBankWithLongName(){\n //WxAppException expected\n $userId = TestIdGenerator::getUserId('uId06');\n $newBankName = 'TheLongestName(more than fifty 字数)Should not be Used';\n\n $this->setExpectedException('WxAppException', BankMessages::ERR_BANK_NAME_TOO_LONG);\n Bank::createBank($userId, $newBankName);\n }", "public function createHandler( $name )\n\t{\n\t\t$Handler = NyaaLogHandler::factory( $name, $this );\n\n\t\treturn $Handler;\n\t}", "public function test_create_bill_with_too_long_client_name() {\n\n $this->actingAs($this->user)\n ->post('/bills/create', ['client' => str_repeat('Alex', 16)])\n ->seeJson([\n 'success' => false,\n 'message' => trans('validation.max.string', ['attribute' => trans('validation.attributes.client'), 'max' => 60])\n ])\n ->notSeeInDatabase('clients', [\n 'user_id' => $this->user->id,\n 'name' => str_repeat('Alex', 16)\n ]);\n }", "static function getHandlerId ();", "public function testEditClientNameWithTooLongValue() {\n\n $this->withoutMiddleware();\n\n // Generate user and client\n $user = factory(App\\User::class)->create();\n $client = $user->clients()->save(factory(App\\Client::class)->make());\n\n $this->actingAs($user)\n ->post('/clients/' . $client->id . '/edit-name', ['name' => str_repeat($client->name, 50)])\n ->seeJson(['success' => false]);\n\n }", "abstract public function addHandler($name, $handler, array $opts = []);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to delete a Encadrant entity.
private function createDeleteForm(Encadrant $encadrant) { return $this->createFormBuilder() ->setAction($this->generateUrl('encadrant_delete', array('id' => $encadrant->getIdencadrant()))) ->setMethod('DELETE') ->getForm() ; }
[ "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getRfc())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Encuestador $encuestador)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_encuestador_delete', array('id' => $encuestador->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Antecedant $antecedant)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('antecedant_delete', array('id' => $antecedant->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CausaDescompensante $causaDescompensante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('causa_delete', array('id' => $causaDescompensante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(indexe $indexe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('indexe_delete', array('id' => $indexe->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private\n function createAnnonceeDeleteForm(Annonce $annonce)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annoncee_delete', array('id' => $annonce->getAnnonceId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Vente $vente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vente_delete', array('id' => $vente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Almacen $almacen)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('almacen_delete', array('id' => $almacen->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(MotifAbsence $motifabsence)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('motifabsence_delete', array('id' => $motifabsence->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Equiment $equiment)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_oprema_delete', array('id' => $equiment->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Insecte $insecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('insecte_delete', array('id' => $insecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RefMotifArrivee $refMotifArrivee) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('refmotifarrivee_delete', array('idMotiarri' => $refMotifArrivee->getIdmotiarri())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Agence $agence)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('agence_delete', array('id' => $agence->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Ecolabel $ecolabel)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ecolabel_delete', array('id' => $ecolabel->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Agence $agence)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('agence_delete', array('id' => $agence->getIdagence())))\n ->setMethod('DELETE')\n ->getForm();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ $model = stringa che indica il tipo di scheda $code = identificativo univoco ICCD $institute = istituto di appartenenza
function execute($model, $code, $institute) { header('Content-Type: application/json'); if(!__Config::get('metafad.getIccd.activate')) { return 'Servizio non disponibile.'; } $dam = pinax_ObjectFactory::createObject('metafad.dam.services.ImportMedia', $institute); $availableModels = json_decode(__Config::get('metafad.getIccd.availableModels')); if (!$model || !$code || !$institute) { return 'Errore, uno dei parametri obbligatori non è stato inviato correttamente.'; } //verifico che il valore di $model sia valido e che la scheda sia di una tipologia disponibile if (!in_array($model, $availableModels)) { return 'Tipologia di scheda scelta non disponibile'; } $form = pinax_ObjectFactory::createModelIterator($model . '.models.Model') ->where('instituteKey', $institute) ->where('uniqueIccdId', $code) ->first(); if (!$form) { return 'Scheda non disponibile, verificare i dati inseriti'; } $fields = $form->getValuesAsArray(false, true, false, false); if ($fields['FTA']) { foreach ($fields['FTA'] as $f) { if ($f->{'FTA-image'}) { $d = json_decode($f->{'FTA-image'}); $thumbnail = $dam->streamUrl($d->id,'thumbnail'); $original = $dam->streamUrl($d->id, 'original'); $d->thumbnail = $thumbnail; $d->original = $original; $f->{'FTA-image'} = $d; } } } //Se non c'è il parametro fieldsList restituisco tutto if (!__Request::get('fieldsList')) { $fields['data_ultima_modifica'] = $form->document_detail_modificationDate; echo json_encode($fields); } //Altrimenti filtro i valori else { $values = new stdClass(); foreach (explode(',', str_replace(' ', '', __Request::get('fieldsList'))) as $field) { $values->$field = $fields[$field]; } $values->data_ultima_modifica = $form->document_detail_modificationDate; echo json_encode($values); } exit; }
[ "function identifyVehicleAndOperatorByBuild()\n {\n echo $this->build_code;\n echo $this->vehicle_code;\n if ( $this->build_code && !$this->vehicle_code )\n {\n\t $vehicle_id = NULL;\n\t if (!($record = $this->odsconnector->getVehicleRecordByBuildCode($this->build_code)))\n\t {\n\t\t echo \"Unknown build_code $operator/$vehicle\\n\";\n\t\t return false;\n\t }\n\t $this->operator_code = $record[\"operator_code\"];\n\t $this->vehicle_code = $record[\"vehicle_code\"];\n\t $this->vehicle_id = $record[\"vehicle_id\"];\n\t $this->operator_id = $record[\"operator_id\"];\n }\n }", "private function convertProgramModel($soapModel) {\n $programModel = new Program();\n $programModel->address = $soapModel->nita_FacilityAddr1 . \":\" .\n $soapModel->nita_FacilityAddr2 . \":\" .\n $soapModel->nita_FacilityAddr3 . \":\" .\n $soapModel->nita_FacilityAddr4;\n $programModel->capacityMax = $soapModel->nita_MaxCapacity;\n $programModel->capacityMin = $soapModel->nita_MinCapacity;\n $programModel->city = $soapModel->nita_FacilityCity;\n \n $aId = explode(\"|\",$soapModel->nita_name);\n $programModel->code = trim($aId[0]);\n $programModel->description = $soapModel->nita_Description;\n $programModel->descriptor = $soapModel->nita_Descriptor;\n $programModel->dinnerDate = $soapModel->nita_FacultyDinnerDate;\n $programModel->dinnerLocation = $soapModel->nita_FacultyDinnerLocation;\n $programModel->director; // Not in ProgramModel\n $programModel->discounts; // Not in ProgramModel\n $programModel->duration = $soapModel->nita_Duration;\n $programModel->endDate = $soapModel->nita_EndDate;\n $programModel->id = $soapModel->nita_ProgramId;\n $programModel->location = $soapModel->nita_FacilityName;\n $programModel->name = $soapModel->nita_name;\n $programModel->price = $soapModel->nita_TuitionPriceStandard;\n $programModel->registerEnd = $soapModel->nita_RegistrationEndDate;\n $programModel->registerStart = $soapModel->nita_RegistrationBeginDate;\n $programModel->startDate = $soapModel->nita_StartDate;\n $programModel->state = $soapModel->nita_FacilityState;\n $programModel->title = $soapModel->nita_Title;\n $programModel->typeId = $soapModel->nita_programtypeid;\n $programModel->zip = $soapModel->nita_FacilityZip;\n \n // Format dates\n $programModel->endDate = $this->formatDate($programModel->endDate);\n $programModel->startDate = $this->formatDate($programModel->startDate);\n $programModel->registerEnd = $this->formatDate($programModel->registerEnd);\n $programModel->registerStart = $this->formatDate($programModel->registerStart);\n $programModel->dates = $programModel->startDate . ' - ' . $programModel->endDate;\n \n // Format numbers\n $programModel->price = number_format($programModel->price,2,'.','');\n \n // Format text\n $programModel->description = nl2br($programModel->description);\n \n // Format program types\n if(key_exists($programModel->typeId, $this->programTypeMap)) {\n $programModel->typeId = $this->programTypeMap[$programModel->typeId];\n }\n return $programModel;\n }", "public function getStations($cavw, $type) {\r\n $volcanoId = $this->getVolcanoId($cavw);\r\n $stations = \"\";\r\n $value = \"\";\r\n $code = \"\";\r\n\r\n $used_dd_ang=array();\r\n $used_dd_gps=array();\r\n $used_dd_edm=array();\r\n $used_dd_lev=array();\r\n $used_fd_ele=array();\r\n $used_fd_gra=array();\r\n $used_fd_mag=array();\r\n\r\n switch ($type) {\r\n case 'seismic':\r\n\r\n\r\n $stations = mysql_query(\"(select c.ss_code,c.ss_lat,c.ss_lon FROM sn a, ss c where a.vd_id = '$volcanoId' and a.sn_id = c.sn_id) UNION (select c.ss_code,c.ss_lat,c.ss_lon FROM jj_volnet a, ss c , vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'S' and a.jj_net_id = c.sn_id and (sqrt(power(d.vd_inf_slat - c.ss_lat, 2) + power(d.vd_inf_slon - c.ss_lon, 2))*100)<20)\") or die(mysql_error());\r\n while ($temp = mysql_fetch_array($stations)) {\r\n// get the station code\r\n $code = $temp[0];\r\n// sd_ivl\r\n $value = mysql_query(\"select a.ss_id from sd_ivl a, ss b where b.ss_code = '$code' and ((a.sn_id is not null and b.sn_id=a.sn_id) or (a.ss_id is not null and b.ss_id=a.ss_id)) limit 0,1\"); ;\r\n\r\n if($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&hdist&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&avgdepth&m;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&vdispers&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&hmigr_hyp&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&vmigr_hyp&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&nrec;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&nfelt;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&etot&erg;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&fmin&Hz;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&fmax&Hz;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&amin;\");\r\n $this->chkNull(\"Seismic&Interval&$code&$temp[1]&$temp[2]&amax;\");\r\n }\r\n\r\n\r\n// sd_rsm\r\n $value = mysql_query(\"select c.sd_rsm_id from ss a, sd_sam b, sd_rsm c where a.ss_code = '$code' and a.ss_id = b.ss_id and b.sd_sam_id = c.sd_sam_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&RSAM&$code&$temp[1]&$temp[2];\");\r\n break;\r\n }\r\n\r\n// sd_ssm\r\n $value = mysql_query(\"select c.sd_ssm_id from ss a, sd_sam b, sd_ssm c where a.ss_code = '$code' and a.ss_id = b.ss_id and b.sd_sam_id = c.sd_sam_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&SSAM&$code&$temp[1]&$temp[2]&lowf&Hz;\");\r\n $this->chkNull(\"Seismic&SSAM&$code&$temp[1]&$temp[2]&highf&Hz;\");\r\n $this->chkNull(\"Seismic&SSAM&$code&$temp[1]&$temp[2]&count;\");\r\n break;\r\n }\r\n\r\n\r\n// sd_evs\r\n $value = mysql_query(\"select b.ss_id from ss a, sd_evs b where a.ss_code = '$code' and a.ss_id = b.ss_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&EVS&$code&$temp[1]&$temp[2]&SPInterval;\");\r\n $this->chkNull(\"Seismic&EVS&$code&$temp[1]&$temp[2]&MaxAmpl;\");\r\n $this->chkNull(\"Seismic&EVS&$code&$temp[1]&$temp[2]&Duration;\");\r\n }\r\n\r\n// sd_int\r\n $value = mysql_query(\"select c.ss_id from ss a, sd_evs b, sd_int c where a.ss_code = '$code' and a.ss_id = b.ss_id and b.sd_evs_id=c.sd_evs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&INT&$code&$temp[1]&$temp[2]&MaxDist&km;\");\r\n $this->chkNull(\"Seismic&INT&$code&$temp[1]&$temp[2]&MaxRInt&km;\");\r\n $this->chkNull(\"Seismic&INT&$code&$temp[1]&$temp[2]&MaxRIntDist&km;\");\r\n } \r\n\r\n $value = mysql_query(\"select b.sd_trm_id from ss a, sd_trm b where a.ss_code = '$code' and ((b.sn_id is not null and b.sn_id=a.sn_id) or (b.ss_id is not null and b.ss_id=a.ss_id)) limit 0,1\") ;\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DurDay&min;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DomFreq1&Hz;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DomFreq2&Hz;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&MaxAmp;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&RedDis;\"); \r\n } \r\n }\r\n\r\n// sd_trm\r\n \r\n $value = mysql_query(\"select b.sd_trm_id from ss a, sd_trm b where a.ss_code = '$code' and ((b.sn_id is not null and b.sn_id=a.sn_id) or (b.ss_id is not null and b.ss_id=a.ss_id)) limit 0,1\") ;\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DurDay&min;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DomFreq1&Hz;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&DomFreq2&Hz;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&MaxAmp;\");\r\n $this->chkNull(\"Seismic&TRM&$code&$temp[1]&$temp[2]&RedDis;\"); \r\n }\r\n// sd_ivl by network\r\n $networks = mysql_query(\"select distinct(a.sn_code) from sn a, sd_ivl b where b.ss_id is null and b.sn_id = a.sn_id\");\r\n while($code = mysql_fetch_array(($networks))) {\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&hdist&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&avgdepth&m;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&vdispers&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&hmigr_hyp&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&vmigr_hyp&km;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&nrec;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&nfelt;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&etot&erg;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&fmin&Hz;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&fmax&Hz;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&amin;\");\r\n $this->chkNull(\"Seismic&Interval&$code&0&$0&amax;\");\r\n }\r\n\r\n\r\n break; \r\n case 'deformation':\r\n $stations = mysql_query(\"(select c.ds_code,c.ds_nlat,c.ds_nlon FROM cn a, ds c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id order by c.ds_code) UNION (select c.ds_code,c.ds_nlat,c.ds_nlon FROM jj_volnet a, ds c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and (sqrt(power(d.vd_inf_slat - c.ds_nlat, 2) + power(d.vd_inf_slon - c.ds_nlon, 2))*100)<20 ORDER BY c.ds_code)\") or die(mysql_error());\r\n// get the station code\r\n while ($temp = mysql_fetch_array($stations)) {\r\n $code = $temp[0];\r\n// dd_tlt\r\n $value = mysql_query(\"select b.ds_id from ds a, dd_tlt b where a.ds_code = '$code' and a.ds_id = b.ds_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Deformation&ElectronicTilt&$code&$temp[1]&$temp[2]&Tilt1&microradians;\");\r\n $this->chkNull(\"Deformation&ElectronicTilt&$code&$temp[1]&$temp[2]&Tilt2&microradians;\");\r\n $this->chkNull(\"Deformation&ElectronicTilt&$code&$temp[1]&$temp[2]&Temp&celsiusdegree;\");\r\n }\r\n// dd_tlv\r\n $value = mysql_query(\"select b.ds_id from ds a, dd_tlv b where a.ds_code = '$code' and a.ds_id = b.ds_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Deformation&TiltVector&$code&$temp[1]&$temp[2]&mag&microradians;\");\r\n $this->chkNull(\"Deformation&TiltVector&$code&$temp[1]&$temp[2]&azi&degree;\");\r\n }\r\n// dd_str\r\n $value = mysql_query(\"select b.ds_id from ds a, dd_str b where a.ds_code = '$code' and a.ds_id = b.ds_id limit 0 , 1\");\r\n\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&comp1&microstrain;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&comp2&microstrain;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&comp3&microstrain;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&comp4&microstrain;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&vdstr;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&sstr_ax1;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&azi_ax1;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&sstr_ax2;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&azi_ax2;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&sstr_ax3;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&azi_ax3;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&pmax;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&pmin;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&pmax_die;\");\r\n $this->chkNull(\"Deformation&Strain&$code&$temp[1]&$temp[2]&pmin_die;\");\r\n }\r\n// dd_edm\r\n $value = mysql_query(\"select distinct b.ds_id1, b.ds_id2 from ds a, dd_edm b where a.ds_code = '$code' and (a.ds_id = b.ds_id1 or a.ds_id = b.ds_id2)\");\r\n \r\n while ($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('ds_id1' => $row['ds_id1'], 'ds_id2' => $row['ds_id2']);\r\n $newcode = $this->getNewCode($parameter,'ds');\r\n if(!$used_dd_edm[$newcode]) {\r\n $used_dd_edm[$newcode]=true;\r\n $this->chkNull(\"Deformation&EDM&$newcode&$temp[1]&$temp[2]&undefined&m;\");\r\n }\r\n }\r\n\r\n// dd_ang\r\n $value = mysql_query(\"select distinct b.ds_id, b.ds_id1, b.ds_id2 from ds a, dd_ang b where a.ds_code = '$code' and (b.ds_id=a.ds_id or b.ds_id1=a.ds_id or b.ds_id2=a.ds_id)\");\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('ds_id' => $row['ds_id'], 'ds_id1' => $row['ds_id1'], 'ds_id2' => $row['ds_id2']);\r\n $newcode = $this->getNewCode($parameter,'ds');\r\n\r\n if(!$used_dd_ang[$newcode]) {\r\n $this->chkNull(\"Deformation&Angle&$newcode&$temp[1]&$temp[2]&Hort1&degree;\");\r\n $this->chkNull(\"Deformation&Angle&$newcode&$temp[1]&$temp[2]&Hort2&degree;\");\r\n $this->chkNull(\"Deformation&Angle&$newcode&$temp[1]&$temp[2]&Vert1&degree;\");\r\n $this->chkNull(\"Deformation&Angle&$newcode&$temp[1]&$temp[2]&Vert2&degree;\");\r\n $used_dd_ang[$newcode]=true;\r\n }\r\n }\r\n// dd_gps\r\n $value = mysql_query(\"select distinct b.ds_id, b.ds_id_ref1, b.ds_id_ref2 from ds a, dd_gps b where a.ds_code = '$code' and b.ds_id=a.ds_id\");\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('ds_id' => $row['ds_id'], 'ds_id_ref1' => $row['ds_id_ref1'], 'ds_id_ref2' => $row['ds_id_ref2']);\r\n $newcode = $this->getNewCode($parameter,'ds');\r\n \r\n if(!$used_dd_gps[$newcode]) {\r\n $this->chkNull(\"Deformation&GPS&$newcode&$temp[1]&$temp[2]&Lat&degree;\");\r\n $this->chkNull(\"Deformation&GPS&$newcode&$temp[1]&$temp[2]&Lon&degree;\");\r\n $this->chkNull(\"Deformation&GPS&$newcode&$temp[1]&$temp[2]&Elev&m;\");\r\n $used_dd_gps[$newcode]=true;\r\n }\r\n }\r\n\r\n\r\n// dd_gpv\r\n $value = mysql_query(\"select b.ds_id from ds a, dd_gpv b where a.ds_code = '$code' and a.ds_id = b.ds_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Deformation&GPSVector&$code&$temp[1]&$temp[2]&dmag&mm;\");\r\n $this->chkNull(\"Deformation&GPSVector&$code&$temp[1]&$temp[2]&daz&degree;\");\r\n $this->chkNull(\"Deformation&GPSVector&$code&$temp[1]&$temp[2]&NS&mm;\");\r\n $this->chkNull(\"Deformation&GPSVector&$code&$temp[1]&$temp[2]&EW&mm;\");\r\n $this->chkNull(\"Deformation&GPSVector&$code&$temp[1]&$temp[2]&Z&mm;\");\r\n }\r\n// dd_lev\r\n $query = \"select distinct b.ds_id_ref, b.ds_id1, b.ds_id2 from ds a, dd_lev b where a.ds_code = '$code' and ((a.ds_id = b.ds_id1) or (a.ds_id=b.ds_id2) or (a.ds_id=b.ds_id_ref)) limit 0 , 1\";\r\n $value = mysql_query($query);\r\n\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('ds_id_ref' => $row['ds_id_ref'], 'ds_id1' => $row['ds_id1'], 'ds_id2' => $row['ds_id2']);\r\n $newcode = $this->getNewCode($parameter,'ds');\r\n\r\n if(!$used_dd_lev[$newcode]) {\r\n $used_dd_lev[$newcode] = true;\r\n $this->chkNull(\"Deformation&Leveling&$newcode&$temp[1]&$temp[2]&m;\");\r\n }\r\n }\r\n// dd_sar: no station? , how to display the data\r\n// use volcano id instead\r\n $value = mysql_query(\"select vd_id from dd_sar where vd_id = '$volcanoId' limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Deformation&InSAR&$code&$temp[1]&$temp[2];\");\r\n }\r\n }\r\n break;\r\n case 'field':\r\n $stations = mysql_query(\"(select c.fs_code,c.fs_lat,c.fs_lon FROM cn a, fs c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id order by c.fs_code) UNION (select c.fs_code,c.fs_lat,c.fs_lon FROM jj_volnet a, fs c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and (sqrt(power(d.vd_inf_slat - c.fs_lat, 2) + power(d.vd_inf_slon - c.fs_lon, 2))*100)<20 ORDER BY c.fs_code)\") or die(mysql_error());\r\n\r\n while ($temp = mysql_fetch_array($stations)) {\r\n $code = $temp[0];\r\n// fd_ele\r\n\r\n $value = mysql_query(\"select distinct b.fs_id1, b.fs_id2 from fs a, fd_ele b where a.fs_code = '$code' and (b.fs_id1=a.fs_id or b.fs_id2=a.fs_id)\");\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('fs_id1' => $row['fs_id1'], 'fs_id2' => $row['fs_id2']);\r\n $newcode = $this->getNewCode($parameter,'fs');\r\n if(!$used_fd_ele[$newcode]) {\r\n $this->chkNull(\"Field&ElectricFields&$newcode&$temp[1]&$temp[2]&field;\");\r\n $this->chkNull(\"Field&ElectricFields&$newcode&$temp[1]&$temp[2]&spot;\");\r\n $this->chkNull(\"Field&ElectricFields&$newcode&$temp[1]&$temp[2]&ares;\");\r\n $this->chkNull(\"Field&ElectricFields&$newcode&$temp[1]&$temp[2]&dres;\");\r\n $used_fd_ele[$newcode]=true;\r\n }\r\n }\r\n\r\n// fd_gra\r\n $value = mysql_query(\"select distinct b.fs_id, b.fs_id_ref from fs a, fd_gra b where a.fs_code = '$code' and (b.fs_id=a.fs_id or b.fs_id_ref=a.fs_id)\");\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('fs_id' => $row['fs_id'], 'fs_id_ref' => $row['fs_id_ref']);\r\n $newcode = $this->getNewCode($parameter,'fs');\r\n if(!$used_fd_gra[$newcode]) {\r\n $this->chkNull(\"Field&Gravity&$newcode&$temp[1]&$temp[2]&fstr;\");\r\n $used_fd_gra[$newcode]=true;\r\n }\r\n }\r\n// fd_mag\r\n $value = mysql_query(\"select distinct b.fs_id, b.fs_id_ref from fs a, fd_mag b where a.fs_code = '$code' and (b.fs_id=a.fs_id or b.fs_id_ref=a.fs_id)\");\r\n while($row = mysql_fetch_assoc($value)) {\r\n $parameter = array('fs_id' => $row['fs_id'], 'fs_id_ref' => $row['fs_id_ref']);\r\n $newcode = $this->getNewCode($parameter,'fs');\r\n if(!$used_fd_mag[$newcode]) {\r\n $this->chkNull(\"Field&MagneticFields&$newcode&$temp[1]&$temp[2]&f;\");\r\n $this->chkNull(\"Field&MagneticFields&$newcode&$temp[1]&$temp[2]&compx;\");\r\n $this->chkNull(\"Field&MagneticFields&$newcode&$temp[1]&$temp[2]&compy;\");\r\n $this->chkNull(\"Field&MagneticFields&$newcode&$temp[1]&$temp[2]&compz;\");\r\n $used_fd_mag[$newcode]=true;\r\n }\r\n }\r\n\r\n// fd_mgv\r\n $value = mysql_query(\"select fd_mgv_id from fs , fd_gra where fs.fs_code = '$code' and fs.fs_id = fd_mgv.fs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Field&MagneticVector&$code&$temp[1]&$temp[2]&Dec;\");\r\n $this->chkNull(\"Field&MagneticVector&$code&$temp[1]&$temp[2]&Incl;\");\r\n }\r\n }\r\n\r\n\r\n break;\r\n case 'gas':\r\n $used_gd_plu=array();\r\n\r\n $stations = mysql_query(\"(select c.gs_code, c.gs_lat, c.gs_lon FROM cn a, gs c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id) \r\n UNION (select c.gs_code,c.gs_lat,c.gs_lon FROM jj_volnet a, gs c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id \r\n and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and \r\n (sqrt(power(d.vd_inf_slat - c.gs_lat, 2) + power(d.vd_inf_slon - c.gs_lon, 2))*100)<20 ORDER BY c.gs_code)\") or die(mysql_error());\r\n while ($temp = mysql_fetch_array($stations)) {\r\n $code = $temp[0];\r\n// gd\r\n $value = mysql_query(\"select gd_id from gs, gd where gs.gs_code = '$code' and gs.gs_id = gd.gs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Gas&SampledGas&$code&$temp[1]&$temp[2]&gd_gtemp;\");\r\n $this->chkNull(\"Gas&SampledGas&$code&$temp[1]&$temp[2]&gd_bp;\");\r\n $this->chkNull(\"Gas&SampledGas&$code&$temp[1]&$temp[2]&gd_flow;\");\r\n $this->chkNull(\"Gas&SampledGas&$code&$temp[1]&$temp[2]&gd_concentration;\");\r\n }\r\n// gd_plu\r\n $value = mysql_query(\"select gd_plu_id from gs , gd_plu where gs.gs_code = '$code' and gs.gs_id = gd_plu.gs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Gas&Plume&$code&$temp[1]&$temp[2]&gd_plu_height;\");\r\n $this->chkNull(\"Gas&Plume&$code&$temp[1]&$temp[2]&gd_plu_emit;\");\r\n }\r\n\r\n// gd_sol\r\n $value = mysql_query(\"select gd_sol_id from gs , gd_sol where gs.gs_code = '$code' and gs.gs_id = gd_sol.gs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Gas&SoilEfflux&$code&$temp[1]&$temp[2]&gd_sol_tflux;\");\r\n $this->chkNull(\"Gas&SoilEfflux&$code&$temp[1]&$temp[2]&gd_sol_high;\");\r\n $this->chkNull(\"Gas&SoilEfflux&$code&$temp[1]&$temp[2]&gd_sol_htemp;\");\r\n }\r\n }\r\n\r\n// gd_plu using satelite or airplane data\r\n $value = mysql_query(\"select distinct concat_ws('___',cs.cs_code, gd_plu.gd_plu_lat, gd_plu.gd_plu_lon), gd_plu.gd_plu_lat, gd_plu.gd_plu_lon from cs, gd_plu where gd_plu.cs_id is not null and cs.cs_id = gd_plu.cs_id and gd_plu.vd_id = '$volcanoId'\");\r\n while ($temp = mysql_fetch_array($value)) {\r\n $code = $temp[0];\r\n $this->chkNull(\"Gas&Plume&$code&$temp[1]&$temp[2]&gd_plu_height;\");\r\n $this->chkNull(\"Gas&Plume&$code&$temp[1]&$temp[2]&gd_plu_emit;\");\r\n }\r\n break;\r\n case 'hydrologic':\r\n $stations = mysql_query(\"(select c.hs_code,c.hs_lat,c.hs_lon FROM cn a, hs c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id) UNION (select c.hs_code,c.hs_lat,c.hs_lon FROM jj_volnet a, hs c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and (sqrt(power(d.vd_inf_slat - c.hs_lat, 2) + power(d.vd_inf_slon - c.hs_lon, 2))*100)<30 ORDER BY c.hs_code)\") or die(mysql_error());\r\n while ($temp = mysql_fetch_array($stations)) {\r\n\r\n $code = $temp[0];\r\n// hd\r\n $value = mysql_query(\"select hd_id from hs, hd where hs_code = '$code' and hs.hs_id = hd.hs_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&welev;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&temp;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&wdepth;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&bp;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&dwlev;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&sdisc;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&prec;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&dprec;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&ph;\"); \r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&cond;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&comp_content;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&a_temp;\");\r\n $this->chkNull(\"Hydrologic&Data&$code&$temp[1]&$temp[2]&tds;\");\r\n }\r\n }\r\n break;\r\n case 'thermal':\r\n $stations = mysql_query(\"(select c.ts_code,c.ts_lat,c.ts_lon FROM cn a, ts c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id) UNION (select c.ts_code,c.ts_lat,c.ts_lon FROM jj_volnet a, ts c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and (sqrt(power(d.vd_inf_slat - c.ts_lat, 2) + power(d.vd_inf_slon - c.ts_lon, 2))*100)<20 ORDER BY c.ts_code)\") or die(mysql_error());\r\n while ($temp = mysql_fetch_array($stations)) {\r\n $code = $temp[0];\r\n// td\r\n $value = mysql_query(\"select td_id from ts,td where ts_code = '$code' and ts.ts_id = td.ts_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Thermal&Data&$code&$temp[1]&$temp[2]&temp;\");\r\n $this->chkNull(\"Thermal&Data&$code&$temp[1]&$temp[2]&flux;\");\r\n $this->chkNull(\"Thermal&Data&$code&$temp[1]&$temp[2]&bkgg;\");\r\n $this->chkNull(\"Thermal&Data&$code&$temp[1]&$temp[2]&tcond;\"); \r\n } \r\n// td_img\r\n $value = mysql_query(\"select td_id from ts, td_img where ts.ts_code = '$code' and ts.ts_id = td_img.ts_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxrrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxtemp;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&totrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxflux;\");\r\n }\r\n }\r\n\r\n// td_img using satellite\r\n $value = mysql_query(\"select distinct concat_ws('___',cs.cs_code, td_img.td_img_ilat, td_img.td_img_ilon), td_img.td_img_ilat, td_img.td_img_ilon from cs, td_img where td_img.cs_id is not null and cs.cs_id = td_img.cs_id and td_img.vd_id = '$volcanoId'\");\r\n while ($temp = mysql_fetch_array($value)) {\r\n $code = $temp[0];\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxrrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxtemp;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&totrad;\");\r\n $this->chkNull(\"Thermal&ThermalImage&$code&$temp[1]&$temp[2]&maxflux;\");\r\n }\r\n break;\r\n case 'meteo':\r\n $stations = mysql_query(\"(select c.ms_code,c.ms_lat,c.ms_lon FROM cn a, ms c where a.vd_id = '$volcanoId' and a.cn_id = c.cn_id) UNION (select c.ms_code,c.ms_lat,c.ms_lon FROM jj_volnet a, ms c,vd_inf d WHERE a.vd_id = '$volcanoId' and a.vd_id=d.vd_id and a.jj_net_flag = 'C' and a.jj_net_id = c.cn_id and (sqrt(power(d.vd_inf_slat - c.ms_lat, 2) + power(d.vd_inf_slon - c.ms_lon, 2))*100)<30 ORDER BY c.ms_code)\") or die(mysql_error());\r\n while ($temp = mysql_fetch_array($stations)) {\r\n $code = $temp[0];\r\n// hd\r\n $value = mysql_query(\"select med_id from ms, med where ms_code = '$code' and ms.ms_id = med.ms_id limit 0 , 1\");\r\n if ($value && mysql_num_rows($value)) {\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&temp;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&stemp;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&bp;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&prec;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&hd;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&wind;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&wsmax;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&wdir;\");\r\n $this->chkNull(\"Meteo&Data&$code&$temp[1]&$temp[2]&clc;\");\r\n }\r\n }\r\n break;\r\n }\r\n\r\n\r\n }", "private function interpretU2Line($params)\n {\n \n for($i = 0;$i < ($params[2]);$i++)\n {\n $n=($i*6+3);\n $day = $params[$n];\n if(($params[$n+1])!= null)\n {\n $startTime = clone($this->startingTimes[($params[$n+1])-1]);\n $endTime = clone($this->startingTimes[($params[$n+1])-1]);\n $endTime->add(new DateInterval('PT'.$this->mins.'M'));\n }\n $roomShrt = $params[$n+3];\n $profShrt = $params[$n+4];\n \n array_push($this->appointments, array('id'=>$params[1],'day'=>$day,'start'=>$startTime,'end'=>$endTime,'room'=>$this->alterString($roomShrt),\n 'prof'=>$this->alterString($profShrt),'subject'=>$this->currentCourse,'classes'=>$this->current_classes,'week'=> $this->current_weekly_rotation));\n }\n }", "function get_consult_inscription_course_in_schedule($code_student,$code_course){\n\t\t\t$sql = \"SELECT concat(t1.gasi_id,'-',t1.asig_descripcion)grupo\n\t\t\t\t\tFROM (\n\t\t\t\t\t\t\tSELECT ga.gasi_id,\n\t\t\t\t\t\t\tconcat(d.doce_nombres,' ', d.doce_apellidos) nomdocente,a.asig_descripcion, \n\t\t\t\t\t\t\tconcat(hg.hgru_diasemana,' ',hgru_horaini,'-', hgru_horafin)hora1, \n\t\t\t\t\t\t\tcase when he.hest_anio != 'null' then 'false' else 'true' end inscribir\n\t\t\t\t\t\t\tFROM grupos_asignatura ga\n\t\t\t\t\t\t\tINNER JOIN docente d\n\t\t\t\t\t\t\tON d.doce_codigo = ga.doce_codigo\n\t\t\t\t\t\t\tINNER JOIN asignatura a \n\t\t\t\t\t\t\tON a.asig_codigo = ga.asig_codigo\n\t\t\t\t\t\t\tINNER JOIN horario_grupoasig hg \n\t\t\t\t\t\t\tON hg.gasi_id = ga.gasi_id\n\t\t\t\t\t\t\tLEFT JOIN horario_estudiante he\n\t\t\t\t\t\t\tON he.gasi_id = ga.gasi_id\n\t\t\t\t\t\t\tAND he.estu_codigo = '{$code_student}'\n\t\t\t\t\t\t\tWHERE ga.asig_codigo = '{$code_course}'\n\t\t\t\t\t\t )t1\n\t\t\t\t\tWHERE t1.inscribir = 'false'\n\t\t\t\t\tGROUP BY t1.gasi_id, t1.asig_descripcion\";\n\t\t\t\t$result = $this->conn->query($sql);\n\t if ($result->num_rows > 0) {\n\t \t$rows = array();\n\t\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\t\t$rows[] = array_map('stripslashes',$row);\n\t\t\t\t} \n\t return $rows[0];\n\t } else {\n\t return NULL;\n\t }\t\t\t\t\n\t\t}", "function vcn_provider_program_edit($unitid, $programid, $cipcode) {\r\n\r\n\treturn drupal_get_form('vcnprovider_program_form', $unitid, $programid, $cipcode);\r\n\r\n}", "function run_model($array_of_computers, $mysqli)\n{\n\n # Store the name of the APTs\n $apt_name = [];\n $phases = [];\n $apts2 = [];\n # We're running this query to make sure that the model will have every technique\n # regardless of whether it's observered or not. If we don't do this, we can run\n # into errors. This came up during testing.\n $query = \"SELECT * FROM attack_patterns\";\n $results = $mysqli->query(\"$query\");\n while ($row = $results->fetch_assoc()) {\n $testVar = $row['Name'];\n $apt_name = $row['Phase'];\n array_push($apts2, $apt_name);\n if (!array_key_exists($testVar, $phases)) {\n $phases[$testVar] = 1;\n }\n }\n\n # Now we have all the possible techniques.\n $array_of_techniques = array_keys($phases);\n\n # Run the query and save the results to $results\n $query = \"SELECT `groupname` FROM `groups_and_techniques`\";\n $results = $mysqli->query($query);\n $aptnames = [];\n\n while ($row = $results->fetch_assoc()) {\n array_push($aptnames, $row['groupname']);\n }\n\n # Lets create the model right here\n $model = [];\n $apts = [];\n\n foreach ($array_of_techniques as $indi_tech) {\n $model[$indi_tech] = [];\n }\n\n\n foreach ($aptnames as $name) {\n\n $query = \"select techniques from groups_and_techniques where groupname = '$name'\";\n $results = $mysqli->query($query);\n $apts[$name] = 0.0;\n\n while ($row = $results->fetch_assoc()) {\n\n $techs = explode(',', $row['techniques']);\n\n foreach ($techs as $things) {\n # Inside of here, we know what APT we're looking at\n # As well as the techniques, which will be represented\n # in the $things variable.\n if (array_key_exists($things, $model)) {\n array_push($model[$things], $name);\n } else {\n $model[$things] = [];\n array_push($model[$things], $name);\n }\n }\n }\n }\n # $array_of_computers contains all the computers we want to run against the WHERE clause.\n # The next block of code just constructs the MYSQL query we want to use. It looks confusing\n # but it's just a series of string concats.\n $long_string = \"WHERE ComputerName = '\" . array_pop($array_of_computers) . \"'\";\n foreach($array_of_computers as $computer_name){\n $long_string .= \" or ComputerName = \" . \" '\" . $computer_name . \"'\";\n }\n $long_string .= \";\";\n\n # Here's a clever trick to implement a PHP only solution to a check all box.\n # What we do is set the value of a check all box to something no windows box should ever be \n # called. This means if we see it, we know that we just need to run the query on the check\n # all. Which is just a semi-colon, no WHERE statement.\n if (strpos($long_string, '!!!') !== false) {\n $long_string = \";\";\n }\n\n $query = \"SELECT * FROM patterns_seen \" . $long_string;\n echo \"Query ran:\" . '</br>';\n echo $query . '</br>';\n $results = $mysqli->query(\"$query\");\n\n # Here's where the actual mathematics goes on. Also where the program spends the majority\n # of its time. If you're looking to change the model, this is a good place to start.\n while ($row = $results->fetch_assoc()) {\n foreach ($model[$row['Name']] as $ind_apts) {\n $apts[$ind_apts] += (1 / count($model[$row['Name']]));\n }\n }\n arsort($apts);\n var_dump($apts);\n}", "function Responsaveis() {\r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_chave_aux = $_REQUEST['w_chave_aux'];\r\n $w_sq_acao_ppa = $_REQUEST['w_sq_acao_ppa'];\r\n $w_sq_acao_ppa_pai = $_REQUEST['w_sq_acao_ppa_pai'];\r\n $w_sq_orprioridade = $_REQUEST['w_sq_orprioridade'];\r\n if ($O=='L') {\r\n // Recupera todos os registros para a listagem\r\n $sql = new db_getSolicData; $RS = $sql->getInstanceOf($dbms,$w_chave,$SG);\r\n } elseif (!(strpos('A',$O)===false)) {\r\n if ($w_sq_acao_ppa_pai>'') {\r\n $w_tipo=1;\r\n $sql = new db_getAcaoPPA; $RS = $sql->getInstanceOf($dbms,$w_sq_acao_ppa_pai,$w_cliente,null,null,null,null,null,null,null,null,null);\r\n foreach ($RS as $row) {$RS=$row; break;} \r\n } elseif ($w_sq_acao_ppa>'') {\r\n $w_tipo=2;\r\n $sql = new db_getAcaoPPA; $RS = $sql->getInstanceOf($dbms,$w_sq_acao_ppa,$w_cliente,null,null,null,null,null,null,null,null,null);\r\n foreach ($RS as $row) {$RS=$row; break;} \r\n } elseif ($w_sq_orprioridade>'') {\r\n $w_tipo=3;\r\n $sql = new db_getOrPrioridade; $RS = $sql->getInstanceOf($dbms,null,$w_cliente,$w_sq_orprioridade,null,null,null);\r\n foreach ($RS as $row) {$RS=$row; break;} \r\n } \r\n //$RS = db_getSolicData RS, w_chave, SG\r\n if (count($RS)>0) {\r\n $w_responsavel = f($RS,'responsavel');\r\n $w_telefone = f($RS,'telefone');\r\n $w_email = f($RS,'email');\r\n $w_nome = f($RS,'nome');\r\n $w_codigo = f($RS,'codigo');\r\n if ($w_tipo==2) {\r\n $w_nome_pai = f($RS,'nm_acao_pai');\r\n $w_codigo_pai = f($RS,'cd_pai');\r\n } \r\n } \r\n } \r\n Cabecalho();\r\n head();\r\n if (!(strpos('A',$O)===false)) {\r\n ScriptOpen('JavaScript');\r\n modulo();\r\n checkbranco();\r\n formatadata();\r\n SaltaCampo();\r\n FormataCEP();\r\n FormataValor();\r\n ValidateOpen('Validacao');\r\n if (!(strpos('A',$O)===false)) {\r\n Validate('w_responsavel','Responsável','','1','3','60','1','1');\r\n Validate('w_telefone','Telenfone','1','','7','14','1','1');\r\n Validate('w_email','Email','','','3','60','1','1');\r\n } \r\n ShowHTML(' theForm.Botao[0].disabled=true;');\r\n ShowHTML(' theForm.Botao[1].disabled=true;');\r\n ValidateClose();\r\n ScriptClose();\r\n } \r\n ShowHTML('</HEAD>');\r\n ShowHTML('<BASE HREF=\"'.$conRootSIW.'\">');\r\n BodyOpen('onLoad=\\'this.focus()\\';');\r\n ShowHTML('<B><FONT COLOR=\"#000000\">'.$w_TP.'</FONT></B>');\r\n ShowHTML('<HR>');\r\n ShowHTML('<div align=center><center>');\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n if ($O=='L') {\r\n ShowHTML('<tr><td align=\"center\" colspan=3>&nbsp;');\r\n ShowHTML('<tr><td align=\"center\" colspan=3>');\r\n ShowHTML(' <TABLE class=\"tudo\" WIDTH=\"100%\" bgcolor=\"'.$conTableBgColor.'\" BORDER=\"'.$conTableBorder.'\" CELLSPACING=\"'.$conTableCellSpacing.'\" CELLPADDING=\"'.$conTableCellPadding.'\" BorderColorDark=\"'.$conTableBorderColorDark.'\" BorderColorLight=\"'.$conTableBorderColorLight.'\">');\r\n ShowHTML(' <tr bgcolor=\"'.$conTrBgColor.'\" align=\"center\">');\r\n ShowHTML(' <td><b>Tipo</td>');\r\n ShowHTML(' <td><b>Nome</td>');\r\n ShowHTML(' <td><b>Operações</td>');\r\n ShowHTML(' </tr>');\r\n if (count($RS)<=0) {\r\n // Se não foram selecionados registros, exibe mensagem\r\n ShowHTML(' <tr bgcolor=\"'.$conTrBgColor.'\"><td colspan=7 align=\"center\"><font size=\"2\"><b>Não foram encontrados registros.</b></td></tr>');\r\n } else {\r\n // Lista os registros selecionados para listagem\r\n if (nvl(f($RS,'sq_acao_ppa'),'')>'') {\r\n $w_cor = ($w_cor==$conTrBgColor || $w_cor=='') ? $w_cor=$conTrAlternateBgColor : $w_cor=$conTrBgColor;\r\n ShowHTML(' <tr bgcolor=\"'.$w_cor.'\" valign=\"top\">');\r\n ShowHTML(' <td>Programa PPA</td>');\r\n ShowHTML(' <td>'.f($RS,'nm_ppa_pai').'</td>');\r\n ShowHTML(' <td align=\"top\" nowrap>');\r\n ShowHTML(' <A class=\"HL\" HREF=\"'.$w_dir.$w_pagina.$par.'&R='.$w_pagina.$par.'&O=A&w_chave='.$w_chave.'&w_sq_acao_ppa_pai='.f($RS,'sq_acao_ppa_pai').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&w_chave_aux='.f($RS,'sq_acao_ppa').'\">Gerente Executivo</A>&nbsp');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n $w_cor = ($w_cor==$conTrBgColor || $w_cor=='') ? $w_cor=$conTrAlternateBgColor : $w_cor=$conTrBgColor;\r\n ShowHTML(' <tr bgcolor=\"'.$w_cor.'\" valign=\"top\">');\r\n ShowHTML(' <td>Ação PPA</td>');\r\n ShowHTML(' <td>'.f($RS,'nm_ppa').'</td>');\r\n ShowHTML(' <td align=\"top\" nowrap>');\r\n ShowHTML(' <A class=\"HL\" HREF=\"'.$w_dir.$w_pagina.$par.'&R='.$w_pagina.$par.'&O=A&w_chave='.$w_chave.'&w_sq_acao_ppa='.f($RS,'sq_acao_ppa').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&w_chave_aux='.f($RS,'sq_siw_solicitacao').'\">Coordenador</A>&nbsp');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n } \r\n if (nvl(f($RS,'sq_orprioridade'),'')>'') {\r\n $w_cor = ($w_cor==$conTrBgColor || $w_cor=='') ? $w_cor=$conTrAlternateBgColor : $w_cor=$conTrBgColor;\r\n ShowHTML(' <tr bgcolor=\"'.$w_cor.'\" valign=\"top\">');\r\n ShowHTML(' <td>Iniciativa</td>');\r\n ShowHTML(' <td>'.f($RS,'nm_pri').'</td>');\r\n ShowHTML(' <td align=\"top\" nowrap>');\r\n ShowHTML(' <A class=\"HL\" HREF=\"'.$w_dir.$w_pagina.$par.'&R='.$w_pagina.$par.'&O=A&w_chave='.$w_chave.'&w_sq_orprioridade='.f($RS,'sq_orprioridade').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&w_chave_aux='.f($RS,'sq_orprioridade').'\">Responsável</A>&nbsp');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n } \r\n } \r\n ShowHTML(' </center>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </td>');\r\n ShowHTML('</tr>');\r\n } elseif (!(strpos('A',$O)===false)) {\r\n AbreForm('Form',$w_dir.$w_pagina.'Grava','POST','return(Validacao(this));',null,$P1,$P2,$P3,$P4,$TP,$SG,$R,$O);\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo\" value=\"'.$w_tipo.'\">');\r\n if ($w_tipo==1) {\r\n $w_label = 'Programa PPA';\r\n $w_chave_aux = $w_sq_acao_ppa_pai;\r\n } elseif ($w_tipo==2) {\r\n $w_label = 'Ação PPA';\r\n $w_chave_aux = $w_sq_acao_ppa;\r\n } elseif ($w_tipo==3) {\r\n $w_label = 'Iniciativa prioritária';\r\n $w_chave_aux = $w_sq_orprioridade;\r\n } \r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave_aux\" value=\"'.$w_chave_aux.'\">');\r\n ShowHTML('<tr bgcolor=\"'.$conTrBgColor.'\"><td align=\"center\">');\r\n ShowHTML(' <table width=\"97%\" border=\"0\">');\r\n if ($w_tipo==2) {\r\n ShowHTML(' <tr><td valign=\"top\"><b>Programa PPA: </b>'.$w_codigo_pai.' - '.$w_nome_pai.' </b>');\r\n } \r\n ShowHTML(' <tr><td valign=\"top\"><b>'.$w_label.': </b>');\r\n if (!$w_tipo==3) {\r\n ShowHTML(''.$w_codigo.' - ');\r\n } \r\n ShowHTML(''.$w_nome.'</td>');\r\n if ($w_tipo==1) ShowHTML(' <tr><td><b><u>G</u>erente executivo:</b><br><input '.$w_Disabled.' accesskey=\"G\" type=\"text\" name=\"w_responsavel\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_responsavel.'\" title=\"Informe um gerente executivo.\"></td>');\r\n elseif ($w_tipo==2) ShowHTML(' <tr><td><b><u>C</u>oordenador:</b><br><input '.$w_Disabled.' accesskey=\"C\" type=\"text\" name=\"w_responsavel\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_responsavel.'\" title=\"Informe um coordenador.\"></td>');\r\n elseif ($w_tipo==3) ShowHTML(' <tr><td><b>Res<u>p</u>onsável:</b><br><input '.$w_Disabled.' accesskey=\"P\" type=\"text\" name=\"w_responsavel\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_responsavel.'\" title=\"Informe um responsável.\"></td>'); \r\n ShowHTML(' <tr><td valign=\"top\"><b><u>T</u>elefone:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_telefone\" class=\"STI\" SIZE=\"15\" MAXLENGTH=\"14\" VALUE=\"'.$w_telefone.'\"></td>');\r\n ShowHTML(' <tr><td><b>E<u>m</u>ail:</b><br><input '.$w_Disabled.' accesskey=\"M\" type=\"text\" name=\"w_email\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_email.'\" title=\"Informe o email do responsável.\"></td>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=4><hr>');\r\n ShowHTML(' <input class=\"STB\" type=\"submit\" name=\"Botao\" value=\"Gravar\">');\r\n ShowHTML(' <input class=\"STB\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,$w_pagina.$par.'&w_chave='.$w_chave.'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&O=L').'\\';\" name=\"Botao\" value=\"Cancelar\">');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n ShowHTML('</FORM>');\r\n } else {\r\n ScriptOpen('JavaScript');\r\n ShowHTML(' alert(\"Opção não disponível\");');\r\n //ShowHTML ' history.back(1);'\r\n ScriptClose();\r\n } \r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Rodape();\r\n}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('subjectcontent')) {\n try {\n $subjectcontent = $this->_initSubjectcontent();\n\n $code = $data['subcon_code'];\n $subjectId = $data['subject_id'];\n $subject = Mage::getModel('bs_subject/subject')->load($subjectId);\n $subjectCode = $subject->getSubjectCode();\n\n $increment = 1;\n\n $subjectContents = Mage::getModel('bs_subject/subjectcontent')->getCollection()->addFieldToFilter('subject_id',$subjectId);\n if(count($subjectContents)){\n $increment = count($subjectContents) + 1;\n }\n\n if($code == ''){//new subject doesnt have the value in this field, we will add this here\n\n\n $code = $subjectCode.'-'.$increment.Mage::helper('bs_traininglist')->generateRandomString(4);\n $data['subcon_code'] = $code;\n\n }\n\n if($data['import'] != ''){\n $import = $data['import'];\n $import = explode(\"\\r\\n\", $import);\n $i=$increment*10;\n foreach ($import as $line) {\n if(strpos($line, \"--\")){\n $item = explode(\"--\", $line);\n }else {\n $item = explode(\"\\t\", $line);\n }\n $count = count($item);\n $name = false;\n $level = false;\n $hour = false;\n\n if($count == 3){//Name--hour\n\n $name = trim($item[0]);\n $level= (int)trim($item[1]);\n $hour = (float)trim($item[2]);\n\n }\n\n if($name){\n $subs = Mage::getModel('bs_subject/subjectcontent');\n $subs->setSubconTitle($name);\n $subs->setSubjectId($subjectId);\n $subscode = $subjectCode.'-'.$i.Mage::helper('bs_traininglist')->generateRandomString();\n $subs->setSubconCode($subscode);\n if($level>0){\n $subs->setSubconLevel($level);\n }\n if($hour>0){\n $subs->setSubconHour($hour);\n }\n\n $subs->setSubconOrder($i);\n\n $subs->save();\n\n $i += 10;\n\n }\n\n\n\n\n\n\n }\n\n }else {\n\n $subjectcontent->addData($data);\n $subjectcontent->save();\n }\n\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.subjectcontentGridJsObject.reload();window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_subject')->__('Subject Content was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $subjectcontent->getId()));\n return;\n }\n $this->_redirect('*/subject_subject/edit', array('id'=>$subjectcontent->getSubjectId(), 'tab'=>'subject_info_tabs_subcontent'));\n //$this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setSubjectcontentData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_subject')->__('There was a problem saving the subject content.')\n );\n Mage::getSingleton('adminhtml/session')->setSubjectcontentData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_subject')->__('Unable to find subject content to save.')\n );\n $this->_redirect('*/*/');\n }", "function Responsaveis() {\r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_chave_aux = $_REQUEST['w_chave_aux'];\r\n $w_cd_programa = $_REQUEST['w_cd_programa'];\r\n $w_ds_programa = $_REQUEST['w_ds_programa'];\r\n $w_nm_gerente_programa = $_REQUEST['w_nm_gerente_programa'];\r\n $w_fn_gerente_programa = $_REQUEST['w_fn_gerente_programa'];\r\n $w_em_gerente_programa = $_REQUEST['w_em_gerente_programa'];\r\n $w_nm_gerente_executivo = $_REQUEST['w_nm_gerente_executivo'];\r\n $w_fn_gerente_executivo = $_REQUEST['w_fn_gerente_executivo'];\r\n $w_em_gerente_executivo = $_REQUEST['w_em_gerente_executivo'];\r\n $w_nm_gerente_adjunto = $_REQUEST['w_nm_gerente_adjunto'];\r\n $w_fn_gerente_adjunto = $_REQUEST['w_fn_gerente_adjunto'];\r\n $w_em_gerente_adjunto = $_REQUEST['w_em_gerente_adjunto'];\r\n if ($O=='L') {\r\n // Recupera todos os registros para a listagem\r\n $sql = new db_getSolicData_IS; $RS = $sql->getInstanceOf($dbms,$w_chave,$SG);\r\n foreach($RS as $row){$RS=$row; break;}\r\n } elseif (!(strpos('A',$O)===false)) {\r\n $sql = new db_getProgramaPPA_IS; $RS = $sql->getInstanceOf($dbms,$w_cd_programa,$w_cliente,$w_ano,null,null,null,null);\r\n foreach($RS as $row){$RS=$row; break;}\r\n if (count($RS)>0) {\r\n $w_nm_gerente_programa = f($RS,'nm_gerente_programa');\r\n $w_fn_gerente_programa = f($RS,'fn_gerente_programa');\r\n $w_em_gerente_programa = f($RS,'em_gerente_programa');\r\n $w_nm_gerente_executivo = f($RS,'nm_gerente_executivo');\r\n $w_fn_gerente_executivo = f($RS,'fn_gerente_executivo');\r\n $w_em_gerente_executivo = f($RS,'em_gerente_executivo');\r\n $w_nm_gerente_adjunto = f($RS,'nm_gerente_adjunto');\r\n $w_fn_gerente_adjunto = f($RS,'fn_gerente_adjunto');\r\n $w_em_gerente_adjunto = f($RS,'em_gerente_adjunto');\r\n $w_ds_programa = f($RS,'ds_programa');\r\n } \r\n } \r\n Cabecalho();\r\n head();\r\n if (!(strpos('A',$O)===false)) {\r\n ScriptOpen('JavaScript');\r\n modulo();\r\n checkbranco();\r\n formatadata();\r\n SaltaCampo();\r\n FormataCEP();\r\n FormataValor();\r\n ValidateOpen('Validacao');\r\n if (!(strpos('A',$O)===false)) {\r\n Validate('w_nm_gerente_programa','Gerente do programa','','1','3','60','1','1');\r\n Validate('w_fn_gerente_programa','Telefone do gerente programa','1','','7','20','1','1');\r\n Validate('w_em_gerente_programa','Email do gerente programa','','','3','60','1','1');\r\n Validate('w_nm_gerente_executivo','Gerente do executivo','','1','3','60','1','1');\r\n Validate('w_fn_gerente_executivo','Telefone do gerente executivo','1','','7','20','1','1');\r\n Validate('w_em_gerente_executivo','Email do gerente executivo','','','3','60','1','1');\r\n Validate('w_nm_gerente_adjunto','Gerente adjunto','','','3','60','1','1');\r\n Validate('w_fn_gerente_adjunto','Telefone do gerente adjunto','1','','7','20','1','1');\r\n Validate('w_em_gerente_adjunto','Email do gerente adjunto','','','3','60','1','1');\r\n } \r\n ShowHTML(' theForm.Botao[0].disabled=true;');\r\n ShowHTML(' theForm.Botao[1].disabled=true;');\r\n ValidateClose();\r\n ScriptClose();\r\n } \r\n ShowHTML('</HEAD>');\r\n ShowHTML('<BASE HREF=\"'.$conRootSIW.'\">');\r\n if ($O=='A') {\r\n BodyOpen('onLoad=\\'document.Form.w_nm_gerente_programa.focus()\\';');\r\n } else {\r\n BodyOpen(null);\r\n } \r\n ShowHTML('<B><FONT COLOR=\"#000000\">'.$w_TP.'</FONT></B>');\r\n ShowHTML('<HR>');\r\n ShowHTML('<div align=center><center>');\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n if ($O=='L') {\r\n ShowHTML('<tr><td align=\"center\" colspan=3>&nbsp;');\r\n ShowHTML('<tr><td align=\"center\" colspan=3>');\r\n ShowHTML(' <TABLE class=\"tudo\" WIDTH=\"100%\" bgcolor=\"'.$conTableBgColor.'\" BORDER=\"'.$conTableBorder.'\" CELLSPACING=\"'.$conTableCellSpacing.'\" CELLPADDING=\"'.$conTableCellPadding.'\" BorderColorDark=\"'.$conTableBorderColorDark.'\" BorderColorLight=\"'.$conTableBorderColorLight.'\">');\r\n ShowHTML(' <tr bgcolor=\"'.$conTrBgColor.'\" align=\"center\">');\r\n ShowHTML(' <td><b>Tipo</td>');\r\n ShowHTML(' <td><b>Nome</td>');\r\n ShowHTML(' <td><b>Operações</td>');\r\n ShowHTML(' </tr>');\r\n if (count($RS)<=0) {\r\n // Se não foram selecionados registros, exibe mensagem\r\n ShowHTML(' <tr bgcolor=\"'.$conTrBgColor.'\"><td colspan=7 align=\"center\"><font size=\"2\"><b>Não foram encontrados registros.</b></td></tr>');\r\n } else {\r\n $w_cor = ($w_cor==$conTrBgColor || $w_cor=='') ? $w_cor=$conTrAlternateBgColor : $w_cor=$conTrBgColor;\r\n ShowHTML(' <tr bgcolor=\"'.$w_cor.'\" valign=\"top\">');\r\n ShowHTML(' <td>Programa PPA</td>');\r\n ShowHTML(' <td>'.f($RS,'cd_programa').' - '.f($RS,'ds_programa').'</td>');\r\n ShowHTML(' <td align=\"top\" nowrap>');\r\n ShowHTML(' <A class=\"HL\" HREF=\"'.$w_dir.$w_pagina.$par.'&R='.$w_pagina.$par.'&O=A&w_chave='.$w_chave.'&w_cd_programa='.f($RS,'cd_programa').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&w_chave_aux='.f($RS,'sq_siw_solicitacao').'\">Responsáveis</A>&nbsp');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n } \r\n ShowHTML(' </center>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </td>');\r\n ShowHTML('</tr>');\r\n } elseif (!(strpos('A',$O)===false)) {\r\n AbreForm('Form',$w_dir.$w_pagina.'Grava','POST','return(Validacao(this));',null,$P1,$P2,$P3,$P4,$TP,$SG,$R,$O);\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo\" value=\"'.$w_tipo.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave_aux\" value=\"'.$w_chave_aux.'\">');\r\n ShowHTML('<tr bgcolor=\"'.$conTrBgColor.'\"><td align=\"center\">');\r\n ShowHTML(' <table width=\"97%\" border=\"0\">');\r\n ShowHTML(' <tr><td valign=\"top\"><font size=\"2\"><b>Programa PPA: </b>'.$w_cd_programa.' - '.$w_ds_programa.' </b>');\r\n ShowHTML(' <tr><td valign=\"top\"><b>Gerente do programa: </b>');\r\n ShowHTML(' <tr><td><b><u>N</u>ome:</b><br><input '.$w_Disabled.' accesskey=\"N\" type=\"text\" name=\"w_nm_gerente_programa\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_nm_gerente_programa.'\" title=\"Informe o nome do gerente do programa.\"></td>');\r\n ShowHTML(' <tr><td valign=\"top\"><b><u>T</u>elefone:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fn_gerente_programa\" class=\"STI\" SIZE=\"15\" MAXLENGTH=\"14\" VALUE=\"'.$w_fn_gerente_programa.'\" title=\"Informe o telefone do gerente do programa.\"></td>');\r\n ShowHTML(' <tr><td><b><u>E</u>mail:</b><br><input '.$w_Disabled.' accesskey=\"E\" type=\"text\" name=\"w_em_gerente_programa\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_em_gerente_programa.'\" title=\"Informe o e-mail do gerente do programa.\"></td>');\r\n ShowHTML(' <tr><td valign=\"top\"><b>Gerente Executivo do programa: </b>');\r\n ShowHTML(' <tr><td><b>N<u>o</u>me:</b><br><input '.$w_Disabled.' accesskey=\"O\" type=\"text\" name=\"w_nm_gerente_executivo\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_nm_gerente_executivo.'\" title=\"Informe o nome do gerente executivo do programa.\"></td>');\r\n ShowHTML(' <tr><td valign=\"top\"><b>Te<u>l</u>efone:</b><br><input '.$w_Disabled.' accesskey=\"L\" type=\"text\" name=\"w_fn_gerente_executivo\" class=\"STI\" SIZE=\"15\" MAXLENGTH=\"14\" VALUE=\"'.$w_fn_gerente_executivo.'\" title=\"Informe o telefone do gerente executivo do programa.\"></td>');\r\n ShowHTML(' <tr><td><b>Em<u>a</u>il:</b><br><input '.$w_Disabled.' accesskey=\"A\" type=\"text\" name=\"w_em_gerente_executivo\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_em_gerente_executivo.'\" title=\"Informe o e-mail do gerente executivo do programa.\"></td>');\r\n ShowHTML(' <tr><td valign=\"top\"><b>Gerente Adjunto do programa: </b>');\r\n ShowHTML(' <tr><td><b>No<u>m</u>e:</b><br><input '.$w_Disabled.' accesskey=\"M\" type=\"text\" name=\"w_nm_gerente_adjunto\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_nm_gerente_adjunto.'\" title=\"No caso de programa multisetorial cuja gerência não pertença a SEPPIR, informe o nome do gerente executivo adjunto do programa.\"></td>');\r\n ShowHTML(' <tr><td valign=\"top\"><b>Tele<u>f</u>one:</b><br><input '.$w_Disabled.' accesskey=\"F\" type=\"text\" name=\"w_fn_gerente_adjunto\" class=\"STI\" SIZE=\"15\" MAXLENGTH=\"14\" VALUE=\"'.$w_fn_gerente_adjunto.'\" title=\"No caso de programa multisetorial cuja gerência não pertença a SEPPIR, informe o telefone do gerente executivo adjunto do programa.\"></td>');\r\n ShowHTML(' <tr><td><b>Ema<u>i</u>l:</b><br><input '.$w_Disabled.' accesskey=\"I\" type=\"text\" name=\"w_em_gerente_adjunto\" class=\"STI\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"'.$w_em_gerente_adjunto.'\" title=\"No caso de programa multisetorial cuja gerência não pertença a SEPPIR, informe o e-mail do gerente executivo adjunto do programa.\"></td>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=4><hr>');\r\n ShowHTML(' <input class=\"STB\" type=\"submit\" name=\"Botao\" value=\"Gravar\">');\r\n ShowHTML(' <input class=\"STB\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,$w_pagina.$par.'&w_chave='.$w_chave.'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.$SG.'&O=L').'\\';\" name=\"Botao\" value=\"Cancelar\">');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n ShowHTML('</FORM>');\r\n } else {\r\n ScriptOpen('JavaScript');\r\n ShowHTML(' alert(\"Opção não disponível\");');\r\n ShowHTML(' history.back(1);');\r\n ScriptClose();\r\n } \r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Rodape();\r\n}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "protected function getStandardConjugation(){\n\n $arr = array();\n $model = $this->getVerbModel();\n \n if ($model == '230' || $model == '250' || $model == '251'){\n $arr['00_IndPres|Present'] = \"i,es,,èm,ètz,on\";\n $arr['01_IndImp|Imperfach'] = \"iái,iás,iá,iam,iatz,ián\";\n $arr['02_IndPret|Preterit'] = \"iguèri,iguères,iguèt,iguèrem,iguèretz,iguèron\";\n $arr['03_IndFutur|Futur'] = \"irai,iràs,irà,irem,iretz,iràn\";\n $arr['04_Infinitiu|Infinitiu'] = \"ir\";\n $arr['05_Gerondiu|Gerondiu'] = \"issent\";\n $arr['06_PartPassat|Participi passat'] = \"it,ida\";\n if ($model == '230' || $model == '251'){\n $arr['06_PartPassat|Participi passat'] = \"òrt,òrta\";\n }\n\n $arr['07_Imperatiu|Imperatiu'] = \",am,ètz,iscas,iscam,iscatz\";\n\n if ($model == '230' || $model == '251'){\n $arr['07_Imperatiu|Imperatiu'] = \",am,ètz,a,am,atz\";\n }\n\n $arr['08_SubPres|Subjontiu present'] = \"a,as,a,am,atz,an\";\n $arr['09_SubImp|Subjontiu imperfach'] = \"iguèsse,iguèsses,iguèsse,iguèssem,iguèssetz,iguèsson\";\n $arr['10_Conditional|Conditional'] = \"iriái,iriás,iriá,iriam,iriatz,irián\";\n return $arr;\n }\n if ($model == '210' || $model == '211' || $model == '212' || $model == '213'){\n $arr['00_IndPres|Present'] = \"ïssi,ïsses,ís,ïssèm,ïssètz,ïsson\";\n $arr['01_IndImp|Imperfach'] = \"ïssiái,ïssiás,ïssiá,ïssiam,ïssiatz,ïssián\";\n $arr['02_IndPret|Preterit'] = \"ïguèri,ïguères,ïguèt,ïguèrem,ïguèretz,ïguèron\";\n $arr['03_IndFutur|Futur'] = \"ïrai,ïràs,ïrà,ïrem,ïretz,ïràn\";\n $arr['04_Infinitiu|Infinitiu'] = \"ïr\";\n $arr['05_Gerondiu|Gerondiu'] = \"ïssent\";\n $arr['06_PartPassat|Participi passat'] = \"ït,ida\";\n $arr['07_Imperatiu|Imperatiu'] = \"ís,ïscam,ïssètz,ïscas,ïscam,ïscatz\";\n $arr['08_SubPres|Subjontiu present'] = \"ïsca,ïscas,ïsca,ïscam,ïscatz,ïscan\";\n $arr['09_SubImp|Subjontiu imperfach'] = \"ïguèsse,ïguèsses,ïguèsse,ïguèssem,ïguèssetz,ïguèsson\";\n $arr['10_Conditional|Conditional'] = \"ïriái,ïriás,ïriá,ïriam,ïriatz,ïrián\";\n return $arr;\n }\n\n $arr['00_IndPres|Present'] = \"issi,isses,ís,issèm,issètz,isson\";\n $arr['01_IndImp|Imperfach'] = \"issiái,issiás,issiá,issiam,issiatz,issián\";\n $arr['02_IndPret|Preterit'] = \"iguèri,iguères,iguèt,iguèrem,iguèretz,iguèron\";\n $arr['03_IndFutur|Futur'] = \"irai,iràs,irà,irem,iretz,iràn\";\n $arr['04_Infinitiu|Infinitiu'] = \"ir\";\n $arr['05_Gerondiu|Gerondiu'] = \"issent\";\n $arr['06_PartPassat|Participi passat'] = \"it,ida\";\n $arr['07_Imperatiu|Imperatiu'] = \"ís,iscam,issètz,iscas,iscam,iscatz\";\n $arr['08_SubPres|Subjontiu present'] = \"isca,iscas,isca,iscam,iscatz,iscan\";\n $arr['09_SubImp|Subjontiu imperfach'] = \"iguèsse,iguèsses,iguèsse,iguèssem,iguèssetz,iguèsson\";\n $arr['10_Conditional|Conditional'] = \"iriái,iriás,iriá,iriam,iriatz,irián\";\n\n if ($model == '220'){\n $arr['06_PartPassat|Participi passat'] = \"èrt,èrta\";\n }\n\n if ($model == '230'){\n $arr['06_PartPassat|Participi passat'] = \"òrt,òrta\";\n }\n\n return $arr;\n }", "function edit_instruction_automatic() {\n\t\t\tinclude_once(\"template/therapistEHS/therapistArray.php\");\n //echo $this->value('day');\n\t\t\tif( $this->value('update') == \"update\" && $this->value('id') != \"\"){\n\n\t\t\t\t$where = \" plan_treatment_id = '{$this->value('id')}' \";\n\n\t\t\t\t$updateArr = $this->fillForm($instructionFormArray,true);\n\n\t\t\t\tif($this->update($this->config['table']['plan_treatment'],$updateArr,$where)){\n\n\t\t\t\t\t$_SESSION['edit_record'][] = $this->value('id');\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<script language=\"javascript\" >\n\n\t\t\t\t\t\twindow.close();\n\n\t\t\t\t\t\twindow.opener.location.href = \"index.php?action=customize_instruction_automatic&plan_id=<?php echo $this->get_field($this->value('id'),\"plan_treatment\",\"plan_id\") ?>&edit_instruction=1&day=<?php echo $this->value('day'); ?>\";\n\n\t\t\t\t\t</script>\n\n\t\t\t\t\t<?php\t\n\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\t//echo \"shail\";exit;\n\n\t\t\t\t$row = $this->fillForm($instructionFormArray,true);\n\n\t\t\t\tif(is_array($row)){\n\n\t\t\t\t\t$row['plan_treatment_id'] = $this->value('id');\n\n\t\t\t\t\t$row['lrboption'] = $this->build_select_option($this->config['lrb'],$row['lrb']);\n $row['day']= $this->value('day');\n\n\t\t\t\t\t$mainRegion = $this->build_template($this->get_template(\"edit_instruction\"),$row);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t$query = \"select pt.plan_treatment_id,pl.plan_name,pt.treatment_order,pt.treatment_id,trt.treatment_name,\n\n\t\t\t\t\t\t\tpt.instruction,pt.benefit,pt.sets,pt.reps,pt.hold,pt.lrb,pt.plan_id from plan_treatment pt\n\n\t\t\t\t\t\t\tinner join treatment trt on pt.treatment_id = trt.treatment_id \n\n\t\t\t\t\t\t\tinner join plan pl on pl.plan_id = pt.plan_id \n\n\t\t\t\t\t\t\twhere pt.plan_treatment_id = '{$this->value('id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\t\t\t\t\t\t\t\t \t\n\n\t\t\t\tif(is_resource($result)){\n\n\t\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t\t$row['lrboption'] = $this->build_select_option($this->config['lrb'],$row['lrb']);\n $row['day']= $this->value('day'); \n\t\t\t\t\t\t$mainRegion = $this->build_template($this->get_template(\"edit_instruction\"),$row);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\t\n\n\t\t\t\telse{\n\n\t\t\t\t\t$mainRegion = \"Record Not found.\";\n\n\t\t\t\t}\n\n\t\t\t}\t\n $replace['day'] = $this->value('day');\n\t\t\t$replace['mainRegion'] = $mainRegion;\n\n\t\t\t$replace['browserTitle'] = \"Edit Instruction\";\n\t\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n \n // Personalized GUI \n //Label \n $DefaultInstructions=$_SESSION['providerLabel']['Default Instructions']!=''?$_SESSION['providerLabel']['Default Instructions']:'Default Instructions';\n $BenefitofTreatment=$_SESSION['providerLabel']['Benefit of Treatment']!=''?$_SESSION['providerLabel']['Benefit of Treatment']:'Benefit of Treatment'; \n\n \n //Label\n $replace['labelDefaultInstructions']=$DefaultInstructions;\n $replace['labelBenefitofTreatment']=$BenefitofTreatment;\n\n // Fields\n $displayFieldSets='';\n $displayFieldReps='';\n $displayFieldHold='';\n $displayFieldLRB='';\n \n $SetsDisplay=$_SESSION['providerField']['Sets']!=''?$_SESSION['providerField']['Sets']:'1';\n $RepsDisplay=$_SESSION['providerField']['Reps']!=''?$_SESSION['providerField']['Reps']:'1';\n $HoldDisplay=$_SESSION['providerField']['Hold']!=''?$_SESSION['providerField']['Hold']:'1';\n $LRBDisplay=$_SESSION['providerField']['LRB']!=''?$_SESSION['providerField']['LRB']:'1';\n \n if($SetsDisplay=='0'){\n $displayFieldSets='none'; \n }\n if($RepsDisplay=='0'){\n $displayFieldReps='none'; \n }\n if($HoldDisplay=='0'){\n $displayFieldHold='none'; \n }\n if($LRBDisplay=='0'){\n $displayFieldLRB='none'; \n }\n \n $replace['displayFieldLRB']=$displayFieldLRB;\n $replace['displayFieldReps']=$displayFieldReps;\n $replace['displayFieldHold']=$displayFieldHold;\n $replace['displayFieldSets']=$displayFieldSets;\n \n\n\t\t\t \n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\t\t\t\n\n\t\t}", "function applyProvisionalCode($pid)\n {\n\n\n if(APP_FEDORA_BYPASS == 'ON') {\n $record = new RecordObject($pid);\n $docType = $record->getDocumentType();\n $subType = Record::getSearchKeyIndexValue($pid, \"Subtype\");\n // no longer use genreType for records, only subtype\n// $genreType = Record::getSearchKeyIndexValue($pid, \"Genre Type\");\n $existingHERDCcode = Record::getSearchKeyIndexValue($pid, \"HERDC code\");\n } else {\n $record = new RecordGeneral($pid);\n $docType = $record->getDocumentType();\n $subType = $record->getFieldValueBySearchKey(\"Subtype\");\n $subType = $subType[0];\n// $genreType = $record->getFieldValueBySearchKey(\"Genre Type\");\n// $genreType = $genreType[0];\n $existingHERDCcode = $record->getFieldValueBySearchKey(\"HERDC code\");\n $existingHERDCcode = $existingHERDCcode[0];\n }\n\n $provHERDCcode = \"\";\n\n // Bail out if we already have a HERDC code\n if ((is_array($existingHERDCcode) && count($existingHERDCcode) != 0) || (!is_array($existingHERDCcode) && ($existingHERDCcode != '' || !is_null($existingHERDCcode) )) ) {\n return;\n }\n\n //////////////////////////////////////////////////////////////////////////////\n // This is a fairly linear translation of MG's business rules. I have not //\n // attempted to optimise them in any way. Leaving them in this form makes //\n // the mapping between the source rules and the code as simple as possible. //\n // Note: There are some extra rules here that were not in MG's original //\n // document; these have come from email discussions. //\n //////////////////////////////////////////////////////////////////////////////\n if ($docType == \"Conference Paper\") {\n if ($subType == \"Fully published paper\") {\n $provHERDCcode = \"E1\";\n } elseif ($subType == \"Oral presentation\") {\n $provHERDCcode = \"EX\";\n } elseif ($subType == \"Other\") {\n $provHERDCcode = \"EX\";\n } elseif ($subType == \"Poster\") {\n $provHERDCcode = \"EX\";\n } elseif ($subType == \"Published abstract\") {\n $provHERDCcode = \"EX\";\n }\n\n } elseif ($docType == \"Book\") {\n if ($subType == \"Research book (original research)\") {\n $provHERDCcode = \"A1\";\n } elseif ($subType == \"Edited book\") {\n $provHERDCcode = \"A3\";\n } elseif ($subType == \"Creative work\") {\n $provHERDCcode = \"AX\";\n } elseif ($subType == \"Other\") {\n $provHERDCcode = \"AX\";\n } elseif ($subType == \"Reference work, encyclopaedia, manual or book\") {\n $provHERDCcode = \"AX\";\n } elseif ($subType == \"Textbook\") {\n $provHERDCcode = \"AX\";\n }\n\n } elseif ($docType == \"Book Chapter\") {\n if ($subType == \"Research book chapter (original research)\") {\n $provHERDCcode = \"B1\";\n } elseif ($subType == \"Critical review of research, literature review, critical commentary\") {\n $provHERDCcode = \"B1\";\n } elseif ($subType == \"Introduction, foreword, editorial or appendix\") {\n $provHERDCcode = \"BX\";\n } elseif ($subType == \"Other\") {\n $provHERDCcode = \"BX\";\n } elseif ($subType == \"Creative work\") {\n $provHERDCcode = \"BX\";\n } elseif ($subType == \"Chapter in reference work, encyclopaedia, manual or handbook\") {\n $provHERDCcode = \"BX\";\n } elseif ($subType == \"Chapter in textbook\") {\n $provHERDCcode = \"BX\";\n }\n\n } elseif ($docType == \"Journal Article\") {\n if ($subType == \"Article (original research)\") {\n $provHERDCcode = \"C1\";\n } elseif ($subType == \"Correction/erratum\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Creative work\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Discussion - responses, round table/panel discussions, Q&A, reply\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Editorial\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Letter to editor, brief commentary or brief communication\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Other\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Review of book, film, TV, video, software, performance, music etc\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Critical review of research, literature review, critical commentary\") {\n $provHERDCcode = \"C1\";\n }\n\n } elseif ($docType == \"Online Journal Article\") {\n if ($subType == \"Article (original research)\") {\n $provHERDCcode = \"C1\";\n } elseif ($subType == \"Correction/erratum\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Creative work\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Discussion - responses, round table/panel discussions, Q&A, reply\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Editorial\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Letter to editor, brief commentary or brief communication\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Other\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Review of book, film, TV, video, software, performance, music etc\") {\n $provHERDCcode = \"CX\";\n } elseif ($subType == \"Critical review of research, literature review, critical commentary\") {\n $provHERDCcode = \"C1\";\n }\n\n }\n\n if ($provHERDCcode != '') {\n\n $history = \"was set based on Provisional HERDC assignment rules\";\n\n // HERDC code\n $provCode = Controlled_Vocab::getID($provHERDCcode);\n $record->addSearchKeyValueList(array(\"HERDC code\"), array($provCode), true, $history);\n\n // HERDC status\n $provisional = Controlled_Vocab::getID('Provisional Code');\n $record->addSearchKeyValueList(array(\"HERDC Status\"), array($provisional), true, $history);\n\n // Institutional status\n $unknown = Controlled_Vocab::getID('Unknown');\n $record->addSearchKeyValueList(array(\"Institutional Status\"), array($unknown), true, $history);\n }\n\n return;\n }", "private function _getLine($model)\n {\n $householdRegEx = \"/^[A-L]$/i\";\n $butlerRegE = \"/^[M-V]$/i\";\n $companionRegE = \"/^[W-Z]$/i\";\n if(preg_match($householdRegEx, $model)){\n return \"household\";\n }else if (preg_match($butlerRegE, $model)){\n return \"butler\";\n }else if (preg_match($companionRegE, $model)){\n return \"companion\";\n }\n }", "public static function assemble_experiment()\n {\n $experimentInputs = array();\n\n $scheduling = new ComputationalResourceSchedulingModel();\n $scheduling->totalCPUCount = $_POST['cpu-count'];\n $scheduling->nodeCount = $_POST['node-count'];\n $scheduling->queueName = $_POST['queue-name'];\n $scheduling->wallTimeLimit = $_POST['wall-time'];\n $scheduling->totalPhysicalMemory = $_POST['total-physical-memory'];\n $scheduling->resourceHostId = $_POST['compute-resource'];\n// $scheduling->staticWorkingDir = $_POST['static-working-dir'];\n\n $userConfigData = new UserConfigurationDataModel();\n $userConfigData->computationalResourceScheduling = $scheduling;\n $userConfigData->storageId = Config::get('pga_config.airavata')['gateway-data-store-resource-id'];\n $userConfigData->airavataAutoSchedule = isset($_POST['enable-auto-scheduling']) ? true : false;\n if (isset($_POST[\"userDN\"])) {\n $userConfigData->generateCert = 1;\n $userConfigData->userDN = $_POST[\"userDN\"];\n }\n $userConfigData->useUserCRPref = isset($_POST['use-user-cr-pref']) ? true : false;\n ExperimentUtilities::create_experiment_folder_path($_POST['project'], $_POST['experiment-name']);\n $userConfigData->experimentDataDir = ExperimentUtilities::$experimentPath;\n $applicationInputs = AppUtilities::get_application_inputs($_POST['application']);\n $experimentInputs = ExperimentUtilities::process_inputs(ExperimentUtilities::$experimentPath, $applicationInputs, $experimentInputs);\n\n\n\n $experiment = new ExperimentModel();\n // required\n $experiment->projectId = $_POST['project'];\n $experiment->userName = Session::get('username');\n $experiment->name = $_POST['experiment-name'];\n $experiment->gatewayId = Config::get('pga_config.airavata')['gateway-id'];\n $experiment->experimentName = $_POST['experiment-name'];\n\n // optional\n $experiment->description = $_POST['experiment-description'];\n $experiment->executionId = $_POST['application'];\n $experiment->userConfigurationData = $userConfigData;\n $experiment->experimentInputs = $experimentInputs;\n if (isset($_POST[\"enableEmailNotification\"])) {\n $experiment->enableEmailNotification = intval($_POST[\"enableEmailNotification\"]);\n $experiment->emailAddresses = array_unique(array_filter($_POST[\"emailAddresses\"], \"trim\"));\n }\n\n // adding default experiment outputs for now till prepoulated experiment template is not implemented.\n $experiment->experimentOutputs = AppUtilities::get_application_outputs($_POST[\"application\"]);\n\n if ($experimentInputs) {\n return $experiment;\n }\n }", "public function CreateEventsFromIntervenciones()\n\t{\n\t\t$smallInt = new Application_Model_DbTable_Easya_Intervenciones();\n\t\t$TareasDb = new Application_Model_DbTable_Calendar_Tareas();\n\t\t$EventsDb = new Application_Model_DbTable_Calendar_Eventos();\n\t\t$opciones = new Application_Model_DbTable_Calendar_EventosOpciones();\n\t\t\n\t\t$arrayevents = $this->GetInterventionData();\n\t\t//file_put_contents(\"arrayevents.txt\",json_encode($arrayevents).\" \".count($arrayevents));\n\t\t\tif($arrayevents != false)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < count($arrayevents); $i++)\n\t\t\t\t{\n\t\t\t\t\t$cis =\t\"\";\n\t\t\t\t\t//obtener lista de cis\n\t\t\t\t\t$arrayServidores = unserialize($arrayevents[$i][\"data_servidor\"]);\n\t\t\t\t\t\n\t\t\t\t\tfor($x=0; $x < count($arrayServidores);$x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($x==0)\n\t\t\t\t\t\t$cis.=$arrayServidores[$x][0];\n\t\t\t\t\t\telse $cis.=\", \".$arrayServidores[$x][0];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t//Creacion de tarea\n\t\t\t\t$xxx = array();\n\t\t\t\t$xx = 1;\n\t\t\t\t$tipoTarea = \"Info_Intervencion\";\n\t\t\t\t$k= array('turno','centro','t_start','t_end','client', 'customer_affected', 'title', 'description','origen','OU_ID','creada',\n\t\t\t\t\t\t'programacion','owner','params','group','type','refer');\n\t\t\t\t$iparams = json_encode(array(\n\t\t\t\t\t\t'idChange' => $arrayevents[$i]['ticket'], 'idTarea' => \"Parent\", 'Status'=> 'Pending',\n\t\t\t\t\t\t'Service' => '', 'Environment' => '',\n\t\t\t\t\t\t'CI' => $cis\n\t\t\t\t\t\t,'Coordinator'=>$arrayevents[$i]['tecnico'], 'idIntervention' => $arrayevents[$i]['ID'],'tipo_intervencion'=>$arrayevents[$i]['tipo'],\n\t\t\t\t\t\t'INFO'=>true,'Intervention'=>true,'fin_manual'=>$arrayevents[$i]['fin_manual'],'historico'=>false));\n\t\t\t\t \n\t\t\t\n\t\t\t\t\n\t\t\t\t$rs[0] = 'Morning';\n\t\t\t\t$rs[1] = 'BCN - 22@';\n\t\t\t\t$rs[2] = date(\"H:i\", strtotime($arrayevents[$i]['fecha_inicio']));\n\t\t\t\t$rs[3] = date(\"H:i\", strtotime($arrayevents[$i]['fecha_fin']));\n\t\t\t\t$rs[4] = '87'; // CTTI\n\t\t\t\t//$rs[5] = 'T-Systems Iberia/T-Systems Iberia';\n\t\t\t\t\n\t\t\t\t$rs[5] = 'T-SYSTEMS IBERIA/T-SYSTEMS IBERIA';\n\t\t\t\t$rs[6] = \"EASY INTERVENCIONES - \".substr($arrayevents[$i]['observaciones'], 0, 70);\n\t\t\t\t$rs[7] = \"Tipo: Reinicio - \".$arrayevents[$i]['cliente'].\" - \".$arrayevents[$i]['observaciones'];\n\t\t\t\t$rs[8] = \"Journal\";\n\t\t\t\t$rs[9] = $arrayevents[$i]['tecnico'];\n\t\t\t\t$rs[10] = date(\"Y-m-d H:i:s\");\n\t\t\t\t$rs[11] = (isset($xxx))?json_encode ($xxx):json_encode (array());\n\t\t\t\t$rs[12] = isset($arrayevents[$i]['tecnico']) ? $arrayevents[$i]['tecnico'] : \"\";\n\t\t\t\t$rs[13] = $iparams;\n\t\t\t\t$rs[14] = 'EASY_INTERVENCIONES';\n\t\t\t\t$rs[15] = 'INTERVENCIONES';\n\t\t\t\t$rs[16] = $arrayevents[$i]['ci'];\n\t\t\t\t\n\t\t\t\t$res = array_combine($k, $rs);\n\t\t\t\t\n\t\t\t\t$dat['id'] = $TareasDb->InsertTarea($res);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Creacion de evento\n\t\t\t\t\t$dataservidores = unserialize($arrayevents[$i][\"data_servidor\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t$data = array('id'=>null,\n\t\t\t\t\t\t'title'\t\t\t=>\"Tipo: Reinicio - \".substr($arrayevents[$i]['observaciones'], 0, 70),\n\t\t\t\t\t\t'start'\t\t\t=>$arrayevents[$i]['fecha_inicio'],\n\t\t\t\t\t\t'end'\t\t\t=>$arrayevents[$i]['fecha_fin'],\n\t\t\t\t\t\t'description'\t=>$arrayevents[$i]['observaciones'],\n\t\t\t\t\t\t'origen'\t\t=>\"Journal\",\n\t\t\t\t\t\t'idtarea'\t\t=>$dat['id'],\n\t\t\t\t\t\t'turno'\t\t\t=>\"morning\" ,\n\t\t\t\t\t\t'refer' \t\t=>(is_null($arrayevents[$i]['ticket']))?'':$arrayevents[$i]['ticket'],\n\t\t\t\t\t\t'centro'\t\t=>$arrayevents[$i]['entorno'],\n\t\t\t\t\t\t'cliente'\t\t=>$arrayevents[$i]['cliente'],\n\t\t\t\t\t\t'group'\t\t\t=>\"EASY\",\n\t\t\t\t\t\t'rgroup'\t\t=>$arrayevents[$i]['tipo'],\n\t\t\t\t\t\t'type' \t\t\t=>\"EASY_INTERVENCION\" ,\n\t\t\t\t\t\t'params' =>(is_null($iparams))?'':$iparams,\n\t\t\t\t\t\t'customer_affected' =>$dataservidores[0][1],\n\t\t\t\t\t\t'open-close-ticket' => null,\n\t\t\t\t\t\t'status' => \"Pending\",\n\t\t\t\t\t\t'creada'=> date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'usuario' => $arrayevents[$i]['tecnico']\n\t\t\t\t);\n\t\t\t\t\t$id = $EventsDb->InsertEvent($data);\n\t\t\t\t\t$opciones->SetEventValue($id,\"className\",\"Journal_Pending\");\n\t\t\t\t\t//insert en tabla control\n\t\t\t\t\t$dataintervencion = array();\n\t\t\t\t\t$dataintervencion[\"id_intervencion\"] \t= $arrayevents[$i]['ID'];\n\t\t\t\t\t$dataintervencion[\"servidores\"] \t\t= $arrayevents[$i][\"data_servidor\"];\n\t\t\t\t\t$smallInt->InsertInterventionTaskControl($dataintervencion);\n\t\t\t}\n\t\t\t}\n\n\t\t\n\t}", "public function getProgramByProgramTypeID ()\n\t{\n//\t\techo json_encode('hello');\n//\t\t$this->form_validation->set_rules('shift_id','shift is required','required|trim');\n\t\t$this->form_validation->set_rules('program_type','program is required','required|trim');\n\t\tif ($this->form_validation->run())\n\t\t{\n//\t\t\t$shift_id = $this->input->post(\"shift_id\");\n\t\t\t$program_type = $this->input->post(\"program_type\");\n\n\t\t\t$record = $this->Administration->getProgramsByProgramType ($program_type);\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\techo json_encode($record);\n\t\t}//if\n\t}", "protected function initprogram() {\n $data = array(\n 'idnumber' => '__fcH__TESTID001__',\n 'name' => 'Test Program 1'\n );\n\n $newprogram = new curriculum($data);\n $newprogram->save();\n $this->tprogramid = $newprogram->id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the enabled state of the given choices in the container.
public function EnableArray(array &$choices) { $this->SetEnabled($choices, true); }
[ "public function setChoices(array $choices);", "public function setEnabled($value);", "public function set_choices(array $choices) {\n $this->choices = $choices;\n }", "public function setEnabled($enabled);", "function setEnabled($enabled) {\n $this->enabled = $enabled;\n }", "public function enable()\n\t{\n\t\t$this->setProperty('enabled', 'y');\n\t}", "private function SetSelectedByValue(array &$values, $state) {\n foreach($this->choices AS &$choice) {\n if(in_array($choice->value, $values)) {\n $choice->selected = $state;\n if($state && !$choice->enabled)\n $choice->enabled = true;\n }\n } unset($choice);\n }", "public function testSetDisabled()\n {\n $container = $this->_getContainerWithItems();\n $container->setDisabled(true);\n $container->addItem('Mock_MockItem', 'testMock');\n foreach($container as $item) {\n $this->assertTrue($item->isDisabled());\n }\n }", "function setOptions() {\n\t\t$enabled_options = '';\n\t\tif ($this->gamestate['enable_blurries']) $enabled_options .= 'blurries_enabled ';\n\t\tif ($this->gamestate['enable_wobblies']) $enabled_options .= 'wobblies_enabled ';\n\t\t$this->set(compact('enabled_options'));\n\t}", "public function updateSelectors(array $choices);", "public function setChoices($choices)\n {\n if (func_num_args() > 1) {\n $choices = func_get_args();\n }\n\n $this->choices = [];\n return $this->addChoices($choices);\n }", "public function setEnabled($enabled)\n {\n $this->enabled = (bool)$enabled;\n }", "public function setEnabled($enabled)\n {\n $this->enabled = (int)$enabled;\n }", "private function setEnabled()\n\t{\n\t\t$this->enabled_types = $this->post_type_repo->getPostTypesObject();\n\t}", "public function setDisabled($value);", "public function enableOption();", "public function test_choices_are_set() {\n\t\t$control = $this->wp_customize->add_control( new \\Astoundify_ThemeCustomizer_Control_BigChoices(\n\t\t\t$this->wp_customize,\n\t\t\t'choices_are_set',\n\t\t\tarray(\n\t\t\t\t'choices' => array( 1, 2, 3 ),\n\t\t\t)\n\t\t) );\n\n\t\t$this->assertEqualSets( array( 1, 2, 3 ), $control->choices );\n\t}", "public function setChoices(?array $value): void {\n $this->getBackingStore()->set('choices', $value);\n }", "public function authSetEnableAction()\n {\n $enable = $this->requireNotEmptyParam('enable') ? true : false;\n\n $result = $this->backend->auth_setenable($enable);\n $this->processUnnormalBackendResult($result);\n\n $this->apiOk(null, 'set auth enable status successfully');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the check category of the check.
public function checkCategory() { return $this->belongsTo('Dodona\CheckCategory'); }
[ "public function getCategory()\n {\n return $this->readOneof(6);\n }", "function get_category() {\n $category = null;\n\n if (!empty($this->categoryid)) {\n $category = grade_category::fetch('id', $this->categoryid);\n } elseif (!empty($this->iteminstance) && $this->itemtype == 'category') {\n $category = grade_category::fetch('id', $this->iteminstance);\n }\n\n return $category;\n }", "public function getCategory()\n {\n if (array_key_exists(\"category\", $this->_propDict)) {\n if (is_a($this->_propDict[\"category\"], \"\\Beta\\Microsoft\\Graph\\WindowsUpdates\\Model\\SafeguardCategory\") || is_null($this->_propDict[\"category\"])) {\n return $this->_propDict[\"category\"];\n } else {\n $this->_propDict[\"category\"] = new SafeguardCategory($this->_propDict[\"category\"]);\n return $this->_propDict[\"category\"];\n }\n }\n return null;\n }", "public function getCategory()\n {\n return $this->getOptionValue(self::CATEGORY);\n }", "public function getCategory()\r\n {\r\n return $this->category;\r\n }", "public function getCategory(): string\n {\n return $this->category;\n }", "function get_item_category() {\n if (!$this->is_course_item() and !$this->is_category_item()) {\n return false;\n }\n return grade_category_local::fetch(array('id'=>$this->iteminstance));\n }", "public function getCategory(): string\n {\n return 'validation';\n }", "public function getUsageCategory()\n {\n return isset($this->usageCategory) ? $this->usageCategory : null;\n }", "function getCategoryClass()\n {\n global $category_class;\n \n if ($category_class) {\n // nothing\n } elseif ($category = get_constructor_category()) {\n if (sizeof($category) > 0)\n $category_class = 'category-' .join(' category-', $category);\n } else {\n $category_class = '';\n }\n \n return $category_class;\n }", "public function getCategory()\n {\n $string = mb_strtolower(\"{$this->name} {$this->id}\");\n $string = preg_replace('/[^a-z ]/', ' ', $string);\n $parts = explode(' ', $string);\n $parts = array_filter($parts);\n $lastPart = array_shift($parts);\n return $lastPart ?: 'bin';\n }", "function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }", "public function getCategory()\n {\n if (array_key_exists(\"category\", $this->_propDict)) {\n if (is_a($this->_propDict[\"category\"], \"\\Beta\\Microsoft\\Graph\\Model\\WindowsMalwareCategory\") || is_null($this->_propDict[\"category\"])) {\n return $this->_propDict[\"category\"];\n } else {\n $this->_propDict[\"category\"] = new WindowsMalwareCategory($this->_propDict[\"category\"]);\n return $this->_propDict[\"category\"];\n }\n }\n return null;\n }", "public function getCategory()\n {\n return Mage::registry('current_category');\n }", "public function getControlCategory()\n {\n if (array_key_exists(\"controlCategory\", $this->_propDict)) {\n return $this->_propDict[\"controlCategory\"];\n } else {\n return null;\n }\n }", "public function getDef_category()\n {\n return $this->def_category;\n }", "public function get_category_const()\n {\n return $this->m_category_const;\n }", "public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Layout = '.get_class( $this ) ) );\n\t}", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.add_extra() update_extra() extra tablosundaki verilerini gunceller
function update_extra($where, $args = array()) { if (!have_log(@$args['uniquetime'])) { // default variable if (!is_array($where)) { if (is_numeric($where)) { $where = array('id' => $where); } else { $where = array('name' => $where); } } $args = _args_helper(input_check($args), 'update'); $update = $args['update']; @form_validation($update['taxonomy'], '', 'Ekstra adı', 'required|min_length[3]|max_length[64]', __FUNCTION__); if (!is_alert(__FUNCTION__)) { if ($extra = get_extra($where)) { if ($q_update = db()->query("UPDATE " . dbname('extra') . " SET " . sql_update_string($update) . " " . sql_where_string($where) . " ")) { $new_extra = get_extra($extra->id); if ($args['add_alert']) { add_alert('Ekstra güncellendi.', 'success', __FUNCTION__); } if ($args['add_log']) { add_log(array('uniquetime' => @$args['uniquetime'], 'table_id' => 'extra:' . $extra->id, 'log_key' => __FUNCTION__, 'log_text' => 'Eksra güncellendi.', 'meta' => log_compare($extra, $new_extra))); } return $extra->id; } else { add_mysqli_error_log(__FUNCTION__); } } else { if ($args['add_new']) { if ($extra_id = add_extra($args)) { return $extra_id; } else { return false; } } //.$args['add_new'] } //.$extra = get_extra($where) } else { return false; } } else { repetitive_operation(__FUNCTION__); } }
[ "function table_heading_row_add_extra($data, $class=\"\") {\r\n }", "function cextra_quete_valeurs_extras($extras, $type, $id){\r\n\t\r\n\t// nom de la table et de la cle primaire\r\n\t$table = table_objet_sql($type);\r\n\t$_id = id_table_objet($type);\r\n\t\r\n\t// liste des champs a recuperer\r\n\t$champs = array();\r\n\tforeach ($extras as $e) {\r\n\t\t$champs[] = $e->champ;\r\n\t}\r\n\tif (is_array($res = sql_fetsel($champs, $table, $_id . '=' . sql_quote($id)))) {\r\n\t\treturn $res;\r\n\t}\r\n\treturn array();\r\n}", "function cextra_quete_valeurs_extras($extras, $type, $id){\n\n\t// nom de la table et de la cle primaire\n\t$table = table_objet_sql($type);\n\t$_id = id_table_objet($type);\n\n\t// liste des champs a recuperer\n\t$champs = array();\n\tforeach ($extras as $e) {\n\t\t$champs[] = $e->champ;\n\t}\n\tif (is_array($res = sql_fetsel($champs, $table, $_id . '=' . sql_quote($id)))) {\n\t\treturn $res;\n\t}\n\treturn array();\n}", "function edit_entries_additional_tableheader()\n\t{\n\n\t\tif($this->debug === TRUE) print(\"<br />edit_entries_additional_tableheader\");\n\n\t\tglobal $DSP, $LANG, $EXT, $SESS;\n\n\t\t$extra = ($EXT->last_call !== FALSE) ? $EXT->last_call : '';\n\n\t\t$SESS->cache['lg'][LG_LL_addon_id]['show_links'] = FALSE;\n\t\tforeach ($this->settings['weblogs'] as $weblog_id => $weblog_settings)\n\t\t{\n\t\t\tif($weblog_settings['display_link'] == TRUE)\n\t\t\t{\n\t\t\t\t$SESS->cache['lg'][LG_LL_addon_id]['show_links'] = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(\n\t\t\t// enabled?\n\t\t\t$this->settings['enabled'] == TRUE\n\t\t\t&& $SESS->cache['lg'][LG_LL_addon_id]['show_links']\n\t\t\t// allowed member group?\n\t\t\t&& in_array($SESS->userdata['group_id'], $this->settings['allowed_member_groups'])\n\t\t)\n\t\t{\n\t\t\t$extra .= $DSP->table_qcell('tableHeadingAlt', \"Live Look\");\n\t\t} \n\t\treturn $extra;\n\t}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '475','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '474','type' => 'module','code' => 'category'),\n array('extension_id' => '473','type' => 'module','code' => 'account'),\n array('extension_id' => '472','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '471','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '470','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '469','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '468','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '467','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '572','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '571','type' => 'module','code' => 'category'),\n array('extension_id' => '570','type' => 'module','code' => 'account'),\n array('extension_id' => '569','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '568','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '567','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '566','type' => 'module','code' => 'basel_products')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '668','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '667','type' => 'module','code' => 'category'),\n array('extension_id' => '666','type' => 'module','code' => 'account'),\n array('extension_id' => '665','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '664','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '663','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '662','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '660','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "static function getExtraTable() { return self::$extra_table; }", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '437','type' => 'module','code' => 'account'),\n array('extension_id' => '436','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '435','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '434','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '433','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '432','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '438','type' => 'module','code' => 'category'),\n array('extension_id' => '439','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '440','type' => 'module','code' => 'basel_categories')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "public function testUpdateExtraFields(): void { }", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\n\t$oc_extension = array(\n\t array('extension_id' => '35','type' => 'module','code' => 'basel_carousel'),\n\t array('extension_id' => '33','type' => 'module','code' => 'blog_latest'),\n\t array('extension_id' => '32','type' => 'module','code' => 'basel_products'),\n\t array('extension_id' => '31','type' => 'module','code' => 'basel_megamenu'),\n\t array('extension_id' => '30','type' => 'module','code' => 'basel_layerslider'),\n\t array('extension_id' => '29','type' => 'module','code' => 'basel_content'),\n\t array('extension_id' => '14','type' => 'module','code' => 'account'),\n\t array('extension_id' => '13','type' => 'module','code' => 'category'),\n\t array('extension_id' => '34','type' => 'module','code' => 'basel_instagram')\n\t);\n\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n\t$oc_extension = array(\n\t array('extension_id' => '35','type' => 'module','code' => 'basel_carousel'),\n\t array('extension_id' => '33','type' => 'module','code' => 'blog_latest'),\n\t array('extension_id' => '32','type' => 'module','code' => 'basel_products'),\n\t array('extension_id' => '31','type' => 'module','code' => 'basel_megamenu'),\n\t array('extension_id' => '30','type' => 'module','code' => 'basel_layerslider'),\n\t array('extension_id' => '29','type' => 'module','code' => 'basel_content'),\n\t array('extension_id' => '14','type' => 'module','code' => 'account'),\n\t array('extension_id' => '13','type' => 'module','code' => 'category'),\n\t array('extension_id' => '34','type' => 'module','code' => 'basel_instagram')\n\t);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "function delete_extra($args = array())\n{\n\n // default variable\n if (!is_array($args)) {\n if (is_numeric($args)) {\n $args = array('where' => array('id' => $args));\n } else {\n $args = array('where' => array('name' => $args));\n }\n }\n\n $args = _args_helper($args);\n\n if ($extra = get_extra($args)) {\n if ($q_delete = db()->query(\"DELETE FROM \" . dbname('extra') . \" \" . sql_where_string($args) . \" \")) {\n if (db()->affected_rows) {\n if ($args['add_alert']) {\n add_alert('Ekstra bilgisi silindi', 'warning', __FUNCTION__);\n }\n if ($args['add_log']) {\n add_log(array('table_id' => 'extra:' . $extra->id, 'log_key' => __FUNCTION__, 'log_text' => _b($extra->name) . ' Ekstra silindi.'));\n }\n return true;\n } else {\n return false;\n }\n } else {\n add_mysqli_error_log(__FUNCTION__);\n }\n } else {\n if ($args['add_alert']) {\n add_alert('Silinecek ekstra bilgisi bulunamadı.', 'warning', __FUNCTION__);\n }\n return false;\n }\n\n}", "function delete_extra($args=array()) {\n\n\t// default variable\n\tif(!is_array($args)) { if(is_numeric($args)) { $args = array('where'=>array('id'=>$args)); } else { $args = array('where'=>array('name'=>$args)); } }\n\n\t$args = _args_helper($args);\n\n\tif($extra = get_extra($args)) {\n\t\tif($q_delete = db()->query(\"DELETE FROM \".dbname('extra').\" \".sql_where_string($args).\" \")) {\n\t\t\tif(db()->affected_rows) {\n\t\t\t\tif($args['add_alert']) { add_alert('Ekstra bilgisi silindi', 'warning', __FUNCTION__); }\n\t\t\t\tif($args['add_log']) { add_log(array('table_id'=>'extra:'.$extra->id, 'log_key'=>__FUNCTION__, 'log_text'=>_b($extra->name).' Ekstra silindi.')); }\n\t\t\t\treturn true;\n\t\t\t} else { return false; }\n\t\t} else { add_mysqli_error_log(__FUNCTION__); }\n\t} else { if($args['add_alert']) { add_alert('Silinecek ekstra bilgisi bulunamadı.', 'warning', __FUNCTION__); } return false; }\n\n}", "public function foto_extra_reserva($id_extra_reserva, $extra_reserva)\n {\n $this->db->where('id', $id_extra_reserva);\n return $this->db->update(self::TABLA, $extra_reserva);\n }", "function plugin_add ($db,$tableid,$id)\n{\n global $system_settings;\n\n $table_desc=get_cell($db,\"tableoftables\",\"table_desc_name\",\"id\",$tableid);\n $tablename=get_cell($db,\"tableoftables\",\"tablename\",\"id\",$tableid);\n $real_tablename=get_cell($db,\"tableoftables\",\"real_tablename\",\"table_desc_name\",$table_desc);\n $authortable=get_cell($db,$table_desc,\"associated_table\",\"columnname\",\"type2\");\n\n if (!$system_settings[\"protocols_file\"])\n return false;\n $r=$db->Execute(\"SELECT ownerid,title,type1,type2 FROM $real_tablename WHERE id=$id\");\n $fid=fopen($system_settings[\"protocols_file\"],w);\n if ($fid) {\n $link= $system_settings[\"baseURL\"].getenv(\"SCRIPT_NAME\").\"?tablename=$tablename&showid=$id\";\n $author=get_cell($db,$authortable,\"type\",\"id\",$r->fields[\"type2\"]);\n $author.=\" \".get_cell($db,$authortable,\"typeshort\",\"id\",$r->fields[\"type2\"]);\n $submitter=get_person_link($db,$r->fields[\"ownerid\"]);\n $text=\"<a href='$link'><b>\".$r->fields[\"title\"].\"</b></a>\";\n $text.= \". Written by $author.<br> Submitted by $submitter.\";\n fwrite($fid,$text);\n fclose($fid);\n }\n}", "public function modify_privilage_options(){\n $all_active_result = $this->dbCon->select('tbl_features','*',array('isactive'=>1),null,null,true);\n if($all_active_result->total_data()!=\"\"){\n while($r = $all_active_result->fetch_data()){\n $str[] = str_replace(\" \", \"_\", strtolower($r->feature_name));\n }\n //Gets all the previlage currently available\n $current_fields = $this->get_all_prev_fields();\n //finds the currently available tables not to be touched\n $no_touch_previlage = array_intersect($str, $current_fields);\n //finds the new previlages which must be added to table\n $add_previlage = array_diff($str, $current_fields);\n //finds the old previlage that must be deleted from table tbl_user_prev\n $delete_previlage = array_diff($current_fields, $str);\n \n //Process to delete all the unwanted previlage\n if(is_array($delete_previlage)){\n foreach($delete_previlage as $dval){\n //$del_sql = 'ALTER TABLE tbl_user_prev DROP \"'.$dval.'\"';\n $this->dbCon->exec('ALTER TABLE tbl_user_prev DROP '.$dval);\n }\n }\n //Add all the new Previlages as required\n if(is_array($add_previlage)){\n foreach($add_previlage as $aval){\n $this->dbCon->exec(\"ALTER TABLE tbl_user_prev ADD $aval INT(11)\");\n }\n }\n //$list = implode(',', $str);\n \n }\n \n \n }", "function alterEntries($user_details, $db, $type, $table, $where)\r\n\t{\r\n\t\t$tf = $this->getFields($table, $db['dbname'], $db['link']);\r\n\t//This is just setting up some variables for use in the switch.\r\n\t\tif(is_array($user_details))\r\n\t\t{\r\n\t\t\t\t//This is so far the best way I can see that will let you count the number of items to be parsed.\r\n\t\t\tforeach($tf as $tf_key)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($user_details[$tf_key] != NULL)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$x++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\t\r\n\t\r\n\t\r\n\t\t//Lets assemble this sucker.\r\n\t\tswitch($type)\r\n\t\t{\r\n\t\t\r\n\t\t\tcase'new_entry':\r\n\t\t\t\t\r\n\t\t\r\n\t\t\tforeach($tf as $tf_key)\r\n\t\t\t{\r\n\t\t\r\n\t\t\t\tif($tf_key != NULL)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($user_details[$tf_key] != NULL)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$c++;\r\n\t\t\t\t\t\t\t\t\tif($c < $x)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$comma = ',';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$comma = NULL;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$sql_part1 .= '`'.$tf_key.\"`$comma \"; \r\n\t\t\t\t\t\t\t\t$sql_part2 .=\"'\".$user_details[$tf_key].\"'$comma \"; \r\n\t\t\t\t\t\t\t\t$user_details[$tf_key] = NULL;\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn(\"insert into `$db[dbname]`.`$table` ($sql_part1) values($sql_part2) \");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\tcase'update_entry':\r\n\t\r\n\t\t\t\tforeach($tf as $tf_key)\r\n\t\t\t\t{\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($tf_key != NULL)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($user_details[$tf_key] != NULL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$c++;\r\n\t\t\t\t\t\t\t\tif($c < $x)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$comma = ',';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$comma = NULL;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$sql_part1 .= \"`$tf_key`='$user_details[$tf_key]'$comma \"; \r\n\t\t\t\t\t\t\t$user_details[$tf_key] = NULL;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn(\"update `$db[dbname]`.`$table` set $sql_part1 $where\");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\r\n\t\t\tcase'delete_entry':\r\n\t\t\treturn(\"delete from `$db[dbname]`.`$table` $where\");\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function AddImported()\n {\n $datas=preg_grep('/\\S/',$this->ImportDatas);\n array_unshift($datas,\"No\");\n $titles=$this->B($this->MyMod_Data_Titles($datas));\n\n $this->MyMod_Data_Add_Default_Init();\n\n $table=array($titles);\n foreach ($this->ImportItems as $n => $item)\n {\n $ritem=$item;\n foreach ($this->AddDefaults as $data => $value)\n {\n $ritem[ $data ]=$value;\n }\n\n array_push\n (\n $table,\n $this->MyMod_Group_Row_Item(0,$item,$n+1,$datas)\n );\n }\n\n print\n $this->H(2,\"Itens Importados\").\n $this->H(3,count($this->ImportItems).\" \".$this->ItemsName).\n $this->HtmlTable(\"\",$table).\n $this->MakeHidden(\"Import\",1);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
elementFactory wrapper to get elements by type, assign data and form dependency
protected function _getElement($type = 'checkbox', array $data = [], array $formData = []) { $element = $this->elementFactory ->create($type, ['data' => $data]) ->setForm($this->_getFormMock($formData)); return $element; }
[ "public function provideElementFactory()\n {\n return [\n 'primary' => [\n 'expected' => '',\n 'column' => 'id',\n 'params' => [\n 'primary' => true,\n 'type' => 'int',\n 'description' => 'description',\n ],\n 'value' => 1,\n ],\n\n 'not primary' => [\n 'expected' => 'expected value - not primary',\n 'column' => 'name',\n 'params' => [\n 'type' => 'varchar',\n 'description' => 'description',\n ],\n 'value' => 'the value',\n ],\n\n 'text' => [\n 'expected' => 'expected value - text element',\n 'column' => 'name',\n 'params' => [\n 'type' => 'text',\n 'description' => 'description',\n ],\n 'value' => 'the name',\n ],\n\n 'enum' => [\n 'expected' => 'expected value - enum element',\n 'column' => 'name',\n 'params' => [\n 'type' => 'enum',\n 'description' => 'description',\n 'options' => ['value', 'value2'],\n ],\n 'value' => 'the name',\n ],\n ];\n }", "abstract public function getElementProvider();", "public function selectAndCreateElement($type=null)\n\t{\n\t\t$this->functionCallLog('selectAndCreateElement -> ' .$type);\n\t\t$element=null;\n\t\tif(strtoupper($type)=='TEXT')\n\t\t\t$element=$this->elementText();\n\t\tif(strtoupper($type)=='DROPDOWN')\n\t\t\t$element=$this->elementDropdown();\n\t\tif(strtoupper($type)=='ORDERED LIST')\n\t\t\t$element=$this->elementList('ORDERED LIST');\n\t\tif(strtoupper($type)=='DEFINATION LIST')\n\t\t\t$element=$this->elementList('DEFINATION LIST');\n\t\tif(strtoupper($type)=='UNORDERED LIST')\n\t\t\t$element=$this->elementList();\n\t\tif(strtoupper($type)=='RADIO')\n\t\t\t$element=$this->elementRadio();\n\t\tif(strtoupper($type)=='CHECKBOX')\n\t\t\t$element=$this->elementCheckbox();\n\t\tif(strtoupper($type)=='SUBMIT')\n\t\t\t$element=$this->elementSubmit();\n\t\tif(strtoupper($type)=='BLANK')\n\t\t\t$element='';\n\n\t\treturn $element;\n\t}", "public function setFormElements()\n {\n $fieldinfos = $this->getFieldsForInput();\n foreach ($fieldinfos as $fieldinfo) {\n $input = base_form_element_Factory::createElement($fieldinfo);\n $value = '';\n $defaultValue = $fieldinfo->getDefaultValue();\n if (!empty($defaultValue)) {\n $value = $defaultValue;\n }\n if (isset($this->obj[$fieldinfo->getFieldName()])) {\n $value = $this->obj->getField($fieldinfo->getFieldName());\n }\n $input->setValue($value);\n $input->setDisplayedLength($fieldinfo->getDisplayedLength());\n $input->setName($fieldinfo->getFieldName());\n $dClName = 'base_displayclass_' . ucfirst($fieldinfo->getDisplayClass());\n /** @var DisplayClass $dCl */\n $dCl = new $dClName($this->obj);\n $displaymode = $dCl->getDisplayMode($this->getDisplayMode());\n $input->setDisplayMode($displaymode);\n $this->_addFormElement($input, $fieldinfo->getFieldLabel());\n }\n }", "abstract function form_elements();", "public function testCreatingElementsAreWorkingAsExpected()\n\t{\n\t\t$div = $this->factory->create('div', array('class' => 'container'));\n\n\t\t$this->assertEquals('<div class=\"container\"></div>', $div->render());\n\n\t\t//Testing syntax sugar for creating elements\n\t\t$ul = HTMLElementFactory::ul(array('class' => 'nav'));\n\n\t\t$this->assertEquals('<ul class=\"nav\"></ul>', $ul->render());\n\n\t\t//Testing HTMLReference changing\n\t\t$input = $this->factory->create('input', array('type' => 'text', 'name' => 'someName', 'value' => 'someValue', 'required'));\n\n\t\t$this->factory->setHTMLReference( HTMLReference::of('xhtml') );\n\n\t\t$inputX = $this->factory->create('input', array('type' => 'text', 'name' => 'someName', 'value' => 'someValue', 'required'));\n\n\t\t$this->assertEquals('<input type=\"text\" name=\"someName\" value=\"someValue\" required>', $input->render());\n\t\t$this->assertEquals('<input type=\"text\" name=\"someName\" value=\"someValue\" required=\"required\"/>', $inputX->render());\n\t}", "function makeElement($id,$type,$value=\"\",$attr=array(),$options=array()) {\n # Init\n $el = \"\";\n \n # Type?\n switch($type) {\n\t # Tipe Label\n\t case 'label' :\n\t\t $el .= \"<label for='\".$id.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \">\".$value.\"</label>\";\n\t\t break;\n\t\t \n\t # Tipe Text Standard\n\t case 'txt' :\n\t case 'text' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtext' type='text'\";\n\t\t $el .= \" value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Text Uppercase\n\t case 'textupper' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextuppercase' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Text Lowercase\n\t case 'textlower' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextlowercase' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Text Number/Numeric\n\t case 'textnum' :\n\t case 'textnumber' :\n\t case 'textnumeric' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' class='myinputtextnumber' type='text' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Select\n\t case 'select' :\n\t case 'dropdown' :\n\t\t $el .= \"<select id='\".$id.\"' name='\".$id.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .=\">\";\n\t\t foreach($options as $val=>$name) {\n\t\t\t if($value==$val) {\n\t\t\t\t $el .= \"<option value='\".$val.\"' selected>\".$name.\"</option>\";\n\t\t\t } else {\n\t\t\t\t $el .= \"<option value='\".$val.\"'>\".$name.\"</option>\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"</select>\";\n\t\t break;\n\t\t \n\t # Tipe Checkbox\n\t case 'chk' :\n\t case 'check' :\n\t case 'checkbox' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='checkbox'\";\n\t\t $el .= \" value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t # Tipe Password\n\t case 'password' :\n\t case 'pwd' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='password' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Button\n\t case 'button' :\n\t case 'btn' :\n\t\t $el .= \"<button id='\".$id.\"' name='\".$id.\"' class='mybutton'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \">\".$value.\"</button>\";\n\t\t break;\n\t \n\t # Tipe Submit\n\t case 'submit' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='submit' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t \n\t # Tipe Submit\n\t case 'hidden' :\n\t case 'hid' :\n\t\t $el .= \"<input id='\".$id.\"' name='\".$id.\"' type='hidden' value='\".$value.\"'\";\n\t\t if(is_array($attr) and $attr!=array()) {\n\t\t\t foreach($attr as $key=>$row) {\n\t\t\t\t $el .= \" \".$key.\"=\\\"\".$row.\"\\\"\";\n\t\t\t }\n\t\t }\n\t\t $el .= \"/>\";\n\t\t break;\n\t\t \n\t default :\n\t\t break;\n }\n return $el;\n }", "public function create( $spec )\n {\n $element = parent::create( $spec );\n\n if ( $element instanceof ServiceLocatorAwareInterface )\n {\n $element->setServiceLocator( $this->getServiceLocator() );\n }\n\n if ( $element instanceof FieldsetInterface )\n {\n $element->setFormFactory( $this );\n }\n\n if ( $element instanceof PrepareElementsAwareInterface )\n {\n $element->prepareElements();\n }\n\n return $element;\n }", "abstract protected function populateElements();", "function athematic_form_element($variables) {\n $element = &$variables['element'];\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n\n // This function is invoked as theme wrapper, but the rendered form element\n // may not necessarily have been processed by form_builder().\n $element += array(\n '#title_display' => 'before',\n );\n\n // Add element #id for #type 'item'.\n if (isset($element['#markup']) && !empty($element['#id'])) {\n $attributes['id'] = $element['#id'];\n }\n // Add element's #type and #name as class to aid with JS/CSS selectors.\n $attributes['class'] = array('form-item');\n if (!empty($element['#type'])) {\n $attributes['class'][] = 'form-type-' . strtr($element['#type'], '_', '-');\n }\n if (!empty($element['#name'])) {\n $attributes['class'][] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));\n }\n // Add a class for disabled elements to facilitate cross-browser styling.\n if (!empty($element['#attributes']['disabled'])) {\n $attributes['class'][] = 'form-disabled';\n }\n $output = '<div' . drupal_attributes($attributes) . '>' . \"\\n\";\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n $prefix = isset($element['#field_prefix']) ? '<span class=\"field-prefix\">' . $element['#field_prefix'] . '</span> ' : '';\n $suffix = isset($element['#field_suffix']) ? ' <span class=\"field-suffix\">' . $element['#field_suffix'] . '</span>' : '';\n\n switch ($element['#title_display']) {\n case 'before':\n case 'invisible':\n $output .= ' ' . theme('form_element_label', $variables);\n $output .= ' ' . $prefix . $element['#children'] . $suffix . \"\\n\";\n break;\n\n case 'after':\n $output .= ' ' . $prefix . $element['#children'] . $suffix;\n $output .= ' ' . theme('form_element_label', $variables) . \"\\n\";\n break;\n\n case 'none':\n case 'attribute':\n // Output no label and no required marker, only the children.\n $output .= ' ' . $prefix . $element['#children'] . $suffix . \"\\n\";\n break;\n }\n\n if (!empty($element['#description'])) {\n $output .= '<div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n /*\n * Kill the throbber css backgroud replacement for tags text-field.\n * \n * For some reason the form-autocomplete class gets its BG replaced \n * universally when the throbber is called, this really messes up the tags\n * element if you don't catch it. I caught it here but this is really a\n * messy way to do it, not sure what would be better.\n */\n\n if(!empty ($element['#field_name']) && $element['#field_name']=='field_tags'){\n$output ='<div class=\"form-item form-type-textfield form-item-field-tags-und\">' . \n '<label for=\"edit-field-tags-und\">Tags </label> <div id=\"input-text-wrapper\">' . \n '<!-- Wrapper for text input --><input type=\"text\" id=\"edit-field-tags-und\" name=\"field_tags[und]\" value=\"\" size=\"60\" maxlength=\"1024\" class=\"form-text form-autocomplete-tags\" />' .\n '</div> <!-- /#input-text-wrapper --><input type=\"hidden\" id=\"edit-field-tags-und-autocomplete\" value=\"http://localhost/drupal-7.7/?q=taxonomy/autocomplete/field_tags\" disabled=\"disabled\" class=\"autocomplete\" />'. \n'<div class=\"description\">Enter a comma-separated list of words to describe your content.</div>\n</div>';\n }\n\n return $output;\n}", "public function build_form_input( $element );", "function formElements()\r\n {\r\n $returnArray = array();\r\n $formArray = array();\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $formArray, \"SELECT ElementID FROM eZForm_FormElementDict WHERE\r\n FormID='$this->ID' ORDER BY Placement\" );\r\n\r\n for ( $i = 0; $i < count( $formArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZFormElement( $formArray[$i][$db->fieldName( \"ElementID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public static function getFormElements();", "function generateElement($element){\n global $dropdown;\n global $elements;\n\n //Generate html element with two input fields for xml attribute and value\n if( $element->columns == 'doubleColumn'){\n echo '\n <div class=\"form-group row no-gutters\" > <!--Standard form group with two inputs-->\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\" >'\n .((is_array($element->attribute) == false)?'<input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\"' .(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') . 'id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . ' ' . (($element->hidden==true)?'hidden=\"true\"':'') . '>':generateDropdown($element)) .\n '<input type=\"'.(($element->value=='date')?'date':'text').'\" ' .(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' class=\"form-control form-control-sm inputField\" id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </div>';\n //Generate html element with a single input field for either xml attribute or value\n }else if($element->columns == 'singleColumn'){\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\"> \n <input type=\"'.(($element->value=='date')?//If value field is == date, create add a datepicker\n 'date'\n :'text').//Else mark as text element\n '\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_attribute_input\"' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled':'').'>\n </div>\n </div>';\n }else if($element->columns == 'typeColumn'){ //Special case for the type fields\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->prefix . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\"> \n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" id=\"'. $element->name .'_attribute_input\" value=\"'.((is_array($element->attribute))?''.((sizeof($elements) > 10))?(string)$element->attribute[0]:(string)$element->attribute[1].'':(string)$element->attribute).'\" ' . (($element->readOnly==true)?'disabled':'').'>\n </div>\n </div>';\n //Generate html element with two input fields for xml attribute and value and a button to dynamically add additional copies of this element\n }else if($element->columns == 'singleDropdown'){\n echo ' \n <div class=\"form-group row no-gutters\"> <!--type--> \n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">' . $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group col-sm-10\">'\n .generateDropdown($element).\n '</div>\n </div>';\n }else if($element->columns == 'buttonDouble'){\n echo '\n <div class=\"form-group row no-gutters justify-content-end\"> <!--Form group with dynamic adding and removal of inputs-->\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group entry col-sm-10 attribute_input\">'\n .((is_array($element->attribute) == false)? '<input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\"' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' >':generateDropdown($element)) .\n '<input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" ' . ((is_array($element->attribute) && sizeOf($element->attribute)==1)?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'') . '>\n <button class=\"btn btn-success btn-add\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>';\n //Generate html element with a single input field for xml attribute or value and a button to dynamically add additional copies of this element\n }else if($element->columns == 'buttonSingle'){\n echo '\n <div class=\"form-group row no-gutters justify-content-end\">\n <label class=\"col-sm-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <div class=\"input-group entry col-sm-10\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\" form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_input\" >\n <button class=\"btn btn-success btn-add\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>';\n }else if( $element->columns == 'doubleRow'){\n echo '\n <div>\n <div class=\"form-group row no-gutters justify-content-end\" > <!--Standard form group with two inputs-->\n <div class=\"col\"> \n <div class=\"form-group row no-gutters justify-content-end\"> \n <label class=\"col-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label> \n <span class=\"col\">\n <div class=\"input-group col-12 no-padding\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n \n <div class=\"w-100\"></div>\n\n <span class=\"col-2\"></span>\n <div class=\"col-12 input-group no-padding\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_attribute_input\" ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[1] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . ' ' . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .'id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </span>\n </div>\n </div> \n </div>\n </div>';\n }\n else if( $element->columns == 'buttonDoubleRow'){\n echo '\n <div>\n <div class=\"form-group row no-gutters justify-content-end entry\"> <!--Form group with dynamic adding and removal of inputs-->\n <div class=\"col\">\n <div class=\"form-group row no-gutters justify-content-end\">\n <label class=\"col-2 col-form-label col-form-label-sm\" for=\"'. $element->name .'_attribute_input\">'. $element->name . (($element->isRequired==true)?'*':'') .'</label>\n <span class=\"col\">\n <div class=\"input-group col-12\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ' ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[0] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n\n <div class=\"w-100\"></div>\n\n <span class=\"col-2\"></span>\n <div class=\"input-group col-12\">\n <input type=\"text\" name=\"'. $element->prefix . $element->name .'\" class=\"form-control form-control-sm inputField attribute_input\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_attribute_input\" ' . ' ' . ((is_array($element->attribute))?'value='. \"'\" . (string)$element->attribute[1] . \"'\" .'':'value='. \"'\" . (string)$element->attribute . \"'\" .'') . (($element->readOnly==true)?'disabled=\"disabled\"':'') . '>\n <input type=\"text\" class=\"form-control form-control-sm inputField\" '.(($element->value=='date')?'':/*'onfocus=\"expandInput(this)\"'*/'') .' id=\"'. $element->name .'_value_input\" value=\"\">\n </div>\n </span>\n </div>\n </div>\n <div style=\"padding-top: 5px;\">\n <button class=\"btn btn-success btn-double-add\" style=\"height: 100%;\" type=\"button\" tabindex=\"-1\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </div>\n </div>\n </div>';\n }\n }", "public function buildStepFormElements();", "protected function createZendFormElement($field)\n\t{\n\t\t// Test for iterator\n\t\tif ($iterator = ($field instanceof Scil_Services_Model_Field_ObjectInterface)) {\n\t\t\t$fieldType = 'iterator';\n\t\t}\n\t\telseif ($field instanceof Scil_Services_Model_Field_Abstract) {\n\t\t\t// Discover the field type and filter out the garbage\n\t\t\t$fieldType = $field->getType();\n\t\t}\n\t\telse {\n\t\t\tthrow new Scil_Services_Model_Decorator_Exception(__METHOD__.' unable to determine field type.');\n\t\t}\n\n\t\t// Create the basic options array\n\t\t$id = $field->getId();\n\t\t$name = $this->renderNamespace($id);\n\n\t\t// Get the form element label\n\t\t$label = isset($this->_labels[$id]) ? $this->_labels[$id] : $name;\n\n\t\t$options = array(\n\t\t\t'name' => $name,\n\t\t\t'id' => $name,\n\t\t\t'value' => $field->getValue(),\n\t\t\t'description' => $field->getDescription(),\n\t\t\t);\n\n\t\tswitch ($fieldType) {\n\t\t\tcase 'iterator' : {\n\t\t\t\t$options['options'] = $field->getValues(TRUE);\n\t\t\t\t$zendField = new Zend_Form_Element_Select($options);\n\t\t\t\t$zendField->setLabel($label);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'bool' : {\n\t\t\t\t$options['options'] = array(\n\t\t\t\t\t'yes' => 'Yes',\n\t\t\t\t\t'no' => 'No',\n\t\t\t\t\t);\n\n\t\t\t\tif (TRUE === $options['value']) {\n\t\t\t\t\t$options['value'] = 'yes';\n\t\t\t\t}\n\t\t\t\telseif (FALSE === $options['value']) {\n\t\t\t\t\t$options['value'] = 'no';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$options['value'] = NULL;\n\t\t\t\t}\n\n\t\t\t\t$zendField = new Zend_Form_Element_MultiCheckbox($options);\n\t\t\t\t$zendField->setLabel($label);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'set' : {\n\t\t\t\t$options['options'] = $field->getEnumeration();\n\t\t\t\t$options['value'] = explode(',', $options['value']);\n\t\t\t\t$zendField = new Zend_Form_Element_MultiSelect($options);\n\t\t\t\t$zendField->setLabel($label);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'enum' : {\n\t\t\t\t$options['options'] = $field->getEnumeration();\n\t\t\t\t$zendField = new Zend_Form_Element_MultiSelect($options);\n\t\t\t\t$zendField->setLabel($label);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'auto' : {\n\t\t\t\t$options['readonly'] = 'readonly';\n\t\t\t\t$zendField = new Zend_Form_Element_Hidden($options);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'string' : {\n\t\t\t\tif (NULL !== ($length = $field->getLength())) {\n\t\t\t\t\t$options['maxlength'] = $length;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'float' :\n\t\t\tcase 'integer' :\n\t\t\tdefault : {\n\t\t\t\t$zendField = new Zend_Form_Element_Text($options);\n\t\t\t\t$zendField->setLabel($label);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\t// Handle validation\n\t\tif ( ! $field->validate()) {\n\t\t\t$zendField->addErrors($field->getMessages());\n\t\t}\n\n\t\treturn $zendField;\n\t}", "private function getFormFactory()\n {\n $typeFactory = new Form\\ResolvedFormTypeFactory();\n $typeFactory->createResolvedType(new BetweenType(), array());\n $registry = new Form\\FormRegistry(\n array(\n new TestForm\\Extension\\TestCore\\TestCoreExtension(),\n new Form\\Extension\\Core\\CoreExtension(),\n new Form\\Extension\\Csrf\\CsrfExtension(new Security\\Csrf\\CsrfTokenManager()),\n new DatasourceExtension()\n ),\n $typeFactory\n );\n return new Form\\FormFactory($registry, $typeFactory);\n }", "public function testElementFactory($expected, $column, $params, $value)\n {\n $sut = $this->getMockBuilder('\\MvcLite\\View\\Helper\\Form')\n ->setMethods(['getView'])\n ->getMock();\n\n $view = $this->getMockBuilder('\\MvcLite\\View')\n ->disableOriginalConstructor()\n ->setMethods(['getHelper'])\n ->getMock();\n\n $helper = $this->getMockBuilder('ViewHelperElement')\n ->setMethods(['render'])\n ->getMock();\n\n $helper->expects($this->any())\n ->method('render')\n ->will($this->returnValue($expected));\n\n $view->expects($this->any())\n ->method('getHelper')\n ->will($this->returnValue($helper));\n\n $sut->expects($this->any())\n ->method('getView')\n ->will($this->returnValue($view));\n\n $result = $sut->elementFactory($column, $params);\n\n $this->assertSame($expected, $result);\n }", "function element_set_form($record, $elementSetName)\n{\n $recordType = get_class($record);\n if ($recordType == 'Item' && $elementSetName == 'Item Type Metadata') {\n $elements = $record->getItemTypeElements();\n } else {\n $elements = get_db()->getTable('Element')->findBySet($elementSetName);\n }\n $filterName = array('ElementSetForm', $recordType, $elementSetName);\n $elements = apply_filters(\n $filterName,\n $elements,\n array('record_type' => $recordType, 'record' => $record, 'element_set_name' => $elementSetName)\n );\n $html = element_form($elements, $record);\n return $html;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Only allow admins to create groups. Catches the edit action and if this is a new group, checks that an admin is logged in. If an existing group, lets the action proceed.
function community_groups_restrict_group_edit_action() { $guid = get_input('group_guid', 0); if ($guid) { // group edit action return true; } // group create return elgg_is_admin_logged_in(); }
[ "public function _requireGroups(){\n\t\treturn array('post','admin');\n\t}", "public function isAdminGroup() {\r\n return $this->object->get('id') == 1 || $this->object->get('name') == $this->modx->lexicon('administrator');\r\n }", "public function addGroupToAdmin()\n {\n try\n {\n // Find the user using the user id\n $user = \\Bencavens\\Chief\\Services\\ChiefSentryFacade::findUserById(1);\n\n // Find the group using the group id\n $admin = \\Bencavens\\Chief\\Services\\ChiefSentryFacade::findGroupByName('admin');\n\n // Assign the group to the user\n $user->addGroup( $admin );\n }\n catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n {\n echo 'User was not found...';\n }\n catch (Cartalyst\\Sentry\\Groups\\GroupNotFoundException $e)\n {\n echo 'Group was not found.';\n }\n }", "function check_group_create(){\n global $bp;\n if(!function_exists('bp_is_active')||!bp_is_active('groups'))\n return; //do not cause headache\n\n self::restrict_group_create();\n }", "public function testOnlyAdminUsersCanUpdateAGroup(): void\n {\n $admin = User::factory()->admin()->create();\n $user = User::factory()->create();\n\n $group = Group::factory()->create();\n\n $this->assertTrue($admin->can('update', $group));\n $this->assertFalse($user->can('update', $group));\n }", "public function actionCreate() {\n $group = $this->groups->add($this->user->id);\n $this->redirect('Group:edit', $group->id);\n }", "function _createGroup()\n {\n global $_ARRAYLANG;\n\n if (isset($_POST['access_create_group'])) {\n $objFWUser = \\FWUser::getFWUserObject();\n if (!empty($_POST['access_group_type']) && in_array($_POST['access_group_type'], $objFWUser->objGroup->getTypes())) {\n $this->_modifyGroup();\n return;\n } else {\n self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_SELECT_A_VALID_GROUP_TYPE'];\n }\n }\n\n $this->_objTpl->addBlockfile('ACCESS_GROUP_TEMPLATE', 'module_access_group_create', 'module_access_group_create.html');\n\n $this->_objTpl->setVariable(array(\n 'TXT_ACCESS_CREATE_GROUP' => $_ARRAYLANG['TXT_ACCESS_CREATE_GROUP'],\n 'TXT_ACCESS_CREATE_GROUP_TYPE_QUESTION' => $_ARRAYLANG['TXT_ACCESS_CREATE_GROUP_TYPE_QUESTION'],\n 'TXT_ACCESS_FRONTEND_DESC' => $_ARRAYLANG['TXT_ACCESS_FRONTEND_DESC'],\n 'TXT_ACCESS_BACKEND_DESC' => $_ARRAYLANG['TXT_ACCESS_BACKEND_DESC'],\n 'TXT_ACCESS_CANCEL' => $_ARRAYLANG['TXT_ACCESS_CANCEL'],\n 'TXT_ACCESS_NEXT' => $_ARRAYLANG['TXT_ACCESS_NEXT']\n ));\n\n $this->_pageTitle = $_ARRAYLANG['TXT_ACCESS_CREATE_NEW_USER_GROUP'];\n\n $this->_objTpl->parse('module_access_group_create');\n }", "public function isGroupAdmin()\n {\n return $this->hasRole(Role::GROUP_ADMINISTRATOR);\n }", "function Groups_admin_create($args)\n{\n // Get parameters from whatever input we need.\n $name = FormUtil::getPassedValue('name', isset($args['name']) ? $args['name'] : null, 'POST');\n $gtype = FormUtil::getPassedValue('gtype', isset($args['gtype']) ? $args['gtype'] : null, 'POST');\n $state = FormUtil::getPassedValue('state', isset($args['state']) ? $args['state'] : null, 'POST');\n $nbumax = FormUtil::getPassedValue('nbumax', isset($args['nbumax']) ? $args['nbumax'] : null, 'POST');\n $description = FormUtil::getPassedValue('description', isset($args['description']) ? $args['description'] : null, 'POST');\n\n // Confirm authorisation code.\n if (!SecurityUtil::confirmAuthKey()) {\n return LogUtil::registerAuthidError(pnModURL('Groups', 'admin', 'view'));\n }\n\n // The API function is called.\n $check = pnModAPIFunc('Groups', 'admin', 'getgidbyname',\n array('name' => $name));\n\n if ($check != false) {\n // Group already exists\n LogUtil::registerError(__('Error! There is already a group with that name.'));\n } else {\n $gid = pnModAPIFunc('Groups', 'admin', 'create',\n array('name' => $name,\n 'gtype' => $gtype,\n 'state' => $state,\n 'nbumax' => $nbumax,\n 'description' => $description));\n\n // The return value of the function is checked here\n if ($gid != false) {\n // Success\n LogUtil::registerStatus(__('Done! Created the group.'));\n }\n }\n\n // This function generated no output\n return pnRedirect(pnModURL('Groups', 'admin', 'view'));\n}", "function doAdmin()\n {\n assignGetIfExists($this->forcegroup, $this->rs, 'forcegroup');\n if ($this->forcegroup)\n {\n /* Force group assignment for unassigned students. */\n $unassignedStudents = $this->getUnassignedStudentList();\n $emptyGroups = $this->getEmptyGroupsList();\n $forced_groups = $this->forceGroupAssignment($unassignedStudents, $emptyGroups);\n $this->assign('forced_groups', $forced_groups);\n $this->action = 'forcegroup';\n }\n }", "function addGroup() {\n\t\t$adminGroup = new adminGroup;\n\t\t$template = new template;\n\t\t$template->assignClean('_TITLE', systemSettings::get('SITENAME').' Admin Groups');\n\t\t$template->assignClean('adminGroup', $adminGroup->fetchArray());\n\t\t$template->assignClean('accessSections', adminUser::$accessSections);\n\t\t$template->assignClean('groupAccess', $adminGroup->getAccess());\n\t\t$template->assignClean('propertyMenuItem', getRequest('propertyMenuItem'));\n\t\t$template->assignClean('mode', 'add');\n\t\t$template->assignClean('admin', adminCore::getAdminUser());\n\t\t$template->setSystemDataGateway();\n\t\t$template->getSystemMessages();\n\t\t$template->display('admin/adminGroupEdit.htm');\n\t}", "public function creategroupAction() {\n if ($this->getRequest()->isPost()) {\n $groupName = $_POST['groupName'];\n $groupType = $_POST['groupType'];\n $user = $_SESSION['Incite']['USER_DATA'];\n\n $group = new InciteGroup;\n $group->name = $groupName;\n $group->creator_id = $user->id;\n $group->group_type = $groupType;\n $group->instructions = \"\";\n $group->save();\n\n $groups_users = new InciteGroupsUsers;\n $groups_users->user_id = $user->id;\n $groups_users->group_id = $group->id;\n $groups_users->group_privilege = 0;\n $groups_users->seen_instruction = 1;\n $groups_users->save();\n\n $groupId = $group->id;\n\n if ($groupId > 0) {\n echo $groupId;\n } else {\n system_log('failed to create group');\n echo 'false';\n }\n }\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function store()\n {\n return \\Auth::user()->hasRight('create-group');\n }", "function requireGroups() {\r\n\t\t$this->forceLogin();\r\n\r\n\t\t$userId = $this->user[$this->_options['userIdField']];\r\n\t\tif (!isset($this->user['::groups::'])) {\r\n\t\t\t$this->user['::groups::'] = $this->_getGroups($userId);\r\n\t\t}\r\n\r\n\t\t// check each group.\r\n\t\t$groups = func_get_args();\r\n\t\tforeach ($groups as $group) {\r\n\t\t\tif (!isset($this->user['::groups::'][$group]) ||\r\n\t\t\t\t!$this->user['::groups::'][$group]) {\r\n\t\t\t\t$this->_callback(AUTH_ACCESS_DENIED,\r\n\t\t\t\t\t'You are not allowed to access this zone.');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testNonAdminUsersCanNotStoreGroups(): void\n {\n $user = User::factory()->create();\n\n $this->storeGroup([], $user)\n ->assertStatus(403);\n\n $this->assertCount(0, Group::all());\n }", "public function add_group() {\r\n $data = array();\r\n $u = new Users();\r\n $u->setLoggedUser();\r\n $company = new Companies($u->getCompany());\r\n\r\n $data['company_name'] = $company->getName();\r\n $data['user_email'] = $u->getEmail();\r\n if ($u->hasPermission('permissions_view')) {\r\n $permissions = new Permissions();\r\n\r\n if (isset($_POST['name']) && !empty($_POST['name'])) {\r\n $pname = addslashes($_POST['name']);\r\n $plist = $_POST['permissions'];\r\n $permissions->add_group($pname, $plist, $u->getCompany());\r\n header(\"Location: \".BASE_URL.\"/permissions\");\r\n\r\n }\r\n\r\n $data['permissions_list'] = $permissions->getList($u->getCompany());\r\n\r\n $this->loadTemplate('permissions_add_group', $data); \r\n } else {\r\n header(\"Location: \".BASE_URL);\r\n } \r\n }", "public function actionCreategroup()\n {\n $user = $this->getUser();\n $group = new Groups();\n $group->l_user = $user->username;\n $group->create_date = date(\"Y-m-d\");\n $group->status = 'o';\n\tif ($group->load(Yii::$app->request->post()) && $group->validate()) \n {\n if(!$group->groupExist())\n {\n if($group->save())\n {\n return $this->goHome();\n } else {\n return $this->render('say', ['message'=>'GroupErr']);\n }\n } else {\n return $this->render('error', ['name' => 'error', 'message'=>\"You Created this group $group->groupname...\"]);\n }\n }\n\treturn $this->render('creategroup', ['model'=>$group]);\n }", "public function canCreateGroup() {\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Required. The ID to use for the workspace, which will become the final component of the workspace's resource name. Generated from protobuf field string workspace_id = 3 [(.google.api.field_behavior) = REQUIRED];
public function setWorkspaceId($var) { GPBUtil::checkString($var, True); $this->workspace_id = $var; return $this; }
[ "public function getWorkspaceId() {\n return $this->_workspace_id;\n }", "public function getWorkspaceId() {}", "public function getWorkspaceName()\n {\n return $this->_variables['application']['workspace'];\n }", "public function getId(): int\n {\n return $this->workspaceId;\n }", "public function getWorkspaceName() {\n\t\treturn $this->workspaceName;\n\t}", "public function setWorkspaceId($val) {\n $this->_workspace_id = $val;\n }", "public function getWorkspace()\n {\n return $this->hasOne(Workspace::class, ['id' => 'workspace_id']);\n }", "public function getWorkspace()\n {\n return $this->workspace;\n }", "public function getWorkspace() {\n\t\treturn $this->workspace;\n\t}", "public function getCloudWorkspace()\n {\n return $this->readOneof(2);\n }", "public function getWorkspaceObjectName()\n {\n return $this->workspaceObjectName;\n }", "public function setWorkspaceId($workspaceId)\n {\n $this->workspaceId = (int)$workspaceId;\n }", "public function getWorkspace() {\r\n\t\treturn ($this->crWorkspace);\r\n\t}", "public function getWorkspacePath()\n {\n return $this->getProjectPath().'/workspace';\n }", "public function getWorkSpaceId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->workSpaceId;\r\n\r\n \t}", "public static function workspaceName(string $project, string $location, string $repository, string $workspace): string\n {\n return self::getPathTemplate('workspace')->render([\n 'project' => $project,\n 'location' => $location,\n 'repository' => $repository,\n 'workspace' => $workspace,\n ]);\n }", "public function testGetWorkspaceId() {\n $this->assertSame('default', $this->workspaceNegotiator->getWorkspaceId($this->request));\n }", "public function get($id)\n {\n $response = $this->client->sendRequest($this->getBase() . '/' . $id);\n if (!is_array($response)) {\n throw new UnexpectedValueException('Array expected, but got ' . gettype($response));\n }\n\n try {\n return new Workspace($response);\n } catch (\\InvalidArgumentException $e) {\n throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);\n }\n }", "public function getWorkspacesPath()\n {\n return $this->getDataPath() . '/workspaces';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The CSS classes to be applied to the rendered text input.
protected function get_input_classes() { return array( 'widefat', 'siteorigin-widget-input', 'siteorigin-widget-autocomplete-input' ); }
[ "protected function inputClass() {\n $class = cssClass(\"form-\".$this->inputType());\n if ($this->isTextfield())\n $class.= \" form-textfield\";\n return $class;\n }", "protected function _getCSSClassNames()\n\t{\n\t\t$classes = array('swat-form');\n\t\t$classes = array_merge($classes, parent::_getCSSClassNames());\n\t\treturn $classes;\n\t}", "protected function getStyleClass()\n {\n $class = 'z-form-text';\n if ($this->mandatorysym) {\n $class .= ' z-form-mandatory';\n }\n if ($this->readOnly) {\n $class .= ' z-form-readonly';\n }\n if ($this->cssClass != null) {\n $class .= ' ' . $this->cssClass;\n }\n return $class;\n }", "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }", "function sn_gforms_input_class( $classes, $field, $form ){\n\t$input_slug = sanitize_title( $field['label'] );\n\t$classes .= \" gfield-{$input_slug}\";\n\n\treturn $classes;\n}", "protected function getFormFieldClasses() { \n\n return array(\n // 'AmazonAutoLinks_FormFields_AutoInsert_GoBack',\n 'AmazonAutoLinks_FormFields_AutoInsert_Status',\n 'AmazonAutoLinks_FormFields_AutoInsert_PostID',\n 'AmazonAutoLinks_FormFields_AutoInsert_Area',\n 'AmazonAutoLinks_FormFields_AutoInsert_Static',\n 'AmazonAutoLinks_FormFields_AutoInsert_WhereToEnable',\n 'AmazonAutoLinks_FormFields_AutoInsert_WhereToDisable',\n 'AmazonAutoLinks_FormFields_AutoInsert_Save',\n ); \n \n }", "protected function getFormFieldClasses() { \n\n return array(\n // 'AmazonAutoLinks_FormFields_AutoInsert_GoBack',\n 'AmazonAutoLinks_FormFields_AutoInsert_Status',\n // 'AmazonAutoLinks_FormFields_AutoInsert_PostID',\n 'AmazonAutoLinks_FormFields_AutoInsert_Area',\n 'AmazonAutoLinks_FormFields_AutoInsert_Static',\n 'AmazonAutoLinks_FormFields_AutoInsert_WhereToEnable',\n 'AmazonAutoLinks_FormFields_AutoInsert_WhereToDisable',\n 'AmazonAutoLinks_FormFields_AutoInsert_Save',\n ); \n \n }", "public function type_css_classes()\n {\n $classes = array();\n\n foreach ($this->_data['ticket_type_ids'] as $type_id) {\n $classes[] = \"field-for-type-{$type_id}\";\n }\n\n return implode(\" \", $classes);\n }", "function getFormClasses(){\n return \"\";\n }", "protected function _getInputValidateClass()\n {\n $class = false;\n $validateRules = $this->getAttribute()->getValidateRules();\n if (!empty($validateRules['input_validation'])) {\n switch ($validateRules['input_validation']) {\n case 'alphanumeric':\n $class = 'validate-alphanum';\n break;\n case 'numeric':\n $class = 'validate-digits';\n break;\n case 'alpha':\n $class = 'validate-alpha';\n break;\n case 'email':\n $class = 'validate-email';\n break;\n case 'url':\n $class = 'validate-url';\n break;\n default:\n $class = false;\n break;\n }\n }\n return $class;\n }", "protected function _getCSSClassNames()\n\t{\n\t\t$classes = array('swat-radio-list');\n\t\t$classes = array_merge($classes, parent::_getCSSClassNames());\n\t\treturn $classes;\n\t}", "private function getClasses()\n {\n $classes = 'myradiofrm';\n foreach ($this->classes as $class) {\n $classes .= \" $class\";\n }\n\n return $classes;\n }", "public function canvas_classes() {\r\n\r\n\t\t$classes = 'type_' . $this->canvas_type;\r\n\r\n\t\t// Language modificator\r\n\t\tif ( defined( 'ICL_LANGUAGE_CODE' ) AND ICL_LANGUAGE_CODE ) {\r\n\t\t\t$classes .= ' wpml_lang_' . ICL_LANGUAGE_CODE;\r\n\t\t}\r\n\r\n\t\treturn $classes;\r\n\t}", "public function getClass($input, $class = 'input-error') {\n\t\treturn (!empty($this->_errors) && isset($this->_errors[$input])) ? $class : '';\n\t}", "protected function get_css_class_names()\n\t{\n\t\treturn array\n\t\t(\n\t\t\t'type' => 'comment',\n\t\t\t'id' => 'comment-' . $this->commentid,\n\t\t\t'author-reply' => $this->is_author\n\t\t);\n\t}", "function getFormClasses(){\n return \" user \";\n }", "function vikinger_woocommerce_quantity_input_classes($classes, $product) {\r\n $classes[] = 'vk-form-counter-input';\r\n\r\n return $classes;\r\n }", "public function row_css_class_callback() {\r\n $value = ($value = get_option(self::$field_prefix.'row_css_class')) ? $value : '';\r\n echo !empty($value) ? $value : '<i>'.__('Empty value', \"js_composer\").'</i>';\r\n // echo '<input type=\"text\" name=\"'.self::$field_prefix.'row_css_class'.'\" value=\"'.$value.'\">';\r\n // echo '<p class=\"description indicator-hint\">'.__('To change class name for the row element, enter it here. By default vc_row is used.', 'js_composer').'</p>';\r\n\r\n }", "function get_class(){\n\t\treturn apply_filters('wdh_control_class', $this->class, $this->id);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns an array of the xml data
function xml_to_array() { $output=array(); foreach($this->xpath_map as $key=>$value) { $output[$key]=$value['data']; } return $output; }
[ "private function readXmlContent():array\n {\n\n $data = [];\n $url = \"https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml\";\n $xmlRaw = file_get_contents($url);\n\n $doc = new DOMDocument();\n $doc->preserveWhiteSpace = FALSE;\n\n $doc->loadXML($xmlRaw);\n\n $firstNode = $doc->getElementsByTagName('Cube')->item(0);\n foreach ($firstNode->childNodes as $secondNode) {\n $value = [];\n foreach ($secondNode->childNodes as $thirdNode) {\n $value['date'] = $secondNode->getAttribute('time');\n $value['currency'] = $thirdNode->getAttribute('currency');\n $value['rate'] = $thirdNode->getAttribute('rate');\n $data[] = $value;\n unset($value);\n }\n }\n\n return $data;\n\n }", "function get_xml_data_as_array()\n {\n\n if ($this->data_array && $this->dirty_data_string === FALSE && $this->dirty_data_array===FALSE)\n {\n return;\n }\n else\n {\n $this->get_xml_data_as_string();\n $this->data_array = explode(\"\\n\", $this->data_string);\n $this->dirty_data_array = FALSE;\n $this->dirty_parsed_array = TRUE;\n return;\n }\n\n }", "public function getArray() {\r\n if(!empty($this->xml))\r\n return t3lib_div::xml2array($this->xml);\r\n else\r\n throw new Exception (\"class.xmlObject contains no valid XML\");\r\n }", "function getWholeArray(){\n$xml = new XMLReader();\n$xml->open('./XML/REASONS.XML');\n$finalArray = getReasons($xml);\n$xml->close();\nreturn $finalArray;\n}", "function getXMLRawData(){\n\t\treturn $this->text;\n\t}", "public function getXml();", "public static function xmlToArray($xml);", "function xml2array($fname){\n $sxi = simplexml_load_string($fname, 'SimpleXMLIterator');\n return sxiToArray($sxi);\n }", "private function _xmlToArray($data) \n {\n $DataArray = array();\n $DataArray['events'] = array();\n\n $XMLObject = new SimpleXMLElement($data);\n\n if ($XMLObject->body->parcel->internalstatus == '0') {\n // The parcel tracking id could not be found.'\n // Thus we only set a statuscode and return \n // the Array to SimpleQuery() again.\n $DataArray['statuscode'] = 0;\n return $DataArray;\n } else {\n foreach ($XMLObject->body->parcel->children() as $child) {\n if ($child->getName() == 'event') { \n array_push(\n $DataArray['events'], array(\n 'date' => (int) $child->date,\n 'time' => (string) $child->time,\n 'id' => (string) $child->id,\n 'type' => (string) $child->type,\n 'location' => (string) $child->location,\n 'code' => (int) $child->code,\n 'description' => (string) $child->description,\n )\n );\n } elseif ($child->getName() == 'extraservice') {\n continue;\n } else {\n $DataArray[(string) $child->getName()] = dom_import_simplexml(\n $child\n )->textContent;\n }\n }\n }\n\n\n return $DataArray;\n }", "function createArrayfromXML( $xmlDoc )\n {\n $result = array();\n $xml = new eZXML();\n $dom = $xml->domTree( $xmlDoc );\n if ( is_object( $dom ) )\n {\n $node = $dom->get_root();\n $children = $node->children();\n foreach ( $children as $child )\n {\n $contentnode = $child->firstChild();\n if ( $contentnode->type === EZ_XML_NODE_TEXT )\n {\n $result[$child->name()] = $contentnode->textContent();\n }\n else\n {\n $result[$child->name()] = xrowDefaultSubscriptionHandler::createArrayfromDOMNODE( $child );\n }\n }\n }\n return $result;\n }", "private function xml2array($xml) \n\t{ \n\t\t$json = json_encode( simplexml_load_string($xml));\n\t\treturn json_decode($json, TRUE);\n\t}", "protected function getData() {\n\n $path = $this->getPath();\n\n // Check if file exists.\n if(!file_exists($path)) {\n throw new ImporterException(t('XML file @path does not exist.', array('@path' => $path)));\n }\n\n // Let the XML parser use internal errors so we can collect them later if anything goes wrong.\n libxml_use_internal_errors(true);\n $xml = simplexml_load_file($path);\n if($xml === FALSE) {\n $error_message = \"Failed loading XML:\";\n foreach(libxml_get_errors() as $error) {\n $error_message.= PHP_EOL . $error->message;\n }\n throw new ImporterException($error_message);\n }\n\n // XML -> JSON -> ARRAY\n $json = json_encode($xml);\n $array = json_decode($json, TRUE);\n return $array;\n }", "function toArray( $xml )\r\n {\r\n\t\t$this->rownum=0;\r\n $newXML = new SimpleXMLElement( $xml );\r\n return $this->getArrayElements( $newXML );\r\n }", "private function __xmlToArray($xml=null, $ifXML=true) {\r\n\t\tif (strpos($xml, \"<?xml\") === false && $ifXML) {\r\n\t\t\t$this->_errors[] = $xml;\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\tif (!class_exists('Xml')) {\r\n\t\t\tApp::import('Core', 'Xml');\r\n\t\t}\r\n\t\t$xml = new Xml($xml);\r\n\t\treturn $xml->toArray();\r\n\t}", "private function xmlToarray($xml){\n $xmlIterator = new \\SimpleXmlIterator($xml, null);\n return $this->xmlIteratorToArray($xmlIterator);\n }", "protected function bodyXmlAsArray()\n {\n try {\n $xml = simplexml_load_string($this->response->body());\n $json = json_encode($xml);\n return json_decode($json, true);\n }catch(\\Exception $e){\n return null;\n }\n }", "public function readXml();", "public function fetchNodesAsObjects(){\r\n $nodes=array();\r\n foreach($this->xml as $node){\r\n $nodes[]=$node;\r\n }\r\n return $nodes;\r\n }", "function get_xml_data() {\n\t\t$this->generate_purchase_xml();\n\t\t$this->encrypt_data($this->myXmlData);\n\t\treturn $this->myXmlData;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation editDocumentDocxBody Get body from a Word DOCX document
public function editDocumentDocxBody($req_config) { list($response) = $this->editDocumentDocxBodyWithHttpInfo($req_config); return $response; }
[ "public function testEditDocumentDocxBody()\n {\n }", "protected function editDocumentDocxBodyRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxBody'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-body';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editDocumentDocxBodyWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\GetDocxBodyResponse';\n $request = $this->editDocumentDocxBodyRequest($req_config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\GetDocxBodyResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function editDocumentDocxBodyAsync($req_config)\n {\n return $this->editDocumentDocxBodyAsyncWithHttpInfo($req_config)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function docx2text()\n {\n return $this->readZippedXML($this->file, \"word/document.xml\");\n }", "function\nread_docx($f){\nreturn strip_tags(str_replace(['</w:r></w:p>','</w:r></w:p></w:tc><w:tc>'],[\" \",\"\\r\\n\"],$this->readZippedXML\n($filename,\"word/document.xml\")));}", "function GetDocumentText($form_name) {\n if (!file_exists($_FILES[$form_name]['tmp_name']) || !is_uploaded_file($_FILES[$form_name]['tmp_name'])) return null;\n if ($_FILES[$form_name]['error']) return null;\n if ($_FILES[$form_name]['size'] > MAX_FILE_SIZE) return null;\n $file_parts = explode(\".\", $_FILES[$form_name]['name']);\n $extension = end($file_parts);\n if (!in_array($extension, array(\n \"docx\"\n ))) return null;\n if (!in_array($_FILES[$form_name]['type'], array(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ))) return null;\n \n // Read docx file and get contents.\n $doc_reader = new DocReader();\n $doc_reader->ReadDocument($_FILES[$form_name]['tmp_name']);\n $html = $doc_reader->ParseDocumentToHTML();\n return $html;\n}", "protected function editDocumentDocxReplaceRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxReplace'\n );\n }\n\n $resourcePath = '/convert/edit/docx/replace-all';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/octet-stream']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/octet-stream'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateWopiDocuemntContent($document, $access_token, $body = null)\n {\n $this->updateWopiDocuemntContentWithHttpInfo($document, $access_token, $body);\n }", "public function editDocumentDocxBodyAsyncWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\GetDocxBodyResponse';\n $request = $this->editDocumentDocxBodyRequest($req_config);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "private function getDocumentXML()\n {\n $this->documentXML = $this->zipArchive->getFromName(\"word/document.xml\");\n return $this->documentXML;\n }", "function readDocx($filePath) {\r\n // Create new ZIP archive\r\n $zip = new ZipArchive;\r\n $dataFile = 'word/document.xml';\r\n // Open received archive file\r\n if (true === $zip->open($filePath)) {\r\n // If done, search for the data file in the archive\r\n if (($index = $zip->locateName($dataFile)) !== false) {\r\n // If found, read it to the string\r\n $data = $zip->getFromIndex($index);\r\n // Close archive file\r\n $zip->close();\r\n // Load XML from a string\r\n // Skip errors and warnings\r\n $xml = DOMDocument::loadXML($data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);\r\n // Return data without XML formatting tags\r\n\t\t\t//echo $xml->saveXML();exit;\r\n $contents = explode('\\n',strip_tags($xml->saveXML()));\r\n $text = '';\r\n foreach($contents as $i=>$content) {\r\n $text .= $contents[$i];\r\n }\r\n //echo \"<pre>\"; print_r ($xml->saveXML());\r\n return $xml->saveXML();\r\n }\r\n $zip->close();\r\n }\r\n // In case of failure return empty string\r\n return \"\";\r\n}", "protected function editDocumentDocxReplaceParagraphRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxReplaceParagraph'\n );\n }\n\n $resourcePath = '/convert/edit/docx/replace/paragraph';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function read_file_docx($filename)\n\t\t\t \t\t{\n\t\t\t \t\t\t$striped_content = '';\n\t\t\t \t\t\t$content = '';\n\t\t\t \t\t\tif(!$filename || !file_exists($filename)) return false;\n\t\t\t \t\t\t$zip = zip_open($filename);\n\t\t\t \t\t\tif (!$zip || is_numeric($zip)) return false;\n\t\t\t \t\t\twhile ($zip_entry = zip_read($zip)) {\n\t\t\t \t\t\t\tif (zip_entry_open($zip, $zip_entry) == FALSE) continue;\n\t\t\t \t\t\t\tif (zip_entry_name($zip_entry) != \"word/document.xml\") continue;\n\t\t\t \t\t\t\t$content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));\n\t\t\t \t\t\t\tzip_entry_close($zip_entry);\n\t\t\t \t\t\t}\n\t\t\t \t\t\tzip_close($zip);\n\t\t\t \t\t\t$content = str_replace('</w:r></w:p></w:tc><w:tc>', \" \", $content);\n\t\t\t \t\t\t$content = str_replace('</w:r></w:p>', \"\\r\\n\", $content);\n\t\t\t \t\t\t$striped_content = strip_tags($content);\n\t\t\t \t\t\n\t\t\t \t\t\treturn $striped_content;\n\t\t\t \t\t}", "function hw_document_setcontent($doc, $content) {}", "function readDocx($filePath) {\r\n // Create new ZIP archive\r\n $zip = new ZipArchive;\r\n $dataFile = 'word/document.xml';\r\n // Open received archive file\r\n if (true === $zip->open($filePath)) {\r\n // If done, search for the data file in the archive\r\n if (($index = $zip->locateName($dataFile)) !== false) {\r\n // If found, read it to the string\r\n $data = $zip->getFromIndex($index);\r\n // Close archive file\r\n $zip->close();\r\n // Load XML from a string\r\n // Skip errors and warnings\r\n $xml = DOMDocument::loadXML($data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);\r\n // Return data without XML formatting tags\r\n\t\t\t//echo $xml->saveXML();exit;\r\n $contents = explode('\\n',strip_tags($xml->saveXML()));\r\n $text = '';\r\n foreach($contents as $i=>$content) {\r\n $text .= $contents[$i];\r\n }\r\n return $xml->saveXML();\r\n }\r\n $zip->close();\r\n }\r\n // In case of failure return empty string\r\n return \"\";\r\n}", "function read_file_docx($filename){\t\n\t\t$striped_content = '';\n\t\t$content = '';\n\t\tif(!$filename || !file_exists($filename)){ return false;}\n\t\t$zip = zip_open($filename);\n\t\tif (!$zip || is_numeric($zip)) return false;\n\t\twhile ($zip_entry = zip_read($zip)) {\n\t\t\tif (zip_entry_open($zip, $zip_entry) == FALSE) continue;\n\t\t\tif (zip_entry_name($zip_entry) != \"word/document.xml\") continue;\n\t\t\t$content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));\n\t\t\tzip_entry_close($zip_entry);\n\t\t}// end while\n\t\t\n\t\tzip_close($zip);\n\t\t$content = str_replace('</w:r></w:p></w:tc><w:tc>', \" \", $content);\n\t\t$content = str_replace('</w:r></w:p>', \"\\r\\n\", $content);\n\t\t$content = str_replace('</w:p>', \"\\r\\n\\n\", $content);\t\t\n\t\t$content = str_replace(array('.com', '.in'), array(\".com \\r\\n\", \".in \\r\\n\"), $content);\n\t\t$content = str_replace(array(':'), \": \", $content);\n\t\t$striped_content = strip_tags($content);\n\t\treturn $striped_content;\n\t}", "function body() {\n return $this->document->getContent();\n }", "private function generateTemplateWordDocument()\n {\n if (count(CreateDocx::$insertNameSpaces) > 0) {\n $strxmlns = '';\n foreach (CreateDocx::$insertNameSpaces as $key => $value) {\n $strxmlns .= $key . '=\"' . $value . '\" ';\n }\n $this->_documentXMLElement = str_replace('<w:document', '<w:document ' . $strxmlns, $this->_documentXMLElement);\n }\n $this->_wordDocumentC .= $this->_sectPr->saveXML($this->_sectPr->documentElement); //FIXME: I am insertying by hand the sections of the base template\n if (!empty($this->_wordHeaderC)) {\n $this->_wordDocumentC = str_replace(\n '__GENERATEHEADERREFERENCE__', '<' . CreateDocx::NAMESPACEWORD . ':headerReference ' .\n CreateDocx::NAMESPACEWORD . ':type=\"default\" r:id=\"rId' .\n $this->_idWords['header'] . '\"></' .\n CreateDocx::NAMESPACEWORD . ':headerReference>', $this->_wordDocumentC\n );\n }\n if (!empty($this->_wordFooterC)) {\n $this->_wordDocumentC = str_replace(\n '__GENERATEFOOTERREFERENCE__', '<' . CreateDocx::NAMESPACEWORD . ':footerReference ' .\n CreateDocx::NAMESPACEWORD . ':type=\"default\" r:id=\"rId' .\n $this->_idWords['footer'] . '\"></' .\n CreateDocx::NAMESPACEWORD . ':footerReference>', $this->_wordDocumentC\n );\n }\n $this->_wordDocumentT = $this->_documentXMLElement .\n $this->_background .\n '<' . CreateDocx::NAMESPACEWORD . ':body>' .\n $this->_wordDocumentC .\n '</' . CreateDocx::NAMESPACEWORD . ':body>' .\n '</' . CreateDocx::NAMESPACEWORD . ':document>';\n $this->cleanTemplate();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UPLOAD new styleboard from create screen
public function post_styleboardUpload() { $imgName= md5(rand().time()); $base64 = Input::post('base64'); $base64 = str_replace('data:image/png;base64,', '', $base64); $base64 = str_replace(' ', '+', $base64); $imgData = base64_decode($base64); $success = file_put_contents(DOCROOT.'uploads/styleboards/l/'.$imgName.'.png', $imgData); if( !$success ){ $this->response(array( 'success' => false, 'message' => 'bad upload' )); }else{ Image::load(DOCROOT.'uploads/styleboards/l/'.$imgName.'.png')->resize('400', '400')->save(DOCROOT.'uploads/styleboards/s/'.$imgName.'.png'); $dbSave = Model_Uploadstyleboards::add(Input::post('title'), Input::post('user_id'), $imgName.'.png'); if( ! $dbSave ) { $this->response(array( 'success' => false, 'message' => 'bad upload' )); }else{ $this->response(array( 'success' => true, 'message' => 'good upload' )); } } }
[ "function save($style, $destinationPathname, $compilationId = '_');", "public function actionCreate()\n {\n $user = Yii::$app->user->identity;\n\n $model = new ScreenForm($user, null, [\n 'scenario' => ScreenForm::SCENARIO_CREATE,\n ]);\n\n $model->load(Yii::$app->request->post());\n\n $model->file = UploadedFile::getInstanceByName('file');\n\n if ($screen = $model->save()) {\n return $screen;\n }\n\n return $this->sendErrorResponse($model->getFirstErrors());\n }", "public function bsp_run_file_action() {\n\n /* prepare data */\n $name = str_replace(\" \", \"-\", $_POST[\"data\"][\"name\"]);\n $directory = trim(reset(explode(\"/\", $_POST[\"data\"][\"dir\"])));\n\n /* Create a new style directory */\n if($_POST[\"data\"][\"type\"] == \"create-style\"){\n $source = WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"this-dir\"].\"templates/library/empty\";\n $dest = WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $name.\"/\";\n WPEXPANSE_Blog_Styles_Pro::$helpers->copy_recursive($source, $dest);\n echo '{ \"dir\": \"'. $name.'\", \"message\" :\"BSP theme ' . $name . ' created!\"}';\n } \n /* Create a new file in a style directory */\n else if($_POST[\"data\"][\"type\"] == \"create-file\"){\n file_put_contents(WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $directory.\"/\". $name.\".less\" ,\"\");\n echo '{ \"dir\": \"'. $directory.'\", \"message\" :\"'. $name . ' created in ' . $directory.'!\"}';\n } \n /* Delete entire style directory */\n else if($_POST[\"data\"][\"type\"] == \"delete-style\"){\n $dest = WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $name.\"/\";\n WPEXPANSE_Blog_Styles_Pro::$helpers->unlink_recursive($dest, TRUE);\n echo '{ \"dir\": \"'. $directory.'\", \"message\" :\"BSP theme '. $name . ' deleted!\"}';\n } \n /* Delete Single File */\n else if($_POST[\"data\"][\"type\"] == \"delete-file\"){ \n unlink(WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $directory.\"/\". $name.\".less\");\n echo '{ \"dir\": \"'. $directory.'\", \"message\" :\"BSP file '. $name . ' in ' . $directory . ' deleted!\"}';\n }\n /* Duplicate an existing style directory */\n else if($_POST[\"data\"][\"type\"] == \"duplicate-style\"){ \n $source = WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $name.\"/\";\n $new_unique_name = WPEXPANSE_Blog_Styles_Pro::$helpers->unique_name_in_dir(WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] , $name, \"-duplicated-\");\n $dest = WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $new_unique_name.\"/\";\n WPEXPANSE_Blog_Styles_Pro::$helpers->copy_recursive($source, $dest);\n echo '{ \"dir\": \"'. $name.'\", \"message\" :\"BSP theme ' . $name . ' is duplicated!\"}';\n } \n /* Rename current style */\n else if($_POST[\"data\"][\"type\"] == \"rename-style\"){ \n rename(WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $directory, WPEXPANSE_Blog_Styles_Pro::$plugin_data[\"shared-bsp-dir\"] . $name);\n echo '{ \"dir\": \"'. $name.'\", \"message\" :\"BSP theme ' . $directory . ' is now ' . $name . '!\"}';\n }\n else {\n echo '{ \"dir\": \"'. $directory.'\", \"message\" :\"fail\"}';\n }\n\n wp_die();\n\n }", "public function action_savestyles()\n\t{\n\t\tcheckSession();\n\n\t\trequire_once(SUBSDIR . '/Prefix/StylePicker.class.php');\n\t\trequire_once(SUBSDIR . '/DataValidator.class.php');\n\n\t\t$data = (array) $this->_req->post;\n\t\t$picker = new StylePicker('Prefix');\n\t\t$validator = new Data_Validator();\n\n\t\t// Set all our prefix styles\n\t\t$result = $picker->validate($data, $validator);\n\t\t$data['prefix_style'] = '';\n\t\tforeach ($result as $key => $val)\n\t\t{\n\t\t\tif (!empty($val))\n\t\t\t{\n\t\t\t\t$data['prefix_style'] .= $key . ': ' . $val . \" !important;\\n\\t\";\n\t\t\t}\n\t\t}\n\n\t\t// We are saving css styles, the rest stays the same\n\t\t$topicPrefix = topicprefixLoadId($data['pid']);\n\t\t$data['brd'] = $topicPrefix['boards'];\n\t\t$id = $this->_savePrefix($data);\n\n\t\t$this->sendJson($id);\n\t}", "function board_add() {\n\tglobal $core, $document, $db;\n\n\t//Get categories\n\t$query = $db->make_query(\"categories\");\n\t$query->set_order(\"category_order ASC\");\n\t$categories_object = $query->execute();\n\t$category_html = \"\";\n\twhile ($category = $categories_object->fetch_assoc()) {\n\t\t$selected = \"\";\n\t\t$category_html .= '<option value=\"' . $category['category_id'] . '\" ' . $selected . '>' . $category['category_name'] . '</option>';\n\t}\n\n\t//Main options\n\t$token=make_token();\n\t$_SESSION['token']=$token;\n\t$form = $document->make_form(\"addboard\",\"addboard\",\"/admin.php/boards/add2\",$token);\n\t$form->start_fieldset(\"options\",\"Add new board\");\n\t$form->add_element(\"board_name\",\"Title\",\"text\",\"\",\"Title of the board\");\n\t$form->add_element(\"category_id\",\"Category\",\"list\",$category_html,\"Category of the board\");\n\t$form->add_element(\"board_description\",\"Content\",\"textarea\",\"\",\"Content of the board\");\n\t$form->end_fieldset();\n\n\t//Other options\n\t$form->start_fieldset(\"moreoptions\",\"Other options\");\n\t$form->add_element(\"board_order\",\"Order\",\"number\",\"\",\"Board display order\");\n\t$form->end_fieldset();\n\n\t//End\n\t$form->append('<div class=\"center\">');\n\t$form->add_element_only(\"submit\",\"Submit\",\"submit\",\"Create\");\n\t$form->append('</div>');\n\t$formhtml = $form->output();\n\t$document->append_template(\"title\",array('title'=>\"Admin: Create Board\"));\n\t$document->append_template(\"window\",array('title'=>\"Create Board\",'content'=>$formhtml));\n}", "private static function save_form_style() {\n\t\t$permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'frm_save_form_style', 'frm_save_form_style_nonce' );\n\t\tif ( $permission_error !== false ) {\n\t\t\twp_die( 'Unable to save form', '', 403 );\n\t\t}\n\n\t\t$style_id = FrmAppHelper::get_post_param( 'style_id', 0, 'absint' );\n\t\tif ( $style_id && ! self::confirm_style_exists_before_setting( $style_id ) ) {\n\t\t\twp_die( esc_html__( 'Invalid target style', 'formidable' ), esc_html__( 'Invalid target style', 'formidable' ), 400 );\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Hook into the saved style ID so Pro can import a style template by its key and return a new style ID.\n\t\t *\n\t\t * @since 6.0\n\t\t *\n\t\t * @param int $style_id\n\t\t */\n\t\t$style_id = apply_filters( 'frm_saved_form_style_id', $style_id );\n\n\t\tif ( ! $style_id && '0' !== FrmAppHelper::get_post_param( 'style_id', 'sanitize_text_field', '' ) ) {\n\t\t\t// \"0\" is a special value used for the enable/disable toggle.\n\t\t\twp_die( esc_html__( 'Invalid style value', 'formidable' ), esc_html__( 'Invalid style value', 'formidable' ), 400 );\n\t\t\treturn;\n\t\t}\n\n\t\t$form_id = FrmAppHelper::get_post_param( 'form_id', 'absint', 0 );\n\t\tif ( ! $form_id ) {\n\t\t\twp_die( esc_html__( 'No form specified', 'formidable' ), esc_html__( 'No form specified', 'formidable' ), 400 );\n\t\t\treturn;\n\t\t}\n\n\t\t$form = FrmForm::getOne( $form_id );\n\t\tif ( ! $form ) {\n\t\t\twp_die( esc_html__( 'Form does not exist', 'formidable' ), esc_html__( 'Form does not exist', 'formidable' ), 400 );\n\t\t\treturn;\n\t\t}\n\n\t\t// If the default style is selected, use the \"Always use default\" legacy option instead of the default style.\n\t\t// There's also a check here for conversational forms.\n\t\t// Without the check it isn't possible to select \"Default\" because \"Always use default\" will convert to \"Lines\" dynamically.\n\t\t$default_style = self::get_default_style();\n\t\tif ( $style_id === $default_style->ID && empty( $form->options['chat'] ) ) {\n\t\t\t$style_id = 1;\n\t\t}\n\n\t\t$form->options['custom_style'] = (string) $style_id; // We want to save a string for consistency. FrmStylesHelper::get_form_count_for_style expects the custom style ID is a string.\n\n\t\tglobal $wpdb;\n\t\t$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );\n\n\t\tFrmForm::clear_form_cache();\n\n\t\tself::$message = __( 'Successfully updated style.', 'formidable' );\n\t}", "public function createNewDesignAction() {\n $design = Mage::getModel('shirtdesigner/design');\n $param = $this->getRequest()->getParams();\n \n define('UPLOAD_DIR', 'media/shirtdesigner/images/custom-designs/');\n $img = $param['front-image-code'];\n $img = str_replace('data:image/png;base64,', '', $img);\n $img = str_replace(' ', '+', $img);\n $data = base64_decode($img);\n $file = UPLOAD_DIR . 'f-'.$param['design-id'].'.png';\n $success = file_put_contents($file, $data);\n \n \n $img2 = $param['back-image-code'];\n $img2 = str_replace('data:image/png;base64,', '', $img2);\n $img2 = str_replace(' ', '+', $img2);\n $data2 = base64_decode($img2);\n $file2 = UPLOAD_DIR . 'b-'.$param['design-id'].'.png';\n $success2 = file_put_contents($file2, $data2);\n \n $img3 = $param['left-image-code'];\n $img3 = str_replace('data:image/png;base64,', '', $img3);\n $img3 = str_replace(' ', '+', $img3);\n $data3 = base64_decode($img3);\n $file3 = UPLOAD_DIR . 'l-'.$param['design-id'].'.png';\n $success3 = file_put_contents($file3, $data3);\n \n \n $img4 = $param['right-image-code'];\n $img4 = str_replace('data:image/png;base64,', '', $img4);\n $img4 = str_replace(' ', '+', $img4);\n $data4 = base64_decode($img4);\n $file4 = UPLOAD_DIR . 'r-'.$param['design-id'].'.png';\n $success4 = file_put_contents($file4, $data4);\n \n \n \n $design->setShirtColor($param['shirt-color']);\n $design->setSku($param['sku']);\n if(strlen($param['front-text-1']) > 0){\n $design->setFrontText_1($param['front-text-1']);\n $design->setFrontText_1Size($param['front-text-1-size']);\n $design->setFrontText_1Color($param['front-text-1-color']);\n $design->setFrontText_1Font($param['front-text-1-font']);\n $design->setFrontText_1Style($param['front-text-1-style']);\n }\n if(strlen($param['front-text-2']) > 0){\n $design->setFrontText_2($param['front-text-2']);\n $design->setFrontText_2Size($param['front-text-2-size']);\n $design->setFrontText_2Color($param['front-text-2-color']);\n $design->setFrontText_2Font($param['front-text-2-font']);\n $design->setFrontText_2Style($param['front-text-2-style']);\n }\n \n if(strlen($param['front-text-3']) > 0){\n $design->setFrontText_3($param['front-text-3']);\n $design->setFrontText_3Size($param['front-text-3-size']);\n $design->setFrontText_3Color($param['front-text-3-color']);\n $design->setFrontText_3Font($param['front-text-3-font']);\n $design->setFrontText_3Style($param['front-text-3-style']);\n }\n if(strlen($param['back-text-1']) > 0){\n $design->setBackText_1($param['back-text-1']);\n $design->setBackText_1Size($param['back-text-1-size']);\n $design->setBackText_1Color($param['back-text-1-color']);\n $design->setBackText_1Font($param['back-text-1-font']);\n $design->setBackText_1Style($param['back-text-1-style']);\n }\n if(strlen($param['back-text-2']) > 0){\n $design->setBackText_2($param['back-text-2']);\n $design->setBackText_2Size($param['back-text-2-size']);\n $design->setBackText_2Color($param['back-text-2-color']);\n $design->setBackText_2Font($param['back-text-2-font']);\n $design->setBackText_2Style($param['back-text-2-style']);\n }\n if(strlen($param['back-text-3']) > 0){ \n $design->setBackText_3($param['back-text-3']);\n $design->setBackText_3Size($param['back-text-3-size']);\n $design->setBackText_3Color($param['back-text-3-color']);\n $design->setBackText_3Font($param['back-text-3-font']);\n $design->setBackText_3Style($param['back-text-3-style']);\n }\n \n if(strlen($param['left-text-1']) > 0){\n $design->setLeftText_1($param['left-text-1']);\n $design->setLeftText_1Size($param['left-text-1-size']);\n $design->setLeftText_1Color($param['left-text-1-color']);\n $design->setLeftText_1Font($param['left-text-1-font']);\n $design->setLeftText_1Style($param['left-text-1-style']);\n }\n if(strlen($param['left-text-2']) > 0){\n $design->setLeftText_2($param['left-text-2']);\n $design->setLeftText_2Size($param['left-text-2-size']);\n $design->setLeftText_2Color($param['left-text-2-color']);\n $design->setLeftText_2Font($param['left-text-2-font']);\n $design->setLeftText_2Style($param['left-text-2-style']);\n }\n if(strlen($param['left-text-3']) > 0){ \n $design->setLeftText_3($param['left-text-3']);\n $design->setLeftText_3Size($param['left-text-3-size']);\n $design->setLeftText_3Color($param['left-text-3-color']);\n $design->setLeftText_3Font($param['left-text-3-font']);\n $design->setLeftText_3Style($param['left-text-3-style']);\n }\n \n if(strlen($param['right-text-1']) > 0){\n $design->setRightText_1($param['right-text-1']);\n $design->setRightText_1Size($param['right-text-1-size']);\n $design->setRightText_1Color($param['right-text-1-color']);\n $design->setRightText_1Font($param['right-text-1-font']);\n $design->setRightText_1Style($param['right-text-1-style']);\n }\n if(strlen($param['right-text-2']) > 0){\n $design->setRightText_2($param['right-text-2']);\n $design->setRightText_2Size($param['right-text-2-size']);\n $design->setRightText_2Color($param['right-text-2-color']);\n $design->setRightText_2Font($param['right-text-2-font']);\n $design->setRightText_2Style($param['right-text-2-style']);\n }\n if(strlen($param['right-text-3']) > 0){ \n $design->setRightText_3($param['right-text-3']);\n $design->setRightText_3Size($param['right-text-3-size']);\n $design->setRightText_3Color($param['right-text-3-color']);\n $design->setRightText_3Font($param['right-text-3-font']);\n $design->setRightText_3Style($param['right-text-3-style']);\n }\n \n \n $design->setFrontImages($param['arts']);\n $design->setBackImages($param['arts2']);\n $design->setLeftImages($param['arts3']);\n $design->setRightImages($param['arts4']);\n \n $design->setFrontDesignUrl(UPLOAD_DIR . 'f-'.$param['design-id'].'.png');\n $design->setBackDesignUrl(UPLOAD_DIR . 'b-'.$param['design-id'].'.png');\n $design->setLeftDesignUrl(UPLOAD_DIR . 'l-'.$param['design-id'].'.png');\n $design->setRightDesignUrl(UPLOAD_DIR . 'r-'.$param['design-id'].'.png');\n \n $design->setS($param['s-size']);\n $design->setM($param['m-size']);\n $design->setL($param['l-size']);\n $design->setXl($param['xl-size']);\n \n $qty = intval($param['s-size']) + intval($param['m-size']) + intval($param['l-size']) + intval($param['xl-size']);\n \n $design->save(); \n \n Mage::getSingleton('core/session')->setDesignId($param['design-id']);\n Mage::getSingleton('core/session')->setNewPrice($param['product-price-final']);\n Mage::log('product-price-final: '. $param['product-price-final'] );\n $myData = Mage::getSingleton('core/session')->getNewPrice();\n Mage::log('mydata: '. $myData );\n \n $url = Mage::getUrl('',array('_secure'=>true));\n $url = $url.'checkout/cart/add?product='.$param['product-id'].'&qty='.$qty; //checkout/cart/add?product=14&qty=1\n //echo '<script type=\"text/javascript\">alert(\"'.$url.'\");</script>';\n Mage::log('redirect: '. $url);\n $this->_redirectUrl($url);\n \n }", "function create_screen_save() {\n\t\tglobal $bp;\n\n\t\tcheck_admin_referer( 'groups_create_save_' . $this->slug );\n\n\t\t$success = $this->settings_save( $bp->groups->new_group_id );\n\t}", "public function actionCreate()\n {\n $model = new ScreenWindow();\n $types = ArrayHelper::map(Types::find()->all(), 'type_id', 'type_name');\n\n if ($model->load(Yii::$app->request->post())) {\n\n //making image empty for new image\n $model->image = \"\";\n\n //saving model value as posted\n if ($model->save()) {\n //getting images instance\n $images = UploadedFile::getInstances($model, 'image');\n\n //check if any image available\n if ($images) {\n\n //loop for multiple images uploading\n foreach ($images as $image) {\n\n $filename = Yii::$app->security->generateRandomString() . '.' . $image->extension;\n $path = '../uploads/' . $filename;\n\n //checking uploaded file types\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\n if (!array_key_exists($image->extension, $allowed)) {\n\n \\Yii::$app->getSession()->setFlash('error', 'Please select a valid file format.');\n return $this->redirect(['index']);\n }\n\n //processing image size limit validation for 5MB\n $maxsize = 5 * 1024 * 1024;\n\n if ($image->size > $maxsize) {\n \\Yii::$app->getSession()->setFlash('error', 'File size is larger than the allowed limit(5MB).');\n return $this->redirect(['index']);\n }\n\n //setting all columns values for new screenshot model\n $Screenshotmodel = new Screenshot();\n $Screenshotmodel->image = $filename;\n $Screenshotmodel->window_id = $model->window_id;\n\n //saving uploaded image on server\n $image->saveAs($path);\n if ($Screenshotmodel->save()) {\n \\Yii::$app->getSession()->setFlash('success', 'Record(s) created successfully.');\n } else {\n \\Yii::$app->getSession()->setFlash('error', 'Any one or more images can not uploaded, Please try again.');\n }\n }\n }\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'types' => $types,\n ]);\n }\n }", "function bj_save_skin() {\n\tif($_POST['skin-edit-uniqid'] and $_POST['skin-edit-file']) {\n\t\t$handle = fopen(BJPATH.'content/skins/'.bj_clean_string($_POST['skin-edit-uniqid']).'/'.bj_clean_string($_POST['skin-edit-file']),'w');\n\t\tif(stripslashes($_POST['content']) == '') {\n\t\t\t$content = '\n'; #fread error protector.\n\t\t}\n\t\telse {\n\t\t\t$content = stripslashes($_POST['content']);\n\t\t}\n\t\tfwrite($handle,$content);\n\t\tfclose($handle);\n\t}\n}", "public function actionCreate()\n {\n $model = new ScreenTemplate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'backgrounds' => self::backgroundsArray(),\n ]);\n }", "public function store()\n\t{\n\t\t//\n\n\t\t$input = Input::get();\n\t\tif(!['name']) dd('You need a name');\n\t\t$style = new Style;\n\t\t$style->name = $input['name'];\n\t\t$style->description = $input['description'];\n\t\t$style->save();\n\n\t\treturn Redirect::to('/admin_styles')->with('notification', 'Style has been added');\n\n\n\t}", "public function actionCreate()\n {\n $model = new FlashScreen();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($_FILES['FlashScreen']['error']['bg_screen'] == 0) {\n //echo\"sds\";die; \n $rand = rand(0, 99999); // random number generation for unique image save\n // $model->scenario = 'imageUploaded';\n $model->file = UploadedFile::getInstance($model, 'bg_screen');\n $image_name = 'images/youtube/' . $model->file->basename . $rand . \".\" . $model->file->extension;\n $model->file->saveAs($image_name);\n $model->bg_screen = $image_name;\n }\n\n if ($_FILES['FlashScreen']['error']['title_screen'] == 0) {\n $rand = rand(0, 99999);\n $model->file = UploadedFile::getInstance($model, 'title_screen');\n $image_name = 'images/youtube/' . $model->file->basename . $rand . \".\" . $model->file->extension;\n $model->file->saveAs($image_name);\n $model->title_screen = $image_name;\n }\n\n if ($model->save()) {\n //Yii::$app->getSession()->setFlash('success', 'Category Saved successfully.');\n return $this->redirect(['index']); } \n else {\n // Yii::$app->getSession()->setFlash('error', 'Something went wrong !');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } \n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function saveSkinAs()\n\t{\n\t\tif ($this->common->isDevelopment())\n\t\t{\n\t\t\tsleep(1);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->assertPostAndPermission();\n\n\t\t\t// Get inputs from GET\n\t\t\t$store_id = $this->request->post['store_id'];\n\t\t\t$skin_id = $this->request->post['skin_id'];\n\t\t\t$new_skin_name = $this->request->post['new_skin_name'];\n\t\t\t$skin_options = $this->request->post['options'];\n\t\t\t$skin_css = $this->request->post['css'];\n\n\t\t\t// Get theme id from config\n\t\t\t$theme_id = $this->model->getThemeId($store_id);\n\n\t\t\t// Normalize skin id from skin name\n\t\t\t$new_skin_id = $this->model->normalizeSkinId($new_skin_name);\n\n\t\t\t// TODO: Check for name conflict\n\n\t\t\t// Get source skin\n\t\t\t$source_skin = $this->model->getSkin($theme_id, $skin_id);\n\n\t\t\t// Save skin info\n\t\t\t$new_skin = array(\n\t\t\t\t'skin_id' => $new_skin_id,\n\t\t\t\t'name' => $new_skin_name,\n\t\t\t\t'theme_id' => $theme_id,\n\t\t\t\t'root_skin_id' => $source_skin['root_skin_id']\n\t\t\t);\n\n\t\t\t$this->model->insertSkin($new_skin);\n\n\t\t\t$this->model->setSkinForStore($store_id, $theme_id, $new_skin_id);\n\n\t\t\t// Save skin options into db\n\t\t\t$this->model->updateSkinOptions($theme_id, $new_skin_id, $skin_options);\n\n\t\t\t// Process skin CSS\n\t\t\t$skin_css = html_entity_decode($skin_css, ENT_COMPAT, \"UTF-8\");\n\t\t\t$skin_css = $this->model->convertRelative2AbsoluteUrlCss($skin_css);\n\t\t\t$this->model->saveSkinCss($theme_id, $new_skin_id, $skin_css);\n\n\t\t\t$result = array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'message' => _t('text_success_save', 'Success: You have modified module Kuler CP!')\n\t\t\t);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->response->addHeader('HTTP/1.1 500 Error');\n\n\t\t\t$result = array(\n\t\t\t\t'error' => $e->getMessage()\n\t\t\t);\n\t\t}\n\n\t\t$this->response->setOutput(json_encode($result));\n\t}", "public function uploadclip()\n\t{\n\t\t$type = $this->session->userdata('type');\n\t\tif (empty($_FILES) && ! $this->input->get('tipo')) \n\t\t{\n\t\t \t$data['title'] = $this->uri->segment(2);\n\t\t \t$this->load->view('templates/header_upload',$data);\n\t\t \t$this->load->view('templates/logo');\n\t\t \tif ( ! $this->input->get('fname'))\n\t\t \t{\t\n\t\t\t\tif ($type === 'admin')\n\t\t\t\t{\n\t\t\t\t\t$this->load->view('clientes/uploadclip',$data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse echo $this->clientes_model->existing_clip(); //Added clip, verifies if it was loaded before\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! $this->input->get('tipo'))\n\t\t\t{\n\t\t\t\t$this->clientes_model->upload_clip();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (substr($this->input->get('ftype'),0,5) == 'video')\n\t\t\t\t\techo 'El nuevo clip \"'.$this->input->get('tipo').'\" ha sido cargado en el servidor!';\n\t\t\t\t//redirect('loadclips/'.$this->input->get('tipo'));\n\t\t\t}\n\t\t}\t\t\n\t}", "public function actionCreateCss()\n {\n $model = new Areaagricola();\n $data = ArrayHelper::map(Tipo::find()->select(['id', 'nombre'])->all(), 'id', 'nombre');\n\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n\n $model->foto = UploadedFile::getInstance($model,'foto');\n $foto = $model->nombre.'-'. date('Y-m-d H.i.s') .'.'.$model->foto->extension;\n $model->imagen = $foto;\n\n if ($model->save()) {\n //TODO revisar si falta hacer algo aquí\n Yii::$app->session->setFlash('success', 'Guardado correctamente!');\n $model->foto->saveAs($model->ruta.$foto);\n } else {\n Yii::$app->session->setFlash('error', 'Error!');\n return $this->render('create-css-targeta', [\n 'model' => $model,\n 'data' => $data,\n ]);\n }\n\n return $this->redirect(['/areaagricola/css']);\n }\n\n return $this->render('create-css-targeta', [\n 'model' => $model,\n 'data' => $data,\n ]);\n }", "function InsertBoard()\n {\n JRequest::checkToken() or jexit('Invalid Token');\n $user = JFactory::getUser();\n $dt = JFactory::getDate();\n $state_b = $this->getState('state_boar');\n $title = strip_tags(htmlspecialchars($_POST['boardname']));\n $alias = strip_tags(htmlspecialchars($_POST['aliasboard']));\n if ($alias) {\n $alias = $alias;\n } else {\n $alias = $title;\n }\n $alias = JApplication::stringURLSafe($alias);\n $description = strip_tags(htmlspecialchars($_POST['decsipt']));\n $created_time = $dt->toSql();\n $catid = strip_tags(htmlspecialchars($_POST['catego']));\n $created_user_id = $user->id;\n $erro = $this->checkAlias();\n\n if ($erro == \"0\" && isset($created_user_id) && !empty($created_user_id)) {\n $db = JFactory::getDbo();\n $sql = 'INSERT INTO #__tz_pinboard_boards\n VALUES(NULL,\"' . $title . '\",\"' . $alias . '\",\"' . $description . '\",\"' . $state_b . '\",\"' . $created_time . '\",\"\",\"' . $catid . '\",\"' . $created_user_id . '\")';\n $db->setQuery($sql);\n $db->query();\n }\n\n }", "public function actionCreate()\n {\n $model = new Screenshot();\n\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n if ($model->validate()) {\n\n //print_r($model);\n $file = UploadedFile::getInstance($model, 'main_photo_file');\n if (isset($file->size) && $file->size != 0) {\n\n $unique_name = \"screenshot_\" . date(\"Y-m-d_H-i-s\") . \"_\" . uniqid();\n $path = $unique_name . \".{$file->extension}\";\n $model->main_photo = $path;\n $file->saveAs('uploads/screenshot/' . $path);\n }\n $model->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function save()\n {\n global $current_user, $template_uri;\n\n // get theme options\n $constructor = $this->_options;\n $admin = $this->_admin;\n\n // get theme name\n $theme = isset($_REQUEST['theme'])?$_REQUEST['theme']:$admin['theme'];\n $theme_new = strtolower($theme);\n $theme_new = preg_replace('/\\W/', '-', $theme_new);\n $theme_new = preg_replace('/[-]+/', '-', $theme_new);\n\n if ($this->isDefaultTheme($theme_new)) {\n $theme_new = $theme_new .'_'. date('His');\n }\n\n $path_new = CONSTRUCTOR_CUSTOM_THEMES .'/'. $theme_new;\n $path_old = CONSTRUCTOR_CUSTOM_THEMES .'/current';\n\n $theme_uri = isset($_REQUEST['theme-uri'])?$_REQUEST['theme-uri']:'';\n $description = stripslashes(isset($_REQUEST['description'])?$_REQUEST['description']:'');\n $version = isset($_REQUEST['version'])?$_REQUEST['version']:'0.0.1';\n $author = isset($_REQUEST['author'])?$_REQUEST['author']:'';\n $author_uri = isset($_REQUEST['author-uri'])?$_REQUEST['author-uri']:$current_user->user_nicename;\n\n // create new folder for new theme\n if (is_dir($path_new) &&\n !is_writable($path_new)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Directory \"%s\" is not writable.', 'constructor'), $path_new));\n } else {\n if (!wp_mkdir_p($path_new)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Directory \"%s\" is not writable.', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'));\n }\n }\n // copy all theme images to new? directory\n foreach ($constructor['images'] as $img => $data) {\n if (!empty($data['src'])) {\n $old_image = $path_old .'/'. $data['src'];\n $new_image = $path_new .'/'. $data['src'];\n\n if ($old_image != $new_image) {\n // we are already check directory permissions\n if (!@copy($old_image, $new_image)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), $old_image));\n }\n }\n }\n }\n\n // copy all images (*.png, *.jpeg, *.jpg, *.gif)\n // and check it\n $files = scandir($path_old);\n $files = array_diff($files, array('.','..','.svn','screenshot.png','config.php','style.css'));\n foreach ($files as $file) {\n if (in_array(pathinfo($file, PATHINFO_EXTENSION), array('png', 'jpg', 'jpeg', 'gif'))\n && @getimagesize($path_old . '/'. $file)\n ) {\n @copy($path_old.'/'.$file, $path_new.'/'.$file);\n }\n }\n\n // copy default screenshot (if not exist)\n if (!file_exists($path_new.'/screenshot.png') &&\n file_exists($path_old.'/screenshot.png')) {\n if (!@copy($path_old.'/screenshot.png', $path_new.'/screenshot.png')) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), $path_old.'/screenshot.png'));\n }\n } elseif (!file_exists($path_new.'/screenshot.png')) {\n if (!@copy(CONSTRUCTOR_DIRECTORY.'/admin/images/screenshot.png', $path_new.'/screenshot.png')) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), '/admin/images/screenshot.png'));\n }\n }\n\n\n require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';\n\t require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';\n\n $wp_filesystem_direct = new WP_Filesystem_Direct(null);\n\n // update style file\n if (file_exists($path_old.'/style.css')) {\n $style = $wp_filesystem_direct->get_contents($path_old.'/style.css');\n // match first comment /* ... */\n $style = preg_replace('|\\/\\*(.*)\\*\\/|Umis', '', $style, 1);\n } else {\n $style = '';\n }\n\n $style = \"/*\nTheme Name: $theme\nTheme URI: $theme_uri\nDescription: $description\nVersion: $version\nAuthor: $author\nAuthor URI: $author_uri\n*/\".$style;\n\n unset($constructor['theme']);\n\n $config = \"<?php \\n\".\n \"/* Save on \".date('Y-m-d H:i').\" */ \\n\".\n \"return \".\n var_export($constructor, true).\n \"\\n ?>\";\n\n // update files content\n // style CSS\n if (!$wp_filesystem_direct->put_contents(CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/style.css', $style, 0644)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t save file \"%s\".', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/style.css'));\n }\n\n // theme config\n if (!$wp_filesystem_direct->put_contents(CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/config.php', $config, 0644)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t save file \"%s\".', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/config.php'));\n }\n\n $this->returnResponse(RESPONSE_OK, __('Theme was saved, please reload page for view changes', 'constructor'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform wrong parent_id attribute to setting them to null.
public function setParentIdAttribute($value) { $this->attributes['parent_id'] = $value ?: null; }
[ "protected function changeChildrenParent()\n {\n if (config('multi-route.set_null_on_delete', false)) {\n foreach ($this->load('children')->children as $child) {\n $child->parent_id = null;\n $child->save();\n }\n }\n }", "public function setParentIdAttribute($value)\n {\n $this->attributes['parent_id'] = ((int)$value == 0) ? null : $value;\n }", "public function setParentIdAttribute($value){\n\t\t//if branch parent doesn't exist\n\t\tif($this->find($value) === null)\n\t\t\t$value = null;\n\t\t\n $this->attributes['parent_id'] = $value;\n }", "function divorce_parent() {\n $this->old_parent = $this->get_category();\n $this->category = null;\n $this->categoryid = null;\n return $this->update();\n }", "public function setParentAsNullForChildrenOnDelete($tableName)\n {\n UsniAdaptor::db()->createCommand()->update($tableName,\n ['parent_id' => 0, 'level' => $this->level],\n 'parent_id = :pid',\n [':pid' => $this->id])->execute();\n }", "public function testSavesEmptyParentAsNull()\n {\n $category = Mage::getModel('things/category')->setParentId(0)->save();\n $this->assertNull($category->getParentId());\n }", "private function null_parent_settings()\n {\n $this->parent_settings = null;\n return $this;\n }", "function set_parent_id($parent_id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_PARENT_ID, $parent_id);\r\n }", "function fc_update_parent_links()\n{\n $db = new PHPWS_DB('images');\n $db->addWhere('url', 'parent');\n $db->addValue('url', NULL);\n PHPWS_Error::logIfError($db->update());\n\n // remove superfluous column\n PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));\n}", "public function setParentId($parent_id);", "private function resetValuesIfParentIsEmpty(): void\n {\n // Parent element\n $parent = $this->elements[0]->getUriKey();\n\n // Reset the values\n if (! $this->comboboxValues[$parent]) {\n $this->comboboxValues = [];\n $this->comboboxValues[$parent] = [];\n }\n }", "public function unset_on_parent() {\n\t\t$this->parent->delete_by_key( $this->key );\n\t}", "public function setParentId( $parentid );", "function setParentId($value) {\n return $this->setFieldValue('parent_id', $value);\n }", "function cron_reset_skill_parentid_duplicates()\n\t{\n\t\tglobal $ilance;\n\t\t$html = '';\n\t\t$sql = $ilance->db->query(\"\n\t\t\tSELECT cid\n\t\t\tFROM \" . DB_PREFIX . \"skills\n\t\t\tWHERE cid = parentid\n\t\t\", 0, null, __FILE__, __LINE__);\n\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t{\n\t\t\twhile ($res = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t\t\t{\n\t\t\t\t$html .= 'Found a duplicate parentid and cid mixup for cid [' . $res['cid'] . '].. resolving now, ';\n\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\tUPDATE \" . DB_PREFIX . \"skills\n\t\t\t\t\tSET parentid = '0'\n\t\t\t\t\tWHERE cid = '\" . $res['cid'] . \"'\n\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t}\n\t\t}\n\t\treturn $html;\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setObjeto('');\n $this->setId_resto('');\n $this->setId_dl('');\n $this->setPrimary_key($aPK);\n }", "private function _fixCategoryParents()\n\t{\n\t\t$categories = $this->_getCategories();\n\t\tif (empty($categories)) {\n\t\t\treturn;\n\t\t}\n\t\tforeach ($categories as $category) {\n\n\t\t\t$getNewCategory = $this->_getCategoryDatabase($category);\n\n\t\t\tif (! empty($getNewCategory) && $category['parent_id'] > 0) {\n\n\t\t\t\t// Find parent\n\t\t\t\t$parentCategory = $this->_getCateogry($category['parent_id']);\n\t\t\t\tif (! empty($parentCategory)) {\n\n\t\t\t\t\t$getNewParentCategory = $this->_getCategoryDatabase($parentCategory);\n\n\t\t\t\t\tif (! empty($getNewParentCategory)) {\n\t\t\t\t\t\t$getNewCategory['parent_id'] = $getNewParentCategory['id'];\n\t\t\t\t\t\tDatabaseSave::save('categories', $getNewCategory);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function backfill_parents() {\n\t\tglobal $wpdb;\n\n\t\t// find parents for post orphans\n\t\tforeach ( $this->post_orphans as $child_id => $parent_id ) {\n\t\t\t$local_child_id = $local_parent_id = false;\n\t\t\tif ( isset( $this->processed_posts[$child_id] ) )\n\t\t\t\t$local_child_id = $this->processed_posts[$child_id];\n\t\t\tif ( isset( $this->processed_posts[$parent_id] ) )\n\t\t\t\t$local_parent_id = $this->processed_posts[$parent_id];\n\n\t\t\tif ( $local_child_id && $local_parent_id )\n\t\t\t\t$wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );\n\t\t}\n\n\t}", "public function testSetParentShouldWorkWithNull()\n {\n $page1 = Zym_Navigation_Page::factory(array(\n 'label' => 'Page 1',\n 'uri' => '#'\n ));\n \n $page2 = Zym_Navigation_Page::factory(array(\n 'label' => 'Page 2',\n 'uri' => '#'\n ));\n \n $page2->setParent($page1);\n $page2->setParent(null);\n \n $this->assertEquals(null, $page2->getParent());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the essentials environment variables such as php timezone for date().
private static function _load_base_settings() { // Set the timezone for PHP date function. $_timezone = static::get_env('app.timezone'); if (!empty($_timezone)) { date_default_timezone_set($_timezone); } // Set the single-slash if empty base_path. if (empty(static::$_env['app']['base_path'])) { static::$_env['app']['base_path'] = '/'; } }
[ "public function loadEnv()\n {\n $dotenv = Dotenv::createImmutable(__DIR__);\n $dotenv->load();\n\n $this->CST_PLATFORM = $_ENV['CST_PLATFORM'];\n $this->CST_MID = $_ENV['CST_MID'];\n $this->LGD_MID = ((\"test\" == $this->CST_PLATFORM) ? \"t\" : \"\") . $this->CST_MID;\n }", "protected function loadEnvironmentVariables()\n {\n (new Dotenv())->load($this->basePath.'/.env');\n }", "protected static function loadEnv(): void {\n if (empty(self::$env)) {\n self::$env = $_ENV ?: getenv();\n }\n }", "protected static function loadEnv(): void\n {\n if (!getenv(\"APP_ENV\")) {\n $dotenv = new Dotenv($_SERVER['DOCUMENT_ROOT']);\n $dotenv->load();\n }\n }", "public function getEnvironmentVariables();", "static function reifyEnvironment() {\n\t\tforeach (static::$exports as $ekey => $eval) { // Environment variables\n\t\t\tputenv(\"$ekey=$eval\");\n\t\t}\n\t\tforeach (static::$ini_settings as $key => $val) { // PHP .ini settings\n\t\t\tini_set($key, $val);\n\t\t}\n\t}", "public static function define_constants_from_env()\n {\n define('CACHE_BUST', getenv('CACHE_BUST'));\n define('GOOGLE_API_KEY', getenv('GOOGLE_API_KEY'));\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 environmentVariable();", "public function getEnv();", "public function loadIntoENV(): void;", "function loadEnvironment(string $root)\n {\n (Dotenv::createImmutable(realpath(__DIR__), \".env.default\"))->load();\n\n defineFromEnv('PATH_CACHE');\n defineFromEnv('PATH_DATA');\n defineFromEnv('PATH_OUTPUT');\n defineFromEnv('DATA_SQLITE_CACHE_NAME');\n }", "public function setEnvVariables();", "function load_env($path){\n\nif(!is_readable($path)){\n return false;\n}\n\n$lines = file($path,FILE_IGNORE_NEW_LINES |FILE_SKIP_EMPTY_LINES);\n\nforeach($lines as $line){\n $_ENV[trim(explode(\"=\",$line)[0])] = trim(explode(\"=\",$line)[1]);\n}\n\nreturn true;\n}", "protected function loadApiCredentialsFromEnvironment(): void\n {\n $this->apiMerchantId = getenv('PAYONE_MERCHANT_ID');\n $this->apiPortalId = getenv('PAYONE_PORTAL_ID');\n $this->apiSubaccountId = getenv('PAYONE_SUBACCOUNT_ID');\n $this->apiKey = getenv('PAYONE_KEY');\n }", "protected static function initializeEnvironment() {\n\t\t$env = array(\n\t\t\t\t'CIAPI_ENDPOINT' => self::$endpoint, 'CIAPI_USERNAME' => self::$userName,\n\t\t\t\t'CIAPI_PASSWORD' => self::$password\n\t\t);\n\t\tarray_walk($env,\n\t\t\t\tfunction (&$value, $key) {\n\t\t\t\t\t$envValue = getenv($key);\n\t\t\t\t\tif ($envValue) {\n\t\t\t\t\t\t$value = $envValue;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tself::$endpoint = $env['CIAPI_ENDPOINT'];\n\t\tself::$userName = $env['CIAPI_USERNAME'];\n\t\tself::$password = $env['CIAPI_PASSWORD'];\n\t}", "public static function set_timezone(){\n\t\ttry{\n\t\t\tdate_default_timezone_set(Application::config(\"general->application_timezone\"));\n\t\t}catch(Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}", "protected function _initPhpSettings ()\n {\n $options = $this->getOptions();\n date_default_timezone_set($options ['phpSettings'] ['timezone']);\n\n // Turn on the display of errors\n if (APPLICATION_ENV != 'production')\n {\n @ini_set('display_errors', 1);\n }\n }", "public static function include_env_config() {\n if(file_exists(self::$environments_path.\"/\".TRAX_ENV.\".php\")) {\n include_once(self::$environments_path.\"/\".TRAX_ENV.\".php\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
C39E Barcode HTML table rendering test
public function testC39EGetBarcodeHTMLRaw() { $d1 = new barCode(); $d1->savePath = '/tmp/'; $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'C39E', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT); $bcCheckArray = explode('background-color:black', $bcHTMLRaw); $this->assertTrue(count($bcCheckArray)===46); }
[ "public function testC39GetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'C39', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===46);\n }", "public function testCODE11GetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'CODE11', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===31);\n }", "public function testC39GetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_DEFAULT, 'C39', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 46);\n }", "public function testKIXGetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'KIX', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===29);\n }", "public function testC128CGetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_C128C, 'C128C', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===34);\n }", "public function testUPCEGetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_UPCE, 'UPCE', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 18);\n }", "public function testEAN8GetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_EAN2, 'EAN13', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===31);\n }", "public function testC128AGetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'C128', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===28);\n }", "protected function _prepareBarcode()\n {\n $barcodeTable = [];\n $height = ($this->_drawText) ? 1.1 : 1;\n\n // Start character (101)\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n\n $textTable = str_split($this->getText());\n $system = 0;\n\n if ($textTable[0] == 1) {\n $system = 1;\n }\n\n $checksum = $textTable[7];\n $parity = $this->_parities[$system][$checksum];\n\n for ($i = 1; $i < 7; $i++) {\n $bars = str_split($this->_codingMap[$parity[$i - 1]][$textTable[$i]]);\n foreach ($bars as $b) {\n $barcodeTable[] = [$b , $this->_barThinWidth , 0 , 1];\n }\n }\n\n // Stop character (10101)\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n return $barcodeTable;\n }", "public function testEAN8GetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_EAN2, 'EAN13', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 31);\n }", "public function testEAN13GetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_EAN2, 'EAN13', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===31);\n }", "public function testPLANETGetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_DEFAULT, 'PLANET', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 43);\n }", "public function testRMS4CCGetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'RMS4CC', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===35);\n }", "public function testRMS4CCGetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_DEFAULT, 'RMS4CC', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 35);\n }", "function barcode_outhtml($code, $bars, $scale = 1, $total_y = 0, $space = ''){\n /* set defaults */\n $total_y=(int)($total_y);\n if ($scale<1) $scale=2;\n if ($total_y<1) $total_y=(int)$scale * 60;\n if (!$space)\n $space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale);\n\n\n /* generate html-code */\n $height=round($total_y-($scale*10));\n $height2=round($total_y)-$space['bottom'];\n $out=\n '<Table border=0 cellspacing=0 cellpadding=0 bgcolor=\"white\">'.\"\\n\".\n '<TR><TD><img src=white.png height=\"'.$space['top'].'\" width=1></TD></TR>'.\"\\n\".\n '<TR><TD>'.\"\\n\".\n '<IMG src=white.png height=\"'.$height2.'\" width=\"'.$space['left'].'\">';\n \n $width=true;\n for ($i=0;$i<strlen($bars);$i++){\n\t$val=strtolower($bars[$i]);\n\tif ($width){\n\t $w=$val*$scale;\n\t if ($w>0) $out.=\"<IMG src=white.png height=\\\"$total_y\\\" width=\\\"$w\\\" align=top>\";\n\t $width=false;\n\t continue;\n\t}\n\tif (ereg(\"[a-z]\", $val)){\n\t //hoher strich\n\t $val=ord($val)-ord('a')+1;\n\t $h=$height2;\n\t}else $h=$height;\n\t$w=$val*$scale;\n\tif ($w>0) $out.='<IMG src=\"black.png\" height=\"'.$h.'\" width=\"'.$w.'\" align=top>';\n\t$width=true;\n }\n $out.=\n '<IMG src=white.png height=\"'.$height2.'\" width=\".'.$space['right'].'\">'.\n '</TD></TR>'.\"\\n\".\n '<TR><TD><img src=\"white.png\" height=\"'.$space['bottom'].'\" width=\"1\"></TD></TR>'.\"\\n\".\n '</TABLE>'.\"\\n\";\n //for ($i=0;$i<strlen($bars);$i+=2) print $line[$i].\"<B>\".$line[$i+1].\"</B>&nbsp;\";\n return $out;\n}", "public function testI25GetBarcodeHTMLRaw()\n {\n $d1 = new barCode();\n $d1->savePath = '/tmp/';\n\n $bcHTMLRaw = $d1->getBarcodeHTML(self::C_BC_DEFAULT, 'I25', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray)===25);\n }", "protected function prepareBarcode()\n {\n $text = str_split($this->getText());\n $barcodeTable = [];\n foreach ($text as $char) {\n $barcodeChar = str_split($this->codingMap[$char]);\n foreach ($barcodeChar as $c) {\n // visible, width, top, length\n $barcodeTable[] = [$c, $this->barThinWidth, 0, 1];\n }\n $barcodeTable[] = [0, $this->barThinWidth];\n }\n return $barcodeTable;\n }", "public function testI25GetBarcodeHTMLRaw(): void\n {\n $base1DBarcode = new barCode();\n $base1DBarcode->savePath = '/tmp/';\n\n $bcHTMLRaw = $base1DBarcode->getBarcodeHTML(self::C_BC_DEFAULT, 'I25', self::C_BC_1D_WIDTH, self::C_BC_1D_HEIGHT);\n $bcCheckArray = explode('background-color:black', $bcHTMLRaw);\n\n $this->assertTrue(count($bcCheckArray) === 25);\n }", "public function barcodes(){\n /* echo \"<br>\";\n echo DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');\n echo \"<br>\";\n echo $barcode = DNS1D::getBarcodeHTML('4445645656', 'C128');\n echo \"<br>\"; */\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ checks if string contains downloadsource and performs download if possible param downloadLink= string to check for downloads, toolStr = string containing name of tool to check for returns 0 no download found 1 download found + SUCCESSFULLY performed 2 download found but URL couldn't be retrieved or fileSize = 0 3 download found but problem when writing do disk 6 ftp download found, just displayed 7 download found but URL contains duplicate file > file isn't stored again 4 other error
private function checkSingleString( $downloadLink, $toolStr ){ $max_size_per_line = 1024; // max filesize per line in Bytes $success = true; $tempLink = $downloadLink; $returnVal = 5; // init 5 as default return $fileSize = 0; $foundTool = (!(stripos( $downloadLink, $toolStr) === false )); if ( $foundTool ){ /* FIND START OF LINK */ if ( !(strcmp( $toolStr, "http://") == 0 || strcmp( $toolStr, "https://") == 0) ) // if no tool is looked for don't cut of beginning $tempLink = substr( $downloadLink, strpos( $downloadLink, $toolStr ) + strlen($toolStr)); // cut off everything after first "WGET" else { // if no tool used but http:// is looked for if ( (strpos( $tempLink, "http://") === false) && (strpos( $tempLink, "https://") === false )) return 0; } $tempLink = preg_replace("/^[^a-zA-Z]*/" , "", $tempLink ); // remove starting spaces, %20 etc. if ( !(strpos( $tempLink, "http://") === false )) // skip parameters "curl -O http://" $tempLink = substr( $tempLink, strpos( $tempLink, "http://" )); else if ( !(strpos( $tempLink, "https://") === false )) $tempLink = substr( $tempLink, strpos( $tempLink, "https://" )); else if ( !(strpos( $tempLink, "ftp://") === false )) $tempLink = substr( $tempLink, strpos( $tempLink, "ftp://" )); else if ( !(strpos( $tempLink, "ftps://") === false )) $tempLink = substr( $tempLink, strpos( $tempLink, "ftps://" )); else if ( !(strpos( $tempLink, "www.") === false )) // skip parameters "curl -O www.ha.." $tempLink = substr( $tempLink, strpos( $tempLink, "www." )); else { //echo "nothing found:".$tempLink." ".$toolStr."<br>"; $success = false; } /* FIND END OF LINK */ if ( !(strpos( $tempLink, "?") === false )) // split off Get-variables, if any $tempLink = substr( $tempLink, 0, strpos( $tempLink, "?" )); if ( !(strpos( $tempLink, ";") === false )) // split of everything after semicolon $tempLink = substr( $tempLink, 0, strpos( $tempLink, ";" )); if ( !(strpos( $tempLink, "%3B") === false )) // split of everything after semicolon-hex $tempLink = substr( $tempLink, 0, strpos( $tempLink, "%3B" )); if ( !(strpos( $tempLink, " ") === false )) // split of everything after SPACE $tempLink = substr( $tempLink, 0, strpos( $tempLink, " " )); if ( !(strpos( $tempLink, ",") === false )) // split of everything after comma $tempLink = substr( $tempLink, 0, strpos( $tempLink, "," )); //echo "MIDDLE".ereg_replace( "(\ )*", "", $tempLink )."SPACE".$tempLink."<br>"; /* add "http://" if necessary as default*/ if ( !((strpos( $tempLink, "https://") === 0 ) || (strpos( $tempLink, "ftp://") === 0 ) || (strpos( $tempLink, "ftps://") === 0 ) || (strpos( $tempLink, "http://") === 0 ))) $tempLink = "http://".$tempLink; /* ftp-links are just stored, not downloaded */ if ((strpos( $tempLink, "ftp://") === 0 ) | (strpos( $tempLink, "ftps://") === 0 )) return 6; /* make sure at least one dot -> URL */ if ( !(strpos( $tempLink, ".") === false )) { //$tempLink = "D://albie//vid.avi"; $remotefile = @fopen($tempLink,"r"); if($remotefile) { $buffer = ""; // read file and store in buffer while (!feof( $remotefile ) && (($this->maxFileSize - 1) * $max_size_per_line) > $fileSize ) { $buffer .= @fgets($remotefile, $max_size_per_line ); $fileSize = strlen( $buffer ); } $this->resultFileSize = $fileSize; // close file if (!(@fclose($remotefile))) $success = false; // connect to logging-database include "connect.php"; // write buffer to database if ($buffer != "" ) { //echo "DA:".addslashed($buffer)."END<br><br>"; //$data = addslashes(fread(fopen($binFile, "r"), filesize($binFile))); //$strDescription = addslashes(nl2br($txtDescription)); $fileName = strtolower( substr( strrchr( $tempLink, "/" ), 1 ) ); // check if file already in database $duplicate = false; $sql = "SELECT source_url, filename, filesize, filetype FROM ".$this->binary_table." WHERE source_url='".addslashes( $tempLink)."' AND filename='". addslashes($fileName)."' AND filesize='".strlen($buffer)."' AND filetype= '".$this->get_mime( $fileName)."'"; $readResult = @mysqli_query($conn, $sql); if ( $readResult ) if( mysqli_num_rows($readResult) > 0 ) $duplicate = true; // insert new file, if not already in db if (!$duplicate) { $sql = "INSERT INTO ".$this->binary_table." ( id_files, bin_data, source_url, filename, filesize, filetype ) VALUES ('".$this->rowId."', '".addslashes($buffer)."', '".addslashes( $tempLink)."', '". addslashes($fileName)."','".strlen($buffer)."', '".$this->get_mime( $fileName)."' )"; $writeResult = @mysqli_query($conn, $sql) OR die(mysqli_error($conn)); if ($writeResult) { //echo "ja". mysql_num_rows($writeResult); //mysql_free_result($writeResult); // it's always nice to clean up! //echo "Thank you. The new file was successfully added to our database.".strlen($buffer)."<br><br>"; } else { $success = false; $returnVal = 3; //echo "Couldn't write to DB".$tempLink."<br>"; } } else { $this->resultFileSize = $fileSize; $this->resultURL = $tempLink; RETURN 7; // duplicate: url + file found, but both already in db } } else { $success = false; $returnVal = 4; //echo "Buffer or file empty".$tempLink."<br>"; } } else { $success = false; $returnVal = 2; //echo "URL not found".$tempLink."<br>"; } } else { $success = false; $returnVal = 0; //echo "nothing found to download"; } //echo "Size:".$fileSize." Success:".$success." ".$tempLink." ".$returnVal."<br>"; } else { $success = false; $returnVal = 0; //echo "nothing found to download"; } // cleanup if error if ( $fileSize == 0 && $success == true ) { $success = false; } // set results $this->resultFileSize = $fileSize; //if ( $returnVal != 0 && $success ) $this->resultURL = $tempLink; if ( $success == true && $returnVal == 5 && $fileSize > 0 ) return 1; else if ( $success == false & ( $returnVal == 0 || $returnVal == 2 || $returnVal == 3 )) return $returnVal; else if ( $success == true & $fileSize == 0 ) return 3; else return 4; }
[ "function check_download_package_folder(){\n global $PHP_SELF;\n global $DOWNLOAD_SHARED_FOLDER;\n global $process_storage_folder_url;\n global $storage_ip;\n $rt = array('activated'=>'', 'error'=>'', 'path'=>'');\n \n if( $_SERVER['HTTP_HOST'] == $storage_ip){\n if(is_writable($DOWNLOAD_SHARED_FOLDER['SOURCE'])){\n $rt['activated']= true;\n $rt['path']= $DOWNLOAD_SHARED_FOLDER;\n }\n \n return $rt;\n }\n check_prohits_web_root();\n if(isset($DOWNLOAD_SHARED_FOLDER['SOURCE']) and $DOWNLOAD_SHARED_FOLDER['SOURCE']){\n $path = add_folder_backslash($DOWNLOAD_SHARED_FOLDER['SOURCE']);\n $action = '&action=isEmpty_or_unexist';\n $url = $process_storage_folder_url.$path.$action;\n \n $tmp_arr = file($url);\n if($tmp_arr[0] === '0'){\n $action = '&action=isWritable';\n $tmp_arr = file($process_storage_folder_url.$path.$action);\n if(!$tmp_arr[0] or $tmp_arr[0] == '2'){\n $rt['error'] .= \"The folder is not writable($path)\";\n }else{\n $rt['path'] = $path;\n $rt['activated'] = true;\n }\n }else if($tmp_arr[0] == '2'){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory is empty.\";\n }else if($tmp_arr[0] == '1'){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory doesn't exist.\";\n }else if(strpos($tmp_arr[1], 'Maximum execution time')){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory should be mounted after umounted.\";\n }\n }\n return $rt;\n}", "private function getDownloadStatus(){\n $this->MySql->getUrls();\n if ($this->MySql->resultUrl && !empty($this->MySql->resultUrl)) {\n foreach ($this->MySql->resultUrl as $value) {\n $this->domainData[$value['id']] = $value;\n $this->MySql->countFileElement($value['id']);\n $this->downlodedResult[$value['id']] = $this->MySql->result;\n $this->MySql->percentage($value['id']);\n $this->percentage[$value['id']] = $this->MySql->result2;\n $this->calculate($value['id']);\n }\n }\n }", "function reconcileDownload($conn, $localName, $serverName)\n{\n\n appendLogFile(\"reconciling download...\");\n $lastSuccessfulFileName = getLastSuccess();\n appendLogFile(\"serverName: \".$serverName.\" lastSuccessfulFileName: \".$lastSuccessfulFileName);\n appendLogFile(\"The last file set successfully downloaded \".$lastSuccessfulFileName);\n for($i = $lastSuccessfulFileName; $i <= $serverName; $i++)\n {\n $acfString = \"WNCLN\".$i.\".ACF\";\n $ulhString = \"WNCLN\".$i.\".ULH\";\n appendLogFile(\"Attempting to download\". $acfString);\n appendLogFile(\"Attempting to download\". $ulhString);\n if(ftp_get($conn, \"download\\\\\".$acfString, $acfString, FTP_ASCII))\n {\n appendLogFile($acfString.\" downloaded successfully\");\n }\n else\n {\n appendLogFile($acfString.\" DOWNLOAD FAILED!\");\n }\n if(ftp_get($conn, \"download\\\\\".$ulhString, $ulhString, FTP_ASCII))\n {\n appendLogFile($ulhString.\" downloaded successfully\");\n }\n else\n {\n appendLogFile($ulhString.\" DOWNLOAD FAILED!\");\n }\n }\n writeConfigUpdate($serverName);\n}", "public function checkForDownloads()\n\t{\n\t\t$throttle = FILE_DOWNLOAD_THROTTLE; \n\t\tif (!file_exists(FILE_DOWNLOAD_TMP_FILE)) {\n\t\t\texec(\"touch \" . FILE_DOWNLOAD_TMP_FILE);\n\t\t\t$pendingDownloads = $this->db->fetchCol(\"SELECT downloadID FROM File_Downloads WHERE NOT started\");\n\t\t\tforeach ($pendingDownloads as $downloadID) {\n\t\t\t\t$count = $this->db->fetchOne(\"SELECT COUNT(*) FROM File_Downloads WHERE started\");\n\t\t\t\tif ($count < $throttle) {\n\t\t\t\t\texec(APPLICATION_ROOT . \"/cli/download.php $downloadID > /dev/null &#038;\");\n\t\t\t\t}\n\t\t\t\tsleep(1);\n\t\t\t}\n\t\t\texec(\"rm \" . FILE_DOWNLOAD_TMP_FILE);\n\t\t}\n\t}", "function download_file($mirror, $file)\n{\n global $MYSITE;\n \n // Could be a normal download or a manual download file\n $possible_files = array($file => TRUE, \"manual/$file\" => FALSE); \n \n // Find out what is the exact file requested \n $found = FALSE;\n foreach ($possible_files as $name => $log) {\n if (@file_exists($_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $name)) {\n $found = $name;\n break;\n }\n }\n \n // No downloadable file found\n if ($found === FALSE) {\n status_header(404);\n site_header(\"Download not found\");\n \n // If user comes from a mirror selection page, provide a backlink\n if (isset($_SERVER['HTTP_REFERER']) && preg_match(\"!/from/a/mirror$!\", $_SERVER['HTTP_REFERER'])) {\n $moreinfo = \", or <a href=\\\"\".htmlspecialchars($_SERVER['HTTP_REFERER'],ENT_QUOTES,'UTF-8').\"\\\">reconsider your mirror selection</a>\"; \n } else { $moreinfo = \"\"; }\n \n // An executable was requested (temp fix for rsync change)\n if (preg_match(\"!\\\\.exe$!\", $name)) {\n $info = \"<p>\n This mirror site is improperly setup, and thus has\n no copy of the executable file you requested. Please\n <a href=\\\"/mirrors\\\">select a different\n mirror site</a> to get the file, until this site gets\n fixed.\n</p>\";\n }\n else {\n $info = \"<p>\n The file you requested (<strong> \" . htmlspecialchars($file, ENT_QUOTES, \"UTF-8\") . \" </strong>) is not found on\n this server (<strong>{$MYSITE}</strong>). If this file is a\n recent addition to our downloads, then it is possible that this\n particular server is not yet updated to host that file for download.\n Please come back to this server later{$moreinfo}.\n</p>\";\n }\n \n echo <<<EOT\n<h1>Download not found</h1>\n{$info}\nEOT;\n site_footer();\n exit;\n }\n \n // Redirect to the particular file\n if (!headers_sent()) {\n status_header(302);\n header('Location: ' . $mirror . 'distributions/' . $found);\n } else {\n exit(\"Unable to serve you the requested file for download\");\n }\n\n // Try to flush output, and make the browser really\n // download the file, even if the log server is down\n echo \" \";\n flush();\n \n // Log download on master server (may be a registered\n // shutdown function to really run after the file is\n // started to download)\n // if ($log) { download_log($mirror, $found); }\n}", "function _check_download_package_folder(){\n global $PHP_SELF;\n global $DOWNLOAD_PACKAGE_FOLDER;\n global $process_storage_folder_url;\n $rt = array('activated'=>'', 'error'=>'', 'path'=>'');\n if( $_SERVER['HTTP_HOST'] == STORAGE_IP){\n if(is_writable($DOWNLOAD_PACKAGE_FOLDER['SOURCE'])){\n $rt['activated']= true;\n $rt['path']= $DOWNLOAD_PACKAGE_FOLDER;\n }\n return $rt;\n }\n check_prohits_web_root();\n if(isset($DOWNLOAD_PACKAGE_FOLDER['SOURCE']) and $DOWNLOAD_PACKAGE_FOLDER['SOURCE']){\n $path = add_folder_backslash($DOWNLOAD_PACKAGE_FOLDER['SOURCE']);\n $action = '&action=isEmpty_or_unexist';\n $tmp_arr = file($process_storage_folder_url.$path.$action);\n if($tmp_arr[0] === '0'){\n $action = '&action=isWritable';\n $tmp_arr = file($process_storage_folder_url.$path.$action);\n if(!$tmp_arr[0] or $tmp_arr[0] == '2'){\n $rt['error'] .= \"The folder is not writable($path)\";\n }else{\n $rt['path'] = $path;\n $rt['activated'] = true;\n }\n }else if($tmp_arr[0] == '2'){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory is empty.\";\n }else if($tmp_arr[0] == '1'){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory doesn't exist.\";\n }else if(strpos($tmp_arr[1], 'Maximum execution time')){\n $rt['error'] .= \"Prohits lost connection with DOWNLOAD_PACKAGE folder data folder. <br>The source directory should be mounted after umounted.\";\n }\n }\n return $rt;\n}", "function _http_download_file($url,$byte_limit=NULL,$trigger_error=true,$no_redirect=false,$ua='ocPortal',$post_params=NULL,$cookies=NULL,$accept=NULL,$accept_charset=NULL,$accept_language=NULL,$write_to_file=NULL,$referer=NULL,$auth=NULL,$timeout=6.0,$is_xml=false,$files=NULL)\n{\n\tif ($cookies===null) $cookies=array();\n\n\t$url=str_replace(' ','%20',$url);\n\n\t// Prevent DOS loop attack\n\tif (ocp_srv('HTTP_USER_AGENT')==$ua) $ua='ocP-recurse';\n\tif (ocp_srv('HTTP_USER_AGENT')=='ocP-recurse') return NULL;\n\n\trequire_code('urls');\n\tif (url_is_local($url)) $url=get_custom_base_url().'/'.$url;\n\n\tif ((strpos($url,'/')!==false) && (strrpos($url,'/')<7)) $url.='/';\n\n\tglobal $DOWNLOAD_LEVEL;\n\t$DOWNLOAD_LEVEL++;\n\tglobal $HTTP_DOWNLOAD_MIME_TYPE;\n\t$HTTP_DOWNLOAD_MIME_TYPE=NULL;\n\tglobal $HTTP_CHARSET;\n\t$HTTP_CHARSET=NULL;\n\tglobal $HTTP_DOWNLOAD_SIZE;\n\t$HTTP_DOWNLOAD_SIZE=0;\n\tglobal $HTTP_DOWNLOAD_URL;\n\t$HTTP_DOWNLOAD_URL=$url;\n\tglobal $HTTP_MESSAGE;\n\t$HTTP_MESSAGE=NULL;\n\tglobal $HTTP_MESSAGE_B;\n\t$HTTP_MESSAGE_B=NULL;\n\tglobal $HTTP_NEW_COOKIES;\n\tif ($DOWNLOAD_LEVEL==0) $HTTP_NEW_COOKIES=array();\n\tglobal $HTTP_FILENAME;\n\t$HTTP_FILENAME=NULL;\n\n\tif ($DOWNLOAD_LEVEL==8) return '';//critical_error('FILE_DOS',$url); // Prevent possible DOS attack\n\n\t$url_parts=@parse_url($url);\n\tif ($url_parts===false || !isset($url_parts['host']))\n\t{\n\t\tif ($trigger_error)\n\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_BAD_URL',escape_html($url)));\n\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_BAD_URL',escape_html($url));\n\t\t$DOWNLOAD_LEVEL--;\n\t\t$HTTP_MESSAGE='malconstructed-URL';\n\t\treturn NULL;\n\t}\n\tif (!array_key_exists('scheme',$url_parts)) $url_parts['scheme']='http';\n\n\t$use_curl=(($url_parts['scheme']!='http') && (function_exists('curl_version'))) || ((function_exists('get_value')) && (get_value('prefer_curl')==='1')) || (!php_function_allowed('fsockopen'));\n\n\t// Prep cookies and post data\n\t$sent_http_post_content=false;\n\tif (!is_null($post_params))\n\t{\n\t\tif ($is_xml)\n\t\t{\n\t\t\t$_postdetails_params=$post_params[0];\n\t\t} else\n\t\t{\n\t\t\t$_postdetails_params='';//$url_parts['scheme'].'://'.$url_parts['host'].$url2.'?';\n\t\t\tif (array_keys($post_params)==array('_'))\n\t\t\t{\n\t\t\t\t$_postdetails_params=$post_params['_'];\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif (count($post_params)>0)\n\t\t\t\t{\n\t\t\t\t\tif (function_exists('http_build_query'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$post_params_copy=$post_params;\n\t\t\t\t\t\tforeach ($post_params_copy as $param_key=>$param_value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($use_curl) && (substr($param_value,0,1)=='@'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$param_value=' @'.substr($param_value,1);\n\t\t\t\t\t\t\t\t$post_params_copy[$param_key]=$param_value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_postdetails_params.='?'.http_build_query($post_params_copy);\n\n\t\t\t\t\t\t$sent_http_post_content=true;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$first=true;\n\t\t\t\t\t\tforeach ($post_params as $param_key=>$param_value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($use_curl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (substr($param_value,0,1)=='@') $param_value=' @'.substr($param_value,1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$_postdetails_params.=((array_key_exists('query',$url_parts)) || (!$first))?('&'.$param_key.'='.rawurlencode($param_value)):($param_key.'='.rawurlencode($param_value));\n\t\t\t\t\t\t\t$first=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sent_http_post_content=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else $_postdetails_params='';\n\tif (count($cookies)!=0)\n\t{\n\t\t$_cookies='';\n\t\t$done_one_cookie=false;\n\t\tforeach ($cookies as $key=>$val)\n\t\t{\n\t\t\tif ($done_one_cookie) $_cookies.='; ';\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\tforeach ($val as $key2=>$val2)\n\t\t\t\t{\n\t\t\t\t\tif (!is_string($key2)) $key2=strval($key2);\n\t\t\t\t\tif ($done_one_cookie) $_cookies.='; ';\n\t\t\t\t\t$_cookies.=$key.'['.$key2.']='.rawurlencode($val2);\n\t\t\t\t\t$done_one_cookie=true;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$_cookies.=$key.'='.rawurlencode($val);\n\t\t\t}\n\t\t\t$done_one_cookie=true;\n\t\t}\n\t}\n\n\tif ($use_curl) // We'll have to try to use CURL\n\t{\n\t\tif (!is_null($files))\n\t\t{\n\t\t\tif (is_null($post_params)) $post_params=array();\n\t\t\tforeach ($files as $upload_field=>$file_path)\n\t\t\t{\n\t\t\t\t$post_params[$upload_field]='@'.$file_path;\n\t\t\t}\n\t\t}\n\n\t\t// CURL\n\t\tif (function_exists('curl_version'))\n\t\tif (function_exists('curl_init'))\n\t\tif (function_exists('curl_setopt'))\n\t\tif (function_exists('curl_exec'))\n\t\tif (function_exists('curl_error'))\n\t\tif (function_exists('curl_close'))\n\t\tif (function_exists('curl_getinfo'))\n\t\tif (($url_parts['scheme']=='https') || ($url_parts['scheme']=='http'))\n\t\t{\n\t\t\t$curl_version=curl_version();\n\t\t\tif (((is_string($curl_version)) && (strpos($curl_version,'OpenSSL')!==false)) || ((is_array($curl_version)) && (array_key_exists('ssl_version',$curl_version))))\n\t\t\t{\n\t\t\t\t$ch=curl_init($url);\n\t\t\t\tif (!is_null($post_params))\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($ch,CURLOPT_POST,true);\n\t\t\t\t\tif (is_null($files))\n\t\t\t\t\t{\n\t\t\t\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$_postdetails_params);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t@curl_setopt($ch,CURLOPT_POSTFIELDS,$post_params); // PHP5.5 gives a deprecation warning\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count($cookies)!=0) curl_setopt($ch,CURLOPT_COOKIE,$_cookies);\n\t\t\t\t$crt_path=get_file_base().'/data/curl-ca-bundle.crt';\n\t\t\t\tif (ini_get('curl.cainfo')=='')\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($ch,CURLOPT_CAINFO,$crt_path);\n\t\t\t\t\tcurl_setopt($ch,CURLOPT_CAPATH,$crt_path);\n\t\t\t\t}\n\t\t\t\t//curl_setopt($ch,CURLOPT_SSLVERSION,6);\n\t\t\t\tcurl_setopt($ch,CURLOPT_SSL_CIPHER_LIST,'TLSv1');\n\t\t\t\t//if (!$no_redirect) @curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); // May fail with safe mode, meaning we can't follow Location headers. But we can do better ourselves anyway and protect against file:// exploits.\n\t\t\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,intval($timeout));\n\t\t\t\tcurl_setopt($ch,CURLOPT_TIMEOUT,intval($timeout));\n\t\t\t\tcurl_setopt($ch,CURLOPT_USERAGENT,$ua);\n\t\t\t\t$headers=array();\n\t\t\t\tif ($is_xml) $headers[]='Content-Type: application/xml';\n\t\t\t\tif (!is_null($accept)) $headers[]='Accept: '.rawurlencode($accept);\n\t\t\t\tif (!is_null($accept_charset)) $headers[]='Accept-Charset: '.rawurlencode($accept_charset);\n\t\t\t\tif (!is_null($accept_language)) $headers[]='Accept-Language: '.rawurlencode($accept_language);\n\t\t\t\tif (is_null($files)) // Breaks file uploads for some reason\n\t\t\t\t\tcurl_setopt($ch,CURLOPT_HTTPHEADER,$headers);\n\t\t\t\tif (!is_null($auth)) curl_setopt($ch,CURLOPT_USERPWD,implode(':',$auth));\n\t\t\t\tif (!is_null($referer))\n\t\t\t\t\tcurl_setopt($ch,CURLOPT_REFERER,$referer);\n\t\t\t\t$proxy=get_value('proxy',NULL,true);\n\t\t\t\tif ($proxy=='') $proxy=NULL;\n\t\t\t\tif ((!is_null($proxy)) && ($url_parts['host']!='localhost') && ($url_parts['host']!='127.0.0.1'))\n\t\t\t\t{\n\t\t\t\t\t$port=get_value('proxy_port',NULL,true);\n\t\t\t\t\tif (is_null($port)) $port='8080';\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXY,$proxy.':'.$port);\n\t\t\t\t\t$proxy_user=get_value('proxy_user',NULL,true);\n\t\t\t\t\tif (!is_null($proxy_user))\n\t\t\t\t\t{\n\t\t\t\t\t\t$proxy_password=get_value('proxy_password',NULL,true);\n\t\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_user.':'.$proxy_password);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!is_null($byte_limit)) curl_setopt($ch,CURLOPT_RANGE,'0-'.strval(($byte_limit==0)?0:($byte_limit-1)));\n\t\t\t\tglobal $CURL_HEADERS,$CURL_BODY,$CURL_WRITE_TO_FILE;\n\t\t\t\t$CURL_HEADERS=array();\n\t\t\t\t$CURL_BODY='';\n\t\t\t\t$CURL_WRITE_TO_FILE=$write_to_file;\n\t\t\t\tcurl_setopt($ch,CURLOPT_HEADERFUNCTION,'_http_download_file_curl_headers');\n\t\t\t\tcurl_setopt($ch,CURLOPT_WRITEFUNCTION,'_http_download_file_curl_body');\n\t\t\t\t$result=curl_exec($ch);\n\t\t\t\tif (!$result)\n\t\t\t\t{\n\t\t\t\t\t$error=curl_error($ch);\n\t\t\t\t\tcurl_close($ch);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$HTTP_DOWNLOAD_MIME_TYPE=curl_getinfo($ch,CURLINFO_CONTENT_TYPE);\n\t\t\t\t\t$HTTP_DOWNLOAD_SIZE=curl_getinfo($ch,CURLINFO_CONTENT_LENGTH_DOWNLOAD);\n\t\t\t\t\t$HTTP_DOWNLOAD_URL=curl_getinfo($ch,CURLINFO_EFFECTIVE_URL);\n\t\t\t\t\t$HTTP_MESSAGE=strval(curl_getinfo($ch,CURLINFO_HTTP_CODE));\n\t\t\t\t\tif ($HTTP_MESSAGE=='206') $HTTP_MESSAGE='200'; // We don't care about partial-content return code, as ocP implementation gets ranges differently and we check '200' as a return result\n\t\t\t\t\tif (strpos($HTTP_DOWNLOAD_MIME_TYPE,';')!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$HTTP_CHARSET=substr($HTTP_DOWNLOAD_MIME_TYPE,8+strpos($HTTP_DOWNLOAD_MIME_TYPE,'charset='));\n\t\t\t\t\t\t$HTTP_DOWNLOAD_MIME_TYPE=substr($HTTP_DOWNLOAD_MIME_TYPE,0,strpos($HTTP_DOWNLOAD_MIME_TYPE,';'));\n\t\t\t\t\t}\n\t\t\t\t\tcurl_close($ch);\n\n\t\t\t\t\tforeach ($CURL_HEADERS as $_line)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matches=array();\n\n\t\t\t\t\t\tif (preg_match('#^Content-Disposition: [^;]*;\\s*filename=\"([^\"]*)\"#i',$_line,$matches)!=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$HTTP_FILENAME=$matches[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (preg_match(\"#^Set-Cookie: ([^\\r\\n=]*)=([^\\r\\n]*)\\r\\n#i\",$_line,$matches)!=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cookie_key=trim(rawurldecode($matches[1]));\n\n\t\t\t\t\t\t\t$cookie_value=trim($matches[2]);\n\t\t\t\t\t\t\t$_cookie_parts=explode('; ',$cookie_value);\n\n\t\t\t\t\t\t\t$cookie_parts=array();\n\n\t\t\t\t\t\t\t$cookie_parts['key']=$cookie_key;\n\t\t\t\t\t\t\t$cookie_parts['value']=trim(rawurldecode(array_shift($_cookie_parts)));\n\n\t\t\t\t\t\t\tforeach ($_cookie_parts as $i=>$part)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp=explode('=',$part,2);\n\t\t\t\t\t\t\t\tif (array_key_exists(1,$temp))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$cookie_parts[trim($temp[0])]=trim(rawurldecode($temp[1]));\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 (function_exists('get_cookie_domain'))\n\t\t\t\t\t\t\t\t$cookie_parts['domain']=get_cookie_domain();\n\n\t\t\t\t\t\t\t$HTTP_NEW_COOKIES[$cookie_key]=$cookie_parts;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (preg_match(\"#^Location: (.*)\\r\\n#i\",$_line,$matches)!=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=basename($matches[1]);\n\n\t\t\t\t\t\t\tif (strpos($matches[1],'://')===false) $matches[1]=qualify_url($matches[1],$url,true);\n\t\t\t\t\t\t\tif ($matches[1]!=$url)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$bak=$HTTP_FILENAME;\n\t\t\t\t\t\t\t\t$text=$no_redirect?mixed():_http_download_file($matches[1],$byte_limit,$trigger_error,false,$ua,NULL,collapse_2d_complexity('key','value',$HTTP_NEW_COOKIES)+$cookies,$accept,$accept_charset,$accept_language,$write_to_file);\n\t\t\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=$bak;\n\t\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\t\treturn _detect_character_encoding($text);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t$ret=_detect_character_encoding($CURL_BODY);\n\n\t\t\t\t\tif ($HTTP_MESSAGE!='200') $ret='';\n\n\t\t\t\t\treturn $ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$errno=0;\n\t$errstr='';\n\tif ($url_parts['scheme']=='http')\n\t{\n\t\tif (!array_key_exists('host',$url_parts)) $url_parts['host']='127.0.0.1';\n\t\t$connect_to=$url_parts['host'];\n\t\t$base_url_parsed=parse_url(get_base_url());\n\t\tif (!array_key_exists('host',$base_url_parsed)) $base_url_parsed['host']='127.0.0.1';\n\t\tif (($base_url_parsed['host']==$connect_to) && (function_exists('get_option')) && (get_option('ip_forwarding')=='1')) // For cases where we have IP-forwarding, and a strong firewall (i.e. blocked to our own domain's IP by default)\n\t\t{\n\t\t\t$connect_to='127.0.0.1'; // Localhost can fail due to IP6\n\t\t} elseif (preg_match('#(\\s|,|^)gethostbyname(\\s|$|,)#i',@ini_get('disable_functions'))==0) $connect_to=@gethostbyname($connect_to); // for DNS cacheing\n\t\t$proxy=function_exists('get_value')?get_value('proxy',NULL,true):NULL;\n\t\tif ($proxy=='') $proxy=NULL;\n\t\tif ((!is_null($proxy)) && ($connect_to!='localhost') && ($connect_to!='127.0.0.1'))\n\t\t{\n\t\t\t$proxy_port=get_value('proxy_port',NULL,true);\n\t\t\tif (is_null($proxy_port)) $proxy_port='8080';\n\t\t\t$mysock=@fsockopen($proxy,intval($proxy_port),$errno,$errstr,$timeout);\n\t\t} else\n\t\t{\n\t\t\t$mysock=@fsockopen($connect_to,array_key_exists('port',$url_parts)?$url_parts['port']:80,$errno,$errstr,$timeout);\n\t\t}\n\t\tif (is_null($mysock)) $mysock=false; // For Quercus #4549\n\t} else $mysock=false;\n\tif ($mysock!==false)\n\t{\n\t\tif (function_exists('stream_set_timeout'))\n\t\t{\n\t\t\tif (@stream_set_timeout($mysock,intval($timeout))===false) $mysock=false;\n\t\t} elseif (function_exists('socket_set_timeout'))\n\t\t{\n\t\t\tif (@socket_set_timeout($mysock,intval($timeout))===false) $mysock=false;\n\t\t}\n\t}\n\tif ($mysock!==false)\n\t{\n\t\t$url2=array_key_exists('path',$url_parts)?$url_parts['path']:'/';\n\t\tif (array_key_exists('query',$url_parts)) $url2.='?'.$url_parts['query'];\n\n\t\tif ((!is_null($proxy)) && ($connect_to!='localhost') && ($connect_to!='127.0.0.1'))\n\t\t{\n\t\t\t$out='';\n\t\t\t$out.=((is_null($post_params))?(($byte_limit===0)?'HEAD ':'GET '):'POST ').str_replace(\"\\r\",'',str_replace(chr(10),'',$url)).\" HTTP/1.1\\r\\n\";\n\t\t\t$proxy_user=get_value('proxy_user',NULL,true);\n\t\t\tif (!is_null($proxy_user))\n\t\t\t{\n\t\t\t\t$proxy_password=get_value('proxy_password',NULL,true);\n\t\t\t\t$out.='Proxy-Authorization: Basic '.base64_encode($proxy_user.':'.$proxy_password).\"\\r\\n\";\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\t$out=((is_null($post_params))?(($byte_limit===0)?'HEAD ':'GET '):'POST ').str_replace(\"\\r\",'',str_replace(chr(10),'',$url2)).\" HTTP/1.1\\r\\n\";\n\t\t}\n\t\t$out.=\"Host: \".$url_parts['host'].\"\\r\\n\";\n\t\tif (count($cookies)!=0) $out.='Cookie: '.$_cookies.\"\\r\\n\";\n\t\t$out.=\"User-Agent: \".rawurlencode($ua).\"\\r\\n\";\n\t\tif (!is_null($auth))\n\t\t{\n\t\t\t$out.=\"Authorization: Basic \".base64_encode(implode(':',$auth)).\"==\\r\\n\";\n\t\t}\n\t\tif (!is_null($accept))\n\t\t{\n\t\t\t$out.=\"Accept: \".rawurlencode($accept).\"\\r\\n\";\n\t\t} else\n\t\t{\n\t\t\t$out.=\"Accept: */*\\r\\n\"; // There's a mod_security rule that checks for this\n\t\t}\n\t\tif (!is_null($accept_charset))\n\t\t{\n\t\t\t$out.=\"Accept-Charset: \".rawurlencode($accept_charset).\"\\r\\n\";\n\t\t}\n\t\tif (!is_null($accept_language))\n\t\t{\n\t\t\t$out.=\"Accept-Language: \".rawurlencode($accept_language).\"\\r\\n\";\n\t\t}\n\t\tif (!is_null($referer))\n\t\t\t$out.=\"Referer: \".rawurlencode($referer).\"\\r\\n\";\n\t\tif ($_postdetails_params!='')\n\t\t{\n\t\t\tif ($is_xml)\n\t\t\t{\n\t\t\t\t$out.=\"Content-Type: application/xml\\r\\n\";\n\t\t\t\t$out.='Content-length: '.strval(strlen($_postdetails_params)).\"\\r\\n\";\n\t\t\t\t$out.=\"\\r\\n\".$_postdetails_params.\"\\r\\n\\r\\n\";\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif (is_null($files))\n\t\t\t\t{\n\t\t\t\t\t$out.='Content-type: application/x-www-form-urlencoded; charset='.get_charset().\"\\r\\n\";\n\t\t\t\t\t$out.='Content-length: '.strval(strlen($_postdetails_params)).\"\\r\\n\";\n\t\t\t\t\t$out.=\"\\r\\n\".$_postdetails_params.\"\\r\\n\\r\\n\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$divider=uniqid('',true);\n\t\t\t\t\t$out2='';\n\t\t\t\t\t$out.='Content-type: multipart/form-data; boundary=\"--ocp'.$divider.'\"; charset='.get_charset().\"\\r\\n\";\n\t\t\t\t\tforeach ($post_params as $key=>$val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$out2.='----ocp'.$divider.\"\\r\\n\";\n\t\t\t\t\t\t$out2.='Content-Disposition: form-data; name=\"'.urlencode($key).'\"'.\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t$out2.=$val.\"\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_null($files))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($files as $upload_field=>$file_path)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$out2.='----ocp'.$divider.\"\\r\\n\";\n\t\t\t\t\t\t\t$out2.='Content-Disposition: form-data; name=\"'.urlencode($upload_field).'\"; filename=\"'.urlencode(basename($file_path)).'\"'.\"\\r\\n\";\n\t\t\t\t\t\t\t$out2.='Content-Type: application/octet-stream'.\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t\t$out2.=file_get_contents($file_path).\"\\r\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$out2.='----ocp'.$divider.\"--\\r\\n\";\n\t\t\t\t\t$out.='Content-length: '.strval(strlen($out2)).\"\\r\\n\";\n\t\t\t\t\t$out.=\"\\r\\n\".$out2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ((!$sent_http_post_content) || (!is_null($files)))\n\t\t{\n\t\t\t$out.=\"Connection: Close\\r\\n\\r\\n\";\n\t\t}\n\n\t\t@fwrite($mysock,$out);\n\t\t$data_started=false;\n\t\t$input='';\n\t\t$input_len=0;\n\t\t$first_fail_time=mixed();\n\t\t$chunked=false;\n\t\t$buffer_unprocessed='';\n\t\twhile (($chunked) || (!@feof($mysock))) // @'d because socket might have died. If so fread will will return false and hence we'll break\n\t\t{\n\t\t\t$line=@fread($mysock,(($chunked) && (strlen($buffer_unprocessed)>10))?10:1024);\n\t\t\tif ($line===false)\n\t\t\t{\n\t\t\t\tif ((!$chunked) || ($buffer_unprocessed=='')) break;\n\t\t\t\t$line='';\n\t\t\t}\n\t\t\tif ($line=='')\n\t\t\t{\n\t\t\t\tif (!is_null($first_fail_time))\n\t\t\t\t{\n\t\t\t\t\tif ($first_fail_time<time()-5) break;\n\t\t\t\t} else $first_fail_time=time();\n\t\t\t} else $first_fail_time=NULL;\n\t\t\tif ($data_started)\n\t\t\t{\n\t\t\t\t$line=$buffer_unprocessed.$line;\n\t\t\t\t$buffer_unprocessed='';\n\n\t\t\t\tif ($chunked)\n\t\t\t\t{\n\t\t\t\t\t$matches=array();\n\t\t\t\t\tif (preg_match('#^(\\r\\n)?([a-f\\d]+) *(;[^\\r\\n]*)?\\r\\n(.*)$#is',$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$amount_wanted=hexdec($matches[2]);\n\t\t\t\t\t\tif (strlen($matches[4])<$amount_wanted) // Chunk was more than what we grabbed, so we need to iterate more to parse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$buffer_unprocessed=$line;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$buffer_unprocessed=substr($matches[4],$amount_wanted); // May be some more extra read\n\t\t\t\t\t\t$line=substr($matches[4],0,$amount_wanted);\n\t\t\t\t\t\tif ($line=='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\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\t// Should not happen :S\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_null($write_to_file)) $input.=$line; else fwrite($write_to_file,$line);\n\t\t\t\t$input_len+=strlen($line);\n\t\t\t\tif ((!is_null($byte_limit)) && ($input_len>=$byte_limit))\n\t\t\t\t{\n\t\t\t\t\t$input=substr($input,0,$byte_limit);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($line!='')\n\t\t\t{\n\t\t\t\t$old_line=$line;\n\t\t\t\t$lines=explode(\"\\r\\n\",$line);\n\n\t\t\t\t$tally=0;\n\t\t\t\tforeach ($lines as $lno=>$line)\n\t\t\t\t{\n\t\t\t\t\t$line.=\"\\r\\n\";\n\n\t\t\t\t\t$tally+=strlen($line);\n\n\t\t\t\t\t$matches=array();\n\t\t\t\t\tif (preg_match(\"#Transfer-Encoding: chunked\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$chunked=true;\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#Content-Disposition: [^\\r\\n]*filename=\\\"([^;\\r\\n]*)\\\"\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$HTTP_FILENAME=$matches[1];\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#^Set-Cookie: ([^\\r\\n=]*)=([^\\r\\n]*)\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cookie_key=trim(rawurldecode($matches[1]));\n\n\t\t\t\t\t\t$cookie_value=trim($matches[2]);\n\t\t\t\t\t\t$_cookie_parts=explode('; ',$cookie_value);\n\n\t\t\t\t\t\t$cookie_parts=array();\n\n\t\t\t\t\t\t$cookie_parts['key']=$cookie_key;\n\t\t\t\t\t\t$cookie_parts['value']=trim(rawurldecode(array_shift($_cookie_parts)));\n\n\t\t\t\t\t\tforeach ($_cookie_parts as $i=>$part)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp=explode('=',$part,2);\n\t\t\t\t\t\t\tif (array_key_exists(1,$temp))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cookie_parts[trim($temp[0])]=trim(rawurldecode($temp[1]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (function_exists('get_cookie_domain'))\n\t\t\t\t\t\t\t$cookie_parts['domain']=get_cookie_domain();\n\n\t\t\t\t\t\t$HTTP_NEW_COOKIES[$cookie_key]=$cookie_parts;\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#^Content-Length: ([^;\\r\\n]*)\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$HTTP_DOWNLOAD_SIZE=intval($matches[1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#^Content-Type: ([^;\\r\\n]*)(;[^\\r\\n]*)?\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$HTTP_DOWNLOAD_MIME_TYPE=$matches[1];\n\t\t\t\t\t\tif (array_key_exists(2,$matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_ct_more=explode(';',str_replace(' ','',trim($matches[2])));\n\t\t\t\t\t\t\tforeach ($_ct_more as $ct_more)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ct_bits=explode('=',$ct_more,2);\n\t\t\t\t\t\t\t\tif ((count($ct_bits)==2) && (strtolower($ct_bits[0])=='charset'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$HTTP_CHARSET=trim($ct_bits[1]);\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\tif (preg_match(\"#^Refresh: (\\d*);(.*)\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=basename($matches[1]);\n\n\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\tif (strpos($matches[1],'://')===false) $matches[1]=qualify_url($matches[1],$url,true);\n\t\t\t\t\t\t$bak=$HTTP_FILENAME;\n\t\t\t\t\t\t$text=$no_redirect?mixed():_http_download_file($matches[2],$byte_limit,$trigger_error,false,$ua,NULL,collapse_2d_complexity('key','value',$HTTP_NEW_COOKIES)+$cookies,$accept,$accept_charset,$accept_language,$write_to_file);\n\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=$bak;\n\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\treturn _detect_character_encoding($text);\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#^Location: (.*)\\r\\n#i\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=basename($matches[1]);\n\n\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\tif (strpos($matches[1],'://')===false) $matches[1]=qualify_url($matches[1],$url,true);\n\t\t\t\t\t\tif ($matches[1]!=$url)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bak=$HTTP_FILENAME;\n\t\t\t\t\t\t\t$text=$no_redirect?mixed():_http_download_file($matches[1],$byte_limit,$trigger_error,false,$ua,NULL,collapse_2d_complexity('key','value',$HTTP_NEW_COOKIES)+$cookies,$accept,$accept_charset,$accept_language,$write_to_file);\n\t\t\t\t\t\t\tif (is_null($HTTP_FILENAME)) $HTTP_FILENAME=$bak;\n\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\treturn _detect_character_encoding($text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (preg_match(\"#HTTP/(\\d*\\.\\d*) (\\d*) #\",$line,$matches)!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// 200/201 = Ok\n\t\t\t\t\t\t// 301/302 = Redirected: Not good, we should not be here\n\t\t\t\t\t\t// 401 = Unauthorized\n\t\t\t\t\t\t// 403 = Forbidden\n\t\t\t\t\t\t// 404 = Not found\n\t\t\t\t\t\t// 500 = Internal server error\n\t\t\t\t\t\t$HTTP_MESSAGE=$matches[2];\n\t\t\t\t\t\tswitch ($matches[2])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase '302':\n\t\t\t\t\t\t\tcase '301':\n\t\t\t\t\t\t\t\t// We'll expect a location header\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '200':\n\t\t\t\t\t\t\tcase '201':\n\t\t\t\t\t\t\t\t// Good\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '401':\n\t\t\t\t\t\t\t\tif ($trigger_error)\n\t\t\t\t\t\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_STATUS_UNAUTHORIZED',escape_html($url)));\n\t\t\t\t\t\t\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_STATUS_UNAUTHORIZED',escape_html($url));\n\t\t\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\t\t\t$HTTP_DOWNLOAD_MIME_TYPE='security';\n\t\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t\t\tcase '403':\n\t\t\t\t\t\t\t\tif ($trigger_error)\n\t\t\t\t\t\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_STATUS_UNAUTHORIZED',escape_html($url)));\n\t\t\t\t\t\t\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_STATUS_UNAUTHORIZED',escape_html($url));\n\t\t\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\t\t\t$HTTP_DOWNLOAD_MIME_TYPE='security';\n\t\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t\t\tcase '404':\n\t\t\t\t\t\t\t\tif ($trigger_error)\n\t\t\t\t\t\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_STATUS_NOT_FOUND',escape_html($url)));\n\t\t\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t\t\tcase '500':\n\t\t\t\t\t\t\t\tif ($trigger_error)\n\t\t\t\t\t\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_STATUS_SERVER_ERROR',escape_html($url)));\n\t\t\t\t\t\t\t\t@fclose($mysock);\n\t\t\t\t\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif ($trigger_error)\n\t\t\t\t\t\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_STATUS_UNKNOWN',escape_html($url)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($line==\"\\r\\n\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$data_started=true;\n\t\t\t\t\t\t$buffer_unprocessed=substr($old_line,$tally);\n\t\t\t\t\t\tif ($buffer_unprocessed===false) $buffer_unprocessed='';\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// Process any non-chunked extra buffer (chunked would have been handled in main loop)\n\t\tif (!$chunked)\n\t\t{\n\t\t\tif ($buffer_unprocessed!='')\n\t\t\t{\n\t\t\t\tif (is_null($write_to_file)) $input.=$buffer_unprocessed; else fwrite($write_to_file,$buffer_unprocessed);\n\t\t\t\t$input_len+=strlen($buffer_unprocessed);\n\t\t\t\tif ((!is_null($byte_limit)) && ($input_len>=$byte_limit))\n\t\t\t\t{\n\t\t\t\t\t$input=substr($input,0,$byte_limit);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@fclose($mysock);\n\t\tif (!$data_started)\n\t\t{\n\t\t\tif ($byte_limit===0) return '';\n\n\t\t\tif ($trigger_error)\n\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_NO_SERVER',escape_html($url)));\n\t\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_NO_SERVER',escape_html($url));\n\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t$HTTP_MESSAGE='no-data';\n\t\t\treturn NULL;\n\t\t}\n\t\t$size_expected=$HTTP_DOWNLOAD_SIZE;\n\t\tif (!is_null($byte_limit))\n\t\t{\n\t\t\tif ($byte_limit<$HTTP_DOWNLOAD_SIZE)\n\t\t\t\t$size_expected=$byte_limit;\n\t\t}\n\t\tif ($input_len<$size_expected)\n\t\t{\n\t\t\tif ($trigger_error)\n\t\t\t\twarn_exit(do_lang_tempcode('HTTP_DOWNLOAD_CUT_SHORT',escape_html($url),escape_html(integer_format($size_expected)),escape_html(integer_format($input_len))));\n\t\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_CUT_SHORT',escape_html($url),escape_html(integer_format($size_expected)),escape_html(integer_format($input_len)));\n\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t$HTTP_MESSAGE='short-data';\n\t\t\treturn _detect_character_encoding($input);\n\t\t}\n\n\t\t$DOWNLOAD_LEVEL--;\n\n\t\treturn _detect_character_encoding($input);\n\t} else\n\t{\n\t\tif (($errno!=110) && (($errno!=10060) || (@ini_get('default_socket_timeout')=='1')) && (is_null($post_params)))\n\t\t{\n\t\t\t// Perhaps fsockopen is restricted... try fread/file_get_contents\n\t\t\t@ini_set('allow_url_fopen','1');\n\t\t\t$timeout_before=@ini_get('default_socket_timeout');\n\t\t\t@ini_set('default_socket_timeout',strval(intval($timeout)));\n\t\t\tif ((is_null($byte_limit)) && (is_null($write_to_file)))\n\t\t\t{\n\t\t\t\t$read_file=@file_get_contents($url);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$_read_file=@fopen($url,'rb');\n\t\t\t\tif ($_read_file!==false)\n\t\t\t\t{\n\t\t\t\t\t$read_file='';\n\t\t\t\t\twhile ((!feof($_read_file)) && ((is_null($byte_limit)) || (strlen($read_file)<$byte_limit)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$line=fread($_read_file,1024);\n\t\t\t\t\t\tif (is_null($write_to_file)) $read_file.=$line; else fwrite($write_to_file,$line);\n\t\t\t\t\t}\n\t\t\t\t\tfclose($_read_file);\n\t\t\t\t} else $read_file=false;\n\t\t\t}\n\t\t\t@ini_set('allow_url_fopen','0');\n\t\t\t@ini_set('default_socket_timeout',$timeout_before);\n\t\t\tif ($read_file!==false)\n\t\t\t{\n\t\t\t\t$DOWNLOAD_LEVEL--;\n\t\t\t\treturn _detect_character_encoding($read_file);\n\t\t\t}\n\t\t\t$errstr=$php_errormsg;\n\t\t}\n\n\t\tif ($trigger_error)\n\t\t{\n\t\t\tif ($errstr=='') $errstr=strval($errno);\n\t\t\t$error=do_lang_tempcode('_HTTP_DOWNLOAD_NO_SERVER',escape_html($url),escape_html($errstr));\n\t\t\twarn_exit($error);\n\t\t}\n\t\telse $HTTP_MESSAGE_B=do_lang_tempcode('HTTP_DOWNLOAD_NO_SERVER',escape_html($url));\n\t\t$DOWNLOAD_LEVEL--;\n\t\t$HTTP_MESSAGE='could not connect to host ('.$errstr.')';\n\t\treturn NULL;\n\t}\n}", "public static function check_download() {\n\n\t\t// Check the user's capabilities before proceeding\n\t\t$this->check_capabilities();\n\n\t\t$api_params = array(\n\t\t\t'edd_action' => 'check_download',\n\t\t\t'item_name' => urlencode( $_POST['download'] ),\n\t\t);\n\n\t\t// Send our details to the remote server\n\t\t$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t\t// There was no error, we can proceed\n\t\tif ( ! is_wp_error( $request ) ) {\n\n\t\t\t$request = maybe_unserialize( json_decode( wp_remote_retrieve_body( $request ) ) );\n\n\t\t\tif ( 'free' == $request->download ) {\n\t\t\t\t// This is a free download.\n\t\t\t\t$response = 0;\n\t\t\t} else if ( 'chargeable' == $request->download ) {\n\t\t\t\t// This is a chargeable download.\n\t\t\t\t// We'll probably need to ask for a license.\n\t\t\t\t$response = 1;\n\t\t\t} else {\n\t\t\t\t// File does not exist\n\t\t\t\t$response = 'invalid';\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Server was unreacheable\n\t\t\t$response = 'Server error';\n\n\t\t}\n\n\t\tdie( json_encode( $response ) );\n\n\t}", "private function __download_file() {\n\t\t$url = str_replace ( \" \", \"%20\", $this->options ['url'] );\n\t\t\n\t\t$fp = fopen ( $this->file->tmporary_path, \"w\" );\n\t\t$ch = curl_init ( $url );\n\t\t// curl_setopt ( $ch, CURLOPT_NOPROGRESS, true );\n\t\tcurl_setopt ( $ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3' );\n\t\t// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, 0 );\n\t\t// curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');\n\t\t// curl_setopt ( $ch, CURLOPT_PROGRESSFUNCTION, 'curl_progress_callback');\n\t\tcurl_setopt ( $ch, CURLOPT_FILE, $fp );\n\t\t$this->success = curl_exec ( $ch );\n\t\t$this->curl_info = curl_getinfo ( $ch );\n\t\t$this->curl_errors = curl_error ( $ch );\n\t\tcurl_close ( $ch );\n\t\tfclose ( $fp );\n\t\t$this->__set_curl_errors ();\n\t}", "private static function check_downloads_remaining($download)\n {\n }", "function curl_http_header_check($url_input, $useragent_input)\n {\n $ch_m_file_header_check = curl_init($url_input);\n \t\t \n curl_setopt($ch_m_file_header_check, CURLOPT_HEADER, 1); \n curl_setopt($ch_m_file_header_check, CURLOPT_NOBODY, 1); \n //curl_setopt($ch_m_file_header_check, CURLOPT_USERAGENT, $userAgent_m);\n curl_setopt($ch_m_file_header_check, CURLOPT_USERAGENT, $useragent_input);\n curl_setopt($ch_m_file_header_check, CURLOPT_FOLLOWLOCATION, true);\n \t curl_setopt($ch_m_file_header_check, CURLOPT_MAXREDIRS, 10);\n \t curl_setopt($ch_m_file_header_check, CURLOPT_AUTOREFERER, true);\n \t curl_setopt($ch_m_file_header_check, CURLOPT_RETURNTRANSFER, 1);\n \t curl_setopt($ch_m_file_header_check,CURLOPT_CONNECTTIMEOUT,60);\n \t curl_setopt($ch_m_file_header_check, CURLOPT_FAILONERROR, 1); \n $execute_m_file = curl_exec($ch_m_file_header_check);\n \n \n \n \t\n \t\n \tif(!curl_errno($ch_m_file_header_check))\n \t{\n \t\t\n \t\t $status_m_file = curl_getinfo($ch_m_file_header_check, CURLINFO_HTTP_CODE);\n \t\t$bytes_m_file = curl_getinfo($ch_m_file_header_check, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\t\t\n \t\t$url1_file_size_m = byte_convert($bytes_m_file);\n \t\t$average_download_speed1 = curl_getinfo($ch_m_file_header_check, CURLINFO_SPEED_DOWNLOAD);\n \t\t$average_download_speed_converted1 = byte_convert($average_download_speed1);\n \t\t$total_time = curl_getinfo($ch_m_file_header_check, CURLINFO_TOTAL_TIME);\n \t\t\n \t\t\t\t\n \t}\n \t\n \n \t/* if ( $status_m_file == '200')\n \t \n \t{\n \t\t echo \"The html file is in place and the company url succeeded to stay verified\";\n \n }*/ \n clearstatcache();\n\t\n curl_close($ch_m_file_header_check);\n return $status_m_file; \n }", "function isDownloadable();", "function DownloadAlt($url)\n\t\t{\n\t\t\t$curl = curl_init();\n\t\t\t// First, get the content-length...\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, true); // header will be at output\n\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request\n\t\t\tcurl_setopt($curl, CURLOPT_NOBODY, true );\n\t\t\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n\t\t\tcurl_setopt($curl, CURLOPT_MAXREDIRS, $this->m_RedirectLimit);\n\t\t\t$Headers = curl_exec($curl);\n\t\t\t$ContentLength = curl_getinfo($curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\n\t\t\t$HttpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n\t\t\tif( $HttpCode != 200 )\n\t\t\t{\n\t\t\t\tswitch( $HttpCode )\n\t\t\t\t{\n\t\t\t\t\tcase 301:\n\t\t\t\t\tcase 302:\n\t\t\t\t\tcase 307: {\n\t\t\t\t\t\t$this->SetError( 'Download exceeded redirect limit of '.$this->m_RedirectLimit .'.' );\n\t\t\t\t\t}; break;\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\t$this->SetError( 'HTTP error '. $HttpCode .'.' );\n\t\t\t\t\t}; break;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Next get the first chunk of the file...\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, false); // header will be at output\n\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET'); // HTTP request\n\t\t\tcurl_setopt($curl, CURLOPT_NOBODY, false );\n\t\t\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n\t\t\tcurl_setopt($curl, CURLOPT_MAXREDIRS, $this->m_RedirectLimit);\n\t\t\tcurl_setopt($curl, CURLOPT_RANGE, \"0-{$this->m_DownloadBytesLimit}\");\n\t\t\t$Content = curl_exec($curl);\n\t\t\tcurl_close($curl);\n\n\t\t\tif( $Content )\n\t\t\t{\n\t\t\t\tglobal $TempFile;\n\t\t\t\tif( function_exists('get_temp_dir') ) // If wordpress function is available, lets use it\n\t\t\t\t\t$TempFile = tempnam(get_temp_dir(), 'wp_powerpress');\n\t\t\t\telse // otherwise use the default path\n\t\t\t\t\t$TempFile = tempnam('/tmp', 'wp_powerpress');\n\n\t\t\t\tif( $TempFile === false )\n\t\t\t\t{\n\t\t\t\t\t$this->SetError('Unable to save media information to temporary directory.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$fp = fopen( $TempFile, 'w' );\n\t\t\t\tfwrite($fp, $Content);\n\t\t\t\tfclose($fp);\n\n\t\t\t\tif( $ContentLength )\n\t\t\t\t\t$this->m_ContentLength = $ContentLength;\n\t\t\t\treturn $TempFile;\n\t\t\t}\n\n\t\t\t$this->SetError('Unable to download media.');\n\t\t\treturn false;\n\t\t}", "function instant_download($product_id) {\n\t //echo \"PICKIT:\",$file; \n \n\t switch ($this->type) {\n\t\t\t\t\n case 'fullversion' :\n\t\t $file = paramload('SHELL','prpath') . \n\t\t\t\t\t\t\t paramload('RCPICKIT','dirsource') . \n\t\t\t\t\t\t\t\t\t $product_id . \n\t\t\t\t\t\t\t\t\t paramload('RCPICKIT','filetype');\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t \n\t case 'shareware' : $file = paramload('SHELL','prpath') . \n\t\t\t\t\t\t\t paramload('RCDOWNLOAD','dirsource') . \n\t\t\t\t\t\t\t\t \t $product_id . \n\t\t\t\t\t\t\t\t\t paramload('RCDOWNLOAD','filetype');\n\t\t\t\t\t\t\t break;\n\t }\t \n\n $downloadfile = new DOWNLOADFILE($file);\n\t \n //$this->tell_by_mail(\n\t GetGlobal('controller')->calldpc_method(\"rcdownload.tell_by_mail use \" .\n\t $this->type . \" file downloaded\".\"+\".\n\t 'support@re-coding.com'.\"+\".\n\t\t 'billy@re-coding.com'.\"+\".\n\t\t\t\t\t\t $file);\t \t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n $ret = $this->error;\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t \n\t return ($ret);\n }", "function get_download_filename($ref,$size,$alternative,$ext)\n {\n # Constructs a filename for download\n global $original_filenames_when_downloading,$download_filenames_without_size,$download_id_only_with_size,\n $download_filename_id_only,$download_filename_field,$prefix_resource_id_to_filename,$filename_field,\n $prefix_filename_string, $filename,$server_charset;\n \n $filename = (($download_filenames_without_size || $size == \"\") ? \"\" : \"_\" . $size . \"\") . ($alternative>0 ? \"_\" . $alternative : \"\") . \".\" . $ext;\n \n if ($original_filenames_when_downloading)\n {\n # Use the original filename.\n if ($alternative>0)\n {\n # Fetch from the resource_alt_files alternatives table (this is an alternative file)\n $origfile=get_alternative_file($ref,$alternative);\n $origfile=$origfile[\"file_name\"];\n }\n else\n {\n # Fetch from field data or standard table \n $origfile=get_data_by_field($ref,$filename_field); \n }\n if (strlen($origfile)>0)\n {\n # do an extra check to see if the original filename might have uppercase extension that can be preserved. \n $pathparts=pathinfo($origfile);\n if (isset($pathparts['extension'])){\n if (strtolower($pathparts['extension'])==$ext){$ext=$pathparts['extension'];} \n } \n \n # Use the original filename if one has been set.\n # Strip any path information (e.g. if the staticsync.php is used).\n # append preview size to base name if not the original\n if($size != '' && !$download_filenames_without_size)\n {\n $filename = strip_extension(mb_basename($origfile),true) . '-' . $size . '.' . $ext;\n }\n else\n {\n $filename = strip_extension(mb_basename($origfile),true) . '.' . $ext;\n }\n }\n }\n\n elseif ($download_filename_id_only)\n {\n if(!hook('customdownloadidonly', '', array($ref, $ext, $alternative)))\n {\n $filename=$ref . \".\" . $ext;\n\n if($size != '' && $download_id_only_with_size)\n {\n $filename = $ref . '-' . $size . '.' . $ext;\n } \n }\n }\n \n elseif (isset($download_filename_field))\n {\n $newfilename=get_data_by_field($ref,$download_filename_field);\n if ($newfilename)\n {\n $filename = trim(nl2br(strip_tags($newfilename)));\n if($size != \"\" && !$download_filenames_without_size)\n {\n $filename = strip_extension(mb_basename(substr($filename, 0, 200)),true) . '-' . $size . '.' . $ext;\n }\n else\n {\n $filename = strip_extension(mb_basename(substr($filename, 0, 200)),true) . '.' . $ext;\n }\n }\n }\n\n if($prefix_resource_id_to_filename)\n {\n $filename = $ref . (substr($filename,0,1) == \".\" ? \"\" : '_') . $filename;\n }\n \n if(isset($prefix_filename_string) && trim($prefix_filename_string) != '')\n {\n $filename = $prefix_filename_string . $filename;\n }\n\n # Remove critical characters from filename\n $altfilename=hook(\"downloadfilenamealt\");\n if(!($altfilename)) $filename = preg_replace('/:/', '_', $filename);\n else $filename=$altfilename;\n\n # Convert $filename to the charset used on the server.\n if (!isset($server_charset)) {$to_charset = 'UTF-8';}\n else\n {\n if ($server_charset!=\"\") {$to_charset = $server_charset;}\n else {$to_charset = 'UTF-8';}\n }\n $filename = mb_convert_encoding($filename, $to_charset, 'UTF-8');\n\n hook(\"downloadfilename\");\n return $filename;\n }", "protected function downloadIfNeeded()\r\n {\r\n if(!file_exists($this->downloadedFileLocation) || $this->isOutdated())\r\n {\r\n $this->downloadFile();\r\n }\r\n //else the file exists - do nothing.\r\n }", "public function downloadFileOld()\r\n {\r\n $this->log->m_log('Create folder: ' . FOLDER_DEFAULT . \"/\" . $this->folder . \"/\" . $this->id);\r\n if (!file_exists(FOLDER_DEFAULT . \"/\" . $this->folder . \"/\" . $this->id)) {\r\n mkdir(FOLDER_DEFAULT . \"/\" . $this->folder . \"/\" . $this->id, 0777, true);\r\n $this->log->m_log('Create folder success: ' . FOLDER_DEFAULT . \"/\" . $this->folder . \"/\" . $this->id);\r\n }\r\n \r\n $downloadedFile = fopen($this->target, 'rb');\r\n if (!$downloadedFile) {\r\n $this->log->m_log('Error download file from url : ' . $this->target);\r\n return false;\r\n }\r\n $this->localfile = FOLDER_DEFAULT . \"/\" . $this->folder . \"/\" . $this->id . '/' . basename($this->target);\r\n $lFile = fopen($this->localfile, 'wb');\r\n if (!$lFile) {\r\n $this->log->m_log('Error open localfile : ' . $this->localfile);\r\n fclose($downloadedFile);\r\n return false;\r\n }\r\n \r\n while ($buffer = fread($downloadedFile, $this->buffer)) {\r\n fwrite($lFile, $buffer);\r\n }\r\n \r\n fclose($lFile);\r\n $this->log->m_log('localfile close success');\r\n fclose($downloadedFile);\r\n $this->log->m_log('targetUrlFile close success');\r\n \r\n return true;\r\n }", "function validate_wget($errmsg, &$page_path) {\n\n //errlog(\"validate_wget(): \\$errmsg is \" . strlen($errmsg) . \" chars long.\\n\");\n\n $wget_messages = array('Read error','Scheme missing','ERROR 404');\n $patterns_flattened = implode('|', $wget_messages);\n\n if ( preg_match('/('. $patterns_flattened .')/', $errmsg, $matches) === true)\n {\n errlog(\"Read error, Scheme missing or 404, aborting.\\n\");\n return false;\n }\n\n $wget_messages = array(\".*Saving to: ‘(.*)’\",\".*File ‘(.*)’ already there\");\n $patterns_flattened = implode('|', $wget_messages);\n\n if ( preg_match('/('. $patterns_flattened .')/', $errmsg, $matches) )\n {\n $page_path = $matches[2];\n errlog(\"Download Message from WGet:\\n$matches[0]: \" . $matches[0] . \"\\n\");\n return true;\n } else {\n errlog(\"validate_wget(): WGet returned no filename.\\n\\$errmsg: \" . $errmsg . \"\\n\");\n return false;\n }\n }", "function source_collecting($url){\n\t// FIRST PART \n\t// If the URL is marked in \"pickup_list\", the program exit.\n\t// check the URL in \"pickup_list.txt\"\n\t// Mark up chceck : Before collecting the source, you should check up the url if it is already collected.\t\n\t$mark_up = \"\"; \t\t\t\t\t\t\t\t// for each URL marked in \"pickup_list.txt\".\n\t$mark_ups = file_get_contents(\"../s_collecting_p/pickup_list.txt\");\n\t$count = 0; \t\t\t\t\t\t\t\t// for file length.\n\t$delimiter = \"\"; \t\t\t\t\t\t\t// for checking if the character is \",\"\n\twhile ($count != strlen($mark_ups)) {\n\t\t$delimiter = substr($mark_ups, $count, 1);\n\t\tif ($delimiter == \",\") {\n\t\t\tif ($url == $mark_up) {\n\t\t\t\techo \"The URL already exist..\";\n\t\t\t\techo \"The program stopped normally\";\n\t\t\t\texit(0);\n\t\t\t}\n\t\t\t$mark_up = \"\";\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t$mark_up .= $delimiter;\n\t\t}\n\t\t$count++;\n\t}\t\n\n\t// SECOND PART\n\t//if not the URL marked, it registers the URL in \"pickup_list.txt\" and collect the contents.\n\t$source = file_get_contents($url);\n\t\n\tif($source){\n\t\t//mark up the URL into the \"pickup_list.txt\" file adding it.\n\t\t$pick_up = fopen(\"../s_collecting_p/pickup_list.txt\", \"a\");\n\t\tfputs($pick_up, $url.\",\");\n\t\tfclose($pick_up);\n\t\techo \"A new URL marked into pickup_list.txt : \".$url.\" ; \";\n\n\t\t// Collect the contents in a new file.\n\t\t$time = time();\n\t\tfile_put_contents(\"../s_collecting_p/guten/web\".$time.\".txt\", $source);\n\t\techo $url.\" : is collected\";\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves list of expense types.
public static function GetExpenseTypes( $params = array() ) { $default_params = array( 'fct' => "getexpensetypes", 'expensetypeid' => null, 'sortorder' => null, ); $params = array_merge( $default_params, $params ); return self::sendRequestAndGetObject( $params ); }
[ "function getKmExpenseTypes()\n {\n /** @todo Move the javascript registration to an interface related function. */\n // Register the km_displayfield javascript\n $page = &atkpage::getInstance();\n $page->register_script(moduleDir(\"billing\") . \"javascript/km_displayfield.js\");\n\n // Get all KM expense types\n $expenseTypeNode = &getNode(\"billing.expensetype\");\n $results = $expenseTypeNode->selectDb(\"`billing_expensetype`.`km_specification`='1'\",\"\",\"\",\"\",array('id'));\n\n // Return the KM expensetypes\n return $results;\n }", "function getExpenseTypes($con)\n\t{\n\t\t$sql_etypes = \"SELECT etypeID, etypeName FROM expensetypes\";\n\t\t$stmt_etypes = sqlsrv_query($con, $sql_etypes);\n\t\t\n\t\t$list_etypes = \"\";\n\t\twhile($rowTypes = sqlsrv_fetch_array($stmt_etypes))\n\t\t{\n\t\t\t$etypeID = $rowTypes['etypeID'];\n\t\t\t$etypeName = $rowTypes['etypeName'];\n\t\t\t$list_etypes .= \"<option value='$etypeID'>$etypeName</option>\";\n\t\t}\n\n\t\treturn $list_etypes;\n\t}", "public function priceTypesList()\n {\n return $this->client->makeRequest(\n '/reference/price-types',\n RetailcrmHttpClient::METHOD_GET\n );\n }", "public function get_expense_types() {\n\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$id = $this->uri->segment(4);\n\t\t\n\t\t$data = array(\n\t\t\t'company_id' => $id\n\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view(\"admin/accounting/get_expense_types\", $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t\t// Datatables Variables\n\t\t$draw = intval($this->input->get(\"draw\"));\n\t\t$start = intval($this->input->get(\"start\"));\n\t\t$length = intval($this->input->get(\"length\"));\n\t }", "function get_all_expenseType()\n {\n $this->db->order_by('id', 'asc');\n return $this->db->get('acc_expense_types')->result_array();\n }", "public function loadExpenseType() {\n\t\t$idExpenseType = $_REQUEST['id'];\t\t\t\t\n\t\t$expenseTypeVO = new ExpenseTypeVO();\n\t\t$expenseTypeVO->setID_EXPENSE_TYPE ($idExpenseType);\n\t\t$expenseTypeBO = ExpenseTypeBOImpl::getInstance();\n\t\t$newExpenseTypeVO = $expenseTypeBO->findById ($expenseTypeVO);\n\t\techo $newExpenseTypeVO->getID_EXPENSE_TYPE () \n\t\t\t . \",\" . $newExpenseTypeVO->getNM_EXPENSE_TYPE();\n\t}", "public function getExpenseLines()\n\t{\n\t\treturn $this->getList('ExpenseLine');\n\t}", "public function expenseList(Request $request)\n {\n $start = $request->start_date;\n $end = $request->end_date;\n \n $data = Expense::query()\n ->where('branch_id', '=', auth()->user()->branch->branch_id)\n ->whereBetween('created_at', [$request->start_date, $request->end_date])\n ->orderBy('id','DESC')\n ->paginate(20);\n return Helper::response_with_data($data, false);\n }", "public function getEmotionTypeList()\n {\n $emotionTypes = $this->getList('emotion_types', 'all');\n return $emotionTypes;\n }", "static function getPredefinedExpenses() {\n global $user;\n $mdb2 = getConnection();\n\n $group_id = $user->getGroup();\n $org_id = $user->org_id;\n\n $result = array();\n $sql = \"select id, name, cost from tt_predefined_expenses\".\n \" where group_id = $group_id and org_id = $org_id\";\n $res = $mdb2->query($sql);\n $result = array();\n if (!is_a($res, 'PEAR_Error')) {\n $decimal_mark = $user->getDecimalMark();\n $replaceDecimalMark = ('.' != $decimal_mark);\n\n while ($val = $res->fetchRow()) {\n if ($replaceDecimalMark)\n $val['cost'] = str_replace('.', $decimal_mark, $val['cost']);\n $result[] = $val;\n }\n return $result;\n }\n return false;\n }", "public function get_company_expense_types() {\n\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$id = $this->uri->segment(4);\n\t\t\n\t\t$data = array(\n\t\t\t'company_id' => $id\n\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view(\"admin/accounting/get_company_expense_types\", $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t\t// Datatables Variables\n\t\t$draw = intval($this->input->get(\"draw\"));\n\t\t$start = intval($this->input->get(\"start\"));\n\t\t$length = intval($this->input->get(\"length\"));\n\t }", "public function getExpenses() {\n\n $expenses = Expense::where('user_id',Auth::user()->id)\n ->whereBetween('created_at', [Carbon::now()->startOfWeek(),Carbon::now()->endOfWeek()])\n ->where('expenses_entry_id', 0)\n ->get();\n return expenseResult::collection($expenses);\n\n }", "public function getOffenses() {\n\t\t$client = $this->guzzleClient ? $this->guzzleClient : new GuzzleClient();\n\t\t$request = $client->get('siem/offenses', array('Accept' => 'application/json'));\n\t\t$response = $request->send();\n\t\t$response_objects = $response->json();\t\t\n\t\t$offense_instances = array();\n\t\tforeach ($response_objects as $o) {\n\t\t\t$class = \"QRadar\\\\Model\\\\Offense\";\n\t\t\t$offense = new $class($o);\n\t\t\tarray_push($offense_instances, $offense);\n\t\t}\n\t\treturn $offense_instances;\n\t}", "public static function incomeExpense(): array\n {\n $orders = BusinessOrdersGetter :: get();\n\n return IncomeExpenseAnalyser :: analyse( $orders );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeExps = $em->getRepository('AppBundle:TypeExp')->findAll();\n\n return $this->render('typeexp/index.html.twig', array(\n 'typeExps' => $typeExps,\n ));\n }", "public function get_expense_type(){\n\t\treturn ($this->request->query['type'] == 'draft' ? 'Draft Expense' : ($this->request->query['type'] == 'discrepancy' ? 'Discrepancy' : 'My Expense'));\n\t\t\t\n\t}", "public function expenses()\n {\n return $this->hasMany(Expense::class);\n }", "public static function getExpenses()\n {\n if (Cache::has('expenses_' . auth()->id())) {\n $expenseRecords = Cache::get('expenses_' . auth()->id());\n } else {\n $expenseRecords = self::where('wallet_id', auth()->user()->wallet->id)->get();\n self::cacheAllExpenses($expenseRecords);\n }\n return $expenseRecords;\n }", "public function discount_types_list ()\n {\n return DB::table(Config::get('tables.DISCOUNT_TYPE_LOOKUPS'))\n ->where('status', Config::get('constants.ACTIVE'))\n ->orderby('discount_type', 'ASC')\n ->select('discount_type_id', 'discount_type')\n ->get();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created DevSensor in storage.
public function store(CreateDevSensorRequest $request) { $input = app('common')->RegionRepo()->attachReginNameByInputId($request->all()); $devSensor = $this->devSensorRepository->create($input); Flash::success('添加传感器成功.'); return redirect(route('devSensors.index')); }
[ "public function store(CreateDevElectricityMeterRequest $request)\n {\n $input = app('common')->RegionRepo()->attachReginNameByInputId($request->all());\n\n $devElectricityMeter = $this->devElectricityMeterRepository->create($input);\n\n Flash::success('添加成功.');\n\n return redirect(route('devElectricityMeters.index'));\n }", "public function create($data) {\n\t\t$this->assureAllowed('create');\n // Validation\n V::objectType()\n ->attribute('name', V::alnum('_-.')->length(1, 50))\n ->attribute('location', V::stringType()->length(0, 255))\n ->attribute('division', V::intVal())\n ->attribute('server_endpoint_mode', V::intVal()->between(0, 1))\n ->attribute('network_ip_mode', V::intVal()->between(0, 1))\n ->attribute('network_mac_mode', V::intVal()->between(0, 1))\n ->attribute('proxy_mode', V::intVal()->between(0, 1))\n ->check($data);\n // Persistence\n\t\t$em = $this->getEntityManager();\n $division = $em->getRepository('HoneySens\\app\\models\\entities\\Division')->find($data->division);\n V::objectType()->check($division);\n\t\t$defaultconfig = $em->getRepository('HoneySens\\app\\models\\entities\\SensorConfig')->find(1);\n V::objectType()->check($defaultconfig);\n\t\t$sensor = new Sensor();\n\t\t$sensor->setName($data->name)\n\t\t\t->setLocation($data->location)\n ->setDivision($division)\n ->setServerEndpointMode($data->server_endpoint_mode)\n ->setNetworkIPMode($data->network_ip_mode)\n ->setNetworkMACMode($data->network_mac_mode)\n ->setProxyMode($data->proxy_mode);\n // Validate and persist additional attributes depending on the previous ones\n if($sensor->getServerEndpointMode() == Sensor::SERVER_ENDPOINT_MODE_CUSTOM) {\n V::attribute('server_endpoint_host', V::stringType()->ip())\n ->attribute('server_endpoint_port_https', V::intVal()->between(0, 65535))\n ->check($data);\n $sensor->setServerEndpointHost($data->server_endpoint_host)\n ->setServerEndpointPortHTTPS($data->server_endpoint_port_https);\n }\n if($sensor->getNetworkIPMode() == Sensor::NETWORK_IP_MODE_STATIC) {\n V::attribute('network_ip_address', V::stringType()->ip())\n ->attribute('network_ip_netmask', V::stringType()->ip())\n ->attribute('network_ip_gateway', V::optional(V::stringType()->ip()))\n ->attribute('network_ip_dns', V::optional(V::stringType()->ip()))\n ->check($data);\n $sensor->setNetworkIPAddress($data->network_ip_address)\n ->setNetworkIPNetmask($data->network_ip_netmask)\n ->setNetworkIPGateway($data->network_ip_gateway)\n ->setNetworkIPDNS($data->network_ip_dns);\n }\n if($sensor->getNetworkMACMode() == Sensor::NETWORK_MAC_MODE_CUSTOM) {\n V::attribute('network_mac_address', V::stringType()->macAddress())\n ->check($data);\n $sensor->setNetworkMACAddress($data->network_mac_address);\n }\n if($sensor->getProxyMode() == Sensor::PROXY_MODE_ENABLED) {\n V::attribute('proxy_host', V::stringType())\n ->attribute('proxy_port', V::intVal()->between(0, 65535))\n ->attribute('proxy_user', V::stringType())\n ->check($data);\n $sensor->setProxyHost($data->proxy_host)\n ->setProxyPort($data->proxy_port)\n ->setProxyUser($data->proxy_user);\n // Only update the password if it was provided by the client,\n // otherwise keep the existing one.\n if(V::attribute('proxy_password', V::stringType())->validate($data)) {\n $sensor->setProxyPassword($data->proxy_password);\n }\n // Also reset the password in case no user was provided\n if($data->proxy_user == null) {\n $sensor->setProxyPassword('');\n }\n }\n\t\t$defaultconfig->addSensor($sensor);\n $em->persist($sensor);\n // Flush early, because we need the sensor ID for the cert common name\n $em->flush();\n // Create sensor certificate\n $privkey = null;\n $config = array('config' => APPLICATION_PATH . '/../data/CA/openssl.cnf');\n $cacert = 'file://' . APPLICATION_PATH . '/../data/CA/cacert.pem';\n $cakey = array('file://' . APPLICATION_PATH . '/../data/CA/cakey.pem', 'asdf');\n $dn = array(\n 'countryName' => 'DE',\n 'stateOrProvinceName' => 'Saxony',\n 'localityName' => 'Dresden',\n 'organizationName' => 'TUD',\n 'organizationalUnitName' => 'Faculty of CS',\n 'emailAddress' => 'pascal.brueckner@mailbox.tu-dresden.de',\n 'commonName' => $sensor->getHostname()\n );\n $privkey = openssl_pkey_new($config);\n $csr = openssl_csr_new($dn, $privkey, $config);\n $usercert = openssl_csr_sign($csr, $cacert, $cakey, 365, $config);\n openssl_x509_export($usercert, $certout);\n openssl_pkey_export($privkey, $pkeyout);\n $cert = new SSLCert();\n $cert->setContent($certout);\n $cert->setKey($pkeyout);\n // TODO Seriously? One of those should be sufficient...\n $sensor->setCert($cert);\n $cert->setSensor($sensor);\n $em->persist($cert);\n\t\t// Generate initial config\n $this->getBeanstalkService()->putSensorConfigCreationJob($sensor, $em);\n $sensor->setConfigArchiveStatus(Sensor::CONFIG_ARCHIVE_STATUS_SCHEDULED);\n\t\t$em->flush();\n\t\treturn $sensor;\n\t}", "public function store()\n {\n $this->createIfNotExist();\n\n $points = [];\n\n foreach ($this->dataPoints as $dataPoint) {\n $points[] =\n new Point(\n $dataPoint->getMeasurement(),\n $dataPoint->getValue(),\n [\n 'area' => $dataPoint->getArea(),\n 'zone' => $dataPoint->getZone(),\n 'account_id' => $dataPoint->getAccountId(),\n 'sensor_node' => $dataPoint->getSensornodeId()\n ],\n [\n 'crop' => $dataPoint->getcrop(),\n ],\n $dataPoint->getTimestamp()\n );\n }\n return InfluxDB::writePoints($points, \\InfluxDB\\Database::PRECISION_SECONDS);\n }", "public function saveMagnetometer()\n {\n $time = $this->getTimestamp();\n $value = $this->getValue();\n $temp = $this->getTemp();\n $db = Connector::getInstance();\n\n $stmt = $db->prepare('INSERT INTO magneto_meter (timestamp, value, temp) VALUES (:time, :value, :temp)');\n $stmt->bindParam(':time', $time);\n $stmt->bindParam(':value', $value);\n $stmt->bindParam(':temp', $temp);\n $stmt->execute();\n }", "public function save()\n {\n $db = Database::getInstance();\n\n if (!$this->id) {\n // This device is new.\n $db->query(\n (\"INSERT INTO {waa_device} (deviceuuid, platform, type, name, os, osversion, dtmcreated, dtmmodified) \"\n . \"VALUES (:uuid, :platform, :type, :name, :os, :osversion, :dtmcreated, :dtmmodified)\"),\n array(\n ':uuid' => $this->deviceuuid,\n ':platform' => $this->platform,\n ':type' => $this->type,\n ':name' => $this->name,\n ':os' => $this->os,\n ':osversion' => $this->osVersion,\n ':dtmcreated' => $this->created,\n ':dtmmodified' => $this->modified,\n \n )\n );\n $this->id = $db->insertedId();\n\n } else {\n \t// Question: Does an update make sense for a device?\n \t// Yes it does. We can modify the OS and the OS version.\n \t// This has not yet been implemented\n \n \t\t\t$this->modified = time();\n // Update existing device\n $db->query(\n (\"UPDATE {waa_device} SET os = :os, osversion = :osversion, \"\n . \"dtmmodified = :dtmmodified\"),\n array(\n ':os' => $this->os,\n ':osversion' => $this->osVersion,\n ':dtmmodified' => $this->modified,\n )\n );\n }\n }", "function createSensor()\n\t{\n\t\t# Here we initialize the sensor with some values.\n\t\t# Initialize the sensor with your own logic.\n\t\t$sensor = new Sensor(\"Station 1\", 10, 15, date(\"Y-m-d H:i:s\"));\n\t\t\n\t\t# This is to make sure that the sensor has been sent successfully.\n\t\t# You can use your own logic to do this.\n\t\t$done = false;\n\t\t\n\t\twhile ($done == false)\n\t\t{\n\t\t\t$done = sendData($sensor);\n\t\t}\n\t}", "private function saveData()\n {\n $this->storageAdapter->save($this->serviceName, json_encode($this->toArray()));\n }", "private function SyncSensors() {\n $HomePilotSensorCategory = $this->GetHomePilotSensorCategory();\n if(@$HomePilotSensorCategory > 0) {\n $sensors = $this->Request('meters=1');\n\t \n\t \t \n if ($sensors) {\n foreach ($sensors as $sId => $sensor) {\n\n\t\t $uniqueId = $sensor->did;\n\t\t\t\n $name = utf8_decode((string)$sensor->name);\n $sensorId = $this->GetDeviceByUniqueId($uniqueId);\n\n if ($sensorId == 0) {\n $sensorId = IPS_CreateInstance($this->SensorGuid());\n IPS_SetProperty($sensorId, 'UniqueId', $uniqueId);\n\t\t\tIPS_LogMessage(\"HPBridge\",\"Sensor create new ($name:$uniqueId)\");\n }\n\n IPS_SetParent($sensorId, $HomePilotSensorCategory);\n IPS_SetName($sensorId, $name);\n\n\n // Verbinde Knoten mit Bridge\n if (IPS_GetInstance($sensorId)['ConnectionID'] <> $this->InstanceID) {\n @IPS_DisconnectInstance($sensorId);\n IPS_ConnectInstance($sensorId, $this->InstanceID);\n }\n\t\t \n IPS_ApplyChanges($sensorId);\n\t\t \n\t\t $dataRequest = \"meter=$uniqueId\";\n\t\t \n\t\t // nun noch die Daten abfragen\n\t\t $data = $this->Request($dataRequest );\n\t\t \n\t\t if( $data ) {\n\t\t\t // Ergänze Daten\n\t\t\t $sensor->data = $data;\n\t\t }\n\n\t\t \n\t\t // Daten zuordnen, Variablen anlegen\n\t\t HPSensor_ApplyJsonData($sensorId, json_encode($sensor));\n }\n }\n\t \n } else {\n echo 'Sensoren konnten nicht syncronisiert werden, da die Sensorkategorie nicht zugewiesen wurde.';\n IPS_LogMessage('SymconHP', 'Sensoren konnten nicht syncronisiert werden, da die Sensorenkategorie nicht zugewiesen wurde.');\n }\n return true;\n }", "public function createSensor( $name, $displayName, $deviceType, $pagerType, $dataType, $dataStructure)\n {\n\t\t$data = $this->call(array(\"sensor\"=>array(\"name\"=>$name, \"display_name\"=>$displayName, \"device_type\"=>$deviceType, \"pager_type\"=>$pagerType, \"data_type\"=>$dataType, \"data_structure\"=>$dataStructure)), \"POST\", \"sensors.json\");\n\t\treturn $data;\n }", "public function createStorage();", "public function save(ElectricReading $electricReading);", "public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}", "public function record_sensor($name, $status, $value)\r\n\t{\r\n\t\t$sID = ltrim($name, \"Sensor \");\r\n\t\t\r\n\t\t$sql = \"INSERT INTO sensors (sID, sStatus, sValue) VALUES ($sID, \\\"$status\\\", $value )\";\r\n\t\t$this->tbl_insert($sql);\r\n\t}", "public static function addSensor($sensor) {\r\n\t\t$query = \"INSERT INTO Sensors (dataset_id, sensor_name, sensor_type, sensor_units,\r\n\t\t\t\tsequence_type, description) VALUES (:dataset_id, :sensor_name, :sensor_type,\r\n\t\t\t\t:sensor_units, :sequence_type, :description)\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (is_null($sensor) || $sensor->getErrorCount() > 0)\r\n\t\t\t\treturn $sensor;\r\n\t\t\t\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->bindValue(':dataset_id', $sensor->getDatasetId());\r\n\t\t\t$statement->bindValue(':sensor_name', $sensor->getSensorName());\r\n\t\t\t$statement->bindValue(':sensor_type', $sensor->getSensorType());\r\n\t\t\t$statement->bindValue(':sensor_units', $sensor->getSensorUnits());\r\n\t\t\t$statement->bindValue(':sequence_type', $sensor->getSequenceType());\r\n\t\t\t$statement->bindValue(':description', $sensor->getDescription());\r\n\t\t\t$statement->execute();\r\n\t\t\t$statement->closeCursor();\r\n\t\t\t\r\n\t\t\t$newSensorId = $db->lastInsertId('sensor_id');\r\n\t\t\t$sensor->setSensorId($newSensorId);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$sensor->setError('sensor_id', 'SENSOR_INVALID');\r\n\t\t}\r\n\t\t\r\n\t\treturn $sensor;\r\n\t}", "public function apiStore(Request $request){\n Consultas::guardarInflux($request->data, $request->equipo, $request->sensor);\n\n event(new sensorEvent($request->all()));\n }", "private function store()\n {\n $settings = [];\n foreach ($this->settings as $key => $value) {\n $settings[$key] = serialize($value);\n }\n $this->files->put($this->filepath, json_encode($settings));\n }", "public function save(){\n if($data = $this->validateInput()){\n $device = new Device();\n $device->setName($data['name']);\n $device->setIP($data['ip']);\n $device->setSubnet($data['subnet']);\n $device->setMAC(strtoupper($data['mac']));\n $device->create();\n $this->setSuccess('Device successfully added!');\n }else{\n $this->setError('Error while creating new device');\n }\n\n header('Location: /devices');\n }", "public function store(CreateDeviceRequest $request)\n {\n $input = $request->all();\n\t $input['date_inventory'] = Carbon::createFromFormat('d/m/Y',$input['date_inventory']);\n\t $input['date_guarantee_end'] = Carbon::createFromFormat('d/m/Y',$input['date_guarantee_end']);\n\t $input['date_buy'] = Carbon::createFromFormat('d/m/Y',$input['date_buy']);\n\n $device = $this->deviceRepository->create($input);\n\n Flash::success('Device saved successfully.');\n\n return redirect(route('devices.index'));\n }", "public function store(CreateDeviceRequest $request)\n {\n $input = $request->all();\n if (!empty($input['image'])) {\n $imageName = time().'.'.transText($request->image->getClientOriginalName(),'-');\n $request->image->move(public_path('uploads/devices'), $imageName);\n $request->image = $imageName;\n $input['image'] = '/uploads/devices/'.$imageName;\n }\n $device = $this->deviceRepository->create($input);\n\n Flash::success(__('messages.device_add_successfully'));\n if($input['save']==='save_edit'){\n return redirect(route('admin.devices.edit', $device->id));\n }\n elseif ($input['save']==='save_new'){\n return redirect(route('admin.devices.create'));\n }\n else{\n return redirect(route('admin.devices.index'));\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms a string (list) to an object collection (tags).
public function reverseTransform($list) { if (!$list) { return array(); } $tags = array(); foreach(explode(",", $list) as $item) { $tagName = trim($item); $tag = $this->om ->getRepository('IDCISimpleMediaBundle:Tag') ->findOneBy(array('name' => $tagName)) ; if(!$tag) { $tag = new Tag($tagName); } $tags[] = $tag; } return $tags; }
[ "function transformToTagList($list){\n $newTags = array();\n foreach($list as $item){\n $tagFr = isset($item->tagFr) ? $item->tagFr : \"\";\n $tagEn = isset($item->tagEn) ? $item->tagEn : \"\";\n $tag = new Tag($item->id, $tagFr, $tagEn);\n array_push($newTags, $tag);\n }\n return $newTags;\n}", "function make_tag_list($array) {\n\t$tags = array();\n\tforeach ($array as $item) {\n\t\tforeach ($item[\"tags\"] as $tag) {\n\t\t\t$tags[] = trim($tag);\n\t\t}\n\t}\n\treturn $tags;\n}", "public function reverseTransform($value): array\n {\n $tagNames = explode(',', $value);\n\n $listTags = [];\n\n foreach ($tagNames as $tagName) {\n if ('' !== trim($tagName)) {\n $listTag = $this->repository->findOneByName(strtolower($tagName));\n if (null == $listTag) {\n $listTag = new ListTag();\n $listTag->setName($tagName);\n $this->repository->save($listTag);\n }\n $listTags[] = $listTag;\n }\n }\n\n return $listTags;\n }", "public function testFromStrings()\n {\n $result = Tag::fromStrings([\"Test\", \"Hammock\"]);\n\n // check it's a Collection\n $this->assertInstanceOf(Collection::class, $result);\n\n // check the first item is \"Test\"\n $this->assertSame(\"Test\", $result->get(0)->name);\n\n // check the second item is \"Hammock\"\n $this->assertSame(\"Hammock\", $result->get(1)->name);\n\n // call the fromStrings method\n $result = Tag::fromStrings([\"Penguin\", \"Wombat\", \"Penguin\"]);\n $this->assertSame(2, $result->count());\n }", "protected function tags() : Collection\n\t{\n\t\treturn $this->items->pluck('tags')->flatMap(function ($item, $key) {\n\t\t\treturn Collection::make(explode(',', trim($item,'\"')));\n\t\t})->unique();\n\t}", "static function createTagsFromString( $string )\n {\n // Remove commas and trim spaces.\n $pattern = \"[^A-ZäöüÄÖÜßa-z0-9,-. ]\";\n $tags = preg_replace( $pattern ,'', $string );\n $tags = explode(\",\", $tags );\n $tags = array_unique( $tags );\n\n if( count($tags) > 0 )\n {\n return self::createTagsFromArray( $tags );\n }\n else\n {\n return array();\n }\n }", "private function setTagsFromArray(array $input): void\n {\n $this->tags = is_null($tags = ArrayAccess::getArray($input, 'tags'))\n ? new TagList()\n : new TagList($tags);\n }", "function HtmlTagList($list,$tag,$options=array())\n {\n foreach ($list as $id => $item)\n {\n $list[ $id ]=$this->HtmlTags($tag,$item,$options);\n }\n\n return $list;\n }", "public function convertTagsToArray($tags){\n\t\t\t$tags = explode(\", \",$tags); // split tags into array at seperator (which is a comma and a space)\n\t\t\treturn $tags;\n\t\t}", "function push_tag_list($tags, $delimiter) {\n\t\t$tags = explode($delimiter, $tags); // Explode the list to make it an array\n\t\t\n\t\t$this->push_tag_array($tags);\n\t\t\n\t}", "function parseTags ($string) {\n preg_match_all(\"/\\[([^]]*)\\]/\", $string, $matches);\n\n $out = array();\n foreach($matches[1] as $match) {\n $subtags = explode(\",\", $match);\n foreach($subtags as $tag) {\n $out[] = trim($tag);\n }\n }\n\n return $out;\n}", "public function transform($collection)\n {\n if ($collection === null)\n \treturn array();\n\n $tagsArray = array();\n foreach ($collection as $tag) {\n $tagsArray[] = $tag->getId();\n }\n \n\t\treturn $tagsArray;\n }", "public static function syncFromList(object $record, string $delimitedList = null)\n {\n $delimitedList = strtolower($delimitedList);\n $delimitedList = trim($delimitedList);\n\n $tags = [];\n\n if (empty($delimitedList) === false) {\n $names = explode(',', $delimitedList);\n $names = array_map('trim', $names);\n $names = array_unique($names);\n\n $tags = static::whereIn('name', $names)->get();\n\n $existingNames = $tags->map(function ($tag) {\n return $tag->name;\n });\n\n foreach ($names as $name) {\n if ($existingNames->contains($name) === false) {\n $tag = self::create(['name' => $name]);\n $tags->push($tag);\n }\n }\n }\n\n $record->tags()->sync($tags);\n\n return $tags;\n }", "function sed_tag_parse($input)\r\n{\r\n\t$res = array();\r\n\t$tags = explode(',', $input);\r\n\tforeach($tags as $tag)\r\n\t{\r\n\t\t$tag = sed_tag_prep($tag);\r\n\t\tif(!empty($tag))\r\n\t\t{\r\n\t\t\t$res[] = $tag;\r\n\t\t}\r\n\t}\r\n\t$res = array_unique($res);\r\n\treturn $res;\r\n}", "public static function explode($tags)\n\t{\n\t\t// This regexp allows the following types of user input:\n\t\t// this, \"somecompany, llc\", \"and \"\"this\"\" w,o.rks\", foo bar\n\t\t$regexp = '%(?:^|,\\ *)(\"(?>[^\"]*)(?>\"\"[^\"]* )*\"|(?: [^\",]*))%x';\n\t\tpreg_match_all($regexp, $tags, $matches);\n\t\t$typed_tags = array_unique($matches[1]);\n\n\t\t$tags = array();\n\t\tforeach ($typed_tags as $tag)\n\t\t{\n\t\t\t// If a user has escaped a term (to demonstrate that it\n\t\t\t// is a group, or includes a comma or quote character),\n\t\t\t//we remove the escape formatting so to save the term into the database as the user intends.\n\t\t\t$tag = trim(str_replace('\"\"', '\"', preg_replace('/^\"(.*)\"$/', '\\1', $tag)));\n\t\t\tif ($tag != \"\")\n\t\t\t{\n\t\t\t\t$tags[] = $tag;\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}", "function _parse_tags(){\n // Define the new tag model\n $Tag =& new Tag;\n // split all the tags on a space into an array\n $tag_list = explode(\" \", $this->data['Post']['tags']);\n $tags = array(); // New tag array to store tag id and names from db\n foreach($tag_list as $t) {\n //the tag already exists\n if ($tag = $Tag->findByName($t)) {\n //add the join table relationship to the Tag model to connect it to the post \n $tags[] = array_merge($tag['Tag'], array('PostsTag' => array('id' => '', 'post_id' => $this->id, 'tag_id' => $tag['Tag']['id'])));\n } else {\n //create a new tag\n $Tag->save(array('id' => '', 'name' => $t));\n //get the id of the recently created tag\n $tag_id = $Tag->getLastInsertID();\n //add the join table relationship to the Tag model to connect it to the post\n $tags[] = array('id' => $tag_id, 'name' => $t, 'PostsTag' => array('id' => '', 'post_id' => $this->id, 'tag_id' => $tag_id));\n }\n //just to be safe\n unset($tag);\n }\n // add all of the tags into the post's tag container\n $this->data['Tag'] = $tags;\n }", "function objectsFromTags( $tagList )\r\n\t{\r\n\t\t$objects = array();\r\n\t\tforeach( $tagList as $tag ) {\r\n\t\t\t$tagObjects = $tag->getRelatedObjects();\r\n\t\t\tforeach( $tagObjects as $object ) {\r\n\t\t\t\t// add to array with objID as key to avoid duplicates\r\n\t\t\t\t$objects[$object->ID] = $object;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $objects;\r\n\t}", "function tag_list($tags)\n{\n\treturn join( ', ', array_map(function($tag){ return '<a href=\"/tags/' . ha($tag) . '\">' . h($tag) . '</a>'; }, $tags) );\n}", "function news_build_tags($given)\n{\n global $mybb, $templates;\n\n if ($given === '') {\n return;\n }\n\n $taglist = news_explode_settings('news_tags');\n $given = explode(',', $given);\n\n $tags = '';\n foreach ($given as $item) {\n $split = explode('=', $item);\n $tag = array('key' => $item, 'value' => $taglist[$item]);\n $tags .= eval($templates->render('news_tag'));\n }\n\n return $tags;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ echo "entro Invoke"; echo ""; echo "Action: ".$action; echo ""; echo "Controller: ".$controller; echo ""; echo "Panel: ".$panel; echo ""; echo "MenuOption: ".$menuOption; echo "";
public static function invoke($action, $controller, $panel, $menuOption) { //echo $action; //echo $controller; //$controller= new AdministradorEstadisticasController(); //Cargar el panel izquierdo de la sección de Estadisticas if (($controller=="AdministradorEstadisticas") && ($panel == 1)) { AdminFrontController::invokeAction("panelEstadisticas","Panel"); } //Cargar el panel izquierdo de la sección de Usuarios if (($controller=="AdministradorAdminUsuarios") && ($panel == 1)) { AdminFrontController::invokeAction("panelUsuarios","Panel"); } //Cargar el panel izquierdo de la sección de Corrientes if (($controller=="AdministradorAdminCorrientes") && ($panel == 1)) { AdminFrontController::invokeAction("panelCorrientes","Panel"); } //Menu Estadisticas if (($menuOption=="estadistica-conexionesUsuarios") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } if (($menuOption=="estadistica-espacioMemoriaUsuarios") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } if (($menuOption=="estadistica-cantMensajesXCorrientes") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } if (($menuOption=="estadistica-cantUsuariosXPais") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Usuarios - Listado de Usuarios if (($menuOption=="usuarios-listadoUsuarios") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Usuarios - Listado de Sugerencias if (($menuOption=="usuarios-sugerenciasCorrientes") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Usuarios - Form de Advertencia if (($menuOption=="usuarios-advertencia-form") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Usuarios - Envio de Form de Advertencia if (($menuOption=="usuarios-envio-advertencia-form") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Usuarios - Bloqueo de Usuario if (($menuOption=="usuarios-bloqueoUsuario") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Corrientes - Principal Listado if (($menuOption=="corrientes-listadoCorrientes") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Corrientes - Eliminar Corriente if (($menuOption=="corrientes-eliminarCorriente") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Corrientes - Agregar Corriente - Form if (($menuOption=="corrientes-FormModificarCorrientes") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } //Menu Corrientes - Agregar/Modificar Corriente - Accion if (($menuOption=="corrientes-AltaModificarCorriente") && ($panel == 0)) { AdminFrontController::invokeAction($action,$controller); } }
[ "public function controller() {\n if(isset($_SESSION['AAT']['debug']) && $_SESSION['AAT']['debug'] === 1) {\n\t\t\t$this->oDebugLog->addLog('message','Access','controller','in');\n }\n\t\tif ($this->oQS->ifExists('op2'))\n {\n $func = trim($this->oQS->getValue('op2'));\n $this->$func();\n } \n\t\telse \n\t\t{\n if(isset($_SESSION['AAT']['debug']) && $_SESSION['AAT']['debug'] === 1) \n\t\t\t{\n\t\t\t\t$this->oDebugLog->addLog('message','Access','controller','querystring variable op2 does not exist');\n }\n\t\t\t$this->lst();\n }\n $this->oPage->setCenterContent($this->sOutput);\n $this->oPage->setMessage($this->sMsg);\n $this->oPage->setHelpText($this->sHelp);\n\t\t$this->oPage->setLeftNavShow(true);\n }", "public function action()\n {\n return \"Subsystem2: subsystem2 performing action !\\n\";\n }", "public function execute() \n { \n $opdracht = $this->action.'Action';\n if(!method_exists($this,$opdracht))\n {\n $opdracht = 'defaultAction';\n $this->action = 'default';\n }\n $this->$opdracht();\n $this->view->setAction($this->action);\n $this->view->setControl($this->control);\n $this->view->toon();\n }", "public function executeController()\n {\n\t\t$ctrl_method_name = $this->method_name;\n $this->$ctrl_method_name();\n\t\t\n\t\tif($this->navbar_method_name !== null)\n\t\t{\n\t\t\t$navbar_method_name = $this->navbar_method_name;\n\t\t\t$this->$navbar_method_name();\n\t\t}\t\t\n }", "function display()\n {\n echo $this->menu;\n }", "public function showUserPanel() \n\t{\n\t //echo\"jghjhgjh\";\n\t\t$controllerName = ucfirst ( $_SESSION [\"userType\"] ) . \"Controller\";\n\t\t//print $controllerName;\n\t\t$objController = new $controllerName ();\n\t\t\n\t\t$objController->process ();\n\t}", "function print_panel() {\t\n\t\tif ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) {\n\t\t\t$this->print_saved_message();\n\t\t}\n\t\tif ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) {\n\t\t\t$this->print_reset_message();\n\t\t}\n\t\n\t\t$this->print_heading();\n\t\t$this->print_options();\n\t\t$this->print_footer();\n\t}", "public function imprintAction()\n {\n }", "public function invoke() {\n\n switch ($this->action) {\n\n\t\t\t// handle news data retreval and display ////////////////////////////////////////////////////////////////////////\n case 'shownews':\n\n $this->model = new dbNewsModel();\n\n // get data...\n $this->model->setId($_GET['id']);\n $this->model->getNewsItem();\n\n // process view\n require ('mls/view/shownews.php');\n\n break;\n\n case 'news-loop':\n\n $this->model = new dbNewsModel();\n\n // get data...no params needed\n $this->model->getNewsListings();\n\n // process view\n do {\n require ('mls/view/newsLoop.php');\n } while ($this->model->next());\n\n break;\n\t\t\t// end news //////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\n case 'listings-loop':\n\n $this->model = new dbRetsModel();\n\n // set params for search and get data\n $this->model->setPropertyType(\"residential\");\n $this->model->setAgentId(\"20130716175942774876000000\");\n $this->model->getClientSummaryListings();\n\n // process view\n do {\n require ('mls/view/listingLoop.php');\n } while ($this->model->next());\n\n break;\n\n case 'area':\n\n \t//explode($_GET);\n \t$this->pagename = $_GET['page'];\n\n \t// load model need for this action\n $this->page = new dbPageModel();\n\n // set params for search and get data\n $this->page->setPageName($this->pagename);\n $this->page->getPage();\n $_SESSION['page'] = $this->page->row;\t\t// store for later use in search\n\n // process view\n require ('mls/view/area.php');\n\n break;\n\n case 'area-loop':\n\n \t// load model need for this action\n $this->model = new dbRetsModel();\n $area = $_SESSION['page']['page_name'];\n\n // set params for search and get data\n $this->model->setArea($area);\n $this->model->getAreaListings();\n\n // process view\n do {\n require ('mls/view/areaLoop.php');\n } while ($this->model->next());\n\n break;\n\n case 'search-results':\n\n \t// load model need for this action\n $this->model = new dbRetsModel();\n\n // set params for search and get data\n $this->model->setArea($_GET['area']);\n \t$this->model->getSearchHeaderInfo();\n\n // process view\n require ('mls/view/search.php');\n\n break;\n\n case 'search-loop':\n\n \t// load model need for this action\n $this->model = new dbRetsModel();\n\n // set params for search and get data\n $this->model->setArea($_GET['area']);\n \t$this->model->doSearch();\n\n // process view using listing loop code...nice re-use\n do {\n require ('mls/view/areaLoop.php');\n } while ($this->model->next());\n\n break;\n\n case 'showmls':\n\n \t// load model need for this action\n $this->model = new dbRetsModel();\n\n // set params for search and get data\n $this->model->setMLS($_GET['mls']);\n \t$this->model->getSingleProperty();\n\n // process view\n switch ($this->model->getPropertyType()) {\n\n\t\t\t\t\tcase \"residential\":\n\t\t\t\t\t\trequire ('mls/view/mlsDetail/showRes.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"multifamily\":\n\t\t\t\t\t\trequire ('mls/view/mlsDetail/showMF.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"commercial\":\n\t\t\t\t\t\trequire ('mls/view/mlsDetail/showComm.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"rental\":\n\t\t\t\t\t\trequire ('mls/view/mlsDetail/showRent.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vacantland\":\n\t\t\t\t\t\trequire ('mls/view/mlsDetail/showLand.php');\n\t\t\t\t\t\tbreak;\n\n }\n\n break;\n\n default:\n throw new Exception('Controller ERROR - unknown action type {'.$this->action.'} Please make sure the filename WITHOUT extension matches the switch/case strings in the invoke() method.');\n }\n\n }", "public function action() {\n\n\t\n\t}", "function editor_executeAction() {\r\n\tglobal $headline, $feedback;\r\n\tglobal $userid_, $cmdid, $cmd, $method, $url, $params, $suchbegriffe, $suchdienst, $beispiel;\r\n\t\r\n\tif (isset($_REQUEST[\"new\"])) {\r\n\t\teditor_clearForm();\r\n\t} elseif (isset($_REQUEST[\"save\"])) {\r\n\t\t$_feedback = editor_saveCommand($cmdid, $cmd, $method, $url, $params, $suchbegriffe, $suchdienst, $beispiel);\r\n\t} elseif (isset($_REQUEST[\"delete\"])) {\r\n\t\t$_feedback = deleteCommand($cmdid);\r\n\t\teditor_clearForm();\r\n\t}\r\n\r\n\tif ($_feedback != null && sizeof(trim($_feedback)) > 0) {\r\n\t\t$feedback = \"<p><font color=red><b>$_feedback</b></font></p>\";\r\n\t}\r\n}", "public function ActionIndex()\n\t{\n\t\t$InitTerminalHelper=$this->getGateWayApp()->getContainer()->get('terminal.helper')->TerminalDumper($this);\n\t\tif($InitTerminalHelper)\n\t\t{\n\t\t $cssPath=$this->getGateWay()->getConfig('config')->Payroll->cssPath;\n\t\t $jsPath=$this->getGateWay()->getConfig('config')->Payroll->jsPath; \t\t\n\t\t $this->render('emulatedshell', array('cssRequire' => $cssPath,\n \t\t\t\t'jsRequire' => $jsPath , 'routers'=>$this->getRoute()\n\t\t\t));\n\t\t}\n\n\t}", "public function Action(){\n\t \n $this->SetRequestVariables(); \n $this->SetAction(); \n $this->UpdateyAction(); \n \n \n $path = $this->fileSystemPath.$this->actionFolder.self::$yAction['_LITE_']['ACTION'].\".php\";\n \n if(!file_exists ( $path )){ \n \t header( 'Location: ' . $this->applicationPath.'?action=404' );\n \t //die (\"File <b>\".$path.\" </b> <br />Not Found or File doesn't have the permission to open\"); \n }\n \n require_once($path);\n\n \t\n $LiteFrameAction = new LiteFrameAction();\n self::$yAction['_LITE_']['VARS']['Request'] = self::$yAction['_LITE_']['REQUEST'];\n $this->liteVars = &self::$yAction['_LITE_']['VARS'];\n // Double checking the Template variables from the Action file\n $this->MergeActionTemplatesWithFramework();\n $this->LoadTemplate();\t \n\n\t}", "private function printMenu() {\n\t\t$this->logo();\n\t\t$this->line(\"Please select the number of options below:\");\n\t\t$action = $this->choice('Main Menu', $this->menu);\n\t\t$this->processAction($action);\n\t}", "function Control_Panel_ManagerAction() {\n $modelClassName = tx_div::makeInstanceClassName('tx_cbgaedms_model_useraccess');\n $viewClassName = tx_div::makeInstanceClassName('tx_cbgaedms_view_Control_Panel');\n $entryClassName = tx_div::makeInstanceClassName('tx_cbgaedms_view_Control_PanelEntry');\n\t\t$translatorClassName = tx_div::makeInstanceClassName('tx_lib_translator');\n $view = new $viewClassName($this);\n $model = new $modelClassName($this);\n $model->load($this->parameters);\n for($model->rewind(); $model->valid(); $model->next()) {\n $entry = new $entryClassName($model->current(), $this);\n $view->append($entry);\n }\n $view->render('Control_Panel_Manager');\n\t\t$translator = new $translatorClassName($this, $view);\n\t\t$out = $translator->translateContent();\n return $out;\n\t}", "function _toolbarAction() {\n $content = NULL;\n\n if(isset($_REQUEST['PHAT_Add']) && isset($_REQUEST['PHAT_ElementType'])) {\n $this->element = new $_REQUEST['PHAT_ElementType'];\n $content = $this->element->edit();\n } elseif(isset($_REQUEST['PHAT_Settings'])) {\n unset($this->report);\n $content = $_SESSION['PHAT_FormManager']->menu();\n $content .= $this->editSettings();\n } elseif(isset($_REQUEST['PHAT_Save'])) {\n if($this->_saved) {\n $content = $this->view(TRUE);\n } else {\n $this->_save();\n }\n } elseif(isset($_REQUEST['PHAT_Go'])) {\n $this->_position = ($_REQUEST['PHAT_PageNumber'] - 1) * $this->_pageLimit;\n $content = $_SESSION['PHAT_FormManager']->menu();\n $content .= $this->view(TRUE);\n }\n\n return $content;\n }", "private function send_cli(string $action, $vars = array())\n{ \n\n // Get app\n if (!$app = app::get_instance()) { \n $app = new app('test');\n }\n\n // Process action\n $response = $app->call([apex_cli::class, $action], ['vars' => $vars]);\n\n // Return\n return $response;\n\n}", "public function actualAction()\n\t{\n\t\t$action = explode(\"Action\", __FUNCTION__)[0];\n\t\t\n\t\t$assignValues = [];\n\t\t\n\t\t$extSettings = parent::getExtSettings();\n\n\t\tif(array_key_exists('version', $this->settings['model'][$this->nj_domain][$action]))\n\t\t{\n\t\t\t$extSettings['version'] = $this->settings['model'][$this->nj_domain][$action]['version'];\n\t\t}\n\n\t\t$assignValues['ext'] = $extSettings;\n\t\t\n\t\t$assignValues['exhibition'] = $this->exhibitionRepository->findActualExhibition();\n\t\t\n\t\t$this->view->assignMultiple($assignValues);\n\t\t$assignValues['js'] = $this->getJsSettings();\n\t\t\n\t\t$this->view->assignMultiple($assignValues);\n\t}", "function invoke()\n {\n if(!isset($_GET[\"view\"]))\n {\n include_once(\"./views/login.php\");\n }\n else\n {\n switch($_GET[\"view\"])\n {\n case \"managecategories\":\n include_once(\"./views/managecategories.php\");\n break;\n case \"budget\";\n include_once(\"./views/budget.php\");\n break;\n case \"categorize\";\n include_once(\"./views/categorize.php\");\n break;\n case \"import\";\n include_once(\"./views/import.php\");\n break;\n case \"login\";\n include_once(\"./views/login.php\");\n break;\n case \"logout\";\n session_destroy();\n $this->util->redirect(\"?view=login\");\n break;\n case \"monthly\";\n include_once(\"./views/monthly.php\");\n break;\n case \"signup\";\n include_once(\"./views/signup.php\");\n break;\n default:\n include_once(\"./views/login.php\");\n break;\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
User Authored Reports Retrieves the reports collection authored by a specific user
function appthemes_get_user_authored_reports( $user_id, $args = array() ) { $args = array( 'user_id' => $user_id, 'meta_key' => '', 'meta_value' => '', ); return APP_Report_Factory::get_user_reports( $user_id, $args ); }
[ "function myreports(){\r\n /* Check loggen in user permission rights */\r\n if(!$this->Session->check('UserUsername')){\r\n $this->redirect(array('controller'=>'pages', 'action'=>'display')); \r\n }\r\n /* Find user's id */\r\n $email = $this->Session->read('UserUsername');\r\n $userId = ClassRegistry::init('User')->getUserId($email);\r\n /* Find user's reports */\r\n if($userId !== false){\r\n $reports = $this->Report->findUserReports($userId);\r\n $this->set('reports', $reports);\r\n }\r\n else{\r\n $this->redirect(array('controller'=>'pages', 'action'=>'display')); \r\n }\r\n }", "public function test_logged_user_access_to_reports()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->withSession(['banned' => false])\n ->get('/reports');\n\n $response->assertStatus(200);\n }", "public function crReports(){\n\t\treturn $this->hasMany('App\\CrReports','user_id');\t\n\t}", "public function getUserReport($report_id, $user_id){\n\t\t$sql = \"SELECT t1.*, t2.firstname, t2.surname, t2.email\n\t\t\t\tFROM user_reports t1\n\t\t\t\t\tLEFT JOIN users t2 ON t1.user_id = t2.id\n\t\t\t\tWHERE t1.report_id = :report_id AND t1.user_id = :user_id\n\t\t\t\tGROUP BY t1.user_id\n\t\t\t\t\";\n\t\treturn $this->_db->select($sql, array(':report_id' => $report_id, ':user_id' => $user_id));\n\t}", "public function getReportDashboard()\n {\n $roleId = Auth::user()->role_id;\n $userId = Auth::user()->id;\n $user = Auth::user();\n $getRoleDetails = $this->userRepository->getRoleIdDetailsBasedOnCurrentRole($user);\n $currentSessionRole = Session::get('role');\n $getRoleName = $this->userRepository->getUserRoleName($currentSessionRole);\n if (Session::get('role') == config('custom.practiceLeadId')) {\n $userDetails = $this->userRepository->getRolesNameId();\n $getManagerId = $this->userRepository->getManagerId($userDetails);\n $getProjectLeadAndManagerId = $this->userRepository->getProjectLeadAndManagerId($userDetails,\n $getManagerId);\n $getHierarchicalIds = $this->userRepository->getReportersInHeirarchy($userId);\n $users = $this->userRepository->getPeopleId($getProjectLeadAndManagerId, $getHierarchicalIds);\n return view('report_summary')\n ->with('roleId', $roleId)\n ->with('users', $users)\n ->with('getRoleDetails', $getRoleDetails)\n ->with('getRoleName', $getRoleName);\n }\n\n $users = $this->reportRepo->getPeople();\n return view('report_summary')\n ->with('roleId', $roleId)\n ->with('users', $users)\n ->with('getRoleDetails', $getRoleDetails)\n ->with('getRoleName', $getRoleName);\n }", "public function getUserReports(): array {\n return $this->userReports;\n }", "public function forUser(User $user)\n {\n return Report::where('user_id', $user->id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function hrReports(){\n\t\treturn $this->hasMany('App\\HrReports','user_id');\t\n\t}", "public function addReport($user_id);", "public function getReportsForUser($id) {\n $user = $this->doGet(array('users', $id, 'reports'));\n $user = $this->boxList($user, 'WG\\Report');\n return $user;\n }", "public function canReport()\n {\n return DB::table('access_user')\n ->whereAccessId(Access::where('name', Access::SALES)->first()->id)\n ->whereUserId($this->id)\n ->count() > 0;\n }", "public function getReportsForAUserScope($isAdmin, $loggedInUserId, $userId = null)\n {\n $reports = $this->getModel()->join('users', 'reports.user_id', '=', 'users.id')\n ->select([\n 'reports.id', 'reports.user_id', 'users.name', 'reports.overall_score',\n 'reports.max_score', 'reports.created_at'\n ]);\n\n //If user is not admin, load users reports only\n if (!$isAdmin) {\n return $reports->where('reports.user_id', $loggedInUserId);\n }\n\n //Otherwise, display user's related reports only if any user ID\n if ($userId) {\n return $reports->where('reports.user_id', $userId);\n }\n\n return $reports;\n }", "public function getMyReports()\n { \n\n if((Session::has('prac_id')) && (Session::has('is_admin')))\n {\n $reports = Report::all();\n\n $reportlist = array();\n foreach($reports as $report)\n { \n $client = User::find($report->userid);\n $practitioner = Practitioner::find($report->prac_id);\n\n if($report->updated_at->isToday())\n {\n $updated_date = date('h:ia', strtotime($report->updated_at));\n }\n else\n {\n $updated_date = date('F d, Y', strtotime($report->updated_at));\n }\n \n $reportlist[] = ['id'=>$report->id,\n 'client_name'=>$client->fname . \" \" . $client->sname,\n 'prac_name'=>$practitioner->fname . \" \" . $practitioner->sname,\n 'updated_at'=>$updated_date,\n 'status'=>$report->status];\n \n }\n }\n else\n {\n\n if(Session::has('prac_id'))\n {\n $reports = Report::latest('updated_at')->practitioner()->get();\n }\n elseif(Auth::check())\n {\n $reports = Report::latest('updated_at')->GetUserReports()->get();\n }\n \n $reportlist = array();\n foreach($reports as $report)\n { \n if(Session::has('prac_id'))\n {\n $client = User::find($report->userid);\n $name = $client->fname . \" \" . $client->sname;\n }\n else\n {\n $practitioner = Practitioner::find($report->prac_id);\n $name = $practitioner->fname . \" \" . $practitioner->sname;\n }\n \n\n if($report->updated_at->isToday())\n {\n $updated_date = date('h:ia', strtotime($report->updated_at));\n }\n else\n {\n $updated_date = date('F d, Y', strtotime($report->updated_at));\n }\n\n if($report->created_at->isToday())\n {\n $created_date = date('h:ia', strtotime($report->created_at));\n }\n else\n {\n $created_date = date('F d, Y', strtotime($report->created_at));\n }\n \n $reportlist[] = ['id'=>$report->id,\n 'name'=>$name,\n 'updated_at'=>$updated_date,\n 'status'=>$report->status,\n 'created_at'=>$created_date];\n \n }\n }\n\n if(count($reportlist) < 1)\n {\n return null;\n }\n else\n { \n return $reportlist;\n }\n }", "function set_session_report_acls() {\n\t\t//only use set_session_report_acls in this module if an ldap user is logged in (as opposed to a database user)\n\t\tif (substr($_SESSION['user'], 0, 5) != \"ldap_\") return;\n\n\t\t//get the user_id\n\t\t$usr = substr($_SESSION['user'], 5);\n\n\t\t$search_string = \"(uid=$usr)\";\n\n\t\t#Connect to the ldap server\n\t\t$ds=ldap_connect($this->conf['ldap']['host']);\n\t\tif ($ds) {\n\t\t\t$r = ldap_bind($ds);\n\t\t\t//search the directory for the logged in user id\n\t\t\t$sr = ldap_search($ds, $this->conf['ldap']['base_dn'], $search_string, array(\"uid\", \"fullname\", \"groupmembership\"));\n\n\t\t\t$ldap_entries = ldap_get_entries($ds, $sr);\n\n\t\t\tforeach ($ldap_entries as $entry) {\n\t\t\t\tif (empty($entry['uid'][0])) continue;\n\t\t\t\tif (empty($entry['fullname'][0])) continue;\n\n\t\t\t\t//make sure this user has all the requred dn attributes\n\t\t\t\tif (!$this->check_required_dn($entry['dn'])) continue;\n\n\t\t\t\t$user_id = \"ldap_\".strtolower($entry['uid'][0]);\n\t\t\t\t$name = $entry['fullname'][0];\n\n\t\t\t\tlist($units, $user_id_units) = $this->cromulategroups($user_id, $units, $user_id_units, $entry['groupmembership']);\n\t\t\t}\n\n\t\t\tldap_close($ds);\n\t\t}\n\n\t\t//get report permissions for the user and their groups\n\t\t$rep_acls_users_query = $this->dobj->db_fetch_all($this->dobj->db_query(\"SELECT * FROM report_acls_ldap_users WHERE user_id='\".$usr.\"' AND access=true;\"));\n\n\t\tif (!empty($units)) {\n\t\t\t$rep_acls_groups_query = $this->dobj->db_fetch_all($this->dobj->db_query(\"SELECT * FROM report_acls_ldap_groups WHERE group_id='\".implode(\"' OR group_id='\", $units).\"' AND access=true;\"));\n\t\t}\n\n\t\t//convert the user's and user's groups acls into a single array telling if the user has permission or not for each role of each report.\n\t\t$rep_acls_query = array_merge((array)$rep_acls_users_query, (array)$rep_acls_groups_query);\n\t\tforeach ($rep_acls_query as $acl_tmp) {\n\t\t\tif (empty($acl_tmp)) continue;\n\n\t\t\t$template_id = $acl_tmp['template_id'];\n\t\t\t$role_id = $acl_tmp['role'];\n\n\t\t\t$acls['report'][$template_id][$role_id] = true;\n\t\t}\n\n\t\t//save the report acl in $_SESSION\n\t\t$_SESSION['acls']['report'] = $acls['report'];\n\t}", "public function load_report_audit()\n {\n if(Auth::user()->usertype == 0)\n {\n return abort(401);\n }\n $page = 'reports';\n return view('reports.audit.audit_reports', compact('page'));\n }", "public function getDReportsByUserID($id)\n\t{\n\t\t$dReports = Report::where('user_id', '=', $id)->get();\n\n\t\treturn $dReports;\n\t}", "function get_report_user($id)\n {\n return $this->db->get_where('report_user',array('id'=>$id))->row_array();\n }", "public function getReports();", "public function client_user_visit_report() \n\t{\n\t\t\n\t\t$this->loadModel('Admin');\n\t\t\t\n\t\t$conditions = array(\t\t\n\t\t\t\t\t'limit' => 10,\n\t\t\t\t\t'conditions' => array('Admin.id'=>$this->Auth->user('id')),\n\t\t\t\t\t'fields'=>array('first_name', 'last_name', 'email', 'total_visit', 'facebook_visit', 'twitter_visit', 'other_visit')\t\t\t\n\t\t\t\t);\t\t\t\n\t\t$user = $this->Admin->find('first', $conditions);\n\t\t\n\t\t$this->set('user', $user);\t\t\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the dt fermeture auto.
public function getDtFermetureAuto() { return $this->dtFermetureAuto; }
[ "public function getDtFermetureAuto(): ?DateTime {\n return $this->dtFermetureAuto;\n }", "public function getDt();", "public function getDt()\n {\n return $this->dt;\n }", "public function getDecalageFermetureAuto() {\n return $this->decalageFermetureAuto;\n }", "public function getDate_debut()\n {\n return $this->date_debut;\n }", "public function getTiempodedicacionfecha()\n\t{\n\t\treturn $this->tiempodedicacionfecha;\n\t}", "public function getDateDebut();", "public function getDate_debut(): \\DateTime\n {\n return new \\DateTime($this->date_debut);\n }", "public function getAuto_fecha_compra()\n {\n return $this->auto_fecha_compra;\n }", "public function getDateDebut()\n {\n return $this->dateDebut;\n }", "public function getFecha()\n {\n return $this->v_fecha;\n }", "public function getDuracionDeuda()\n {\n return $this->duracion_deuda;\n }", "public function get_dateDebut()\n {\n return $this->_dateDebut;\n }", "public function getDateDebut()\n {\n return $this->_dateDebut;\n }", "public function getDate_de_naissance()\n {\n return $this->date_de_naissance;\n }", "public function getDateDecTva() {\n return $this->dateDecTva;\n }", "public function getManualDateStart() {}", "public function getDateDebutAffiche()\n {\n return $this->dateDebutAffiche;\n }", "public function getDateDebutRempl() {\n return $this->dateDebutRempl;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Active movies by criteria
public function getActiveMovies(){ $query = $this->getEntityManager() ->createQuery( 'SELECT p FROM CinheticPublicBundle:Movies p WHERE p.dateRelease >= :current AND p.visible = 1 ORDER BY p.title ASC' ) ->setParameters( array( 'current' => new \Datetime('midnight'), )); return $query; }
[ "public function getCurrentMovies(){\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT p\n FROM CinheticPublicBundle:Movies p\n WHERE p.dateRelease >= :current\n AND p.visible = 1\n ORDER BY p.title ASC'\n )\n ->setParameters(\n array(\n 'current' => new \\Datetime('midnight'),\n ));\n\n return $query->getResult();\n }", "public static function fetchFromMovies()\n {\n $url = self::formatUrl(self::MOVIES);\n return self::fetch($url);\n }", "public function fetchMovies() {\n \n $sql = $this->generateSQL();\n \n $db = $this->db;\n $this->queryResults = $db->ExecuteSelectQueryAndFetchAll($sql['query'], $sql['params']);\n \n }", "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function getAllMoviesAndRoles(){\n\t\t$stmt = $this->DB->prepare(\"SELECT movies.name, actors.first_name, actors.last_name, roles.role FROM movies JOIN roles JOIN actors ON movies.id=roles.movie_id AND roles.actor_id=actors.id\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function searchMovies()\n {\n }", "public function selectAllMovies()\r\n {\r\n $query = \"SELECT movie_id, title, year from movie ORDER BY title;\";\r\n return $this->executeQuery(strval($query)); // convert query to string\r\n }", "function searchActor(){\n \n $criteria = $this->input->post('criteria');\n include(FCPATH.\"/application/libraries/tmdb-api.php\");\n $tmdb = new TMDB();\n \n $searchActor = $tmdb->searchPerson($criteria);\n $searchMovie = $tmdb->searchMovie($criteria);\n \n if($searchActor==NULL){\n $this->showMessage(\"No results were found.\");\n }\n else{\n $data = array('searchActor'=>$searchActor,'searchMovie'=>$searchMovie);\n $this->showResult($data);\n } \n }", "public function getAllMovies()\n {\n }", "public function showMoviesAction() : object\n {\n $db = $this->app->db;\n $page = $this->app->page;\n\n $title = \"Show movies\";\n\n if (isset($_SESSION[\"resSearchTitle\"])) {\n $resultset = $this->getSession(\"resSearchTitle\");\n $searchTitle = $this->getSession(\"searchTitle\");\n } elseif (isset($_SESSION[\"resSearchYear\"])) {\n $year1 = $this->getSession(\"year1\");\n $year2 = $this->getSession(\"year2\");\n $resultset = $this->getSession(\"resSearchYear\");\n } else {\n $sql = \"SELECT * FROM movie;\";\n $resultset = $db->executeFetchAll($sql);\n }\n\n $page->add(\"movie/sidebar\");\n $page->add(\"movie/article-header\");\n $page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle ?? null,\n ]);\n $page->add(\"movie/search-year\", [\n \"year1\" => $year1 ?? null,\n \"year2\" => $year2 ?? null,\n ]);\n $page->add(\"movie/show-movies\", [\n \"resultset\" => $resultset,\n ]);\n $page->add(\"movie/article-footer\");\n\n return $page->render([\n \"title\" => $title,\n ]);\n }", "public function getMovies()\n {\n return $this->movies;\n }", "public function getMovies()\n {\n return $this->movies;\n }", "function getOGVideoActors();", "function getMoviesList() {\n\t if ($this->movies == NULL) {\n\t $this->movies = Movie::getMoviesWithActor($this->id);\n\t }\n\t\t\n\t return $this->movies;\n\t}", "public function getMoviesInCinema($cinema_id);", "public function searchMovies() {\n $query = Input::get('title');\n\n if (!$query) {\n return Redirect::back();\n }\n\n $results = [];\n $response = Tmdb::getSearchApi()->searchMovies($query);\n $num_of_pages = $response['total_pages'];\n\n if ($num_of_pages > 1) {\n for($i = 1; $i <= $num_of_pages; $i++){\n $response = Tmdb::getSearchApi()->searchMovies($query, array('page' => $i));\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n }\n else {\n $movies = $response['results'];\n foreach($movies as $movie){\n array_push($results, $movie);\n }\n }\n return Redirect::back()->with('search_result', $results);\n }", "public function getAllMoviesAndRoles() {\n \t$stmt = $this->DB->prepare (\"SELECT actors.first_name,actors.last_name,roles.role,movies.name FROM roles JOIN actors ON actors.id = roles.actor_id JOIN movies ON movies.id = roles.movie_id\");\n \t$stmt->execute();\n\n \treturn $stmt->fetchAll ( PDO::FETCH_ASSOC);\n }", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "function query_films($db, $actorID) {\n\t\treturn $db->query(\"SELECT m.name, m.year \n\t\t\tFROM movies m\n\t\t\tJOIN roles r ON m.id = r.movie_id\n\t\t\tJOIN roles r1 ON m.id = r1.movie_id\n\t\t\tJOIN actors a ON r.actor_id = a.id\n\t\t\tJOIN actors k ON r1.actor_id = k.id\n\t\t\tWHERE a.id = '$actorID[0]'\n\t\t\tAND k.first_name = 'Kevin'\n\t\t\tAND k.last_name = 'Bacon'\n\t\t\tORDER BY m.year DESC\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Requests the Zabbix API and returns the response of the method "discoveryrule.findinterfaceforitem". The $params Array can be used, to pass parameters to the Zabbix API. For more information about these parameters, check the Zabbix API documentation at The $arrayKeyProperty can be used to get an associative instead of an indexed array as response. A valid value for the $arrayKeyProperty is is any property of the returned JSON objects (e.g. "name", "host", "hostid", "graphid", "screenitemid").
public function discoveryruleFindInterfaceForItem($params = [], $arrayKeyProperty = null, $assoc = true) { return $this->request('discoveryrule.findinterfaceforitem', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true); }
[ "public function itemFindInterfaceForItem($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('item.findInterfaceForItem', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }", "public function hostinterfaceCheckInput($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('hostinterface.checkInput', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }", "public function screenitemGet($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('screenitem.get', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }", "public function findData($interfaceName);", "function guifi_get_device_interfaces($id,$iid = NULL, $used = NULL) {\n\n if (!is_array($used))\n $used = array(''=>t('Create new remote interface'));\n\n if (empty($id))\n return $used;\n\n if (empty($iid))\n $iid = 0;\n\n guifi_log(GUIFILOG_TRACE,'guifi_get_device_interfaces(id - iid)',$id.' - '.$iid);\n guifi_log(GUIFILOG_TRACE,'guifi_get_device_interfaces(iid)',$id);\n\n $did = explode('-',$id);\n\n if (!is_numeric($did[0]))\n return $used;\n\n $sql_i = '\n SELECT id, interface_type, connto_iid\n FROM {guifi_interfaces}\n WHERE device_id = ' .$did[0];\n\n $sql_i .=\n ' AND ( interface_class = \"ethernet\" OR interface_class = \"vlan\" OR interface_class = \"bridge\" OR\n ( interface_class is NULL AND (radiodev_counter is NULL OR upper(interface_type) IN (\"WLAN/LAN\"))))';\n\n guifi_log(GUIFILOG_TRACE,'guifi_get_devicename(sql)',$sql_i);\n\n $qi = db_query($sql_i);\n\n while ($i = db_fetch_object($qi)) {\n if ( ((empty($i->connto_did)) and (empty($i->connto_iid)) ) or ($i->id == $iid)) {\n $trimmed_itype = trim($i->interface_type);\n if (!empty($trimmed_itype))\n $used[$i->id] = $i->interface_type;\n }\n }\n\n return $used;\n}", "public function itemGet($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('item.get', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }", "public function discoveryruleUpdate($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('discoveryrule.update', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }", "public function hostinterfaceReplaceHostInterfaces($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('hostinterface.replacehostinterfaces', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }", "public function lookupItem($item_id);", "function getInterface($IID){\n\t$conn=conDB();\n\t$sql=\"SELECT * FROM interfaces WHERE IDKey='$IID'\";\n\t$result = mysqli_query($conn, $sql);\n\t$row = $result->fetch_assoc();\n\t$L1=$row[\"Line1\"];\n\t$L2=$row[\"Line2\"];\n\t$L3=$row[\"Line3\"];\n\t$L4=$row[\"Line4\"];\n\t$L5=$row[\"Line5\"];\n\t$return=array();\n\t$return[0]=$L1;\n\t$return[1]=$L2;\n\t$return[2]=$L3;\n\t$return[3]=$L4;\n\t$return[4]=$L5;\n\treturn $return;\n}", "public function dispatchCall($params)\r\n {\r\n $req = new GetItemRequestType();\r\n $req->setItemID($params['ItemID']);\r\n \r\n $res = $this->proxy->GetItem($req);\r\n if ($this->testValid($res)) {\r\n $this->dumpObject($res);\r\n return (true);\r\n } else {\r\n $this->dumpObject($res);\r\n return (false);\r\n }\r\n }", "private function lookup($interface, $class, array& $objects) {\n\t\tif (array_key_exists($interface, $objects)) {\n\t\t\treturn $objects[$interface];\n\t\t} else if (array_key_exists($class, $objects)) {\n\t\t\treturn $objects[$class];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function get_Interface_By_IP($tgt_id, $ip)\n {\n $this->help->select(\"sagacity.interfaces\", null, array(\n array(\n 'field' => 'tgt_id',\n 'op' => '=',\n 'value' => $tgt_id\n ),\n array(\n 'field' => 'ipv4',\n 'op' => '=',\n 'value' => $ip,\n 'sql_op' => 'AND',\n 'open-paren' => true\n ),\n array(\n 'field' => 'ipv6',\n 'op' => '=',\n 'value' => $ip,\n 'sql_op' => 'OR',\n 'close-paren' => true\n )\n ));\n\n $row = $this->help->execute();\n if (is_null($row)) {\n return null;\n }\n $int = new interfaces($row['id'], $row['tgt_id'], $row['name'], $row['ipv4'], $row['ipv6'], $row['hostname'], $row['fqdn'], $row['description']);\n\n $this->help->select(\"sagacity.ports_proto_services pps\", array(\n 'pps.id',\n 'pps.port',\n 'pps.proto',\n \"IF(ppsl.name != pps.IANA_Name, ppsl.name, pps.IANA_Name) AS 'name'\",\n \"IF(ppsl.banner != pps.banner, ppsl.banner, pps.banner) AS 'banner'\",\n \"IF(ppsl.notes != pps.notes, ppsl.notes, pps.notes) AS 'notes'\"\n ), array(\n array(\n 'field' => 'ppsl.int_id',\n 'op' => '=',\n 'value' => $row['id']\n ),\n array(\n 'field' => 'pps.id',\n 'op' => IN,\n 'value' => \"(SELECT pps_id FROM sagacity.pps_list WHERE int_id={$row['id']})\",\n 'sql_op' => 'AND'\n )\n ), array(\n 'table_joins' => array(\n \"LEFT JOIN sagacity.pps_list ppsl ON ppsl.pps_id=pps.id\"\n )\n ));\n\n $rows2 = $this->help->execute();\n if (is_array($rows2) && count($rows2) && isset($rows2['id'])) {\n $rows2 = array(\n 0 => $rows2\n );\n }\n\n if (is_array($rows2) && count($rows2) && isset($rows2[0])) {\n foreach ($rows2 as $port) {\n $class = \"{$port['proto']}_ports\";\n $method = \"add_\" . strtoupper($port['proto']) . \"_Ports\";\n $port = new $class($port['id'], $port['port'], $port['name'], $port['banner'], $port['notes']);\n $int->$method($port);\n }\n }\n\n return $int;\n }", "public function hostinterfaceDelete($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('hostinterface.delete', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }", "public static function resolveHostInterfaces(array $interfaces) {\n\t\tself::init();\n\n\t\t// agent primary ip and dns\n\t\t$data = array();\n\t\tforeach ($interfaces as $interface) {\n\t\t\tif ($interface['type'] == INTERFACE_TYPE_AGENT && $interface['main'] == INTERFACE_PRIMARY) {\n\t\t\t\t$data[$interface['hostid']][] = $interface['ip'];\n\t\t\t\t$data[$interface['hostid']][] = $interface['dns'];\n\t\t\t}\n\t\t}\n\n\t\t$resolvedData = self::$macrosResolver->resolve(array(\n\t\t\t'config' => 'hostInterfaceIpDnsAgentPrimary',\n\t\t\t'data' => $data\n\t\t));\n\n\t\tforeach ($resolvedData as $hostId => $texts) {\n\t\t\t$n = 0;\n\n\t\t\tforeach ($interfaces as &$interface) {\n\t\t\t\tif ($interface['type'] == INTERFACE_TYPE_AGENT && $interface['main'] == INTERFACE_PRIMARY\n\t\t\t\t\t\t&& $interface['hostid'] == $hostId) {\n\t\t\t\t\t$interface['ip'] = $texts[$n];\n\t\t\t\t\t$n++;\n\t\t\t\t\t$interface['dns'] = $texts[$n];\n\t\t\t\t\t$n++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($interface);\n\t\t}\n\n\t\t// others ip and dns\n\t\t$data = array();\n\t\tforeach ($interfaces as $interface) {\n\t\t\tif (!($interface['type'] == INTERFACE_TYPE_AGENT && $interface['main'] == INTERFACE_PRIMARY)) {\n\t\t\t\t$data[$interface['hostid']][] = $interface['ip'];\n\t\t\t\t$data[$interface['hostid']][] = $interface['dns'];\n\t\t\t}\n\t\t}\n\n\t\t$resolvedData = self::$macrosResolver->resolve(array(\n\t\t\t'config' => 'hostInterfaceIpDns',\n\t\t\t'data' => $data\n\t\t));\n\n\t\tforeach ($resolvedData as $hostId => $texts) {\n\t\t\t$n = 0;\n\n\t\t\tforeach ($interfaces as &$interface) {\n\t\t\t\tif (!($interface['type'] == INTERFACE_TYPE_AGENT && $interface['main'] == INTERFACE_PRIMARY)\n\t\t\t\t\t\t&& $interface['hostid'] == $hostId) {\n\t\t\t\t\t$interface['ip'] = $texts[$n];\n\t\t\t\t\t$n++;\n\t\t\t\t\t$interface['dns'] = $texts[$n];\n\t\t\t\t\t$n++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($interface);\n\t\t}\n\n\t\t// port\n\t\t$data = array();\n\t\tforeach ($interfaces as $interface) {\n\t\t\t$data[$interface['hostid']][] = $interface['port'];\n\t\t}\n\n\t\t$resolvedData = self::$macrosResolver->resolve(array(\n\t\t\t'config' => 'hostInterfacePort',\n\t\t\t'data' => $data\n\t\t));\n\n\t\tforeach ($resolvedData as $hostId => $texts) {\n\t\t\t$n = 0;\n\n\t\t\tforeach ($interfaces as &$interface) {\n\t\t\t\tif ($interface['hostid'] == $hostId) {\n\t\t\t\t\t$interface['port'] = $texts[$n];\n\t\t\t\t\t$n++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($interface);\n\t\t}\n\n\t\treturn $interfaces;\n\t}", "public function itemGet($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('item.get', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }", "public function get_all_interfaces(){\n return $this->query('/routing/pim/interface/getall');\n }", "static function get_interface_by_id($id)\n {\n global $db;\n\n $str = \"SELECT * FROM `interfaces` WHERE `intid`='%d'\";\n $sql = sprintf($str, api::cleanse($id));\n return mysqli_fetch_assoc(mysqli_query($db, $sql));\n }", "public function testResolveWithInterface(array $rule, string $result): void\n {\n $container = new Container($rule);\n\n $this->assertInstanceOf(\n ClassResInterface::class,\n $container->resolve(ClassResInterface::class)\n );\n\n $this->assertEquals(\n $result,\n ($container->resolve(ClassResInterface::class))->getClass()\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configuration for video classification task. Generated from protobuf field .google.cloud.datalabeling.v1beta1.VideoClassificationConfig video_classification_config = 6;
public function getVideoClassificationConfig() { return $this->readOneof(6); }
[ "public function setVideoClassification($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AutoMl\\V1beta1\\VideoClassificationAnnotation::class);\n $this->writeOneof(9, $var);\n\n return $this;\n }", "public function getVideoClassification()\n {\n return $this->readOneof(9);\n }", "public function setTextClassificationConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DataLabeling\\V1beta1\\TextClassificationConfig::class);\n $this->writeOneof(10, $var);\n\n return $this;\n }", "public function setImageClassificationConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DataLabeling\\V1beta1\\ImageClassificationConfig::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "public function getVideoConfidenceThreshold()\n {\n return $this->video_confidence_threshold;\n }", "public function setTextDetectionConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VideoIntelligence\\V1\\TextDetectionConfig::class);\n $this->text_detection_config = $var;\n\n return $this;\n }", "public function setVideoConfidenceThreshold($var)\n {\n GPBUtil::checkFloat($var);\n $this->video_confidence_threshold = $var;\n\n return $this;\n }", "public function getVideoObjectDetectionDetails()\n {\n return $this->readOneof(6);\n }", "public function getImageClassificationConfig()\n {\n return $this->readOneof(4);\n }", "public function getVideo()\n {\n return $this->readOneof(102);\n }", "public function getTextClassificationConfig()\n {\n return $this->readOneof(4);\n }", "public function setVideo($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V0\\Resources\\Video::class);\n $this->video = $var;\n\n return $this;\n }", "public function getVideoDefinitionType()\n {\n return $this->videoDefinitionType;\n }", "public function setObjectDetectionConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DataLabeling\\V1beta1\\ObjectDetectionConfig::class);\n $this->writeOneof(7, $var);\n\n return $this;\n }", "public function getVideoExtension()\n {\n return $this->videoExtension;\n }", "public function setVideoThumbnails($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\DataLabeling\\V1beta1\\VideoThumbnail::class);\n $this->video_thumbnails = $arr;\n\n return $this;\n }", "public function setTrainingConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\TrainingConfig::class);\n $this->training_config = $var;\n\n return $this;\n }", "public function setIncident_video($x) { $this->incident_video = $x; }", "public function render_video($conf) {\r\n\r\n\t\t$extPath = \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::siteRelPath('t3sbootstrap');\r\n\r\n\t\t$videoJsPath = $extPath.'Resources/Public/Contrib/VideoJs/Video.js';\r\n\t\t$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile($videoJsPath);\r\n\r\n\t\t$videoCssPath = $extPath.'Resources/Public/Contrib/VideoJs/Video-js.css';\r\n\t\t$GLOBALS['TSFE']->getPageRenderer()->addCssFile($videoCssPath, 'stylesheet','all','', TRUE);\r\n\r\n\t\t$uid = $this->cObj->data['uid'];\r\n\r\n\t\t$this->pi_initPIflexForm();\r\n\r\n\t\t$source = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'source');\r\n\t\t$ratio = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ratio');\r\n\r\n\t\t$centerPlayButton = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'centerPlayButton');\r\n\t\t$centerPlayButton = $centerPlayButton ? 'vjs-big-play-centered' : '';\r\n\r\n\t\t$autoplay = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'autoplay');\r\n\t\t$autoplay = $autoplay ? 'autoplay' : '';\r\n\r\n\r\n\t\t$preload = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'preload');\r\n\t\t$preload = $preload ? 'preload' : '';\r\n\r\n\t\t$loop = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'loop');\r\n\t\t$loop = $loop ? 'loop' : '';\r\n\r\n\t\t$video = '<div class=\"embed-responsive embed-responsive-'.$ratio.'\">';\r\n\r\n\t\tif ( $source == 1 ) {\r\n\t\t\t# own video source\r\n\t\t\t$mp4 = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'mp4'));\r\n\t\t\t$webm = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'webm'));\r\n\t\t\t$ogg = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'ogg'));\r\n\r\n\t\t\t$previewImage = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'previewImage');\r\n\t\t\t$previewImage = $previewImage ? 'poster=\"'.$previewImage.'\"' : '';\r\n\r\n\t\t\t$video .= '<video id=\"video_'.$uid.'\" class=\"video-js vjs-default-skin\" controls '.$previewImage.' data-setup '.$autoplay.' '.$preload.' '.$loop.'>';\r\n\r\n\t\t\tif ( $mp4 ) $video .= '<source src=\"'.$mp4.'\" type=\"video/mp4\" />';\r\n\t\t\tif ( $webm ) $video .= '<source src=\"'.$webm.'\" type=\"video/webm\" />';\r\n\t\t\tif ( $ogg ) $video .= '<source src=\"'.$ogg.'\" type=\"video/ogg\" />';\r\n\r\n\r\n\t\t} elseif ( $source == 2 ) {\r\n\t\t\t# youtube\r\n\t\t\t$youtube = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'youtube'));\r\n\t\t\t$video .= '<video id=\"video_'.$uid.'\" src=\"\" class=\"video-js vjs-default-skin '.$centerPlayButton.'\" controls data-setup=\\'{ \"techOrder\": [\"youtube\"], \"src\": \"http://www.youtube.com/watch?v='.$youtube.'\" }\\' '.$autoplay.' '.$preload.' '.$loop.'>';\r\n\r\n\t\t\t$youtubePath = \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::siteRelPath('t3sbootstrap').'Resources/Public/Contrib/VideoJs/Youtube.js';\r\n\t\t\t$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile($youtubePath);\r\n\r\n\t\t} elseif ( $source == 3 ) {\r\n\t\t\t# vimeo\r\n\t\t\t$vimeo = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'vimeo'));\r\n\r\n\t\t\t$video .= '<video id=\"vid1_'.$uid.'\" src=\"\" class=\"video-js vjs-default-skin\" controls data-setup=\\'{ \"techOrder\": [\"vimeo\"], \"src\": \"https://vimeo.com/'.$vimeo.'\" }\\' '.$autoplay.' '.$preload.' '.$loop.'>';\r\n\r\n\t\t\t$vimeoPath = \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::siteRelPath('t3sbootstrap').'Resources/Public/Contrib/VideoJs/Vimeo.js';\r\n\t\t\t$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile($vimeoPath);\r\n\r\n\t\t}\r\n\r\n\t\t$video .= '</video></div>';\r\n\r\n\r\n\t\treturn $video;\r\n\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unregisters this error handler by restoring the PHP error and exception handlers.
public function unregister(): void { restore_error_handler(); restore_exception_handler(); }
[ "public function unregister() {\n\t\tif ($this->isRegistered) {\n\t\t\trestore_error_handler();\n\t\t\trestore_exception_handler();\n\t\t\t$this->isRegistered = false;\n\t\t}\n\t}", "public function unregister()\n {\n restore_error_handler();\n }", "protected function revertErrorHandler(): void\n {\n $handler = new ErrorHandler();\n set_error_handler([$handler, 'errorHandler']);\n }", "static public function unregister()\n {\n restore_error_handler();\n }", "public function restore_handler()\n {\n restore_error_handler();\n }", "public function restoreErrorHandler() {\n\t\trestore_error_handler();\n\t}", "protected function restoreErrorHandler() {\n restore_error_handler();\n }", "function restore_exception_handler () {}", "public static function replaceErrorHandler()\n {\n $previous = set_error_handler(array(__CLASS__, 'handleError'));\n // If the previous error handler was not the one from Contao, restore it as we assume it was behaving good.\n if ('__error' !== $previous) {\n restore_error_handler();\n }\n }", "function restore_error_handler()\n{\n}", "public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }", "public function clearExceptionHandler ()\n {\n $handler = $this->exceptionHandler;\n unset($this->exceptionHandler);\n set_exception_handler(null);\n return $handler;\n }", "public static function unmuteExpectedErrors()\n {\n restore_error_handler();\n }", "public function removeErrorHandler(Closure $handler): void;", "public function restoreNativeHandler()\n {\n $this->callable = null;\n }", "public function __destruct() {\n if (!empty($this->exception_handler))\n restore_exception_handler();\n }", "public static function disableHandlers()\n {\n Core::removeErrorHandler(['\\FuzeWorks\\Logger', 'errorHandler'], Priority::NORMAL);\n Core::removeExceptionHandler(['\\FuzeWorks\\Logger', 'exceptionHandler'], Priority::NORMAL);\n }", "public function __destruct()\n {\n restore_error_handler();\n restore_exception_handler();\n }", "public function resetHandler()\n {\n $this->errno = null;\n $this->errstr = null;\n $this->errfile = null;\n $this->errline = null;\n $this->errcontext = null;\n $this->type = null;\n $this->trace = null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a list of all user who are not friends with the user.
function getNonFriends(){ $query=" SELECT DISTINCT u.user_id,u.username FROM users u,friends f WHERE u.user_id NOT IN( SELECT u1.user_id FROM users u1,friends f1 WHERE f1.friend1=$this->userid AND f1.friend2=u1.user_id UNION SELECT u2.user_id FROM users u2,friends f2 WHERE f2.friend2=$this->userid AND f2.friend1=u2.user_id ) AND u.user_id <> $this->userid LIMIT 20 "; $result=$this->link->query($query); return $result; }
[ "public function usersNotIn()\n {\n if ($this->id > 0) {\n $userIds = $this->users()->lists('user_id');\n $users = User::where('deleted', '=', User::NOT_DELETED_USERS)->whereNotIn('id', $userIds)->get();\n } else {\n $users = User::where('deleted', '=', User::NOT_DELETED_USERS)->get();\n }\n\n return $users->lists('fullname', 'id');\n }", "public function findAllUsersWithoutProfiles();", "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "public static function findUsersWithoutConnections()\n {\n $connections = Connection::find()->where([\"patient_id\" => Yii::$app->user->id])->all();\n $connIDs = [];\n foreach ($connections as $connection) {\n $connIDs[] = $connection->user_id;\n }\n \n $users = self::find()->where(['NOT IN', 'id', $connIDs])->all();\n \n return $users;\n }", "function get_all_but_not_this_user($usr)\n{\n $user=$usr->__get('uid');\n $con = connect();\n\t$q1=mysqli_query($con,\"SELECT * FROM user WHERE UId != '$user'\");\n\treturn $q1;\n}", "public function getAllUsersExceptUserAuth()\n {\n $user = $this->getUserAuth();\n return $this->repository->findWhereNotIn('id', [$user->id]);\n }", "public function allExceptUser(User $user)\n {\n return User::where('id', '!=', $user->id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function getNonRegisteredUsers()\n {\n $q = Doctrine_Query::create()\n ->from('sfGuardUser u')\n ->innerJoin('u.Profile p')\n ->where('p.'.$this->getEmailHashColumn().' IS NULL');\n\n return $q->execute()->getData();\n }", "public function getAllExceptUser()\n {\n $conn = Db::getConnection();\n\n //<> is the same as !=\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email <> :email\");\n $statement->bindValue(':email', $this->getEmail());\n $statement->execute();\n $users = $statement->fetchAll(\\PDO::FETCH_OBJ);\n\n return $users;\n }", "public function getNotModeratedUsers()\n {\n return $this->userRepository->getNotModeratedUsers();\n }", "public function notFriend($friends, $notfriends, $user){\r\n\t\t\r\n\t\t$userRecomend = new ArrayCollection();\r\n\r\n\t\tforeach($notfriends as $user1) {\r\n\t\t\r\n\t\t\tif(!$friends->contains($user1) && $user1 != $user){ //comprobamos que los usuarios encontrados no sean amigos mios y que no sea yo\r\n\t\t\t\t$userRecomend->add($user1);\r\n\t\t\t\tif($userRecomend->count() > 4){//hasta cuatro usuarios\r\n\t\t\t\t\treturn $userRecomend;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $userRecomend;\r\n\t}", "public function getUsersWithoutKids() {\n\t\t$users = array();\n\t\t$data = self::$connection->selectValues(\"SELECT email,name,vorname,registered,user.id,eltern.id \n\t\tFROM user,eltern \n\t\tWHERE user.id = eltern.userid order by registered\");\n\t\tif ($data) {\n\t\tforeach ($data as $d) {\n\t\t\t\t$users[] = array(\"name\"=>$d[1],\"vorname\"=>$d[2],\"mail\"=>$d[0],\n\t\t\t\t\"registered\"=>$d[3],\"id\"=>$d[4],\"eid\"=>$d[5]);\n\t\t\t\t}\t\t\n\t\t\t}\n\n\t\t$unused = array();\n\t\tforeach ($users as $u) {\n\t\t\t$data = self::$connection->selectValues(\"SELECT id FROM schueler WHERE eid = \".$u['eid'].\" OR eid2= \".$u['eid']);\n\t\t\tif (!$data[0][0] ) {\n\t\t\t\tarray_push($unused,$u);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn $unused;\n\t}", "Public Function getAllNonDeletedUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user WHERE deleted = 0');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "public function getUsersToExcludeFromNotification();", "public function findAllNotSubscribedToBy(FrontendUser $user)\n {\n $q = $this->createQuery();\n\n $q->matching($q->logicalNot($q->contains('feUsers', [$user->getUid()])));\n\n $q->setOrderings(['sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING]);\n\n return $q->execute();\n }", "public function findUsersWithoutMe($me)\n {\n $query = $this->createQueryBuilder('p')\n ->where('p.id != :me') #without the current user logged in\n ->setParameter('me', $me)\n ->getQuery()\n ->getResult();\n\n return $query;\n\n }", "private function get_not_active_users(){\n\n\t\tglobal $wpdb;\n\n\t\t$how_many = apply_filters( 'sfn_prune_how_many_users', 200 );\n\n\t\t$query = $wpdb->prepare( \"SELECT * FROM $wpdb->signups WHERE active = %d LIMIT %d\", 0, absint( $how_many ) );\n\t\t$users = $wpdb->get_results( $query );\n\n\t\treturn $users;\n\n\t}", "public function getNotSeen($user)\n\t{\n\t\t$query = $this->model->whereHas('users', function ($query) use ($user) {\n $query->where('user_id', '=', $user->id);\n \t$query->where('seen', '=', 0);\n });\n\n\t\treturn $query->get();\n\t}", "function getAllNonPublisherUsers() {\n\t\t$result = $this->_connection->selectAllFrom ( \"non_publisher_users_view\" );\n\t\t$output = [ ];\n\t\twhile ( $row = $result->fetch () ) {\n\t\t\tarray_push ( $output, new User ( $row ) );\n\t\t}\n\t\treturn $output;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the user can delete the post category.
public function delete(User $user) { return $user->hasPermissionTo('delete post category') || $user->hasPermissionWithRole('delete post category'); }
[ "public function canDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$topics = $this->getModel()->getList();\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$post = $this->getService('com://site/ninjaboard.model.posts')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->first_post_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $post->created_by != $user->id) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function delete(User $user) {\n return $user->can('delete-category');\n }", "public function canDelete(): bool\n {\n if (Auth::getLoggedInUserId() == $this->user_id || Auth::isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "public function isDeleteAllowed()\n {\n return $this->isAllowedAction('delete');\n }", "private function canDelete(): bool\n {\n return $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN');\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "public function delete()\n {\n return auth()->user()->can('user_delete');\n }", "public function canDelete()\n {\n if ($this->created_by == Yii::$app->user->id) {\n return true;\n }\n\n return false;\n }", "public function delete(User $user)\n {\n return $user->can('delete_article_categories');\n }", "public function delete($user, $category)\n {\n if (Category::first()->id == $category->id) {\n return false;\n }\n\n $user = User::findOrFail($user->id);\n\n return $user->superAdmin() || $user->hasPermission('laralum::shop.category.delete');\n }", "public function canDelete() {\n return !$this->anySubmissions() && !$this->anyManualGrades() && !$this->anyTeams();\n }", "public function userCanDelete($user) {\n // if the user is a guest\n if (!isset($user)) return false;\n\n // if the user is the author of the post\n if ($this->author->user_id == $user->user_id) return true;\n\n // if the user can delete posts for this post's page\n $permissions = Permission::where('user_id', '=', $user->user_id)\n ->where('charity_id', '=', $this->page->charity->charity_id)\n ->where(function($query) {\n $query->where('page_id', '=', $this->page->page_id)\n ->orWhere('page_id', '=', 0);\n })\n ->count();\n \n return $permissions > 0;\n\n }", "function current_user_can_delete() {\n\t\treturn false;\n\t}", "public function delete(User $user, Post $post)\n {\n # admin\n if ($user->isAdmin()) {\n return true;\n }\n\n # owner\n if ($user->id == $post->author_id) {\n return true;\n }\n\n # moderator can delete post in its category\n if ($user->isModerator($post->category_id)) {\n return true;\n }\n\n return false;\n }", "public function current_user_can_delete() {\n\n\t\tglobal $wpdb;\n\n\t\t$comment_id = absint( $this->id );\n\n\t\t// If comment id is empty return false.\n\t\tif ( 0 === $comment_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Allow admins to delete the comment.\n\t\tif ( current_user_can( 'administrator' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Only allow the same user to delete his own comment.\n\t\t$current_user_id = get_current_user_id();\n\t\t$comment_user = $wpdb->get_var( \"SELECT user FROM $this->model WHERE id = $comment_id\" ); // Db call ok; no-cache pass.\n\t\t$comment_user = absint( $comment_user );\n\n\t\tif ( ! empty( $comment_user ) ) {\n\t\t\tif ( $current_user_id === $comment_user ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t// No conditions met? return false.\n\t\treturn false;\n\t}", "public function userWantsToDeletePost() : bool {\n return $this->userWantsToViewPost() && $this->isRequestPOSTHeaderPresent(self::$postDelete);\n }", "public function canDelete()\n {\n return !$this->isAssigned();\n //nikto ho este neriesil\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the facets configuration
public function getFacetsFilter() { if($this->facetConfiguration === null) { $this->facetConfiguration = array(); if($serializeFacets = Mage::getStoreConfig('antidot/engine/facets')) { $facets = unserialize($serializeFacets); foreach($facets as $facet) { list($facetId) = explode('|', $facet['facet']); $this->facetConfiguration[$facetId] = $facet; } } } return $this->facetConfiguration; }
[ "public function getFacetSourceConfig();", "protected function getFacetInfo() {\n $adapter = $this->getFacetapiAdapter();\n if ($adapter) {\n $adapter->processFacets();\n $facets = $adapter->getEnabledFacets();\n\n // Allow other modules to limit the displayed facets for a solr block.\n drupal_alter('solr_bean_facets', $facets);\n\n return $facets;\n }\n }", "public function getFacet(){}", "public function getFacet();", "public function get_option_facet() {\n\t\treturn self::get_option( true, self::OPTION_FACET, [] );\n\t}", "public function getGridConfig();", "private function getFacetParameters()\n {\n // Retrieve all the query parameters for facets.\n $facetQueryParams = $this->request->query->get('facets');\n\n // Get parameters for current facet if there are any.\n if (isset($facetQueryParams[$this->index])) {\n return $facetQueryParams[$this->index];\n }\n\n return [];\n }", "public function getFaceDetectionConfig()\n {\n return $this->face_detection_config;\n }", "public function getFacetData()\n {\n //check to see if facet exists and return output\n return $this->solrFacetCollection;\n }", "public function getFacets() {\n\t\treturn Mage::helper('solr')->getResponse()->getFacetFields();\n\t}", "public function getFacets() {\n return $this->facets;\n }", "public function getEngineConfig()\r\n\t{\r\n\t\t$sEngine = strtolower(substr(get_class($this), 10));\r\n\t\treturn self::getConfigFor($sEngine);\r\n\t}", "private function get_components_config() {\n\t\t$settings = [];\n\n\t\tforeach ( $this->get_components() as $id => $instance ) {\n\t\t\t$settings[ $id ] = $instance->get_settings();\n\t\t}\n\n\t\treturn $settings;\n\t}", "public function getFacet() {\n return $this->facet;\n }", "public function get_facets() {\r\n if (isset($this->page)) {\r\n return $this->page['facets'];\r\n }\r\n return NULL;\r\n }", "public function getFacets() {\n return $this->facets;\n }", "public function getFacetFields() {\n\t}", "public function getFacetSpecs()\n {\n return $this->facet_specs;\n }", "protected function getEngineOptions()\n {\n return ProjectX::getContainer()\n ->get('projectXEngineResolver')\n ->getOptions();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends out a lost password mail to the given account
private function sendLostPasswordMail(Account $account) { $mailText = 'Hello ' . $account->getName() . ', a password reset for your account was requested. ' . 'If you didn\'t request a password reset, you don\'t need to do anything. If you really want to ' . 'reset your password, please follow the given link: ' . $_SERVER['SERVER_NAME'] . '/account/resetpassword/' . $account->getUserHash(); $this->appMailService->sendMail($account->getEmail(), 'Password Reset', $mailText); }
[ "public function sendForgotPasswordMail()\n {\n Mail::to($this->email)->send(new ForgotPassMail($this));\n }", "public function sendPassword() {\n if ( !$this->emailAddress ) return;\n $headers = \"From: \" . PASSWORD_EMAIL_FROM_NAME . \" <\" . PASSWORD_EMAIL_FROM_ADDRESS . \">\";\n ob_start();\n require( TEMPLATE_PATH . \"/passwordEmail.php\" );\n $message = ob_get_contents();\n ob_clean();\n $success = mail( $this->emailAddress, PASSWORD_EMAIL_SUBJECT, $message, $headers );\n }", "public function sendPasswordEmail(){\n\t\t\t$hash = md5($this->username . self::PASSWORD_SALT);\n\n\t\t\t$changeLink = \"http://www.theproblem.dreamhosters.com/login/newPassword?username=\" . $this->username . \"&code=\" . $hash;\n\n\t\t\t$to = $this->email;\n\t\t\t$subject = \"Change your\" . htmlentities(Pages::$template->title) . \"Password\";\n\n\t\t\t$messageHTML = \n\n\t\t\t\t\t\t'<body style=\"padding-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom: 0px; margin-left: 0px; margin-right: 0px;' \n\t\t\t\t\t\t. 'margin-top: 0px; margin-bottom: 0px\"><div style=\"font-family: sans-serif\">'. \"\\r\\n\" \n\t\t\t\t\t\t.\"<h1>Want your password changed?</h1>\"\n\t\t\t\t\t\t.\"<p>Click the link below to be taken to the password change page.</p><br>\"\n\t\t\t\t\t\t.'<a href=\"' . $changeLink . '\">' . $changeLink . \"</a></div></body>\";\n\n\n\t\t\t$headers = \"From: noreply@theproblem.dreamhosters.com\" . \"\\r\\n\";\n\t\t\t$headers .= \"Reply-To: noreply@theproblem.dreamhosters.com\" . \"\\r\\n\";\n\t\t\t$headers .= \"Content-type: text/html\" . \"\\r\\n\";\n\n\t\t\treturn mail($to, $subject, $messageHTML, $headers);\n\t\t}", "public function sendPasswordRecoveryEmail(string $email);", "private function password_reset()\n {\n //Load and store parameters\n $email = $this->Request->get('email');\n $this->responseSetParam('email', $email);\n\n //Try to retrieve corresponding user\n $UsersLib = new UsersLib($this->DB, $this->User);\n $user = $UsersLib->getFromEmail($email);\n if($user)\n {\n //Generate temporary password\n $PasswordHandler = new PasswordHandler();\n $password = $PasswordHandler->tempCreate($this->DB, $user->getID());\n\n //Send email with instructions\n $EmailHandler = new EmailHandler($this->DB);\n $EmailHandler->pattern(EmailHandler::TYPE_PASSWORDRESET, array(\n 'content' => 'text',\n 'recipient' => $email,\n 'user_id' => $user->getID(),\n 'firstname' => $user->getFirstname(),\n 'password' => $password\n ));\n }\n //Do not produce an error here because it would tell a potential attacker\n //that this email does not exist !\n else \n $this->close();\n }", "protected function sendLoginFailedMail()\n {\n $formValues = GeneralUtility::_GP('install');\n $warningEmailAddress = $GLOBALS['TYPO3_CONF_VARS']['BE']['warning_email_addr'];\n if ($warningEmailAddress) {\n /** @var \\TYPO3\\CMS\\Core\\Mail\\MailMessage $mailMessage */\n $mailMessage = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Mail\\MailMessage::class);\n $mailMessage\n ->addTo($warningEmailAddress)\n ->setSubject('Install Tool Login ATTEMPT at \\'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\\'')\n ->addFrom($this->getSenderEmailAddress(), $this->getSenderEmailName())\n ->setBody('There has been an Install Tool login attempt at TYPO3 site'\n . ' \\'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\\''\n . ' (' . GeneralUtility::getIndpEnv('HTTP_HOST') . ')'\n . ' The last 5 characters of the MD5 hash of the password tried was \\'' . substr(md5($formValues['password']), -5) . '\\''\n . ' remote address was \\'' . GeneralUtility::getIndpEnv('REMOTE_ADDR') . '\\''\n . ' (' . GeneralUtility::getIndpEnv('REMOTE_HOST') . ')')\n ->send();\n }\n }", "public function pwForgot() {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n\n\n if($activation = \\Activation::completed($user)) {\n // User is activated so create the activation url and email it to the user.\n $uri = '/register/' . 'pwreset/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->pwResetEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with password reset instructions.\";\n } else {\n // User not activated yet\n $activation = \\Activation::exists($user);\n // Create the activation url and email it to the user.\n $uri = '/register/' . 'activation/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->activationEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with activation instructions.\";\n }\n return $this->render('emails/test');\n }", "public function forget_password()\n\t{\n\t\t$this->layout = 'login';\n\t\tif( !empty( $this->request->data ) ){\n\t\t\t$email = $this->request->data['User']['email'];\n\t\t\t$password = $this->randomPassword();\n\t\t\t$password1 = $this->Auth->password( $password );\n\t\t\t$this->User->query(\"UPDATE users SET password = '$password1' WHERE email = '$email'\");\n\t\t\t$to = $email;\n\t\t\t$subject = \"New Password Request\";\n\t\t\t$txt = \"Your New Password \".$password;\n\t\t\t$headers = \"From: admin@smarttutorials.net\" . \"\\r\\n\" .\n\t\t\t\t\t\"CC: admin@smarttutorials.net\";\n\t\t\t\n\t\t\tif( mail($to,$subject,$txt,$headers) ){\n\t\t\t\t$this->Session->setFlash(FORGET_PASSWORD_SUCCESS, 'default', array( 'class' => 'message error'), 'success' );\n\t\t\t\treturn $this->redirect(BASE_PATH.'login');\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash(FORGET_PASSWORD_FAILURE, 'default', array( 'class' => 'message error'), 'error' );\n\t\t\t\treturn $this->redirect(BASE_PATH.'forget_password');\n\t\t\t}\n\t\t}\n\t}", "public function emailPasswordReset()\n {\n $email = $this->getEmailInstance();\n $email->subject('Requested Password Reset')\n ->template('Propeller/Users.reset_password')\n ->send();\n }", "public function sendRestoreMail(LAccount $account) {\n $this->errorCode = 0;\n $onetime = LOneTime::create($account->uid);\n $message = new YiiMailMessage();\n if (isset($this->restoreMailSubjectCallback))\n $subject = call_user_func($this->restoreMailSubjectCallback, $account);\n if (!isset($subject) || !is_string($subject))\n $subject = LilyModule::t('Password restoration on {siteName}', array('{siteName}' => Yii::app()->name));\n $message->setSubject($subject);\n $message->view = $this->restoreMailView;\n if (isset($this->restoreMailView))\n $message->setBody(array('account' => $account), 'text/html');\n else\n $message->setBody(LilyModule::t('Your email is registered on <a href=\"{siteUrl}\">{siteName}</a>.<br />\nAnd someone (possibly you) requested password restoration. <br />\nIf it was you, open <a href=\"{restoreUrl}\">link</a></li> in your browser in order to login on website and then change the password in account settings. <br />\n<br />\nYours respectfully,<br />\nadministration of {siteName}.', array('{siteUrl}' => Yii::app()->createAbsoluteUrl(Yii::app()->homeUrl), '{siteName}' => Yii::app()->name,\n '{restoreUrl}' => Yii::app()->createAbsoluteUrl('/'.LilyModule::route('user/onetime'), array('token' => $onetime->token)))), 'text/html');\n $message->addTo($account->id);\n $message->from = $this->adminEmail;\n $recipient_count = Yii::app()->mail->send($message);\n if ($recipient_count > 0)\n Yii::log('E-mail to ' . $account->id . ' was sent.', CLogger::LEVEL_INFO, 'lily');\n else\n Yii::log('Failed sending e-mail to ' . $account->id . '.', CLogger::LEVEL_WARNING, 'lily');\n $this->errorCode = $recipient_count == 0;\n return $recipient_count > 0;\n }", "protected function sendPasswordResetEmail()\n {\n\n $url = 'http://' . $_SERVER['HTTP_HOST'] . '/museum/gamify/password/reset/' . $this->reset_token;\n\n $text = View::getTemplate('Password/reset_email.txt', array('url' => $url));\n $html = View::getTemplate('Password/reset_email.html', array('url' => $url));\n\n Mail::send($this->email, 'Password reset request', $text, $html);\n }", "function forgetpassword()\n\t{\n\t\t$this->checklogin();\n\t\tif(!isset($_POST['forget-email']))\n\t\t{\n\t\t\t$redirect();\n\t\t}\n\n\t\t$email = $_POST['forget-email'];\n\t\t$code = hash('ripemd160','forget'.$email.''.time());\n\t\t$db=$this->getDbo();\n\t\t$eml = $db->quote($email);\n\t\t$sql = \"UPDATE users SET confirm_code= '$code' WHERE email= ?\";\n\t\t$query = $db->prepare($sql,array($eml));\n\t\tif($query->rowCount())\n\t\t{\n\t\t\t$this->sendResetEmail($code,$email);\n\t\t\t$message = 'Your reset password information has been sent to your email address.';\n\t\t\t$heading = 'Success';\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'You have provide invalid email address';\n\t\t\t$heading = 'Error';\n\t\t}\n\t\trequire('applications/account/message.php');\n\t}", "public function enviaPasswordMail()\n\t\t{\n\t\t\t\t$message = \"G'Day!\n\t\t\t\t \n\t\t\t\tYour personal account for the Project Web Site\n\t\t\t\thas been created! To log in, proceed to the\n\t\t\t\tfollowing address:\n\t\t\t\t \n\t\t\t\thttp://www.example.com/\n\t\t\t\t \n\t\t\t\tYour personal login ID and password are as follows:\n\t\t\t\t \n\t\t\t\tuserid: $_POST[newid]\n\t\t\t\tpassword: $newpass\n\t\t\t\t \n\t\t\t\tYou aren't stuck with this password! You can change it at any time after you have logged in.\n\t\t\t\t \n\t\t\t\tIf you have any problems, feel free to contact me at <you@example.com>.\n\t\t\t\t \n\t\t\t\t-Your Name\n\t\t\t\tYour Site Webmaster\n\t\t\t\t\";\n\t\t\t\t \n\t\t\t\tmail($_POST['newemail'],\"Your Password for Your Website\",\n\t\t\t\t$message, \"From:Your Name <you@example.com>\");\n\t\t\t\t$newpass = substr(md5(time()),0,6);\n\t\t}", "protected function sendPasswordResetEmail() {\r\n $url = 'http://' . $_SERVER['HTTP_HOST'] . '/' . \\App\\Config::SITE_NAME . '/password/reset/' . $this->password_reset_token;\r\n \r\n $text = \"Please click on the following URL to reset your password: $url\";\r\n $html = \"Please click <a href=\\\"$url\\\">here</a> to reset your password.\";\r\n \r\n Mail::send($this->email, 'Password reset', $text, $html);\r\n }", "public function forgotPasswordAction()\n {\n $email = $this->getRequest()->getPost('email');\n if ($email) {\n if (!Zend_Validate::is($email, 'EmailAddress')) {\n $this->_message($this->__('Invalid email address.'), self::MESSAGE_STATUS_ERROR);\n return;\n }\n $customer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email);\n\n if ($customer->getId()) {\n try {\n $newPassword = $customer->generatePassword();\n $customer->changePassword($newPassword, false);\n $customer->sendPasswordReminderEmail();\n $this->_message($this->__('A new password has been sent.'), self::MESSAGE_STATUS_SUCCESS);\n return;\n } catch (Mage_Core_Exception $e) {\n $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);\n } catch (Exception $e) {\n $this->_message($this->__('Problem changing or sending password.'), self::MESSAGE_STATUS_ERROR);\n }\n } else {\n $this->_message(\n $this->__('This email address was not found in our records.'), self::MESSAGE_STATUS_ERROR\n );\n }\n } else {\n $this->_message($this->__('Customer email not specified.'), self::MESSAGE_STATUS_ERROR);\n }\n }", "public function forgottenPassword()\n {\n $payload = $this->assertRequestPayloadItem();\n $account = Account::fetchByEmail($payload['email_address']);\n if ($account)\n {\n $new_password = str_random(8);\n $account->hashAndSetPassword($new_password);\n $account->save();\n\n Mail::send('emails.agrarify.password_reset', ['password' => $new_password], function($message) use ($account)\n {\n $message->from(Config::get('agrarify.support_address'), Config::get('agrarify.app_name'));\n $message->to($account->getEmailAddress());\n $message->subject('Your ' . Config::get('agrarify.app_name') . ' password has been reset');\n });\n\n return Response::make('');\n }\n return $this->sendErrorNotFoundResponse();\n }", "function lostPassword()\n\t{\n\t\t$messageNoAccess = null;\n\t\t$form = new Piwik_Login_PasswordForm();\n\t\t$currentUrl = 'index.php';\n\t\t$urlToRedirect = Piwik_Common::getRequestVar('form_url', $currentUrl, 'string');\n\t\t$urlToRedirect = htmlspecialchars_decode($urlToRedirect);\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$loginMail = $form->getSubmitValue('form_login');\n\t\t\t$messageNoAccess = $this->lostPasswordFormValidated($loginMail, $urlToRedirect);\n\t\t}\n\n\t\t$view = Piwik_View::factory('lostPassword');\n\t\t$view->AccessErrorString = $messageNoAccess;\n\t\t// make navigation login form -> reset password -> login form remember your first url\n\t\t$view->urlToRedirect = $urlToRedirect;\n\t\t$view->linkTitle = Piwik::getRandomTitle();\n\t\t$view->addForm( $form );\n\t\t$view->subTemplate = 'genericForm.tpl';\n\t\techo $view->render();\n\t}", "function send_lostpassword($user_info, $lostpassword_code) {\n\tglobal $setting, $url;\n\n\t// GET SERVER INFO\n\t$prefix = $url->url_base;\n\n\t// DECODE SUBJECT AND EMAIL FOR SENDING\n\t$subject = htmlspecialchars_decode($setting[setting_email_lostpassword_subject], ENT_QUOTES);\n\t$message = htmlspecialchars_decode($setting[setting_email_lostpassword_message], ENT_QUOTES);\n\n\t// REPLACE VARIABLES IN EMAIL SUBJECT AND MESSAGE\n\t$subject = str_replace(\"[username]\", $user_info[user_username], $subject);\n\t$message = str_replace(\"[username]\", $user_info[user_username], $message);\n\t$subject = str_replace(\"[email]\", $user_info[user_email], $subject);\n\t$message = str_replace(\"[email]\", $user_info[user_email], $message);\n\t$subject = str_replace(\"[link]\", \"<a href=\\\"$prefix\".\"lostpass_reset.php?user=$user_info[user_username]&r=$lostpassword_code\\\">$prefix\".\"lostpass_reset.php?user=$user_info[user_username]&r=$lostpassword_code</a>\", $subject);\n\t$message = str_replace(\"[link]\", \"<a href=\\\"$prefix\".\"lostpass_reset.php?user=$user_info[user_username]&r=$lostpassword_code\\\">$prefix\".\"lostpass_reset.php?user=$user_info[user_username]&r=$lostpassword_code</a>\", $message);\n\n\t// ENCODE SUBJECT FOR UTF8\n\t$subject=\"=?UTF-8?B?\".base64_encode($subject).\"?=\";\n\n\t// REPLACE CARRIAGE RETURNS WITH BREAKS\n\t$message = str_replace(\"\\n\", \"<br>\", $message);\n\n\t// SET HEADERS\n\t$from_email = \"$setting[setting_email_fromname] <$setting[setting_email_fromemail]>\";\n\t$headers = \"MIME-Version: 1.0\".\"\\n\";\n\t$headers .= \"Content-type: text/html; charset=utf-8\".\"\\n\";\n\t$headers .= \"Content-Transfer-Encoding: 8bit\".\"\\n\";\n\t$headers .= \"From: $from_email\".\"\\n\";\n\t$headers .= \"Return-Path: $from_email\".\"\\n\";\n\t$headers .= \"Reply-To: $from_email\";\n\n\t// SEND MAIL\n\t@mail($user_info[user_email], $subject, $message, $headers);\n \n\treturn true;\n}", "protected function sendPasswordResetEmail()\n {\n $url = 'http://' . $_SERVER['HTTP_HOST'] . '/fyp/public/?Admin/Password/reset/' .\n $this->password_reset_token;\n $text = View::getTemplate('Password/reset_email.txt', ['url' => $url]);\n $html = View::getTemplate('Password/reset_email.html', ['url' => $url]);\n\n Mail::send($this->UA_EMAIL, 'Password reset', $text, $html);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Connect to memcache server
public function connect() { $this->memcache = new Memcache(); $servers = CacheMemcache::getMemcachedServers(); if (!$servers) return false; foreach ($servers as $server) $this->memcache->addServer($server['ip'], $server['port'], $server['weight']); $this->is_connected = true; }
[ "public function connect()\n {\n \n $this->_memcached = new \\Memcache(); \n $this->_memcached->connect( \"10.10.10.140\", 11211);\n\n \n // $this->_memcached->setOption(\\Memcache::OPT_CONNECT_TIMEOUT, 10);\n // $this->_memcached->setOption(\\Memcache::OPT_DISTRIBUTION, \\Memcache::DISTRIBUTION_CONSISTENT);\n // $this->_memcached->setOption(\\Memcache::OPT_SERVER_FAILURE_LIMIT, 2);\n // $this->_memcached->setOption(\\Memcache::OPT_REMOVE_FAILED_SERVERS, true);\n // $this->_memcached->setOption(\\Memcache::OPT_RETRY_TIMEOUT, 1);\n \n // $this->_memcached->addServers( $this->host );\n \n $this->isConnected = true;\n }", "private function cacheConnect()\n\t{\n\t\t$_memcacheConnected=false; // connected bool\n\t\t\n\t\tif (class_exists('Memcache')) {\n\n $this->__cache = new Memcache();\n\t\t\t\n\t\t\t$_server=$this->get('memcacheserver');\n\t\t\t$_port=$this->get('memcacheserverport');\n\t\t\t\n\t\t\t\tif (@$this->__cache->connect($_server, $_port)) {\n\t\t\t\t\t$_memcacheConnected=true;\n\t\t\t\t\t$this->set('memcacheversion',$_memcacheVersion=memcache_get_version($this->__cache));\n\t\t\t\t}\n\t\t\t\t\n } \n\t\t$this->set('memcacheconnected',$_memcacheConnected);\n }", "private function connect(){\n\t\tforeach($this->servers as $server){\n\t\t\t$this->memcache->addServer($server['host'], $server['port']);\n\t\t}\n\t}", "function memcached_connect()\r\n{\r\n\t$m = new Memcached();\r\n\t$m->addServer('localhost', 11211);\r\n\treturn $m;\r\n}", "private function connect() {\r\n $this->_db = new memcache;\r\n return $this->_db->connect($this->host, $this->port);\r\n }", "public function connect(){\n $memcached = memcached_connect();\n dump($memcached);\n }", "private function connect() {\n if (!class_exists('Memcache')) return FALSE;\n $this->client = new Memcache;\n $this->client->connect($this->host, $this->port) or die (\"Could not connect to cache.\");\n\n return TRUE;\n }", "private function connect() {\n if ($this->srv_address == \"\") {\n trigger_error('No memcache servers to connect', E_USER_WARNING);\n exit();\n }\n list($ip, $port) = explode(\":\", $this->srv_address);\n $port = ($port == \"\") ? 11211 : $port;\n\n $this->conn = @memcache_pconnect($ip, $port);\n if (!$this->conn) {\n $this->is_connect = false;\n trigger_error('Cannot connect to memcached server ' . $this->srv_address, E_USER_WARNING);\n } else {\n $this->is_connect = true;\n }\n\n return $this->is_connect;\n }", "function open_memcache_connection()\n{\n\t$mem = new Memcached();\n\t$mem->addServer('web-demo.xxxxxx.0001.use2.cache.amazonaws.com', 11211);\t// node 1\n\t$mem->addServer('web-demo.xxxxxx.0002.use2.cache.amazonaws.com', 11211);\t// node 2\n\t$mem->addServer('web-demo.xxxxxx.0003.use2.cache.amazonaws.com', 11211);\t// node 3\n\treturn $mem;\n}", "function mc_conn(){\n\tif(empty(Consts::$cache_hosts)){\n\t\treturn false;\n\t}else{\n\t\t$conn = new Memcached(APP_NAME);\n\t\t$hosts=explode(\",\", Consts::$cache_hosts);\n\t\t$ss = $conn->getServerList();\n\t\tif (empty ( $ss )) {\n\t\t\t$conn->setOption(Memcached::OPT_RECV_TIMEOUT, 1000);\n\t\t\t$conn->setOption(Memcached::OPT_SEND_TIMEOUT, 1000);\n\t\t\t$conn->setOption(Memcached::OPT_TCP_NODELAY, true);\n\t\t\t$conn->setOption(Memcached::OPT_SERVER_FAILURE_LIMIT, 50);\n\t\t\t$conn->setOption(Memcached::OPT_CONNECT_TIMEOUT, 500);\n\t\t\t$conn->setOption(Memcached::OPT_RETRY_TIMEOUT, 300);\n\t\t\t$conn->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);\n\t\t\t$conn->setOption(Memcached::OPT_REMOVE_FAILED_SERVERS, true);\n\t\t\t$conn->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);\n\t\t\tforeach ($hosts as $host){\n\t\t\t\tlist($h,$p) = explode(\":\",trim($host));\n\t\t\t\t$conn->addServer ($h, isset($p)&&$p!=\"\"?(int)$p:11211, 1 );\n\t\t\t}\n\t\t}\n\t\treturn $conn;\n\t}\n}", "public function _connect() {\n\t\t\n\t\t$instanceHash = sprintf( 'memcached://%s:%d', $this->_host, $this->_port );\n\t\t\n\t\t// already having instances for this connection\n\t\tif ( isset( self::$_pool[ $instanceHash ] ) == true && self::$_pool[ $instanceHash ] instanceof Memcached ) {\n\t\t\tself::$_connection = self::$_pool[ $instanceHash ];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tself::$_connection = new Memcached( $instanceHash );\n\t\tself::$_connection->addServer( $this->_host, $this->_port );\n\t\tself::$_connection->setOption( Memcached::OPT_POLL_TIMEOUT, $this->_timeout );\n\t\tself::$_pool[ $instanceHash ] = self::$_connection;\n\t}", "private function connection() {\r\n\t\tif($this->servers) {\r\n\t\t\t$this->memcachedObject = new Memcached();\r\n\t\t\t$noServer = true;\r\n\t\t\tforeach ($this->servers as $server) {\r\n\t\t\t\t$parameters = explode(':', $server);\r\n\t\t\t\tif(!isset($parameters[1]))\r\n\t\t\t\t\t$parameters[1] = '11211';\r\n\t\t\t\t$this->memcachedObject->addServer($parameters[0], $parameters[1]);\r\n\t\t\t\t$status = $this->memcachedObject->getStats();\r\n\t\t\t\tif($status) {\r\n\t\t\t\t\t$noServer = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($noServer) {\r\n\t\t\t\t$this->noConnection = true;\r\n\t\t\t\tif ($this->log) {\r\n\t\t\t\t\t$this->log->error('Memcache Exception, unable to establish connection to memcached server');\r\n\t\t\t\t}\r\n\t\t\t\tif($this->crash) {\r\n\t\t\t\t\tthrow new MemcachedCachedException('Memcache Exception, unable to establish connection to memcached server');\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tthrow new MemcachedCachedException(\"Error no connection set in Memcached cache. Add it in the Mouf interface\");\r\n\t}", "private function _connect() {\n if (array_key_exists('apitype', $this->_config)) {\n if (!class_exists($this->_config['apitype'])) {\n $err = 'Not installed selected MCache api: [' . $this->_config['apitype'] . ']';\n if ($this->silentMode) {\n $this->errors[] = $err;\n } else {\n throw new MCache_Exception($err);\n }\n } else {\n $this->apitype = $this->_config['apitype'];\n }\n } else {\n $this->apitype = $this->_defaultApi;\n if (!class_exists($this->apitype)) {\n $err = 'Not installed ' . $this->apitype . '.';\n if ($this->silentMode) {\n $err .= ' Try ' . ($this->_defaultApi == MCache::API_MEMCACHE ? MCache::API_MEMCACHED : MCache::API_MEMCACHE);\n $this->errors[] = $err;\n } else {\n throw new MCache_Exception($err);\n }\n $this->apitype = ($this->_defaultApi == MCache::API_MEMCACHE ? MCache::API_MEMCACHED : MCache::API_MEMCACHE);\n if (!class_exists($this->apitype)) {\n $err = 'Not installed Memcache and Memcached';\n if ($this->silentMode) {\n $this->errors[] = $err;\n } else {\n throw new MCache_Exception($err);\n }\n }\n }\n }\n $this->stats['api'] = $this->apitype;\n if (array_key_exists('timeout', $this->_config)) {\n $this->timeoutDefault = $this->_config['timeout'];\n }\n $this->_resource = new $this->apitype;\n if (!array_key_exists('host', $this->_config)) {\n //Try to load from Config\n if (\n class_exists('Config') &&\n method_exists('Config', 'getInstance') &&\n method_exists('Config', 'have') &&\n method_exists('Config', 'get')\n ) {\n $config = Config::getInstance();\n $this->_config = $config->get('mcache');\n if (!array_key_exists('host', $this->_config)) {\n $this->_config['host'] = 'localhost';\n }\n } else {\n $this->_config['host'] = 'localhost';\n }\n }\n if (!array_key_exists('port', $this->_config)) {\n $this->_config['port'] = 11211;\n }\n if ($this->apitype == MCache::API_MEMCACHE) {\n $ret = $this->_resource->connect($this->_config['host'], $this->_config['port']);\n } else {\n $ret = $this->_resource->addServer($this->_config['host'], $this->_config['port']);\n }\n if ($ret === false) {\n $err = 'Wrong host or port for memcache server';\n if ($this->silentMode) {\n $this->errors[] = $err;\n } else {\n throw new MCache_Exception($err);\n }\n }\n return $this;\n }", "public function __construct(){\n\t\t$this->mc = new Memcache();\n\t\t$this->mc->connect('localhost',11211);\n }", "protected function connect()\n {\n if (is_null($this->memcached)) {\n $this->memcached = new \\Memcached();\n $this->memcached->addServer($this->host, $this->port);\n }\n\n return $this->memcached;\n }", "private static function memcache_open()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Create Memcached instance, add all servers in pool\n\t\t\t\t$memcache = new Memcached();\n\t\t\t\tforeach (self::$SERVERS as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t// Add server by host, port\n\t\t\t\t\t$memcache->addServer($key, $value);\n\t\t\t\t}\n\n\t\t\t\t// Set Memcached options\n\t\t\t\t$memcache->setOption(Memcached::OPT_COMPRESSION, self::CACHE_COMPRESSION);\n\n\t\t\t\treturn $memcache;\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Catch exception and throw error\n\t\t\t\ttrigger_error(\"database::memcache_open() could not open connection to memcache\", E_USER_WARNING);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "private function initialize() {\n // Check that Memcached PECL is installed/configured.\n if (!class_exists('Memcached')) {\n $this->logger->notice(\"Memcached PHP extension library is not installed/configured on this server.\");\n $this->isConnected = FALSE;\n return;\n }\n $this->memcached = new Memcached();\n\n // Optimize Memcached settings for more fluent fail-over.\n // See http://php.net/manual/en/memcached.addservers.php.\n $this->memcached->setOption(Memcached::OPT_CONNECT_TIMEOUT, 100);\n $this->memcached->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);\n $this->memcached->setOption(Memcached::OPT_REMOVE_FAILED_SERVERS, TRUE);\n\n // Retrieve configured servers.\n $configured_servers = $this->getConfiguredServers();\n\n // Only attempt to add servers when they're configured in environment\n // and are not already added to the daemon.\n if (!empty($configured_servers) && empty($this->memcached->getServerList())) {\n $servers = [];\n foreach ($configured_servers as $configured_server => $status) {\n $servers[] = explode(':', $configured_server);\n }\n\n $success = $this->memcached->addServers($servers);\n\n if (!$success) {\n $this->logger->error(\"Error initializing Memcache connection - Failed adding\n servers to Memcache daemon. \\nMemcache Result Message: {$this->memcached->getResultMessage()}\");\n $this->isConnected = FALSE;\n }\n }\n }", "protected function __construct()\n\t\t{\n\t\t\t$this->connect( MEMCACHED_HOST, MEMCACHED_PORT );\n\t\t}", "public final function initialize() {\n\t\t$this->_ensureModuleExistance();\n\t\t$this->_memcache = new Memcache();\n\t\t$this->_memcache->connect($this->_host, $this->_port);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that guests attempting to go to the homepage are redirected to the login page
public function testHomePageRedirectsGuestToLogin() { $this->visit('/')->seePageIs('/login'); }
[ "public function testLandingRedirectsToLoginIfNotAuthenticated()\n {\n $this->visit(route('home'))\n ->seePageIs(route('signin_get'));\n }", "public function testIndexRequestedByGuestUser(): void {\n \n $this->session(['Auth' => null]);\n $this->get(\"/user\");\n print $this->getActualOutput();\n $this->assertRedirectContains('/users/login');\n \n $this->get(\"/user/profile\");\n $this->assertRedirectContains('/users/login');\n \n }", "public function guest_visit_login_page_then_click_home_and_see_this_page()\n {\n $this->visit('/login')\n ->click('Home')\n ->seePageIs('/')\n ->seeText('Hello Guest!')\n ->seeLink('Register', '/register')\n ->seeLink('Login', '/login')\n ->seeLink('Home', '/');\n }", "public function test_login_page_loads_properly()\n {\n $this->visit('/')\n ->see(\"Email\")\n ->see(\"Password\")\n ->see(\"Login\")\n ->dontSee('You are logged in!');\n }", "public function testLandingRedirectToHome()\n {\n $response = $this->actingAs(User::find(1))\n ->get('/');\n\n $response->assertStatus(302);\n }", "public function testLoginPageLoadsProperly() {\n $this->visit('/')\n ->see(\"Login\")\n ->see(\"Username\")\n ->see(\"Password\")\n ->see(\"Sign in\")\n ->dontSee('Pathology Lab');\n }", "public function testHomepageAsGuest()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Demandes de formation')\n ->assertSee('Connexion')\n ->assertDontSee('Mes demandes')\n ->assertDontSee('Déconnexion')\n ->assertDontSee('Administration');\n });\n }", "public function testGuestRouteAuthenticated(){\n $user = factory(User::class)->make();\n $response = $this->actingAs($user)->get(route('guest'));\n $response->assertStatus(302);\n $response->assertRedirect(route('home'));\n }", "public function testLoginRedirect()\r\n\t{\r\n\t\t$user = Woodling::retrieve('User');\r\n\r\n\t\t// Retrieve credentials before saving, for plaintext password\r\n\t\t$params = array(\r\n\t\t\t'email'\t\t=> $user->email,\r\n\t\t\t'username'\t => $user->email,\r\n\t\t\t'password'\t => $user->password,\r\n\t\t);\r\n\r\n\t\t$user->save();\r\n\r\n\t\t// Login user\r\n\t\t$this->assertTrue(Confide::logAttempt($params));\r\n\r\n\t\t// Login page should redirect to home page\r\n\t\t$this->call('GET', 'user/login');\r\n\t\t$this->assertRedirectedTo('/');\r\n\t}", "public function testRedirectToLoginIfUserNotAuthenticatedAndAccessToAdminHomeUrl()\n {\n $response = $this->call('GET', $this->adminHomeUrl);\n $response->assertStatus(302);\n }", "public function testUserCanViewLoginPage() :void\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->waitFor('form')\n ->assertVisible('input#email')\n ->assertVisible('input#password');\n });\n }", "public function testHomePageForUnauthenticatedUsers()\n {\n $this->visit( '/home' )\n ->seePageIs( '/login' );\n }", "public function testIndexActionWhenNotAuthenticatedRedirectsToLogin()\n {\n $this->get('/admin/users');\n $this->assertRedirectsTo('/session/login');\n }", "public function testLoginWithAdminRedirect()\n {\n $this->visit('/admin')\n ->seePageIs('/auth/login')\n ->see('Login')\n ->type('gnanakeethan@gmail.com', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n\n }", "public function test_setting_private_site_enabled_guest_redirect_to_login()\n {\n setting()->set('private_site', 1);\n $this->get('/')\n ->assertStatus(302)\n ->assertRedirect('/login');\n }", "public function testUnauthenticatedSeesLogin()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login');\n });\n }", "public function testGuestUserCanAccessLoginPageWithForm()\n {\n $this->builder->unAuthorised();\n\n $this->dispatch('/en_GB/user-auth/login', 'GET');\n $this->assertResponseStatusCode(200);\n $this->assertQuery('form[method=\"post\"][name=\"login-form\"]');\n // ensure that input with name email exists \n $this->assertQuery('input[name=\"email\"][type=\"email\"]');\n // ensure that input with name password exists \n $this->assertQuery('input[name=\"password\"][type=\"password\"]');\n $this->assertQuery('input[name=\"submit\"][type=\"submit\"]');\n $this->assertQuery('input[name=\"csrf\"][type=\"hidden\"]');\n $this->assertQuery('input[name=\"remember_me\"][type=\"checkbox\"]');\n $this->assertQuery('a[href*=\"user/forgotten-password\"]');\n $this->assertModuleName('AclUser');\n $this->assertControllerName('user-auth');\n $this->assertControllerClass('AuthController');\n $this->assertActionName('login');\n }", "public function testViewLogin() {\n $this->visit('http://londonce.lan/login')\n ->see('Login');\n }", "public function testGuestAdmin()\n {\n $this->visit('/admin')\n ->seePageIs('/login')\n ->see('Register')\n ->see('Login')\n ->dontSee('Brackets')\n ->dontSee('Amdin')\n ->dontSee('Home');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete an object from LDAP. Optionally you can set the second argument to true which sends a control to LDAP to perform a recursive deletion. This is helpful in the case of deleting an OU with with objects underneath it. By setting the second parameter to true the OU and all objects below it would be deleted. Use with care! If recursive deletion does not work, first check that 'accidental deletion' is not enabled on the object (AD).
public function delete(LdapObject $ldapObject, $recursively = false) { $this->getObjectManager()->delete($ldapObject, $recursively); return $this; }
[ "public function delete(){\n\t\treturn ldap_delete($this->connection, $this->dn);\n\t}", "public function deleteAcl($object);", "public function deleteOne($object);", "public function delete($object);", "public function delete(Blog $object);", "public function delete($instance)\n {\n $dn = $this->buildEntityDn($instance);\n $this->logger->debug('Delete in LDAP: ' . $dn );\n $this->deleteByDn($dn, true);\n return;\n }", "function deleteOne($object);", "function delRelByObject(){\n\t\t$this->result['status'] == true;\n\t\tif(!$this->check_exitTable()){\n\t\t\t$this->result['status'] == false;\n\t\t\t$this->result['message'] .= \"Table [\".SQL_PREFIX.$this->tableName.\"] not exits\";\n\t\t\treturn false;\n\t\t}\n\t\tif($this->objectId){\n\t\t\t$condition=\"objectId in ($this->objectId)\";\n\t\t\t$this->setCondition($condition);\n\t\t\t$this->deleteObjectByCondition();\n\t\t}\n\t\treturn true;\n\t}", "function record_delete()\n\t{\n\t\tlog_write(\"debug\", \"ldap_query\", \"Executing record_delete()\");\n\n\t\tif (ldap_delete($this->ldapcon, $this->record_dn .\",\". $this->srvcfg[\"base_dn\"]))\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\n\t}", "abstract protected function deleteRemoteObject( $object );", "public function delete() {\n\n // Does the Access object have an ID?\n //if ( is_null( $this->id ) ) trigger_error ( \"Access::delete(): Attempt to delete an Access object that does not have it's ID property set.\", E_USER_ERROR );\n\n // Delete the Access\n /*$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n $st = $conn->prepare ( \"DELETE FROM \" . DB_PREFIX . \"users WHERE id = :id LIMIT 1\" );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->execute();\n $conn = null;*/\n }", "public function delete($dn) {\n\t\treturn ldap_delete($this->conn, $dn);\n\t}", "static private function deleteLdapEntry($ds, $dn, $recursive = FALSE)\n {\n if ($recursive == FALSE) {\n return ldap_delete($ds, $dn);\n } else {\n // Searching for sub entries\n $sr = ldap_list($ds, $dn, \"ObjectClass=*\", array(\"\"));\n $info = ldap_get_entries($ds, $sr);\n for ($i = 0; $i < $info['count']; $i++) {\n // Deleting recursively sub entries\n $result = self::deleteLdapEntry($ds, $info[$i]['dn'], $recursive);\n if (! $result) {\n // Return result code, if delete fails\n return $result;\n }\n }\n return ldap_delete($ds, $dn);\n }\n }", "function LDAP_deleteID($type,$id)\n{\n\t$sql=\"DELETE FROM `$type\".\"IDs` WHERE $type\".\"ID=\\\"$id\\\"\";\n\tDB_query($sql);\n}", "public function delete()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Validate\n //---------\n\n Validation_Exception::is_valid($this->validate_username($this->username, FALSE, FALSE));\n\n // Disable the user and set random password for apps without disable\n //------------------------------------------------------------------\n\n $ldap_object = array();\n\n $ldap_object['clearAccountStatus'] = User_Engine::STATUS_DISABLED;\n $ldap_object['userPassword'] = '{sha}' . base64_encode(pack('H*', sha1(mt_rand())));\n\n // Update LDAP attributes from extensions\n //---------------------------------------\n\n foreach ($this->_get_extensions() as $extension_name => $details) {\n $extension = Utilities::load_user_extension($details);\n\n if ($extension && method_exists($extension, 'delete_attributes_hook')) {\n $hook_object = $extension->delete_attributes_hook();\n $ldap_object = Utilities::merge_ldap_objects($ldap_object, $hook_object);\n }\n }\n\n // Run delete hook\n //----------------\n\n foreach ($this->_get_extensions() as $extension_name => $details) {\n $extension = Utilities::load_user_extension($details);\n\n if ($extension && method_exists($extension, 'delete_hook'))\n $extension->delete_hook();\n }\n\n // Modify LDAP object\n //-------------------\n\n if ($this->ldaph === NULL)\n $this->ldaph = Utilities::get_ldap_handle();\n\n $dn = $this->_get_dn_for_uid($this->username);\n\n // TODO: revisit asynchronous deletes\n // $this->ldaph->modify($dn, $ldap_object);\n $this->ldaph->delete($dn);\n\n // Ping the synchronizer\n //----------------------\n\n $this->_signal_transaction(lang('accounts_deleted_user'));\n }", "function delete()\n\t{\n\t\tglobal $rbacadmin, $log, $ilDB;\n\n\t\t$remove = false;\n\n\t\t// delete object_data entry\n\t\tif ((!$this->referenced) || ($this->countReferences() == 1))\n\t\t{\n\t\t\t// check type match\n\t\t\t$db_type = ilObject::_lookupType($this->getId());\n\t\t\tif ($this->type != $db_type)\n\t\t\t{\n\t\t\t\t$message = \"ilObject::delete(): Type mismatch. Object with obj_id: \".$this->id.\" \".\n\t\t\t\t\t\"was instantiated by type '\".$this->type.\"'. DB type is: \".$db_type;\n\t\t\t\t\t\n\t\t\t\t// write log entry\n\t\t\t\t$log->write($message);\n\t\t\t\t\t\n\t\t\t\t// raise error\n\t\t\t\t$this->ilias->raiseError(\"ilObject::delete(): Type mismatch. (\".$this->type.\"/\".$this->id.\")\",$this->ilias->error_obj->WARNING);\n\t\t\t}\n\t\t\t\n\t\t\t// delete entry in object_data\n\t\t\t$q = \"DELETE FROM object_data \".\n\t\t\t\t\"WHERE obj_id = \".$ilDB->quote($this->getId(), \"integer\");\n\t\t\t$ilDB->manipulate($q);\n\n\t\t\t// delete long description\n\t\t\t$query = \"DELETE FROM object_description WHERE obj_id = \".\n\t\t\t\t$ilDB->quote($this->getId(), \"integer\");\n\t\t\t$ilDB->manipulate($query);\n\n\t\t\t// write log entry\n\t\t\t$log->write(\"ilObject::delete(), deleted object, obj_id: \".$this->getId().\", type: \".\n\t\t\t\t$this->getType().\", title: \".$this->getTitle());\n\t\t\t\n\t\t\t// remove news\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem();\n\t\t\t$news_item->deleteNewsOfContext($this->getId(), $this->getType());\n\t\t\tinclude_once(\"./Services/Block/classes/class.ilBlockSetting.php\");\n\t\t\tilBlockSetting::_deleteSettingsOfBlock($this->getId(), \"news\");\n\n\t\t\tinclude_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';\n\t\t\tilDidacticTemplateObjSettings::deleteByObjId($this->getId());\n\n\t\t\t/* remove notes (see infoscreen gui)\n\t\t\t as they can be seen as personal data we are keeping them for now\n\t\t\tinclude_once(\"Services/Notes/classes/class.ilNote.php\");\n\t\t\tforeach(array(IL_NOTE_PRIVATE, IL_NOTE_PUBLIC) as $note_type)\n\t\t\t{\n\t\t\t\tforeach(ilNote::_getNotesOfObject($this->id, 0, $this->type, $note_type) as $note)\n\t\t\t\t{\n\t\t\t\t\t$note->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t */\n\t\t\t\t\t\t\n\t\t\t// BEGIN WebDAV: Delete WebDAV properties\n\t\t\t$query = \"DELETE FROM dav_property \".\n\t\t\t\t\"WHERE obj_id = \".$ilDB->quote($this->getId(),'integer');\n\t\t\t$res = $ilDB->manipulate($query);\n\t\t\t// END WebDAV: Delete WebDAV properties\n\n\t\t\tinclude_once './Services/WebServices/ECS/classes/class.ilECSImport.php';\n\t\t\tilECSImport::_deleteByObjId($this->getId());\n\t\t\t\n\t\t\tinclude_once(\"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php\");\n\t\t\tilAdvancedMDValues::_deleteByObjId($this->getId());\n\n\t\t\t$remove = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// write log entry\n\t\t\t$log->write(\"ilObject::delete(), object not deleted, number of references: \".\n\t\t\t\t$this->countReferences().\", obj_id: \".$this->getId().\", type: \".\n\t\t\t\t$this->getType().\", title: \".$this->getTitle());\n\t\t}\n\n\t\t// delete object_reference entry\n\t\tif ($this->referenced)\n\t\t{\t\t\t\n\t\t\tinclude_once \"Services/Object/classes/class.ilObjectActivation.php\";\n\t\t\tilObjectActivation::deleteAllEntries($this->getRefId());\n\t\t\t\n\t\t\t// delete entry in object_reference\n\t\t\t$query = \"DELETE FROM object_reference \".\n\t\t\t\t\"WHERE ref_id = \".$ilDB->quote($this->getRefId(),'integer');\n\t\t\t$res = $ilDB->manipulate($query);\n\t\t\t\n\t\t\t// write log entry\n\t\t\t$log->write(\"ilObject::delete(), reference deleted, ref_id: \".$this->getRefId().\n\t\t\t\t\", obj_id: \".$this->getId().\", type: \".\n\t\t\t\t$this->getType().\", title: \".$this->getTitle());\n\n\t\t\t// DELETE PERMISSION ENTRIES IN RBAC_PA\n\t\t\t// DONE: method overwritten in ilObjRole & ilObjUser.\n\t\t\t// this call only applies for objects in rbac (not usr,role,rolt)\n\t\t\t// TODO: Do this for role templates too\n\t\t\t$rbacadmin->revokePermission($this->getRefId(),0,false);\n\n\t\t\tinclude_once \"Services/AccessControl/classes/class.ilRbacLog.php\";\n\t\t\tilRbacLog::delete($this->getRefId());\n\n\t\t\t// Remove applied didactic template setting\n\t\t\tinclude_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';\n\t\t\tilDidacticTemplateObjSettings::deleteByRefId($this->getRefId());\n\n\t\t\t// Remove desktop items\n\t\t\tilUtil::removeItemFromDesktops($this->getRefId());\n\t\t}\n\n\t\t// remove conditions\n\t\tif ($this->referenced)\n\t\t{\n\t\t\t$ch =& new ilConditionHandler();\n\t\t\t$ch->delete($this->getRefId());\n\t\t\tunset($ch);\n\t\t}\n\n\t\treturn $remove;\n\t}", "private function deleteLdapServer() {\n global $xmlConfig;\n $xpath = \"//services/ldapserver\";\n\t\t$object = $xmlConfig->get($xpath);\n //stop the openldap service while we clear the ldap directory\n $cmd = \"service slapd stop\";\n if (0 !== $this->exec($cmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $cmd, implode(\"\\n\", $output));\n }\n \n //now we clear the ldap directory\n $ldapDir=\"/var/lib/ldap\";\n $ldapConf=\"/etc/ldap/slapd.d\";\n $delCmd=\"rm -rf $ldapDir/* $ldapConf/cn=config $ldapConf/cn=config.ldif\";\n if (0 !== $this->exec($delCmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $delCmd, implode(\"\\n\", $output));\n }\n }", "public function undelete() {\n if ($sd_id = $this->has_soft_deleted_entry()) {\n $sd_obj = new db_object($this->table_name, $sd_id);\n\n if ($sd_obj->set_attribute('deleted', '0', $force_update=true, $check_acceptable_attribute=true, $metadata_override=false)) {\n if ($this->logging_enabled === true) {\n $this->log_attribute_change('deleted', false, 'undelete');\n }\n }\n\n // return the correct type of object.\n if (get_class($this) == 'db_object') {\n $this->__construct($sd_obj->table_name, $sd_obj->get_id());\n }\n else {\n $this->__construct($sd_obj->get_id());\n }\n\n $related_tables = $this->get_db_relationship_tables();\n foreach ($related_tables as $related_table) {\n $relationship_type = $this->get_db_relationship_type($related_table);\n\n switch ($relationship_type) {\n case 'has_one':\n if ($related_db_object = $this->get_child_object($related_table))\n $related_db_object->undelete();\n break;\n case 'has_many':\n if ($related_db_recordset = $this->get_child_object($related_table)) {\n foreach ($related_db_recordset as $related_db_object) {\n $related_db_object->undelete();\n }\n }\n break;\n case 'belongs_to':\n break;\n }\n }\n\n return true;\n }\n return false;\n }", "public function deleteAcl($object)\n {\n $acl = $this->getAcl($object); //Simple fix to avoid deleting a non-existing ACL\n $objectIdentity = ObjectIdentity::fromDomainObject($object);\n $this->aclProvider->deleteAcl($objectIdentity);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check rendering of response when role_admin request Homepage
public function testHomepageAdminRender() { // Create Client $client = $this->createRoleAdminClient(); $crawler = $client->request('GET', '/'); // Execute userBaseLayout $this->checkAdminBaseLayout($crawler); // Execute homepageBaseLayout $this->checkHomepageBaseLayout($crawler); // As Admin user, attempt list_users link $this->checkLink( 'Liste des utilisateurs', '/users', 1, $crawler ); }
[ "public function check_admin_access()\n {\n return;\n $role = self::_get_role();\n if ('admin' !== $role) {\n PeepSo::redirect(get_home_url());\n }\n\n // if it's a \"peepso_\" user, redirect to the front page\n//\t\t$sRole = self::get_user_role();\n//\t\tif (substr($sRole, 0, 7) == 'peepso_') {\n//\t\t\tPeepSo::redirect(get_home_url());\n//\t\t\tdie;\n//\t\t}\n }", "public static function is_admin_page()\n {\n }", "public function checkAdminPagePermission()\n {\n if (!SUPER_USER) {\n exit(\"Only super users can access this page!\");\n } elseif (!Csrf::isValidRequest()) {\n exit(\n \"Access not allowed. Your session may have expired.\"\n .\" Please make sure you are logged in and try again.\"\n );\n }\n }", "public function respond() \n\t{\n\t\t// Always reset the cross login nonces. I'm too paranoid otherwise :)\n\t\t// Response::reset_nonce('cross_auth');\n\t\t$this->require_admin();\n\t\tTheme::type(Theme::ADMIN);\n\t\t\n\t\tResponse::add_to_javascript('admin', array('url' => AdminResponder::base_url()));\n\t\treturn parent::respond();\n\t}", "public function renderErrorNotAdmin(): void;", "function user_can_access_admin_page() {}", "public function isAdminPage() {\n return ($this->getAccessLevel() > SECURITY_USER);\n }", "public function pagechecklogin()\n {\n if($this->admin_type == \"content_writer\")\n {\n $auth = Zend_Auth::getInstance();\n $hasIdentity = $auth->hasIdentity();\n /*************** check admin identity ************/\n if(!$hasIdentity) \n { \n $this->_redirect('admin/index/index'); \n } \n } else {\n $this->_redirect('admin/index/index'); \n }\n }", "public static function adminProtectedPage() {\n \tif(isset($_SESSION['user_logged_in']))\n \t{\n \t\tglobal $user;\n \t\tif(!$user->is_admin())\n \t\t{\n \t\t\t#TODO\n \t\t\t//There needs to be an log which records events. Such as\n \t\t\t//a user trying to access admin areas.\n \t\t\t//log table should have id, event, user, severity_level, ip\n \t\t\theader('location: ' . URL . 'error/_403'); exit();\n \t\t}\n \t}else {\n \t\theader('location: ' . URL . 'error/_403'); exit();\n \t}\n }", "function ifNotAdmin() {\n if (!$this->getUserData()->admin) {\n return $this->redirectToUrl(login_url(), \"Access proteced!\", \"danger\");\n }\n }", "public function actionAdminPage()\n {\n return $this->renderRestrictedPage('admin');\n }", "public function showAdminHomepageAction()\n {\n $homepageManager = new HomepageManager();\n $homepage = $homepageManager->getAllHomepage();\n return $this->twig->render('admin/adminhomepage.html.twig', array(\n 'homepage' => $homepage\n ));\n }", "public function home() \n {\n\n\t$user = $this->session->userdata(\"username\");\n if ($user != false) {\n if (modules::run('permissions/isPermitted', $this->session->userdata(\"username\"), \"canViewMember\") == \"permitted\") {\n redirect('/selfservice');\n } else if (modules::run('permissions/isPermitted', $this->session->userdata(\"username\"), \"canViewAdmin\") == \"permitted\") {\n redirect('/admin');\n }\n }\n\t\t\n $data['page_title'] = 'Armony';\n $data['module'] = 'pages';\n $data['view_file'] = 'main_page';\n\n echo Modules::run('templates/main_site', $data);\n }", "public function check_is_admin()\n {\n $role = '';\n if (isset($_SESSION['email'])) {\n $role = $this->get_columns_where(['account_role'], ['email' => $_SESSION['email']]);\n }\n if ($role[0]['account_role'] != 'admin') {\n $_SESSION['login_modal'][] = 'Vous n\\'êtes pas autorisé à accéder à cette partie du site';\n header('Location: /#modal');\n }\n }", "private function _check_role() {\n $no_logined_pages = $this->config->item('no_login_pages');\n $current_path = uri_string();\n if (in_array($current_path, $no_logined_pages)) {\n // Page is that don't need signin\n } else {\n if ($this->logined_user === FALSE) {// if user didn't signin\n if ($this->uri->segment(1) == 'admin') {\n redirect('admin/auth/signin');\n } else {\n redirect('auth/signin');\n }\n } else {// if current page is admin panel\n if ($this->uri->segment(1) == 'admin' && $this->logined_user->group != 'admin') {\n redirect('admin/auth/signin');\n }\n }\n }\n }", "public function admin_check()\n {\n\n $redirect = home_url( '/' );\n if (!current_user_can('administrator'))\n exit( wp_redirect( $redirect ) );\n\n }", "static function handleMainAdminPageActionAndDisplay() {\n global $abj404view;\n global $abj404logic;\n global $abj404logging;\n global $abj404dao;\n \n try {\n $action = $abj404dao->getPostOrGetSanitize('action');\n \n if (!is_admin() || !current_user_can('administrator')) { \n $abj404logging->logUserCapabilities(\"handleMainAdminPageActionAndDisplay (\" . \n esc_html($action == '' ? '(none)' : $action) . \")\");\n return; \n }\n\n $sub = \"\";\n\n // --------------------------------------------------------------------\n // Handle Post Actions\n $abj404logging->debugMessage(\"Processing request for action: \" . \n esc_html($action == '' ? '(none)' : $action));\n\n // this should really not pass things by reference so it can be more object oriented (encapsulation etc).\n $message = \"\";\n $message .= $abj404logic->handlePluginAction($action, $sub);\n $message .= $abj404logic->hanldeTrashAction();\n $message .= $abj404logic->handleDeleteAction();\n $message .= $abj404logic->handleIgnoreAction();\n $message .= $abj404logic->handleActionEdit($sub);\n $message .= $abj404logic->handleActionDeleteLog();\n $message .= $abj404logic->handleActionImportRedirects();\n $message .= $abj404logic->handleActionChangeItemsPerRow();\n\n // --------------------------------------------------------------------\n // Output the correct page.\n $abj404view->echoChosenAdminTab($action, $sub, $message);\n \n } catch (Exception $e) {\n $abj404logging->errorMessage(\"Caught exception: \" . stripcslashes(wp_kses_post(json_encode($e))));\n throw $e;\n }\n }", "protected function checkLogin() {\r\n if (!$this->user->isLoggedInAdmin()) {\r\n $this->response->setRedirect('admin/login');\r\n exit();\r\n }\r\n }", "public function authAdmin(){\r\n if(empty($_SESSION['admin'])){\r\n $this->view('error/404');\r\n die('');\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to refund the amount paid by Giftcard back to the Card when the entire order is refunded
function wcgc_refund_order($order_id) { $giftCard_id = get_post_meta($order_id, 'wcgc_id', true); $giftCard_refunded = get_post_meta($order_id, 'wcgc_refunded', true); if ($giftCard_id && ! ($giftCard_refunded == 'yes')) { $oldBalance = wcgc_get_giftcard_balance($giftCard_id); $refundAmount = get_post_meta($order_id, 'wcgc_payment', true); $giftcard_balance = (float) $oldBalance + (float) $refundAmount; update_post_meta($giftCard_id, 'wcgc_balance', $giftcard_balance); // Update balance of Giftcard update_post_meta($order_id, 'wcgc_refunded', 'yes'); // prevents multiple refunds of Giftcard } }
[ "public function refund($order);", "public function refund() {\n $result = Braintree_Transaction::refund('f22c2zwk'); //for full refund\n //$result = Braintree_Transaction::refund('f22c2zwk','20.9'); //for partial refund\n if ($result) {\n echo \"<pre>\";\n print_r($result);\n echo \"</pre>\";\n }\n }", "public function refund() {\n\t\t$this->old_status = $this->status;\n\t\t$this->status = 'refunded';\n\t\t$this->pending['status'] = $this->status;\n\n\t\t$this->save();\n\t}", "public function doRefund() {\n if (isset($this->request->post['transaction_id']) && isset($this->request->post['refund_full'])) {\n \n $this->theme->model('payment/paypalexpress');\n $this->theme->language('payment/paypalexpress_refund');\n \n if ($this->request->post['refund_full'] == 0 && $this->request->post['amount'] == 0) {\n $this->session->data['error'] = $this->language->get('lang_error_partial_amt');\n } else {\n $order_id = $this->model_payment_paypalexpress->getOrderId($this->request->post['transaction_id']);\n $paypal_order = $this->model_payment_paypalexpress->getOrder($order_id);\n \n if ($paypal_order) {\n $call_data = array();\n $call_data['METHOD'] = 'RefundTransaction';\n $call_data['TRANSACTIONID'] = $this->request->post['transaction_id'];\n $call_data['NOTE'] = urlencode($this->request->post['refund_message']);\n $call_data['MSGSUBID'] = uniqid(mt_rand(), true);\n \n $current_transaction = $this->model_payment_paypalexpress->getLocalTransaction($this->request->post['transaction_id']);\n \n if ($this->request->post['refund_full'] == 1) {\n $call_data['REFUNDTYPE'] = 'Full';\n } else {\n $call_data['REFUNDTYPE'] = 'Partial';\n $call_data['AMT'] = number_format($this->request->post['amount'], 2);\n $call_data['CURRENCYCODE'] = $this->request->post['currency_code'];\n }\n \n $result = $this->model_payment_paypalexpress->call($call_data);\n \n $transaction = array('paypal_order_id' => $paypal_order['paypal_order_id'], 'transaction_id' => '', 'parent_transaction_id' => $this->request->post['transaction_id'], 'note' => $this->request->post['refund_message'], 'msgsubid' => $call_data['MSGSUBID'], 'receipt_id' => '', 'payment_type' => '', 'payment_status' => 'Refunded', 'transaction_entity' => 'payment', 'pending_reason' => '', 'amount' => '-' . (isset($call_data['AMT']) ? $call_data['AMT'] : $current_transaction['amount']), 'debug_data' => json_encode($result));\n \n if ($result === false) {\n $transaction['payment_status'] = 'Failed';\n $this->model_payment_paypalexpress->addTransaction($transaction, $call_data);\n $this->response->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else if ($result['ACK'] != 'Failure' && $result['ACK'] != 'FailureWithWarning') {\n \n $transaction['transaction_id'] = $result['REFUNDTRANSACTIONID'];\n $transaction['payment_type'] = $result['REFUNDSTATUS'];\n $transaction['pending_reason'] = $result['PENDINGREASON'];\n $transaction['amount'] = '-' . $result['GROSSREFUNDAMT'];\n \n $this->model_payment_paypalexpress->addTransaction($transaction);\n \n //edit transaction to refunded status\n if ($result['TOTALREFUNDEDAMOUNT'] == $this->request->post['amount_original']) {\n $this->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE `{$this->db->prefix}paypal_order_transaction` \n\t\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\t\t\t`payment_status` = 'Refunded' \n\t\t\t\t\t\t\t\tWHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\");\n } else {\n $this->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE `{$this->db->prefix}paypal_order_transaction` \n\t\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\t\t\t`payment_status` = 'Partially-Refunded' \n\t\t\t\t\t\t\t\tWHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\");\n }\n \n //redirect back to the order\n $this->response->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else {\n $this->model_payment_paypalexpress->log(json_encode($result));\n $this->session->data['error'] = (isset($result['L_SHORTMESSAGE0']) ? $result['L_SHORTMESSAGE0'] : 'There was an error') . (isset($result['L_LONGMESSAGE0']) ? '<br />' . $result['L_LONGMESSAGE0'] : '');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n } else {\n $this->session->data['error'] = $this->language->get('lang_error_data_missing');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }\n } else {\n $this->session->data['error'] = $this->language->get('lang_error_data');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }", "function refund($paymentInfo)\n {\n }", "public function refund($purchase);", "public function refund()\n {\n }", "public function refundAction()\n {\n $orderId = $this->getRequest()->getParam('order_id');\n\n /* @var Mage_Core_Model_Session $session */\n $session = Mage::getSingleton('core/session');\n\n /* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */\n $existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');\n $existingRefundJob->loadByOrder($orderId);\n if ($existingRefundJob->getId() > 0) {\n try {\n /* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */\n $refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');\n $refund = $refundService->refund($existingRefundJob->getSpaceId(), $existingRefundJob->getRefund());\n\n if ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::FAILED) {\n $session->addError(\n Mage::helper('postfinancecheckout_payment')->translate(\n $refund->getFailureReason()\n ->getDescription()));\n } elseif ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::PENDING) {\n $session->addNotice(\n Mage::helper('postfinancecheckout_payment')->__(\n 'The refund was requested successfully, but is still pending on the gateway.'));\n } else {\n $session->addSuccess('Successfully refunded.');\n }\n } catch (Exception $e) {\n $session->addError('There has been an error while sending the refund to the gateway.');\n }\n } else {\n $session->addError('For this order no refund request exists.');\n }\n\n $this->_redirect('adminhtml/sales_order/view', array(\n 'order_id' => $orderId\n ));\n }", "public function refund( $order_id )\n \t{\n \t\tdie('Not allowed');\n \t}", "public function cancelOrderRefundAction($order)\n {\n foreach($order->getItemsCollection() as $item)\n {\n if ($item->getQtyRefunded() > 0)\n {\n $item->setQtyRefunded(0)\n ->setAmountRefunded(0)\n ->setBaseAmountRefunded(0)\n ->setHiddenTaxRefunded(0)\n ->setBaseHiddenTaxRefunded(0)\n ->setTaxRefunded(0)\n ->setBaseTaxRefunded(0)\n ->setDiscountRefunded(0)\n ->setBaseDiscountRefunded(0)\n ->save();\n }\n }\n\n $order\n ->setBaseDiscountRefunded(0)\n ->setBaseShippingRefunded(0)\n ->setBaseSubtotalRefunded(0)\n ->setBaseTaxRefunded(0)\n ->setBaseShippingTaxRefunded(0)\n ->setBaseTotalOnlineRefunded(0)\n ->setBaseTotalOfflineRefunded(0)\n ->setBaseTotalRefunded(0)\n ->setTotalOnlineRefunded(0)\n ->setTotalOfflineRefunded(0)\n ->setDiscountRefunded(0)\n ->setShippingRefunded(0)\n ->setShippingTaxRefunded(0)\n ->setSubtotalRefunded(0)\n ->setTaxRefunded(0)\n ->setTotalRefunded(0)\n ->save();\n\n $invoice = $order->getInvoiceCollection()->getLastItem();\n $invoice->setIsUsedForRefund(0)->save();\n }", "public function refund($url, $orderUUID, $amount);", "public function handleChargePartiallyRefunded()\n {\n $payment = $this->getPayment();\n\n if ($payment) {\n $amount = $payment->amount;\n $refunded = 0;\n\n if (isset($this->payload['data']['object']['amount']) && isset($this->payload['data']['object']['refunds']['data']['amount'])) {\n $amount = abs(Payment::parseAmount($this->payload['data']['object']['amount']));\n $refunded = abs(Payment::parseAmount($this->payload['data']['object']['refunds']['data']['amount']));\n }\n\n $payment->amount = (int) $amount - (int) $refunded;\n $payment->status = 'refunded';\n $payment->save();\n }\n\n $this->saveLog();\n return $payment;\n }", "public function refundTransaction()\n {\n $oxOrder = $this->getEditObject();\n\n $transaction = oxNew('paymill_transaction');\n $transaction->load($this->getEditObjectId());\n\n //Create Refund\n $params = array(\n 'transactionId' => $transaction->paymill_transaction__transaction_id->rawValue,\n 'params' => array('amount' => (int) ($this->_getRefundAmount() * 100))\n );\n\n $refundsObject = new Services_Paymill_Refunds(\n trim(oxRegistry::getConfig()->getShopConfVar('PAYMILL_PRIVATEKEY')),\n paymill_util::API_ENDPOINT\n );\n\n oxRegistry::getSession()->setVariable('refund', true);\n\n try {\n $refund = $refundsObject->create($params);\n } catch (Exception $ex) {\n\n }\n\n if (isset($refund['response_code']) && $refund['response_code'] == 20000) {\n $oxOrder->assign(array('oxorder__oxdiscount' => $this->_getRefundAmount()));\n $oxOrder->reloadDiscount(false);\n $oxOrder->recalculateOrder();\n oxRegistry::getSession()->setVariable('success', true);\n } else {\n oxRegistry::getSession()->setVariable('error', true);\n }\n }", "public function refund(\\Magento\\Payment\\Model\\InfoInterface $payment, $amount);", "public function saleOrderPaymentRefund($observer)\n {\n $oCreditmemo = $observer['creditmemo'];\n $oOrder = $oCreditmemo->getOrder();\n foreach($oCreditmemo->getAllItems() as $_item){\n $giftCardsOrderCollection = Mage::getModel('giftcards/order')->getCollection()->addFieldToFilter('id_order', $oOrder->getId());\n foreach($giftCardsOrderCollection as $giftCardOrder){\n $giftCard = Mage::getModel('giftcards/giftcards')->load($giftCardOrder->getIdGiftcard());\n $hash_data = unserialize($giftCard->getHashData());\n $cardItem = $hash_data[$giftCardOrder->getIdGiftcard()];\n $orderItem = $_item->getOrderItem();\n $refundAmountArray = $cardItem['items'][$orderItem->getQuoteItemId()];\n $refundAmount = $refundAmountArray['item_discount'] / (isset($refundAmountArray['qty']) ? $refundAmountArray['qty'] : 1);\n if (is_null($giftCard->getCardCurrency()) || $giftCard->getCardCurrency() == $oOrder->getBaseCurrencyCode()) {\n $refundValue = $refundAmount * $_item->getQty();\n } else {\n $refundValue = Mage::helper('giftcards')->currencyConvert($refundAmount, $oOrder->getBaseCurrencyCode(), $giftCard->getCardCurrency()) * $_item->getQty();\n }\n if($refundValue > 0 ){\n $hash_data[$giftCardOrder->getIdGiftcard()]['items'][$orderItem->getQuoteItemId()]['item_discount'] = $hash_data[$giftCardOrder->getIdGiftcard()]['items'][$orderItem->getQuoteItemId()]['item_discount'] - $refundValue;\n $giftCard->setCardBalance($giftCard->getCardBalance() + $refundValue);\n $giftCard->setCardStatus(1);\n $giftCard->setHashData(serialize($hash_data));\n $giftCard->save();\n $oGiftCardOrder = Mage::getModel('giftcards/order');\n $oGiftCardOrder->setIdGiftcard($giftCard->getId());\n $oGiftCardOrder->setIdOrder($oOrder->getId());\n $oGiftCardOrder->setDiscounted(-(float)$refundValue);\n $oGiftCardOrder->save();\n }\n if($oCreditmemo->getShippingAmount() > 0){\n $refundValue = $hash_data[$giftCardOrder->getIdGiftcard()]['shipping_discount'];\n //if($refundValue){\n // $oCreditmemo->setShippingAmount(0);\n //}\n $hash_data[$giftCardOrder->getIdGiftcard()]['shipping_discount'] = 0 ;\n $giftCard->setCardBalance($giftCard->getCardBalance() + $refundValue);\n $giftCard->setCardStatus(1);\n $giftCard->setHashData(serialize($hash_data));\n $giftCard->save();\n $oGiftCardOrder = Mage::getModel('giftcards/order');\n $oGiftCardOrder->setIdGiftcard($giftCard->getId());\n $oGiftCardOrder->setIdOrder($oOrder->getId());\n $oGiftCardOrder->setDiscounted(-(float)$refundValue);\n $oGiftCardOrder->save();\n }\n }\n \n }\n }", "function doRefund()\n {\n $id_unique = Tools::getValue($this->name . '_transaction_id');\n $amount = Tools::getValue($this->name . '_transaction_amount');\n $usage = Tools::getValue($this->name . '_transaction_usage');\n $ip_addr = Tools::getRemoteAddr();\n\n // Apply settings\n $this->applyGenesisConfig();\n\n try {\n $transaction = EComProcessingTransaction::getByUniqueId($id_unique);\n\n if ($transaction->terminal) {\n \\Genesis\\Config::setToken($transaction->terminal);\n }\n\n $data = array(\n 'transaction_id' => md5(uniqid() . mt_rand() . microtime(true)),\n 'usage' => $usage,\n 'remote_ip' => $ip_addr,\n 'reference_id' => $transaction->id_unique,\n 'currency' => $transaction->currency,\n 'amount' => $amount,\n );\n\n $response = EComProcessingTransactionProcess::refund($data);\n\n $transaction_response = new EComProcessingTransaction();\n $transaction_response->id_parent = $transaction->id_unique;\n $transaction_response->ref_order = $transaction->ref_order;\n $transaction_response->importResponse($response->getResponseObject());\n $transaction_response->updateOrderHistory(\n Configuration::get('PS_OS_REFUND'), true\n );\n $transaction_response->add();\n } catch (\\Exception $e) {\n $this->logError($e);\n\n $this->setSessVar('error_transaction',\n $this->l('The transaction was unsuccessful, please check your Logs for more information')\n );\n }\n }", "public function refund( WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$request = $this->get_new_request();\n\n\t\t$request->create_refund();\n\n\t\treturn $this->perform_request( $request );\n\t}", "function refund($reservation){\n global $wpdb;\n global $DOPBSP;\n \n $nvp_data = array();\n \n /*\n * Check if selected payment method is PayPal access.\n */\n if ($reservation->payment_method == 'paypal'){\n $this->set($reservation->calendar_id);\n \n /*\n * Check if selected refunds are enabled.\n */\n if ($this->refund){\n /*\n * Stop if a refund has been made.\n */\n if ($reservation->payment_status == 'partially refunded'\n || $reservation->payment_status == 'refunded'){\n echo 'success_with_message;;;;;'.$DOPBSP->text('RESERVATIONS_RESERVATION_CANCEL_SUCCESS_REFUND_WARNING');\n return false;\n }\n \n $refund_value = $this->refund_type == 'fixed' ? $this->refund_value:($reservation->price_total*$this->refund_value)/100;\n \n array_push($nvp_data, '&TRANSACTIONID='.$reservation->transaction_id);\n array_push($nvp_data, '&REFUNDTYPE='.($refund_value == $reservation->price_total ? 'Full':'Partial'));\n \n if ($refund_value == $reservation->price_total){\n array_push($nvp_data, '&REFUNDTYPE=Full');\n }\n else{\n array_push($nvp_data, '&REFUNDTYPE=Partial');\n array_push($nvp_data, '&AMT='.$refund_value);\n array_push($nvp_data, '&CURRENCYCODE='.$reservation->currency_code);\n }\n \n /*\n * Make the API call to PayPal.\n */\n $call_response = $this->call('RefundTransaction', \n implode('', $nvp_data));\n $ack = strtoupper($call_response['ACK']);\n\n if ($ack == 'SUCCESS' \n || $ack == 'SUCCESSWITHWARNING'){\n $settings_calendar = $DOPBSP->classes->backend_settings->values($reservation->calendar_id, \n 'calendar');\n $wpdb->update($DOPBSP->tables->reservations, array('refund' => $refund_value,\n 'payment_status' => $refund_value == $reservation->price_total ? 'refunded':'partially refunded'), \n array('id' => $reservation->id));\n \n /*\n * Success message.\n */\n echo 'success_with_message;;;;;';\n printf($DOPBSP->text('RESERVATIONS_RESERVATION_CANCEL_SUCCESS_REFUND'), $DOPBSP->classes->price->set($refund_value,\n $reservation->currency,\n $settings_calendar->currency_position));\n } \n else{\n /*\n * Error message.\n */\n echo 'error_with_message;;;;;'.urldecode($call_response['L_LONGMESSAGE0']).'.';\n }\n }\n }\n }", "public function orderRefund($observer)\n {\n $creditmemo = $observer->getCreditmemo();\n $order = $creditmemo->getOrder();\n\n /* If guest, return */\n if (!$order || !$order->getCustomerId() || !$order->getTotalQtyOrdered()) {\n return;\n }\n $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());\n if (!$customer->getId()) {\n return;\n }\n\n $data = array('memo' => $creditmemo, 'order' => $order, 'customer' => $customer);\n if (Mage::helper('points/config')->isCancelPoints($order->getStoreId())) {\n $this->_cancelRefererPoints($data);\n $this->_cancelEarnedPoints($data);\n }\n\n if (Mage::helper('points/config')->isRefundPoints($order->getStoreId())) {\n $this->_refundSpentPoints($data);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the application can logout other browser sessions.
public static function canLogoutOtherBrowserSessions(): bool { return static::enabled(static::logoutOtherBrowserSessions()); }
[ "public function userWantsToLogout() {\n return isset($_GET[\"logout\"]);\n }", "public static function revokeOtherSessions() : bool\n {\n // Remove invalid authentication session cookie.\n if (!self::$session) {\n\n return Cookie::unset(Config::auth('session_cookie_name'));\n }\n\n // Remove all the authentication sessions from the database, except the current one.\n DB::prepare('DELETE FROM ' . Config::db('table_auth') . ' WHERE AccountId = :accountId AND Id <> UUID_TO_BIN(:sessionId)')\n ->bind(':sessionId', self::$session['sessionId'])\n ->bind(':accountId', self::$session['accountId'])\n ->execute();\n\n return (bool) DB::rowCount();\n }", "public static function isLogout(){\n // Destroy\n if (session_id()) {\n session_unset();\n session_destroy();\n $_SESSION = array();\n }\n }", "public function userLoggingOut() {\n\t\treturn isset($_GET[self::$LOGOUT]);\n\t}", "function pos_host_current_user_can_force_logout() {\r\n\t$force_logout = 'yes' === get_option( 'pos_host_force_logout', 'no' );\r\n\t$current_user = wp_get_current_user();\r\n\r\n\tif ( $current_user->has_cap( 'force_logout_register' ) && $force_logout ) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "static function loggedOut() {\n return !loggedIn();\n }", "static function http_is_logout_pending() {\n\t\t$t_cookie_name = \\Core\\Config::mantis_get( 'logout_cookie' );\n\t\t$t_cookie = \\Core\\GPC::get_cookie( $t_cookie_name, '' );\n\t\n\t\treturn( $t_cookie > '' );\n\t}", "public function userHasRecentlyLoggedOut() {\n\t\tif ( isset($_SESSION[\"hasLoggedOut\"]) ) {\n\t\t\tunset($_SESSION[\"hasLoggedOut\"]);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isOAuthDisconnected()\n {\n if (isset($_COOKIE[$this->oauthAccessTokenName])) {\n return false;\n }\n return true;\n }", "private static function check_session_rights()\n {\n $page = self::$page['name'];\n $common_area = array('home');\n $visitors_only = array('register', 'login', 'reset');\n $members_only = array('search', 'chatroom', 'chat',\n 'profile', 'logout', 'modify-account', 'modify-profile', 'modify-mate', 'actions');\n\n if (!in_array($page, $common_area) &&\n !(in_array($page, $visitors_only) && !$_SESSION['is_logged']) &&\n !(in_array($page, $members_only) && $_SESSION['is_logged']))\n header('Location: '.Config::ROOT.'');\n }", "private function _isLogoutPage() {\n\t\tif(!isset($this->getConfig()->logout->path)) {\n\t\t\tthrow new FirewallException('Invalid firewall configuration. Missing configuration param: \"logout.path\".');\n\t\t}\n\n\t\treturn $this->_isOnPath($this->getConfig()->logout->path);\n\t}", "public function checkSessionConcurrency(){\n\t\tif(Session::userIsLoggedIn()){\n\t\t\t// $this->logger->debug(\"userIsLoggedIn\");\n\t\t\tif(Session::isConcurrentSessionExists()){\n\t\t\t\t// TODO: log something...\n\t\t\t\tLoginModel::logout();\n\t\t\t\t$this->redirectHome();\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "protected function _isLoggedOut()\n {\n return $this->_isPersistent() && !Mage::getSingleton('customer/session')->isLoggedIn();\n }", "static function checkLogOutRequest($mysession){\n if(isset($_GET[\"logout\"]) && isset($_GET[\"token\"])){\n if ($mysession->validateToken($_GET[\"token\"])){\n return true;\n }\n }\n return false;\n }", "function sessionAllowed() {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_robots.php');\n if (!$this->sessionProtocolAllowed() || base_robots::checkRobot()) {\n $pattern = '{^/'.preg_quote($this->sessionName).$this->sessionPattern.'}i';\n if ($this->allowRedirects &&\n isset($_SERVER['REQUEST_URI']) &&\n preg_match($pattern, $_SERVER['REQUEST_URI'], $regs)) {\n // session not permitted but sid in url - remove it\n $this->reloadPage(FALSE, NULL, NULL, 'No session, remove sid from url');\n }\n return FALSE;\n }\n return TRUE;\n }", "function session_is_valid() {\n if(!last_login_is_recent()) { return false; }\n if(!user_agent_matches_session()) { return false; }\n return true;\n }", "private function _isLogoutRequest()\n {\n return !empty($_POST['logoutRequest']);\n }", "public function getBackchannelLogoutSessionRequired()\n {\n return $this->backchannel_logout_session_required;\n }", "public static function revokeAllSessions() : bool\n {\n // Remove invalid authentication session cookie.\n if (!self::$session) {\n\n return Cookie::unset(Config::auth('session_cookie_name'));\n }\n\n // Remove all the authentication sessions from the database.\n DB::prepare('DELETE FROM ' . Config::db('table_auth') . ' WHERE AccountId = :accountId')\n ->bind(':accountId', self::$session['accountId'])\n ->execute();\n \n if (!DB::rowCount()) {\n\n return false;\n }\n\n // Revoke the current authentication session and remove its authentication session\n // cookie.\n self::$session = null;\n Cookie::unset(Config::auth('session_cookie_name'));\n\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Client By status API
public function actionclientsbystatus() { if (Yii::app()->request->getParam('key') != API_KEY) { echo "Invalid api key"; die(); } $api_token = Yii::app()->request->getParam('api_token'); $t1 = Yii::app()->request->getParam('t1'); $t2 = Yii::app()->request->getParam('t2'); $user_type = Yii::app()->request->getParam('user_type'); $user_id = Yii::app()->request->getParam('user_id'); $token_check = $this->verifyapitoken($api_token, $t1, $t2, $user_type, $user_id, AES256CBC_API_PASS); if (!$token_check) { $json = array( 'result' => 'false', 'response' => 'Invalid request' ); echo json_encode($json); die(); } //complete orders $online_clients = Customers::model()->findAllByAttributes(array("online_status" => 'online')); $onlineclients = array(); foreach ($online_clients as $client) { $cust_last_wash_date = ""; $customer_feedbacks = Washingfeedbacks::model()->findAllByAttributes(array("customer_id" => $client->id)); $cust_last_wash = Washingrequests::model()->findByAttributes(array("customer_id" => $client->id, "status" => 4), array('order' => 'id DESC')); if (count($cust_last_wash)) { $cust_last_wash_date = date('M d, Y h:i A', strtotime($cust_last_wash->order_for)); } else $cust_last_wash_date = "N/A"; $total_rate = count($customer_feedbacks); if ($total_rate) { $rate = 0; foreach ($customer_feedbacks as $customers_feedbacks) { $rate += $customers_feedbacks->customer_ratings; } $customer_rate = round($rate / $total_rate); } else { $customer_rate = 0; } $client_loc = CustomerLiveLocations::model()->findByAttributes(array("customer_id" => $client->id)); //print_r($client_locs); if (count($client_loc)) { $key = 'onlineclient_' . $client->id; $jsononlineclient = array(); $jsononlineclient['id'] = $client->id; $jsononlineclient['customername'] = $client->first_name . " " . $client->last_name; $jsononlineclient['email'] = $client->email; $jsononlineclient['contact_number'] = $client->contact_number; $jsononlineclient['image'] = $client->image; $jsononlineclient['total_wash'] = $client->total_wash; $jsononlineclient['latitude'] = $client_loc->latitude; $jsononlineclient['longitude'] = $client_loc->longitude; $jsononlineclient['rating'] = $client->rating; $jsononlineclient['last_wash'] = $cust_last_wash_date; $onlineclients[$key] = $jsononlineclient; } } //penidng orders $pending_orders = Washingrequests::model()->findAllByAttributes(array("status" => '0', "is_scheduled" => '0')); $pendingorders = array(); foreach ($pending_orders as $pendings_orders) { $washer_detail = ''; $customers_detail = Customers::model()->findByAttributes(array("id" => $pendings_orders->customer_id)); if ($pendings_orders->agent_id) $washer_detail = Agents::model()->findByPk($pendings_orders->agent_id); $customer_feedbacks = Washingfeedbacks::model()->findAllByAttributes(array("customer_id" => $pendings_orders->customer_id)); $total_rate = count($customer_feedbacks); if ($total_rate) { $rate = 0; foreach ($customer_feedbacks as $customers_feedbacks) { $rate += $customers_feedbacks->customer_ratings; } $customer_rate = round($rate / $total_rate); } else { $customer_rate = 0; } $key = 'pending_order_' . $pendings_orders->id; $jsonpending = array(); $jsonpending['id'] = $customers_detail->id; $jsonpending['wash_request_id'] = $pendings_orders->id; $jsonpending['customername'] = $customers_detail->first_name . " " . $customers_detail->last_name; $jsonpending['email'] = $customers_detail->email; $jsonpending['contact_number'] = $customers_detail->contact_number; $jsonpending['image'] = $customers_detail->image; $jsonpending['total_wash'] = $customers_detail->total_wash; $jsonpending['latitude'] = $pendings_orders->latitude; $jsonpending['longitude'] = $pendings_orders->longitude; $jsonpending['agent_id'] = $pendings_orders->agent_id; if (count($washer_detail)) { $jsonpending['agent_badge_id'] = $washer_detail->real_washer_id; $jsonpending['agent_name'] = $washer_detail->first_name . " " . $washer_detail->last_name; $jsonpending['agent_phone'] = $washer_detail->phone_number; } $jsonpending['rating'] = $customers_detail->rating; $jsonpending['created_date'] = $pendings_orders->created_date; $pendingorders[$key] = $jsonpending; } //schedule orders $schedule_orders = Washingrequests::model()->findAllByAttributes(array("status" => '0', "is_scheduled" => '1', 'wash_request_position' => APP_ENV)); $scheduleorders = array(); foreach ($schedule_orders as $schedorder) { $washer_detail = ''; $customers_detail = Customers::model()->findByAttributes(array("id" => $schedorder->customer_id)); if ($schedorder->agent_id) $washer_detail = Agents::model()->findByPk($schedorder->agent_id); $customer_feedbacks = Washingfeedbacks::model()->findAllByAttributes(array("customer_id" => $schedorder->customer_id)); $total_rate = count($customer_feedbacks); if ($total_rate) { $rate = 0; foreach ($customer_feedbacks as $customers_feedbacks) { $rate += $customers_feedbacks->customer_ratings; } $customer_rate = round($rate / $total_rate); } else { $customer_rate = 0; } $key = 'schedule_order_' . $schedorder->id; $jsonpending = array(); $jsonpending['id'] = $customers_detail->id; $jsonpending['wash_request_id'] = $schedorder->id; $jsonpending['customername'] = $customers_detail->first_name . " " . $customers_detail->last_name; $jsonpending['email'] = $customers_detail->email; $jsonpending['contact_number'] = $customers_detail->contact_number; $jsonpending['image'] = $customers_detail->image; $jsonpending['total_wash'] = $customers_detail->total_wash; $jsonpending['latitude'] = $schedorder->latitude; $jsonpending['longitude'] = $schedorder->longitude; $jsonpending['rating'] = $customers_detail->rating; $jsonpending['created_date'] = $schedorder->created_date; $jsonpending['agent_id'] = $schedorder->agent_id; if (count($washer_detail)) { $jsonpending['agent_badge_id'] = $washer_detail->real_washer_id; $jsonpending['agent_name'] = $washer_detail->first_name . " " . $washer_detail->last_name; $jsonpending['agent_phone'] = $washer_detail->phone_number; } $jsonpending['schedule_date'] = date('m-d-Y', strtotime($schedorder->order_for)); $jsonpending['schedule_time'] = date('h:i A', strtotime($schedorder->order_for)); $datediff = (strtotime($schedorder->order_for)) - (strtotime(date("Y-m-d"))); $difference = floor($datediff / (60 * 60 * 24)); if ($difference > 0) { $jsonpending['order_for'] = 'tomorrow'; } else { $jsonpending['order_for'] = 'today'; } $scheduleorders[$key] = $jsonpending; } // Get Processing Orders /* $processing_orders = Yii::app()->db->createCommand() ->select('*') ->from('washing_requests') //Your Table name ->where('status>=1 AND status<=3') // Write your where condition here ->queryAll(); */ $processing_orders = Yii::app()->db->createCommand("SELECT * FROM washing_requests WHERE status>=1 AND status<=3")->queryAll(); $processingorders = array(); foreach ($processing_orders as $process_orders) { $customers_detail = Customers::model()->findByAttributes(array("id" => $process_orders['customer_id'])); $customer_feedbacks = Washingfeedbacks::model()->findAllByAttributes(array("customer_id" => $process_orders['customer_id'])); $total_rate = count($customer_feedbacks); if ($total_rate) { $rate = 0; foreach ($customer_feedbacks as $customers_feedbacks) { $rate += $customers_feedbacks->customer_ratings; } $customer_rate = round($rate / $total_rate); } else { $customer_rate = 0; } $key = 'processing_order_' . $process_orders['id']; $jsonprocessing = array(); $jsonprocessing['id'] = $customers_detail->id; $jsonprocessing['wash_request_id'] = $process_orders['id']; $jsonprocessing['customername'] = $customers_detail->first_name . " " . $customers_detail->last_name; $jsonprocessing['email'] = $customers_detail->email; $jsonprocessing['contact_number'] = $customers_detail->contact_number; $jsonprocessing['image'] = $customers_detail->image; $jsonprocessing['total_wash'] = $customers_detail->total_wash; $jsonprocessing['latitude'] = $process_orders['latitude']; $jsonprocessing['longitude'] = $process_orders['longitude']; $jsonprocessing['rating'] = $customers_detail->rating; $processingorders[$key] = $jsonprocessing; } $clientstatus['online_clients'] = $onlineclients; $clientstatus['pending_orders'] = $pendingorders; $clientstatus['schedule_orders'] = $scheduleorders; $clientstatus['processing_orders'] = $processingorders; echo json_encode($clientstatus); die(); }
[ "public function getStatusClient() : GetStatusInterface;", "private function query_status() {\n\t\tif ($this->header === true) {\n\t\t\t$status = new eyewire_status($this->status . '-header', $this->issue);\n\t\t} else {\n\t\t\t$status = new eyewire_status($this->status, $this->issue);\n\t\t}\n\t\t\n\t\t$status->get_tasks($this->user);\n\n\t\t// Prepare result object\n\t\t$result = new stdClass();\n\t\t$result->status = $this->status;\n\t\t$result->statusText = $status->Text();\n\t\t$result->header = $this->header;\n\t\t$result->issue = $this->issue;\n\t\t$result->user = $this->user;\n\t\t$result->tasks = $status->Tasks();\n\t\t$result->count = $status->Total();\n\t\t\n\t\t// Save result to request output\n\t\t$this->request->OutputType('text/json');\n\t\t$this->request->OutputReplace(json_encode($result));\n\t\t\n\t}", "private function getStatus()\n {\n $this->curl->get($this->status_url);\n }", "public function match_status_get()\n \t{\n \t\tlog_message('debug', 'Transaction/match_status_get');\n \t\tlog_message('debug', 'Transaction/match_status_get:: [1] adminId='.extract_id($this->get('adminId')));\n \t\t\n\t\t$result = server_curl(CRON_SERVER_URL, array('__action'=>'get_transaction_match_status', \n\t\t\t\t'admin_id'=>extract_id($this->get('adminId'))\n\t\t\t));\n\t\t\n\t\tlog_message('debug', 'Transaction/match_status_get:: [2] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function getStatus_client()\n {\n return $this->status_client;\n }", "public function testGetClientStatusUsingGet()\n {\n }", "public function getByStatus($status);", "public function testGetClientStatusAllUsingGet()\n {\n }", "public function getRequestStatus();", "public function actionGetStatus() {\n $area_id = Yii::app()->request->getParam('area_id');\n if ($area_id){\n $this->sendClientResponse(true, 'Status Request Successful', Status::getReadableStatusForAllDevicesByArea($area_id));\n } else {\n $this->sendClientResponse(false, 'Area Id not provided');\n }\n }", "function retrieve_client_statistics(){\n\t\t\n\t}", "public function status($params) {\n\t\t$request_url = \"{$this->url}&api_action=campaign_status&api_output={$this->output}&{$params}\";\n\t\t$response = parent::curl($request_url);\n\t\treturn $response;\n\t}", "public function getStatus();", "public function status();", "abstract public function getStatus();", "public function allClientReportsByDateStatus(Request $request){\n try{ \n $inputs = $request->all();\n $validator = ( new Client )->ValidateClientByStatus( $inputs );\n if( $validator->fails() ) {\n return apiResponseApp(false, 406, \"\", errorMessages($validator->messages()));\n } \n\n $from = $inputs['from'];\n $to = $inputs['to'];\n $clients = (new Client)->allclientReportStatusDate($inputs['id'], $from, $to);\n\n if (count($clients) != 0) {\n foreach ($clients as $client) {\n $status_type = StatusUpdate::where('id', $client->project_status)->value('status_type');\n $client['project_status'] = Status::where('id', $status_type)->value('status_type');\n $payment = Payment::where('client_id', $client->client_id)->value('id');\n $payment_status = PaymentStatus::where('id', $payment)->orderBy('created_at', 'desc')->limit(1)->value('status');\n if ($payment_status == 2) {\n $payment_status = 'Completed';\n }else{\n $payment_status = 'Pending';\n }\n $client['payment_status'] = $payment_status;\n $lead_head = LeadAssignment::where('client_id', $client->client_id)->where('status', 1)->orderBy('created_at', 'desc')->limit(1)->value('lead_head');\n $client['lead_manager'] = UserLogin::where('id', $lead_head)->value('name');\n }\n return apiResponseApp(true, 200, null, [], $clients);\n }else{\n return apiResponseApp(false, 400, 'No client Record found');\n }\n\n\n }catch(Exception $e){\n return apiResponseApp(false, 500, lang('messages.server_error'));\n }\n }", "function getVehicleStatus($vin,$VehicleName) {\n // needed: set the active vehicle to our current VIN:\n $requestActiveVehicle = $GLOBALS['$client']->put(\"/api/vehicle\",[\n 'headers' => [\n 'Authorization' => 'Bearer '.$GLOBALS['AuthToken'],\n ],\n 'json' => ['active_vehicle' => $vin],\n 'cookies' => $GLOBALS['cookieJar'],\n 'debug' => false\n ]);\n // get current battery-status:\n $BatteryResponse = $GLOBALS['$client']->request('GET', '/api/vehicle/'.$vin.'/battery', [\n 'headers' => [\n 'Authorization' => 'Bearer '.$GLOBALS['AuthToken'],\n 'Content-Type' => 'application/json',\n ],\n 'cookies' => $GLOBALS['cookieJar'],\n 'debug' => false\n ]);\n $rawData = json_decode($BatteryResponse->getBody(),true);\n\n // get data about previous and next charge:\n $SiblingsResponse = $GLOBALS['$client']->request('GET', '/api/vehicle/'.$vin.'/charge/siblings', [\n 'headers' => [\n 'Authorization' => 'Bearer '.$GLOBALS['AuthToken'],\n 'Content-Type' => 'application/json',\n ],\n 'cookies' => $GLOBALS['cookieJar'],\n 'debug' => false\n ]);\n\n $rawData += json_decode($SiblingsResponse->getBody(),true);\n // assemble the missing parts:\n $rawData['VehicleName'] = $VehicleName;\n // pass the array back since we modify it further!\n return $rawData;\n}", "function get_status(&$client,&$g) {\n\t$socket = \"unix://{$g['openvpn_base']}/{$client['mgmt']}/sock\";\n\t$status = openvpn_get_client_status($client, $socket);\n\tif($status['status'] != \"up\" ) {\n\t\treturn 0;\n\t} else {\n\t\treturn 1;\n\t}\n}", "function get_status($username) {\n if(!$username) {\n return \"Error. No username :(\"; \n }\n \n $f = @fopen(sprintf(\"%s?username=%s\", $this->uri['api'], urlencode($username)), \"r\");\n \n if(!$f) {\n // Something's fishy :(\n return \"Couldn't access the API\"; \n }\n \n $json = \"\";\n while(!feof($f)) {\n $json .= fgets($f);\n }\n fclose($f);\n \n return json_decode($json, true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$result = BookCollection::where('type', $request>type)>where('map_id', $request>id)>get();
public function searchByType(Request $request) { // return response()->json($result); // if ($request->year != '0') { // $conditions[] = ['Books.public_start_date', 'like', '%' . $request->year . '%']; // } // if ($request->department != '0') { // $conditions[] = ['book_collection.map_id', '=', $request->department]; // } // if ($request->country != '0') { // $conditions[] = ['country.', '=', $request->country]; // } // if ($request->text != '0') { // $conditions[] = ['Books.book_title.', 'like', '%' . $request->text . '%']; // $conditions[] = ['Books.book_keyword.', 'like', '%' . $request->text . '%']; // $conditions[] = ['Books.book_abstract.', 'like', '%' . $request->text . '%']; // } // $result = BookCollection::where($conditions) // ->leftJoin('Books', 'book_collection.book_id', '=', 'Books.id') // ->get(); // return response()->json($result); }
[ "public static function get_tour_bookings_by_id($request)\n {\n return Tour_bookings::where('id' ,$request->row_id)->where('status','1')->first(); \n }", "public function donationRequests(Request $request){\n $donationRequests=donationRequests::where(function ($query)use ($request){\n if($request ->has('id')){\n $query->where ('id',$request->id);\n }\n})->get();\n\n return responseJson(1,'success donationRequests',$donationRequests);\n}", "public function searchbook(Request $request)\n {\n $select=$request->input('category');\n $search=$request->input('key_word');\n $type=$request->input('type');\n \n if($select == \"all\")\n {\n \n $books= DB::table('bookdetails')\n ->leftJoin('books', 'bookdetails.id','=','books.book_name_id')\n\n ->select(DB::raw('count(books.id) as available, bookdetails.*'))\n ->where('bookdetails.'.$type, 'LIKE', $search.'%')\n ->groupBy('bookdetails.id')\n ->get();\n\n \n $categories = DB::table('categories')->orderBy('id')->get();\n \n return view('resources')->with(\"categories\",$categories)->with(\"books\",$books); \n }\n else\n {\n $books= DB::table('bookdetails')\n ->leftJoin('books', 'bookdetails.id','=','books.book_name_id')\n\n ->select(DB::raw('count(books.id) as available, bookdetails.*'))\n ->where('bookdetails.category','=' , $select)\n ->where('bookdetails.'.$type, 'LIKE', $search.'%')\n ->groupBy('bookdetails.id')\n ->get();\n\n $categories = DB::table('categories')->orderBy('id')->get();\n \n return view('resources')->with(\"categories\",$categories)->with(\"books\",$books);\n }\n }", "function get_by_multiple($where) {\n \n }", "public function catFilter(Req $request){\n $cate=DB::table('categorys')\n ->join('subcategorys','categorys.id','=','subcategorys.category_id')\n ->join('books','books.subcategory_id','=','subcategorys.id')\n ->join('owners','books.id','=','owners.book_id')\n ->select('books.*', 'owners.owner_price')\n ->where('categorys.id',[$request->cat])\n ->get();\n return json_encode($cate);\n }", "public static function get_this_booking_request($request)\n {\n return Taxi_bookings::where('status','1')\n ->where(\"booking_request_id\",$request->booking_request_id)\n ->get();\n }", "function or_whereraw()\n {\n $m = (new Model())\n ->table('products')\n\n ->where([\n ['cost', 50, '>'], // AND\n ['id', 190, '<=']\n ]) \n // AND\n ->group(function($q){ \n $q->where(['active', 1])\n // OR\n ->orWhereRaw('name LIKE ?', ['%a%']); \n })\n // AND\n ->where(['belongs_to', 1, '>'])\n \n ->select(['id', 'name', 'cost', 'size', 'description', 'belongs_to']);\n\n dd($m->get()); \n\t var_dump($m->dd());\n }", "private function SearchPlaceFilter($request){\n $place = Place::select('*'); \n if($request->has('name') && !empty($request->name)){ \n $place->where('places.name','like','%'.$request->name.'%');\n }\n if($request->has('number') && !empty($request->number)){ \n $place->where('places.street_number','like','%'.$request->number.'%');\n }\n if($request->has('streetname') && !empty($request->streetname)){ \n $place->where('places.street_name','like','%'.$request->streetname.'%');\n }\n if($request->has('streetid') && !empty($request->streetid)){ \n $place->where('places.street_type_id',$request->streetid);\n }\n if($request->has('city') && !empty($request->city)){ \n $place->where('places.city_id',$request->city);\n }\n if($request->has('suite') && !empty($request->suite)){ \n $place->where('places.suite','like','%'.$request->suite.'%');\n }\n if($request->has('placetype') && !empty($request->placetype)){ \n $place->where('places.place_type_id',$request->placetype);\n }\n if($request->has('alert') && !empty($request->alert)){ \n $alert = $request->alert == 'true' ? 1 : 0; \n $place->where('places.alert',$alert);\n }\n if($request->has('hold') && !empty($request->hold)){ \n $hold = $request->hold == 'true' ? 1 : 0; \n $place->where('places.on_hold',$hold);\n }\n if($request->has('active') && !empty($request->active)){ \n $active = $request->active == 'true' ? [1] : [0,1]; \n $place->whereIn('places.active',$active);\n }else{\n $place->where('places.active',1);\n }\n return $place;\n }", "public function searchBookByTag($tag)\n {\n $tag = Tag::where('name','=',$tag)->get();\n if(count($tag) != 0){\n $book_tag = BookTag::where('tag_id','=',$tag[0]->id)->lists('id');\n if(count($book_tag) != 0)\n {\n $books = Book::whereIn('id',$book_tag)->get();\n $this->layout->content = View::make('admin.books.index', compact('books'));\n }\n \n \n }\n return Redirect::to('/')->with('error_message','Please put valid tags');\n }", "public function getContactsFiltred(Request $request)\n {\n $existingTypes = ['Undefined','Entreprise','Personne','User'];\n $existingRelations = \\App\\Relation::select('relation')->distinct()->pluck('relation')->toArray();\n $existingRelations = \\array_merge($existingRelations, ['client','fournisseur','prospect','collegue']);\n if($request->relations)\n {\n // validation of the relations \n $relations = \\explode(',',$request->relations);\n foreach($relations as $relation)\n {\n if(! \\in_array($relation,$existingRelations))\n {\n return response()->json([\"message\"=>\"Invalide relation value : '$relation' \"],400);\n }\n\n }\n //applying the relations filter to build a query \n $query = \\App\\Contact::where(function($query) use ($relations)\n {\n $query->whereHas('relations' ,function ($query) use ($relations)\n {\n $query->whereIn('relation',$relations);\n });\n });\n \n }else\n {\n //if relations was not passed as an argument we build a query that returns all contacts\n $query = \\App\\Contact::whereRaw('1');\n }\n\n \n if($request->types)\n { \n $types = \\explode(',',$request->types);\n //validation of the types \n foreach($types as $key=>$type)\n {\n if(! \\in_array($type,$existingTypes))\n {\n return response()->json([\"message\"=>\"Invalide type value : '$type' \"],400);\n }else if($type == \"Personne\" || $type == \"Entreprise\")\n {\n $types[$key] = \"App\\\\\".$type;\n } \n \n } \n $query = $query->where(function ($query) use($types)\n {\n //checking for undefined to be tested as contactable_type is NULL\n if(\\in_array('Undefined',$types))\n {\n $query->WhereIn('contactable_type',$types)->orWhereNull('contactable_type'); \n }else\n {\n $query->WhereIn('contactable_type',$types);\n } \n \n //checking for User as it needs a special request to find out who's a user\n if(\\in_array(\"User\",$types))\n { \n $query->orWhereRaw('id in (SELECT contacts.id from contacts \n join personnes on contacts.contactable_id = personnes.id WHERE contacts.contactable_type = \"App\\\\\\Personne\" and personnes.user_id IS NOT NULL)');\n }\n });\n \n }\n //returning a ressource collection of the results of the query\n return ContactResource::collection($query->paginate());\n \n }", "public function get_type_document_select ( Request $request, $type = '' )\n {\n if ( $type == 'F' ) \n $data = Db::table('documents')\n ->where( 'name', 'NOT LIKE', '%CUIT%' )\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n else\n if ( $type == 'J' ) \n $data = Db::table('documents')\n ->where( 'name', 'like', '%CUIT%' )\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n else\n $data = Db::table('documents')\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n\n return $data; \n }", "public function ScopeSearchParticipantBookings($query, $request)\n {\n // return $query::all();\n\n $user = \\Auth::user();\n // pr($request->all(),1);\n $members = DB::table('users')\n ->where('first_name', 'like',$request->input('member'))\n ->orWhere('last_name', 'like',$request->input('member'))\n ->orWhere('email', 'like',$request->input('member'))\n ->select('id')\n ->get();\n\n // pr($members->pluck('id')->toArray());\n\n return $query->whereDate('booking_orders.starts_at', '>=', $request->get('start_date'))\n ->whereDate('booking_orders.ends_at', '<=', $request->get('end_date'))\n ->where('provider_id', '=', $user->id)\n ->where(function ($query) use ($members){\n $query->whereIn('participant_id', $members->pluck('id')->toArray());\n }) \n ->get();\n\n \n }", "public function writers() { \n $users = User::whereHas('roles', function($query)\n{\n $query->where('name', 'writer');\n $query->orWhere('name', 'counterA');\n \n}) \n ->get();\n return response($users);\n }", "function where_raw(){\n $m = DB::table('products')\n ->where(['belongs_to' => 90])\n ->whereRaw('cost < IF(size = \"1L\", ?, 100) AND size = ?', [300, '1L'])\n ->orderBy(['cost' => 'ASC']);\n\n dd($m->get()); \n\t var_dump($m->dd());\n }", "public function hotelFilterByPrice(Request $request){\n \n $keyword=$request->price;\n $max=0;\n $min=0;\n\n $resulthotels=null;\n\n if($keyword == '0-60'){\n $min_price=0;\n $max_price=60;\n\n \n $resulthotels=Company::withCount(['room'=>function ($q) use($min_price,$max_price){\n $q->whereBetween('pricepernight',[$min_price,$max_price])\n ->where('status','=',1);\n }])\n ->whereHas('room',function ($q) use($min_price,$max_price){\n return $q->whereBetween('pricepernight',[$min_price,$max_price])\n ->where('status','=',1);\n })\n ->get();\n\n \n\n \n }\n\n elseif($keyword == '70-140'){\n $min_price=70;\n $max_price=140;\n\n $resulthotels=Company::withCount(['room'=>function ($q) use($min_price,$max_price){\n $q->whereBetween('pricepernight',[$min_price,$max_price])\n ->where('status','=',1);\n }])->whereHas('room',function ($q) use($min_price,$max_price){\n return $q->whereBetween('pricepernight',[$min_price,$max_price])\n ->where('status','=',1);\n })->get();\n\n }else{\n $resulthotels=Company::withCount(['room'=>function ($q) {\n $q->where('pricepernight','>',140)\n ->where('status','=',1);\n }])->whereHas('room',function ($q) {\n return $q->where('pricepernight','>',140)\n ->where('status','=',1);\n })->get();\n }\n\n \n\n return response()->json(['hotels'=>$resulthotels]);\n \n }", "public function getSwappers(Request $request){\n $request->validate([\n 'guard' => 'required',\n 'roster' => 'required'\n ]);\n\n $guard = $request->guard;\n $roster = $request->roster;\n \n\n $guards = DB::select(DB::raw(\"SELECT guard_id from guard_roster where shift_type_id <> (SELECT DISTINCT(shift_type_id) from guard_roster where guard_id = '$guard') and duty_roster_id = '$roster'\"));\n $temp = array();\n\n foreach($guards as $guard){\n array_push($temp, $guard->guard_id);\n }\n\n $guards = Guard::find($temp);\n\n return response()->json([\n 'error' => false,\n 'guards' => $guards\n ]);\n }", "function not(){\n $m = DB::table('products')\n\n ->not(function($q){ // <-- group *\n $q->where([\n ['cost', 100, '>'],\n ['id', 50, '<']\n ]) \n // OR\n ->orWhere([\n ['cost', 100, '<='],\n ['description', NULL, 'IS NOT']\n ]); \n })\n // AND\n ->where(['belongs_to', 150, '>'])\n \n ->select(['id', 'cost', 'size', 'description', 'belongs_to']);\n \n dd($m->get()); \n var_dump($m->dd());\n }", "public function getBooks()\n {\n return Book::find()->filterWhere(['like','authors','\"'.$this->id.'\"'])->andWhere(['>','status',0])->all();\n// return Book::find()->where('like','authors',)->all();\n }", "public function get_photos_all($thread_id,$post_id){\nreturn $this->where(array('post_id' => $post_id, 'thread_id' => $thread_id))->get();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the strategy from an Auth0 user ID.
public static function get_strategy( $auth0_id ) { if ( false === strpos( $auth0_id, '|' ) ) { return ''; } $auth0_id_parts = explode( '|', $auth0_id ); return $auth0_id_parts[0]; }
[ "public function getUserStrategy()\r\n {\r\n $config = $this->_config;\r\n \r\n $options = null;\r\n if (isset($config['user'])) {\r\n $options = $config['user'];\r\n }\r\n \r\n $userStrategy = new UserStrategy($options);\r\n return $userStrategy;\r\n }", "function b2c_get_current_user_auth_provider() {\n\t $user_id = get_current_user_id();\n\tif ( $user_id == 0 ) {\n\t\t// no user is logged in\n\t\treturn null;\n\t}\n\n\treturn get_user_meta( $user_id, 'b2c_auth_provider', true );\n}", "public function find_auth0_user( $id ) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $id ) ) {\n\t\t\tWP_Auth0_ErrorManager::insert_auth0_error( __METHOD__, __( 'Empty user id', 'wp-auth0' ) );\n\n\t\t\treturn null;\n\t\t}\n\n\t\t$query = array(\n\t\t\t'meta_key' => $wpdb->prefix . 'auth0_id',\n\t\t\t'meta_value' => $id,\n\t\t\t'blog_id' => 0,\n\t\t);\n\n\t\t$users = get_users( $query );\n\n\t\tif ( $users instanceof WP_Error ) {\n\t\t\tWP_Auth0_ErrorManager::insert_auth0_error( __METHOD__ . ' => get_users() ', $users->get_error_message() );\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn ! empty( $users[0] ) ? $users[0] : null;\n\t}", "function get_user($id) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t\r\n\t\t\t$users_table = $this->model->get_users_table_name();\r\n\t\t\t\r\n\t\t\t$users = $wpdb->get_results(\"SELECT * FROM $users_table WHERE tractis_auth_userid = '$id'\");\r\n\t\t\tif (count($users)>0){\r\n\t\t\t\treturn $users[0];\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}", "public function get(string $user_handle): ?User;", "public function getStrategy()\n {\n $value = $this->get(self::strategy);\n return $value === null ? (string)$value : $value;\n }", "public static function fetchUserAuthHook($user_id, $hook);", "public function getStrategy(string $context) : StrategyInterface;", "public function get_user_id();", "function\tget_user($user_id) {\n\t\t$this->clear_cached_data();\n\t\tif (isset($this->cache['users'][$user_id]))\n\t\t\treturn ($this->cache['users'][$user_id]);\n\t\treturn (null);\n\t}", "private function _getUserOauth( $user_id ) {\n return craft()->picPuller_appCreation->getUserOauthValue($user_id);\n }", "function getGoogleUser($bdd, $idGoogle) {\n\t$stmt = $bdd->prepare(\"SELECT * FROM users WHERE id_google = :id_google AND provider = 'google' \");\n\t$stmt->bindParam('id_google', $idGoogle, PDO::PARAM_STR);\n\t$stmt->execute();\n\tif($user = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\treturn $user;\n\t}\n\n\treturn null;\n}", "public function getAuthenticationStrategy()\n {\n if ($this->initialized === false) {\n $this->initialize();\n }\n\n return $this->authenticationStrategy;\n }", "public function getStrategy()\n {\n return $this->_strategy;\n }", "protected function getAuthService($protocol)\n {\n $protocols = [\n 'oauth1' => $this->oauth1,\n 'oauth2' => $this->oauth2,\n ];\n\n return $protocols[$protocol] ?: null;\n }", "function get_user_by_provider_and_id( $provider_name, $provider_user_id )\n{\n\treturn mysqli_query_excute( \"SELECT * FROM users WHERE hybridauth_provider_name = '$provider_name' AND hybridauth_provider_uid = '$provider_user_id'\" );\n}", "public function getAuthProviderUid(): ?string;", "function tja_get_sso_provider( $sso_provider_id ) {\n\t\n\tforeach( tja_get_sso_providers() as $sso_provider )\n\t\tif( $sso_provider->id == $sso_provider_id )\n\t\t\treturn $sso_provider;\n\t\n}", "private function getUser()\n {\n if (null !== request()->bearerToken()) {\n $clientId = (new Parser())->parse(request()->bearerToken())->getClaim('aud');\n $client = $this->clientRepository->find($clientId);\n\n return $this->userService->repository->find((int) $client->user_id);\n }\n\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create mock for TransformedKey.
private function createTransformedKeyMock() { return $this->getMockBuilder(TransformedKey::class)->getMock(); }
[ "private function createKeyConfigurationMock()\n {\n return $this->getMockBuilder(KeyConfiguration::class)->getMock();\n }", "private function createKeyProxyInterfaceMock()\n {\n return $this->getMockBuilder(KeyProxyInterface::class)->getMock();\n }", "private function createKeyConfigurationMock()\n {\n return $this->getMockBuilder(\\Picodexter\\ParameterEncryptionBundle\\Configuration\\Key\\KeyConfiguration::class)->getMock();\n }", "public function testCreateKey(): void\n {\n $token = $this->getToken(array(\n 'email' => 'test_full@gmail.com',\n 'password' => 'testfullpassword'\n ));\n $response = static::createClientWithCredentials()->request(\n 'POST',\n '/api/keys',\n ['body' => json_encode([\n 'keyCode' => 'test.key',\n 'description' => 'test description'\n ])]\n );\n $this->assertResponseIsSuccessful();\n $this->assertJsonContains([\n 'keyCode' => 'test.key',\n 'description' => 'test description'\n ]);\n $this->assertMatchesResourceItemJsonSchema(Key::class);\n }", "public function testCreateKey(): void\n {\n $apiKey = $this->createApiManager(\n [\n 'created_at' => '2019-02-25T23=>36=>48Z',\n 'key' => 'PNYH33ZHKVX3HBAT',\n 'target_user' => [\n 'created_at' => '2019-02-24T23=>34=>11Z',\n 'email' => 'examples@user.test',\n 'id' => 'external-user-ids',\n 'updated_at' => '2019-02-24T23=>34=>11Z',\n ],\n 'updated_at' => '2019-02-25T23=>36=>48Z',\n 'user' => [\n 'created_at' => '2019-02-12T22=>08=>30Z',\n 'email' => 'payments@eoneopay.com',\n 'updated_at' => '2019-02-12T22=>08=>30Z',\n ],\n ],\n 201\n )\n ->create(\n (string)\\getenv('PAYMENTS_API_KEY'),\n new ApiKey(['user' => new User(['id' => 'external-user-id'])])\n );\n\n self::assertIsString(($apiKey instanceof ApiKey) ? $apiKey->getKey() : null);\n self::assertInstanceOf(User::class, ($apiKey instanceof ApiKey) ? $apiKey->getUser() : null);\n }", "private function createKeyCacheInterfaceMock()\n {\n return $this->getMockBuilder(KeyCacheInterface::class)->getMock();\n }", "public function testGetters() {\n // Create a key entity using Configuration key provider.\n $values = [\n 'key_id' => $this->getRandomGenerator()->word(15),\n 'key_provider' => 'config',\n 'key_provider_settings' => $this->key_provider_settings,\n ];\n $key = new Key($values, 'key');\n\n $this->assertEquals($values['key_provider'], $key->getKeyProvider()->getPluginId());\n $this->assertEquals($values['key_provider_settings'], $key->getKeyProvider()->getConfiguration());\n $this->assertEquals($values['key_provider_settings']['key_value'], $key->getKeyProvider()->getConfiguration()['key_value']);\n }", "public function testCreateCryptokey()\n {\n }", "public function testNewFromKey()\r\n {\r\n $registry = $this->registry->newFromKey('ref_4');\r\n self::assertEquals(\r\n [\r\n 'key_1_1' => \"value_1_1\",\r\n ],\r\n $registry->get()\r\n );\r\n }", "private function createKeyConfigurationFactoryInterfaceMock()\n {\n return $this->getMockBuilder(KeyConfigurationFactoryInterface::class)->getMock();\n }", "public function testKey()\n {\n $str = 'a.test.key';\n $key = static::$instance->key($str);\n $expected = '0b4e02e6.a.test.key';\n\n verify($key)->equals($expected);\n }", "private function getTKeyAccessor()\n {\n $tKeyAccessor = $this->getMockBuilder('TRex\\Iterator\\resources\\KeyAccessor')\n ->setMethods(array('getIterator'))\n ->getMock();\n\n $tKeyAccessor->expects($this->any())\n ->method('getIterator')\n ->will($this->returnValue($this->getIterator()));\n return $tKeyAccessor;\n }", "public function testGetByHandlerKey(): void\n {\n $handler1 = new TransformableHandlerStub(null, [\n 'getHandlerKey' => ['handler1', 'handler1'],\n ]);\n\n $registered = $this->createInstance([$handler1]);\n\n $result = $registered->getTransformableHandlerByKey('handler1');\n\n self::assertSame($handler1, $result);\n }", "public function testDeleteKey()\n {\n }", "public function testJobKeysCreate()\n {\n }", "public function testModifyCryptokey()\n {\n }", "public function testGetStateKey()\n {\n $subject = $this->createInstance();\n $reflect = $this->reflect($subject);\n\n $state = uniqid('state-');\n\n $this->assertEquals(\n $state,\n $reflect->_getStateKey($state),\n 'Retrieved state key and given state string are not the same.'\n );\n }", "public function testCanGetSpecificKey() {\n $this->assertEquals('Yet another key', $this->container->get('akamai.key_provider')->getKey('second_key'));\n }", "public function testGetEntityKeyFunctionReturnsCorrectKey()\n {\n $testKey = 'storage';\n $this->assertSame(ExS\\Core::ENTITY_KEY_PREFIX . $testKey, ExS\\Core::getEntityKey($testKey));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets channel topic message
private function setTopicMessage($value) { if (is_string($value)) { $this->topic = $value; } return $this; }
[ "public function set_topic( $data )\r\n\t\t{\r\n\t\t\tif ( $data->origin == Data::PM ) {\r\n\t\t\t\t$channel = $this->to_channel( $data->commandArgs[0] );\r\n\t\t\t\t$topic = substr( $data->fullLine, strlen( COMMAND_PREFIX . $data->command . \" \" . $data->commandArgs[0] . \" \" ) );\r\n\t\t\t}\r\n\t\t\telseif ( $data->origin == Data::CHANNEL )\r\n\t\t\t{\r\n\t\t\t\t$channel = $data->receiver;\r\n\t\t\t\t$topic = substr( $data->fullLine, strlen( COMMAND_PREFIX . $data->command . \" \" ) );\r\n\t\t\t}\r\n\r\n\t\t\t$channel = $this->to_channel( $channel );\r\n\t\t\t$_msg = new Message( \"TOPIC\", $channel . \" :\" . $topic );\r\n\t\t\tdebug_message( \"Channel topic for \" . $channel . \" was altered to \\\"\" . $topic . \"\\\"!\" );\r\n\t\t}", "public function set_topic( $topic ) {\n\t\t$topic = wc_clean( $topic );\n\n\t\tif ( ! wc_is_webhook_valid_topic( $topic ) ) {\n\t\t\t$topic = '';\n\t\t}\n\n\t\t$this->set_prop( 'topic', $topic );\n\t}", "public function testChannelsSetTopic()\n {\n }", "public function onTopic($sChannel, $sTopic)\n\t{\n\t\t$this->Log(\"Topic in {$sChannel} has been set to {$sTopic}\");\n\t}", "public function setTopic($text)\n {\n return $this->client->apiCall('groups.setTopic', [\n 'channel' => $this->getId(),\n 'topic' => $text,\n ])->then(function () use ($text) {\n $this->data['topic']['value'] = $text;\n return $text;\n });\n }", "public function setTopic(string $topic)\n {\n $this->topic = $topic;\n\n \n }", "public function setTopic($topic){\r\n\t\t$this->_topic = $topic;\r\n\t}", "public function setTopic($topic)\n {\n # Strip slashes, decode any html entities, strip any tags, and set the data member.\n $topic = ((empty($topic)) ? '' : strip_tags(html_entity_decode(stripslashes($topic), ENT_COMPAT, 'UTF-8')));\n # Clean it up.\n $topic = trim($topic);\n # Set the data member.\n $this->topic = $topic;\n }", "public function setTopic($channel, $topic)\n {\n return $this->method('setTopic', compact('channel', 'topic'));\n }", "public function publish($topic, $message);", "public function setTopic(?string $value): void {\n $this->getBackingStore()->set('topic', $value);\n }", "public function set_email_topic($string) {\n\t // Only change it if it meets minimum / maximum length requirements ...... \n\t \n $minimum_topic_length = 0;\n\t $maximum_topic_length = 255;\n\n\t if ((strlen($string) > $minimum_top_length) && (strlen($string) < $maximum_topic_length)) {\n\n\t\t $this->email_topic = $string;\n\n\t }\n\n }", "public function setIrcTopic($numConns = 0){\r\n $this->sendCommand(\"TOPIC \".$this->ircChannel.\" :\".sprintf(TOPIC_TEMPLATE, $numConns).$this->getTopic());\r\n\t}", "public function setTopic($topic)\r\n\t{\r\n\t\tif (strlen($topic) == 0 || $topic == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->topic = $topic;\r\n\t\treturn true;\r\n\t}", "public function setMessage($key, $message) {\n\t\t$this->msg[$key] = $message;\n\t}", "function set_topic_state( $data )\n\t{\n\t\t$this->topic_state = $data;\n\t}", "function set_event_topic_id($new_topic_id){\n\t\t$this->event_topic_id=$new_topic_id;\n\t}", "public function testMuteTopic()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function publish($channel, $message) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the list element at index to value. For more information on the index argument, see LINDEX. An error is returned for out of range indexes.
public function LSet($key, $index, $value);
[ "public function set($index, $value);", "public function set($index, $element);", "abstract public function set(int $index, $value);", "#[Generic(['params' => ', T', 'return' => 'T'])]\n public function set($index, $element) {\n if ($index < 0 || $index >= $this->size) {\n throw new IndexOutOfBoundsException('Offset '.$index.' out of bounds');\n }\n\n $orig= $this->elements[$index];\n $this->elements[$index]= $element;\n return $orig;\n }", "public function set (int $index, Object $element) : Object;", "public function offsetSet ($index, $newval) {}", "public function offsetSet($index, $newval);", "public function offsetSet($index, $newval) { }", "public function set($index, $value)\n {\n $value = $this->cube($value);\n parent::set($index, $value);\n }", "public function set($index, $value) {\r\n \r\n if($index < 0 or $index >= $this->count()) \r\n {\r\n throw new ArgumentOutOfRangeException(\"index is less than zero. -or- index is greater than or equal to the number of elements in the System.Collections.BitArray.\");\r\n }\r\n \r\n if(is_bool($value)) \r\n {\r\n $this->values[$index] = $value;\r\n }\r\n }", "public function setItemInRequestList($index, $value)\n {\n if (count($this->RequestList) > 1)\n {\n if (isset($this->RequestList[$index]))\n {\n $this->RequestList[$index] = $value;\n }\n }\n }", "#[ReturnTypeWillChange]\n\tpublic function offsetSet( $index, $value ) {\n\t\tif ( is_null( $index ) ) {\n\t\t\t$this->blocks[] = $value;\n\t\t} else {\n\t\t\t$this->blocks[ $index ] = $value;\n\t\t}\n\t}", "public function setItemIndex($value)\n\t{\n\t\t$this->_itemIndex=TPropertyValue::ensureInteger($value);\n\t}", "public function __set($idx, $value)\r\n\t{\r\n\t\t$this->members[$idx] = $value;\r\n\t}", "function replace(int $index, $value): void\n {\n if (!key_exists($index, $this->values)) {\n throw new \\OutOfBoundsException(sprintf(\n 'Cannot replace value at index %d because it does not exist (%s)',\n $index,\n $this->isEmpty()\n ? 'the collection is empty'\n : sprintf('valid indexes are 0 to %d', $this->count() - 1)\n ));\n }\n\n $this->values[$index] = $value;\n }", "function writeItemIndex($value) { $this->_itemindex = $value; }", "public function set(int $index, $element)\n {\n $this->assertIndex($index);\n\n $oldElement = null;\n if ($this->has($index)) {\n $oldElement = $this->get($index);\n }\n\n $this->elements[$index] = $element;\n\n return $oldElement;\n }", "public function setSingleValueIndex($key, $value);", "public function offsetSet( $index, $entry ): void;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method inserts or updates the given WebPageobject in the storage. Before a WebPage could be saved it must be assigned to a WebCollection.
public function save(WebPage $webPage) { if ($webPage->getCollection() === null) { throw new Exception( 'You cannot save a WebPage that doesn\'t belong to a collection'); } // This is a new empty web page if ($webPage->getId() <= 0) { $this->insert($webPage); // This is just a change of an existing web page. } else { $this->update($webPage); } }
[ "public function save(WebPage $webPage);", "function save()\n\t{\n\t\t$this->obj =& new ilLMPageObject($this->content_object);\n\t\t$this->obj->setType(\"pg\");\n\t\t$this->obj->setTitle(ilUtil::stripSlashes($_POST[\"Fobject\"][\"title\"]));\n\t\t$this->obj->setDescription(ilUtil::stripSlashes($_POST[\"Fobject\"][\"desc\"]));\n\t\t$this->obj->setLMId($this->content_object->getId());\n\t\t$this->obj->create();\n\n\t\t// obj_id is empty, if page is created from \"all pages\" screen\n\t\t// -> a free page is created (not in the tree)\n//echo \"<br>savePage:\".$_GET[\"obj_id\"].\":\";\n\t\tif ($_GET[\"obj_id\"] != 0)\n\t\t{\n\t\t\t$this->putInTree();\n\n\t\t\t// check the tree\n\t\t\t$this->checkTree();\n\n\t\t\tilUtil::redirect($this->ctrl->getLinkTargetByClass(\"ilStructureObjectGUI\",\n\t\t\t\t\"edit\", \"\", true));\n\t\t}\n\t\t$up_gui = ($this->content_object->getType() == \"dbk\")\n\t\t\t? \"ilobjdlbookgui\"\n\t\t\t: \"ilobjlearningmodulegui\";\n\t\t$this->ctrl->redirectByClass($up_gui, \"pages\");\n\t}", "public function save()\n {\n // Get page info from the database if it exists\n $page = $this->get_page_data_by_url($this->page_data['url']);\n\n $data = array_filter($this->page_data, function($k) {\n return in_array($k, $this->property_list);\n }, ARRAY_FILTER_USE_KEY);\n\n if (is_null($page)) {\n // Insert to database\n $this->db->insert($this->table_name, $data);\n $this->page_data['id'] = $this->db->insert_id();\n } else {\n // Update database\n $this->db->where('id', $page['id']);\n $this->db->update($this->table_name, $data);\n $this->page_data['id'] = $page['id'];\n }\n\n // If the current page is actually the seed then we can assign seed's data to saved page's data\n if ($this->page_data['url'] === $this->seed_data['url']) {\n $this->seed_data = $this->page_data;\n }\n\n return $this;\n }", "function createOrUpdatePage(PopulatedPage $page);", "public function savePage(Page $page);", "private function SaveNew()\n {\n $treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));\n $treeBuilder->Insert($this->page, $this->parent, $this->previous);\n }", "public function saved(Page $Page)\n {\n //code...\n }", "public function savePageObject($type, $pageId, $objectId);", "function storePage(\\models\\WikiPage $page);", "public function save()\n {\n $project = $this->getProject();\n\n $values = $this->request->getValues();\n list($valid, $errors) = $this->wiki->validatePageCreation($values);\n\n if ($valid) {\n\n $newDate = date('Y-m-d');\n\n $wiki_id = $this->wiki->createpage($values['project_id'], $values['title'], $values['content'], $newDate);\n if ($wiki_id > 0) {\n\n $this->wiki->createEdition($values, $wiki_id, 1, $newDate);\n // don't really care if edition was successful\n\n $this->flash->success(t('The wikipage has been created successfully.'));\n $this->response->redirect($this->helper->url->to('WikiController', 'create', array('plugin' => 'wiki', 'project_id' => $project['id'])), true);\n return;\n } else {\n $this->flash->failure(t('Unable to create the wikipage.'));\n }\n }\n\n $this->create($values, $errors);\n }", "public function save() {\n $db = Zend_Registry::get('db');\n $db->beginTransaction();\n $insert = is_null($this->_idPage);\n try {\n $db->beginTransaction();\n $insert = is_null($this->_idPage);\n $this->savePageData(); //сохраняем даные страницы\n if ($insert) {\n $db->insert('contentPages', array(\n 'idPage' => $this->_idPage\n ));\n $this->_idContentPage = $db->lastInsertId();\n } else {\n //@зачем если у нас одно поле с одного id\n }\n $db->commit();\n //$this->clearCache();\n } catch (Exception $e) {\n $db->rollBack();\n Application_Model_Kernel_ErrorLog::addLogRow(Application_Model_Kernel_ErrorLog::ID_SAVE_ERROR, $e->getMessage(), ';ContentPage.php');\n throw new Exception($e->getMessage());\n }\n return $this;\n }", "abstract public function save(Page $page, Request $request);", "public function updateWebPageIdById($id, $webPageId);", "private function savePages()\n\t{\n\t\tif ( $this->validates() ){\n\t\t\t$this->data['new_pages'] = $this->factory->createChildPosts($this->data);\n\t\t\t$this->setResponse();\n\t\t\treturn;\n\t\t}\n\t\t$this->sendErrorResponse();\n\t}", "public function savePage() {\n $pageId = $this->request->getParameter(\"id\");\n $title = $this->request->getParameter(\"title\");\n if($this->request->existsParameter(\"content\")) {\n $content = $this->request->getParameter(\"content\");\n }\n else {\n $content = '';\n }\n \n $this->page->update($title, $content, $pageId);\n $this->redirect('admin','editPage/'.$pageId);\n\n }", "public function save()\n\n\t\t{\n\n\t\t\t$database\t= new database();\n\n\t\t\tif ( isset($this->_properties['page_content_id']) && $this->_properties['page_content_id'] > 0) \n\n\t\t\t{\n\n\t\t\t\t$sql\t= \"UPDATE page_content SET page_name = '\". $database->real_escape_string($this->page_name) .\"', title = '\". $database->real_escape_string($this->title) .\"', content = '\". $database->real_escape_string($this->content) . \"', modified_date = NOW() WHERE page_content_id = '$this->page_content_id'\";\n\n\t\t\t}\n\n\t\t\telse \n\n\t\t\t{\n\n\t\t\t\t$order_id\t= 0;\n\n\t\t\t\t$sql\t\t= \"INSERT INTO page_content \n\n\t\t\t\t\t\t\t(page_name, title, content, added_date, modified_date, status, order_id) \n\n\t\t\t\t\t\t\tVALUES ('\" . $database->real_escape_string($this->page_name) . \"',\n\n\t\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->title) . \"',\n\n\t\t\t\t\t\t\t\t\t'\" . $database->real_escape_string($this->content) . \"',\n\n\t\t\t\t\t\t\t\t\tNOW(),\n\n\t\t\t\t\t\t\t\t\tNOW(),\n\n\t\t\t\t\t\t\t\t\t'Y',\n\n\t\t\t\t\t\t\t\t\t'\" . $order_id . \"'\n\n\t\t\t\t\t\t\t\t\t)\";\n\n\t\t\t}\n\n\t\t\t//print $sql;\n\n\t\t\t$result\t\t\t= $database->query($sql);\n\n\t\t\t\n\n\t\t\tif($database->affected_rows == 1)\n\n\t\t\t{\n\n\t\t\t\tif($this->page_content_id == 0)\n\n\t\t\t\t{\n\n\t\t\t\t\t$this->page_content_id\t= $database->insert_id;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->initialize($this->page_content_id);\n\n\t\t\t$this->message = cnst11;\n\n\t\t\treturn true;\n\n\t\t}", "private static function doSavePages() {\n\t\tglobal $mod;\n\t\t$save = array();\n\t\t//if (wgPost::isValue('system_websites_id')) $save['system_websites_id'] = wgPost::getValue('system_websites_id');\n\t\t$save['system_websites_id'] = wgSystem::getCurrentWebsite();\n\t\t//if (wgPost::isValue('system_language_id')) $save['system_language_id'] = wgPost::getValue('system_language_id');\n\t\t$save['system_language_id'] = wgLang::getLanguageId();\n\t\t\n\t\tif (wgPost::isValue('pages_templates_id')) $save['pages_templates_id'] = wgPost::getValue('pages_templates_id');\n\t\t//PagesModel::getParentTemplateRecursively(1);\n\t\tif (wgPost::isValue('name')) $save['name'] = wgPost::getValue('name');\n\t\tif (wgPost::isValue('identifier')) $save['identifier'] = valid::safeText(wgPost::getValue('identifier'));\n\t\tif (wgPost::isValue('title')) $save['title'] = wgPost::getValue('title');\n\t\tif (wgPost::isValue('heading1')) $save['heading1'] = wgPost::getValue('heading1');\n\t\tif (wgPost::isValue('heading2')) $save['heading2'] = wgPost::getValue('heading2');\n\t\tif (wgPost::isValue('heading3')) $save['heading3'] = wgPost::getValue('heading3');\n\t\tif (wgPost::isValue('rewrite')) $save['rewrite'] = wgPost::getValue('rewrite');\n\t\tif (wgPost::isValue('keywords')) $save['keywords'] = wgPost::getValue('keywords');\n\t\tif (wgPost::isValue('description')) $save['description'] = wgPost::getValue('description');\n\t\tif (wgPost::isValue('addtext1')) $save['addtext1'] = wgPost::getValue('addtext1');\n\t\tif (wgPost::isValue('addtext2')) $save['addtext2'] = wgPost::getValue('addtext2');\n\t\tif (wgPost::isValue('enabled')) $save['enabled'] = wgPost::getValue('enabled');\n\t\tif (wgPost::isValue('parentid')) $save['parentid'] = wgPost::getValue('parentid');\n\t\tif ($save['parentid'] == PagesModel::getHomeId()) $save['parentid'] = 0;\n\t\tif (wgPost::isValue('sort')) $save['sort'] = wgPost::getValue('sort');\n\t\tif (wgPost::isValue('head')) $save['head'] = wgPost::getValue('head');\n\t\tif (wgPost::isValue('page')) $save['page'] = wgPost::getValue('page');\n\t\tif (wgPost::isValue('note')) $save['note'] = wgPost::getValue('note');\n\t\tif (wgPost::isValue('redirect1')) $save['redirect1'] = (int) wgPost::getValue('redirect1');\n\t\tif (wgPost::isValue('redirect2')) $save['redirect2'] = (int) wgPost::getValue('redirect2');\n\t\tif (wgPost::isValue('redirect3')) $save['redirect3'] = (string) wgPost::getValue('redirect3');\n\t\tif (wgPost::isValue('redirect4')) $save['redirect4'] = (string) wgPost::getValue('redirect4');\n\t\tif ((bool) wgPost::getValue('edit')) {\n\t\t\t$save['where'] = (int) wgPost::getValue('edit');\n\t\t\tif (wgPost::isValue('redirect1')) if ($save['redirect1'] == $save['where']) {\n\t\t\t\t$save['redirect1'] = 0;\n\t\t\t\twgError::add('redirecttosamepage');\n\t\t\t}\n\t\t\tif (wgPost::isValue('redirect2')) if ($save['redirect2'] == $save['where']) {\n\t\t\t\t$save['redirect2'] = 0;\n\t\t\t\twgError::add('redirecttosamepage');\n\t\t\t}\n\t\t\t$mPag = $mod->runModule('pages');\n\t\t\t$save['revision'] = (modulePages::getPageRevision($save['where']) + 1);\n\t\t\t$ok = (bool) PagesModel::doUpdate($save);\n\t\t\t$id = $save['where'];\n\t\t}\n\t\telse {\n\t\t\t$save['revision'] = 1;\n\t\t\t$ok = (int) PagesModel::doInsert($save);\n\t\t\t$id = $ok;\n\t\t}\n\t\tif (isset($save['where'])) unset($save['where']);\n\t\t$save['pages_id'] = $id;\n\t\tPagesRevisionsModel::doInsert($save);\n\t\treturn (bool) $ok;\n\t}", "public function insertPage($parentWebsite, $pageUrl);", "public function copyObject($strNewPrevid = \"\") {\n\n\n $this->objDB->transactionBegin();\n\n //fetch data to be updated after the general copy process\n //page-properties, language dependant\n $arrBasicSourceProperties = $this->objDB->getPArray(\"SELECT * FROM \" . _dbprefix_ . \"page_properties WHERE pageproperties_id = ?\", array($this->getSystemid()));\n\n //create a new page-name\n $this->setStrName($this->generateNonexistingPagename($this->getStrName(), false));\n\n //copy the page-instance and all elements on the page\n parent::copyObject($strNewPrevid);\n\n //update the pages' properties in the table - manually\n foreach($arrBasicSourceProperties as $arrOneProperty) {\n\n //insert or update - the properties for the current language should aready be in place\n $this->objDB->flushQueryCache();\n $arrCount = $this->objDB->getPRow(\"SELECT COUNT(*) FROM \" . _dbprefix_ . \"page_properties WHERE pageproperties_id = ? AND pageproperties_language = ? \", array($this->getSystemid(), $arrOneProperty[\"pageproperties_language\"]));\n\n if($arrCount[\"COUNT(*)\"] == 0) {\n\n $strQuery = \"INSERT INTO \" . _dbprefix_ . \"page_properties\n (pageproperties_browsername,\n pageproperties_keywords,\n pageproperties_description,\n pageproperties_template,\n pageproperties_seostring,\n pageproperties_alias,\n pageproperties_path,\n pageproperties_target,\n pageproperties_language,\n pageproperties_id\n ) VALUES\n (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\n }\n else {\n $strQuery = \"UPDATE \" . _dbprefix_ . \"page_properties\n SET pageproperties_browsername = ?,\n pageproperties_keywords = ?,\n pageproperties_description = ?,\n pageproperties_template = ?,\n pageproperties_seostring = ?,\n pageproperties_alias = ?,\n pageproperties_path = ?,\n pageproperties_target = ?\n WHERE pageproperties_language = ?\n AND pageproperties_id = ?\";\n\n }\n\n $arrValues = array(\n $arrOneProperty[\"pageproperties_browsername\"],\n $arrOneProperty[\"pageproperties_keywords\"],\n $arrOneProperty[\"pageproperties_description\"],\n $arrOneProperty[\"pageproperties_template\"],\n $arrOneProperty[\"pageproperties_seostring\"],\n $arrOneProperty[\"pageproperties_alias\"],\n $arrOneProperty[\"pageproperties_path\"],\n $arrOneProperty[\"pageproperties_target\"],\n $arrOneProperty[\"pageproperties_language\"],\n $this->getSystemid()\n );\n\n if(!$this->objDB->_pQuery($strQuery, $arrValues, array(false, false, false, false, false, false, false, false))) {\n $this->objDB->transactionRollback();\n class_logger::getInstance()->addLogRow(\"error while copying page properties\", class_logger::$levelError);\n return false;\n }\n }\n\n\n $this->objDB->transactionCommit();\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Amount for Shop Payment
public function getAmountShopPayment() { return $this->amount_shop_payment; }
[ "public function getAmountValue();", "public function sum()\r\n\t{\r\n\t\treturn sprintf(\"%.2f %s\", $this->getAmount(), $this->Shop_Order->Shop_Currency->name);\r\n\t}", "private function setup_total() {\n\t\t$amount = $this->get_meta( '_give_payment_total', true );\n\n\t\treturn round( floatval( $amount ), give_get_price_decimals( $this->ID ) );\n\t}", "public function getProposalAmount();", "function simpay_custom_form_157_amount( $currency ) {\n\treturn '123.25';\n}", "public function getPaymentAuthorizationAmount();", "public function getAmount(){\n return $this->getParameter('amount');\n }", "public function getShippingAmount();", "public function amount(): float\n {\n return $this->extras->sum();\n }", "public function getAmount()\n {\n return $this->currentAmount;\n }", "public function getPurchasableAmount();", "public function getAmount()\n {\n return $this->money->getAmount();\n }", "public function amount() {\n return new Double((double)$this->amount);\n }", "public function payAmount()\n {\n if ($this->amount >= 500) {\n $payment = new payByCC();\n } else {\n $payment = new payByPayPal();\n }\n\n $payment->pay($this->amount);\n }", "public function getPrice()\n {\n return ($this->payment_sum+$this->payment_discount);\n }", "function getPotentialAmount(){\n\t\t\t$account_no = \"potentialMoney\";\n\t\t\t//getting money transfer details from database\n\t\t\t$transaction = $this->manageContent->getValueWhere_descending(\"money_transfer_log\",\"*\",\"membership_id\",$account_no);\n\t\t\tif(!empty($transaction))\n\t\t\t{\n\t\t\t\t//initialize the variables\n\t\t\t\t$sl_no = 1;\n\t\t\t\t$total_amount = 0;\n\t\t\t\tforeach($transaction as $transactions){\n\t\t\t\t\t//checking for only debited amount\n\t\t\t\t\tif(!empty($transactions['debit']))\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//checking for membership product or not\n\t\t\t\t\t\tif(substr($transactions['product_id'],0,2) == 'M_')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"membership_product\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(substr($transactions['product_id'],0,1) == 'C')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$coupon_details = $this->manageContent->getValueWhere(\"coupon_table\",\"*\",\"coupon_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $coupon_details[0]['coupon_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"product_table\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//getting member details\n\t\t\t\t\t\t$memberDetails = $this->manageContent->getValueWhere(\"member_table\",\"*\",\"membership_id\",$transactions['notes']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//showing the details of money debited in detail\n\t\t\t\t\t\techo '<tr>\n\t\t\t\t\t\t\t\t<td>'.$sl_no.'</td>\n\t\t\t\t\t\t\t\t<td>'.$memberDetails[0]['name'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$product_name.'</td>\n\t\t\t\t\t\t\t\t<td>'.$transactions['product_quantity'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$this->changeDateFormat($transactions['date']).'</td>\n\t\t\t\t\t\t\t\t<td> € '.$transactions['debit'].'</td>\n\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// total amount calculation\n\t\t\t\t\t\t\t$total_amount = $total_amount + $transactions['debit'];\n\t\t\t\t\t\t\t//increment of serial_no variable\n\t\t\t\t\t\t\t$sl_no++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $total_amount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}", "public function getAmountCurrency();", "public function getBaseShippingAmount();", "public function getGiftcardAmount();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the blockMsolPowerShell property value. To disable the use of the MSOnline PowerShell module set this property to true. This will also disable userbased access to the legacy service endpoint used by the MSOnline PowerShell module. This does not affect Azure AD Connect or Microsoft Graph.
public function setBlockMsolPowerShell(?bool $value): void { $this->getBackingStore()->set('blockMsolPowerShell', $value); }
[ "public function setEdgeBlockPasswordManager(?bool $value): void {\n $this->getBackingStore()->set('edgeBlockPasswordManager', $value);\n }", "public function setResetProtectionModeBlocked($val)\n {\n $this->_propDict[\"resetProtectionModeBlocked\"] = boolval($val);\n return $this;\n }", "public function setLocalSecurityOptionsBlockMicrosoftAccounts(?bool $value): void {\n $this->getBackingStore()->set('localSecurityOptionsBlockMicrosoftAccounts', $value);\n }", "protected function _setCanReadPriceFalse($block)\n {\n if (!$this->observerData->isCanReadProductPrice()) {\n $block->setCanReadPrice(false);\n }\n }", "public function setRevokeOnMdmHandoffDisabled(?bool $value): void {\n $this->getBackingStore()->set('revokeOnMdmHandoffDisabled', $value);\n }", "public function setBlocked(?bool $value): void {\n $this->getBackingStore()->set('blocked', $value);\n }", "public function setStartupAuthenticationBlockWithoutTpmChip($val)\n {\n $this->_propDict[\"startupAuthenticationBlockWithoutTpmChip\"] = $val;\n return $this;\n }", "public function setSystemExtensionsBlockOverride(?bool $value): void {\n $this->getBackingStore()->set('systemExtensionsBlockOverride', $value);\n }", "public function setWindowsStoreBlocked(?bool $value): void {\n $this->getBackingStore()->set('windowsStoreBlocked', $value);\n }", "public function setBlocked($blocked)\n {\n $this->setValue('blocked', $blocked);\n }", "public function setStealthModeBlocked($val)\n {\n $this->_propDict[\"stealthModeBlocked\"] = $val;\n return $this;\n }", "public function setBrowserBlockEnterpriseModeAccess(?bool $value): void {\n $this->getBackingStore()->set('browserBlockEnterpriseModeAccess', $value);\n }", "public function setLanManagerWorkstationDisableInsecureGuestLogons(?bool $value): void {\n $this->getBackingStore()->set('lanManagerWorkstationDisableInsecureGuestLogons', $value);\n }", "protected function _setOptionsEditReadFalse($block)\n {\n if (!$this->observerData->isCanEditProductPrice()) {\n $optionsBoxBlock = $block->getChildBlock('options_box');\n if ($optionsBoxBlock !== null) {\n $optionsBoxBlock->setCanEditPrice(false);\n if (!$this->observerData->isCanReadProductPrice()) {\n $optionsBoxBlock->setCanReadPrice(false);\n }\n }\n }\n }", "public function setLocalSecurityOptionsBlockMicrosoftAccounts($val)\n {\n $this->_propDict[\"localSecurityOptionsBlockMicrosoftAccounts\"] = boolval($val);\n return $this;\n }", "public function setInternetSharingBlocked(?bool $value): void {\n $this->getBackingStore()->set('internetSharingBlocked', $value);\n }", "public function setMicrosoftAccountBlockSettingsSync(?bool $value): void {\n $this->getBackingStore()->set('microsoftAccountBlockSettingsSync', $value);\n }", "public function setLocationServicesBlocked(?bool $value): void {\n $this->getBackingStore()->set('locationServicesBlocked', $value);\n }", "function setBlocking($value) {\n\t\t$this->params['blocking'] = $value;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a mock connection for testing addConnection().
protected function getMockConnectionForAddConnection() { $connection = $this->getMockConnection(); foreach (array('username', 'hostname', 'servername', 'realname', 'nickname') as $property) { $connection ->expects($this->once()) ->method('get' . ucfirst($property)) ->will($this->returnValue($property)); } return $connection; }
[ "protected function createConnectionMock()\n {\n $connectionMock = $this->getMock('Connection', array('connect'));\n $connectionMock->expects($this->once())->method('connect');\n\n return $connectionMock;\n }", "protected function getMockConnection()\n {\n return $this->getMock('\\Phergie\\Irc\\ConnectionInterface', array(), array(), '', false);\n }", "private function mockConnection()\n {\n $objectManager = $this->getMockBuilder(ObjectManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $resource = $this->getMockBuilder(AbstractDb::class)\n ->disableOriginalConstructor()\n ->getMock();\n $connection = $this->getMockBuilder(AdapterInterface::class)\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n $statement = $this->getMockBuilder(Mysql::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->fixtureModelMock->expects($this->atLeastOnce())->method('getObjectManager')->willReturn($objectManager);\n $objectManager->expects($this->atLeastOnce())\n ->method('get')\n ->willReturn($resource);\n $resource->expects($this->atLeastOnce())->method('getConnection')->willReturn($connection);\n $connection->expects($this->atLeastOnce())\n ->method('getTableName')\n ->willReturn('table_name');\n $resource->expects($this->atLeastOnce())\n ->method('getTable')\n ->willReturn('table_name');\n $connection->expects($this->atLeastOnce())\n ->method('query')\n ->willReturn($statement);\n $connection->expects($this->atLeastOnce())->method('getTransactionLevel')->willReturn(0);\n $connection->expects($this->atLeastOnce())->method('beginTransaction')->willReturnSelf();\n $statement->expects($this->atLeastOnce())->method('fetchColumn')->with(0)->willReturn(25);\n }", "protected function getMockDbConnection()\n {\n $mockCDbSchema = $this->getMockCDbSchema();\n $mockDbCommand = $this->getMockDbCommand();\n\n $mock = $this->getObjectMock('Craft\\DbConnection');\n $mock->autoConnect = false; // Do not auto connect\n\n $mock->expects($this->any())->method('getSchema')->willReturn($mockCDbSchema);\n $mock->expects($this->any())->method('createCommand')->willReturn($mockDbCommand);\n\n return $mock;\n }", "protected function mockPdoConnection()\n {\n self::$initialResolver = Model::getConnectionResolver();\n\n Model::unsetConnectionResolver();\n\n $connection = new MySqlConnection($mock = Mockery::mock(PDO::class), 'testing_mock');\n $resolver = new ConnectionResolver(['mocked' => $connection]);\n $resolver->setDefaultConnection('mocked');\n\n Model::setConnectionResolver($resolver);\n\n return $mock;\n }", "protected function mockDatabaseConnection() {}", "protected function getMockConnectionHandler()\n {\n if (empty($this->connections)) {\n $this->connections = $this->getMock('Phergie_Connection_Handler');\n }\n return $this->connections;\n }", "protected function getMockConnection($parameters = null) {\n\t\t$connection = $this->getMock ( 'Predis\\Connection\\SingleConnectionInterface' );\n\t\t\n\t\tif ($parameters) {\n\t\t\t$parameters = new ConnectionParameters ( $parameters );\n\t\t\t$hash = \"{$parameters->host}:{$parameters->port}\";\n\t\t\t\n\t\t\t$connection->expects ( $this->any () )->method ( 'getParameters' )->will ( $this->returnValue ( $parameters ) );\n\t\t\t$connection->expects ( $this->any () )->method ( '__toString' )->will ( $this->returnValue ( $hash ) );\n\t\t}\n\t\t\n\t\treturn $connection;\n\t}", "protected function getConnection()\n {\n require_once dirname(__FILE__) . '/bootstrap_pdo.php';\n return getConnectionToTestDB();\n }", "protected function getConnection()\n {\n if (empty(self::$connection))\n {\n self::$connection = new \\PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($this->getPdo());\n }\n\n return self::$connection;\n }", "public function testConnect()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $connection->connect();\n $this->assertEquals($this->mockPdo, $connection->pdo);\n }", "protected function getMockWriteStreamForAddConnection()\n {\n $writeStream = $this->getMockWriteStream();\n $writeStream\n ->expects($this->once())\n ->method('ircUser')\n ->with('username', 'hostname', 'servername', 'realname');\n $writeStream\n ->expects($this->once())\n ->method('ircNick')\n ->with('nickname');\n return $writeStream;\n }", "public function testGetNewConnection() {\n $pool = $this->reflector->getProperty(\"pool\");\n $pool->setAccessible(true);\n \n $this->assertCount(0, $pool->getValue($this->instance));\n \n $connection = $this->instance->getConnection(\n $this->BaseConfig['class'], \n $this->BaseConfig['host'], \n $this->BaseConfig['port'], \n $this->BaseConfig['database']\n );\n \n $this->assertInstanceOf($this->BaseConfig['class'], $connection);\n $this->assertCount(1, $pool->getValue($this->instance));\n }", "protected function getConnector()\n {\n $mock = $this->getMockBuilder(\\Mezon\\CrudService\\CrudServiceClient::class)\n ->setMethods([\n 'newRecordsSince',\n 'getList'\n ])\n ->disableOriginalConstructor()\n ->getMock();\n\n return $mock;\n }", "protected function getConnectedClientMock() {\n $mockClient = $this->getMockBuilder('phpseclib\\Net\\SFTP')\n ->disableOriginalConstructor()\n ->getMock();\n $mockClient->expects($this->any())\n ->method('isConnected')\n ->willReturn(TRUE);\n return $mockClient;\n }", "protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection($this->TEST_DB_PDO(), $this->TEST_GET_DB_INFO()->name);\n\t}", "public function testAddConnection()\n {\n $connection = $this->getMockConnection();\n\n $this->assertEquals(0, count($this->connections));\n $this->connections->addConnection($connection);\n $this->assertEquals(1, count($this->connections));\n\n foreach ($this->connections as $entry) {\n $this->assertSame($connection, $entry);\n }\n }", "final public function getConnection()\n {\n $dbData = array();\n $config = Registry::get('config');\n\n foreach (array('dbEngineTest', 'dbHostTest', 'dbUserTest', 'dbPasswordTest', 'dbNameTest', 'dbPrefixTest') as $configKey) {\n /*\n * Using the data for the db from the config.\n * We check if special config variables for this test execution exist.\n * If so we gonna use it. Otherwise we have to skip the tests.\n */\n if ($config->get($configKey) !== null) {\n $dbData[$configKey] = $config->get($configKey);\n } else {\n $this->markTestIncomplete('Necessary DB configuration is not set.');\n return;\n }\n }\n\n $dsn = strtolower($dbData['dbEngineTest']).':dbname='.$dbData['dbNameTest'].';host='.$dbData['dbHostTest'];\n $dbData['dbDsnTest'] = $dsn;\n\n if ($this->conn === null) {\n if (self::$pdo === null) {\n self::$pdo = new PDO($dbData['dbDsnTest'], $dbData['dbUserTest'], $dbData['dbPasswordTest']);\n }\n\n $this->conn = $this->createDefaultDBConnection(self::$pdo, $dbData['dbNameTest']);\n }\n\n return $this->conn;\n }", "protected function getMockSocket()\n {\n return $this->getMock('Wrench\\Socket\\ClientSocket', array(), array('wss://localhost:8000'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Overrides the method SoapClient.__soapCall() to process the response from the SOAP call.
function __soapCall($function_name, $arguments, $options = NULL, $input_headers = NULL, &$output_headers = NULL) { try { $input_headers[] = $this->GenerateSoapHeader(); $this->lastHeaders = $input_headers; $this->lastArguments = $arguments; $response = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers); $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name); return $response; } catch (SoapFault $e) { $this->ProcessResponse($this->lastRequest, $this->__getLastResponse(), $function_name, $e); throw $e; } }
[ "public function __soapCall ($function_name, array $arguments, array $options = null, $input_headers = null, array &$output_headers = null) {}", "public function getResponse()\n {\n try {\n set_error_handler(array('XML_RPC2_Backend_Php_Server', 'errorToException'));\n $request = @simplexml_load_string($GLOBALS['HTTP_RAW_POST_DATA']);\n // TODO : do not use exception but a XMLRPC error !\n if (!is_object($request)) throw new XML_RPC2_FaultException('Unable to parse request XML', 0);\n $request = XML_RPC2_Backend_Php_Request::createFromDecode($request); \n $methodName = $request->getMethodName();\n $arguments = $request->getParameters();\n if ($this->signatureChecking) {\n $method = $this->callHandler->getMethod($methodName);\n if (!($method)) {\n // see http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php for standard error codes \n return (XML_RPC2_Backend_Php_Response::encodeFault(-32601, 'server error. requested method not found'));\n }\n if (!($method->matchesSignature($methodName, $arguments))) {\n return (XML_RPC2_Backend_Php_Response::encodeFault(-32602, 'server error. invalid method parameters')); \n }\n }\n restore_error_handler();\n return (XML_RPC2_Backend_Php_Response::encode(call_user_func_array(array($this->callHandler, $methodName), $arguments), $this->encoding)); \n } catch (XML_RPC2_FaultException $e) {\n return (XML_RPC2_Backend_Php_Response::encodeFault($e->getFaultCode(), $e->getMessage(), $this->encoding));\n } catch (Exception $e) {\n return (XML_RPC2_Backend_Php_Response::encodeFault(1, 'Unhandled ' . get_class($e) . ' exception:' . $e->getMessage(), $this->encoding));\n } \n }", "private\n function getResult($xmlresponse) {\n $start = strpos($xmlresponse,'<?xml');\n $end = strrpos($xmlresponse,'>');\n $soapdata = substr($xmlresponse,$start,$end-$start+1);\n $xml_parser = xml_parser_create();\n xml_parse_into_struct($xml_parser, $soapdata, $vals, $index);\n xml_parser_free($xml_parser);\n if(array_key_exists(\"RESULT\",$index))\n $result = $vals[$index['RESULT'][0]]['value'];\n if(!empty($result))\n return $result;\n return \"SOAP Server do not respond!\";\n }", "function get_soapbody(){\n\t\treturn $this->soapresponse;\n\t}", "function invoke_method() {\n\t\t$this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction);\n\n\t\t//\n\t\t// if you are debugging in this area of the code, your service uses a class to implement methods,\n\t\t// you use SOAP RPC, and the client is .NET, please be aware of the following...\n\t\t// when the .NET wsdl.exe utility generates a proxy, it will remove the '.' or '..' from the\n\t\t// method name. that is fine for naming the .NET methods. it is not fine for properly constructing\n\t\t// the XML request and reading the XML response. you need to add the RequestElementName and\n\t\t// ResponseElementName to the System.Web.Services.Protocols.SoapRpcMethodAttribute that wsdl.exe\n\t\t// generates for the method. these parameters are used to specify the correct XML element names\n\t\t// for .NET to use, i.e. the names with the '.' in them.\n\t\t//\n\t\t$orig_methodname = $this->methodname;\n\t\tif ($this->wsdl) {\n\t\t\tif ($this->opData = $this->wsdl->getOperationData($this->methodname)) {\n\t\t\t\t$this->debug('in invoke_method, found WSDL operation=' . $this->methodname);\n\t\t\t\t$this->appendDebug('opData=' . $this->varDump($this->opData));\n\t\t\t} elseif ($this->opData = $this->wsdl->getOperationDataForSoapAction($this->SOAPAction)) {\n\t\t\t\t// Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element\n\t\t\t\t$this->debug('in invoke_method, found WSDL soapAction=' . $this->SOAPAction . ' for operation=' . $this->opData['name']);\n\t\t\t\t$this->appendDebug('opData=' . $this->varDump($this->opData));\n\t\t\t\t$this->methodname = $this->opData['name'];\n\t\t\t} else {\n\t\t\t\t$this->debug('in invoke_method, no WSDL for operation=' . $this->methodname);\n\t\t\t\t$this->fault('SOAP-ENV:Client', \"Operation '\" . $this->methodname . \"' is not defined in the WSDL for this service\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->debug('in invoke_method, no WSDL to validate method');\n\t\t}\n\n\t\t// if a . is present in $this->methodname, we see if there is a class in scope,\n\t\t// which could be referred to. We will also distinguish between two deliminators,\n\t\t// to allow methods to be called a the class or an instance\n\t\tif (strpos($this->methodname, '..') > 0) {\n\t\t\t$delim = '..';\n\t\t} else if (strpos($this->methodname, '.') > 0) {\n\t\t\t$delim = '.';\n\t\t} else {\n\t\t\t$delim = '';\n\t\t}\n\t\t$this->debug(\"in invoke_method, delim=$delim\");\n\n\t\t$class = '';\n\t\t$method = '';\n\t\tif (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1) {\n\t\t\t$try_class = substr($this->methodname, 0, strpos($this->methodname, $delim));\n\t\t\tif (class_exists($try_class)) {\n\t\t\t\t// get the class and method name\n\t\t\t\t$class = $try_class;\n\t\t\t\t$method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim));\n\t\t\t\t$this->debug(\"in invoke_method, class=$class method=$method delim=$delim\");\n\t\t\t} else {\n\t\t\t\t$this->debug(\"in invoke_method, class=$try_class not found\");\n\t\t\t}\n\t\t} else {\n\t\t\t$try_class = '';\n\t\t\t$this->debug(\"in invoke_method, no class to try\");\n\t\t}\n\n\t\t// does method exist?\n\t\tif ($class == '') {\n\t\t\tif (!function_exists($this->methodname)) {\n\t\t\t\t$this->debug(\"in invoke_method, function '$this->methodname' not found!\");\n\t\t\t\t$this->result = 'fault: method not found';\n\t\t\t\t$this->fault('SOAP-ENV:Client',\"method '$this->methodname'('$orig_methodname') not defined in service('$try_class' '$delim')\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\t$method_to_compare = (substr(phpversion(), 0, 2) == '4.') ? strtolower($method) : $method;\n\t\t\tif (!in_array($method_to_compare, get_class_methods($class))) {\n\t\t\t\t$this->debug(\"in invoke_method, method '$this->methodname' not found in class '$class'!\");\n\t\t\t\t$this->result = 'fault: method not found';\n\t\t\t\t$this->fault('SOAP-ENV:Client',\"method '$this->methodname'/'$method_to_compare'('$orig_methodname') not defined in service/'$class'('$try_class' '$delim')\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// evaluate message, getting back parameters\n\t\t// verify that request parameters match the method's signature\n\t\tif(! $this->verify_method($this->methodname,$this->methodparams)){\n\t\t\t// debug\n\t\t\t$this->debug('ERROR: request not verified against method signature');\n\t\t\t$this->result = 'fault: request failed validation against method signature';\n\t\t\t// return fault\n\t\t\t$this->fault('SOAP-ENV:Client',\"Operation '$this->methodname' not defined in service.\");\n\t\t\treturn;\n\t\t}\n\n\t\t// if there are parameters to pass\n\t\t$this->debug('in invoke_method, params:');\n\t\t$this->appendDebug($this->varDump($this->methodparams));\n\t\t$this->debug(\"in invoke_method, calling '$this->methodname'\");\n\t\tif (!function_exists('call_user_func_array')) {\n\t\t\tif ($class == '') {\n\t\t\t\t$this->debug('in invoke_method, calling function using eval()');\n\t\t\t\t$funcCall = \"\\$this->methodreturn = $this->methodname(\";\n\t\t\t} else {\n\t\t\t\tif ($delim == '..') {\n\t\t\t\t\t$this->debug('in invoke_method, calling class method using eval()');\n\t\t\t\t\t$funcCall = \"\\$this->methodreturn = \".$class.\"::\".$method.\"(\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->debug('in invoke_method, calling instance method using eval()');\n\t\t\t\t\t// generate unique instance name\n\t\t\t\t\t$instname = \"\\$inst_\".time();\n\t\t\t\t\t$funcCall = $instname.\" = new \".$class.\"(); \";\n\t\t\t\t\t$funcCall .= \"\\$this->methodreturn = \".$instname.\"->\".$method.\"(\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->methodparams) {\n\t\t\t\tforeach ($this->methodparams as $param) {\n\t\t\t\t\tif (is_array($param) || is_object($param)) {\n\t\t\t\t\t\t$this->fault('SOAP-ENV:Client', 'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$funcCall .= \"\\\"$param\\\",\";\n\t\t\t\t}\n\t\t\t\t$funcCall = substr($funcCall, 0, -1);\n\t\t\t}\n\t\t\t$funcCall .= ');';\n\t\t\t$this->debug('in invoke_method, function call: '.$funcCall);\n\t\t\t@eval($funcCall);\n\t\t} else {\n\t\t\tif ($class == '') {\n\t\t\t\t$this->debug('in invoke_method, calling function using call_user_func_array()');\n\t\t\t\t$call_arg = \"$this->methodname\";\t// straight assignment changes $this->methodname to lower case after call_user_func_array()\n\t\t\t} elseif ($delim == '..') {\n\t\t\t\t$this->debug('in invoke_method, calling class method using call_user_func_array()');\n\t\t\t\t$call_arg = array ($class, $method);\n\t\t\t} else {\n\t\t\t\t$this->debug('in invoke_method, calling instance method using call_user_func_array()');\n\t\t\t\t$instance = new $class ();\n\t\t\t\t$call_arg = array(&$instance, $method);\n\t\t\t}\n\t\t\tif (is_array($this->methodparams)) {\n\t\t\t\t$this->methodreturn = call_user_func_array($call_arg, array_values($this->methodparams));\n\t\t\t} else {\n\t\t\t\t$this->methodreturn = call_user_func_array($call_arg, array());\n\t\t\t}\n\t\t}\n $this->debug('in invoke_method, methodreturn:');\n $this->appendDebug($this->varDump($this->methodreturn));\n\t\t$this->debug(\"in invoke_method, called method $this->methodname, received data of type \".gettype($this->methodreturn));\n\t}", "public function processResponse() {\n $result = $this->getAllResponse();\n $this->status = isset($result['status']) ? intval($result['status']) : NULL;\n $this->response = isset($result['response']) && is_array($result['response']) ? $result['response'] : array();\n $this->errors = (isset($this->response['error']) ? $this->response['error'] : array());\n }", "abstract protected function handleResponse(\\SimpleXMLElement $xml);", "abstract protected function _response();", "#[Deprecated]\n public function processGetLocationResponseSOAP(ResponseInterface $response)\n {\n try {\n $xml = new SimpleXMLElement(static::getResponseText($response));\n } catch (HttpClientException $e) {\n throw $e;\n } catch (ResponseException $e) {\n throw new ResponseException($e->getMessage(), 0, $e, $response);\n } catch (Exception $e) {\n throw new ResponseException('Could not parse response', 0, $e, $response);\n }\n\n static::registerNamespaces($xml);\n static::validateSOAPResponse($xml);\n\n $reader = new Reader();\n $reader->xml(static::getResponseText($response));\n try {\n $array = array_values($reader->parse()['value'][0]['value']);\n } catch (LibXMLException $e) {\n throw new ResponseException('Could not parse response', 0, $e, $response);\n }\n $array = $array[0];\n\n /** @var GetLocationsInAreaResponse $object */\n $object = AbstractEntity::xmlDeserialize($array);\n $this->setService($object);\n\n return $object;\n }", "function _uc_tejarat_soap_call($soap_method, $soap_params) {\n // Load the legacy nuSOAP library.\n module_load_include('php', 'uc_tejarat', 'includes/nusoap');\n\n // Instantiate a legacy SOAPClient object.\n $soap_server = _uc_tejarat_gateway_uri('soap');\n $soap_client = new nusoap_client($soap_server);\n\n // Check for instantiation errors.\n if ($soap_client->getError()) {\n // Log SOAP instantiation error.\n watchdog('uc_tejarat', 'Could not connect to SOAP server: @error', array(\n '@error' => $soap_client->getError()\n ), WATCHDOG_ERROR);\n return FALSE;\n }\n\n // Set service specific options before remote method call.\n $soap_client->setUseCurl(TRUE);\n\n // There were no instantiation error, call the remote method.\n $soap_results = $soap_client->call($soap_method, $soap_params, UC_TEJARAT_GATEWAY_NAMESPACE);\n\n // Check for SOAP call faults.\n if ($soap_client->fault) {\n // Log SOAP method call error.\n watchdog('uc_tejarat', 'Transaction validation failed, fault: @fault', array(\n '@fault' => $soap_results\n ), WATCHDOG_ERROR);\n return FALSE;\n }\n\n // Check for SOAP call errors.\n if ($soap_client->getError()) {\n watchdog('uc_tejarat', 'Transaction validation failed, error: @error', array(\n '@error' => $soap_client->getError()\n ), WATCHDOG_ERROR);\n return FALSE;\n }\n\n // No probs, return results.\n return $soap_client->return;\n}", "abstract public function executeAndGetResponse();", "function CallService($Endpoint=null, $Method=null, $Params=null,$isWSDL=null,$Session=null)\n {\n \t$args=func_get_args();\n \treturn call_user_func_array(array($this,\"CallSoap\"),$args);\n }", "function call(){\n\t\t\n\t\ttry{\n\t\t\t$data = $this->_cecilia->$method($args);\n\t\t}catch(\\Exception $e){\n\t\t return new Response(0,null);\n\t\t}\n\t\t\n\t\treturn(\n\t\t\t\t$data instanceof Response\n\t\t\t\t? $data\n\t\t\t\t: new Response(0,null)\n\t\t\t\t);\n\t}", "private function parseXmlResponse()\n {\n // initiate a new PhpApi Response.\n $this->response = new Response();\n\n try {\n if ($this->xmlResponse === null) {\n throw new UndefinedXmlResponseException('XML Response is not set.');\n }\n\n // get a new SimpleXML objects from the raw response.\n $xml = new SimpleXMLElement($this->xmlResponse);\n\n // loop though all Response getters\n foreach ($this->getResponseParameterGroups($this->response) as $method) {\n // get the instance of the parameter group by calling it's getter.\n $parameterGroupInstance = call_user_func([$this->response, $method]);\n\n // get the mapper class\n if ($mapperClassName = $this->getMappingClass($parameterGroupInstance)) {\n $mapperInstance = new $mapperClassName;\n $this->setParameterGroupProperties($parameterGroupInstance, $mapperInstance, $xml);\n }\n }\n\n // set the criterion data\n if (isset($xml->Transaction->Analysis->Criterion)) {\n foreach ($xml->Transaction->Analysis->Criterion as $criterion) {\n $this->response->getCriterion()->set($criterion['name'], (string)$criterion);\n }\n }\n } catch (\\Exception $e) {\n if ($e instanceof UndefinedXmlResponseException) {\n throw new XmlResponseParserException('Problem while parsing the raw xml response: ' . $e->getMessage());\n }\n\n throw new \\Exception($e->getMessage());\n }\n }", "protected function process()\n {\n $this->result = $this[self::RESPONSE_PROCESSING] == self::TYPE_RAW\n ? $this->request->getResponse()\n : $this->getResponseParser()->parse($this);\n }", "#[Deprecated]\n public function processConfirmResponseSOAP(ResponseInterface $response)\n {\n try {\n $xml = new SimpleXMLElement(static::getResponseText($response));\n } catch (HttpClientException $e) {\n throw $e;\n } catch (ResponseException $e) {\n throw new ResponseException($e->getMessage(), 0, $e, $response);\n } catch (Exception $e) {\n throw new ResponseException('Could not parse response', $e->getCode(), $e, $response);\n }\n\n static::registerNamespaces($xml);\n static::validateSOAPResponse($xml);\n\n $reader = new Reader();\n $reader->xml(static::getResponseText($response));\n try {\n $array = array_values($reader->parse()['value'][0]['value'][0]['value']);\n } catch (LibXMLException $e) {\n throw new ResponseException('Could not parse response', 0, $e, $response);\n }\n $array = $array[0];\n\n /** @var ConfirmingResponseShipment $object */\n $object = AbstractEntity::xmlDeserialize($array);\n $this->setService($object);\n\n return $object;\n }", "private function soap_response_incorporater($soap_response,$data_row,$arr_sequence){\n\n\n\t\t//$data_array = $this->get_mapped_data_array_from_session();\n\n\t\t//var_dump($data_row);exit;\n\n\t\t$response_msg = $soap_response->ResponseMessage;\n\n\t\t$error_msg = $soap_response->ErrorMessage;\n\n\t\t$RequestSequence = $soap_response->RequestSequence;\n\n\t\t$connote = $soap_response->Connote;\n\n\t\t$msg = \"\";\n\n\t\tif($response_msg === 'FAILED'){\n\n\t\t\t$msg = $this->get_error($error_msg);\n\n\t\t\t$data_row['SOAP_error']= '<div class=\"soap_error\">FAIL</div>';\n\t\t\t\t\n\t\t\t$data_row['new_connote'] = $msg;\n\n\t\t\t$this->set_fail_shipment_row($data_row);\n\n\t\t}else if($response_msg === 'INTERNAL ERROR'){\n\n\t\t\t$data_row['SOAP_error']= '<div class=\"soap_error\">FAIL</div>';\n\t\t\t\t\n\t\t\t$data_row['new_connote'] = 'Could not upload record. Internal Server Error<BR>'.$response_msg;\n\n\t\t\t$this->set_fail_shipment_row($data_row);\n\n\t\t}else if($response_msg === 'SUCCESS'){\n\n\t\t\t$data_row['SOAP_error']= '<div class=\"soap_success\">'.$response_msg.'</div>';\n\n\t\t\t$data_row['new_connote'] = $connote;\n\n\t\t\t$this->set_success_shipment_row($data_row);\n\n\t\t}//end if\n\n\t\treturn $data_row;\n\n\t}", "private function parse_response() {\n\n\t\t// Remove namespace as SimpleXML throws warnings with invalid namespace URI provided by Authorize.net\n\t\t$this->response = preg_replace( '/[[:space:]]xmlns[^=]*=\"[^\"]*\"/i', '', $this->response );\n\n\t\t// LIBXML_NOCDATA ensures that any XML fields wrapped in [CDATA] will be included as text nodes\n\t\t$response = new WC_Authorize_Net_CIM_API_Response( $this->response, LIBXML_NOCDATA );\n\n\t\t// Throw exception for true API errors, 'E00027' is a generic 'Declined' message which is handled by response class\n\t\tif ( $response->has_api_error() && 'E00027' != $response->get_api_error_code() ) {\n\t\t\tthrow new Exception( sprintf( __( 'Error: [%s] - %s', WC_Authorize_Net_CIM::TEXT_DOMAIN ), $response->get_api_error_code(), $response->get_api_error_message() ) );\n\t\t}\n\n\t\treturn $response;\n\t}", "public function call() {\r\n $data = $this->getInputDataAsArray(TRUE);\r\n $response = $this->_service->call($this->_operation, $data);\r\n $this->_output->setData($response);\r\n return $this->getResponseHeader()->successCode == 0;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert total in rupiah.
public function totalInRupiah() { return MoneyHelper::convertToRupiah($this->total); }
[ "public function formattedTotal(): string;", "public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }", "public function formattedNetTotal(): string;", "public function get_total_pengeluaran_umkm()\n {\n $pemasukan = $this->M_pengeluaran->total_pengeluaran_umkm()->get()->row_array();\n\n echo number_format($pemasukan['total'],0,\",\",\".\");\n }", "private function setup_total() {\n\t\t$amount = $this->get_meta( '_give_payment_total', true );\n\n\t\treturn round( floatval( $amount ), give_get_price_decimals( $this->ID ) );\n\t}", "public function update_total() {\n\t\t$this->load->model('pos/pos');\n\t\t$this->language->load('module/pos');\n\t\t$json = $this->recalculate_total($this->request->post);\n\t\t$this->response->setOutput(json_encode($json));\t\n\t}", "function eqs_total(){ //\n\t\t$this->get_eqs_total();\n\t\techo json_encode($this->data);\n\t}", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "function guesttotal($key) {\n\t\t\n\t\t$key = strval(sprintf(\"%06s\",strval($key)));\n\t\t\n\t\t$guestsfile = DIRDATA.\"/user/guest.totals\";\n\t\tif (!file_exists($guestsfile)) {\n\t\t\tif (defined(\"ININTERFACE\")) {\n\t\t\t\t$conn = new Conn();\n\t\t\t\t$conn->command(message::generate_function(\"NORMALIZE\"));\n\t\t\t}\n\t\t}\n\t\t//clearstatcache();\n\n\t\t$guests = parse_ini_file($guestsfile);\n\t\t\n\t\tif (!$guests[strval($key)]) { record::msg_log(\"key error: $key\",\"guest\"); return 0; }\n\t\t\n\t\t$totals = $guests[strval($key)];\n\t\t\n\t\t$ret = intval($totals);\n\t\t/*\n\t\t$totals = explode(\",\",$totals);\n\t\tfor ($i=0;$i<count($totals);$i++) {\n\t\t\t$total = explode(\"-\",$totals[$i]);\n\n\t\t\tif ((trim($total[1])==\"\")&&($i==count($totals)-1)) {\n\t\t\t\t\t$total[1]=time();\n\t\t\t}\n\t\t\t\n\t\t\tif (trim($total[1])!=\"\") {\n\t\t\t\t$tmp = $total[1]-$total[0];\n\t\t\t\t$ret = $ret + $tmp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t*/\n\t\treturn $ret;\n\t}", "public function total()\n\t{\n\t\treturn number_format($this->invoice['total'] / 100, 2);\n\t}", "public function getForwarderTotal(): float;", "function tampilUang($total){\n $totalAkhir = 0;\n $totalNominal = 0;\n foreach($total as $nominal => $jumlah){\n $totalNominal = $nominal * $jumlah;\n echo \"<br>Nominal Rp. $nominal sebanyak $jumlah lembar.\";\n $totalAkhir += $totalNominal;\n }\n echo \"<br>Total uang sekarang adalah <b>Rp. $totalAkhir</b>\";\n }", "public static function rupiah($nominal)\n {\n $rupiah = number_format($nominal, 0, \",\", \".\");\n $rupiah = \"Rp \" . $rupiah . \",00\";\n return $rupiah;\n }", "public function recalculateTotal()\n\t{\t\t\n\t\t$summary = $this->summary();\t\t\n\t\t$this->total = $summary['total'];\n\t}", "public function getHolguraTotal()\n\t\t{\t\t\t\n\t\t\t return $this->tli - $this->tei;\n\t\t}", "public function getTotalForDisplay() {\r\n return Vushop_Utils::formatPrice($this->getTotal());\r\n }", "function collatePageTotalDB()\n\t\t{\n\t\t\t$sql = e107::getDb();\n\n\t\t\t$qry = \"SELECT * FROM `#logstats` WHERE `log_id` REGEXP '^[0-9]' AND LENGTH(log_id) > 7 AND `log_data` LIKE '%http%'\";\n\t\t\t$data = $sql->retrieve($qry,true);\n\n\t\t\t$pageTotal = array();\n\n\t\t\tforeach($data as $values)\n\t\t\t{\n\t\t\t\t$tmp = explode(chr(1),$values['log_data']);\n\t\t\t\tunset($tmp[0],$tmp[1]);\n\t\t\t\t$thisTotal = array();\n\n\t\t\t\tforeach($tmp as $val)\n\t\t\t\t{\n\t\t\t\t\tif(!empty($val))\n\t\t\t\t\t{\n\t\t\t\t\t\tlist($url,$ttl,$unq,$lan) = explode(\"|\",$val);\n\t\t\t\t\t\t$lan = vartrue($lan,e_LAN);\n\t\t\t\t\t\t$key = $this->getPageKey($url,'','', $lan);\n\n\t\t\t\t\t\t$thisTotal[$key]['url'] = $url;\n\t\t\t\t\t\t$thisTotal[$key]['lan'] = $lan;\n\t\t\t\t\t\t$thisTotal[$key]['ttlv'] += $ttl;\n\t\t\t\t\t\t$thisTotal[$key]['unqv'] += $unq;\n\n\t\t\t\t\t\t$pageTotal[$key]['url'] = $url;\n\t\t\t\t\t\t$pageTotal[$key]['lan'] = $lan;\n\t\t\t\t\t\t$pageTotal[$key]['ttlv'] += $ttl;\n\t\t\t\t\t\t$pageTotal[$key]['unqv'] += $unq;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t//\techo \"<h3>\".$values['log_id'].\"</h3>\";\n\t\t\t//\tprint_a($thisTotal);\n\n\t\t\t}\n\n\t\t\tif(empty($pageTotal))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$id = $sql->retrieve('logstats','log_uniqueid', \"log_id='pageTotal'\");\n\n\t\t\t$insertData = array(\n\t\t\t\t'log_uniqueid' => intval($id),\n\t\t\t\t'log_id'=> 'pageTotal',\n\t\t\t\t'log_data'=> serialize($pageTotal)\n\t\t\t);\n\n\t\t\t//\techo \"<h2>Total</h2>\";\n\t\t\t// print_a($pageTotal);\n\n\t\t\treturn $sql->replace('logstats', $insertData);\n\n\t\t}", "private function mapTotalVolumeKomoditi()\n {\n return $this->repository->totalVolumePerSatuan()[strtolower($this->permohonan)];\n }", "public function getBasketTotal();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }