query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Change the timestamp of an order by passing in year, month, day, time | function updateTimestamp($year, $month, $day, $time = NULL)
{
if(empty($this->id))
return false; //need a saved order
if(empty($time))
$time = "00:00:00";
$date = $year . "-" . $month . "-" . $day . " " . $time;
global $wpdb;
$this->sqlQuery = "UPDATE $wpdb->pmpro_membership_orders SET timestamp = '" . $date . "' WHERE id = '" . $this->id . "' LIMIT 1";
if($wpdb->query($this->sqlQuery) !== "false")
return $this->getMemberOrderByID($this->id);
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function move_to_start_of_day()\n {\n $hour=0;\n $minute=0;\n $second=0;\n $day=$this->get_day();\n $month=$this->get_month();\n $year=$this->get_year();\n $newtimestamp=mktime( $hour, $minute, $second, $day, $month, $year);\n }",
"protected function getOrderFields() {\n return 'PostTime';\n }",
"private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }",
"function set_date_to_now()\n {\n $this->timestamp=time();\n }",
"protected function _syncModDate() {}",
"public function timestamp()\n {\n $this->replaceTextNode('/p:package/p:date', date('Y-m-d'));\n $this->replaceTextNode('/p:package/p:time', date('H:i:s'));\n\n $release = $this->_requireCurrentRelease();\n\n $this->replaceTextNodeRelativeTo('./p:date', $release, date('Y-m-d'));\n }",
"private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}",
"public function testSetTime() {\n $time = new \\DateTime();\n $this->order->setTime($time);\n $this->assertEquals($time, $this->order->getTime());\n }",
"public function setOrderDateAttribute($orderDate) {\n $this->attributes['order_date'] = Carbon::parse($orderDate)->toDateString(); //'toDateTimeString(); use to dd:mm:yyyy:hh:mm:ss\n }",
"function dateToCal($timestamp) {\nreturn date('Ymd\\THis', $timestamp);\n}",
"private function _mktime(){\n\t\t$this->_timestamp = self::mktime($this->_month, $this->_day, $this->_year);\n\t}",
"function custom_unixtimesamp ( $post_id ) {\r\n if ( get_post_type( $post_id ) == 'event_type' ) {\r\n\t$event_date = get_post_meta($post_id, 'event_date', true);\r\n\r\n\t\tif($event_date) {\r\n\t\t\t$dateparts = explode('/', $event_date);\r\n\t\t\t$newdate1 = strtotime(date('d.m.Y H:i:s', strtotime($dateparts[1].'/'.$dateparts[0].'/'.$dateparts[2])));\r\n\t\t\tupdate_post_meta($post_id, 'unixstartdate', $newdate1 );\r\n\t\t}\r\n\t}\r\n}",
"abstract protected function _buildOrderBy( $order );",
"public function refreshTimestamp();",
"function setOrder($order);",
"function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)\n {\n }",
"function date_modif_manuelle_autoriser() {\n}",
"private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"function modifyDate($mode, $date, $amount);",
"function set_time($newhour, $newminute, $newday, $newmonth, $newyear)\n {\n //sets the Date object given the hour, minute, day, month, and year\n $newtimestamp=mktime( $newhour, $newminute, 0, $newmonth, $newday, $newyear);\n $this->timestamp=$newtimestamp;\n }",
"static function default_sort_key(): string { return 'date_till'; }",
"function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}",
"public function setTimestamp($timestamp);",
"private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}",
"public function testUpdateOrder()\n {\n }",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"public function format_timestamp($time)\n {\n }",
"public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }",
"public function timestamp();",
"function convert_all_timestamps()\n\t{\n\t\t$check_already_included = !empty($this->timestamps);\n\t\tforeach($this->table_def['fd'] as $name => $data)\n\t\t{\n\t\t\tif ($data['type'] == 'timestamp' && (!$check_already_included || !in_array($name,$this->timestamps)))\n\t\t\t{\n\t\t\t\t$this->timestamps[] = $name;\n\t\t\t}\n\t\t}\n\t}"
]
| [
"0.5484895",
"0.5383799",
"0.53715086",
"0.5308254",
"0.52889013",
"0.5257454",
"0.5166426",
"0.51152647",
"0.5105451",
"0.50734",
"0.50658846",
"0.5045822",
"0.50283694",
"0.5020341",
"0.50188255",
"0.5002801",
"0.49783668",
"0.4973506",
"0.49686325",
"0.49561173",
"0.4939371",
"0.4933226",
"0.48772627",
"0.48720917",
"0.48645645",
"0.4862811",
"0.48602864",
"0.48584235",
"0.4836191",
"0.48251945"
]
| 0.6541331 | 0 |
Get a random code to use as the order code. | function getRandomCode()
{
global $wpdb;
while(empty($code))
{
$scramble = md5(AUTH_KEY . current_time('timestamp') . SECURE_AUTH_KEY);
$code = substr($scramble, 0, 10);
$code = apply_filters("pmpro_random_code", $code, $this); //filter
$check = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE code = '$code' LIMIT 1");
if($check || is_numeric($code))
$code = NULL;
}
return strtoupper($code);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomCode() {\n $code = md5($this->getid_recipient() . $this->getid_offer() . $this->getexpirationdate());\n return $code;\n }",
"public function get_random_coupon_code() {\n\t\t$rand_name = uniqid( rand( 10, 1000 ), false );\n\t\treturn substr( $rand_name, 0, rand( 5, 10 ) );\n\t}",
"protected function generateCode(): string {\n return (string)rand(100000, 999999);\n }",
"public static function generateCode()\n {\n return Str::random(10);\n }",
"private function genCode()\r\n\t{\r\n\t\t$digits = 10;\r\n\t\treturn rand(pow(10, $digits-1), pow(10, $digits)-1);\r\n\t}",
"private function generate_code()\n\t\t{\n\t\t\t$code = \"\";\n\t\t\tfor ($i = 0; $i < 5; ++$i) \n\t\t\t{\n\t\t\t\tif (mt_rand() % 2 == 0) \n\t\t\t\t{\n\t\t\t\t\t$code .= mt_rand(0,9);\n\t\t\t\t} else \n\t\t\t\t{\n\t\t\t\t\t$code .= chr(mt_rand(65, 90));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn $code; \n\n\t\t}",
"public function generateRandomCouponCode()\n {\n $length = 12;\n $code = '';\n $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ0123456789';\n $maxlength = strlen($chars);\n if ($length > $maxlength) {\n $length = $maxlength;\n }\n\n $i = 0;\n while ($i < $length) {\n $char = substr($chars, mt_rand(0, $maxlength - 1), 1);\n if (!strstr($code, $char)) {\n $code .= $char;\n $i++;\n }\n }\n\n $code = strtoupper($code);\n return $code;\n }",
"public function generate_code()\n {\n return $string = bin2hex(random_bytes(10));\n }",
"private static function generateUniqueCode()\n {\n do {\n $code = str_random(7);\n } while (static::checkCode($code));\n\n return $code;\n }",
"public static function generateCode() {\n $long_code = strtr(md5(uniqid(rand())), '0123456789abcdefghij', '234679QWERTYUPADFGHX');\n return substr($long_code, 0, 12);\n }",
"private function generate_code(){\n $bytes = random_bytes(2);\n // var_dump(bin2hex($bytes));\n return bin2hex($bytes);\n }",
"public\tfunction sp_build_order_no()\n\t{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $uuid = strtoupper(md5(uniqid(rand(), true)));\n // $uuid = substr($charid, 0, 8)\n // .substr($charid, 8, 4)\n // .substr($charid,12, 4)\n // .substr($charid,16, 4)\n // .substr($charid,20,12);\n return $uuid;\n\t}",
"function generateRandomNumber() {\n return chr(mt_rand(48, 57));\n }",
"public function createVerificationCode()\n {\n return $code = random_int(config('twilio-verify.random_int.initial_value'), config('twilio-verify.random_int.final_value'));\n }",
"function generateRandomSymbol() {\n $r = mt_rand(0, 3);\n switch($r) {\n case 0: $i = mt_rand(33, 47); break;\n case 1: $i = mt_rand(58, 64); break;\n case 2: $i = mt_rand(91, 96); break;\n case 3: $i = mt_rand(123, 126); break;\n }\n return chr($i);\n }",
"function generate_otp_code(){\n return rand(1000,9999);\n}",
"public function crateSmsCode(){\n // generate a pin based on 2 * 7 digits + a random character\n $pin = mt_rand(100, 999)\n . mt_rand(100, 999);\n // shuffle the result\n $string = str_shuffle($pin);\n return $string;\n }",
"public function genOrderCode($cart_cd){\n\t\t$cart_cd \t= str_pad($cart_cd, 5, \"0\", STR_PAD_LEFT);\n\t\t$time \t\t= md5(time());\n\t\t$order_cd \t= substr($time, rand(0, 22), 6);\n\t\t$order_cd\t= $order_cd . $cart_cd;\n\t\t$_SESSION['OrderCode'] = $order_cd;\n\t\tsetcookie(\"OrderCode\", $order_cd, time() + 60 * 60 * 24 * 30);\n\t\treturn $order_cd;\n\t}",
"function _generate_code_string() {\n\n $str = strval(microtime());\n return substr(md5($str),rand(0, 15) , 10);\n}",
"public function orderRandom();",
"public static function gen_order_str()\n {\n\n $str = session_id();\n $str .= (string)time();\n $checksum = crc32($str);\n $date = date('Y-m-d');\n $order_number = $date . $checksum;\n\n return substr($order_number, 0, 19);\n }",
"private function getRandomCartNumber()\n\t{\n\t\t$number = md5(uniqid(mt_rand(), true));\n\n\t\t$order = craft()->commerce_orders->getOrderByNumber($number);\n\t\t// Make sure not duplicate number\n\t\tif ($order)\n\t\t{\n\t\t\treturn $this->getRandomCartNumber();\n\t\t}\n\n\t\treturn $number;\n\t}",
"public function generateCodigo()\n {\n $this->codigo = random_int(1000000,9999999);\n }",
"public function make_activation_code(){\n\t\t$alphanum = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\t\t return substr(str_shuffle($alphanum), 0, 7);\n\t}",
"public function generateActivationCode() : int\n {\n return mt_rand(100000, 999999);\n }",
"function generate_mobile_code()\n{\n $chars = \"0123456789\";\n srand((double)microtime()*1000000);\n $code = \"\";\n for ($i = 0; $i < 6; $i++)\n {\n $num = rand() % 10;\n $tmp = substr($chars, $num, 1);\n $code = $code . $tmp;\n }\n return $code;\n}",
"function customcert_generate_code() {\n global $DB;\n\n $uniquecodefound = false;\n $code = random_string(10);\n while (!$uniquecodefound) {\n if (!$DB->record_exists('customcert_issues', array('code' => $code))) {\n $uniquecodefound = true;\n } else {\n $code = random_string(10);\n }\n }\n\n return $code;\n}",
"public function getVerCode(){\n \n $rand = $this->generateRandomString(6);\n return $rand;\n }",
"function generateCode($code='') {\n\t\t\n\t\tif(empty($code)) {\n\t\t\t$code = $this->randomString();\n\t\t}\n\t\t\n\t\twhile(true) {\t\n\t\t\t\n\t\t\t$shortUrl = $this->findByCode($code);\n\t\t\tif(empty($shortUrl)) break;\n\t\t\t$code = $this->randomString();\n\t\t}\n\t\t\n\t\treturn $code;\n\t}",
"public function generateOTPCode()\n {\n return generate_otp_code();\n }"
]
| [
"0.7452733",
"0.72495455",
"0.72280747",
"0.7134761",
"0.70665157",
"0.6968279",
"0.69414",
"0.690896",
"0.6758713",
"0.67116964",
"0.6700356",
"0.66881895",
"0.66527075",
"0.6575303",
"0.65681154",
"0.6543719",
"0.65306723",
"0.6497861",
"0.64967483",
"0.6460922",
"0.6458205",
"0.6444786",
"0.6421892",
"0.6395011",
"0.6382728",
"0.6378046",
"0.63698214",
"0.6362256",
"0.6345105",
"0.63125944"
]
| 0.78642285 | 0 |
For offsite gateways with a confirm step. | function confirm()
{
if (is_object($this->Gateway)) {
return $this->Gateway->confirm($this);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }",
"public function confirm() {\n\t\t\t\n\t\t\t$this->status = 'confirmed';\n\t\t\t$this->save();\n\t\t}",
"public function confirm()\n {\n $this->confirmed = true;\n $this->confirmation_token = null;\n\n $this->save();\n }",
"public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }",
"function confirm()\n {\n return $this->__confirm();\n }",
"function ctr_validateConfirmation(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n if ($reservation->persons AND $reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Please, do not play with the URL.\\n\";\n\n return false;\n}",
"public function callback_confirm(){\r\n\r\n $this->log('Entering the confirm callback', 'info');\r\n\r\n try{\r\n\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n \r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n $this->log('Flow response: '.json_encode($result));\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $order = $this->getOrder($order_id);\r\n $status = $result['status'];\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n\r\n /*if($this->isTesting($result)){\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n\r\n if($this->isPendingInFlow($status)){\r\n $this->setOrderAsPending($order);\r\n }\r\n elseif($this->isPaidInFlow($status)){\r\n $this->payOrder($order);\r\n }\r\n elseif($this->isCancelledInFlow($status)){\r\n $this->cancelOrder($order);\r\n }\r\n else{\r\n $this->rejectOrder($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n error_log($e->getMessage());\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n }\r\n }",
"public function confirmOrder()\n {\n $order = Order::query()->findOrFail(request()->input('order'));\n\n if ($order->orderStatus->slug !== OrderStatus::PROCESSED) {\n return redirect()->back();\n }\n\n $order->delivery_tracking = request()->input('delivery_tracking');\n\n $order->setStatusSent();\n\n $order->save();\n\n $order->user->notify(new OrderSent($order));\n\n return redirect(backpack_url('order?status=2')) //http://lucilevilaine.local/admin/order?status=2\n ->with('success', 'La commande a bien été confirmé');\n }",
"private function ConfirmOrder()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// The current quote cannot be finalized - don't let it proceed\n\t\tif(!$this->getQuote()->canBeFinalized()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// ensure that the applied coupon still valid\n\t\ttry {\n\t\t\t$this->getQuote()->reapplyCoupons(true);\n\t\t}\n\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t}\n\n\t\t$GLOBALS['EnterCouponCode'] = isc_html_escape(GetLang('EnterCouponCode'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . \" - \" . GetLang('ConfirmYourOrder'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"checkout_confirm\");\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}",
"public function confirmAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n if ($orderData = $this->getRequest()->getPost('order')) {\n $customerComment = (isset($orderData['customer_comment']) ? $orderData['customer_comment'] : '');\n $this->getOnepage()->getQuote()->setCustomerComment($customerComment);\n }\n\n $this->loadLayout();\n $this->renderLayout();\n }",
"public function actionConfirm(){\n if($this->confirm('Yakin loe..??'))\n echo \"Ok deh kaka..\";\n else\n echo \"Ga yakin diee..:p\";\n }",
"function __confirm()\n {\n $postdata = 'Comando=validar&Token=' . $this->token;\n foreach($_POST as $key => $value) {\n $val = $this->__clearstr($value);\n $postdata.= \"&$key=$val\";\n }\n return $this->__getConfirmation($postdata);\n }",
"public function confirm()\n {\n $task = $this->getTask();\n $link = $this->getExternalTaskLink($task);\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }",
"public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }",
"public function testConfirmWithoutCodeFail() {\n //avoid creating discounts with same referer and let the discount action be set before we test it\n sleep(1);\n\n // create new discount of type 2\n $discount = $this->createNewCustomerDiscount(array('type' => 2));\n\n $this->dispatch('/discount/confirm/referer/' . $referer);\n $this->assertController('discount');\n $this->assertAction('confirm');\n\n //test redirection, so no action shall be done on the discount page\n $this->assertResponseCode(302);\n }",
"function confirm($message = 'Are you sure?')\n{\n\t$CI\t=& get_instance();\n $CI->output->set_header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n $CI->output->set_header(\"Cache-Control: post-check=0, pre-check=0\", FALSE);\n $CI->output->set_header(\"Pragma: no-cache\");\n\t$segments = $CI->uri->segment_array();\n\t\n\tif( end($segments) != 'yes')\n\t{\n\t\t$referrer = $CI->input->server('HTTP_REFERER');\n\t\tif (empty($referrer))\n\t\t{\n\t\t\t// No user agent referrer, use the controller index\n\t\t\t$RTR =& load_class('Router');\n\t\t\t$referrer = $RTR->fetch_directory().$RTR->fetch_class();\n\t\t}\n\n\t\t$data['no_href']\t= $referrer;\n\t\t$data['yes_href']\t= implode('/', $segments).'/yes';\n\t\t$data['message']\t= $message;\n\t\t\t\t\n\t\techo $CI->template->display('content/confirmation', $data, 'general', TRUE);\n\t\texit;\n\t}\n}",
"public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }",
"function set_confirmacion($confirm)\n\t{\n\t\t$this->confirmacion = $confirm;\n\t}",
"function confirmation(){\n\t\tglobal $wpdb;\n\n\t\t$form_id = ( isset( $_REQUEST['form_id'] ) ) ? (int) esc_html( $_REQUEST['form_id'] ) : '';\n\n\t\tif ( !isset( $_REQUEST['vfb-submit'] ) )\n\t\t\treturn;\n\n\t\tdo_action( 'vfb_confirmation', $form_id, $this->new_entry_id );\n\n\t\t// Allow custom query arguments to be appended to redirects\n\t\t$query_args = apply_filters( 'vfb_redirect_query_args', '', $form_id, $this->new_entry_id );\n\n\t\t// Get forms\n\t\t$order = sanitize_sql_orderby( 'form_id DESC' );\n\t\t$forms \t= $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order\", $form_id ) );\n\n\t\tforeach ( $forms as $form ) :\n\n\t\t\t// If user wants this to redirect to PayPal\n\t\t\tif ( $form->form_paypal_setting ) {\n\n\t\t\t\t$paypal_data = array(\n\t\t\t\t\t'paypal_field'\t=> $form->form_paypal_field_price,\n\t\t\t\t\t'item_name'\t\t=> $form->form_paypal_item_name,\n\t\t\t\t\t'currency_code'\t=> $form->form_paypal_currency,\n\t\t\t\t\t'tax_rate'\t\t=> $form->form_paypal_tax,\n\t\t\t\t\t'shipping'\t\t=> $form->form_paypal_shipping,\n\t\t\t\t\t'business'\t\t=> $form->form_paypal_email,\n\t\t\t\t);\n\n\t\t\t\t$this->paypal_redirect( $paypal_data, $form_id );\n\t\t\t}\n\n\t\t\t// Allow templating within confirmation message\n\t\t\t$form->form_success_message = $this->templating( $form->form_success_message );\n\n\t\t\t// Apply a filter for the success message\n\t\t\t$form->form_success_message = apply_filters( 'vfb_form_success_message', $form->form_success_message, $form_id, $form->form_success_type );\n\n\t\t\t// If text, return output and format the HTML for display\n\t\t\tif ( 'text' == $form->form_success_type ) :\n\t\t\t\treturn stripslashes( html_entity_decode( wp_kses_stripslashes( $form->form_success_message ) ) );\n\t\t\t// If page, redirect to the permalink\n\t\t\telseif ( 'page' == $form->form_success_type ) :\n\t\t\t\t$page = get_permalink( $form->form_success_message );\n\t\t\t\twp_redirect( esc_url_raw( $page . $query_args ) );\n\t\t\t\texit();\n\t\t\t// If redirect, redirect to the URL\n\t\t\telseif ( 'redirect' == $form->form_success_type ) :\n\t\t\t\twp_redirect( esc_url_raw( $form->form_success_message . $query_args ) );\n\t\t\t\texit();\n\t\t\t// Display Entry with Text message prepended\n\t\t\telseif ( 'display-entry' == $form->form_success_type ) :\n\t\t\t\t// At least output the Text message\n\t\t\t\t$output = stripslashes( html_entity_decode( wp_kses_stripslashes( $form->form_success_message ) ) );\n\n\t\t\t\t// Only add entry to output if Display Entries is active\n\t\t\t\tif ( class_exists( 'VFB_Pro_Display_Entries' ) ) {\n\t\t\t\t\t$output .= vfb_display_entries( array(\n\t\t\t\t\t\t'entry_id' \t=> $this->new_entry_id,\n\t\t\t\t\t\t'echo'\t\t=> 0\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\treturn $output;\n\t\t\tendif;\n\n\t\tendforeach;\n\t}",
"function confirmation() {\r\n return false;\r\n }",
"function confirm_order($order, $comments, $ecpay_feedback) {\r\n\t\t$order->add_order_note($comments, true);\r\n\t\t\r\n\t\t$order->payment_complete();\r\n\r\n\t\t// call invoice model\r\n\t\t$invoice_active_ecpay \t= 0 ;\r\n\t\t$invoice_active_allpay \t= 0 ;\r\n\r\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\r\n\r\n\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\r\n\r\n\t\tforeach($active_plugins as $key => $value)\r\n\t\t{\r\n\t\t\tif ( (strpos($value,'/woocommerce-ecpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_ecpay = 1;\r\n\t }\r\n\r\n\t if ( (strpos($value,'/woocommerce-allpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_allpay = 1;\r\n\t }\t\t\t\r\n\t\t}\r\n\r\n\t\tif($invoice_active_ecpay == 0 && $invoice_active_allpay == 1)\t\t// allpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/allpay_invoice/woocommerce-allpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_allpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_allpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_allpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('allpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($invoice_active_ecpay == 1 && $invoice_active_allpay == 0)\t//ecpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/ecpay_invoice/woocommerce-ecpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_ecpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_ecpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_ecpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('ecpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static function location_confirmation() {\n\t\tif ( 'yes' === get_option( 'woocommerce_eu_vat_number_validate_ip', 'no' ) && self::cart_has_digital_goods() ) {\n\t\t\tif ( false === self::$data['vat_number'] && self::is_self_declaration_required() ) {\n\t\t\t\twc_get_template( 'location-confirmation-field.php', array(\n\t\t\t\t\t'location_confirmation_is_checked' => isset( $_POST['location_confirmation'] ),\n\t\t\t\t\t'countries' => WC()->countries->get_countries(),\n\t\t\t\t), 'woocommerce-eu-vat-number', untrailingslashit( plugin_dir_path( WC_EU_VAT_FILE ) ) . '/templates/' );\n\t\t\t}\n\t\t}\n\t}",
"public function subscription_confirm()\n {\n $model = & $this->getModel('jms');\n $model->subscriptionConfirm();\n\n\n // $this->setRedirect('index.php?option=com_jms&task=jms.subscription_confirm&payment_method=iwl_paypal');\n }",
"static function confirm_account() {\n \n # hash GET param exists\n if ($hash = data('hash')) {\n \n $hash = confirm_account($hash);\n\n if ($hash === -3)\n flash('Algo ocorreu errado. Tente novamente mais tarde..', 'error');\n else if ($hash === true)\n flash('Conta Confirmada! Agora você já pode se conectar.');\n }\n\n go('/');\n }",
"public function confirmAction()\r\n {\r\n if (empty($this->View()->sUserLoggedIn)) {\r\n return $this->forward('login', 'account', null, array('sTarget'=>'sKUZOOffer', 'sTargetAction'=>'confirm'));\r\n } elseif ($this->basket->sCountBasket() < 1) {\r\n return $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'checkout',\r\n 'action' => 'cart'\r\n ));\r\n }\r\n\r\n $this->View()->sCountry = $this->getSelectedCountry();\r\n $this->View()->sState = $this->getSelectedState();\r\n $this->View()->sPayment = $this->getSelectedPayment();\r\n $this->View()->sUserData[\"payment\"] = $this->View()->sPayment;\r\n\r\n $this->View()->sDispatch = $this->getSelectedDispatch();\r\n $this->View()->sPayments = $this->getPayments();\r\n $this->View()->sDispatches = $this->getDispatches();\r\n\r\n $this->View()->sBasket = $this->getBasket();\r\n\r\n $this->View()->sLaststock = $this->basket->sCheckBasketQuantities();\r\n $this->View()->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $this->View()->sShippingcostsDifference = $this->View()->sBasket['sShippingcostsDifference'];\r\n $this->View()->sAmount = $this->View()->sBasket['sAmount'];\r\n $this->View()->sAmountWithTax = $this->View()->sBasket['sAmountWithTax'];\r\n $this->View()->sAmountTax = $this->View()->sBasket['sAmountTax'];\r\n $this->View()->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n\r\n $this->View()->sPremiums = $this->getPremiums();\r\n\r\n $this->View()->sNewsletter = isset($this->session['sNewsletter']) ? $this->session['sNewsletter'] : null;\r\n $this->View()->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : null;\r\n\r\n $this->View()->sShowEsdNote = $this->getEsdNote();\r\n\r\n $this->View()->sDispatchNoOrder = $this->getDispatchNoOrder();\r\n if(!$this->View()->sDispatch)\r\n {\r\n $this->View()->sDispatchNoOrder = true;\r\n }\r\n $this->View()->sRegisterFinished = !empty($this->session['sRegisterFinished']);\r\n\r\n $this->saveTemporaryOrder();\r\n\r\n if ($this->getMinimumCharge()) {\r\n return $this->forward('cart');\r\n }\r\n\r\n if($this->View()->sBasket['sAmount'] < Shopware()->Config()->inquiryvalue)\r\n {\r\n return $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'checkout',\r\n 'action' => 'cart',\r\n 'amountError' => true\r\n ));\r\n }\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")) {\r\n $activeBillingAddressId = $this->session->offsetGet('checkoutBillingAddressId', null);\r\n if(empty($activeBillingAddressId)) {\r\n $activeBillingAddressId = $this->View()->sUserData['additional']['user']['default_billing_address_id'];\r\n }\r\n\r\n $activeShippingAddressId = $this->session->offsetGet('checkoutShippingAddressId', null);\r\n if(empty($activeShippingAddressId)) {\r\n $activeShippingAddressId = $this->View()->sUserData['additional']['user']['default_shipping_address_id'];\r\n }\r\n\r\n $this->View()->assign('activeBillingAddressId', $activeBillingAddressId);\r\n $this->View()->assign('activeShippingAddressId', $activeShippingAddressId);\r\n\r\n $this->View()->assign('invalidBillingAddress', !$this->isValidAddress($activeBillingAddressId));\r\n $this->View()->assign('invalidShippingAddress', !$this->isValidAddress($activeShippingAddressId));\r\n\r\n $billingAddress = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$activeBillingAddressId);\r\n $this->get('shopware_account.address_service')->setDefaultBillingAddress($billingAddress);\r\n $shippingAddress = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$activeShippingAddressId);\r\n $this->get('shopware_account.address_service')->setDefaultShippingAddress($shippingAddress);\r\n\r\n $userData = $this->View()->sUserData;\r\n $userAddressData = Shopware()->Modules()->Admin()->sGetUserData();\r\n $userData['billingaddress'] = $userAddressData['billingaddress'];\r\n $userData['shippingaddress'] = $userAddressData['shippingaddress'];\r\n $this->View()->sUserData = $userData;\r\n }\r\n\r\n $this->session['sOrderVariables'] = new ArrayObject($this->View()->getAssign(), ArrayObject::ARRAY_AS_PROPS);\r\n $this->View()->sKUZOOffer = true;\r\n $this->View()->sTargetAction = 'confirm';\r\n }",
"public function confirm()\n {\n\n\n $this->load->model('checkout/order');\n\n if (!isset($this->session->data['order_id'])) {\n $this->response->redirect($this->url->link('checkout/cart'));\n return;\n }\n $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n if (false === $order_info) {\n $this->response->redirect($this->url->link('checkout/cart'));\n return;\n }\n\n $orderID = $this->session->data['order_id'];\n $order_total = $order_info['total'];\n $order_total = round($order_total, 2);\n $currency_code = $order_info['currency_code'];\n $redirect_url = $this->config->get($this->code.'_redirect_url');\n\n $AccountID = $this->config->get($this->code.'_payment_api_accountID');\n $AccountPrivateKey = $this->config->get($this->code.'_payment_api_privateKey');\n if (isset($this->session->data['meth'])) {\n $data['meth'] = $this->session->data['meth'];\n }\n $payinput = \"knet\";\n if(!empty($data['meth'])){\n \t$payinput = $data['meth'];\n }else{\n \t$payinput = 'knet';\n }\n \n\n $this->redirect_post($AccountID,$AccountPrivateKey,$redirect_url,$order_total,$payinput);\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function confirm()\n {\n //transaction id\n $fee = $this->wsRequest->getParam('fee', 0);\n $amount = $this->wsRequest->requireNumericAndPositive('amount');\n $transactionId = $this->wsRequest->requireNumericAndPositive('transaction_id');\n $controlNumber = $this->wsRequest->requireNumericAndPositive('control_number');\n\n $account = Session::getAccount();\n $transaction = Session::getTransaction();\n $transaction->restore($transactionId);\n if(!$transaction->getTransactionId()){\n throw new TransactionException(\"This transaction not exist or not can be loaded: \" . $transactionId);\n }else{\n $this->wsRequest->putParam('type', $transaction->getAgencyTypeId());\n }\n\n if($transaction->getTransactionStatusId() != Transaction::STATUS_REQUESTED && $transaction->getTransactionStatusId() != Transaction::STATUS_REJECTED){\n if($transaction->getTransactionStatusId() == Transaction::STATUS_CANCELED && $transaction->getProviderId() != Dinero::PROVIDER_ID){\n throw new TransactionException(\"Transaction has expired. Valid time is 48 hours to confirm.\");\n }elseif($transaction->getTransactionStatusId() == Transaction::STATUS_EXPIRED){\n throw new TransactionException(\"Transaction abandoned after 48 hours without re-submit.\");\n }else{\n throw new TransactionException(\"Transaction cannot be confirmed since the current status is: \" . $transaction->getTransactionStatus());\n }\n }\n\n //validate customer\n $customerRequest = new Customer();\n $customerRequest->restoreFromRequest($this->wsRequest);\n $newCustomerName = strtoupper($customerRequest->getCustomer());\n $customerTransaction = Session::getCustomer($transaction->getCustomerId());\n $originalCustomerName = strtoupper($customerTransaction->getCustomer());\n $percent = Util::similarPercent($newCustomerName, $originalCustomerName);\n if($newCustomerName != $originalCustomerName && $percent >= CoreConfig::CUSTOMER_SIMILAR_PERCENT_UPDATE){\n $customerTransaction->setFirstName($customerRequest->getFirstName());\n $customerTransaction->setLastName($customerRequest->getLastName());\n $customerUpdated = $customerTransaction->update();\n $username = $transaction->getUsername();\n if($customerUpdated){\n Log::custom('UpdateCustomer', \"Customer updated | Username: $username Original: $originalCustomerName New: $newCustomerName Percent: $percent%\");\n }else{\n Log::custom('UpdateCustomer', \"Customer not updated | Username: $username Original: $originalCustomerName New: $newCustomerName Percent: $percent%\");\n }\n }\n\n $transaction->setFee($fee);\n $transaction->setAmount($amount);\n $transaction->setControlNumber($controlNumber);\n $transaction->setModifiedBy($account->getAccountId());\n\n $provider = $transaction->getProvider();\n $confirm = $provider->confirm();\n if(!$confirm){\n throw new TransactionException(\"Transaction cannot be confirmed. Please try again in a few minutes!\");\n }\n\n //update transaction after the validation of the data\n $transaction->setTransactionStatusId(Transaction::STATUS_SUBMITTED);\n $transaction->setNote('');\n $transaction->setReason('');\n $transaction->update();\n\n $wsResponse = new WSResponseOk();\n $wsResponse->addElement('transaction', $transaction);\n\n return $wsResponse;\n }",
"function pre_confirmation_check() {\r\n return false;\r\n }",
"public function confirm() {\n if($this->request->server['REQUEST_METHOD'] == 'POST')\n {\n $order_id = $this->request->post['order_id'];\n\t\t\t\t\n\t\t\t\t$this->load->language('payment/paynow');\n\n $this->load->model('payment/paynow');\n $paynowInfo = $this->model_payment_paynow->getPaynowInfo($order_id);\n\n if($paynowInfo)\n {\n \t\n\t\t\t\t\t//close connection\n $msg = $this->request->post;\n\n $MerchantKey = $this->config->get('paynow_config_merchant_key');\n $validateHash = $this->CreateHash($msg, $MerchantKey);\n if($validateHash != $msg[\"hash\"]){\n $data['text_message'] = \"Paynow reply hashes do not match : \" . $validateHash . \" - \" . $msg[\"hash\"];\n }\n else\n {\n $this->model_payment_paynow->update($order_id\n , $paynowInfo['resulturl']\n , $msg[\"pollurl\"]\n , $msg[\"paynowreference\"]\n , $msg[\"amount\"]\n , $msg[\"status\"]\n );\n $this->load->model('checkout/order');\n\n if (trim(strtolower($msg[\"status\"])) == $this->language->get('ps_created_but_not_paid')){\n //$data['text_message'] = \"Transaction has not yet been paid on Paynow.<br /><br />\"\n // . \"<a class='s_button_1 s_main_color_bgr' href='\" . $paynowInfo['process_url'] . \"'><span class='s_text'>Return to Paynow</span></a>\";\n }\n else if (trim(strtolower($msg[\"status\"])) == $this->language->get('ps_cancelled')){\n //$data['text_message'] = \"Transaction was cancelled by the user. You will be redirected back to the checkout page.<br /><br />\";\n //$data['redirect_url'] = str_replace('&', '&', $this->url->link('checkout/checkout'));\n $order = $this->model_checkout_order->getOrder($order_id);\n if($order[\"order_status_id\"] != 7){\n $this->model_checkout_order->confirm($order_id, 7, \"Cancelled by user.\", true);\n }\n }\n else if (trim(strtolower($msg[\"status\"])) == $this->language->get('ps_failed')){\n //$data['text_message'] = \"Transaction payment has failed on Paynow. You can still resume the payment.<br /><br />\"\n // . \"<a class='s_button_1 s_main_color_bgr' href='\" . $paynowInfo['process_url'] . \"'><span class='s_text'>Return to Paynow</span></a>\";\n }\n else if (trim(strtolower($msg[\"status\"])) == $this->language->get('ps_paid') || trim(strtolower($msg[\"status\"])) == $this->language->get('ps_awaiting_delivery') || trim(strtolower($msg[\"status\"])) == $this->language->get('ps_delivered')){\n //$data['text_message'] = \"Transaction Paid Successfully. You will be redirected to a confirmation page.<br /><br />\";\n //$data['redirect_url'] = str_replace('&', '&', $this->url->link('checkout/success'));\n $order = $this->model_checkout_order->getOrder($order_id);\n\t\t\t\t\t\t\t$this->setClassData();\n\n if($order[\"order_status_id\"] != $this->final_order_status){\n $this->model_checkout_order->confirm($order_id, $this->final_order_status, \"Paynow ID: \" . $msg[\"PaynowReference\"], true);\n }\n }\n else {\n //$data['text_message'] = \"Invalid status in from Paynow, cannot continue.\";\n }\n }\n }\n else\n {\n //$data['text_message'] = \"Could not update order info from Paynow.\";\n }\n }\n else\n {\n //$data['text_message'] = \"paynow order info not found.\";\n }\n\t}"
]
| [
"0.67044175",
"0.6589432",
"0.64864486",
"0.6432199",
"0.6279789",
"0.6277888",
"0.62760097",
"0.62334263",
"0.62093484",
"0.62034714",
"0.61815774",
"0.61195904",
"0.6115351",
"0.6089262",
"0.6083957",
"0.607394",
"0.60568315",
"0.604939",
"0.60294",
"0.6029177",
"0.6000323",
"0.5998992",
"0.5996695",
"0.59777635",
"0.59749335",
"0.5965101",
"0.59640026",
"0.5946358",
"0.5937228",
"0.5923708"
]
| 0.6844857 | 0 |
Call the getSubscriptionStatus method of the gateway class. | function getGatewaySubscriptionStatus()
{
if (is_object($this->Gateway)) {
return $this->Gateway->getSubscriptionStatus( $this );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSubscriptionStatus() {\n return $this->subscription_status;\n\n }",
"public function status_subscription(){\n\t\t\treturn true;\n\t\t}",
"function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }",
"public function getSubscriptionStatus(): string\n {\n return $this->subscriptionStatus;\n }",
"public function subscriptions() {\n\n // Monta a query\n $q = $this->db->query( \" SELECT COUNT(*) as total FROM customer_gateway\n WHERE gateway_id = \".$this->id );\n \n // Verifica se existem resultados\n if ( $q->num_rows() > 0 ) {\n return $q->result()[0]->total;\n } else return 0;\n }",
"public function getSubscriptionStatus(SubscriptionRequestEntity $requestEntity);",
"protected function statusAggregator($subscription) {\n \ttry {\n\t $iUserDataId = $subscription->sdkSubscriptionId;\n\t $return = $this->bundle->status($iUserDataId);\n \t}\n catch (Exception $e){\n \t$return[\"status\"] = 'error';\n }\n return $return;\n }",
"private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }",
"public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }",
"public function subscriptionStatus($subscription_id)\n {\n $active = $this->fetchSubscriptionDetails($subscription_id);\n return $active->status;\n }",
"function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"public function callGetServiceStatus() {\n\t\t$requestArray = $this->signArray();\n\t\treturn $this->getServiceStatus($requestArray);\n\t}",
"function subscribe() {\n\t\t\t\t\t\t //**Store the status to a global variable - debug purposes\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . \"SUB-OK|\";\n\t\t\t\t}",
"public function gatewaySubscription()\n {\n if (!$this->everSubscribed()) {\n return null;\n }\n \n if ($customer = $this->customer()) {\n $customer = $customer->gatewayCustomer();\n }\n \n return Billing::subscription($this->billing_subscription, $customer);\n }",
"function comment_subscription_status() {\n\tglobal $comment;\n\treturn !!_stc()->is_subscribed( $comment->comment_ID );\n}",
"public function get_subscription_status( $subscription ) {\n\t\treturn is_array( $subscription ) && isset( $subscription['status'] ) ? $subscription['status'] : '';\n\t}",
"public function getSubscription()\n {\n return $this->subscription;\n }",
"public function getSubscriptions();",
"function it_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, $status ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id_by_subscriber_id( $subscriber_id );\n\tforeach( $transactions as $transaction ) { //really only one\n\t\t// If the subscription has been cancelled/suspended and fully refunded, they need to be deactivated\n\t\tif ( !in_array( $status, array( 'active', 'deactivated' ) ) ) {\n\t\t\tif ( $transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $transaction, false ) )\n\t\t\t\t$status = 'deactivated';\n\n\t\t\tif ( $transaction->has_children() ) {\n\t\t\t\t//Get the last child and make sure it hasn't been fully refunded\n\t\t\t\t$args = array(\n\t\t\t\t\t'numberposts' => 1,\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t);\n\t\t\t\t$last_child_transaction = $transaction->get_children( $args );\n\t\t\t\tforeach( $last_child_transaction as $last_transaction ) { //really only one\n\t\t\t\t\t$last_transaction = it_exchange_get_transaction( $last_transaction );\n\t\t\t\t\tif ( $last_transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $last_transaction, false ) )\n\t\t\t\t\t\t$status = 'deactivated';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdo_action( 'it_exchange_update_transaction_subscription_status', $transaction, $subscriber_id, $status );\n\t}\n}",
"public function getSubscriptionStatus(Request $request)\n {\n //\n\n try {\n //code...\n $subscription = CategorySubscription::where('user_id', $request->user_id)->where('category_id', $request->category_id)->first();\n\n if ($subscription == null) {\n # code...\n $subscription_status = false;\n\n }else{\n $subscription_status = true;\n\n }\n \n return $subscription_status;\n\n } catch (\\Throwable $th) {\n //throw $th;\n\n return $th;\n }\n }",
"function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}",
"public function isSubscribed(): bool;",
"private function isSubscribed()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['userid']) || $request['userid']==\"\" )\n throw_error_msg(\"userid not provided\");\n\n if( !is_numeric($request['userid']) )\n throw_error_msg(\"invalid userid\");\n\n global $userquery;\n $is_subscribed = $userquery->is_subscribed($request['userid'],$uid);\n \n if(!$is_subscribed)\n {\n throw_error_msg(\"user is not subscribed\"); \n }\n else\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'user is subscribed', \"data\" => $is_subscribed);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"function api_status()\n{\n $result;\n return _do_api_call('GET', '/api/v1/status', null, $result);\n}",
"public function getStatus()\n {\n return $this->_makeCall('status');\n }",
"public function action_subscriptions()\n\t{\n\t\tglobal $context, $txt;\n\n\t\t// Load the paid template anyway.\n\t\ttheme()->getTemplates()->load('ManagePaid');\n\t\tTxt::load('ManagePaid');\n\n\t\t$memID = currentMemberID();\n\t\t$context['member']['id'] = $memID;\n\n\t\t// Load all of the subscriptions in the system (loads in to $context)\n\t\trequire_once(SUBSDIR . '/PaidSubscriptions.subs.php');\n\t\tloadSubscriptions();\n\n\t\t// Remove any invalid ones, ones not properly set up\n\t\t$this->_remove_invalid();\n\n\t\t// Work out what payment gateways are enabled.\n\t\t$this->_gateways = loadPaymentGateways();\n\t\tforeach ($this->_gateways as $id => $gateway)\n\t\t{\n\t\t\t$this->_gateways[$id] = new $gateway['display_class']();\n\n\t\t\tif (!$this->_gateways[$id]->gatewayEnabled())\n\t\t\t{\n\t\t\t\tunset($this->_gateways[$id]);\n\t\t\t}\n\t\t}\n\n\t\t// No gateways yet, no way to pay then, blame the admin !\n\t\tif (empty($this->_gateways))\n\t\t{\n\t\t\tthrow new Exception($txt['paid_admin_not_setup_gateway']);\n\t\t}\n\n\t\t// Get the members current subscriptions.\n\t\t$context['current'] = loadMemberSubscriptions($memID, $context['subscriptions']);\n\n\t\t// Find the active subscribed ones\n\t\tforeach ($context['current'] as $id => $current)\n\t\t{\n\t\t\tif ($current['status'] == 1)\n\t\t\t{\n\t\t\t\t$context['subscriptions'][$id]['subscribed'] = true;\n\t\t\t}\n\t\t}\n\n\t\t// Simple \"done\"?\n\t\tif (isset($this->_req->query->done))\n\t\t{\n\t\t\t$this->_orderDone($memID);\n\t\t}\n\t\t// They have selected a subscription to order.\n\t\telseif (isset($this->_req->query->confirm, $this->_req->post->sub_id) && is_array($this->_req->post->sub_id))\n\t\t{\n\t\t\t$this->_confirmOrder($memID);\n\t\t}\n\t\t// Show the users whats available and what they have\n\t\telse\n\t\t{\n\t\t\t$context['sub_template'] = 'user_subscription';\n\t\t}\n\t}",
"public function call() : GetStatusInterface;",
"public function runSubscriptionsCron()\n {\n $billingActive = $this->scopeConfig->getValue(\n 'subscriptions/general/billing_active',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n if ($billingActive == 1) {\n $this->runSubscriptions();\n }\n }",
"private function callStatus() {\n try {\n $this->status = $this->client->request('GET', $this->url->full_url, [\n 'allow_redirects' => false\n ]);\n } catch (\\Exception $ex) {\n $this->status = $ex->getResponse();\n }\n }",
"public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }"
]
| [
"0.7219857",
"0.7037794",
"0.695794",
"0.66265553",
"0.6506025",
"0.64732325",
"0.61721814",
"0.6151219",
"0.5984803",
"0.59537596",
"0.59493077",
"0.5919059",
"0.5899994",
"0.5889747",
"0.58148223",
"0.5801881",
"0.578239",
"0.5779568",
"0.5769155",
"0.57326204",
"0.56429696",
"0.5630864",
"0.55813557",
"0.55790854",
"0.5561448",
"0.553594",
"0.5535756",
"0.5535276",
"0.5533978",
"0.552242"
]
| 0.78681624 | 0 |
Call the getTransactionStatus method of the gateway class. | function getGatewayTransactionStatus()
{
if (is_object($this->Gateway)) {
return $this->Gateway->getTransactionStatus( $this );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getTransactionStatus();",
"private function transactionStatus(){\n $data = [\n 'Initiator' => ' ',\n 'SecurityCredential' => ' ',\n 'CommandID' => 'TransactionStatusQuery',\n 'TransactionID' => ' ',\n 'PartyA' => ' ',\n 'IdentifierType' => '1',\n 'QueueTimeOutURL' => $this->apiBaseUrl.'/mobilepay/tran_status/time_out',\n 'ResultURL' => $this->apiBaseUrl.'/mobilepay/tran_status/result',\n 'Remarks' => ' ',\n 'Occasion' => ' '\n ];\n return $this->remotePostCall('mpesa/transactionstatus/v1/query', $data);\n }",
"public function getTxStatus()\n {\n return $this->tx_status;\n }",
"public function getTransactionStatus()\n {\n return $this->data['payment_status'];\n }",
"public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }",
"public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }",
"public function getTransactionStatus(TransactionEntity $transaction);",
"function trans_status()\r\n\t{\r\n\t\treturn $this->_trans_status;\r\n\t}",
"public function run()\n {\n $this->propertiesPassRequired();\n\n return $this->_get('/transactions/status' . '?' . http_build_query($this->propertiesToArray()));\n }",
"public function status()\n {\n if (!$this->config->get('onego_status') || !$this->user->hasPermission('modify', 'sale/order')) {\n $this->response->setOutput('');\n return;\n }\n \n $this->language->load('total/onego');\n \n $orderId = (int) $this->request->get['order_id'];\n $operations = OneGoTransactionsLog::getListForOrder($orderId);\n foreach ($operations as $row) {\n if ($row['success'] && empty($statusSuccess)) {\n $statusSuccess = $row;\n break;\n } else if (!$row['success'] && empty($statusFailure)) {\n $statusFailure = $row;\n }\n }\n if (!empty($statusSuccess)) {\n if ($statusSuccess['operation'] == OneGoSDK_DTO_TransactionEndDto::STATUS_DELAY) {\n // delayed transaction\n $expiresOn = strtotime($statusSuccess['inserted_on']) + $statusSuccess['expires_in'];\n if ($expiresOn <= time()) {\n // transaction expired\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_expired'), date('Y-m-d H:i:s', $expiresOn));\n } else {\n // transaction delayed\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_delayed'), \n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])),\n date('Y-m-d H:i:s', $expiresOn));\n \n // enable transaction completion actions\n $this->data['onego_allow_status_change'] = true;\n $confirmStatuses = OneGoConfig::getArray('confirmOnOrderStatus');\n $cancelStatuses = OneGoConfig::getArray('cancelOnOrderStatus');\n $this->data['confirm_statuses'] = $confirmStatuses;\n $this->data['cancel_statuses'] = $cancelStatuses;\n $this->data['onego_btn_confirm'] = $this->language->get('button_confirm_transaction');\n $this->data['onego_btn_cancel'] = $this->language->get('button_cancel_transaction');\n $this->data['onego_btn_delay'] = $this->language->get('button_delay_transaction');\n\n }\n } else {\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_'.strtolower($statusSuccess['operation'])),\n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])));\n }\n } \n if (!empty($statusFailure)) {\n $this->data['onego_status_failure'] = sprintf(\n $this->language->get('transaction_operation_failed'),\n date('Y-m-d H:i', strtotime($statusFailure['inserted_on'])),\n $statusFailure['operation'],\n $statusFailure['error_message']);\n } else if (empty($statusSuccess)) {\n $this->data['onego_status_undefined'] = $this->language->get('transaction_status_undefined');\n }\n $this->data['onego_status'] = $this->language->get('onego_status');\n $this->data['order_id'] = $orderId;\n $this->data['token'] = $this->session->data['token'];\n\n $this->data['confirm_confirm'] = $this->language->get('confirm_transaction_confirm');\n $this->data['confirm_cancel'] = $this->language->get('confirm_transaction_cancel');\n $this->data['delay_periods'] = $this->language->get('delay_period');\n $this->data['delay_for_period'] = $this->language->get('delay_for_period');\n $this->data['confirm_delay'] = $this->language->get('confirm_transaction_delay');\n $this->data['status_will_confirm'] = $this->language->get('transaction_will_confirm');\n $this->data['status_will_cancel'] = $this->language->get('transaction_will_cancel');\n \n $this->template = 'total/onego_status.tpl';\n $this->response->setOutput($this->render());\n }",
"function get_transaction_status($transaction_id){\n $mid = $this->credentials.mid;\n $url = \"https://apps-uat.phonepe.com/v3/transaction/$mid/$transaction_id/status\";\n $salt_key = $this->credentials.salt_key;\n $salt_index = $this->credentials.salt_index;\n $_sha256 =hash(\"sha256\", \"/v3/transaction/$mid/$transaction_id/status$salt_key\");\n $request = new HttpRequest();\n $request->setUrl($url);\n $request->setMethod(HTTP_METH_GET);\n $request->setHeaders(array(\n \"x-verify\" => \"$_sha256###$salt_index\",\n \"x-client-id\" => $this->credentials.client_id,\n \"Content-Type\" => 'application/json',\n ));\n try {\n $response = $request->send();\n return $response->getBody();\n } catch (Exception $ex) {\n return $ex;\n }\n }",
"public function getTransactionStatus()\n {\n if (isset($this->data['vnp_TransactionStatus'])) {\n return $this->data['vnp_TransactionStatus'];\n }\n\n return null;\n }",
"public function getTransactionStatusInfos() {\n return $this->transactionStatusInfos;\n }",
"abstract public function GetStatus();",
"public function get_status()\n {\n }",
"public function get_status()\n {\n }",
"public function transactionStatus(ESL_Buckaroo_Request_TransactionStatus $oRequest)\n\t{\n\t\t$aData = $oRequest->getData();\n\t\t$aRequestData = $this->completeRequest($aData);\n\t\treturn $this->communicate('/nvp/?op=transactionstatus', $aRequestData);\n\t}",
"public function request_transaction_status($host_obj, $transaction_id)\n\t\t{\n\t\t\t$this->init_braintree_environment($host_obj);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$transaction = Braintree_Transaction::find($transaction_id);\n\t\t\t\tif (!$transaction)\n\t\t\t\t\tthrow new Phpr_ApplicationException('Transaction not found');\n\n\t\t\t\treturn new Shop_TransactionUpdate(\n\t\t\t\t\t$transaction->status,\n\t\t\t\t\t$this->get_status_name($transaction->status)\n\t\t\t\t);\n\t\t\t} catch (Exception $ex)\n\t\t\t{\n\t\t\t\tthrow new Phpr_ApplicationException($this->get_exception_description($ex));\n\t\t\t}\n\t\t}",
"public function getStatus()\n {\n return $this->_makeCall('status');\n }",
"function getGatewaySubscriptionStatus()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->getSubscriptionStatus( $this );\n\t\t\t}\n\t\t}",
"public function handleGatewayCallback()\n {\n $paymentDetails = Paystack::getPaymentData();\n\n //dd($paymentDetails['status']);\n\n }",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();"
]
| [
"0.78885335",
"0.6946413",
"0.6818651",
"0.677535",
"0.6699064",
"0.6699064",
"0.6566974",
"0.6443286",
"0.6385332",
"0.634949",
"0.62406945",
"0.6239475",
"0.62304807",
"0.6141229",
"0.61259323",
"0.61259323",
"0.60296845",
"0.5988465",
"0.5927343",
"0.5901033",
"0.5883599",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006",
"0.58787006"
]
| 0.7877095 | 1 |
Sets the HtmlElement to be rendered. | public function setHtmlElement(HtmlElementInterface $htmlElement)
{
$this->htmlElement = $htmlElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _beforeRender()\r\n {\r\n $this->_element->setAttributes($this->getAttribs());\r\n }",
"function setInnerHTML($innerHTML){\n\t\tif(!is_array($innerHTML)){\n\t\t\t$innerHTML = [$innerHTML];\n\t\t}\n\n\t\t$this->innerHTML = $innerHTML;\n\t}",
"protected function setHtmlContent() {}",
"public function setHtml();",
"function setElementHTML($elemName, $html)\n\t{\n\t\t// Only update if element is custom\n\t\tif (isset($this->elementListNames[$elemName]) && $this->elementListNames[$elemName]->type == 'custom') {\n\t\t\t$this->elementListNames[$elemName]->setCustomHTML($html);\n\t\t}\n\t}",
"public function setHtml($html)\n\t{\n\t\t$this->_html = $this->buildHtml($html);\n\t}",
"public function setElement($element)\n\t{\n\t\t$props = array(\n\t\t\t\"encType:'\" . $element->getAttrib('enctype') .\"'\",\n\t\t\t\"formName:'\" . $element->getName() . \"'\",\n\t\t\t\"action:'\" . $element->getAction() . \"'\",\n\t\t\t\"method:'\" . $element->getMethod() . \"'\"\n\t\t);\n\t\tforeach ($element->getDojoProps() as $key => $val) {\n\t\t\t$props[] = \"$key: '$val'\";\n\t\t}\n\t\t$element->setAttrib('data-dojo-props', join(',', $props));\n\t\t$element->setAttrib('id', '');\n\t\t\n\t\treturn parent::setElement($element);\n\t}",
"protected function initHtmlElements()\n {\n $this->htmlElement = new Html_Element('input');\n $this->htmlElementLabel = new Html_Element('label');\n $this->htmlElementValidaionLabel = clone $this->containerElement;\n $this->htmlElementSubLabel = clone $this->containerElement;\n }",
"protected function setElement()\n {\n $this->result[$this->attribute]['element'] = $this->field['element'];\n return $this;\n }",
"public function setElement($prm_elementName, $prm_ElementText){\n $this->startElement($prm_elementName);\n $this->text($prm_ElementText);\n $this->endElement();\n }",
"public function setAttribute(string $name, $value): HtmlElementInterface;",
"public function setHTML()\n {\n // Tanken är att logiken för att sätta HTML-koden för navbaren ligger i denna metod.\n\n\n $this->htmlNavbar = $this->getHTML();\n\n }",
"private function setInnerHTML($element, $html)\n\t{\n\t $fragment = $element->ownerDocument->createDocumentFragment();\n\t $fragment->appendXML($html);\n\t while ($element->hasChildNodes())\n\t $element->removeChild($element->firstChild);\n\t @$element->appendChild($fragment);\n\t}",
"public function setHtml(HelperLocatorFactory $html)\n {\n $this->html = $html;\n }",
"public function setID(string $elementId): HtmlElementInterface;",
"public function renderElement($element);",
"function setElementCustomHTML($elemName, $html)\n\t{\n\t\t// Only update if element is custom\n\t\tif (isset($this->elementListNames[$elemName])) {\n\t\t\t$this->elementListNames[$elemName]->setTypeAsCustom($html);\n\t\t}\n\t}",
"public function render(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element) {\n $this->setElement($element);\n\n return $this->toHtml();\n }",
"public function setHtmlContent($html)\n {\n $this->htmlContent = $html;\n }",
"public function set_element($elm) {\n $this->elements[$elm->id] = $elm;\n }",
"public function setContentElement(ContentElementInterface $element): void\n {\n $this->setChildElement(1, $element);\n }",
"public function setTag(string $tag): HtmlElementInterface;",
"public function setName(string $name): HtmlElementInterface;",
"function setCustomHTML($html) {\n\t\t$this->customHTML = $html;\n\t}",
"public function render() {\n\n echo $this->html;\n\n }",
"public function setHtml($sHtml) {\n $this->sHtml = $sHtml;\n }",
"public function setHtml($html)\n {\n $this->html = $this->message['html'] = $html;\n }",
"public function render() {\n $html = str_replace('{text}', $this->text, FORMWIZARD_SEPARATOR);\n $this->html = $html;\n }",
"public function render() {\n echo $this->getHtml();\n }",
"public function renderHTML()\n {\n }"
]
| [
"0.65320414",
"0.6308219",
"0.62952656",
"0.62424237",
"0.61530143",
"0.61296016",
"0.60567784",
"0.59861195",
"0.5848006",
"0.5794629",
"0.5781736",
"0.57224756",
"0.5714232",
"0.5678281",
"0.5634106",
"0.56266636",
"0.5616157",
"0.55920047",
"0.55434775",
"0.5542657",
"0.55309933",
"0.5527726",
"0.5497968",
"0.54712766",
"0.5468989",
"0.5463224",
"0.5396598",
"0.53958416",
"0.53718764",
"0.53707445"
]
| 0.6712898 | 0 |
Returns the HtmlElement to be rendered. | public function getHtmlElement()
{
return $this->htmlElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function render() {\n\t\treturn $this->_view->getBaseView()->element($this->_name, $this->_data, $this->_options);\n\t}",
"public function innerHtml()\n {\n return $this->getDom()->innerHtml();\n }",
"public function getElement()\n {\n return $this->element;\n }",
"protected function get_element() {\n\t\tif ( ! $this->element ) {\n\t\t\t$this->element = \\esc_attr( \\apply_filters( 'wpseo_breadcrumb_single_link_wrapper', 'span' ) );\n\t\t}\n\n\t\treturn $this->element;\n\t}",
"public function asElement() {\n //public Element asElement()\n return $element;\n }",
"public function getHtml()\n {\n return $this->_getHtml();\n }",
"protected function getElement() {\n return $this->getWebform()->getElement($this->configuration['element_key']);\n }",
"protected function renderElement() {\n $result = \"\";\n $result .= $this->getOpeningTag();\n $result .= (!empty($this->options['content'])) ? $this->options['content'] : \"\";\n $result .= $this->getClosingTag();\n return $result;\n }",
"function toHtml() \n {\n return $this->_html;\n }",
"public function getHtml() {\n\t\treturn $this->_html;\n\t}",
"public function getElement()\n\t{\n\t\treturn $this->_element;\n\t}",
"public function getHtml() : SimpleHtmlDom\n {\n return $this->html;\n }",
"public function getHtml_tag()\n\t{\n\t\treturn $this->html_tag;\n\t}",
"public function getHtml()\n {\n return $this->_toHtml();\n }",
"public function getOuterHtml()\n {\n return $this->getSession()->getDriver()->getOuterHtml($this->getXpath());\n }",
"public function getDomObject()\n\t\t{\n\t\t\t$span = $this->createDomObject( 'span' );\n\t\t\t$span->setAttribute('id', $this->getHTMLControlId());\n\t\t\tif($this->errMsg) {\n\t\t\t\t$span->nodeValue = $this->errMsg;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$span->setAttribute('style', 'display:none;');\n\t\t\t}\n\t\t\treturn $span;\n\t\t}",
"public function getElement()\n {\n if ($this->element_id != 0) {\n return $this->getTable('Element')->find($this->element_id);\n }\n }",
"protected function getWebformElement() {\n $element = $this->getElement();\n return ($element) ? $this->elementManager->getElementInstance($element) : NULL;\n }",
"public function getElementHtml() {\n\t\t$html = '<button ';\n\t\t$html .= $this->getAttributesString();\n\t\t$html .= ' />';\n\t\t$html .= $this->value;\n\t\t$html .= '</button>';\n\n\t\treturn $html;\n\t}",
"public function html()\n {\n return $this->getDom()->html();\n }",
"public function outerHtml()\n {\n }",
"public function getElementHtml(){\n $htmlElement = '<input id=\"color\" name=\"color\" data-ui-id=\"sales-order-status-edit-container-form-fieldset-element-text-color\" class=\"input-text admin__control-text\" type=\"color\" value=\"'.$this->getData('value').'\" >';\n return $htmlElement;\n }",
"public function getElementHtml(){\n $htmlElement = '<input id=\"color\" name=\"color\" data-ui-id=\"sales-order-status-edit-container-form-fieldset-element-text-color\" class=\"input-text admin__control-text\" type=\"color\" value=\"'.$this->getData('value').'\" >';\n return $htmlElement;\n }",
"public function toHtml()\n {\n return $this->render();\n }",
"public function toHtml()\n {\n return $this->render();\n }",
"public function buildElement()\n\t{\n\t\t$e = $this->getElement();\n\t\t$view = $e->getView();\n\t\t$helper = $e->helper;\t\t\n\t\t\n\t\t$type = $e->getType();\n\t\t\n\t\t$attribs = $e->getAttribs();\n\t\t\n\t\t/*$mode = self::MODE_FILE;\n\t\tif (is_string($attribs['selector_mode']) && in_array($attribs['selector_mode'], $this->_modes)) {\n\t\t\t$mode = $attribs['selector_mode'];\n\t\t}\n\t\t$attribs['selector_mode'] = $mode;*/\n\t\t\n\t\t$buttonLabel = '';\n\t\t\n\t\t$selectMultiple = 'false';\n\t\t$jsMethod = 'mainImageRenderer';\n\t\tif (isset($attribs['selectMultiple']) && !!$attribs['selectMultiple']) {\n\t\t\t$selectMultiple = 'true';\n\t\t\t$jsMethod = 'imagesRenderer';\n\t\t}\n\t\t\n\t\t$imgType = '';\n\t\tif (is_string($attribs['media-type'])) {\n\t\t\t$imgType = $attribs['media-type'];\n\t\t\tunset ($attribs['media-type']);\n\t\t}\n\t\t\n\t\t$xhtml = '<div class=\"' . $this->_namespace . '-tag\">'\n\t\t\t . $view->formHidden($e->getName(), $e->getValue(), array('media-type' => $imgType, 'select-multiple' => $selectMultiple, 'autocomplete' => \"off\"))\n\t\t\t . $view->$helper($e->getName(), $buttonLabel, $attribs, $e->options)\n\t\t\t . '<script>$(document).ready(function(){ $.fn.cmsManager(\\'' . $jsMethod . '\\', null, \\'' . $e->getName() . '\\'); })</script>'\n\t\t\t . '</div>';\t\t\t\n\t\n\t\treturn $xhtml;\n\t}",
"public function element( ) : \\DOMElement\n {\n $item = $this->createElement( 'textInput' );\n\n $this->addTitleElement( $item );\n\n $this->addDescriptionElement( $item );\n\n $this->addLinkElement( $item );\n\n if ( $this->name ) {\n $item->appendChild( $this->createElement( 'name', $this->name ) );\n }\n\n $this->addDublinCoreTags( $item );\n\n return $item;\n }",
"public function render()\n {\n // dd( $this->createItemArray() );\n return $this->htmlFromArray($this->createItemArray());\n }",
"public static function Get()\n\t\t{\n\t\t\treturn self::$html;\n\t\t}",
"function toHtml()\n\t{\n\t\t$js = $this->getElementJS();\n\t\treturn $js.parent :: toHtml();\n\t}"
]
| [
"0.7024795",
"0.6776012",
"0.6772301",
"0.6744204",
"0.67321813",
"0.6725592",
"0.6717045",
"0.6675148",
"0.658837",
"0.6586442",
"0.65831906",
"0.65706193",
"0.6555373",
"0.6505501",
"0.64885837",
"0.64781505",
"0.6395322",
"0.63831997",
"0.6377076",
"0.6374024",
"0.6360782",
"0.6348927",
"0.6348927",
"0.63438004",
"0.63438004",
"0.6342274",
"0.6335447",
"0.6320492",
"0.6293222",
"0.627643"
]
| 0.75845915 | 0 |
Obtiene un json con el listado de subfamilias | public function obtenerSubfamilias($familia_id) {
// Obtenemos el listado de subfamilias perteneciente a la familia $familia_id
$subfamilias = Subfamilia::where('IdFamilia', $familia_id)->orderBy('Subfamilia', 'asc')->get();
// Devolvemos el listado en formato json
return Response::json($subfamilias);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listSubSegmentsJSON()\n {\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n\n //Creamos una instancia de nuestro \"modelo\"\n $segmentModel = new SegmentsModel();\n\n if(isset($_GET['gbu']))\n $listado = $segmentModel->getSubSegmentsByGbu($_GET['gbu']);\n else\n $listado = $segmentModel->getAllSubSegments();\n\n $output = array();\n\n while ($row = $listado->fetch(PDO::FETCH_ASSOC))\n {\n $output[$row['COD_SUB_SEGMENT']] = utf8_encode($row['NAME_SUB_SEGMENT']);\n }\n\n $output['selected'] = utf8_encode($_GET['current']);\n\n echo json_encode( $output );\n }",
"public function listarFamiliares(){\n\t\theader('Content-Type: application/json');\n\t\t$lst = new \\App\\Models\\MFamiliares();\n\t\t$respuesta = $lst->listarFamiliares($_POST['ced']);\n\t\techo json_encode($respuesta);\n\t}",
"public function listMicroSegmentsJSON()\n {\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n\n //Creamos una instancia de nuestro \"modelo\"\n $segmentModel = new SegmentsModel();\n\n if(isset($_GET['gbu']))\n $listado = $segmentModel->getAllMicroSegmentsByGbu ($_GET['gbu']);\n else\n $listado = $segmentModel->getAllMicroSegments ();\n\n $output = array();\n\n while ($row = $listado->fetch(PDO::FETCH_ASSOC))\n {\n $output[$row['COD_MICRO_SEGMENT']] = utf8_encode($row['NAME_MICRO_SEGMENT']);\n }\n\n $output['selected'] = utf8_encode($_GET['current']);\n\n echo json_encode( $output );\n }",
"public function ajax_subfamilias($id) {\n\n $subfamilias = Subfamilia::where('familia_id', '=', $id)->get();\n return response()->json($subfamilias);\n\n }",
"public function getSubdivisionList();",
"function _get_regions_subregions(){\n $this->gen_contents['regions'] = $this->admin_career_event_model->dbSelectAllRegions();\n $arr_data = $this->admin_career_event_model->dbSelectAllSubRegions();\n $this->gen_contents['raw_subregion']= $arr_data;\n $id \t\t\t\t\t= 0;\n $arr_subregion\t\t\t\t= array();\n\n foreach ($arr_data as $value){\n if($id != $value->regionid){\n $id = $value->regionid;\n $arr_subregion['R'][$id] = array();\n }\n $arr_subregion['R'][$id][] = array('id' =>$value->id,'name'=>$value->sub_name);\n }\n //gets all the region and subregion for the purpose of displaying filter\n //used to diaply subregion using jason array \t\t\t\t\n $this->gen_contents['json_array'] \t= json_encode($arr_subregion);\n\t\t\t\n\t\t}",
"function getsubcatelist(){\r\n\t\t\t$res=$this->auth_chk();\r\n\t\t\tif(isset($res[\"trust\"])){\r\n\t\t\t\t$data =$this->model->get_subcategory_list($this->post());\r\n\t\t\t\techo json_encode($data);\r\n\t\t\t}else{\r\n\t\t\t\techo json_encode(array(\"status\" => array(\"code\" => 1,'success'=>false,'msg'=>'User have no permission')));\t\r\n\t\t\t}\r\n\t\t}",
"public function JsonDioceses() {\n $o_data = new Db();\n $qr_result = $o_data->query(\"select grandsparents.idno, CASE objects.status WHEN 0 THEN \\\"en attente\\\" WHEN 1 THEN \\\"en cours\\\" WHEN 2 THEN \\\"à valider\\\" WHEN 3 THEN \\\"validé\\\" ELSE \\\"valeur incohérente\\\" END as statut, count(*) as nombre from ca_objects as objects left join ca_objects as parents on parents.object_id=objects.parent_id left join ca_objects as grandsparents on parents.parent_id=grandsparents.object_id and grandsparents.type_id=261 where objects.type_id = 262 and objects.deleted=0 and parents.type_id=23 and parents.parent_id is not null and grandsparents.object_id is not null group by parents.parent_id, objects.status;\");\n $first=1;\n print \"[\";\n while($qr_result->nextRow()) {\n if(!$first) print \",\";\n print \"{\\\"idno\\\":\\\"\".$qr_result->get('idno').\"\\\",\\n\";\n print \"\\\"statut\\\":\\\"\".$qr_result->get('statut').\"\\\",\\n\";\n print \"\\\"nombre\\\":\\\"\".$qr_result->get('nombre').\"\\\"}\\n\";\n $first=0;\n }\n print \"]\\n\";\n exit;\n }",
"function alta_subfamilia(){\n\t\t$u= new Subfamilia_producto();\n\t\t$u->fecha_alta=date(\"Y/m/d\");\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related)){\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Subfamilia de Productos.\\\"); window.location='\".base_url().\"index.php/\".$GLOBALS['ruta'].\"/productos_c/formulario/list_subfamilias';</script></html>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}",
"public function listsSubcountiesget()\r\n {\r\n $response = Sub_county::get();\r\n return response()->json($response, 200);\r\n }",
"public function listSegmentsJSON()\n {\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n\n //Creamos una instancia de nuestro \"modelo\"\n $segmentModel = new SegmentsModel();\n\n if(isset($_GET['gbu']))\n $listado = $segmentModel->getAllSegmentsByGbu ($_GET['gbu']);\n else\n $listado = $segmentModel->getAllSegments();\n\n $output = array();\n\n while ($row = $listado->fetch(PDO::FETCH_ASSOC))\n {\n $output[$row['COD_SEGMENT']] = utf8_encode($row['NAME_SEGMENT']);\n }\n\n $output['selected'] = utf8_encode($_GET['current']);\n\n echo json_encode( $output );\n }",
"public function get_subsec()\n\t{\n\t\t$section_id = $this->input->post('section_id');\n\t\t$subsection['subsec'] = $this->reports->get_subsec($section_id);\n\t\techo json_encode($subsection);\n\t}",
"function listar_familias($objeto){\n\n\t\t$sql = \"SELECT\n\t\t\t\t\t\t\tid, nombre\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tapp_familia\n\t\t\t\t\t\tWHERE id in\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tselect\n\t\t\t\t\t\t\t\t\tdistinct familia\n\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\tapp_productos\n\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\tstatus = 1 and\n\t\t\t\t\t\t\t\t\tfamilia is not null and\n\t\t\t\t\t\t\t\t\tfamilia <>0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\tORDER BY id\";\n\n\t\t// return $sql;\n\t\t$result = $this->queryArray($sql);\n\n\t\treturn $result;\n\t}",
"public function getSubCategory(){\n $productModel = new productModel();\n $subCategories = $productModel->getSubCategoryList($this->data);\n $this->JsonCall($subCategories);\n }",
"function getListJsonString() {\r\n \r\n $arr=array();\r\n \r\n foreach ($this->list as $object)\r\n {\r\n $vars = $object->getObjectVars();\r\n \r\n if ( $object->getObjCentro() !=null )\r\n {\r\n $vars['objCentro']=$object->getObjCentro()->getObjectVars();\r\n }\r\n if ( $object->getObjCiclo() !=null )\r\n {\r\n $vars['objCiclo']=$object->getObjCiclo()->getObjectVars();\r\n \r\n if ( $object->getObjCiclo()->getObjFamilia() !=null )\r\n {\r\n $vars['objFamilia']=$object->getObjCiclo()->getObjFamilia()->getObjectVars();\r\n } \r\n }\r\n \r\n array_push($arr, $vars);\r\n }\r\n return json_encode($arr);\r\n }",
"public function get_subsec()\n\t{\n\t\t$section_id = $this->input->post('section_id');\n\t\t$subsection['subsec'] = $this->file_maintenance_model->get_subsec($section_id);\n\t\techo json_encode($subsection);\n\t}",
"function jx_get_franchiselist(){\r\n\t\t$output = array();\r\n\t\t \r\n\t\t$f_list_res = $this->db->query(\"select franchise_id,pnh_franchise_id,franchise_name from pnh_m_franchise_info a order by franchise_name asc \");\r\n\t\tif($f_list_res->num_rows())\r\n\t\t{\r\n\t\t\t$output['f_list'] = $f_list_res->result_array();\r\n\t\t\t$output['status'] = 'success';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$output['status'] = 'error';\r\n\t\t\t$output['message'] = 'No Franchises found';\r\n\t\t}\r\n\t\techo json_encode($output);\r\n\t}",
"public function get_subtypes()\n {\n }",
"public function fetch_sub_class_json($class)\n{\n $table = $this->return_table();\n $this->db->where(\"class_name\", $class);\n $query = $this->db->get($table);\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n}",
"public function listarFaltas()\n {\n $id_tipo_falta = $this->request->getGet(\"id_tipo_falta\");\n $respuesta = $this->model->seleccionarFaltas($id_tipo_falta);\n return json_encode($respuesta);\n }",
"public function getBergrivierSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '116'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function annonceJson(){\n $db = $this->getPDO();\n $sql = \"SELECT * FROM annonces INNER JOIN utilisateurs ON annonces.utilisateur_id = utilisateurs.id_utilisateur INNER JOIN categories ON annonces.categorie_id = categories.id_categorie INNER JOIN regions ON annonces.regions_id = regions.id_regions\";\n $json = $db->query($sql);\n return $json;\n }",
"public function get_trainee_related_json() {\n $trainee = array();\n $tenant_id = $this->tenant_id;\n $class_id = $this->input->post('class_id');\n if ($class_id) {\n $trainees = $this->classtraineemodel->get_all_trainee_details($tenant_id, '', $class_id);\n if ($trainees) {\n foreach ($trainees as $row) {\n $trainee['trainee'][] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . ' (Tax Code: ' . $row->tax_code . ')',\n );\n }\n }\n }\n echo json_encode($trainee);\n exit();\n }",
"public function complexListing(){\n\t\t//if someone knows, please make it better\n\t\t$formatResponse = new ResponseModel();\n\t\t$enrollmentModel = new EnrollmentModel();\n\t\t$formatResponse->data = [];\n\t\tforeach ($enrollmentModel->getStudentbyClass() as $item) {\n\t\t\t$new_item[\"fullname\"] = $item[\"firstname\"] . \" \" . $item[\"lastname\"];\n\t\t\t$new_item[\"birtdate\"] = date(\"d F Y\",strtotime($item[\"birthdate\"]));\n\t\t\t$new_item[\"enrollments\"] = $enrollmentModel->getClassByIdStudent($item[\"student_id\"]);\n\t\t\tarray_push($formatResponse->data,$new_item);\n\t\t}\n\t\treturn $this->respond($formatResponse);\n\t}",
"public function getBitouSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '107'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function company_all_profiles_json() {\n $this->autoRender = false;\n $profile_pending = $this->Role->find('list', array(\n 'fields' => array('name'),\n 'conditions' => array(\n 'Role.comp_id' => $this->Auth->user('id'),\n )));\n return json_encode($profile_pending);\n }",
"function get_item_list_json()\n {\n $output = $this->invm->get_item_list_search(strtolower($this->uri->segment(4)));\n echo json_encode($output);\n }",
"public function get_seubjects_list(){\n\t\t$this->verify();\n\t\t$subjects=$this->admin_model->fetch_subjects_list($_GET['search']);\n\t\tforeach ($subjects as $key => $value) {\n\t\t\t$data[] = array('id' => $value['SUBJECT_ID'], 'text' => $value['SUBJECT']);\t\t\t \t\n \t\t}\n\t\techo $officers=json_encode($data);\n\t}",
"public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }",
"public function getStellenboschSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '99'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}"
]
| [
"0.7005925",
"0.69772184",
"0.6653488",
"0.64718735",
"0.6179561",
"0.61782146",
"0.6119779",
"0.6091362",
"0.5983521",
"0.59311396",
"0.59236217",
"0.58544314",
"0.58518636",
"0.58080286",
"0.57703656",
"0.5762025",
"0.5706058",
"0.56903625",
"0.56679493",
"0.5666484",
"0.5655862",
"0.56073564",
"0.55773324",
"0.5570082",
"0.55657357",
"0.555818",
"0.55519915",
"0.555076",
"0.5550632",
"0.5546259"
]
| 0.711566 | 0 |
Extracts the token from the response | public function tokenFromResponse($response){
parse_str($response);
$this->token = $access_token;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extract_access_token()\r\n{\r\n $header = $_SERVER['HTTP_AUTHORIZATION'];\r\n\r\n if ($header != null && preg_match('/^Bearer[ ]+(.+)/i', $header, $captured))\r\n {\r\n return $captured;\r\n }\r\n\r\n if ($_SERVER['REQUEST_METHOD'] == 'GET')\r\n {\r\n return $_GET['access_token'];\r\n }\r\n else\r\n {\r\n return $_POST['access_token'];\r\n }\r\n}",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"private function get_token() {\n\n\t\t$query = filter_input( INPUT_GET, 'mwp-token', FILTER_SANITIZE_STRING );\n\t\t$header = filter_input( INPUT_SERVER, 'HTTP_AUTHORIZATION', FILTER_SANITIZE_STRING );\n\n\t\treturn ( $query ) ? $query : ( $header ? $header : null );\n\n\t}",
"public function getToken() {\n return $this->token;\n }",
"public function getToken()\r\n {\r\n return $this->token;\r\n }",
"public function getToken()\r\n {\r\n return $this->token;\r\n }",
"public function getToken ()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function get_token() {\n\t\treturn $this->token;\n\t}",
"public function getToken() {\n return $this->token;\n }",
"public function getToken()\n {\n $authHeader = $this->getHeader('AUTHORIZATION');\n $authQuery = $this->getQuery('token');\n\n return $authQuery ? $authQuery : $this->parseBearerValue($authHeader);\n }",
"public function token()\n {\n return $this->token['token'] ?? null;\n }"
]
| [
"0.68614656",
"0.68573296",
"0.68573296",
"0.68573296",
"0.68573296",
"0.6833982",
"0.6766311",
"0.6750373",
"0.6750373",
"0.6716843",
"0.6712098",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6682548",
"0.6680603",
"0.6673676",
"0.6630066",
"0.66282517"
]
| 0.71816236 | 0 |
Checks if a token is short term or long term. If the issued_at field is returned, then the token is long term | public function isShortTerm($inputToken){
$debug = json_decode($this->debug($inputToken));
if(isset($debug->data->issued_at)){
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasToken();",
"function __validToken($token_created_at) {\n $expired = strtotime($token_created_at) + 86400;\n $time = strtotime(\"now\");\n if ($time < $expired) {\n return true;\n }\n return false;\n }",
"function check_token($token, $form_name)\n{\n if (is_bool($token)) {\n return false;\n }\n return $token === get_token($form_name);\n}",
"private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function hasToken(){\n return $this->_has(2);\n }",
"public function hasToken(){\n return $this->_has(2);\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasToken(){\n return ( $this->token and $this->token->isValid() );\n }",
"function is_valid_token($request)\n\t{\n\t\tif (!isset($request->token) || empty($request->token))\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\t\t// else\n\t\t\t// $request->token = urldecode($request->token);\n\t\t\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = ['android_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = ['ios_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = ['web_token' => $request->token];\n\t\t}\n\t\t\n\t\t$ci = &get_instance();\n\t\t$ci->load->model('auth_model');\n\t\t$row = $ci->auth_model->get_token($token);\n\t\tif (!$row)\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = $row->android_token;\n\t\t\t$token_exp = $row->android_token_expired;\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = $row->ios_token;\n\t\t\t$token_exp = $row->ios_token_expired;\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = $row->web_token;\n\t\t\t$token_exp = $row->web_token_expired;\n\t\t}\n\t\t\n\t\tif ($request->token != $token)\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_invalid')]];\n\t\t\n\t\tif ($token_exp < date('Y-m-d H:i:s'))\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_expired')]];\n\t\t\n\t\treturn [TRUE, ['result' => $row, 'message' => NULL]];\n\t}",
"function media_theplatform_mpx_check_token() {\n if (!media_theplatform_mpx_variable_get('token')) {\n return FALSE;\n }\n // If idleTimeout date has passed, signIn again.\n if (media_theplatform_mpx_variable_get('date_idletimeout') < time()) {\n // Expire the current token.\n media_theplatform_mpx_expire_token();\n // Retrieve and return new token.\n return media_theplatform_mpx_signin();\n }\n else {\n return TRUE;\n }\n}",
"public function token_is_valid() {\n $token = $this->ci->input->post(\"token\");\n\n $this->ci->load->helper(\"access\");\n return check_token($token);\n }",
"public function hasTokenExpired()\n {\n $tokenTimestamp = $this->flagManager->getFlagData(self::TOKEN_RECEIVED_TIMESTAMP);\n if ($tokenTimestamp !== null) {\n $date = (new \\DateTime())->getTimestamp();\n $validity = $this->flagManager->getFlagData(self::TOKEN_EXPIRES_IN_FLAG_NAME);\n return $date > $tokenTimestamp + $validity - self::TOKEN_VALIDITY_MARGIN_IN_SECONDS;\n }\n return true;\n }",
"public static function checkValidateToken(array $decodedToken): bool {\n $expired_at = new \\DateTime($decodedToken['expired_at']);\n\n //Get actually time\n $now = new \\DateTime();\n\n //Check date validity\n return ($expired_at < $now);\n }",
"public function checkToken( )\n {\n\n $this->getTokenPost();\n if ( $this->token_post && $this->is_active() ) {\n if (empty($this->project_id) || $this->project_id != $this->token_post['meta_data']['pr-projekt'][0]) {\n $this->set_result_error('notfound');\n return false;\n }\n return $this->result;\n } else {\n return false;\n }\n\n }",
"public function isMyTokenExpired() {\n if ($this->getExpiresAt() instanceof \\DateTime) {\n return $this->getExpiresAt()->getTimestamp() < time();\n }\n return null;\n }",
"protected function _checkToken(KCommandContext $context)\n {\n //Check the token\n if($context->caller->isDispatched())\n { \n $method = KRequest::method();\n \n //Only check the token for PUT, DELETE and POST requests (AND if the view is not 'ipn')\n if(($method != KHttpRequest::GET) && ($method != KHttpRequest::OPTIONS) && (KRequest::get('get.view', 'string') != 'ipn')) \n { \n if( KRequest::token() !== JUtility::getToken()) { \n return false;\n }\n }\n }\n \n return true;\n }",
"public function validateAccessTokenTime($payload)\r\n {\r\n $output = 0;\r\n $dateNow = Carbon::now('UTC')->timestamp;\r\n if ($payload->creation_refrech_ttl_date == \"\" && $payload->expire_refrech_ttl_date == \"\") \r\n {\r\n $creation_ttl_date = $payload->creation_ttl_date;\r\n $expire_ttl_date = $payload->expire_ttl_date;\r\n $expire_refresh_ttl_date = Carbon::createFromTimestampUTC($payload->creation_ttl_date)->timestamp;\r\n $expire_refresh_ttl_date = Carbon::createFromTimestampUTC($expire_refresh_ttl_date)->addMinutes(Config(\"config.refresh_ttl\"))->timestamp;\r\n } \r\n else \r\n {\r\n $creation_ttl_date = $payload->creation_ttl_date;\r\n $expire_ttl_date = $payload->expire_ttl_date;\r\n $expire_refresh_ttl_date = $payload->expire_refrech_ttl_date;\r\n }\r\n if ($payload->expire_ttl_date > $dateNow) \r\n {\r\n if ($expire_refresh_ttl_date > $dateNow) \r\n {\r\n //token is ok\r\n $output = 1;\r\n } \r\n else \r\n {\r\n //token need refresh\r\n $output = 2;\r\n }\r\n } \r\n else \r\n {\r\n //token expired\r\n $output = 3;\r\n }\r\n return $output;\r\n }",
"function checkToken($type,$token,$userid){\n\tif(trim($type) == ''\n\t\t|| trim($token) == ''\n\t\t|| trim($userid) == ''\n\t){\n\t\treturn false;\n\t}\n\tif($type == DUDU_DRIVER){\n\t\t$table = API_TABLE_PRE.'driver_token';\n\t\t$conditionUseridColumn = 'did';\n\t}elseif ($type == DUDU_PASSENGER){\n\t\t$table = API_TABLE_PRE.'passenger_token';\n\t\t$conditionUseridColumn = 'pid';\n\t}else{\n\t\treturn false;\n\t}\n\t$sql = 'select token from '.$table.' where '.$conditionUseridColumn.' = '.$userid;\n\t$rs = myDoSqlQuery($sql);\n\t$tokenInfo = pg_fetch_assoc($rs);\n\tif($tokenInfo['token']==$token){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public static function hasToken(Request $request);",
"public static function check_token($submitted_token) {\n\t\t\t// Check if a token was submitted\n\t\t\tif($submitted_token) {\n\t\t\t\t// Token was submitted\n\t\t\t\t// Bring in the session variable\n\t\t\t\tglobal $session;\n\t\t\t\t\n\t\t\t\t// Check if the submitted token matches the one in the database\n\t\t\t\tif($submitted_token == $session->get('csrf_token')) {\n\t\t\t\t\t// Token is the same\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t// Token is not the same\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Token wasn't submitted\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function setup_check_security_token() {\n\t\tif ( ! $this->wsal->settings()->CurrentUserCan( 'edit' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Access Denied.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\t$nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : false;\n\t\t$token = isset( $_POST['token'] ) ? sanitize_text_field( wp_unslash( $_POST['token'] ) ) : false;\n\n\t\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-verify-wizard-page' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Nonce verification failed.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\tif ( empty( $token ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Invalid input.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'success' => true,\n\t\t\t\t'token' => $token,\n\t\t\t\t'tokenType' => esc_html( $this->get_token_type( $token ) ),\n\t\t\t)\n\t\t);\n\t\tdie();\n\t}",
"public static function checkToken($request){\n $authHeader = $request->getHeader(\"Authorization\");\n if ($authHeader) {\n try{\n $headerInfo = \\explode(\" \", $authHeader);\n $jwt = $headerInfo[1];\n\n $secretKey = Configuration::get('jwtkey');\n $token = JWT::decode($jwt, $secretKey, array('HS512'));\n return true;\n } catch (Exception $ex) {\n return false;\n }\n }\n return false;\n }",
"function validToken($name, $referer, $time)\n{\n\tif(isset($_SESSION[$name.'Token']) && isset($_SESSION[$name.'Token_time']) && isset($_POST['token']))\n\t\tif($_SESSION[$name.'Token']===$_POST['token'])\n\t\t\tif($_SESSION[$name.'Token_time']>=(time()-$time))\n\t\t\t\tif($_SERVER['HTTP_REFERER']==$referer)\n\t\t\t\t\treturn true;\n\treturn false;\n}",
"public function verify($token):bool;",
"public function validateTokenTime($token) {\n \t// get token validation\n \tif(Reset::where('token', $token)->count() > 0) {\n\t \t$reset = Reset::where('token', $token)->first();\n\n\t \tdate_default_timezone_set('UTC'); \n\t $date_two = date('Y-m-d H:i:s ', time());\n\n\t $minutes = round((strtotime($date_two) - strtotime($reset->updated_at)) / 60,2);\n\t $hours = round((strtotime($date_two) - strtotime($reset->updated_at))/(60*60));\n\n\t if($hours >= 24) {\n\t return \"expired\";\n\t } else {\n\t return \"working\";\n\t }\n\t } else {\n\t \treturn \"working\";\n\t }\n }",
"public function validate ( $token ) { return $this->server->token2uid( $token ) > 0; }",
"function checkToken() {\n\t\t\t// Split the token up again to make sure the first 40 chars are the same (TOKEN)\n\t\t\t$splitToken = substr($this->tokenFromCookie, 0, 40);\n\t\t\t\n\t\t\t// Split the token up again to make sure the second 40 chars are the same (ZIPPED)\n\t\t\t$splitZipped = substr($this->tokenFromCookie, 40, 40);\n\t\t\t\n\t\t\t// Unzip the second 40 chars\n\t\t\t$result = $this->unzip($splitZipped);\n\n\t\t\t// Check if the sha of the zipped portion matches the token.\n\t\t\t// If so, no one has messed with the token\n\t\t\tif(strcmp($splitToken, sha1($splitZipped) == 0)) {\n\t\t\t\t// Grab all data from unzip\n\t\t\t\t$ip = base_convert($result[0], IP_ADDRESS, 10);\n\t\t\t\t$time = base_convert($result[1], REQUEST_TIME, 10);\n\t\t\t\t$user = $result[2];\n\t\t\t\t$random = $result[3];\n\t\t\t\t$expires = substr($this->tokenFromCookie, 80, strlen($this->tokenFromCookie));\n\n\t\t\t\t// Check if token is expired after one hour\n\t\t\t\tif(time() - $expires <= 3600) {\n\t\t\t\t\tif(strpos($_SERVER['REMOTE_ADDR'], \":\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\":\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\telseif(strpos($_SERVER['REMOTE_ADDR'], \".\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\".\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check if userIp is the same as when s/he originally logged in\n\t\t\t\t\t$validity = (strcmp($ip, $userIpAddImp) == 0) ? true : false;\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t$validity = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$validity = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $validity;\n\t\t}",
"private static function verify_token( $token, $timestamp )\n\t{\n\t\tif ( $token == self::create_token( $timestamp ) ) {\n\t\t\t$time = time();\n\t\t\tif ( $time > ($timestamp + 3) && $time < ($timestamp + 5*60) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function checkToken() {\n if (!isset($this->requestToken)) {\n trigger_error(tr('Request token missing. Is the session module missing?'), E_USER_WARNING);\n return false;\n }\n if (!isset($this->data['access_token'])) {\n return false;\n }\n return $this->requestToken->getToken() === $this->data['access_token'];\n }"
]
| [
"0.5865291",
"0.5829752",
"0.5793695",
"0.5639133",
"0.5521375",
"0.5521375",
"0.5473424",
"0.5473424",
"0.5445249",
"0.54319274",
"0.5424611",
"0.5346178",
"0.52662194",
"0.52658385",
"0.5207227",
"0.52028275",
"0.51978046",
"0.5162347",
"0.51555914",
"0.5145898",
"0.51033306",
"0.5084344",
"0.5078459",
"0.5074216",
"0.5068988",
"0.5066839",
"0.5061891",
"0.5050549",
"0.5046644",
"0.49969092"
]
| 0.6773717 | 0 |
fonction de calcul d'age a partir de date de naissance sous forme AAAAMMJJ | function age($naiss){
list($y,$m,$d) = explode('-',$naiss);// list créer un tableau
$diff = date('m') - $m;
if( $diff < 0 ){
//le mois de naissance de la personne n'est pas encore le bon, par rapport au mois en cours, donc elle "perd" 1an (y++)
$y++;
}elseif($diff == 0 && (date('d') - $d < 0)){
$y++;
}
return date('Y') - $y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculAge($date){\n\n$timestamp = strtotime($date); // en seconde\nreturn ceil((time() - $timestamp) / (60 * 60 * 24 * 365)); //calcul de l'age en arrondit\n}",
"function age($date)\n{\n\t// PHP décompose la date saisie dans l'ordre défini\n list($annee, $mois, $jour) = explode ('/', $date);\n $TSN = strtotime($annee.\"/\".$mois.\"/\".$jour);\n $TS = strtotime(date(\"Y/m/d\"));\n\n $Age = ($TS-$TSN)/(365*3600*24);\n return round($Age);\n}",
"function get_age($date_of_birth) //day-month-year\n\t\t{\n\t\t\t$bdate = explode(\"-\", $date_of_birth);\n\t\t\t$day\t= isset($bdate[0]) ? (int)$bdate[0] : 0;\n\t\t\t$month\t= isset($bdate[1]) ? (int)$bdate[1] : 0;\n\t\t\t$year\t= isset($bdate[2]) ? (int)$bdate[2] : 0;\n\t\t\tif ($year)\n\t\t\t{\n\t\t\t\t$age = date(\"Y\") - $year;\n\t\t\t\tif (($month > date(\"m\")) || ($month == date(\"m\") && date(\"d\") < $day))\n\t\t\t\t{\n\t\t\t\t\t$age -= 1;\n\t\t\t\t}\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function getAge()\n {\n //function qui calcule l'age de leleve \n $now = new \\DateTime('now');\n $age = $this->getDateNaissance();\n $difference = $now->diff($age);\n\n return $difference->format('%y Ans');\n }",
"function calcularIdade($birthDate){\n\n\t\t\t\t//explode the date to get month, day and year\n\t\t\t\t$birthDate = explode(\"/\", $birthDate);\n\n\t\t\t\t//get age from date or birthdate\n\t\t\t\t$age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date(\"md\") ? ((date(\"Y\") - $birthDate[2]) - 1) : (date(\"Y\") - $birthDate[2]));\n\t\t\t\treturn $age;\n\t\t}",
"function getAge($dob) { \n $dob = explode(\"/\", $dob); \n $curMonth = date(\"m\");\n $curDay = date(\"j\");\n $curYear = date(\"Y\");\n // echo \"curYear: $curYear\";\n $age = $curYear - $dob[2]; \n if($curMonth<$dob[0] || ($curMonth==$dob[0] && $curDay<$dob[1])) \n $age--; \n return $age; \n}",
"function Age ($date, $year = true, $month = false, $day = false)\r{\r\t$byear = substr ($date, 0, 4);\r\t$bmonth = substr ($date, 5, 2);\r\t$bday = substr ($date, 7, 2);\r\r\t$today = getdate();\r\t$tyear = $today['year'];\r\t$tmonth = $today['mon'];\r\t$tday = $today['mday'];\r\r\t$years = $tyear - $byear + ($bmonth > $tmonth ? -1 : 0);\r\t$months = $tmonth - $bmonth;\r\tif ($months < 0) $months += 12;\r\t$days = $tday - $bday;\r\tif ($days < 0) $months += 31;\r\r\tif ($year) $result = $years . ' years';\r\telse $months += 12 * $years;\r\r\tif ($month) $result .= ' ' . $months . ' months';\r\telse $days += $months * 31;\r\r\tif ($day) $result .= ' ' . $days . ' days';\r\r\treturn $result;\r}",
"public function cheffism_age_function($atts) {\n extract(shortcode_atts(array(\n 'date' => '11/04/1985',\n 'format' => 'dd/MM/YYYY'\n ), $atts));\n\n //explode the date to get month, day and year\n $date = explode(\"/\", $date);\n //get age from date or birthdate\n $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $date[1], $date[0], $date[2]))) > date(\"md\")\n ? ((date(\"Y\") - $date[2]) - 1)\n : (date(\"Y\") - $date[2]));\n\n return $age;\n }",
"function GetAge($dob) \r\n\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t$dob=explode(\"/\",$dob); \r\n\t\t\t\t\t\t\t\t\t\t$curMonth = date(\"m\");\r\n\t\t\t\t\t\t\t\t\t\t$curDay = date(\"j\");\r\n\t\t\t\t\t\t\t\t\t\t$curYear = date(\"Y\");\r\n\t\t\t\t\t\t\t\t\t\t$age = $curYear - $dob[2]; \r\n\t\t\t\t\t\t\t\t\t\tif($curMonth<$dob[1] || ($curMonth==$dob[1] && $curDay<$dob[0])) \r\n\t\t\t\t\t\t\t\t\t\t\t$age--; \r\n\t\t\t\t\t\t\t\t\t\treturn $age; \r\n\t\t\t\t\t\t\t\t\t}",
"public function getAge() {\n\t\tif ($this->birthday) {\n\t\t\t// split date\n\t\t\t$year = $month = $day = 0;\n\t\t\t$optionValue = explode('-', $this->birthday);\n\t\t\tif (isset($optionValue[0])) $year = intval($optionValue[0]);\n\t\t\tif (isset($optionValue[1])) $month = intval($optionValue[1]);\n\t\t\tif (isset($optionValue[2])) $day = intval($optionValue[2]);\n\t\t\t\n\t\t\t// calc\n\t\t\tif ($year) {\n\t\t\t\t$age = DateUtil::formatDate('%Y', null, false, true) - $year;\n\t\t\t\tif (intval(DateUtil::formatDate('%m', null, false, true)) < intval($month)) $age--;\n\t\t\t\telse if (intval(DateUtil::formatDate('%m', null, false, true)) == intval($month) && DateUtil::formatDate('%e', null, false, true) < intval($day)) $age--;\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}",
"public function age() {\n $years = ((integer) date('Y')) - $this->year;\n\n if (((integer) date('n')) < $this->month) {\n $years -= 1;\n }\n else if (((integer) date('n')) == $this->month) {\n if (((integer) date('j')) < $this->day) {\n $years -= 1;\n }\n }\n\n return $years;\n }",
"public static function getAge($date) {\r\n $d = new DateTime($date);\r\n $t = new DateTime(self::currentDateTime(self::datePattern));\r\n $interval = $t->diff($d);\r\n \r\n $years = $interval->format(\"%Y\");\r\n if($years == date(self::dateYear,time()))\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return $years;\r\n } \r\n }",
"public function getAge() {\n date_default_timezone_set('America/New_York');\n list($year,$month,$day) = explode(\"-\",$this->birthDate);\n $year_diff = date(\"Y\") - $year;\n $month_diff = date(\"m\") - $month;\n $day_diff = date(\"d\") - $day;\n if ($month_diff < 0 || ($month_diff == 0 && $day_diff < 0)) {\n $year_diff--;\n }\n return $year_diff;\n }",
"function ageCalculator($dob){\n if(!empty($dob)){\n $birthdate = new DateTime($dob);\n $today = new DateTime('today');\n $age = $birthdate->diff($today)->y;\n return $age;\n }else{\n return 0;\n }\n}",
"function ageCalculator($dob)\n{\n\tif(!empty($dob))\n\t{\n\t\t$birthdate = new DateTime($dob);\n\t\t$today = new DateTime('today');\n\t\t$age = $birthdate->diff($today)->y;\n\t\treturn $age;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}\n}",
"public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}",
"private function ageChaton() { \n $datenow = new DateTime(\"now\");\n $result = date('Y-m-d', strtotime('-365 day')); //-12 mois\n\n return $result;\n }",
"function checkAge($thisAge, $listDate){\r\n\t$date = new DateTime($thisAge);\r\n\t$now = new DateTime($listDate);\r\n\t$interval = $now->diff($date);\r\n\t$age = $interval->y;\r\n\treturn $age;\r\n}",
"public function age($date){\n $date = str_replace(\"/\",\"-\",$date);\n $date = date('Y/m/d',strtotime($date));\n $today = date('Y/m/d');\n $age = $today - $date;\n return $age;\n}",
"function date_to_age($day, $month, $year) {\n\t$offset = -5;\n\n\t$now = gmdate(\"Y m d\", time() + (60*60*$offset));\n\n\t$now_year = intval(substr($now,0,4));\n\t$now_month = intval(substr($now,5,2));\n\t$now_day = intval(substr($now,8,2));\n\n\t$age = $now_year - $year;\n\tif($now_month == $month && $now_day >= $day) $age++;\n\n\treturn $age;\n}",
"function NUMERO_DE_HIJOS_MAYORES_ESTUDIANDO($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\tlist($a, $m)=SPLIT( '[/.-]', $_ARGS[\"PERIODO\"]); \r\n\r\n $anio = $a - 18;\r\n\t$fecha18 = \"$anio-$m-01\";\r\n\t\r\n\t $anio = $a - 25;\r\n\t$fecha25 = \"$anio-$m-01\";\r\n\r\n\t$sql = \"SELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\trh_cargafamiliar\r\n\t\t\tWHERE\r\n\t\t\t\tCodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\tParentesco = 'HI' \r\n\t\t\t\tAND\tFechaNacimiento <= '\".$fecha18.\"'\r\n\t\t\t\tAND\tFechaNacimiento >= '\".$fecha25.\"'\r\n\t\t\t\tAND rh_cargafamiliar.Parentesco = 'HI' \r\n\t\t\t\tAND rh_cargafamiliar.FlagEstudia = 'S'\t\r\n\t\t\t\t\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\treturn intval(mysql_num_rows($query));\r\n}",
"function setAge($dob){ #calculate current age\n/**\n * Simple PHP age Calculator\n *\n * Calculate and returns age based on the date provided by the user.\n * @param date of birth('Format:yyyy-mm-dd').\n * @return age based on date of birth\n */\n\n\t#dumpDie($dob);\n\tif((!empty($dob)) || ($dob != '--') ){\n\t\t$birthdate = new DateTime($dob);\n\t\t#$today = new DateTime('today');\n\t\t$today = new DateTime(DATE_CURRENT);\n\t\t$age = $birthdate->diff($today)->y;\n\t\treturn $age;\n\t}else{\n\t\treturn 0;\n\t}\n}",
"function hitungumurdalambulan($birthday){\n\t\n\t$biday = new DateTime($birthday);\n\t$today = new DateTime('Y-m-d');\n\t\n\t$diff = $today->diff($biday);\n\treturn ($diff->y * 12 ) + $diff->m;\n\n}",
"function getAge($DOB) \n{\n $birth = explode(\"-\", $DOB);\n $age = date(\"Y\") - $birth[0];\n if(($birth[1] > date(\"m\")) || ($birth[1] == date(\"m\") && date(\"d\") < $birth[2]))\n {\n $age -= 1;\n }\n return $age;\n}",
"public function determineAge() {\n $timeInOneYear = 365.256 * 24 * 60 * 60;\n $yearsofAge = floor((strtotime(date('Y')) - strtotime($this->year.'-12-31'))/ $timeInOneYear);\n\n $this->age = $yearsofAge;\n\n return (int) $yearsofAge;\n }",
"public function age()\r\n {\r\n\r\n // Note that A DOB object is based on a date-range and the exact date is\r\n // usually unknown so for age calculation the the middle of the range is\r\n // assumed to be the real date-of-birth.\r\n\r\n if (!empty($this->date_range))\r\n {\r\n $dob = $this->date_range->middle();\r\n $today = new DateTime('now', new DateTimeZone('GMT'));\r\n\r\n $diff = $today->format('Y') - $dob->format('Y');\r\n\r\n if ($dob->format('z') > $today->format('z'))\r\n {\r\n $diff -= 1;\r\n }\r\n\r\n return $diff;\r\n }\r\n return;\r\n }",
"function aika($older_date, $newer_date = false) {\n $chunks = array(\n array(60 * 60 * 24 * 365 , 'vuosi'),\n array(60 * 60 * 24 * 30 , 'kuukausi'),\n array(60 * 60 * 24 * 7, 'viikko'),\n array(60 * 60 * 24 , 'päivä'),\n array(60 * 60 , 'tunti'),\n array(60 , 'minuutti'),\n );\n\n $i = 0;\n $since = $newer_date - $older_date;\n for ($iik = 0, $j = count($chunks); $i < $j; $iik++)\n {\n $seconds = $chunks[$iik][0];\n $name = $chunks[$iik][1];\n if (($count = floor($since / $seconds)) != 0)\n {\n break;\n }\n }\n if ($count > 1 & $name == \"päivä\") {\n $output = ($count == 1) ? '1 '.$name : \"$count {$name}ä\";\n } elseif ($count > 1 & $name == \"vuosi\") {\n $output = ($count == 1) ? '1 '.$name : \"$count vuotta\";\n } elseif ($count > 1 & $name == \"kuukausi\") {\n $output = ($count == 1) ? '1 '.$name : \"$count kuukautta\";\n } else {\n $output = ($count == 1) ? '1 '.$name : \"$count {$name}a\";\n }\n if ($i + 1 < $j)\n {\n $seconds2 = $chunks[$i + 1][0];\n $name2 = $chunks[$i + 1][1];\n \n if (($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0)\n {\n if ($count2 > 1 & $name2 == \"päivä\") {\n $output .= ($count2 == 1) ? ', 1 '.$name2 : \", $count2 {$name2}ä\";\n } elseif ($count2 > 1 & $name2 == \"kuukausi\") {\n $output .= ($count2 == 1) ? ', 1 '.$name2 : \", $count2 kuukautta\";\n } else {\n $output .= ($count2 == 1) ? ', 1 '.$name2 : \", $count2 {$name2}a\";\n }\n \n }\n\n return $output;\n }\n }",
"function get_age_difference($start_date,$end_date, $separator){\n \n\tlist($start_month,$start_date,$start_year) = explode($separator, $start_date);\n list($current_month,$current_date,$current_year) = explode($separator, $end_date);\n $result = '';\n \n /** days of each month **/\n \n for($x=1 ; $x<=12 ; $x++){\n \n $dim[$x] = date('t',mktime(0,0,0,$x,1,date('Y')));\n \n }\n \n /** calculate differences **/\n \n $m = $current_month - $start_month;\n $d = $current_date - $start_date;\n $y = $current_year - $start_year;\n\n /** if the start day is ahead of the end day **/\n \n if($d < 0) {\n \n $today_day = $current_date + $dim[$current_month];\n $today_month = $current_month - 1;\n $d = $today_day - $start_date;\n $m = $today_month - $start_month;\n if(($today_month - $start_month) < 0) {\n \n $today_month += 12;\n $today_year = $current_year - 1;\n $m = $today_month - $start_month;\n $y = $today_year - $start_year;\n \n }\n \n }\n \n /** if start month is ahead of the end month **/\n \n if($m < 0) {\n \n $today_month = $current_month + 12;\n $today_year = $current_year - 1;\n $m = $today_month - $start_month;\n $y = $today_year - $start_year;\n \n }\n \n /** Calculate dates **/\n \n if($y < 0) {\n \n die(\"Start date entered is a future date.\");\n \n } else {\n \n switch($y) {\n \n case 0 : $result .= ''; break;\n case 1 : $result .= $y.($m == 0 && $d == 0 ? ' Year' : ' Year'); break;\n default : $result .= $y.($m == 0 && $d == 0 ? ' Years' : ' Years');\n \n }\n \n switch($m) {\n \n case 0: $result .= ''; break;\n case 1: $result .= ($y == 0 && $d == 0 ? $m.' Month' : ($y == 0 && $d != 0 ? $m.' Month' : ($y != 0 && $d == 0 ? ' and '.$m.' Month' : ', '.$m.' Month'))); break;\n default: $result .= ($y == 0 && $d == 0 ? $m.' Months' : ($y == 0 && $d != 0 ? $m.' Months' : ($y != 0 && $d == 0 ? ' and '.$m.' Months' : ', '.$m.' Months'))); break;\n \n }\n \n switch($d) {\n \n case 0: $result .= ($m == 0 && $y == 0 ? 'Today' : ''); break;\n case 1: $result .= ($m == 0 && $y == 0 ? $d.' Day' : ($y != 0 || $m != 0 ? ' and '.$d.' Day' : '')); break;\n default: $result .= ($m == 0 && $y == 0 ? $d.' Days' : ($y != 0 || $m != 0 ? ' and '.$d.' Days' : ''));\n \n }\n \n }\n\n return $result;\n \n}",
"public function get_age($dob){\n\t\treturn floor((time() - strtotime($dob))/31556926);\n\t}",
"function getAge($birthDate){\n $birthDate = explode('/', $birthDate);\n $birthYear = $birthDate[2];\n $date = date('Y');\n $age = date_diff(date_create($birthYear), date_create($date));\n \n return $age->format('%Y');\n}"
]
| [
"0.77393025",
"0.7426872",
"0.7194352",
"0.7135991",
"0.693347",
"0.6844857",
"0.6766513",
"0.67515135",
"0.6683365",
"0.665995",
"0.6639407",
"0.6585441",
"0.6580333",
"0.65747446",
"0.65393806",
"0.65247744",
"0.65232384",
"0.651775",
"0.65086156",
"0.6482359",
"0.6437759",
"0.64310384",
"0.6413355",
"0.6389726",
"0.6389537",
"0.6388974",
"0.63707936",
"0.6369289",
"0.63642406",
"0.6361562"
]
| 0.82830113 | 0 |
do lots of thing to send a voice message and then | public function broadcastVoiceMessage()
{
//return following message
return 'voice message is sent';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function send_msg() {\r\n }",
"function send($mobile, $message);",
"function msgsrv_send ($target, $cmd, $content, $link) {}",
"public function sendVoice($datas = [])\r\n {\r\n return $this->telegram(\"sendVoice\", $datas);\r\n }",
"public function textToSpeech($message);",
"abstract function doSend();",
"function callBackUpdate($_TELEGRAM, $th, $tc){\n // YOUR BOT CODE GOES HERE\n if ($_TELEGRAM['text'] == \"/start\")\n {\n send($_TELEGRAM['cid'], \"Hi! Welcome on MTgBot Example!\\nThis message was sent by Thread #$th.\\nThe Thread #$th sent $tc messages.\");\n }\n\n}",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function talk();",
"public function sendVoice($chat_id,$voice,$caption=null,$reply_to_message_id=null,$reply_markup=null,$duration=null,$disable_notification=null){\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }",
"public abstract function sendMessage();",
"public function voice ($value, $room_id, $from_id, $message=NULL, $silent=NULL) {\r\n $this->voice = $value;\r\n $this->save();\r\n\r\n if (is_array($client_ids = $this->get_all($this->room->id))) {\r\n foreach($client_ids as $id) {\r\n $this->__sm($id, message::CL_DETAIL, $this->id, $this->room->id, $this->name, $this->voice, $this->admin, $this->image);\r\n if (!$silent) $this->__sm($id, message::RM_VOICE, $from_id, $this->id, $this->room->id, $value, $message);\r\n }\r\n }\r\n return TRUE;\r\n }",
"public function actionVoice()\n {\n $title = '微站设置/语音设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('voice',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }",
"abstract function send();",
"public function sendMessage(){\n\n\n }",
"function sen_sms($to,$text)///ส่ง sms\n{ //create client with api key and secret\n $rest = substr($to, 1);\n $client = new Nexmo\\Client(new Nexmo\\Client\\Credentials\\Basic('c21feb7d', 'yrxEwwXERXj8yv7L'));\n $message = $client->message()->send([\n 'to' => '66'.$rest,\n 'from' => 'RFLpang',\n 'text' => $text,\n 'type' => 'unicode'\n ]);\n //array access provides response data\n //echo \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n\n return \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n}",
"function send_sms()\n\t{\n\t\t$config['functions']['send_sms'] = array('function' => 'Xmlrpc.rpc_send_sms');\n\t\t$this->xmlrpcs->initialize($config);\n\t\t$this->xmlrpcs->serve();\n\t}",
"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}",
"function dire($texte,$signature='', $voice='')\n { \n if ($signature != '') {\n $this->url .='&tts='.rawurlencode('Message de '.stripslashes(trim($signature)).' : ').rawurlencode(stripslashes(trim($texte)));\n } else {\n $this->url .='&tts='.rawurlencode(stripslashes(trim($texte)));\n }\n //Pour le francais on ne prends pas la voix par defaut (preference personnelle ;)\n if ($voice == '' && $this->lang==\"fr\") $voice='claire22k';\n if ($voice == '' && $this->lang==\"us\") $voice='heather22k';\n \n if ($voice != '') {\n $this->url .='&voice='.$voice;\n }\n }",
"function smsmediafailed(){\n $getsender=rawurlencode(\"256703744226\");\n $getsms=rawurlencode(\"No sms recieved, check usesmsmedia.php\");\n\n \n $url='http://lambda.smsmedia.ug/api/capi/send.php?sender='.$getsender.'&dest=8198&user=alimulondo&pass=alimulondo&code=alimulondo&content='.$getsms.''; \n\n $ch = curl_init();\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_URL, $url);\n $content = curl_exec($ch);\n exec(GET);\n \n }"
]
| [
"0.6757487",
"0.63130903",
"0.6276084",
"0.6276014",
"0.6230564",
"0.6219829",
"0.62141967",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.61656773",
"0.6149018",
"0.60921115",
"0.6082289",
"0.6023659",
"0.6013223",
"0.6009522",
"0.59790343",
"0.5925621",
"0.5869086",
"0.5868201",
"0.58548737",
"0.5850575"
]
| 0.6464166 | 1 |
Return an icon representing the visibility of the course | function get_course_visibility_icon($v)
{
$path = api_get_path(REL_CODE_PATH);
$style = 'style="margin-bottom:-5px;margin-right:5px;"';
switch($v)
{
case 0:
return '<img src="'.$path.'img/bullet_red.gif" title="'.get_lang('CourseVisibilityClosed').'" '.$style.' />';
break;
case 1:
return '<img src="'.$path.'img/bullet_orange.gif" title="'.get_lang('Private').'" '.$style.' />';
break;
case 2:
return '<img src="'.$path.'img/bullet_green.gif" title="'.get_lang('OpenToThePlatform').'" '.$style.' />';
break;
case 3:
return '<img src="'.$path.'img/bullet_blue.gif" title="'.get_lang('OpenToTheWorld').'" '.$style.' />';
break;
default:
return '';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function icon()\n {\n return '<i class=\"fas fa-plane-departure sidebar-icon\"></i>';\n }",
"public function getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay() {}",
"public function icon(): string;",
"public function get_icon() {\n\t\tglobal $wc_authorize_sim;\n\n\t\t$icon = '';\n\n\t\t$icon = '<img src=\"' . esc_url( $wc_authorize_sim->force_ssl( $wc_authorize_sim->plugins_url('assets/images/authorize-net-co.png') ) ) . '\" alt=\"' . esc_attr( $this->title ) . '\" />';\n\n\t\treturn apply_filters( 'woocommerce_authorize_sim_icon', $icon, $this->id );\n\t}",
"public function getCategoryIcon();",
"public function getIcon();",
"public function getIcon();",
"public function get_icon()\n {\n return 'fa fa-file-video-o';\n }",
"public function getIcon() {}",
"public function getShowIcon()\n {\n if ($parent = $this->Parent()) {\n return (boolean) $parent->ShowIcons;\n }\n }",
"public function icon() {\n\t\treturn 'column';\n\t}",
"public static function getIcon(): string\n {\n }",
"public static function getIcon(): string\n {\n }",
"public function getIconAttribute(){\n\t\treturn false;\n\t}",
"function icon() {\n global $CFG;\n\n return \"<img src='$CFG->wwwroot/blocks/ilp/pix/graphicon.jpg' height='24' width='24' />\";\n }",
"public function icon($icon);",
"public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}",
"public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}",
"public function getIcon()\n {\n }",
"public function get_icon() {\n\t\treturn 'eicon-eye';\n\t}",
"public function getStrIcon() {\n return \"icon_folderClosed\";\n }",
"public function get_icon() {\n return 'fas fa-comments';\n }",
"public function isVisible();",
"public function isVisible();",
"public function getArticleListIcon();",
"protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}",
"public function getBsShowIcon($icon = null);",
"public function get_icon()\n {\n return 'fa fa-filter';\n }",
"public function get_icon()\n {\n return 'fa fa-image';\n }",
"public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}"
]
| [
"0.64287",
"0.6388247",
"0.6366592",
"0.6113638",
"0.6071895",
"0.60611326",
"0.60611326",
"0.6046433",
"0.5988314",
"0.59722763",
"0.59179157",
"0.5884875",
"0.5884875",
"0.58694166",
"0.58541185",
"0.58527994",
"0.58218193",
"0.5807028",
"0.57842445",
"0.57693446",
"0.57400125",
"0.57382715",
"0.5736145",
"0.5736145",
"0.57164276",
"0.5699855",
"0.5697612",
"0.56876373",
"0.5670231",
"0.5666281"
]
| 0.79532975 | 0 |
set the previous token for PHP file streaming | public function setPreviousToken() {
$this->_token = $this->_previousToken;
$this->_session->key = $this->_previousToken;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _getNextToken() {}",
"protected function _getNextToken() {}",
"public function next_token()\n {\n }",
"function resetToken() {\n $this->setToken(make_string(40));\n }",
"public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}",
"public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }",
"abstract public function setNextAuthToken($token);",
"public function backupCurrentToken()\n {\n $stateStorage = $this->getClient()->getStateStorage();\n\n $token = $stateStorage->get($this->getStateStorageKeyName('token'));\n $stateStorage->set($this->getStateStorageKeyName('real_token'), $token);\n }",
"public function getNewToken()\n\t{ return $this->myNewToken ; }",
"public /*void*/ function rewind(){}",
"public function setPreWebAccessToken($token)\n {\n // First, remove previous (no longer valid) WebAccessToken from session if it exists\n if (session()->has('api_consumer_token')) {\n session()->pull('api_consumer_token');\n }\n // Set the PreWebAccessToken in the session\n session()->put('consumer_token', $token);\n }",
"public function setToken(string $token): void;",
"private static function setSubmitToken() {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n return $token;\n }",
"private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}",
"protected function _removeCurrentToken()\n {\n $session = new Session();\n $session->remove('token');\n }",
"public function rewind() {\n\t\treset($this->tokens);\n\t}",
"function ReadTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"r\");\n $this->_props['RequestToken'] = trim(fread($fh, filesize($fname)));\n fclose($fh);\n }\n }",
"function setToken($token)\n {\n $this->token = $token;\n }",
"public function refreshToken()\n {\n $token = $this->getToken();\n }",
"public function setToken($token);",
"public function readToken() {}",
"function release_token(){\n if(!isset($_GET[$this->name])) {\n header(\"Status: 302 Moved Temporarily\");\n $this->get_id($sid);\n header(\"Location: http://\".$_SERVER['HTTP_HOST'].$this->self_url());\n exit;\n } \n }",
"protected function _initializeTokens() {\n\t\t$this->_previousToken = $this->_session->key;\n\t\t\n\t\t$newKey = sha1 ( microtime () . mt_rand () );\n\t\t\n\t\t$this->_session->key = $newKey;\n\t\tif ($this->_expiryTime > 0)\n\t\t\t$this->_session->setExpirationSeconds ( $this->_expiryTime );\n\t\t\n\t\t$this->_token = $newKey;\n\t}",
"public function rewind ()\n {\n reset($this->tokens);\n }",
"public function setSessionToken() {\n\t\t\t$session_token = hash('sha256', microtime());\n\t\t\t$_SESSION['session_token'] = $session_token;\n\t\t\treturn $session_token;\n\t\t}",
"public function getOriginalToken()\n {\n return $this->token;\n }",
"public function token()\n {\n\n\t\t$this->server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send();\n }",
"public function rewind() {}",
"public function rewind() {}",
"public function rewind() {}"
]
| [
"0.61627007",
"0.61627007",
"0.61043566",
"0.607167",
"0.5759482",
"0.57057667",
"0.56079113",
"0.55237037",
"0.5508565",
"0.5463904",
"0.54513943",
"0.5448828",
"0.54418063",
"0.54359305",
"0.5415702",
"0.5414065",
"0.5382302",
"0.53811765",
"0.53761333",
"0.53738976",
"0.5366251",
"0.53650355",
"0.53536105",
"0.5308532",
"0.5306402",
"0.5299236",
"0.5298648",
"0.5285098",
"0.5285098",
"0.5284098"
]
| 0.720171 | 0 |
Constructs the child compound object metadata. | function metrodora_compound_child_metadata(AbstractObject $object) {
module_load_include('inc', 'islandora', 'includes/metadata');
$children = islandora_compound_object_get_parts($object);
$pid = (!empty($children)) ? $children[0] : $object->id;
$compound_object = islandora_object_load($pid);
return array(
'metadata' => array(
'#markup' => islandora_retrieve_metadata_markup($compound_object, TRUE),
),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}",
"private function packMeta()\n {\n $transport = $this->modx->fromJSON(file_get_contents(__DIR__ . '/../transport.json'));\n unset($transport['support']['db']);\n\n $this->builder->setPackageAttributes([\n 'changelog' => file_get_contents(__DIR__ . '/../meta/changelog.txt'),\n 'license' => file_get_contents(__DIR__ . '/../meta/license.txt'),\n 'readme' => file_get_contents(__DIR__ . '/../meta/readme.txt'),\n 'requires' => $transport['support']\n ]);\n }",
"public function generateMetaData($ObjectName) {\n\t\t$Object = Object::create($ObjectName);\n\t\t$fields = array();\n\t\t$db = $Object->db();\n\t\tarray_push($fields, array(\"name\"=>\"ID\", \"type\"=>\"int\")); //\n\t\tforeach($db as $key=>$value) {\n\t\t\t$value = $this->convertTypeToEXT($value);\n\t\t\t$xtype = $this->getInputType($value);\n\t\t\tarray_push($fields, array(\"name\"=>\"{$key}\", \"type\"=>\"{$value}\", \"xtype\"=>\"{$xtype}\")); //\n\t\t}\n\t\t$has_one = $Object->has_one();\n\t\tforeach($has_one as $key=>$value) {\n\t\t\t//array_push($fields, array(\"name\"=>\"{$key}\", \"type\"=>\"{$value}\"));\n\t\t\tif($value == 'Image') {\n\t\t\t\t$xtype = $this->getInputType($value);\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}\", \"mapping\"=>\"{$key}\", \"xtype\"=>\"{$xtype}\"));\n\t\t\t} else {\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}ID\", \"type\"=>\"int\", \"mapping\"=>\"{$key}ID\"));\n\t\t\t}\n\t\t\t$sObject = Object::create($value);\n\t\t\tif($sObject == $Object) {\n\t\t\t} else {\n\t\t\t\t$sdb = $sObject->db();\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.ID\", \"type\"=>\"int\", \"mapping\"=>\"{$key}.ID\")); //, \"mapping\"=>\"{$key}.ID\"\n\t\t\t\tforeach($sdb as $sKey=>$sValue) {\n\t\t\t\t\t$sValue = $this->convertTypeToEXT($sValue);\n\t\t\t\t\t$xtype = $this->getInputType($sValue);\n\t\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.{$sKey}\", \"type\"=>\"{$sValue}\", \"mapping\"=>\"{$key}.{$sKey}\", \"xtype\"=>\"{$xtype}\")); //, \"mapping\"=>\"{$key}.{$sKey}\"\n\t\t\t\t}\n\t\t\t\t$shas_one = $sObject->has_one();\n\t\t\t\tforeach($shas_one as $sKey=>$sValue) {\n\t\t\t\t\t$sValue = $this->convertTypeToEXT($sValue);\n\t\t\t\t\t$xtype = $this->getInputType($sValue);\n\t\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.{$sKey}\", \"type\"=>\"{$sValue}\", \"mapping\"=>\"{$key}.{$sKey}\", \"xtype\"=>\"{$xtype}\")); //, \"mapping\"=>\"{$key}.{$sKey}\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$fields = Convert::array2json($fields);\n\t\t$metaData = \"\n\t\t\\\"metaData\\\": {\n\t\t\\\"idProperty\\\": \\\"ID\\\",\n \\\"root\\\": \\\"rows\\\",\n \\\"totalProperty\\\": \\\"results\\\",\n \\\"start\\\": 0,\n \\\"limit\\\": 20,\n \\\"successProperty\\\": \\\"success\\\",\n \\\"fields\\\": {$fields}\n \t},\n \t\";\n\t\treturn $metaData;\n\t}",
"public function addMetadata()\n {\n $metadata = new clozetext_metadata();\n $metadata->set_distractor_rationale('It is a general feedback');\n return $metadata;\n }",
"protected function getMetadata()\n {\n // object not working must use array\n $metadata['platform'] = \"Magento 1\";\n $metadata['version'] = Mage::getVersion();\n return $metadata;\n }",
"protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}",
"public function __construct() {\n\t $this->metadata = new \\OpenCloud\\Metadata();\n\t}",
"public function __construct() {\n $this->table = 'child';\n $this->primaryKey = 'id';\n $this->foreinKey = 'person_id';\n $this->columns = array(\n 'id', \n 'person_id', \n 'name', \n 'last_name', \n 'gender',\n 'age', \n 'blood_type'\n );\n $this->randomize = array(\n 'name' => array( //add format options upercase lowercase and capitalize or without format\n 'type' => 'file',\n 'path' => 'files/nameslist.txt',\n 'num_lines' => 200\n ),\n 'last_name' => array( //add format options upercase lowercase and capitalize or without format\n 'type' => 'file',\n 'path' => 'files/lastnameslist.txt',\n 'num_lines' => 200\n ),\n 'gender' => array(\n 'type' => 'in-list',\n 'list' => array('male', 'female')\n ),\n 'age' => array(\n 'type' => 'range-numbers',\n 'min' => 5,\n 'max' => 16 \n ),\n 'blood_type' => array(\n 'type' => 'in-list',\n 'list' => array('A+', 'B+', 'O+', 'O-', 'AB+', 'AB-')\n )\n );\n\n $this->operation = 'generate'; // generate | clone\n\n $this->qty = array(0, 3); // quatity of registerswhen $this->operation is generate\n\n $this->withChild = false;\n }",
"abstract public function getCorrespondingMetaData();",
"protected function buildCoreFields(): void\n {\n //====================================================================//\n // Reference\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"increment_id\")\n ->name('Reference')\n ->microData(\"http://schema.org/Invoice\", \"confirmationNumber\")\n ->isReadOnly()\n ->isListed()\n ;\n //====================================================================//\n // Customer Object\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name('Customer')\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isReadOnly()\n ;\n //====================================================================//\n // Customer Email\n $this->fieldsFactory()->create(SPL_T_EMAIL)\n ->identifier(\"customer_email\")\n ->name(\"Email du contact\")\n ->microData(\"http://schema.org/ContactPoint\", \"email\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"created_at\")\n ->name(\"Date\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ->isListed()\n ;\n }",
"public function getExpectedMetadata()\n {\n $metadata = [\n 'name' => null,\n 'class' => __CLASS__,\n 'config' => [],\n 'hash' => 'test',\n 'properties' => [\n 'boolean_property' => [\n 'name' => 'boolean_property',\n 'class' => Boolean::class,\n 'config' => [\n 'default' => true,\n ],\n 'hash' => 'test',\n ],\n 'int_property' => [\n 'name' => 'int_property',\n 'class' => Integer::class,\n 'config' => [\n 'nullable' => false,\n 'default' => 100,\n 'min' => 10,\n 'max' => 1000,\n ],\n 'hash' => 'test',\n ],\n 'string_property' => [\n 'name' => 'string_property',\n 'class' => Str::class,\n 'config' => [],\n 'hash' => 'test',\n ],\n 'generic_property' => [\n 'name' => 'generic_property',\n 'class' => Str::class,\n 'config' => [\n 'default' => 'some value',\n ],\n 'hash' => 'test',\n ],\n 'child_struct_with_explicit_class' => [\n 'name' => 'child_struct_with_explicit_class',\n 'class' => BasicStruct::class,\n 'config' => [],\n 'hash' => 'test',\n ],\n 'child_struct_with_inline_definition' => [\n 'name' => 'child_struct_with_inline_definition',\n 'class' => null,\n 'config' => [],\n 'hash' => 'test',\n 'properties' => [\n 'a' => [\n 'name' => 'a',\n 'class' => Boolean::class,\n 'config' => [],\n 'hash' => 'test',\n ],\n 'b' => [\n 'name' => 'b',\n 'class' => Integer::class,\n 'config' => [],\n 'hash' => 'test',\n ],\n 'c' => [\n 'name' => 'c',\n 'class' => Str::class,\n 'config' => [],\n 'hash' => 'test',\n ],\n 's' => [\n 'name' => 's',\n 'class' => null,\n 'config' => [],\n 'hash' => 'test',\n 'properties' => [\n 'min' => [\n 'name' => 'min',\n 'class' => Integer::class,\n 'config' => [\n 'default' => 0,\n ],\n 'hash' => 'test',\n ],\n 'max' => [\n 'name' => 'max',\n 'class' => Integer::class,\n 'config' => [\n 'default' => 100,\n ],\n 'hash' => 'test',\n ],\n ],\n ],\n ],\n ],\n ],\n ];\n /** @var $child MetadataTestcaseInterface */\n $child = new $metadata['properties']['child_struct_with_explicit_class']['class'];\n $meta = $child->getExpectedMetadata();\n $metadata['properties']['child_struct_with_explicit_class']['properties'] = $meta['properties'];\n return $metadata;\n }",
"protected function build_meta( Meta_Tags_Context $context ) {\n\t\treturn new Meta( $context, $this->container );\n\t}",
"public function initialize()\n {\n // attributes\n $this->setName('meta');\n $this->setPhpName('Meta');\n $this->setIdentifierQuoting(true);\n $this->setClassName('\\\\CE\\\\Model\\\\Meta');\n $this->setPackage('src.CE.Model');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);\n $this->addForeignKey('website_id', 'WebsiteId', 'INTEGER', 'website', 'id', false, null, null);\n $this->addForeignKey('website_routing_id', 'WebsiteRoutingId', 'INTEGER', 'website_routing', 'id', false, null, null);\n $this->addColumn('culture', 'Culture', 'VARCHAR', false, 5, null);\n $this->addColumn('html', 'Html', 'LONGVARCHAR', true, null, null);\n }",
"function __construct(){\n parent::__construct();\n $this->set_primitive_type('string');\n $this->set_core(true);\n $this->set_related_mapped_prop('title');\n $this->set_component('tainacan-text');\n $this->set_name( __('Core Description', 'tainacan') );\n $this->set_description( __('The \"Core Title\" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') );\n }",
"function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ReviewObjectMetadata');\n\t\treturn new ReviewObjectMetadata();\n\t}",
"function __construct () {\n\t\t$this->metaData = Lang::get('metadata');\n\n\t}",
"public function create_child($parent_id, $parent_type, $type, $attribs = array()) {\n \n $endpoint = \"/\" . $parent_type . \"s/\" . $parent_id . \"/\" . $type . \"s/\";\n $data = array(\n \"data\" => array(\n \"type\" => $type,\n \"attributes\" => $attribs,\n ),\n );\n /* in the MM API, create is a POST */\n $payload_json = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n $request_url = $this->base_endpoint . $endpoint;\n $ch = $this->build_curl_handle($request_url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);\n curl_setopt($ch, CURLOPT_HEADER, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload_json);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($payload_json)));\n $result = curl_exec($ch);\n $info = curl_getinfo($ch);\n $errors = curl_error($ch);\n curl_close($ch);\n if (!in_array($info['http_code'], array(200, 201, 202, 204))) {\n $result = $this->make_response_array($result);\n return array(\n 'errors' => array(\n 'info' => $info,\n 'errors' => $errors,\n 'result' => $result,\n ),\n );\n }\n /*\n * A successful request will return a 20x and the location of the created\n * object.\n * We'll follow that location and parse the resulting JSON to return the\n * cid.\n */\n // Get just the URI.\n preg_match(\"/(Location|URI): .*?\\/([a-f0-9\\-]+)\\/(edit\\/)?(\\r|\\n|\\r\\n)/\", $result, $matches);\n \n // TODO: Unsafe indexing, how should errors be handled?\n return $matches[2];\n }",
"function __construct()\n\t{\n\t\t// changes the metaColumnsSQL, adds columns: attnum[6]\n\t}",
"public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }",
"function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }",
"public function __construct() {\n parent::__construct();\n $this->markdown = $this->di['markdown'];\n $this->log = $this->di['log'];\n\n $this->meta['supertype'] = 'post';\n $this->meta['index'] = static::INDEX; // We use static because the INDEX constant is overridden by subclasses.\n $this->meta['visible'] = TRUE;\n\n $this->zRemTags = ($this->isMetadataPresent('tags')) ? Helper\\ArrayHelper::merge($this->meta['tags'], $this->uniqueMasters()->asArray()) : [];\n }",
"public function getMetaData();",
"public function prepareMetaData() {\n if ($this->mt instanceof folksoPageDataMeta) {\n return $this->mt;\n }\n\n if (! $this->ptags instanceof folksoPagetags) {\n $this->ptags = new folksoPagetags($this->loc, $this->url);\n }\n\n\n $this->mt = $this->ptags->buildMeta();\n if (! $this->e13 instanceof folksoEanList) {\n $this->e13 = new folksoEanList($this->loc, $this->url);\n }\n // this is supposed to be a reference. it had better be!\n $this->mt->e13 = $this->e13;\n return $this->mt;\n }",
"function getMetaData()\n {\n $meta = parent::getMetaData();\n\n $meta[\"sum_bankcodes\"] = floatval($this->sum_bankcodes);\n $meta[\"sum_accounts\"] = floatval($this->sum_accounts);\n\n return $meta;\n }",
"protected function __construct() \r\n {\r\n parent::__construct();\r\n // to do: instantiate members representing substructures/blocks\r\n }",
"protected function buildPropertyInfo() {\n }",
"public static function createItemMetaForFile($filename) {\n\t\t$exifData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_ExifParser')->parseExifData($filename);\n\t\t$iptcData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_IptcParser')->parseIptcData($filename);\n\t\t$xmpData = Tx_Yag_Domain_Import_MetaData_XmpParser::parseXmpData($filename);\n\t\t\n\t\t$itemMeta = new Tx_Yag_Domain_Model_ItemMeta();\n\t\t\n\t\t$itemMeta->setExif(serialize($exifData));\n\t\t$itemMeta->setIptc(serialize($iptcData));\n\t\t$itemMeta->setXmp($xmpData);\n\t\t\n\t\t$itemMeta->setAperture($exifData['ApertureValue']);\n\t\t$itemMeta->setArtist($iptcData[\"2#080\"][0]);\n\n\t\t$itemMeta->setArtistMail(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork'));\n\t\t$itemMeta->setArtistWebsite(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork')); \n\t\t$itemMeta->setCameraModel($exifData['Make'] . ' - ' . $exifData['Model']);\n\t\t$itemMeta->setCopyright($iptcData[\"2#116\"][0]);\n\t\t$itemMeta->setDescription($exifData['ImageDescription']);\n\t\t$itemMeta->setFlash($exifData['Flash']);\n\t\t$itemMeta->setFocalLength($exifData['FocalLength']);\n\n\t\t$itemMeta->setCaptureDate(new DateTime('@' . $exifData['CaptureTimeStamp']));\n\n\t\t//$itemMeta->setGpsLatitude(); // not available yet\n\t\t//$itemMeta->setGpsLongitude(); // not available yet\n\t\t$itemMeta->setIso($exifData['ISOSpeedRatings']); \n\t\tif(is_array($iptcData['2#025'])) $itemMeta->setKeywords(implode(',', $iptcData['2#025']));\n\t\t$itemMeta->setLens(self::getXmpValueByKey($xmpData, 'aux\\:Lens'));\n\n\t\t$itemMeta->setShutterSpeed($exifData['ShutterSpeedValue']);\n\t\t\n\t\treturn $itemMeta;\n\t}",
"private function buildClassMeta()\n {\n // Search meta informations before going to reflection and then, ast parsing\n foreach ($this->data as $line) {\n $line = trim($line);\n\n // Namespace search\n if (preg_match(self::NAMESPACE_PATTERN, $line, $matches) === 1) {\n $this->context->setCurrentNamespace(trim($matches[1]));\n continue;\n }\n\n // Class name\n if (preg_match(self::DEFINITION_PATTERN, $line, $matches) === 1) {\n $this->context->setClassName(trim($matches[1]));\n break; // Stop after class found, let the reflection do the next job\n }\n\n // Uses\n if (preg_match(self::USE_PATTERN, $line, $matches) === 1) {\n $this->context->addUse($matches[1]);\n continue;\n }\n }\n }",
"protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}",
"private function createMetadataDefinition()\n {\n $id = $this->getServiceId('metadata');\n if (!$this->container->has($id)) {\n $definition = new Definition(self::CLASS_METADATA);\n $definition\n ->setFactory([new Reference($this->getManagerServiceId()), 'getClassMetadata'])\n ->setArguments([\n $this->container->getParameter($this->getServiceId('class'))\n ])//->setPublic(false)\n ;\n $this->container->setDefinition($id, $definition);\n }\n }"
]
| [
"0.567669",
"0.5510086",
"0.5461526",
"0.5387138",
"0.5335656",
"0.5255159",
"0.523913",
"0.5226158",
"0.5194192",
"0.512243",
"0.50792414",
"0.50393987",
"0.5038989",
"0.5034832",
"0.5030249",
"0.500522",
"0.49840537",
"0.49736506",
"0.49599114",
"0.49376437",
"0.4926684",
"0.49050832",
"0.48933735",
"0.48875946",
"0.48805034",
"0.48577273",
"0.484878",
"0.48194262",
"0.48043573",
"0.48036766"
]
| 0.69656223 | 0 |
Indicate whether the renderer is capable of rendering trees of view models | public function canRenderTrees(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canRenderTrees()\n {\n return $this->__renderTrees;\n }",
"public function getRenderParents(): bool;",
"public function __isMainTree()\n\t{\n\t\treturn $this->table_tree === 'tree';\n\t}",
"public function supportsTermHierarchyDesign() {\n \treturn $this->manager->supportsTermHierarchyDesign();\n\t}",
"public function isRendered(): bool\n {\n if (true === $this->rendered || 0 === \\count($this->children)) {\n return $this->rendered;\n }\n\n foreach ($this->children as $child) {\n if (!$child->isRendered()) {\n return false;\n }\n }\n\n return $this->rendered = true;\n }",
"public function should_render() {\n\t\t\t\treturn is_singular();\n\t\t\t}",
"public function isViewModeTeaser() {\n return $this->isViewMode(CoreEntityManager::VIEW_MODE_NODE_TEASER);\n }",
"protected function shouldRender()\n {\n return true;\n }",
"public function hasRenderingType()\n {\n return $this->RenderingType !== null;\n }",
"public function supportsTermHierarchy() {\n \treturn $this->manager->supportsTermHierarchy();\n\t}",
"function _outputTree () {\r\n // this could e.g. call _applyPostfilters\r\n return true;\r\n }",
"public function viewCanBeRendered()\r\n {\r\n return true;\r\n }",
"public function hasView()\n {\n return false;\n }",
"public function hasView() {\n\t\treturn is_object($this->view);\n\t}",
"public function getIsShowChildren();",
"public function isRendering()\n {\n return $this->_is_rendering;\n }",
"public function getIsShowChildrenDefault();",
"protected function _needsRenderer()\n {\n $types = $this->getRequest()->getAcceptTypes();\n $htmlPos = array_search(Clockworkgeek_Extrarestful_Model_Api2_Block_Renderer::MIME_TYPE, $types);\n if ($htmlPos !== false) {\n /** @var $helper Mage_Api2_Helper_Data */\n $helper = Mage::helper('api2');\n $adapters = $helper->getResponseRenderAdapters();\n foreach ($adapters as $item) {\n $typePos = array_search($item->type, $types);\n if ($typePos < $htmlPos) {\n return false;\n }\n }\n return true;\n }\n return false;\n }",
"function show_tree(){\n\t\t\t\t\tswitch(LINK_TYPE){\n\t\t\t\t\t\tcase \"static\":\n\t\t\t\t\t\t\treturn $this->show_tree_static();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"burc\":\n\t\t\t\t\t\tcase \"dynamic\":\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn $this->show_tree_dynamic();\n\t\t\t\t\t}\n\t\t\t\t}",
"public function shouldRender()\n {\n if ($this->totalPages > 1) {\n \n return true;\n }\n \n return false;\n }",
"public function supportsTopicHierarchyDesign() {\n \treturn $this->manager->supportsTopicHierarchyDesign();\n\t}",
"public function hasViewModel()\n {\n return $this->viewModel ? true : false;\n }",
"public function supportsCourseCatalogHierarchyDesign() {\n \treturn $this->manager->supportsCourseCatalogHierarchyDesign();\n\t}",
"public function WantsChildren() {\r\n return false;\r\n }",
"private function executeControl()\n {\n if (!Doctrine_Core::getTable($this->model)->isTree())\n {\n throw new Exception('Model \"'.$this->model.'\" is not a NestedSet');\n return false;\n }\n return true;\n }",
"function isChildren()\n {\n return count($this->children)>0;\n }",
"public function hasAdvisorTree() {\n return sizeof($this->advisorTree) > 0;\n }",
"public function shouldShow()\n {\n return $this->_checkClass();\n }",
"public function viewAny()\n {\n return true;\n }",
"public function isViewModeFull() {\n return $this->isViewMode(CoreEntityManager::VIEW_MODE_NODE_FULL);\n }"
]
| [
"0.81133866",
"0.64701277",
"0.645384",
"0.6410741",
"0.6356743",
"0.62417096",
"0.62353307",
"0.6232864",
"0.61393833",
"0.6110469",
"0.6077327",
"0.60456336",
"0.6043103",
"0.60351473",
"0.5987362",
"0.5853956",
"0.58505553",
"0.5846714",
"0.5837995",
"0.5805964",
"0.5783515",
"0.57565063",
"0.5718997",
"0.57173115",
"0.5685599",
"0.5680569",
"0.56638014",
"0.56513864",
"0.5646859",
"0.56430686"
]
| 0.8186635 | 0 |
Sets the serialization max depth for this attribute. | public function setMaxDepth(?int $maxDepth): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMaxComponentDepth($value) {}",
"public function setMaxDepth($depth)\n {\n if ($depth === null) {\n $this->maxDepth = null;\n\n return $this;\n }\n\n if (!is_integer($depth)) {\n throw new InvalidArgumentException('The depth must be an integer.');\n }\n\n if ($depth < 0) {\n $depth = -1;\n }\n\n $this->maxDepth = $depth;\n\n return $this;\n }",
"function setDepth($depth){\n\t\t$this->depth = $depth;\n\t}",
"public function setDepth($depth) {\n\t\t$this->depth = $depth;\n\t}",
"public function setDepth($depth)\n {\n $this->depth = $depth;\n }",
"public function setDepth($depth)\n {\n $this->depth = $depth;\n }",
"public function setDepth($depth) {\n\t $this->d = $depth;\n }",
"public function withDepthMaximum(PositiveInteger $depthMaximum): static;",
"public function depth($value) {\n return $this->setProperty('depth', $value);\n }",
"public static function setMaxDepth($maxDepth) : void\n {\n $maxDepth = (int)$maxDepth;\n \n if (static::getDepth() > $maxDepth) {\n static::$stack = array_slice(static::$stack, 0, $maxDepth);\n }//end if\n \n }",
"public function reSetDepth()\n\t{\t\t\n\t\tif ($this->getParentId() !== 0 && $this->getParentId() != null)\n\t\t{\n\t\t\t$parentCat = $this->getParentCategory();\n\t\t\t$this->setDepth($parentCat->getDepth() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setDepth(0);\n\t\t}\n\t}",
"public function setDepth($depth) {\n $depth = (int) $depth;\n\n if (!isset($depth) || $depth == \"\") {\n $depth = \"0\";\n }\n $this->fields[\"depth\"] = $depth;\n\n return $this;\n }",
"public function maxDepth()\n {\n if ($this->maxDepth === null) {\n return static::DEFAULT_MAX_DEPTH;\n }\n\n return $this->maxDepth;\n }",
"public function maxDepth(int $maxDepth) : self\n {\n $this->maxDepth = $maxDepth;\n\n return $this;\n }",
"public function setMaxRecursionDepth($maxRecursionDepth) {\n\t\t$this->_maxRecursionDepth = $maxRecursionDepth;\n\t}",
"public function getMaxComponentDepth() {}",
"public function setMax($max) {\n\t\t$this->attributes['max'] = $max;\n\t\t$this->max = $max;\n\t\treturn $this;\n\t}",
"public static function setMaximumDepthLevelAllowedAtLeast($atLeastLevel)\n {\n self::$maximumDepthLevelAllowed = max($atLeastLevel, self::$maximumDepthLevelAllowed);\n if (self::$maximumDepthLevelAllowed < 1) {\n self::$maximumDepthLevelAllowed = 1;\n }\n }",
"public function getDepthMaximum(): PositiveInteger;",
"public function getMaxNesting()\n {\n return $this->maxNesting;\n }",
"public static function setMaxGraphicStateNestingLevel($maxGraphicStateNestingLevel) {}",
"public function setMaxQueryDepth($maxQueryDepth)\n {\n }",
"public function setDepth($depth)\n {\n $this->depth = $depth;\n\n return $this;\n }",
"public function setMaximum(?Json $value): void {\n $this->getBackingStore()->set('maximum', $value);\n }",
"public function getDepthAttribute()\n {\n $count = 0;\n $parent = $this->parent;\n while ($parent)\n {\n $count += 1;\n $parent = $parent->parent;\n }\n return $count;\n }",
"public function setDepth(int $depth): Indexer {\n $this->depth = $depth;\n return $this;\n }",
"function SetOrder($aDepth) {\n\t$this->depth=$aDepth;\n }",
"public function getDepth()\n {\n return $this->depth;\n }",
"public function getDepth()\n {\n return $this->depth;\n }",
"public function getDepth()\n {\n return $this->depth;\n }"
]
| [
"0.6639622",
"0.6361039",
"0.62467736",
"0.6232355",
"0.6131402",
"0.6131402",
"0.60980314",
"0.60460913",
"0.5927813",
"0.59007704",
"0.58958656",
"0.58538795",
"0.5822494",
"0.56646305",
"0.5612565",
"0.5511419",
"0.53916585",
"0.5294469",
"0.5255898",
"0.5224857",
"0.52176195",
"0.5215654",
"0.5199655",
"0.51916826",
"0.51708126",
"0.5138228",
"0.505927",
"0.50368553",
"0.50368553",
"0.50368553"
]
| 0.67978823 | 0 |
Gets all the normalization contexts per group ("" being the base context applied to all groups). | public function getNormalizationContexts(): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNormalizationContextForGroups(array $groups): array;",
"public function getDenormalizationContextForGroups(array $groups): array;",
"public function getDenormalizationContexts(): array;",
"public function getContexts();",
"public function setNormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getNormalizationContext(): array\n {\n return [\n self::ACTION => $this->getAction(),\n self::VERSION => $this->getVersion(),\n self::REQUEST_TYPE => $this->getRequestType(),\n 'sharedData' => $this->getSharedData()\n ];\n }",
"public function getContexts() {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function setDenormalizationContextForGroups(array $context, array $groups = []): void;",
"private function appEntityNormalizers(): array\n {\n return [\n new CredentialProductDenormalizer(),\n new CredentialProductNormalizer(),\n new AttributesPropertyDenormalizer(),\n new AppCredentialNormalizer(),\n new AppDenormalizer(),\n ];\n }",
"public function getContexts() : array\n {\n return $this->contexts;\n }",
"function getContextSets()\n {\n return $this->_contextSets;\n }",
"protected function _cleanContexts(){\n\n //remove no more present contexts\n foreach( $this->_destroyContext as $_context ){\n\n self::_TimeStampMsg( \"(parent \" . self::$tHandlerPID . \") : need to delete a context\" );\n $this->_killPids( $_context );\n\n }\n $this->_destroyContext = array();\n\n }",
"public function getOperatingContexts();",
"public function getNormalization()\r\n {\r\n return $this->normalization;\r\n }",
"protected function getContexts() {\n return $this->configContexts->get();\n }",
"function ac_skin_get_all_group_styles($reset = FALSE) {\n $skin_settings = &drupal_static(__FUNCTION__, array());\n\n $settings = ac_skin_get_theme_skin_items();\n foreach($settings as $group => $def) {\n\tif (is_array($def)) {\n\t // load group def file\n\t ac_skin_load_skin_group_file($group);\n\n\t $styles_func = $def['styles callback'];\n\t if (function_exists($styles_func)) {\n\t\t$skin_settings[$group] = $styles_func();\n\t }\n\t}\n }\n\n return $skin_settings;\n}",
"public static function getAllGroups()\n {\n return ValveGroup::all();\n }",
"public function getContext(bool $merge = true): array;",
"function miscapps_contexts() {\n\t// return an associative array with context and description\n\tforeach (miscapps_list() as $row) {\n\t\t$contexts[] = array(\n\t\t\t'context' => 'app-miscapps-'.$row['miscapps_id'], \n\t\t\t'description'=> 'Misc Application: '.$row['description'],\n\t\t\t'source' => 'Misc Applications',\n\t\t);\n\t}\n\treturn $contexts;\n}",
"public function getRawGroups()\n {\n if (!empty($this->rawGroups)) {\n return $this->rawGroups;\n }\n if ($this->enableCache && isset($this->cache)) {\n if (($data = $this->cache->get(static::className())) !== false) {\n list($rawGroups, $aliases) = $data;\n Alias::setAliases($this->prepareAliases($aliases), false);\n $rawGroups = $this->calculateCacheGroups($rawGroups, $this->groups);\n return $this->rawGroups = $rawGroups;\n }\n }\n list($rawGroups, $aliases) = $this->normalizeGroups($this->groups);\n if ($this->enableCache && isset($this->cache)) {\n $this->cache->set(static::className(), [$this->normalizeCacheGroups($rawGroups), $aliases]);\n }\n return $this->rawGroups = $rawGroups;\n }",
"public function getGroupFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupFuncs;\n\t}",
"function getAllGroupApplies() {\n return getALL('SELECT mga.*,\n m.name AS member_name,\n g.group_name\n FROM member_group_apply mga\n JOIN `member` m\n ON m.id = mga.member_id\n join `group` g\n on mga.group_id = g.id');\n}",
"public function getContext() : array;",
"function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }",
"public function getContext(): array\n {\n $context = [];\n\n if ($this->category !== null) {\n $context['category'] = $this->category;\n }\n\n if ($this->trace !== null) {\n $context['trace'] = $this->trace;\n }\n\n if ($this->memory !== null) {\n $context['memory'] = $this->memory;\n }\n\n if ($this->exception !== null) {\n $context['exception'] = $this->exception;\n }\n\n return $context;\n }",
"function ac_skin_get_group_styles($group) {\n $styles = ac_skin_get_all_group_styles();\n if (isset($styles[$group])) {\n\treturn $styles[$group];\n }else{\n\treturn array();\n }\n}",
"function getAllGroups() {\n return getAll(\"SELECT * FROM `group`\");\n}",
"public function getContext(): array;"
]
| [
"0.7066151",
"0.6497781",
"0.63671035",
"0.56504685",
"0.5646797",
"0.5425137",
"0.5327526",
"0.530681",
"0.530681",
"0.52755195",
"0.5192234",
"0.5072104",
"0.49970007",
"0.49198693",
"0.49066877",
"0.48944038",
"0.48228815",
"0.4817542",
"0.47822222",
"0.4743921",
"0.472406",
"0.4639494",
"0.46237943",
"0.4612999",
"0.46038654",
"0.457824",
"0.4567948",
"0.4561066",
"0.45587713",
"0.45063964"
]
| 0.68633336 | 1 |
Gets the computed normalization contexts for given groups. | public function getNormalizationContextForGroups(array $groups): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDenormalizationContextForGroups(array $groups): array;",
"public function getNormalizationContexts(): array;",
"public function setNormalizationContextForGroups(array $context, array $groups = []): void;",
"public function setDenormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getDenormalizationContexts(): array;",
"public function getNormalizationContext(): array\n {\n return [\n self::ACTION => $this->getAction(),\n self::VERSION => $this->getVersion(),\n self::REQUEST_TYPE => $this->getRequestType(),\n 'sharedData' => $this->getSharedData()\n ];\n }",
"public function getContexts();",
"private function appEntityNormalizers(): array\n {\n return [\n new CredentialProductDenormalizer(),\n new CredentialProductNormalizer(),\n new AttributesPropertyDenormalizer(),\n new AppCredentialNormalizer(),\n new AppDenormalizer(),\n ];\n }",
"function _acf_apply_get_local_field_groups($groups = array())\n{\n}",
"public function getNormalization()\r\n {\r\n return $this->normalization;\r\n }",
"public function getValidators($groups = 'default')\n {\n $validators = [];\n $ids = array_merge(array_keys($this->vs), array_keys($this->controls));\n if ($groups == '*')\n {\n foreach ($ids as $id)\n {\n $vs = $this->getActualVS($id);\n if ($vs && $vs['properties']['visible'] && is_subclass_of($vs['class'], 'ClickBlocks\\Web\\POM\\Validator') && empty($vs['attributes']['locked'])) \n {\n $validators[] = $this->get($id);\n }\n }\n }\n else\n {\n $groups = array_map('trim', explode(',', $groups));\n foreach ($ids as $id)\n {\n $vs = $this->getActualVS($id);\n if ($vs && $vs['properties']['visible'] && is_subclass_of($vs['class'], 'ClickBlocks\\Web\\POM\\Validator') && empty($vs['attributes']['locked'])) \n {\n $group = isset($vs['attributes']['groups']) ? $vs['attributes']['groups'] : 'default';\n foreach ($groups as $grp)\n {\n if (preg_match('/,\\s*' . preg_quote($grp) . '\\s*,/', ',' . $group . ','))\n {\n $validators[] = $this->get($id);\n break;\n }\n }\n }\n }\n }\n return $validators;\n }",
"function ac_skin_get_group_styles($group) {\n $styles = ac_skin_get_all_group_styles();\n if (isset($styles[$group])) {\n\treturn $styles[$group];\n }else{\n\treturn array();\n }\n}",
"public function getContexts() {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getProductAttributesGroups()\n {\n $colors = array();\n $groups = array();\n $combinations = array();\n\n $attributes_groups = $this->product->getAttributesGroups($this->context->language->id);\n\n if (is_array($attributes_groups) && $attributes_groups) {\n foreach ($attributes_groups as $row) {\n // Color management\n if (isset($row['is_color_group'])\n && $row['is_color_group']\n && (isset($row['attribute_color']) && $row['attribute_color'])\n || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) {\n $colors[$row['id_attribute']]['value'] = $row['attribute_color'];\n $colors[$row['id_attribute']]['name'] = $row['attribute_name'];\n if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) {\n $colors[$row['id_attribute']]['attributes_quantity'] = 0;\n }\n $colors[$row['id_attribute']]['attributes_quantity'] += (int)$row['quantity'];\n }\n if (!isset($groups[$row['id_attribute_group']])) {\n $groups[$row['id_attribute_group']] = array(\n 'group_name' => $row['group_name'],\n 'name' => $row['public_group_name'],\n 'group_type' => $row['group_type'],\n 'default' => -1,\n );\n }\n\n $attr_g = $row['id_attribute_group'];\n $groups[$attr_g]['attributes'][$row['id_attribute']] = $row['attribute_name'];\n if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {\n $groups[$row['id_attribute_group']]['default'] = (int)$row['id_attribute'];\n }\n if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {\n $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;\n }\n $r_attr = $row['id_attribute_group'];\n $groups[$r_attr]['attributes_quantity'][$row['id_attribute']] += (int)$row['quantity'];\n\n $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute'];\n\n //calculate full price for combination\n $priceDisplay = Product::getTaxCalculationMethod(0); //(int)$this->context->cookie->id_customer\n if (!$priceDisplay || $priceDisplay == 2) {\n $combination_price = $this->product->getPrice(true, $row['id_product_attribute']);\n } else {\n $combination_price = $this->product->getPrice(false, $row['id_product_attribute']);\n }\n $combinations[$row['id_product_attribute']]['price'] = $this->formatPrice($combination_price);\n $combinations[$row['id_product_attribute']]['float_price'] = $combination_price;\n $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity'];\n $combinations[$row['id_product_attribute']]['minimal_quantity'] = (int)$row['minimal_quantity'];\n }\n\n // wash attributes list (if some attributes are unavailables and if allowed to wash it)\n if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock)\n && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {\n foreach ($groups as &$group) {\n foreach ($group['attributes_quantity'] as $key => &$quantity) {\n if ($quantity <= 0) {\n unset($group['attributes'][$key]);\n }\n }\n }\n\n foreach ($colors as $key => $color) {\n if ($color['attributes_quantity'] <= 0) {\n unset($colors[$key]);\n }\n }\n }\n foreach ($combinations as $id_product_attribute => $comb) {\n $attribute_list = '';\n foreach ($comb['attributes'] as $id_attribute) {\n $attribute_list .= '\\'' . (int)$id_attribute . '\\',';\n }\n $attribute_list = rtrim($attribute_list, ',');\n $combinations[$id_product_attribute]['list'] = $attribute_list;\n }\n }\n\n return array(\n 'groups' => $groups,\n 'colors' => (count($colors)) ? $colors : false,\n 'combinations' => $combinations\n );\n }",
"private function ldap_get_group_members_rfc($groupfilter) {\n global $CFG;\n\n $ret = array();\n $ldapconnection = $this->ldap_connect();\n\n if (!$ldapconnection) {\n return $ret;\n }\n\n $queryg = \"(&({$this->config['syncgroupsgroupattribute']}=\" . $this->filter_addslashes(trim($groupfilter)) . \")(objectClass={$this->config['syncgroupsgroupclass']}))\";\n $contexts = $this->get_group_contexts();\n\n foreach ($contexts as $context) {\n $context = trim($context);\n if (empty ($context)) {\n continue;\n }\n\n if ($this->config['syncgroupssearchsub'] == 'yes') {\n $resultg = ldap_search($ldapconnection, $context, $queryg);\n }\n else {\n $resultg = ldap_list($ldapconnection, $context, $queryg);\n }\n\n if ($resultg !== false && ldap_count_entries($ldapconnection, $resultg)) {\n $group = ldap_get_entries($ldapconnection, $resultg);\n\n for ($g = 0; $g < (count($group[0][strtolower($this->config['syncgroupsmemberattribute'])]) - 1); $g++) {\n\n $member = trim($group[0][strtolower($this->config['syncgroupsmemberattribute'])][$g]);\n if (empty($member)) {\n continue;\n }\n if (!$this->config['syncgroupsmemberattributeisdn']) {\n // member attribute is the username, not a DN\n $ret[] = $member;\n }\n else {\n // member attribute is a DN.\n // Check to see if the member is actually a nested group\n if ($this->config['syncgroupsnestedgroups'] && ($group_cn = $this->is_ldap_group($member))) {\n // in case of funny directory where groups are member of groups\n if (array_key_exists($member, $this->anti_recursion_array)) {\n unset($this->anti_recursion_array[$member]);\n continue;\n }\n\n //recursive call\n // TODO: Better to set the recursion end point by passing this in as a parameter...\n $this->anti_recursion_array[$member] = 1;\n $tmp = $this->ldap_get_group_members_rfc($group_cn);\n unset($this->anti_recursion_array[$member]);\n $ret = array_merge($ret,$tmp);\n }\n // The \"member\" node is a member DN. Extract the username and return it.\n else {\n $member = $this->get_username_from_dn($member);\n if ($member) {\n $ret[] = $member;\n }\n }\n }\n }\n }\n }\n\n $this->ldap_close($ldapconnection);\n return $ret;\n }",
"public function getGroupsFromDatabase() {\n $db = \\Helper::getDB();\n $db->join('groups g', 'gd.groupId = g.id', 'LEFT');\n $db->where('gd.documentId', $db->escape($this->getId()));\n $groups = $db->get('group_documents gd', NULL, 'g.*');\n $this->groups = array();\n\n // Process all groups\n foreach($groups as $group) {\n $newGroup = new \\Models\\Group($group['id'], $group['name']);\n $this->addGroup($newGroup);\n }\n }",
"function get_multi( $groups ) {\n\t\t$return = array();\n\t\tforeach ( $groups as $group => $ids ) {\n\t\t\t$mc =& $this->get_mc( $group );\n\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t$key = $this->key( $id, $group );\n\t\t\t\tif ( isset( $this->cache[$key] ) ) {\n\t\t\t\t\tif ( is_object( $this->cache[$key] ) )\n\t\t\t\t\t\t$return[$key] = clone $this->cache[$key];\n\t\t\t\t\telse\n\t\t\t\t\t\t$return[$key] = $this->cache[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if ( in_array( $group, $this->no_mc_groups ) ) {\n\t\t\t\t\t$return[$key] = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t$return[$key] = $mc->get( $key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $to_get ) {\n\t\t\t\t$vals = $mc->get_multi( $to_get );\n\t\t\t\t$return = array_merge( $return, $vals );\n\t\t\t}\n\t\t}\n\t\t@ ++$this->stats['get_multi'];\n\t\t$this->group_ops[$group][] = \"get_multi $id\";\n\t\t$this->cache = array_merge( $this->cache, $return );\n\t\treturn $return;\n\t}",
"public function getGroupFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupFuncs;\n\t}",
"public function getActualActionGroups()\n {\n $actionGroupIds = $this->getActionGroupIds();\n $actualActionProductIds = $this->getActualActionProducts()->select('id')->column();\n\n $query = Group::find()\n ->orderBy(['{{%sales_groups}}.name' => SORT_ASC]);\n\n if (empty($actualActionProductIds)) {\n return $query->andWhere('1=0');\n }\n\n $query\n ->joinWith('products', false)\n ->andWhere(['IN', '{{%sales_products}}.id', $actualActionProductIds])\n ->distinct('{{%sales_groups}}.id');\n\n if ($actionGroupIds) {\n $query->where(['IN', '{{%sales_groups}}.id', $actionGroupIds]);\n }\n\n return $query;\n }",
"public function saveGroups($groups)\n {\n foreach ($groups as $group) {\n $proposer = $group->getSubject(self::$PROPOSER_ROLE_ID);\n $receiver = $group->getSubject(self::$RECEIVER_ROLE_ID);\n\n $proposerGroup = new DictatorGroup();\n $proposerGroup->setSubjectId($proposer->getId());\n $proposerGroup->setSubjectRole(self::$PROPOSER_ROLE_ID);\n $proposerGroup->setPartnerId($receiver->getId());\n $proposerGroup->setPartnerRole(self::$RECEIVER_ROLE_ID);\n $proposerGroup->save();\n\n $receiverGroup = new DictatorGroup();\n $receiverGroup->setSubjectId($receiver->getId());\n $receiverGroup->setSubjectRole(self::$RECEIVER_ROLE_ID);\n $receiverGroup->setPartnerId($proposer->getId());\n $receiverGroup->setPartnerRole(self::$PROPOSER_ROLE_ID);\n $receiverGroup->save();\n }\n }",
"public static function lemmaContext($lemma_id) {\n $sentence_list = // array of sentences [text of sentence, wordforms joined with comma)\n $lemma_strings = // array of pairs lemma_id=>lemma_lemma\n $context_lemmas = []; // array of pairs lemma_id=>frequency in the context set\n \n $wordform_list = [];\n $wordforms = Wordform::whereIn('id',function($q) use ($lemma_id){\n $q->select('wordform_id')\n ->from('lemma_wordform')\n ->where('lemma_id',$lemma_id);\n })->get();\n foreach ($wordforms as $wordform) {\n $wordform_list[$wordform->id] = $wordform-> wordform;\n foreach ($wordform->sentences as $sentence) {\n $sentence_list[$sentence->id]['sentence'] = $sentence->sentence;\n $sentence_list[$sentence->id]['wordforms'][$wordform->id] = $wordform-> wordform;\n\n foreach($sentence->wordforms as $w) {\n foreach ($w->lemmas as $lemma) {\n if ($lemma->id != $lemma_id) {\n $lemma_strings[$lemma->id] = $lemma->lemma;\n if (isset($context_lemmas[$lemma->id])) {\n $context_lemmas[$lemma->id] +=1;\n } else {\n $context_lemmas[$lemma->id] =1; \n }\n }\n }\n }\n }\n } \n arsort($context_lemmas); \n \n return [$sentence_list,$context_lemmas, $lemma_strings];\n }",
"public function getRawGroups()\n {\n if (!empty($this->rawGroups)) {\n return $this->rawGroups;\n }\n if ($this->enableCache && isset($this->cache)) {\n if (($data = $this->cache->get(static::className())) !== false) {\n list($rawGroups, $aliases) = $data;\n Alias::setAliases($this->prepareAliases($aliases), false);\n $rawGroups = $this->calculateCacheGroups($rawGroups, $this->groups);\n return $this->rawGroups = $rawGroups;\n }\n }\n list($rawGroups, $aliases) = $this->normalizeGroups($this->groups);\n if ($this->enableCache && isset($this->cache)) {\n $this->cache->set(static::className(), [$this->normalizeCacheGroups($rawGroups), $aliases]);\n }\n return $this->rawGroups = $rawGroups;\n }",
"protected function getGroupsForMatchmaker($groups)\n {\n return array_values(array_filter($groups, function ($group) {\n return $group;\n }));\n }",
"function ac_skin_get_all_group_styles($reset = FALSE) {\n $skin_settings = &drupal_static(__FUNCTION__, array());\n\n $settings = ac_skin_get_theme_skin_items();\n foreach($settings as $group => $def) {\n\tif (is_array($def)) {\n\t // load group def file\n\t ac_skin_load_skin_group_file($group);\n\n\t $styles_func = $def['styles callback'];\n\t if (function_exists($styles_func)) {\n\t\t$skin_settings[$group] = $styles_func();\n\t }\n\t}\n }\n\n return $skin_settings;\n}",
"public function get_group_discounts()\r\n\t{\r\n\t\t// Check the discount tables exist in the config file and are enabled.\r\n\t\tif ($this->get_enabled_status('discounts'))\r\n\t\t{\r\n\t\t\t// Set aliases of discount table data.\r\n\t\t\t$tbl_cols_discounts = $this->flexi->cart_database['discounts']['columns'];\r\n\t\t\t$tbl_cols_group_discounts = $this->flexi->cart_database['discount_groups']['columns'];\r\n\t\t\t$tbl_cols_group_item_discounts = $this->flexi->cart_database['discount_group_items']['columns'];\r\n\t\t\r\n\t\t\t$sql_select = array(\r\n\t\t\t\t$tbl_cols_group_item_discounts['item'].' AS item_id',\r\n\t\t\t\t$tbl_cols_discounts['group'].' AS group_id'\r\n\t\t\t);\r\n\r\n\t\t\t// Lookup item id from item data array and add to SQL WHERE string\r\n\t\t\t$sql_where = ' AND ('.$tbl_cols_group_item_discounts['item'].' IN (';\r\n\t\t\tforeach($this->flexi->cart_contents['items'] as $item)\r\n\t\t\t{\r\n\t\t\t\t$sql_where .= $item[$this->flexi->cart_columns['item_id']].',';\r\n\t\t\t}\r\n\t\t\t$sql_where = rtrim($sql_where,',').') AND '.$tbl_cols_group_discounts['status'].' = 1)';\r\n\t\t\t\r\n\t\t\tif ($group_item_discount_data = $this->get_database_discount_data($sql_select, $sql_where, 'group_discounts'))\r\n\t\t\t{\r\n\t\t\t\treturn $this->sort_discount_data($group_item_discount_data);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"public function ADStaff_Get_Group_List(){\n\t \n\t $result_key = parent::Initial_Result('groups');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t\t// 查詢資料庫\n\t\t$DB_OBJ = $this->DBLink->prepare(parent::SQL_Permission_Filter(SQL_AdStaff::SELECT_GROUP_LIST()));\n\t\tif(!$DB_OBJ->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t$groups = $DB_OBJ->fetchAll(PDO::FETCH_ASSOC);\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $groups;\t\t\n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}",
"protected function _cleanContexts(){\n\n //remove no more present contexts\n foreach( $this->_destroyContext as $_context ){\n\n self::_TimeStampMsg( \"(parent \" . self::$tHandlerPID . \") : need to delete a context\" );\n $this->_killPids( $_context );\n\n }\n $this->_destroyContext = array();\n\n }",
"static public function getPhraseByGroup ($key, $group) {\n Assert::isString($key);\n Assert::isString($group, TRUE);\n \n /**\n * If no drivers have been loaded yet, the chances are that the application hasn't finished\n * booting yet or literals aren't in use\n */\n if (self::$_initialised == FALSE) {\n return $key;\n }\n\n $culture = Culture_Info::current();\n\n if (self::cultureExists($culture) == FALSE) {\n throw new Exception(\"Culture does not exist\");\n }\n\n $arguments = func_get_args();\n\n // Look in the current/selected language\n foreach (self::$_cultureDrivers[$culture] as $driver) {\n if (call_user_func_array(array($driver, 'phraseExists'), $arguments) == TRUE) {\n return call_user_func_array(array($driver, 'getPhrase'), $arguments);\n }\n }\n\n // Look in the invariant language\n foreach (self::$_cultureDrivers[Culture_Info::invariantCulture] as $driver) {\n if (call_user_func_array(array($driver, 'phraseExists'), $arguments) == TRUE) {\n return call_user_func_array(array($driver, 'getPhrase'), $arguments);\n }\n }\n\n return $key;\n }"
]
| [
"0.7304307",
"0.6099826",
"0.59139836",
"0.5495448",
"0.53455555",
"0.47453034",
"0.46126696",
"0.45308113",
"0.44227195",
"0.4382518",
"0.43744487",
"0.42646965",
"0.4196143",
"0.4189175",
"0.4189175",
"0.4175185",
"0.4109515",
"0.41087556",
"0.41074908",
"0.410084",
"0.40814477",
"0.40455136",
"0.40391332",
"0.3971849",
"0.39681068",
"0.39325616",
"0.39259654",
"0.39256153",
"0.39151788",
"0.39078194"
]
| 0.80325735 | 0 |
Sets the normalization context for given groups. | public function setNormalizationContextForGroups(array $context, array $groups = []): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDenormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getNormalizationContextForGroups(array $groups): array;",
"public function getDenormalizationContextForGroups(array $groups): array;",
"function setGroups($groups) {\n if (is_array($groups)) {\n $groups = implode(',', $groups);\n }\n $this->groups = $groups;\n }",
"public function setGroups($groups);",
"public function set(array $groups)\n {\n $this->groups = $groups;\n }",
"public function set($model, $attribute, $groups)\n {\n \n }",
"function set_groups($groups) {\n\t\tif ($this->get_fixedgroups())\n\t\t\tthrow new LGIPortalException(\"Cannot change groups for this user, certificate does not allow it.\");\n\t\tlgi_mysql_query(\"DELETE FROM %t(usergroups) WHERE `usercertid`=(SELECT `id` FROM %t(usercerts) WHERE `user`='%%')\", $this->userid);\n\t\tforeach ($groups as $g)\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(usergroups) SET `usercertid`=(SELECT `id` FROM %t(usercerts) WHERE `user`='%%'), `name`='%%'\", $this->userid, $g);\n\t\t$_SESSION['groups'] = implode(',', $groups);\n\t}",
"public function setNormalization($normalization)\r\n {\r\n $this->normalization = (int) $normalization;\r\n\r\n return $this;\r\n }",
"public function setGroup($group) {}",
"public function setGroup($group) {}",
"protected function processNormalization(NormalizeValueContext $context): void\n {\n $value = $context->getResult();\n if (null !== $value && $this->isValueNormalizationRequired($value)) {\n if ($context->isRangeAllowed() && str_contains($value, $context->getRangeDelimiter())) {\n $context->setResult($this->normalizeRangeValue($value, $context->getRangeDelimiter()));\n } elseif ($context->isArrayAllowed()) {\n $context->setResult($this->normalizeArrayValue($value, $context->getArrayDelimiter()));\n } else {\n $this->validateValue($value);\n $context->setResult($this->normalizeValue($value));\n }\n }\n $context->setProcessed(true);\n }",
"public function getNormalizationContexts(): array;",
"public function set($model, $attribute, $groups)\n { \n $model::saved(function ($model) use ($groups) {\n $model->combinations()->get()->each->delete();\n\n $groups->map->getAttributes()->map(function($layout) {\n return tap($layout, function(&$layout) {\n $layout['attributes'] = json_decode($layout['attributes'] ?? '[]', true);\n }); \n })->each(function($attributes) use ($model) { \n if (isset($attributes['attributes']) && ! empty($attributes['attributes'])) {\n\n $combination = $model->combinations()->create($attributes);\n $combination->attributes()->sync($attributes['attributes']); \n\n } \n }); \n });\n \n }",
"public function setGroups($groups)\n {\n $this->data['groups'] = $groups;\n return $this;\n }",
"public function attachGroups($groups);",
"public function assignGroup($groups): self\n {\n $groups = collect(is_array($groups) || $groups instanceof Collection ? $groups : func_get_args())\n ->flatten()\n ->reduce(function ($array, $group) {\n if (empty($group)) {\n return $array;\n }\n\n $group = $this->getStoredGroup($group);\n\n if (! $group instanceof Group) {\n return $array;\n }\n\n $this->ensureModelSharesGuard($group);\n\n $array[$group->getKey()] = AclRegistrar::$teams && ! is_a($this, Permission::class) ?\n [AclRegistrar::$teamsKey => getPermissionsTeamId()] : [];\n\n return $array;\n }, []);\n\n $model = $this->getModel();\n\n if ($model->exists) {\n $this->groups()->sync($groups, false);\n $model->load('groups');\n } else {\n /** @var Model $class */\n $class = \\get_class($model);\n\n $class::saved(\n function ($object) use ($groups, $model) {\n if ($model->getKey() != $object->getKey()) {\n return;\n }\n\n $model->groups()->sync($groups, false);\n $model->load('groups');\n }\n );\n }\n\n if (is_a($this, get_class($this->getPermissionClass()))) {\n $this->forgetCachedPermissions();\n }\n\n return $this;\n }",
"public function syncGroups($groups)\n {\n $groups = is_array($groups) || $groups instanceof Collection ? $groups : func_get_args();\n\n $this->groups()->detach();\n\n $this->assignGroup($groups);\n }",
"function setGroups( $groupsArr )\n {\n if ( is_array( $groupsArr ) ) {\n $this->_groups = &$groupsArr;\n }\n }",
"public static function setUserGroups($groups = array())\n {\n self::$userGroups = $groups;\n }",
"protected function applyGroup(XsdGroup $group)\n {\n // It provides for naming a model group for use by reference in the XML representation of complex type \n // definitions and model groups. The correspondences between the properties of the information item and \n // properties of the component it corresponds to are as follows:\n \n // <group\n // id = ID\n // maxOccurs = (nonNegativeInteger | unbounded) : 1\n // minOccurs = nonNegativeInteger : 1\n // name = NCName\n // ref = QName\n // {any attributes with non-schema namespace . . .}>\n // Content: (annotation?, (all | choice | sequence)?)\n // </group>\n \n // Мать вашу, какому идиоту понадобилось использовать группы???\n throw new Exception('Мать вашу, какому идиоту понадобилось использовать группы???');\n }",
"public function set_group($group) {\n $this->group = $group;\n }",
"function updateLocaleFields(&$group) {\n\t\t$this->updateDataObjectSettings('group_settings', $group, array(\n\t\t\t'group_id' => $group->getId()\n\t\t));\n\t}",
"private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }",
"function setGroup( $group )\r\n {\r\n if ( is_a( $group, \"eZUserGroup\" ) )\r\n {\r\n $this->GroupID = $group->id();\r\n }\r\n else if ( is_numeric( $group ) )\r\n {\r\n $this->GroupID = $group;\r\n }\r\n }",
"public function refreshGroupSettings()\n {\n $group = $this->currentUser->getGroup();\n if ($group instanceof \\Gems\\User\\Group) {\n $group->applyGroupToModel($this, false);\n }\n }",
"public function overrideFilterGroups($filterGroups) {\n foreach($filterGroups as $filterGroup => $options) {\n foreach($options as $optionKey => $option) {\n $this->filterGroups[$filterGroup][$optionKey] = $option;\n }\n }\n }",
"function modify_groups() {\n\t//checks if user is admin - if yes then show them the page attributes box so they can set hierarchy\n\tif ( current_user_can ( 'manage_options') ) {\n \tadd_post_type_support('groups','page-attributes');\n }\n\t\n if ( post_type_exists( 'groups' ) ) {\n \t\n /* Give groups hierarchy */\n /* Give products hierarchy (for house plans) */\n global $wp_post_types, $wp_rewrite;\n $wp_post_types['groups']->hierarchical = true;\n $args = $wp_post_types['groups'];\n $wp_rewrite->add_rewrite_tag(\"%groups%\", '(.+?)', $args->query_var ? \"{$args->query_var}=\" : \"post_type=groups=\");\n \n }\n\n}",
"protected function normalize() {}",
"public function beforeUpdate()\n {\n $product = self::find($this->id);\n self::$product_group = $product->group_id;\n }"
]
| [
"0.7164009",
"0.64815396",
"0.5706676",
"0.5386428",
"0.5140846",
"0.51400465",
"0.5067658",
"0.50382346",
"0.5001172",
"0.4980942",
"0.49799627",
"0.49629313",
"0.48689756",
"0.48386523",
"0.47723225",
"0.4769469",
"0.47627634",
"0.4760015",
"0.4753596",
"0.4732903",
"0.4688783",
"0.46887267",
"0.46702582",
"0.46303034",
"0.46117073",
"0.45857984",
"0.45794037",
"0.45770037",
"0.45383492",
"0.45366544"
]
| 0.7828162 | 0 |
Gets all the denormalization contexts per group ("" being the base context applied to all groups). | public function getDenormalizationContexts(): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDenormalizationContextForGroups(array $groups): array;",
"public function getNormalizationContextForGroups(array $groups): array;",
"public function setDenormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getContexts();",
"public function getNormalizationContexts(): array;",
"public function getContexts() {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getContexts() : array\n {\n return $this->contexts;\n }",
"function getContextSets()\n {\n return $this->_contextSets;\n }",
"public function getOperatingContexts();",
"public function setNormalizationContextForGroups(array $context, array $groups = []): void;",
"protected function getContexts() {\n return $this->configContexts->get();\n }",
"public function getContext(bool $merge = true): array;",
"public static function getAllGroups()\n {\n return ValveGroup::all();\n }",
"public function groups()\n {\n return $this->morphedByMany(Group::class, 'device_tokenable')->withTimestamps();\n }",
"public function getContext(): array\n {\n $context = [];\n\n if ($this->category !== null) {\n $context['category'] = $this->category;\n }\n\n if ($this->trace !== null) {\n $context['trace'] = $this->trace;\n }\n\n if ($this->memory !== null) {\n $context['memory'] = $this->memory;\n }\n\n if ($this->exception !== null) {\n $context['exception'] = $this->exception;\n }\n\n return $context;\n }",
"function getAllGroups() {\n return getAll(\"SELECT * FROM `group`\");\n}",
"public function getContext() : array;",
"function miscapps_contexts() {\n\t// return an associative array with context and description\n\tforeach (miscapps_list() as $row) {\n\t\t$contexts[] = array(\n\t\t\t'context' => 'app-miscapps-'.$row['miscapps_id'], \n\t\t\t'description'=> 'Misc Application: '.$row['description'],\n\t\t\t'source' => 'Misc Applications',\n\t\t);\n\t}\n\treturn $contexts;\n}",
"public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}",
"public function getContext(): array;",
"function get_child_contexts($context) {\n\n global $CFG;\n $children = array();\n\n switch ($context->contextlevel) {\n\n case CONTEXT_BLOCK:\n // No children.\n return array();\n break;\n\n case CONTEXT_MODULE:\n // No children.\n return array();\n break;\n\n case CONTEXT_GROUP:\n // No children.\n return array();\n break;\n\n case CONTEXT_COURSE:\n // Find all block instances for the course.\n $page = new page_course;\n $page->id = $context->instanceid;\n $page->type = 'course-view';\n if ($blocks = blocks_get_by_page_pinned($page)) {\n foreach ($blocks['l'] as $leftblock) {\n if ($child = get_context_instance(CONTEXT_BLOCK, $leftblock->id)) {\n array_push($children, $child->id);\n }\n }\n foreach ($blocks['r'] as $rightblock) {\n if ($child = get_context_instance(CONTEXT_BLOCK, $rightblock->id)) {\n array_push($children, $child->id);\n }\n }\n }\n // Find all module instances for the course.\n if ($modules = get_records('course_modules', 'course', $context->instanceid)) {\n foreach ($modules as $module) {\n if ($child = get_context_instance(CONTEXT_MODULE, $module->id)) {\n array_push($children, $child->id);\n }\n }\n }\n // Find all group instances for the course.\n if ($groupids = groups_get_groups($context->instanceid)) {\n foreach ($groupids as $groupid) {\n if ($child = get_context_instance(CONTEXT_GROUP, $groupid)) {\n array_push($children, $child->id);\n }\n }\n }\n return $children;\n break;\n\n case CONTEXT_COURSECAT:\n // We need to get the contexts for:\n // 1) The subcategories of the given category\n // 2) The courses in the given category and all its subcategories\n // 3) All the child contexts for these courses\n\n $categories = get_all_subcategories($context->instanceid);\n\n // Add the contexts for all the subcategories.\n foreach ($categories as $catid) {\n if ($catci = get_context_instance(CONTEXT_COURSECAT, $catid)) {\n array_push($children, $catci->id);\n }\n }\n\n // Add the parent category as well so we can find the contexts\n // for its courses.\n array_unshift($categories, $context->instanceid);\n\n foreach ($categories as $catid) {\n // Find all courses for the category.\n if ($courses = get_records('course', 'category', $catid)) {\n foreach ($courses as $course) {\n if ($courseci = get_context_instance(CONTEXT_COURSE, $course->id)) {\n array_push($children, $courseci->id);\n $children = array_merge($children, get_child_contexts($courseci));\n }\n }\n }\n }\n return $children;\n break;\n\n case CONTEXT_USER:\n // No children.\n return array();\n break;\n\n case CONTEXT_PERSONAL:\n // No children.\n return array();\n break;\n\n case CONTEXT_SYSTEM:\n // Just get all the contexts except for CONTEXT_SYSTEM level.\n $sql = 'SELECT c.id '.\n 'FROM '.$CFG->prefix.'context AS c '.\n 'WHERE contextlevel != '.CONTEXT_SYSTEM;\n\n $contexts = get_records_sql($sql);\n foreach ($contexts as $cid) {\n array_push($children, $cid->id);\n }\n return $children;\n break;\n\n default:\n error('This is an unknown context (' . $context->contextlevel . ') in get_child_contexts!');\n return false;\n }\n}",
"public function getAllGroups();",
"public function districts()\n {\n $noHidden = (bool)$this->request->getQuery('no-hidden');\n $metrics = $this->getMetrics(Context::DISTRICT_CONTEXT, $noHidden);\n\n $this->set([\n '_serialize' => ['metrics'],\n 'metrics' => array_values($metrics),\n ]);\n }",
"public function getNormalizationContext(): array\n {\n return [\n self::ACTION => $this->getAction(),\n self::VERSION => $this->getVersion(),\n self::REQUEST_TYPE => $this->getRequestType(),\n 'sharedData' => $this->getSharedData()\n ];\n }",
"public function getGroupCols()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupCols;\n\t}",
"public function getGroupFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupFuncs;\n\t}",
"public static function getAll(){\n $conn = DataManager::getInstance()->getConnection();\n if(!$conn || $conn->connect_error) exit();\n $statement = $conn->prepare('SELECT `id` FROM `groups` WHERE 1');\n if(!$statement || !$statement->execute()) exit();\n $result_set = $statement->get_result();\n $group_ids = array();\n while($row = $result_set->fetch_assoc()){\n array_push($group_ids, $row['id']);\n }\n $output = array();\n foreach($group_ids as $id){\n array_push($output, self::fromId($id));\n }\n return $output;\n }",
"function fetch_context_independent_capabilities() {\n\n //only CONTEXT_SYSTEM capabilities here or it will break the hack in fetch_context_capabilities()\n $contextindependentcaps = array(\n 'moodle/site:accessallgroups'\n );\n\n $records = array();\n\n foreach ($contextindependentcaps as $capname) {\n $record = get_record('capabilities', 'name', $capname);\n array_push($records, $record);\n }\n return $records;\n}"
]
| [
"0.7304672",
"0.6462966",
"0.6000314",
"0.5943111",
"0.5916635",
"0.553271",
"0.5513563",
"0.5513563",
"0.5365157",
"0.5331891",
"0.5194104",
"0.51109093",
"0.50656384",
"0.50149727",
"0.49833047",
"0.4863249",
"0.4839967",
"0.48140556",
"0.48102522",
"0.479252",
"0.4788695",
"0.4728072",
"0.47153592",
"0.47066063",
"0.46847528",
"0.4675724",
"0.46529317",
"0.4609338",
"0.46013245",
"0.45799738"
]
| 0.7307807 | 0 |
Gets the computed denormalization contexts for given groups. | public function getDenormalizationContextForGroups(array $groups): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNormalizationContextForGroups(array $groups): array;",
"public function getDenormalizationContexts(): array;",
"public function setDenormalizationContextForGroups(array $context, array $groups = []): void;",
"public function setNormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getNormalizationContexts(): array;",
"public function getContexts();",
"function get_multi( $groups ) {\n\t\t$return = array();\n\t\tforeach ( $groups as $group => $ids ) {\n\t\t\t$mc =& $this->get_mc( $group );\n\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t$key = $this->key( $id, $group );\n\t\t\t\tif ( isset( $this->cache[$key] ) ) {\n\t\t\t\t\tif ( is_object( $this->cache[$key] ) )\n\t\t\t\t\t\t$return[$key] = clone $this->cache[$key];\n\t\t\t\t\telse\n\t\t\t\t\t\t$return[$key] = $this->cache[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if ( in_array( $group, $this->no_mc_groups ) ) {\n\t\t\t\t\t$return[$key] = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t$return[$key] = $mc->get( $key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $to_get ) {\n\t\t\t\t$vals = $mc->get_multi( $to_get );\n\t\t\t\t$return = array_merge( $return, $vals );\n\t\t\t}\n\t\t}\n\t\t@ ++$this->stats['get_multi'];\n\t\t$this->group_ops[$group][] = \"get_multi $id\";\n\t\t$this->cache = array_merge( $this->cache, $return );\n\t\treturn $return;\n\t}",
"function obtenerDimensionesContextuales($dominioDifuso) {\n $conexion = $this->conectar();\n $query = \"SELECT dimension FROM DependenciaCtx_TAB where domDifuso ='\" . $dominioDifuso . \"'\";\n $result = oci_parse($conexion, $query);\n oci_execute($result);\n $this->desconectar($conexion);\n\n return $result;\n\n }",
"public function getContexts() {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function getContexts()\n {\n return $this->contexts;\n }",
"public function saveGroups($groups)\n {\n foreach ($groups as $group) {\n $proposer = $group->getSubject(self::$PROPOSER_ROLE_ID);\n $receiver = $group->getSubject(self::$RECEIVER_ROLE_ID);\n\n $proposerGroup = new DictatorGroup();\n $proposerGroup->setSubjectId($proposer->getId());\n $proposerGroup->setSubjectRole(self::$PROPOSER_ROLE_ID);\n $proposerGroup->setPartnerId($receiver->getId());\n $proposerGroup->setPartnerRole(self::$RECEIVER_ROLE_ID);\n $proposerGroup->save();\n\n $receiverGroup = new DictatorGroup();\n $receiverGroup->setSubjectId($receiver->getId());\n $receiverGroup->setSubjectRole(self::$RECEIVER_ROLE_ID);\n $receiverGroup->setPartnerId($proposer->getId());\n $receiverGroup->setPartnerRole(self::$PROPOSER_ROLE_ID);\n $receiverGroup->save();\n }\n }",
"public function getGroupsQuery()\n {\n $query = Query::selectFrom(['g' => 'groups'], ['group_id', 'subject', 'teacher']);\n $query->where()->in('g.group_id', [3, 7, 11]);\n\n /*\n SQL:\n SELECT s.*, gs.group_id\n FROM students AS s\n INNER JOIN groups_students AS gs ON s.student_id = gs.student_id\n WHERE gs.group_id IN (3, 7, 11)\n */\n $studentsQuery = Query::selectFrom(['s' => 'students']);\n $query->nest(['Students' => $studentsQuery], function (NestedSelect $nest, RowProxy $row) {\n // common structure for nesting,\n $nest->getSelect()\n ->innerJoin(['gs' => 'groups_students'], ['group_id'])\n ->on()->equals('s.student_id', 'gs.student_id');\n\n // result varies per $row values.\n $nest->getSelect()\n ->where()->equals('gs.group_id', $row->group_id);\n });\n\n return $query;\n }",
"public function getActualActionGroups()\n {\n $actionGroupIds = $this->getActionGroupIds();\n $actualActionProductIds = $this->getActualActionProducts()->select('id')->column();\n\n $query = Group::find()\n ->orderBy(['{{%sales_groups}}.name' => SORT_ASC]);\n\n if (empty($actualActionProductIds)) {\n return $query->andWhere('1=0');\n }\n\n $query\n ->joinWith('products', false)\n ->andWhere(['IN', '{{%sales_products}}.id', $actualActionProductIds])\n ->distinct('{{%sales_groups}}.id');\n\n if ($actionGroupIds) {\n $query->where(['IN', '{{%sales_groups}}.id', $actionGroupIds]);\n }\n\n return $query;\n }",
"public function get_group_discounts()\r\n\t{\r\n\t\t// Check the discount tables exist in the config file and are enabled.\r\n\t\tif ($this->get_enabled_status('discounts'))\r\n\t\t{\r\n\t\t\t// Set aliases of discount table data.\r\n\t\t\t$tbl_cols_discounts = $this->flexi->cart_database['discounts']['columns'];\r\n\t\t\t$tbl_cols_group_discounts = $this->flexi->cart_database['discount_groups']['columns'];\r\n\t\t\t$tbl_cols_group_item_discounts = $this->flexi->cart_database['discount_group_items']['columns'];\r\n\t\t\r\n\t\t\t$sql_select = array(\r\n\t\t\t\t$tbl_cols_group_item_discounts['item'].' AS item_id',\r\n\t\t\t\t$tbl_cols_discounts['group'].' AS group_id'\r\n\t\t\t);\r\n\r\n\t\t\t// Lookup item id from item data array and add to SQL WHERE string\r\n\t\t\t$sql_where = ' AND ('.$tbl_cols_group_item_discounts['item'].' IN (';\r\n\t\t\tforeach($this->flexi->cart_contents['items'] as $item)\r\n\t\t\t{\r\n\t\t\t\t$sql_where .= $item[$this->flexi->cart_columns['item_id']].',';\r\n\t\t\t}\r\n\t\t\t$sql_where = rtrim($sql_where,',').') AND '.$tbl_cols_group_discounts['status'].' = 1)';\r\n\t\t\t\r\n\t\t\tif ($group_item_discount_data = $this->get_database_discount_data($sql_select, $sql_where, 'group_discounts'))\r\n\t\t\t{\r\n\t\t\t\treturn $this->sort_discount_data($group_item_discount_data);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"function _acf_apply_get_local_field_groups($groups = array())\n{\n}",
"public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}",
"public static function lemmaContext($lemma_id) {\n $sentence_list = // array of sentences [text of sentence, wordforms joined with comma)\n $lemma_strings = // array of pairs lemma_id=>lemma_lemma\n $context_lemmas = []; // array of pairs lemma_id=>frequency in the context set\n \n $wordform_list = [];\n $wordforms = Wordform::whereIn('id',function($q) use ($lemma_id){\n $q->select('wordform_id')\n ->from('lemma_wordform')\n ->where('lemma_id',$lemma_id);\n })->get();\n foreach ($wordforms as $wordform) {\n $wordform_list[$wordform->id] = $wordform-> wordform;\n foreach ($wordform->sentences as $sentence) {\n $sentence_list[$sentence->id]['sentence'] = $sentence->sentence;\n $sentence_list[$sentence->id]['wordforms'][$wordform->id] = $wordform-> wordform;\n\n foreach($sentence->wordforms as $w) {\n foreach ($w->lemmas as $lemma) {\n if ($lemma->id != $lemma_id) {\n $lemma_strings[$lemma->id] = $lemma->lemma;\n if (isset($context_lemmas[$lemma->id])) {\n $context_lemmas[$lemma->id] +=1;\n } else {\n $context_lemmas[$lemma->id] =1; \n }\n }\n }\n }\n }\n } \n arsort($context_lemmas); \n \n return [$sentence_list,$context_lemmas, $lemma_strings];\n }",
"public function getFiltersForGroups($groupIds) {\n $select = $this->getDatabase()\n ->select()\n ->from($this->getTableName())\n ->where('groupId IN (?)', $groupIds);\n\n $data = $select->fetchAll();\n\n $result = array();\n foreach ($data as $item) {\n $item['id'] = (int)$item['id'];\n $item['groupId'] = (int)$item['groupId'];\n\n $result[] = new Entity\\Filter($item);\n }\n\n return $result;\n }",
"public function getGroupsById($groups_ids) {\n\t\treturn SQLQuery::create()->select(\"StudentsGroup\")->whereIn(\"StudentsGroup\",\"id\",$groups_ids)->execute();\n\t}",
"public function getContexts() : array\n {\n return $this->contexts;\n }",
"public function getNormalizationContext(): array\n {\n return [\n self::ACTION => $this->getAction(),\n self::VERSION => $this->getVersion(),\n self::REQUEST_TYPE => $this->getRequestType(),\n 'sharedData' => $this->getSharedData()\n ];\n }",
"public function getValidators($groups = 'default')\n {\n $validators = [];\n $ids = array_merge(array_keys($this->vs), array_keys($this->controls));\n if ($groups == '*')\n {\n foreach ($ids as $id)\n {\n $vs = $this->getActualVS($id);\n if ($vs && $vs['properties']['visible'] && is_subclass_of($vs['class'], 'ClickBlocks\\Web\\POM\\Validator') && empty($vs['attributes']['locked'])) \n {\n $validators[] = $this->get($id);\n }\n }\n }\n else\n {\n $groups = array_map('trim', explode(',', $groups));\n foreach ($ids as $id)\n {\n $vs = $this->getActualVS($id);\n if ($vs && $vs['properties']['visible'] && is_subclass_of($vs['class'], 'ClickBlocks\\Web\\POM\\Validator') && empty($vs['attributes']['locked'])) \n {\n $group = isset($vs['attributes']['groups']) ? $vs['attributes']['groups'] : 'default';\n foreach ($groups as $grp)\n {\n if (preg_match('/,\\s*' . preg_quote($grp) . '\\s*,/', ',' . $group . ','))\n {\n $validators[] = $this->get($id);\n break;\n }\n }\n }\n }\n }\n return $validators;\n }",
"public function getGroupsFromDatabase() {\n $db = \\Helper::getDB();\n $db->join('groups g', 'gd.groupId = g.id', 'LEFT');\n $db->where('gd.documentId', $db->escape($this->getId()));\n $groups = $db->get('group_documents gd', NULL, 'g.*');\n $this->groups = array();\n\n // Process all groups\n foreach($groups as $group) {\n $newGroup = new \\Models\\Group($group['id'], $group['name']);\n $this->addGroup($newGroup);\n }\n }",
"public function getAdminsForGroup($group_id) {\n return $this->get('get_admins_for_group', ['group_id' => $group_id]);\n }",
"public function denormalize(DenormalizerInterface $denormalizer, $data, string $format = null, array $context = [])\n {\n }",
"public function setGroups($groups)\n {\n $this->data['groups'] = $groups;\n return $this;\n }",
"public function get_groups($args = [])\n {\n global $db, $system;\n /* initialize arguments */\n $user_id = !isset($args['user_id']) ? null : $args['user_id'];\n $offset = !isset($args['offset']) ? 0 : $args['offset'];\n $get_all = !isset($args['get_all']) ? false : true;\n $suggested = !isset($args['suggested']) ? false : true;\n $random = !isset($args['random']) ? false : true;\n $managed = !isset($args['managed']) ? false : true;\n $results = !isset($args['results']) ? $system['max_results_even'] : $args['results'];\n /* initialize vars */\n $groups = [];\n $offset *= $results;\n /* get suggested groups */\n if ($suggested) {\n $where_statement = \"\";\n /* make a list from joined groups (approved|pending) */\n $groups_ids = $this->get_groups_ids();\n if ($groups_ids) {\n $groups_list = implode(',', $groups_ids);\n $where_statement .= \"AND group_id NOT IN (\" . $groups_list . \") \";\n }\n $sort_statement = ($random) ? \" ORDER BY RAND() \" : \" ORDER BY group_id DESC \";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_groups = $db->query(\"SELECT * FROM `groups` WHERE group_privacy != 'secret' \" . $where_statement . $sort_statement . $limit_statement) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"taget\" all groups who admin */\n } elseif ($managed) {\n $get_groups = $db->query(sprintf(\"SELECT `groups`.* FROM groups_admins INNER JOIN `groups` ON groups_admins.group_id = `groups`.group_id WHERE groups_admins.user_id = %s ORDER BY group_id DESC\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"viewer\" groups who admin */\n } elseif ($user_id == null) {\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_groups = $db->query(sprintf(\"SELECT `groups`.* FROM groups_admins INNER JOIN `groups` ON groups_admins.group_id = `groups`.group_id WHERE groups_admins.user_id = %s ORDER BY group_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"target\" groups*/\n } else {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_groups FROM users WHERE user_id = %s\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_groups'], $user_id)) {\n return $groups;\n }\n /* if the viewer not the target exclude secret groups */\n $where_statement = ($this->_data['user_id'] == $user_id) ? \"\" : \"AND `groups`.group_privacy != 'secret'\";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_groups = $db->query(sprintf(\"SELECT `groups`.* FROM `groups` INNER JOIN groups_members ON `groups`.group_id = groups_members.group_id WHERE groups_members.approved = '1' AND groups_members.user_id = %s \" . $where_statement . \" ORDER BY group_id DESC \" . $limit_statement, secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_groups->num_rows > 0) {\n while ($group = $get_groups->fetch_assoc()) {\n $group['group_picture'] = get_picture($group['group_picture'], 'group');\n /* check if the viewer joined the group */\n $group['i_joined'] = $this->check_group_membership($this->_data['user_id'], $group['group_id']);;\n $groups[] = $group;\n }\n }\n return $groups;\n }",
"public function getGroupCols()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupCols;\n\t}",
"function getContextSets()\n {\n return $this->_contextSets;\n }"
]
| [
"0.76032853",
"0.6496426",
"0.64332396",
"0.5626132",
"0.541504",
"0.48913193",
"0.44983113",
"0.44532853",
"0.43977025",
"0.43837795",
"0.43837795",
"0.43634072",
"0.43561164",
"0.4335778",
"0.43352512",
"0.43081564",
"0.43077093",
"0.42861372",
"0.42682028",
"0.42512184",
"0.41950092",
"0.41909575",
"0.41897237",
"0.41702747",
"0.41635782",
"0.4160394",
"0.41547418",
"0.41526452",
"0.41444322",
"0.41415378"
]
| 0.82780755 | 0 |
Sets the denormalization context for given groups. | public function setDenormalizationContextForGroups(array $context, array $groups = []): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setNormalizationContextForGroups(array $context, array $groups = []): void;",
"public function getDenormalizationContextForGroups(array $groups): array;",
"public function getNormalizationContextForGroups(array $groups): array;",
"public function set(array $groups)\n {\n $this->groups = $groups;\n }",
"function setGroups($groups) {\n if (is_array($groups)) {\n $groups = implode(',', $groups);\n }\n $this->groups = $groups;\n }",
"public function denormalize(DenormalizerInterface $denormalizer, $data, string $format = null, array $context = [])\n {\n }",
"public function getDenormalizationContexts(): array;",
"public function setGroups($groups);",
"public function setGroup($group) {}",
"public function setGroup($group) {}",
"public function setGroups($groups)\n {\n $this->data['groups'] = $groups;\n return $this;\n }",
"public function set($model, $attribute, $groups)\n {\n \n }",
"public function attachGroups($groups);",
"public function setDataGroup($datagroup) {\n\t\t$this->datagroup = $datagroup;\n\t}",
"public function set($model, $attribute, $groups)\n { \n $model::saved(function ($model) use ($groups) {\n $model->combinations()->get()->each->delete();\n\n $groups->map->getAttributes()->map(function($layout) {\n return tap($layout, function(&$layout) {\n $layout['attributes'] = json_decode($layout['attributes'] ?? '[]', true);\n }); \n })->each(function($attributes) use ($model) { \n if (isset($attributes['attributes']) && ! empty($attributes['attributes'])) {\n\n $combination = $model->combinations()->create($attributes);\n $combination->attributes()->sync($attributes['attributes']); \n\n } \n }); \n });\n \n }",
"public function set_recursive_groups($_recursive_groups)\n {\n $this->_recursive_groups = $_recursive_groups;\n }",
"function set_groups($groups) {\n\t\tif ($this->get_fixedgroups())\n\t\t\tthrow new LGIPortalException(\"Cannot change groups for this user, certificate does not allow it.\");\n\t\tlgi_mysql_query(\"DELETE FROM %t(usergroups) WHERE `usercertid`=(SELECT `id` FROM %t(usercerts) WHERE `user`='%%')\", $this->userid);\n\t\tforeach ($groups as $g)\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(usergroups) SET `usercertid`=(SELECT `id` FROM %t(usercerts) WHERE `user`='%%'), `name`='%%'\", $this->userid, $g);\n\t\t$_SESSION['groups'] = implode(',', $groups);\n\t}",
"public function supportsDenormalization($data, $type, $format = null, array $context = array());",
"abstract protected function setContext(array $context);",
"public function prepareDetailedByGroup($group_id);",
"private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }",
"protected function applyGroup(XsdGroup $group)\n {\n // It provides for naming a model group for use by reference in the XML representation of complex type \n // definitions and model groups. The correspondences between the properties of the information item and \n // properties of the component it corresponds to are as follows:\n \n // <group\n // id = ID\n // maxOccurs = (nonNegativeInteger | unbounded) : 1\n // minOccurs = nonNegativeInteger : 1\n // name = NCName\n // ref = QName\n // {any attributes with non-schema namespace . . .}>\n // Content: (annotation?, (all | choice | sequence)?)\n // </group>\n \n // Мать вашу, какому идиоту понадобилось использовать группы???\n throw new Exception('Мать вашу, какому идиоту понадобилось использовать группы???');\n }",
"function modify_groups() {\n\t//checks if user is admin - if yes then show them the page attributes box so they can set hierarchy\n\tif ( current_user_can ( 'manage_options') ) {\n \tadd_post_type_support('groups','page-attributes');\n }\n\t\n if ( post_type_exists( 'groups' ) ) {\n \t\n /* Give groups hierarchy */\n /* Give products hierarchy (for house plans) */\n global $wp_post_types, $wp_rewrite;\n $wp_post_types['groups']->hierarchical = true;\n $args = $wp_post_types['groups'];\n $wp_rewrite->add_rewrite_tag(\"%groups%\", '(.+?)', $args->query_var ? \"{$args->query_var}=\" : \"post_type=groups=\");\n \n }\n\n}",
"function setGroups( $groupsArr )\n {\n if ( is_array( $groupsArr ) ) {\n $this->_groups = &$groupsArr;\n }\n }",
"public function syncGroups($groups)\n {\n $groups = is_array($groups) || $groups instanceof Collection ? $groups : func_get_args();\n\n $this->groups()->detach();\n\n $this->assignGroup($groups);\n }",
"public function saveGroups($groups)\n {\n foreach ($groups as $group) {\n $proposer = $group->getSubject(self::$PROPOSER_ROLE_ID);\n $receiver = $group->getSubject(self::$RECEIVER_ROLE_ID);\n\n $proposerGroup = new DictatorGroup();\n $proposerGroup->setSubjectId($proposer->getId());\n $proposerGroup->setSubjectRole(self::$PROPOSER_ROLE_ID);\n $proposerGroup->setPartnerId($receiver->getId());\n $proposerGroup->setPartnerRole(self::$RECEIVER_ROLE_ID);\n $proposerGroup->save();\n\n $receiverGroup = new DictatorGroup();\n $receiverGroup->setSubjectId($receiver->getId());\n $receiverGroup->setSubjectRole(self::$RECEIVER_ROLE_ID);\n $receiverGroup->setPartnerId($proposer->getId());\n $receiverGroup->setPartnerRole(self::$PROPOSER_ROLE_ID);\n $receiverGroup->save();\n }\n }",
"private function setGroups($entity, array &$groups): void\n {\n $className = $this->getClassName($entity);\n\n // Add the default entity groups\n if ($className !== null) {\n $groups[] = end($className);\n }\n\n $groups[] = 'TimestampedEntity';\n $groups[] = 'TimestampedWithUserEntity';\n }",
"public function set_group($group) {\n $this->group = $group;\n }",
"public function assignGroup($groups): self\n {\n $groups = collect(is_array($groups) || $groups instanceof Collection ? $groups : func_get_args())\n ->flatten()\n ->reduce(function ($array, $group) {\n if (empty($group)) {\n return $array;\n }\n\n $group = $this->getStoredGroup($group);\n\n if (! $group instanceof Group) {\n return $array;\n }\n\n $this->ensureModelSharesGuard($group);\n\n $array[$group->getKey()] = AclRegistrar::$teams && ! is_a($this, Permission::class) ?\n [AclRegistrar::$teamsKey => getPermissionsTeamId()] : [];\n\n return $array;\n }, []);\n\n $model = $this->getModel();\n\n if ($model->exists) {\n $this->groups()->sync($groups, false);\n $model->load('groups');\n } else {\n /** @var Model $class */\n $class = \\get_class($model);\n\n $class::saved(\n function ($object) use ($groups, $model) {\n if ($model->getKey() != $object->getKey()) {\n return;\n }\n\n $model->groups()->sync($groups, false);\n $model->load('groups');\n }\n );\n }\n\n if (is_a($this, get_class($this->getPermissionClass()))) {\n $this->forgetCachedPermissions();\n }\n\n return $this;\n }",
"function setGroup( $group )\r\n {\r\n if ( is_a( $group, \"eZUserGroup\" ) )\r\n {\r\n $this->GroupID = $group->id();\r\n }\r\n else if ( is_numeric( $group ) )\r\n {\r\n $this->GroupID = $group;\r\n }\r\n }"
]
| [
"0.73990244",
"0.6775073",
"0.6013397",
"0.5453847",
"0.5401843",
"0.5398585",
"0.53317237",
"0.53111243",
"0.4937679",
"0.49361128",
"0.49249876",
"0.49171585",
"0.49106437",
"0.48777124",
"0.48293018",
"0.4774721",
"0.47638568",
"0.47319794",
"0.4706306",
"0.47017854",
"0.4682121",
"0.46708456",
"0.46383545",
"0.4634562",
"0.4615718",
"0.4614191",
"0.46115",
"0.46095303",
"0.45839334",
"0.4534256"
]
| 0.8179869 | 0 |
Delete Inquiry by ID | public function deleteById($inquiryId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_enquiry($enquiry_id)\n {\n $this->db->update('tbl_enquiry',$this,array('enquiry_id'=>$enquiry_id));\n //echo $this->db->last_query();\n }",
"public function deleted(CustomerInquiry $customerInquiry)\n {\n\n }",
"public function destroy($id)\n {\n $inquiry = Inquiry::find($id);\n $inquiry->delete();\n return redirect('submissions');\n }",
"public function deleted(OnlineInquiry $onlineInquiry)\n {\n //\n }",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function destroy($id)\n {\n //\n $inquiry = Inquiry::find($id);\n\n $inquiry->delete();\n\n // return redirect()->back();\n return response()->json(array('status' => 200, 'monolog' => array('title' => 'delete success', 'message' => 'Inquiry has been deleted'), 'id' => $id));\n }",
"public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }",
"public function delete(RequisitionId $id)\n {\n }",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);",
"public function delete($id);"
]
| [
"0.71961963",
"0.71368855",
"0.7006988",
"0.69995344",
"0.6972199",
"0.6972199",
"0.6972199",
"0.6972199",
"0.6972199",
"0.6972199",
"0.6970923",
"0.69506216",
"0.69193166",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645",
"0.69111645"
]
| 0.81334144 | 0 |
Signs payload with $timestamp and $secret | public function signPayload($payload, $secret, $timestamp = 'now')
{
if ($timestamp == 'now') {
$timestamp = time();
}
$payload = is_string($payload) ? $payload : json_encode($payload);
$timedPayload = "$timestamp.$payload";
$value = $this->computeSignature($timedPayload, $secret);
$signature = "t=$timestamp,v=$value";
return $signature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function signMessage($secretKey);",
"protected function generate_signature($payload_params, $timestamp)\n {\n $payload = \"timestamp:{$timestamp}\"; \n foreach ($payload_params as $key => $value) {\n $payload = \"{$payload},{$key}:{$value}\";\n }\n $tmp_signature = hash_hmac(\"sha256\", $payload, $this->client_secret);\n $base64_signature = trim(base64_encode($tmp_signature));\n return $base64_signature;\n }",
"private function calcSign($clientId, $secret, $timestamp) {\n\n $str = $clientId . $this->access_token . $timestamp;\n $hash = hash_hmac('sha256', $str, $secret);\n $hashInBase64 = (string)$hash;\n $signUp = strtoupper($hashInBase64);\n return $signUp;\n }",
"public function createSecret($tid, $amount, $currency, $timeStamp){}",
"private static function signRequest($key, $secret, $method, $request_url, $bodyHash, $timestamp, $nonce)\n {\n $signature = base64_encode(hash_hmac(\"sha256\", self::normalizeRequest($key, $method, $request_url, $bodyHash, $timestamp, $nonce), $secret, True));\n return $signature;\n }",
"private function computeSignature($payload, $secret)\n {\n return hash_hmac(\"sha256\", $payload, $secret);\n }",
"public function sign()\n {\n }",
"public function mefSignature() {\r\n\t$encoded_header = base64_encode('{\"alg\": \"HS512\",\"typ\": \"JWT\"}');\r\n\t$iss = 'CISCAR';\r\n\tif(isset($_GET['annuaire']) && $_GET['annuaire'] == 2 )\r\n\t{\r\n\t\t\t$iss = 'GCR';\r\n\t}\r\n\t// base64 encodes the payload json\r\n\t$encoded_payload = base64_encode('{\r\n\t\t\t\"iat\": \"'.time().'\",\r\n\t\t\t\"iss\": \"'.$iss.'\",\r\n\t\t\t\"aud\": \"https://boxstva-client.stva.com\",\r\n\t\t\t\"sub\": \"'.$this->getIndividuID().'\",\r\n\t\t\t\"family_name\": \"'.utf8_encode($this->getNom()).'\",\r\n\t\t\t\"given_name\": \"'.utf8_encode($this->getPrenom()).'\",\r\n\t\t\t\"ordering_party\": \"'.$this->getRolePrinc().'\",\r\n\t\t\t\"entities\": \"'.$this->getRattachements().'\"\r\n\t\t}');\r\n\t\r\n\t// base64 strings are concatenated to one that looks like this\r\n\t$header_payload = $encoded_header . '.' . $encoded_payload;\r\n\t\r\n\t//Setting the secret key environnement de Pre-PROD\r\n\t//\"aud\": \"http://box-gcr-pp.stva.com.s3-website-eu-west-1.amazonaws.com\",\r\n\t//$secret_key = '+XgiH7AFTCCUSbuFyMiqYThoStVW7etx32VRhSAKvCrqZPK2rZ4r1gtXoBlZHEismbALi8KKdmdRd3MnoH/19nfwIOV0+tX8blaUy/cQLxCQmfL8BlWuDutdegs72js2zvGpbS1YxXgjWhd4RjsVPn0HSL7q3EBJBORwAELOpI4GZuqSCn1n/R/veZiq7giAv7Gxi+J1A+EOTXtOzZSiQa/tYvcm6xaPTNPzP9HdgxAeKMN4FV44dG+Q66wD14WYOBAo1IPHKvAdWSS53uwRVAb7HDDfflVLcib851LG7fLC6JXaUmdK0iTEU3qJV32wzlF5phax9t16GdJfmCqAxJDMHx0iIVtZYajZPHnPYzXoHHCSilHmPoPZZkmKjlC12L1m87QKVySqP9K3J9fORW+Tn3QIkIcvl+GA4vqomk7/eVP8NT9MwIOvV9pjMJl+cGIoIYYQZmqQ3+Pa7d1NjV0bx6I9WlJNAKYxC5zFvVzqlx5j/H5Wq91WLOrZZNGaE/kygrLmyCYWQiCNzNbwvEsAgCPUgGy0o9o2itVEL4zwzRWPrNDp4fivhMA87QzbzFkDvX9B6PBb1R/3EFy1uSAk22ovyK/fMmN6GRTNeDQdGRi/U64Ys9mA+UjzBi22gy8ZIgFfcnCfJIinMO5PCh2BJ2AQq3kKxe4AMEQmeno=';\r\n\r\n\t//Setting the secret key environnement de PRODUCTION\r\n\t//\"aud\": \"https://boxstva-client.stva.com\",\r\n\t$secret_key = 'Rn2ZvoU+dTOtpE/BOUEuMaf65G2l7lA1nDJV56hmLcl17Y6F2EPCSIrKRCCVWc/Zda7m5Bp/g9BYUIRVTvgmtlcghGRBtswGFwMjq0Ye4QVtmpa8qZBI0sTHGjnbwTvmqZmf1v2TAcJWsAIJsRcoX0IchGvhaEKUMnLAXAUQT4mBhSdUY7H/ZckUthciFveKtxvmKMfjOLJNqciD8fVapuzQBqSRzFhTifVceLG1EmouRnoE5vg3RERwEhpVqFmt0fo+VCOinAR0nHG5Nq0XWXUTmGGsbOcDljLxz+oLAN28cffMc+6OfxkRX3L5ILId3pHMvV+MJns9FCZSA6+u87s3K31fLARCvVP6aVXXRn+M6CGBLxjQtbGopeQCHBRaliNxGr5LJIAkLFusBeG7jqIpGToxqy+D87tiYrg1zG2iRFTkKtvMJRZxdEkCnwJx4jOmuVboKCdtAqCQNX9e4I6jKp+Gs8edSbbV+17TY422DqV+sOXIxMA6udZ1vWm9eDE25dVVoRfiQXC7U/BLEGkV3ocs5du15nD1+NEODqlrVW+2WceQ1yQcSF4hRsU7Wk1pJ+aMRvFkx6PV028nSLExxTTPkxw07BmmDU5W9E6KbLB1/NFtseSyzgxTacGlFEVxmS+Zq846NLcNTrwQuM15Bub4zAy1N8Qv2NeQs4I=';\r\n\t\r\n\t// Creating the signature, a hash with the s512 algorithm and the secret key. The signature is also base64 encoded.\r\n\t$signature = base64_encode(hash_hmac('sha512', $header_payload, $secret_key, true));\r\n\t//$signature = hash_hmac('sha512', $header_payload, $secret_key, true);\r\n\t\r\n\t// Creating the JWT token by concatenating the signature with the header and payload, that looks like this:\r\n\t$jwt_token = $header_payload . '.' . $signature;\r\n\t\r\n\t//listing the resulted JWT\r\n\t//echo $jwt_token;\r\n\t//print $jwt_token;\r\n\treturn $jwt_token;\r\n\t\r\n\t//$decoded_jwt = explode(\".\",$jwt_token);\r\n\t//$decoded_header = base64_decode($decoded_jwt[0]);\r\n\t//$decoded_payload = base64_decode($decoded_jwt[1]);\r\n\t//$decoded_signature = base64_decode($decoded_jwt[2]);\r\n\t//echo $decoded_signature;\r\n\t\r\n\t//die();\r\n\r\n\r\n//\t\t$data = 'my data';\r\n\t\t\r\n//\t\t//Crée une nouvelle clé privée et publique\r\n//\t\t$new_key_pair = openssl_pkey_new(array(\r\n//\t\t\t\t\"private_key_bits\" => 1024,\r\n//\t\t\t\t\"private_key_type\" => OPENSSL_KEYTYPE_RSA,\r\n//\t\t));\r\n//\t\topenssl_pkey_export($new_key_pair, $private_key_pem);\r\n\t\t\r\n//\t\t$details = openssl_pkey_get_details($new_key_pair);\r\n//\t\t$public_key_pem = $details['key'];\r\n\t\t\r\n//\t\t//Création de la signature\r\n//\t\topenssl_sign($data, $signature, $private_key_pem, OPENSSL_ALGO_SHA1);\r\n\t\t\r\n//\t\t//Sauvegarde pour utilisation ultérieur\r\n//\t\tfile_put_contents('private_key.pem', $private_key_pem);\r\n//\t\tfile_put_contents('public_key.pem', $public_key_pem);\r\n//\t\tfile_put_contents('signature.dat', $signature);\r\n//\t\tprint $private_key_pem;\r\n//\t\t//Vérification de la signature\r\n//\t\t$r = openssl_verify($data, $signature, $public_key_pem, \"sha1WithRSAEncryption\");\r\n//\t\tvar_dump($r);\r\n\t}",
"function sign($date) {\n $key = base64_decode('MIIEowIBAAKCAQEA5NmI8GIsupuvOMXR4yfs8hK2RUmX/CKlHmLEr/b1mPr/gx+fenafOSKoXs7OUvUxF/CR0EW6iUJvJ9lmTACTZFsTfF+mSJZ76dpuh6J8BQj9lpnH+AEp05LqLr2zvlzkksrjYSW4hfaZqfUZDk8YvGsdBqDpWrEykD16R5Jv5Iw/Y13Jd99F5zYU+Z3M+XdBSrFSaDwU5GeiOQVyl8q/Bt9gY7O1HfqYY9udXmAzPfEaZdCqCj7B8V8Sj7Wc92TZ/fHabZFKzfhVwfHCAzK4mQZ1be8snJd1f9R2peqjzBEINGdOnAnm0rGItKZJY91LMYi5H6Wh/Qh21CYY4Ne2wwIDAQABAoIBAEKXQg+goZ9TOfNtLJvKvFncNAmJVp5Zfm6PEuiZFfID52HCS+eYqNA5U4Dy8HqXOkfbCrLt90+Fc07HJcsrx7fGAK+KLZqlnzz3AH6bOzdD3HZ8HQH/ZKpZ76bWMH1ODnzgaLWWAlGI5kHcPgQ549q/2FxbakunkC0ElpZI+CIqWEf0zNfTXOpExMWx+FENntk/qpHijE+zcbh1/cy8Bsmj0WcXZ3aTDElG3XCC21rPd7zgrFeL6Sy26Br0eqxqddatghZHB5PhZYE4BYM3AlZTZVfuDHogXn4BXILTyV+oQHNUzHKjStfVryJnslnWVAF5whaXGm1fyRY3WBAEmuECgYEA+AivBccqnKfgB7BTDTUMCdt7v+vVbR7CEZc5/jCRy+N0R6NN/L/+LdAAjsodjzVmkLOUzPbZhw72hHXA63RijAhSDeg8IdCUY1YVygyr5KZpHRnn96XJOucPCCFWFfiToJ2Qz+JfZMBUt9HhsSWGS2jF2hUGjixhRwFwTd5xtYsCgYEA7DMe0bJeF336UtgrY9MNVC1sc/A8sEeYtlr47rcLlRDboaO9PRsuIMssxiZ/9uRkYP1FDmS3S8pgwg4UuoVUYHg5Tt95iq3aK0BRQnpKuGIerbBCwFUBZMwpP1DW3fMKtOQ5pjoV74tqR+df7gD0hWlfMFV8WUP9vXLa+XBcWqkCgYEA85sbw3IEsQ3UY9jTCSKzqy7NUQcgfGb8NmiwBa7QU08XUpDatMYgsAAdvCBYfeH11WL7X3+G0DZq+lfo3ZhWfbBiXtRb0t5YD2RqTCK75PtoO7PI95r1lAuB4PtU4Ile/R4kL3jnNj4MNupFX0Y6qu/BetqxsIt4E1QfZ+t1BNcCgYBrDiCB2t5at3al5eSEsjvwU0Y8pj5bh5fnzwPU7pIJVkK12IkFETSvGGeKyBhnxszYSPLruyp455lDWy55+8RqlRMkdJWaDYI86EHsZ5FGUPKmtqUKl3yyOvbXA8TfhDDuHCMk/F7E2+OoA26vaS9q6H+EYLqjmvV+0Hf/ZrX1QQKBgGd8r9wi+fPG3IgGXHBQjmnVgaPNsvQzBKFmHrER0/iLZuA9A2R5x7DxZdHUSRWaPADIaHiU1O9jbNJCk7Jtnqn7M85Q0SRsqZhA2+28/1bmqrTkQmT7T9Q4+hUEN+qehZx83BkRYaP1QWuH11UcRxFr+O3HNXlC9mAG/zt6HhuV');\n $sig = hash_hmac('SHA1', $date, $key, true);\n $sig = base64_encode($sig);\n return $sig;\n }",
"private static function createMessageSig($params, $secret){\r\n return hash_hmac('md5', $params, $secret);\r\n }",
"protected static function _sign($parameters)\n\t{\n\t\t// Fixup our private key, copy-pasting the key might lead to whitespace faults\n\t\tif(!preg_match('/-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/si', Transip_ApiSettings::$privateKey, $matches))\n\t\t\tdie('<p>Could not find your private key, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\t$key = $matches[2];\n\t\t$key = preg_replace('/\\s*/s', '', $key);\n\t\t$key = chunk_split($key, 64, \"\\n\");\n\n\t\t$key = \"-----BEGIN PRIVATE KEY-----\\n\" . $key . \"-----END PRIVATE KEY-----\";\n\n\t\t$digest = self::_sha512Asn1(self::_encodeParameters($parameters));\n\t\tif(!@openssl_private_encrypt($digest, $signature, $key))\n\t\t\tdie('<p>Could not sign your request, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\treturn base64_encode($signature);\n\t}",
"protected function generateSignature()\n {\n // set the expire time to 5 minutes\n $expires = time() + 300;\n\n // put the parameters in a different line\n $stringToSign = $this->accessID.\"\\n\".$expires;\n\n // get the binary output of the hmac has\n $binarySignature = hash_hmac('sha1', $stringToSign, $this->secretKey, true);\n\n // Base64-encode and url-encode\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n return array('expires' => $expires, 'signature' => $urlSafeSignature);\n }",
"public function createRequestSignature(Request $request, $salt);",
"public function getSignSecretKey() : string;",
"public function signRequest(OAuth_Request $request, $consumer_secret, $token_secret = '');",
"function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }",
"function signPolicy($policy) {\n if (!function_exists('binsha1'))\n {\n if (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n function binsha1($d) { return sha1($d, true); }\n } else {\n function binsha1($d) { return pack('H*', sha1($d)); }\n }\n }\n\n $aws_secret = $this->_secretAccessKey;\n\n if (strlen($aws_secret) == 40)\n $aws_secret = $aws_secret.str_repeat(chr(0), 24);\n\n $ipad = str_repeat(chr(0x36), 64);\n $opad = str_repeat(chr(0x5c), 64);\n\n $hmac = binsha1(($aws_secret^$opad).binsha1(($aws_secret^$ipad).$policy));\n return base64_encode($hmac);\n }",
"public static function generateSignature($params)\n {\n $queryParams = $params . getenv('API_KEY') . getenv('API_SECRET');\n $signature = md5($queryParams);\n\n return $signature;\n }",
"public function signString($string, $secretKey)\n {\n return base64_encode(\n hash_hmac('sha1', $string, $secretKey, true)\n );\n }",
"public function sign($url, $expiration, $timeunit);",
"private function generate_signature()\n {\n $phrase = implode('', func_get_args());\n /**\n * Sign data and make final signature\n */\n $signature = '';\n $private_key_id = openssl_pkey_get_private($this->private_key);\n if (!openssl_sign($phrase, $signature, $private_key_id, OPENSSL_ALGO_SHA1)) {\n throw new BankException('OPEN SSL SIGN ERROR');\n }\n\n return $signature;\n }",
"public function sign(array $args);",
"private function sign(string $input)\n {\n return md5(($input . $this->appsecret));\n }",
"protected function _sign_string($string, $secret) {\n\t\treturn hash_hmac(\"sha1\", $string, $secret);\n\t}",
"private function sign ($postbody = '')\n\t{\n\t\t$get = array ();\n\t\t$get['time'] = time ();\n\t\t$get['random'] = mt_rand ();\n\t\t$get['reseller'] = CWRESELLER_RESELLER_ID;\n\n\t\t$json = implode (',', $get) . '|' . $postbody;\n\n\t\t$privatekey = openssl_get_privatekey ('file://' . CWRESELLER_PRIVATE_KEY);\n\n\t\t$signature = null;\n\t\topenssl_sign ($json, $signature, $privatekey);\n\n\t\t$get['signature'] = base64_encode ($signature);\n\t\t$get['debug'] = isset ($_GET['debug']) ? 1 : 0;\n\n\t\treturn $get;\n\t}",
"public function sign($http_method, $url, $params, $secret) {\n $sig = array(\n strtoupper($http_method),\n preg_replace('/%7E/', '~', rawurlencode($url)),\n rawurlencode($this->get_signable_parameters($params)),\n );\n\n $base_string = implode('&', $sig);\n $sig = base64_encode(hash_hmac('sha1', $base_string, $secret, true));\n return $sig;\n }",
"private function makeSigningKey() {\r\n\t\t$signing_key = $this->makeBase64HmacSha256($this->timestamp, $this->client_secret);\r\n\t\t$this->verbose('signing_key', $signing_key);\r\n\t\treturn $signing_key;\r\n\t}",
"protected function stringToSign(string $message, string $encodedData, int $timestamp) {\n\t\t\treturn \"{$message}:{$timestamp}:{$encodedData}\";\n\t\t}",
"public static function getSignatureString($params, $secret) {\n $values = array();\n self::extractParamValues($params, $values);\n sort($values, SORT_STRING);\n $string = $secret . implode('', $values);\n return $string;\n }",
"function setSig() {\n if (sfConfig::get(\"sf_private_key\") !='') {\n \n $hash = md5(rand_str());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HASH:: \".$hash);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN HASH:: \".$hash);\n \n $expires = strtotime(now());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} EXPIRES:: \".$expires);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN EXPIRES:: \".$expires);\n \n $code = setUserOrderTicket();\n $this -> seat -> setAudienceHmacKey( $code );\n $this -> seat -> save();\n $this -> context ->getLogger()->debug(\"{Theater Token Class} CODE:: \".$code);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN CODE:: \".$code);\n \n /*\n\t\t\t$enc_date = encryptCookie($code, $hash.\"=\".strtotime(now()));\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HMAC_SIG:: \".$enc_date);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN HMAC_SIG:: \".$enc_date);\n \n $this -> token_raw = $hash . \"|\" . strtotime(now()) . \"|\" . $enc_date;\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Token:: \".$this -> token_raw);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN RAW:: \".$this -> token_raw);\n \n $this -> token = encryptCookie($code,$this -> token_raw);\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Coookie:: \".$this -> token);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - SET COOKIE:: \".$this -> token);\n */\n \n $this -> setCookieVar( \"csth\", $code, 7 );\n return $this -> token;\n \n }\n \n }"
]
| [
"0.71683824",
"0.6858672",
"0.6744343",
"0.66804504",
"0.64597446",
"0.6390731",
"0.63141274",
"0.6189814",
"0.6108093",
"0.61041784",
"0.60289395",
"0.60185325",
"0.59008175",
"0.58496994",
"0.58491135",
"0.5829614",
"0.5824143",
"0.5823879",
"0.58222914",
"0.58133936",
"0.57991433",
"0.5774565",
"0.5753469",
"0.5740178",
"0.57235366",
"0.57218045",
"0.5707036",
"0.5706301",
"0.5695592",
"0.56908333"
]
| 0.8138887 | 0 |
Extracts the timestamp in a signature. | private function getTimestamp($signature)
{
$items = explode(",", $signature);
foreach ($items as $item) {
$itemParts = explode("=", $item, 2);
if ($itemParts[0] != "t") {
continue;
}
if (is_numeric($itemParts[1])) {
return intval($itemParts[1]);
}
break;
}
throw new SignatureVerificationException(
"Unable to extract timestamp from signature"
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSignature();",
"function wp_exif_date2ts($str)\n {\n }",
"protected function parseTransactionEntryTimestamp()\n {\n $results = [];\n if (preg_match('/^:61:(\\d{2})((\\d{2})\\d{2})((\\d{2})\\d{2})[C|D]/', $this->getCurrentTransactionData(), $results)\n && !empty($results[1])\n ) {\n\n list(, $valueDateY, $valueDateMD, $valueDateM, $entryDateMD, $entryDateM) = $results;\n $entryDate = $valueDateY . $entryDateMD;\n if ($valueDateMD !== $entryDateMD && $valueDateM > $entryDateM) {\n $entryDate = ($valueDateY + 1) . $entryDateMD;\n }\n\n return $this->sanitizeTimestamp($entryDate, 'ymd');\n }\n return 0;\n }",
"static function getDateFromTimeStamp($timestamp) {\r\n $tab = explode(\" \", $timestamp);\r\n return $tab[\"0\"];\r\n }",
"public function getLastTimestamp()\n\t{\n\t\tif (!$this->isFlv())\n\t\t\treturn 0;\n\t\t\t\n\t\tfseek($this->fh, -4 , SEEK_END); // go back 4 bytes\n\t\t\n\t\t$prev_tag_size_raw = fread ($this->fh, 4);\n\t\t$tag_size = unpack(\"N\", $prev_tag_size_raw);\n\t\t\n\t\t// go back 4 bytes AND the size of the tag + 4 bytes to get to the timestamp\n\t\tfseek ($this->fh, -$tag_size[1], SEEK_END);\n\t\t\n\t\t$data = fread ($this->fh, 4);\n\t\t$data = $data[3].substr($data, 0, 3);\n\t\t$res = unpack(\"N\", $data);\n\t\treturn $res[1];\n\t}",
"private static function generateSignature() {\n $result = microtime(true);\n return substr($result, -7);\n }",
"abstract public function getTstamp();",
"function getTimestamp ($key);",
"public function getSignatureDate() {\n return $this->signatureDate;\n }",
"public function getSignatureDate() {\n return $this->signatureDate;\n }",
"function wp_get_media_creation_timestamp($metadata)\n {\n }",
"public static function timestamp() {}",
"public function getTimestamp($path)\n\t{\n\t\treturn $this->getMetadata($path);\n\t}",
"public function getTimestamp();",
"public function getTimestamp();",
"public function getTimestamp();",
"public function getEventTimestamp();",
"function readTimestamp(): int;",
"public function timestamp();",
"function TidyTimeStampJustTime($str)\n{\n\t$date=strtok($str, \"T\");\n\t$time=strtok(\"T\");\n\t$finalTime=substr($time,0,5);\n\treturn $finalTime;\n}",
"public function getFirstVideoTimestamp()\n\t{\n\t\tif (!$this->isFlv())\n\t\t\treturn -1;\n\t\t\t\n\t\t$info = $this->validateHelper(false);\n\t\t\n\t\t$res = $info->readTag(0);\n\t\t\n\t\tif ($res == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn $res[FlvInfoVideo::VTAG_FIELD_TIMESTAMP];\n\t}",
"function get_media_creation_timestamp( $metadata ) {\n $creation_date = false;\n\n if ( empty( $metadata['fileformat'] ) ) {\n return $creation_date;\n }\n\n switch ( $metadata['fileformat'] ) {\n case 'asf':\n if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) {\n $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix'];\n }\n break;\n\n case 'matroska':\n case 'webm':\n if ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {\n $creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );\n } elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {\n $creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];\n }\n break;\n\n case 'quicktime':\n case 'mp4':\n if ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {\n $creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];\n }\n break;\n }\n\n return $creation_date;\n}",
"public function getTimestamp()\n\t{\n\t\treturn $this->getValue('timestamp');\n\t}",
"function getTimestamp($data) {\r\n\t// yyyy-mm-dd HH:ii:ss\r\n\t// 0123456789012345678\r\n\t$h = substr($data, 11, 2);\r\n\t$i = substr($data, 14, 2);\r\n\t$s = substr($data, 17, 2);\r\n\t$m = substr($data, 5, 2);\r\n\t$d = substr($data, 8, 2);\r\n\t$y = substr($data, 0, 4);\r\n\t//**************\r\n\treturn mktime($h, $i, $s, $m, $d, $y);\r\n}",
"public function getAuthCaptureTimestamp()\n {\n return $this->auth_capture_timestamp;\n }",
"function variant_date_from_timestamp($timestamp) {}",
"public static function get_timestamp() {\n\t\treturn floor(microtime(true)/self::keyRegeneration);\n\t}",
"public static function getSignature()\n\t{\n\t\treturn MHTTPD::$info['signature'];\n\t}",
"public function getSignature()\n {\n $signString= sprintf(\"%s\\n%s\\n%s\\n%d\", $this->topic, $this->consumerId, $this->message->getMessageHandle(), $this->time);\n return base64_encode(hash_hmac('sha1', $signString, $this->getAuthorization()->getAccessSecret(), true));\n }",
"public function getSignature(): string\n {\n return $this->signature;\n }"
]
| [
"0.6456596",
"0.6402775",
"0.63269496",
"0.63169116",
"0.6248316",
"0.6178181",
"0.61704457",
"0.6166245",
"0.61111647",
"0.61111647",
"0.59928674",
"0.5992445",
"0.59275687",
"0.5927226",
"0.5927226",
"0.5927226",
"0.5920747",
"0.59046364",
"0.5904306",
"0.59025097",
"0.5848151",
"0.58373046",
"0.5805861",
"0.5791106",
"0.57282364",
"0.57024384",
"0.56990296",
"0.5683658",
"0.56787467",
"0.5667253"
]
| 0.7839076 | 0 |
Extracts signed payload value in a signature | private function getValue($signature)
{
$items = explode(",", $signature);
foreach ($items as $item) {
$itemParts = explode("=", $item, 2);
if ($itemParts[0] == 'v') {
return $itemParts[1];
}
}
throw new SignatureVerificationException(
"Unable to extract value from signature"
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSignature();",
"public function getSignature() {\n $headers = $this->getHeaders();\n foreach ($headers as $key => $value) {\n if (strtolower($key) === 'x-hub-signature') {\n return $value;\n }\n }\n return '';\n }",
"function parse_signed_request($signed_request, $secret) {\n list($encoded_sig, $payload) = explode('.', $signed_request, 2);\n\n // decode the data\n $sig = base64_url_decode($encoded_sig);\n $data = json_decode(base64_url_decode($payload), true);\n\n if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {\n error_log('Unknown algorithm. Expected HMAC-SHA256');\n return null;\n }\n\n // check sig\n $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);\n if ($sig !== $expected_sig) {\n error_log('Bad Signed JSON signature at ' . __FILE__ . ' line ' . __LINE__ . '!');\n return null;\n }\n\n return $data;\n}",
"abstract public function getRawSignedRequest();",
"function parse_signed_request($signed_request, $secret) {\n list($encoded_sig, $payload) = explode('.', $signed_request, 2);\n\n // decode the data\n $sig = base64_url_decode($encoded_sig);\n $data = json_decode(base64_url_decode($payload), true);\n\n if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {\n error_log('Unknown algorithm. Expected HMAC-SHA256');\n return null;\n }\n\n // check sig\n $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);\n if ($sig !== $expected_sig) {\n error_log('Bad Signed JSON signature!');\n return null;\n }\n\n return $data;\n}",
"protected function getSignatureFromRequest()\n\t{\n\t\t$signature = $this->request->header($this->config['signature_header'], null);\n\n\t\tif (is_null($signature) || $signature === '') {\n\t\t\tthrow new AlexaVerificationException('Request signature verification failed: no signature present in header.');\n\t\t}\n\n\t\treturn base64_decode($signature);\n\t}",
"function getPayload();",
"private function computeSignature($payload, $secret)\n {\n return hash_hmac(\"sha256\", $payload, $secret);\n }",
"public function get_payload();",
"public function sign(string $payload) : string {\n $privateKey = openssl_pkey_get_private($this->privateKey, $this->passphrase);\n openssl_sign($payload, $signature, $privateKey, $this->getAlgorithm());\n return $signature;\n }",
"public function getSignedContent()\n {\n return $this->get(self::SIGNEDCONTENT);\n }",
"public function getRawSignedRequestFromPost()\r\r\n {\r\r\n if (isset($_POST['signed_request'])) {\r\r\n return $_POST['signed_request'];\r\r\n }\r\r\n\r\r\n return null;\r\r\n }",
"function decodeSignature($signature): string {\n\t\t$length = strlen($signature);\n\t\t$result = \"\";\n\t\t$index = 0;\n\n\t\twhile ($index < $length) {\n\t\t\t$a = substr($signature, $index, 2);\n\t\t\t$c = pack(\"H*\", $a);\n\n\t\t\t$index == 0 ? $result = $c : $result .= $c;\n\t\t\t$index += 2;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getSignature() {\n\t\treturn $this->signature;\n\t}",
"public function getPayload();",
"public function getPayload();",
"public function getPayload();",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getRawSignedRequestFromGet()\r\r\n {\r\r\n if (isset($_GET['signed_request'])) {\r\r\n return $_GET['signed_request'];\r\r\n }\r\r\n\r\r\n return null;\r\r\n }",
"public function parsePayload()\n { \n return $this->_payload;\n }",
"public function mefSignature() {\r\n\t$encoded_header = base64_encode('{\"alg\": \"HS512\",\"typ\": \"JWT\"}');\r\n\t$iss = 'CISCAR';\r\n\tif(isset($_GET['annuaire']) && $_GET['annuaire'] == 2 )\r\n\t{\r\n\t\t\t$iss = 'GCR';\r\n\t}\r\n\t// base64 encodes the payload json\r\n\t$encoded_payload = base64_encode('{\r\n\t\t\t\"iat\": \"'.time().'\",\r\n\t\t\t\"iss\": \"'.$iss.'\",\r\n\t\t\t\"aud\": \"https://boxstva-client.stva.com\",\r\n\t\t\t\"sub\": \"'.$this->getIndividuID().'\",\r\n\t\t\t\"family_name\": \"'.utf8_encode($this->getNom()).'\",\r\n\t\t\t\"given_name\": \"'.utf8_encode($this->getPrenom()).'\",\r\n\t\t\t\"ordering_party\": \"'.$this->getRolePrinc().'\",\r\n\t\t\t\"entities\": \"'.$this->getRattachements().'\"\r\n\t\t}');\r\n\t\r\n\t// base64 strings are concatenated to one that looks like this\r\n\t$header_payload = $encoded_header . '.' . $encoded_payload;\r\n\t\r\n\t//Setting the secret key environnement de Pre-PROD\r\n\t//\"aud\": \"http://box-gcr-pp.stva.com.s3-website-eu-west-1.amazonaws.com\",\r\n\t//$secret_key = '+XgiH7AFTCCUSbuFyMiqYThoStVW7etx32VRhSAKvCrqZPK2rZ4r1gtXoBlZHEismbALi8KKdmdRd3MnoH/19nfwIOV0+tX8blaUy/cQLxCQmfL8BlWuDutdegs72js2zvGpbS1YxXgjWhd4RjsVPn0HSL7q3EBJBORwAELOpI4GZuqSCn1n/R/veZiq7giAv7Gxi+J1A+EOTXtOzZSiQa/tYvcm6xaPTNPzP9HdgxAeKMN4FV44dG+Q66wD14WYOBAo1IPHKvAdWSS53uwRVAb7HDDfflVLcib851LG7fLC6JXaUmdK0iTEU3qJV32wzlF5phax9t16GdJfmCqAxJDMHx0iIVtZYajZPHnPYzXoHHCSilHmPoPZZkmKjlC12L1m87QKVySqP9K3J9fORW+Tn3QIkIcvl+GA4vqomk7/eVP8NT9MwIOvV9pjMJl+cGIoIYYQZmqQ3+Pa7d1NjV0bx6I9WlJNAKYxC5zFvVzqlx5j/H5Wq91WLOrZZNGaE/kygrLmyCYWQiCNzNbwvEsAgCPUgGy0o9o2itVEL4zwzRWPrNDp4fivhMA87QzbzFkDvX9B6PBb1R/3EFy1uSAk22ovyK/fMmN6GRTNeDQdGRi/U64Ys9mA+UjzBi22gy8ZIgFfcnCfJIinMO5PCh2BJ2AQq3kKxe4AMEQmeno=';\r\n\r\n\t//Setting the secret key environnement de PRODUCTION\r\n\t//\"aud\": \"https://boxstva-client.stva.com\",\r\n\t$secret_key = 'Rn2ZvoU+dTOtpE/BOUEuMaf65G2l7lA1nDJV56hmLcl17Y6F2EPCSIrKRCCVWc/Zda7m5Bp/g9BYUIRVTvgmtlcghGRBtswGFwMjq0Ye4QVtmpa8qZBI0sTHGjnbwTvmqZmf1v2TAcJWsAIJsRcoX0IchGvhaEKUMnLAXAUQT4mBhSdUY7H/ZckUthciFveKtxvmKMfjOLJNqciD8fVapuzQBqSRzFhTifVceLG1EmouRnoE5vg3RERwEhpVqFmt0fo+VCOinAR0nHG5Nq0XWXUTmGGsbOcDljLxz+oLAN28cffMc+6OfxkRX3L5ILId3pHMvV+MJns9FCZSA6+u87s3K31fLARCvVP6aVXXRn+M6CGBLxjQtbGopeQCHBRaliNxGr5LJIAkLFusBeG7jqIpGToxqy+D87tiYrg1zG2iRFTkKtvMJRZxdEkCnwJx4jOmuVboKCdtAqCQNX9e4I6jKp+Gs8edSbbV+17TY422DqV+sOXIxMA6udZ1vWm9eDE25dVVoRfiQXC7U/BLEGkV3ocs5du15nD1+NEODqlrVW+2WceQ1yQcSF4hRsU7Wk1pJ+aMRvFkx6PV028nSLExxTTPkxw07BmmDU5W9E6KbLB1/NFtseSyzgxTacGlFEVxmS+Zq846NLcNTrwQuM15Bub4zAy1N8Qv2NeQs4I=';\r\n\t\r\n\t// Creating the signature, a hash with the s512 algorithm and the secret key. The signature is also base64 encoded.\r\n\t$signature = base64_encode(hash_hmac('sha512', $header_payload, $secret_key, true));\r\n\t//$signature = hash_hmac('sha512', $header_payload, $secret_key, true);\r\n\t\r\n\t// Creating the JWT token by concatenating the signature with the header and payload, that looks like this:\r\n\t$jwt_token = $header_payload . '.' . $signature;\r\n\t\r\n\t//listing the resulted JWT\r\n\t//echo $jwt_token;\r\n\t//print $jwt_token;\r\n\treturn $jwt_token;\r\n\t\r\n\t//$decoded_jwt = explode(\".\",$jwt_token);\r\n\t//$decoded_header = base64_decode($decoded_jwt[0]);\r\n\t//$decoded_payload = base64_decode($decoded_jwt[1]);\r\n\t//$decoded_signature = base64_decode($decoded_jwt[2]);\r\n\t//echo $decoded_signature;\r\n\t\r\n\t//die();\r\n\r\n\r\n//\t\t$data = 'my data';\r\n\t\t\r\n//\t\t//Crée une nouvelle clé privée et publique\r\n//\t\t$new_key_pair = openssl_pkey_new(array(\r\n//\t\t\t\t\"private_key_bits\" => 1024,\r\n//\t\t\t\t\"private_key_type\" => OPENSSL_KEYTYPE_RSA,\r\n//\t\t));\r\n//\t\topenssl_pkey_export($new_key_pair, $private_key_pem);\r\n\t\t\r\n//\t\t$details = openssl_pkey_get_details($new_key_pair);\r\n//\t\t$public_key_pem = $details['key'];\r\n\t\t\r\n//\t\t//Création de la signature\r\n//\t\topenssl_sign($data, $signature, $private_key_pem, OPENSSL_ALGO_SHA1);\r\n\t\t\r\n//\t\t//Sauvegarde pour utilisation ultérieur\r\n//\t\tfile_put_contents('private_key.pem', $private_key_pem);\r\n//\t\tfile_put_contents('public_key.pem', $public_key_pem);\r\n//\t\tfile_put_contents('signature.dat', $signature);\r\n//\t\tprint $private_key_pem;\r\n//\t\t//Vérification de la signature\r\n//\t\t$r = openssl_verify($data, $signature, $public_key_pem, \"sha1WithRSAEncryption\");\r\n//\t\tvar_dump($r);\r\n\t}",
"public function getSignature(): string\n {\n return $this->signature;\n }",
"public function getSignature(): string\n {\n return $this->signature;\n }",
"public function parsePayload()\n {\n return($this->_payload);\n }",
"private function getTimestamp($signature)\n {\n $items = explode(\",\", $signature);\n\n foreach ($items as $item) {\n $itemParts = explode(\"=\", $item, 2);\n\n if ($itemParts[0] != \"t\") {\n continue;\n }\n\n if (is_numeric($itemParts[1])) {\n return intval($itemParts[1]);\n }\n\n break;\n }\n\n throw new SignatureVerificationException(\n \"Unable to extract timestamp from signature\"\n );\n }",
"public function getSignature() : string\n {\n return $this->signature;\n }"
]
| [
"0.6365519",
"0.6182076",
"0.6014631",
"0.59967875",
"0.5973378",
"0.59643054",
"0.5928119",
"0.58989316",
"0.58907944",
"0.5845108",
"0.5814384",
"0.57867175",
"0.574677",
"0.57120734",
"0.57099867",
"0.57099867",
"0.57099867",
"0.568939",
"0.568939",
"0.568939",
"0.568939",
"0.568939",
"0.5682084",
"0.56614476",
"0.5643814",
"0.563988",
"0.563988",
"0.5635916",
"0.56008023",
"0.55851644"
]
| 0.67598474 | 0 |
Computes the signature for a given payload and secret. | private function computeSignature($payload, $secret)
{
return hash_hmac("sha256", $payload, $secret);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function signPayload($payload, $secret, $timestamp = 'now')\n {\n if ($timestamp == 'now') {\n $timestamp = time();\n }\n\n $payload = is_string($payload) ? $payload : json_encode($payload);\n $timedPayload = \"$timestamp.$payload\";\n $value = $this->computeSignature($timedPayload, $secret);\n\n $signature = \"t=$timestamp,v=$value\";\n return $signature;\n }",
"private static function createMessageSig($params, $secret){\r\n return hash_hmac('md5', $params, $secret);\r\n }",
"public static function getSignatureHash($params, $secret) {\n return md5(self::getSignatureString($params, $secret));\n }",
"protected function generate_signature($payload_params, $timestamp)\n {\n $payload = \"timestamp:{$timestamp}\"; \n foreach ($payload_params as $key => $value) {\n $payload = \"{$payload},{$key}:{$value}\";\n }\n $tmp_signature = hash_hmac(\"sha256\", $payload, $this->client_secret);\n $base64_signature = trim(base64_encode($tmp_signature));\n return $base64_signature;\n }",
"abstract public function build_signature($request, $consumer, $token);",
"abstract public function build_signature($request, $consumer, $token);",
"public function signMessage($secretKey);",
"public static function getSignatureString($params, $secret) {\n $values = array();\n self::extractParamValues($params, $values);\n sort($values, SORT_STRING);\n $string = $secret . implode('', $values);\n return $string;\n }",
"private function calcSign($clientId, $secret, $timestamp) {\n\n $str = $clientId . $this->access_token . $timestamp;\n $hash = hash_hmac('sha256', $str, $secret);\n $hashInBase64 = (string)$hash;\n $signUp = strtoupper($hashInBase64);\n return $signUp;\n }",
"public function generateSignature($signingString, $secret)\n {\n // base64-encode the binary result of the HMAC computation.\n\n return base64_encode(hash_hmac(\n 'sha256',\n $signingString,\n pack(\"H*\", $secret),\n true\n ));\n }",
"public static function generateSignature($params)\n {\n $queryParams = $params . getenv('API_KEY') . getenv('API_SECRET');\n $signature = md5($queryParams);\n\n return $signature;\n }",
"public function doSignature($login, $secret_word)\n {\n return $login . '|' . $this->hash->doHash($secret_word);\n }",
"public function signaturekey($tokenSecret='') {\n \n $consumerSecret = littlemdesign_web_http_URL::percentEncode($this->secret);\n if(!empty($tokenSecret)) {\n $tokenSecret = littlemdesign_web_http_URL::percentEncode($tokenSecret);\n }\n \n $signingKey = \"$consumerSecret&$tokenSecret\";\n \n /* all done */\n \n return $signingKey;\n }",
"public static function generateSignature(InstagramApp $app, $endpoint, $params)\n {\n $signature = $endpoint;\n ksort($params);\n foreach ($params as $key => $value) {\n $signature .= \"|$key=$value\";\n }\n\n return hash_hmac('sha256', $signature, $app->getSecret(), false);\n }",
"protected function generateSignature()\n {\n // set the expire time to 5 minutes\n $expires = time() + 300;\n\n // put the parameters in a different line\n $stringToSign = $this->accessID.\"\\n\".$expires;\n\n // get the binary output of the hmac has\n $binarySignature = hash_hmac('sha1', $stringToSign, $this->secretKey, true);\n\n // Base64-encode and url-encode\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n return array('expires' => $expires, 'signature' => $urlSafeSignature);\n }",
"public function getSignature()\n {\n $input = $this->getArgs();\n\n $str = \"\";\n foreach ($input as $key => $val) {\n $str .= $key . \"=\" . $val . \"&\";\n }\n\n $str .= \"password=\" . $this->config->password;\n return $this->hashFunction($str);\n }",
"private function generate_signature()\n {\n $phrase = implode('', func_get_args());\n /**\n * Sign data and make final signature\n */\n $signature = '';\n $private_key_id = openssl_pkey_get_private($this->private_key);\n if (!openssl_sign($phrase, $signature, $private_key_id, OPENSSL_ALGO_SHA1)) {\n throw new BankException('OPEN SSL SIGN ERROR');\n }\n\n return $signature;\n }",
"public function sign($http_method, $url, $params, $secret) {\n $sig = array(\n strtoupper($http_method),\n preg_replace('/%7E/', '~', rawurlencode($url)),\n rawurlencode($this->get_signable_parameters($params)),\n );\n\n $base_string = implode('&', $sig);\n $sig = base64_encode(hash_hmac('sha1', $base_string, $secret, true));\n return $sig;\n }",
"protected function _sign_string($string, $secret) {\n\t\treturn hash_hmac(\"sha1\", $string, $secret);\n\t}",
"public function mefSignature() {\r\n\t$encoded_header = base64_encode('{\"alg\": \"HS512\",\"typ\": \"JWT\"}');\r\n\t$iss = 'CISCAR';\r\n\tif(isset($_GET['annuaire']) && $_GET['annuaire'] == 2 )\r\n\t{\r\n\t\t\t$iss = 'GCR';\r\n\t}\r\n\t// base64 encodes the payload json\r\n\t$encoded_payload = base64_encode('{\r\n\t\t\t\"iat\": \"'.time().'\",\r\n\t\t\t\"iss\": \"'.$iss.'\",\r\n\t\t\t\"aud\": \"https://boxstva-client.stva.com\",\r\n\t\t\t\"sub\": \"'.$this->getIndividuID().'\",\r\n\t\t\t\"family_name\": \"'.utf8_encode($this->getNom()).'\",\r\n\t\t\t\"given_name\": \"'.utf8_encode($this->getPrenom()).'\",\r\n\t\t\t\"ordering_party\": \"'.$this->getRolePrinc().'\",\r\n\t\t\t\"entities\": \"'.$this->getRattachements().'\"\r\n\t\t}');\r\n\t\r\n\t// base64 strings are concatenated to one that looks like this\r\n\t$header_payload = $encoded_header . '.' . $encoded_payload;\r\n\t\r\n\t//Setting the secret key environnement de Pre-PROD\r\n\t//\"aud\": \"http://box-gcr-pp.stva.com.s3-website-eu-west-1.amazonaws.com\",\r\n\t//$secret_key = '+XgiH7AFTCCUSbuFyMiqYThoStVW7etx32VRhSAKvCrqZPK2rZ4r1gtXoBlZHEismbALi8KKdmdRd3MnoH/19nfwIOV0+tX8blaUy/cQLxCQmfL8BlWuDutdegs72js2zvGpbS1YxXgjWhd4RjsVPn0HSL7q3EBJBORwAELOpI4GZuqSCn1n/R/veZiq7giAv7Gxi+J1A+EOTXtOzZSiQa/tYvcm6xaPTNPzP9HdgxAeKMN4FV44dG+Q66wD14WYOBAo1IPHKvAdWSS53uwRVAb7HDDfflVLcib851LG7fLC6JXaUmdK0iTEU3qJV32wzlF5phax9t16GdJfmCqAxJDMHx0iIVtZYajZPHnPYzXoHHCSilHmPoPZZkmKjlC12L1m87QKVySqP9K3J9fORW+Tn3QIkIcvl+GA4vqomk7/eVP8NT9MwIOvV9pjMJl+cGIoIYYQZmqQ3+Pa7d1NjV0bx6I9WlJNAKYxC5zFvVzqlx5j/H5Wq91WLOrZZNGaE/kygrLmyCYWQiCNzNbwvEsAgCPUgGy0o9o2itVEL4zwzRWPrNDp4fivhMA87QzbzFkDvX9B6PBb1R/3EFy1uSAk22ovyK/fMmN6GRTNeDQdGRi/U64Ys9mA+UjzBi22gy8ZIgFfcnCfJIinMO5PCh2BJ2AQq3kKxe4AMEQmeno=';\r\n\r\n\t//Setting the secret key environnement de PRODUCTION\r\n\t//\"aud\": \"https://boxstva-client.stva.com\",\r\n\t$secret_key = 'Rn2ZvoU+dTOtpE/BOUEuMaf65G2l7lA1nDJV56hmLcl17Y6F2EPCSIrKRCCVWc/Zda7m5Bp/g9BYUIRVTvgmtlcghGRBtswGFwMjq0Ye4QVtmpa8qZBI0sTHGjnbwTvmqZmf1v2TAcJWsAIJsRcoX0IchGvhaEKUMnLAXAUQT4mBhSdUY7H/ZckUthciFveKtxvmKMfjOLJNqciD8fVapuzQBqSRzFhTifVceLG1EmouRnoE5vg3RERwEhpVqFmt0fo+VCOinAR0nHG5Nq0XWXUTmGGsbOcDljLxz+oLAN28cffMc+6OfxkRX3L5ILId3pHMvV+MJns9FCZSA6+u87s3K31fLARCvVP6aVXXRn+M6CGBLxjQtbGopeQCHBRaliNxGr5LJIAkLFusBeG7jqIpGToxqy+D87tiYrg1zG2iRFTkKtvMJRZxdEkCnwJx4jOmuVboKCdtAqCQNX9e4I6jKp+Gs8edSbbV+17TY422DqV+sOXIxMA6udZ1vWm9eDE25dVVoRfiQXC7U/BLEGkV3ocs5du15nD1+NEODqlrVW+2WceQ1yQcSF4hRsU7Wk1pJ+aMRvFkx6PV028nSLExxTTPkxw07BmmDU5W9E6KbLB1/NFtseSyzgxTacGlFEVxmS+Zq846NLcNTrwQuM15Bub4zAy1N8Qv2NeQs4I=';\r\n\t\r\n\t// Creating the signature, a hash with the s512 algorithm and the secret key. The signature is also base64 encoded.\r\n\t$signature = base64_encode(hash_hmac('sha512', $header_payload, $secret_key, true));\r\n\t//$signature = hash_hmac('sha512', $header_payload, $secret_key, true);\r\n\t\r\n\t// Creating the JWT token by concatenating the signature with the header and payload, that looks like this:\r\n\t$jwt_token = $header_payload . '.' . $signature;\r\n\t\r\n\t//listing the resulted JWT\r\n\t//echo $jwt_token;\r\n\t//print $jwt_token;\r\n\treturn $jwt_token;\r\n\t\r\n\t//$decoded_jwt = explode(\".\",$jwt_token);\r\n\t//$decoded_header = base64_decode($decoded_jwt[0]);\r\n\t//$decoded_payload = base64_decode($decoded_jwt[1]);\r\n\t//$decoded_signature = base64_decode($decoded_jwt[2]);\r\n\t//echo $decoded_signature;\r\n\t\r\n\t//die();\r\n\r\n\r\n//\t\t$data = 'my data';\r\n\t\t\r\n//\t\t//Crée une nouvelle clé privée et publique\r\n//\t\t$new_key_pair = openssl_pkey_new(array(\r\n//\t\t\t\t\"private_key_bits\" => 1024,\r\n//\t\t\t\t\"private_key_type\" => OPENSSL_KEYTYPE_RSA,\r\n//\t\t));\r\n//\t\topenssl_pkey_export($new_key_pair, $private_key_pem);\r\n\t\t\r\n//\t\t$details = openssl_pkey_get_details($new_key_pair);\r\n//\t\t$public_key_pem = $details['key'];\r\n\t\t\r\n//\t\t//Création de la signature\r\n//\t\topenssl_sign($data, $signature, $private_key_pem, OPENSSL_ALGO_SHA1);\r\n\t\t\r\n//\t\t//Sauvegarde pour utilisation ultérieur\r\n//\t\tfile_put_contents('private_key.pem', $private_key_pem);\r\n//\t\tfile_put_contents('public_key.pem', $public_key_pem);\r\n//\t\tfile_put_contents('signature.dat', $signature);\r\n//\t\tprint $private_key_pem;\r\n//\t\t//Vérification de la signature\r\n//\t\t$r = openssl_verify($data, $signature, $public_key_pem, \"sha1WithRSAEncryption\");\r\n//\t\tvar_dump($r);\r\n\t}",
"public function sign(string $payload) : string {\n $privateKey = openssl_pkey_get_private($this->privateKey, $this->passphrase);\n openssl_sign($payload, $signature, $privateKey, $this->getAlgorithm());\n return $signature;\n }",
"public function getSignature()\n {\n $signString= sprintf(\"%s\\n%s\\n%s\\n%d\", $this->topic, $this->consumerId, $this->message->getMessageHandle(), $this->time);\n return base64_encode(hash_hmac('sha1', $signString, $this->getAuthorization()->getAccessSecret(), true));\n }",
"private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}",
"protected function getSignature(array $parameters, $algorithm, $secret, $salt = null)\n {\n if (!$this->isValidAlgorithm($algorithm)) {\n return false;\n }\n\n // Add some salt\n if (!isset($salt)) {\n $salt = Str::random(16);\n }\n\n $parameters['salt'] = $salt;\n $parameters['secret'] = $secret;\n\n // Sort on key\n ksort($parameters);\n\n // Turn into a string\n $base = http_build_query($parameters);\n\n // And... hash!\n $signature = hash($algorithm, $base);\n\n return $algorithm . ':' . $parameters['salt'] . ':' . $signature;\n }",
"private function getSignature(): string {\r\n return base64_encode(hash_hmac(\"sha1\", $this->buildSigningBase(), $this->buildSigningKey(), true));\r\n }",
"function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }",
"function signPolicy($policy) {\n if (!function_exists('binsha1'))\n {\n if (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n function binsha1($d) { return sha1($d, true); }\n } else {\n function binsha1($d) { return pack('H*', sha1($d)); }\n }\n }\n\n $aws_secret = $this->_secretAccessKey;\n\n if (strlen($aws_secret) == 40)\n $aws_secret = $aws_secret.str_repeat(chr(0), 24);\n\n $ipad = str_repeat(chr(0x36), 64);\n $opad = str_repeat(chr(0x5c), 64);\n\n $hmac = binsha1(($aws_secret^$opad).binsha1(($aws_secret^$ipad).$policy));\n return base64_encode($hmac);\n }",
"public function signRequest(OAuth_Request $request, $consumer_secret, $token_secret = '');",
"private function sign ($postbody = '')\n\t{\n\t\t$get = array ();\n\t\t$get['time'] = time ();\n\t\t$get['random'] = mt_rand ();\n\t\t$get['reseller'] = CWRESELLER_RESELLER_ID;\n\n\t\t$json = implode (',', $get) . '|' . $postbody;\n\n\t\t$privatekey = openssl_get_privatekey ('file://' . CWRESELLER_PRIVATE_KEY);\n\n\t\t$signature = null;\n\t\topenssl_sign ($json, $signature, $privatekey);\n\n\t\t$get['signature'] = base64_encode ($signature);\n\t\t$get['debug'] = isset ($_GET['debug']) ? 1 : 0;\n\n\t\treturn $get;\n\t}",
"public function getSignature();"
]
| [
"0.7342053",
"0.67038405",
"0.6635904",
"0.66140556",
"0.65715873",
"0.65715873",
"0.6407757",
"0.63133484",
"0.63053685",
"0.6294876",
"0.6267173",
"0.609098",
"0.6086867",
"0.599443",
"0.59915304",
"0.5937906",
"0.59037966",
"0.5900572",
"0.58357143",
"0.5834017",
"0.57554245",
"0.5736922",
"0.5713749",
"0.5708781",
"0.5683654",
"0.56435525",
"0.557142",
"0.55580014",
"0.55243206",
"0.5518016"
]
| 0.85240483 | 0 |
TODO: Implement toSlackObjectArray() method. | public function toSlackObjectArray(): array
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toSlackObjectArray(): array;",
"public function toSlackObjectArray(): array\n {\n $message = [\n 'text' => $this->text,\n 'mrkdwn' => $this->markDown,\n 'response_type' => $this->responseType,\n ];\n\n if ($this->hasChannel()) {\n $message['channel'] = $this->channel;\n }\n\n if ($this->hasBlocks()) {\n $blocks = [];\n /** @var LayoutBlock $block */\n foreach ($this->blocks as $block) {\n $blocks[] = $block->toSlackObjectArray();\n }\n $message['blocks'] = $blocks;\n }\n\n if ($this->hasAttachments()) {\n $attachments = [];\n foreach ($this->attachments as $attachment) {\n $attachments[] = $attachment;\n }\n $message['attachments'] = $attachments;\n }\n\n return $message;\n }",
"public function toMessage(): array;",
"public function getAsArray() {\n return $this->message;\n }",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): array\n {\n }",
"public function toArray()\n {\n return [\n 'title' => $this->title,\n 'body' => $this->body,\n 'sound' => $this->sound,\n 'badge' => $this->badge,\n 'ttl' => $this->ttl,\n 'channelId' => $this->channelId,\n 'data' => empty($this->jsonData) ? '{}' : json_encode($this->jsonData),\n ];\n }",
"public function toArray(): array\n {\n /**\n * $get_object_vars = get_object_vars($this);\n unset($get_object_vars['parsedBody']);\n return $get_object_vars;\n */\n return (array)$this;\n }",
"public function toArray()\r\n {\r\n \treturn array(\r\n \t\t'guid'\t=> $this->guid,\r\n \t\t'pollGuid'\t=> $this->pollGuid,\r\n \t\t'text' => $this->text,\r\n \t\t'hits' => $this->hits\r\n \t);\r\n }",
"public function toArray($notifiable)\n {\n return $this->chat->toArray();\n }",
"public function pullTransientMessage(): object|array;",
"public function toArray(): array\n {\n return [\n 'message' => $this->message,\n 'types' => $this->types,\n 'dismissible' => $this->dismissible,\n ];\n }",
"public function convertItemArray() {}",
"public function getPayload(): array;",
"public function getPayload(): array;",
"public function toArray()\n {\n $message = [\n 'url' => $this->url,\n 'title' => $this->subject,\n 'message' => $this->body,\n ];\n\n if ($this->icon) {\n $message['image_url'] = $this->icon;\n }\n\n return $message;\n }",
"public function asArray()\n {\n }",
"public function toArray()\n {\n return [\n 'title' => MessengerUtils::checkStringLength($this->title, 80),\n 'item_url' => $this->item_url,\n 'image_url' => $this->image_url,\n 'subtitle' => MessengerUtils::checkStringLength($this->subtitle, 80),\n 'buttons' => MessengerUtils::checkArraySize($this->buttons, 3)\n ];\n }",
"protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}",
"public function toSearchableArray() : array\n {\n $array = $this->fresh()->toArray();\n\n // algolia 프리티어는 한 객체의 크기를 제한합니다.\n $array['body'] = Str::limit($array['body'], 400);\n\n return $array + ['created_at_timestamp' => $this->created_at->timestamp];\n }",
"public function objectToArray($object): static;",
"public function getAsArray();",
"public function toArray(): array\n {\n $optionalFields = array_filter([\n 'emoji' => $this->emoji,\n ]);\n\n return array_merge([\n 'type' => 'plain_text',\n 'text' => $this->text,\n ], $optionalFields);\n }",
"public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}",
"function toArray($object);",
"public function toArray($notifiable)\n {\n return $this->message;\n }",
"public function testToArray0()\n{\n\n $actual = $this->slackAttachmentField->toArray();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function toArray($request)\n {\n $type = array_search($this->type, SupportChatMessage::TYPES);\n $resource = self::RESOURCES[$type];\n $message = new $resource($this->messagable);\n\n $user = auth()->user();\n $createdDate = $this->created_at;\n if($user->isPetOwner()){\n $utc = $user->owner->utc;\n if($utc > 0)\n $createdDate = $createdDate->addHours($utc);\n elseif($utc < 0)\n $createdDate = $createdDate->subHours($utc);\n }\n\n return [\n 'id' => $this->id,\n 'type' => $type,\n 'message' => $message,\n 'date_time_created' => $createdDate->toDateTimeString(),\n 'is_like' => $this->is_like,\n 'sender' => ($this->sender_id ? new OwnerResource($this->sender, true, false, false) : null)\n ];\n }"
]
| [
"0.925128",
"0.7939471",
"0.6608399",
"0.60131305",
"0.59342927",
"0.59342927",
"0.59342927",
"0.58991796",
"0.58316785",
"0.58112717",
"0.5803808",
"0.5801347",
"0.57833487",
"0.5755184",
"0.57480764",
"0.5713371",
"0.5713371",
"0.57118356",
"0.5681555",
"0.5662648",
"0.560678",
"0.5603613",
"0.560156",
"0.5596",
"0.5590342",
"0.5587136",
"0.5585368",
"0.5577555",
"0.55467236",
"0.55348366"
]
| 0.9040295 | 1 |
news endpoints public function getNewsAction($year = null, $month = null, $day = null, $slug = null, $mode = null) | public function getNewsAction(Request $request)
{
$mode = $request->get('mode');
$year = $request->get('year');
$month = $request->get('month');
$day = $request->get('day');
if ($mode == 'archive') {
$news = $this->get('renaissance.service.news')->getArchive();
} elseif ($year) {
$news = $this->get('renaissance.service.news')->getArchiveByYear($year);
} elseif ($year && $month) {
$news = $this->get('renaissance.service.news')->getArchiveByYearAndMonth($year, $month);
} elseif ($year && $month && $day && $slug) {
$news = $this->get('renaissance.service.news')->getNews($year, $month, $day, $slug);
} else {
$news = $this->get('renaissance.service.news')->getNewsLatest();
}
$view = $this->view($news, 200);
return $this->handleView($view);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionIndex()\n {\n /* Здесь генерируется SQL-запрос для выборки новостей в соотвествии с условиями (все|категория|год и месяц)\n В данном случае не используется метод SQL_Request_Creator, т.к для пагинации требуется использование DAO */\n $where = '';\n switch(true){\n case !empty($_GET['month']):\n $where .= ' DATE_FORMAT(`date`, \\'%M\\') = \\''.(string)$_GET['month'].'\\' and';\n case !empty($_GET['year']):\n $where .= ' DATE_FORMAT(`date`, \\'%Y\\') = \\''.(string)$_GET['year'].'\\'';\n break;\n default:\n $where = 1;\n }\n\n $query = News::find()->where($where);\n\n if(true == !empty($_GET['category'])){\n $query = News::find()->where('theme_id IN (SELECT theme_id\n FROM themes\n WHERE theme_title = \\''.(string)$_GET['category'].'\\')');\n\n }\n\n // Формирование пагинации\n $pagination = new Pagination(['totalCount' => $query->count(), 'pageSize' => 5]);\n $selectNews = $query->orderBy('date DESC')\n ->offset($pagination->offset)\n ->limit($pagination->limit)\n ->all();\n\n // Формирование сортировки по годам и месяцам\n $sql = $this->SQL_Request_Creator('groupByYearAndMonth');\n $groupByYearAndMonthFromBD = \\Yii::$app->db->createCommand($sql)->queryAll();\n\n // Обработка данных сортировки по годам и мсяцам в удобном для вывода виде\n foreach ($groupByYearAndMonthFromBD as $item){\n $sortByYearAndMonthForView[$item['year']][$item['month']] = $item['count_news'];\n }\n\n // Формирование сортировки по категории\n $sql = $this->SQL_Request_Creator('sortByCategory');\n $selectCategory = \\Yii::$app->db->createCommand($sql)->queryAll();\n\n return $this->render('index', ['sortByYearAndMonthForView' => $sortByYearAndMonthForView,\n 'selectNews'=> $selectNews,\n 'selectCategory' => $selectCategory,\n 'pagination' => $pagination,\n ]);\n }",
"public function getNewsOn(){\n\t\t$numargs = func_num_args();\n\t\tif ($numargs < 3) return false;\n\t\t$param = ''; $arg_list = func_get_args();\n\t\tif ($numargs > 3){\t\t\t\n\t\t\tfor($i=3; $i < $numargs; $i++)\n\t\t\t\t$param .= strtolower($arg_list[$i]).\"/\";\n\t\t}\n\t\t$yr = $arg_list[0]; $mon = $arg_list[1]; $dat = $arg_list[2];\n\t\t$res = $this->espn_get($this->uriapi . $this->apiV . \"/\" . \"sports\" . \"/\" . $param . \"news/dates/\" . $yr . $mon . $dat . $this->apiR . $this->apiKey);\n\t\tif ($this->rawop)\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn $this->streamline($res);\n\t}",
"public function getNews()\r\n\t{\r\n\t\treturn $this->makeRequest('/news');\r\n\t}",
"public function showWithSlugAction ($slug, $year, $month, $day) {\n \n $em = $this->getDoctrine()->getManager();\n \n $notice = $em\n ->getRepository('FenchyNoticeBundle:Notice')\n ->findFullDetailedWithSlug($slug);\n\n if( ! ($notice instanceof \\Fenchy\\NoticeBundle\\Entity\\Notice) ) \n throw $this->createNotFoundException ();\n \n $pagination = $this->container->getParameter('reviews_pagination');\n $userLoggedIn = $this->get('security.context')->getToken()->getUser();\n $reviewRepo = $em->getRepository('FenchyNoticeBundle:Review');\n \n if ( $notice->getUser() == $userLoggedIn ) \n $usersOwnListing = true;\n else\n $usersOwnListing = false;\n \n $initialReviewsP = $reviewRepo->findByInJSON(\n $this->container->get('router'),\n array('aboutNotice'=>$notice->getId(), 'type'=>Review::TYPE_POSITIVE),\n array('created_at'=>'DESC'), $pagination+1, 0);\n $initialReviewsPCount = $reviewRepo->findCount(\n array('aboutNotice'=>$notice->getId(), 'type'=>Review::TYPE_POSITIVE) );\n \n $initialReviewsN = $reviewRepo->findByInJSON(\n $this->container->get('router'),\n array('aboutNotice'=>$notice->getId(), 'type'=>Review::TYPE_NEGATIVE),\n array('created_at'=>'DESC'), $pagination+1, 0);\n $initialReviewsNCount = $reviewRepo->findCount(\n array('aboutNotice'=>$notice->getId(), 'type'=>Review::TYPE_NEGATIVE) );\n \n $userId = $notice->getUser()->getId();\n \n if ( $userId != NULL ) {\n \n $userOther = $this->getDoctrine()->getManager()->getRepository('UserBundle:User')->getAllData( $userId );\n\n if ( ! $userOther instanceof \\Fenchy\\UserBundle\\Entity\\User )\n return new RedirectResponse($this->container->get('router')->generate('fenchy_frontend_homepage'));\n $displayUser = $userOther;\n $usersOwnProfile = 0;\n }\n \n \n\n \n return $this->render('FenchyRegularUserBundle:Listing:show.html.twig', array(\n 'notice' => $notice,\n 'usersOwnListing' => $usersOwnListing,\n 'displayUser' => $displayUser,\n 'pagination' => $pagination,\n 'initialReviewsP' => array(\"list\"=>$initialReviewsP, \"count\"=>$initialReviewsPCount),\n 'initialReviewsN' => array(\"list\"=>$initialReviewsN, \"count\"=>$initialReviewsNCount)\n ));\n }",
"public function newsAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\t\t\t$this->view->news = $db->fetchAll($db->select()->from('inwestycje_news')->order('data DESC')->where('id_inwest = ?', $id));\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t}",
"public function getNewsListAction(){\n if(I(\"get.status\") == -1) {\n $data[\"status\"] = -1;\n }else{\n $want = array(\"menuid\" => \"menu_id\", \"title\" => \"title\");\n $other = array(\"status\");\n $data = getdata(I(\"post.\", \"\", \"htmlspecialchars\"), $want, $other);\n }\n $page = $_REQUEST[\"p\"] ? $_REQUEST[\"p\"] : 1;\n $pageSize = 5;\n $result = D('News') -> getList($data,$page,$pageSize);\n $count = D('News') -> getAllCount($data);\n $Page= new \\Think\\Page($count,5);// 实例化分页类 传入总记录数和每页显示的记录数(25)\n $Page = setPage($Page);\n $Page->lastSuffix = false;\n $show = bootstrap_page_style($Page->show());\n $menulist = D('Menu') -> getList();\n $positionlist = D('Position')->getList();\n if(is_numeric($data[\"menu_id\"])){\n $this -> assign(\"menuid\",$data[\"menu_id\"]);\n }\n $this -> assign(\"positionlist\",$positionlist);\n $this -> assign(\"menulist\",$menulist);\n $this -> assign(\"page\",$show);\n $this -> assign(\"newslist\",$result);\n $this -> display();\n }",
"public function show(news $news)\n {\n //\n }",
"public function show(News $news)\n {\n //\n }",
"public function show(News $news)\n {\n //\n }",
"public function show(News $news)\n {\n //\n }",
"public function show(News $news)\n {\n //\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $news = $em->getRepository('NeoxisBundle:news')->findAll();\n\n return $this->render('news/index.html.twig', array(\n 'news' => $news,\n ));\n }",
"public function news();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('WrathContentBundle:News')->findAll();\n\n return $this->render('WrathContentBundle:News:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function show(News $news)\n {\n dd(__METHOD__);\n }",
"public function indexAction()\n {\n $slug = $this->params('slug');\n $module = $this->params('module');\n\n // Get Module Config\n $config = Pi::service('registry')->config->read($module);\n\n // Check deactivate view\n if ($config['admin_deactivate_view']) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('Page not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n\n // Get topic list\n $topicList = Pi::registry('topicList', 'news')->read();\n\n // Get author list\n $authorList = Pi::registry('authorList', 'news')->read();\n\n // Find story\n $story = $this->getModel('story')->find($slug, 'slug');\n if ($slug != $story['slug']) {\n return $this->redirect()->toRoute('', ['slug' => $story['slug']])->setStatusCode(301);\n }\n $story = Pi::api('story', 'news')->canonizeStory($story, $topicList, $authorList);\n\n // Check status\n if (!$story || $story['status'] != 1 || !in_array($story['type'], ['text', 'article', 'magazine', 'image', 'gallery', 'media', 'download'])) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('The story not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n\n // Check time_publish\n if ($story['time_publish'] > time()) {\n $this->getResponse()->setStatusCode(401);\n $this->terminate(__('The Story not publish.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n\n // Update Hits\n if ($config['story_all_hits']) {\n $this->getModel('story')->increment('hits', ['id' => $story['id']]);\n $this->getModel('link')->increment('hits', ['story' => $story['id']]);\n } else {\n if (!isset($_SESSION['hits_news'][$story['id']])) {\n if (!isset($_SESSION['hits_news'])) {\n $_SESSION['hits_news'] = [];\n }\n\n $_SESSION['hits_news'][$story['id']] = false;\n }\n\n if (!$_SESSION['hits_news'][$story['id']]) {\n $this->getModel('story')->increment('hits', ['id' => $story['id']]);\n $this->getModel('link')->increment('hits', ['story' => $story['id']]);\n $_SESSION['hits_news'][$story['id']] = true;\n }\n }\n\n // Links\n $link = Pi::api('story', 'news')->Link($story['id'], [$story['topic_main']]);\n $this->view()->assign('link', $link);\n\n // Related\n if ($config['show_related']) {\n $related = Pi::api('story', 'news')->Related($story['id'], $story['topic_main']);\n $this->view()->assign('relateds', $related);\n }\n\n // Attached\n if ($config['show_attach'] && $story['attach']) {\n $attach = Pi::api('story', 'news')->AttachList($story['id']);\n $this->view()->assign('attach', $attach);\n }\n\n // Attribute\n if ($config['show_attribute'] && $story['attribute']) {\n $attribute = Pi::api('attribute', 'news')->Story($story['id'], $story['topic_main']);\n $this->view()->assign('attribute', $attribute);\n }\n\n // Tag\n if ($config['show_tag'] && Pi::service('module')->isActive('tag')) {\n $tag = Pi::service('tag')->get($module, $story['id'], '');\n $this->view()->assign('tag', $tag);\n }\n\n // Author\n if ($config['show_author']) {\n $author = Pi::api('author', 'news')->getStorySingle($story['id']);\n $this->view()->assign('authors', $author);\n }\n\n // Set vote\n if ($config['vote_bar'] && Pi::service('module')->isActive('vote')) {\n $vote['point'] = $story['point'];\n $vote['count'] = $story['count'];\n $vote['item'] = $story['id'];\n $vote['table'] = 'story';\n $vote['module'] = $module;\n $vote['type'] = 'star';\n $this->view()->assign('vote', $vote);\n }\n\n // favourite\n if ($config['favourite_bar'] && Pi::service('module')->isActive('favourite')) {\n $favourite['is'] = Pi::api('favourite', 'favourite')->loadFavourite($module, 'story', $story['id']);\n $favourite['item'] = $story['id'];\n $favourite['table'] = 'story';\n $favourite['module'] = $module;\n $this->view()->assign('favourite', $favourite);\n\n $configFavourite = Pi::service('registry')->config->read('favourite');\n if ($configFavourite['favourite_list']) {\n $favouriteList = Pi::api('favourite', 'favourite')->listItemFavourite('news', 'story', $story['id']);\n $this->view()->assign('favouriteList', $favouriteList);\n }\n }\n\n // Set template\n switch ($story['type']) {\n case 'download':\n $template = 'story-download';\n break;\n\n case 'media':\n $template = 'story-media';\n break;\n\n case 'gallery':\n $template = 'story-gallery';\n break;\n\n case 'image':\n $template = 'story-image';\n break;\n\n case 'magazine':\n $template = 'story-magazine';\n break;\n\n case 'article':\n $template = 'story-article';\n break;\n\n case 'text':\n default:\n $template = 'story-text';\n break;\n }\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('news', 'story', $story['id']);\n }\n\n // Set view\n $this->view()->headTitle($story['seo_title']);\n $this->view()->headdescription($story['seo_description'], 'set');\n $this->view()->headkeywords($story['seo_keywords'], 'set');\n $this->view()->setTemplate($template);\n $this->view()->assign('story', $story);\n $this->view()->assign('config', $config);\n }",
"function url($date, $slug = null)\n{\n\t// pasre date\n\t$parsedDate = Carbon\\Carbon::parse($date)->format('Y/m');\n\treturn base_url('articles/'.$parsedDate.'/'.$slug);\n}",
"public function getNews()\n {\t\n \t$news = News::all();\n \treturn response()->json([ 'news' => $news ]);\n }",
"public function actionIndex()\n {\n $searchModel = new NewsSearch();\n\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n\n }",
"public function actionNews()\n {\n $title = '微站设置/图文设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('news',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new NewsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $news = $this->getDoctrine()->getEntityManager()\n ->getRepository('R3cNewsBundle:News')->findAll();\n\n return $this->render('R3cNewsBundle:News:index.html.twig', array('news' => $news));\n }",
"public function indexAction()\n {\n \t$em\t\t\t= $this->getDoctrine()->getEntityManager();\n \t$locale\t\t= $this->container->get('session')->getLocale();\n $entities\t= $em->getRepository(\"PiAppGedmoBundle:News\")->findAllByEntity($locale, 'object'); \n \n $NoLayout = $this->container->get('request')->query->get('NoLayout');\n if(!$NoLayout) \t$template = \"index.html.twig\"; else $template = \"index.html.twig\";\n\n return $this->render(\"PiAppGedmoBundle:News:$template\", array(\n 'entities' => $entities,\n 'NoLayout'\t=> $NoLayout,\n ));\n }",
"public function index()\n {\n return News::all();\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => News::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"private function getDashboardNews(){\n $this->dashboard->findDashboardNewsData();\n }",
"public function newsAction(Request $request): Response\n {\n $em = $this->get('doctrine.orm.entity_manager');\n $dql = \"SELECT a FROM AppBundle:Article a WHERE a.published = true\";\n $query = $em->createQuery($dql);\n\n $paginator = $this->get('knp_paginator');\n $news = $paginator->paginate(\n $query,\n $request->query->getInt('page', 1),\n 5\n );\n//\n// dump($news);\n// die;\n\n return $this->render('@App/front/news/news.html.twig', ['news' => $news]);\n }",
"public function getNewsFromCurrentRequest() {\n\t\t$pluginArguments = $this->tsRuntime->getControllerContext()->getRequest()->getPluginArguments();\n\t\tif (!empty($pluginArguments)) {\n\t\t\tforeach ($pluginArguments as $arguments) {\n\t\t\t\tif (!empty($arguments['@package']) &&\n\t\t\t\t\t\t$arguments['@package'] === 'Lelesys.Plugin.News'\n\t\t\t\t\t\t&& $arguments['@controller'] === 'News'\n\t\t\t\t\t\t&& $arguments['@action'] === 'show'\n\t\t\t\t\t\t&& !empty($arguments['news']['__identity'])) {\n\t\t\t\t\treturn $this->newsService->findById($arguments['news']['__identity']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function getNewsFromCurrentRequest() {\n\t\t$pluginArguments = $this->tsRuntime->getControllerContext()->getRequest()->getPluginArguments();\n\t\tif (!empty($pluginArguments)) {\n\t\t\tforeach ($pluginArguments as $arguments) {\n\t\t\t\tif (!empty($arguments['@package']) &&\n\t\t\t\t\t\t$arguments['@package'] === 'Lelesys.Plugin.News'\n\t\t\t\t\t\t&& $arguments['@controller'] === 'News'\n\t\t\t\t\t\t&& $arguments['@action'] === 'show'\n\t\t\t\t\t\t&& !empty($arguments['news']['__identity'])) {\n\t\t\t\t\treturn $this->newsService->findById($arguments['news']['__identity']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
]
| [
"0.6364564",
"0.620637",
"0.61925375",
"0.61565655",
"0.6021017",
"0.6006371",
"0.59837466",
"0.5957344",
"0.5957344",
"0.5957344",
"0.5957344",
"0.5928922",
"0.5881322",
"0.58200425",
"0.5807338",
"0.57846445",
"0.5777762",
"0.5777379",
"0.57763493",
"0.5748748",
"0.57310706",
"0.5708982",
"0.5702028",
"0.5699327",
"0.566132",
"0.5660096",
"0.5654476",
"0.5653606",
"0.564849",
"0.564849"
]
| 0.76076597 | 0 |
Skip selected node child items | public static function skipSelectedNodeChilds($id)
{
if (!empty($id)) {
// Skip child nodes for selected parent
$ids = self::getChildrenString($id);
// Implode ids
$implodeIds = Helper::convertMultiArray(',', $ids);
$explode = explode(',', $implodeIds);
$explode[] = $id;
$selectionList = self::find()->where(['NOT IN', 'id', $explode])->all();
return ArrayHelper::map($selectionList, 'id', 'name');
} else {
throw new Exception('Page ID cannot be null.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function skipNode()\n {\n }",
"public function getChildNodes() {}",
"public function getChildNodes() {}",
"public function removeChildNodes() {}",
"function getChildNodes() ;",
"public function getChildNodes();",
"public function skip() {\n parent::skip();\n foreach ($this->suites as $suite) {\n $suite->skip();\n }\n foreach ($this->cases as $case) {\n $case->skip();\n }\n }",
"public function getChildElements() {}",
"public function childElementsAllowed() {}",
"public function testFindAllOnNonRootElement(): void\n {\n $this->assertSelects(['Nested tag.'], $this->byNameTree->div?->findAll('a'));\n }",
"function skip() {\n # This method is meant to sidestep any expensive processing\n # a subclass might perform as part of next().\n $this->next();\n }",
"private function removeIrrelevantChildren(\\DOMNode $node)\n {\n if ($node->hasChildNodes()) {\n foreach ($node->childNodes as $child) {\n if (is_a($child, \\DOMText::class) && strlen(trim($child->wholeText)) === 0) {\n $node->removeChild($child);\n $this->removeIrrelevantChildren($node);\n }\n }\n }\n }",
"function wp_filter_out_block_nodes($nodes)\n {\n }",
"protected function deleteChildren() {}",
"public function nextInvisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_next($this->parent->children(), func_get_args(), 'invisible');\n }\n }",
"function dump_nodes($node, $indent) {\n\n if($node->hasChildren()) {\n foreach($node->child as $child) {\n if($child->attribute['class'] == 'test') {\n $node_value = new Node_Value();\n echo (\"!!!!-\" . $node_value->get_value($child) . \"-!!!<br/>\");\n unset($node_value);\n }\n dump_nodes($child, $indent+1);\n }\n }\n}",
"public function isChildOnly();",
"public function getNonSelectableLevelList() {}",
"protected function getNotSelectedRow(){\n return array('id' => '0', 'caption' => 'flt_all_categories');\n }",
"public function iterateChildren();",
"public function remove () {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t $node->parentNode->removeChild($node);\r\n\t}",
"function getSelectableParents()\n {\n $roles = $this->all();\n $tree = $this->findChildren($roles, 0, 1);\n\n //recursively go trough the array and delete....\n\n $trimmed_tree = $this->removeTreeNode($tree, $this->id);\n return $trimmed_tree;\n\n\n\n\n }",
"function remove_children(&$node) {\n\twhile ($node->firstChild) {\n\t\twhile ($node->firstChild->firstChild) {\n\t\t\tremove_children($node->firstChild);\n\t\t}\n\t\t$node->removeChild($node->firstChild);\n\t}\n}",
"public function test_group_one_group_node_appears_groupid_filter() {\n\n $params = array(\n 'coursemoduleid' => $this->assign1->cmid,\n 'groupid' => 'nextnodefilter',\n );\n\n $nodes = block_ajax_marking_nodes_builder_base::unmarked_nodes($params);\n\n $this->assertNotEmpty($nodes, 'No nodes returned');\n\n $foundnode = new stdClass();\n $count = 0;\n foreach ($nodes as $node) {\n if ($node->groupid == $this->group1->id) {\n $count++;\n $foundnode = $node;\n break;\n }\n }\n\n $this->assertNotEquals(0, $count, 'No nodes returned for groupid '.$this->group1->id);\n $this->assertEquals(1, $count, 'Too many nodes found');\n $this->assertEquals(1, $foundnode->itemcount, 'User should be hidden here due to other goup membership');\n }",
"public function test_no_group_memberships_group_node_appears_userid_filter() {\n\n // User 1 is in no groups. Ought to show up with groupid of 0. This ought to give us\n // a single node for groupid 0 with a count of 1.\n $params = array(\n 'coursemoduleid' => $this->assign1->cmid,\n 'groupid' => 0,\n 'userid' => 'nextnodefilter',\n );\n\n $nodes = block_ajax_marking_nodes_builder_base::unmarked_nodes($params);\n $this->assertCount(1, $nodes, 'Too many nodes!');\n $node = reset($nodes);\n\n $this->assertObjectHasAttribute('userid', $node);\n $this->assertEquals($this->user1->id, $node->userid, 'Wrong userid returned for groupid 0');\n $this->assertEquals(1, $node->itemcount);\n }",
"public function onlyDeepest()\n {\n return $this->filter(function (HasParentInterface $attribute): bool {\n return !$this->getByParent($attribute);\n });\n }",
"public function WantsChildren() {\r\n return false;\r\n }",
"public function getNonDefaultSiblings()\n {\n return $this->non_default_siblings;\n }",
"public function test_no_group_memberships_group_node_appears_groupid_filter() {\n\n // User 1 is in no groups. Ought to show up with groupid of 0. This ought to give us\n // a single node for groupid 0 with a count of 1.\n $params = array(\n 'coursemoduleid' => $this->assign1->cmid,\n 'groupid' => 'nextnodefilter',\n );\n\n $nodes = block_ajax_marking_nodes_builder_base::unmarked_nodes($params);\n\n $this->assertNotEmpty($nodes, 'No nodes returned');\n\n $foundnode = new stdClass();\n $count = 0;\n foreach ($nodes as $node) {\n if ($node->groupid == 0) {\n $count++;\n $foundnode = $node;\n break;\n }\n }\n\n $this->assertEquals(1, $count, 'Too many nodes found');\n $this->assertObjectHasAttribute('groupid', $foundnode);\n $this->assertEquals(0, $foundnode->groupid, 'Nothing returned for groupid 0');\n $this->assertEquals(1, $foundnode->itemcount);\n }",
"protected function controlActiveElements() {}"
]
| [
"0.6755333",
"0.60458994",
"0.60444665",
"0.58984053",
"0.57815963",
"0.57532305",
"0.5543235",
"0.54849666",
"0.5473077",
"0.5424268",
"0.54204667",
"0.54029596",
"0.5384752",
"0.52723616",
"0.5262759",
"0.5131269",
"0.508859",
"0.50470483",
"0.5031151",
"0.49849665",
"0.49797133",
"0.49492782",
"0.49254397",
"0.49021578",
"0.4901822",
"0.48699585",
"0.4844889",
"0.4844748",
"0.48419228",
"0.48314604"
]
| 0.61612433 | 1 |
get the Restriction Fields for the permission setups Should be used by all the controller before responding back to Request. | public function getRestrictionFields(Request $request)
{
/** Get the restriction fields from the security permission $restrictions */
$restrictions = [];
$permissionFilter = ($request->input());
if (!empty($permissionFilter) && isset($permissionFilter['route_url']) && isset($permissionFilter[ $permissionFilter['route_url'] ])) {
$restrictions = $permissionFilter[ $permissionFilter['route_url'] ];
}
return $restrictions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAccessRestrictions()\n {\n return $this->getFieldArray('506');\n }",
"public function getRestrictions() \n {\n return $this->_restrictions; \n }",
"public function getRestrictions()\n {\n return $this->restrictions;\n }",
"public function getRestrictions()\n {\n return $this->restrictions;\n }",
"function get_registration_required_fields() {\n\t\t$requiredFields = new RequiredFields(\n\t\t\t'FirstName',\n\t\t\t'Surname',\n\t\t\t'Email'\n\t\t);\n\t\t//TODO: don't add ticket field when multiple attendees allowed\n\t\t//if(!$event->MultipleBooking)\n\t\t\t$requiredFields->addRequiredField('Ticket');\n\t\t// Allow decorators to add extra required fields\n\t\t//$this->extend('updateRegistrationRequiredFields', $requiredFields);\n\t\treturn $requiredFields;\n\t}",
"public function getFrontEndRequiredFields();",
"public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}",
"function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}",
"public function getFields() {\n $modifiable_fields = [];\n $type = $this->getType();\n $bundle = $this->getBundle();\n // Get _all_ defined fields. This should return an associative array.\n $fields = Framework::instance()->fieldInfoFields();\n foreach ($fields as $field => $info) {\n if (isset($info['bundles'][$type]) && is_array($info['bundles'][$type]) && in_array($bundle, $info['bundles'][$type]) && $this->filter($field)) {\n $this->addModifier($modifiable_fields, 'field', $field);\n }\n }\n return $modifiable_fields;\n }",
"public function getFields()\n {\n return $this->fillable;\n }",
"public function getSupportedFields()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getViewRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$fields = array_values(array_diff($this->getHandler()->getSupportedFields(), $this->getRestrictedFields()));\n\t\t\t\t$array = new ArrayList($fields);\n\n\t\t\t\t$this->setResponse($array);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}",
"protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }",
"public function getRequiredFields() {\n return $this->source->getRequiredFields($this->filter);\n }",
"public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}",
"private function getRequiredFields()\n\t{\n\t\treturn $this->endpointRequiredFields;\n\t}",
"public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }",
"public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }",
"abstract protected function getMandatoryModelsFields();",
"public function getRequiredFields()\n {\n return $this->_aRequiredFields;\n }",
"public function permissions()\n {\n return $this->permissionModel->findAll();\n }",
"protected function restrict_fields()\n {\n }",
"protected function getPermissionMappings()\n {\n return [];\n }",
"public function getRequiredFields()\n {\n return $this->requiredFields;\n }",
"function _get_avail_fields() {\n\t\t$avail_fields = array();\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$avail_fields = $this->_get_fields_map_simple();\n\t\t} else {\n\t\t\t$avail_fields = $this->_get_fields_map_dynamic(true);\n\t\t}\n\t\treturn $avail_fields;\n\t}",
"public function getPermissions() {}",
"public function getPermissions() {}",
"public function getPermitProperties()\n {\n return $this->permitProperties;\n }",
"public function get_settings_fields() {\n\t\treturn tml_redirection_admin_get_settings_fields();\n\t}",
"public function & GetPermissions ();",
"public function getFields()\n {\n return $this->arr_defined_fields;\n }"
]
| [
"0.6868387",
"0.6856651",
"0.6727455",
"0.6727455",
"0.63605714",
"0.6289791",
"0.6163446",
"0.6146608",
"0.6102928",
"0.610287",
"0.60776556",
"0.6071833",
"0.6064252",
"0.60569876",
"0.6054282",
"0.60385185",
"0.60385185",
"0.6035281",
"0.6033547",
"0.60278106",
"0.60101014",
"0.5987407",
"0.59679836",
"0.5966499",
"0.5963289",
"0.5963289",
"0.59368265",
"0.59342235",
"0.5933571",
"0.59329253"
]
| 0.72743833 | 0 |
/ This method is used to get ONE restaurant by name now its used together with adding a restaurant noot anymore could be nice if we in the future would have a search funtion before they add a new one they could search for it if it exists | public function getOneRestaurant($name){
$query = "SELECT r.*, c.name as city_name FROM restaurant r JOIN city c ON r.city = c.id WHERE r.name ='{$name}' ";
$result = $this->mysqli->query($query);
while ($row = $result->fetch_object()) {
$restaurant = new Restaurant();
$restaurant->setId($row->id);
$restaurant->setName($row->name);
$restaurant->setLatitude($row->latitude);
$restaurant->setLongitude($row->longitude);
$restaurant->setWebsite($row->website);
$restaurant->setCity($row->city);
$restaurant->setFax($row->fax);
$restaurant->setHas_breakfast($row->hasbreakfast);
$restaurant->setHas_dinner($row->hasdinner);
$restaurant->setHas_lunch($row->haslunch);
$restaurant->setHittaURL($row->hittaURL);
$restaurant->setMail_city($row->mailcity);
$restaurant->setPhone($row->phone);
$restaurant->setStreet($row->street);
$restaurant->setType($row->type_name);
$restaurant->setZip($row->zipcode);
}
unset($result);
unset($row);
return $restaurant;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRestaurant()\n {\n $restaurant = Restaurant::getOneBy(array('_id' => $this->restaurant));\n return $restaurant;\n }",
"public function afficherRestaurant(){\r\n\t\t$sql=\"SElECT * From restaurant\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}",
"public function getRestaurant()\n {\n return $this->hasOne(Restaurant::className(), ['restaurantId' => 'restaurantId']);\n }",
"public function restaurant()\n {\n return $this->restaurant;\n }",
"function fetch_some_restaurants($restaurant_name)\n\t{\n\t\treturn $this->db->select('*')\n\t\t\t\t\t\t->from($this->table)\n\t\t\t\t\t\t->like('restaurant_name', $restaurant_name)\n\t\t\t\t\t\t->limit(5)\n\t\t\t\t\t\t->get()\n\t\t\t\t\t\t->result_array();\n\t}",
"public function getrestaurant()\n\t{\t\t\n\t\t$this->db->select(\"res.*,ht.hotal_name\");\n\t\t$this->db->from(RESTAURANT.\" as res\");\n\t\t$this->db->join(Hotal.\" as ht\", \"ht.id = res.hotal_id\");\n\t\t$this->db->where(\"res.is_deleted='0'\");\n\t\t$this->db->order_by(\"res.id\",\"DESC\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\t\n\t}",
"public function getRestaurants(){\n \n $result = self::where([\n \"status\" => \"Active\"\n ])\n ->select([\"id\",\"name\",\"has_gst\"])\n ->orderBy(\"name\")\n ->get();\n \n return $result;\n }",
"public function showbyname(Request $request) {\n $input = $request->all();\n $name = $input['name'];\n $results = DB::select('select * from restos where name = :name', ['name' => $name]);\n if ($results == null)\n return response()->json(['error'=> \"Restaurant Not Found\"], 404);\n else\n return new RestoResource(Resto::find($results[0]->id));\n }",
"public static function getMdalRestaurant()\n {\n if (self::$_mdalRestaurant === null) {\n require_once 'Mdal/Kitchen/Restaurant.php';\n self::$_mdalRestaurant = Mdal_Kitchen_Restaurant::getDefaultInstance();\n }\n\n return self::$_mdalRestaurant;\n }",
"public function saveNewRestaurant(Restaurant $res){\n\t\t$city = strtolower($res->getCity());\n\t\tif ($city == 'göteborg' || $city == 'goteborg' || $city == 'gÖteborg'){\n\t\t\t$city = 'gothenburg';\n\t\t}\n\t\t$res->setCity($city);\n\t\t/*\n\t\t * This is if we're going to add a search before the insert to check if the rest exists\n\t\t$query = \"SELECT id FROM restaurant WHERE name ='{$res->getName()}' LIMIT 1\";\n\n\t\tvar_dump($this->mysqli->query($query)); die();\n\t\tif (null == $this->mysqli->query($query)){\n\t\t\tvar_dump($this->mysqli->query($query)); die();\n\n\t\t\t\tdie($this->mysqli->error);\n\t\t\t\treturn false;}\n\t\t\telse {\n\t\t\t\tif ($this->mysqli->affected_rows == 0) {\n\t\t\t\t\t$row = $result->fetch_object();\n\t\t\t\t\t$city = $row->city;\n\t\t\t\t}\n\t\t\t}\n\t\t*/\n\n\t\t$query = \"SELECT id FROM city WHERE name = '$city' LIMIT 1\";\n\t\t$result = $this->mysqli->query($query);\n\t\t$row = $result->fetch_object();\n\n\t\tif(null == $row->id) {\n\t\t\techo \"We do not support this city yet, plz come back later. City name:\" . $city;\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$res->setCity($row->id);\n\t\t\t$query = sprintf(\"INSERT INTO restaurant(\n\n\t\t\t\tname,\n\t\t\t\tcity,\n\t\t\t\tzipcode,\n\t\t\t\tstreet,\n\t\t\t\tphone,\n\t\t\t\tfax,\n\t\t\t\twebsite,\n\t\t\t\tlatitude,\n\t\t\t\tlongitude,\n\t\t\t\thasbreakfast,\n\t\t\t\thaslunch,\n\t\t\t\thasdinner,\n\t\t\t\tapproved,\n\t\t\t\thittaId\n\t\t\t\t)VALUES (\n\t\t\t\t'%s',\n\t\t\t\t'%d',\n\t\t\t\t'%s',\n\t\t\t\t'%s',\n\t\t\t\t'%s',\n\t\t\t\t'%s',\n\t\t\t\t'%s',\n\t\t\t\t'%d',\n\t\t\t\t'%d',\n\t\t\t\t'%d',\n\t\t\t\t'%d',\n\t\t\t\t'%d',\n\t\t\t\t'%d',\n\t\t\t\t'%s'\n\n\t\t\t\t)\",\n\t\t\t\t$res->getName(),\n\t\t\t\t$res->getCity(),\n\t\t\t\t$res->getZip(),\n\t\t\t\t$res->getStreet(),\n\t\t\t\t$res->getPhone(),\n\t\t\t\t$res->getFax(),\n\t\t\t\t$res->getWebsite(),\n\t\t\t\t$res->getLatitude(),\n\t\t\t\t$res->getLongitude(),\n\t\t\t\t$res->getHas_breakfast(),\n\t\t\t\t$res->getHas_lunch(),\n\t\t\t\t$res->getHas_dinner(),\n\t\t\t\t1,\n\t\t\t\t$res->getHittaId()\n\t\t\t\t);\n\n\t\t\t\tif (!$this->mysqli->query($query)) {\n\t\t\t\t\tdie($this->mysqli->error);\n\t\t\t\t} else {\n\t\t\t\t\t$rest_id = $this->mysqli->insert_id;\n\t\t\t\t\t$res->setId($rest_id);\n\t\t\t\t\t$query = \"SELECT id FROM restauranttype WHERE name = '{$res->getType()}' LIMIT 1\";\n\t\t\t\t\t$result = $this->mysqli->query($query);\n\t\t\t\t\t$row = $result->fetch_object();\n\n\t\t\t\t\tif(null == $row->id) {\n\t\t\t\t\t\techo \"We do not support this type yet, plz come back later. Type name:\" . $res->getType();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$query = sprintf(\"INSERT INTO restauranttype_join_restaurant (\n\t\t\t\t\t\trestauranttype_id,\n\t\t\t\t\t\trestaurant_id\n\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t'%d',\n\t\t\t\t\t\t'%d'\n\t\t\t\t\t\t)\",\n\t\t\t\t\t\t$row->id,\n\t\t\t\t\t\t$rest_id\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (!$this->mysqli->query($query)) {\n\t\t\t\t\t\t\tdie($this->mysqli->error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t}",
"public function restaurant()\n {\n }",
"public function all() {\n $parser = new XmlParser();\n $restaurants = $parser->getRestaurantList(50);\n foreach ($restaurants as $restaurant) {\n $restaurant_eloquent = Restaurant::firstOrNew(['url' => $restaurant[\"value\"]]);\n if (!$restaurant_eloquent->exists) {\n $restaurant_eloquent->description = \"\";\n $restaurant_eloquent->name = $this->getTempName($restaurant_eloquent);\n $restaurant_eloquent->save();\n }\n $this->dispatch(new ScrapeRestaurantInfo($restaurant_eloquent));\n }\n\n return Restaurant::all()->keyBy('id');\n }",
"public function show(Restaurant $restaurant)\n {\n }",
"public function show(Restaurant $restaurant)\n {\n //\n }",
"public static function getInstance() {\n return !self::$instance ? new restaurantService() : self::$instance;\n\t\t}",
"public function search($name)\n {\n return Item::where('title', 'like','%' .$name. '%')->orWhere('sku', 'like','%' .$name. '%')->orWhere('ebay_item_id', 'like','%' .$name. '%')->get();\n\n \n }",
"public function addRestaurantSuggest($data)\n {\n try {\n $this->name = $data['name'];\n $this->address = $data['address'];\n $this->telephone = $data['telephone'];\n $this->latitude = $data['latitude'];\n $this->longitude = $data['longitude'];\n $this->user_id = $data['user_id'];\n $this->cuisines = $data['cuisines'];\n $this->other_details = $data['other_details'];\n $this->save();\n\n return $this;\n } catch (\\Exception $e) {\n throw $e;\n }\n }",
"public function getNotApprovedRestaurants() {\n\t\t$query = \"SELECT * FROM restaurant WHERE approved = 1\";\n\t\t$rest_list;\n\t\t$result = $this->mysqli->query($query);\n\t\t$i = 0;\n\t\twhile ($row = $result->fetch_object()) {\n\t\t\t$restaurant = new Restaurant();\n\t\t\t$restaurant->setId($row->id);\n\t\t\t$restaurant->setName($row->name);\n\t\t\t$restaurant->setLatitude($row->latitude);\n\t\t\t$restaurant->setLongitude($row->longitude);\n\t\t\t$restaurant->setWebsite($row->website);\n\t\t\t$restaurant->setCity($row->city);\n\t\t\t$restaurant->setFax($row->fax);\n\t\t\t$restaurant->setHas_breakfast($row->hasbreakfast);\n\t\t\t$restaurant->setHas_dinner($row->hasdinner);\n\t\t\t$restaurant->setHas_lunch($row->haslunch);\n\t\t\t$restaurant->setHittaURL($row->hittaURL);\n\t\t\t$restaurant->setMail_city($row->mailcity);\n\t\t\t$restaurant->setPhone($row->phone);\n\t\t\t$restaurant->setStreet($row->street);\n\t\t\t$restaurant->setType($row->type_name);\n\t\t\t$restaurant->setZip($row->zipcode);\n\t\t\t$rest_list[$i];\n\t\t\t$i++;\n\t\t}\n\t\treturn $rest_list;\n\t}",
"public function restaurant()\n {\n return $this->belongsTo('App\\Models\\Local', 'riflocal', 'rif');\n }",
"public function getrestaurant_based_detail($id)\n {\n $data = $this->restaurants->with(['Add_ons','Menu'])->find($id);\n //dd($data);\n return $data;\n }",
"public function GetRestaurant($Restid = NULL)\n {\n $query = ($Restid) \n ? ( (is_array($Restid)) \n ? $this->db->select('*')->from('restaurant')->where_in('id',$Restid) ->get() \n : $this->db->select('*')->from('restaurant')->where('id',$Restid)->get() ) \n : $this->db->get('restaurant') ;\n foreach($query->result('array') as $row)\n $data[$row['id']] = $row ;\n return $data;\n }",
"public function searchItemById(){\n\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> searchItemById());\n $res = $this -> Conexion -> extraer();\n $this -> idProducto = $res[0];\n $this -> nombre = $res[1];\n $this -> foto = $res[2];\n $this -> descripcion = $res[3];\n $this -> precio = $res[4];\n $this -> Conexion -> cerrar();\n }",
"function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}",
"public function GetRestbyHotal(){\n\t\t$data=array();\n\t\t$getres=''; \n\t\t$data=$this->Testimonials_model->getResHotel($_POST['id']);\n\t\t if(!empty($data)){\n\t\t\t$getres .= \"<option value=''> Select Restaurant </option>\";\n\t\t\tforeach($data as $val){\n\t\t\t$getres .= \"<option value=\".$val['id'].\"> \".$val['restaurant_name'].\" </option>\";\n\t\t\t}}\n\t\t\telse\n\t\t\t{\n\t\t\t$getres .= \"<option value=''> There is no Restaurant </option>\";\n\t\t\t}\n\t\t\techo $getres; \n\t }",
"public function findRecipe() {\n /** @var Item[] $iterator */\n $iterator = $this->items->excludeExpired()->getSortedIteratorOn('useByDate');\n foreach ($iterator as $item) {\n $selectedRecipe = $this->recipes->findRecipeWithMatchingIngredient($item);\n $recipe = $this->selectRecipe($selectedRecipe, $item);\n if ($recipe !== null) {\n return $recipe;\n }\n }\n return null;\n }",
"public function findRecipeByName($name){\n\n $query = $this->db->prepare('SELECT * FROM recipes WHERE name = ?');\n $query->bind_param(\"s\", $name);\n if(!$query->execute()){\n return NULL;\n }\n $result = $query->get_result();\n\n if(!$result || !$result->num_rows){\n return NULL;\n }\n $recipeRow = $result->fetch_assoc();\n $recipe = $this->recipeFactory->make($recipeRow);\n\n return $recipe;\n }",
"public function gofoodRestaurantById($restaurantId)\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->get(GojekID::BASE_ENDPOINT . Action::gofoodRestaurant . '/' . $restaurantId, $data, $this->headers)->getResponse();\n\t}",
"public static function traerReq($name) {\n\n return Requisito::nombre($name)->orderBy('id','desc')->get();\n }",
"function show_restaurants()\n \t{\n\t\t\t$conn = connect_to_server();\n\t \t\t$sql = \"SELECT nazev, id_provozovna FROM Provozovna;\";\n\t \t\t\n\t \t\tif ($result = $conn->query($sql))\n\t \t\t\t// output data of each row\n\t\t \t\twhile($row = $result->fetch_assoc()) {\n\t\t \techo \"<a href=\\\"projekt.php?show_food_list=\". $row[\"id_provozovna\"]. \"\\\">\". $row[\"nazev\"]. \"</a><br>\";\n\t\t \t}\n\t\t}",
"function fetch_restaurant_category_item($connection, $restaurant_id){\n\t$item_query = \"SELECT t.id, t.name, t.price, t.size, t.ingredients, ct.restaurant_id, ct.category_name from category_item ct, item t\n\t\t\t\t\twhere ct.restaurant_id = '\" . $restaurant_id .\"' AND ct.item_id = t.id\" ;\n\t$returned_values = array();\n\t$items_results = $connection->query($item_query);\n\tif (mysqli_num_rows($items_results) > 0) {\n\t\twhile ($row = mysqli_fetch_array($items_results) ) {\n\t\t\tarray_push($returned_values, $row);\n\t\t}\n\t}\n\tif (!empty($returned_values)){\n\t\treturn $returned_values;\n\t}else{\n\t\treturn \"No items to display\";\n\t}\n}"
]
| [
"0.70475656",
"0.6666671",
"0.64719284",
"0.64195645",
"0.61206436",
"0.6090729",
"0.603002",
"0.6028396",
"0.6010517",
"0.5983609",
"0.5931748",
"0.5793",
"0.57855326",
"0.5759624",
"0.57280165",
"0.5682202",
"0.56469077",
"0.5633375",
"0.5613588",
"0.55881995",
"0.5496832",
"0.54931605",
"0.54717773",
"0.54563785",
"0.5454486",
"0.54201674",
"0.5408838",
"0.5403035",
"0.5385416",
"0.53823537"
]
| 0.79283893 | 0 |
/ This method could be used to approve a restaurant not sure yet.. | public function approveNewRestaurant(restaurant $res){
$query = sprintf("INSERT INTO restaurant(
latitude,
longitude,
image,
link,
approved
)VALUES (
'%s',
'%s',
'%s',
'%s',
'%d'
)",
$res->getLat(),
$res->getLong(),
$res->getImage(),
$res->getLink(),
$res->getApproved()
);
if (!$this->mysqli->query($query))
die($this->mysqli->error);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function approve() {\n\n }",
"function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}",
"public function approve()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->approve($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }",
"private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }",
"public function restaurant_update_status($restaurant_id = '') {\n\t global $foodbakery_plugin_options;\n\t $foodbakery_restaurants_review_option = isset($foodbakery_plugin_options['foodbakery_restaurants_review_option']) ? $foodbakery_plugin_options['foodbakery_restaurants_review_option'] : '';\n\n\t $get_restaurant_id = foodbakery_get_input('restaurant_id', 0);\n\t $is_updating = false;\n\t if ($get_restaurant_id != '' && $get_restaurant_id != 0 && $this->is_publisher_restaurant($get_restaurant_id)) {\n\t\t$is_updating = true;\n\t }\n\n\t $user_data = wp_get_current_user();\n\n\t if ($foodbakery_restaurants_review_option == 'on') {\n\t\tupdate_post_meta($restaurant_id, 'foodbakery_restaurant_status', 'awaiting-activation');\n\t\t// Restaurant not approved\n\t\tdo_action('foodbakery_restaurant_not_approved_email', $user_data, $restaurant_id);\n\t } else {\n\t\tupdate_post_meta($restaurant_id, 'foodbakery_restaurant_status', 'active');\n\t\t// Restaurant approved\n\t\tdo_action('foodbakery_restaurant_approved_email', $user_data, $restaurant_id);\n\n\t\t// social sharing\n\t\t$get_social_reach = get_post_meta($restaurant_id, 'foodbakery_transaction_restaurant_social', true);\n\t\tif ($get_social_reach == 'on') {\n\t\t do_action('foodbakery_restaurant_social_post', $restaurant_id);\n\t\t}\n\t }\n\n\t $foodbakery_free_restaurants_switch = isset($foodbakery_plugin_options['foodbakery_free_restaurants_switch']) ? $foodbakery_plugin_options['foodbakery_free_restaurants_switch'] : '';\n\n\t if ($foodbakery_free_restaurants_switch != 'on') {\n\n\t\t$foodbakery_package_id = get_post_meta($restaurant_id, 'foodbakery_restaurant_package', true);\n\t\tif ($foodbakery_package_id) {\n\t\t $foodbakery_package_data = get_post_meta($foodbakery_package_id, 'foodbakery_package_data', true);\n\n\t\t $restaurant_duration = isset($foodbakery_package_data['restaurant_duration']['value']) ? $foodbakery_package_data['restaurant_duration']['value'] : 0;\n\n\t\t // calculating restaurant expiry date\n\t\t $foodbakery_trans_restaurant_expiry = $this->date_conv($restaurant_duration, 'days');\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_expired', strtotime($foodbakery_trans_restaurant_expiry));\n\t\t}\n\t }\n\t}",
"public function approve(Req $request, $id)\n\t{\n\n\t\t$bookReq = BookRequest::findOrFail($id);\n\t\t$property = Property::findOrFail($bookReq->property_id);\n\t\tif($property->property_type == 'apartment'){\n\t\t\t\n\t\t}\n\t\t$bookReq->status = 1;\n\t\t$bookReq->save();\n\t\tMail::send('emails.requestAccepted',['email'=>$data['email'],\n\t\t\t\t\t\t\t\t\t 'name'=>$data['name'],\n\t\t\t\t\t\t\t\t\t 'body'=>$data['body']], \n\t\tfunction($message) use($data)\n\t\t{\n\t\t $message->to('[email protected]', $data['name'])->subject($data['name'].' question');\n\t\t});\t\n\n\n\t}",
"public function restaurant_save_assignments($restaurant_id = '', $publisher_id = '') {\n\t global $foodbakery_plugin_options;\n\t $response = array('status' => false, 'msg' => esc_html__('An error occurred. Try again later.', 'foodbakery'));\n\t $get_restaurant_id = foodbakery_get_input('restaurant_id', 0);\n\t $is_updating = false;\n\t if ($get_restaurant_id != '' && $get_restaurant_id != 0 && $this->is_publisher_restaurant($get_restaurant_id)) {\n\t\t$is_updating = true;\n\t }\n\t $foodbakery_free_restaurants_switch = isset($foodbakery_plugin_options['foodbakery_free_restaurants_switch']) ? $foodbakery_plugin_options['foodbakery_free_restaurants_switch'] : '';\n\t $foodbakery_restaurant_default_expiry = isset($foodbakery_plugin_options['foodbakery_restaurant_default_expiry']) ? $foodbakery_plugin_options['foodbakery_restaurant_default_expiry'] : '';\n\t if ($foodbakery_free_restaurants_switch == 'on') {\n\t\t// Free Posting without any Membership\n\t\tif (!$is_updating) {\n\t\t if ($foodbakery_restaurant_default_expiry == '') {\n\n\t\t\t$foodbakery_trans_restaurant_expiry = current_time('Y-m-d H:i:s');\n\t\t } else {\n\n\t\t\t$foodbakery_trans_restaurant_expiry = $this->date_conv($foodbakery_restaurant_default_expiry, 'days');\n\t\t }\n\n\t\t // Assign expire date\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_expired', strtotime($foodbakery_trans_restaurant_expiry));\n\n\t\t // Add restaurant type in free posting\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_type', 'restaurant-settings');\n\n\t\t // Assign without package true\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_without_package', '1');\n\n\t\t // Assign Status of restaurant\n\t\t $this->restaurant_update_status($restaurant_id);\n\t\t //do_action( 'foodbakery_restaurant_add_assign_status', $restaurant_id );\n\t\t}\n\t\t$response['status'] = true;\n\t\t$response['msg'] = esc_html__('Restaurant added successfully and packages processed', 'foodbakery');\n\t } else {\n\t\t$new_pkg_check = foodbakery_get_input('foodbakery_restaurant_new_package_used', '');\n\t\tif ($new_pkg_check == 'on') {\n\n\t\t $package_id = foodbakery_get_input('foodbakery_restaurant_package', 0);\n\t\t if ($this->is_package($package_id)) {\n\t\t\tif ($is_updating) {\n\t\t\t // package subscribe\n\t\t\t // add transaction\n\t\t\t $transaction_detail = $this->foodbakery_restaurant_add_transaction('update-restaurant', $restaurant_id, $package_id, $publisher_id);\n\t\t\t echo force_balance_tags($transaction_detail);\n\t\t\t} else {\n\t\t\t // package subscribe\n\t\t\t // add transaction\n\t\t\t $transaction_detail = $this->foodbakery_restaurant_add_transaction('add-restaurant', $restaurant_id, $package_id, $publisher_id);\n\t\t\t echo force_balance_tags($transaction_detail);\n\t\t\t}\n\t\t }\n\n\t\t // end of using new package\n\t\t} else {\n\n\t\t $active_package_key = foodbakery_get_input('foodbakery_restaurant_active_package', 0);\n\t\t $active_package_key = explode('pt_', $active_package_key);\n\t\t $active_pckg_id = isset($active_package_key[0]) ? $active_package_key[0] : '';\n\t\t $active_pckg_trans_id = isset($active_package_key[1]) ? $active_package_key[1] : '';\n\t\t if ($this->is_package($active_pckg_id)) {\n\t\t\t$t_package_feature_list = get_post_meta($active_pckg_trans_id, 'foodbakery_transaction_restaurant_feature_list', true);\n\t\t\t$t_package_top_cat_list = get_post_meta($active_pckg_trans_id, 'foodbakery_transaction_restaurant_top_cat_list', true);\n\n\t\t\tif ($is_updating) {\n\t\t\t $foodbakery_package_id = get_post_meta($restaurant_id, 'foodbakery_restaurant_package', true);\n\t\t\t $foodbakery_trans_id = $this->restaurant_trans_id($restaurant_id);\n\t\t\t // update-restaurant\n\t\t\t $is_pkg_subs = $this->foodbakery_is_pkg_subscribed($active_pckg_id, $active_pckg_trans_id);\n\t\t\t if ($foodbakery_package_id != $active_pckg_id || $active_pckg_trans_id != $foodbakery_trans_id) {\n\t\t\t\t// if package subscribe\n\t\t\t\tif ($is_pkg_subs) {\n\n\t\t\t\t // update featured, top category\n\t\t\t\t // this change will be temporary\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\n\t\t\t\t // Get Transaction Restaurants array\n\t\t\t\t // Merge new Restaurant in Array\n\t\t\t\t $get_trans_restaurants = get_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", true);\n\t\t\t\t $updated_trans_restaurants = $this->merge_in_array($get_trans_restaurants, $restaurant_id);\n\t\t\t\t update_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", $updated_trans_restaurants);\n\n\t\t\t\t $active_pckg_trans_title = $active_pckg_trans_id != '' ? str_replace('#', '', get_the_title($active_pckg_trans_id)) : '';\n\n\t\t\t\t // updating package id in restaurant\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_package\", $active_pckg_id);\n\n\t\t\t\t // updating transaction title id in restaurant\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_trans_id\", $active_pckg_trans_title);\n\n\t\t\t\t // update restaurant subscription renew\n\t\t\t\t $get_subscripton_data = get_post_meta($restaurant_id, \"package_subscripton_data\", true);\n\t\t\t\t if (empty($get_subscripton_data)) {\n\t\t\t\t\t$package_subscripton_data = array(\n\t\t\t\t\t array(\n\t\t\t\t\t\t'type' => 'update_package',\n\t\t\t\t\t\t'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t\t'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t\t'package_id' => $active_pckg_id,\n\t\t\t\t\t\t'subscribe_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t )\n\t\t\t\t\t);\n\t\t\t\t } else {\n\t\t\t\t\t$package_subscripton_data = array(\n\t\t\t\t\t 'type' => 'update_package',\n\t\t\t\t\t 'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t 'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t 'package_id' => $active_pckg_id,\n\t\t\t\t\t 'renew_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t);\n\t\t\t\t }\n\t\t\t\t $merged_subscripton_data = $this->merge_in_array($get_subscripton_data, $package_subscripton_data, false);\n\t\t\t\t update_post_meta($restaurant_id, \"package_subscripton_data\", $merged_subscripton_data);\n\n\t\t\t\t // updating restaurant meta\n\t\t\t\t // as per transaction meta\n\t\t\t\t $this->restaurant_assign_meta($restaurant_id, $active_pckg_trans_id);\n\n\t\t\t\t // Assign Status of restaurant\n\t\t\t\t $this->restaurant_update_status($restaurant_id);\n\t\t\t\t}\n\t\t\t }\n\t\t\t if ($is_pkg_subs) {\n\t\t\t\t// update restaurant featured\n\t\t\t\tif ($t_package_feature_list == 'on') {\n\t\t\t\t // featured from form\n\t\t\t\t $get_restaurant_featured = foodbakery_get_input('foodbakery_restaurant_featured', '');\n\t\t\t\t // featured from meta\n\t\t\t\t $db_restaurant_featured = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", true);\n\n\t\t\t\t if ($get_restaurant_featured == 'on' && $db_restaurant_featured != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", 'on');\n\t\t\t\t } else if ($get_restaurant_featured != 'on' && $db_restaurant_featured == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t}\n\n\t\t\t\t// update restaurant top category\n\t\t\t\tif ($t_package_top_cat_list == 'on') {\n\t\t\t\t // Top Cat from form\n\t\t\t\t $get_restaurant_top_cat = foodbakery_get_input('foodbakery_restaurant_top_cat', '');\n\t\t\t\t // Top Cat from meta\n\t\t\t\t $db_restaurant_top_cat = get_post_meta($restaurant_id, 'foodbakery_restaurant_is_top_cat', true);\n\n\t\t\t\t if ($get_restaurant_top_cat == 'on' && $db_restaurant_top_cat != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", 'on');\n\t\t\t\t } else if ($get_restaurant_top_cat != 'on' && $db_restaurant_top_cat == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t}\n\t\t\t }\n\t\t\t} else {\n\t\t\t // if package subscribe\n\t\t\t if ($this->foodbakery_is_pkg_subscribed($active_pckg_id, $active_pckg_trans_id)) {\n\n\t\t\t\t// Get Transaction Restaurants array\n\t\t\t\t// Merge new Restaurant in Array\n\t\t\t\t$get_trans_restaurants = get_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", true);\n\t\t\t\t$updated_trans_restaurants = $this->merge_in_array($get_trans_restaurants, $restaurant_id);\n\t\t\t\tupdate_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", $updated_trans_restaurants);\n\n\t\t\t\t$active_pckg_trans_title = $active_pckg_trans_id != '' ? str_replace('#', '', get_the_title($active_pckg_trans_id)) : '';\n\t\t\t\t// updating package id in restaurant\n\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_package\", $active_pckg_id);\n\n\t\t\t\t// updating transaction title id in restaurant\n\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_trans_id\", $active_pckg_trans_title);\n\n\t\t\t\t// update restaurant subscription renew\n\t\t\t\t$get_subscripton_data = get_post_meta($restaurant_id, \"package_subscripton_data\", true);\n\n\t\t\t\tif (empty($get_subscripton_data)) {\n\t\t\t\t $package_subscripton_data = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t 'type' => 'update_package',\n\t\t\t\t\t 'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t 'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t 'package_id' => $active_pckg_id,\n\t\t\t\t\t 'subscribe_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t)\n\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t $package_subscripton_data = array(\n\t\t\t\t\t'type' => 'update_package',\n\t\t\t\t\t'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t'package_id' => $active_pckg_id,\n\t\t\t\t\t'renew_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t$merged_subscripton_data = $this->merge_in_array($get_subscripton_data, $package_subscripton_data, false);\n\t\t\t\tupdate_post_meta($restaurant_id, \"package_subscripton_data\", $merged_subscripton_data);\n\n\t\t\t\t// update restaurant featured\n\t\t\t\tif ($t_package_feature_list == 'on') {\n\t\t\t\t // featured from form\n\t\t\t\t $get_restaurant_featured = foodbakery_get_input('foodbakery_restaurant_featured', '');\n\t\t\t\t // featured from meta\n\t\t\t\t $db_restaurant_featured = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", true);\n\n\t\t\t\t if ($get_restaurant_featured == 'on' && $db_restaurant_featured != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", 'on');\n\t\t\t\t } else if ($get_restaurant_featured != 'on' && $db_restaurant_featured == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t}\n\n\t\t\t\t// update restaurant top category\n\t\t\t\tif ($t_package_top_cat_list == 'on') {\n\t\t\t\t // Top Cat from form\n\t\t\t\t $get_restaurant_top_cat = foodbakery_get_input('foodbakery_restaurant_top_cat', '');\n\t\t\t\t // Top Cat from meta\n\t\t\t\t $db_restaurant_top_cat = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", true);\n\n\t\t\t\t if ($get_restaurant_top_cat == 'on' && $db_restaurant_top_cat != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", 'on');\n\t\t\t\t } else if ($get_restaurant_top_cat != 'on' && $db_restaurant_top_cat == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t}\n\n\t\t\t\t// updating restaurant meta\n\t\t\t\t// as per transaction meta\n\t\t\t\t$this->restaurant_assign_meta($restaurant_id, $active_pckg_trans_id);\n\n\t\t\t\t// Assign Status of restaurant\n\t\t\t\t$this->restaurant_update_status($restaurant_id);\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t // end of using existing package\n\t\t}\n\t\t$response['status'] = true;\n\t\t$response['msg'] = esc_html__('Restaurant added successfully and packages processed', 'foodbakery');\n\t\t// end assigning packages\n\t\t// and payment processs\n\t }\n\t return $response;\n\t}",
"public function approve()\n {\n $post = new PostBag();\n $id = $post->fetchInt('id');\n \n $this->db->query(\"UPDATE `film_review` SET `status` = 'show' WHERE `id` = {$id} LIMIT 1\");\n if (!empty($this->db->error)) {\n return false;\n }\n\n $result = $this->db->query(\"SELECT `userId` FROM `film_review` WHERE `id` = {$id} LIMIT 1\");\n if ($row = $result->fetch_assoc()) {\n $this->db->query(\"UPDATE `user` SET `count_review` = `count_review` + 1 WHERE `id` = {$row['userId']} LIMIT 1\");\n }\n \n return true;\n }",
"public function approve_request($id) {\r\n\t\treturn $this->db->update('orders', [\r\n\t\t\t'_assigned_staff'=>$this->input->post('staff'), \r\n\t\t\t'price'=>$this->input->post('amount'), \r\n\t\t\t'_status' => STATUS_PENDING_PAYMENT], ['_id' => $id]);\r\n\t}",
"public function approveByUser() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n $this->admin_id = NULL;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n \n return $this->save(false);\n }",
"function requestApproval() \t{\n\t\t$this->getMenu() ;\n\t\t$id = $this->input->post('id');\n\t\t$this->timesheetModel->saveTimesheetRequest($id);\n\t\tredirect ('/timesheet/');\n\t}",
"public function approveItem()\n {\n if ($this->getItem()->getType() == \\Apprecie\\Library\\Items\\ItemTypes::EVENT) {\n if ($this->getStatus() == \\Apprecie\\Library\\Items\\ApprovalState::APPROVED) {\n return true;\n }\n\n $org = Organisation::getActiveUsersOrganisation();\n $event = Event::findFirstBy('itemId', $this->getItemId());\n\n $event->setState(\\Apprecie\\Library\\Items\\ItemState::APPROVED);\n $event->update();\n\n if (!$org->addEventToVault($event)) {\n $this->appendMessageEx($org);\n $this->logActivity('Failed xx addEventToVault() inside approve method', 'messages ' . _ms($org));\n return false;\n } //@todo gh use transaction\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::APPROVED);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n $this->update();\n } else {\n throw new \\Phalcon\\Exception('approveItem work flow not implemented for non events');\n }\n }",
"function approve_return($item_id) {\n $this->db->where('item_id', $item_id);\n $this->db->update('items', array('status' => 0)); // set the item status to returned\n //delete the item \n return $this->db->delete('items_collection', array('item_id' => $item_id));\n }",
"public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }",
"function approve( $booking_ids ){\n\t\t$this->set_status(1, $booking_ids);\n\t\treturn false;\n\t}",
"public function disapprove()\n {\n return $this->approve(false);\n }",
"function update_promoter_guest_list_set_auto_approve(){\n\t\t\n\t\tif(!$pgla_id = $this->CI->input->post('pgla_id')){\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'pgla_id not set');\n\t\t}\n\t\t\n\t\tif(!$auto_approve = $this->CI->input->post('auto_approve')){\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'auto_approve not set');\n\t\t}\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->update_promoter_guest_list_set_auto_approve($pgla_id, $auto_approve, $this->promoter->up_id);\n\t}",
"public function approve($id){\n\n return 'hi';\n }",
"public function actionApprove($id){\n $model = $this->findModel($id);\n \n if ($model->status_listing == 1){\n $model->status_listing = 5;\n \n if ($model->save()){\n return 'success';\n }\n \n }else{\n return 'Not Valid for Approve';\n }\n }",
"public function testItCanApproveASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/approve/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 1,\n ]);\n }",
"public function approveCommentMethod()\n { \n $choice = $this->getGet()[\"approve\"];\n $data = [\"approved\" => (int) $choice]; \n $comment_id = (string) $this->getId();\n\n if ($choice === \"1\") {\n $message = \"Le commentaire a bien été approuvé et publié.\";\n } elseif ($choice === \"0\") {\n $message = \"Le commentaire a été refusé et ne sera pas publié.\";\n };\n\n ModelFactory::getModel(\"Comment\")->updateData($comment_id, $data);\n $this->setMessage($message);\n $this->redirect(\"user!admin\");\n }",
"public function approve($id)\n {\n $borrow = Borrows::find($id);\n\n $borrow->status = \"approved\";\n\n $borrow->save();\n\n //push status of details of borrows to borrows_inventory\n $details = Borrows_InventoryTools::where('borrow_id', $borrow->id)->get();\n\n foreach ($details as $index => $tool) {\n $detail = Borrows_InventoryTools::find($tool->id);\n $detail->status = \"approved\";\n $detail->save();\n }\n\n \n\n return back();\n }",
"public function approve_advertiser(Request $request)\n {\n\n }",
"public function isApproved()\n {\n\n return false;\n }",
"public function approve_xtra_req($comment, $status, $days, $req_id, $user_id1){\r\n\t\r\n\t$date = date('Y/m/d');\r\n\t$usr_id = ($user_id1 != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($user_id1).\"'\":'NULL';\r\n\t$comm = ($comment != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($comment).\"'\":'NULL';\r\n\t$stat = ($status != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($status).\"'\":'NULL';\r\n\t$days_num = ($days != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($days).\"'\":'NULL';\r\n\t$id = ($req_id != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($req_id).\"'\":'NULL';\r\n\t$dates = ($date != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($date).\"'\":'NULL';\r\n\tif($status==3){\r\n\t$sql = $this->hrm_mysql_connect->query(\"UPDATE xtra_days_requests SET comment=$comm, status=$stat, date_reviewed=$dates WHERE id=$id\");\r\n\t$sql2 = $this->hrm_mysql_connect->query(\"UPDATE leave_instance_2018 SET compensatory_leave=compensatory_leave+$days_num WHERE user_id=$usr_id\");\r\n\t}else{\r\n\t\t$sql = $this->hrm_mysql_connect->query(\"UPDATE xtra_days_requests SET comment=$comm, status=$stat, date_reviewed=$dates WHERE id=$id\");\r\n\t\t}\r\n\tif($sql){\r\n\t\t\t\t$data = '<div class=\"alert alert-success\"><a class=\"close\" data-dismiss=\"alert\">×</a>'.'Request succesfully Accepted'.'</div>';\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$data = mysql_error().'<div class=\"alert alert-danger\"><a class=\"close\" data-dismiss=\"alert\">×</a>'.'Request not processed, contact I.T for support'.'</div>';\r\n\t\t\t\t\t}\r\n\t\t\treturn $data;\r\n\t}",
"public function approve_submission(Request $request)\n {\n }",
"public function approveAction()\n {\n /** @var Facepalm_Model_Row_Point $point */\n $this->_helper->assertHasParameter('id');\n\n $pointsModel = new Facepalm_Model_Points();\n $point = $pointsModel->find($this->_getParam('id'))->current();\n\n $this->_helper->assertResourceExists($point);\n\n $this->_helper->assertCanApprove($point, $this->getCurrentUser());\n\n $point->approved = true;\n $point->save();\n\n $this->_helper->sendNotifications(\n $point, $this->getCurrentUser()\n );\n\n $this->_helper->redirector->gotoRouteAndExit(\n array(\n 'action' => 'view',\n 'id' => $point->id,\n )\n );\n\n }",
"public function approve()\n {\n // Make sure that all necessary payment plugins are loaded at this point.\n $this->getDi()->plugins_payment->loadEnabled();\n if ($this->isConfirmed())\n return true;\n $old_status = $this->is_confirmed;\n $this->is_confirmed = self::IS_CONFIRMED_CONFIRMED;\n\n $this->updateSelectedFields('is_confirmed');\n $saved = array();\n foreach ($this->data()->getAll() as $k => $v) {\n if (strpos($k, self::SAVED_TRANSACTION_KEY) !== false) {\n list(, $time, $payment_id) = explode('-', $k);\n $saved[$time] = array($payment_id, $v);\n }\n }\n ksort($saved);\n foreach ($saved as $time => $v) {\n $this->addAccessPeriod($v[1], $v[0] ? $v[0] : null);\n $this->data()->set(self::SAVED_TRANSACTION_KEY . '-' . $time . '-' . $v[0], null)->update();\n }\n if ($old_status == self::IS_CONFIRMED_NOT_CONFIRMED)\n {\n $this->sendApprovedEmail();\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_APPROVE, array('invoice' => $this));\n }\n return true;\n }",
"public function testApprove()\n {\n $json = <<<JSON\n{\n \"order_id\": \"45aa52f387871e3a210645d4\",\n \"fraud_status\": \"REJECTED\"\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $data = $order->approve([\n 'data' => 'sent in'\n ]);\n\n $this->assertEquals('45aa52f387871e3a210645d4', $data['order_id']);\n $this->assertEquals('REJECTED', $data['fraud_status']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::POST, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456/orders',\n $request->getUri()->getPath()\n );\n $this->assertEquals('{\"data\":\"sent in\"}', strval($request->getBody()));\n\n $this->assertAuthorization($request);\n }",
"public function approveAction() {\n\t\t$request = $this->getRequest();\n\t\t$ta_id = (int)($request->getParam('id'));\n\t\t$lo_id = (int)($request->getParam('loid'));\n\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($ta_id);\n\t\tif (($result = UserAcl::checkTaPermission($ta, UserAcl::$APPROVE)) !== true) {\n\t\t\tthrow new Exception($result);\n\t\t}\n\n\t\t$linkFinder = new LinkageLoTas();\n\t\t$link = $linkFinder->getLinkageByLoAndTaId($lo_id, $ta_id);\n\t\tif (!$link->isNewVersionRequest()) {\n\t\t\tthrow new Exception(\"Teaching activity $ta_id does not need approval.\");\n\t\t}\n\n\t\t$link->approveNewTaVersion();\n\t\t\n\t\t$session = new Zend_Session_Namespace('taapprovecomplete');\n\t\t$session->ta_id = $ta_id;\n\t\t$session->lo_id = $lo_id;\n\t\t$this->_redirect('/teachingactivity/approvecomplete');\n\t}"
]
| [
"0.76765937",
"0.7002296",
"0.69104725",
"0.6903896",
"0.68125564",
"0.64785904",
"0.646956",
"0.64442486",
"0.64261204",
"0.63636184",
"0.63561887",
"0.63050824",
"0.6296809",
"0.62911004",
"0.62760884",
"0.6261775",
"0.621974",
"0.6211101",
"0.6184542",
"0.61597526",
"0.614038",
"0.61252266",
"0.61024773",
"0.610159",
"0.60955954",
"0.60935247",
"0.608267",
"0.60712093",
"0.6060443",
"0.60555094"
]
| 0.7240661 | 1 |
when running the import restaurants script, this checks if a restaurant has already been importted before or not | public function hasImported(Restaurant $res){
$query = "SELECT id FROM restaurant WHERE name = '{$res->getName()}' OR hittaId ='{$res->getHittaId()}' LIMIT 1";
if (!$result = $this->mysqli->query($query))
die($this->mysqli->error);
else {
if ($this->mysqli->affected_rows == 1) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isImportDatabaseDone() {}",
"protected function needImport(): bool\n {\n $out = true;\n $this->structureCont = $this->structureApi->send();\n if ($structure = OpenDataStructure::find()->one()) {\n if ($structure->num_id == $this->structureCont->data['num_id']) {\n $out = false;\n }\n }\n return $out;\n }",
"function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public function isImported()\n {\n if (isset($this->product['Cost in GBP'])\n && $this->product['Cost in GBP'] < 5\n && isset($this->product['Stock'])\n && $this->product['Stock'] < 10\n ) {\n return false;\n }\n if(isset($this->product['Cost in GBP'])\n && $this->product['Cost in GBP'] > 1000\n ){\n return false;\n }\n return true;\n }",
"public function is_import_valid() {\n\t\t$import_settings = [\n\t\t\t'user',\n\t\t];\n\n\t\t$valid = true;\n\n\t\tforeach ( $import_settings as $setting ) {\n\t\t\tif ( empty( $this->import[ $setting ] ) ) {\n\t\t\t\t$valid = false;\n\t\t\t}\n\t\t}\n\n\t\treturn ( $this->is_core_valid() && $valid );\n\t}",
"public function isImported(): bool\n {\n return $this->importedAsset !== null;\n }",
"protected function _importData()\n {\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->deleteEntity();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->replaceEntity();\n } elseif (Import::BEHAVIOR_APPEND == $this->getBehavior()) {\n $this->saveEntity();\n }\n\n return true;\n }",
"public function check(){\n\t\tif ($this->import_tth != $this->import_new_tth) {\n\t\t\t// Check if new import file is fully uploaded\n\t\t\t// Process import_1C\n\t\t\trequire 'import_exec.php';\n\t\t\t// Write new tth to db\n\t\t\tif($this->import_tth) {\n\t\t\t\t$sql = \"Update `\" . DB_PREFIX . \"setting` Set\n `value` = '\" . $this->db->escape($this->import_new_tth) . \"',\n `serialized` = '0'\n Where `group` = '1c'\n And `key` = 'import_tth'\";\n\t\t\t} else {\n\t\t\t\t$sql = \"Insert Into `\" . DB_PREFIX . \"setting` Set\n `value` = '\" . $this->db->escape($this->import_new_tth) . \"',\n `serialized` = '0',\n `group` = '1c',\n `key` = 'import_tth'\";\n\t\t\t}\n\t\t\t$this->db->query($sql);\n\n\t\t\t// Write logs to file\n\t\t\t$this->log->add(\"New import.csv synchronisation at: \" . date('Y-m-d H-a-s'));\n\t\t}\n\t}",
"function checkForPreviousImport(){\n global $name, $blockToCheck, $con, $runType, $sqlAction, $university, $previousCheckComplete, $passedStartAdvisor, $startAdvisor,\n $previousHeader, $school, $department, $previousInfo, $similarNames, $previousPic, $previousSchool, $previousDepartment, $newName;\n \n $newName = \"\";\n if ( function_exists(\"parseLink\") === false ){\n require(\"../../../lib/linkParser.php\");\n }\n\t // Get the name and check to see if the name exists in the database\n\t \n\t if ( isset($_GET[\"completed\"]) ){\n\t $completed = json_decode($_GET[\"completed\"],true);\n\t }\n\t $nameCheck = runSQL($con,\"SELECT `Header`,`Block`,`School`,`Department`,`Info`,`Name` FROM `$runType` WHERE `University` = '$university'\");\n\t if ( mysqli_num_rows($nameCheck) > 0 ){\n\t // Check to see if the advisor already exists in the database\n\t $id = 1;\n\t while ( $row = mysqli_fetch_array($nameCheck) ){\n\t $lev = levenshtein($row[\"Name\"],$name);\n\t if ( $name == $row[\"Name\"] ){\n\t $sqlAction = \"UPDATE\";\n\t $blockToCheck = $row[\"Block\"];\n\t $previousHeader = $row[\"Header\"];\n\t $previousInfo = $row[\"Info\"];\n\t $previousPic = $row[\"Picture\"];\n\t $previousSchool = $row[\"School\"];\n\t $previousDepartment = $row[\"Department\"];\n\t echo $name . \"<br/>\";\n\t //print_r($previousDepartment);\n\t echo \"<br/>\";\n\t return \"UPDATE\";\n\t }\n\t else if ( ( $lev > -1 && $lev < 4 ) ){\n\t $nameInfo = json_decode(file_get_contents(\"http://www.projectlever.com/import/lib/names.json\"),true);\n\t if ( $nameInfo[$name] != null ){\n\t if ( stripos($nameInfo[$name],\"-continue\") === false ){\n\t $newName = str_replace(\"-continue\",\"\",$nameInfo[$name]);\n\t //echo $newName;exit;\n\t }\n\t $sqlAction = \"UPDATE\";\n \t $blockToCheck = $row[\"Block\"];\n \t $previousHeader = $row[\"Header\"];\n \t $previousInfo = $row[\"Info\"];\n \t $previousPic = $row[\"Picture\"];\n \t $previousSchool = $row[\"School\"];\n \t $previousDepartment = $row[\"Department\"];\n \t echo $name . \"<br/>\";\n \t //print_r($previousDepartment);\n \t return \"UPDATE\";\n\t }\n\t else if ( $nameInfo[$row[\"Name\"]] != null ){\n\t if ( stripos($nameInfo[$row[\"Name\"]],\"-continue\") === false ){\n\t $newName = str_replace(\"-continue\",\"\",$nameInfo[$row[\"Name\"]]);\n\t }\n\t $sqlAction = \"UPDATE\";\n \t $blockToCheck = $row[\"Block\"];\n \t $previousHeader = $row[\"Header\"];\n \t $previousInfo = $row[\"Info\"];\n \t $previousPic = $row[\"Picture\"];\n \t $previousSchool = $row[\"School\"];\n \t $previousDepartment = $row[\"Department\"];\n \t echo $name . \"<br/>\";\n \t \n \t echo \"<br/>\";\n \t return \"UPDATE\";\n\t }\n\t else if ( strpos($row[\"Name\"],trim($name)) !== false ){\n\t $newName = trim($name);\n\t $sqlAction = \"UPDATE\";\n\t return \"UPDATE\";\n\t }\n\t else {\n\t echo \"<span class='change' onclick='window.parent.keepMe(document.advisorToRun,document.nameFromSQL)' style='cursor:default'>\".$name . \"</span> -- <span onclick='window.parent.keepMe(document.nameFromSQL,document.advisorToRun)' style='cursor:default' class='change'>\" . $row[\"Name\"] . \"</span>\";\n\t echo \"<button onclick='window.parent.skip(document.advisorToRun,document.nameFromSQL)'>Skip</button><button onclick='window.parent.setNewName(document.advisorToRun)'>New Name</button>\";\n\t echo \"<script>window.parent.set(\\\"\".$name.\"\\\",\\\"\".$row[\"Name\"].\"\\\");\n \t document.advisorToRun = \\\"\".$name.\"\\\";\n \t document.nameFromSQL = \\\"\".$row[\"Name\"].\"\\\";\n \t </script>\";\n\t exit;\n\t }\n\t }\n\t }\n\t // The advisor doesn't exist in the database yet!\n\t $sqlAction = \"INSERT\";\n return \"INSERT\";\n\t }\n\t $sqlAction = \"continue\";\n $previousCheckComplete = true;\n\t return \"continue\";\n }",
"protected function _importData()\n {\n $this->_validatedRows = null;\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->_deleteProducts();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->_replaceFlag = true;\n $this->_replaceProducts();\n } else {\n $this->_saveProductsData();\n }\n $this->_eventManager->dispatch('catalog_product_import_finish_before', ['adapter' => $this]);\n return true;\n }",
"function importpostprocess() {\n /// Argument is a simple array of question ids that \n /// have just been added.\n\n return true;\n }",
"private function tokenIsImport()\n {\n return $this->isFullToken()\n && in_array($this->getTokenObject(), [T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, T_REQUIRE_ONCE]);\n }",
"function importUsers()\n {\n geoAdmin::m('Fake import run, all users imported from bridge to local.', geoAdmin::NOTICE);\n return true;\n }",
"function test_deport_import_location()\n\t{\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t// the pre condition ensures this will not be null\n\t\t$this->assertNotEqual($r, null);\n\t\t// delete it from the data base\n\t\t$r->sql_delete();\n\t\t// load it from the database and get NULL to verify its gone\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertEqual($r, null);\n\t\t// // now put it back in database - load from file and then insert\n\t\t$new_r = Item::get_by_trip_slug('rtw', LOC_SLUG);\n\t\t$new_r->sql_insert();\n\t\t// finally test it is in database\n\t\t$r = Item::get_by_slug(LOC_SLUG);\n\t\t$this->assertNotEqual($r, null);\n\t}",
"private function can_import() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'import' &&\n current_user_can( 'manage_options' );\n }",
"public function checkImported($object) {\n if (!empty($this->source->data)) {\n if (in_array($object['Key'], $this->source->data)) {\n return true;\n }\n }\n return false;\n }",
"public function checkImportPrerequisites() {}",
"abstract public function import(): bool;",
"public function import_check()\n\t{\n\t\t$view\t\t= $this->getView( 'HelloImport', 'html');\t//display user form\n\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t$view->setModel($model, true);\t\t\t\t\t//define as default model for view\n\t\t$view->display();\t\t\t\t\t\t//call default template\n\t}",
"public function processImport()\n {\n $file = $this->_createFile();\n if ($file) {\n $this->_deleteFtpFiles();\n $this->_sendFile($file);\n if (!$this->_deleteFile($file)) {\n Mage::throwException(Mage::helper('find_feed')->__(\"FTP: Can't delete files\"));\n }\n }\n }",
"private function import_start()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\t//check for form tampering\n\t\t$this->inp\t= JFactory::getApplication()->input;\n\t\t$files\t\t= $this->inp->files;\n\t\t$this->file\t= reset($files->getArray());\t\t\t//first (and only) file\n\t\t$this->ok\t= !empty($this->file);\t\t\t\t//file ok?\n\t\treturn\t\t$this->ok;\n\t}",
"private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }",
"function importpostprocess() {\n /// Argument is a simple array of question ids that \n /// have just been added.\n \n // need to clean up temporary directory\n return $this->clean_temp_dir();\n }",
"function import_has_errors($import_array){\r\n\t// pass client and server objects\r\n\tglobal $Client, $svc;\r\n\r\n\t$client_id_field = \"client_id\";\r\n\t$err_array = array();\r\n\r\n\r\n\r\n\tif(empty($import_array)){\r\n\t\t$err_array[0][0] = \"Nothing to import.. Please try again...\";\r\n\t}else{\r\n\t\tforeach($import_array As $import_array_sheet => $import_array_row){\r\n\t\tforeach($import_array_row As $k => $v){\r\n\t\t\t// check if CLIENT_ID EXISTS\r\n\t\t\tif(!is_numeric($v[$client_id_field])){\r\n\t\t\t\t$err_array[$import_array_sheet][$k] = \"Bad or Missing Client ID\";\r\n\t\t\t}elseif(!$Client->is_client_id($v[$client_id_field])){\r\n\t\t\t\t$err_array[$import_array_sheet][$k] = \"Client ID Does Not Exist\";\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\t\t\t\r\n\t//if(!empty($err_array)){\r\n\t\treturn $err_array;\r\n\t//}else{\r\n\t//\treturn false;\r\n\t//}\r\n}",
"public function hasInitialInventory()\n {\n return $this->initial_inventory !== null;\n }",
"public function import() {\n\t\t$this->status = new WPSEO_Import_Status( 'import', false );\n\n\t\tif ( ! $this->detect_helper() ) {\n\t\t\treturn $this->status;\n\t\t}\n\n\t\t$this->import_metas();\n\n\t\treturn $this->status->set_status( true );\n\t}",
"public function importPass()\n {\n // Prepare list of objects for import\n $remoteObjects = $this->getImportableObjects();\n if ($remoteObjects === null) {\n return;\n }\n \n // Add all objects\n $updated = 0;\n $added = 0;\n $total = 0;\n $remoteCount = $remoteObjects->count();\n foreach ($remoteObjects as $remoteObject) {\n // Show progress indicator\n $this->task->progress(++$total, $remoteCount);\n\n // If allowed, detect updateable objects\n $localObject = null;\n if ($this->canUpdate() && ($localObject = $this->findMatchedLocalObject($remoteObject->ID))) {\n // Update existing object\n $this->updateLocalObject($localObject, $remoteObject);\n ++$updated;\n }\n\n // If allowed, create a new object\n // If this step has an add only strategy, then this step relies on getImportableObjects\n // to filter out objects that have already been added.\n if (empty($localObject) && $this->canAdd()) {\n // Make a new object\n $this->createLocalFromRemoteObject($remoteObject);\n ++$added;\n }\n }\n // Done!\n $this->task->message(\" * Result: {$added} added, {$updated} updated\");\n }",
"public function getImportGlobally()\n {\n $value = $this->_config->get('dataprocessing/general/import_globally');\n\n if ($value === null) {\n $value = true;\n }\n\n return (bool)$value;\n }",
"public function _importData()\n {\n Mage::dispatchEvent($this->_eventPrefix . '_before_import', array(\n 'data_source_model' => $this->_dataSourceModel,\n 'entity_model' => $this\n ));\n $result = parent::_importData();\n Mage::dispatchEvent($this->_eventPrefix . '_after_import', array(\n 'entities' => $this->_newCustomers,\n 'entity_model' => $this\n ));\n return $result;\n }",
"function sanityCheck() {\n $_app = new ITechTable(SyncCompare::getDesktopConnectionParams('location',$this->desktopFilePath));\n $tiers = $_app->getAdapter()->query('SELECT COUNT(DISTINCT tier) as \"cnt\" FROM location');\n $rows = $tiers->fetchAll();\n $settings = System::getAll();\n $city_tier = 2 + $settings['display_region_i'] + $settings['display_region_h'] + $settings['display_region_g'] + $settings['display_region_f'] + $settings['display_region_e'] + $settings['display_region_d'] + $settings['display_region_c'] + $settings['display_region_b'];\n if ( $rows[0]['cnt'] != $city_tier) {\n //return 'Could not import data: Offline database contains '.$rows[0]['cnt'].' regional levels, while the web database contains '.$city_tier.'.';\n }\n \n return false;\n }"
]
| [
"0.6291677",
"0.624105",
"0.6142928",
"0.60432243",
"0.60091674",
"0.59837246",
"0.5786427",
"0.57631075",
"0.56931937",
"0.56823665",
"0.5667403",
"0.56670886",
"0.5665026",
"0.5643555",
"0.56184864",
"0.55975014",
"0.5588726",
"0.5435211",
"0.5414605",
"0.53470325",
"0.5341445",
"0.53404933",
"0.5297527",
"0.52906305",
"0.5280523",
"0.52598846",
"0.5255224",
"0.52549267",
"0.52173764",
"0.5203666"
]
| 0.7304569 | 0 |
Handle calculations when delete a buying transaction instance. | public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void
{
$transaction->share->handleCalculationsOfDeletedBuying($transaction);
$transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }",
"public function deleteDiscount();",
"public function destroy(Request $request)\n { \n $organization_id = Session::get('organization_id'); \n\n $transaction = Transaction::findOrFail($request->id);\n\n Log::info(\"TransactionController->destroy :- Inside id \".$transaction->id);\n\n $stock_item_update = TransactionItem::where('transaction_id', $transaction->id)->first();\n\n if($transaction->reference_id != null){\n $reference_status = Transaction::find($transaction->reference_id);\n }\n \n $transaction_type = AccountVoucher::find($transaction->transaction_type_id);\n\n $transaction_id = TransactionFieldValue::where('transaction_id', $transaction->id)->get();\n\n if(count($transaction_id) > 0) {\n foreach($transaction_id as $id) {\n TransactionFieldValue::where('id', $id->id)->first()->delete();\n }\n }\n\n if($transaction->approval_status == 1)\n {\n if($transaction_type->name == \"credit_note\" || $transaction_type->name == \"purchases\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n }\n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n if($stock_item_update->stock_update == 1){\n\n foreach ($items as $item) {\n\n $stock = InventoryItemStock::find($item->item_id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first();\n\n //dd($inventory_item_batch);\n \n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)\n ->first();\n\n if($stock != null) {\n\n //$inventory_stock = $stock->in_stock - $item->quantity;\n\n if($stock->in_stock <= $item->quantity)\n {\n $inventory_stock = 0.00;\n }else{\n $inventory_stock = $stock->in_stock - $item->quantity;\n }\n \n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true); \n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0];\n\n $stock->data = json_encode($data);\n\n\n $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first();\n\n $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ];\n\n /*$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null);*/\n\n $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id);\n \n $stock->save();\n\n /* Item Batch Update */\n\n if($inventory_item_batch != null)\n {\n /*if($inventory_item_batch->quantity <= $item->quantity)\n {\n $inventory_item_batch->quantity= 0.00;\n }\n else{\n $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity;\n }\n\n $inventory_item_batch->save();*/\n\n InventoryItemBatch::where('id', $inventory_item_batch->id)->first()->delete();\n } \n\n /* End */\n }\n \n }\n }\n }\n\n if($transaction_type->name == \"goods_receipt_note\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n } \n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n if($stock_item_update->stock_update == 0 && $reference_status->approval_status == 1){\n\n foreach ($items as $item) {\n\n $stock = InventoryItemStock::find($item->item_id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first();\n\n //dd($inventory_item_batch);\n \n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)\n ->first();\n\n if($stock != null) {\n\n //$inventory_stock = $stock->in_stock - $item->quantity;\n\n if($stock->in_stock <= $item->quantity)\n {\n $inventory_stock = 0.00;\n }else{\n $inventory_stock = $stock->in_stock - $item->quantity;\n }\n \n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true); \n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0];\n\n $stock->data = json_encode($data);\n\n\n $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first();\n\n $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ];\n\n /*$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null);*/\n\n $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id);\n \n $stock->save();\n\n /* Item Batch Update */\n\n if($inventory_item_batch != null)\n {\n /*if($inventory_item_batch->quantity <= $item->quantity)\n {\n $inventory_item_batch->quantity= 0.00;\n }\n else{\n $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity;\n }\n\n $inventory_item_batch->save();*/\n\n InventoryItemBatch::where('id', $inventory_item_batch->id)->first()->delete();\n } \n\n /* End */\n }\n \n }\n }\n\n }\n\n if( $transaction_type->name == \"debit_note\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n }\n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n \n\n foreach ($items as $item)\n {\n $stock = InventoryItemStock::find($item->item_id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $inventory_item_batch = InventoryItemBatch::find($item->batch_id);\n\n //dd($inventory_item_batch);\n\n //$inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first();\n\n /*$data = Custom::get_least_closest_date(json_decode($stock->data, true));\n\n $qty = $data['quantity'];*/ \n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)\n ->first();\n\n if($stock != null) {\n\n $inventory_stock = $stock->in_stock + $item->quantity;\n \n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true);\n \n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0];\n\n $stock->data = json_encode($data);\n\n\n $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first();\n\n $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ];\n\n $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id);\n \n $stock->save();\n\n\n /* Item Batch Update */\n\n if($inventory_item_batch != null)\n {\n $inventory_item_batch->quantity = $inventory_item_batch->quantity + $item->quantity;\n\n $inventory_item_batch->save();\n } \n\n /* End */\n } \n }\n \n }\n\n\n if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n }\n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n if($stock_item_update->stock_update == 1){\n\n foreach ($items as $item) \n {\n $stock = InventoryItemStock::find($item->item_id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $inventory_item_batch = InventoryItemBatch::find($item->batch_id);\n\n //dd($inventory_item_batch);\n\n //$inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first();\n\n /*$data = Custom::get_least_closest_date(json_decode($stock->data, true));\n\n $qty = $data['quantity'];*/ \n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)\n ->first();\n\n if($stock != null) {\n\n $inventory_stock = $stock->in_stock + $item->quantity;\n \n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true);\n \n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0];\n\n $stock->data = json_encode($data);\n\n\n $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first();\n\n $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ];\n\n $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id);\n \n $stock->save();\n\n\n /* Item Batch Update */\n\n if($inventory_item_batch != null)\n {\n $inventory_item_batch->quantity = $inventory_item_batch->quantity + $item->quantity;\n\n $inventory_item_batch->save();\n } \n\n /* End */\n } \n }\n }\n }\n\n\n if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\")\n {\n Custom::delete_revenue('total_revenue',$transaction->total);\n } \n\n }\n\n $transaction->delete();\n\n if(!empty($transaction->entry_id)) {\n AccountEntry::where('account_entries.id', $transaction->entry_id)->first()->delete();\n }\n\n /*over all addon transaction delete*/\n\n Custom::delete_addon('transaction');\n\n /* end */\n \n\n /* If we need separately addon delete use this */\n\n /*if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\")\n {\n Custom::delete_addon('invoice');\n } \n if($transaction_type->name == \"purchases\"){\n\n Custom::delete_addon('purchase');\n }\n if($transaction_type->name == \"goods_receipt_note\"){\n\n Custom::delete_addon('grn');\n }\n if($transaction_type->name == \"job_card\"){\n Custom::delete_addon('job_card');\n }*/\n\n /*end*/\n Log::info(\"TransactionController->destroy :- return id \".$transaction->id);\n \n return response()->json(['status' => 1, 'message' => 'Transaction'.config('constants.flash.deleted'), 'data' =>['gen_no'=>$transaction->gen_no]]);\n }",
"public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}",
"function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }",
"public static function handleCalculationsOfDeletedRights(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedRights($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);\n }",
"public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }",
"public function delete()\n {\n $LedgerEntyModel = new Core_Model_Finance_Ledger_Entry;\n $purchaseRecord = $this->fetch();\n $ledgerEntryIds = unserialize($purchaseRecord['s_ledger_ids']);\n for($i = 0; $i <= sizeof($ledgerEntryIds)-1; $i += 1) {\n $result = $LedgerEntyModel->deleteById($ledgerEntryIds[$i]);\n }\n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto(\n 'purchase_id = ?', $this->_purchaseId\n );\n $result = $table->delete($where);\n \n $log = $this->getLoggerService();\n $info = 'Purchase deleted with purchas id = '. $this->_purchaseId;\n $log->info($info);\n \n return $result;\n }",
"public abstract function delete($model, $useTransaction);",
"public static function handleCalculationsOfDeletedSale(Transaction $transaction): void\n {\n $items = $transaction->share->getSoldTransactions();\n $lot = $transaction->lot;\n $gain = $amount = MoneyManager::createMoney();\n\n $items->each(function ($item) use ($transaction, &$lot, &$gain, &$amount) {\n $itemSold = bcsub($item->lot, $item->remaining);\n $soldLot = ($itemSold < $lot) ? $itemSold : $lot;\n $item->remaining = bcadd($item->remaining, $soldLot);\n $soldAmount = $transaction->price->multiply($soldLot);\n $item->sale_average_amount = $item->sale_average_amount->subtract($soldAmount);\n $itemPreSold = bcsub($item->lot, $item->remaining);\n $item->sale_average = ($itemPreSold == '0') ? MoneyManager::createMoney() : $item->sale_average_amount->divide($itemPreSold);\n $item->sale_gain = $item->sale_average_amount->equals(MoneyManager::createMoney()) ? MoneyManager::createMoney() : $item->sale_average_amount->subtract($item->amount);\n $item->update();\n\n $buyingAmount = $item->price->multiply($soldLot);\n $amount = $amount->add($buyingAmount);\n $gain = $gain->add($soldAmount->subtract($buyingAmount));\n\n $lot = $lot - $soldLot;\n if ($lot == 0) {\n return false;\n }\n });\n\n $transaction->share->handleCalculationsOfDeletedSale($transaction, $gain, $amount);\n $transaction->share->portfolio->handleCalculationsOfDeletedSale($transaction, $gain, $amount);\n }",
"public function destroy(balacetransaction $balacetransaction)\n {\n //\n }",
"public function delete() {\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_tax_rates' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'wc_tax_rate_classes' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_items' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_itemmeta' );// phpcs:ignore\n\t\t$this->order = null;\n\t\t$this->product = null;\n\t\t$this->tax_rate_ids = array();\n\t}",
"public function deleteSelf() {\n trace('[METHOD] '.__METHOD__);\n if ($this->get_uid()) {\n $this->set_deleted(true);\n $dataArray = $this->getDataArray();\n $this->set_uid(tx_ptgsaaccounting_orderCreditBalanceAccessor::getInstance()->storeOrderCreditBalanceData($dataArray));\n }\n \n\n }",
"public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}",
"public function deleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }",
"public function delete_transaction($transaction_id){\n //delete any note suggestions for the deal\n\t\t/***********\n\t\tsng:30/apr/2012\n\t\tWe now have transaction_note_suggestions\n\t\t**************/\n $q = \"delete from \".TP.\"transaction_note_suggestions where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any notes for the deal\n $q = \"delete from \".TP.\"transaction_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any error reports for the deal\n $q = \"delete from \".TP.\"transaction_error_reports where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*****************************************************************/\n //delete any sources for the deal\n $q = \"delete from \".TP.\"transaction_sources where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*******************************************************************/\n //delete partner members assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partner_members where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete partner banks/law firms assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partners where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete the transaction/tombstone from tombstone_favorite_tombstones\n //tombstone_id is same as transaction id\n $q = \"delete from \".TP.\"favorite_tombstones where tombstone_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /******************************************************************************/\n /**********\n sng:22/sep/2010\n since there can be multiple logos for a transaction, need to delete the images first\n the logos field has the multiple logo images in serialised form\n an array each of which is an array (fileName, default)\n \n also, if those logos are chosen, those have to be deleted [tombstone_chosen_logos ]\n since this is a serialised list, how to update?\n This part should be handled by Mihai\n ************/\n $q = \"select logos from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $res = mysql_query($q);\n if($res){\n $cnt = mysql_num_rows($res);\n if($cnt > 0){\n $row = mysql_fetch_assoc($res);\n $logos = $row['logos'];\n if($logos!=NULL){\n $logos_arr = unserialize($logos);\n $logos_cnt = count($logos_arr);\n if($logos_cnt > 0){\n foreach($logos_arr as $key=>$value){\n @unlink(FILE_PATH.\"uploaded_img/logo/\".$value['fileName']);\n @unlink(FILE_PATH.\"uploaded_img/logo/thumbnails/\".$value['fileName']);\n }\n }\n }\n }\n }\n /***************************************\n sng:22/nov/2010\n Now it can happen that press release entry may store the deal id if that press release item talks about this deal\n So, before deleting this deal, we will set the deal id in press release to blank (because we cannot delete the press release, that is\n independent of deal)\n **********/\n $q = \"update \".TP.\"press_releases set deal_id='0' where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any private note for the deal\n ******************/\n $q = \"delete from \".TP.\"transaction_private_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/*************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any discussion for this deal\n\t\t************/\n\t\t$q = \"delete from \".TP.\"transaction_discussion where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any case studies for the deal. Before deleting the case study, get the filename and delete it first\n\t\t*****************************/\n\t\t$q = \"select filename from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$filename = $row['filename'];\n\t\t\tif(($filename!=\"\")&&file_exists(FILE_PATH.\"case_studies/\".$filename)){\n\t\t\t\tunlink(FILE_PATH.\"case_studies/\".$filename);\n\t\t\t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************\n\t\tsng:1/july/2011\n\t\tDelete any transaction correction for this deal. Before deleting it, delete the correcponding records\n\t\tfrom transaction suggestion partner\n\t\t*************/\n\t\t$q = \"select id from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$suggestion_id = $row['id'];\n\t\t\t$del_q = \"delete from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$suggestion_id.\"'\";\n\t\t\t$success = mysql_query($del_q);\n \tif(!$success){\n \treturn false;\n \t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************************\n\t\tsng:1/july/2011\n\t\tDelete the transaction extra detail for the deal\n\t\t********************/\n\t\t$q = \"delete from \".TP.\"transaction_extra_detail where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************/\n //now delete the transaction\n $q = \"delete from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************************/\n return true;\n }",
"public function execute()\n {\n $agreementModel = $this->_initBillingAgreement();\n\n if ($agreementModel) {\n try {\n $agreementModel->delete();\n $this->messageManager->addSuccessMessage(\n __('You deleted the billing agreement.')\n );\n $this->_redirect('paypal/*/');\n return;\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $this->messageManager->addExceptionMessage(\n $e,\n $e->getMessage()\n );\n } catch (\\Exception $e) {\n $this->messageManager->addExceptionMessage(\n $e,\n __('We can\\'t delete the billing agreement.')\n );\n }\n $this->_redirect('paypal/*/view', ['_current' => true]);\n }\n $this->_redirect('paypal/*/');\n }",
"public function purchase_item_delete()\n {\n /** Delete item from purchase details table */\n $this->MPurchase_details->delete(trim($this->input->post('item_id')));\n /** Update AVCO price in item table */\n $avco = $this->MPurchase_details->get_avco(trim($this->input->post('item_id')));\n $this->MItems->update_field(trim($this->input->post('item_id')), 'avco_price', $avco);\n\n $msg = $this->purchase_table($this->input->post('purchase_no'));\n echo $msg;\n }",
"public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }",
"public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}",
"function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }",
"public function delete()\n {\n // If deposit is existing, will get database ID removed.\n $this->dbID = $this->db->deleteDeposit($this);\n }"
]
| [
"0.69621783",
"0.6912633",
"0.6727354",
"0.6727354",
"0.6727354",
"0.6727354",
"0.66313577",
"0.662857",
"0.6467369",
"0.6448657",
"0.6408586",
"0.63986605",
"0.639699",
"0.639288",
"0.6375222",
"0.6350462",
"0.6301976",
"0.62799805",
"0.6264247",
"0.6263157",
"0.62389624",
"0.6222265",
"0.6206156",
"0.6203923",
"0.62020904",
"0.61942375",
"0.6189524",
"0.6160128",
"0.6118822",
"0.6093453"
]
| 0.73986006 | 0 |
Handle calculations when create a new public offering transaction instance. | public static function handleCalculationsOfPublicOffering(Transaction $transaction): void
{
$transaction->handleCalculationsOfBuying();
$transaction->share->handleCalculationsOfBuying($transaction);
$transaction->share->portfolio->handleCalculationsOfBuying($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createPayment()\n\t{\n\n\t}",
"function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\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\tif (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}",
"public function calculatePayment()\n {\n }",
"public function store(Request $request)\n { \n $default_currency = Currency::default();\n $exchange_rate_id = $default_currency->id;\n $selected_currency = Currency::findOrFail($request->current_currency_id);\n $exchange_rate = CurrencyExchangeRate::currentRate($selected_currency->id);\n $calculation = ($selected_currency->calculation == 'multiplication') ? 'divide' : 'multiplication';\n $rate = 1;\n \n // Start transaction!\n DB::beginTransaction();\n\n try {\n // ...\n $quotation = new Quotation();\n $quotation->quotation_number = config('global.codes.quotation');\n $quotation->customer_id = $request->customer_id;\n $quotation->quotation_date = \\Carbon\\Carbon::now();\n $quotation->validity_date = $request->validity;\n $quotation->payment_term_id = $request->payment_term_id;\n $quotation->delivery_method_id = $request->delivery_method_id; \n $quotation->amount = $request->amount;\n $quotation->tax = $request->pay_tax;\n $quotation->discount = $request->discount;\n $quotation->discount_amount = $request->discount_amount;\n $quotation->grand_total = $request->grand_total;\n $quotation->rate = $rate;\n $quotation->currency_id = $default_currency->id;\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $rate = $exchange_rate->rate;\n $quotation->amount = $this->exchangeRate($calculation, $request->amount, $rate);\n $quotation->tax = $this->exchangeRate($calculation, $request->pay_tax, $rate);\n $quotation->discount_amount = $this->exchangeRate($calculation, $request->discount_amount, $rate);\n $quotation->grand_total = $this->exchangeRate($calculation, $request->grand_total, $rate);\n $quotation->rate = $rate;\n $quotation->is_default_currency = 0;\n $quotation->currency_id = $selected_currency->id;\n }\n\n $quotation->save();\n\n // retreive the id and combine with the quotation code\n $quotation->quotation_number = $quotation->quotation_number.$quotation->id;\n $quotation->save();\n // ...\n // create quotation details reference to quotation id above\n foreach ($request->product_id_array as $key => $value) {\n $detail = new QuotationDetail();\n $detail->quotation_id = $quotation->id;\n $detail->product_id = $request->product_id_array[$key];\n $detail->product_name = $request->product_name_array[$key];\n $detail->notes = $request->description_array[$key];\n $detail->variant_ids = $request->variant_ids[$key];\n $detail->qty = $request->qty_array[$key];\n $detail->unit_price = $request->price_array[$key];\n $detail->tax = $request->tax_array[$key];\n $detail->pay_tax = $request->pay_tax_array[$key];\n $detail->discount = $request->discount_array[$key];\n $detail->discount_amount = $request->discount_amount_array[$key];\n $detail->subtotal = $request->subtotal_array[$key];\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $detail->pay_tax = $this->exchangeRate($calculation, $request->pay_tax_array[$key], $rate);\n $detail->discount_amount = $this->exchangeRate($calculation, $request->discount_amount_array[$key], $rate);\n $detail->unit_price = $this->exchangeRate($calculation, $request->price_array[$key], $rate);\n $detail->subtotal = $this->exchangeRate($calculation, $request->subtotal_array[$key], $rate);\n } \n\n $detail->save();\n }\n\n } catch(\\Exception $e)\n {\n DB::rollback();\n throw $e;\n }\n\n DB::commit(); \n return response()->json([ 'quotation' => $quotation, 'status' => 'success']); \n }",
"public function actionCreate($amountFrom = null, $exchangeId = null, $amount = null){\n\n if (!Yii::$app->session['amountFrom']) {\n return $this->redirect(['//site/index']);\n }\n\n $model = new Transaction();\n\n if ($model->load(Yii::$app->request->post())){\n $load = Yii::$app->request->post();\n \n $model->clientId = Yii::$app->user->id;\n\n // Exchange Rate Used\n $er = ExchangeRate::find()->where(['id' => $load['Transaction']['exchangeId']])->one();\n $model->currencyIdFrom = $er->currencyIdFrom;\n $model->currencyIdTo = $er->currencyIdTo;\n $model->sellRateValue = $er->sellValue;\n $model->buyRateValue = $er->buyValue;\n \n // Check if I should multiply or divide according to the \"base\" currency (id=1)\n // Multiply\n if ($model->currencyIdFrom == 1){\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n // Divide\n else if ($model->currencyIdTo == 1){\n $model->amountTo = $model->amountFrom/$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountFrom/$model->buyRateValue) - $model->amountTo;\n }\n // For the future...\n else {\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n \n // Look for the account the user tranfered the money to and update the available amount of money\n //$accountAdmin = AccountAdmin::find()->where(['id' => $load['Transaction']['accountAdminId']])->one();\n \n // Look for the available amount of money in every account of the To \n //$accountAdmin = new AccountAdmin();\n //$accounts = $accountAdmin->getAccountsAvailableMoney($model->amountTo);\n \n // Available money in all of the accounts\n $accountAdmin = new AccountAdmin();\n $available = $accountAdmin->getAmountSumByCurrency($er->currencyIdTo);\n \n // If the account \"has\" the money... continue\n if ($available['total'] >= $model->amountTo){\n $model->transactionDate = Yii::$app->formatter->asDate($_POST['Transaction']['transactionDate'], 'yyyy-MM-dd');\n \n // Transaction receipt\n $upload_file = UploadedFile::getInstance($model, 'uploadFile');\n\n if (!empty($upload_file) && $upload_file->size !== 0){\n\n if ($model->validate()){\n if ($model->save()){\n\n $fileName = 't-' . $model->id . '.' . $upload_file->extension;\n $model->uploadFile = $fileName;\n $model->save();\n\n $upload_file->saveAs('uploads/' . $fileName);\n\n /**\n * Unsets the session variables\n */\n\n Yii::$app->session->remove('amountFrom');\n Yii::$app->session->remove('currencyIdFrom');\n Yii::$app->session->remove('currencyIdTo');\n\n // \"Substract\" the amountTo from the account\n //$accountAdmin->maxAmount = $accountAdmin->maxAmount - $model->amountTo;\n //$accountAdmin->save();\n \n return $this->redirect(['index']);\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Debe agregar el comprobante de la transacción.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }\n else {\n Yii::$app->getSession()->setFlash('error','La cantidad solicitada no se encuentra disponible. Por favor pruebe con un monto más bajo.');\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n /*$er1 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdFrom']], ['currencyIdTo' => $load['Transaction']['currencyIdTo']]])->one();\n \n if ($er1 != null){\n $model->sellRateValue = $er1->sellValue;\n $model->buyRateValue = $er1->buyValue;\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $er1->sellValue;\n }\n else {\n $er2 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdTo']], ['currencyIdTo' => $load['Transaction']['currencyIdFrom']]])->one();\n \n if ($er2 != null){\n $model->sellRateValue = $er2->sellValue;\n $model->buyRateValue = $er2->buyValue;\n $model->amountTo = $model->amountFrom/$model->buyRateValue;\n $model->usedValue = $er2->buyValue;\n } \n }*/ \n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }",
"public function makePurchase() {;\n $this->setTotalPurchases($this->getTotalPurchases()+1);\n $this->setTotalAllAccess($this->getTotalAllAccess()+$this->getTotalAccess());\n $this->setTotalAccess(0);\n }",
"public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}",
"public function create()\n {\n $this->authorize('create', Transaction::class);\n }",
"public function createInvoice()\r\n {\r\n }",
"public function create(Request $request)\n {\n $policy = new Policy();\n\n $now = Carbon::now();\n $next_year = Carbon::now()->addYear()->subDay();\n\n $policy->date_from = $now->format('d.m.Y');\n $policy->time_from = $now->addHour()->format('H').':00';\n $policy->date_to = $next_year->format('d.m.Y');\n $policy->time_to = '24:00';\n $policy->sign_date = $now->format('d.m.Y');\n $policy->same_client_owner = true;\n $policy->p_base = 4118;\n $policy->p_k1 = 1.8;\n $policy->p_k2 = 1.0;\n $policy->p_k3 = 1.0;\n $policy->p_k4 = 1.0;\n $policy->p_k5 = 1.0;\n $policy->p_k6 = 1.0;\n $policy->p_k7 = 1.0;\n $policy->p_k8 = 1.0;\n $policy->policy_serial = 'EEE';\n $policy->dk_date = $next_year->format('d.m.Y');\n $policy->t_amount = 500.0;\n $policy->f_amount = 2000.0;\n\n $max_policy_number = Policy::all()->max('policy_number');\n if(!$max_policy_number){\n $max_policy_number = '0724573036';\n }\n $max_receipt_number = Policy::all()->max('receipt_number');\n if(!$max_receipt_number){\n $max_receipt_number = '1711116';\n }\n $policy->policy_number = str_pad((int)$max_policy_number + 1, 10, '0', STR_PAD_LEFT);\n $policy->receipt_number = (int)$max_receipt_number + 1;\n\n $vehicles = [];\n $client = Client::find($request->get('client_id'));\n if($client){\n $policy->client = $client;\n $policy->drivers = $client->drivers;\n $vehicles = $client->vehicles;\n //if(!empty($vehicles)){\n // $policy->vehicle = $client->vehicles()->first();\n //}\n }\n $policy->company_name = trans('policy.Company Megaruss');\n $policy->owner_company = false;\n\n session()->put('url.intended', URL::previous());\n\n $companies = Policy::getCompanyOptionsForSelect();\n $makers = Vehicle::getMakeOptionsForSelect();\n\n return view('policies.create', compact('policy','vehicles','companies','makers'));\n }",
"abstract protected function handlePayment();",
"function public_payment_info() {\n if (!$this->request->isAsyncCall()) {\n $this->response->badRequest();\n } // if\n if ($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n }",
"function create() {\n\n if ( ! authCheck(['salesperson', 'manager']) ) {\n\n return json_encode(['success' => false, 'authorised' => false]);\n\n } else {\n\n $requestBody = file_get_contents('php://input');\n $data = json_decode($requestBody);\n\n // make quote\n $quote = new \\App\\Quote;\n $quote->owner = $_COOKIE['userid'];\n $quote->customer_name = getPropertySafely($data, 'customer_name');\n $quote->address = getPropertySafely($data, 'address');\n $quote->date = (getPropertySafely($data, 'date')) ? getPropertySafely($data, 'date') . ' 00:00:00': '1970-01-01 00:00:00';\n $quote->appointment_number = getPropertySafely($data, 'appointment_number');\n $quote->product_price = getPropertySafely($data, 'total_product_price');\n $quote->installation_price = getPropertySafely($data, 'total_installation_price');\n $quote->cost_price = getPropertySafely($data, 'total_price');\n $quote->save();\n $quoteId = $quote->id;\n\n foreach($data->products as $productName => $product) {\n\n foreach ($product as $rowId => $row) {\n\n // make quote product (\"Item\")\n $quoteProduct = new \\App\\QuoteProduct;\n $quoteProduct->quote_id = $quoteId;\n $quoteProduct->product = $productName;\n $quoteProduct->row = $rowId;\n $quoteProduct->save();\n $quoteProductId = $quoteProduct->id;\n\n foreach ($row as $settingName => $value) {\n\n // make quote product setting (could specify product to remove quote products table)\n $qpSetting = new \\App\\QuoteProductSetting;\n $qpSetting->quote_id = $quoteId;\n $qpSetting->quote_product_id = $quoteProductId;\n $qpSetting->setting = $settingName;\n if ($settingName == \"location\" || $settingName == \"description\" ) {\n $qpSetting->valueString = $value;\n } else {\n $qpSetting->value = $value;\n }\n $qpSetting->save();\n\n }\n }\n }\n\n //die();\n \n return json_encode(['success' => true, 'id' => $quoteId]);\n }\n }",
"function billing_userpanel_payment_invoiceCreate(){\n\tif(!$uid = $_SESSION['uid']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$cost = intval($_REQUEST['cost'])){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$method = $_REQUEST['method']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(substr($method, 0, 6)=='manual'){\n\t\treturn billing_userpanel_payment_offline();\n\t} else if(!function_exists('billing_userpanel_payment_'.$method)){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else {\n\t\t$order_id = $_REQUEST['order_id'];\n\t\tif($order_id){\n\t\t\tif(!$rs = dbq(\" SELECT COUNT(*) FROM `billing_invoice` WHERE `order_id`='$order_id' \")){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else if(dbn($rs)==0){\n\t\t\t\t;// its new, we need to insert it\n\t\t\t} else if(!$rw = dbf($rs)){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else {\n\t\t\t\t$invoiceId = $rw['id'];\n\t\t\t}\n\t\t}\n\t\tif($invoiceId){\n\t\t\t;// it already inserted\n\t\t} else if(!dbq(\" INSERT INTO `billing_invoice` (`uid`,`order_id`,`cost`,`method`) VALUES ('$uid','$order_id','$cost','$method') \")){\n\t\t\te(__LINE__.\" : \".__FILE__.\" \".dbe());\n\t\t} else {\n\t\t\t$invoiceId = dbi();\n\t\t}\n\t\tcall_user_func('billing_userpanel_payment_'.$method, $invoiceId);\n\t}\n}",
"private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }",
"public function createTransaction()\n {\n }",
"public function store(Request $request) {\n \n $request->validate([\n 'amount_paid' => 'required',\n ]);\n\n $tenant_id = $request->input('tenant_id');\n $findPropertyId = Tenant::where('id', '=', $tenant_id)->first(); \n $property_id = $findPropertyId->property_id;\n $landlord_id = Auth::user()->id;\n $user = User::where('id', '=', $findPropertyId->user_id)->first();\n\n // figure the late fee\n $latefee = $this->calculateLateFee($request->input('late_fee_amount'));\n \n $property = Property::join('rents', 'rents.property_id', '=', 'properties.id')\n ->where('properties.id', '=', $property_id)\n ->first();\n\n // calculate the balance\n $amount_paid = $request->input('amount_paid');\n $currentBalance = $this->findRentBalance($tenant_id) + $property->rent_amount;\n $newBalance = $this->calculateNewBalance($currentBalance, $amount_paid, $property->rent_amount); \n\n // calc paid in full\n $paid_in_full = 0;\n if( $newBalance <= 0 ) {\n $paid_in_full = 1;\n }\n\n // generate the confirmation code\n $confirmationNumber = str_random(10);\n\n $transaction = new Transaction([\n 'tenant_id' => $tenant_id,\n 'landlord_id' => $landlord_id,\n 'property_id' => $property_id,\n 'amount_paid' => $amount_paid,\n 'payment_method' => 'cash/check',\n 'paid_in_full' => $paid_in_full,\n 'late_fee_amount' => $latefee,\n 'confirmation' => $confirmationNumber,\n ]);\n $transaction->save();\n\n // find the next due date \n $numberOfMonths = $amount_paid / $property->rent_amount; \n $roundMonth = floor($numberOfMonths); // always round down\n\n // save balance to rents table \n $rents = Rent::where('property_id', '=', $property_id)->first();\n $rents->balance = $newBalance;\n $rents->next_due_date = Carbon::now()->addMonths($roundMonth);\n $rents->save();\n\n // send email to tenant\n Mail::to($user->email)->send(new ManualPaymentConfirmation($user, $amount_paid, $transaction->created_at, $confirmationNumber));\n\n return redirect()\n ->route('tenants.index')\n ->with('info', 'Good job! You have successfully entered the tenants rent payment for the month. It will reflect on the tenants page.');\n\n }",
"protected function createSavepoint()\n {\n $this->exec(\n $this->compileSavepoint('trans' . ($this->transactions + 1))\n );\n }",
"protected function createPayment() {\n /* @var \\Drupal\\commerce_payment\\Plugin\\Commerce\\PaymentGateway\\PaymentGatewayInterface $payment_gateway */\n $payment_gateway = $this->order->payment_gateway->entity;\n $payment_method = $this->order->payment_method->entity;\n\n $now = REQUEST_TIME;\n $mode = SIPSPaymentGateway::MODES[$payment_gateway->getPlugin()->configuration['mode']];\n\n // Create a payment entity which will be initially in \"pending mode\":\n // \"pending mode\": means that the payment was still not finished in SIPS,\n // so the user is in the platform filling in the credit card or he/she had\n // problems to pay that time (timeout/closed the browser/etc).\n $payment = Payment::create([\n 'order_id' => $this->order->id(),\n 'payment_method' => $payment_method->id(),\n 'payment_gateway' => $payment_gateway->id(),\n // Give it a status: pending/failed/done.\n 'state' => 'new',\n 'remote_state' => 'pending',\n // Give it a max_timestamp of 24 hours.\n 'authorization_expires' => $now + (24 * 60 * 60),\n // Give it a transaction reference.\n 'remote_id' => $this->order->id() . $now,\n 'test' => $mode != PaymentRequest::PRODUCTION,\n 'amount' => $this->order->getTotalPrice(),\n ]);\n\n $payment->save();\n\n return $payment;\n }",
"public function run()\n {\n $saleItemM1 = SaleItem::where('name', '=', 'Marketino ONE')->firstOrFail();\n\n $saleItemM1->prices()->create([\n\t\t\t'is_default' => true,\n\t\t\t'name' => 'Marketino ONE - Limited promo',\n\t\t\t'original_net_price' => 799,\n\t\t\t'net_price' => 499,\n\t\t\t'short_id' => 'M1-LIMITED-PROMO'\n ]);\n }",
"public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }",
"public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public function create()\n {\n // Checks for login data\n if ($this->agent->is_mobile()) {\n if ($this->input->post(\"user_token\") != 1) show_404();\n } else if ($this->agent->is_browser()) {\n if ($this->session->userdata(\"user_token\") != 1) show_404();\n } else {\n return;\n }\n\n // Default Process Transaction Data\n $transactionData = array(\n \"transaction_date\" => strtotime(\"now\"),\n \"return_date\" => 0,\n \"amount_paid\" => 0,\n \"status\" => $this->input->post(\"status\"),\n \"itembook_id\" => $this->input->post(\"itembook_id\"),\n \"user_id\" => $this->input->post(\"user_id\")\n );\n\n // Default Process Item Book Data\n $itemBookData = array(\n \"itembook_id\" => $transactionData[\"itembook_id\"]\n );\n\n // Checks for Type of Transaction\n // Transaction types:\n // 1 - reserve\n // 2 - borrow\n // 3 - returned\n // 4 - paid\n // 5 - disabled\n // 6 - enable\n switch ($transactionData[\"status\"]) {\n case \"1\":\n // Change the status of the Item Book to reserved\n $itemBookData[\"status\"] = 2;\n break;\n case \"2\":\n // Change the status of the Item Book to borrowed\n $itemBookData[\"status\"] = 3;\n break;\n case \"3\":\n // Check for the last Transaction where the book was borrowed\n if ($lastTransactionData = $this->Transaction_model->getTransactionsByBook(array(\"transactiontbl.itembook_id\" => $this->input->post(\"itembook_id\")))) {\n $transactionData[\"user_id\"] = $lastTransactionData[0]->user_id;\n }\n\n // Get the penalty for the date of the last transaction\n $penalty = $this->Penalty_model->getPenalty($lastTransactionData[0]->transaction_date);\n\n // Get the current date and time\n $transactionData[\"return_date\"] = strtotime(\"now\");\n\n // Check if the penalty is going to be applied\n if (strtotime(\"now\") > strtotime(\"+\" . $penalty[0]->penalty_day . \" day\", $lastTransactionData[0]->transaction_date)) {\n // Apply penalty based on the number of days exceeded\n $transactionData[\"amount_paid\"] = $penalty[0]->penalty_amount * ceil((strtotime(\"now\") - strtotime(\"+\" . $penalty[0]->penalty_day . \" day\", $lastTransactionData[0]->transaction_date)) / 86400);\n }\n\n // Change the status of the Item Book to available\n $itemBookData[\"status\"] = 1;\n break;\n case \"4\":\n // Remove Item Book\n $transactionData[\"itembook_id\"] = 0;\n\n // Get Payment\n $transactionData[\"amount_paid\"] = $this->input->post(\"payment\");\n\n // Get Total of the Penalty\n $penalties = $this->Transaction_model->getUserPenalties(array(\"user_id\" => $this->input->post(\"user_id\"), \"status\" => \"3\"));\n $paid = $this->Transaction_model->getUserPaid(array(\"user_id\" => $this->input->post(\"user_id\"), \"status\" => \"4\"));\n\n // If Payment is greater than the Total Penalty\n if ($transactionData[\"amount_paid\"] > ($penalties - $paid)) {\n echo json_encode(array(\n \"response\" => 0,\n \"errorMessage\" => \"Payment is greater than the penalty\"\n ));\n return;\n }\n break;\n case \"5\":\n // Get Current Admin Disabling the Book\n $transactionData[\"user_id\"] = $this->session->userdata(\"user_token\");\n\n // Change the status of the Item Book to disabled\n $itemBookData[\"status\"] = 4;\n break;\n case \"6\":\n // Get Current Admin Enabling the Book\n $transactionData[\"user_id\"] = $this->session->userdata(\"user_token\");\n\n // Change the status of the Item Book to available\n $itemBookData[\"status\"] = 1;\n break;\n }\n\n // Insert Transaction Data\n if ($this->Transaction_model->createTransaction($transactionData)) {\n if ($transactionData[\"status\"] == 4) {\n echo json_encode(array(\n \"response\" => 1\n ));\n return;\n }\n if ($this->Book_model->updateBook(\"itembooktbl\", array(\"status\" => $itemBookData[\"status\"]), array(\"itembook_id\" => $itemBookData[\"itembook_id\"]))) {\n echo json_encode(array(\n \"response\" => 1,\n \"data\" => $transactionData\n ));\n return;\n }\n }\n }",
"private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }",
"public function create()\n {\n return 'create payment working';\n }",
"public function create_simple($data) {\n\n $plan = $this->csmplan->get($data['plan_id']);\n if (empty($plan)) {\n throw new Exception('Something went wrong. Membership plan does not exist');\n } else {\n $this->gump->validation_rules(array(\n 'user_id' => 'required|max_len,100',\n 'plan_id' => 'required|numeric',\n 'plan_start' => 'required|date',\n 'vat' => 'required|numeric'\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n $response = $this->create(array(\n 'user_id' => $data['user_id'],\n 'plan_id' => $plan['plan_id'],\n 'plan_start' => $data['plan_start'],\n 'plan_end' => date('Y-m-d', (strtotime($data['plan_start']) + ($plan['days'] * 60 * 60 * 24))),\n 'approved' => $data['approved'] ? 1 : 0,\n 'payment' => $data['payment'] ? 1 : 0,\n 'payment_method' => $data['payment_method'],\n 'payment_at' => $data['payment_at'],\n 'price' => $plan['price'],\n 'vat' => $plan['vat'],\n 'price_total' => $plan['price'] + (($plan['price'] / 100) * $data['vat'])\n ));\n if ($response !== 1) {\n throw new Exception('Something went wrong');\n } else {\n return $response;\n }\n }\n }\n }",
"public function createCostEstimate($request)\n {\n\n $user_id = $request->get('user_id');\n\n $vehicle_id = $request->get('vehicle_id',null);\n\n $location = $request->get('location',null);\n\n $city = $request->get('city',null);\n\n /** get array of object services & supplies */\n $item = $request->input('joborder_service_supplies');\n\n /** get array of user id techinician */\n $technician_id = $request->input('technician_id');\n\n\n DB::beginTransaction();\n\n /**\n * Get users\n */\n $user = $this->user\n ->addWith(['information.enterprise.vehicles','vehicles'])\n ->firstOrfail($user_id);\n\n try{\n /**\n * Create Bookings\n */\n $data = [\n 'vehicle_id' => $vehicle_id,\n 'address' => $request->get('address',''),\n 'concern' => $request->get('concern',''),\n 'concern_type' => $request->get('concern_type',null),\n 'date' => $request->get('date',null),\n 'time' => $request->get('time',null),\n 'status' => $request->get('status','pending'),\n 'booked_by' => $this->authUser->user_type\n ];\n\n /**\n * Consumer type Request\n */\n if($user->user_type === 'consumer')\n {\n $data['user_id'] = $user->id;\n $data['location'] = $location;\n $data['city'] = $city;\n }\n\n /**\n * Enterprise Type Request\n */\n if($user->user_type === 'enterprise')\n {\n $data['user_id'] = $user->id;\n $data['enterprise_id'] = $user->information->enterprise_id;\n }\n\n /** booking created */\n $booking = $this->booking->create($data);\n\n /**\n * Create Joborders\n */\n $data = [\n 'requested_at' => $request->get('requested_at',null),\n 'concern' => $request->get('concern',null),\n 'assessment' => $request->get('assessment',null),\n 'solution' => $request->get('solution',null),\n 'vehicle_id' => $vehicle_id,\n 'status' => $request->get('status','pending'),\n 'user_id' => $user->id,\n 'concern_type' => $request->get('concern_type',null),\n 'schedule' => $request->get('schedule',null),\n 'location' => $request->get('location',null),\n 'city' => $city,\n 'booking_id' => $booking->id,\n 'total' => $request->get('total',null)\n ];\n\n /**\n * Enterprise Type Request\n */\n if($user->user_type === 'enterprise')\n {\n $data['enterprise_id'] = $user->information->enterprise_id;\n }\n\n $joborder = $this->joborder->create($data);\n\n $joborder->load(['user.information.enterprise']);\n\n /**\n * Create Joborder Code\n */\n $this->joborder->update(['id' => $joborder->id],[\n 'code' => sprintf('%04d',$joborder->id),\n ]);\n\n\n /**\n * Send Message\n */\n $threadId = md5($joborder->user_id);\n if($joborder->user->information->enterprise_id !== null){\n $threadId = md5('enterprise-'.$joborder->user->information->enterprise->id);\n }\n\n $data = [\n 'thread_id' => $threadId,\n 'user_id' => $this->authUser->id,\n 'chat' => 'Joborder Created #' . $joborder->joborder_id . $joborder->code,\n 'is_read' => 'sent',\n 'joborder_id' => $joborder->id,\n ];\n\n $chatCreated = $this->message->create($data);\n\n $chatCreated->load(['joborder']);\n\n /**\n * Broadcast Messages\n */\n broadcast(new ChatMessages($chatCreated))->toOthers();\n\n /**\n * Update Booking status\n */\n if($request->has('booking_id') === TRUE)\n {\n $this->booking->update(['id' => $booking->id],[\n 'status' => $request->get('status','pending')\n ]);\n }\n\n /**\n * Save Service And Supplies\n */\n foreach ($item as $key => $value)\n {\n $value['joborder_id'] = $joborder->id;\n $this->joborderItem->create((array)$value);\n }\n\n /**\n * Save Data in Pivot\n */\n $joborder->users()->attach($technician_id);\n\n }catch(Exception $e){\n DB::rollback();\n\n return $this->response('error',[ $e->getMessage() ],Code::HTTP_BAD_REQUEST);\n }\n DB::commit();\n\n /**\n * Send SNS Notification\n */\n if($user->user_type === 'admin'){\n\n /**\n * Get All Users of Thread Id\n */\n $participant = $this->message->addWhere(['thread_id' => $chatCreated->thread_id])->addGroupBy('user_id')->fetch(FALSE,TRUE,FALSE);\n\n\n foreach ($participant as $key => $value){\n\n /**\n * Get All Devices of Users\n */\n $device = clone $this->device;\n $usersDevice = $device->addWhere(['user_id' => $value['user_id']])->fetch(FALSE,TRUE,FALSE);\n\n /**\n * Send Notif To ALl Mobile\n */\n if(count($usersDevice) !== 0){\n\n foreach ($usersDevice as $key => $value){\n\n Notification::sendToArn($chatCreated->chat,$value,['data' => $chatCreated],'mycasa_message');\n }\n }\n }\n }\n\n $joborder = $this->joborder->firstOrFail($joborder->id);\n\n return $this->response('success',$joborder,Code::HTTP_CREATED);\n\n }",
"public function create()\n\t{\n /*if(!in_array('viewProduct', $this->permission)) {\n redirect('dashboard', 'refresh');\n }*/\n\n $this->data['vendor'] = $this->model_products->getVendorData();\n $this->data['products'] = $this->model_products->getProductData();\n\n\t\t$this->render_template('invoice/create', $this->data);\t\n\t}",
"protected function calculatePrices()\n {\n }"
]
| [
"0.60616416",
"0.569195",
"0.5596257",
"0.55281425",
"0.55243003",
"0.54938686",
"0.54937685",
"0.5486746",
"0.5462518",
"0.5460336",
"0.5452661",
"0.54492795",
"0.53983766",
"0.5396981",
"0.5389064",
"0.5380063",
"0.53721285",
"0.5366993",
"0.5329868",
"0.5326797",
"0.531813",
"0.530538",
"0.52929735",
"0.5287746",
"0.5282893",
"0.5275033",
"0.5271338",
"0.52529836",
"0.5247111",
"0.52396214"
]
| 0.6334871 | 0 |
Handle calculations when delete a public offering transaction instance. | public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void
{
$transaction->share->handleCalculationsOfDeletedBuying($transaction);
$transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }",
"public function deleteDiscount();",
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"public function deleting()\n {\n # code...\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"public abstract function delete();",
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }",
"protected function _delete()\n\t{\n\t}",
"protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"protected function delete() {\n\t}",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"abstract protected function delete ();",
"function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function execute()\n {\n $agreementModel = $this->_initBillingAgreement();\n\n if ($agreementModel) {\n try {\n $agreementModel->delete();\n $this->messageManager->addSuccessMessage(\n __('You deleted the billing agreement.')\n );\n $this->_redirect('paypal/*/');\n return;\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $this->messageManager->addExceptionMessage(\n $e,\n $e->getMessage()\n );\n } catch (\\Exception $e) {\n $this->messageManager->addExceptionMessage(\n $e,\n __('We can\\'t delete the billing agreement.')\n );\n }\n $this->_redirect('paypal/*/view', ['_current' => true]);\n }\n $this->_redirect('paypal/*/');\n }",
"abstract function delete();",
"public static function handleCalculationsOfDeletedRights(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedRights($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);\n }"
]
| [
"0.6556547",
"0.6464026",
"0.6306264",
"0.62858546",
"0.6265374",
"0.62161106",
"0.6214771",
"0.6193351",
"0.6193351",
"0.6193351",
"0.6193351",
"0.61864406",
"0.618376",
"0.616365",
"0.61561817",
"0.6151534",
"0.61478794",
"0.61345446",
"0.61345446",
"0.61345446",
"0.61345446",
"0.61326766",
"0.61141807",
"0.606117",
"0.6061164",
"0.6061164",
"0.6060945",
"0.6032052",
"0.6024704",
"0.5995415"
]
| 0.74668634 | 0 |
Handle calculations when delete a sale transaction instance. | public static function handleCalculationsOfDeletedSale(Transaction $transaction): void
{
$items = $transaction->share->getSoldTransactions();
$lot = $transaction->lot;
$gain = $amount = MoneyManager::createMoney();
$items->each(function ($item) use ($transaction, &$lot, &$gain, &$amount) {
$itemSold = bcsub($item->lot, $item->remaining);
$soldLot = ($itemSold < $lot) ? $itemSold : $lot;
$item->remaining = bcadd($item->remaining, $soldLot);
$soldAmount = $transaction->price->multiply($soldLot);
$item->sale_average_amount = $item->sale_average_amount->subtract($soldAmount);
$itemPreSold = bcsub($item->lot, $item->remaining);
$item->sale_average = ($itemPreSold == '0') ? MoneyManager::createMoney() : $item->sale_average_amount->divide($itemPreSold);
$item->sale_gain = $item->sale_average_amount->equals(MoneyManager::createMoney()) ? MoneyManager::createMoney() : $item->sale_average_amount->subtract($item->amount);
$item->update();
$buyingAmount = $item->price->multiply($soldLot);
$amount = $amount->add($buyingAmount);
$gain = $gain->add($soldAmount->subtract($buyingAmount));
$lot = $lot - $soldLot;
if ($lot == 0) {
return false;
}
});
$transaction->share->handleCalculationsOfDeletedSale($transaction, $gain, $amount);
$transaction->share->portfolio->handleCalculationsOfDeletedSale($transaction, $gain, $amount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public static function handleCalculationsOfDeletedRights(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedRights($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);\n }",
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"public function delete()\n\n {\n Sales::find($this->deleteId)->delete();\n session()->flash('message', 'Sale Deleted Successfully.');\n\n }",
"public function deleteDiscount();",
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"public function deleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }",
"public function sales_unsaved_delete()\n {\n $sales_no = $this->input->post('sales_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created money receipt for partial or full cash sales */\n $mr = $this->MAc_money_receipts->get_by_doc('Sales', $sales_no);\n if (count($mr) > 0)\n {\n $this->MAc_money_receipts->delete($mr['id']);\n }\n /** Remove sales */\n $this->MSales_details->delete_by_sales_no($sales_no);\n $this->MSales_master->delete_by_sales_no($sales_no);\n }",
"public function deleteSell(Request $request, Transaction $transaction) {\n\n foreach ($transaction->sells as $sell) {\n //add deleted product into stock\n $product = Product::find($sell->product_id);\n $current_stock = $product->quantity;\n $product->quantity = $current_stock + $sell->quantity;\n $product->save();\n\n //delete the sales entry in sells table\n $sell->delete();\n }\n\n //delete all the payments against this transaction\n foreach($transaction->payments as $payment){\n $payment->delete();\n }\n\n //delete all the return sells against this transaction\n foreach($transaction->returnSales as $return){\n $return->delete();\n }\n\n //delete the transaction entry for this sale\n $transaction->delete();\n\n $message = trans('core.deleted');\n return redirect()->route('sell.index')->withSuccess($message);\n }",
"public function deleteAction(DeleteSaleRequest $request)\n {\n $saleId = $request->get('sale_id');\n $date = $request->get('date');\n \n $sale = Sale::where('id', $saleId)->where('status', 1)->first();\n\n if(!empty($sale) && !empty($sale->id)) {\n if(Carbon::parse($sale->date_time)->format('d-m-Y') != $date) {\n return redirect()->back()->with(\"message\",\"Deletion restricted. Date change detected!! #02/36\")->with(\"alert-class\",\"alert-danger\");\n }\n\n if($sale->transaction->created_user_id != Auth::id() && Auth::user()->role != 'admin') {\n return redirect()->back()->with(\"message\",\"Failed to delete the sale details.You don't have the permission to delete this record! #02/37\")->with(\"alert-class\",\"alert-danger\");\n }\n if($sale->created_at->diffInDays(Carbon::now(), false) > 5) {\n return redirect()->back()->with(\"message\",\"Deletion restricted.Only records created within 5 days can be deleted! #02/38\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $royality = Royalty::where('sale_id', $sale->id)->first();\n\n if(!empty($royality) && !empty($royality->id)) {\n $saleTransactionDelete = $sale->transaction->delete();\n $royaltyTransactionDelete = $sale->royality->transaction->delete();\n $royaltyDeleteFlag = $sale->royality->delete();\n $saleDeleteFlag = $sale->delete();\n\n if($saleTransactionDelete && $royaltyTransactionDelete && $saleDeleteFlag && $royaltyDeleteFlag) {\n return redirect()->back()->with(\"message\",\"#\". $sale->transaction->id. \" -Successfully deleted.\")->with(\"alert-class\",\"alert-success\");\n }\n }\n }\n\n return redirect()->back()->with(\"message\",\"Failed to delete the sale details.Try again after reloading the page! #02/39\")->with(\"alert-class\",\"alert-danger\");\n }",
"public function deleted(SaleService $saleService)\n {\n //\n }",
"public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }",
"public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public abstract function delete($model, $useTransaction);",
"public function destroy(sale $sale)\n {\n //\n }",
"public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}",
"public function sales_return_unsaved_delete()\n {\n $sales_return_no = $this->input->post('sales_return_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales Return', $sales_return_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove sales */\n $this->MSales_return_details->delete_by_sales_return_no($sales_return_no);\n $this->MSales_return_master->delete_by_sales_return_no($sales_return_no);\n }",
"public function deleted(ReservationPayment $ReservationPayment)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n if($sale->revenue)\n {\n Revenue::where('sale_id',$sale->id)->delete();\n }\n\n if($sale->report)\n {\n Report::where('sale_id',$sale->id)->delete();\n }\n\n $sale->delete();\n\n Session::flash('message', env(\"SAVE_SUCCESS_MSG\",\"Sale deleted succesfully!\"));\n session(['soldProds' => []]);\n session(['salePrice' => 0]);\n session(['sale_id'=>'']);\n\n //update user acc\n $credit = new UserTransactions;\n $credit->user_id = $sale->user_id;\n $credit->credit = $sale->amountDue;\n $credit->save();\n\n return redirect(route('sales.index'));\n }",
"public function destroy(Sale $sale)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n //\n }",
"public function destroy(Sale $sale)\n {\n //\n }"
]
| [
"0.69209814",
"0.6834642",
"0.6834642",
"0.6834642",
"0.6834642",
"0.67847335",
"0.67845356",
"0.67813015",
"0.67023003",
"0.66486967",
"0.66414255",
"0.65667963",
"0.65622205",
"0.6494417",
"0.6489171",
"0.6471843",
"0.64472",
"0.64314795",
"0.63318706",
"0.62631714",
"0.6185812",
"0.61695796",
"0.61694115",
"0.61483246",
"0.6137044",
"0.6137044",
"0.6137044",
"0.6137044",
"0.6137044",
"0.6137044"
]
| 0.6879189 | 1 |
Handle calculations when create a new dividend transaction instance. | public static function handleCalculationsOfDividend(Transaction $transaction): void
{
$transaction->dividend = $transaction->dividend_gain->divide($transaction->lot);
$transaction->update();
$transaction->share->handleCalculationsOfDividend($transaction);
$transaction->share->portfolio->handleCalculationsOfDividend($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"protected function calculatePrices()\n {\n }",
"public function store(Request $request)\n { \n $default_currency = Currency::default();\n $exchange_rate_id = $default_currency->id;\n $selected_currency = Currency::findOrFail($request->current_currency_id);\n $exchange_rate = CurrencyExchangeRate::currentRate($selected_currency->id);\n $calculation = ($selected_currency->calculation == 'multiplication') ? 'divide' : 'multiplication';\n $rate = 1;\n \n // Start transaction!\n DB::beginTransaction();\n\n try {\n // ...\n $quotation = new Quotation();\n $quotation->quotation_number = config('global.codes.quotation');\n $quotation->customer_id = $request->customer_id;\n $quotation->quotation_date = \\Carbon\\Carbon::now();\n $quotation->validity_date = $request->validity;\n $quotation->payment_term_id = $request->payment_term_id;\n $quotation->delivery_method_id = $request->delivery_method_id; \n $quotation->amount = $request->amount;\n $quotation->tax = $request->pay_tax;\n $quotation->discount = $request->discount;\n $quotation->discount_amount = $request->discount_amount;\n $quotation->grand_total = $request->grand_total;\n $quotation->rate = $rate;\n $quotation->currency_id = $default_currency->id;\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $rate = $exchange_rate->rate;\n $quotation->amount = $this->exchangeRate($calculation, $request->amount, $rate);\n $quotation->tax = $this->exchangeRate($calculation, $request->pay_tax, $rate);\n $quotation->discount_amount = $this->exchangeRate($calculation, $request->discount_amount, $rate);\n $quotation->grand_total = $this->exchangeRate($calculation, $request->grand_total, $rate);\n $quotation->rate = $rate;\n $quotation->is_default_currency = 0;\n $quotation->currency_id = $selected_currency->id;\n }\n\n $quotation->save();\n\n // retreive the id and combine with the quotation code\n $quotation->quotation_number = $quotation->quotation_number.$quotation->id;\n $quotation->save();\n // ...\n // create quotation details reference to quotation id above\n foreach ($request->product_id_array as $key => $value) {\n $detail = new QuotationDetail();\n $detail->quotation_id = $quotation->id;\n $detail->product_id = $request->product_id_array[$key];\n $detail->product_name = $request->product_name_array[$key];\n $detail->notes = $request->description_array[$key];\n $detail->variant_ids = $request->variant_ids[$key];\n $detail->qty = $request->qty_array[$key];\n $detail->unit_price = $request->price_array[$key];\n $detail->tax = $request->tax_array[$key];\n $detail->pay_tax = $request->pay_tax_array[$key];\n $detail->discount = $request->discount_array[$key];\n $detail->discount_amount = $request->discount_amount_array[$key];\n $detail->subtotal = $request->subtotal_array[$key];\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $detail->pay_tax = $this->exchangeRate($calculation, $request->pay_tax_array[$key], $rate);\n $detail->discount_amount = $this->exchangeRate($calculation, $request->discount_amount_array[$key], $rate);\n $detail->unit_price = $this->exchangeRate($calculation, $request->price_array[$key], $rate);\n $detail->subtotal = $this->exchangeRate($calculation, $request->subtotal_array[$key], $rate);\n } \n\n $detail->save();\n }\n\n } catch(\\Exception $e)\n {\n DB::rollback();\n throw $e;\n }\n\n DB::commit(); \n return response()->json([ 'quotation' => $quotation, 'status' => 'success']); \n }",
"function create($whole, $num, $denom) {\n if ($denom == 0) { $denom = 1; }\n // negative?\n if ((($whole < 0) xor ($denom < 0)) xor ($num < 0)) {\n // yes make the numerator negative\n $this->num = -1 * (abs($whole) * abs($denom) + abs($num));\n } else {\n $this->num = (abs($whole) * abs($denom) + abs($num));\n }\n // denom always positive\n $this->denom = abs($denom);\n }",
"protected function _initTotals()\r\n {\r\n parent::_initTotals();\r\n $orderId = $this->getSource()->getId();\r\n\t\t//$base_orderId = 34243;\r\n\t\t$discount = $this->helper('auction')->getDiscountByOrderId($orderId);\r\n if (0) {\r\n $this->addTotalBefore(new Varien_Object(array(\r\n 'code' => 'auction',\r\n 'value' => $amount,\r\n 'base_value'=> $amount,\r\n 'label' => $this->helper('auction')->__('Auction Product Discount ').$amount.$this->helper('auction')->__('%'),\r\n ), array('shipping', 'tax')));\r\n }\r\n\r\n return $this;\r\n }",
"function calculate()\n {\n $this->first_period = $this->second_period = $this->rebill_times = null;\n foreach ($this->getCalculators() as $calc)\n $calc->calculate($this);\n // now summarize all items to invoice totals\n $priceFields = array(\n 'first_subtotal' => null,\n 'first_discount' => 'first_discount',\n 'first_tax' => 'first_tax',\n 'first_shipping' => 'first_shipping',\n 'first_total' => 'first_total',\n 'second_subtotal' => null,\n 'second_discount' => 'second_discount',\n 'second_tax' => 'second_tax',\n 'second_shipping' => 'second_shipping',\n 'second_total' => 'second_total',\n );\n foreach ($priceFields as $k => $kk)\n $this->$k = 0.0;\n foreach ($this->getItems() as $item) {\n $this->first_subtotal += moneyRound($item->first_price * $item->qty);\n $this->second_subtotal += moneyRound($item->second_price * $item->qty);\n foreach ($priceFields as $k => $kk)\n $this->$k += $kk ? $item->$kk : 0;\n }\n foreach ($priceFields as $k => $kk)\n $this->$k = moneyRound($this->$k);\n /// set periods, it has been checked for compatibility in @see add()\n $mostExpensiveItem = null;\n foreach ($this->getItems() as $item) {\n if (!$mostExpensiveItem || $item->first_price > $mostExpensiveItem->first_price) {\n $mostExpensiveItem = $item;\n }\n $this->currency = $item->currency;\n if (empty($this->first_period) && $item->rebill_times)\n $this->first_period = $item->first_period;\n if (empty($this->second_period))\n $this->second_period = $item->second_period;\n if (empty($this->rebill_times))\n $this->rebill_times = $item->rebill_times;\n $this->rebill_times = max($this->rebill_times, $item->rebill_times);\n }\n\n // First period is empty, invoice has only one time items,\n // set first period from most expensive item.\n if (empty($this->first_period) && $mostExpensiveItem) {\n $this->first_period = $mostExpensiveItem->first_period;\n }\n\n if ($this->currency == Am_Currency::getDefault())\n $this->base_currency_multi = 1.0;\n else {\n $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency,\n sqlDate(!empty($this->tm_added) ? $this->tm_added : $this->getDi()->sqlDateTime));\n if (!$this->base_currency_multi)\n $this->base_currency_multi = 1;\n }\n $this->getDi()->hook->call(Am_Event::INVOICE_CALCULATE, array('invoice' => $this));\n\n $this->terms = null;\n if ((count($this->getItems()) == 1) &&\n ($item = $this->getItem(0)) &&\n ($item->item_type == 'product') &&\n ($pr = $item->tryLoadProduct()) &&\n ($bp = $pr->getBillingPlan()) &&\n $bp->terms) {\n\n if (((float)$bp->first_price == (float)$this->first_total) &&\n ($bp->first_period == $this->first_period) &&\n ((float)$bp->second_price == (float)$this->second_total) &&\n ($bp->second_period == $this->second_period) &&\n ($bp->rebill_times == $this->rebill_times)\n ) {\n $this->terms = $bp->terms;\n }\n }\n\n $this->terms = $this->getDi()->hook->filter($this->terms,\n Am_Event::INVOICE_TERMS, array('invoice' => $this));\n\n return $this;\n }",
"public function generateExpenses()\n {\n \t//Iva\n \t$iva_expense = new Expense();\n \t$iva_expense->type = 'iva';\n \t$iva_expense->value = ($this->value * $this->iva_percetage)/100;\n \t$iva_expense->exchange_rate_cop = $this->exchange_rate_cop;\n \t$iva_expense->income_id = $this->id;\n \t$iva_expense->currency_id = $this->currency_id;\n \t$iva_expense->save();\n\n \t//Trsoft utility, se calcula con el valor después de descontar el iva\n\t\t$trsoft_utility_expense = new Expense();\n\t\t$trsoft_utility_expense->type = 'trsoft utility';\n\t\t//En la compra de una licencia la utilidad de trsoft aumenta\n\t\tif($this->type == 'license'){\n\t\t\t$trsoft_utility_expense->value = (\n\t\t\t\t//Valor despues de restarle el iva\n\t\t\t\t($this->value - $iva_expense->value) \n\t\t\t\t//Se calcula el % de utilidad de TrSoft, se separa la utilidad de socios\n\t\t\t\t* (100 - $this->partners_utility)\n\t\t\t)/100;\n\t\t}else if($this->type == 'commission'){\n\t\t\t//Cuando se paga una comisión la utiliad de TrSoft es la establecida\n\t\t\t$trsoft_utility_expense->value = (($this->value - $iva_expense->value) * $this->trsoft_utility)/100;\n\t\t}\n\n\t\t$trsoft_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$trsoft_utility_expense->state = 'paid out';\n\t\t$trsoft_utility_expense->income_id = $this->id;\n\t\t$trsoft_utility_expense->currency_id = $this->currency_id;\n\t\t$trsoft_utility_expense->save(); \n\n \t//Partners utility, se calcula con el valor después de descontar el iva\n\t\t$partners_utility_expense = new Expense();\n\t\t$partners_utility_expense->type = 'partners utility';\n\t\t$partners_utility_expense->value = (($this->value - $iva_expense->value) * $this->partners_utility)/100;\n\t\t$partners_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$partners_utility_expense->income_id = $this->id;\n\t\t$partners_utility_expense->currency_id = $this->currency_id;\n\t\t$partners_utility_expense->save(); \t\n\n\t\t//Si es el pago de una comisión se deben generar los egresos\n\t\t//para pago de comisión de traders y desarrollador\n\t\tif($this->type == 'commission'){\n\n\t\t}\n }",
"function set_values() {\n\t\tparent::set_values();\n\t\t$currency = new currency($this->_currency_id);\n\t\t\n\t\t$this->order_id->value = $this->_order_id;\n\t\t$this->timestamp->value = date(\"j M Y\");\n\t\t$this->total_amount->value = $currency->format_money($this->_total_amount);\n\t}",
"public function calculate()\n {\n\n $yesterday = Carbon::now()->subDay();\n $seven_days_ago = $yesterday->copy()->subDay(7);\n $twenty_eight_days_ago = $yesterday->copy()->subDay(28);\n\n $this->seven_day_food = $this->site->foodExpenses($seven_days_ago->toDateString(), $yesterday->toDateString())\n / $this->site->foodSales($seven_days_ago->toDateString(), $yesterday->toDateString());\n $this->twenty_eight_day_food = $this->site->foodExpenses($twenty_eight_days_ago->toDateString(), $yesterday->toDateString())\n / $this->site->foodSales($twenty_eight_days_ago->toDateString(), $yesterday->toDateString());\n // etc...\n\n\n }",
"public function calculatePayment()\n {\n }",
"function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }",
"public function createParentDiscount()\n {\n ini_set('max_execution_time', 0);\n\n $doctrine = $this->getDoctrine();\n $entityManager = $doctrine->getManager();\n $discountRepository = $doctrine->getRepository('App:Discount');\n $discounts = $discountRepository->findWithOutParent();\n\n if($discounts) {\n foreach ($discounts as $parent) {\n /**\n * @var Discount $child\n */\n /**\n * @var Discount $parent\n */\n $child = clone $parent;\n\n $child->setParent($parent);\n\n $entityManager->persist($parent);\n $entityManager->persist($child);\n $entityManager->flush();\n }\n\n echo 'done';\n }\n }",
"private function calculateSubscription()\n {\n $subscription = new Subscription();\n $result = $subscription->getById($this->subscription['name'])[0];\n if ($result === FALSE) {\n $this->subscription['final_price'] = \"0.00\";\n } else {\n $result['date'] = $this->subscription['date'];\n $result['days'] = $subscription->calculateAmountOfDays($this->subscription['date']);\n $result['total'] += $result['price_per_day'] * $result['days'];\n $this->subtotal += $result['total'];\n }\n\n $this->subscription = $result;\n\n }",
"private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }",
"function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }",
"function CreateDeposit() {\r\n $conn = conn();\r\n\r\n $sql = \"INSERT INTO `deposit`(`CompanyId`, `DepositAmount`, `PreviousBalance`, `CurrentBalance`, `Comments`, `RecEntered`, `RecEnteredBy`) VALUES \"\r\n . \"('$this->CompanyId','$this->DepositAmount','$this->PreviousBalance','$this->CurrentBalance','$this->Comments',NOW(), '$this->ReEnteredBy')\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }",
"public function store()\n\t{\n $validator = Validator::make(Input::all(), array(\n \"business_unit_id\" => \"required|numeric\",\n \"calculation_number\" => \"required|numeric\",\n \"document_number\" => \"required|numeric\",\n \"partner_code\" => \"required|numeric\",\n \"calculation_date\" => \"required\",\n \"calculation_ddo\" => \"required\",\n \"calculation_booked\" => \"required\",\n \"currency_code\" => \"required|numeric\",\n \"currency_value\" => \"required|numeric\",\n \"calculation_type_code\" => \"required|numeric\",\n ));\n if($validator->fails()){\n return ProcessResponse::getError(1000,$validator->messages());\n }else{\n if($model=CalculationHeader::create(Input::all())){\n return ProcessResponse::process(array(\"id\"=>$model->id));\n }else{\n return ProcessResponse::getError( 1000,\"Error\");\n }\n }\n\t}",
"public function store(QuotationRequest $request)\n {\n $total_fields = Quotation::whereNull('deleted_at')->orWhereNotNull('deleted_at')->orderBy('id', 'desc')->first();\n $quotation_no = Settings::get('quotation_prefix') . (Settings::get('quotation_start_number') + (isset($total_fields) ? $total_fields->id : 0) + 1);\n $exp_date = date(Settings::get('date_format'), strtotime(' + ' . isset($request->payment_term) ? $request->payment_term : Settings::get('opportunities_reminder_days') . ' days'));\n\n\n $quotation = new Quotation($request->only('customer_id', 'qtemplate_id', 'date',\n 'exp_date', 'payment_term', 'sales_person_id', 'sales_team_id', 'terms_and_conditions', 'status', 'total',\n 'tax_amount', 'grand_total','discount','final_price'));\n $quotation->quotations_number = $quotation_no;\n $quotation->exp_date = isset($request->exp_date) ? $request->exp_date : strtotime($exp_date);\n $quotation->user_id = Sentinel::getUser()->id;\n $quotation->save();\n\n if (!empty($request->product_id)) {\n foreach ($request->product_id as $key => $item) {\n if ($item != \"\" && $request->product_name[$key] != \"\" &&\n $request->quantity[$key] != \"\" && $request->price[$key] != \"\" && $request->sub_total[$key] != \"\"\n ) {\n $quotationProduct = new QuotationProduct();\n $quotationProduct->quotation_id = $quotation->id;\n $quotationProduct->product_id = $item;\n $quotationProduct->product_name = $request->product_name[$key];\n $quotationProduct->description = $request->description[$key];\n $quotationProduct->quantity = $request->quantity[$key];\n $quotationProduct->price = $request->price[$key];\n $quotationProduct->sub_total = $request->sub_total[$key];\n $quotationProduct->save();\n }\n }\n }\n return redirect(\"quotation\");\n }",
"protected function _initTotals() {\n parent::_initTotals();\n $order = $this->getOrder();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n\n if (Mage::helper('ipgbase')->isIpagarePaymentMethod($paymentMethodCode)) {\n $amount = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscount($order);\n if (abs($amount) > 0) {\n $baseAmount = Mage::getModel($paymentMethodCode . '/discount')->getIpgBaseDiscount($order);\n $code = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscountCode();\n $this->addTotal(new Varien_Object(array(\n 'code' => $code,\n 'value' => $amount,\n 'base_value' => $baseAmount,\n 'label' => Mage::helper($paymentMethodCode)->__('Payment Discount'),\n )));\n }\n }\n return $this;\n }",
"public function __construct()\n {\n $this->type = 'percentage';\n $this->amount = 20;\n $this->end_date = strtotime(\"+1 day\");\n $this->minimum_amount = 100;\n $this->free_shipping = false;\n $this->included_categories = [10, 20];\n $this->excluded_categories = [50];\n $this->included_products = [3];\n $this->excluded_products = [4, 1];\n }",
"public function postProcess() {\n if ($this->_action & CRM_Core_Action::DELETE) {\n CRM_CiviDiscount_BAO_Item::del($this->_id);\n CRM_Core_Session::setStatus(ts('Selected Discount has been deleted.'));\n return;\n }\n\n if ($this->_action & CRM_Core_Action::COPY) {\n $params = $this->exportValues();\n $newCode = CRM_CiviDiscount_Utils::randomString('abcdefghjklmnpqrstwxyz23456789', 8);\n CRM_CiviDiscount_BAO_Item::copy($this->_cloneID, $params, $newCode);\n CRM_Core_Session::setStatus(ts('Selected Discount has been duplicated.'));\n return;\n }\n\n $params = $this->exportValues();\n\n if ($this->_action & CRM_Core_Action::UPDATE) {\n $params['id'] = $this->_id;\n }\n $params['multi_valued'] = $this->_multiValued;\n\n if(in_array(0, $params['events']) && count($params['events']) > 1) {\n CRM_Core_Session::setStatus(ts('You selected `any event` and specific events, specific events have been unset'));\n $params['events'] = array(0);\n }\n\n $params['filters'] = $this->getFiltersFromParams($params);\n $item = CRM_CiviDiscount_BAO_Item::add($params);\n\n CRM_Core_Session::setStatus(ts('The discount \\'%1\\' has been saved.',\n array(1 => $item->description ? $item->description : $item->code)));\n }",
"public function calculate(): Invoice\n {\n\n $instance = clone $this;\n\n if ($this->onBeforePriceCalculate) {\n call_user_func_array($this->onBeforePriceCalculate, array(&$instance->order));\n }\n\n $instance->totalPrice = 0;\n $tax = $instance->order->getCountry()->getTax();\n\n\n foreach ($instance->order->getProducts()->iterate() as &$product) {\n $productTax = round(($product->getPrice() * $tax) / 100, 2);\n $instance->totalPrice += ($product->getPrice() + $productTax) * $product->getQuantity();\n $product->setTax($productTax);\n }\n\n if ($this->onAfterPriceCalculate) {\n ($this->onAfterPriceCalculate)($instance->totalPrice);\n }\n\n $instance->totalPrice = round($instance->totalPrice, 2);\n return $instance;\n }",
"public function payment(){\r\n \r\n echo \"class ExtendedPaymentSelf : <br />\";\r\n\r\n $firstPayment = ($this->RegistrationFee) + ($this->ProgramTuition / 2);\r\n\r\n echo \"The first payment: \" . $firstPayment . \"$ <br />\";\r\n //$myDate = new DateClass();\r\n\r\n echo \" date: \" . $this->StartDate . \"<br />\";\r\n\r\n \r\n $secondPayment = $this->ProgramTuition / 2;\r\n\r\n echo \"The second payment : \" . $secondPayment . \"<br />\";\r\n echo \" date: SixMonthsLater\";\r\n echo \"<hr/>\";\r\n\r\n\t\t\r\n }",
"function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}",
"public function store(DividendRequest $request)\n {\n try {\n $dividend = $this->repository->create($request->all());\n } catch (Exception $e) {\n // flash(trans('messages.error.created'))->error();\n return back()->withInput();\n }\n\n // flash(trans('messages.city.saved', ['cityId' => $city->id]))->success();\n\n return redirect('dividends');\n }",
"public function div($dividend, $divisor);",
"public function store(Request $request)\n {\n DB::beginTransaction();\n try {\n $indice = 0;\n $sumTotal = 0;\n\n $nuevaFecha1 = explode('/', $request->date_tx);\n $diaFecha1 = $nuevaFecha1[0];\n $mesFecha1 = $nuevaFecha1[1];\n $anioFecha1 = $nuevaFecha1[2];\n $fecha1 = $anioFecha1 . '-' . $mesFecha1 . '-' . $diaFecha1;\n\n $verify_correlative = Quotation::where('serie_id', $request->serie_id)\n ->where('correlative', $request->correlativo)\n ->count();\n if ($verify_correlative > 0) {\n throw new \\Exception('El correlativo:' . $request->correlativo . ' ya esta utilizado en un documento de la serie seleccionada.', 6);\n }\n $quotation = new Quotation();\n $quotation->customer_id = $request->customer_id;\n $quotation->user_id = $request->user_relation;\n $quotation->comment = $request->comments;\n $quotation->date = $fecha1;\n $quotation->serie_id = $request->serie_id;\n $quotation->days = $request->days;\n $quotation->correlative = $request->correlative;\n $quotation->status = 1;\n $quotation->price_id = $request->price_id;\n $quotation->created_by = Auth::user()->id;\n $quotation->updated_by = Auth::user()->id;\n $quotation->save();\n $quotation_id = $quotation->id;\n\n // process receiving items\n\n foreach ($request->all() as $key => $value) {\n if (strpos($key, 'cantidad') !== false) {\n $items_array[$indice]['cantidad'] = $value;\n } elseif (strpos($key, 'selling') !== false) {\n $items_array[$indice]['selling'] = $value;\n } elseif (strpos($key, 'newcosto') !== false) {\n $items_array[$indice]['newcosto'] = $value;\n } elseif (strpos($key, 'product') !== false) {\n $items_array[$indice]['product'] = $value;\n $cantidad = $items_array[$indice]['cantidad'];\n $id_items = $items_array[$indice]['product'];\n $precio = $items_array[$indice]['selling'];\n\n $detail = new DetailQuotation();\n $detail->quotation_id = $quotation_id;\n $detail->item_id = $id_items;\n //Para tener acceso al producto\n $detail->price = $precio;\n $detail->quantity = $cantidad;\n $detail->quantity_sale = $cantidad;\n $detail->total_cost = $precio * $cantidad;\n $sumTotal += $detail->total_cost;\n $detail->save();\n }\n }\n $newq = Quotation::find($quotation_id);\n $newq->amount = $sumTotal;\n $newq->save();\n DB::commit();\n $message = 'Cotización guardada correctamente';\n $flag = 1;\n $url = 'quotation/header/' . $quotation_id;\n Session::flash('message', 'Cotización guardada correctamente');\n Session::flash('alert-type', trans('success'));\n } catch (\\Exception $ex) {\n DB::rollBack();\n $message = \"RB:\" . $ex->getMessage();\n $flag = 2;\n $url = '#';\n }\n $resp = array('message' => $message, 'flag' => $flag, 'url' => $url);\n return json_encode($resp);\n }",
"private function get_add_cashflow(){\n\t\t$a_e = new FinMathAnnuityEscalating();\n\t\t$a_i = new FinMathAnnuityIncreasing();\n\t\t$c_e = new FinMathCashflow( 0, 0, $a_e );\n\t\t$c_i = new FinMathCashflow( 0, 0, $a_i );\n\t\t$parameters = array();\n\t\t$parameters['single_payment'] = array(\n\t\t\t'name'=> 'single_payment',\n\t\t\t'label' => self::myMessage( 'fm-single_payment'),\n\t\t\t);\n\t\t$parameters_c = array_merge( $c_e->get_parameters(), $c_i->get_parameters() );\n\t\t$parameters = array_merge( $parameters, $parameters_c );\n\t\t$valid_options = array_merge( $c_e->get_valid_options(), $c_i->get_valid_options() );\n\t\t$valid_options['single_payment'] = array( 'type' => 'boolean' );\n\t\t$valid_options['consider_increasing'] = array( 'type' => 'boolean' );\n\t\t$parameters['consider_increasing'] = array(\n\t\t\t'name'=> 'consider_increasing',\n\t\t\t'label' => self::myMessage( 'fm-consider_increasing'),\n\t\t\t);\n\t\tforeach ( array('value','delta', 'escalation_delta', \"source_m\",\"source_advance\",\"source_rate\") as $p ){\n\t\t\tunset( $parameters[ $p ] );\n\t\t\tunset( $valid_options[ $p ] );\n\t\t}\n\t\t$values = array_merge( $c_e->get_values(), $c_i->get_values() );\n\t\t$form = array();\n\t\t$form['method'] = 'GET';\n\t\t$form['parameters'] = $parameters;\n\t\t$form['valid_options'] = $valid_options;\n\t\t$form['request'] = 'add_cashflow';\n\t\t$form['render'] = 'HTML';\n\t\t$form['introduction'] = self::myMessage( 'fm-add-a-cashflow') ;\n\t\t$form['submit'] = self::myMessage( 'fm-add') ;\n\t\t$form['exclude'] = array( \"i_effective\" );\n\t\t$form['values'] = $values;\n\t\t$form['hidden'] = $this->get_hidden_cashflow_fields();\n\t\treturn $form;\n\t}",
"public function postCreatePayPeriod(){\n \n $pay_period = new TimeTrackingPayPeriod();\n $this->postPayPeriod($pay_period);\n \n }",
"public static function handleCalculationsOfPublicOffering(Transaction $transaction): void\n {\n $transaction->handleCalculationsOfBuying();\n $transaction->share->handleCalculationsOfBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfBuying($transaction);\n }"
]
| [
"0.57564086",
"0.53153306",
"0.53051096",
"0.524608",
"0.51939976",
"0.51735914",
"0.516544",
"0.51131123",
"0.5091078",
"0.5056436",
"0.5028471",
"0.5021096",
"0.5016266",
"0.4987964",
"0.49605653",
"0.49513713",
"0.48978174",
"0.48877352",
"0.48814735",
"0.48778728",
"0.4873196",
"0.48719203",
"0.48705637",
"0.48664334",
"0.48550078",
"0.48532385",
"0.4844539",
"0.48419338",
"0.48008406",
"0.47888428"
]
| 0.6584587 | 0 |
Handle calculations when delete a dividend transaction instance. | public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void
{
$transaction->share->handleCalculationsOfDeletedDividend($transaction);
$transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteDiscount();",
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }",
"public static function handleCalculationsOfDeletedRights(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedRights($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }",
"function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }",
"public static function handleCalculationsOfDividend(Transaction $transaction): void\n {\n $transaction->dividend = $transaction->dividend_gain->divide($transaction->lot);\n $transaction->update();\n $transaction->share->handleCalculationsOfDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDividend($transaction);\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }",
"public function cashierDeleteOPDDoctorDiscount ($id , $invoice , $year_invoice , $daily_invoice , $cashbook_id , $invoice_tr_id , $status)\n {\n $collection_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->first();\n $total_payable = $collection_info->total_payable ;\n $total_discount = $collection_info->total_discount ;\n $total_rebate = $collection_info->total_rebate ;\n $total_payment = $collection_info->total_payment ;\n $bill_added_id = $collection_info->added_id ;\n $bill_tr_date = $collection_info->tr_date ;\n $bill_created_time = $collection_info->created_time ;\n $bill_created_at = $collection_info->created_at ;\n // get opd bill info\n $opd_bill_info_query = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->where('year_invoice',$year_invoice)->where('daily_invoice',$daily_invoice)->limit(1)->first();\n $opd_status = $opd_bill_info_query->opd_status ;\n if($opd_status == '2'){\n // delete cashbook id\n DB::table('cashbook')->where('id',$cashbook_id)->delete();\n \n // incress pettycash amount\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt + $total_discount ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }else{\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $pettycash_amount->pettycash_amount ;\n }\n // insert data into\n $data_delete_history = array();\n $data_delete_history['admin_type'] = 3 ;\n $data_delete_history['branch_id'] = $this->branch_id ;\n $data_delete_history['status'] = 4 ;\n $data_delete_history['tr_status'] = 1 ;\n $data_delete_history['before_pettycash_amt'] = $current_pettycash_amt ;\n $data_delete_history['after_pettycash_amt'] = $now_pettycash_amt ;\n $data_delete_history['bill_added_id'] = $bill_added_id ;\n $data_delete_history['bill_remove_id'] = $this->loged_id ;\n $data_delete_history['bill_tr_date'] = $bill_tr_date ;\n $data_delete_history['bill_remove_date'] = $this->rcdate ;\n $data_delete_history['bill_created_date'] = $bill_created_at ;\n $data_delete_history['bill_created_time'] = $bill_created_time ;\n $data_delete_history['bill_remove_time'] = $this->current_time ; \n DB::table('delete_history')->insert($data_delete_history);\n // get last delete history\n $last_delete_history_query = DB::table('delete_history')->orderBy('id','desc')->limit(1)->first();\n $last_delete_history_id = $last_delete_history_query->id ; \n // insert into delete pathlogy bill\n $data_delete_pathology_bill = array();\n $data_delete_pathology_bill['delete_history_id'] = $last_delete_history_id ;\n $data_delete_pathology_bill['branch_id'] = $this->branch_id ;\n $data_delete_pathology_bill['cashbook_id'] = $cashbook_id ;\n $data_delete_pathology_bill['invoice_number'] = $invoice;\n $data_delete_pathology_bill['year_invoice_number'] = $year_invoice ;\n $data_delete_pathology_bill['daily_invoice_number'] = $daily_invoice;\n $data_delete_pathology_bill['invoice_tr_id'] = $invoice_tr_id ;\n $data_delete_pathology_bill['total_payable'] = $total_payable;\n $data_delete_pathology_bill['total_payment'] = $total_payment;\n $data_delete_pathology_bill['total_discount'] = $total_discount;\n $data_delete_pathology_bill['total_rebate'] = $total_rebate;\n $data_delete_pathology_bill['opd_status'] = $opd_status;\n $data_delete_pathology_bill['status'] = $status ;\n $data_delete_pathology_bill['bill_added_id'] = $bill_added_id;\n $data_delete_pathology_bill['bill_remove_id'] = $this->loged_id ; \n $data_delete_pathology_bill['bill_tr_date'] = $bill_tr_date ;\n $data_delete_pathology_bill['bill_remove_date'] = $this->rcdate ;\n $data_delete_pathology_bill['bill_created_date'] = $bill_created_at;\n $data_delete_pathology_bill['bill_created_time'] = $bill_created_time ;\n $data_delete_pathology_bill['bill_remove_time'] = $this->current_time;\n DB::table('delete_opd_bill')->insert($data_delete_pathology_bill);\n // now delete patylogy bill transaction\n DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('id',$id)->where('invoice_number',$invoice)->where('year_invoice_number',$year_invoice)->where('daily_invoice_number',$daily_invoice)->where('status',$status)->where('cashbook_id',$cashbook_id)->where('invoice_tr_id',$invoice_tr_id)->delete();\n Session::put('succes','Thanks , OPD Doctor Discount Deleted Successfully');\n return Redirect::to('cashierOPDDoctorDiscountReport');\n }",
"public static function onAfterDelete(ORM\\Event $event): void\n\t{\n\t\tModel\\Price::clearSettings();\n\t}",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n\n /* Get a lecture that this subtask is related to. */\n $lectureBean = new LectureBean ($this->id, $this->_smarty, \"\", \"\");\n $lectureBean->assignSingle();\n }",
"protected function _postDelete()\n\t{\n\t}",
"public function deleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }",
"public function deleted(Credit $credit)\n {\n\n }",
"function AfterDelete($where,&$deleted_values,&$message,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid = $deleted_values['proid'];\n\n\n//get related bill in student record\n$sql_bill= \"select student_bill_id from student_billing where proid='$proid'\";\n$q_bill = db_query($sql_bill,$conn);\n$row_bill=db_fetch_array($q_bill);\n\n//delete payment record\ndo{\n$student_bill_id=$q_bill['student_bill_id'];\n$sql_del2=\"DELETE FROM student_payment WHERE student_bill_id='$student_bill_id'\";\ndb_exec($sql_del2,$conn);\t \n}while($row_bill=db_fetch_array($q_bill));\n\n//then delete student bill\n$sql_del=\"DELETE FROM student_billing WHERE proid='$proid'\";\ndb_exec($sql_del,$conn);\t \n\n\n\n\n\n\n\n\n\n\n\n\n;\t\t\n}",
"public static function handleCalculationsOfDeletedSale(Transaction $transaction): void\n {\n $items = $transaction->share->getSoldTransactions();\n $lot = $transaction->lot;\n $gain = $amount = MoneyManager::createMoney();\n\n $items->each(function ($item) use ($transaction, &$lot, &$gain, &$amount) {\n $itemSold = bcsub($item->lot, $item->remaining);\n $soldLot = ($itemSold < $lot) ? $itemSold : $lot;\n $item->remaining = bcadd($item->remaining, $soldLot);\n $soldAmount = $transaction->price->multiply($soldLot);\n $item->sale_average_amount = $item->sale_average_amount->subtract($soldAmount);\n $itemPreSold = bcsub($item->lot, $item->remaining);\n $item->sale_average = ($itemPreSold == '0') ? MoneyManager::createMoney() : $item->sale_average_amount->divide($itemPreSold);\n $item->sale_gain = $item->sale_average_amount->equals(MoneyManager::createMoney()) ? MoneyManager::createMoney() : $item->sale_average_amount->subtract($item->amount);\n $item->update();\n\n $buyingAmount = $item->price->multiply($soldLot);\n $amount = $amount->add($buyingAmount);\n $gain = $gain->add($soldAmount->subtract($buyingAmount));\n\n $lot = $lot - $soldLot;\n if ($lot == 0) {\n return false;\n }\n });\n\n $transaction->share->handleCalculationsOfDeletedSale($transaction, $gain, $amount);\n $transaction->share->portfolio->handleCalculationsOfDeletedSale($transaction, $gain, $amount);\n }",
"protected function _preDelete() {}"
]
| [
"0.6852793",
"0.66659445",
"0.6648401",
"0.65028",
"0.6370271",
"0.6258419",
"0.6238405",
"0.6162668",
"0.6144073",
"0.60283566",
"0.6001491",
"0.6000658",
"0.59866214",
"0.594411",
"0.59241426",
"0.5904652",
"0.5882009",
"0.5882009",
"0.5882009",
"0.5882009",
"0.58365566",
"0.5823047",
"0.581903",
"0.58160436",
"0.58127975",
"0.5807908",
"0.57500225",
"0.5744105",
"0.57421225",
"0.5709541"
]
| 0.77221465 | 0 |
Handle calculations when delete a bonus transaction instance. | public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void
{
$transaction->share->handleCalculationsOfDeletedBonus($transaction);
$transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteDiscount();",
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}",
"public static function handleCalculationsOfDeletedRights(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedRights($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);\n }",
"public function delete()\n {\n global $connection;\n //echo \"Im on the purchases ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM purchases \" \n // . \" WHERE purchase_id = :purchase_id;\";\n $SQLQuery = \"CALL purchases_delete(\"\n . \":purchase_id);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":purchase_id\", $this->purchase_id); \n $PDOStatement->execute(); \n }",
"public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\n }",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"public static function handleCalculationsOfDeletedPublicOffering(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"public function deleted(Credit $credit)\n {\n\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }",
"public function delete() {\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_tax_rates' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'wc_tax_rate_classes' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_items' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_itemmeta' );// phpcs:ignore\n\t\t$this->order = null;\n\t\t$this->product = null;\n\t\t$this->tax_rate_ids = array();\n\t}",
"function deleteFee()\n {\n global $db;\n $requete = $db->prepare('DELETE FROM fees WHERE idF = ?');\n $requete->execute(array($this->idF));\n }",
"public function deleting()\n {\n # code...\n }",
"public function delete()\n {\n // If deposit is existing, will get database ID removed.\n $this->dbID = $this->db->deleteDeposit($this);\n }",
"public function deleteAction(){\n\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('id');\n\t\t$emp_id = $this->_request->getParam('emp_id');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t\n\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\t\t\t//check employee has amount of select amount\n\t\t\t$getEmployeeBalance = $employeeadvancesModel->getEmpAdvanceSummary($emp_id);\n\t\t\t$total = !empty($getEmployeeBalance[0]['balance'])?$getEmployeeBalance[0]['balance']:0;\n\t\t\t\n\t\t\t$employeeAdvanceData = $employeeadvancesModel->getsingleEmployeeadvancesData($id,$type='advance');\n\t\t\t\n\t\t\t$employeebalance = !empty($employeeAdvanceData[0]['application_amount'])?$employeeAdvanceData[0]['application_amount']:0;\n\t\t\t\n\t\t\tif($total >= $employeebalance) //if employee has suffiecient amount to delete advance\n\t\t\t{\n\t\t\t\t$data = array('isactive'=>0,'modifieddate'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t//remove deleted advance amount from employee total advance amount\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$emp_advance_summery = $advancesummary->getAdvanceDetailsById($emp_id);\n\t\t\t\t\t$totalsum = $emp_advance_summery[0]['total']-$employeebalance;\n\t\t\t\t\t$balence = $emp_advance_summery[0]['balance']-$employeebalance;\n\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$emp_id); \n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\t\n\t\t\t\t\t$messages['message'] = 'advance deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$messages['message'] = 'advance cannot be deleted already used.';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}",
"public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}",
"public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}",
"public function delete() {\n\t$stmt = $this->_database->prepare('DELETE FROM planetterrains WHERE refid = ?');\n\t$stmt->bind_param('i', $this->refid);\n\t$stmt->execute();\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->delete();\n\t}\n }",
"function delete()\n {\n global $connection;\n //echo \"Im on the customers ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM customers \" \n // . \" WHERE customer_username = :customer_username;\";\n $SQLQuery = \"CALL customers_delete(\"\n . \":customer_username);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":customer_username\", $this->customer_username); \n $PDOStatement->execute(); \n }",
"public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }",
"public function deleteSelf() {\n trace('[METHOD] '.__METHOD__);\n if ($this->get_uid()) {\n $this->set_deleted(true);\n $dataArray = $this->getDataArray();\n $this->set_uid(tx_ptgsaaccounting_orderCreditBalanceAccessor::getInstance()->storeOrderCreditBalanceData($dataArray));\n }\n \n\n }"
]
| [
"0.6852363",
"0.6524959",
"0.64138687",
"0.6275695",
"0.6248315",
"0.62324953",
"0.62205285",
"0.6214557",
"0.61746526",
"0.6169711",
"0.60963464",
"0.60755366",
"0.60753053",
"0.5974217",
"0.5971819",
"0.5971819",
"0.5971819",
"0.5971819",
"0.59587824",
"0.59102494",
"0.58982044",
"0.5892962",
"0.58912355",
"0.58857226",
"0.5882582",
"0.58716625",
"0.58635575",
"0.58587426",
"0.5834486",
"0.5830964"
]
| 0.7509622 | 0 |
Handle calculations when delete a rights transaction instance. | public static function handleCalculationsOfDeletedRights(Transaction $transaction): void
{
$transaction->share->handleCalculationsOfDeletedRights($transaction);
$transaction->share->portfolio->handleCalculationsOfDeletedRights($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }",
"private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}",
"public function deleteDiscount();",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleted(Transaction $transaction)\n {\n //\n }",
"public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }",
"public abstract function delete($model, $useTransaction);",
"function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }",
"public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }",
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"protected function _preDelete() {}",
"public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }",
"public abstract function delete();",
"public function deleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"protected function _delete()\n\t{\n\t}",
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}"
]
| [
"0.64385027",
"0.6300594",
"0.62733465",
"0.6253001",
"0.6253001",
"0.6253001",
"0.6253001",
"0.620681",
"0.61679566",
"0.610806",
"0.60725117",
"0.6071964",
"0.6071233",
"0.60638446",
"0.6060359",
"0.603412",
"0.5974813",
"0.59660405",
"0.59508824",
"0.5945771",
"0.59453",
"0.5944878",
"0.5944878",
"0.5944878",
"0.5944878",
"0.5930844",
"0.5930384",
"0.5924862",
"0.5922763",
"0.59124154"
]
| 0.70408875 | 0 |
Handle calculations when create a new merger out transaction instance. | public static function handleCalculationsOfMergerOut(Transaction $transaction): void
{
$shareAmount = $transaction->share->average_amount;
$transaction->share->handleCalculationsOfMergerOut($transaction);
$newShare = $transaction->share->portfolio->handleCalculationsOfMergerOut($transaction);
$newTransaction = new Transaction();
$newTransaction->fill([
'share_id' => $newShare->id,
'type' => TransactionType::MergerIn,
'date_at' => $transaction->date_at,
'lot' => ($newLot = bcmul($transaction->lot, $transaction->exchange_ratio, 3)),
'exchange_ratio' => $transaction->exchange_ratio,
'symbol_code' => $transaction->share->symbol->code,
]);
$newTransaction->price = $shareAmount->divide($newLot);
$newTransaction->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfMergerIn(Transaction $transaction): void\n {\n $transaction->handleCalculationsOfMergerIn();\n $transaction->share->handleCalculationsOfMergerIn($transaction);\n $transaction->share->portfolio->handleCalculationsOfMergerIn($transaction);\n }",
"public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }",
"public function createTransaction()\n {\n }",
"public function ProcessPayment(Request $request)\n {\n $payment_model = new Payment();\n $payment_id = keyGen($payment_model);\n\n $mode_model = new Mode();\n $mode_id = keyGen($mode_model);\n\n $transaction_model = new Transactions();\n $transaction_id = keyGen($transaction_model);\n\n $client_data = DB::table('clients')\n ->where('client_id',$request->payment_client)\n ->get();\n\n $receivable = $client_data[0]->client_receivable;\n $invoice_receivable = +$receivable - +$request->payment_mode_amount;\n\n\n DB::transaction(function () use($payment_id,$mode_id,$transaction_id,$request,$invoice_receivable) {\n\n DB::table('payments')->insert(\n [\n 'payment_id' => $payment_id,\n 'payment_mode' => $mode_id,\n 'payment_client' => $request->payment_client,\n 'payment_invoice' => $request->payment_invoice,\n 'payment_transaction' => $request->payment_transaction,\n 'payment_date' => $request->payment_mode_check_date\n ]\n );\n\n DB::table('modes')->insert(\n [\n 'mode_id' => $mode_id,\n 'mode_type' => $request->payment_method,\n 'mode_bank' => $request->payment_mode_bank_name,\n 'mode_date' => $request->payment_mode_check_date,\n 'mode_entity' => $request->payment_client,\n 'mode_amount' => $request->payment_mode_amount,\n 'mode_description' => $request->payment_mode_description,\n 'mode_reference' => $request->payment_mode_check_number,\n ]\n );\n\n DB::table('transactions')->insert(\n [\n 'transaction_id' => $transaction_id,\n 'transaction_invoice' => $request->payment_invoice,\n 'transaction_client' => $request->payment_client,\n 'transaction_type' => 'Credit',\n 'transaction_amount' => $request->payment_mode_amount\n ]\n );\n\n DB::table('invoices')->where('invoice_id',$request->payment_invoice)\n ->update(\n [\n 'invoice_status' => 'Paid'\n ]\n );\n\n DB::table('clients')->where('client_id',$request->payment_client)\n ->update(\n [\n 'client_receivable' => $invoice_receivable\n ]\n );\n\n });\n return redirect('/ledger')->withStatus(__('Invoice Paid'));\n }",
"public function actionCreate() {\n $this->active_menu = \"cps\";\n $this->open_class = \"invoice\";\n $this->active_class = \"cpadmin\";\n $model = new Calculatepayout;\n $id = $_GET['id'];\n $invoice_details = Purchaseinvoice::model()->findByPk($id);\n $kataparchy = Kataparchy::model()->findByAttributes(array(\"purchase_invoice_id\" => $invoice_details->id));\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Calculatepayout'])) {\n $model->attributes = $_POST['Calculatepayout'];\n $invoice_details = Purchaseinvoice::model()->findByPk($_POST['Calculatepayout']['customer_id']);\n $kataparchy = Kataparchy::model()->findByAttributes(array(\"purchase_invoice_id\" => $invoice_details->id));\n $model->kata_parchy_id = $kataparchy->id;\n $model->rate = $_POST['Calculatepayout']['rate'];\n $model->dated = date('Y-m-d');\n if ($model->save())\n Yii::app()->user->setFlash('success', 'Item Added successfully');\n $this->redirect(array('create', 'id' => $model->customer_id));\n }\n\n $this->render('create', array(\n 'model' => $model, 'id' => $id, 'invoice_details' => $invoice_details, 'kataparchy' => $kataparchy\n ));\n }",
"protected function runTransactionBuild()\n {\n $this->request->transaction = new Transaction($this->request); /* Write the transaction record to disk */\n }",
"public function store(Request $request)\n { \n $default_currency = Currency::default();\n $exchange_rate_id = $default_currency->id;\n $selected_currency = Currency::findOrFail($request->current_currency_id);\n $exchange_rate = CurrencyExchangeRate::currentRate($selected_currency->id);\n $calculation = ($selected_currency->calculation == 'multiplication') ? 'divide' : 'multiplication';\n $rate = 1;\n \n // Start transaction!\n DB::beginTransaction();\n\n try {\n // ...\n $quotation = new Quotation();\n $quotation->quotation_number = config('global.codes.quotation');\n $quotation->customer_id = $request->customer_id;\n $quotation->quotation_date = \\Carbon\\Carbon::now();\n $quotation->validity_date = $request->validity;\n $quotation->payment_term_id = $request->payment_term_id;\n $quotation->delivery_method_id = $request->delivery_method_id; \n $quotation->amount = $request->amount;\n $quotation->tax = $request->pay_tax;\n $quotation->discount = $request->discount;\n $quotation->discount_amount = $request->discount_amount;\n $quotation->grand_total = $request->grand_total;\n $quotation->rate = $rate;\n $quotation->currency_id = $default_currency->id;\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $rate = $exchange_rate->rate;\n $quotation->amount = $this->exchangeRate($calculation, $request->amount, $rate);\n $quotation->tax = $this->exchangeRate($calculation, $request->pay_tax, $rate);\n $quotation->discount_amount = $this->exchangeRate($calculation, $request->discount_amount, $rate);\n $quotation->grand_total = $this->exchangeRate($calculation, $request->grand_total, $rate);\n $quotation->rate = $rate;\n $quotation->is_default_currency = 0;\n $quotation->currency_id = $selected_currency->id;\n }\n\n $quotation->save();\n\n // retreive the id and combine with the quotation code\n $quotation->quotation_number = $quotation->quotation_number.$quotation->id;\n $quotation->save();\n // ...\n // create quotation details reference to quotation id above\n foreach ($request->product_id_array as $key => $value) {\n $detail = new QuotationDetail();\n $detail->quotation_id = $quotation->id;\n $detail->product_id = $request->product_id_array[$key];\n $detail->product_name = $request->product_name_array[$key];\n $detail->notes = $request->description_array[$key];\n $detail->variant_ids = $request->variant_ids[$key];\n $detail->qty = $request->qty_array[$key];\n $detail->unit_price = $request->price_array[$key];\n $detail->tax = $request->tax_array[$key];\n $detail->pay_tax = $request->pay_tax_array[$key];\n $detail->discount = $request->discount_array[$key];\n $detail->discount_amount = $request->discount_amount_array[$key];\n $detail->subtotal = $request->subtotal_array[$key];\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $detail->pay_tax = $this->exchangeRate($calculation, $request->pay_tax_array[$key], $rate);\n $detail->discount_amount = $this->exchangeRate($calculation, $request->discount_amount_array[$key], $rate);\n $detail->unit_price = $this->exchangeRate($calculation, $request->price_array[$key], $rate);\n $detail->subtotal = $this->exchangeRate($calculation, $request->subtotal_array[$key], $rate);\n } \n\n $detail->save();\n }\n\n } catch(\\Exception $e)\n {\n DB::rollback();\n throw $e;\n }\n\n DB::commit(); \n return response()->json([ 'quotation' => $quotation, 'status' => 'success']); \n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'transaction_date' => 'required',\n 'transaction_code' => 'required',\n 'account_number' => 'required',\n 'amount' => 'required|numeric',\n 'narration' => 'required',\n 'created_by' => 'required',\n 'payment_to' => 'required'\n ]);\n \n $transaction = new Transaction();\n $lastTrans = \\App\\Transaction::all()->pop();\n if (!empty($lastTrans)) {\n $lastId= $lastTrans->id;\n } else {\n $lastId=0;\n }\n if ($request->transaction_code==\"DOB\") {\n $transaction->balance=$request->amount;\n $transaction->amount_paid=0;\n } else {\n $transaction->amount_paid=$request->amount;\n $transaction->balance=0;\n }\n \n $transaction->trn_ref_no = \"MPost\" . \"-\" .$request->payment_to . \"-\" .($lastId +1);\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = null;\n $transaction->liters = 0;\n $transaction->rate = null;\n $transaction->total_cost = null;\n $transaction->narration = $request->narration;\n $transaction->account_number=$request->account_number;\n $transaction->transaction_code = $request->transaction_code;\n $customer=Customer::where(\"customer_number\", $request->payment_to)->get();\n if (isset($customer[0]->customer_name)) {\n $customerName= $customer[0]->customer_name;\n } else {\n $customerName=\"\";\n }\n $transaction->customer_name = $customerName;\n \n \n $transaction->shortages = 0;\n \n $supplier=\"\";\n $supplier=Supplier::where(\"supplier_number\", $request->payment_to)->get();\n if (isset($supplier[0]->supplier_name)) {\n $supplierName=$supplier[0]->supplier_name;\n } else {\n $supplierName=\"\";\n }\n \n $transaction->supplier_name = $supplierName;\n \n \n $transaction->unit_price = 0;\n $transaction->payment_mode = \"N/A\";\n //$transaction->approved_by\n\n $transaction->save();\n Session::flash('flash_message', 'Record successfully added!');\n\n return redirect()->back();\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n \"transaction_date\" => \"required\",\n \"transaction_type_id\" => \"required\",\n \"transaction_category_id\" => \"required\",\n \"sub_total.*\" => \"required|numeric\",\n \"transaction_created_date.*\" => \"required\",\n ]);\n /* if($request->payment_amount == 0 || $request->payment_amount == NULL)return redirect()->back()->with([\n 'alert-type' => 'error',\n 'message' => 'Invalid Number!'\n ]); */\n \n $status = NULL;\n // Start transaction!\n DB::beginTransaction();\n try\n { \n $save_detail = [];\n $transaction_final = new TransactionFinal();\n $transaction_final->business_location_id = 1;\n $transaction_final->business_type_id = 1;\n $transaction_final->transaction_type_id = $request->transaction_type_id;\n $transaction_final->transaction_category_id = $request->transaction_category_id;\n $transaction_final->reference_no = $request->transaction_final_reference;\n $transaction_final->transaction_date = $request->transaction_date;\n //$transaction_final->others_cost = 0;\n //$transaction_final->discount_type = 0;\n //$transaction_final->discount_value = 0;\n //$transaction_final->discount_amount = 0;\n $transaction_final->transaction_note = $request->transaction_note;\n $transaction_final->created_by = auth()->user()->id;\n if ($transaction_final->save()) \n {\n foreach ($request->sub_total as $key => $amount) {\n $transaction_detail = new TransactionDetail();\n $transaction_detail->business_location_id = 1;\n $transaction_detail->business_type_id = 1;\n $transaction_detail->transaction_type_id = $request->transaction_type_id;\n $transaction_detail->transaction_category_id = $request->transaction_category_id;\n $transaction_detail->transaction_final_id = $transaction_final->id;\n $transaction_detail->transaction_created_date = $request->transaction_created_date[$key];\n $transaction_detail->reference_no = $request->transaction_final_reference;\n $transaction_detail->transaction_title = $request->transaction_title[$key];\n $transaction_detail->description = $request->description[$key];\n $transaction_detail->sub_total = $amount;\n $transaction_detail->created_by = auth()->user()->id;\n $save_detail[] = $transaction_detail->save();\n }\n if (!in_array(false, $save_detail)) {\n $notification = array(\n 'message' => 'Successfully Transaction Added!',\n 'alert-type' => 'success'\n );\n } else {\n $notification = array(\n 'message' => 'Someting Went Wrong!',\n 'alert-type' => 'error'\n );\n }\n DB::commit();\n } else {\n $notification = array(\n 'message' => 'Someting Went Wrong!',\n 'alert-type' => 'error'\n );\n }\n return redirect()->route('admin.transaction-detail.index')->with($notification);\n }\n catch(\\Exception $e)\n {\n DB::rollback();\n if($e->getMessage())\n {\n $message = $e->getMessage();//\"Something went wrong! Please Try again\";\n }\n return Redirect()->back()\n ->with('error',$message);\n }\n }",
"public function store(Request $request) {\n \n $request->validate([\n 'amount_paid' => 'required',\n ]);\n\n $tenant_id = $request->input('tenant_id');\n $findPropertyId = Tenant::where('id', '=', $tenant_id)->first(); \n $property_id = $findPropertyId->property_id;\n $landlord_id = Auth::user()->id;\n $user = User::where('id', '=', $findPropertyId->user_id)->first();\n\n // figure the late fee\n $latefee = $this->calculateLateFee($request->input('late_fee_amount'));\n \n $property = Property::join('rents', 'rents.property_id', '=', 'properties.id')\n ->where('properties.id', '=', $property_id)\n ->first();\n\n // calculate the balance\n $amount_paid = $request->input('amount_paid');\n $currentBalance = $this->findRentBalance($tenant_id) + $property->rent_amount;\n $newBalance = $this->calculateNewBalance($currentBalance, $amount_paid, $property->rent_amount); \n\n // calc paid in full\n $paid_in_full = 0;\n if( $newBalance <= 0 ) {\n $paid_in_full = 1;\n }\n\n // generate the confirmation code\n $confirmationNumber = str_random(10);\n\n $transaction = new Transaction([\n 'tenant_id' => $tenant_id,\n 'landlord_id' => $landlord_id,\n 'property_id' => $property_id,\n 'amount_paid' => $amount_paid,\n 'payment_method' => 'cash/check',\n 'paid_in_full' => $paid_in_full,\n 'late_fee_amount' => $latefee,\n 'confirmation' => $confirmationNumber,\n ]);\n $transaction->save();\n\n // find the next due date \n $numberOfMonths = $amount_paid / $property->rent_amount; \n $roundMonth = floor($numberOfMonths); // always round down\n\n // save balance to rents table \n $rents = Rent::where('property_id', '=', $property_id)->first();\n $rents->balance = $newBalance;\n $rents->next_due_date = Carbon::now()->addMonths($roundMonth);\n $rents->save();\n\n // send email to tenant\n Mail::to($user->email)->send(new ManualPaymentConfirmation($user, $amount_paid, $transaction->created_at, $confirmationNumber));\n\n return redirect()\n ->route('tenants.index')\n ->with('info', 'Good job! You have successfully entered the tenants rent payment for the month. It will reflect on the tenants page.');\n\n }",
"public function store(Request $request)\r\n {\r\n try {\r\n $settlement_no = $request->settlement_no;\r\n $business_id = $request->session()->get('business.id');\r\n $settlement = Settlement::where('settlement_no', $request->settlement_no)->where('business_id', $business_id)->first();\r\n $edit = Settlement::where('settlements.id', $settlement->id)->where('settlements.business_id', $business_id)->where('status', 0)->first();\r\n DB::beginTransaction();\r\n if (!empty($edit)) {\r\n $this->deletePreviouseTransactions($settlement->id);\r\n }\r\n\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n\r\n $settlement = Settlement::where('settlements.id', $settlement->id)->where('settlements.business_id', $business_id)\r\n ->leftjoin('pump_operators', 'settlements.pump_operator_id', 'pump_operators.id')\r\n ->with([\r\n 'meter_sales',\r\n 'other_sales',\r\n 'other_incomes',\r\n 'customer_payments',\r\n 'cash_payments',\r\n 'card_payments',\r\n 'cheque_payments',\r\n 'credit_sale_payments',\r\n 'expense_payments',\r\n 'excess_payments',\r\n 'shortage_payments'\r\n ])\r\n ->select('settlements.*', 'pump_operators.name as pump_operator_name')\r\n ->first();\r\n\r\n $business = Business::where('id', $settlement->business_id)->first();\r\n $pump_operator = PumpOperator::where('id', $settlement->pump_operator_id)->first();\r\n\r\n $total_sales_amount = $settlement->meter_sales->sum('sub_total') + $settlement->other_sales->sum('sub_total');\r\n $total_sales_discount_amount = $settlement->meter_sales->sum('discount_amount') + $settlement->other_sales->sum('discount_amount');\r\n\r\n $transaction = $this->createTransaction($settlement, $total_sales_amount, null, $settlement->pump_operator_id, 'sell', 'settlement', $settlement_no, null, 0, $total_sales_discount_amount);\r\n\r\n $sell_transaction = $transaction;\r\n foreach ($settlement->meter_sales as $meter_sale) {\r\n $fuel_tank_id = Pump::where('id', $meter_sale->pump_id)->first()->fuel_tank_id;\r\n $sell_line = $this->createSellTransactions($transaction, $meter_sale, $business_id, $default_location, $fuel_tank_id);\r\n MeterSale::where('id', $meter_sale->id)->update(['transaction_id' => $transaction->id]);\r\n }\r\n foreach ($settlement->other_sales as $other_sale) {\r\n $sell_line = $this->createSellTransactions($transaction, $other_sale, $business_id, $default_location);\r\n OtherSale::where('id', $other_sale->id)->update(['transaction_id' => $transaction->id]);\r\n }\r\n foreach ($settlement->other_incomes as $other_income) {\r\n $sell_line = $this->createSellTransactions($transaction, $other_income, $business_id, $default_location);\r\n OtherIncome::where('id', $other_income->id)->update(['transaction_id' => $transaction->id]);\r\n }\r\n /* map purchase sell lines */\r\n $this->createStockAccountTransactions($transaction);\r\n $this->mapSellPurchaseLines($business_id, $transaction, $settlement);\r\n\r\n foreach ($settlement->cash_payments as $cash_payment) {\r\n //this transaction will use in report to show amounts\r\n $this->createTransaction($settlement, $cash_payment->amount, $cash_payment->customer_id, null, 'settlement', 'cash_payment', $settlement_no);\r\n }\r\n $cash_transaction_payment = null;\r\n if ($settlement->cash_payments->sum('amount') > 0) {\r\n $cash_transaction_payment = $this->createTansactionPayment($transaction, 'cash', $settlement->cash_payments->sum('amount'));\r\n }\r\n\r\n foreach ($settlement->card_payments as $card_payment) {\r\n //this transaction will use in report to show amounts\r\n $this->createTransaction($settlement, $card_payment->amount, $card_payment->customer_id, null, 'settlement', 'card_payment', $settlement_no);\r\n $transaction_payment = $this->createTansactionPayment($transaction, 'card', $card_payment->amount, $card_payment->card_number, $card_payment->card_type);\r\n SettlementCardPayment::where('id', $card_payment->id)->update(['customer_payment_id' => $transaction_payment->id]);\r\n if (!empty($card_payment->card_type)) {\r\n $account_id = $card_payment->card_type;\r\n } else {\r\n $account_id = $this->transactionUtil->account_exist_return_id('Cards (Credit Debit) Account');\r\n }\r\n $type = 'debit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, $transaction_payment->id, 'ledger_show', $card_payment->customer_id, $card_payment->amount);\r\n }\r\n foreach ($settlement->cheque_payments as $cheque_payment) {\r\n //this transaction will use in report to show amounts\r\n $this->createTransaction($settlement, $cheque_payment->amount, $cheque_payment->customer_id, null, 'settlement', 'cheque_payment', $settlement_no);\r\n $transaction_payment = $this->createTansactionPayment($transaction, 'cheque', $cheque_payment->amount, null, null, $cheque_payment->cheque_number, $cheque_payment->bank_name, $cheque_payment->cheque_date);\r\n SettlementChequePayment::where('id', $cheque_payment->id)->update(['customer_payment_id' => $transaction_payment->id]);\r\n $account_id = $this->transactionUtil->account_exist_return_id('Cheques in Hand');\r\n $type = 'debit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, $transaction_payment->id, 'ledger_show', $cheque_payment->customer_id, $cheque_payment->amount);\r\n }\r\n foreach ($settlement->credit_sale_payments as $credit_sale_payment) {\r\n $transaction = $this->createCreditSellTransactions($settlement, 'credit_sale', $credit_sale_payment, $business_id, $default_location, null, $credit_sale_payment->id);\r\n SettlementCreditSalePayment::where('id', $credit_sale_payment->id)->update(['transaction_id' => $transaction->id]);\r\n $credit_sale_payment->transaction_id = $transaction->id;\r\n $credit_sale_payment->save();\r\n $account_id = $this->transactionUtil->account_exist_return_id('Accounts Receivable');\r\n $type = 'debit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, null, 'ledger_show', null, 0, true);\r\n }\r\n $total_shortage = $pump_operator->short_amount; //get previous amount\r\n foreach ($settlement->shortage_payments as $shortage_payment) {\r\n $transaction = $this->createTransaction($settlement, $shortage_payment->amount, null, $settlement->pump_operator_id, 'settlement', 'shortage', $settlement_no);\r\n SettlementShortagePayment::where('id', $shortage_payment->id)->update(['transaction_id' => $transaction->id]);\r\n $account_id = $this->transactionUtil->account_exist_return_id('Accounts Receivable');\r\n $type = 'debit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, null, 'ledger_show');\r\n $total_shortage += $shortage_payment->amount;\r\n }\r\n $total_excess = $pump_operator->excess_amount; //get previous amount\r\n foreach ($settlement->excess_payments as $excess_payment) {\r\n $transaction = $this->createTransaction($settlement, $excess_payment->amount, null, $settlement->pump_operator_id, 'settlement', 'excess', $settlement_no);\r\n SettlementExcessPayment::where('id', $excess_payment->id)->update(['transaction_id' => $transaction->id]);\r\n $account_id = $this->transactionUtil->account_exist_return_id('Accounts Receivable');\r\n $type = 'credit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, null, 'ledger_show');\r\n $total_excess += $excess_payment->amount;\r\n }\r\n $pump_operator->short_amount = $total_shortage;\r\n $pump_operator->excess_amount = $total_excess;\r\n $pump_operator->settlement_no = $settlement->settlement_no;\r\n\r\n $pump_operator->save();\r\n\r\n foreach ($settlement->expense_payments as $expense_payment) {\r\n $transaction = $this->createTransaction($settlement, $expense_payment->amount, null, $settlement->pump_operator_id, 'settlement', 'expense', $settlement_no);\r\n $transaction->expense_category_id = $expense_payment->category_id;\r\n $transaction->ref_no = \"Settlement No: \" . $settlement->settlement_no;\r\n $transaction->expense_account = $expense_payment->account_id;\r\n $transaction->save();\r\n SettlementExpensePayment::where('id', $expense_payment->id)->update(['transaction_id' => $transaction->id]);\r\n $transaction_payment = $this->createTansactionPayment($transaction, 'cash');\r\n $account_id = $expense_payment->account_id;\r\n $type = 'debit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, $transaction_payment->id);\r\n $account_id = $this->transactionUtil->account_exist_return_id('Cash');\r\n $type = 'credit';\r\n $this->createAccountTransaction($transaction, $type, $account_id, $transaction_payment->id);\r\n }\r\n\r\n //Cash payment + expense payment //doc 3075 - POS Settlement Expense amount in cash account – 5 Nov 2020\r\n $account_id = $this->transactionUtil->account_exist_return_id('Cash');\r\n $expense_transaction_data = [\r\n 'amount' => $settlement->expense_payments->sum('amount') + $settlement->cash_payments->sum('amount'),\r\n 'account_id' => $account_id,\r\n 'contact_id' => $sell_transaction->contact_id,\r\n 'type' => 'debit',\r\n 'sub_type' => null,\r\n 'operation_date' => $sell_transaction->transaction_date,\r\n 'created_by' => $sell_transaction->created_by,\r\n 'transaction_id' => $sell_transaction->id,\r\n 'transaction_payment_id' => !empty($cash_transaction_payment) ? $cash_transaction_payment->id : null,\r\n 'note' => null\r\n ];\r\n AccountTransaction::createAccountTransaction($expense_transaction_data);\r\n\r\n \r\n //this for only to show in print page customer payments which entered in customer payments tab\r\n $customer_payments_tab = CustomerPayment::leftjoin('contacts', 'customer_payments.customer_id', 'contacts.id')\r\n ->where('customer_payments.settlement_no', $settlement->id)\r\n ->where('customer_payments.business_id', $business_id)\r\n ->select('customer_payments.*', 'contacts.name as customer_name')\r\n ->get();\r\n\r\n $settlement_total = $settlement->meter_sales->sum('sub_total') + $settlement->other_sales->sum('sub_total') + $settlement->other_incomes->sum('sub_total') + $settlement->customer_payments->sum('sub_total');\r\n $settlement->total_amount = $settlement_total;\r\n $settlement->status = 0; // set status to non active\r\n $settlement->finish_date = date('Y-m-d');\r\n $settlement->save();\r\n\r\n // //Get Daily Collection from businiss_id and pomp_operator id and settlement_id is null\r\n $daily_collections = DailyCollection::leftjoin('business_locations', 'daily_collections.location_id', 'business_locations.id')\r\n ->leftjoin('pump_operators', 'daily_collections.pump_operator_id', 'pump_operators.id')\r\n ->leftjoin('users', 'daily_collections.created_by', 'users.id')\r\n ->leftjoin('settlements', 'daily_collections.settlement_id', 'settlements.id')\r\n ->where('daily_collections.business_id', $business_id)\r\n ->where('daily_collections.pump_operator_id', $settlement->pump_operator_id)\r\n ->whereNull('settlement_id')\r\n ->select([\r\n 'daily_collections.*',\r\n 'business_locations.name as location_name',\r\n 'pump_operators.name as pump_operator_name',\r\n 'settlements.id as settlements_id',\r\n 'users.username as user',\r\n ])->orderBy('daily_collections.id')->get();\r\n \r\n $outstanding_payment = $settlement_total;\r\n foreach ($daily_collections as $daily_collections) { \r\n # code...\r\n if ($outstanding_payment >= 0) { \r\n $outstanding_payment = floatval($outstanding_payment) - floatval($daily_collections->current_amount); \r\n DB::update('update daily_collections set settlement_id = ?, settlement_date = ?, balance_collection = ? where business_id = ? and pump_operator_id = ? and id = ? and settlement_id is null',\r\n [$settlement->id, $settlement->finish_date, floatval($daily_collections->current_amount), $business_id, $settlement->pump_operator_id, $daily_collections->id]);\r\n // echo var_dump($outstanding_payment .\"/nr\");\r\n }\r\n } \r\n \r\n DB::commit();\r\n\r\n return view('petro::settlement.print')->with(compact('settlement', 'business', 'pump_operator', 'customer_payments_tab'));\r\n } catch (\\Exception $e) {\r\n Log::emergency('File: ' . $e->getFile() . 'Line: ' . $e->getLine() . 'Message: ' . $e->getMessage());\r\n $output = [\r\n 'success' => 0,\r\n 'msg' => $e->getMessage()\r\n ];\r\n }\r\n\r\n return $output;\r\n }",
"public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }",
"function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'phone' => 'required',\n 'amount' => 'required'\n ]);\n $transferee = \\App\\User::getPhoneId($request->phone);\n if ($transferee && $request->amout >= 1 && $request->amount <=1000000) {\n $out = new Transaction();\n $out->type = \\App\\TransactionType::where('name', 'out')->first()->id;\n $out->amount = $request->amount;\n $out->message = $request->message;\n if ($this->user->transactions()->save($out)) {\n $in = new Transaction();\n $in->user = $transferee->id;\n $in->type = \\App\\TransactionType::where('name', 'in')->first()->id;\n $in->amount = $request->amount;\n $in->message = $request->message;\n if ($transferee->transactions()->save($in)) {\n return response()->json([\n 'success' => true,\n 'transaction' => $out\n ]);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, transfer could not be added'\n ], 500);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, transfer could not be added'\n ], 500);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, transfer could not be added'\n ], 500);\n }",
"public function create()\r\n {\r\n $business_id = request()->session()->get('business.id');\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n $payment_types = $this->productUtil->payment_types($default_location);\r\n $customers = Contact::customersDropdown($business_id, false);\r\n $pump_operators = PumpOperator::where('business_id', $business_id)->pluck('name', 'id');\r\n\r\n $items = [];\r\n\r\n $ref_no_prefixes = request()->session()->get('business.ref_no_prefixes');\r\n $ref_no_starting_number = request()->session()->get('business.ref_no_starting_number');\r\n $prefix = !empty($ref_no_prefixes['settlement']) ? $ref_no_prefixes['settlement'] : '';\r\n $starting_no = !empty($ref_no_starting_number['settlement']) ? (int) $ref_no_starting_number['settlement'] : 1;\r\n $count = Settlement::where('business_id', $business_id)->count();\r\n $settlement_no = $prefix . ($starting_no + $count);\r\n\r\n $active_settlement = Settlement::where('status', 1)\r\n ->where('business_id', $business_id)\r\n ->select('settlements.*')\r\n ->with(['meter_sales', 'other_sales', 'other_incomes', 'customer_payments'])->first();\r\n\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n if (!empty($active_settlement)) {\r\n $already_pumps = MeterSale::where('settlement_no', $active_settlement->id)->pluck('pump_id')->toArray();\r\n $pump_nos = Pump::where('business_id', $business_id)->whereNotIn('id', $already_pumps)->pluck('pump_name', 'id');\r\n } else {\r\n $pump_nos = Pump::where('business_id', $business_id)->pluck('pump_name', 'id');\r\n }\r\n \r\n //other_sale tab\r\n $stores = Store::where('business_id', $business_id)->pluck('name', 'id');\r\n $fuel_category_id = Category::where('business_id', $business_id)->where('name', 'Fuel')->first();\r\n $fuel_category_id = !empty($fuel_category_id) ? $fuel_category_id->id : null;\r\n $items = $this->transactionUtil->getProductDropDownArray($business_id);\r\n \r\n // other income tab\r\n $services = Product::where('business_id', $business_id)->where('enable_stock', 0)->pluck('name', 'id');\r\n\r\n\r\n $payment_meter_sale_total = !empty($active_settlement->meter_sales) ? $active_settlement->meter_sales->sum('sub_total') : 0.00;\r\n $payment_other_sale_total = !empty($active_settlement->other_sales) ? $active_settlement->other_sales->sum('sub_total') : 0.00;\r\n $payment_other_income_total = !empty($active_settlement->other_incomes) ? $active_settlement->other_incomes->sum('sub_total') : 0.00;\r\n $payment_customer_payment_total = !empty($active_settlement->customer_payments) ? $active_settlement->customer_payments->sum('sub_total') : 0.00;\r\n\r\n $wrok_shifts = WorkShift::where('business_id', $business_id)->pluck('shift_name', 'id');\r\n $bulk_tanks = FuelTank::where('business_id', $business_id)->where('bulk_tank', 1)->pluck('fuel_tank_number', 'id');\r\n\r\n\r\n $select_pump_operator_in_settlement = $this->moduleUtil->hasThePermissionInSubscription($business_id, 'select_pump_operator_in_settlement');\r\n\r\n $message = $this->transactionUtil->getGeneralMessage('general_message_pump_management_checkbox');\r\n \r\n return view('petro::settlement.create')->with(compact(\r\n 'select_pump_operator_in_settlement',\r\n 'message',\r\n 'business_locations',\r\n 'payment_types',\r\n 'customers',\r\n 'pump_operators',\r\n 'wrok_shifts',\r\n 'pump_nos',\r\n 'items',\r\n 'settlement_no',\r\n 'default_location',\r\n 'active_settlement',\r\n 'stores',\r\n 'payment_meter_sale_total',\r\n 'payment_other_sale_total',\r\n 'payment_other_income_total',\r\n 'payment_customer_payment_total',\r\n 'bulk_tanks',\r\n 'services'\r\n ));\r\n }",
"public function actionCreate($amountFrom = null, $exchangeId = null, $amount = null){\n\n if (!Yii::$app->session['amountFrom']) {\n return $this->redirect(['//site/index']);\n }\n\n $model = new Transaction();\n\n if ($model->load(Yii::$app->request->post())){\n $load = Yii::$app->request->post();\n \n $model->clientId = Yii::$app->user->id;\n\n // Exchange Rate Used\n $er = ExchangeRate::find()->where(['id' => $load['Transaction']['exchangeId']])->one();\n $model->currencyIdFrom = $er->currencyIdFrom;\n $model->currencyIdTo = $er->currencyIdTo;\n $model->sellRateValue = $er->sellValue;\n $model->buyRateValue = $er->buyValue;\n \n // Check if I should multiply or divide according to the \"base\" currency (id=1)\n // Multiply\n if ($model->currencyIdFrom == 1){\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n // Divide\n else if ($model->currencyIdTo == 1){\n $model->amountTo = $model->amountFrom/$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountFrom/$model->buyRateValue) - $model->amountTo;\n }\n // For the future...\n else {\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n \n // Look for the account the user tranfered the money to and update the available amount of money\n //$accountAdmin = AccountAdmin::find()->where(['id' => $load['Transaction']['accountAdminId']])->one();\n \n // Look for the available amount of money in every account of the To \n //$accountAdmin = new AccountAdmin();\n //$accounts = $accountAdmin->getAccountsAvailableMoney($model->amountTo);\n \n // Available money in all of the accounts\n $accountAdmin = new AccountAdmin();\n $available = $accountAdmin->getAmountSumByCurrency($er->currencyIdTo);\n \n // If the account \"has\" the money... continue\n if ($available['total'] >= $model->amountTo){\n $model->transactionDate = Yii::$app->formatter->asDate($_POST['Transaction']['transactionDate'], 'yyyy-MM-dd');\n \n // Transaction receipt\n $upload_file = UploadedFile::getInstance($model, 'uploadFile');\n\n if (!empty($upload_file) && $upload_file->size !== 0){\n\n if ($model->validate()){\n if ($model->save()){\n\n $fileName = 't-' . $model->id . '.' . $upload_file->extension;\n $model->uploadFile = $fileName;\n $model->save();\n\n $upload_file->saveAs('uploads/' . $fileName);\n\n /**\n * Unsets the session variables\n */\n\n Yii::$app->session->remove('amountFrom');\n Yii::$app->session->remove('currencyIdFrom');\n Yii::$app->session->remove('currencyIdTo');\n\n // \"Substract\" the amountTo from the account\n //$accountAdmin->maxAmount = $accountAdmin->maxAmount - $model->amountTo;\n //$accountAdmin->save();\n \n return $this->redirect(['index']);\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Debe agregar el comprobante de la transacción.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }\n else {\n Yii::$app->getSession()->setFlash('error','La cantidad solicitada no se encuentra disponible. Por favor pruebe con un monto más bajo.');\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n /*$er1 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdFrom']], ['currencyIdTo' => $load['Transaction']['currencyIdTo']]])->one();\n \n if ($er1 != null){\n $model->sellRateValue = $er1->sellValue;\n $model->buyRateValue = $er1->buyValue;\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $er1->sellValue;\n }\n else {\n $er2 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdTo']], ['currencyIdTo' => $load['Transaction']['currencyIdFrom']]])->one();\n \n if ($er2 != null){\n $model->sellRateValue = $er2->sellValue;\n $model->buyRateValue = $er2->buyValue;\n $model->amountTo = $model->amountFrom/$model->buyRateValue;\n $model->usedValue = $er2->buyValue;\n } \n }*/ \n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}",
"function handle_transaction()\n\t{\t\n\t\tif ((file_exists(get_file_base().'/data_custom/ecommerce.log')) && (is_writable_wrap(get_file_base().'/data_custom/ecommerce.log')))\n\t\t{\n\t\t\t$myfile=fopen(get_file_base().'/data_custom/ecommerce.log','at');\n\t\t\tfwrite($myfile,serialize($_POST).chr(10));\n\t\t\tfclose($myfile);\n\t\t}\n\n\t\t// assign posted variables to local variables\n\t\t$purchase_id=post_param('custom','-1');\n\n\t\t$txn_type=post_param('txn_type',NULL);\n\n\t\tif ($txn_type=='cart')\n\t\t{\t\n\t\t\trequire_lang('shopping');\n\t\t\t$item_name=do_lang('CART_ORDER',$purchase_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item_name=(substr(post_param('txn_type',''),0,6)=='subscr')?'':post_param('item_name','');\n\t\t}\n\n\t\t$payment_status=post_param('payment_status',''); // May be blank for subscription\n\t\t$reason_code=post_param('reason_code','');\n\t\t$pending_reason=post_param('pending_reason','');\n\t\t$memo=post_param('memo','');\n\t\t$mc_gross=post_param('mc_gross',''); // May be blank for subscription\n\t\t$tax=post_param('tax','');\n\t\tif (($tax!='') && (intval($tax)>0) && ($mc_gross!='')) $mc_gross=float_to_raw_string(floatval($mc_gross)-floatval($tax));\n\t\t$mc_currency=post_param('mc_currency',''); // May be blank for subscription\n\t\t$txn_id=post_param('txn_id',''); // May be blank for subscription\n\t\t$parent_txn_id=post_param('parent_txn_id','-1');\n\t\t$receiver_email=post_param('receiver_email',null);\n\t\tif ($receiver_email===null) $receiver_email=post_param('business');\n\n\t\t// post back to PayPal system to validate\n\t\tif (!ecommerce_test_mode())\n\t\t{\n\t\t\trequire_code('files');\n\t\t\t$pure_post=isset($GLOBALS['PURE_POST'])?$GLOBALS['PURE_POST']:$_POST;\n\t\t\t$x=0;\n\t\t\t$res=mixed();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$res=http_download_file('https://'.(ecommerce_test_mode()?'www.sandbox.paypal.com':'www.paypal.com').'/cgi-bin/webscr',NULL,false,false,'ocPortal',$pure_post+array('cmd'=>'_notify-validate'));\n\t\t\t\t$x++;\n\t\t\t}\n\t\t\twhile ((is_null($res)) && ($x<3));\n\t\t\tif (is_null($res)) my_exit(do_lang('IPN_SOCKET_ERROR'));\n\t\t\tif (!(strcmp($res,'VERIFIED')==0))\n\t\t\t{\n\t\t\t\tif (post_param('txn_type','')=='send_money') exit('Unexpected'); // PayPal has been seen to mess up on send_money transactions, making the IPN unverifiable\n\t\t\t\tmy_exit(do_lang('IPN_UNVERIFIED').' - '.$res.' - '.flatten_slashed_array($pure_post),strpos($res,'<html')!==false);\n\t\t\t}\n\t\t}\n\n\t\t$txn_type=str_replace('-','_',post_param('txn_type'));\n\t\tif ($txn_type=='subscr-modify')\n\t\t{\n\t\t\t$payment_status='SModified';\n\t\t\t$txn_id=post_param('subscr_id').'-m';\n\t\t}\n\t\telseif ($txn_type=='subscr_signup')\n\t\t{\n\t\t\t$payment_status='Completed';\n\t\t\t$mc_gross=post_param('mc_amount3');\n\t\t\tif (post_param_integer('recurring')!=1) my_exit(do_lang('IPN_SUB_RECURRING_WRONG'));\n\t\t\t$txn_id=post_param('subscr_id');\n\t\t}\n\t\telseif ($txn_type=='subscr_eot' || $txn_type=='recurring_payment_suspended_due_to_max_failed_payment')\n\t\t{\n\t\t\t$payment_status='SCancelled';\n\t\t\t$txn_id=post_param('subscr_id').'-c';\n\t\t}\n\t\telseif ($txn_type=='subscr_payment' || $txn_type=='subscr_failed' || $txn_type=='subscr_cancel')\n\t\t{\n\t\t\texit();\n\t\t}\n\n\t\t$primary_paypal_email=get_value('primary_paypal_email');\n\n\t\tif (!is_null($primary_paypal_email))\n\t\t{\n\t\t\tif ($receiver_email!=$primary_paypal_email) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t} else\n\t\t{\n\t\t\tif ($receiver_email!=$this->_get_payment_address()) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t}\n\n\t\tif (addon_installed('shopping'))\n\t\t{\n\t\t\tif (preg_match('#'.str_replace('xxx','.*',preg_quote(do_lang('shopping:CART_ORDER','xxx'),'#')).'#',$item_name)!=0)\n\t\t\t{\n\t\t\t\t$this->store_shipping_address($purchase_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array($purchase_id,$item_name,$payment_status,$reason_code,$pending_reason,$memo,$mc_gross,$mc_currency,$txn_id,$parent_txn_id);\n\t}",
"private function calculateOrderAmount()\n {\n if ($this->getOffer() instanceof Offer) {\n //recalculates the new amount\n $this->getOffer()->calculateInvoiceAmount();\n Shopware()->Models()->persist($this->getOffer());\n }\n }",
"public function run()\n {\n $borrow = new Transaction();\n $borrow->user_id = 1;\n $borrow->debit = 1000;\n $borrow->credit = 2000;\n $borrow->saldo = 2000;\n $borrow->total = 4000;\n $borrow->save();\n }",
"function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }",
"public function doTransaction()\n\t{\n\t\t$this->initRequest();\n\n\t\t$this->setTransaction([\n\t\t\t'ReportTxnDetail' => [\n\t\t\t\t'TxnId' => $this->TxnId\n\t\t\t]\n\t\t]);\n\t\t\n\t\treturn $this->Transaction();\n\t}",
"protected function initData(){\n $paymentMethod = $this->getPaymentMethod();\n $order = $this->getLastOrder();\n\n $tokenSecret = $this->_encryptor->decrypt($paymentMethod->getConfigData(\"token_secret\"));\n\n $this->addData([\n \"amount\" => $order->getGrandTotal(),\n \"order_id\" => $order->getId(),\n \"email\" => $order->getCustomerEmail(),\n \"token_service\" => $paymentMethod->getConfigData(\"token_service\"),\n \"token_store\" => $paymentMethod->getConfigData(\"token_store\"),\n \"submit_url\" => $this->getSubmitUrl((boolean)$paymentMethod->getConfigData(\"sandbox\")),\n ]);\n\n $transaction = new Transaccion($this->getOrderId(),$this->getTokenStore(),$this->getAmount(),$this->getTokenService(),$this->getEmail());\n $transaction->setCt_token_secret($tokenSecret);\n $paymentArgs = $transaction->getArrayResponse();\n $this->setSignature($paymentArgs[\"ct_firma\"]);\n\n return $this;\n }",
"public function createIntern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => 'required|regex:/^THW[0-9]{6}DZD$/|exists:accounts,number',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo more validation\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $commission = config('commission.COUR_COUR') * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'in',\n 'account_id' => $request->input('receiver.account'),\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client just in case of < 200 000 else till validation\n $receiverAccount = Account::find($request->input('receiver.account'));\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n\n InternTransfer::create([\n 'code' => $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi'),\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'transfers_type' => 'vir_client',\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $request->input('receiver.account'),\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }",
"public function calculatePayment()\n {\n }",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"public function createPayment()\n\t{\n\n\t}",
"public function createExtern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => ['required', 'regex:/^[A-Z]{3}[0-9]{6}(DZD|EUR|USD)$/'],\n 'receiver.name' => 'required|max:255',\n 'receiver.bank' => 'required|regex:/^[A-Z]{3}$/|exists:banks,code',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n\n //create the transfer\n $commission = config('commission.SENDEXTBANK') * $amount;\n $now = \\Carbon\\Carbon::now();\n $virement_code = $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi');\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //generate the XML file that will be treated later equivalent to send money\n $xmlBody = View::make('xml_transfer_template', [\n \"code\" => $virement_code,\n \"date\" => $now->format('YmdHis'),\n \"senderName\" => $this->client()->firstname . ' ' . $this->client()->lastname,\n \"senderAccount\" => $senderAccount->number,\n \"receiverName\" => $request->input('receiver.name'),\n \"receiverBank\" => $request->input('receiver.bank'),\n \"receiverAccount\" => $request->input('receiver.account'),\n \"amount\" => $amount,\n \"reason\" => $request->input('reason'),\n ])->render();\n $xmlBody = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . $xmlBody;\n\n Storage::disk('xml_out')->put($virement_code . '.xml', $xmlBody);\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n ExternTransfer::create([\n 'code' => $virement_code,\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'commission' => $commission,\n 'intern_account_id' => $senderAccount->number,\n 'direction' => 'out',\n 'extern_account_name' => $request->input('receiver.name'),\n 'extern_account_number' => $request->input('receiver.account'),\n 'extern_bank' => $request->input('receiver.bank'),\n ]);\n\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,\n 'transaction_type' => 'transf',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }",
"public function transaction();"
]
| [
"0.5553868",
"0.545725",
"0.5168276",
"0.51629806",
"0.51600903",
"0.5125773",
"0.51082724",
"0.5100993",
"0.5085761",
"0.50155854",
"0.5004947",
"0.49852723",
"0.49775472",
"0.49656126",
"0.49649438",
"0.4905013",
"0.4878981",
"0.48551846",
"0.48531926",
"0.48473588",
"0.48381567",
"0.48321944",
"0.48187447",
"0.4801844",
"0.47952095",
"0.47924468",
"0.47851476",
"0.4782315",
"0.4749726",
"0.4742492"
]
| 0.60860914 | 0 |
Handle calculations when create a new merger in transaction instance. | public static function handleCalculationsOfMergerIn(Transaction $transaction): void
{
$transaction->handleCalculationsOfMergerIn();
$transaction->share->handleCalculationsOfMergerIn($transaction);
$transaction->share->portfolio->handleCalculationsOfMergerIn($transaction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleCalculationsOfMergerOut(Transaction $transaction): void\n {\n $shareAmount = $transaction->share->average_amount;\n $transaction->share->handleCalculationsOfMergerOut($transaction);\n $newShare = $transaction->share->portfolio->handleCalculationsOfMergerOut($transaction);\n\n $newTransaction = new Transaction();\n $newTransaction->fill([\n 'share_id' => $newShare->id,\n 'type' => TransactionType::MergerIn,\n 'date_at' => $transaction->date_at,\n 'lot' => ($newLot = bcmul($transaction->lot, $transaction->exchange_ratio, 3)),\n 'exchange_ratio' => $transaction->exchange_ratio,\n 'symbol_code' => $transaction->share->symbol->code,\n ]);\n $newTransaction->price = $shareAmount->divide($newLot);\n $newTransaction->save();\n }",
"public function parseCalculations() {\n foreach($this->calculations as $calculation) {\n $this->parseCalculation($calculation);\n }\n $calculationResult = $this->calculationResults[count($this->calculationResults)-1];\n $calculationResultMethod = $calculationResult->getMethod();\n if ($this->parserMethodsExtra->isGMethod($calculationResultMethod)) {\n $calculationResult->insert();\n } else {\n foreach ($this->calculationResults as $calculationResult) {\n $calculationResult->insert();\n }\n }\n }",
"public static function handleCalculationsOfBonus(Transaction $transaction): void\n {\n $transaction->handleCalculationsOfBonus();\n $transaction->share->handleCalculationsOfBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfBonus($transaction);\n }",
"protected function _initTotals()\n {\n parent::_initTotals();\n $amount = $this->getSource()->getAddCost();\n $createHelper = Mage::helper('addshippingcost/varienObjectCreate');\n if ($amount) {\n $this->addTotalBefore($createHelper->create($amount));\n }\n\n return $this;\n }",
"public static function handleCalculationsOfBuying(Transaction $transaction): void\n {\n $transaction->handleCalculationsOfBuying();\n $transaction->share->handleCalculationsOfBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfBuying($transaction);\n }",
"public function initTotals()\n {\n $amount = $this->getParentBlock()->getSource()->getAddCost();\n $createHelper = Mage::helper('addshippingcost/varienObjectCreate');\n if ($amount) {\n $this->getParentBlock()->addTotalBefore($createHelper->create($amount));\n }\n\n return $this;\n }",
"public static function handleCalculationsOfDeletedBonus(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBonus($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBonus($transaction);\n }",
"public function store(Request $request)\n { \n $default_currency = Currency::default();\n $exchange_rate_id = $default_currency->id;\n $selected_currency = Currency::findOrFail($request->current_currency_id);\n $exchange_rate = CurrencyExchangeRate::currentRate($selected_currency->id);\n $calculation = ($selected_currency->calculation == 'multiplication') ? 'divide' : 'multiplication';\n $rate = 1;\n \n // Start transaction!\n DB::beginTransaction();\n\n try {\n // ...\n $quotation = new Quotation();\n $quotation->quotation_number = config('global.codes.quotation');\n $quotation->customer_id = $request->customer_id;\n $quotation->quotation_date = \\Carbon\\Carbon::now();\n $quotation->validity_date = $request->validity;\n $quotation->payment_term_id = $request->payment_term_id;\n $quotation->delivery_method_id = $request->delivery_method_id; \n $quotation->amount = $request->amount;\n $quotation->tax = $request->pay_tax;\n $quotation->discount = $request->discount;\n $quotation->discount_amount = $request->discount_amount;\n $quotation->grand_total = $request->grand_total;\n $quotation->rate = $rate;\n $quotation->currency_id = $default_currency->id;\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $rate = $exchange_rate->rate;\n $quotation->amount = $this->exchangeRate($calculation, $request->amount, $rate);\n $quotation->tax = $this->exchangeRate($calculation, $request->pay_tax, $rate);\n $quotation->discount_amount = $this->exchangeRate($calculation, $request->discount_amount, $rate);\n $quotation->grand_total = $this->exchangeRate($calculation, $request->grand_total, $rate);\n $quotation->rate = $rate;\n $quotation->is_default_currency = 0;\n $quotation->currency_id = $selected_currency->id;\n }\n\n $quotation->save();\n\n // retreive the id and combine with the quotation code\n $quotation->quotation_number = $quotation->quotation_number.$quotation->id;\n $quotation->save();\n // ...\n // create quotation details reference to quotation id above\n foreach ($request->product_id_array as $key => $value) {\n $detail = new QuotationDetail();\n $detail->quotation_id = $quotation->id;\n $detail->product_id = $request->product_id_array[$key];\n $detail->product_name = $request->product_name_array[$key];\n $detail->notes = $request->description_array[$key];\n $detail->variant_ids = $request->variant_ids[$key];\n $detail->qty = $request->qty_array[$key];\n $detail->unit_price = $request->price_array[$key];\n $detail->tax = $request->tax_array[$key];\n $detail->pay_tax = $request->pay_tax_array[$key];\n $detail->discount = $request->discount_array[$key];\n $detail->discount_amount = $request->discount_amount_array[$key];\n $detail->subtotal = $request->subtotal_array[$key];\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $detail->pay_tax = $this->exchangeRate($calculation, $request->pay_tax_array[$key], $rate);\n $detail->discount_amount = $this->exchangeRate($calculation, $request->discount_amount_array[$key], $rate);\n $detail->unit_price = $this->exchangeRate($calculation, $request->price_array[$key], $rate);\n $detail->subtotal = $this->exchangeRate($calculation, $request->subtotal_array[$key], $rate);\n } \n\n $detail->save();\n }\n\n } catch(\\Exception $e)\n {\n DB::rollback();\n throw $e;\n }\n\n DB::commit(); \n return response()->json([ 'quotation' => $quotation, 'status' => 'success']); \n }",
"public function createTransaction()\n {\n }",
"public function ProcessPayment(Request $request)\n {\n $payment_model = new Payment();\n $payment_id = keyGen($payment_model);\n\n $mode_model = new Mode();\n $mode_id = keyGen($mode_model);\n\n $transaction_model = new Transactions();\n $transaction_id = keyGen($transaction_model);\n\n $client_data = DB::table('clients')\n ->where('client_id',$request->payment_client)\n ->get();\n\n $receivable = $client_data[0]->client_receivable;\n $invoice_receivable = +$receivable - +$request->payment_mode_amount;\n\n\n DB::transaction(function () use($payment_id,$mode_id,$transaction_id,$request,$invoice_receivable) {\n\n DB::table('payments')->insert(\n [\n 'payment_id' => $payment_id,\n 'payment_mode' => $mode_id,\n 'payment_client' => $request->payment_client,\n 'payment_invoice' => $request->payment_invoice,\n 'payment_transaction' => $request->payment_transaction,\n 'payment_date' => $request->payment_mode_check_date\n ]\n );\n\n DB::table('modes')->insert(\n [\n 'mode_id' => $mode_id,\n 'mode_type' => $request->payment_method,\n 'mode_bank' => $request->payment_mode_bank_name,\n 'mode_date' => $request->payment_mode_check_date,\n 'mode_entity' => $request->payment_client,\n 'mode_amount' => $request->payment_mode_amount,\n 'mode_description' => $request->payment_mode_description,\n 'mode_reference' => $request->payment_mode_check_number,\n ]\n );\n\n DB::table('transactions')->insert(\n [\n 'transaction_id' => $transaction_id,\n 'transaction_invoice' => $request->payment_invoice,\n 'transaction_client' => $request->payment_client,\n 'transaction_type' => 'Credit',\n 'transaction_amount' => $request->payment_mode_amount\n ]\n );\n\n DB::table('invoices')->where('invoice_id',$request->payment_invoice)\n ->update(\n [\n 'invoice_status' => 'Paid'\n ]\n );\n\n DB::table('clients')->where('client_id',$request->payment_client)\n ->update(\n [\n 'client_receivable' => $invoice_receivable\n ]\n );\n\n });\n return redirect('/ledger')->withStatus(__('Invoice Paid'));\n }",
"public function created(Transaction $transaction)\n {\n //\n }",
"protected function _initTotals() {\n parent::_initTotals();\n $this->removeTotal('base_grandtotal');\n \n if ((float) $this->getSource()->getAdjustmentPositive()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_positive',\n 'value' => $this->getSource()->getAdjustmentPositive(),\n 'label' => $this->__('Adjustment Refund')\n ));\n $this->addTotal($total);\n }\n \n if ((float) $this->getSource()->getAdjustmentNegative()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_negative',\n 'value' => $this->getSource()->getAdjustmentNegative(),\n 'label' => $this->__('Adjustment Fee')\n ));\n $this->addTotal($total);\n }\n\n return $this;\n }",
"public static function handleCalculationsOfDeletedDividend(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedDividend($transaction);\n }",
"public static function handleCalculationsOfDividend(Transaction $transaction): void\n {\n $transaction->dividend = $transaction->dividend_gain->divide($transaction->lot);\n $transaction->update();\n $transaction->share->handleCalculationsOfDividend($transaction);\n $transaction->share->portfolio->handleCalculationsOfDividend($transaction);\n }",
"protected function initData(){\n $paymentMethod = $this->getPaymentMethod();\n $order = $this->getLastOrder();\n\n $tokenSecret = $this->_encryptor->decrypt($paymentMethod->getConfigData(\"token_secret\"));\n\n $this->addData([\n \"amount\" => $order->getGrandTotal(),\n \"order_id\" => $order->getId(),\n \"email\" => $order->getCustomerEmail(),\n \"token_service\" => $paymentMethod->getConfigData(\"token_service\"),\n \"token_store\" => $paymentMethod->getConfigData(\"token_store\"),\n \"submit_url\" => $this->getSubmitUrl((boolean)$paymentMethod->getConfigData(\"sandbox\")),\n ]);\n\n $transaction = new Transaccion($this->getOrderId(),$this->getTokenStore(),$this->getAmount(),$this->getTokenService(),$this->getEmail());\n $transaction->setCt_token_secret($tokenSecret);\n $paymentArgs = $transaction->getArrayResponse();\n $this->setSignature($paymentArgs[\"ct_firma\"]);\n\n return $this;\n }",
"public function calculate()\n {\n $person_id = $this->security->xss_clean($this->input->post('person_id'));\n $revision_date = $this->security->xss_clean($this->input->post('increment_date'));\n $grade = $this->security->xss_clean($this->input->post('grade'));\n $current_salary_step = $this->security->xss_clean($this->input->post('salary_step'));\n $revision_year = date(Y, strtotime($revision_date));\n\n $current_salary = $this->calculateSalary($grade, $current_salary_step, $revision_year-1);\n $new_salary = $this->calculateSalary($grade, $current_salary_step, $revision_year);\n\n $next_salary_increment = $this->calculateSalary($grade, $current_salary_step+1, $revision_year);\n\n $increment = $new_salary - $current_salary;\n\n $salaryDetails = array('new_salary' => $new_salary, 'increment' => $increment, 'current_salary' => $current_salary, 'next_salary' => $next_salary_increment, 'year' => $revision_year);\n\n echo json_encode($salaryDetails);\n }",
"public function addCalculation(Request $request)\n {\n // Retrieve post data from request\n $user_data = $request->data;\n\n // Insert new User\n $user = new User;\n\n // Fill items from post data\n $user->gender = boolval($user_data['gender']);\n $user->familiar = intval($user_data['familiar']);\n $user->preparation = intval($user_data['preparation']);\n $user->physical_active = intval($user_data['physical_active']);\n $user->willing_option = intval($user_data['willing_option']);\n $user->age = intval($user_data['age']);\n $user->unit = boolval($user_data['unit']);\n\n // Decide the gender\n $genderStr = $user->gender ? 'male' : 'female';\n\n if ($user_data['unit']) {\n $user->height_cm = intval($user_data['height_cm']);\n $user->weight_kg = intval($user_data['weight_kg']);\n $user->target_kg = intval($user_data['target_kg']);\n\n // Calculate the bmi value according the user's height, weight\n $height = $user->height_cm / 100;\n $user->bmi = $user->weight_kg / round(($height * $height), 2);\n $options = ['formula' => 'revised_harris_benedict', 'unit' => 'metric'];\n\n // Calculate the calorie according the user's gender, target_weight, height (metric option)\n $tdeeCalculator = new TDEECalculator($options);\n $user->calorie = $tdeeCalculator->calculate($genderStr, $user->target_kg, $user->height_cm,\n $user->age);\n } else {\n $user->height_ft = intval($user_data['height_ft']);\n $user->height_in = intval($user_data['height_in']);\n $user->weight_lb = intval($user_data['weight_lb']);\n $user->target_lb = intval($user_data['target_lb']);\n\n // Calculate the bmi value according the user's height, weight\n $height = $user->height_ft * 12 + $user->height_in;\n $user->bmi = ($user->weight_lb * 703) / ($height * $height);\n\n // Calculate the calorie according the user's gender, target_weight, height (imperial option)\n $options = ['formula' => 'mifflin_st_jeor', 'unit' => 'imperial'];\n $tdeeCalculator = new TDEECalculator($options);\n $user->calorie = $tdeeCalculator->calculate($genderStr, $user->target_lb, floatval($height) / 12,\n $user->age);\n }\n\n // Adjust the value for reality\n $user->calorie -= 440;\n\n // Create unique id for column key\n $uniqId = md5(uniqid(time()));\n $user->key = $uniqId;\n\n // Save the user information\n $user->save();\n\n // Insert product_user relation items\n $meal_products = $user_data['meal_product'];\n $productIds = [];\n foreach ($meal_products as $product) {\n $productId = Product::where('name', $product)->first()->id;\n array_push($productIds, $productId);\n }\n $user->products()->attach($productIds);\n\n\n // Return key of the user\n return (['summaryId' => $uniqId]);\n }",
"function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }",
"public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }",
"private function addPostProcessingMandatoryData($transaction)\n {\n $transaction->setAmount(\n new Amount(\n (float) $this->deltaAmount,\n $this->transactionModel->getCurrency()\n )\n );\n\n $transaction->setParentTransactionId(\n $this->transactionModel->getTransactionId()\n );\n\n return $transaction;\n }",
"function calculate()\n {\n $this->first_period = $this->second_period = $this->rebill_times = null;\n foreach ($this->getCalculators() as $calc)\n $calc->calculate($this);\n // now summarize all items to invoice totals\n $priceFields = array(\n 'first_subtotal' => null,\n 'first_discount' => 'first_discount',\n 'first_tax' => 'first_tax',\n 'first_shipping' => 'first_shipping',\n 'first_total' => 'first_total',\n 'second_subtotal' => null,\n 'second_discount' => 'second_discount',\n 'second_tax' => 'second_tax',\n 'second_shipping' => 'second_shipping',\n 'second_total' => 'second_total',\n );\n foreach ($priceFields as $k => $kk)\n $this->$k = 0.0;\n foreach ($this->getItems() as $item) {\n $this->first_subtotal += moneyRound($item->first_price * $item->qty);\n $this->second_subtotal += moneyRound($item->second_price * $item->qty);\n foreach ($priceFields as $k => $kk)\n $this->$k += $kk ? $item->$kk : 0;\n }\n foreach ($priceFields as $k => $kk)\n $this->$k = moneyRound($this->$k);\n /// set periods, it has been checked for compatibility in @see add()\n $mostExpensiveItem = null;\n foreach ($this->getItems() as $item) {\n if (!$mostExpensiveItem || $item->first_price > $mostExpensiveItem->first_price) {\n $mostExpensiveItem = $item;\n }\n $this->currency = $item->currency;\n if (empty($this->first_period) && $item->rebill_times)\n $this->first_period = $item->first_period;\n if (empty($this->second_period))\n $this->second_period = $item->second_period;\n if (empty($this->rebill_times))\n $this->rebill_times = $item->rebill_times;\n $this->rebill_times = max($this->rebill_times, $item->rebill_times);\n }\n\n // First period is empty, invoice has only one time items,\n // set first period from most expensive item.\n if (empty($this->first_period) && $mostExpensiveItem) {\n $this->first_period = $mostExpensiveItem->first_period;\n }\n\n if ($this->currency == Am_Currency::getDefault())\n $this->base_currency_multi = 1.0;\n else {\n $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency,\n sqlDate(!empty($this->tm_added) ? $this->tm_added : $this->getDi()->sqlDateTime));\n if (!$this->base_currency_multi)\n $this->base_currency_multi = 1;\n }\n $this->getDi()->hook->call(Am_Event::INVOICE_CALCULATE, array('invoice' => $this));\n\n $this->terms = null;\n if ((count($this->getItems()) == 1) &&\n ($item = $this->getItem(0)) &&\n ($item->item_type == 'product') &&\n ($pr = $item->tryLoadProduct()) &&\n ($bp = $pr->getBillingPlan()) &&\n $bp->terms) {\n\n if (((float)$bp->first_price == (float)$this->first_total) &&\n ($bp->first_period == $this->first_period) &&\n ((float)$bp->second_price == (float)$this->second_total) &&\n ($bp->second_period == $this->second_period) &&\n ($bp->rebill_times == $this->rebill_times)\n ) {\n $this->terms = $bp->terms;\n }\n }\n\n $this->terms = $this->getDi()->hook->filter($this->terms,\n Am_Event::INVOICE_TERMS, array('invoice' => $this));\n\n return $this;\n }",
"function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }",
"public function calculateWithPriorityToAdditionAndSubtractionDataProvider() {}",
"public static function createFromJson($transData) {\n $transaction = new Transaction();\n\n $transaction->id = $transData->id;\n $transaction->transactionDate = self::parseDate($transData->transactionDate);\n $transaction->clickDate = self::parseDate($transData->clickDate);\n $transaction->validationDate = self::parseDate($transData->validationDate);\n $transaction->advertiserId = $transData->advertiserId;\n $transaction->clickDevice = $transData->clickDevice;\n $transaction->transactionDevice = $transData->transactionDevice;\n $transaction->commissionStatus = $transData->commissionStatus;\n $transaction->declineReason = $transData->declineReason;\n $transaction->clickRefs = (array)$transData->clickRefs;\n $transaction->commissionAmount = $transData->commissionAmount->amount;\n $transaction->orderReference = $transData->orderRef;\n $transaction->saleAmount = $transData->saleAmount->amount;\n $transaction->siteName = $transData->siteName;\n $transaction->url = $transData->publisherUrl;\n $transaction->paid = $transData->paidToPublisher;\n $transaction->transactionType = $transData->type;\n\n $transaction->totalCommissionAmount = 0;\n\n // Process transaction parts:\n foreach ($transData->transactionParts as $transactionPartData) {\n $transactionPart = new TransactionPart();\n\n $transactionPart->commissionGroupId = $transactionPartData->commissionGroupId;\n $transactionPart->amount = $transactionPartData->amount;\n $transactionPart->commissionAmount = $transactionPartData->commissionAmount;\n\n // Add transaction part\n $transaction->transactionParts[] = $transactionPart;\n\n // Keep track of total commission (over all transaction parts)\n $transaction->totalCommissionAmount += $transactionPart->commissionAmount;\n }\n\n // Determine whether the commission for this sale is shared with other publisher:\n if ($transaction->totalCommissionAmount > 0 && $transaction->totalCommissionAmount != $transaction->commissionAmount) {\n $transaction->sharedCommission = true;\n $transaction->commissionPercentage = $transaction->commissionAmount / $transaction->totalCommissionAmount * 100;\n } else {\n $transaction->sharedCommission = false;\n $transaction->commissionPercentage = 100;\n }\n\n return $transaction;\n }",
"public function store(Request $request) {\n \n $request->validate([\n 'amount_paid' => 'required',\n ]);\n\n $tenant_id = $request->input('tenant_id');\n $findPropertyId = Tenant::where('id', '=', $tenant_id)->first(); \n $property_id = $findPropertyId->property_id;\n $landlord_id = Auth::user()->id;\n $user = User::where('id', '=', $findPropertyId->user_id)->first();\n\n // figure the late fee\n $latefee = $this->calculateLateFee($request->input('late_fee_amount'));\n \n $property = Property::join('rents', 'rents.property_id', '=', 'properties.id')\n ->where('properties.id', '=', $property_id)\n ->first();\n\n // calculate the balance\n $amount_paid = $request->input('amount_paid');\n $currentBalance = $this->findRentBalance($tenant_id) + $property->rent_amount;\n $newBalance = $this->calculateNewBalance($currentBalance, $amount_paid, $property->rent_amount); \n\n // calc paid in full\n $paid_in_full = 0;\n if( $newBalance <= 0 ) {\n $paid_in_full = 1;\n }\n\n // generate the confirmation code\n $confirmationNumber = str_random(10);\n\n $transaction = new Transaction([\n 'tenant_id' => $tenant_id,\n 'landlord_id' => $landlord_id,\n 'property_id' => $property_id,\n 'amount_paid' => $amount_paid,\n 'payment_method' => 'cash/check',\n 'paid_in_full' => $paid_in_full,\n 'late_fee_amount' => $latefee,\n 'confirmation' => $confirmationNumber,\n ]);\n $transaction->save();\n\n // find the next due date \n $numberOfMonths = $amount_paid / $property->rent_amount; \n $roundMonth = floor($numberOfMonths); // always round down\n\n // save balance to rents table \n $rents = Rent::where('property_id', '=', $property_id)->first();\n $rents->balance = $newBalance;\n $rents->next_due_date = Carbon::now()->addMonths($roundMonth);\n $rents->save();\n\n // send email to tenant\n Mail::to($user->email)->send(new ManualPaymentConfirmation($user, $amount_paid, $transaction->created_at, $confirmationNumber));\n\n return redirect()\n ->route('tenants.index')\n ->with('info', 'Good job! You have successfully entered the tenants rent payment for the month. It will reflect on the tenants page.');\n\n }",
"public static function handleCalculationsOfDeletedBuying(Transaction $transaction): void\n {\n $transaction->share->handleCalculationsOfDeletedBuying($transaction);\n $transaction->share->portfolio->handleCalculationsOfDeletedBuying($transaction);\n }",
"private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }",
"protected function _initTotals()\r\n {\r\n parent::_initTotals();\r\n $orderId = $this->getSource()->getId();\r\n\t\t//$base_orderId = 34243;\r\n\t\t$discount = $this->helper('auction')->getDiscountByOrderId($orderId);\r\n if (0) {\r\n $this->addTotalBefore(new Varien_Object(array(\r\n 'code' => 'auction',\r\n 'value' => $amount,\r\n 'base_value'=> $amount,\r\n 'label' => $this->helper('auction')->__('Auction Product Discount ').$amount.$this->helper('auction')->__('%'),\r\n ), array('shipping', 'tax')));\r\n }\r\n\r\n return $this;\r\n }",
"protected function runTransactionBuild()\n {\n $this->request->transaction = new Transaction($this->request); /* Write the transaction record to disk */\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'transaction_date' => 'required',\n 'transaction_code' => 'required',\n 'account_number' => 'required',\n 'amount' => 'required|numeric',\n 'narration' => 'required',\n 'created_by' => 'required',\n 'payment_to' => 'required'\n ]);\n \n $transaction = new Transaction();\n $lastTrans = \\App\\Transaction::all()->pop();\n if (!empty($lastTrans)) {\n $lastId= $lastTrans->id;\n } else {\n $lastId=0;\n }\n if ($request->transaction_code==\"DOB\") {\n $transaction->balance=$request->amount;\n $transaction->amount_paid=0;\n } else {\n $transaction->amount_paid=$request->amount;\n $transaction->balance=0;\n }\n \n $transaction->trn_ref_no = \"MPost\" . \"-\" .$request->payment_to . \"-\" .($lastId +1);\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = null;\n $transaction->liters = 0;\n $transaction->rate = null;\n $transaction->total_cost = null;\n $transaction->narration = $request->narration;\n $transaction->account_number=$request->account_number;\n $transaction->transaction_code = $request->transaction_code;\n $customer=Customer::where(\"customer_number\", $request->payment_to)->get();\n if (isset($customer[0]->customer_name)) {\n $customerName= $customer[0]->customer_name;\n } else {\n $customerName=\"\";\n }\n $transaction->customer_name = $customerName;\n \n \n $transaction->shortages = 0;\n \n $supplier=\"\";\n $supplier=Supplier::where(\"supplier_number\", $request->payment_to)->get();\n if (isset($supplier[0]->supplier_name)) {\n $supplierName=$supplier[0]->supplier_name;\n } else {\n $supplierName=\"\";\n }\n \n $transaction->supplier_name = $supplierName;\n \n \n $transaction->unit_price = 0;\n $transaction->payment_mode = \"N/A\";\n //$transaction->approved_by\n\n $transaction->save();\n Session::flash('flash_message', 'Record successfully added!');\n\n return redirect()->back();\n }"
]
| [
"0.5983439",
"0.5101523",
"0.5052811",
"0.49495438",
"0.48717952",
"0.4865523",
"0.48105228",
"0.480563",
"0.47939113",
"0.4723655",
"0.47020668",
"0.46926194",
"0.46638536",
"0.46522734",
"0.46514738",
"0.46508506",
"0.46311048",
"0.46104884",
"0.45864505",
"0.45825285",
"0.4580559",
"0.45691413",
"0.4566618",
"0.4564736",
"0.45570508",
"0.45471787",
"0.45448732",
"0.4544739",
"0.45426267",
"0.45022246"
]
| 0.6174344 | 0 |
This method sets the game to the 'owned' status. | public function own($id)
{
// Find our game and perform the vote.
$game = $this->findById($id);
// Check if we own this game already.
if (!empty($game) && $game['owned'] == 1) return false;
// Check if we are using the service.
if (XBOXAPP_OFFLINE === true) {
if (empty($game)) return false;
$this->update($id, array('owned' => 1));
} else {
// Set the status to gotit.
if (!ServiceApi::setGotIt($id)) return false;
}
// Sync up our database.
$this->sync();
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set_game()\n {\n $player = Player::findOrFail(Input::json('player_id'));\n $game = Game::findOrFail(Input::json('game_id'));\n\n if (Input::json('playing') && !$player->games->contains($game->id)) {\n $player->games()->attach($game->id, ['created_at' => DB::raw('now()'), 'updated_at' => DB::raw('now()')]);\n }\n else {\n $player->games()->detach($game->id);\n }\n }",
"private function set_win($who, $game_id)\n {\n self::$storage_obj->set_win($who, $game_id);\n }",
"public function setOwnedObjects($val)\n {\n $this->_propDict[\"ownedObjects\"] = $val;\n return $this;\n }",
"private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }",
"public function updateAvailability(Player $player)\n {\n if ($player->getOpponent()) {\n $game = $player->getGame();\n $game->manipulateAvailable(false);\n $this->em->persist($game);\n $this->em->flush();\n }\n }",
"public function gameOver(): void\n {\n $this->setGameState(SELF::STATE_GAMEOVER);\n }",
"private function exit_user_from_game() {\n //increments the user account_balance, since the amount was already deducted at game start\n $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) + {$this->amount} WHERE user_id = '{$this->userID}'\");\n\n /*This gets the user current game details*/\n $this->userCurrentGameDetail = $this->fetch_data_from_table($this->games_table_name, 'game_id', $this->user_details[\"game_id_about_to_play\"])[0];\n\n /* Gets the number of players in the game */\n $number_of_players = (int)$this->userCurrentGameDetail[\"number_of_players\"];\n\n /* the new number of players will now be the previous number of players - 1*/\n $new_number_of_players = $number_of_players - 1;\n /* if the new number of players is equal to 0; meaning that he is the only one about to play; the entire game details will be deleted from the database*/\n if($new_number_of_players == 0){ $this->delete_record($this->games_table_name , \"game_id\" , $this->user_details[\"game_id_about_to_play\"] ); return true;}\n /* else set the new number of players to the one above */\n $this->update_record($this->games_table_name , \"number_of_players\" , $new_number_of_players , 'game_id' , $this->userCurrentGameDetail[\"game_id\"]);\n /* delete the game id from the user detail to avoid deduction from the when the game starts */\n $this->update_record($this->users_table_name , \"game_id_about_to_play\" , \"0\" , 'user_id' , $this->userID);\n /* finally return true */\n return true;\n }",
"function resetRound() {\n\t// execute this function at end of game\n\twriteGamestate([\n\t\t\"player1\" => [],\n\t\t\"player2\" => [],\n\t\t\"round\" => 0,\n\t]);\n}",
"public static function updateWonLoseState($targetUser, $loggedUserID, $playerNumber, $winner){\n\t\tRoomDBHandler::setupStringifiedBoard(RoomLogic::constructStringifiedBoard(), $targetUser['roomID']);\n\n\t\tif($winner === $playerNumber)\n\t\t{\n\t\t\tRoomDBHandler::addUpPlayerWon($loggedUserID, $targetUser['roomID']);\n\t\t\tRoomDBHandler::addUpOpponentLose($loggedUserID, $targetUser['roomID']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tRoomDBHandler::addUpPlayerLose($loggedUserID, $targetUser['roomID']);\n\t\t\tRoomDBHandler::addUpOpponentWon($loggedUserID, $targetUser['roomID']);\n\t\t}\n }",
"public function updateOwnerStatus()\n {\n $owner['status'] = $this->input->get('status');\n $owner['id'] = $this->input->get('owner_id');\n\n if(isset($owner['status']) && isset($owner['id']))\n {\n if($this->Owner_model->updateTeamOwner($owner))\n {\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\">×</a><strong>Success!</strong> Owner updated Successfully.</div>');\n redirect($_SERVER['HTTP_REFERER']);\n }\n else\n {\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\">×</a><strong>Error!</strong> Try again.</div>');\n redirect($_SERVER['HTTP_REFERER']);\n }\n }\n redirect('admin/owner?msg=failure');\n }",
"public function newgame()\n {\n $this->gamerounds = [];\n $this->roundsum = 0;\n $this->dice = new Dice();\n }",
"function resetFlagsForMonument() {\n self::DbQuery(\"\n UPDATE\n player\n SET\n number_of_tucked_cards = 0,\n number_of_scored_cards = 0\n \");\n }",
"public function stand(){\n $_SESSION['score'] = $this ->score;\n $this ->endturn = false;\n }",
"public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }",
"public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }",
"function addPlayer()\n\t{\n\t\t$uid = $_SESSION['uid'];\n\t\t$gid = $_POST['gid'];\n\t\t$ct = $_POST['country'];\n\t\t\n\t\t$query = \"UPDATE games\n\t\t\t\t\tSET players=players+1\n\t\t\t\t\tWHERE gid=$gid;\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$query = \"INSERT INTO in_game(uid, gid, country)\n\t\t\t\t\tVALUES('$uid', $gid, '$ct');\";\n\t\t\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$this->addStartUnits($ct, $gid, $uid);\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM games\n\t\t\t\t\tWHERE gid='$gid';\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$players = mysql_result($result, 0, \"players\");\n\t\t\n\t\tif($players == 7)\n\t\t{\n\t\t\t$date = date(\"Y-m-d H:i:s\", time());\n\t\t\t$date = strtok($date, \" \");\n\t\t\t$year = strtok($date, \"-\");\n\t\t\t$month = strtok(\"-\");\n\t\t\t$day = strtok(\"-\");\n\t\t\t$day = (int)$day + 7;\n\t\t\t$datetime = $year . \"-\" . $month . \"-\" . $day . \" 00:00:00\";\n\t\t\t$query = \"UPDATE games\n\t\t\t\t\t\tSET running=true, deadline='$datetime'\n\t\t\t\t\t\tWHERE gid=$gid;\";\n\t\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t}\n\t}",
"public function become_owner(){\n\t\t//成为房东\n\t\t$this->load->view('become_owner');\n\t}",
"protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }",
"public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}",
"public function changeAllPlayersStatus($status) {\n foreach ($this->players as &$player) {\n $player->status = $status;\n }\n }",
"public function withholdTargets()\n\t{\n\t\tif ($this->winnerExists() && !empty($this->winner->getStateData()->withheld_targets))\n\t\t{\n\t\t\tif (empty($this->data->withheld_targets))\n\t\t\t{\n\t\t\t\t$this->data->withheld_targets = array();\n\t\t\t}\n\n\t\t\t$this->data->withheld_targets = array_unique(array_merge($this->data->withheld_targets, $this->winner->getStateData()->withheld_targets));\n\t\t}\n\t}",
"function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }",
"public static function addGameUserOnly() {\n\t\t$accountId = parent::get_user_logged_in()->id;\n\t\tif (isset($_POST['list'])) {\n\t\t\t$gameId = $_POST['list'];\n\t\t} else {\n\t\t\tRedirect::to('/addGame', array('errors' => array('nothing selected')));\n\t\t}\n\n\t\tif (!Account_game::checkIfAccountOwnsGame($accountId, $gameId)) {\n\t\t\t$accountGame = new Account_game(array(\n\t\t\t\t'accountId' => $accountId,\n\t\t\t\t'gameId' => $gameId\n\t\t\t));\n\t\t\t$accountGame->save();\n\t\t\tRedirect::to('/addGame', array('messages' => array('game added to your account')));\n\t\t} else if (Game::getGame($gameId) == null) {\n\t\t\t$errors = array(\"game doesn't exist\");\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t} else {\n\t\t\t$errors = array('you already own that game');\n\t\t\tRedirect::to('/addGame', array('errors' => $errors));\n\t\t}\n\t}",
"public function openValve(){\n if ($this->game->get_current_turn()->WinStatus($this->game->getSize())){\n $this->game->set_winner();\n }else{\n $this->game->update_turn();\n $this->game->set_winner();\n }\n }",
"abstract protected function putPlayersInDuel(): void;",
"public function testProfilePrototypeUpdateByIdOwnedGroups()\n {\n\n }",
"public function setPlayer(Down_UserSummary $value)\n {\n return $this->set(self::_PLAYER, $value);\n }",
"public function setPlayer(Down_UserSummary $value)\n {\n return $this->set(self::_PLAYER, $value);\n }",
"public function runGame()\n {\n $currentGame = $this->find('all')->where([\n 'complete' => false\n ])->contain(['Users'])->first();\n\n //get all the plays counts\n $gamesUsersTable = TableRegistry::get('GamesUsers');\n $currentGameCheckedCount = $gamesUsersTable->find();\n $currentGameCheckedCount = $currentGameCheckedCount->select([\n 'count' => $currentGameCheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->first()->count;\n\n $currentGameUncheckedCount = $gamesUsersTable->find();\n $currentGameUncheckedCount = $currentGameUncheckedCount->select([\n 'count' => $currentGameUncheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->first()->count;\n\n $totalPlays = $currentGameCheckedCount + $currentGameUncheckedCount;\n\n //If not enough players, extend the end time and bail;\n if ($totalPlays < 2) {\n $currentGame->end_time = Time::now()->addHour(1);\n $this->save($currentGame);\n return false;\n }\n\n //update current game fields\n $currentGame->total_checked = $currentGameCheckedCount;\n $currentGame->total_plays = $totalPlays;\n $currentGame->ratio = round((float)$currentGameCheckedCount / (float)$totalPlays, 2);\n\n //save game as 'complete'\n $currentGame->complete = true;\n $this->save($currentGame);\n\n //get all the users that played this round\n $usersTable = TableRegistry::get('Users');\n $usersWhoCheckedThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->toArray();\n $currentGameCheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoCheckedThisGameIdArray) ? $usersWhoCheckedThisGameIdArray : [0])\n ]);\n\n $usersWhoDidntCheckThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->toArray();\n $currentGameUncheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoDidntCheckThisGameIdArray) ? $usersWhoDidntCheckThisGameIdArray : [0])\n ]);\n\n\n //update users scores\n foreach ($currentGameCheckedUsers as $user) {\n if ($currentGame->ratio > 0.5) {\n if ($user->score != 0) {\n $user->score = (int)$user->score - 10;\n }\n } else {\n $user->score = (int)$user->score + 10;\n }\n $usersTable->save($user);\n }\n\n //create next incomplete game & save\n $this->createNewGame();\n\n //send notification emails to everybody that gained/lost points\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => true,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameCheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n\n //send email to everybody who played but didn't check\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => false,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameUncheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n }",
"function st_setupMinigame()\n {\n self::incGameStateValue('minigame', 1);\n $minigame = self::getGameStateValue('minigame');\n\n self::setGameStateValue('minigame_round', 1);\n self::setStat(1, \"rounds_{$minigame}\");\n self::setGameStateValue('points_winnable', 7);\n self::DbQuery(\"UPDATE `player` SET `player_solved_in_round` = NULL\");\n\n // Get all cards, sort into piles, shuffle piles.\n $this->cards->moveAllCardsInLocation(null, \"offtable\");\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('evidence'), 'id'), 'deck');\n $this->cards->shuffle('deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('crime'), 'id'), 'crime_deck');\n $this->cards->shuffle('crime_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('location'), 'id'), 'location_deck');\n $this->cards->shuffle('location_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('suspect'), 'id'), 'suspect_deck');\n $this->cards->shuffle('suspect_deck');\n\n // Get all tiles, shuffle them in two decks, associate them with\n // location slots. Decks are called \"cri_tile_d\" (crime tile deck) and\n // \"sus_tile_d\" (suspect tile deck). VARCHAR(16) ftw!\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_crime'), 'id'), 'cri_tile_d');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_suspect'), 'id'), 'sus_tile_d');\n $this->cards->shuffle('cri_tile_d');\n $this->cards->shuffle('sus_tile_d');\n foreach($this->locations as $loc_id => $loc) {\n $this->cards->pickCardForLocation('cri_tile_d', 'locslot', $loc['slots']['crime']['id']);\n $this->cards->pickCardForLocation('sus_tile_d', 'locslot', $loc['slots']['suspect']['id']);\n\n // Get the specific location tile (also currently 'offboard') and\n // put it into its fixed location slot.\n //\n // (28 + $loc_id) is the \"material id\" aka type_arg of the fake\n // location tile.\n $temp = $this->cards->getCardsOfType('tile_location', 28 + $loc_id); // required, as array_shift does not want a direct reference\n $location_tile = array_shift($temp);\n $this->cards->moveCard($location_tile['id'], 'locslot', $loc['slots']['location']['id']);\n }\n\n // Main display of evidence cards\n $this->cards->pickCardsForLocation($this->constants['EVIDENCE_DISPLAY_SIZE'], 'deck', 'evidence_display');\n\n // Investigators that have been used go back to the box.\n $used_investigators = $this->tokens->getTokensOfTypeInLocation('pi_%', 'agentarea_%');\n if ($used_investigators) {\n $this->tokens->moveTokens(array_pluck($used_investigators, 'key'), 'box');\n }\n\n // Set up a case for every player and distribute the case cards to their\n // right neighbor.\n $players = self::loadPlayersBasicInfos();\n foreach($players as $player_id => $player) {\n $this->cards->pickCard('crime_deck', $player_id);\n $this->cards->pickCard('location_deck', $player_id);\n $this->cards->pickCard('suspect_deck', $player_id);\n\n // Give their tokens\n $color = $this->constants['HEX2COLORNAME'][$player['player_color']];\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"cube_{$color}_%\"), 'key'),\n \"cubes_{$player_id}\");\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"disc_{$color}_%\"), 'key'),\n \"discs_{$player_id}\");\n }\n\n // Trigger clean up in frontend. Sending only tokens that are to be\n // moved away.\n self::notifyAllPlayers(\"cleanBoard\", \"\", array(\n 'tokens' => array_values(array_merge(\n $this->tokens->getTokensInLocation('box'),\n $this->tokens->getTokensInLocation('offtable'),\n $this->tokens->getTokensInLocation('cubes_%'),\n $this->tokens->getTokensInLocation('discs_%')\n ))\n ));\n $this->notifyAnimate();\n\n $this->gamestate->nextState(); // start minigame\n }"
]
| [
"0.5759811",
"0.5340348",
"0.52983654",
"0.5203056",
"0.51844317",
"0.51810324",
"0.51652664",
"0.51643074",
"0.514527",
"0.5137998",
"0.51322",
"0.5093528",
"0.49861553",
"0.49640495",
"0.49418867",
"0.49408394",
"0.4936616",
"0.49302822",
"0.49148554",
"0.4906178",
"0.48999035",
"0.4882934",
"0.4866244",
"0.48500732",
"0.48479468",
"0.48467478",
"0.48418543",
"0.48418543",
"0.4836915",
"0.48344755"
]
| 0.5355357 | 1 |
This method returns to us a game given a title. | public function findGameByTitle($title)
{
$title = htmlspecialchars(trim($title), ENT_COMPAT, 'UTF-8', false);
$result = $this->fetchOne(array('title'=>$title));
if (!empty($result)) {
return $result;
}
// Nope..., not here bud!
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getGame() {\n if (!isset($this->params['game'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n\n $key = $this->params['game'];\n $game = new SnGames();\n\t\t$url = Url::getUrlByName($key, URL_GAME);\n\n\t\tif ($url) {\n\t\t\t$game->ID_GAME = $url->ID_OWNER;\n\t\t} else {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn FALSE;\n\t\t}\n\n $game = $game->getOne();\n\n return $game;\n }",
"public function title() {\n\t\treturn $this->hasOne('App\\Models\\GameTitle', 'id', 'game_title_id');\n\t}",
"public function getById(Uuid $gameId): Game;",
"function getOpenGame() {\n\t$games = getGames();\n\tif (isset($games['open']) and $games[$games['open']]['state'] == 'open') {\n\t\treturn $games['open'];\n\t} else {\n\t\treturn newGame();\n\t}\n}",
"public function getGame(): Game\n {\n return $this->client->getGame($this->gameVersion->getGameId());\n }",
"public function GetGame($gameName)\r\n\t{\r\n\t\tif($this->LoadGame($gameName) != null)\r\n\t\t{\r\n\t\t\treturn new $gameName();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public function getGame()\n {\n return $this->game;\n }",
"public function getByTitle()\n {\n }",
"public function getGame() {\n return $this->game;\n }",
"private function getBoardGame($bggName){\n $resp = $this->bggApi->SearchForBgg($bggName);\n if($resp){\n $bgg = [ 'id' => $resp['boardgame'][0]['@attributes']['objectid'],\n 'title' => $resp['boardgame'][0]['name'] ];\n\n if ($bgg['id'] == null){\n $bgg['id'] = $resp['boardgame']['@attributes']['objectid'];\n }\n if ($bgg['title'] == null){\n $bgg['title'] = $resp['boardgame']['name'];\n }\n return $bgg;\n }\n else {\n return false;\n }\n\n }",
"public function game()\n {\n return $this->game;\n }",
"public function playgameActionGet() : object\n {\n $title = \"Guessing game\";\n\n $data = [\n \"diceGame\" => $this->app->session->get(\"dice\")\n ];\n\n $this->app->page->add(\"dice100/play-dice\", $data);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"public function show(Title $title)\n {\n //\n return $title;\n }",
"public function loadGame($id){\n\t\t$this->game = new Game($id);\n\t\treturn $this->game;\n\t}",
"function getGame($id) {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games WHERE id = :id\");\n $query->bindParam(\":id\", $id);\n $query->execute();\n\n return $query->fetch();\n }",
"private function titleGuess(): string {\n $collaboration = $this->containsCollaboration($this->title);\n return $collaboration;\n }",
"private function findGame($id) {\n $game = null;\n foreach($this->getGames() as $currentGame) {\n if($currentGame->getAppId() == $id ||\n $currentGame->getShortName() == $id ||\n $currentGame->getName() == $id) {\n $game = $currentGame;\n break;\n }\n }\n\n if($game == null) {\n if(is_int($id)) {\n $message = \"This SteamID does not own a game with application ID {$id}.\";\n } else {\n $message = \"This SteamID does not own the game \\\"{$id}\\\".\";\n }\n throw new SteamCondenserException($message);\n }\n\n return $game;\n }",
"public function show(Game $game)\n {\n return new GameResource($game);\n }",
"function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}",
"public function get($title)\n {\n return isset($this->collection[$title]) ? $this->collection[$title] : null;\n }",
"private function createGame()\n {\n $hash = hash(\"md5\", uniqid(mt_rand(), true));\n $temphash = hash(\"md5\", uniqid(mt_rand(), true));\n\n // array with values to be inserted to the table\n $game = array(\n 'player1_hash' => $hash,\n 'player1_name' => \"Player 1\",\n 'player1_ships' => \"\",\n 'player2_hash' => $temphash,\n 'player2_name' => \"Player 2\",\n 'player2_ships' => \"\",\n 'timestamp' => Misc::getUtcTime()->getTimestamp()\n );\n\n $query = \"INSERT INTO games (player1_hash, player1_name, player1_ships,\n player2_hash, player2_name, player2_ships, timestamp)\n VALUES (?, ?, ?, ?, ?, ?, ?)\";\n $this->oDB->getAll($query, array_values($game));\n\n $game['player_number'] = 1; // player who starts is always No. 1\n $game['id'] = $this->oDB->lastInsertId();\n\n return $game;\n }",
"public function show($id)\n {\n return Game::find($id);\n }",
"public function getBook($title) \n {\n // in a real life scenario this will be done through a db select command \n $allBooks = $this->getBookList(); \n return $allBooks[$title]; \n }",
"public static function title( $title )\r\n {\r\n return array_search ( $title, self::choices() );\r\n }",
"private function _serviceadd($title)\r\n\t{\r\n\t\t// Check to see if we already have this entry.\r\n\t\t$games = ServiceApi::getGames();\r\n\t\tif (!empty($games) && count($games)) {\r\n\t\t\tforeach ($games as $game) {\r\n\t\t\t\tif ($game->title == $title) return false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tServiceApi::addGame($title);\r\n\t\treturn true;\r\n\t}",
"protected function createGame($data = null)\n {\n $generator = new Generator();\n if ($data) {\n $game = $generator->createGameFromVisualBlock($data);\n }\n else {\n $game = $generator->createGame();\n }\n $game->setStatus(Game::STARTED);\n return $game; \n }",
"public function getBook($title)\n\t{\n\t\t// in a real life scenario this will be done through a db select command\n\t\t$allBooks = $this->getBookList();\n\t\treturn $allBooks[$title];\n\t}",
"public function getGame($id)\n {\n $games_list = $this->getGamesList();\n foreach ($games_list as $key => $value) {\n if ($value->id == $id)\n return $value;\n }\n }",
"function game()\r\n {\r\n return $this->Game;\r\n }",
"public function playActionGet() : object\n {\n $title = \"Guessing game\";\n $data = [];\n\n $this->app->page->add(\"dice100/play\", $data);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }"
]
| [
"0.6788305",
"0.6240881",
"0.60855967",
"0.6022973",
"0.59908634",
"0.5945933",
"0.58170986",
"0.57282376",
"0.572054",
"0.5708681",
"0.56872356",
"0.5654858",
"0.5639713",
"0.5620209",
"0.55793685",
"0.5576336",
"0.5539285",
"0.55269474",
"0.5491251",
"0.5465872",
"0.54308057",
"0.5373933",
"0.5372041",
"0.53593546",
"0.5350586",
"0.53377795",
"0.53332025",
"0.5323515",
"0.5307929",
"0.53005284"
]
| 0.7333656 | 0 |
This method performs a sync with the games database from the Nerdery service database. Using this method ensures we are always getting the latest games from the web service and that we are not just using cache results. I've mentioned this a few times already that I hope this is acceptable due to my first couple of days restraints. When offline mode is turned 'off' we use SQLite purely as a way to sort and do some Ajaxy stuff. | private function sync()
{
// Check if we're in offline mode.
if (XBOXAPP_OFFLINE === true) return false;
// If we were in offline mode I'd go ahead and add all the games that were not
// added to the service by checking if sync = 0. This was mainly if I was working
// without the internet or if for some reason the Nerdery service was down for some
// period of time. I'm not sure how useful this will be but I've implemented for fun.
$unsyncedGames = parent::fetch(array('sync' => 0));
while ($game = $unsyncedGames->fetchArray())
{
ServiceApi::addGame($game['title']);
// This doesn't work well with games the owning part... There's no elegant way to do it
// other than grabbing the list and setting them to owned. boooo! This is for testing
// mostly so I'll just skip it since this case will never really exist.
// This goes also for the votes in offline mode... they don't transfer over in this implementation.
// None of these issues would be hard to implement really...
// Essentially, no votes or owned games will be synced, only the titles.
}
// Clear out our current games since they are at this point, invalid!
parent::clear();
// Get the games from the service call and readd them to our sqlite3 database.
$games = ServiceApi::getGames();
if (!empty($games) && count($games)) {
foreach ($games as $game) {
$this->_dbadd($game->title, 1, $game->id, $game->votes, ($game->status === 'gotit' ? 1 : 0));
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function serverSync() {\n\n\t\t// get current players on the server ...\n\t\t$this->client->query('GetPlayerList', 100, 0);\n\t\t$response['playerlist'] = $this->client->getResponse();\n\n\t\t// get game version the server runs on ...\n\t\t$this->client->query('GetVersion');\n\t\t$response['version'] = $this->client->getResponse();\n\n\t\t$this->client->query('GetCurrentGameInfo');\n\t\t$response['gameinfo'] = $this->client->getResponse();\n\n\t\t$this->client->query('GetStatus');\n\t\t$response['status'] = $this->client->getResponse();\n\n\t\t// update player list ...\n\t\tif (!empty($response['playerlist'])) {\n\t\t\tforeach ($response['playerlist'] as $player) {\n\t\t\t \n\t\t\t\t// PRELOAD\n\t\t\t\t// create player object of every player response ...\n\t\t\t\t$player_item = new Player($player);\n\t\t\t\t$player_item->mistral['displayPlayerInfo']=true;\n\n\t\t\t\t// add player object to player list ...\n\t\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t\t// GET ALL INFOS LATER - wtf no wins \n//\t\t\t\t$this->addCall('GetPlayerInfo', array($player['Login']), '', 'initPlayer');\n\t\t\t \n\t\t\t\t// NO RASPWAY\n//\t\t\t\t$this->playerConnect(array($player['Login'], ''));\t\t\t\t\t// fake it into thinking it's a connecting player, it gets team & ladder info this way\n\t\t\t}\n\t\t}\n\n\t\t// get game ...\n\t\t$this->server->game = $response['version']['Name'];\n\n\t\t// get mode ...\n\t\t$this->server->gameinfo = new Gameinfo($response['gameinfo']);\n\n\t\t// get status ...\n\t\t$this->server->status = $response['getstatus']['Code'];\n\n\t\t// get trackdir\n\t\t$this->client->query('GetTracksDirectory');\n\t\t$this->server->trackdir = $this->client->getResponse();\n\t\t// throw new synchronisation event ...\n\t\t$this->releaseEvent('onSync', array());\n\t}",
"public function run_online()\r\n\t{\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE (`last_sync_date`='0000-00-00' OR DATE_ADD(`last_sync_date`, INTERVAL `sync_period` DAY)<'\".date(\"Y-m-d H:i:s\").\"') AND `enabled`>='1'\";\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\t\t\t\r\n\t\t\tif(trim($wplrets->mls_server_data->mls_unique_field) == '') continue;\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\t\t\t\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\t\t\t\r\n\t\t\tif(!empty($mls_query->selects)) $options = array('Count'=>1, 'Offset'=>$mls_query->offset, 'Select'=>$mls_query->selects);\r\n else $options = array('Count'=>1, 'Offset'=>$mls_query->offset);\r\n\t\t\t\r\n\t\t\t/** set query **/\r\n\t\t\t$mls_query_string = $mls_query->query;\r\n\t\t\t$date1 = ($mls_query->last_sync_date == '0000-00-00' ? date('Y-m-01') : $mls_query->last_sync_date);\r\n\t\t\t$date2 = date('Y-m-d', strtotime('+'.$mls_query->sync_period.' day', strtotime($date1)));\r\n\t\t\t\r\n\t\t\tif(strstr($mls_query_string, 'dateT') != '')\r\n\t\t\t{\r\n\t\t\t\t$mls_query_string = str_replace('dateT', $date1.'T00:00:00-'.$date2.'T', $mls_query_string);\r\n\t\t\t\t$mls_query_string = str_replace($date2.'T00:00:00+', $date2.'T00:00:00', $mls_query_string);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$mls_query_string = str_replace('date+', $date1.'-'.$date2, $mls_query_string);\r\n\r\n\t\t\t$search = $wplrets->rets->SearchQuery($wplrets->mls_server_data->resource, $mls_query->mls_class_id, $mls_query_string, $options);\r\n\t\t\t$count = $wplrets->rets->TotalRecordsFound();\r\n\t\t\t\r\n\t\t\tif(!$count and wpl_request::getVar('rets_cron_job') != 1) continue;\r\n\t\t\t\r\n\t\t\t$results = array();\r\n\t\t\twhile($row = $wplrets->rets->FetchRow($search)) $results[$row[$wplrets->mls_server_data->mls_unique_field]] = $row;\r\n\t\t\t$wplrets->rets->FreeResult($search);\r\n\r\n\t\t\t/** map data **/\r\n\t\t\t$mapped = $wplrets->map($results, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** import properties **/\r\n\t\t\t$pids = $wplrets->import_mapped_data($mapped, $mls_query->id, '', $mls_query_string);\r\n\t\t\t\r\n\t\t\t/** download images **/\r\n\t\t\tif(trim($mls_query->images)) $wplrets->import_properties_images($pids, $mls_query->mls_server_id, $mls_query->images, false);\r\n\t\t\t\r\n\t\t\t/** finalizing properties **/\r\n\t\t\tforeach($pids as $pid) $wplrets->finalize($pid);\r\n\t\t\t\r\n\t\t\t/** update **/\r\n\t\t\tif($count <= $mls_query->limit+$mls_query->offset) self::mls_query_is_done($mls_query->id, $date2);\r\n\t\t\telse self::update_query($mls_query->id, ($mls_query->offset+$mls_query->limit));\r\n\t\t\t\r\n\t\t\t//Remove Expired Listings\r\n\t\t\t$mls_query_fetch_listings = str_replace('date+', '2000-01-01+', $mls_query->query);\r\n\r\n\t\t\t$offset_checked = 0;\r\n\r\n\t\t\t$result = self::fetch_class_listings($wplrets, $mls_query->mls_class_id, $mls_query_fetch_listings, $offset_checked);\r\n\r\n\t\t\tif(self::all_properties_retrieved(count($result), 100) and $offset_checked)\r\n\t\t\t{\r\n\t\t\t\t$division_factor = count($result);\r\n\t\t\t\twhile(self::all_properties_retrieved(count($result), $division_factor))\r\n\t\t\t\t{\r\n\t\t\t\t\t$offset_delete = count($result)+1;\r\n\t\t\t\t\t$second_array = self::fetch_class_listings($wplrets, $mls_query->mls_class_id, $mls_query_fetch_listings, $offset_checked, $offset_delete);\r\n\t\t\t\t\t$result = array_merge($result, $second_array);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$wpl_unique_field = wpl_addon_mls::get_wpl_unique_field($mls_query->id,$mls_query->mls_server_id);\r\n\r\n\t\t\tif(count($result) > 0)\r\n\t\t\t{\r\n\t\t\t\t$where = \"WHERE `mls_query_id`='\".$mls_query->id.\"' AND `\".$wpl_unique_field['table_column'].\"` NOT IN('\".implode(\"','\", $result).\"');\";\r\n\t\t\t\t$query_delete = \"SELECT `id` from `#__wpl_properties` \".$where;\r\n\t\t\t\t$expired_properties = wpl_db::select($query_delete);\r\n\r\n\t\t\t\tforeach($expired_properties as $expired_property) wpl_property::purge($expired_property->id);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/** Disconnect **/\r\n\t\tif(isset($wplrets)) $wplrets->rets->Disconnect();\r\n \r\n /** Delete expired temporary directories **/\r\n wpl_global::delete_expired_tmp();\r\n \r\n /** cPanel cronjob **/\r\n if(wpl_request::getVar('rets_cron_job') == 1) exit;\r\n\t}",
"function Sync() {\r\n \tif (count($this->sync) == 0) {\r\n \t$this->RaiseError('No Sync Databases defined. Use AddSyncDatabase() to add Sync Databases.');\r\n }\r\n for ($i = 0; $i < count($this->sync); $i++) {\r\n \t$this->SyncDatabases($this->home, $this->sync[$i]);\r\n }\r\n\r\n return true;\r\n }",
"protected function initDB() {\r\n\r\n $qry = $this->getMain()->getDatabase()->get(\"*\", [\"table\" => \"Games\", \"name\" => $this->getName()]);\r\n\r\n if($qry instanceof \\SQLite3Result) {\r\n\r\n if($qry->num_rows == 0) { // Game not initiated in the db.\r\n\r\n $id = $this->getMain()->getDatabase()->get(\"*\", [\"table\" => \"Games\"]);\r\n\r\n $v3 = $this->getLevel()->getSafeSpawn();\r\n\r\n $v3Ser = $v3->x . \",\" . $v3->y . \",\" . $v3->z; // V32String\r\n\r\n $this->getMain()->getDatabase()->insert(\"Games\", [$this->getName(), $v3Ser, $v3Ser, $this->getMain()->getMaxPlayers(), $this->getMain()->getWaitTime(), $this->getMain()->getSeekTime(), $this->getMain()->getSeekersPercentage(), $id->num_rows+1]); // Inserting the db with new queries\r\n\r\n }\r\n\r\n } else {\r\n\r\n throw new \\Exception(\"Could not contact database.\");\r\n\r\n }\r\n\r\n }",
"public function sync();",
"public function sync();",
"private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }",
"public function run_offline()\r\n\t{\r\n\t\t$ids = wpl_request::getVar('rets_query_ids');\r\n\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE `enabled`>='1'\";\r\n\t\tif(is_numeric(str_replace(',', '', $ids))) $query .= \" AND `id` IN ({$ids})\";\r\n\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t$ids = wpl_db::select(\"SELECT `unique_value` FROM `#__wpl_addon_mls_data` WHERE `mls_query_id` = '{$mls_query->id}'\", 'loadColumn');\r\n\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\t\t\t\r\n\t\t\tif(trim($wplrets->mls_server_data->mls_unique_field) == '') continue;\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\t\t\t\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\t\t\t\r\n if(!empty($mls_query->selects)) $options = array('Count'=>1, 'Offset'=>$mls_query->offset, 'Select'=>$mls_query->selects);\r\n else $options = array('Count'=>1, 'Offset'=>$mls_query->offset);\r\n \r\n\t\t\t$today = date('Y-m-d H:i:s');\r\n\t\t\t\r\n\t\t\t/** set query **/\r\n\t\t\t$mls_query_string = $mls_query->query;\r\n\t\t\t$date = ($mls_query->last_sync_date == '0000-00-00' ? date('1950-01-01') : $mls_query->last_sync_date);\r\n $date2 = date('Y-m-d', strtotime('+'.$mls_query->sync_period.' day', strtotime($date)));\r\n\t\t\t\r\n if(stristr($mls_query_string, 'date+s'))\r\n {\r\n if($date2 > $today) continue;\r\n \r\n $mls_query_string = str_replace('date+s', $date.'-'.$date2, $mls_query_string);\r\n $today = date('Y-m-d H:i:s', strtotime($date2));\r\n }\r\n else $mls_query_string = str_replace('date+', $date.'+', $mls_query_string);\r\n\r\n\t\t\t$search = $wplrets->rets->SearchQuery($wplrets->mls_server_data->resource, $mls_query->mls_class_id, $mls_query_string, $options);\r\n\t\t\t$count = $wplrets->rets->TotalRecordsFound();\r\n\t\t\t\r\n\t\t\tif($wplrets->rets->Error() and false === stristr($mls_query->query, 'date+s')) print_r($wplrets->rets->Error());\r\n\t\t\tif(!$count and false === stristr($mls_query->query, 'date+s'))\r\n\t\t\t{\r\n\t\t\t\tself::mls_query_is_done($mls_query->id, $today);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t$num = 0;\r\n\t\t\twhile($row = $wplrets->rets->FetchRow($search)) \r\n\t\t\t{\r\n\t\t\t\t$unique_value = $row[$wplrets->mls_server_data->mls_unique_field];\r\n\t\t\t\t$data = base64_encode(json_encode($row));\r\n\t\t\t\t\r\n\t\t\t\tif(in_array($unique_value, $ids))\r\n\t\t\t\t\twpl_db::q(\"UPDATE `#__wpl_addon_mls_data` SET `content` = '{$data}', `date` = '{$today}', `imported` = 0 WHERE `unique_value` = '{$unique_value}' AND `mls_query_id` = '{$mls_query->id}'\");\r\n\t\t\t\telse\r\n\t\t\t\t\twpl_db::q(\"INSERT INTO `#__wpl_addon_mls_data` (`mls_query_id`, `unique_value`, `content`, `date`) VALUES ('{$mls_query->id}', '{$unique_value}', '{$data}', '{$today}')\");\r\n\r\n\t\t\t\t$ids[] = $unique_value;\r\n\t\t\t\t$num++;\r\n\t\t\t}\r\n\t\t\t$wplrets->rets->FreeResult($search);\r\n\t\t\t\r\n\t\t\t/** update **/\r\n\t\t\tif($count <= $num) self::mls_query_is_done($mls_query->id, $today);\r\n\t\t\telse self::update_query($mls_query->id, ($mls_query->offset+$num));\r\n\t\t\t\r\n\t\t\t// Remove Expired Listings\r\n\t\t\t$offset_checked = 0;\r\n \r\n\t\t\tif(stristr($mls_query->query, 'date+s')) $mls_query_fetch_listings = str_replace('date+s', '1950-01-01+', $mls_query->query);\r\n\t\t\telse $mls_query_fetch_listings = str_replace('date+', '1950-01-01+', $mls_query->query);\r\n \r\n\t\t\t$result = self::fetch_class_listings($wplrets, $mls_query->mls_class_id, $mls_query_fetch_listings, $offset_checked);\r\n\t\t\t$wpl_unique_field = wpl_addon_mls::get_wpl_unique_field($mls_query->id,$mls_query->mls_server_id);\r\n\r\n\t\t\tif(count($result) < $count)\r\n\t\t\t{\r\n\t\t\t\t$offset = 0;\r\n\t\t\t\twhile(count($result) > $offset and count($result) < $count)\r\n\t\t\t\t{\r\n\t\t\t\t\t$offset = count($result);\r\n\t\t\t\t\t$second_array = self::fetch_class_listings($wplrets, $mls_query->mls_class_id, $mls_query_fetch_listings, 1, $offset);\r\n\t\t\t\t\t$result = array_merge($result, $second_array);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(count($result) > 0)\r\n\t\t\t{\r\n\t\t\t\t$result = implode(\"','\", $result);\r\n\r\n\t\t\t\t$where = \"WHERE `mls_query_id`='\".$mls_query->id.\"' AND `\".$wpl_unique_field['table_column'].\"` NOT IN('{$result}');\";\r\n\t\t\t\t$query_delete = \"SELECT `id` from `#__wpl_properties` \".$where;\r\n\t\t\t\t$expired_properties = wpl_db::select($query_delete);\r\n\t\t\t\t\r\n\t\t\t\tforeach($expired_properties as $expired_property) wpl_property::purge($expired_property->id);\r\n\t\t\t\twpl_db::delete('wpl_addon_mls_data', '', \"AND `mls_query_id` = '{$mls_query->id}' AND `unique_value` NOT IN('{$result}')\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/** Disconnect **/\r\n\t\tif(isset($wplrets)) $wplrets->rets->Disconnect();\r\n \r\n /** Delete expired temporary directories **/\r\n wpl_global::delete_expired_tmp();\r\n \r\n /** cPanel cronjob **/\r\n if(wpl_request::getVar('rets_cron_job') == 1) exit;\r\n\t}",
"public function updateDatabase(){\n $api_response = Http::get(config('urls.api'));\n //Place in database\n $this->postToDatabase($api_response);\n }",
"function determineNextGame( $gameID, $teamID, $winnerOrLoser ) {\n\n/* ... get the details for the game just played */\n $gameDetails = $this->getGameDetails( $gameID );\n \n/* ... get the details for the next game using the proper flow */\n if ($winnerOrLoser == \"WINNER\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['WinnerNextGame'] );\n }\n else {\n if ($gameDetails['LoserNextGame'] != \"\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['LoserNextGame'] );\n }\n else {\n return( -1 );\n }\n }\n \n/* ... if we have a game to update, then figure out what to change and do it */\n if (count( $nextGameDetails ) > 0) {\n $dbData = array();\n $division = substr( $gameDetails['TournamentID'], 0, 1 );\n \n/* ... if the Home Team hasn't been set, then put the winner in as the home team for now */ \n if ($nextGameDetails['HomeTeamID'] == NULL) {\n $dbData = array(\n \"GameID\" => $nextGameDetails['GameID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n\n/* ... determine who should be the home team from the 2 teams now known for the game */\n if ($this->_whoIsBetterSeed( $teamID, $nextGameDetails['HomeTeamID'], $division ) == $teamID) {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $nextGameDetails['HomeTeamID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $teamID\n );\n }\n }\n\n/* ... time to update the database */\n $this->saveGameResult( $nextGameDetails['GameID'], $dbData );\n\n }\n\n/* ... time to go */\n return( $dbData['GameID'] );\n }",
"function serverSync() {\n\n\t\t// check server build\n\t\tif (strlen($this->server->build) == 0 ||\n\t\t ($this->server->getGame() == 'MP' && strcmp($this->server->build, MP_BUILD) < 0)) {\n\t\t\ttrigger_error(\"Obsolete server build '\" . $this->server->build . \"' - must be at least '\" . MP_BUILD . \"' !\", E_USER_ERROR);\n\t\t}\n\n\t\t// get server id, login, nickname, zone & packmask\n\t\t$this->server->isrelay = false;\n\t\t$this->server->relaymaster = null;\n\t\t$this->server->relayslist = array();\n\t\t$this->server->gamestate = Server::RACE;\n\t\t$this->server->packmask = '';\n\t\t$this->client->query('GetSystemInfo');\n\t\t$response['system'] = $this->client->getResponse();\n\t\t$this->server->serverlogin = $response['system']['ServerLogin'];\n\n\t\t$this->client->query('GetDetailedPlayerInfo', $this->server->serverlogin);\n\t\t$response['info'] = $this->client->getResponse();\n\t\t$this->server->id = $response['info']['PlayerId'];\n\t\t$this->server->nickname = $response['info']['NickName'];\n\t\t$this->server->zone = substr($response['info']['Path'], 6); // strip 'World|'\n\n\t\t$this->client->query('GetLadderServerLimits');\n\t\t$response['ladder'] = $this->client->getResponse();\n\t\t$this->server->laddermin = $response['ladder']['LadderServerLimitMin'];\n\t\t$this->server->laddermax = $response['ladder']['LadderServerLimitMax'];\n\n\t\t$this->client->query('IsRelayServer');\n\t\t$this->server->isrelay = ($this->client->getResponse() > 0);\n\t\tif ($this->server->isrelay) {\n\t\t\t$this->client->query('GetMainServerPlayerInfo', 1);\n\t\t\t$this->server->relaymaster = $this->client->getResponse();\n\t\t}\n\n\t\t// get MP packmask\n\t\t$this->client->query('GetServerPackMask');\n\t\t$this->server->packmask = $this->client->getResponse();\n\n\t\t// clear possible leftover ManiaLinks\n\t\t$this->client->query('SendHideManialinkPage');\n\n\t\t// get mode & limits\n\t\t$this->client->query('GetCurrentGameInfo', 1);\n\t\t$response['gameinfo'] = $this->client->getResponse();\n\t\t$this->server->gameinfo = new Gameinfo($response['gameinfo']);\n\n\t\t// get status\n\t\t$this->client->query('GetStatus');\n\t\t$response['status'] = $this->client->getResponse();\n\t\t$this->currstatus = $response['status']['Code'];\n\n\t\t// get game & mapdir\n\t\t$this->client->query('GameDataDirectory');\n\t\t$this->server->gamedir = $this->client->getResponse();\n\t\t$this->client->query('GetTracksDirectory');\n\t\t$this->server->mapdir = $this->client->getResponse();\n\n\t\t// get server name & options\n\t\t$this->getServerOptions();\n\n\t\t// throw 'synchronisation' event\n\t\t$this->releaseEvent('onSync', null);\n\n\t\t// get current players/servers on the server (hardlimited to 300)\n\t\t$this->client->query('GetPlayerList', 300, 0, 2);\n\t\t$response['playerlist'] = $this->client->getResponse();\n\n\t\t// update players/relays lists\n\t\tif (!empty($response['playerlist'])) {\n\t\t\tforeach ($response['playerlist'] as $player) {\n\t\t\t\t// fake it into thinking it's a connecting player:\n\t\t\t\t// it gets team & ladder info this way & will also throw an\n\t\t\t\t// onPlayerConnect event for players (not relays) to all plugins\n\t\t\t\t$this->playerConnect(array($player['Login'], ''));\n\t\t\t}\n\t\t}\n\t}",
"function syncDatabaseAndNotifyAction()\n {\n # $this->basicAuthentication('webservices');\n $sl = $this->getServiceLocator();\n\n set_time_limit(0);\n\n $config = $sl->get('config');\n $domain = $this->_params('domain');\n\n try\n {\n if(empty($domain))\n {\n throw new \\Exception(\"Invalid call to the webservice. No domain name provided\");\n }\n\n\n $dbClient = $sl->get('App\\Db\\Client');\n $dbDatabase = $sl->get('App\\Db\\Database');\n\n $clients = $dbClient->findBy(function($where) use($domain) {\n $where->equalTo('domain', $domain);\n }, array(), 'id asc');\n\n // lest just find the first user of the domain\n $client = $clients->current();\n\n if(!$client)\n {\n throw new \\Exception(\"Client with domain $domain not found.\");\n }\n\n if($client->deleted)\n {\n throw new \\Exception(\"Client #{$client->id} with domain $domain is deleted. The confirmation email was not send.\");\n }\n\n if($client->email_verified)\n {\n throw new \\Exception(\"Client #{$client->id} with domain $domain is already verified. The confirmation email was not send.\");\n }\n\n $databases = $dbDatabase->findDatabaseByClientId($client->id);\n if(!$databases->count())\n {\n throw new \\Exception(\"No database assigned to client #{$client->id} with domain $domain. The confirmation email was not send.\");\n }\n\n\n //\n if('backend' != $client->created_from)\n {\n ;\n }\n\n\n\n $lang = $client->lang;\n /////////////////////////////////////////////\n # sync databases\n ///////////////////////////////////////////// \n\n // get the list of tables from the path\n $pathSchema = $config['freemium']['path']['master_freemium_schema'][$lang];\n $currentTables = array();\n foreach(glob(\"$pathSchema/*.sql\") as $item)\n {\n $info = pathinfo($item);\n $tableName = $info['filename'];\n $currentTables[$tableName] = $item;\n }\n \n foreach ($databases as $database)\n {\n $tablesToCreate = array();\n $instanceTables = array();\n \n $databaseName = $database->db_name;\n $host = $database->db_host;\n $username = $database->db_user;\n $password = $database->db_password;\n $instanceAdapter = $this->_getInstanceAdapter($databaseName, $host, $username, $password);\n\n $sql = 'show tables';\n $rowset = $instanceAdapter->query($sql)->execute();\n foreach ($rowset as $row)\n {\n $tabelName = current($row);\n $instanceTables[$tabelName] = $tabelName;\n }\n\n foreach ($currentTables as $key => $item)\n {\n if(!isset($instanceTables[$key]))\n {\n $tablesToCreate[$key] = $item;\n }\n }\n\n foreach ($tablesToCreate as $item)\n {\n $sql = file_get_contents($item);\n $instanceAdapter->query($sql)->execute();\n }\n }\n\n /////////////////////////////////////////////\n # send the confirmation email to the user\n /////////////////////////////////////////////\n\n // prepare the verification code\n $cPassword = new Com\\Crypt\\Password();\n $plain = $client->email;\n $code = $cPassword->encode($plain);\n\n $request = $sl->get('request');\n $uri = $request->getUri();\n $serverUrl = \"{$uri->getScheme()}://{$uri->getHost()}\";\n \n $routeParams = array();\n $routeParams['action'] = 'verify-account';\n $routeParams['code'] = $code;\n $routeParams['email'] = $client->email;\n \n $viewRenderer = $sl->get('ViewRenderer');\n $url = $serverUrl . $viewRenderer->url('auth/wildcard', $routeParams);\n \n // preparing some replacement values\n $data = array();\n $data['follow_us'] = $this->_('follow_us', array(), 'default', $lang);\n $data['body'] = $this->_('confirm_your_email_address_body', array(\n $url,\n ), 'default', $lang);\n $data['header'] = '';\n \n // load the email template and replace values\n $mTemplate = $sl->get('App\\Model\\EmailTemplate');\n \n $langString = '';\n if('es' == $lang)\n {\n $langString = \"_$lang\";\n }\n \n $arr = $mTemplate->loadAndParse(\"common{$langString}\", $data);\n \n //\n $mailer = new Com\\Mailer();\n \n // prepare the message to be send\n $message = $mailer->prepareMessage($arr['body'], null, $this->_('confirm_your_email_address_subject', array(), 'default', $lang));\n \n $message->setTo($client->email);\n $mailTo = $config['freemium']['mail_to'];\n foreach($mailTo as $mail)\n {\n $message->addBcc($mail);\n }\n\n // prepare de mail transport and send the message\n $transport = $mailer->getTransport($message, 'smtp1', 'sales');\n $transport->send($message);\n echo \"Done!\";\n }\n catch(\\Exception $e)\n {\n \\App\\NotifyError::notify($e);\n ddd($e);\n }\n\n exit;\n }",
"public function sync()\n {\n $class = explode('\\\\', get_called_class());\n $manager = \\Str::studly(str_replace('EntryModel', null, end($class)));\n\n $existingAddons = $manager::getAll();\n $databaseAddons = $this->all();\n\n // Sync TO the database\n foreach ($existingAddons as $addon) {\n if (!$databaseAddons->findBySlug($addon->slug)) {\n $this->addons->insert(\n array(\n 'slug' => $addon->slug,\n )\n );\n }\n }\n }",
"public function fetchUpdates()\n\t{\n\t}",
"function sync() {\n\t\t// TODO\n\t}",
"abstract protected function getEntitiesToSync();",
"public function sync()\n {\n if( $this->dirty )\n {\n if( !Master::$cMaster->APICall('0.9.1/db/' . $this->ulA->db->ID . '/ul/' . $this->ulA->ID, array( 'setConnection' => $this->json() ) ) ){ commandResult( 500, \"Could not set connection \" . $this->description() ); }\n $this->dirty = false;\n\n return true;\n }\n\n return false;\n }",
"public static function sync()\r\n {\r\n if ( is_admin() && file_exists( SEOT::$tmp_path . '/plugin-sync' ) )\r\n {\r\n unlink( SEOT::$tmp_path . '/plugin-sync' );\r\n SEOT::setModuleOptions('core');\r\n /*\r\n $GLOBALS['_POST']['seoa_site_apikey'] = SEOT::$options['site_apikey'];\r\n\r\n SEOT::handler(\r\n 'sync',\r\n 'core',\r\n array(\r\n 'hide_info' => 1,\r\n 'post' => array( $post_id )\r\n )\r\n );\r\n */\r\n SEOTL_Net_URL_Get::content(\r\n get_site_url(),\r\n array(\r\n 'timeout' => 5,\r\n\r\n 'post' => array(\r\n 'seot_handler' => 'sync',\r\n 'seot_module' => 'core',\r\n 'seoa_site_apikey' => SEOT::$options['site_apikey']\r\n )\r\n )\r\n );\r\n }\r\n\r\n if ( is_admin() && !file_exists( SEOT::$tmp_path . '/old-data-deleted' ) )\r\n {\r\n global $wpdb;\r\n\r\n SEOTL_FileSys_File::write( SEOT::$tmp_path . '/old-data-deleted', 1 );\r\n\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_competitors`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_competitors_sites`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_seo_keywords`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_seo_backlinks`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_seo_interlinks`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_seo_positions`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_stats`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_stats_custom_period`');\r\n SEOTL_DB::query('DROP TABLE IF EXISTS `' . $wpdb->prefix.'seotools' . '_stats_keywords`');\r\n }\r\n }",
"public function sync($force = false) {\n\t\t// do this once per request\n\t\tif ($this->cache) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $conf;\n\n\t\t$idx_cache = new cache($this->getPluginName(), '.idx');\n\t\t$pkg_cache = new cache($this->getPluginName(), '.txt');\n\t\t$cache_exists = file_exists($pkg_cache->cache);\n\n\t\t// check poldek indexes\n\t\tif (!$cache_exists || !$idx_cache->useCache(array('age' => $conf['locktime'], 'files' => getConfigFiles('main')))) {\n\n\t\t\t// cache is ok, if it exists and is not empty and does not contain errors\n\t\t\t$cache_ok = $cache_exists && filesize($pkg_cache->cache) && !preg_grep('/^error:/', file($pkg_cache->cache));\n\n\t\t\t// without force update indexes only if cache is missing\n\t\t\tif ($force || !$cache_exists) {\n\t\t\t\t$lines = $this->exec(\"--up\");\n\t\t\t\t// process output, if we find \"Writing ...\" line, means we should update ls output as well\n\t\t\t\t// Writing /root/.poldek-cache/[...]/packages.ndir.gz...\n\t\t\t\t// Index patches size too big\n\t\t\t\t// Retrieving whole index ...\n\t\t\t\tif (!$cache_exists || !$cache_ok || preg_grep('/^(Writing|Retrieving whole index) /', $lines)) {\n\t\t\t\t\t$idx_cache->storeCache(time());\n\t\t\t\t} else {\n\t\t\t\t\t// freshen timestamp or we keep updating indexes if index\n\t\t\t\t\t// is older than locktime\n\t\t\t\t\ttouch($idx_cache->cache);\n\t\t\t\t\tif ($force) {\n\t\t\t\t\t\t// sleep, so packages cache be newer\n\t\t\t\t\t\tsleep(1);\n\t\t\t\t\t}\n\t\t\t\t\t// touch also package file, not to trigger it's update\n\t\t\t\t\ttouch($pkg_cache->cache);\n\t\t\t\t\tclearstatcache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// do not update listing, if cache exists and not in cron mode\n\t\tif (($force || !$cache_exists) && !$pkg_cache->useCache(array('files' => array($idx_cache->cache)))) {\n\t\t\t$lines = $this->shcmd(\"ls\", $rc);\n\t\t\t// write cache, unless there was an error\n\t\t\tif (!$rc) {\n\t\t\t\t$pkg_cache->storeCache(join(\"\\n\", $lines));\n\t\t\t}\n\t\t}\n\n\t\t$this->cache = $pkg_cache->cache;\n\t}",
"private function synchronize() {\n\t\t$response = $this->send(self::$synchronize_uri, self::SYNC_SIZE);\n\t\t$this->_set_sync($response);\n\t}",
"function gaMatch_save($appGlobals){\n // $appGlobals->gb_sql->sql_transaction_start ($appGlobals); //?????????????????????\n $exists = ( ! empty($this->game_atGameId) );\n // need to update opponent array\n if ( $exists ) {\n $orgRec = new stdData_gameMatch_group;\n $orgRec->gaMatch_read($appGlobals,$this->game_atGameId, $this->game_opponents_gameId[0]);\n $orgRec->gag_updateGameTotals($appGlobals,-1);\n $orgRec->gag_updateKidPeriodTotals($appGlobals,-1);\n }\n $atGameId = $this->gaUnit_save($appGlobals);\n $this->gag_updateGameTotals($appGlobals,1);\n $this->gag_updateKidPeriodTotals($appGlobals,1);\n // $appGlobals->gb_sql->sql_transaction_end ($appGlobals);\n return $atGameId;\n // end transaction processing\n}",
"function optimizeDatabase() {}",
"public function syncContacts() {\n // Pulls the SOQL from database.php config\n $sforce = $this->getDataSource();\n $SOQL = $sforce->getConfigSOQL();\n \n $done = false;\n $queryResult = $this->query($SOQL);\n \n $syncResults = array(\n 'create' => array(),\n 'update' => array(),\n 'delete' => array(),\n 'unchanged' => array()\n );\n\n // Based on the Salesforce Partner API documentation\n if ($queryResult->size > 0) {\n while (!$done) {\n foreach ($queryResult->records as $record) {\n // Creating the sObject translates the results from the API into a useable object\n $sObject = new SObject($record);\n $result = get_object_vars($sObject->fields);\n $result['Id'] = $sObject->Id;\n // Prepares the SyncObject\n $this->SyncObject->newSyncObject($result);\n // Performs the appropriate sync operation\n $this->SyncObject->performSyncOperation();\n $syncResults = array_merge_recursive($syncResults, $this->SyncObject->getSyncResult());\n }\n if ($queryResult->done != true) {\n $this->queryMore($queryResult);\n } else {\n $done = true;\n }\n }\n }\n \n return $syncResults;\n }",
"public function afterSyncing() {}",
"private function youreMine ()\n {\n if ( CACHE_ENABLED === true ) {\n $status = $this->cache->fetch( CACHE_ID_RUNNING );\n if ( $status === \"DONE\" || $status === false ) {\n $running = false;\n $this->cache->save( CACHE_ID_RUNNING, \"STARTED\" );\n } else {\n $running = true;\n }\n } else {\n if( file_exists( RUNNING_FILE ) ) {\n if( file_get_contents( RUNNING_FILE ) === \"DONE\" ) {\n $running = false;\n $this->createLocal( \"file\", RUNNING_FILE, \"put\", \"STARTED\" );\n } else {\n $running = true;\n }\n } else {\n $running = false;\n $this->createLocal( \"file\", RUNNING_FILE, \"put\", \"STARTED\" );\n }\n }\n if ( $running === false ) {\n $contents = $this->recurse();\n if ( CACHE_ENABLED === true ) {\n foreach ( $contents as $content ){\n $dbx_cache_id = md5( \"dbxContent\" . $content[0] );\n list( $object, , $mtime, , $rev ) = $this->cache->fetch( $dbx_cache_id );\n if ( $object === null || $object !== null && $mtime < $content[2] ) {\n $content[4] = $rev;\n $metadata = $this->uploadFile( $content );\n $content[2] = $metadata['modified'];\n $content[4] = $metadata['rev'];\n $this->cache->save( $dbx_cache_id, $content );\n }\n }\n $this->cache->save( CACHE_ID_RUNNING, \"DONE\" );\n } else {\n foreach( $contents as $content ){\n $this->uploadFile( $content );\n }\n $this->createLocal( \"file\", RUNNING_FILE, \"put\", \"DONE\" );\n }\n }\n }",
"function syncUpdate($table, $phone, $email, $id) {\n global $loginloc;\n global $dbTables;\n global $debugFile;\n foreach ($dbTables as $item) { // if npt equal, insert new item\n $loginloc = \"CHECK SYNC UPDATE table -> \" . $item . \" id\" . $id . \"\\n\";\n get_client_ip(1, $debugFile);\n if (strcmp($item, $table) != 0) { // if npt equal, update needed for this table also\n $query = \"UPDATE `\" . $item . \"` SET phone='\" . $phone . \"' ,email='\" . $email . \"' WHERE id='\" . $id . \"'\"; // id is row number \n $data = mysql_query($query) OR die(mysql_error());\n $loginloc = \"SYNC UPDATE table -> \" . $item . \" id\" . $id . \"\\n\";\n get_client_ip(1, $debugFile);\n }\n }\n}",
"private function connectDBs()\n {\n // the object in the first place, and also to recreate the connections when we're woken up.\n $this->memcached = new \\Memcached();\n $this->memcached->addServer($this->environment['MEMCACHEDSERVER'], $this->environment['MEMCACHEDPORT']);\n if (!$this->memcached->set('Test', time())) {\n throw new \\Exception('REMOMTE ' . $this->memcached->getResultMessage());\n }\n\n $this->localmemcached = new \\Memcached();\n $this->localmemcached->addServer('/tmp/memcached.sock', '0');\n if (!$this->localmemcached->set('Test', time())) {\n throw new \\Exception('LOCAL ' . $this->localmemcached->getResultMessage());\n }\n\n $this->redis = new \\Redis();\n $this->redis->connect($this->environment['REDISSERVER'], $this->environment['REDISPORT']);\n\n $this->db = new \\mysqli(\n $this->environment['MYSQLSERVER'],\n $this->environment['MYSQLUSER'],\n $this->environment['MYSQLPASSWORD'],\n $this->environment['MYSQLDATABASE']\n );\n\n $this->sqlite = new \\SQLite3($this->sqlitedb);\n\n $this->api = new Client(); // Guzzle client\n\n $this->cURL = curl_init($this->environment['APIURI']);\n $version = curl_version();\n curl_setopt_array($this->cURL, [CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HEADER, false,\n CURLOPT_USERAGENT => \"cURL/$version[version] PHP/\" . PHP_VERSION,\n ]);\n }",
"public function sync()\n {\n $sql = null;\n $module = new \\ZPM\\Core\\Setup\\Schema();\n $modData = new \\ZPM\\Core\\Setup\\Info();\n\n $module->install();\n }",
"function updateDatabase()\n\t{\n\t\tglobal $ilCtrlStructureReader;\n\n\t\t$ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);\n\n\t\tinclude_once \"./Services/Database/classes/class.ilDBUpdate.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacAdmin.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacReview.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacSystem.php\";\n\t\tinclude_once \"./Services/Tree/classes/class.ilTree.php\";\n\t\tinclude_once \"./Services/Xml/classes/class.ilSaxParser.php\";\n\t\tinclude_once \"./Services/Object/classes/class.ilObjectDefinition.php\";\n\n\t\t// #9019: init timezone\t\t\n\t\t$tz = $this->setup->ini->readVariable(\"server\",\"timezone\");\n\t\tif ($tz != \"\")\n\t\t{\n\t\t\tif (function_exists('date_default_timezone_set'))\n\t\t\t{\n\t\t\t\tdate_default_timezone_set($tz);\n\t\t\t}\n\t\t\tdefine (\"IL_TIMEZONE\", $tz);\n\t\t}\n\n\t\t// referencing db handler in language class\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$this->lng->setDbHandler($ilDB);\n\n\t\t// run dbupdate\n\t\t$dbupdate = new ilDBUpdate($ilDB);\n\t\t$dbupdate->applyUpdate((int) $_POST[\"update_break\"]);\n\n\t\tif ($dbupdate->updateMsg == \"no_changes\")\n\t\t{\n\t\t\t$message = $this->lng->txt(\"no_changes\").\". \".$this->lng->txt(\"database_is_uptodate\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sep = \"\";\n\t\t\tforeach ($dbupdate->updateMsg as $row)\n\t\t\t{\n\t\t\t\tif ($row[\"msg\"] == \"update_applied\")\n\t\t\t\t{\n\t\t\t\t\t$a_message.= $sep.$row[\"nr\"];\n\t\t\t\t\t$sep = \", \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$e_message.= \"<br/>\".$this->lng->txt($row[\"msg\"]).\": \".$row[\"nr\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($a_message != \"\")\n\t\t\t{\n\t\t\t\t$a_message = $this->lng->txt(\"update_applied\").\": \".$a_message;\n\t\t\t}\n\t\t}\n\n\t\tilUtil::sendInfo($a_message.$e_message, true);\n\t\tilUtil::redirect(\"setup.php?cmd=displayDatabase\");\n\t}",
"public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }"
]
| [
"0.6314875",
"0.5788685",
"0.5776724",
"0.5735581",
"0.55856323",
"0.55856323",
"0.5575879",
"0.556417",
"0.5489072",
"0.54048705",
"0.53133744",
"0.5311128",
"0.5309001",
"0.530137",
"0.5281816",
"0.5217794",
"0.51931936",
"0.5150927",
"0.51063454",
"0.504137",
"0.5040073",
"0.5028135",
"0.49992678",
"0.4997241",
"0.4993162",
"0.49877384",
"0.4972884",
"0.49554196",
"0.49552736",
"0.49217206"
]
| 0.7715419 | 0 |
Creates a default chromosome. | function createDefaultChromosome(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function generateGenome()\n\t{\n\t\tfor($a=1; $a<=3; $a++) {\n\t\t\tfor($b=1; $b<=3; $b++) {\n\t\t\t\tfor($c=1; $c<=3; $c++) {\n\t\t\t\t\tfor($d=1; $d<=3; $d++) {\n\t\t\t\t\t\tfor($e=1; $e<=3; $e++) {\n\t\t\t\t\t\t\tif($this->random or mt_rand(0,1000) < $this->mutation) {\n\t\t\t\t\t\t\t\t$this->genome[$a.$b.$c.$d.$e] = mt_rand(1,6);\n\t\t\t\t\t\t\t\tif( ! $this->random) {\n\t\t\t\t\t\t\t\t\terror_log(\"MUTATION!\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->genome[$a.$b.$c.$d.$e] = $this->parentGenome[mt_rand(1,2)][$a.$b.$c.$d.$e];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function createDefault()\n {\n return self::create(null);\n }",
"private function generateString() :string\n {\n $chromosome = '';\n\n for ($i = 0; $i < Settings::CHROMOSOME_SIZE; $i++) {\n $chromosome = $chromosome . $this->genes[$this->getRandomPosition()];\n }\n\n return $chromosome;\n }",
"public function create_default() {\n if (!$this->model->has_default()) {\n $default_data = [\n 'id' => 1,\n 'name' => 'Beregu',\n 'desc' => 'team vs team',\n ];\n $this->model->create_default($default_data);\n\n $default_data = [\n 'id' => 2,\n 'name' => 'Individu',\n 'desc' => 'individu vs individu',\n ];\n $this->model->create_default($default_data);\n }\n }",
"public static function createWithDefaultName()\n {\n return new self([], [self::DEFAULT_NAME]);\n }",
"private function generateArray() : array\n {\n $chromosome = [];\n\n for ($i = 0; $i < Settings::CHROMOSOME_SIZE; $i++) {\n $chromosome[$i] = $this->genes[$this->getRandomPosition()];\n }\n\n return $chromosome;\n }",
"public static function initDefaultGame()\r\n {\r\n return new BattleshipGame(10, 10);\r\n }",
"public function create()\n {\n return 'okey c';\n }",
"public function createDefaultColorCode(){\n\t\n\t\tif(!$this->isColorCode(\"default\", \"b2dfee\")){\n\t\t\t$sql = \"INSERT INTO sy_color_codes (name, color, text) VALUES(?,?,?)\";\n\t\t\t$this->runRequest($sql, array(\"default\", \"b2dfee\", \"000000\"));\n\t\t}\n\t}",
"public function createDefault()\n {\n $this->setDefaultContent();\n $fileController = $this->generator->formatControllersPath()\n . PhpInterface::SLASH\n . $this->generator->defaultController\n . DefaultInterface::CONTROLLER_POSTFIX\n . PhpInterface::PHP_EXT;\n $isCreated = FileManager::createFile($fileController, $this->sourceCode);\n if($isCreated)\n {\n Console::out($fileController . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN);\n }\n }",
"public static function createNew();",
"public function createNew() {\n\t}",
"function __construct(int $chars = 6)\n {\n static::setRange();\n static::setChars($chars);\n }",
"public function createNew();",
"public function create_default()\n {\n return method_exists($this, 'matrix') ? app()->call([$this, 'matrix']) : app()->call([$this, 'matrix_default']);\n }",
"public function getDefaultChar() {}",
"function CreateDefaultCountry()\n\t{\n\t\t$result = $this->sendRequest(\"CreateDefaultCountry\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function createDefault($id = 0) {\n\t $x =UserLocation::model()->findByAttributes(array('user_id'=>$id));\n if ($x === null) {\n $ul = new UserLocation();\n $ul->neighborhood_id = 0; // default\n $ul->user_id = $id;\n $ul->gps = new CDbExpression(\"GeomFromText('Point(0 0)')\"); // default\n $ul->address ='';\n $ul->address_ext =''; \n $ul->save();\n } \n }",
"public function generateCodigo()\n {\n $this->codigo = random_int(1000000,9999999);\n }",
"public function _createDefault($code, $name){\n\n\n\t\t$nameFormated = \"Default - \" . $name ;\n\t\t$new = JTable::getInstance('Assign', 'GeofactoryTable');\n\t\t$new->name = $nameFormated ;\n\t\t$new->typeList = $code ;\n\t\t$new->extrainfo = JText::sprintf('COM_GEOFACTORY_DEFAULT_ASSIGN_FOR', $name); \n\t\t$new->state = 1 ;\n\t\t$new->check();\n\t\tif (!$new->store()){\n\t\t\t$new->setError($new->getError());\n\t\t}\t\t\t\t\n\t}",
"protected function makeDefault()\n {\n $this->options = [];\n $this->menuSource = MenuSource::STATIC_SOURCE;\n $this->action = new Action(ActionType::MENU(), 'Default menu name', 'Default menu text');\n }",
"public function __construct($house_number_from = null, $house_number_to = null, $neighborhood_code = null, $letter_combination = null, $range_indication = null, $street_name = null, $street_name_nen = null, $city = null, $municipality = null, $municipality_code = null, $cebuco_code = null, $province = null, $province_code = null)\n {\n $this\n ->setHouse_number_from($house_number_from)\n ->setHouse_number_to($house_number_to)\n ->setNeighborhood_code($neighborhood_code)\n ->setLetter_combination($letter_combination)\n ->setRange_indication($range_indication)\n ->setStreet_name($street_name)\n ->setStreet_name_nen($street_name_nen)\n ->setCity($city)\n ->setMunicipality($municipality)\n ->setMunicipality_code($municipality_code)\n ->setCebuco_code($cebuco_code)\n ->setProvince($province)\n ->setProvince_code($province_code);\n }",
"public function CreateDefaultTypeElement() {\n\t\treturn $this->createElement('Default');\n\t}",
"public function setPrinterToDefault()\n {\n $command = chr(94).'default'.self::CRLF;\n $this->device->buffer .= $command;\n return $command;\n }",
"public function create() {\n\t \n }",
"public function create()\n {\n throw new NotImplementedException();\n }",
"public function __construct(ChamberIO $chamberIO = NULL){\n\n\t\tif(empty($chamberIO)){\n\t\t\t$chamberIO = new ChamberIO_ASCII();\n\t\t}\n\t\t$this->chamberIO = $chamberIO;\n\n\t}",
"public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }",
"public function creat()\n {\n\n }",
"public function getDefault();"
]
| [
"0.5161879",
"0.51169163",
"0.5110057",
"0.50518006",
"0.49710712",
"0.49699134",
"0.49452725",
"0.49234244",
"0.48351145",
"0.47843862",
"0.4766253",
"0.46624184",
"0.46294048",
"0.4619013",
"0.4602764",
"0.4585824",
"0.45840526",
"0.45733634",
"0.45687002",
"0.45591977",
"0.45500785",
"0.45318443",
"0.44873118",
"0.44741887",
"0.44734362",
"0.44732025",
"0.444629",
"0.4439739",
"0.44195032",
"0.44148454"
]
| 0.92477494 | 0 |
Swap genes at positions $i and $j | public function swapGenes($i, $j); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function swap($a, $i, $j) \n { \n $temp; \n //convert string into an array\n $charArray = str_split($a); \n $temp = $charArray[$i] ; \n $charArray[$i] = $charArray[$j]; \n $charArray[$j] = $temp; \n //convert back array into an string\n return implode($charArray); \n }",
"public static function swap_string($a, $i, $j)\n {\n $temp =$a[$i];\n $a [$i]= $a[$j];\n $a[$j]=$temp;\n return $a;\n }",
"public function swap($k, $j) {\n if (!isset($this->_hash[$k]) || !isset($this->_hash[$j])) {\n return FALSE;\n }\n $t= $this->_hash[$k];\n $this->_hash[$k]= $this->_hash[$j];\n $this->_hash[$j]= $t;\n return TRUE;\n }",
"public function swap(int $first, int $second): void\n {\n $tmp = $this->elements[$first];\n $this->elements[$first] = $this->elements[$second];\n $this->elements[$second] = $tmp;\n }",
"function flip(&$arr, $i) \n{ \n\t$start = 0; \n\twhile ($start < $i) \n\t{ \n\t\t$temp = $arr[$start]; \n\t\t$arr[$start] = $arr[$i]; \n\t\t$arr[$i] = $temp; \n\t\t$start++; \n\t\t$i--; \n\t} \n}",
"function DoSwap($word,$num,&$blocks,&$wordlocs)\n{\n\t// Generate a list of the location keys (eg 0,1,2,3,4)\n\t$loclist=array_keys($wordlocs[$word]);\n\t\n\t// Randomise the order (eg 3,1,0,4,2)\n\tshuffle($loclist);\n\t\n\t$swapped=array();\n\tfor ($locidx=0; $locidx<$num; $locidx++)\n\t{\n\t\t$li1=$locidx;\n\t\t$li2=$loclist[$locidx];\n\t\t\n\t\tif ($li1==$li2) continue; // nothing being swapped\n\t\n\t\t// First part of sentence comes from $li1, second from $li2\n\t\t$loc1=$wordlocs[$word][$li1];\n\t\t$loc2=$wordlocs[$word][$li2];\n\n\t\tif (isset($swapped[$li2]) && $swapped[$li2]==$li1) continue; // already swapped these two\n\t\t$swapped[$li1]=$li2;\n\t\t\n\t\t$block_num1=$loc1[0];\n\t\t$snum1=$loc1[1];\n\t\t$wordnum1=$loc1[2];\n\t\t\n\t\t$block_num2=$loc2[0];\n\t\t$snum2=$loc2[1];\n\t\t$wordnum2=$loc2[2];\n\t\t\n\t\tif ($block_num1==$block_num2 && $snum1==$snum2) continue; // no swapping within same sentence\n\t\t\n\t\t$s1=$blocks[$block_num1][$snum1];\n\t\t$s2=$blocks[$block_num2][$snum2];\n\t\t\n\t\t// New s1 is everything up to, but not including wordnum1 from s1 + everything from wordnum2 from s2\n\t\t$ns1=array_merge(array_slice($s1,0,$wordnum1),array_slice($s2,$wordnum2));\n\t\t// Opposite for s2\n\t\t$ns2=array_merge(array_slice($s2,0,$wordnum2),array_slice($s1,$wordnum1));\n\t\t\n\t\t// If there are any indexed words in the second half of each sentence,\n\t\t// they need re-indexing\n\t\t\n\t\t// Second half of s2, which is going to s1\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\t$new_wordnum=$wnum2-$wordnum2+$wordnum1;\n\t\t\t// Move to a negative block, to avoid the situation where a word is moved\n\t\t\t// to a sentence which already has the same word in the same location\n\t\t\t// (which always happens for the word being handled, but may happen to others)\n\t\t\tMoveWord($wordw,$wordlocs,$block_num2,$snum2,$wnum2,-$block_num1,$snum1,$new_wordnum);\n\t\t}\n\t\t// Second half of s1, which is going to s2\n\t\tfor ($wnum1=$wordnum1; $wnum1<count($s1); $wnum1++)\n\t\t{\n\t\t\t$wordw=$s1[$wnum1];\n\t\t\t$new_wordnum=$wnum1-$wordnum1+$wordnum2;\n\t\t\tMoveWord($wordw,$wordlocs,$block_num1,$snum1,$wnum1,$block_num2,$snum2,$new_wordnum);\n\t\t}\n\t\t// Fix up words from second half of s2 with negative block numbers\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\tFixNegBlock($wordw,$wordlocs);\n\t\t}\n\t\t\n\t\t// Store the updates back\n\t\t$blocks[$block_num1][$snum1]=$ns1;\n\t\t$blocks[$block_num2][$snum2]=$ns2;\n\t}\n}",
"function changeOrder() {\n $this->iteratorH = array_reverse($this->iteratorH);\n }",
"private function arrangeBoardingCards()\n {\n for ($counter = 0; $counter < count($this->boardingCards); $counter++) {\n\n $boardingCard = $this->boardingCards[$counter];\n\n $this->toIndex[$boardingCard->getTo()] = $boardingCard;\n $this->fromIndex[$boardingCard->getFrom()] = $boardingCard;\n }\n }",
"function swap(&$a, &$b)\n {\n list($a, $b) = array($b, $a);\n }",
"private function exchangeGossips(Driver $one, Driver $two): void\n {\n $one->learnGossips($two->getGossips());\n $two->learnGossips($one->getGossips());\n }",
"function permutation($x, $y) {\r\n\techo \"permutation...\\n\" ;\r\n\t$t = $x ;\r\n\t$x = $y ;\r\n\t$y = $t ;\r\n}",
"public function swapValue(int $index1, int $index2) {\n $tmp = $this->data[$index1];\n $this->data[$index1] = $this->data[$index2];\n $this->data[$index2] = $tmp;\n }",
"function swap2($a, $b) {\n$t = $a;\n$a = $b;\necho \"\\$a = \".$a.\"<br>\\n\";\n$b = $t;\necho \"\\$b = \".$b.\"<br>\\n\";\n}",
"private function swap(array $items, int $selectedIndex, int $newIndex): array {\n\n $temp = $items[$selectedIndex];\n $items[$selectedIndex] = $items[$newIndex];\n $items[$newIndex] = $temp;\n\n return $items;\n }",
"function SwapII($str) {\n $arr = explode(\" \", $str);\n\n //Initialize two temp variables.\n $temp = \"\";\n $temp2 = \"\";\n\n //Create a for loop that will go through all the elements in the array.\n for ($i = 0; $i < count($arr); $i++) {\n\n //Initialize an array variable to store digit matches, and positions.\n $matches = array();\n\n //Look for digits inside the current string.\n preg_match_all('/\\d/', $arr[$i], $matches, PREG_OFFSET_CAPTURE);\n\n //If more than 1 digit is found in the string...\n if(count($matches[0]) > 1) {\n\n //Verify that their positions are different.\n if($matches[0][0][1] < $matches[0][1][1]) {\n\n //Store the digits in the temp variables.\n $temp = $matches[0][0][0];\n $temp2 = $matches[0][1][0];\n\n //Swap the digits in the temp variables.\n //swap($temp, $temp2);\n $temp = $temp ^ $temp2;\n $temp2 = $temp ^ $temp2;\n $temp = $temp ^ $temp2;\n\n //Put the above changes in the current array element.\n $arr[$i] = substr_replace($arr[$i], $temp, $matches[0][0][1], 1);\n $arr[$i] = substr_replace($arr[$i], $temp2, $matches[0][1][1], 1);\n\n }\n }\n\n for($j = 0; $j < strlen($arr[$i]); $j++) {\n\n //Change all lowercase letters to uppercase, and vice versa.\n if(ctype_alpha($arr[$i][$j])) {\n\n if (ctype_upper($arr[$i][$j])) {\n $arr[$i][$j] = strtolower($arr[$i][$j]);\n }\n else {\n $arr[$i][$j] = strtoupper($arr[$i][$j]);\n }\n\n }\n }\n\n }\n\n //Return the final computed value.\n return implode($arr, \" \");\n }",
"function switchTwoItems($iItemIndex1, $iItemIndex2) {\r\n\t\t\t$oTmp = $this->getItem($iItemIndex1);\r\n\t\t\t\r\n\t\t\t// set index 1 = item 2 setItem\r\n\t\t\t$this->setItem($iItemIndex1, $this->getItem($iItemIndex2));\t\r\n\t\t\t\r\n\t\t\t// set index 2 = tmp setItem\r\n\t\t\t$this->setItem($iItemIndex2, $oTmp);\t\t\t\r\n\t}",
"public function switchItemPositions(Item $item1, Item $item2): void;",
"public function swapRows(int $r1, int $r2) {\n for ($i = 0; $i < $this->col; ++$i) {\n $tmp = $this->data[$r1 * $this->col + $i];\n $this->data[$r1 * $this->col + $i] = $this->data[$r2 * $this->col + $i];\n $this->data[$r2 * $this->col + $i] = $tmp;\n }\n }",
"function B2B_G($a, $b, $c, $d, $ix, $iy) {\n\t\t$x0 = $this->m[$ix];\n\t\t$x1 = $this->m[$ix + 1];\n\t\t$y0 = $this->m[$iy];\n\t\t$y1 = $this->m[$iy + 1];\n\n\t\t$this->ADD64AA($this->v, $a, $b); // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n\t\t$this->ADD64AC($this->v, $a, $x0, $x1); // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n\t\t// v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n\t\t$xor0 = ($this->v[$d] ^ $this->v[$a]) & 0xffffffff;\n\t\t$xor1 = ($this->v[$d + 1] ^ $this->v[$a + 1]) & 0xffffffff;\n\t\t$this->v[$d] = $xor1;\n\t\t$this->v[$d + 1] = $xor0;\n\n\t\t$this->ADD64AA($this->v, $c, $d);\n\n\t\t// v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n\t\t$xor0 = ($this->v[$b] ^ $this->v[$c]) & 0xffffffff;\n\t\t$xor1 = ($this->v[$b + 1] ^ $this->v[$c + 1]) & 0xffffffff;\n\t\t$this->v[$b] = (uRShift($xor0, 24) ^ LShift($xor1, 8)) & 0xffffffff;\n\t\t$this->v[$b + 1] = (uRShift($xor1, 24) ^ LShift($xor0, 8)) & 0xffffffff;\n\n\t\t$this->ADD64AA($this->v, $a, $b);\n\t\t$this->ADD64AC($this->v, $a, $y0, $y1);\n\n\t\t// v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n\t\t$xor0 = ($this->v[$d] ^ $this->v[$a]) & 0xffffffff;\n\t\t$xor1 = ($this->v[$d + 1] ^ $this->v[$a + 1]) & 0xffffffff;\n\t\t$this->v[$d] = (uRShift($xor0, 16) ^ LShift($xor1, 16)) & 0xffffffff;\n\t\t$this->v[$d + 1] = (uRShift($xor1, 16) ^ LShift($xor0, 16)) & 0xffffffff;\n\n\t\t$this->ADD64AA($this->v, $c, $d);\n\n\t\t// v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n\t\t$xor0 = ($this->v[$b] ^ $this->v[$c]) & 0xffffffff;\n\t\t$xor1 = ($this->v[$b + 1] ^ $this->v[$c + 1]) & 0xffffffff;\n\t\t$this->v[$b] = (uRShift($xor1, 31) ^ LShift($xor0, 1)) & 0xffffffff;\n\t\t$this->v[$b + 1] = (uRShift($xor0, 31) ^ LShift($xor1, 1)) & 0xffffffff;\n\t}",
"function build_bitwise_swap($profilefieldid, $loc1, $loc2)\n{\n\n\tglobal $vbulletin;\n\n\t$loc1value = pow(2, $loc1 - 1);\n\t$loc2value = pow(2, $loc2 - 1);\n\n\t// Zero loc1 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc1value\n\t\tWHERE temp & $loc1value\n\t\");\n\t// Copy loc2 to loc1\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc1value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Zero loc2 in temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp - $loc2value\n\t\tWHERE temp & $loc2value\n\t\");\n\t// Copy loc1 from perm field to loc2 temp field\n\t$vbulletin->db->query_write(\"\n\t\tUPDATE \" . TABLE_PREFIX . \"userfield\n\t\tSET temp = temp + $loc2value\n\t\tWHERE field$profilefieldid & $loc1value\n\t\");\n\n}",
"function mergereagentandarrow($filename_x, $filename_y, $filename_result) {\n\n list($width_x, $height_x) = getimagesize($filename_x);\n list($width_y, $height_y) = getimagesize($filename_y);\n\n // Create new image with desired dimensions\n\n $image = imagecreatetruecolor($width_y, $height_x + $height_y);\n$white = imagecolorallocate($image, 255, 255, 255);\nimagefill($image, 0, 0, $white);\n\n\n // Load images and then copy to destination image\n\n $image_x = imagecreatefromgif($filename_x);\n $image_y = imagecreatefromgif($filename_y);\n\n imagecopy($image, $image_x, ($width_y-$width_x)/2, 0, 0, 0, $width_x, $height_x);\n imagecopy($image, $image_y, 0, $height_x, 0, 0, $width_y, $height_y);\n\n // Save the resulting image to disk (as JPEG)\n\n imagegif($image, $filename_result);\n\n\n\n\n // Clean up\n\n imagedestroy($image);\n imagedestroy($image_x);\n imagedestroy($image_y);\n\n}",
"public function tourSuivant() {\n\t\t\t$this -> turn = ($this-> turn == $this -> j1) ? $this -> j2 : $this -> j1 ;\n\t\t}",
"function swap(&$a, &$b) {\n$t = $a;\n$a = $b;\necho \"\\$a = \".$a.\"<br>\\n\";\n$b = $t;\necho \"\\$b = \".$b.\"<br>\\n\";\n}",
"function swap(&$a,&$b){\n\n $aux= $b;\n $b = $a;\n $a = $aux;\n}",
"function transpose(&$A, &$B)\r\n {\r\n $N = 4;\r\n for ($i = 0; $i < $N; $i++)\r\n for ($j = 0; $j < $N; $j++)\r\n $B[$i][$j] = $A[$j][$i];\r\n }",
"protected function drukowanie()\n {\n for($i=0,$c=count($this->tags); $i<$c; $i++){\n $this->szkielet = $this->swap( $this->szkielet , $this->install($i) );\n }\n\n }",
"function minimumSwaps($arr) {\n \n\n $size = count($arr);\n $counter = 0;\n\n for ($i=0; $i < count($arr); $i++) { \n echo $arr[$i] . \" \";\n }\n\n print(\"\\n\");\n\n for ($i=0; $i < $size; $i++) { \n # code...\n if (($i+1) != $arr[$i]){\n /*$key = array_search(($i+1), $arr);\n $tmp = $arr[$i];\n $arr[$i] = ($i+1);\n $arr[$key] = $tmp;\n $counter ++;*/\n\n $value = $arr[$i];\n $tmp = $arr[$value-1];\n $arr[$value-1] = $value;\n //$tmp = $arr[($i+1)];\n $arr[$i] = $tmp;\n $counter++;\n \n\n }\n }\n\n echo $counter . \"\\n\";\n for ($i=0; $i < count($arr); $i++) { \n echo $arr[$i] . \" \";\n }\n \n \n\n}",
"private function rotate() {\r\n $temp = $this->teams_1[1];\r\n for($i = 1; $i < (count($this->teams_1) - 1); $i++) {\r\n $this->teams_1[$i] = $this->teams_1[$i + 1];\r\n }\r\n $this->teams_1[count($this->teams_1) - 1] = end($this->teams_2);\r\n for($i = (count($this->teams_2) - 1); $i > 0; $i--) {\r\n $this->teams_2[$i] = $this->teams_2[$i - 1];\r\n }\r\n $this->teams_2[0] = $temp;\r\n return true;\r\n }",
"function swapFiles() {\r\n\t\tglobal $file;\r\n\r\n\t\trename($file, $file.\".tmp\");\r\n\t\trename($file.\".bak\", $file);\r\n\t\trename($file.\".tmp\", $file.\".bak\");\r\n\t}",
"function reverseStr(&$str) \n{ \n $n = strlen($str); \n \n // Swap character starting \n // from two corners \n for ($i = 0; $i < $n / 2; $i++) \n //swap the string \n list($str[$i], $str[$n - $i - 1]) = array($str[$n - $i - 1], $str[$i]); \n}"
]
| [
"0.5742254",
"0.55348194",
"0.55132675",
"0.54502356",
"0.5192657",
"0.50175023",
"0.4826076",
"0.48215976",
"0.4763406",
"0.47493008",
"0.4728692",
"0.46957836",
"0.46494663",
"0.45249987",
"0.450617",
"0.4491856",
"0.44712323",
"0.4463605",
"0.44398436",
"0.4420064",
"0.44082013",
"0.44075742",
"0.44025394",
"0.43635333",
"0.43622446",
"0.43443924",
"0.43343478",
"0.43325368",
"0.43245846",
"0.43141"
]
| 0.9107245 | 0 |
Take genes from index $lo to $hi and reverse them. Interval is [$lo, $hi] Copy genes in that section and then inversely place them in the same section. | public function reversePart($lo,$hi); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function swapGenes($i, $j);",
"public function reversed();",
"public function reverse();",
"public function reverse();",
"public function reverse();",
"public function reverse();",
"function reverse()\n {\n }",
"public function inverse() : self\n {\n $a = self::identity($this->m)\n ->augmentLeft($this)\n ->rref()\n ->a()\n ->asArray();\n\n $b = [];\n\n foreach ($a as $rowA) {\n $b[] = array_slice($rowA, $this->n);\n }\n\n return self::quick($b);\n }",
"public function invert();",
"public function reverse() {}",
"function changeOrder() {\n $this->iteratorH = array_reverse($this->iteratorH);\n }",
"function flip(&$arr, $i) \n{ \n\t$start = 0; \n\twhile ($start < $i) \n\t{ \n\t\t$temp = $arr[$start]; \n\t\t$arr[$start] = $arr[$i]; \n\t\t$arr[$i] = $temp; \n\t\t$start++; \n\t\t$i--; \n\t} \n}",
"public function reverse()\n {\n $this->dataToArray();\n $preserveKeys = (\\Sledgehammer\\is_indexed($this->data) === false);\n\n return new self(array_reverse($this->data, $preserveKeys));\n }",
"function reverseArray($a) {\n\n $arrayCount = count($a);\n $start = 0;\n $end = $arrayCount-1;\n \n\n while($start < $end) {\n $temp = $a[$start];\n $a[$start] = $a[$end];\n $a[$end] = $temp;\n ++$start;\n --$end;\n }\n \n return $a;\n\n}",
"public function reverse($latitude, $longitude);",
"public function reverse()\n {\n return $this::from(array_reverse($this->hash, true));\n }",
"public function reverse()\r\n\t{\r\n\t\tarray_reverse($this->_items);\r\n\t}",
"public function reverse()\n {\n $board = clone $this;\n foreach ($this->board as $x => $row) {\n /** @var array $row */\n foreach ($row as $y => $item) {\n $board->board[-$x][$y] = $item;\n }\n }\n\n return $board;\n }",
"public function reverse() {\n\t\tarray_reverse( $this->elements );\n\n\t\treturn $this;\n\t}",
"public function reverse() {\r\n\t\t$this->collection = array_reverse($this->collection);\r\n return $this;\r\n }",
"public function reverse() {\n $rev = $this;\n $rev->edits = [];\n foreach ($this->edits as $edit) {\n $rev->edits[] = $edit->reverse();\n }\n return $rev;\n }",
"function reverse () {\r\n\t$rev = $this;\r\n $rev->edits = array();\r\n foreach ($this->edits as $edit) {\r\n $rev->edits[] = $edit->reverse();\r\n }\r\n\treturn $rev;\r\n }",
"public function reverse() : Arr {\n $keys = [];\n $values = [];\n foreach($this as $k => $v) {\n $keys[] = $k;\n $values[] = $v;\n unset($this[$k]);\n }\n\n for($i = sizeof($keys) - 1; $i >= 0; --$i) {\n $this[$keys[$i]] = $values[$i];\n }\n\n return $this;\n }",
"protected function inverse() {\n $this->invert = true;\n return $this;\n }",
"public function reverse(): self\n {\n return Factory::create(array_reverse($this->items, true));\n }",
"abstract public function reverse($preserveKeys = false);",
"public function reverse(): void\n {\n $ranks = $this->ranks;\n\n $this->commit(array_values(collect($ranks)->reverse()->all()));\n }",
"public function reverseMap(): MappingInterface;",
"public function reverse()\n {\n return new static(array_reverse($this->objects, true));\n }",
"function reverse() {\r\n return new self(array_reverse($this->list));\r\n }"
]
| [
"0.5712711",
"0.5562977",
"0.5431925",
"0.5431925",
"0.5431925",
"0.5431925",
"0.52181983",
"0.51887995",
"0.5094343",
"0.5084791",
"0.501926",
"0.5012143",
"0.49856704",
"0.49631062",
"0.48403564",
"0.47830704",
"0.47806922",
"0.47583032",
"0.4728807",
"0.46845216",
"0.46820167",
"0.46524367",
"0.45796746",
"0.4493805",
"0.44930494",
"0.4488452",
"0.44715017",
"0.44486058",
"0.44444945",
"0.44364095"
]
| 0.6773227 | 0 |
Check the 'Same as billing address' checkbox in shipping address. | public function setSameAsBillingShippingAddress()
{
$this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();
$this->browser->find($this->accountInformationBlock)->hover();
$this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set_ship_to_different_address( $checked ) {\n\n\t\t$details = WC()->session->get( 'wc_braintree_paypal_cart_customer_details', array() );\n\n\t\tif ( ! empty( $details ) ) {\n\n\t\t\tunset( $details['billing']['email'] );\n\t\t\tunset( $details['billing']['phone'] );\n\n\t\t\tif ( empty( $details['shipping'] ) ) {\n\t\t\t\t$checked = false;\n\t\t\t} elseif ( empty( $details['billing'] ) || $details['billing'] !== $details['shipping'] ) {\n\t\t\t\t$checked = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $checked;\n\t}",
"public function isBillingEqualShipping()\n {\n $user = Shopware()->Modules()->Admin()->sGetUserData();\n\n $billingAddress = $user[\"billingaddress\"][\"street\"].' '.$user[\"billingaddress\"][\"city\"].\n ' '.$user[\"billingaddress\"][\"zipcode\"].' '.$user[\"billingaddress\"][\"countryID\"];\n\n $shippingAddress = $user[\"shippingaddress\"][\"street\"].' '.$user[\"shippingaddress\"][\"city\"].\n ' '.$user[\"shippingaddress\"][\"zipcode\"].' '.$user[\"shippingaddress\"][\"countryID\"];\n\n if ($billingAddress == $shippingAddress) {\n return true;\n }\n return false;\n }",
"public function uncheckSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('No');\n $this->waitLoader();\n }",
"private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}",
"public function needs_shipping_address() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping_address', true === $this->needs_shipping() && ! wc_ship_to_billing_address_only() );\n\t}",
"public function isSetShipFromAddress()\n {\n return !is_null($this->_fields['ShipFromAddress']['FieldValue']);\n }",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function SetOrderShippingAddress($address, $isBilling = false)\n\t{\n\t\t// The shipping address attached to the quote, where the address should be stored\n\t\t$quoteShippingAddress = $this->getQuote()\n\t\t\t->setIsSplitShipping(false)\n\t\t\t->getShippingAddress();\n\n\t\t// Is an address ID - so it needs to be fetched\n\t\tif(!is_array($address)) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($address,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\tif(!$address) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get the customer email address, if they're logged in\n\t\t\t$customer = getClass('ISC_CUSTOMER')->getCustomerInfo();\n\t\t\tif($customer) {\n\t\t\t\t$address['shipemail'] = $customer['custconemail'];\n\t\t\t}\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(!empty($address['customFormFields'])) {\n\t\t\t\tif($isBilling == true) {\n\t\t\t\t\t$address['customFormFields'] =\n\t\t\t\t\t\t$this->mapBillingFieldsToShipping($address['customFormFields']);\n\t\t\t\t}\n\t\t\t\t$quoteShippingAddress->setCustomFields($address['customFormFields']);\n\t\t\t}\n\t\t}\n\n\t\t// Store the billing address in the quote\n\t\t$quoteShippingAddress->setAddressByArray($address);\n\t\treturn true;\n\t}",
"public function check_billing_address_for_packstation()\n\t{\n\t\t$addressValid = true;\n\n\t\t$billToAddress = $this->getAddressData($_SESSION['billto']);\n\t\tif(preg_match('/(packstation|filiale)/i', $billToAddress['entry_street_address']) === 1)\n\t\t{\n\t\t\t$addressValid = false;\n\t\t}\n\n\t\treturn $addressValid;\n\t}",
"function useDifferentShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = true;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}",
"private function SaveBillingAddress()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// If the customer isn't signed in then they've just entered an address that we need to validate\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\t$errors = array();\n\t\t\t// An invalid address was entered, show the form again\n\t\t\t$addressDetails = $this->ValidateGuestCheckoutAddress('billing', $errors);\n\t\t\tif(!$addressDetails) {\n\t\t\t\t$this->ChooseBillingAddress($errors);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// We've just selected an address\n\t\t\tif(isset($_GET['address_id'])) {\n\t\t\t\t$addressDetails = (int)$_GET['address_id'];\n\t\t\t}\n\t\t}\n\n\t\t// There was a problem saving the selected billing address\n\t\tif(!$this->SetOrderBillingAddress($addressDetails)) {\n\t\t\t$this->ChooseBillingAddress();\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're automatically creating accounts for customers then we need to save those details too\n\t\tif(!CustomerIsSignedIn() && GetConfig('GuestCheckoutCreateAccounts')) {\n\t\t\t$password = substr(md5(uniqid(true)), 0, 8);\n\t\t\t$autoAccount = 1;\n\t\t\t$_SESSION['CHECKOUT']['CREATE_ACCOUNT'] = 1;\n\t\t\t$_SESSION['CHECKOUT']['ACCOUNT_DETAILS'] = array(\n\t\t\t\t'email' => $addressDetails['shipemail'],\n\t\t\t\t'password' => $password,\n\t\t\t\t'firstname' => $addressDetails['shipfirstname'],\n\t\t\t\t'lastname' => $addressDetails['shiplastname'],\n\t\t\t\t'company' => '',\n\t\t\t\t'phone' => $addressDetails['shipphone'],\n\t\t\t\t'autoAccount' => $autoAccount\n\t\t\t);\n\t\t}\n\n\t\tif($this->getQuote()->isDigital()) {\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=confirm_order\", $GLOBALS['ShopPath']));\n\t\t}\n\t\telse {\n\t\t\t// Are we shipping to the same address?\n\t\t\tif(isset($_POST['ship_to_billing'])) {\n\t\t\t\tif(!$this->SetOrderShippingAddress($addressDetails, true)) {\n\t\t\t\t\t$this->ChooseShippingAddress();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now they need to choose the shipping provider for their order\n\t\t\t\t@ob_end_clean();\n\t\t\t\theader(\"Location: \".GetConfig('ShopPath').\"/checkout.php?action=choose_shipper\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Otherwise, we just move to the next step\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=choose_shipping_address\", $GLOBALS['ShopPath']));\n\t\t}\n\t\texit;\n\t}",
"public function updateBillingAddress() {\n Log::debug(\"Entering updateBillingAddress\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // update the existing billing adress or create a new one\n $address = $order->billingAddress;\n if (!isset($address))\n $address = new Address();\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->billing_address = $address->id;\n $order->save();\n }\n });\n }",
"private function ChooseShipperAndGoToBillingAddress()\n\t{\n\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\t\t$query = sprintf(\"select shipid from [|PREFIX|]shipping_addresses where shipcustomerid='%d'\", $GLOBALS['ISC_CLASS_DB']->Quote($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()));\n\t\t$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 1);\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\tif ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \" . $GLOBALS['ShopPath'] . \"/checkout.php?action=choose_shipper&address_id=\" . $row['shipid']);\n\t\t\tdie();\n\t\t}\n\t\telse {\n\t\t\t$this->ChooseShippingAddress();\n\t\t}\n\t}",
"public function isDefaultBillingAddress()\n {\n return $this->default_billing == 'Y' ? true : false;\n }",
"public function setOrderAddresses(\n Commerce_OrderModel $order,\n Commerce_AddressModel $shippingAddress,\n Commerce_AddressModel $billingAddress\n )\n {\n CommerceDbHelper::beginStackedTransaction();\n try {\n $result1 = craft()->commerce_customers->saveAddress($shippingAddress);\n\n if (($billingAddress->id && $billingAddress->id == $shippingAddress->id) || $shippingAddress === $billingAddress) {\n $result2 = true;\n } else {\n $result2 = craft()->commerce_customers->saveAddress($billingAddress);\n }\n\n $order->setShippingAddress($shippingAddress);\n $order->setBillingAddress($billingAddress);\n\n if ($result1 && $result2) {\n\n $order->shippingAddressId = $shippingAddress->id;\n $order->billingAddressId = $billingAddress->id;\n\n $this->saveOrder($order);\n CommerceDbHelper::commitStackedTransaction();\n\n return true;\n }\n } catch (\\Exception $e) {\n CommerceDbHelper::rollbackStackedTransaction();\n throw $e;\n }\n\n CommerceDbHelper::rollbackStackedTransaction();\n\n return false;\n }",
"public function SetOrderBillingAddress($address)\n\t{\n\t\t// The billing address attached to the quote, where the address should be stored\n\t\t$quoteBillingAddress = $this->getQuote()->getBillingAddress();\n\n\t\t// Is an address ID - so it needs to be fetched\n\t\tif(!is_array($address)) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($address,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\tif(!$address) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get the customer email address, if they're logged in\n\t\t\t$customer = getClass('ISC_CUSTOMER')->getCustomerInfo();\n\t\t\tif($customer) {\n\t\t\t\t$address['shipemail'] = $customer['custconemail'];\n\t\t\t}\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteBillingAddress->setCustomFields($formFields);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(!empty($address['customFormFields'])) {\n\t\t\t\t$quoteBillingAddress->setCustomFields($address['customFormFields']);\n\t\t\t}\n\t\t}\n\n\t\t// Store the billing address in the quote\n\t\t$quoteBillingAddress->setAddressByArray($address);\n\n\t\treturn true;\n\t}",
"private function isAddressSelected()\n {\n $result = false;\n\n try {\n $quote = $this->quoteRepository->get($this->getQuoteId(), ['*']);\n\n if ($quote->getShippingAddress() !== null) {\n $result = (bool)$quote->getShippingAddress()->getCustomerAddressId();\n }\n } catch (NoSuchEntityException $e) {\n // If no such entity, skip\n }\n\n return $result;\n }",
"public function check_shipping()\n\t{\n\t\tif((!isset($_SESSION['shipping']) || empty($_SESSION['shipping']))\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual'\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t\t&& $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if country of selected shipping address is not allowed\n\t\tif($_SESSION['sendto'] !== false \n\t\t && $_SESSION['cart']->content_type != 'virtual'\n\t\t && $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t && $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\tif($this->check_country_by_address_book_id($_SESSION['sendto']) == false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function getAddressBilling()\n {\n return $this->addressBilling;\n }",
"public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}",
"function edd_stripe_update_billing_address_field() {\n\t$payment_mode = strtolower( edd_get_chosen_gateway() );\n\tif ( edd_is_checkout() && 'stripe' !== $payment_mode ) {\n\t\treturn;\n\t}\n\n\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\tif ( empty( $existing_cards ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! did_action( 'edd_stripe_cc_form' ) ) {\n\t\treturn;\n\t}\n\n\t$default_card = false;\n\n\tforeach ( $existing_cards as $existing_card ) {\n\t\tif ( $existing_card['default'] ) {\n\t\t\t$default_card = $existing_card['source'];\n\t\t\tbreak;\n\t\t}\n\t}\n\t?>\n\t<p class=\"edd-stripe-update-billing-address-current\">\n\t\t<?php\n\t\tif ( $default_card ) :\n\t\t\t$address_fields = array( \n\t\t\t\t'line1' => isset( $default_card->address_line1 ) ? $default_card->address_line1 : null,\n\t\t\t\t'line2' => isset( $default_card->address_line2 ) ? $default_card->address_line2 : null,\n\t\t\t\t'city' => isset( $default_card->address_city ) ? $default_card->address_city : null,\n\t\t\t\t'state' => isset( $default_card->address_state ) ? $default_card->address_state : null,\n\t\t\t\t'zip' => isset( $default_card->address_zip ) ? $default_card->address_zip : null,\n\t\t\t\t'country' => isset( $default_card->address_country ) ? $default_card->address_country : null,\n\t\t\t);\n\n\t\t\t$address_fields = array_filter( $address_fields );\n\n\t\t\techo esc_html( implode( ', ', $address_fields ) );\n\t\tendif;\n\t\t?>\n\t</p>\n\n\t<p class=\"edd-stripe-update-billing-address-wrapper\">\n\t\t<input type=\"checkbox\" name=\"edd_stripe_update_billing_address\" id=\"edd-stripe-update-billing-address\" value=\"1\" />\n\t\t<label for=\"edd-stripe-update-billing-address\"><?php _e( 'Enter new billing address', 'edds' ); ?></label>\n\t</p>\n\t<?php\n}",
"function useMemberShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = false;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}",
"public function onCheckoutSaveBilling($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(1);\n $billing = $quote->getBillingAddress();\n $billing->setIsCheckout(1);\n }",
"public function getBillingAddress();",
"public function getBillingAddress();",
"public function getBillingAddress() : Address;",
"public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }",
"public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }",
"public static function include_confirmation_checkbox() {\n\n $address = edd_get_customer_address();\n $taxamo = taxedd_get_country_code();\n $stylecss = \"\";\n\n if ( isset($taxamo) ) {\n if ($taxamo->country_code == $address['country'] ) {\n $stylecss = ' style=\"display: none;\"';\n }\n }\n\n ?>\n\n\n <p id=\"edd-confirmation-checkbox\" <?php echo $stylecss; ?>>\n <label for=\"edd-vat-confirm\" class=\"edd-label\">\n <?php _e( 'By clicking this checkbox, I can confirm my billing address is valid and is located in my usual country of residence.', 'taxamoedd' ); ?>\n <input class=\"edd-self-declaration\" type=\"checkbox\" name=\"edd_self_declaration\" id=\"edd-self-declaration\" value=\"true\" />\n </label>\n <?php\n }",
"private function BeginMultipleAddressCheckout()\n\t{\n\t\t$this->getQuote()->setIsSplitShipping(true);\n\t\t$this->Checkout();\n\t}"
]
| [
"0.7289489",
"0.72602266",
"0.72127235",
"0.6615329",
"0.6605353",
"0.6592912",
"0.6454953",
"0.62867737",
"0.6274438",
"0.61980087",
"0.61537266",
"0.6151004",
"0.61016285",
"0.60891175",
"0.60596555",
"0.60578346",
"0.605712",
"0.59909105",
"0.5945812",
"0.59352434",
"0.5934562",
"0.5898473",
"0.5858515",
"0.58365726",
"0.58365726",
"0.5818321",
"0.58140683",
"0.5782782",
"0.5773802",
"0.57239866"
]
| 0.8210199 | 0 |
Uncheck the 'Same as billing address' checkbox in shipping address. | public function uncheckSameAsBillingShippingAddress()
{
$this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();
$this->browser->find($this->accountInformationBlock)->hover();
$this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('No');
$this->waitLoader();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');\n }",
"public function set_ship_to_different_address( $checked ) {\n\n\t\t$details = WC()->session->get( 'wc_braintree_paypal_cart_customer_details', array() );\n\n\t\tif ( ! empty( $details ) ) {\n\n\t\t\tunset( $details['billing']['email'] );\n\t\t\tunset( $details['billing']['phone'] );\n\n\t\t\tif ( empty( $details['shipping'] ) ) {\n\t\t\t\t$checked = false;\n\t\t\t} elseif ( empty( $details['billing'] ) || $details['billing'] !== $details['shipping'] ) {\n\t\t\t\t$checked = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $checked;\n\t}",
"public function turnOffShippingAddressCollection()\n {\n $this->getPayPalRequest()->setParameter(\"NOSHIPPING\", \"2\");\n }",
"public function unset_sess_cart_shipping_address()\n {\n if (!empty($this->session->userdata('mds_cart_shipping_address'))) {\n $this->session->unset_userdata('mds_cart_shipping_address');\n }\n }",
"private function disableSendingAddressInformation(Payment $payment): void\n {\n $payment->setShipping()->setAddressRequired()->withParameters(\"false\");\n }",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"private function ignoreAddressValidation()\n {\n $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_quote->getIsVirtual()) {\n $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_config->getValue('requireBillingAddress')\n && !$this->_quote->getBillingAddress()->getEmail()\n ) {\n $this->_quote->getBillingAddress()->setSameAsBilling(1);\n }\n }\n }",
"public function SetOrderShippingAddress($address, $isBilling = false)\n\t{\n\t\t// The shipping address attached to the quote, where the address should be stored\n\t\t$quoteShippingAddress = $this->getQuote()\n\t\t\t->setIsSplitShipping(false)\n\t\t\t->getShippingAddress();\n\n\t\t// Is an address ID - so it needs to be fetched\n\t\tif(!is_array($address)) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($address,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\tif(!$address) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get the customer email address, if they're logged in\n\t\t\t$customer = getClass('ISC_CUSTOMER')->getCustomerInfo();\n\t\t\tif($customer) {\n\t\t\t\t$address['shipemail'] = $customer['custconemail'];\n\t\t\t}\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(!empty($address['customFormFields'])) {\n\t\t\t\tif($isBilling == true) {\n\t\t\t\t\t$address['customFormFields'] =\n\t\t\t\t\t\t$this->mapBillingFieldsToShipping($address['customFormFields']);\n\t\t\t\t}\n\t\t\t\t$quoteShippingAddress->setCustomFields($address['customFormFields']);\n\t\t\t}\n\t\t}\n\n\t\t// Store the billing address in the quote\n\t\t$quoteShippingAddress->setAddressByArray($address);\n\t\treturn true;\n\t}",
"public function isBillingEqualShipping()\n {\n $user = Shopware()->Modules()->Admin()->sGetUserData();\n\n $billingAddress = $user[\"billingaddress\"][\"street\"].' '.$user[\"billingaddress\"][\"city\"].\n ' '.$user[\"billingaddress\"][\"zipcode\"].' '.$user[\"billingaddress\"][\"countryID\"];\n\n $shippingAddress = $user[\"shippingaddress\"][\"street\"].' '.$user[\"shippingaddress\"][\"city\"].\n ' '.$user[\"shippingaddress\"][\"zipcode\"].' '.$user[\"shippingaddress\"][\"countryID\"];\n\n if ($billingAddress == $shippingAddress) {\n return true;\n }\n return false;\n }",
"function deleteAddress() {\n\t\tif (!in_array(intval($this->piVars['addressid']), array_keys($this->addresses))) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Hook to delete an address\n\t\t$hookObjectsArr = array();\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi4/class.tx_commerce_pi4.php']['deleteAddress'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi4/class.tx_commerce_pi4.php']['deleteAddress'] as $classRef) {\n\t\t\t\t$hookObjectsArr[] = &t3lib_div::getUserObj($classRef);\n\t\t\t}\n\t\t}\n\t\tforeach($hookObjectsArr as $hookObj) {\n\t\t\tif (method_exists($hookObj, 'deleteAddress')) {\n\t\t\t\t$message = $hookObj->deleteAddress((int)$this->piVars['addressid'], $this);\n\t\t\t}\n\t\t}\n\n\t\tif ($message) {\n\t\t\t$this->sysMessage = $message;\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t'tt_address',\n\t\t\t'uid=' . intval($this->piVars['addressid']),\n\t\t\tarray(\n\t\t\t\t'deleted' => 1\n\t\t\t)\n\t\t);\n\n\t\tunset($this->addresses[intval($this->piVars['addressid']) ]);\n\t\tunset($this->piVars['confirmed']);\n\t}",
"public function isSetShipFromAddress()\n {\n return !is_null($this->_fields['ShipFromAddress']['FieldValue']);\n }",
"public function onCheckoutSaveBilling($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(1);\n $billing = $quote->getBillingAddress();\n $billing->setIsCheckout(1);\n }",
"function useDifferentShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = true;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}",
"function useMemberShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = false;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}",
"public function needs_shipping_address() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping_address', true === $this->needs_shipping() && ! wc_ship_to_billing_address_only() );\n\t}",
"private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}",
"public function setShippingAddress(?Address $shippingAddress): void\n {\n $this->shippingAddress = $shippingAddress;\n }",
"public function reset_shipping() {\n\t\tunset( WC()->session->chosen_shipping_methods );\n\t\t$this->shipping_total = null;\n\t\t$this->shipping_taxes = array();\n\t\t$this->packages = array();\n\t}",
"public function unsetDefaultShippingAddress($member_srl){\n $args = new stdClass();\n $args->member_srl = $member_srl;\n $args->default_shipping = 'N';\n return $this->query('updateDefaultShippingAddress',$args);\n }",
"public function updateBillingAddress() {\n Log::debug(\"Entering updateBillingAddress\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // update the existing billing adress or create a new one\n $address = $order->billingAddress;\n if (!isset($address))\n $address = new Address();\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->billing_address = $address->id;\n $order->save();\n }\n });\n }",
"public function wc_address_book_delete( $address_name ) {\n\n\t\t$address_name = $_POST['name'];\n\t\t$customer_id = get_current_user_id();\n\t\t$address_book = $this->get_address_book( $customer_id );\n\t\t$address_names = $this->get_address_names( $customer_id );\n\n\t\tforeach ( $address_book as $name => $address ) {\n\n\t\t\tif ( $address_name === $name ) {\n\n\t\t\t\t// Remove address from address book.\n\t\t\t\t$key = array_search( $name, $address_names, true );\n\t\t\t\tif ( ( $key ) !== false ) {\n\t\t\t\t\tunset( $address_names[ $key ] );\n\t\t\t\t}\n\n\t\t\t\t$this->save_address_names( $customer_id, $address_names );\n\n\t\t\t\t// Remove specific address values.\n\t\t\t\tforeach ( $address as $field => $value ) {\n\n\t\t\t\t\tdelete_user_meta( $customer_id, $field );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_ajax() ) {\n\t\t\tdie();\n\t\t}\n\t}",
"protected function processShippingAddress()\n {\n $this->updateStreetFields($this->addressFields['children']['street'], 'shippingAddress');\n\n if(false === $this->configResolver->getUseRegions()){\n unset($this->addressFields['children']['region']['filterBy']);\n unset($this->addressFields['children']['region_id']);\n }\n\n foreach ($this->fieldsConfig as $fieldName => $config) {\n $field = &$this->addressFields['children'][$fieldName];\n $this->configureField($field, 'shippingAddress', $config);\n }\n }",
"public function unsetNonProfitAddress($index)\n {\n unset($this->nonProfitAddress[$index]);\n }",
"public function setIgnoreValidation() {\r\n\t\t$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\r\n\t\t$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\r\n\t}",
"public function deleteBackupShippingMethod()\n {\n return true;\n }",
"public function unsetDefaultBillingAddress($member_srl){\n $args = new stdClass();\n $args->member_srl = $member_srl;\n $args->default_billing = 'N';\n return $this->query('updateDefaultBillingAddress',$args);\n }",
"public function disableSelectingDifferentAddressInPayPal()\n {\n $this->getPayPalRequest()->setParameter(\"ADDROVERRIDE\", \"1\");\n }",
"protected function removeItemAddressesThatAreEqualToOrderAddress($order)\n {\n $deliveryAddressId = $order->getDeliveryAddress()->getContactAddress()->getId();\n foreach ($order->getItems() as $item) {\n $itemEntity = $item->getEntity();\n $this->removeOrderAddressIfContactAddressIdIsEqualTo($itemEntity, $deliveryAddressId);\n }\n }",
"public function setShippingAddress($shippingAddress = '') {\n $address = array(\n 'x_ship_to_address'=>$this->truncateChars($shippingAddress, 60),\n );\n $this->NVP = array_merge($this->NVP, $address); \n }",
"public function setBillingAddress(?Address $billingAddress): void\n {\n $this->billingAddress = $billingAddress;\n }"
]
| [
"0.7044091",
"0.63891894",
"0.6298717",
"0.6173141",
"0.5616326",
"0.5580946",
"0.5524105",
"0.551126",
"0.5367759",
"0.5284583",
"0.52657604",
"0.5242602",
"0.5231994",
"0.5230433",
"0.5220637",
"0.5208659",
"0.5207737",
"0.5182705",
"0.51771134",
"0.51303905",
"0.51043916",
"0.50804883",
"0.5067803",
"0.5024907",
"0.5001869",
"0.499071",
"0.4981591",
"0.4978348",
"0.49660447",
"0.49333638"
]
| 0.8704405 | 0 |
Wait for form loading. | private function waitFormLoading()
{
$this->_rootElement->click();
$this->browser->waitUntil(
function () {
return $this->browser->find($this->waitElement)->isVisible() ? null : true;
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function waitFormToLoad()\n {\n $browser = $this->browser;\n $selector = $this->formSelector;\n $browser->waitUntil(\n function () use ($browser, $selector) {\n $element = $browser->find($selector);\n return $element->isVisible() ? true : null;\n }\n );\n }",
"function loadFromForm() \n {\n\n }",
"protected function loadForm()\n {\n $form = $this->createForm();\n\n $bridge = $this->model->getBridgeFor('form', $form);\n\n $this->addFormElements($bridge, $this->model);\n\n $this->form = $bridge->getForm();\n }",
"protected function loadFormData()\n\t{\n\t}",
"public function iWaitForAjaxToFinish() {\n $this->getSession()->wait(10000, '(typeof(jQuery)==\"undefined\" || (0 === jQuery.active && 0 === jQuery(\\':animated\\').length))');\n }",
"public function loadForm()\n\t{\n\t\tJForm::addFormPath(__DIR__ . '/forms');\n\t\t$this->form = JForm::getInstance('com_monitor.project', 'project');\n\n\t\tif ($data = $this->app->getUserState($this->form->getName() . '.data'))\n\t\t{\n\t\t\t$this->form->bind($data);\n\t\t}\n\t\telseif ($this->projectId)\n\t\t{\n\t\t\t$this->form->bind($this->getProject());\n\t\t}\n\t}",
"public function iWaitForAjax() {\n $this->getSession()->wait(5000, 'typeof jQuery !== \"undefined\" && jQuery.active === 0');\n }",
"public function testFormLoad()\n {\n // initialize a module with a form.\n P4Cms_Module::setCoreModulesPath(TEST_ASSETS_PATH . '/core-modules');\n P4Cms_Module::fetch('Core')->init();\n\n // if registered, de-register it.\n if ($this->_isRegistered()) {\n $this->_disableAutoloader();\n }\n\n $this->assertFalse(\n class_exists('Core_Form_TestForm'),\n \"Core_Form_TestForm class should not be registered\"\n );\n\n $this->_enableAutoloader();\n $this->assertTrue(\n class_exists('Core_Form_TestForm'),\n \"Core_Form_TestForm class should be registered\"\n );\n }",
"function training_load_form_callback($js) {\n if (!$js) {\n return drupal_get_form('training_modal_load_files_form');\n }\n ctools_include('modal');\n ctools_include('ajax');\n $form_state = array(\n 'ajax' => TRUE,\n 'title' => t('Upload files form'),\n );\n $commands = ctools_modal_form_wrapper('training_modal_load_files_form', $form_state);\n if (!empty($form_state['executed'])) {\n $commands = array();\n $commands[] = ctools_ajax_command_reload();\n $commands[] = ctools_modal_command_dismiss();\n }\n print ajax_render($commands);\n exit;\n}",
"public function populateForm() {}",
"public function loadForm()\n {\n if ( $this->request->getFormField( '__formId' ) != $this->formId )\n return false;\n\n $serialized = $this->request->getFormField( '__viewState' );\n if ( !empty( $serialized ) )\n $this->loadViewState( $serialized );\n\n $formFields = $this->request->getFormFields();\n foreach ( $this->fields as $key => &$value ) {\n if ( isset( $formFields[ $key ] ) )\n $value = $formFields[ $key ];\n }\n\n return true;\n }",
"protected function Form_Run() {}",
"protected function loadForm(): void\n {\n $rbtHiddenValues = [\n ['label' => BL::lbl('Hidden'), 'value' => 1],\n ['label' => BL::lbl('Published'), 'value' => 0],\n ];\n $internalLinks = BackendSpotlightsModel::getInternalLinks();\n\n // create form\n $this->form = new BackendForm('add');\n\n $this->form->addText('title', null, null, 'form-control title', 'form-control danger title');\n $this->form->addEditor('text');\n $this->form->addText('link', null, null);\n $this->form->addDropdown('categories', $this->categories);\n $this->form->addImage('image');\n $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);\n $this->form->addText('link_title');\n $this->form->addCheckbox('external_link');\n $this->form->addText('external_url');\n $this->form->addDropdown('internal_url', $internalLinks, '',\n false,\n 'chzn-select'\n )->setDefaultElement('');\n\n // meta\n $this->meta = new BackendMeta($this->form, null, 'title', true);\n\n }",
"private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }",
"public function submit()\n {\n $this->waitFor(20000, function () {\n return $this->present();\n });\n $this->xpath($this->selectors['submit'])->click();\n $this->waitFor(20000, function () {\n return $this->xpath($this->selectors['formSubmitted']) !== null;\n });\n }",
"private function please_wait_page($UID) {\n\t\t\tcfs_show_header(plugins_url( '', __FILE__ ), \"Please wait\");\n\t\t\t?>\n\t\t\t<div class=\"container theme-showcase\" role=\"main\">\n\t\t\t <!-- Main jumbotron for a primary marketing message or call to action -->\n\t\t\t <div class=\"jumbotron\">\n\t\t\t\t<?php $this->spinner_html(); ?>\n\t\t\t\t<h2 id=\"msg1\">Working... <span id=\"countDown\"></span></h2>\n\t\t\t\t<div id=\"msg2\"></div>\n\t\t\t\t<div id=\"msg3\"></div>\n\t\t\t\t<div id=\"errmsg\"></div>\n\t\t\t </div>\n\t\t\t</div> <!-- / .container -->\n\t\t\t<?php\n\t\t\tcfs_show_js_libs();\n\t\t\techo \"\\n<script type='text/javascript'>var cfs_uid='$UID';</script>\";\n\t\t\t$js_path = plugins_url( '/js/wait_page.js', __FILE__ );\n\t\t\techo \"\\n<script src='${js_path}'></script>\\n\";\n\t\t\tcfs_show_footer();\n\t\t}",
"function show_wait_message()\n\t\t{\n\t\t\tif(!@is_object($GLOBALS['egw']->js))\n\t\t\t{\n\t\t\t\t$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');\n\t\t\t}\n\t\t\t$please_wait=lang('Please wait, task in progress ...');\n\t\t\t$GLOBALS['egw_info']['flags']['java_script'] .= '<script type=\"text/javascript\">\n\t\t\t\tdocument.write(\\'<DIV id=\"loading\"><BR><BR>\\'+\"'.$please_wait.'\" +\\'</DIV>\\');\n\t\t\t\tfunction hide_loading()\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"loading\").style.display=\"none\";\n\t\t\t\t}</script>';\n\t\t\t$GLOBALS['egw']->js->set_onload('hide_loading();');\n\t\t}",
"function process_form()\n {\n }",
"public function testPrepareForm()\n {\n $this->markTestIncomplete('This test has not been implemented yet.');\n }",
"public function iWaitForTheBatchJobToFinish() {\n $this->getSession()->wait(180000, 'jQuery(\"#updateprogress\").length === 0');\n }",
"function load_bank_form()\n\t{\n\t\tlog_message('debug', 'Account/load_bank_form');\n\t\t$data = filter_forwarded_data($this);\n\n\t\tif($this->native_session->get('__data')) $data = array_merge($data, $this->native_session->get('__data'));\n\t\t$data['area'] = !empty($data['a'])? $data['a']: 'login_form';\n\t\tif(empty($data['response'])) $data['response']['resolve'] = 'ERROR: No response was received from your bank. <br>Please notify us about this error so that we can follow up.';\n\n\t\t$this->load->view('account/bank_forms', $data);\n\t}",
"public function psxFormIsCompleted()\n {\n // TODO: Remove all code related to PSX form. Since it's not used any more we return true to be sure to not make any breaking changes\n return true;\n//\n// if (getenv('PLATEFORM') === 'PSREADY') { // if on ready, the user is already onboarded\n// return true;\n// }\n//\n// return !empty($this->getPsxForm());\n }",
"public function loadForm()\n {\n $this->load->library(array('form_validation'));\n $this->load->helper(array('form', \"url\"));\n }",
"private function run() {\n\t\t\t$this->initRequestValidator();\n\t\t\t$this->printToolHead();\n\t\t\t\n\t\t\tif ($this->rq->allRequiredDefined() == true) {\n\t\t\t\t$this->formSubmitted();\n\t\t\t}\n\t\t}",
"function loadFromForm() \r\n {\t \t\r\n\t parent::loadFromForm();\r\n\t \r\n// \t $this->formName = $_REQUEST['form_name']; \t \r\n// \t \r\n// // \t echo 'Inside load_from_form of main page: <pre>'.print_r($this->formValues,true).'</pre><br>';\t \r\n// \t \r\n// \t\tswitch($this->formName) {\r\n// \t\t\t\r\n// \t\t\tcase 'basicStaffForm':\r\n// \t\t\t\t \r\n// \t\t\t\t$this->active_subPage = $this->basic_form;\t\r\n// \t\t\t\tbreak;\r\n// \t\t\tcase 'scheduledActivityForm':\r\n\r\n// \t\t\t\t$this->active_subPage = $this->optional_sheduled_activity_form;\t \r\n// \t\t\t\tbreak;\t\t\t\r\n// \t\t\tdefault:\r\n// \t\t\t\tdie('VALID FORM NAME **NOT** FOUND; name = '.$this->formName);\r\n// \t\t} \r\n// \t\t$this->active_subPage->loadFromForm(); \r\n// \t\t$this->form_submitted = true; \r\n \r\n }",
"public function execute()\n\t{\n\t\t$opf = Opl_Registry::get('opf');\n\n\t\t$this->invokeEvent('preInit');\n\t\t$this->onInit();\n\t\t$this->invokeEvent('postInit');\n\n\t\t// Validate the input data.\n\t\t$data = $this->_retrieveData();\n\n\t\t// Decide, if the form has been sent to us.\n\t\tif($_SERVER['REQUEST_METHOD'] == $this->_method && isset($data[$opf->formInternalId]))\n\t\t{\n\t\t\t// Get the internal data and remove them from the \"official\" scope.\n\t\t\t$internals = $data[$opf->formInternalId];\n\t\t\tunset($data[$opf->formInternalId]);\n\n\t\t\t// The names must match.\n\t\t\tif(isset($internals['name']) && $internals['name'] == $this->_name)\n\t\t\t{\n\t\t\t\t$this->_step = 0;\n\t\t\t\tif(isset($internals['step']))\n\t\t\t\t{\n\t\t\t\t\t$this->_step = (integer)$internals['step'];\n\t\t\t\t}\n\t\t\t\t$tracker = $this->getTracker();\n\t\t\t\t$tracker->setSequence($this);\n\t\t\t\t$current = 0;\n\t\t\t\twhile($current < $this->_step)\n\t\t\t\t{\n\t\t\t\t\t// Get the current form and advance the placeholder pointer.\n\t\t\t\t\t$form = $this->getNextSubform();\n\n\t\t\t\t\t// Attempt to ensure that the tracked data are still valid.\n\t\t\t\t\t$formData = $tracker->retrieve($internals, $current);\n\t\t\t\t\t$current++;\n\n\t\t\t\t\t$state = $form->_validate($formData);\n\t\t\t\t\tif(!$state)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_step = $current;\n\t\t\t\t\t\t$this->_state = $form->_state = self::ERROR;\n\t\t\t\t\t\t$form->populate($data);\n\t\t\t\t\t\t$form->_onRender($this->_view);\n\t\t\t\t\t\t$this->_onRender($this->_view);\n\t\t\t\t\t\t$this->invokeEvent('preRender');\n\t\t\t\t\t\t$form->invokeEvent('preRender');\n\t\t\t\t\t\t$form->onRender();\n\t\t\t\t\t\t$form->invokeEvent('postRender');\n\t\t\t\t\t\t$this->invokeEvent('postRender');\n\t\t\t\t\t\treturn $this->_state;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$form = $this->getNextSubform();\n\t\t\t\t// Now, the currently displayed form.\n\t\t\t\t$state = $form->_validate($data);\n\t\t\t\tif(!$state)\n\t\t\t\t{\n\t\t\t\t\t$this->_state = $form->_state = self::ERROR;\n\t\t\t\t\t$form->populate($data);\n\t\t\t\t\t$form->_onRender($this->_view);\n\t\t\t\t\t$form->invokeEvent('preRender');\n\t\t\t\t\t$form->onRender();\n\t\t\t\t\t$form->invokeEvent('postRender');\n\t\t\t\t\treturn $this->_state;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tracker->track($data, $current);\n\t\t\t\t\t$form->_state = self::ACCEPTED;\n\t\t\t\t}\n\t\t\t\t// Decide, what to do next: display another form or return\n\t\t\t\t$this->_step++;\n\t\t\t\tif(($form = $this->getNextSubform()) === false)\n\t\t\t\t{\n\t\t\t\t\t$this->_state = self::ACCEPTED;\n\t\t\t\t\t$this->invokeEvent('preAccept');\n\t\t\t\t\t$this->onAccept();\n\t\t\t\t\t$this->invokeEvent('postAccept');\n\t\t\t\t\treturn $this->_state;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->_state = $form->_state = self::RENDER;\n\t\t\t\t\t$form->_onRender($this->_view);\n\t\t\t\t\t$this->_onRender($this->_view);\n\t\t\t\t\t$form->invokeEvent('preRender');\n\t\t\t\t\t$form->onRender();\n\t\t\t\t\t$form->invokeEvent('postRender');\n\t\t\t\t\treturn $this->_state;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$form = $this->getNextSubform();\n\t\t$this->_state = $form->_state = self::RENDER;\n\t\t$form->_onRender($this->_view);\n\t\t$this->_onRender($this->_view);\n\t\t$form->invokeEvent('preRender');\n\t\t$form->onRender();\n\t\t$form->invokeEvent('postRender');\n\t\treturn $this->_state;\n\t}",
"private function assertOffCanvasFormAfterWait(string $expected_form_id): void {\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->waitForOffCanvasArea();\n $off_canvas = $this->assertSession()->elementExists('css', '#drupal-off-canvas');\n $this->assertNotNull($off_canvas);\n $form_id_element = $off_canvas->find('hidden_field_selector', ['hidden_field', 'form_id']);\n // Ensure the form ID has the correct value and that the form is visible.\n $this->assertNotEmpty($form_id_element);\n $this->assertSame($expected_form_id, $form_id_element->getValue());\n $this->assertTrue($form_id_element->getParent()->isVisible());\n }",
"private function findForm(){\n\n\t\t$results = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`form`.`id` \t\t\tas 'id',\n\t\t\t\t`form`.`label` \t\t\tas 'label',\n\t\t\t\t`form`.`confirm_submit` as 'confirm_submit',\n\t\t\t\t`form`.`date_available` as 'date_available',\n\t\t\t\t`form`.`date_expire` \tas 'date_expire'\n\t\t\tFROM `mark_reg_forms` as `form`\n\t\t\tWHERE\n\t\t\t\t`form`.`id` = %d\n\t\t\t\tAND `form`.`enabled` = 1\n\t\t\", $this->form_id));\n\n\t\tif(count($results)):\n\t\t\t$this->form_confirm_submit\t= $results[0]->confirm_submit;\n\t\t\t$this->form_label \t\t\t= $results[0]->label;\n\t\t\t$this->form_date_available\t= $results[0]->date_available;\n\t\t\t$this->form_date_expire\t\t= $results[0]->date_expire;\n\t\t\t$this->form_name\t\t\t= 'mark_reg_form_'.$this->form_id;\n\t\telse:\n\t\t\t$this->log(\"FORM NOT FOUND FOR ID: $this->form_id\");\n\t\tendif;\n\t}",
"public function needForm()\n {\n return true;\n }",
"public function turnOnWaitingChecks()\n {\n $this->isModal = false;\n return;\n }"
]
| [
"0.851611",
"0.6307039",
"0.6257618",
"0.5820313",
"0.5820275",
"0.5818406",
"0.58022374",
"0.579065",
"0.5763735",
"0.5674831",
"0.55756193",
"0.5532999",
"0.5512858",
"0.5459693",
"0.5458476",
"0.5410221",
"0.5409031",
"0.53905845",
"0.5363178",
"0.5352831",
"0.53275335",
"0.5324981",
"0.5301157",
"0.5296",
"0.5292549",
"0.5230626",
"0.5213498",
"0.5203298",
"0.5178826",
"0.5175682"
]
| 0.8859467 | 0 |
Check whether $word starts with $prefix. | public static function startsWith(string $prefix, string $word): bool
{
return \preg_match(\sprintf('#^%s#', $prefix), $word);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isPrefix($word): bool\n {\n return (array_key_exists($this->getKey($word), $this->prefixes));\n }",
"public static function startsWith($str, $prefix) {\n\t\treturn $prefix === '' || strpos($str, $prefix) === 0;\n\t}",
"public function startsWith($prefix);",
"public function startsWith($prefix) {\n return mb_strpos($this->rawString, $prefix, 0, $this->charset) === 0;\n }",
"public function startsWithIgnoreCase($prefix) {\n return mb_stripos($this->rawString, $prefix, 0, $this->charset) === 0;\n }",
"function has_prefix($string, $prefix)\n {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"function has_prefix($string, $prefix) {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }",
"function startsWith($prefix)\n {\n if (empty($prefix)) {\n return false;\n }\n $endNode = $this->searchEndNode($prefix);\n return $endNode != null;\n }",
"public static function startsWith($input, $prefix)\n {\n self::initialize();\n\n return substr($input, 0, strlen($prefix)) === $prefix;\n }",
"function startsWith($prefix) {\n $cur = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $c = substr($prefix, $i, 1);\n if (!isset($cur->next[$c])) {\n return false;\n }\n $cur = $cur->next[$c];\n }\n return true;\n }",
"function starts_with(string $string, string $prefix, Encoding $encoding = Encoding::UTF_8): bool\n{\n /** @psalm-suppress MissingThrowsDocblock */\n return 0 === search($string, $prefix, 0, $encoding);\n}",
"function startsWith($prefix)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"function startsWith($prefix)\n {\n $node = $this;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"function isPrefix($prefix, $string){\n\t\tif(strlen($prefix) > strlen($string)){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn (substr($string, 0, strlen($prefix)) == $prefix);\n\t\t}\n\t}",
"function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static function startsWith($value, $prefix)\n {\n return (0 === strpos($value, $prefix)) ? true : false;\n }",
"static function stringStartsWith($prefix)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::stringStartsWith', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public static function hasPrefix($string, $prefix)\r\n {\r\n if (strpos($string, $prefix) === 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"protected function _startsWith($str, $startswith)\n\t{\n\t\t$length = strlen($startswith);\n\t\t\n\t\treturn (substr($str, 0, $length)) == $startswith;\n\t}",
"public static function startsWith($string, $prefix, $ignoreCase = false)\n {\n if ($ignoreCase) {\n $string = strtolower($string);\n $prefix = strtolower($prefix);\n }\n\n return $prefix == substr($string, 0, strlen($prefix));\n }",
"public static function startsWith($string, $start)\n {\n return strpos($string, $start) === 0;\n }",
"function starts_with($text = '', $substring = '') {\n return (strpos(mb_strtolower($text), mb_strtolower($substring)) === 0);\n}",
"private function tag_matches_prefix($v)\n {\n return preg_match(\"/{$this->instance['prefix']}/\", $v->name)\n ? true\n : false\n ;\n }",
"static function start(string $s, string $prefix): string {\n if (self::startsWith($s, $prefix)) {\n return $s;\n }\n\n return $prefix.$s;\n }",
"function str_start($value, $prefix)\n {\n return Str::start($value, $prefix);\n }",
"public function assertStringStartsWith($prefix, $string, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringStartsWith', func_get_args()));\n }",
"public function assertStringStartsWith($prefix, $string, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringStartsWith', func_get_args()));\n }",
"function startsWith(string $haystack = null, string $needle = null): bool {\n if (empty($haystack) || empty($needle)) {\n return false;\n }\n return $haystack[0] === $needle[0]\n ? \\strncmp($haystack, $needle, strlen($needle)) === 0\n : false;\n}",
"static function isStartWith($haystack, $needle)\n {\n return (substr($haystack, 0, strlen($needle)) == $needle);\n }"
]
| [
"0.7902205",
"0.7798422",
"0.76830834",
"0.7666427",
"0.75608695",
"0.74137527",
"0.74093074",
"0.7396006",
"0.73260844",
"0.7295106",
"0.72742194",
"0.7192292",
"0.7119859",
"0.71086895",
"0.7051964",
"0.69632506",
"0.69427425",
"0.6939426",
"0.66984206",
"0.66019696",
"0.65260726",
"0.6513836",
"0.64747894",
"0.6409614",
"0.639144",
"0.63659364",
"0.633018",
"0.633018",
"0.6322034",
"0.630496"
]
| 0.9183985 | 0 |
Check whether $token matches a given syntax pattern. | public static function hasSyntax($token, string $syntax = self::VAR_SYNTAX): bool
{
if (!\is_array($token)) {
return false;
}
$regexp = \sprintf('#%s#', $syntax);
return (bool) \preg_match($regexp, $token[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function match($token)\n {\n $lookaheadType = $this->lexer->lookahead['type'];\n\n if ($lookaheadType !== $token && ($token !== Lexer::T_TYPE || $lookaheadType <= Lexer::T_TYPE)) {\n throw $this->syntaxError($this->lexer->getLiteral($token));\n }\n\n $this->lexer->moveNext();\n }",
"private function tokensMatchPattern(\n array $tokenList,\n array $pattern\n ) {\n $matches = count($tokenList) === count($pattern);\n\n foreach ($tokenList as $index => $token) {\n if ($matches) {\n $matches = $pattern[$index] === $token->getType();\n }\n }\n\n return $matches;\n }",
"public function validate_token($token) {\n\t\t$splittedtoken = explode('-', $token);\n\t\t$offset = hexdec($splittedtoken[0]);\n\t\t$value = $splittedtoken[1];\n\t\treturn ($this->calculate_tokenvalue($offset) === $value);\n\t}",
"private function matchesPattern($pattern)\n {\n if (preg_match('/' . $pattern . '/u', $this->str)) {\n return true;\n } else {\n return false;\n }\n }",
"protected function match($token)\n {\n if (!is_array($token)) {\n $token = array($token);\n }\n\n foreach ($token as $t) {\n if (strlen($t) === 1) {\n $match = $this->matchChar($t);\n } elseif ($t[0] !== '/') {\n // Non-terminal, match using a function call\n $match = $this->$t();\n } else {\n $match = $this->matchReg($t);\n }\n\n if ($match) {\n return $match;\n }\n }\n }",
"static function matchesRegularExpression($pattern)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::matchesRegularExpression', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function matches(Pattern $pattern);",
"public static function isValidRegEx( $pattern ) {\n\t\t// validate first for allowd delimiters '/%|' and flags\n\t\tif ( !preg_match( '/^([\\\\/\\\\|%]).*\\\\1[imsSuUx]*$/', $pattern ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tAtEase::suppressWarnings(); // instead of using the evil @ operator!\n\t\t$isValid = preg_match( $pattern, ' ' ) !== false; // preg_match returns false on error\n\t\tAtEase::restoreWarnings();\n\t\treturn $isValid;\n\t}",
"public function isValid($token)\n {\n $expected = $this->getToken();\n return $expected === null || $expected === $token;\n }",
"static public function is_pattern(string $pattern): bool\n\t{\n\t\treturn (strpos($pattern, '<') !== false) || (strpos($pattern, ':') !== false) || (strpos($pattern, '*') !== false);\n\t}",
"public function hasOperator(string $token): bool;",
"abstract protected function isStartToken(string $token) : bool;",
"static public function is_pattern($pattern)\n\t{\n\t\treturn (strpos($pattern, '<') !== false) || (strpos($pattern, ':') !== false);\n\t}",
"public function hasTokens($token): bool\n {\n return in_array($token, $this->tokens);\n }",
"public static function check_token($token)\r\n {\r\n if ($token == $_SESSION['token'])\r\n return true;\r\n\r\n return false;\r\n }",
"public function isMatch($pat) {\r\n $result = preg_match($pat, $this->contents /*, $matches*/);\r\n //var_dump($pat); // debug patterns\r\n //if ($pat == NULL) debug_print_backtrace();\r\n //var_dump($matches); // debug patterns\r\n //var_dump($result); // debug patterns\r\n //if ($matches == NULL) debug_print_backtrace();\r\n //if ($result === FALSE) debug_print_backtrace();\r\n return $result;\r\n }",
"public function matches($pattern)\n\t{\n\t\treturn (bool) preg_match('#^'.$pattern.'#', $this->string);\n\t}",
"public function preg_match_PLAIN($pattern)\n\t{\n\t\treturn (bool)preg_match($pattern,$this->PLAIN);\n\t}",
"public function validate($token);",
"public function hasToken();",
"public function validate(string $token): bool\n {\n $string = $this->numberArray($token);\n return $this->setNumberArray($string)->isValid();\n }",
"function isValidToken($token){\r\n global $pdo;\r\n\t\t$select = $pdo->prepare(\"SELECT 1 FROM device_registry \r\n\t\t\tWHERE token = ?\");\r\n\t\t$select->execute(array($token));\r\n \tif($select->fetchColumn()){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function isValidToken( $token )\n {\n $count = $this->repo->getPasswordRemindersCount( $token );\n\n return ($count != 0);\n }",
"public function validate ( $token ) { return $this->server->token2uid( $token ) > 0; }",
"private function _validate( string $token ): void {\n\t\t\tif ( $token === '' ) {\n\t\t\t\tUtil::error( \"SyntaxError\" );\n\t\t\t}\n\t\t\tif ( strlen( $token ) !== strcspn( $token, \"\\t\\r\\n\\f \" ) ) {\n\t\t\t\tUtil::error( \"InvalidCharacterError\" );\n\t\t\t}\n\t}",
"function match(string $string, string $pattern): bool\n{\n $specialCharacters = ['\\\\', '^', '$', '|', '?', '+', '(', ')', '[', '{'];\n $replacementCharacter = ['\\\\\\\\', '\\^', '\\$', '\\|', '\\?', '\\+', '\\(', '\\)', '\\[','\\{'];\n\n for($i = 0; $i < count($specialCharacters); $i++) {\n $pattern = str_replace($specialCharacters[$i], $replacementCharacter[$i], $pattern);\n }\n\n return preg_match(\"/^\".$pattern .\"$/\", $string);\n}",
"function validate_token($token, $procedure, $expiry = 5)\n\t{\n\t\t// parsing passed token, checking proper syntax\n\t\tif (is_array($strings = explode(\"\\n\", $token)))\n\t\t{\n\t\t\t[$token_time, $token_proc] = explode('|', $strings[0]);\n\t\t\t$token_mac = $strings[1];\n\n\t\t\t// something's wrong with the input\n\t\t\tif (!$token_time || !$token_proc || !$token_mac)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// recalculating MAC\n\t\t$new_mac = hash('sha1', $this->engine->db->system_seed . $this->sid . $token_time . $token_proc);\n\n\t\t// validating conditions. exact order is crucial!\n\t\tif ($token_mac !== $new_mac)\n\t\t{\n\t\t\t// MAC mismatch\n\t\t\treturn false;\n\t\t}\n\t\telse if ($token_proc !== $procedure)\n\t\t{\n\t\t\t// procedure mismatch\n\t\t\treturn false;\n\t\t}\n\t\telse if (time() > ($expiry * 60 + $token_time))\n\t\t{\n\t\t\t// token expired\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}",
"private function matchAppToken($token=''){\n\t\tif($token!=''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function preg_test(string $pattern, string $subject): bool\n{\n $res =@ preg_match($pattern, $subject);\n\n // Act as original.\n if ($res === false) {\n $message = preg_error_message(func: 'preg_match');\n trigger_error(sprintf('%s(): %s', __function__, $message), E_USER_WARNING);\n }\n\n return (bool) $res;\n}",
"public static function tokenIs($token, string $which): bool\n {\n if (!\\is_array($token)) {\n return false;\n }\n\n return \\token_name($token[0]) === $which;\n }"
]
| [
"0.66204137",
"0.64315945",
"0.6400936",
"0.6372737",
"0.6367848",
"0.6275672",
"0.6250349",
"0.62437993",
"0.6214156",
"0.6141109",
"0.6134853",
"0.60836786",
"0.6059906",
"0.6026015",
"0.60105425",
"0.5986414",
"0.595635",
"0.59499776",
"0.5929025",
"0.59276956",
"0.5873335",
"0.58395284",
"0.58194304",
"0.5817892",
"0.58108395",
"0.58107877",
"0.58103323",
"0.5783997",
"0.57223225",
"0.5700594"
]
| 0.7461299 | 0 |
Check whether $token type is $which. | public static function tokenIs($token, string $which): bool
{
if (!\is_array($token)) {
return false;
}
return \token_name($token[0]) === $which;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _checkToken(KCommandContext $context)\n {\n //Check the token\n if($context->caller->isDispatched())\n { \n $method = KRequest::method();\n \n //Only check the token for PUT, DELETE and POST requests (AND if the view is not 'ipn')\n if(($method != KHttpRequest::GET) && ($method != KHttpRequest::OPTIONS) && (KRequest::get('get.view', 'string') != 'ipn')) \n { \n if( KRequest::token() !== JUtility::getToken()) { \n return false;\n }\n }\n }\n \n return true;\n }",
"public function hasToken();",
"function checkToken($type,$token,$userid){\n\tif(trim($type) == ''\n\t\t|| trim($token) == ''\n\t\t|| trim($userid) == ''\n\t){\n\t\treturn false;\n\t}\n\tif($type == DUDU_DRIVER){\n\t\t$table = API_TABLE_PRE.'driver_token';\n\t\t$conditionUseridColumn = 'did';\n\t}elseif ($type == DUDU_PASSENGER){\n\t\t$table = API_TABLE_PRE.'passenger_token';\n\t\t$conditionUseridColumn = 'pid';\n\t}else{\n\t\treturn false;\n\t}\n\t$sql = 'select token from '.$table.' where '.$conditionUseridColumn.' = '.$userid;\n\t$rs = myDoSqlQuery($sql);\n\t$tokenInfo = pg_fetch_assoc($rs);\n\tif($tokenInfo['token']==$token){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function hasToken(){\n return $this->_has(2);\n }",
"public function hasToken(){\n return $this->_has(2);\n }",
"public function hasOperator(string $token): bool;",
"protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }",
"static function findMode( $command )\n {\n foreach( static::$mode_list as $mode ) {\n if( in_array( $mode, $command ) ) {\n // found special mode. \n return $mode;\n }\n }\n return FALSE;\n }",
"public static function checkDirectionIn($token)\n {\n return true;\n }",
"function symb_identify($arg_order){\n global $token;\n $error_val = False;\n\n get_token();\n /* Symbol represented as integer */\n if($token->type === tokenType::d_int){\n upper_scan($token->data, 0);\n $arg_order->addAttribute('type','int');\n get_token();\n if($token->type === tokenType::marker){\n get_token();\n if($token->type !== tokenType::number){\n $error_val = True;\n }\n if(!preg_match(\"/^[+|-]?[0-9]*$/\",$token->data)){\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n $arg_order[0] .= $token->data;\n }\n else $error_val = True;\n }\n /* Symbol represented as string */\n elseif($token->type === tokenType::d_string){\n upper_scan($token->data, 0);\n $arg_order->addAttribute('type','string');\n get_token();\n if($token->type === tokenType::marker){\n get_token();\n if($token->type !== tokenType::stringStream){\n if(preg_match(\"/^[+|-]?[0-9]*$/\",$token->data)){\n $token->type === tokenType::number;\n }\n else {\n $error_val = True;\n }\n }\n $arg_order[0] .= xml_special_char($token->data);\n }\n else $error_val = True;\n }\n /* Symbol represented as bool */\n elseif($token->type === tokenType::d_bool){\n upper_scan($token->data, 0);\n $arg_order->addAttribute('type','bool');\n get_token();\n if($token->type === tokenType::marker){\n get_token();\n upper_scan($token->data, 1);\n if($token->type === tokenType::b_true){\n $arg_order[0] .= $token->data;\n }\n elseif($token->type === tokenType::b_false){\n $arg_order[0] .= $token->data;\n }\n else $error_val = True;\n }\n else $error_val = True;\n }\n /* Symbol represented as nil */\n elseif($token->type === tokenType::d_nil){\n upper_scan($token->data, 0);\n $arg_order->addAttribute('type', 'nil');\n get_token();\n if($token->type === tokenType::marker){\n get_token();\n upper_scan($token->data, 0);\n if($token->type !== tokenType::d_nil){\n $error_val = True;\n }\n $arg_order[0] .= $token->data;\n }\n else $error_val = True;\n }\n /* Symbol represented as <var> */\n elseif($token->type >= tokenType::f_gf && $token->type <= tokenType::f_tf){\n upper_scan($token->data, 0);\n $arg_order->addAttribute('type', 'var');\n $arg_order[0] .= $token->data;\n get_token();\n if($token->type === tokenType::marker){\n $arg_order[0] .= $token->data;\n get_token();\n if(!preg_match(\"/^[a-zA-Z_\\-\\$&%\\*!?][a-zA-Z_\\-\\$&%\\*!?0-9]*$/\", $token->data)){\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n if($token->type !== tokenType::identifier){\n $error_val = True;\n }\n $arg_order[0] .= xml_special_char($token->data);\n }\n else $error_val = True;\n }\n else $error_val = True;\n\n if($error_val){\n fwrite(STDERR, \"ERROR : SYNTAX : Symbol <symb> expected : last token: $token->data $token->type\\n\");\n exit(23);\n }\n }",
"public static function isOperator($token): bool\n {\n if (!\\is_string($token)) {\n return false;\n }\n\n return \\strpos(self::MISC_OPERATORS, $token) !== false;\n }",
"protected function check_symb()\n {\n $var_regex = \"/^TF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$|^LF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$|^GF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$/\";\n\n $result = preg_match($var_regex, $this->token);\n\n if($result)\n {\n return Instructions::varr;\n }\n\n $val_regex = \"/^int@[-+]?[0-9]+$|^bool@true$|^bool@false$|^string@.*|^nil@nil$/\";\n\n $result = preg_match($val_regex, $this->token);\n\n $this->check_string();\n\n if($result)\n {\n return Instructions::val;\n }\n else\n {\n return false;\n }\n }",
"abstract protected function isStartToken(string $token) : bool;",
"function check_token($token, $form_name)\n{\n if (is_bool($token)) {\n return false;\n }\n return $token === get_token($form_name);\n}",
"public function isOperator()\n {\n return\n $this->type === 'plus' ||\n $this->type === 'minus' ||\n $this->type === 'slash' ||\n $this->type === 'star';\n }",
"public function hasToken(){\n return ( $this->token and $this->token->isValid() );\n }",
"public function getTokenType();",
"public static function isMethodName($token) {\n\t\t\treturn is_string($token) && preg_match('/^[a-z_][a-z0-9_]*$/i', $token);\n\t\t}",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function isOTP(){\n return ($this->auth_type == \"1\");\n }",
"function identify_operand(){\n global $token;\n global $identifier;\n global $label;\n switch ($token->data) {\n case 'string':\n $identifier->stringSearch = True;\n break;\n case 'int':\n $identifier->numberSearch = True;\n break;\n case '@':\n $identifier->markerSearch = True;\n default:\n if(preg_match(\"/^(LT)|(GT)|(LF)$/\", $token->data)){\n $identifier->varSearch = True;\n }\n break;\n }\n }",
"function is_keyword($type){\n global $keywords;\n global $token;\n\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $type;\n return True;\n }\n }\n return False;\n }",
"protected function isMatch()\n {\n if($this->scope!=''){\n if($this->argv[1] != $this->scope){\n return false;\n }\n }\n\n if($this->argv[2] == $this->trigger || ($this->scope=='' && $this->argv[1] == $this->trigger)) {\n $this->match = true;\n }\n\n }",
"public function getCmdType();",
"public function tokenType()\n {\n return $this->token['token_type'] ?? null;\n }",
"public function existsRequestToken()\n {\n // load token\n $store = $this->getStore();\n $type = $store->loadToken($this);\n\n // get consumer\n $this->_consumer = call_user_func($this->_get_consumer_handler, $store->getConsumerKey());\n\n // return result\n if ($type=='request') {\n return true;\n }\n return false;\n }",
"public function hasToken ()\n {\n return $this->peekAtToken() !== NULL;\n }",
"public function tokenType()\n {\n return $this->tokenType;\n }",
"public static function check_token($token)\r\n {\r\n if ($token == $_SESSION['token'])\r\n return true;\r\n\r\n return false;\r\n }"
]
| [
"0.55055016",
"0.5458382",
"0.5456719",
"0.540959",
"0.540959",
"0.5371062",
"0.5344121",
"0.5215533",
"0.5172731",
"0.5091362",
"0.50280005",
"0.5002302",
"0.49758264",
"0.4971031",
"0.49484736",
"0.49432147",
"0.49338207",
"0.4891005",
"0.4825766",
"0.4825766",
"0.48164377",
"0.48140797",
"0.48095793",
"0.47961098",
"0.47939378",
"0.47926068",
"0.47884676",
"0.47618008",
"0.47288135",
"0.46727368"
]
| 0.72973967 | 0 |
Check whether $token is an operator. | public static function isOperator($token): bool
{
if (!\is_string($token)) {
return false;
}
return \strpos(self::MISC_OPERATORS, $token) !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasOperator(string $token): bool;",
"protected function isOperator(TokenInterface $token): bool {\n return ($set = $this->getOperatorTokenSet()) ? $set->tokenIsMember($token) : false;\n }",
"public function isOperator()\n {\n return\n $this->type === 'plus' ||\n $this->type === 'minus' ||\n $this->type === 'slash' ||\n $this->type === 'star';\n }",
"abstract protected function parseOperator(TokenInterface $token);",
"private function getOperator($token)\n\t{\n\t\tif ($token->isUnary())\n\t\t{\n\t\t\treturn $this->unary_operators[$token->value()];\n\t\t}\n\n\t\tif ( ! isset($this->binary_operators[$token->value()]))\n\t\t{\n\t\t\tthrow new BooleanExpressionException('Invalid Binary Operator: '. $token);\n\t\t}\n\n\t\treturn $this->binary_operators[$token->value()];\n\t}",
"private static function isOperator($operator)\n {\n if ($operator instanceof Number) {\n return false;\n }\n $has = false;\n foreach (self::getOperators() as $op) {\n if ($operator === $op) {\n $has = true;\n break;\n }\n }\n\n return $has;\n }",
"protected function is_operator($node) {\n return !($node->type == qtype_preg_node::TYPE_LEAF_CHARSET\n || $node->type == qtype_preg_node::TYPE_LEAF_ASSERT\n || $node->type == qtype_preg_node::TYPE_LEAF_META\n || $node->type == qtype_preg_node::TYPE_LEAF_BACKREF\n || $node->type == qtype_preg_node::TYPE_LEAF_SUBEXPR_CALL\n || $node->type == qtype_preg_node::TYPE_LEAF_TEMPLATE\n || $node->type == qtype_preg_node::TYPE_LEAF_CONTROL\n || $node->type == qtype_preg_node::TYPE_LEAF_OPTIONS\n || $node->type == qtype_preg_node::TYPE_LEAF_COMPLEX_ASSERT);\n }",
"protected function parseQueryOperator()\n {\n $token = $this->tokenQueue->peek();\n $data = $token->getData();\n\n $nextToken = $this->tokenQueue->peek(1);\n $nextData = $nextToken->getData();\n $op = false;\n\n switch ($data) {\n case '<':\n $op = ($nextData === '>' ? '>=' : ($nextData === '=' ? '<=' : '<'));\n break;\n case '>':\n $op = ($nextData === '=' ? '>=' : '>');\n break;\n case '=':\n $op = '=';\n break;\n case 'LIKE':\n $op = 'LIKE';\n break;\n }\n\n // Consume the correct number of tokens\n if ($op === 'LIKE' || strlen($op) === 1) {\n $this->tokenQueue->next();\n } elseif (strlen($op) === 2) {\n $this->tokenQueue->next();\n $this->tokenQueue->next();\n }\n\n return $op;\n }",
"protected function parseOperator(string $operator)\n {\n $dict_operators = [\n '!~' => ' NOT LIKE ',\n '>=' => ' >= ',\n '<=' => ' <= ',\n '=' => ' = ',\n '!=' => ' != ',\n '>' => ' > ',\n '<' => ' < ',\n '~' => ' LIKE ',\n '!' => ' IS NOT '\n ];\n\n return (isset($dict_operators[$operator]) ? $dict_operators[$operator] : false);\n }",
"private function isValidOdataOperator(string $operator): bool {\n switch ($operator) {\n case 'eq':\n return true;\n case 'ne':\n return true;\n case 'ge':\n return true;\n case 'gt':\n return true;\n case 'lt':\n return true;\n case 'le':\n return true;\n case 'and':\n return true;\n case 'or':\n return true;\n case 'not':\n return true;\n case 'has':\n return true;\n default:\n return false;\n }\n }",
"function sql_is_compare_operator($op){\n\treturn in_array($op, array('=', 'LIKE', 'NOT LIKE', 'NOT', '<>'));\n}",
"function isOperator($player) {\n\n\t\t// check for operator list entry\n\t\tif (isset($player->login) && $player->login != '' && isset($this->operator_list['TMLOGIN']))\n\t\t\tif (($i = array_search($player->login, $this->operator_list['TMLOGIN'])) !== false)\n\t\t\t\t// check for matching IP if set\n\t\t\t\tif ($this->operator_list['IPADDRESS'][$i] != '')\n\t\t\t\t\tif (!$this->ip_match($player->ip, $this->operator_list['IPADDRESS'][$i])) {\n\t\t\t\t\t\ttrigger_error(\"Attempt to use Operator login '\" . $player->login . \"' from IP \" . $player->ip . \" !\", E_USER_WARNING);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\telse\n\t\t\treturn false;\n\t}",
"public static function ValidateOperator($operator) {\n return in_array(strtolower($operator), array_map('strtolower', static::$VALID_OPERATORS));\n }",
"protected function validOperator($operator)\n {\n return in_array($operator, $this->acceptedOperators);\n }",
"public function containsOperators() {\n\t\t$pattern = [];\n\t\tforeach ( $this->wildcardingOperators as $op ) {\n\t\t\t$pattern[] = \"\\\\$op\";\n\t\t}\n\t\t$pattern = \"/\" . implode( '|', $pattern ) . \"/\";\n\n\t\tif ( preg_match( $pattern, $this->original ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special operators should not be removable by config\n\t\tif ( strpos( $this->original, 'AND' ) || strpos( $this->original, 'OR' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function hasOperator($passedOperator){\n\t\tforeach($this->operators as $operator){\n\t\t\tif ($operator->customIdentifier == $passedOperator){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"protected function invalidOperator(string $operator): bool\n\t{\n\t\treturn !in_array(strtolower($operator), self::OPERATORS, true);\n\t}",
"protected function invalidOperator($operator)\n {\n return !in_array(strtolower($operator), $this->operators, true) &&\n !in_array(strtolower($operator), $this->grammar->getOperators(), true);\n }",
"function isOperatorL($login) {\n\n\t\t// check for operator list entry\n\t\tif ($login != '' && isset($this->operator_list['TMLOGIN']))\n\t\t\treturn in_array($login, $this->operator_list['TMLOGIN']);\n\t\telse\n\t\t\treturn false;\n\t}",
"protected function isBasicOperator($operator)\n {\n return in_array($operator, ['=', '!=', '>', '>=', '<', '<='], true);\n }",
"protected function isOperatorExpression($expression)\n {\n if (\n !is_array($expression) ||\n count($expression) !== 2 ||\n !isset($expression[0], $expression[1])\n ) {\n return false;\n }\n\n [$operator, $count] = $expression;\n\n return $this->isBasicOperator($operator) && is_numeric($count);\n }",
"protected function hasOperator($string)\n {\n return (bool)preg_match(\n '/(<|>|!|=|\\sIS NULL|\\sIS NOT NULL|\\sEXISTS|\\sBETWEEN|\\sLIKE|\\sIN\\s*\\(|\\s)/i',\n trim($string)\n );\n }",
"public static function isInvalidOperator($operator)\n {\n return (!is_string($operator) || !in_array(strtoupper($operator), self::getOperators()));\n }",
"protected function _get_operator($str) {\n\t\tstatic $_operators;\n\n\t\tif (empty($_operators)) {\n\t\t\t$_operators = array(\n\t\t\t\t'\\s*(?:<|>|!)?=\\s*', // =, <=, >=, !=\n\t\t\t\t'\\s*<>?\\s*', // <, <>\n\t\t\t\t'\\s*>\\s*', // >\n\t\t\t\t'\\s+IS NULL', // IS NULL\n\t\t\t\t'\\s+IS NOT NULL', // IS NOT NULL\n\t\t\t\t'\\s+EXISTS\\s*\\(.*\\)', // EXISTS(sql)\n\t\t\t\t'\\s+NOT EXISTS\\s*\\(.*\\)', // NOT EXISTS(sql)\n\t\t\t\t'\\s+BETWEEN\\s+', // BETWEEN value AND value\n\t\t\t\t'\\s+IN\\s*\\(.*\\)', // IN(list)\n\t\t\t\t'\\s+NOT IN\\s*\\(.*\\)', // NOT IN (list)\n\t\t\t);\n\n\t\t}\n\n\t\treturn preg_match('/'.implode('|', $_operators).'/i', $str, $match) ? $match[0] : FALSE;\n\t}",
"protected function _has_operator($str) {\n\t\treturn (bool) preg_match('/(<|>|!|=|\\sIS NULL|\\sIS NOT NULL|\\sEXISTS|\\sBETWEEN|\\sLIKE|\\sIN\\s*\\(|\\s)/i', trim($str));\n\t}",
"function checkopration($operator)\r\n {\r\n switch($operator)\r\n {\r\n case 'Add':\r\n return $this->number1 + $this->number2;\r\n break;\r\n\r\n case 'Substract':\r\n return $this->number1 - $this->number2;\r\n break;\r\n\r\n case 'Multiply':\r\n return $this->number1 * $this->number2;\r\n break;\r\n\r\n case 'Divide':\r\n return $this->number1 / $this->number2;\r\n break;\r\n\r\n default:\r\n return \"Sorry No command found\";\r\n } \r\n }",
"public function getOperator()\n {\n $logic = $this->getLogic();\n if (!$logic)\n return null;\n return array_key_exists('operator', $logic) ? $logic['operator'] : null;\n }",
"abstract public function get_operator();",
"public function getOperator();",
"public function getOperator();"
]
| [
"0.88693404",
"0.79390186",
"0.77720106",
"0.7617699",
"0.73910433",
"0.6879744",
"0.68775165",
"0.6775893",
"0.66944265",
"0.6678324",
"0.6630048",
"0.66155404",
"0.6609061",
"0.6592489",
"0.65733826",
"0.65582913",
"0.6482953",
"0.6382587",
"0.6341057",
"0.6340708",
"0.63111365",
"0.6298075",
"0.62345946",
"0.62339354",
"0.62189734",
"0.6184781",
"0.60662967",
"0.6009783",
"0.5988241",
"0.5988241"
]
| 0.8906139 | 0 |
Check whether $token type is present in $coll. | public static function hasToken(array $coll, $token): bool
{
if (!\is_array($token)) {
return false;
}
return \in_array(\token_name($token[0]), $coll);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasToken();",
"public function hasToken(){\n return $this->_has(2);\n }",
"public function hasToken(){\n return $this->_has(2);\n }",
"public static function isScopeType($token) {\n\t\t\t// TODO uncomment session code\n\t\t\t// return is_string($token) && preg_match('/^(singleton|prototype|session)$/', $token);\n\t\t\treturn is_string($token) && preg_match('/^(singleton|prototype)$/', $token);\n\t\t}",
"public function inList($class, $token) {\n return isset($this->list[$class][$token]);\n }",
"public function hasTokens($token): bool\n {\n return in_array($token, $this->tokens);\n }",
"public function hasToken(){\n return ( $this->token and $this->token->isValid() );\n }",
"function is_keyword($type){\n global $keywords;\n global $token;\n\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $type;\n return True;\n }\n }\n return False;\n }",
"public function hasType(){\r\n return $this->_has(1);\r\n }",
"public function hasTypeIdentifier()\n {\n return count($this->get(self::TYPE_IDENTIFIER)) !== 0;\n }",
"public static function isPrimitiveType($token) {\n\t\t\treturn is_string($token) && in_array(strtolower($token), static::$primitives);\n\t\t}",
"public function hasType(){\n return $this->_has(9);\n }",
"function isObject($token) {\n $len = strlen($token);\n return $len >= 2 && '{' == $token[0] && '}' == $token[$len - 1];\n }",
"public function hasType(){\n return $this->_has(3);\n }",
"public function hasType(){\n return $this->_has(3);\n }",
"public function hasType(){\n return $this->_has(3);\n }",
"public function hasType(){\n return $this->_has(2);\n }",
"public function hasType(){\n return $this->_has(5);\n }",
"public function hasType(){\n return $this->_has(5);\n }",
"public function hasType(){\n return !empty($this->type);\n }",
"public function hasType() {\n return $this->_has(2);\n }",
"public static function isa($token)\n {\n return $token->source[0] === self::NODE_IDENTIFIER;\n }",
"public function hasToken ()\n {\n return $this->peekAtToken() !== NULL;\n }",
"public function hasType(){\n return $this->_has(4);\n }",
"public function hasType() {\n return $this->_has(3);\n }",
"protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }",
"function checkToken($type,$token,$userid){\n\tif(trim($type) == ''\n\t\t|| trim($token) == ''\n\t\t|| trim($userid) == ''\n\t){\n\t\treturn false;\n\t}\n\tif($type == DUDU_DRIVER){\n\t\t$table = API_TABLE_PRE.'driver_token';\n\t\t$conditionUseridColumn = 'did';\n\t}elseif ($type == DUDU_PASSENGER){\n\t\t$table = API_TABLE_PRE.'passenger_token';\n\t\t$conditionUseridColumn = 'pid';\n\t}else{\n\t\treturn false;\n\t}\n\t$sql = 'select token from '.$table.' where '.$conditionUseridColumn.' = '.$userid;\n\t$rs = myDoSqlQuery($sql);\n\t$tokenInfo = pg_fetch_assoc($rs);\n\tif($tokenInfo['token']==$token){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"private function isKeyword($token, &$returnKeywordType)\n {\n $properCaseToken = ucfirst(strtolower($token));\n $returnKeywordType = null;\n\n foreach ($this->keywords as $keywordType => $collection) {\n\n foreach ($collection as $wordOrArray) {\n\n if (is_array($wordOrArray)) {\n\n if (in_array($properCaseToken, $wordOrArray)) {\n $returnKeywordType = $keywordType;\n break 2;\n }\n\n } elseif ($properCaseToken == $wordOrArray) {\n $returnKeywordType = $keywordType;\n break 2;\n }\n\n }\n }\n\n return ($returnKeywordType !== null) ? $properCaseToken : false;\n\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasToken()\n {\n return $this->tokenFlag;\n }"
]
| [
"0.5998347",
"0.5946866",
"0.5946866",
"0.57738954",
"0.5728853",
"0.5728656",
"0.5701772",
"0.56804717",
"0.5662382",
"0.5645122",
"0.5614323",
"0.5610915",
"0.55948395",
"0.5484809",
"0.5484809",
"0.5484809",
"0.5467893",
"0.5462357",
"0.5462357",
"0.5418826",
"0.54169375",
"0.5409327",
"0.54062057",
"0.5399519",
"0.53967714",
"0.5347702",
"0.53340507",
"0.5329058",
"0.5300718",
"0.5300718"
]
| 0.67856026 | 0 |
Find the account by a stored event | public function scopeFindByEvent($query, $event)
{
return $this->scopeFindByUUID(
$query,
data_get($event, 'accountUuid')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAccountId($account_name)\n\t{\n\t\t global $log;\n $log->info(\"in getAccountId \".$account_name);\n\t\tglobal $adb;\n\t\tif($account_name != '')\n\t\t{\n\t\t\t$sql = \"select accountid from ec_account where accountname='\".$account_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$accountid = $adb->query_result($result,0,\"accountid\");\n\t\t}\n\t\treturn $accountid;\n\t}",
"public function getAuthFromAccount($account){\n $table = \"access\";\n $fields[] = \"auth\";\n $where[\"account\"] = $account;\n $data = Database_Mysql::select($table,$fields,$where);\n if($data)\n return $data[0][\"auth\"];\n else\n return false;\n }",
"public function getAccount();",
"function mint_get_account($session, $token, $account_name) {\n // mint needs some info to log in\n $_post = array(\n \"input\" => '[' . json_encode(array(\n \"args\" => array(\n \"types\" => array(\"OTHER_PROPERTY\"),\n ),\n \"id\" => \"115485\",\n \"service\" => \"MintAccountService\",\n \"task\" => \"getAccountsSorted\", \n )) . ']',\n );\n $session->URLFetch(\"https://wwws.mint.com/bundledServiceController.xevent?token=\" . $token, $_post);\n $_obj = json_decode($session->response);\n \n // 115485 seems to be a magic/arbitrary number that mint labels the object in it's return json\n foreach ($_obj->response->{115485}->response as $account) {\n if ($account->name == $account_name) {\n return $account->accountId;\n }\n }\n Debug::trace('could not find an account named ' . $account_name . ' in your mint.com account');\n}",
"public function find_client($event_id, $client_id);",
"function get_account() {\n\t\t// $pos = $this->add_request( __FUNCTION__ );\n\t\t$pos = $this->add_request( 'getaccount' );\n\t\t$this->send_request();\n\t\t$r = $this->response_part( $pos );\n\t\tif ( isset( $r->account ) && !is_null( $r->account->email ) )\n\t\t\treturn $r->account;\n\t\treturn false;\n\t}",
"public function findAccount()\r\n {\r\n // get current user id\r\n $loginUser = $_SESSION[\"loginUser\"];\r\n $userId = $loginUser->getId();\r\n \r\n // search accounts from database\r\n $accountList = $this->accountHandler->findAccount($userId);\r\n \r\n require_once ('view/UserHome.php');\r\n }",
"public function findByAccount($name);",
"public function getAccountID();",
"public function getAccountFromAuth($auth){\n $table = \"access\";\n $fields[] = \"account\";\n $where[\"auth\"] = $auth;\n $data = Database_Mysql::select($table,$fields,$where);\n if($data)\n return $data[0][\"account\"];\n else\n return false;\n }",
"function get_owned_by_uid($uid) {\n\t\t$data = $this->db->query('SELECT event_id FROM event_owner WHERE owner_id='.$uid.'');\n\t\treturn $data->result();\n\t}",
"public function getAccountID()\n {\n return $this->getKey('AccountID');\n }",
"public function getAccountFromHost($host,$ident){\n $query = \"SELECT access.account\" . PHP_EOL;\n $query.= \"FROM IrcUserData\" . PHP_EOL;\n $query.= \"INNER JOIN access ON IrcUserData.auth = access.auth\" . PHP_EOL;\n $query.= \"WHERE `host` LIKE '\" . $host . \"' AND `ident` LIKE '\".$ident.\"'\" . PHP_EOL;\n $data = Database_Mysql::advancedSelect($query);\n if($data)\n return $data[0][\"account\"];\n else\n return false;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }",
"function getAccountID () {\r\n //checks if the user is logged in\r\n if (checkLogin()) {\r\n //gets the ID\r\n $ID = getPersonID();\r\n //setup sql query\r\n $sql = \"SELECT AccountID FROM accounts WHERE PersonID = $ID\";\r\n //runs the query\r\n $stmt = runQuery($sql);\r\n //checks if we found atleast 1 account\r\n if ($stmt->rowCount() > 0) {\r\n $row = $stmt->fetch();\r\n //returns the ID\r\n return $row['AccountID'];\r\n }\r\n }\r\n return null;\r\n}",
"function findAccountandProfileByEmailKey($university_account_emailkey)\n {\n $this->gdlog()->LogInfoStartFUNCTION(\"findAccountandProfileByEmailKey\");\n $fr;\n $sqlstmnt = \"SELECT \".\n $this->dbfas(\"university_account.uid, \".\n \"university_account.sdesc, \".\n \"university_account.emailkey, \".\n \"university_profile.uid, \".\n \"university_profile.name, \".\n \"university_profile.content, \".\n \"university_profile.city, \".\n \"university_profile.cfg_region_uid, \".\n \"university_profile.cfg_country_uid, \".\n \"university_profile.foundeddate\").\n \" FROM university_account \".\n \"JOIN match_university_account_to_university_profile on \".\n \"match_university_account_to_university_profile.university_account_uid = university_account.uid \".\n \"JOIN university_profile on \".\n \"match_university_account_to_university_profile.university_profile_uid = university_profile.uid \".\n \"WHERE university_account.emailkey=:university_account_emailkey\";\n \n $dbcontrol = new ZAppDatabase();\n $dbcontrol->setApplicationDB(\"GROUPYOU\");\n $dbcontrol->setStatement($sqlstmnt);\n $dbcontrol->bindParam(\":university_account_emailkey\", $university_account_emailkey);\n $dbcontrol->execSelect();\n if($dbcontrol->getTransactionGood())\n {\n if($dbcontrol->getRowCount() > 0)\n {\n $this->setResult_AccountandProfile($dbcontrol->getStatement()->fetch(PDO::FETCH_ASSOC));\n\n $this->gdlog()->LogInfoDB($this->getResult_AccountandProfile());\n $fr = $this->gdlog()->LogInfoRETURN(\"ACCOUNT_FOUND\");\n }\n else\n {\n $fr = $this->gdlog()->LogInfoRETURN(\"ACCOUNT_NOT_FOUND\");\n }\n }\n else\n {\n $fr = $this->gdlog()->LogInfoERROR(\"TRANSACTION_FAIL\");\n }\n $this->gdlog()->LogInfoEndFUNCTION(\"findAccountandProfileByEmailKey\");\n return $fr;\n }",
"public function getAccount() {\n return $this->account;\n }",
"function findUserCode($activationCode)\n{\n global $db;\n $command = \"SELECT * FROM `user_accounts` WHERE `activationCode` = ?\";\n $stmt = $db->prepare($command);\n $stmt->execute(array($activationCode));\n return $stmt->fetch(PDO::FETCH_ASSOC);\n}",
"public function getAccount($key = null);",
"public function getAccount($cache = TRUE);",
"public function getLoggedInUserAccount() {\n\t\tLoggerRegistry::debug('CustomerModule::getLoggedInUserAccount()');\n\t\t$account = null;\n\t\t$email = $this->getEngine()->getUserManager()->getLoggedInUserEmail();\n\t\tif (!is_null($email)) {\n\t\t\t$account = $this->getRepository('Account')->findOneBy(array( 'email' => '[email protected]' ));\n\t\t\tif (is_null($account)) {\n\t\t\t\t$account = new Account();\n\t\t\t\t$account->setEmail($email);\n\t\t\t\t$this->getEngine()->doctrine()->getEntityManager()->persist($account);\n\t\t\t}\n\t\t}\n\t\treturn $account;\n\t}",
"public function getAccount()\n {\n return isset($this->account) ? $this->account : null;\n }",
"private function findAccount() {\n\t\t\tassertArray($this->errorMsgs);\n\t\t\t// find existing email/login\n\t\t\t$result = $this->dbh->query(\"SELECT `affiliateID`, `email`, `password` FROM `affiliates` WHERE `email` = '\".prepDB($this->registrationForm['email']).\"'\");\n\t\t\tif (isset($_REQUEST['affiliateLogin'])) {\n\t\t\t\t// login\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t// already logged in\n\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['password'] != $this->registrationForm['password']) {\n\t\t\t\t\t\t// login, incorrect password\n\t\t\t\t\t\t$this->errorMsgs[] = 'Incorrect password for '.$this->registrationForm['email'];\n\t\t\t\t\t\taddErrorField('password');\n\t\t\t\t\t} elseif (!$this->affiliateID) {\n\t\t\t\t\t\t// affiliate id is the logged in flag\n\t\t\t\t\t\t// the only way affiliate id can be set is if user successfully creates a new account or logs in\n\t\t\t\t\t\t$this->affiliateID = $row['affiliateID'];\n\t\t\t\t\t\t// update login count\n\t\t\t\t\t\t$this->dbh->query(\"UPDATE `affiliates` SET `totalLogins` = `totalLogins` + 1 WHERE `affiliateID` = '\".prepDB($this->affiliateID).\"'\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// no email found\n\t\t\t\t\t$this->errorMsgs[] = 'Email not found';\n\t\t\t\t}\n\t\t\t} elseif ($this->affiliateID) {\n\t\t\t\t// affiliate changing account info\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['affiliateID'] != $this->affiliateID) {\n\t\t\t\t\t\t// user entered an existing address/login that belongs to another account\n\t\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please enter a different email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are currently using this email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t// new account\n\t\t\t\t$row = $result=>fetchAssoc();\n\t\t\t\tif ($row['email'] == prepDB($this->registrationForm['email'])) {\n\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please log in or enter a different email address';\n\t\t\t\t\taddErrorField('email');\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected function getAccount($account, $basedn)\n {\n if (is_null($this->conn)) {\n throw new RuntimeException('no LDAP connection bound');\n }\n\n $result = ldap_search(\n $this->conn, $basedn, \"(samaccountname={$account})\",\n array('dn', 'givenname', 'sn', 'cn', 'memberof', 'objectguid')\n );\n\n if ($result === false) {\n return null;\n }\n\n $entries = ldap_get_entries($this->conn, $result);\n\n if ($entries['count'] > 0) {\n return $entries[0];\n }\n }",
"public static function findByUsername($account)\n {\n return static::findOne(['account' => $account, 'status' => self::STATUS_ACTIVE]);\n }"
]
| [
"0.578381",
"0.5769125",
"0.5745744",
"0.5722912",
"0.569419",
"0.56732285",
"0.566567",
"0.56632864",
"0.55392337",
"0.5484587",
"0.5475813",
"0.5474283",
"0.54619026",
"0.5451986",
"0.5451986",
"0.5451986",
"0.5451986",
"0.5451986",
"0.5451986",
"0.543434",
"0.5424971",
"0.5370314",
"0.5369132",
"0.53506804",
"0.5350341",
"0.5344936",
"0.5343904",
"0.53344405",
"0.52971524",
"0.52922106"
]
| 0.61266065 | 0 |
The stored events involving this Account | public function events(): HasMany
{
return $this->hasMany(
config('event-sourcing.stored_event_model'),
'event_properties->accountUuid',
'uuid'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEvents() { return $this->_events; }",
"public function &getTransactionEvents()\n {\n $this->_generateEventLabels();\n return self::$_eventList;\n }",
"public function &getTransactionEvents()\n {\n $this->_generateEventLabels();\n return self::$_eventList;\n }",
"public function getEvents() {\n return $this->_events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function events()\n {\n return $this->events;\n }",
"public function events()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->_events;\n }",
"public function getEvents();",
"public function getEvents();",
"public function getEvents()\n\t{\n\t\treturn $this->events;\n\t}",
"public function event_history(/* ... */)\n {\n return $this->_event_history;\n }",
"public function getEvents()\n {\n //\n\n return Event::all();\n }",
"function getEvents() {\n return [];\n }",
"public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}",
"function getAllEvents() {\n\n $this->events = $this->getEvents();\n //If plugin adds new events for an already defined type\n Plugin::doHook('item_get_events', $this);\n\n return $this->events;\n }",
"public function getUncommittedEvents();",
"protected static function getRecordActivityEvents() {\n if (isset(static::$recordEvents)) {\n return static::$recordEvents;\n }\n\n //events by default if recordEvents is not set\n return [\n 'updating',\n// 'deleted',\n ];\n }",
"public function getAttachEvent():array{\r\n return array_keys($this->storage);\r\n }",
"public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }",
"public function eventLog() {\n\t\treturn $this->_eventLog;\n\t}",
"public static function getEvents()\n {\n $events = parent::getEvents();\n $events[] = self::ON_FIRST_LOGIN;\n $events[] = self::ON_LOGIN;\n $events[] = self::ON_LOGOUT;\n $events[] = self::ON_PASSWORD_CHANGE;\n\n return $events;\n }",
"public function getAll(){\n //old : \n // $events = $this->events;\n // return $events;\n $repo = $this->om->getRepository(Event::class); \n return $repo->findAll();\n }"
]
| [
"0.66589713",
"0.65251815",
"0.65251815",
"0.64845586",
"0.6469753",
"0.6469753",
"0.6469753",
"0.6469753",
"0.6469753",
"0.6469753",
"0.6469753",
"0.6469753",
"0.64292574",
"0.64292574",
"0.6415157",
"0.6386372",
"0.6386372",
"0.63639766",
"0.63481057",
"0.6308442",
"0.63049924",
"0.6270697",
"0.62697047",
"0.6259209",
"0.6186069",
"0.6162615",
"0.613368",
"0.61228776",
"0.60990316",
"0.6084667"
]
| 0.67445284 | 0 |
Sundays felt on the first of the month during the twentieth century. | public function firstOfTheMonthSundays()
{
$sundays = 0;
for ($i=$this->startYear; $i<=$this->endYear; $i++) {
for ($j=1; $j<=12; $j++) {
if (date('l', strtotime("$j/1/$i")) == "Sunday" ) {
$sundays++;
}
}
}
return $sundays;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sundays()\n {\n return $this->days(0);\n }",
"public function getFirstDay(){$day = getdate(mktime(0, 0, 0, $this->getMonth(), 1, $this->getYear())); return $day['wday'];}",
"public function saturdays()\n {\n return $this->days(6);\n }",
"function firstDayOfWeek($year,$month,$day){\n global $fd;\n $dayOfWeek=date(\"w\");\n $sunday_offset=$dayOfWeek * 60 * 60 * 24;\n $fd = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) - $sunday_offset);\n return $fd;\n}",
"function easterSunday( $nYEAR ) \r\n{\r\n // but mktime() starts at 1970-01-01! \r\n if ( $nYEAR < 1970 ) \r\n { \r\n $dtEasterSunday = mktime( 1,1,1,1,1,1970 ); \r\n } \r\n else \r\n { \r\n $nGZ = ( $nYEAR % 19 ) + 1; \r\n $nJHD = div( $nYEAR, 100 ) + 1; \r\n $nKSJ = div( 3 * $nJHD, 4 ) - 12; \r\n $nKORR = div( 8 * $nJHD + 5, 25 ) - 5; \r\n $nSO = div( 5 * $nYEAR, 4 ) - $nKSJ - 10; \r\n $nEPAKTE = (( 11 * $nGZ + 20 + $nKORR - $nKSJ ) % 30 ); \r\n \r\n if (( $nEPAKTE == 25 OR $nGZ == 11 ) AND $nEPAKTE == 24 ) \r\n { \r\n $nEPAKTE = $nEPAKTE + 1; \r\n }\r\n \r\n $nN = 44 - $nEPAKTE; \r\n if( $nN < 21 ) \r\n { \r\n $nN = $nN + 30; \r\n } \r\n $nN = $nN + 7 - (( $nSO + $nN ) % 7 ); \r\n $nN = $nN + isLeapYear( $nYEAR ); \r\n $nN = $nN + 59; \r\n \r\n $nA = isLeapYear( $nYEAR ); \r\n // Month \r\n $nNM = $nN; \r\n if ( $nNM > ( 59 + $nA )) \r\n { \r\n $nNM = $nNM + 2 - $nA; \r\n } \r\n $nNM = $nNM + 91; \r\n $nMONTH = div( 20 * $nNM, 611 ) - 2; \r\n \r\n // Day \r\n $nNT = $nN; \r\n $nNT = $nN; \r\n if ( $nNT > ( 59 + $nA )) \r\n { \r\n $nNT = $nNT + 2 - $nA; \r\n } \r\n $nNT = $nNT + 91; \r\n $nM = div( 20 * $nNT, 611 ); \r\n $nDAY = $nNT - div( 611 * $nM, 20 ); \r\n \r\n $dtEasterSunday = mktime( 0,0,0,$nMONTH,$nDAY,$nYEAR ); \r\n } \r\n return $dtEasterSunday; \r\n}",
"public function numberSundays($m1,$y1,$m2,$y2)\n {\n if ($y2 < $y1)\n {\n throw new Exception('Years out of order; y1='.$y1.\"; y2=\".$y2); \n }\n \n $numSundays = 0;\n for ($y=$y1; $y<=$y2; $y++)\n {\n if ($y1==$y2)\n {\n $m_min = $m1;\n $m_max = $m2; \n }\n if (($y2 > $y1) && ($y==$y1))\n {\n $m_min = $m1;\n $m_max = 12;\n }\n if (($y2 > $y1) && ($y > $y1) && ($y < $y2))\n {\n $m_min = 1;\n $m_max = 12;\n }\n if (($y2 > $y1) && ($y == $y2))\n {\n $m_min = 1;\n $m_max = $m2;\n } \n for ($m=$m_min; $m<=$m_max; $m++)\n {\n $numDays = $this->days1900ToDate($m, 1, $y);\n if ($numDays%7 == 0)\n {\n // Falls on Sunday\n echo 'year='.$y.'; month='.$m.\"\\n\";\n echo 'numDays='.$numDays.\"\\n\";\n $numSundays++;\n \n }\n }\n }\n return $numSundays;\n }",
"public function tuesdays()\n {\n return $this->days(2);\n }",
"function getFirstDay($year, $month, $day_of_week) {\n $num = date(\"w\",mktime(0,0,0,$month,1,$year));\n if($num==$day_of_week) {\n return date(\"j\",mktime(0,0,0,$month,1,$year));\n }\n elseif($num>$day_of_week) {\n return date(\"j\",mktime(0,0,0,$month,1,$year)+(86400*((7+$day_of_week)-$num)));\n }\n else {\n return date(\"j\",mktime(0,0,0,$month,1,$year)+(86400*($day_of_week-$num)));\n }\n}",
"private function calculateSecondInternationalWorkersDay(): void\n {\n if ($this->year >= 2018) {\n return;\n }\n\n $this->addHoliday(new Holiday('secondInternationalWorkersDay', [\n 'uk' => 'День міжнародної солідарності трудящих',\n 'ru' => 'День международной солидарности трудящихся',\n ], new \\DateTime(\"$this->year-05-02\", new \\DateTimeZone($this->timezone)), $this->locale));\n }",
"public function mondays()\n {\n return $this->days(1);\n }",
"public function thursdays()\n {\n return $this->days(4);\n }",
"function findSatAndSunFromDateRange($dateStart,$dateEnd) {\r\n$allSat = array();\r\n$allSun = array();\r\n\tfor ($i = strtotime($dateStart); $i <= strtotime($dateEnd); $i = strtotime('+1 day', $i)) {\r\n\t if (date('N', $i) == 6){ //Saturday == 6\r\n\t\t$allSat[] = date('l Y-m-d', $i); // if it's a Saturday\r\n\t }\r\n\t if (date('N', $i) == 7){ //Sunday == 7\r\n\t\t$allSun[] = date('l Y-m-d', $i); // if it's a Sunday\r\n\t }\r\n\t}\r\nreturn array('saturdays' => $allSat, 'sundays' => $allSun);\r\n}",
"function memorialDay ($yr)\n\t{\t//last mon in may\n\t\t$jd = gregorian_to_jd(5,31,$yr);\n\n\t\t$w = jd_to_weekday($jd);\n\t\t//if $w is sunday, it's the sunday FOLLOWING memorial day\n\t\tif ($w==dSUNDAY) $w = 7;\n\n\t\treturn ( $jd - ($w - dMONDAY) );\n\t}",
"function getFirstDayInMonth($y, $m)\n {\n return (int)Date_Calc::dayOfWeek(1, $m, $y);\n }",
"public static function getFirstDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 1, 1, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}",
"public function getFirstDay()\n {\n return (int)$this->_scopeConfig->getValue(\n 'general/locale/firstday',\n ScopeInterface::SCOPE_STORE\n );\n }",
"function get_first_day($day_number=1, $month=false, $year=false) {\r\n $month = ($month === false) ? strftime(\"%m\"): $month;\r\n $year = ($year === false) ? strftime(\"%Y\"): $year;\r\n \r\n $first_day = 1 + ((7+$day_number - strftime(\"%w\", mktime(0,0,0,$month, 1, $year)))%7);\r\n \r\n return mktime(0,0,0,$month, $first_day, $year);\r\n }",
"private function calculateStJohnsHolidays(): void\n {\n $date = new DateTime(\"$this->year-6-20 this saturday\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $this->addHoliday(new Holiday(\n 'stJohnsDay',\n [],\n $date,\n $this->locale\n ));\n\n $date->sub(new DateInterval('P1D'));\n $this->addHoliday(new Holiday(\n 'stJohnsEve',\n [],\n $date,\n $this->locale,\n Holiday::TYPE_OBSERVANCE\n ));\n }",
"function getDate($s)\n\t{\n\t\tif (array_key_exists($s, $this->holidays)) return (strtotime(jdtogregorian(intval($this->holidays[$s],10)+1)));\n\n\n\t\t//the key doesn't exist, return 0\n\t\treturn (0);\n\t}",
"function getFirstDayOfWeek($y=NULL, $m=NULL, $d=NULL)\n {\n return 1;\n }",
"function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }",
"function weekday($date_arr) {\n // using Zeller's rule to determine weekdays, reference: http://mathforum.org/dr.math/faq/faq.calendar.html\n $day_of_month = (float)$date_arr[0];\n // month -2 to make formula more simple\n $month = (float)$date_arr[1] - 2;\n if ($month < 0) {\n // Jan => 11, Feb => 12\n $month = $month + 12;\n }\n $year_last_2_digit = (float)$date_arr[2] % 100;\n if ($month >= 11) {\n // Jan and Feb are put into last year since month -2 above\n $year_last_2_digit = $year_last_2_digit - 1;\n }\n $century = (float)$date_arr[2] / 100;\n $f = $day_of_month + ((13 * $month - 1) / 5) + $year_last_2_digit + ($year_last_2_digit / 4) + ($century / 4) - 2 * $century;\n while ($f < 0) {\n $f += 7;\n }\n $day_in_week = $f % 7;\n // 0 is sunday, 6 is saturday\n return $day_in_week;\n }",
"function setFirstWeekDay($daynum){\n\tif ($daynum==0) $this->startOnSun=true;\n\telse $this->startOnSun=false;\n}",
"public function fridays()\n {\n return $this->days(5);\n }",
"private function calculateDefaultStartDate()\r\n {\r\n $now = time();\r\n while (date('D', $now) != 'Mon') {\r\n $now -= 86400;\r\n }\r\n\r\n return date('Y-m-d', $now);\r\n }",
"private function calculateCatholicChristmasDay(): void\n {\n if ($this->year < 2017) {\n return;\n }\n\n $this->addHoliday(\n new Holiday(\n 'catholicChristmasDay',\n [\n 'uk' => 'Католицький день Різдва',\n 'ru' => 'Католическое рождество',\n ],\n new \\DateTime(\"$this->year-12-25\", new \\DateTimeZone($this->timezone)),\n $this->locale\n ),\n false // Catholic Christmas Day will not be substituted to an monday if it's on a weekend!\n );\n }",
"public function testCanadaDayOnAfter1983(): void\n {\n $year = 2019; // July 1 is not Sunday\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-07-01\", new \\DateTimeZone(self::TIMEZONE))\n );\n $year = 2018; // July 1 is Sunday\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-07-02\", new \\DateTimeZone(self::TIMEZONE))\n );\n }",
"public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }",
"function _data_first_month_day()\n {\n $month = date('m');\n $year = date('Y');\n return date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));\n }",
"function _data_first_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}"
]
| [
"0.69498545",
"0.64840597",
"0.6220662",
"0.6153934",
"0.60710835",
"0.60520834",
"0.5945574",
"0.58515733",
"0.57897764",
"0.5752972",
"0.5747811",
"0.5708191",
"0.5670388",
"0.56387705",
"0.5636962",
"0.5615819",
"0.55794567",
"0.55301565",
"0.5493316",
"0.54858154",
"0.5446265",
"0.5433387",
"0.5428103",
"0.5417862",
"0.5405023",
"0.5395592",
"0.53789127",
"0.53256816",
"0.5325588",
"0.531106"
]
| 0.7697573 | 0 |
Listener method for any entity type definition event. | public function onEntityTypeEvent(EntityTypeEvent $event, $event_name) {
switch ($event_name) {
case EntityTypeEvents::CREATE:
$this->onEntityTypeCreate($event->getEntityType());
break;
case EntityTypeEvents::UPDATE:
$this->onEntityTypeUpdate($event->getEntityType(), $event->getOriginal());
break;
case EntityTypeEvents::DELETE:
$this->onEntityTypeDelete($event->getEntityType());
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_uuid_entities_features_export_entity_alter(&$entity, $entity_type) {\n\n}",
"public static function getEntityTypeEvents() {\n $event = ['onEntityTypeEvent', 100];\n $events[EntityTypeEvents::CREATE][] = $event;\n $events[EntityTypeEvents::UPDATE][] = $event;\n $events[EntityTypeEvents::DELETE][] = $event;\n return $events;\n }",
"public function __construct($definition) {\n // Throw an exception if the entity type ID is longer than 32 characters.\n if (mb_strlen($definition['id']) > static::ID_MAX_LENGTH) {\n throw new EntityTypeIdLengthException('Attempt to create an entity type with an ID longer than ' . static::ID_MAX_LENGTH . \" characters: {$definition['id']}.\");\n }\n\n foreach ($definition as $property => $value) {\n $this->set($property, $value);\n }\n\n // Ensure defaults.\n $this->entity_keys += [\n 'revision' => '',\n 'bundle' => '',\n 'langcode' => '',\n 'default_langcode' => 'default_langcode',\n 'revision_translation_affected' => 'revision_translation_affected',\n ];\n $this->handlers += [\n 'access' => 'Drupal\\Core\\Entity\\EntityAccessControlHandler',\n ];\n if (isset($this->handlers['storage'])) {\n $this->checkStorageClass($this->handlers['storage']);\n }\n\n // Automatically add the \"EntityChanged\" constraint if the entity type\n // tracks the changed time.\n if ($this->entityClassImplements(EntityChangedInterface::class)) {\n $this->addConstraint('EntityChanged');\n }\n // Automatically add the \"EntityUntranslatableFields\" constraint if we have\n // an entity type supporting translatable fields and pending revisions.\n if ($this->entityClassImplements(ContentEntityInterface::class)) {\n $this->addConstraint('EntityUntranslatableFields');\n }\n\n // Ensure a default list cache tag is set.\n if (empty($this->list_cache_tags)) {\n $this->list_cache_tags = [$definition['id'] . '_list'];\n }\n }",
"function entity_type_callbacks($entity_type, $callback = NULL) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getToolboxHelper();\n\n return isset($callback) ? $helper->callbackGet($callback) : $helper->callbacksGet();\n}",
"function entity_info_alter_build(&$entity_info, $entity_type) {\n}",
"function entityDeclHandler($parser, $notationName, $base, $systemID, $publicID) {\n // virtual \n }",
"protected abstract function initializeEntityType(): string;",
"protected function traverseTypes(): void\n {\n if (isset($this->definition->tca['types']) && is_array($this->definition->tca['types'])) {\n foreach ($this->definition->tca['types'] as $type => $def) {\n $this->registerHandlerDefinitions($this->definition->tableName, $def);\n }\n }\n }",
"function schema_alter_build(&$schema, $entity_type) {}",
"function getType ()\n\t\t{\n\t\t\treturn \"Event\";\n\t\t}",
"public function setTableDefinition()\n {\n $this->addListener(new Doctrine_Template_Listener_Loggable($this->_options), 'loggable');\n }",
"public function define_hooks()\n\t{\n\t\t$base = new Base;\n\t\t$this->loader->add_action('init', $base, 'add_post_types');\n\t}",
"public function getExtendedType()\n {\n return EntityType::class;\n }",
"public function type_handler() {\r\n\t\t\r\n\t\t\t$this->next_step();\r\n\t\r\n\t}",
"public function onTickettypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function fireFieldTypeEvents($trigger);",
"function setEventType()\n {\n $this->_eventType = 12;\n }",
"public function manipulateTypeDefinition(DocumentAST &$documentAST, TypeDefinitionNode &$typeDefinition): void;",
"private function createTableDefinition()\n {\n $id = $this->getServiceId('table_type');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('table'));\n $definition\n ->setArguments([$this->options['entity']])\n ->addTag('table.type', [\n 'alias' => sprintf('%s_%s', $this->prefix, $this->resourceName)]\n )\n ;\n $this->container->setDefinition($id, $definition);\n }\n }",
"public function definition_after_data() {\n parent::definition_after_data();\n $this->_form->freeze(['type']);\n $this->tool->form_definition_after_data($this->_form);\n }",
"public function postLoad(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof Files){\n\n return;\n }\n }",
"public function setup_types()\n {\n }",
"public function afterCreate(\\stdClass $data, Entity $entity) { }",
"public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"function getEntityType() {\n return $this->entity_type;\n }",
"abstract protected function listensTo($typeName);",
"function setEventType() // OK\n {\n }",
"public function onAfterStructure() {\n $this->events->fire('updateModel_afterStructure', $this);\n }",
"public function run()\n {\n EntityType::create([\n 'en' => ['name' => 'offers'],\n 'ar' => ['name' => 'العروض'],\n ]);\n }",
"public function onEntityAttach(IEntity $entity): void;"
]
| [
"0.564189",
"0.55730176",
"0.5540037",
"0.54181194",
"0.5391239",
"0.53736305",
"0.5349644",
"0.53293395",
"0.5328653",
"0.532749",
"0.530613",
"0.52815086",
"0.5279895",
"0.5236544",
"0.52326816",
"0.51943827",
"0.5176871",
"0.51692104",
"0.51679146",
"0.51644784",
"0.5149141",
"0.51253515",
"0.51096874",
"0.5109136",
"0.505026",
"0.50334466",
"0.50266695",
"0.5010964",
"0.5006672",
"0.4990051"
]
| 0.617663 | 0 |
Invert the current colors. | public function invertColor($value = '')
{
$this->ansi(7);
$this->raw($value);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function invert();",
"public function resetInvertColors($value = '')\n {\n $this->ansi(27);\n $this->raw($value);\n\n return $this;\n }",
"function mc_inverse_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\tif ( strlen( $color ) != 6 ) {\n\t\treturn '#000000';\n\t}\n\t$rgb = '';\n\t$total = 0;\n\t$red = 0.299 * ( 255 - hexdec( substr( $color, 0, 2 ) ) );\n\t$green = 0.587 * ( 255 - hexdec( substr( $color, 2, 2 ) ) );\n\t$blue = 0.114 * ( 255 - hexdec( substr( $color, 4, 2 ) ) );\n\t$luminance = 1 - ( ( $red + $green + $blue ) / 255 );\n\tif ( $luminance < 0.5 ) {\n\t\treturn '#ffffff';\n\t} else {\n\t\treturn '#000000';\n\t}\n}",
"protected function inverse() {\n $this->invert = true;\n return $this;\n }",
"function inversecouleur($color) {\n\n $C1 = dechex(255-hexdec(substr($color, 1, 2)));\n $C2 = dechex(255-hexdec(substr($color, 3, 2)));\n $C3 = dechex(255-hexdec(substr($color, 5, 2)));\n \n if (strlen($C1) == 1) {\n $C1 = '0'.$C1;\n \n }\n elseif (strlen($C2) == 1) {\n $C2 = '0'.$C2;\n \n }\n elseif (strlen($C3) == 1) {\n $C3 = '0'.$C3;\n \n }\n $color = strtoupper($C1) . strtoupper($C2) . strtoupper($C3);\n return '#'.$color;\n // On prend les caract�res de la couleur $color deux par deux et\n // on les mets dans des variables\n // On transforme les paires de 2 caract�res en d�cimal\n // On inverse chaque partie de la couleur en la soustrayant au maximum (255)\n // On remet chaque partie de la couleur en hexad�cimal\n // Si le nombre hexad�cimal ne prend qu'un caract�re (par exemple 'A') on le \n // transforme en '0A' car une couleur est toujours faite de 6 caract�res\n // On retourne l'inverse de la couleur fournie $color\n}",
"public function invert( $A );",
"public static function color_inverse($color)\n {\n $color = str_replace('#', '', $color);\n if (strlen($color) != 6) {\n $color = str_repeat(substr($color, 0, 1), 2)\n .str_repeat(substr($color, 1, 1), 2)\n .str_repeat(substr($color, 2, 1), 2);\n }\n $rgb = '';\n for ($x=0; $x<3; $x++) {\n $c = 255 - hexdec(substr($color, (2*$x), 2));\n $c = ($c < 0) ? 0 : dechex($c);\n $rgb .= (strlen($c) < 2) ? '0'.$c : $c;\n }\n return $rgb;\n }",
"public function invert() {\n if (isset($this->_resource)) {\n imagefilter($this->_resource, IMG_FILTER_NEGATE);\n } else {\n trigger_error(\"CAMEMISResizeImage::invert() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }",
"public function getInverted() {\r\n return $this->inverted;\r\n }",
"function complement($i = 1){\n\t\tswitch($i){\n\t\t\tcase 1: return new Color($this->c, $this->a, $this->b);\n\t\t\tcase 2: return new Color($this->b, $this->c, $this->a);\n\t\t\tcase 3: return new Color($this->a, $this->c, $this->b);\n\t\t\tcase 4: return new Color($this->a, $this->b, $this->c);\n\t\t\tcase 5: return new Color($this->b, $this->a, $this->c);\n\t\t\tcase 6: return new Color($this->c, $this->b, $this->a);\n\t\t\tdefault: return $this;\n\t\t}\n\t}",
"public function setReverseColors(bool $on = true)\n {\n self::validateBoolean($on, __FUNCTION__);\n $this -> connector -> write(self::GS . \"B\" . ($on ? chr(1) : chr(0)));\n }",
"public static function getInverse()\n {\n return static::$inverse;\n }",
"function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}",
"public static function inverse(array $data)\n {\n self::transform_internal($data, +1);\n // Normalize\n $nd = count($data);\n $n = intdiv($nd, 2);\n $norm = 1 / ((double)$n);\n for ($i = 0; $i < $nd; $i++)\n $data[$i] *= $norm;\n }",
"function uds_invert_product_property_matrix($table)\n{\n\t$inverted = array();\n\t\n\tif(empty($table['properties'])) return array();\n\tif(empty($table['products'])) return array();\n\t\n\tforeach($table['properties'] as $name => $type) {\n\t\t$row = array();\n\t\t$row[] = $name;\t\n\t\t\n\t\tforeach($table['products'] as $product) {\n\t\t\tif($type == 'checkbox') {\n\t\t\t\tif($product['properties'][$name] == 'on') {\n\t\t\t\t\t//@since4.0 - now using font-awesome vector image\n\t\t\t\t\t//$row[] = \"<img src='\".UDS_PRICING_URL.\"/images/checkbox.png' alt='' />\";\n\t\t\t\t\t$row[] = \"<i class=\\\"fa fa-check\\\" style=\\\"color:#000;font-size:18px;\\\"></i>\";\n\t\t\t\t} else {\n\t\t\t\t\t$row[] = \"-\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$row[] = esc_html($product['properties'][$name]);\n\t\t\t}\n\t\t}\n\t\t$inverted[] = $row;\n\t}\n\t\n\treturn $inverted;\n}",
"function inverse(){\n return (long2ip(~(ip2long(\"255.255.255.255\")\n << (32-$this->netbits))));\n }",
"public static function invert(array $array)\n {\n \t$return = array();\n \n \tforeach ($array as $base => $values)\n \t{\n \t\tif (!is_array($values))\n \t\t{\n \t\t\tcontinue;\n \t\t}\n \n \t\tforeach ($values as $key)\n \t\t{\n \t\t\t// If the key isn't scalar then ignore it.\n \t\t\tif (is_scalar($key))\n \t\t\t{\n \t\t\t\t$return[$key] = $base;\n \t\t\t}\n \t\t}\n \t}\n \n \treturn $return;\n }",
"public function inverse(): Matrix\n {\n $this->validateDimensions($this, self::SQUARE | self::INVERTIBLE);\n\n if ($this->y === 1) {\n return new self([[1 / $this->get(0, 0)]]);\n }\n\n $adjugate = $this->getAdjugate();\n $this->setData($adjugate->divide($this->determinant()));\n\n return $this;\n }",
"public function negativeColor($value) {\n return $this->setProperty('negativeColor', $value);\n }",
"public function negativeColor($value) {\n return $this->setProperty('negativeColor', $value);\n }",
"public function inverse() : self\n {\n $a = self::identity($this->m)\n ->augmentLeft($this)\n ->rref()\n ->a()\n ->asArray();\n\n $b = [];\n\n foreach ($a as $rowA) {\n $b[] = array_slice($rowA, $this->n);\n }\n\n return self::quick($b);\n }",
"protected function get_grayout() {\n return 0;\n }",
"public function setInverted($value) {\r\n $this->inverted = $this->setBooleanProperty($this->inverted, $value);\r\n if ($this->isDepthAxis) {\r\n if ($this == $this->getChart()->getAxes()->getDepth())\r\n $this->chart->getAxes()->getDepthTop()->inverted = $this->getInverted();\r\n else\r\n $this->chart->getAxes()->getDepth()->inverted = $this->getInverted();\r\n }\r\n }",
"function opposite()\n\t\t{\n\t\t\t$res = new Vector(array('dest' => new Vertex(array(\n\t\t\t\t'x' => -$this->_x,\n\t\t\t\t'y' => -$this->_y,\n\t\t\t\t'z' => -$this->_z\n\t\t\t))));\n\t\t\treturn ($res);\n\t\t}",
"public function negate() : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $rowB = [];\n\n foreach ($rowA as $valueA) {\n $rowB[] = -$valueA;\n }\n\n $b[] = $rowB;\n }\n\n return self::quick($b);\n }",
"public static function inverse($message, $attributes = array())\n\t{\n\t\treturn static::show(Labels::INVERSE, $message, $attributes);\n\t}",
"public function colorMatrix() {}",
"public function revert();",
"function GetAllColors () {\n $colors = array (\"#00FFFF\",\"#000000\",\"#0000FF\",\"#8A2BE2\",\"#A52A2A\",\"#DEB887\",\"#5F9EA0\",\"#7FFF00\",\"#D2691E\",\"#FF7F50\",\"#6495ED\",\"#00FFFF\",\"#00008B\",\"#008B8B\",\"#B8860B\",\"#A9A9A9\",\"#006400\",\"#BDB76B\",\"#8B008B\",\"#556B2F\",\"#FF8C00\",\"#9932CC\",\"#8B0000\",\"#E9967A\",\"#8FBC8F\",\"#483D8B\",\"#2F4F4F\",\"#2F4F4F\",\"#00CED1\",\"#9400D3\",\"#FF1493\",\"#00BFFF\",\"#696969\",\"#696969\",\"#1E90FF\",\"#B22222\",\"#228B22\",\"#FF00FF\",\"#FFD700\",\"#DAA520\",\"#808080\",\"#808080\",\"#008000\",\"#ADFF2F\",\"#FF69B4\",\"#CD5C5C\",\"#4B0082\",\"#7CFC00\",\"#ADD8E6\",\"#F08080\",\"#E0FFFF\",\"#D3D3D3\",\"#90EE90\",\"#FFB6C1\",\"#FFA07A\",\"#20B2AA\",\"#87CEFA\",\"#778899\",\"#778899\",\"#B0C4DE\",\"#00FF00\",\"#32CD32\",\"#FF00FF\",\"#800000\",\"#66CDAA\",\"#0000CD\",\"#BA55D3\",\"#9370D8\",\"#3CB371\",\"#7B68EE\",\"#00FA9A\",\"#48D1CC\",\"#C71585\",\"#191970\",\"#FFE4E1\",\"#FFE4B5\",\"#000080\",\"#808000\",\"#6B8E23\",\"#FFA500\",\"#FF4500\",\"#DA70D6\",\"#EEE8AA\",\"#98FB98\",\"#AFEEEE\",\"#D87093\",\"#FFDAB9\",\"#CD853F\",\"#FFC0CB\",\"#DDA0DD\",\"#B0E0E6\",\"#800080\",\"#FF0000\",\"#BC8F8F\",\"#4169E1\",\"#8B4513\",\"#FA8072\",\"#F4A460\",\"#2E8B57\",\"#A0522D\",\"#C0C0C0\",\"#87CEEB\",\"#6A5ACD\",\"#708090\",\"#708090\",\"#00FF7F\",\"#4682B4\",\"#D2B48C\",\"#008080\",\"#D8BFD8\",\"#FF6347\",\"#40E0D0\",\"#EE82EE\",\"#F5DEB3\",\"#FFFFFF\",\"#F5F5F5\",\"#FFFF00\",\"#9ACD32\");\n return($colors);\n}",
"function andersen_color_sync($key = '', $lum = 2){\n\t\t$r = hexdec(substr($key,0,2));\n\t\t$g = hexdec(substr($key,2,2));\n\t\t$b = hexdec(substr($key,4,2));\n\n\t\t$yiq = (($r*299)+($g*587)+($b*114))/1000;\n\n\t\tif ($yiq >= 128){\n\t\t $out = andersen_darken($key, $lum);\n\t\t}else{\n\t\t //dark color, use bright font\n\t\t $out = andersen_lighten($key, $lum);\n\t\t}\n\n\t\treturn $out;\n\t}"
]
| [
"0.70377743",
"0.6343577",
"0.6166284",
"0.6151737",
"0.6081107",
"0.59824777",
"0.5866641",
"0.56663996",
"0.54844564",
"0.538906",
"0.5250335",
"0.49616238",
"0.49508855",
"0.49357063",
"0.4840229",
"0.48356944",
"0.48174742",
"0.48122594",
"0.47100475",
"0.47100475",
"0.4707945",
"0.46744028",
"0.4635162",
"0.46334437",
"0.4624613",
"0.46219164",
"0.45858338",
"0.4568262",
"0.4530974",
"0.45214745"
]
| 0.6449858 | 1 |
Reset the invert colors flag. | public function resetInvertColors($value = '')
{
$this->ansi(27);
$this->raw($value);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function invert();",
"public function setReverseColors(bool $on = true)\n {\n self::validateBoolean($on, __FUNCTION__);\n $this -> connector -> write(self::GS . \"B\" . ($on ? chr(1) : chr(0)));\n }",
"public function invertColor($value = '')\n {\n $this->ansi(7);\n $this->raw($value);\n\n return $this;\n }",
"protected function inverse() {\n $this->invert = true;\n return $this;\n }",
"public function getInverted() {\r\n return $this->inverted;\r\n }",
"public function invert( $A );",
"function mc_inverse_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\tif ( strlen( $color ) != 6 ) {\n\t\treturn '#000000';\n\t}\n\t$rgb = '';\n\t$total = 0;\n\t$red = 0.299 * ( 255 - hexdec( substr( $color, 0, 2 ) ) );\n\t$green = 0.587 * ( 255 - hexdec( substr( $color, 2, 2 ) ) );\n\t$blue = 0.114 * ( 255 - hexdec( substr( $color, 4, 2 ) ) );\n\t$luminance = 1 - ( ( $red + $green + $blue ) / 255 );\n\tif ( $luminance < 0.5 ) {\n\t\treturn '#ffffff';\n\t} else {\n\t\treturn '#000000';\n\t}\n}",
"function inversecouleur($color) {\n\n $C1 = dechex(255-hexdec(substr($color, 1, 2)));\n $C2 = dechex(255-hexdec(substr($color, 3, 2)));\n $C3 = dechex(255-hexdec(substr($color, 5, 2)));\n \n if (strlen($C1) == 1) {\n $C1 = '0'.$C1;\n \n }\n elseif (strlen($C2) == 1) {\n $C2 = '0'.$C2;\n \n }\n elseif (strlen($C3) == 1) {\n $C3 = '0'.$C3;\n \n }\n $color = strtoupper($C1) . strtoupper($C2) . strtoupper($C3);\n return '#'.$color;\n // On prend les caract�res de la couleur $color deux par deux et\n // on les mets dans des variables\n // On transforme les paires de 2 caract�res en d�cimal\n // On inverse chaque partie de la couleur en la soustrayant au maximum (255)\n // On remet chaque partie de la couleur en hexad�cimal\n // Si le nombre hexad�cimal ne prend qu'un caract�re (par exemple 'A') on le \n // transforme en '0A' car une couleur est toujours faite de 6 caract�res\n // On retourne l'inverse de la couleur fournie $color\n}",
"public function reset() {\r\n $this->state = BaseConverter::ConvertFromBinary($this->initv, '0123456789');\r\n $this->state = ltrim($this->state, '0');\r\n }",
"public function setInverted($value) {\r\n $this->inverted = $this->setBooleanProperty($this->inverted, $value);\r\n if ($this->isDepthAxis) {\r\n if ($this == $this->getChart()->getAxes()->getDepth())\r\n $this->chart->getAxes()->getDepthTop()->inverted = $this->getInverted();\r\n else\r\n $this->chart->getAxes()->getDepth()->inverted = $this->getInverted();\r\n }\r\n }",
"function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}",
"private function reset(): void\n {\n $this->values = [];\n $this->bg_colors = [];\n $this->striped = false;\n $this->animate = false;\n $this->height = null;\n }",
"public static function color_inverse($color)\n {\n $color = str_replace('#', '', $color);\n if (strlen($color) != 6) {\n $color = str_repeat(substr($color, 0, 1), 2)\n .str_repeat(substr($color, 1, 1), 2)\n .str_repeat(substr($color, 2, 1), 2);\n }\n $rgb = '';\n for ($x=0; $x<3; $x++) {\n $c = 255 - hexdec(substr($color, (2*$x), 2));\n $c = ($c < 0) ? 0 : dechex($c);\n $rgb .= (strlen($c) < 2) ? '0'.$c : $c;\n }\n return $rgb;\n }",
"public function invert() {\n if (isset($this->_resource)) {\n imagefilter($this->_resource, IMG_FILTER_NEGATE);\n } else {\n trigger_error(\"CAMEMISResizeImage::invert() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }",
"public function restoreGraphicState() {}",
"public function restoreGraphicState() {}",
"static function colorize() {\n\t\tself::$colorize = true;\n\t}",
"public function resetOriginalStatus() {\n $this->orig_status = $this->getStatus();\n }",
"public function reset()\n {\n parent::reset();\n $this->attr('Material')->shader('flat');\n $this->attr('Material')->side('double');\n $this->color('#FFF');\n $this->transparent(true);\n $this->height(1.75);\n $this->width(1.75);\n }",
"public function flip(){\n $this->flip = !$this->flip;\n }",
"public function resetFlags();",
"public function reset()\n {\n parent::reset();\n $this->attr('Light');\n \n }",
"protected function get_grayout() {\n return 0;\n }",
"public function resetBooleans()\n {\n $this->setShowSize(false);\n $this->setShowDescription(false);\n $this->setShowExtension(false);\n $this->setShowLastUpdate(false);\n }",
"function inverse(){\n return (long2ip(~(ip2long(\"255.255.255.255\")\n << (32-$this->netbits))));\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_DRAW_VITALITY] = null;\n }",
"protected function setTransparencyColor():void{\n\n\t\tif(!$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\t$this->imagick->transparentPaintImage($transparencyColor, 0.0, 10, false);\n\t}",
"public function reset()\n\t\t{\n\t\t\t$this->styles = [];\n\t\t}",
"public function reset()\n {\n $this->_setRay();\n }",
"public function videoconferenciaNoInterrumpirOFF( ) {\n $this->setNoInterrumpir(\"ON\");\n// $this->setNoInterrumpir(\"AUTOANSWER\");\n }"
]
| [
"0.65772814",
"0.5909503",
"0.5848268",
"0.57038903",
"0.5550052",
"0.55094147",
"0.5503782",
"0.545619",
"0.5242165",
"0.51890737",
"0.51461095",
"0.5133324",
"0.51326185",
"0.5117088",
"0.50935143",
"0.50935143",
"0.5084905",
"0.49260122",
"0.490527",
"0.49012765",
"0.48678648",
"0.48009807",
"0.47902778",
"0.4680202",
"0.46628562",
"0.46597856",
"0.4658733",
"0.46369278",
"0.4616027",
"0.4605115"
]
| 0.6379555 | 1 |
Set a 16bit color. | public function color16(int $color, $value = '')
{
$this->ansi($color);
$this->raw($value);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setColor($hex) {\n }",
"public function setColor($color) {}",
"private static function setColorAsBit($controlLevel, &$color)\n\t{\n\t\t$color = $controlLevel + self::PIXELDIFF;\n\t\tif ($color > 255) {\n\t\t\t$color -= (2 * self::PIXELDIFF);\n\t\t}\n\n\t\treturn;\n\t}",
"public function setColor( $rgb ) {\n\t}",
"function setColor($newColor) {\n\t\t$this->color = $newColor;\n\t}",
"public function set_color($color, $type = self::TYPE_RGB_HEX)\n {\n switch ($type) {\n // Hex string RGB value AABBCC\n case self::TYPE_RGB_HEX:\n $this->_rgb_dec = $this->rgb_hex_to_dex($color);\n $this->_rgb_hex = $this->rgb_dec_to_hex($this->_rgb_dec);\n $this->make_hsl();\n break;\n\n // Decimal array of RGB values\n case self::TYPE_RGB_DEC:\n $this->_rgb_hex = $this->rgb_dec_to_hex($color);\n $this->_rgb_dec = $this->rgb_hex_to_dex($this->_rgb_hex);\n $this->make_hsl();\n break;\n\n // Integer ranges (0 - xxx_MAX) for HSL values\n case self::TYPE_HSL:\n $color['hue'] /= self::HUE_MAX;\n $color['saturation'] /= self::SATURATION_MAX;\n $color['luminance'] /= self::LUMINANCE_MAX;\n $this->_hsl = $color;\n $this->make_rgb();\n break;\n\n // Float ranges (0-1) for HSL values (for internal use)\n case self::TYPE_HSL_INTERNAL:\n $this->_hsl = $color;\n $this->make_rgb();\n break;\n\n // This should never execute, but you never know\n default:\n throw new Exception('Color Type is required');\n }\n }",
"function setColor( $c ) {\n $this->currentColor = $c;\n}",
"public function setColor(int $color = Printer::COLOR_1)\n {\n self::validateInteger($color, 0, 1, __FUNCTION__, \"Color\");\n $this -> connector -> write(self::ESC . \"r\" . chr($color));\n }",
"public function setColor($color){\n $this->color = $color;\n }",
"public function setColor($color) {\n\t\t$this->color = $color;\n\t}",
"public function set_color($color = false) {\n $this->color = (Validator::isa($color,\"boolean\") ? $color : false);\n }",
"public function setColor($color)\n {\n $this->color = $color;\n }",
"public function writeInt16($num){ }",
"protected function setColor(int $index, IColor $color) {\n $this -> offsetSet($index, $color);\n }",
"public function set_hue($hue)\n {\n while ($hue < 0) {\n $hue += self::HUE_MAX;\n }\n\n $hue %= self::HUE_MAX;\n\n $this->_hsl['hue'] = $hue / self::HUE_MAX;\n $this->set_color($this->_hsl, self::TYPE_HSL_INTERNAL);\n }",
"public function setColor($color)\n {\n $this->color = $color;\n }",
"public function setColor(bool $color): void\n {\n $this->color = $color;\n }",
"public function setColor(?string $value): void {\n $this->getBackingStore()->set('color', $value);\n }",
"public function setColor($color, $stroking = true) {}",
"public function setColor() {\n\t\t$cnt = func_num_args();\n\t\tif ($cnt == 0) {\n\t\t\t$this->Color = new TColor(255,100,255);\n\t\t}\telse\n\t\tif ($cnt == 1) {\n\t\t\tlist ($sender) = func_get_args();\n\t\t\tif ($sender instanceof TColor) {\n\t\t\t\t$this->Color = new TColor(\n\t\t\t\t$sender->getRed (),\n\t\t\t\t$sender->getGreen(),\n\t\t\t\t$sender->getBlue ());\n\t\t\t}\telse\n\t\t\tif (is_string($sender)) {\n\t\t\t\t// todo: string\n\t\t\t}\n\t\t}\telse\n\t\tif ($cnt == 3) {\n\t\t\tlist($a1,$a2,$a3) = func_get_args();\n\t\t\t$this->Color = new TColor($a1,$a2,$a3);\n\t\t}\n\t}",
"public function setColorChannel($channel, $value, $convertToAbsolute = false) {\n if ($convertToAbsolute) {\n $value = ColorLib::getChannelAbsoluteValue($channel, $value);\n }\n\n $result = $this->getColorLib()->setColor($this->getSafeType(), $this->getSafeColor())->setChannel($channel, $value);\n if ($result === true) {\n $this->setResultColor();\n }\n }",
"public static function setColorMode(?AnsiColorMode $colorMode): void\n {\n self::$colorMode = $colorMode;\n }",
"public function setColor($color) {\n if (!self::isCorrectColor($this->getType(), $color)) {\n throw new InputException(null, 'WRONG_COLOR_FORMAT');\n }\n if ($this->getType() !== ColorLib::THEX && $this->getType() !== ColorLib::THTML) {\n foreach ($color as $channelName => &$channelValue) {\n $channelValue = ColorLib::fixColorChannel($channelName, $channelValue);\n }\n }\n $this->color = $color;\n }",
"function setColor($color_coche, $nombre_coche){\r\n\t\t\t$this->color=$color_coche;\r\n\t\t\techo \"El color del \" . $nombre_coche . \" es: \" . $this->color . \"<br/>\";\r\n\t\t}",
"public function setColor($Ai_Colormode, $Av_Color)\n {\n $Lb_Return = true;\n $this->a_Errors = null;\n\n switch($Ai_Colormode)\n {\n case self::SVNHUE_COLORMODE_NAME:\n if (array_key_exists($Av_Color, $this->a_Colors))\n {\n $this->a_State['xy'] = $this->a_Colors[$Av_Color];\n $this->i_Colormode = self::SVNHUE_COLORMODE_XY;\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['ct']);\n } /* if */\n else\n {\n $this->a_Errors[] = self::SVNHUE_ERROR_INVALID_COLOR;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_HUE:\n if ((is_numeric($Av_Color[0]) && !is_float($Av_Color[0])) && (is_numeric($Av_Color[1]) && !is_float($Av_Color[1])))\n {\n if ($Av_Color[0] > 65535)\n {\n $Av_Color[0] = 65535;\n } /* if */\n elseif ($Av_Color[0] < 0)\n {\n $Av_Color[0] = 0;\n } /* elseif */\n if ($Av_Color[1] > 254)\n {\n $Av_Color[1] = 254;\n } /* if */\n elseif ($Av_Color[1] < 0)\n {\n $Av_Color[1] = 0;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_HUE;\n $this->a_State['hue'] = $Av_Color[0];\n $this->a_State['sat'] = $Av_Color[1];\n unset($this->a_State['ct']);\n unset($this->a_State['xy']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_CT:\n if (is_numeric($Av_Color) && !is_float($Av_Color))\n {\n if ($Av_Color > 500)\n {\n $Av_Color = 500;\n } /* if */\n elseif ($Av_Color < 154)\n {\n $Av_Color = 154;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_CT;\n $this->a_State['ct'] = $Av_Color;\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['xy']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_XY:\n if (is_numeric($Av_Color[0]) && is_numeric($Av_Color[1]))\n {\n if ($Av_Color[0] > 1)\n {\n $Av_Color[0] = 1;\n } /* if */\n elseif ($Av_Color[0] < 0)\n {\n $Av_Color[0] = 0;\n } /* elseif */\n if ($Av_Color[1] > 1)\n {\n $Av_Color[1] = 1;\n } /* if */\n elseif ($Av_Color[1] < 0)\n {\n $Av_Color[1] = 0;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_XY;\n $this->a_State['xy'] = array($Av_Color[0], $Av_Color[1]);\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['ct']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n default:\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n break;\n } /* switch */\n\n return($Lb_Return);\n\n }",
"public function set_rgbColorAtPowerOn(int $newval): int\n {\n $rest_val = sprintf(\"0x%06x\", $newval);\n return $this->_setAttr(\"rgbColorAtPowerOn\", $rest_val);\n }",
"public function set_hslColor(int $newval): int\n {\n $rest_val = sprintf(\"0x%06x\", $newval);\n return $this->_setAttr(\"hslColor\", $rest_val);\n }",
"public function setColor($id, $color)\n {\n return $this->put($this->getPath().'/'.rawurlencode($id).'/color', array('value' => $color));\n }",
"function it_gets_and_sets_the_color_option()\n {\n $this->getColor()->shouldReturn('yellow');\n\n // Set the color key\n $this->setColor('random');\n\n // Get the current color setting\n $this->getColor()->shouldReturn('random');\n }",
"public static function color($value)\n {\n self::$color = Color::toRGBA($value);\n }"
]
| [
"0.61588037",
"0.6033597",
"0.5975116",
"0.59142286",
"0.5759759",
"0.5728899",
"0.56363815",
"0.56326896",
"0.56140727",
"0.5529181",
"0.54904366",
"0.54881907",
"0.5482875",
"0.54757345",
"0.5448975",
"0.54324347",
"0.5342231",
"0.53343076",
"0.53158975",
"0.5249547",
"0.5233556",
"0.521474",
"0.51865864",
"0.5173688",
"0.5124221",
"0.5111427",
"0.5109341",
"0.5023405",
"0.49968007",
"0.49662355"
]
| 0.66333103 | 0 |
Add a custom ANSI flag. | public function ansi($value)
{
$this->string .= "\033[${value}m";
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetStyle($tag, $enable)\r\n{\r\n $this->$tag += ($enable ? 1 : -1);\r\n $style = '';\r\n foreach(array('B', 'I', 'U') as $s)\r\n {\r\n if($this->$s>0)\r\n $style .= $s;\r\n }\r\n $this->SetFont('',$style);\r\n}",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"function SetStyle($tag,$enable)\n{\n $this->$tag+=($enable ? 1 : -1);\n $style='';\n foreach(array('B','I','U') as $s)\n if($this->$s>0)\n $style.=$s;\n $this->SetFont('',$style);\n}",
"public function ansiEnable() {\n $this->stdout->ansiEnable();\n $this->stderr->ansiEnable();\n return $this;\n }",
"public function useAnsiColors() : bool\n {\n return (bool) ($this->settings['ansi-colors'] ?? true);\n }",
"function SetStyle($tag, $enable) {\n $this->$tag+=($enable ? 1 : -1);\n $style = '';\n foreach (array('B', 'I', 'U') as $s) {\n if ($this->$s > 0)\n $style.=$s;\n }\n $this->SetFont('', $style);\n }",
"function SetStyle($tag,$enable)\r\n {\r\n $this->$tag+=($enable ? 1 : -1);\r\n $style='';\r\n foreach(array('B','I','U') as $s)\r\n if($this->$s>0)\r\n $style.=$s;\r\n $this->SetFont('',$style);\r\n }",
"function SetStyle($tag,$enable)\r\n {\r\n $this->$tag+=($enable ? 1 : -1);\r\n $style='';\r\n foreach(array('B','I','U') as $s)\r\n if($this->$s>0)\r\n $style.=$s;\r\n $this->SetFont('',$style);\r\n }",
"function SetStyle($tag, $enable)\n {\n $this->$tag+=($enable ? 1 : -1);\n $style='';\n foreach(array('B','I','U') as $s)\n {\n if($this->$s>0)\n $style.=$s;\n }\n $this->SetFont('',$style);\n }",
"function SetStyle($tag, $enable)\n {\n $this->$tag+=($enable ? 1 : -1);\n $style='';\n foreach(array('B','I','U') as $s)\n {\n if($this->$s>0)\n $style.=$s;\n }\n $this->SetFont('',$style);\n }",
"function SetStyle($tag, $enable) {\n\t\t$this->$tag += ($enable ? 1 : -1);\n\t\t$style = '';\n\t\tforeach(array('B', 'I', 'U') as $s) {\n\t\t\tif($this->$s>0)\n\t\t\t\t$style .= $s;\n\t\t}\n\t\t$this->SetFont('',$style);\n\t}",
"abstract public function register_style();",
"public function add_inline_style($handle, $code)\n {\n }",
"function SetStyle($tag, $enable)\n\t{\n\t\t$this->$tag += ($enable ? 1 : -1);\n\t\t$style = '';\n\t\tforeach(array('B', 'I', 'U') as $s)\n\t\t{\n\t\t\tif($this->$s>0)\n\t\t\t\t$style .= $s;\n\t\t}\n\t\t$this->SetFont('',$style);\n\t}",
"public static function ansiFormat($string, $format = [])\n {\n $code = implode(';', $format);\n\n return \"\\033[0m\" . ($code !== '' ? \"\\033[\" . $code . 'm' : '') . $string . \"\\033[0m\";\n }",
"function wp_add_inline_style($handle, $data)\n {\n }",
"function pintaln($str, $color = 'blanco')\n{\n $c = array('verde' => \"\\033[32m\",\n 'verdeclaro' => \"\\033[1;32m\",\n 'rojo' => \"\\033[31m\",\n 'azul' => \"\\033[34m\",\n 'cyan' => \"\\033[36m\",\n 'amarillo' => \"\\033[0;33m\",\n 'gris' => \"\\033[1;30m\",\n 'blanco' => \"\\033[0;37m\",\n 'fin' => \"\\033[0;37m\" );\n // echo \"\\033[35mAviso:\\033[37m \";\n // echo \"\\033[133mDebug:\\033[37m \";\n if (!array_key_exists($color,$c)){\n $color='rojo';\n }\n echo $c[$color] . $str . $c['fin'] . \"\\n\";\n}",
"function vcex_inline_style( $atts = array(), $add_style = true ) {\n\t$atts = array_filter( $atts ); // remove empty items.\n\tif ( $atts && is_array( $atts ) ) {\n\t\t$inline_style = new TotalThemeCore\\Vcex\\Inline_Style( $atts, $add_style );\n\t\treturn $inline_style->return_style();\n\t}\n}",
"function register_style() {\n}",
"function formatStatus ($txt, $exit_code = 4)\n{\n\t$green = '#66bb6a';\n\t$red = '#f0666c';\n\t$orange = '#ffe57b';\n\t$grey = '#5f6268';\n\t$white = '#fff';\n\t\n\tif ($exit_code == 0)\n\t\t$output = '<span style=\"background-color:'. $green . '; color: ' . $white . '; padding: 1px 3px;\">'. $txt . '</span>';\n\t\n\telseif ($exit_code == 1)\n\t\t$output = '<span style=\"background-color:'. $orange . '; color: ' . $grey . '; padding: 1px 3px;\">'. $txt . '</span>';\n\t\n\telseif ($exit_code == 2)\n\t\t$output = '<span style=\"background-color:'. $red . '; color: ' . $white . '; padding: 1px 3px;\">'. $txt . '</span>';\n\telse\n\t\t$output = $txt;\n\n\treturn $output;\n}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function add_style($style,$dynamic=false)\n \t{\n \t\t$this->styles[$style]=$style;\n \t}",
"protected function _drawStyle($style) {}",
"static function red($text) {\n\t\techo (self::$colorize) ? \"\\033[31m\".$text.\"\\033[0m\" : $text;\n\t}",
"function cli_highlight($string, $color = null) {\n $colors = [\n 'default' => '49',\n 'black' => '40',\n 'red' => '41',\n 'green' => '42',\n 'yellow' => '43',\n 'blue' => '44',\n 'magenta' => '45',\n 'cyan' => '46',\n 'light_gray' => '47',\n 'dark_gray' => '100',\n 'light_red' => '101',\n 'light_green' => '102',\n 'light_yellow' => '103',\n 'light_blue' => '104',\n 'light_magenta' => '105',\n 'light_cyan' => '106',\n 'white' => '107',\n ];\n\n if ($color === null or ! array_has($colors, $color)) {\n return $string;\n } else {\n $color = $colors[$color];\n }\n\n return s(\"\\033[%sm%s\\033[0m\", $color, $string);\n }",
"public function getLineEndingStyle() {}",
"protected function styles($style, $element) {\n\t\tparent::style($style, $element);\n\t\t$element->setAttribute('titlecolor', $style->getStyle('titlecolor'));\n\t}",
"function SetTextOutline($width, $r=0, $g=-1, $b=-1) //EDITEI\n\t\t{ \n\t\t if ($width == false) //Now resets all values\n\t\t { \n\t\t\t$this->outline_on = false;\n\t\t\t$this->SetLineWidth(0.2); \n\t\t\t$this->SetDrawColor(0); \n\t\t\t$this->_setTextRendering(0); \n\t\t\t$this->_out('0 Tr'); \n\t\t }\n\t\t else\n\t\t { \n\t\t\t$this->SetLineWidth($width); \n\t\t\t$this->SetDrawColor($r, $g , $b); \n\t\t\t$this->_out('2 Tr'); //Fixed\n\t\t } \n\t\t}",
"function cli_style($string, $color = null, $highlight = null, $format = null) {\n return cli_highlight(\n cli_color(\n cli_format($string, $format), $color\n ), $highlight\n );\n }"
]
| [
"0.5662476",
"0.56527525",
"0.56527525",
"0.5620445",
"0.55548257",
"0.5495266",
"0.5480134",
"0.54648036",
"0.54648036",
"0.5439375",
"0.5439375",
"0.54297453",
"0.5378366",
"0.5362404",
"0.53525513",
"0.5239301",
"0.52351654",
"0.5205844",
"0.51463103",
"0.5134375",
"0.51183647",
"0.5111955",
"0.50710946",
"0.5065479",
"0.5044915",
"0.5037452",
"0.5011197",
"0.4992265",
"0.49744758",
"0.49503338"
]
| 0.5694746 | 0 |
Strip all ANSI sequences from the string. | public function stripAnsi()
{
$this->string = \preg_replace("/\033\[[;0-9]*\m/Us", '', $this->string);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function strip_ascii_ctrl($str) {\n\t\treturn preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]+/S', '', $str);\n\t}",
"public function uncut($str)\n {\n return str_replace('​', '', str_replace('', '', $str) );\n }",
"private function trim(string $str)\n {\n return preg_replace('/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/', '', $str);\n }",
"protected function remove_non_ascii( $string ) {\n\t\treturn preg_replace( '/[\\x00-\\x1F\\x7F-\\xFF]/', '', $string );\n\t}",
"public static function strip_non_ascii($str) {\n\t\treturn preg_replace('/[^\\x00-\\x7F]+/S', '', $str);\n\t}",
"function stripColors($str) {\n\t\treturn\n\t\t\tstr_replace(\"\\0\", '$$',\n\t\t\t\tpreg_replace(\n\t\t\t\t\t'/\\\\$(?:[0-9a-f]..|[g-z]|$)/iu', '',\n\t\t\t\t\tstr_replace('$$', \"\\0\", $str)\n\t\t\t\t)\n\t\t\t)\n\t\t;\n\t}",
"public function sanitize($string) {\n return preg_replace('/[^\\x0A\\x20-\\x7E]/', '', $string);\n }",
"protected static function trim(string $string)\n {\n $string = str_replace(\"\\u202a\", \"\", $string);\n $string = str_replace(urldecode(\"%EF%BF%BD\"), \"\", $string);\n return trim($string, urldecode(\"%E2%80%AC\")); // Weird character encodings\n }",
"private function tidyUpData($string)\n {\n return preg_replace('/[\\x00-\\x1F\\x7F]/u', '', $string); \n }",
"public static function stripCtrlChars($string) {\n // See: http://w3.org/International/questions/qa-forms-utf-8.html\n // Printable utf-8 does not include any of these chars below x7F\n return preg_replace('@[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]@', ' ', $string);\n }",
"public static function superTrim($string) {\n // Remove unicode whitespace.\n // @see http://stackoverflow.com/questions/4166896/trim-unicode-whitespace-in-php-5-2\n $string = preg_replace('/^[\\pZ\\pC]+|[\\pZ\\pC]+$/u', '', $string);\n return $string;\n }",
"public function trimText($str) {\n $str = preg_replace('/^\\p{Z}+|\\p{Z}+$/u', '', $str);\n return $str;\n }",
"public static function cleanNonPrintableUtf8($text)\n {\n return is_string($text) ? preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x9F]/u', '', $text) : $text;\n }",
"public function clean_string($str)\n {\n if ($this->is_ascii($str) === false)\n {\n $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);\n }\n\n return $str;\n }",
"static function stripAccents( $str )\n {\n $str = str_replace(\"�\", \"a\", $str);\n $str = str_replace(\"�\", \"e\", $str);\n $str = str_replace(\"�\", \"i\", $str);\n $str = str_replace(\"�\", \"o\", $str);\n $str = str_replace(\"�\", \"u\", $str);\n $str = str_replace(\"�\", \"A\", $str);\n $str = str_replace(\"�\", \"E\", $str);\n $str = str_replace(\"�\", \"I\", $str);\n $str = str_replace(\"�\", \"O\", $str);\n $str = str_replace(\"�\", \"U\", $str);\n $str = str_replace(\"�\", \"n\", $str);\n $str = str_replace(\"�\", \"N\", $str);\n return $str;\n }",
"public function just_clean($string)\n {\n $s = '!@#$%^&*()_+-={}[]:\";\\'?/.,<>`~';\n for($i=0;$i<mb_strlen($s,'utf-8');$i++)\n {\n $string = str_replace(mb_substr($s,$i,1,'utf-8'),'', $string);\n $string = str_replace(' ',' ', $string);\n }\n return trim($string);\n }",
"function _remove_invisible_characters($str)\n\t{\n\t\tstatic $non_displayables;\n\n\t\tif ( ! isset($non_displayables))\n\t\t{\n\t\t\t// every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09),\n\t\t\t$non_displayables = array(\n\t\t\t\t\t\t\t\t\t\t'/%0[0-8bcef]/',\t\t\t// url encoded 00-08, 11, 12, 14, 15\n\t\t\t\t\t\t\t\t\t\t'/%1[0-9a-f]/',\t\t\t\t// url encoded 16-31\n\t\t\t\t\t\t\t\t\t\t'/[\\x00-\\x08]/',\t\t\t// 00-08\n\t\t\t\t\t\t\t\t\t\t'/\\x0b/', '/\\x0c/',\t\t\t// 11, 12\n\t\t\t\t\t\t\t\t\t\t'/[\\x0e-\\x1f]/'\t\t\t\t// 14-31\n\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$cleaned = $str;\n\t\t\t$str = preg_replace($non_displayables, '', $str);\n\t\t}\n\t\twhile ($cleaned != $str);\n\n\t\treturn $str;\n\t}",
"function remove_accents($string) {\n\tif ( !preg_match('/[\\x80-\\xff]/', $string) )\n\t\treturn $string;\n\n\tif (seems_utf8($string)) {\n\t\t$chars = array(\n\t\t// Decompositions for Latin-1 Supplement\n\t\tchr(194).chr(170) => 'a', chr(194).chr(186) => 'o',\n\t\tchr(195).chr(128) => 'A', chr(195).chr(129) => 'A',\n\t\tchr(195).chr(130) => 'A', chr(195).chr(131) => 'A',\n\t\tchr(195).chr(132) => 'A', chr(195).chr(133) => 'A',\n\t\tchr(195).chr(134) => 'AE',chr(195).chr(135) => 'C',\n\t\tchr(195).chr(136) => 'E', chr(195).chr(137) => 'E',\n\t\tchr(195).chr(138) => 'E', chr(195).chr(139) => 'E',\n\t\tchr(195).chr(140) => 'I', chr(195).chr(141) => 'I',\n\t\tchr(195).chr(142) => 'I', chr(195).chr(143) => 'I',\n\t\tchr(195).chr(144) => 'D', chr(195).chr(145) => 'N',\n\t\tchr(195).chr(146) => 'O', chr(195).chr(147) => 'O',\n\t\tchr(195).chr(148) => 'O', chr(195).chr(149) => 'O',\n\t\tchr(195).chr(150) => 'O', chr(195).chr(153) => 'U',\n\t\tchr(195).chr(154) => 'U', chr(195).chr(155) => 'U',\n\t\tchr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',\n\t\tchr(195).chr(158) => 'TH',chr(195).chr(159) => 's',\n\t\tchr(195).chr(160) => 'a', chr(195).chr(161) => 'a',\n\t\tchr(195).chr(162) => 'a', chr(195).chr(163) => 'a',\n\t\tchr(195).chr(164) => 'a', chr(195).chr(165) => 'a',\n\t\tchr(195).chr(166) => 'ae',chr(195).chr(167) => 'c',\n\t\tchr(195).chr(168) => 'e', chr(195).chr(169) => 'e',\n\t\tchr(195).chr(170) => 'e', chr(195).chr(171) => 'e',\n\t\tchr(195).chr(172) => 'i', chr(195).chr(173) => 'i',\n\t\tchr(195).chr(174) => 'i', chr(195).chr(175) => 'i',\n\t\tchr(195).chr(176) => 'd', chr(195).chr(177) => 'n',\n\t\tchr(195).chr(178) => 'o', chr(195).chr(179) => 'o',\n\t\tchr(195).chr(180) => 'o', chr(195).chr(181) => 'o',\n\t\tchr(195).chr(182) => 'o', chr(195).chr(184) => 'o',\n\t\tchr(195).chr(185) => 'u', chr(195).chr(186) => 'u',\n\t\tchr(195).chr(187) => 'u', chr(195).chr(188) => 'u',\n\t\tchr(195).chr(189) => 'y', chr(195).chr(190) => 'th',\n\t\tchr(195).chr(191) => 'y', chr(195).chr(152) => 'O',\n\t\t// Decompositions for Latin Extended-A\n\t\tchr(196).chr(128) => 'A', chr(196).chr(129) => 'a',\n\t\tchr(196).chr(130) => 'A', chr(196).chr(131) => 'a',\n\t\tchr(196).chr(132) => 'A', chr(196).chr(133) => 'a',\n\t\tchr(196).chr(134) => 'C', chr(196).chr(135) => 'c',\n\t\tchr(196).chr(136) => 'C', chr(196).chr(137) => 'c',\n\t\tchr(196).chr(138) => 'C', chr(196).chr(139) => 'c',\n\t\tchr(196).chr(140) => 'C', chr(196).chr(141) => 'c',\n\t\tchr(196).chr(142) => 'D', chr(196).chr(143) => 'd',\n\t\tchr(196).chr(144) => 'D', chr(196).chr(145) => 'd',\n\t\tchr(196).chr(146) => 'E', chr(196).chr(147) => 'e',\n\t\tchr(196).chr(148) => 'E', chr(196).chr(149) => 'e',\n\t\tchr(196).chr(150) => 'E', chr(196).chr(151) => 'e',\n\t\tchr(196).chr(152) => 'E', chr(196).chr(153) => 'e',\n\t\tchr(196).chr(154) => 'E', chr(196).chr(155) => 'e',\n\t\tchr(196).chr(156) => 'G', chr(196).chr(157) => 'g',\n\t\tchr(196).chr(158) => 'G', chr(196).chr(159) => 'g',\n\t\tchr(196).chr(160) => 'G', chr(196).chr(161) => 'g',\n\t\tchr(196).chr(162) => 'G', chr(196).chr(163) => 'g',\n\t\tchr(196).chr(164) => 'H', chr(196).chr(165) => 'h',\n\t\tchr(196).chr(166) => 'H', chr(196).chr(167) => 'h',\n\t\tchr(196).chr(168) => 'I', chr(196).chr(169) => 'i',\n\t\tchr(196).chr(170) => 'I', chr(196).chr(171) => 'i',\n\t\tchr(196).chr(172) => 'I', chr(196).chr(173) => 'i',\n\t\tchr(196).chr(174) => 'I', chr(196).chr(175) => 'i',\n\t\tchr(196).chr(176) => 'I', chr(196).chr(177) => 'i',\n\t\tchr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',\n\t\tchr(196).chr(180) => 'J', chr(196).chr(181) => 'j',\n\t\tchr(196).chr(182) => 'K', chr(196).chr(183) => 'k',\n\t\tchr(196).chr(184) => 'k', chr(196).chr(185) => 'L',\n\t\tchr(196).chr(186) => 'l', chr(196).chr(187) => 'L',\n\t\tchr(196).chr(188) => 'l', chr(196).chr(189) => 'L',\n\t\tchr(196).chr(190) => 'l', chr(196).chr(191) => 'L',\n\t\tchr(197).chr(128) => 'l', chr(197).chr(129) => 'L',\n\t\tchr(197).chr(130) => 'l', chr(197).chr(131) => 'N',\n\t\tchr(197).chr(132) => 'n', chr(197).chr(133) => 'N',\n\t\tchr(197).chr(134) => 'n', chr(197).chr(135) => 'N',\n\t\tchr(197).chr(136) => 'n', chr(197).chr(137) => 'N',\n\t\tchr(197).chr(138) => 'n', chr(197).chr(139) => 'N',\n\t\tchr(197).chr(140) => 'O', chr(197).chr(141) => 'o',\n\t\tchr(197).chr(142) => 'O', chr(197).chr(143) => 'o',\n\t\tchr(197).chr(144) => 'O', chr(197).chr(145) => 'o',\n\t\tchr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',\n\t\tchr(197).chr(148) => 'R',chr(197).chr(149) => 'r',\n\t\tchr(197).chr(150) => 'R',chr(197).chr(151) => 'r',\n\t\tchr(197).chr(152) => 'R',chr(197).chr(153) => 'r',\n\t\tchr(197).chr(154) => 'S',chr(197).chr(155) => 's',\n\t\tchr(197).chr(156) => 'S',chr(197).chr(157) => 's',\n\t\tchr(197).chr(158) => 'S',chr(197).chr(159) => 's',\n\t\tchr(197).chr(160) => 'S', chr(197).chr(161) => 's',\n\t\tchr(197).chr(162) => 'T', chr(197).chr(163) => 't',\n\t\tchr(197).chr(164) => 'T', chr(197).chr(165) => 't',\n\t\tchr(197).chr(166) => 'T', chr(197).chr(167) => 't',\n\t\tchr(197).chr(168) => 'U', chr(197).chr(169) => 'u',\n\t\tchr(197).chr(170) => 'U', chr(197).chr(171) => 'u',\n\t\tchr(197).chr(172) => 'U', chr(197).chr(173) => 'u',\n\t\tchr(197).chr(174) => 'U', chr(197).chr(175) => 'u',\n\t\tchr(197).chr(176) => 'U', chr(197).chr(177) => 'u',\n\t\tchr(197).chr(178) => 'U', chr(197).chr(179) => 'u',\n\t\tchr(197).chr(180) => 'W', chr(197).chr(181) => 'w',\n\t\tchr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',\n\t\tchr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',\n\t\tchr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',\n\t\tchr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',\n\t\tchr(197).chr(190) => 'z', chr(197).chr(191) => 's',\n\t\t// Decompositions for Latin Extended-B\n\t\tchr(200).chr(152) => 'S', chr(200).chr(153) => 's',\n\t\tchr(200).chr(154) => 'T', chr(200).chr(155) => 't',\n\t\t// Euro Sign\n\t\tchr(226).chr(130).chr(172) => 'E',\n\t\t// GBP (Pound) Sign\n\t\tchr(194).chr(163) => '',\n\t\t// Vowels with diacritic (Vietnamese)\n\t\t// unmarked\n\t\tchr(198).chr(160) => 'O', chr(198).chr(161) => 'o',\n\t\tchr(198).chr(175) => 'U', chr(198).chr(176) => 'u',\n\t\t// grave accent\n\t\tchr(225).chr(186).chr(166) => 'A', chr(225).chr(186).chr(167) => 'a',\n\t\tchr(225).chr(186).chr(176) => 'A', chr(225).chr(186).chr(177) => 'a',\n\t\tchr(225).chr(187).chr(128) => 'E', chr(225).chr(187).chr(129) => 'e',\n\t\tchr(225).chr(187).chr(146) => 'O', chr(225).chr(187).chr(147) => 'o',\n\t\tchr(225).chr(187).chr(156) => 'O', chr(225).chr(187).chr(157) => 'o',\n\t\tchr(225).chr(187).chr(170) => 'U', chr(225).chr(187).chr(171) => 'u',\n\t\tchr(225).chr(187).chr(178) => 'Y', chr(225).chr(187).chr(179) => 'y',\n\t\t// hook\n\t\tchr(225).chr(186).chr(162) => 'A', chr(225).chr(186).chr(163) => 'a',\n\t\tchr(225).chr(186).chr(168) => 'A', chr(225).chr(186).chr(169) => 'a',\n\t\tchr(225).chr(186).chr(178) => 'A', chr(225).chr(186).chr(179) => 'a',\n\t\tchr(225).chr(186).chr(186) => 'E', chr(225).chr(186).chr(187) => 'e',\n\t\tchr(225).chr(187).chr(130) => 'E', chr(225).chr(187).chr(131) => 'e',\n\t\tchr(225).chr(187).chr(136) => 'I', chr(225).chr(187).chr(137) => 'i',\n\t\tchr(225).chr(187).chr(142) => 'O', chr(225).chr(187).chr(143) => 'o',\n\t\tchr(225).chr(187).chr(148) => 'O', chr(225).chr(187).chr(149) => 'o',\n\t\tchr(225).chr(187).chr(158) => 'O', chr(225).chr(187).chr(159) => 'o',\n\t\tchr(225).chr(187).chr(166) => 'U', chr(225).chr(187).chr(167) => 'u',\n\t\tchr(225).chr(187).chr(172) => 'U', chr(225).chr(187).chr(173) => 'u',\n\t\tchr(225).chr(187).chr(182) => 'Y', chr(225).chr(187).chr(183) => 'y',\n\t\t// tilde\n\t\tchr(225).chr(186).chr(170) => 'A', chr(225).chr(186).chr(171) => 'a',\n\t\tchr(225).chr(186).chr(180) => 'A', chr(225).chr(186).chr(181) => 'a',\n\t\tchr(225).chr(186).chr(188) => 'E', chr(225).chr(186).chr(189) => 'e',\n\t\tchr(225).chr(187).chr(132) => 'E', chr(225).chr(187).chr(133) => 'e',\n\t\tchr(225).chr(187).chr(150) => 'O', chr(225).chr(187).chr(151) => 'o',\n\t\tchr(225).chr(187).chr(160) => 'O', chr(225).chr(187).chr(161) => 'o',\n\t\tchr(225).chr(187).chr(174) => 'U', chr(225).chr(187).chr(175) => 'u',\n\t\tchr(225).chr(187).chr(184) => 'Y', chr(225).chr(187).chr(185) => 'y',\n\t\t// acute accent\n\t\tchr(225).chr(186).chr(164) => 'A', chr(225).chr(186).chr(165) => 'a',\n\t\tchr(225).chr(186).chr(174) => 'A', chr(225).chr(186).chr(175) => 'a',\n\t\tchr(225).chr(186).chr(190) => 'E', chr(225).chr(186).chr(191) => 'e',\n\t\tchr(225).chr(187).chr(144) => 'O', chr(225).chr(187).chr(145) => 'o',\n\t\tchr(225).chr(187).chr(154) => 'O', chr(225).chr(187).chr(155) => 'o',\n\t\tchr(225).chr(187).chr(168) => 'U', chr(225).chr(187).chr(169) => 'u',\n\t\t// dot below\n\t\tchr(225).chr(186).chr(160) => 'A', chr(225).chr(186).chr(161) => 'a',\n\t\tchr(225).chr(186).chr(172) => 'A', chr(225).chr(186).chr(173) => 'a',\n\t\tchr(225).chr(186).chr(182) => 'A', chr(225).chr(186).chr(183) => 'a',\n\t\tchr(225).chr(186).chr(184) => 'E', chr(225).chr(186).chr(185) => 'e',\n\t\tchr(225).chr(187).chr(134) => 'E', chr(225).chr(187).chr(135) => 'e',\n\t\tchr(225).chr(187).chr(138) => 'I', chr(225).chr(187).chr(139) => 'i',\n\t\tchr(225).chr(187).chr(140) => 'O', chr(225).chr(187).chr(141) => 'o',\n\t\tchr(225).chr(187).chr(152) => 'O', chr(225).chr(187).chr(153) => 'o',\n\t\tchr(225).chr(187).chr(162) => 'O', chr(225).chr(187).chr(163) => 'o',\n\t\tchr(225).chr(187).chr(164) => 'U', chr(225).chr(187).chr(165) => 'u',\n\t\tchr(225).chr(187).chr(176) => 'U', chr(225).chr(187).chr(177) => 'u',\n\t\tchr(225).chr(187).chr(180) => 'Y', chr(225).chr(187).chr(181) => 'y',\n\t\t// Vowels with diacritic (Chinese, Hanyu Pinyin)\n\t\tchr(201).chr(145) => 'a',\n\t\t// macron\n\t\tchr(199).chr(149) => 'U', chr(199).chr(150) => 'u',\n\t\t// acute accent\n\t\tchr(199).chr(151) => 'U', chr(199).chr(152) => 'u',\n\t\t// caron\n\t\tchr(199).chr(141) => 'A', chr(199).chr(142) => 'a',\n\t\tchr(199).chr(143) => 'I', chr(199).chr(144) => 'i',\n\t\tchr(199).chr(145) => 'O', chr(199).chr(146) => 'o',\n\t\tchr(199).chr(147) => 'U', chr(199).chr(148) => 'u',\n\t\tchr(199).chr(153) => 'U', chr(199).chr(154) => 'u',\n\t\t// grave accent\n\t\tchr(199).chr(155) => 'U', chr(199).chr(156) => 'u',\n\t\t);\n\n\t\t// Used for locale-specific rules\n\t\t$locale = get_locale();\n\n\t\tif ( 'de_DE' == $locale ) {\n\t\t\t$chars[ chr(195).chr(132) ] = 'Ae';\n\t\t\t$chars[ chr(195).chr(164) ] = 'ae';\n\t\t\t$chars[ chr(195).chr(150) ] = 'Oe';\n\t\t\t$chars[ chr(195).chr(182) ] = 'oe';\n\t\t\t$chars[ chr(195).chr(156) ] = 'Ue';\n\t\t\t$chars[ chr(195).chr(188) ] = 'ue';\n\t\t\t$chars[ chr(195).chr(159) ] = 'ss';\n\t\t} elseif ( 'da_DK' === $locale ) {\n\t\t\t$chars[ chr(195).chr(134) ] = 'Ae';\n \t\t\t$chars[ chr(195).chr(166) ] = 'ae';\n\t\t\t$chars[ chr(195).chr(152) ] = 'Oe';\n\t\t\t$chars[ chr(195).chr(184) ] = 'oe';\n\t\t\t$chars[ chr(195).chr(133) ] = 'Aa';\n\t\t\t$chars[ chr(195).chr(165) ] = 'aa';\n\t\t}\n\n\t\t$string = strtr($string, $chars);\n\t} else {\n\t\t// Assume ISO-8859-1 if not UTF-8\n\t\t$chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)\n\t\t\t.chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)\n\t\t\t.chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)\n\t\t\t.chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)\n\t\t\t.chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)\n\t\t\t.chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)\n\t\t\t.chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)\n\t\t\t.chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)\n\t\t\t.chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)\n\t\t\t.chr(252).chr(253).chr(255);\n\n\t\t$chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n\n\t\t$string = strtr($string, $chars['in'], $chars['out']);\n\t\t$double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n\t\t$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n\t\t$string = str_replace($double_chars['in'], $double_chars['out'], $string);\n\t}\n\n\treturn $string;\n}",
"function remove_accents($string)\n {\n if (!preg_match('/[\\x80-\\xff]/', $string))\n return $string;\n\n if ($this->seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',\n chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',\n chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',\n chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',\n chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',\n chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',\n chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',\n chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',\n chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',\n chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',\n chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',\n chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',\n chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',\n chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',\n chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',\n chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',\n chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',\n chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',\n chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',\n chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',\n chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',\n chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',\n chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',\n chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',\n chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',\n chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',\n chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',\n chr(195) . chr(191) => 'y',\n // Decompositions for Latin Extended-A\n chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',\n chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',\n chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',\n chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',\n chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',\n chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',\n chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',\n chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',\n chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',\n chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',\n chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',\n chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',\n chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',\n chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',\n chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',\n chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',\n chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',\n chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',\n chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',\n chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',\n chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',\n chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',\n chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',\n chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',\n chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',\n chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',\n chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',\n chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',\n chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',\n chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',\n chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',\n chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',\n chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',\n chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',\n chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',\n chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',\n chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',\n chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',\n chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',\n chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',\n chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',\n chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',\n chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',\n chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',\n chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',\n chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',\n chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',\n chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',\n chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',\n chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',\n chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',\n chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',\n chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',\n chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',\n chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',\n chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',\n chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',\n chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',\n chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',\n chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',\n chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',\n chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',\n chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',\n chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',\n // Euro Sign\n chr(226) . chr(130) . chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194) . chr(163) => '');\n\n $string = strtr($string, $chars);\n } else {\n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)\n . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)\n . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)\n . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)\n . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)\n . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)\n . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)\n . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)\n . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)\n . chr(252) . chr(253) . chr(255);\n\n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n\n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n $string = str_replace($double_chars['in'], $double_chars['out'], $string);\n }\n\n return $string;\n }",
"private function removeAccent($text)\n {\n return @iconv('UTF-8', 'US-ASCII//TRANSLIT', $text);\n }",
"private function _remove_invisible_characters($str) {\n\t\tstatic $non_displayables = false;\n\n\t\tif (!$non_displayables) {\n\t\t\t// every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09),\n\t\t\t$non_displayables = array('/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15\n\t\t\t '/%1[0-9a-f]/', // url encoded 16-31\n\t\t\t '/[\\x00-\\x08]/', // 00-08\n\t\t\t '/\\x0b/', '/\\x0c/', // 11, 12\n\t\t\t '/[\\x0e-\\x1f]/'); // 14-31\n\t\t}\n\n\t\tdo {\n\t\t\t$cleaned = $str;\n\t\t\t$str = preg_replace($non_displayables, '', $str);\n\t\t} while ($cleaned != $str);\n\n\t\treturn $str;\n\t}",
"public static function remove_accents($string) {\n\t\tif ( !preg_match('/[\\x80-\\xff]/', $string) )\n\t\t\treturn $string;\n\n\t\tif ($this -> seems_utf8($string)) {\n\t\t\t$chars = array(\n\t\t\t// Decompositions for Latin-1 Supplement\n\t\t\tchr(195).chr(128) => 'A', chr(195).chr(129) => 'A',\n\t\t\tchr(195).chr(130) => 'A', chr(195).chr(131) => 'A',\n\t\t\tchr(195).chr(132) => 'A', chr(195).chr(133) => 'A',\n\t\t\tchr(195).chr(135) => 'C', chr(195).chr(136) => 'E',\n\t\t\tchr(195).chr(137) => 'E', chr(195).chr(138) => 'E',\n\t\t\tchr(195).chr(139) => 'E', chr(195).chr(140) => 'I',\n\t\t\tchr(195).chr(141) => 'I', chr(195).chr(142) => 'I',\n\t\t\tchr(195).chr(143) => 'I', chr(195).chr(145) => 'N',\n\t\t\tchr(195).chr(146) => 'O', chr(195).chr(147) => 'O',\n\t\t\tchr(195).chr(148) => 'O', chr(195).chr(149) => 'O',\n\t\t\tchr(195).chr(150) => 'O', chr(195).chr(153) => 'U',\n\t\t\tchr(195).chr(154) => 'U', chr(195).chr(155) => 'U',\n\t\t\tchr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',\n\t\t\tchr(195).chr(159) => 's', chr(195).chr(160) => 'a',\n\t\t\tchr(195).chr(161) => 'a', chr(195).chr(162) => 'a',\n\t\t\tchr(195).chr(163) => 'a', chr(195).chr(164) => 'a',\n\t\t\tchr(195).chr(165) => 'a', chr(195).chr(167) => 'c',\n\t\t\tchr(195).chr(168) => 'e', chr(195).chr(169) => 'e',\n\t\t\tchr(195).chr(170) => 'e', chr(195).chr(171) => 'e',\n\t\t\tchr(195).chr(172) => 'i', chr(195).chr(173) => 'i',\n\t\t\tchr(195).chr(174) => 'i', chr(195).chr(175) => 'i',\n\t\t\tchr(195).chr(177) => 'n', chr(195).chr(178) => 'o',\n\t\t\tchr(195).chr(179) => 'o', chr(195).chr(180) => 'o',\n\t\t\tchr(195).chr(181) => 'o', chr(195).chr(182) => 'o',\n\t\t\tchr(195).chr(182) => 'o', chr(195).chr(185) => 'u',\n\t\t\tchr(195).chr(186) => 'u', chr(195).chr(187) => 'u',\n\t\t\tchr(195).chr(188) => 'u', chr(195).chr(189) => 'y',\n\t\t\tchr(195).chr(191) => 'y',\n\t\t\t// Decompositions for Latin Extended-A\n\t\t\tchr(196).chr(128) => 'A', chr(196).chr(129) => 'a',\n\t\t\tchr(196).chr(130) => 'A', chr(196).chr(131) => 'a',\n\t\t\tchr(196).chr(132) => 'A', chr(196).chr(133) => 'a',\n\t\t\tchr(196).chr(134) => 'C', chr(196).chr(135) => 'c',\n\t\t\tchr(196).chr(136) => 'C', chr(196).chr(137) => 'c',\n\t\t\tchr(196).chr(138) => 'C', chr(196).chr(139) => 'c',\n\t\t\tchr(196).chr(140) => 'C', chr(196).chr(141) => 'c',\n\t\t\tchr(196).chr(142) => 'D', chr(196).chr(143) => 'd',\n\t\t\tchr(196).chr(144) => 'D', chr(196).chr(145) => 'd',\n\t\t\tchr(196).chr(146) => 'E', chr(196).chr(147) => 'e',\n\t\t\tchr(196).chr(148) => 'E', chr(196).chr(149) => 'e',\n\t\t\tchr(196).chr(150) => 'E', chr(196).chr(151) => 'e',\n\t\t\tchr(196).chr(152) => 'E', chr(196).chr(153) => 'e',\n\t\t\tchr(196).chr(154) => 'E', chr(196).chr(155) => 'e',\n\t\t\tchr(196).chr(156) => 'G', chr(196).chr(157) => 'g',\n\t\t\tchr(196).chr(158) => 'G', chr(196).chr(159) => 'g',\n\t\t\tchr(196).chr(160) => 'G', chr(196).chr(161) => 'g',\n\t\t\tchr(196).chr(162) => 'G', chr(196).chr(163) => 'g',\n\t\t\tchr(196).chr(164) => 'H', chr(196).chr(165) => 'h',\n\t\t\tchr(196).chr(166) => 'H', chr(196).chr(167) => 'h',\n\t\t\tchr(196).chr(168) => 'I', chr(196).chr(169) => 'i',\n\t\t\tchr(196).chr(170) => 'I', chr(196).chr(171) => 'i',\n\t\t\tchr(196).chr(172) => 'I', chr(196).chr(173) => 'i',\n\t\t\tchr(196).chr(174) => 'I', chr(196).chr(175) => 'i',\n\t\t\tchr(196).chr(176) => 'I', chr(196).chr(177) => 'i',\n\t\t\tchr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',\n\t\t\tchr(196).chr(180) => 'J', chr(196).chr(181) => 'j',\n\t\t\tchr(196).chr(182) => 'K', chr(196).chr(183) => 'k',\n\t\t\tchr(196).chr(184) => 'k', chr(196).chr(185) => 'L',\n\t\t\tchr(196).chr(186) => 'l', chr(196).chr(187) => 'L',\n\t\t\tchr(196).chr(188) => 'l', chr(196).chr(189) => 'L',\n\t\t\tchr(196).chr(190) => 'l', chr(196).chr(191) => 'L',\n\t\t\tchr(197).chr(128) => 'l', chr(197).chr(129) => 'L',\n\t\t\tchr(197).chr(130) => 'l', chr(197).chr(131) => 'N',\n\t\t\tchr(197).chr(132) => 'n', chr(197).chr(133) => 'N',\n\t\t\tchr(197).chr(134) => 'n', chr(197).chr(135) => 'N',\n\t\t\tchr(197).chr(136) => 'n', chr(197).chr(137) => 'N',\n\t\t\tchr(197).chr(138) => 'n', chr(197).chr(139) => 'N',\n\t\t\tchr(197).chr(140) => 'O', chr(197).chr(141) => 'o',\n\t\t\tchr(197).chr(142) => 'O', chr(197).chr(143) => 'o',\n\t\t\tchr(197).chr(144) => 'O', chr(197).chr(145) => 'o',\n\t\t\tchr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',\n\t\t\tchr(197).chr(148) => 'R',chr(197).chr(149) => 'r',\n\t\t\tchr(197).chr(150) => 'R',chr(197).chr(151) => 'r',\n\t\t\tchr(197).chr(152) => 'R',chr(197).chr(153) => 'r',\n\t\t\tchr(197).chr(154) => 'S',chr(197).chr(155) => 's',\n\t\t\tchr(197).chr(156) => 'S',chr(197).chr(157) => 's',\n\t\t\tchr(197).chr(158) => 'S',chr(197).chr(159) => 's',\n\t\t\tchr(197).chr(160) => 'S', chr(197).chr(161) => 's',\n\t\t\tchr(197).chr(162) => 'T', chr(197).chr(163) => 't',\n\t\t\tchr(197).chr(164) => 'T', chr(197).chr(165) => 't',\n\t\t\tchr(197).chr(166) => 'T', chr(197).chr(167) => 't',\n\t\t\tchr(197).chr(168) => 'U', chr(197).chr(169) => 'u',\n\t\t\tchr(197).chr(170) => 'U', chr(197).chr(171) => 'u',\n\t\t\tchr(197).chr(172) => 'U', chr(197).chr(173) => 'u',\n\t\t\tchr(197).chr(174) => 'U', chr(197).chr(175) => 'u',\n\t\t\tchr(197).chr(176) => 'U', chr(197).chr(177) => 'u',\n\t\t\tchr(197).chr(178) => 'U', chr(197).chr(179) => 'u',\n\t\t\tchr(197).chr(180) => 'W', chr(197).chr(181) => 'w',\n\t\t\tchr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',\n\t\t\tchr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',\n\t\t\tchr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',\n\t\t\tchr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',\n\t\t\tchr(197).chr(190) => 'z', chr(197).chr(191) => 's',\n\t\t\t// Euro Sign\n\t\t\tchr(226).chr(130).chr(172) => 'E',\n\t\t\t// GBP (Pound) Sign\n\t\t\tchr(194).chr(163) => '');\n\n\t\t\t$string = strtr($string, $chars);\n\t\t} else {\n\t\t\t// Assume ISO-8859-1 if not UTF-8\n\t\t\t$chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)\n\t\t\t\t.chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)\n\t\t\t\t.chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)\n\t\t\t\t.chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)\n\t\t\t\t.chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)\n\t\t\t\t.chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)\n\t\t\t\t.chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)\n\t\t\t\t.chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)\n\t\t\t\t.chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)\n\t\t\t\t.chr(252).chr(253).chr(255);\n\n\t\t\t$chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n\n\t\t\t$string = strtr($string, $chars['in'], $chars['out']);\n\t\t\t$double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n\t\t\t$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n\t\t\t$string = str_replace($double_chars['in'], $double_chars['out'], $string);\n\t\t}\n\n\t\treturn $string;\n\t}",
"function removeUnnecessaryCharas($string)\n{\n return preg_replace('~\\s+~s', '', $string);\n}",
"private function _remove_accents($string) {\n if (!preg_match('/[\\x80-\\xff]/', $string)) return $string;\n\n if ($this->seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',\n chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',\n chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',\n chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',\n chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',\n chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',\n chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',\n chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',\n chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',\n chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',\n chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',\n chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',\n chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',\n chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',\n chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',\n chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',\n chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',\n chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',\n chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',\n chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',\n chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',\n chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',\n chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',\n chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',\n chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',\n chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',\n chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',\n chr(195) . chr(191) => 'y',\n // Decompositions for Latin Extended-A\n chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',\n chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',\n chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',\n chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',\n chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',\n chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',\n chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',\n chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',\n chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',\n chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',\n chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',\n chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',\n chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',\n chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',\n chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',\n chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',\n chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',\n chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',\n chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',\n chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',\n chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',\n chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',\n chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',\n chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',\n chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',\n chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',\n chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',\n chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',\n chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',\n chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',\n chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',\n chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',\n chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',\n chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',\n chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',\n chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',\n chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',\n chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',\n chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',\n chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',\n chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',\n chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',\n chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',\n chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',\n chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',\n chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',\n chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',\n chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',\n chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',\n chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',\n chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',\n chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',\n chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',\n chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',\n chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',\n chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',\n chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',\n chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',\n chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',\n chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',\n chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',\n chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',\n chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',\n chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',\n // Euro Sign\n chr(226) . chr(130) . chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194) . chr(163) => '');\n\n $string = strtr($string, $chars);\n } else {\n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)\n . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)\n . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)\n . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)\n . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)\n . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)\n . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)\n . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)\n . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)\n . chr(252) . chr(253) . chr(255) . chr(186);\n\n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyyo\";\n\n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208),\n chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae',\n 'dh', 'th');\n $string = str_replace($double_chars['in'], $double_chars['out'], $string);\n }\n\n return $string;\n }",
"protected function cleanStr($str) {\n\t\t$str = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), ' ', trim($str)); \n\t\tif(strlen($str) > $this->maxLineLength) $str = substr($str, 0, $this->maxLineLength); \n\t\tif(strpos($str, ' ^+') !== false) $str = str_replace(' ^=', ' ^ +', $str); // disallowed sequence\n\t\treturn $str; \t\n\t}",
"public static function stripFunkyChars($string = '') {\n\n foreach (StringTools::funkyCharsMap() as $weird => $normal) {\n $string = str_replace($weird, '', $string);\n }\n\n return $string;\n }",
"protected function remove_accents($string) {\n if (!preg_match('/[\\x80-\\xff]/', $string)) {\n return $string;\n }\n\n if ($this->seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',\n chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',\n chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',\n chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',\n chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',\n chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',\n chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',\n chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',\n chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',\n chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',\n chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',\n chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',\n chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',\n chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',\n chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',\n chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',\n chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',\n chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',\n chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',\n chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',\n chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',\n chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',\n chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',\n chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',\n chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',\n chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',\n chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',\n chr(195) . chr(191) => 'y',\n // Decompositions for Latin Extended-A\n chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',\n chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',\n chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',\n chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',\n chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',\n chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',\n chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',\n chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',\n chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',\n chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',\n chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',\n chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',\n chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',\n chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',\n chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',\n chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',\n chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',\n chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',\n chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',\n chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',\n chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',\n chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',\n chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',\n chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',\n chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',\n chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',\n chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',\n chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',\n chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',\n chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',\n chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',\n chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',\n chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',\n chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',\n chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',\n chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',\n chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',\n chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',\n chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',\n chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',\n chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',\n chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',\n chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',\n chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',\n chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',\n chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',\n chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',\n chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',\n chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',\n chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',\n chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',\n chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',\n chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',\n chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',\n chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',\n chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',\n chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',\n chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',\n chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',\n chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',\n chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',\n chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',\n chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',\n chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',\n // Euro Sign\n chr(226) . chr(130) . chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194) . chr(163) => '');\n\n $string = strtr($string, $chars);\n } else {\n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)\n . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)\n . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)\n . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)\n . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)\n . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)\n . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)\n . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)\n . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)\n . chr(252) . chr(253) . chr(255) . chr(186);\n\n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyyo\";\n\n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n $string = str_replace($double_chars['in'], $double_chars['out'], $string);\n }\n\n return $string;\n }",
"Function removeaccents($string) \n\t\t{\t\n\t\t $string= strtr($string,\t\n\t \"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ\", \n\t \"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn\");\t\n\t\t \n\t\treturn $string;\t\n\t\t}",
"public static function remove_accents($string): string {\n if (!preg_match('/[\\x80-\\xff]/', $string))\n return $string;\n\n if (static::seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',\n chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',\n chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',\n chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',\n chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',\n chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',\n chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',\n chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',\n chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',\n chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',\n chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',\n chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',\n chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',\n chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',\n chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',\n chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',\n chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',\n chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',\n chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',\n chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',\n chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',\n chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',\n chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',\n chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',\n chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',\n chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',\n chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',\n chr(195) . chr(191) => 'y',\n // Decompositions for Latin Extended-A\n chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',\n chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',\n chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',\n chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',\n chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',\n chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',\n chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',\n chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',\n chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',\n chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',\n chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',\n chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',\n chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',\n chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',\n chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',\n chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',\n chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',\n chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',\n chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',\n chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',\n chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',\n chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',\n chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',\n chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',\n chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',\n chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',\n chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',\n chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',\n chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',\n chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',\n chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',\n chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',\n chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',\n chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',\n chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',\n chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',\n chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',\n chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',\n chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',\n chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',\n chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',\n chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',\n chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',\n chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',\n chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',\n chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',\n chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',\n chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',\n chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',\n chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',\n chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',\n chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',\n chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',\n chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',\n chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',\n chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',\n chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',\n chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',\n chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',\n chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',\n chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',\n chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',\n chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',\n chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',\n // Euro Sign\n chr(226) . chr(130) . chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194) . chr(163) => '');\n\n $string = strtr($string, $chars);\n } else {\n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)\n . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)\n . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)\n . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)\n . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)\n . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)\n . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)\n . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)\n . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)\n . chr(252) . chr(253) . chr(255);\n\n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n\n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n $string = str_replace($double_chars['in'], $double_chars['out'], $string);\n }\n\n return $string;\n }",
"function remove_accents($string) {\n if (!preg_match('/[\\x80-\\xff]/', $string))\n return $string;\n\n if (seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',\n chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',\n chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',\n chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',\n chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',\n chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',\n chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',\n chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',\n chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',\n chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',\n chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',\n chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',\n chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',\n chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',\n chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',\n chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',\n chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',\n chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',\n chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',\n chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',\n chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',\n chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',\n chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',\n chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',\n chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',\n chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',\n chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',\n chr(195) . chr(191) => 'y',\n // Decompositions for Latin Extended-A\n chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',\n chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',\n chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',\n chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',\n chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',\n chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',\n chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',\n chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',\n chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',\n chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',\n chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',\n chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',\n chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',\n chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',\n chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',\n chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',\n chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',\n chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',\n chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',\n chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',\n chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',\n chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',\n chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',\n chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',\n chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',\n chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',\n chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',\n chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',\n chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',\n chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',\n chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',\n chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',\n chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',\n chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',\n chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',\n chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',\n chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',\n chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',\n chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',\n chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',\n chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',\n chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',\n chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',\n chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',\n chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',\n chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',\n chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',\n chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',\n chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',\n chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',\n chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',\n chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',\n chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',\n chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',\n chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',\n chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',\n chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',\n chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',\n chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',\n chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',\n chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',\n chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',\n chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',\n chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',\n // Euro Sign\n chr(226) . chr(130) . chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194) . chr(163) => '');\n\n $string = strtr($string, $chars);\n } else {\n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)\n . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)\n . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)\n . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)\n . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)\n . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)\n . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)\n . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)\n . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)\n . chr(252) . chr(253) . chr(255);\n\n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n\n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n $string = str_replace($double_chars['in'], $double_chars['out'], $string);\n }\n $string = str_replace(\"’\", \"'\", $string);\n return $string;\n}"
]
| [
"0.6504704",
"0.6458302",
"0.64382446",
"0.6389204",
"0.63798934",
"0.62478584",
"0.61580384",
"0.6126654",
"0.6077035",
"0.6048878",
"0.58608526",
"0.58399624",
"0.5787029",
"0.57495016",
"0.569537",
"0.56937855",
"0.5678807",
"0.567321",
"0.56728446",
"0.56711745",
"0.56709605",
"0.5656735",
"0.5643265",
"0.5641956",
"0.5624549",
"0.5623364",
"0.56229335",
"0.5614864",
"0.5614491",
"0.5610322"
]
| 0.7544471 | 0 |
Test case for addReplenishmentProcessAudit Add new audit for a replenishmentProcess | public function test_addReplenishmentProcessAudit() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function addFulfillmentProcessAuditRequest($fulfillment_process_id, $fulfillment_process_audit)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling addFulfillmentProcessAudit'\n );\n }\n // verify the required parameter 'fulfillment_process_audit' is set\n if ($fulfillment_process_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_audit when calling addFulfillmentProcessAudit'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/audit/{fulfillmentProcessAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n // path params\n if ($fulfillment_process_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessAudit' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testAddReplenishmentAudit()\n {\n }",
"public function test_addReplenishmentProcessTag() {\n\n }",
"public function test_getDuplicateReplenishmentProcessById() {\n\n }",
"public function test_getReplenishmentProcessById() {\n\n }",
"public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }",
"public function test_addOrderLineActivityAudit() {\n\n }",
"public function addFulfillmentProcessAudit($fulfillment_process_id, $fulfillment_process_audit)\n {\n $this->addFulfillmentProcessAuditWithHttpInfo($fulfillment_process_id, $fulfillment_process_audit);\n }",
"public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }",
"public function addFulfillmentProcessAuditWithHttpInfo($fulfillment_process_id, $fulfillment_process_audit)\n {\n $returnType = '';\n $request = $this->addFulfillmentProcessAuditRequest($fulfillment_process_id, $fulfillment_process_audit);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function testUpdateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n $data = json_decode($response->getContent());\n $new_process_data = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $new_response = $this->json('PUT', '/api/processes/' . $data->id, $new_process_data);\n $new_response->assertStatus(201);\n $new_data = json_decode($new_response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"public function test_addExternalShipmentAudit() {\n\n }",
"public function add(ProcessDefinition $definition);",
"public function postProcess(ProcessEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function testAddOrderAudit()\n {\n }",
"public function testAddExternalShipmentAudit()\n {\n }",
"public function addAudit(Audit $audit);",
"function addProcess (&$processCallback) {\n\t\t$this->_processCallbacks[] =& $processCallback;\n\t}",
"public function test_addCartonActivityAudit() {\n\n }",
"public function setProcessInstance(ProcessInstance $processInstance)\n {\n }",
"public function store(StoreProcessRequest $request)\n {\n $process = Process::create([\n 'reference' => $request->reference,\n 'method_id' => $request->method,\n ]);\n $processVersion = $process->versions()->create([\n 'name' => $request->name,\n 'type' => $request->type,\n 'version' => $request->version,\n 'creation_date' => $request->creation_date,\n 'created_by' => $request->created_by,\n 'state' => $request->state,\n 'state' => $request->state,\n 'status' => $request->status,\n ]);\n if ($request->writing_date) {\n $processVersion->writing_date = $request->writing_date;\n $processVersion->written_by = $request->written_by;\n }\n\n if ($request->verification_date) {\n $processVersion->verification_date = $request->verification_date;\n $processVersion->verified_by = $request->verified_by;\n }\n\n if ($request->date_of_approval) {\n $processVersion->date_of_approval = $request->date_of_approval;\n $processVersion->approved_by = $request->approved_by;\n }\n\n if ($request->broadcasting_date) {\n $processVersion->broadcasting_date = $request->broadcasting_date;\n }\n\n if ($request->reasons_for_creation) {\n $processVersion->reasons_for_creation = $request->reasons_for_creation;\n }\n\n if ($request->reasons_for_modification) {\n $processVersion->reasons_for_modification = $request->reasons_for_modification;\n }\n\n if ($request->modifications) {\n $processVersion->modifications = $request->modifications;\n }\n\n if ($request->appendices) {\n $processVersion->appendices = $request->appendices;\n }\n\n $processVersion->save();\n $processVersion->entities()->attach($request->entities);\n\n return redirect()->route('admin.processes.index')->with('message', 'Procédure créée avec succès!');\n }",
"public function setProcess( $process )\n {\n \n $this->process = $process;\n \n }",
"public function __construct(ProcessInstance $processInstance)\n {\n $this->processInstance = $processInstance;\n }",
"public function testAddPackingPlanAudit()\n {\n }",
"function process_add_pnh_invoice_return()\r\n\t{\r\n\t\t$this->erpm->auth(PNH_INVOICE_RETURNS|PNH_ADD_INVOICE_RETURN);\r\n\t\t\r\n\t\t$prod_rcvd_pid = $this->input->post('prod_rcvd_pid');\r\n\t\t$prod_rcvd_qty = $this->input->post('prod_rcvd_qty');\r\n\t\t$prod_rcvd_pid_bc = $this->input->post('prod_rcvd_pid_bc');\r\n\t\t$prod_rcvd_pid_imei = $this->input->post('prod_rcvd_pid_imei');\r\n\t\t$prod_rcvd_cond = $this->input->post('prod_rcvd_cond');\r\n\t\t$prod_rcvd_remarks = $this->input->post('prod_rcvd_remarks');\r\n\t\t \r\n\t\t\r\n\t\t$user = $this->erpm->auth(false,true);\r\n\t\t$return_by = $this->input->post('return_by');\r\n\t\t\r\n\t\tforeach ($prod_rcvd_pid as $invno=>$p_ord_list)\r\n\t\t{\r\n\t\t\t$this->db->query(\"insert into pnh_invoice_returns (invoice_no,return_by,handled_by,status,returned_on) values (?,?,?,?,now()) \",array($invno,$return_by,$user['userid'],0));\r\n\t\t\t$return_id = $this->db->insert_id();\r\n\t\t\r\n\t\t\tforeach($p_ord_list as $oid=>$proddet_list)\r\n\t\t\t{\r\n\t\t\t\tforeach ($proddet_list as $prod_pid_list)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($prod_pid_list as $i=>$pid)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$pqty = $prod_rcvd_qty[$invno][$oid][$pid][0];\r\n\t\t\t\t\t\tfor($j=0;$j<$pqty;$j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$qty = 1;\r\n\t\t\t\t\t\t\t$p_bc = $prod_rcvd_pid_bc[$invno][$oid][$pid][$j];\r\n\t\t\t\t\t\t\t$p_imei_no = $prod_rcvd_pid_imei[$invno][$oid][$pid][$j];\r\n\t\t\t\t\t\t\t$pcond_type = $prod_rcvd_cond[$invno][$oid][$pid][$j];\r\n\t\t\t\t\t\t\t$p_remarks = $prod_rcvd_remarks[$invno][$oid][$pid][$j];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->db->query(\"insert into pnh_invoice_returns_product_link (return_id,order_id,product_id,qty,barcode,imei_no,condition_type,status,created_on) values (?,?,?,?,?,?,?,0,now()) \",array($return_id,$oid,$pid,1,$p_bc,$p_imei_no,$pcond_type));\r\n\t\t\t\t\t\t\t$return_prod_id = $this->db->insert_id();\r\n\t\r\n\t\t\t\t\t\t\t$this->db->query(\"insert into pnh_invoice_returns_remarks (return_prod_id,remarks,parent_id,created_by,created_on) values(?,?,?,?,now()) \",array($return_prod_id,$p_remarks,0,$user['userid']));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($p_imei_no)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->db->query(\"update t_imei_no set is_returned = 1 where imei_no = ? and product_id = ? and is_returned = 0 \",array($p_imei_no,$pid));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// update king invoice for returned status \r\n\t\t\t$this->db->query(\"update king_invoice set is_returned = 1 where invoice_no = ? and invoice_status = 1 \",$invno);\r\n\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"New product return added\");\r\n\t\t\t\r\n\t\t}\r\n\t\tredirect(\"admin/pnh_invoice_returns\",'refresh');\r\n\t}",
"function add_inv_to_existing_manifesto()\r\n\t{\r\n\t\t$user=$this->auth(KFILE_ROLE);\r\n\t\t$user_det=$this->session->userdata(\"admin_user\");\r\n\t\t\r\n\t\t//get the data throught a post\r\n\t\t$manifesto_id=0;\r\n\t\t$manifesto_id=$this->input->post(\"manifesto_list\");\r\n\t\t$invoices_no=$this->input->post(\"invoice_nos\");\r\n\t\t\r\n\t\t$manifesto_details=$this->db->query(\"select * from pnh_m_manifesto_sent_log where id=?\",$manifesto_id)->row_array();\r\n\t\t\r\n\t\t$main_manifesto_det=$this->db->query(\"select invoice_nos from pnh_manifesto_log where id=?\",$manifesto_details['manifesto_id'])->row_array();\r\n\t\t\r\n\t\tif($main_manifesto_det)\r\n\t\t{\r\n\t\t\t$ins_data=array();\r\n\t\t\t$ins_data['invoice_nos']=$main_manifesto_det['invoice_nos'].','.implode(',',$invoices_no);\t\r\n\t\t\t$ins_data['modified_on'] = date('Y-m-d H:i:s');\r\n\t\t\t$ins_data['modified_by'] = $user['userid'];\r\n\t\t\t$this->db->where('id',$manifesto_details['manifesto_id']);\r\n\t\t\t$this->db->update(\"pnh_manifesto_log\",$ins_data);\r\n\t\t\t\r\n\t\t\tforeach($invoices_no as $inv)\r\n\t\t\t{\r\n\t\t\t\t$trans_logprm=array();\r\n\t\t\t\t$trans_logprm['transid']=$this->db->query(\"select transid from king_invoice where invoice_no=? limit 1\",$inv)->row()->transid;\r\n\t\t\t\t$trans_logprm['admin']=$user['userid'];\r\n\t\t\t\t$trans_logprm['time']=time();\r\n\t\t\t\t$trans_logprm['msg']='Manifesto created for this invoice ('.$inv.')';\r\n\t\t\t\t$this->db->insert(\"transactions_changelog\",$trans_logprm);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//link the manifesto id and invoice number to shipment_batch_process_invoice link table\r\n\t\t$invoices=implode(',',$invoices_no);\r\n\t\t$this->db->query(\"update shipment_batch_process_invoice_link set inv_manifesto_id=? where invoice_no in ($invoices) \",array($manifesto_details['manifesto_id']));\r\n\t\t\r\n\t\t$sent_manifesto_logid=0;\r\n\t\tif($manifesto_details)\r\n\t\t{\r\n\t\t\t$param1=array();\r\n\t\t\t$param1['sent_invoices']=$manifesto_details['sent_invoices'].','.implode(',',$invoices_no);\r\n\t\t\t$param1['remark']=$manifesto_details['remark'].','.implode(',',$invoices_no).' this invoices are newly add this manifesto';\r\n\t\t\t$param1['modified_on']=cur_datetime();\r\n\t\t\t$param1['modified_by']=$user_det['userid'];\r\n\t\t\t$this->db->where('id',$manifesto_id);\r\n\t\t\t$this->db->update(\"pnh_m_manifesto_sent_log\",$param1);\r\n\t\t\t$sent_manifesto_logid = $manifesto_id;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tforeach($invoices_no as $invno)\r\n\t\t{\r\n\t\t\t// insert invnos to transit table\r\n\t\t\t\t$ins_data = array();\r\n\t\t\t\t$ins_data['sent_log_id'] = $sent_manifesto_logid;\r\n\t\t\t\t$ins_data['invoice_no'] = $invno;\r\n\t\t\t\t$ins_data['ref_id'] = $manifesto_details['hndleby_empid'];\r\n\t\t\t\t$ins_data['status'] = 0;\r\n\t\t\t\t$ins_data['logged_on'] = cur_datetime();\r\n\t\t\t\t$ins_data['logged_by'] = $user_det['userid'];\r\n\t\t\t\t$this->db->insert(\"pnh_invoice_transit_log\",$ins_data);\r\n\t\t}\r\n\t\t\r\n\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Invoices added to selected manifesto\");\r\n\t\tredirect(site_url('admin/pnh_pending_shipments'));\r\n\t}",
"public function test_updateReplenishmentProcessCustomFields() {\n\n }",
"public function log($process, $message){\n $OldFile = $this->base_url.'logs/oxd-php-server-'.date(\"Y-m-d\") .'.log';\n $person = \"\\n\".date('l jS \\of F Y h:i:s A').\"\\n\".$process.$message.\"\\n\";\n file_put_contents($OldFile, $person, FILE_APPEND | LOCK_EX);\n }",
"public function test_getReplenishmentProcessByFilter() {\n\n }",
"function after_process() {\r\n global $insert_id, $db;\r\n $sql = \"insert into \" . TABLE_ORDERS_STATUS_HISTORY . \" (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )\";\r\n $sql = $db->bindVars($sql, ':orderComments', 'eCheck payment. AUTH: ' . $this->auth_code . '. TransID: ' . $this->transaction_id . '.', 'string');\r\n $sql = $db->bindVars($sql, ':orderID', $insert_id, 'integer');\r\n $sql = $db->bindVars($sql, ':orderStatus', $this->order_status, 'integer');\r\n $db->Execute($sql);\r\n return false;\r\n }"
]
| [
"0.6329952",
"0.6321752",
"0.61969584",
"0.61357874",
"0.578552",
"0.57681775",
"0.54374546",
"0.54366595",
"0.53849727",
"0.53631514",
"0.53532517",
"0.53363013",
"0.53009164",
"0.5243142",
"0.52309525",
"0.5218652",
"0.51374704",
"0.51042664",
"0.5102182",
"0.5097951",
"0.5083663",
"0.50705826",
"0.5033085",
"0.5029013",
"0.50109804",
"0.49835855",
"0.49725917",
"0.49409",
"0.4809506",
"0.4799153"
]
| 0.73772097 | 0 |
Test case for addReplenishmentProcessTag Add new tags for a replenishmentProcess. | public function test_addReplenishmentProcessTag() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_getReplenishmentProcessTags() {\n\n }",
"public function testAddReplenishmentTag()\n {\n }",
"public function test_addReplenishmentProcessAudit() {\n\n }",
"public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }",
"public function setAsProcessTag()\r\n\t{\r\n\t\t$this->process_tag = TRUE;\r\n\t}",
"protected function addFulfillmentProcessTagRequest($fulfillment_process_id, $fulfillment_process_tag)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling addFulfillmentProcessTag'\n );\n }\n // verify the required parameter 'fulfillment_process_tag' is set\n if ($fulfillment_process_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_tag when calling addFulfillmentProcessTag'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/tag/{fulfillmentProcessTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n // path params\n if ($fulfillment_process_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessTag' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function test_deleteReplenishmentProcessTag() {\n\n }",
"public function testGetReplenishmentTags()\n {\n }",
"public function test_addExternalShipmentTag() {\n\n }",
"public function test_getDuplicateReplenishmentProcessById() {\n\n }",
"function addPersonalityTag($personality_tag_details){\n\t if ($this->db->insert('vc_personality_tag',$personality_tag_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }",
"public function test_addOrderLineActivityTag() {\n\n }",
"public function add(ProcessDefinition $definition);",
"public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }",
"protected function getFulfillmentProcessTagsRequest($fulfillment_process_id)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling getFulfillmentProcessTags'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testDeleteReplenishmentTag()\n {\n }",
"public function testAddExternalShipmentTag()\n {\n }",
"public function test_attachTagRequest() {\n\n }",
"function action_attach_tags_process( $p_bug_id ) {\n\t\tglobal $g_action_attach_tags_attach, $g_action_attach_tags_create;\n\n\t\t$t_user_id = auth_get_current_user_id();\n\n\t\tforeach( $g_action_attach_tags_create as $t_tag_row ) {\n\t\t\t$t_tag_row['id'] = tag_create( $t_tag_row['name'], $t_user_id );\n\t\t\t$g_action_attach_tags_attach[] = $t_tag_row;\n\t\t}\n\t\t$g_action_attach_tags_create = array();\n\n\t\tforeach( $g_action_attach_tags_attach as $t_tag_row ) {\n\t\t\tif ( !tag_bug_is_attached( $t_tag_row['id'], $p_bug_id ) ) {\n\t\t\t\ttag_bug_attach( $t_tag_row['id'], $p_bug_id, $t_user_id );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function test_getReplenishmentProcessById() {\n\n }",
"private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }",
"public function addToProcessDescription(\\horstoeko\\ubl\\entities\\cbc\\ProcessDescription $processDescription)\n {\n $this->processDescription[] = $processDescription;\n return $this;\n }",
"public function postProcess(ProcessEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"function tagAdd($pid, $post = array('tag_list' => ''), $query = array(), $rawJson = false) {\n \t\t/**\n \t\t * We currently have to do the following to bypass a php to\n \t\t * rails conflict with the meaning of [] in form field names.\n \t\t * With the following, we only need to name our field \"taggable\",\n \t\t * or tag_list, but \"taggable[tag_list]\" is also supported\n \t\t */\n \t if ( isset($post['tagging']) ) {\n \t $tmp = $post['tagging'];\n \t\t unset($post['tagging']);\n \t\t if ( is_array($post['tagging']) ) {\n \t\t foreach ($tmp as $key => $value)\n \t\t $post[\"tagging[$key]\"] = $value;\n \t\t} else {\n \t\t $post['tagging[tag_list]'] = $tmp;\n \t\t}\n \t\t} elseif ( isset($post['tag_list']) ) {\n \t\t $tmp = $post['tag_list'];\n \t\t unset($post['tag_list']);\n \t\t $post['tagging[tag_list]'] = $tmp;\n \t\t}\n \t\t\n \t\t$post['tagging[tag_list]'] = stripslashes($post['tagging[tag_list]']);\n \t\t\n \t\tif ( $json = $this->_post('/merchants/'.$pid.'/taggings.json', $post, 'post', $query, true) )\n \t\t return $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}",
"public function testAddOrderTag()\n {\n }",
"function addProcess (&$processCallback) {\n\t\t$this->_processCallbacks[] =& $processCallback;\n\t}",
"public function testAddReplenishmentAudit()\n {\n }",
"protected function deleteFulfillmentProcessTagRequest($fulfillment_process_id, $fulfillment_process_tag)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling deleteFulfillmentProcessTag'\n );\n }\n // verify the required parameter 'fulfillment_process_tag' is set\n if ($fulfillment_process_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_tag when calling deleteFulfillmentProcessTag'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/tag/{fulfillmentProcessTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n // path params\n if ($fulfillment_process_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessTag' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function test_createTagRequest() {\n\n }",
"public function testUpdateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n $data = json_decode($response->getContent());\n $new_process_data = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $new_response = $this->json('PUT', '/api/processes/' . $data->id, $new_process_data);\n $new_response->assertStatus(201);\n $new_data = json_decode($new_response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }"
]
| [
"0.64777243",
"0.64514357",
"0.58901095",
"0.56725055",
"0.56608963",
"0.5588498",
"0.5491947",
"0.5420028",
"0.53794855",
"0.53539824",
"0.5308997",
"0.5272309",
"0.51826715",
"0.5174692",
"0.5124133",
"0.50844413",
"0.50332147",
"0.50120324",
"0.500012",
"0.49974453",
"0.49765912",
"0.49459794",
"0.491458",
"0.48932034",
"0.48845634",
"0.48596993",
"0.48578125",
"0.48304835",
"0.48301896",
"0.4829916"
]
| 0.7669442 | 0 |
Test case for deleteReplenishmentProcessTag Delete a tag for a replenishmentProcess. | public function test_deleteReplenishmentProcessTag() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDeleteReplenishmentTag()\n {\n }",
"public function testDeleteProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $data = json_decode($response->getContent());\n $new_response = $this->json('DELETE', '/api/processes/' . $data->id);\n $new_response->assertStatus(200);\n $new_data = json_decode($response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"protected function deleteFulfillmentProcessTagRequest($fulfillment_process_id, $fulfillment_process_tag)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling deleteFulfillmentProcessTag'\n );\n }\n // verify the required parameter 'fulfillment_process_tag' is set\n if ($fulfillment_process_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_tag when calling deleteFulfillmentProcessTag'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/tag/{fulfillmentProcessTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n // path params\n if ($fulfillment_process_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessTag' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testDeleteOrderTag()\n {\n }",
"public function testDeleteExternalShipmentTag()\n {\n }",
"public function test_deleteExternalShipmentTag() {\n\n }",
"public function test_addReplenishmentProcessTag() {\n\n }",
"public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }",
"public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }",
"abstract public function delete__do_process ();",
"public function test_deleteOrderLineActivityTag() {\n\n }",
"public function testDeletesPostTagRelationship()\n {\n // Create the post and tag\n $post = $this->resources->post();\n $tag = $this->resources->tag();\n\n // Add the tag to the post\n $result = $this->writedown->getService('api')->postTag()->create([\n 'post_id' => $post->id,\n 'tag_id' => $tag->id,\n ]);\n\n // Now delete the tag\n $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Check the relationship no longer exists\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\PostTag')\n ->findOneBy(['post_id' => $post->id, 'tag_id' => $tag->id]);\n\n $this->assertNull($databaseResult);\n }",
"public function delete_tag($tag);",
"public function testDeletePackingPlanTag()\n {\n }",
"public function destroy(pregunta_test $pregunta_test)\n {\n //\n }",
"public function test_deleteTagRequest() {\n\n }",
"public function testDeleteVendorComplianceSurveyTag()\n {\n }",
"public function testDeleteInvalidPostTag() {\n\t\t// create a PostTag and try to delete it without actually inserting it\n\t\t$postTag = new PostTag( GigHubTest::INVALID_KEY, GigHubTest::INVALID_KEY );\n\t\t$postTag->delete( $this->getPDO() );\n\t}",
"public function test_deleteItemCategoryTag() {\n\n }",
"public function testDeleteTagAdmin(): void\n {\n // given\n $expectedStatusCode = 200;\n $adminUser = $this->createUser([User::ROLE_USER, User::ROLE_ADMIN]);\n $this->logIn($adminUser);\n\n $expectedTag = new Tag();\n $expectedTag->setName('Test Tag To Delete');\n $tagRepository = self::$container->get(TagRepository::class);\n $tagRepository->save($expectedTag);\n\n // when\n $crawler = $this->httpClient->request('GET', '/tag/'.$expectedTag->getId().'/delete');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n $form = $crawler->selectButton('usuń')->form();\n $this->httpClient->submit($form);\n $this->httpClient->followRedirect();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n $this->assertStringContainsString('Usuwanie powiodło się', $this->httpClient->getResponse()->getContent());\n }",
"public function test_getReplenishmentProcessTags() {\n\n }",
"public function testWorkflowsWorkflowIdDelete()\n {\n }",
"public function test_deleteCustomerTag() {\n\n }",
"public function test_deleteCartonActivityTag() {\n\n }",
"public function testDeleteReplenishmentFile()\n {\n }",
"public function test_detachTagRequest() {\n\n }",
"public function testDeleteProductUsingDELETE()\n {\n }",
"public function deleteOrderDetails($product_code,$order_id=NULL,$quantity,$token=NULL);",
"public function testDeletePromotionCampaignApplicationUsingDELETE()\n {\n }",
"public function delete()\n {\n parent::delete();\n $receiptHandle = $this->job->getReceiptHandle();\n $this->mns->deleteMessage($receiptHandle);\n }"
]
| [
"0.7243982",
"0.66308206",
"0.6245989",
"0.6193545",
"0.61611915",
"0.6085347",
"0.60817456",
"0.606098",
"0.6054327",
"0.5965658",
"0.5935133",
"0.58694756",
"0.5852979",
"0.58500284",
"0.57902443",
"0.5786409",
"0.5765257",
"0.567443",
"0.56649065",
"0.5650478",
"0.5612543",
"0.5591845",
"0.55656296",
"0.5545917",
"0.5528006",
"0.552432",
"0.5475149",
"0.54733396",
"0.54661816",
"0.5456865"
]
| 0.7716604 | 0 |
Test case for getDuplicateReplenishmentProcessById Get a duplicated a replenishmentProcess by id | public function test_getDuplicateReplenishmentProcessById() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetDuplicateReplenishmentById()\n {\n }",
"public function test_getReplenishmentProcessById() {\n\n }",
"protected function getDuplicateFulfillmentProcessByIdRequest($fulfillment_process_id)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling getDuplicateFulfillmentProcessById'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/duplicate/{fulfillmentProcessId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract public function isDuplicatePIMAddition($id);",
"public function testDeleteProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $data = json_decode($response->getContent());\n $new_response = $this->json('DELETE', '/api/processes/' . $data->id);\n $new_response->assertStatus(200);\n $new_data = json_decode($response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"public function test_getDuplicateExternalShipmentById() {\n\n }",
"public function testUpdateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n $data = json_decode($response->getContent());\n $new_process_data = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $new_response = $this->json('PUT', '/api/processes/' . $data->id, $new_process_data);\n $new_response->assertStatus(201);\n $new_data = json_decode($new_response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"public function testGetDuplicateExternalShipmentById()\n {\n }",
"public function test_getDuplicateOrderLineActivityById() {\n\n }",
"public function test_getDuplicateCartonActivityById() {\n\n }",
"public function createDuplicate();",
"public function testDuplicateSurvey()\n {\n $year = 2018;\n $currentYear = current_year();\n $origSurvey = Survey::factory()->create(['year' => $year, 'title' => \"$year Survey Title\"]);\n $origGroup = SurveyGroup::factory()->create(['survey_id' => $origSurvey->id]);\n $origQuestion = SurveyQuestion::factory()->create(['survey_id' => $origSurvey->id, 'survey_group_id' => $origGroup->id]);\n\n $response = $this->json('POST', \"survey/{$origSurvey->id}/duplicate\");\n $response->assertStatus(200);\n $newId = $response->json('survey_id');\n\n $this->assertDatabaseHas('survey', ['id' => $newId, 'title' => \"$currentYear Survey Title\"]);\n $this->assertDatabaseHas('survey_group', ['survey_id' => $newId, 'title' => $origGroup->title]);\n $this->assertDatabaseHas('survey_question', ['survey_id' => $newId, 'description' => $origQuestion->description]);\n }",
"public function duplicateInvoice($id) {\n\t\ttry{\n\t\t\t$invoiceTbl = $this->_serviceManager->get('Invoice\\Model\\InvoiceTable');\n\t\n\t\t\t$invoiceItems = $invoiceTbl->fetchInvoiceItemsById($id);\n\t\t\t\n\t\t\t$invoiceData = $invoiceTbl->getInvoiceDetailsById($id);\n\t\t\t\n\t\t\t$xml = $this->generateDuplicateXml($invoiceData, $invoiceItems);\n\t\t\t\n\t\t\t$response = $this->_XeroOAuth->request('POST', $this->_XeroOAuth->url('Invoices', 'core'), array(), $xml);\n\t\t\t\n\t\t\tif ($this->_XeroOAuth->response['code'] == 200) {\n\t\t\t\t$invoice = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n\t\t\t\t\n\t\t\t\tif (count($invoice->Invoices[0]) > 0) {\n\t\t\t\t\t$data = (array) $invoiceTbl->getInvoiceById($id);\n\t\t\t\t\tunset($data['id']);\n\t\t\t\t\t$data['invoice_id'] = $invoice->Invoices[0]->Invoice->InvoiceID;\n\t\t\t\t\t$data['invoice_number'] = $invoice->Invoices[0]->Invoice->InvoiceNumber;\n\t\t\t\t\t\n\t\t\t\t\t$invoice_id = $this->saveDuplicateData($data, $invoiceItems);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false; \n\t\t}catch(\\Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }",
"public function input_WbfsysPersonDuplicateSuspicion_IdDuplicate( $params )\n {\n $i18n = $this->view->i18n;\n\n if( !Webfrap::classLoadable( 'CorePerson_Entity' ) )\n {\n if(DEBUG)\n Debug::console( 'Entity CorePerson not exists' );\n\n Log::warn( 'Looks like the Entity: CorePerson is missing' );\n\n return;\n }\n\n\n //p: Window\n $objidCorePerson = $this->entity->getData( 'id_duplicate' ) ;\n\n // entity ids can never be 0 so thats ok\n if\n (\n !$objidCorePerson\n || !$entityCorePerson = $this->db->orm->get\n (\n 'CorePerson',\n $objidCorePerson\n )\n )\n {\n $entityCorePerson = $this->db->orm->newEntity( 'CorePerson' );\n }\n\n $inputIdDuplicate = $this->view->newInput( 'inputWbfsysPersonDuplicateSuspicionIdDuplicate', 'Window' );\n $this->items['wbfsys_person_duplicate_suspicion-id_duplicate'] = $inputIdDuplicate;\n $inputIdDuplicate->addAttributes(array\n (\n 'readonly' => 'readonly',\n 'name' => 'wbfsys_person_duplicate_suspicion[id_duplicate]',\n 'id' => 'wgt-input-wbfsys_person_duplicate_suspicion_id_duplicate'.($this->suffix?'-'.$this->suffix:''),\n 'class' => 'wcm wcm_ui_tip medium'.($this->assignedForm?' asgd-'.$this->assignedForm:''),\n 'title' => $i18n->l( 'Insert value for {@attr@} ({@src@})', 'wbf.label', array( 'attr' => 'Duplicate', 'src' => 'Person Duplicate Suspicion' ) ),\n ));\n\n if( $this->assignedForm )\n $inputIdDuplicate->assignedForm = $this->assignedForm;\n\n $inputIdDuplicate->setWidth( 'medium' );\n\n $inputIdDuplicate->setData( $this->entity->getData( 'id_duplicate' ) );\n $inputIdDuplicate->setReadonly( $this->fieldReadOnly( 'wbfsys_person_duplicate_suspicion', 'id_duplicate' ) );\n $inputIdDuplicate->setRequired( $this->fieldRequired( 'wbfsys_person_duplicate_suspicion', 'id_duplicate' ) );\n $inputIdDuplicate->setLabel( $i18n->l( 'Duplicate', 'wbfsys.person_duplicate_suspicion.label' ) );\n\n\n $listUrl = 'modal.php?c=Core.Person.selection'\n .'&suffix='.$this->suffix.'&input=wbfsys_person_duplicate_suspicion_id_duplicate'.($this->suffix?'-'.$this->suffix:'');\n\n $inputIdDuplicate->setListUrl ( $listUrl );\n $inputIdDuplicate->setListIcon( 'control/connect.png' );\n $inputIdDuplicate->setEntityUrl( 'maintab.php?c=Core.Person.edit' );\n $inputIdDuplicate->conEntity = $entityCorePerson;\n $inputIdDuplicate->refresh = $this->refresh;\n $inputIdDuplicate->serializeElement = $this->sendElement;\n\n\n\n $inputIdDuplicate->view = $this->view;\n $inputIdDuplicate->buildJavascript( 'wgt-input-wbfsys_person_duplicate_suspicion_id_duplicate'.($this->suffix?'-'.$this->suffix:'') );\n $this->view->addJsCode( $inputIdDuplicate );\n\n // activate the category\n $this->view->addVar\n (\n 'showCat'.$this->namespace.'_Default' ,\n true\n );\n\n }",
"public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }",
"public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }",
"public function testDuplicate()\n {\n $this->duplicate(\n [\n 'tabId' => 1,\n ],\n [\n 'tabId' => 1,\n ]\n );\n }",
"public function testGetDuplicatePackingPlanById()\n {\n }",
"public static function duplicate($service) {\n\n $serviceid = $service->id;\n\n // duplicate service\n $newservice = ORM::forTable('service')->create();\n Admin::duplicateRecord($service, $newservice);\n $newservice->code = \"CHANGE\";\n $newservice->date = date(\"Y-m-d\");\n $newservice->visible = 0;\n $newservice->save();\n $newserviceid = $newservice->id();\n\n // duplicate destinations\n // create a map of old to new ids\n $destmap = array();\n $destinations = ORM::forTable('destination')->where('serviceid', $serviceid)->findMany();\n if ($destinations) {\n foreach ($destinations as $destination) {\n $newdestination = ORM::forTable('destination')->create();\n Admin::duplicateRecord($destination, $newdestination);\n $newdestination->serviceid = $newserviceid;\n $newdestination->save();\n $destmap[$destination->id] = $newdestination->id();\n }\n }\n\n // duplicate pricebandgroup\n // create a map of old to new ids\n $pbmap = array();\n $pricebandgroups = ORM::forTable('pricebandgroup')->where('serviceid', $serviceid)->findMany();\n if ($pricebandgroups) {\n foreach ($pricebandgroups as $pricebandgroup) {\n $newpricebandgroup = ORM::forTable('pricebandgroup')->create();\n $newpricebandgroup->serviceid = $newserviceid;\n $newpricebandgroup->name = $pricebandgroup->name;\n $newpricebandgroup->save();\n $pbmap[$pricebandgroup->id] = $newpricebandgroup->id();\n }\n }\n\n // duplicate joining\n $joinings = ORM::forTable('joining')->where('serviceid', $serviceid)->findMany();\n if ($joinings) {\n foreach ($joinings as $joining) {\n $newjoining = ORM::forTable('joining')->create();\n Admin::duplicateRecord($joining, $newjoining);\n $newjoining->serviceid = $newserviceid;\n if (empty($pbmap[$joining->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $joining->pricebandgroupid);\n }\n $newjoining->pricebandgroupid = $pbmap[$joining->pricebandgroupid];\n $newjoining->save();\n }\n }\n\n // duplicate pricebands\n $pricebands = ORM::forTable('priceband')->where('serviceid', $serviceid)->findMany();\n if ($pricebands) {\n foreach ($pricebands as $priceband) {\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband = ORM::forTable('priceband')->create();\n Admin::duplicateRecord($priceband, $newpriceband);\n $newpriceband->serviceid = $newserviceid;\n if (empty($destmap[$priceband->destinationid])) {\n throw new Exception('No destination mapping exists for id = ' . $priceband->destinationid);\n }\n $newpriceband->destinationid = $destmap[$priceband->destinationid];\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband->pricebandgroupid = $pbmap[$priceband->pricebandgroupid];\n $newpriceband->save();\n }\n }\n\n // duplicate limits\n $limits = ORM::forTable('limits')->where('serviceid', $serviceid)->findOne();\n if ($limits) {\n $newlimits = ORM::forTable('limits')->create();\n Admin::duplicateRecord($limits, $newlimits);\n $newlimits->serviceid = $newserviceid;\n $newlimits->save();\n }\n\n return $newservice;\n }",
"public function duplicate() {\n \t\t\n \t\ttry {\n\t\t\t\n\t \t\t// start duplicate\n\t\t\t$class = get_class($this);\n \t\t\t$duplicate = new $class;\n \t\t\t\n\t \t\t// duplicate row fields\n\t \t\t$this->duplicateRow($duplicate);\n\t \t\t\n \t\t\t// duplicate data\n\t \t\t$this->duplicateData($duplicate);\n\t \t\t\n\t \t\t// duplicate items\n\t \t\t$this->duplicateChildren($duplicate);\n\t \t\t\n\t \t\t$duplicate->setDuplicate($this->getId());\n \t\t\n \t\t\treturn $duplicate;\n \t\t\t\n \t\t} catch (Exception $e) {\n \t\t\n \t\t\treturn false;\n \t\t\t\n \t\t}\n \t\t\n \t}",
"public function testDuplicate()\n {\n $this->duplicate(\n [\n 'catalogId' => 1,\n 'catalogInstanceId' => 1,\n 'count' => 1,\n 'status' => 0,\n ],\n [\n 'count' => ['minValue']\n ]\n );\n }",
"public function testGetDuplicateOrderById()\n {\n }",
"public function dataProcessingsDuplicateRequest($id, $workspace_id, $tenant_id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling dataProcessingsDuplicate'\n );\n }\n // verify the required parameter 'workspace_id' is set\n if ($workspace_id === null || (is_array($workspace_id) && count($workspace_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $workspace_id when calling dataProcessingsDuplicate'\n );\n }\n // verify the required parameter 'tenant_id' is set\n if ($tenant_id === null || (is_array($tenant_id) && count($tenant_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $tenant_id when calling dataProcessingsDuplicate'\n );\n }\n\n $resourcePath = '/v1/tenant/{tenantId}/ws/{workspaceId}/DataProcessings/{id}/duplicate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($workspace_id !== null) {\n $resourcePath = str_replace(\n '{' . 'workspaceId' . '}',\n ObjectSerializer::toPathValue($workspace_id),\n $resourcePath\n );\n }\n // path params\n if ($tenant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'tenantId' . '}',\n ObjectSerializer::toPathValue($tenant_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 check_duplicate()\n {\n }",
"public function getSubprocessByProcessesId()\n\t\t{\n\n\t\t}",
"public function duplicate($id, HAsistenciaR $hAsistenciaR)\n\t{\n\t\t$hAsistenciaR=$hAsistenciaR->find($id);\n\t\treturn view('hAsistenciaRs.duplicate', compact('hAsistenciaR'))\n\t\t\t->with( 'list', HAsistenciaR::getListFromAllRelationApps() );\n\t}",
"public function testGetPid(): void\n {\n $model = ProcessMemoryMap::load([\n \"pid\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getPid());\n }",
"public function getDuplicateFulfillmentProcessByIdWithHttpInfo($fulfillment_process_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\FulfillmentProcess';\n $request = $this->getDuplicateFulfillmentProcessByIdRequest($fulfillment_process_id);\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 '\\Infoplus\\Infoplus\\Model\\FulfillmentProcess',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function check_duplicate() {\n $this->db->where ( 'orderID', trim ( $this->input->post ( 'orderID' ) ) );\n\n if ($this->db->count_all_results ( $this->table ))\n echo \"1\"; // duplicate\n else\n echo \"0\";\n }",
"public function test_getDuplicateCustomerById() {\n\n }"
]
| [
"0.66931516",
"0.641027",
"0.6232355",
"0.61928725",
"0.6187299",
"0.613635",
"0.6049829",
"0.59200066",
"0.57526034",
"0.56979907",
"0.568265",
"0.56778294",
"0.56549484",
"0.56267667",
"0.5626649",
"0.56112266",
"0.56046975",
"0.5600475",
"0.55439097",
"0.55349207",
"0.5514448",
"0.5465429",
"0.5400188",
"0.5376816",
"0.5344821",
"0.5328834",
"0.5278008",
"0.52715224",
"0.52073395",
"0.5201896"
]
| 0.8148026 | 0 |
Test case for getReplenishmentProcessByFilter Search replenishmentProcesses by filter | public function test_getReplenishmentProcessByFilter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_getReplenishmentProcessById() {\n\n }",
"public function test_getDuplicateReplenishmentProcessById() {\n\n }",
"public function getProcess();",
"public function getSubprocessByProcessesId()\n\t\t{\n\n\t\t}",
"function show_filter_process()\n\t\t{\n\t\t\t$this->t->set_var('filter_process_up', $this->filter_process);\n\t\t\t// now show the filter process select\n\t\t\t$this->t->set_var('filter_process_selected_all', (!$this->filter_process)? 'selected=\"selected\"' : '');\n\t\t\t$this->t->set_block($this->template_name, 'block_filter_process', 'filter_process');\n\t\t\tforeach ($this->all_processes['data'] as $process)\n\t\t\t{\n\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t'filter_process_selected'\t=> ($process['wf_p_id'] == $this->filter_process)? 'selected=\"selected\"' : '',\n\t\t\t\t\t'filter_process_value'\t\t=> $process['wf_p_id'],\n\t\t\t\t\t'filter_process_name'\t\t=> $process['wf_name'],\n\t\t\t\t\t'filter_process_version'\t=> $process['wf_version'],\n\n\t\t\t\t));\n\t\t\t\t$this->t->parse('filter_process', 'block_filter_process', true);\n\t\t\t}\n\t\t}",
"public function testRestosAPagarProcessadosInscritos() {\n $filter = function (array $line): bool {\n if (\n str_starts_with($line['conta_contabil'], '5.3.2') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorRP = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filter);\n $saldoCredorRP = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filter);\n\n $filter = function (array $line): bool {\n return true;\n };\n $saldoRP = $this->somaColuna($this->getDataFrame('RESTOS_PAGAR'), 'saldo_inicial_processados', $filter);\n\n $this->comparar($saldoRP, ($saldoDevedorRP - $saldoCredorRP));\n\n $this->saldoVerificado(__METHOD__, '5.3.2');\n }",
"public function testRestosAPagarNaoProcessadosInscritos() {\n $filter = function (array $line): bool {\n if (\n str_starts_with($line['conta_contabil'], '5.3.1') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorRP = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filter);\n $saldoCredorRP = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filter);\n\n $filter = function (array $line): bool {\n return true;\n };\n $saldoRP = $this->somaColuna($this->getDataFrame('RESTOS_PAGAR'), 'saldo_inicial_nao_processados', $filter);\n\n $this->comparar($saldoRP, ($saldoDevedorRP - $saldoCredorRP));\n\n $this->saldoVerificado(__METHOD__, '5.3.1');\n }",
"public function getProcesses() {\n\t\t$bean = $this->unbox();\n\t\treturn $bean->with(' ORDER BY `id` ')->ownProcess;\n\t}",
"public function testReadProcess () {\n $response = $this->json('GET', 'api/processes');\n $response->assertStatus(200);\n }",
"public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}",
"public function getProcess()\n {\n return $this->hasMany(ToquvMakineProcesses::className(), ['machine_id' => 'id'])->leftJoin('toquv_instructions ti', 'toquv_makine_processes.ti_id = ti.id')->where(['ti.is_closed'=>1])->orderBy(['id' => SORT_DESC]);\n }",
"public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Invoices::grid() )->search ();\n\t}",
"public function ListProcess($processType){\n\t\tif($processType == \"uAchieve\")\n\t\t\t$query = \"SELECT recordID, clusterNumber, title, publishedUser, publishedDate FROM [PUBLISH CLUSTERS TABLE] WHERE uAchieveChangeFlag = 'N'\";\n\t\telse if($processType == \"sis\")\n\t\t\t$query = \"SELECT recordID, clusterNumber, title, publishedUser, publishedDate FROM [PUBLISH CLUSTERS TABLE] WHERE sisChangeFlag = 'N'\";\n\t\telse\n\t\t\treturn array(\"results\" => null);\n\n\t\tif($rows = $this->SelectQueryHelper($query))\n\t\t\treturn array(\"results\" => $rows);\n\t\telse \n\t\t\treturn array(\"results\" => null);\t\t\n\t}",
"private function getOVPNProcess () \n\t\t{\n\t\t\t@exec ('/bin/pidof openvpn',$o,$r ) ; /* pidof command use by exec function */\n\t\t\tif ( ! $r ) {\n\t\t\t\t$this->result['data']['status'] = \"Running\";\n\t\t\t\t$this->result['data']['pid'] = $o[0];\n\t\t\t} else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:200]\";\n\t\t\treturn ;\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $request = $this->getRequest();\n //filter\n $session = $request->getSession();\n $filter = $session->get('adminorderfilter', new OrderFilter());\n if (empty($filter)) {\n $filter = new OrderFilter();\n $session->set('adminorderfilter', $filter);\n }\n if ($filter->getShippingState() != null) {\n $filter->setShippingState($em->merge($filter->getShippingState()));\n }\n if ($filter->getShippingStatus() != null) {\n $filter->setShippingStatus($em->merge($filter->getShippingStatus()));\n }\n if ($filter->getOrderStatus() != null) {\n $filter->setOrderStatus($em->merge($filter->getOrderStatus()));\n }\n\n $form = $this->createForm(new OrderFilterType(), $filter);\n $page = $this->getRequest()->get('page', $filter->getPage());\n if ($request->getMethod() == \"POST\") {\n $form->bind($request);\n if ($form->isValid()) {\n $page = 1;\n $session->set('adminorderfilter', $filter);\n }\n }\n $filter->setPage($page);\n $session->set('adminorderfilter', $filter);\n\n $querybuilder = $em->getRepository('CoreShopBundle:Order')->createQueryBuilder('o');\n $querybuilder = $em->getRepository('CoreShopBundle:Order')->filterOrderQuieryBuilder($querybuilder, $filter);\n $querybuilder->addOrderBy('o.createdAt', 'desc');\n $query = $querybuilder->getQuery();\n $paginator = $this->get('knp_paginator');\n\n $pagination = $paginator->paginate(\n $query,\n $page/*page number*/,\n 100/*limit per page*/\n );\n\n $processOrders = array();\n foreach ($pagination->getItems() as $order) {\n $processOrder = new ProcessOrder();\n $processOrder->setOrder($order);\n $processOrders[] = $processOrder;\n }\n $process = new Process();\n $process->setProcessOrders($processOrders);\n\n $export = $this->container->getParameter('admin.order.export');\n $processConfig = $this->container->getParameter('admin.order.process');\n $processForm = $this->createForm(new ProcessType(), $process, array('export' => $export, 'config' => $processConfig));\n\n return $this->render('CoreShopBundle:Order:index.html.twig', array(\n 'entities' => $pagination,\n 'form' => $form->createView(),\n 'process' => $processForm->createView(),\n 'processConfig' => $processConfig,\n ));\n }",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( ProductsAttributes::grid() )->search ();\n\t}",
"public function run()\n {\n Model::unguard();\n\n Process::create(['id' => '0', 'name' => 'Нет обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '0', 'is_default' => '0']);\n Process::find(1)->update(['id' => '0']);\n\n Process::create(['id' => '1001', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1006', 'is_default' => '0']);\n Process::create(['id' => '1008', 'name' => 'Жареные кружочками', 'coldproc' => '5', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1010', 'name' => 'Печеные в кожице с последующей очисткой', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1012', 'name' => 'Жарка (Н. Зеландия, Австралия)', 'coldproc' => '24', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '1']);\n Process::create(['id' => '1015', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1019', 'is_default' => '1']);\n Process::create(['id' => '1016', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1017', 'name' => 'Котлеты натур. рубленн. в сухарях', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1018', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1019', 'name' => 'Жарка охлажденой', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1021', 'is_default' => '1']);\n Process::create(['id' => '1020', 'name' => 'Тушение охлажденой', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1025', 'name' => 'Жарка дольками', 'coldproc' => '24', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1026', 'is_default' => '1']);\n Process::create(['id' => '1026', 'name' => 'Пассерование', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1026', 'is_default' => '0']);\n Process::create(['id' => '1027', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1026', 'is_default' => '0']);\n Process::create(['id' => '1030', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1027', 'is_default' => '1']);\n Process::create(['id' => '1035', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1033', 'is_default' => '0']);\n Process::create(['id' => '1036', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1033', 'is_default' => '0']);\n Process::create(['id' => '1037', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1034', 'is_default' => '0']);\n Process::create(['id' => '1038', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1034', 'is_default' => '0']);\n Process::create(['id' => '1039', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1035', 'is_default' => '0']);\n Process::create(['id' => '1040', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1035', 'is_default' => '0']);\n Process::create(['id' => '1041', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1045', 'is_default' => '0']);\n Process::create(['id' => '1046', 'name' => 'Варка крупным куском', 'coldproc' => '6', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1047', 'name' => 'Жарка крупным куском', 'coldproc' => '6', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1054', 'name' => 'Варка крупным куском', 'coldproc' => '5', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '1']);\n Process::create(['id' => '1055', 'name' => 'Жарка крупным куском', 'coldproc' => '5', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1056', 'name' => 'Котлетная масса жарка', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1057', 'name' => 'Тушение крупным куском', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1058', 'name' => 'Варка охлажденных', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '14', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1058', 'is_default' => '0']);\n Process::create(['id' => '1059', 'name' => 'Жарка во фритюре (охлажденное)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1059', 'is_default' => '0']);\n Process::create(['id' => '1060', 'name' => 'Варка и тушение (охлажденное)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1059', 'is_default' => '1']);\n Process::create(['id' => '1061', 'name' => 'Жарка охлажденных', 'coldproc' => '13', 'hotproc' => '25', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1060', 'is_default' => '1']);\n Process::create(['id' => '1062', 'name' => 'Варка охлажденных', 'coldproc' => '13', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1063', 'name' => 'Жарка охлажденных', 'coldproc' => '7', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1064', 'name' => 'Варка охлажденных', 'coldproc' => '7', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1061', 'is_default' => '1']);\n Process::create(['id' => '1065', 'name' => 'Жарка охлажденной', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1062', 'is_default' => '1']);\n Process::create(['id' => '1066', 'name' => 'Тушение охлажденной', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1067', 'name' => 'Варка кусками непластованная', 'coldproc' => '19', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1068', 'name' => 'Жарка кусками непластованная', 'coldproc' => '19', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1071', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1067', 'is_default' => '1']);\n Process::create(['id' => '1072', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1067', 'is_default' => '0']);\n Process::create(['id' => '1073', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1068', 'is_default' => '1']);\n Process::create(['id' => '1074', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1068', 'is_default' => '0']);\n Process::create(['id' => '1075', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1075', 'is_default' => '0']);\n Process::create(['id' => '1076', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1075', 'is_default' => '1']);\n Process::create(['id' => '1077', 'name' => 'Жарка (Контрольная проработка)', 'coldproc' => '4', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1076', 'is_default' => '1']);\n Process::create(['id' => '1083', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1079', 'is_default' => '1']);\n Process::create(['id' => '1084', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1079', 'is_default' => '0']);\n Process::create(['id' => '1085', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1079', 'is_default' => '0']);\n Process::create(['id' => '1087', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1083', 'is_default' => '1']);\n Process::create(['id' => '1091', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1103', 'is_default' => '1']);\n Process::create(['id' => '1092', 'name' => 'Котлеты из мякоти', 'coldproc' => '40', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1103', 'is_default' => '0']);\n Process::create(['id' => '1093', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1103', 'is_default' => '0']);\n Process::create(['id' => '1094', 'name' => 'Жаренные ломтиками с кожицей и семянами', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '1']);\n Process::create(['id' => '1096', 'name' => 'Припущенные без кожицы и семян', 'coldproc' => '33', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1097', 'name' => 'Варка', 'coldproc' => '10', 'hotproc' => '46', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1114', 'is_default' => '1']);\n Process::create(['id' => '1099', 'name' => 'Варка', 'coldproc' => '36', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '1']);\n Process::create(['id' => '1100', 'name' => 'Жарка', 'coldproc' => '36', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '0']);\n Process::create(['id' => '1102', 'name' => 'Припускание', 'coldproc' => '36', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1115', 'is_default' => '0']);\n Process::create(['id' => '1107', 'name' => 'Варка крупными кусками', 'coldproc' => '20', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '2', 'ch' => '0', 'protein' => '2', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1108', 'name' => 'Тушение', 'coldproc' => '20', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1109', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1118', 'is_default' => '1']);\n Process::create(['id' => '1111', 'name' => 'Припускание', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1119', 'is_default' => '1']);\n Process::create(['id' => '1114', 'name' => 'Варка ', 'coldproc' => '48', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '2', 'ch' => '1', 'protein' => '2', 'product_id' => '1121', 'is_default' => '1']);\n Process::create(['id' => '1117', 'name' => 'Запеченый с головой', 'coldproc' => '24', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1123', 'is_default' => '1']);\n Process::create(['id' => '1120', 'name' => 'Отварной непластованный кусками', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1121', 'name' => 'Жареный непластованный кусками', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1124', 'name' => 'Отварной очищенный', 'coldproc' => '35', 'hotproc' => '3', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '1']);\n Process::create(['id' => '1125', 'name' => 'Жареный до готовности', 'coldproc' => '35', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1131', 'name' => 'Жарка (Контрольная проработка)', 'coldproc' => '4', 'hotproc' => '34', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1139', 'is_default' => '1']);\n Process::create(['id' => '1133', 'name' => 'Разморозка, очистка от панциря', 'coldproc' => '53', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1143', 'is_default' => '1']);\n Process::create(['id' => '1136', 'name' => 'Жарка с удалением внутренностей', 'coldproc' => '31', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1148', 'is_default' => '1']);\n Process::create(['id' => '1137', 'name' => 'Варка, разделка на мякоть без кожи', 'coldproc' => '0', 'hotproc' => '28', 'finalproc' => '47', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1138', 'name' => 'Жарка, запекание', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '1']);\n Process::create(['id' => '1139', 'name' => 'Котлеты из мякоти', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1140', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1149', 'name' => 'Отварной непластованный кусками', 'coldproc' => '38', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1150', 'name' => 'Жареный непластованный кусками', 'coldproc' => '38', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '1']);\n Process::create(['id' => '1153', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1162', 'is_default' => '1']);\n Process::create(['id' => '1154', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1162', 'is_default' => '0']);\n Process::create(['id' => '1155', 'name' => 'Пассерование', 'coldproc' => '24', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1164', 'is_default' => '1']);\n Process::create(['id' => '1156', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1164', 'is_default' => '0']);\n Process::create(['id' => '1157', 'name' => 'Пассерованный до готовности', 'coldproc' => '16', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1158', 'name' => 'Пассерованный до полуготовности', 'coldproc' => '16', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1159', 'name' => 'Варка по СТН', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1168', 'is_default' => '1']);\n Process::create(['id' => '1160', 'name' => 'Варка по СТН', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1169', 'is_default' => '0']);\n Process::create(['id' => '1161', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1173', 'is_default' => '1']);\n Process::create(['id' => '1163', 'name' => 'Жарка', 'coldproc' => '17', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1183', 'is_default' => '1']);\n Process::create(['id' => '1166', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1184', 'is_default' => '1']);\n Process::create(['id' => '1167', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1184', 'is_default' => '0']);\n Process::create(['id' => '1169', 'name' => 'Припускание и запекание с сырным соусом', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1186', 'is_default' => '1']);\n Process::create(['id' => '1171', 'name' => 'Жарка', 'coldproc' => '9', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1187', 'is_default' => '1']);\n Process::create(['id' => '1185', 'name' => 'Варка', 'coldproc' => '25', 'hotproc' => '1', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1186', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1196', 'is_default' => '1']);\n Process::create(['id' => '1187', 'name' => 'Припускание', 'coldproc' => '25', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1190', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1201', 'is_default' => '1']);\n Process::create(['id' => '1191', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1201', 'is_default' => '0']);\n Process::create(['id' => '1196', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1197', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1198', 'name' => 'Котлеты из мякоти', 'coldproc' => '25', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1205', 'is_default' => '0']);\n Process::create(['id' => '1199', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1205', 'is_default' => '1']);\n Process::create(['id' => '1200', 'name' => 'Запекание', 'coldproc' => '20', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1206', 'is_default' => '1']);\n Process::create(['id' => '1201', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1208', 'is_default' => '1']);\n Process::create(['id' => '1202', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1208', 'is_default' => '0']);\n Process::create(['id' => '1203', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '0', 'protein' => '2', 'product_id' => '1209', 'is_default' => '1']);\n Process::create(['id' => '1204', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1210', 'is_default' => '1']);\n Process::create(['id' => '1205', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1210', 'is_default' => '0']);\n Process::create(['id' => '1206', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1211', 'is_default' => '1']);\n Process::create(['id' => '1207', 'name' => 'Припускание с очисткой', 'coldproc' => '40', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1208', 'name' => 'Варка целиком (из охлажденных)', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1209', 'name' => 'Жарка целиком (из с/м импорного пр-ва)', 'coldproc' => '24', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '1']);\n Process::create(['id' => '1216', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '1']);\n Process::create(['id' => '1217', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1218', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '15', 'ch' => '0', 'protein' => '5', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1219', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1217', 'is_default' => '0']);\n Process::create(['id' => '1224', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1220', 'is_default' => '1']);\n Process::create(['id' => '1225', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1220', 'is_default' => '0']);\n Process::create(['id' => '1226', 'name' => 'Варка', 'coldproc' => '45', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1227', 'name' => 'Жарка порционного куска с кожей без хрящей', 'coldproc' => '45', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1229', 'name' => 'Жарка неглазированное льдом', 'coldproc' => '8', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1231', 'name' => 'Припускание неглазированное льдом', 'coldproc' => '8', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1232', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1224', 'is_default' => '1']);\n Process::create(['id' => '1234', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1226', 'is_default' => '1']);\n Process::create(['id' => '1235', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1226', 'is_default' => '0']);\n Process::create(['id' => '1236', 'name' => 'Пассеровка', 'coldproc' => '25', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1227', 'is_default' => '0']);\n Process::create(['id' => '1238', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1229', 'is_default' => '1']);\n Process::create(['id' => '1239', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1229', 'is_default' => '0']);\n Process::create(['id' => '1240', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1234', 'is_default' => '1']);\n Process::create(['id' => '1244', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1237', 'is_default' => '1']);\n Process::create(['id' => '1245', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1237', 'is_default' => '0']);\n Process::create(['id' => '1255', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '9', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1250', 'is_default' => '1']);\n Process::create(['id' => '1256', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1255', 'is_default' => '1']);\n Process::create(['id' => '1257', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1255', 'is_default' => '0']);\n Process::create(['id' => '1259', 'name' => 'Варка ', 'coldproc' => '25', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '5', 'ch' => '1', 'protein' => '5', 'product_id' => '1261', 'is_default' => '0']);\n Process::create(['id' => '1260', 'name' => 'Пассерование', 'coldproc' => '25', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1261', 'is_default' => '0']);\n Process::create(['id' => '1261', 'name' => 'Тушение', 'coldproc' => '25', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1261', 'is_default' => '1']);\n Process::create(['id' => '1262', 'name' => 'Варка без слива (СТН)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1263', 'name' => 'Варка со сливом (СТН)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1263', 'is_default' => '1']);\n Process::create(['id' => '1264', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1264', 'is_default' => '1']);\n Process::create(['id' => '1265', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1264', 'is_default' => '0']);\n Process::create(['id' => '1271', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '1']);\n Process::create(['id' => '1272', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '0']);\n Process::create(['id' => '1273', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '1']);\n Process::create(['id' => '1274', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '0']);\n Process::create(['id' => '1275', 'name' => 'Вареная в кожуре с посл. очисткой', 'coldproc' => '0', 'hotproc' => '2', 'finalproc' => '25', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1276', 'is_default' => '1']);\n Process::create(['id' => '1276', 'name' => 'Пассерованная', 'coldproc' => '25', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1276', 'is_default' => '0']);\n Process::create(['id' => '1277', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1278', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1277', 'is_default' => '1']);\n Process::create(['id' => '1279', 'name' => 'Котлеты натур. рубл. (с сухарях)', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1280', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1281', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1282', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '1']);\n Process::create(['id' => '1283', 'name' => 'Жарка в сухарях', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1284', 'name' => 'Тушение', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '1285', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1286', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '1']);\n Process::create(['id' => '1287', 'name' => 'Котлеты', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1288', 'name' => 'Тушение', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1289', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '11', 'finalproc' => '49', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1280', 'is_default' => '1']);\n Process::create(['id' => '1293', 'name' => 'Варка охлажденных', 'coldproc' => '2', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '1']);\n Process::create(['id' => '1294', 'name' => 'Жарка охлажденных', 'coldproc' => '2', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1296', 'name' => 'Жарка в сухарях охлажденных', 'coldproc' => '2', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '5', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1298', 'name' => 'Запекание с предварительной варкой', 'coldproc' => '5', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1282', 'is_default' => '1']);\n Process::create(['id' => '1303', 'name' => 'Пассерование', 'coldproc' => '32', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1285', 'is_default' => '1']);\n Process::create(['id' => '1304', 'name' => 'Припускание', 'coldproc' => '32', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1306', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1287', 'is_default' => '0']);\n Process::create(['id' => '1308', 'name' => 'Тушение', 'coldproc' => '3', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1287', 'is_default' => '1']);\n Process::create(['id' => '1309', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1291', 'is_default' => '1']);\n Process::create(['id' => '1311', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1293', 'is_default' => '1']);\n Process::create(['id' => '1314', 'name' => 'Запекание в составе блюда', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1297', 'is_default' => '0']);\n Process::create(['id' => '1318', 'name' => 'Запекание в составе блюда', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1301', 'is_default' => '0']);\n Process::create(['id' => '1320', 'name' => 'Жарка', 'coldproc' => '16', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1304', 'is_default' => '1']);\n Process::create(['id' => '1321', 'name' => 'Отварной непластованный кусками', 'coldproc' => '38', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1322', 'name' => 'Жареный непластованный кусками', 'coldproc' => '38', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1325', 'name' => 'Варка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1307', 'is_default' => '1']);\n Process::create(['id' => '1326', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1307', 'is_default' => '0']);\n Process::create(['id' => '1327', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1308', 'is_default' => '1']);\n Process::create(['id' => '1328', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1308', 'is_default' => '0']);\n Process::create(['id' => '1329', 'name' => 'Припускание', 'coldproc' => '27', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1310', 'is_default' => '1']);\n Process::create(['id' => '1330', 'name' => 'Отварной непластованный кусками', 'coldproc' => '35', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '1']);\n Process::create(['id' => '1331', 'name' => 'Жареный непластованный кусками', 'coldproc' => '35', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1336', 'name' => 'Запекание', 'coldproc' => '8', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1319', 'is_default' => '0']);\n Process::create(['id' => '1337', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1320', 'is_default' => '0']);\n Process::create(['id' => '1338', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1321', 'is_default' => '0']);\n Process::create(['id' => '1339', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1322', 'is_default' => '0']);\n Process::create(['id' => '1344', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1327', 'is_default' => '0']);\n Process::create(['id' => '1345', 'name' => 'Варка', 'coldproc' => '4', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1346', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '1']);\n Process::create(['id' => '1347', 'name' => 'Котлеты', 'coldproc' => '4', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1348', 'name' => 'Припускание', 'coldproc' => '4', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1349', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1330', 'is_default' => '1']);\n Process::create(['id' => '1350', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1330', 'is_default' => '0']);\n Process::create(['id' => '1351', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1331', 'is_default' => '1']);\n Process::create(['id' => '1352', 'name' => 'Пассерование', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1331', 'is_default' => '0']);\n Process::create(['id' => '1353', 'name' => 'Жарка, запекание', 'coldproc' => '15', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1355', 'name' => 'Припускание', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1333', 'is_default' => '0']);\n Process::create(['id' => '1356', 'name' => 'Жарка Medium', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1336', 'is_default' => '0']);\n Process::create(['id' => '1358', 'name' => 'Варка ', 'coldproc' => '30', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1337', 'is_default' => '0']);\n Process::create(['id' => '1359', 'name' => 'Жарка ломтиками', 'coldproc' => '30', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1337', 'is_default' => '1']);\n Process::create(['id' => '1361', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '1']);\n Process::create(['id' => '1362', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1363', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '15', 'ch' => '0', 'protein' => '5', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1364', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1338', 'is_default' => '0']);\n Process::create(['id' => '1366', 'name' => 'Жарка', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '3', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1341', 'is_default' => '1']);\n Process::create(['id' => '1369', 'name' => 'Припускание', 'coldproc' => '10', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '2', 'product_id' => '1342', 'is_default' => '1']);\n Process::create(['id' => '1370', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1343', 'is_default' => '1']);\n Process::create(['id' => '1371', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1343', 'is_default' => '0']);\n Process::create(['id' => '1372', 'name' => 'Варка из замороженых', 'coldproc' => '6', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '1']);\n Process::create(['id' => '1373', 'name' => 'Жарка из замороженых', 'coldproc' => '6', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1374', 'name' => 'Котлеты', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1375', 'name' => 'Жарка панированных п/ф', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1376', 'name' => 'Пассерование', 'coldproc' => '22', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1355', 'is_default' => '0']);\n Process::create(['id' => '1377', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1356', 'is_default' => '1']);\n Process::create(['id' => '1378', 'name' => 'Варка со сливом', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1356', 'is_default' => '0']);\n Process::create(['id' => '1379', 'name' => 'Варка целиком', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1380', 'name' => 'Жарка ломтиками из сырых', 'coldproc' => '0', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '1']);\n Process::create(['id' => '1382', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '53', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1362', 'is_default' => '0']);\n Process::create(['id' => '1383', 'name' => 'Котлеты', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1362', 'is_default' => '0']);\n Process::create(['id' => '1385', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1363', 'is_default' => '0']);\n Process::create(['id' => '1387', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1364', 'is_default' => '1']);\n Process::create(['id' => '1390', 'name' => 'Припускание', 'coldproc' => '26', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1365', 'is_default' => '1']);\n Process::create(['id' => '1392', 'name' => 'Варка', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1367', 'is_default' => '0']);\n Process::create(['id' => '1393', 'name' => 'Припускание', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1367', 'is_default' => '0']);\n Process::create(['id' => '1394', 'name' => 'Отварная непластованная кусками', 'coldproc' => '42', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1395', 'name' => 'Жареная непластованная кусками', 'coldproc' => '42', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '1']);\n Process::create(['id' => '1398', 'name' => 'Запекание с удаленными семенами', 'coldproc' => '12', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1408', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1240', 'is_default' => '0']);\n Process::create(['id' => '1409', 'name' => 'Жарка стейка (Well Done) и мелкими кусочками', 'coldproc' => '6', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1055', 'is_default' => '1']);\n Process::create(['id' => '1410', 'name' => 'Жарка в панировке', 'coldproc' => '6', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1055', 'is_default' => '0']);\n Process::create(['id' => '1411', 'name' => 'Жарка в сухарях', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1412', 'name' => 'Жарка в сухарях (Н. Зеландия, Австралия)', 'coldproc' => '24', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1413', 'name' => 'Жарка в сухарях', 'coldproc' => '0', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1019', 'is_default' => '0']);\n Process::create(['id' => '1414', 'name' => 'Жарка в панировке', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1277', 'is_default' => '0']);\n Process::create(['id' => '1415', 'name' => 'Жарка в сухарях', 'coldproc' => '4', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '1416', 'name' => 'Жарка в сухарях', 'coldproc' => '5', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '1417', 'name' => 'Жарка мороженых', 'coldproc' => '20', 'hotproc' => '25', 'finalproc' => '8', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1418', 'name' => 'Варка мороженых', 'coldproc' => '20', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1060', 'is_default' => '0']);\n Process::create(['id' => '1419', 'name' => 'Варка мороженых', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '14', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1058', 'is_default' => '1']);\n Process::create(['id' => '1420', 'name' => 'Жарка мороженых', 'coldproc' => '14', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1421', 'name' => 'Варка мороженых', 'coldproc' => '14', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1061', 'is_default' => '0']);\n Process::create(['id' => '1422', 'name' => 'Варка замороженных', 'coldproc' => '10', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1423', 'name' => 'Жарка замороженных', 'coldproc' => '10', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1424', 'name' => 'Жарка в сухарях замороженных', 'coldproc' => '10', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '5', 'product_id' => '1281', 'is_default' => '0']);\n Process::create(['id' => '1425', 'name' => 'Жарка замороженной', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1426', 'name' => 'Тушение замороженной', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1062', 'is_default' => '0']);\n Process::create(['id' => '1427', 'name' => 'Жарка мороженой', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1428', 'name' => 'Тушение мороженой', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1021', 'is_default' => '0']);\n Process::create(['id' => '1430', 'name' => 'Жарка разрезанных', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1273', 'is_default' => '0']);\n Process::create(['id' => '1431', 'name' => 'Жарка разрезанных', 'coldproc' => '3', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1272', 'is_default' => '0']);\n Process::create(['id' => '1432', 'name' => 'Жарка фри панированных п/ф', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1433', 'name' => 'Разделка на филе + жарка', 'coldproc' => '52', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1226', 'is_default' => '0']);\n Process::create(['id' => '1434', 'name' => 'Варка филе с кожей и костями', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1435', 'name' => 'Жарка филе с кожей и костями', 'coldproc' => '27', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1436', 'name' => 'Варка филе с кожей без костей', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1437', 'name' => 'Жарка филе (по СТН) с кожей без костей', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1438', 'name' => 'Жареный непластованный', 'coldproc' => '40', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1123', 'is_default' => '0']);\n Process::create(['id' => '1439', 'name' => 'Отварной филе с кожей и костями', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1440', 'name' => 'Жареный филе с кожей и костями', 'coldproc' => '47', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1441', 'name' => 'Отварной филе с кожей без костей', 'coldproc' => '51', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1442', 'name' => 'Жареный филе с кожей без костей', 'coldproc' => '51', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '1']);\n Process::create(['id' => '1443', 'name' => 'Отварной филе с кожей и костями', 'coldproc' => '46', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1444', 'name' => 'Жареный филе с кожей и костями', 'coldproc' => '46', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1445', 'name' => 'Отварной филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1446', 'name' => 'Жареный филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1159', 'is_default' => '0']);\n Process::create(['id' => '1447', 'name' => 'Отварной с кожей и костями', 'coldproc' => '48', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1448', 'name' => 'Жареный с кожей и костями', 'coldproc' => '48', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1449', 'name' => 'Отварной с кожей без костей', 'coldproc' => '50', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '0']);\n Process::create(['id' => '1450', 'name' => 'Жареный с кожей без костей', 'coldproc' => '50', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1306', 'is_default' => '1']);\n Process::create(['id' => '1451', 'name' => 'Отварной с кожей и костями', 'coldproc' => '45', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1452', 'name' => 'Жареный с кожей и костями', 'coldproc' => '45', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1453', 'name' => 'Припущенный с кожей без костей', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1454', 'name' => 'Жареный с кожей без костей', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1455', 'name' => 'Припущенный без кожи и костей', 'coldproc' => '52', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1456', 'name' => 'Жареный без кожи и костей', 'coldproc' => '52', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1457', 'name' => 'Припущенный неглазированный льдом', 'coldproc' => '14', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1458', 'name' => 'Жареный неглазированный льдом', 'coldproc' => '14', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '1']);\n Process::create(['id' => '1459', 'name' => 'Отварная филе с кожей и костями', 'coldproc' => '49', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1460', 'name' => 'Жареная филе с кожей и костями', 'coldproc' => '49', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1461', 'name' => 'Припущенная филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1462', 'name' => 'Жареная филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1463', 'name' => 'Запеченный целиком', 'coldproc' => '5', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '1']);\n Process::create(['id' => '1464', 'name' => 'Варка порционными кусками', 'coldproc' => '10', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1382', 'is_default' => '0']);\n Process::create(['id' => '1465', 'name' => 'Жарка порционными кусками', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1382', 'is_default' => '1']);\n Process::create(['id' => '1466', 'name' => 'Отварной в кожуре с последующей очисткой', 'coldproc' => '0', 'hotproc' => '3', 'finalproc' => '35', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1467', 'name' => 'Жареный из предв. отваренного', 'coldproc' => '35', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1468', 'name' => 'Жареный до полуготовности для рагу', 'coldproc' => '35', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1469', 'name' => 'Жареный фри брусочками', 'coldproc' => '35', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1470', 'name' => 'Жареный фри соломкой', 'coldproc' => '35', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1471', 'name' => 'Жареный чипсами', 'coldproc' => '35', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '10', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1472', 'name' => 'Печеный в кожуре', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1473', 'name' => 'Печеный в кожуре с посл. очисткой', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1474', 'name' => 'Молодой очищенный отварной', 'coldproc' => '20', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1475', 'name' => 'Молодой неочищенный отварной', 'coldproc' => '5', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '5', 'ch' => '9', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1476', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1383', 'is_default' => '1']);\n Process::create(['id' => '1477', 'name' => 'Жареные кружочками очищенные', 'coldproc' => '15', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1478', 'name' => 'Жареные в панировке', 'coldproc' => '5', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '1']);\n Process::create(['id' => '1479', 'name' => 'Жареные в панировке очищенные', 'coldproc' => '15', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1480', 'name' => 'варка', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1070', 'is_default' => '1']);\n Process::create(['id' => '1481', 'name' => 'Очистка', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1117', 'is_default' => '1']);\n Process::create(['id' => '1482', 'name' => 'Шинкованная, стертая с солью', 'coldproc' => '20', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1117', 'is_default' => '0']);\n Process::create(['id' => '1483', 'name' => 'Жаренные ломтиками с кожицей, панированные', 'coldproc' => '10', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1484', 'name' => 'Жаренные без кожицы, панированные', 'coldproc' => '20', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '1485', 'name' => 'Очищенный', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1165', 'is_default' => '1']);\n Process::create(['id' => '1486', 'name' => 'Жаренный фри кольцами', 'coldproc' => '16', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1165', 'is_default' => '0']);\n Process::create(['id' => '1487', 'name' => 'Очищенный', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1163', 'is_default' => '1']);\n Process::create(['id' => '1488', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1489', 'name' => 'Без очистки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '1']);\n Process::create(['id' => '1490', 'name' => 'С очисткой кожуры', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1491', 'name' => 'Тепличные без очистки', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1492', 'name' => 'Без очистки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1214', 'is_default' => '1']);\n Process::create(['id' => '1493', 'name' => 'С очисткой', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1494', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1227', 'is_default' => '1']);\n Process::create(['id' => '1495', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1233', 'is_default' => '1']);\n Process::create(['id' => '1496', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '1']);\n Process::create(['id' => '1497', 'name' => 'Холодная обработка', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1334', 'is_default' => '1']);\n Process::create(['id' => '1498', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1333', 'is_default' => '1']);\n Process::create(['id' => '1499', 'name' => 'Холодная обработка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1258', 'is_default' => '1']);\n Process::create(['id' => '1500', 'name' => 'Очищенный от ботвы', 'coldproc' => '37', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '0']);\n Process::create(['id' => '1501', 'name' => 'Очищенный от короткой ботвы (до 3см) с кожицей', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '1']);\n Process::create(['id' => '1502', 'name' => 'Без ботвы, очищенный от кожицы', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1259', 'is_default' => '0']);\n Process::create(['id' => '1504', 'name' => 'Очистка', 'coldproc' => '30', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1260', 'is_default' => '1']);\n Process::create(['id' => '1505', 'name' => 'Листовой холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1271', 'is_default' => '1']);\n Process::create(['id' => '1506', 'name' => 'Кочанный холодная обработка', 'coldproc' => '33', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1271', 'is_default' => '0']);\n Process::create(['id' => '1507', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1284', 'is_default' => '1']);\n Process::create(['id' => '1508', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1339', 'is_default' => '1']);\n Process::create(['id' => '1509', 'name' => 'Очистка', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1348', 'is_default' => '1']);\n Process::create(['id' => '1510', 'name' => 'Очистка', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1355', 'is_default' => '1']);\n Process::create(['id' => '1512', 'name' => 'Сырые для салата', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1513', 'name' => 'Удаление косточки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1001', 'is_default' => '1']);\n Process::create(['id' => '1514', 'name' => 'Удаление косточки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1007', 'is_default' => '1']);\n Process::create(['id' => '1515', 'name' => 'Очищенный с сердцевиной', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '1']);\n Process::create(['id' => '1516', 'name' => 'Очищенный без сердцевины', 'coldproc' => '45', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1517', 'name' => 'Очищенный от кожуры', 'coldproc' => '33', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '0']);\n Process::create(['id' => '1518', 'name' => 'Получение сока', 'coldproc' => '56', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '0']);\n Process::create(['id' => '1519', 'name' => 'Нарезанный на порции', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1013', 'is_default' => '1']);\n Process::create(['id' => '1520', 'name' => 'Очищенный от коры и семян', 'coldproc' => '48', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1013', 'is_default' => '0']);\n Process::create(['id' => '1521', 'name' => 'Удаление семян', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1004', 'is_default' => '1']);\n Process::create(['id' => '1522', 'name' => 'Очистка от кожицы с удалением семян', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1004', 'is_default' => '0']);\n Process::create(['id' => '1523', 'name' => 'Очистка от кожуры', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1017', 'is_default' => '1']);\n Process::create(['id' => '1524', 'name' => 'Свежая, холодная обработка', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1030', 'is_default' => '1']);\n Process::create(['id' => '1526', 'name' => 'Потери на горбыльки', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '1']);\n Process::create(['id' => '1527', 'name' => 'Получение сока (по СТН)', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '0']);\n Process::create(['id' => '1528', 'name' => 'Переборка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1048', 'is_default' => '1']);\n Process::create(['id' => '1529', 'name' => 'Удаление плодоножки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1530', 'name' => 'Удаление косточки', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '1']);\n Process::create(['id' => '1531', 'name' => 'Очистка', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1071', 'is_default' => '1']);\n Process::create(['id' => '1532', 'name' => 'Удаление семян', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1080', 'is_default' => '1']);\n Process::create(['id' => '1533', 'name' => 'Удаление семян и кожицы', 'coldproc' => '27', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1534', 'name' => 'Варка с удалением семян', 'coldproc' => '10', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1535', 'name' => 'Варка с удалением семян и кожицы', 'coldproc' => '27', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1536', 'name' => 'Очистка от семян', 'coldproc' => '23', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1089', 'is_default' => '0']);\n Process::create(['id' => '1537', 'name' => 'Очистка от коры и семян', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1089', 'is_default' => '1']);\n Process::create(['id' => '1538', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1090', 'is_default' => '1']);\n Process::create(['id' => '1539', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1097', 'is_default' => '1']);\n Process::create(['id' => '1540', 'name' => 'Сок с мякотью', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1097', 'is_default' => '0']);\n Process::create(['id' => '1541', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1132', 'is_default' => '1']);\n Process::create(['id' => '1542', 'name' => 'Получение сока', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1132', 'is_default' => '0']);\n Process::create(['id' => '1543', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1151', 'is_default' => '1']);\n Process::create(['id' => '1544', 'name' => 'Очистка оснований', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '1']);\n Process::create(['id' => '1545', 'name' => 'Очистка от кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '0']);\n Process::create(['id' => '1546', 'name' => 'Получение сока', 'coldproc' => '58', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1160', 'is_default' => '0']);\n Process::create(['id' => '1547', 'name' => 'Холодная обработка', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1170', 'is_default' => '1']);\n Process::create(['id' => '1549', 'name' => 'Очищенные', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1171', 'is_default' => '1']);\n Process::create(['id' => '1550', 'name' => 'Получение сока', 'coldproc' => '43', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1171', 'is_default' => '0']);\n Process::create(['id' => '1551', 'name' => 'Удаление косточки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1231', 'is_default' => '1']);\n Process::create(['id' => '1552', 'name' => 'Удаление косточки', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1289', 'is_default' => '1']);\n Process::create(['id' => '1553', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1302', 'is_default' => '1']);\n Process::create(['id' => '1554', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1303', 'is_default' => '1']);\n Process::create(['id' => '1555', 'name' => 'Получение сока', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1303', 'is_default' => '0']);\n Process::create(['id' => '1556', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1353', 'is_default' => '1']);\n Process::create(['id' => '1557', 'name' => 'Получение сока', 'coldproc' => '41', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1353', 'is_default' => '0']);\n Process::create(['id' => '1558', 'name' => 'Удаление плодоножки', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1352', 'is_default' => '0']);\n Process::create(['id' => '1559', 'name' => 'Удаление косточки', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1352', 'is_default' => '1']);\n Process::create(['id' => '1560', 'name' => 'Запекание с очисткой от кожицы и уд. семян', 'coldproc' => '30', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1561', 'name' => 'Очистка от кожицы и семян', 'coldproc' => '30', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1562', 'name' => 'Очистка от семян', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '1']);\n Process::create(['id' => '1563', 'name' => 'Очистка от скорлупы', 'coldproc' => '63', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1386', 'is_default' => '1']);\n Process::create(['id' => '1564', 'name' => 'Филе без кожи и костей', 'coldproc' => '31', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1066', 'is_default' => '1']);\n Process::create(['id' => '1565', 'name' => 'Филе с кожей и костями', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1066', 'is_default' => '0']);\n Process::create(['id' => '1566', 'name' => 'Разделка на филе', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1270', 'is_default' => '1']);\n Process::create(['id' => '1567', 'name' => 'Неразделанная', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1270', 'is_default' => '0']);\n Process::create(['id' => '1568', 'name' => 'Крупная разделка на филе', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '1']);\n Process::create(['id' => '1569', 'name' => 'Средняя разделка на филе', 'coldproc' => '52', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1570', 'name' => 'Крупная без кожи с костями', 'coldproc' => '38', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1571', 'name' => 'Средняя без кожи с костями', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1572', 'name' => 'Разделка на филе с костями и икрой', 'coldproc' => '47', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1051', 'is_default' => '1']);\n Process::create(['id' => '1573', 'name' => 'Разделка на филе без кожи с костями (Крупный)', 'coldproc' => '46', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '1']);\n Process::create(['id' => '1574', 'name' => 'Разделка на филе без кожи с костями (Средний)', 'coldproc' => '48', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1575', 'name' => 'Разделка на филе без кожи с костями (Мелкий)', 'coldproc' => '50', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1576', 'name' => 'Разделка без кожи с костями', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1288', 'is_default' => '1']);\n Process::create(['id' => '1577', 'name' => 'Разделка на филе без кожи и костей', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1288', 'is_default' => '0']);\n Process::create(['id' => '1578', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1033', 'is_default' => '1']);\n Process::create(['id' => '1579', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1034', 'is_default' => '1']);\n Process::create(['id' => '1580', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1035', 'is_default' => '1']);\n Process::create(['id' => '1581', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1036', 'is_default' => '1']);\n Process::create(['id' => '1582', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1249', 'is_default' => '1']);\n Process::create(['id' => '1583', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1250', 'is_default' => '0']);\n Process::create(['id' => '1584', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1317', 'is_default' => '1']);\n Process::create(['id' => '1585', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1318', 'is_default' => '1']);\n Process::create(['id' => '1586', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1387', 'is_default' => '1']);\n Process::create(['id' => '1587', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1363', 'is_default' => '1']);\n Process::create(['id' => '1588', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1076', 'is_default' => '0']);\n Process::create(['id' => '1589', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1139', 'is_default' => '0']);\n Process::create(['id' => '1590', 'name' => 'Холодная обработка', 'coldproc' => '8', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1319', 'is_default' => '1']);\n Process::create(['id' => '1591', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1320', 'is_default' => '1']);\n Process::create(['id' => '1592', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1240', 'is_default' => '1']);\n Process::create(['id' => '1594', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1321', 'is_default' => '1']);\n Process::create(['id' => '1595', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1256', 'is_default' => '1']);\n Process::create(['id' => '1596', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1257', 'is_default' => '1']);\n Process::create(['id' => '1597', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1256', 'is_default' => '0']);\n Process::create(['id' => '1598', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1257', 'is_default' => '0']);\n Process::create(['id' => '1599', 'name' => 'Без обработки или варка в скорлупе', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1378', 'is_default' => '1']);\n Process::create(['id' => '1600', 'name' => 'Жарка (Глазунья)', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1601', 'name' => 'Жарка (Омлет)', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1602', 'name' => 'Варка без скорлупы', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1603', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1379', 'is_default' => '1']);\n Process::create(['id' => '1604', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1379', 'is_default' => '0']);\n Process::create(['id' => '1605', 'name' => 'Варка без скорлупы', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1379', 'is_default' => '0']);\n Process::create(['id' => '1606', 'name' => 'Удаление скорлупы', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1378', 'is_default' => '0']);\n Process::create(['id' => '1607', 'name' => 'Очистка от кожуры и косточки', 'coldproc' => '47', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1388', 'is_default' => '1']);\n Process::create(['id' => '1608', 'name' => 'Без тепловой обработки', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1391', 'is_default' => '1']);\n Process::create(['id' => '1609', 'name' => 'Обжарка', 'coldproc' => '3', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1391', 'is_default' => '0']);\n Process::create(['id' => '1610', 'name' => 'Мини - ананас, выход мякоти', 'coldproc' => '78', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1611', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1392', 'is_default' => '1']);\n Process::create(['id' => '1612', 'name' => 'Удаление кожи и хрящей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1016', 'is_default' => '1']);\n Process::create(['id' => '1613', 'name' => 'Удаление кожи и костей', 'coldproc' => '19', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1393', 'is_default' => '1']);\n Process::create(['id' => '1614', 'name' => 'Удаление кожи и костей', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1394', 'is_default' => '1']);\n Process::create(['id' => '1615', 'name' => 'Удаление кожи и костей', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1395', 'is_default' => '1']);\n Process::create(['id' => '1616', 'name' => 'Жарка', 'coldproc' => '18', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1396', 'is_default' => '1']);\n Process::create(['id' => '1617', 'name' => 'Запекание с удалением кости', 'coldproc' => '34', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1397', 'is_default' => '1']);\n Process::create(['id' => '1618', 'name' => 'Запекание с костью', 'coldproc' => '5', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1397', 'is_default' => '0']);\n Process::create(['id' => '1619', 'name' => 'Жарка (Россия)', 'coldproc' => '35', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1620', 'name' => 'Жарка в сухарях (Россия)', 'coldproc' => '35', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1621', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1398', 'is_default' => '1']);\n Process::create(['id' => '1622', 'name' => 'Запекание для сухариков (кубик)', 'coldproc' => '7', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1022', 'is_default' => '0']);\n Process::create(['id' => '1623', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1022', 'is_default' => '1']);\n Process::create(['id' => '1625', 'name' => 'Удаление мякоти', 'coldproc' => '54', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1031', 'is_default' => '0']);\n Process::create(['id' => '1626', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1045', 'is_default' => '1']);\n Process::create(['id' => '1627', 'name' => 'Удаление шкуры и жира', 'coldproc' => '22', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1407', 'is_default' => '1']);\n Process::create(['id' => '1628', 'name' => 'Выпаривание', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1408', 'is_default' => '0']);\n Process::create(['id' => '1629', 'name' => 'Выпаривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1409', 'is_default' => '0']);\n Process::create(['id' => '1630', 'name' => 'Холодная обработка', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1411', 'is_default' => '1']);\n Process::create(['id' => '1631', 'name' => 'Получение сока (контрольная проработка)', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '31', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1046', 'is_default' => '0']);\n Process::create(['id' => '1632', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '1']);\n Process::create(['id' => '1633', 'name' => 'Потери при разморозке и порционировании', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1417', 'is_default' => '1']);\n Process::create(['id' => '1634', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1418', 'is_default' => '1']);\n Process::create(['id' => '1635', 'name' => 'Жарка стейка (Well Done)', 'coldproc' => '7', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1419', 'is_default' => '1']);\n Process::create(['id' => '1636', 'name' => 'Холодная обработка (Карпаччо)', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1637', 'name' => 'На кости з/т часть - жарка, удаление кости', 'coldproc' => '22', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1638', 'name' => 'На кости з/т часть - варка, удаление кости', 'coldproc' => '22', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1639', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1420', 'is_default' => '1']);\n Process::create(['id' => '1640', 'name' => 'Жарка филе (по Контр.) с уд. костей', 'coldproc' => '58', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1064', 'is_default' => '1']);\n Process::create(['id' => '1641', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1422', 'is_default' => '1']);\n Process::create(['id' => '1642', 'name' => 'Получение сока', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '48', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1073', 'is_default' => '1']);\n Process::create(['id' => '1643', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1423', 'is_default' => '1']);\n Process::create(['id' => '1644', 'name' => 'Жарка', 'coldproc' => '15', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1424', 'is_default' => '1']);\n Process::create(['id' => '1645', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1425', 'is_default' => '1']);\n Process::create(['id' => '1646', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1426', 'is_default' => '1']);\n Process::create(['id' => '1647', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1427', 'is_default' => '1']);\n Process::create(['id' => '1648', 'name' => 'Жарка дольками (Контр. прораб.)', 'coldproc' => '0', 'hotproc' => '39', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1649', 'name' => 'Жарка Фри тонкими ломтиками', 'coldproc' => '4', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1076', 'is_default' => '0']);\n Process::create(['id' => '1650', 'name' => 'Жарка Фри (ломтиками)', 'coldproc' => '0', 'hotproc' => '62', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1139', 'is_default' => '0']);\n Process::create(['id' => '1651', 'name' => 'Запекание в соли с головой и хребтом', 'coldproc' => '24', 'hotproc' => '15', 'finalproc' => '9', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '1']);\n Process::create(['id' => '1652', 'name' => 'Жарка, запекание в составе блюда', 'coldproc' => '29', 'hotproc' => '55', 'finalproc' => '0', 'grease' => '53', 'ch' => '0', 'protein' => '10', 'product_id' => '1431', 'is_default' => '1']);\n Process::create(['id' => '1653', 'name' => 'Холодная обработка', 'coldproc' => '27', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1432', 'is_default' => '1']);\n Process::create(['id' => '1654', 'name' => 'Холодная обработка', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1433', 'is_default' => '1']);\n Process::create(['id' => '1655', 'name' => 'Холодная обработка', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1434', 'is_default' => '1']);\n Process::create(['id' => '1656', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1435', 'is_default' => '1']);\n Process::create(['id' => '1657', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1438', 'is_default' => '1']);\n Process::create(['id' => '1658', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1441', 'is_default' => '1']);\n Process::create(['id' => '1659', 'name' => 'Холодная обработка для суши', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1442', 'is_default' => '1']);\n Process::create(['id' => '1660', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1443', 'is_default' => '1']);\n Process::create(['id' => '1661', 'name' => 'Удаление основания', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1444', 'is_default' => '1']);\n Process::create(['id' => '1662', 'name' => 'Удаление всей жесткой части', 'coldproc' => '59', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1444', 'is_default' => '0']);\n Process::create(['id' => '1663', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1445', 'is_default' => '1']);\n Process::create(['id' => '1664', 'name' => 'Молодой неочищенный жареный дольками', 'coldproc' => '5', 'hotproc' => '34', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1125', 'is_default' => '0']);\n Process::create(['id' => '1665', 'name' => 'Жарка глазированного льдом', 'coldproc' => '18', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1447', 'is_default' => '1']);\n Process::create(['id' => '1666', 'name' => 'Очистка', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '1']);\n Process::create(['id' => '1667', 'name' => 'Получение сока', 'coldproc' => '21', 'hotproc' => '0', 'finalproc' => '46', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '0']);\n Process::create(['id' => '1668', 'name' => 'Нарезка шариками', 'coldproc' => '60', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1448', 'is_default' => '0']);\n Process::create(['id' => '1669', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1452', 'is_default' => '1']);\n Process::create(['id' => '1670', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1454', 'is_default' => '1']);\n Process::create(['id' => '1671', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1455', 'is_default' => '1']);\n Process::create(['id' => '1672', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '52', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1203', 'is_default' => '1']);\n Process::create(['id' => '1673', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '52', 'finalproc' => '51', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1203', 'is_default' => '0']);\n Process::create(['id' => '1674', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '57', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1458', 'is_default' => '1']);\n Process::create(['id' => '1675', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '40', 'finalproc' => '10', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1459', 'is_default' => '1']);\n Process::create(['id' => '1676', 'name' => 'Жарка мякоти', 'coldproc' => '10', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1148', 'is_default' => '0']);\n Process::create(['id' => '1677', 'name' => 'Жарка', 'coldproc' => '31', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1460', 'is_default' => '1']);\n Process::create(['id' => '1678', 'name' => 'Жарка из свежемороженных', 'coldproc' => '25', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1679', 'name' => 'Жарка из охлажденных', 'coldproc' => '12', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '1']);\n Process::create(['id' => '1680', 'name' => 'Жарка из охл. с предв. запеканием', 'coldproc' => '12', 'hotproc' => '12', 'finalproc' => '31', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1681', 'name' => 'Варка в пароконвектомате', 'coldproc' => '6', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1682', 'name' => 'Варка', 'coldproc' => '41', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1463', 'is_default' => '1']);\n Process::create(['id' => '1683', 'name' => 'Варка в пароконвектомате', 'coldproc' => '41', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1463', 'is_default' => '0']);\n Process::create(['id' => '1684', 'name' => 'Разделка на мякоть с кожей и запекание', 'coldproc' => '47', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1685', 'name' => 'Обработка для суши', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1464', 'is_default' => '1']);\n Process::create(['id' => '1686', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1465', 'is_default' => '1']);\n Process::create(['id' => '1687', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1466', 'is_default' => '1']);\n Process::create(['id' => '1688', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1466', 'is_default' => '0']);\n Process::create(['id' => '1689', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1467', 'is_default' => '1']);\n Process::create(['id' => '1691', 'name' => 'Варка \"Аль денте\"', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1169', 'is_default' => '1']);\n Process::create(['id' => '1692', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1477', 'is_default' => '1']);\n Process::create(['id' => '1693', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1478', 'is_default' => '1']);\n Process::create(['id' => '1694', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1479', 'is_default' => '1']);\n Process::create(['id' => '1695', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1480', 'is_default' => '1']);\n Process::create(['id' => '1696', 'name' => 'Варка Аль Денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1481', 'is_default' => '1']);\n Process::create(['id' => '1697', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1482', 'is_default' => '1']);\n Process::create(['id' => '1698', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1495', 'is_default' => '1']);\n Process::create(['id' => '1699', 'name' => 'Получение сока', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '57', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1196', 'is_default' => '0']);\n Process::create(['id' => '1700', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '26', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1498', 'is_default' => '1']);\n Process::create(['id' => '1701', 'name' => 'Жарка фарша с холодной обработкой', 'coldproc' => '26', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '1702', 'name' => 'Жарка', 'coldproc' => '24', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1504', 'is_default' => '1']);\n Process::create(['id' => '1703', 'name' => 'Варка (% по белым грибам)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1426', 'is_default' => '0']);\n Process::create(['id' => '1704', 'name' => 'Потери при хранении', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1327', 'is_default' => '1']);\n Process::create(['id' => '1705', 'name' => 'Потери при переборке', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1002', 'is_default' => '1']);\n Process::create(['id' => '1706', 'name' => 'Варка (по контрольной проработке)', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1059', 'is_default' => '0']);\n Process::create(['id' => '1707', 'name' => 'Варка', 'coldproc' => '4', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1424', 'is_default' => '0']);\n Process::create(['id' => '1708', 'name' => 'Замачивание в кипятке (контрольная)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1290', 'is_default' => '1']);\n Process::create(['id' => '1709', 'name' => 'потери при порцион. (Контрольная)', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1521', 'is_default' => '1']);\n Process::create(['id' => '1710', 'name' => 'Обжарка (Контрольная прораб.)', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1372', 'is_default' => '1']);\n Process::create(['id' => '1711', 'name' => 'Обжарка (контрольная)', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1526', 'is_default' => '1']);\n Process::create(['id' => '1712', 'name' => 'Замачивание кипятком', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1002', 'is_default' => '0']);\n Process::create(['id' => '1713', 'name' => 'Переборка (Контрольная проработка)', 'coldproc' => '1', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1290', 'is_default' => '0']);\n Process::create(['id' => '1714', 'name' => 'Жарка охлажденных', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1715', 'name' => 'Жарка из сырых (Контрольная по ТУ)', 'coldproc' => '24', 'hotproc' => '51', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1357', 'is_default' => '0']);\n Process::create(['id' => '1716', 'name' => 'Жарка', 'coldproc' => '20', 'hotproc' => '10', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1530', 'is_default' => '1']);\n Process::create(['id' => '1717', 'name' => 'Жарка глазированного льдом', 'coldproc' => '41', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1531', 'is_default' => '1']);\n Process::create(['id' => '1718', 'name' => 'Жарка глазированного льдом', 'coldproc' => '35', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1532', 'is_default' => '1']);\n Process::create(['id' => '1719', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1534', 'is_default' => '1']);\n Process::create(['id' => '1720', 'name' => 'Получение сока', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '25', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1212', 'is_default' => '0']);\n Process::create(['id' => '1721', 'name' => 'Варка с разделкой на мякоть из с/м', 'coldproc' => '43', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1722', 'name' => 'Жарка с разделкой на мякоть из с/м', 'coldproc' => '43', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1723', 'name' => 'Жарка глазированного льдом', 'coldproc' => '24', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '1']);\n Process::create(['id' => '1724', 'name' => 'Припускание глазированного льдом', 'coldproc' => '24', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1223', 'is_default' => '0']);\n Process::create(['id' => '1725', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '1537', 'is_default' => '1']);\n Process::create(['id' => '1726', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1536', 'is_default' => '1']);\n Process::create(['id' => '1727', 'name' => 'Получение сока', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '34', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1231', 'is_default' => '0']);\n Process::create(['id' => '1728', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1538', 'is_default' => '1']);\n Process::create(['id' => '1729', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1540', 'is_default' => '1']);\n Process::create(['id' => '1730', 'name' => 'Варка с разделкой на мякоть', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '89', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1540', 'is_default' => '0']);\n Process::create(['id' => '1731', 'name' => 'Обжарка', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1541', 'is_default' => '1']);\n Process::create(['id' => '1732', 'name' => 'Варка со сливом (Контрольная прораб.)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1734', 'name' => 'Варка со сливом (по Контрольной прораб.)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '10', 'protein' => '5', 'product_id' => '1264', 'is_default' => '0']);\n Process::create(['id' => '1735', 'name' => 'Варка для суши', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1542', 'is_default' => '1']);\n Process::create(['id' => '1736', 'name' => 'Разделка на филе с кожей и костями', 'coldproc' => '35', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1158', 'is_default' => '0']);\n Process::create(['id' => '1737', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1543', 'is_default' => '1']);\n Process::create(['id' => '1738', 'name' => 'Жарка', 'coldproc' => '20', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1546', 'is_default' => '1']);\n Process::create(['id' => '1739', 'name' => 'Тушение', 'coldproc' => '20', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1546', 'is_default' => '0']);\n Process::create(['id' => '1740', 'name' => 'Удаление кости, запекание с предв. варкой', 'coldproc' => '40', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1547', 'is_default' => '1']);\n Process::create(['id' => '1741', 'name' => 'Запекание с предв. варкой на кости', 'coldproc' => '5', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1547', 'is_default' => '0']);\n Process::create(['id' => '1742', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1548', 'is_default' => '1']);\n Process::create(['id' => '1743', 'name' => 'Жарка чипсами', 'coldproc' => '32', 'hotproc' => '75', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1744', 'name' => 'Получение сока (из стеблей)', 'coldproc' => '44', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1284', 'is_default' => '0']);\n Process::create(['id' => '1745', 'name' => 'Филе в масле дозачистка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1286', 'is_default' => '0']);\n Process::create(['id' => '1746', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1549', 'is_default' => '1']);\n Process::create(['id' => '1747', 'name' => 'Жарка', 'coldproc' => '3', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1550', 'is_default' => '1']);\n Process::create(['id' => '1748', 'name' => 'Жарка филе с кожей без костей', 'coldproc' => '37', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '1']);\n Process::create(['id' => '1749', 'name' => 'Разделка для суши, роллов', 'coldproc' => '44', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1750', 'name' => 'Запекание целиком', 'coldproc' => '14', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1751', 'name' => 'Приготовление на пару', 'coldproc' => '18', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1552', 'is_default' => '1']);\n Process::create(['id' => '1752', 'name' => 'Уваривание в соусе', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1556', 'is_default' => '1']);\n Process::create(['id' => '1753', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '5', 'product_id' => '1556', 'is_default' => '0']);\n Process::create(['id' => '1754', 'name' => 'Уваривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1291', 'is_default' => '0']);\n Process::create(['id' => '1755', 'name' => 'Уваривание для соуса', 'coldproc' => '0', 'hotproc' => '66', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1293', 'is_default' => '0']);\n Process::create(['id' => '1756', 'name' => 'жарка', 'coldproc' => '0', 'hotproc' => '29', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1557', 'is_default' => '1']);\n Process::create(['id' => '1757', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1000', 'is_default' => '0']);\n Process::create(['id' => '1758', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1011', 'is_default' => '0']);\n Process::create(['id' => '1759', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '85', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1232', 'is_default' => '0']);\n Process::create(['id' => '1760', 'name' => 'Выпаривание для фруктового соуса', 'coldproc' => '0', 'hotproc' => '85', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1295', 'is_default' => '0']);\n Process::create(['id' => '1761', 'name' => 'Припускание свежемороженой зеленой', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '2', 'product_id' => '1310', 'is_default' => '0']);\n Process::create(['id' => '1762', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '15', 'protein' => '5', 'product_id' => '1568', 'is_default' => '1']);\n Process::create(['id' => '1763', 'name' => 'Припущенный глазированный льдом', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1764', 'name' => 'Жареный глазированный льдом', 'coldproc' => '27', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1381', 'is_default' => '0']);\n Process::create(['id' => '1765', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1595', 'is_default' => '1']);\n Process::create(['id' => '1766', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1596', 'is_default' => '1']);\n Process::create(['id' => '1767', 'name' => 'Холодная обработка', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1597', 'is_default' => '1']);\n Process::create(['id' => '1768', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1598', 'is_default' => '1']);\n Process::create(['id' => '1769', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1599', 'is_default' => '1']);\n Process::create(['id' => '1770', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1600', 'is_default' => '1']);\n Process::create(['id' => '1771', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1601', 'is_default' => '1']);\n Process::create(['id' => '1772', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1602', 'is_default' => '1']);\n Process::create(['id' => '1773', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1603', 'is_default' => '1']);\n Process::create(['id' => '1774', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1604', 'is_default' => '1']);\n Process::create(['id' => '1775', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1605', 'is_default' => '1']);\n Process::create(['id' => '1776', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1606', 'is_default' => '1']);\n Process::create(['id' => '1777', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1607', 'is_default' => '0']);\n Process::create(['id' => '1778', 'name' => 'Запекание', 'coldproc' => '4', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1607', 'is_default' => '1']);\n Process::create(['id' => '1779', 'name' => 'Холодная обработка', 'coldproc' => '18', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1608', 'is_default' => '1']);\n Process::create(['id' => '1781', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1322', 'is_default' => '1']);\n Process::create(['id' => '1782', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1609', 'is_default' => '1']);\n Process::create(['id' => '1783', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1610', 'is_default' => '1']);\n Process::create(['id' => '1784', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1612', 'is_default' => '1']);\n Process::create(['id' => '1785', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1613', 'is_default' => '1']);\n Process::create(['id' => '1786', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1324', 'is_default' => '1']);\n Process::create(['id' => '1787', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1239', 'is_default' => '1']);\n Process::create(['id' => '1788', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1202', 'is_default' => '1']);\n Process::create(['id' => '1789', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1323', 'is_default' => '1']);\n Process::create(['id' => '1791', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1614', 'is_default' => '1']);\n Process::create(['id' => '1792', 'name' => 'Запекание', 'coldproc' => '5', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1615', 'is_default' => '1']);\n Process::create(['id' => '1793', 'name' => 'Жарка (глазированного льдом)', 'coldproc' => '39', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1616', 'is_default' => '1']);\n Process::create(['id' => '1794', 'name' => 'Жарка филе с кожей без костей', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1617', 'is_default' => '1']);\n Process::create(['id' => '1795', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1618', 'is_default' => '1']);\n Process::create(['id' => '1796', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1618', 'is_default' => '0']);\n Process::create(['id' => '1797', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1335', 'is_default' => '1']);\n Process::create(['id' => '1798', 'name' => 'Обработка для суши', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1336', 'is_default' => '1']);\n Process::create(['id' => '1799', 'name' => 'Обработка для суши, роллов', 'coldproc' => '13', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1629', 'is_default' => '1']);\n Process::create(['id' => '1800', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1631', 'is_default' => '1']);\n Process::create(['id' => '1801', 'name' => 'Выпаривание для декорирования', 'coldproc' => '0', 'hotproc' => '75', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1631', 'is_default' => '0']);\n Process::create(['id' => '1802', 'name' => 'Жарка (Магре, Франция)', 'coldproc' => '4', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1632', 'is_default' => '1']);\n Process::create(['id' => '1803', 'name' => 'Жарка (Китай)', 'coldproc' => '0', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1632', 'is_default' => '0']);\n Process::create(['id' => '1804', 'name' => 'Припускание свежемороженой', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '2', 'product_id' => '1342', 'is_default' => '0']);\n Process::create(['id' => '1805', 'name' => 'Варка на пару', 'coldproc' => '31', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '20', 'protein' => '5', 'product_id' => '1633', 'is_default' => '1']);\n Process::create(['id' => '1806', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '1']);\n Process::create(['id' => '1807', 'name' => 'Жарка эскалопом без панировки', 'coldproc' => '4', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1636', 'is_default' => '1']);\n Process::create(['id' => '1808', 'name' => 'Без обработки', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1346', 'is_default' => '1']);\n Process::create(['id' => '1809', 'name' => 'Удаление мякоти', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1346', 'is_default' => '0']);\n Process::create(['id' => '1810', 'name' => 'Жарка фри', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1638', 'is_default' => '1']);\n Process::create(['id' => '1812', 'name' => 'Нарезка шариками', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '60', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1813', 'name' => 'Обжаренные кубиком для штруделя', 'coldproc' => '30', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1814', 'name' => 'Получение сока', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '33', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1369', 'is_default' => '0']);\n Process::create(['id' => '1815', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1648', 'is_default' => '1']);\n Process::create(['id' => '1816', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1659', 'is_default' => '1']);\n Process::create(['id' => '1817', 'name' => 'Срезание корочки', 'coldproc' => '31', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1659', 'is_default' => '0']);\n Process::create(['id' => '1818', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1660', 'is_default' => '1']);\n Process::create(['id' => '1819', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1661', 'is_default' => '1']);\n Process::create(['id' => '1820', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1662', 'is_default' => '1']);\n Process::create(['id' => '1821', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1669', 'is_default' => '1']);\n Process::create(['id' => '1822', 'name' => 'Без тепловой обработки', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1669', 'is_default' => '0']);\n Process::create(['id' => '1823', 'name' => 'Жарка фри тонкими ломтиками', 'coldproc' => '4', 'hotproc' => '60', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1669', 'is_default' => '0']);\n Process::create(['id' => '1824', 'name' => 'Холодная обработка', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1670', 'is_default' => '1']);\n Process::create(['id' => '1825', 'name' => 'Припускание из свежемороженной', 'coldproc' => '3', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1673', 'is_default' => '1']);\n Process::create(['id' => '1826', 'name' => 'Холодная обработка', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1675', 'is_default' => '1']);\n Process::create(['id' => '1827', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1676', 'is_default' => '1']);\n Process::create(['id' => '1829', 'name' => 'Варка и отделение зерен', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '41', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '0']);\n Process::create(['id' => '1830', 'name' => 'Варка целиком', 'coldproc' => '3', 'hotproc' => '3', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '1']);\n Process::create(['id' => '1831', 'name' => 'Удаление косточки', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1684', 'is_default' => '1']);\n Process::create(['id' => '1832', 'name' => 'Удаление кожицы и косточек', 'coldproc' => '38', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1687', 'is_default' => '1']);\n Process::create(['id' => '1833', 'name' => 'Удаление семян и кожуры', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1688', 'is_default' => '1']);\n Process::create(['id' => '1834', 'name' => 'Удаление кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1689', 'is_default' => '1']);\n Process::create(['id' => '1835', 'name' => 'Удаление косточек и кожуры', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1690', 'is_default' => '1']);\n Process::create(['id' => '1836', 'name' => 'Удаление скорлупы', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1692', 'is_default' => '1']);\n Process::create(['id' => '1837', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1707', 'is_default' => '1']);\n Process::create(['id' => '1838', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1710', 'is_default' => '1']);\n Process::create(['id' => '1839', 'name' => 'Варка с запеканием и удалением кости ', 'coldproc' => '20', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1736', 'is_default' => '1']);\n Process::create(['id' => '1841', 'name' => 'Жареный фри в крахмале филе с кожей без костей', 'coldproc' => '64', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1842', 'name' => 'Запеченная целиком без костей', 'coldproc' => '35', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1368', 'is_default' => '0']);\n Process::create(['id' => '1843', 'name' => 'Варка с удалением кожицы', 'coldproc' => '17', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1080', 'is_default' => '0']);\n Process::create(['id' => '1844', 'name' => 'Разделка на мякоть с кожей для фаршир. + запекание', 'coldproc' => '27', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1154', 'is_default' => '0']);\n Process::create(['id' => '1845', 'name' => 'Варка с разд. на мякоть с кожей для рулета из охл.', 'coldproc' => '28', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1846', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1763', 'is_default' => '1']);\n Process::create(['id' => '1847', 'name' => 'Варка из свежемороженной', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '2', 'ch' => '1', 'protein' => '2', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1848', 'name' => 'Жарка с разд. на мякоть с кож. д/ пулярика из охл.', 'coldproc' => '28', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1849', 'name' => 'Удаление кожи и хрящей', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1015', 'is_default' => '1']);\n Process::create(['id' => '1852', 'name' => 'Разделка на мякоть (Контрольная НестФуд)', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1215', 'is_default' => '0']);\n Process::create(['id' => '1853', 'name' => 'Разделка на филе для фарша (Контр. Нестфуд)', 'coldproc' => '26', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1064', 'is_default' => '0']);\n Process::create(['id' => '1855', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1833', 'is_default' => '1']);\n Process::create(['id' => '1857', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1166', 'is_default' => '0']);\n Process::create(['id' => '1858', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '57', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '1']);\n Process::create(['id' => '1859', 'name' => 'Удаление оснований', 'coldproc' => '10', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '1']);\n Process::create(['id' => '1860', 'name' => 'Очистка от кожуры', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '0']);\n Process::create(['id' => '1861', 'name' => 'Получение сока', 'coldproc' => '58', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1910', 'is_default' => '0']);\n Process::create(['id' => '1862', 'name' => 'Холодная обработка', 'coldproc' => '54', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1918', 'is_default' => '0']);\n Process::create(['id' => '1863', 'name' => 'Тушение', 'coldproc' => '54', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '5', 'protein' => '2', 'product_id' => '1918', 'is_default' => '1']);\n Process::create(['id' => '1864', 'name' => 'Жарка панированных п/ф (из с/м филе)', 'coldproc' => '6', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '1865', 'name' => 'Потери при засолке', 'coldproc' => '9', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1550', 'is_default' => '0']);\n Process::create(['id' => '1866', 'name' => 'Удаление кожи и костей', 'coldproc' => '15', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1929', 'is_default' => '1']);\n Process::create(['id' => '1867', 'name' => 'Конкассе (удаление кожицы и семян)', 'coldproc' => '53', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1869', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1942', 'is_default' => '1']);\n Process::create(['id' => '1870', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1774', 'is_default' => '1']);\n Process::create(['id' => '1871', 'name' => 'Потери при запекании', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1937', 'is_default' => '1']);\n Process::create(['id' => '1872', 'name' => 'Жарка тонкими слайсами на гриле', 'coldproc' => '5', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '10', 'ch' => '2', 'protein' => '5', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '1874', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1963', 'is_default' => '1']);\n Process::create(['id' => '1875', 'name' => 'Жарка Конкассе', 'coldproc' => '53', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1878', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '31', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2010', 'is_default' => '1']);\n Process::create(['id' => '1879', 'name' => 'Потери при порционировании', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2022', 'is_default' => '1']);\n Process::create(['id' => '1880', 'name' => 'Запеченный с головой, хвостом и кожей без костей', 'coldproc' => '23', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '1881', 'name' => 'Конкассе (летние)', 'coldproc' => '34', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1882', 'name' => 'Жарка Конкассе (летние)', 'coldproc' => '34', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '1884', 'name' => 'Холодная обработка', 'coldproc' => '24', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1164', 'is_default' => '0']);\n Process::create(['id' => '1885', 'name' => 'Разморозка (контрольная от 29.04.10)', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '1886', 'name' => 'Разморозка (Контрольная от 29.04.10)', 'coldproc' => '39', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1114', 'is_default' => '0']);\n Process::create(['id' => '1887', 'name' => 'Разделка на филе с кожей без костей', 'coldproc' => '37', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1888', 'name' => 'Жарка филе с кожей без кости', 'coldproc' => '54', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '0']);\n Process::create(['id' => '1889', 'name' => 'Жарка', 'coldproc' => '23', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2108', 'is_default' => '1']);\n Process::create(['id' => '1890', 'name' => 'Жарка', 'coldproc' => '22', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1407', 'is_default' => '0']);\n Process::create(['id' => '1893', 'name' => 'Потери при порционировании', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2118', 'is_default' => '1']);\n Process::create(['id' => '1896', 'name' => 'Обработка для суши, роллов', 'coldproc' => '60', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2123', 'is_default' => '1']);\n Process::create(['id' => '1897', 'name' => 'Разделка на мякоть', 'coldproc' => '41', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2145', 'is_default' => '1']);\n Process::create(['id' => '1898', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2160', 'is_default' => '1']);\n Process::create(['id' => '1899', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2166', 'is_default' => '1']);\n Process::create(['id' => '1900', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2171', 'is_default' => '1']);\n Process::create(['id' => '1903', 'name' => 'Холодная обработка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2189', 'is_default' => '1']);\n Process::create(['id' => '1904', 'name' => 'Потери при порционировании', 'coldproc' => '17', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1651', 'is_default' => '1']);\n Process::create(['id' => '1905', 'name' => 'Удаление кожи и костей', 'coldproc' => '19', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2196', 'is_default' => '1']);\n Process::create(['id' => '1906', 'name' => 'Потери при нарезке', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1010', 'is_default' => '1']);\n Process::create(['id' => '1907', 'name' => 'Холодная обработка', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2203', 'is_default' => '1']);\n Process::create(['id' => '1908', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2203', 'is_default' => '0']);\n Process::create(['id' => '1909', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2205', 'is_default' => '1']);\n Process::create(['id' => '1910', 'name' => 'Потери при порционировании', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2206', 'is_default' => '1']);\n Process::create(['id' => '1911', 'name' => 'Жарка', 'coldproc' => '48', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1912', 'name' => 'Очистка', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1234', 'is_default' => '0']);\n Process::create(['id' => '1913', 'name' => 'Очистка', 'coldproc' => '32', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1285', 'is_default' => '0']);\n Process::create(['id' => '1914', 'name' => 'Жарка из свежемороженой', 'coldproc' => '5', 'hotproc' => '30', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1121', 'is_default' => '0']);\n Process::create(['id' => '1915', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '2236', 'is_default' => '1']);\n Process::create(['id' => '1916', 'name' => 'Очищенная без термообработки', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1276', 'is_default' => '0']);\n Process::create(['id' => '1921', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2114', 'is_default' => '1']);\n Process::create(['id' => '1925', 'name' => 'Холодная обработка', 'coldproc' => '12', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2268', 'is_default' => '1']);\n Process::create(['id' => '1926', 'name' => 'Жарка сильно глазированного', 'coldproc' => '62', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1530', 'is_default' => '0']);\n Process::create(['id' => '1927', 'name' => 'Жарка из очищенных свежемороженных', 'coldproc' => '40', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '1928', 'name' => 'Потери при порционировании', 'coldproc' => '2', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2274', 'is_default' => '1']);\n Process::create(['id' => '1929', 'name' => 'Жарка из с/м с предв. запек. и удал берц. кости', 'coldproc' => '18', 'hotproc' => '4', 'finalproc' => '15', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1461', 'is_default' => '0']);\n Process::create(['id' => '1930', 'name' => 'Варка без слива', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1711', 'is_default' => '1']);\n Process::create(['id' => '1931', 'name' => 'Варка Аль денте', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2287', 'is_default' => '1']);\n Process::create(['id' => '1932', 'name' => 'Потери на рассол', 'coldproc' => '35', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1144', 'is_default' => '1']);\n Process::create(['id' => '1933', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2296', 'is_default' => '1']);\n Process::create(['id' => '1934', 'name' => 'Запекание', 'coldproc' => '3', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2296', 'is_default' => '0']);\n Process::create(['id' => '1935', 'name' => 'Жарка филе', 'coldproc' => '53', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '0']);\n Process::create(['id' => '1936', 'name' => 'Очистка корочки', 'coldproc' => '25', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1601', 'is_default' => '0']);\n Process::create(['id' => '1937', 'name' => 'Получение сока', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '52', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1938', 'name' => 'Получение сока', 'coldproc' => '40', 'hotproc' => '0', 'finalproc' => '58', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1071', 'is_default' => '0']);\n Process::create(['id' => '1940', 'name' => 'Запеченный, фаршированный с головой и костями', 'coldproc' => '22', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1941', 'name' => 'Запеченный целиком с удаленным хребтом', 'coldproc' => '35', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1221', 'is_default' => '0']);\n Process::create(['id' => '1942', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2380', 'is_default' => '1']);\n Process::create(['id' => '1943', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '5', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2381', 'is_default' => '1']);\n Process::create(['id' => '1944', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '44', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2384', 'is_default' => '1']);\n Process::create(['id' => '1945', 'name' => 'Разделка на филе с кожей б/к+засолка', 'coldproc' => '43', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1946', 'name' => 'Запекание сухариков с удалением корочки', 'coldproc' => '29', 'hotproc' => '27', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1022', 'is_default' => '0']);\n Process::create(['id' => '1947', 'name' => 'Формование валованов и запекание', 'coldproc' => '50', 'hotproc' => '42', 'finalproc' => '0', 'grease' => '10', 'ch' => '10', 'protein' => '5', 'product_id' => '1614', 'is_default' => '0']);\n Process::create(['id' => '1948', 'name' => 'Холодная обработка', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2420', 'is_default' => '1']);\n Process::create(['id' => '1949', 'name' => 'Холодная обработка', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2422', 'is_default' => '1']);\n Process::create(['id' => '1953', 'name' => 'Выпекание штучных изделий (50-70 грамм)', 'coldproc' => '0', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2435', 'is_default' => '1']);\n Process::create(['id' => '1954', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2444', 'is_default' => '1']);\n Process::create(['id' => '1955', 'name' => 'Жарка соломкой для солянки', 'coldproc' => '3', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '2446', 'is_default' => '1']);\n Process::create(['id' => '1956', 'name' => 'Припускание без очистки', 'coldproc' => '10', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1214', 'is_default' => '0']);\n Process::create(['id' => '1957', 'name' => 'Потери при варке (2)', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '0']);\n Process::create(['id' => '1959', 'name' => 'Потери при варке (1)', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1825', 'is_default' => '1']);\n Process::create(['id' => '1960', 'name' => 'Потери при варке (2)', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1825', 'is_default' => '0']);\n Process::create(['id' => '1961', 'name' => 'Жарка без зачистки', 'coldproc' => '5', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1546', 'is_default' => '0']);\n Process::create(['id' => '1962', 'name' => 'Жарка на гриле с головой и костями (из охл.)', 'coldproc' => '13', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1429', 'is_default' => '0']);\n Process::create(['id' => '1963', 'name' => 'Жарка на гриле с головой и костями (из охл.)', 'coldproc' => '16', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1552', 'is_default' => '0']);\n Process::create(['id' => '1964', 'name' => 'Жарка на гриле целиком очищ. потрошенная (из охл.)', 'coldproc' => '18', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2452', 'is_default' => '1']);\n Process::create(['id' => '1965', 'name' => 'Жарка гриль целиком (из охл.)', 'coldproc' => '15', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1635', 'is_default' => '0']);\n Process::create(['id' => '1966', 'name' => 'Нарезка стейками с кожей и костями+жарка', 'coldproc' => '29', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1551', 'is_default' => '0']);\n Process::create(['id' => '1967', 'name' => 'Жареный гриль целиком (потрош., с головой)', 'coldproc' => '20', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1124', 'is_default' => '0']);\n Process::create(['id' => '1968', 'name' => 'Жарка в беконе с очисткой хвостовой части', 'coldproc' => '40', 'hotproc' => '23', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1460', 'is_default' => '0']);\n Process::create(['id' => '1970', 'name' => 'Жарка без зачистки (Н. Зеландия, Австралия)', 'coldproc' => '3', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1018', 'is_default' => '0']);\n Process::create(['id' => '1971', 'name' => 'Тушение (охлажденное)', 'coldproc' => '8', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2467', 'is_default' => '1']);\n Process::create(['id' => '1972', 'name' => 'Варка (охлажденное)', 'coldproc' => '8', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2467', 'is_default' => '0']);\n Process::create(['id' => '1975', 'name' => 'Варка (из охлажденного)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1976', 'name' => 'Тушение (из охлажденного)', 'coldproc' => '9', 'hotproc' => '43', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2466', 'is_default' => '1']);\n Process::create(['id' => '1977', 'name' => 'Варка (из мороженного)', 'coldproc' => '15', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1978', 'name' => 'Тушение (из мороженного)', 'coldproc' => '15', 'hotproc' => '40', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2466', 'is_default' => '0']);\n Process::create(['id' => '1979', 'name' => 'Жарка', 'coldproc' => '4', 'hotproc' => '53', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1093', 'is_default' => '1']);\n Process::create(['id' => '1980', 'name' => 'Жарка в составе котлет', 'coldproc' => '4', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '1093', 'is_default' => '0']);\n Process::create(['id' => '1981', 'name' => 'Потери при вязке колбасок', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2487', 'is_default' => '1']);\n Process::create(['id' => '1982', 'name' => 'Потери при порционировании', 'coldproc' => '4', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2498', 'is_default' => '1']);\n Process::create(['id' => '1983', 'name' => 'Потери при разморозке (б/к)', 'coldproc' => '16', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1985', 'name' => 'Разморозка и запекание с сухарным соусом', 'coldproc' => '7', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1186', 'is_default' => '0']);\n Process::create(['id' => '1986', 'name' => 'Обжаривание для штруделя', 'coldproc' => '0', 'hotproc' => '64', 'finalproc' => '0', 'grease' => '10', 'ch' => '20', 'protein' => '5', 'product_id' => '1050', 'is_default' => '0']);\n Process::create(['id' => '1987', 'name' => 'Нарезка без очистки', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1008', 'is_default' => '0']);\n Process::create(['id' => '1988', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2525', 'is_default' => '1']);\n Process::create(['id' => '1989', 'name' => 'Припускание', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1836', 'is_default' => '1']);\n Process::create(['id' => '1990', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1428', 'is_default' => '1']);\n Process::create(['id' => '1993', 'name' => 'Варка в составе соуса', 'coldproc' => '0', 'hotproc' => '20', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1297', 'is_default' => '0']);\n Process::create(['id' => '1994', 'name' => 'Варка без слива для плова (Контрольная проработка)', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '2', 'ch' => '5', 'protein' => '2', 'product_id' => '1263', 'is_default' => '0']);\n Process::create(['id' => '1998', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2607', 'is_default' => '1']);\n Process::create(['id' => '2001', 'name' => 'Запекание (булочки)', 'coldproc' => '0', 'hotproc' => '33', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2002', 'name' => 'Запекание (плюшки)', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2004', 'name' => 'Потери на рассол', 'coldproc' => '7', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1065', 'is_default' => '1']);\n Process::create(['id' => '2006', 'name' => 'Запекание (булочка ореховая)', 'coldproc' => '0', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '2609', 'is_default' => '0']);\n Process::create(['id' => '2008', 'name' => 'Потери при запекании в составе теста', 'coldproc' => '0', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1052', 'is_default' => '0']);\n Process::create(['id' => '2009', 'name' => 'Запекание', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2642', 'is_default' => '1']);\n Process::create(['id' => '2010', 'name' => 'Жарка в кляре (Контрольная от 01.09.2010', 'coldproc' => '39', 'hotproc' => '46', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1114', 'is_default' => '0']);\n Process::create(['id' => '2011', 'name' => 'Жарка из с/м б/г с очисткой от панциря и хвоста', 'coldproc' => '45', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '2013', 'name' => 'Жарка с удалением хребта', 'coldproc' => '17', 'hotproc' => '32', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '2014', 'name' => 'Обжарка', 'coldproc' => '11', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1375', 'is_default' => '1']);\n Process::create(['id' => '2015', 'name' => 'Запекание (2)', 'coldproc' => '4', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1607', 'is_default' => '0']);\n Process::create(['id' => '2017', 'name' => 'Жарка гриль (из охлажленных)', 'coldproc' => '2', 'hotproc' => '24', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '2716', 'is_default' => '1']);\n Process::create(['id' => '2018', 'name' => 'Жарка филе без кожи и костей', 'coldproc' => '47', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2729', 'is_default' => '1']);\n Process::create(['id' => '2019', 'name' => 'Потери при нарезке', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2759', 'is_default' => '1']);\n Process::create(['id' => '2021', 'name' => 'Разделка на мякоть + жарка', 'coldproc' => '52', 'hotproc' => '20', 'finalproc' => '10', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1459', 'is_default' => '0']);\n Process::create(['id' => '2022', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '2', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2780', 'is_default' => '1']);\n Process::create(['id' => '2023', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2781', 'is_default' => '1']);\n Process::create(['id' => '2024', 'name' => 'Разогрев', 'coldproc' => '0', 'hotproc' => '6', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2782', 'is_default' => '1']);\n Process::create(['id' => '2025', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '5', 'product_id' => '2783', 'is_default' => '1']);\n Process::create(['id' => '2026', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2784', 'is_default' => '1']);\n Process::create(['id' => '2027', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2785', 'is_default' => '1']);\n Process::create(['id' => '2028', 'name' => 'Жарка гриль (из с/м п/ф)', 'coldproc' => '2', 'hotproc' => '13', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '5', 'product_id' => '1677', 'is_default' => '0']);\n Process::create(['id' => '2033', 'name' => 'Уваривание с сахаром из с/м', 'coldproc' => '0', 'hotproc' => '47', 'finalproc' => '0', 'grease' => '2', 'ch' => '3', 'protein' => '2', 'product_id' => '1097', 'is_default' => '0']);\n Process::create(['id' => '2034', 'name' => 'Уваривание с сахаром из с/м', 'coldproc' => '2', 'hotproc' => '48', 'finalproc' => '0', 'grease' => '2', 'ch' => '3', 'protein' => '2', 'product_id' => '1303', 'is_default' => '0']);\n Process::create(['id' => '2035', 'name' => 'Запекание до полуготовности', 'coldproc' => '0', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '10', 'ch' => '15', 'protein' => '5', 'product_id' => '1774', 'is_default' => '0']);\n Process::create(['id' => '2036', 'name' => 'Допекание', 'coldproc' => '0', 'hotproc' => '7', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2868', 'is_default' => '1']);\n Process::create(['id' => '2037', 'name' => 'Потери влаги при жарке в составе блюда', 'coldproc' => '0', 'hotproc' => '16', 'finalproc' => '0', 'grease' => '5', 'ch' => '5', 'protein' => '5', 'product_id' => '1191', 'is_default' => '0']);\n Process::create(['id' => '2038', 'name' => 'Жареная с головой', 'coldproc' => '20', 'hotproc' => '18', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '2900', 'is_default' => '1']);\n Process::create(['id' => '2039', 'name' => 'Жарка мелкими кусочками', 'coldproc' => '5', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1057', 'is_default' => '0']);\n Process::create(['id' => '2040', 'name' => 'Разделка на мякоть', 'coldproc' => '69', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1476', 'is_default' => '0']);\n Process::create(['id' => '2041', 'name' => 'Потери при хранении и холодной обработки', 'coldproc' => '14', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2910', 'is_default' => '1']);\n Process::create(['id' => '2042', 'name' => 'Потери при хранении и нарезке', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2917', 'is_default' => '1']);\n Process::create(['id' => '2043', 'name' => 'Потери при непродолжительной варке', 'coldproc' => '0', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2924', 'is_default' => '1']);\n Process::create(['id' => '2044', 'name' => 'Потери при длительной варке', 'coldproc' => '0', 'hotproc' => '37', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2924', 'is_default' => '0']);\n Process::create(['id' => '2045', 'name' => 'Варка', 'coldproc' => '50', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '2930', 'is_default' => '1']);\n Process::create(['id' => '2046', 'name' => 'Жарка, запекание', 'coldproc' => '28', 'hotproc' => '50', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1676', 'is_default' => '0']);\n Process::create(['id' => '2048', 'name' => 'Варка', 'coldproc' => '0', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2948', 'is_default' => '1']);\n Process::create(['id' => '2050', 'name' => 'Потери при порционировании', 'coldproc' => '3', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1941', 'is_default' => '1']);\n Process::create(['id' => '2051', 'name' => 'Потеря влаги при запекании воздушного п/ф', 'coldproc' => '0', 'hotproc' => '89', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '10', 'product_id' => '1667', 'is_default' => '1']);\n Process::create(['id' => '2052', 'name' => 'Холодная обработка', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '2053', 'name' => 'Потери при запекании', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2988', 'is_default' => '1']);\n Process::create(['id' => '2054', 'name' => 'Тушение из с/м', 'coldproc' => '0', 'hotproc' => '45', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1198', 'is_default' => '1']);\n Process::create(['id' => '2055', 'name' => 'Потери при варке', 'coldproc' => '0', 'hotproc' => '70', 'finalproc' => '0', 'grease' => '2', 'ch' => '2', 'protein' => '2', 'product_id' => '1011', 'is_default' => '0']);\n Process::create(['id' => '2056', 'name' => 'Жарка', 'coldproc' => '5', 'hotproc' => '42', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '3022', 'is_default' => '1']);\n Process::create(['id' => '2057', 'name' => 'Жарка гриль из свежемороженных', 'coldproc' => '31', 'hotproc' => '19', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '3033', 'is_default' => '1']);\n Process::create(['id' => '2058', 'name' => 'Выпекание хлебных палочек', 'coldproc' => '0', 'hotproc' => '35', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '2435', 'is_default' => '0']);\n Process::create(['id' => '2059', 'name' => 'Варка', 'coldproc' => '5', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '25', 'ch' => '0', 'protein' => '10', 'product_id' => '3050', 'is_default' => '1']);\n Process::create(['id' => '2060', 'name' => 'Жарка + разделка на мякоть с кожей', 'coldproc' => '10', 'hotproc' => '35', 'finalproc' => '56', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1341', 'is_default' => '0']);\n Process::create(['id' => '2061', 'name' => 'Жарка гриль', 'coldproc' => '7', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '3061', 'is_default' => '1']);\n Process::create(['id' => '2062', 'name' => 'Холодное копчение', 'coldproc' => '12', 'hotproc' => '14', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1278', 'is_default' => '0']);\n Process::create(['id' => '2063', 'name' => 'Холодное копчение', 'coldproc' => '5', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1279', 'is_default' => '0']);\n Process::create(['id' => '2065', 'name' => 'Потери при жарке', 'coldproc' => '0', 'hotproc' => '17', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3074', 'is_default' => '1']);\n Process::create(['id' => '2066', 'name' => 'Жарка крупных с/м б/г с очисткой от панциря', 'coldproc' => '27', 'hotproc' => '12', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1908', 'is_default' => '0']);\n Process::create(['id' => '2067', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '8', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3095', 'is_default' => '1']);\n Process::create(['id' => '2068', 'name' => 'Запекание чипсами', 'coldproc' => '17', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1608', 'is_default' => '0']);\n Process::create(['id' => '2069', 'name' => 'Разморозка', 'coldproc' => '6', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1345', 'is_default' => '0']);\n Process::create(['id' => '2070', 'name' => 'Жарка', 'coldproc' => '0', 'hotproc' => '15', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3106', 'is_default' => '1']);\n Process::create(['id' => '2071', 'name' => 'Запекание в кожице без очистки', 'coldproc' => '3', 'hotproc' => '21', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1014', 'is_default' => '0']);\n Process::create(['id' => '2072', 'name' => 'Припущенные с кожицей и семенами', 'coldproc' => '3', 'hotproc' => '22', 'finalproc' => '0', 'grease' => '10', 'ch' => '0', 'protein' => '2', 'product_id' => '1112', 'is_default' => '0']);\n Process::create(['id' => '2073', 'name' => 'Удаление внутренностей', 'coldproc' => '36', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1476', 'is_default' => '1']);\n Process::create(['id' => '2074', 'name' => 'Запеченный в соли с головой и хребтом без кожи', 'coldproc' => '16', 'hotproc' => '18', 'finalproc' => '28', 'grease' => '10', 'ch' => '0', 'protein' => '10', 'product_id' => '1311', 'is_default' => '0']);\n Process::create(['id' => '2075', 'name' => 'Тушение в масле с овощами (конфит)', 'coldproc' => '3', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3117', 'is_default' => '1']);\n Process::create(['id' => '2076', 'name' => 'Тушение с удалением кости (до сустава)', 'coldproc' => '17', 'hotproc' => '25', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '3117', 'is_default' => '0']);\n Process::create(['id' => '2077', 'name' => 'Запекание в фольге с холодной обработкой', 'coldproc' => '13', 'hotproc' => '28', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '2078', 'name' => 'Запекание гребешка в раковине', 'coldproc' => '0', 'hotproc' => '38', 'finalproc' => '0', 'grease' => '20', 'ch' => '0', 'protein' => '10', 'product_id' => '1422', 'is_default' => '0']);\n Process::create(['id' => '2079', 'name' => 'Жарка корейки теленка на кости', 'coldproc' => '19', 'hotproc' => '29', 'finalproc' => '0', 'grease' => '30', 'ch' => '0', 'protein' => '10', 'product_id' => '1328', 'is_default' => '0']);\n Process::create(['id' => '2080', 'name' => 'Потери влаги при запекании в составе чизкейка', 'coldproc' => '0', 'hotproc' => '36', 'finalproc' => '0', 'grease' => '5', 'ch' => '0', 'protein' => '5', 'product_id' => '1613', 'is_default' => '0']);\n Process::create(['id' => '2081', 'name' => 'Выделение хлорофила', 'coldproc' => '85', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1233', 'is_default' => '0']);\n Process::create(['id' => '2082', 'name' => 'Сушка', 'coldproc' => '15', 'hotproc' => '90', 'finalproc' => '0', 'grease' => '10', 'ch' => '1', 'protein' => '5', 'product_id' => '1332', 'is_default' => '0']);\n Process::create(['id' => '2083', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3132', 'is_default' => '1']);\n Process::create(['id' => '2084', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3133', 'is_default' => '1']);\n Process::create(['id' => '2085', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3134', 'is_default' => '1']);\n Process::create(['id' => '2086', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3135', 'is_default' => '1']);\n Process::create(['id' => '2087', 'name' => 'Холодная обработка', 'coldproc' => '28', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3136', 'is_default' => '1']);\n Process::create(['id' => '2088', 'name' => 'Холодная обработка', 'coldproc' => '20', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '3137', 'is_default' => '1']);\n Process::create(['id' => '2090', 'name' => 'Потери при нарезке', 'coldproc' => '5', 'hotproc' => '0', 'finalproc' => '0', 'grease' => '0', 'ch' => '0', 'protein' => '0', 'product_id' => '1347', 'is_default' => '0']);\n }",
"public function process() {}",
"public function process() {}",
"public function process() {}",
"public function process() {}",
"protected function getFulfillmentProcessByFilterRequest($filter = null, $page = null, $limit = null, $sort = null)\n {\n\n $resourcePath = '/beta/fulfillmentProcess/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = ObjectSerializer::toQueryValue($page);\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n // query params\n if ($sort !== null) {\n $queryParams['sort'] = ObjectSerializer::toQueryValue($sort);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function process() {\n\n\t\n\n $process = $_REQUEST['process'];\n\n $chon = $_REQUEST['chon'];\n\n if (count($chon) == 0 || $process < 1) {\n\n\t\t\tif($this->Session->check('pageproduct')) {\n\n\t\t\t\t$this->redirect($this->Session->read('pageproduct'));\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\t$this->redirect('/products');\n\n\t\t\t\texit;\n\n\t\t\t} \n\n }\n\n\t\t\n\n switch ($process) {\n\n case '1' :\n\n // Update active\n\n foreach ($chon as $k => $v) {\n\n $this->Product->updateAll(\n\n array(\n\n 'Product.status' => 1\n\n ), array(\n\n 'Product.id' => $k)\n\n );\n\n }\n\n break;\n\n\n\n case '2' :\n\n // Update deactive\n\n foreach ($chon as $k => $v) {\n\n $this->Product->updateAll(\n\n array(\n\n 'Product.status' => 0\n\n ), array(\n\n 'Product.id' => $k)\n\n );\n\n }\n\n break;\n\n\n\n case '3' :\n\n // delete many rows\n\n $groupId = \"\";\n\n foreach ($chon as $k => $v) {\n\n $groupId .= \",\" . $k;\n\n }\n\n $groupId = substr($groupId, 1);\n\n $conditions = array(\n\n 'Product.id IN (' . $groupId . ')'\n\n );\n\n $this->Product->deleteAll($conditions);\n\n break;\n\n }\n\n if ($this->Session->check('pageproduct')) {\n\n $this->redirect($this->Session->read('pageproduct'));\n\n } else {\n\n $this->redirect(array('action' => 'index'));\n\n } \n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t\t\n\n }",
"public function getInventoryProcess() {\n return $this->params['inventoryProcess'];\n }"
]
| [
"0.6150384",
"0.61182654",
"0.55793357",
"0.55449796",
"0.5528093",
"0.5508495",
"0.54945415",
"0.54615194",
"0.54218364",
"0.5378466",
"0.53776765",
"0.53209627",
"0.52948743",
"0.528947",
"0.51721245",
"0.5167252",
"0.51595134",
"0.51595134",
"0.51595134",
"0.51595134",
"0.5157491",
"0.51322997",
"0.5117015",
"0.5107136",
"0.5106433",
"0.5106433",
"0.5106433",
"0.5095618",
"0.5073784",
"0.5069118"
]
| 0.7013398 | 0 |
Test case for getReplenishmentProcessById Get a replenishmentProcess by id | public function test_getReplenishmentProcessById() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_getDuplicateReplenishmentProcessById() {\n\n }",
"public function testDeleteProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $data = json_decode($response->getContent());\n $new_response = $this->json('DELETE', '/api/processes/' . $data->id);\n $new_response->assertStatus(200);\n $new_data = json_decode($response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"public function getOne($id)\n {\n return Mfp_procurement::where('ref_id', $id)->firstOrFail();\n //return Actual_overhead::where('mfp_procurement_id',$procurement->id)->first();\n //return $procurement;\n \n }",
"public function getProcess();",
"public function getSubprocessByProcessesId()\n\t\t{\n\n\t\t}",
"public function getProcess($id){\n $spb = data_spb::join('data_karyawan AS a', 'a.id_karyawan', '=', 'data_spb.id_pemohon')\n ->leftJoin('data_karyawan AS b', 'b.id_karyawan', '=', 'data_spb.id_acc')\n ->join('data_departemen', 'data_departemen.id_departemen', '=', 'data_spb.id_departemen')\n ->where('data_spb.id_spb', $id)\n ->select(\n 'a.nm_depan',\n 'a.nm_belakang',\n 'b.nm_depan AS acc_depan',\n 'b.nm_belakang AS acc_belakang',\n 'data_departemen.nm_departemen',\n 'data_spb.*'\n )\n ->first();\n\n $akses = \\Me::accessGudang();\n if(!in_array($spb->tipe, $akses))\n return redirect('/skb/spb')->withNotif([\n 'label' => 'danger',\n 'err' => 'Maaf, Tidak ada akses untuk anda!'\n ]);\n\n if($spb->status > 2 || $spb->id_acc == 0)\n return redirect('/skb/spb');\n $items = data_spb_item::byspb($id)->get();\n \n return view('Pengadaan.SKB.ProcessSPB', [\n 'spb' => $spb,\n 'items' => $items,\n 'satuan' => ref_satuan::all()\n ]);\n }",
"public function testGetReplenishmentById()\n {\n }",
"function consultar_repuesto($id_repuesto){\n\t\t$this->db->select('*');\n\t\t$this->db->From('repuestos');\n\t\t$this->db->where('id',$id_repuesto);\n\t\t$query = $this->db->get();\n\t\treturn $query->row();\n\t}",
"public function testUpdateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n $data = json_decode($response->getContent());\n $new_process_data = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $new_response = $this->json('PUT', '/api/processes/' . $data->id, $new_process_data);\n $new_response->assertStatus(201);\n $new_data = json_decode($new_response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"protected function getFulfillmentProcessByIdRequest($fulfillment_process_id)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling getFulfillmentProcessById'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getDuplicateFulfillmentProcessByIdRequest($fulfillment_process_id)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling getDuplicateFulfillmentProcessById'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/duplicate/{fulfillmentProcessId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getById($id = null)\n {\n if ($id == null || $id == '') {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n $promo = $this->promo->find($id);\n if (!$promo) {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n return $promo;\n }",
"public function getById($id)\n {\n return $this->profissionalRepository->getById($id);\n }",
"public function testReadProcess () {\n $response = $this->json('GET', 'api/processes');\n $response->assertStatus(200);\n }",
"public function show($id)\n {\n $inventory_process = InventoryProcess::find($id);\n return view('inventory_process.detail', compact('inventory_process'));\n }",
"public function getById(RequisitionId $id)\n {\n }",
"public function getByID($promotion_id)\n {\n return $this->promotionsRepo->getPromotionByID($promotion_id);\n }",
"public function testGetPid(): void\n {\n $model = ProcessMemoryMap::load([\n \"pid\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getPid());\n }",
"public function show($id)\n {\n $this->checkPermission(\"mfp_procurement_actual_details_view_generated_receipt\");\n try {\n $item = $this->service->getOne($id);\n $item = ApiResource::make($item);\n return $this->respondWithSuccess($item);\n }catch(\\Exception $th){\n return $this->respondWithError($th);\n }\n }",
"public function getPromId()\n {\n return $this->prom_id;\n }",
"public function getItem($id) {\r\n\t\t$sql = \"SELECT * FROM contact_request_status WHERE request_id = '\" . $this->db->escape($id) . \"' and status = 'admin_process'\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\tif( $query->num_rows == 0 ){\r\n\t\t\t$sql = \"INSERT INTO contact_request_status SET status = 'admin_process', request_id = '\" . $this->db->escape($id) . \"', start_time = now()\";\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\r\n \t$query = $this->db->query(\"SELECT * FROM contact_request WHERE request_id = '\" . $this->db->escape($id) . \"'\");\r\n \r\n \treturn $query->row;\r\n \t}",
"public function getrep_id()\r\n {\r\n return $this->rep_id;\r\n }",
"public function setIdPromocion($id_promocion)\n {\n $this->id_promocion = $id_promocion;\n\n return $this;\n }",
"public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }",
"public function getIdPromocion()\n {\n return $this->id_promocion;\n }",
"function process($status, $percent, $pid = \"auto\", $name = \"\")\n{\n $toolkit = systemToolkit::getInstance();\n $processMapper = $toolkit->getMapper('process', 'process');\n $process = false;\n if($pid != \"auto\") {\n $process = $processMapper->searchOneByField('pid', $pid);\n if(!$process) {\n if(function_exists('logMe')) {\n logMe(\"Can't find process with pid «{$pid}»!\", 4);\n }\n }\n }\n if(!$process) {\n $process = true;\n while(true) {\n $pid = rand(0,4294967294);\n $process = $processMapper->searchOneByField('pid', $pid);\n if(!$process) {\n break;\n }\n }\n $process = $processMapper->create();\n $process->setPid($pid);\n }\n $process->setName($name);\n $process->setModule($toolkit->getRequest()->getModule());\n $process->setAction($toolkit->getRequest()->getAction());\n $process->setUserId($toolkit->getUser()->getId());\n $process->setStatus($status);\n $process->setPercent((float)$percent);\n $processMapper->save($process);\n return $process->getPid();\n}",
"public function getProcessInstance()\n {\n }",
"public function setPromId($prom_id)\n {\n $this->prom_id = $prom_id;\n\n return $this;\n }",
"public function edit($id)\n {\n $data = $this->workflow_Process_Service->edit($id);\n $group = $data[1];\n $workflow_process = $data[0];\n // dd($group);\n return view('workflow::workflow_process.edit',compact('group','workflow_process'));\n }",
"public function getProcess()\n {\n return $this->hasMany(ToquvMakineProcesses::className(), ['machine_id' => 'id'])->leftJoin('toquv_instructions ti', 'toquv_makine_processes.ti_id = ti.id')->where(['ti.is_closed'=>1])->orderBy(['id' => SORT_DESC]);\n }"
]
| [
"0.66488874",
"0.5775771",
"0.5759086",
"0.57326126",
"0.5636149",
"0.5605933",
"0.5582114",
"0.55617845",
"0.55186856",
"0.5506978",
"0.54961294",
"0.5432883",
"0.54059285",
"0.53953886",
"0.53817666",
"0.53748924",
"0.5329162",
"0.5326452",
"0.53258175",
"0.53007764",
"0.5272029",
"0.5268439",
"0.5210233",
"0.5209653",
"0.51996",
"0.5197044",
"0.5176111",
"0.5154081",
"0.51355654",
"0.5120209"
]
| 0.7295529 | 0 |
Test case for getReplenishmentProcessTags Get the tags for a replenishmentProcess. | public function test_getReplenishmentProcessTags() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getFulfillmentProcessTagsRequest($fulfillment_process_id)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling getFulfillmentProcessTags'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/tag';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getFulfillmentProcessTagsWithHttpInfo($fulfillment_process_id)\n {\n $returnType = '';\n $request = $this->getFulfillmentProcessTagsRequest($fulfillment_process_id);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}",
"private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}",
"public function getTags() {\n\t\t$tags = array();\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_KlickTipp $api */\n\t\t\t$api = $this->get_api();\n\t\t\t$tags = $api->getTags();\n\t\t} catch ( Exception $e ) {\n\n\t\t}\n\n\t\treturn $tags;\n\t}",
"public function getPPTags()\n {\n $this->postParseTags;\n }",
"public function getFulfillmentProcessTagsAsync($fulfillment_process_id)\n {\n return $this->getFulfillmentProcessTagsAsyncWithHttpInfo($fulfillment_process_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getTags() {}",
"public function &getTags($pids)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getTags',\n array('pids' => $pids));\n\n return $results;\n }",
"protected function _findRelatedProductTags($productId) {\n $productRelation = Mage::getResourceModel('catalog/product_relation');\n $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $childIds = array($productId);\n $tags = array(Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $productId);\n do {\n // following product relations up the chain.\n $select = $writeConnection->select()\n ->from($productRelation->getMainTable(), array('parent_id'))\n ->where(\"child_id IN (?)\", $childIds);\n ;\n if (($childIds = $select->query()->fetchAll(Zend_Db::FETCH_COLUMN, 0))) {\n foreach ($childIds as $id) {\n $tags[] = Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $id;\n }\n }\n } while($childIds != null);\n\n return $tags;\n }",
"public function getFulfillmentProcessTags($fulfillment_process_id)\n {\n $this->getFulfillmentProcessTagsWithHttpInfo($fulfillment_process_id);\n }",
"public function tags(){\n return $this->tags;\n }",
"public function tags()\n {\n return $this->hasManyThrough(\n 'App\\ProductTags',\n 'App\\ProductHasTags',\n 'product_id',\n 'id'\n );\n }",
"public function tags() {\n\t\treturn $this->get_tags();\n\t}",
"public function getTags() {\n\t\t$sql = \"SELECT tags FROM question\";\n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t}",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getTags();",
"public function getProcesses() {\n\t\t$bean = $this->unbox();\n\t\treturn $bean->with(' ORDER BY `id` ')->ownProcess;\n\t}",
"public function test_addReplenishmentProcessTag() {\n\n }",
"function tags($pid, $query = array(), $rawJson = false) {\n \t\tif ( $json = $this->_get('/merchants/'.$pid.'/tags.json', $query) )\n \t\t\treturn $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}",
"public function get_tags(){\n\t \n\t return $this->tags;\n\t}",
"public function tags()\n {\n return $this->setRightOperand(PVar::TAGS);\n }",
"public function testGetReplenishmentTags()\n {\n }",
"public function getTags()\n {\n return $this->_tags;\n }",
"public function getTags()\n\t{\n\t\treturn $this->tags;\n\t}",
"function tags() {\n\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRow = $preloader->getPreloadArticleTag($this->id);\n\n\t\tif ($preloadRow) {\n\t\t\t$rows = $preloadRow;\n\t\t} else {\n\t\t\tglobal $polarbear_db;\n\t\t\t$sql = \"SELECT tagID FROM \" . POLARBEAR_DB_PREFIX . \"_article_tag_relation WHERE articleID = '$this->id'\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t}\n\n\t\t$arrTags = array();\n\t\tif ($rows) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$arrTags[] = polarbear_tag::getInstance($row->tagID);\n\t\t\t}\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article tags()\");\n\n\t\treturn $arrTags;\n\t}",
"public function getTags()\n {\n return $this->_tags;\n }"
]
| [
"0.57338727",
"0.5363438",
"0.524196",
"0.524196",
"0.52236503",
"0.51324606",
"0.50880826",
"0.5027813",
"0.5015275",
"0.4971979",
"0.4942144",
"0.49183613",
"0.48902696",
"0.48655224",
"0.4861036",
"0.48559055",
"0.48559055",
"0.48559055",
"0.48559055",
"0.48559055",
"0.4836277",
"0.48198497",
"0.4819696",
"0.47932902",
"0.47899503",
"0.47250462",
"0.47220564",
"0.47186285",
"0.47180897",
"0.47117215"
]
| 0.6088897 | 0 |
Test case for updateReplenishmentProcessCustomFields Update a replenishmentProcess custom fields | public function test_updateReplenishmentProcessCustomFields() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateReplenishmentCustomFields()\n {\n }",
"public function testUpdateExternalShipmentCustomFields()\n {\n }",
"public function testUpdateOrderCustomFields()\n {\n }",
"public function test_updateExternalShipmentCustomFields() {\n\n }",
"public function updateFulfillmentProcessCustomFields($body)\n {\n $this->updateFulfillmentProcessCustomFieldsWithHttpInfo($body);\n }",
"public function testUpdatePackingPlanCustomFields()\n {\n }",
"protected function updateFulfillmentProcessCustomFieldsRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateFulfillmentProcessCustomFields'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/customFields';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function test_updateCustomerCustomFields() {\n\n }",
"public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }",
"protected function _updatefields() {}",
"public function test_updateBillingCodeTypeCustomFields() {\n\n }",
"public function process()\n\t{\n\t\tPhpfox::getUserParam('custom.can_manage_custom_fields', true);\n\t\t$bOrderUpdated = false;\n\t\t\n\t\tif (($iDeleteId = $this->request()->getInt('delete')) && Phpfox::getService('custom.group.process')->delete($iDeleteId))\n\t\t{\n\t\t\t$this->url()->send('admincp.custom', null, Phpfox::getPhrase('custom.custom_group_successfully_deleted'));\n\t\t}\n\t\t\n\t\tif (($aFieldOrders = $this->request()->getArray('field')) && Phpfox::getService('custom.process')->updateOrder($aFieldOrders))\n\t\t{\t\t\t\n\t\t\t$bOrderUpdated = true;\n\t\t}\n\t\t\n\t\tif (($aGroupOrders = $this->request()->getArray('group')) && Phpfox::getService('custom.group.process')->updateOrder($aGroupOrders))\n\t\t{\t\t\t\n\t\t\t$bOrderUpdated = true;\n\t\t}\t\t\n\t\t\n\t\tif ($bOrderUpdated === true)\n\t\t{\n\t\t\t$this->url()->send('admincp.custom', null, Phpfox::getPhrase('custom.custom_fields_successfully_updated'));\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(Phpfox::getPhrase('custom.manage_custom_fields'))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('custom.manage_custom_fields'))\n\t\t\t->setPhrase(array(\n\t\t\t\t\t'custom.are_you_sure_you_want_to_delete_this_custom_option'\n\t\t\t\t)\n\t\t\t)\t\t\t\n\t\t\t->setHeader(array(\n\t\t\t\t\t'admin.js' => 'module_custom',\n\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.custom_set_url = function() { $Core.custom.url(\\'' . $this->url()->makeUrl('admincp.custom') . '\\'); };</script>',\n\t\t\t\t\t'jquery/ui.js' => 'static_script',\n\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.custom_admin_addSort = function(){$Core.custom.addSort();};</script>'\n\t\t\t\t)\n\t\t\t)\n\t\t\t->assign(array(\n\t\t\t\t\t'aGroups' => Phpfox::getService('custom')->getForListing()\n\t\t\t\t)\n\t\t\t);\n\t}",
"public function testUpdateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n $data = json_decode($response->getContent());\n $new_process_data = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $new_response = $this->json('PUT', '/api/processes/' . $data->id, $new_process_data);\n $new_response->assertStatus(201);\n $new_data = json_decode($new_response->getContent());\n $this->assertEquals($data->id, $new_data->id);\n }",
"public function testUpdateExtraFields(): void { }",
"public function testUpdate()\n {\n\n // $payment = $this->payment\n // ->setEvent($this->eventId)\n // ->acceptCash()\n // ->acceptCheck()\n // ->acceptGoogle()\n // ->acceptInvoice()\n // ->acceptPaypal()\n // ->setCashInstructions($instructions)\n // ->setCheckInstructions($instructions)\n // ->setInvoiceInstructions($instructions)\n // ->setGoogleMerchantId($this->googleMerchantId)\n // ->setGoogleMerchantKey($this->googleMerchantKey)\n // ->setPaypalEmail($this->paypalEmail)\n // ->update();\n\n // $this->assertArrayHasKey('process', $payment);\n // $this->assertArrayHasKey('status', $payment['process']);\n // $this->assertTrue($payment['process']['status'] == 'OK');\n }",
"protected function handleCustomField()\n {\n // If this field is a custom field we'll assume it has it's child fields\n // under the `fields` key. Then we are gonna modify those child fields'\n // attribute `name`, `label` & `conditional_logics` properties using\n // the parent field. The current implementation will modify those\n // properties in a way so that we can use dot notation to access.\n $customFields = Arr::get($this->field, 'fields');\n\n if ($customFields) {\n $parentAttribute = Arr::get($this->field, 'attributes.name');\n\n $parentConditionalLogics = Arr::get($this->field, 'settings.conditional_logics', []);\n\n $isAddressOrNameField = in_array(Arr::get($this->field, 'element'), ['address', 'input_name']);\n\n $isRepeatField = Arr::get($this->field, 'element') === 'input_repeat' || Arr::get($this->field, 'element') == 'repeater_field';\n\n foreach ($customFields as $index => $customField) {\n // If the current field is in fact `address` || `name` field\n // then we have to only keep the enabled child fields\n // by the user from the form editor settings.\n if ($isAddressOrNameField) {\n if (!Arr::get($customField, 'settings.visible', false)) {\n unset($customFields[$index]);\n continue;\n }\n }\n\n // Depending on whether the parent field is a repeat field or not\n // the modified attribute name of the child field will vary.\n if ($isRepeatField) {\n $modifiedAttribute = $parentAttribute.'['.$index.'].*';\n } else {\n $modifiedAttribute = $parentAttribute.'['.Arr::get($customField, 'attributes.name').']';\n }\n\n $modifiedLabel = $parentAttribute.'['.Arr::get($customField, 'settings.label').']';\n\n $customField['attributes']['name'] = $modifiedAttribute;\n\n $customField['settings']['label'] = $modifiedLabel;\n\n // Now, we'll replace the `conditional_logics` property\n $customField['settings']['conditional_logics'] = $parentConditionalLogics;\n\n // Now that this field's properties are handled we can pass\n // it to the extract field method to extract it's data.\n $this->extractField($customField);\n }\n }\n\n return $this;\n }",
"public function updateFulfillmentProcessCustomFieldsWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateFulfillmentProcessCustomFieldsRequest($body);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"function update( $update_fields ) {\n\n $query = \"UPDATE \" . $this->partner_code_table . \" \" .\n \"SET pc_name = '\" . $this->gCI->db->escape_string( $update_fields['pc_name'] ) . \"', \" .\n \"pc_code = '\" . $this->gCI->db->escape_string( $update_fields['pc_code'] ) . \"', \" .\n \"pc_location = '\" . $update_fields['pc_location'] . \"', \" .\n \"pc_order = '\" . $update_fields['pc_order'] . \"', \" .\n \"pc_exclusions = '\" . $update_fields['pc_exclusions'] . \"' \" .\n \"WHERE pc_id='\" . $update_fields['pc_id'] . \"'\";\n return ( $this->gCI->db->query( $query ) );\n }",
"public function testUpdateProductUsingPOST()\n {\n }",
"function pickup_field_update_order_meta( $order_id ) {\n\n //if(isset($_REQUEST['pickup_field_update_order_meta'])) return;\n //$_REQUEST['pickup_field_update_order_meta'] = 1;\n // dispatch_details\n\n print_r($_POST);\n\n //This prints out on order details after checkout\n if ( @$_POST['delivery_date'] ) {\n $str = \"Delivery scheduled for \".esc_attr( $_POST['delivery_date'] );\n $_POST['dispatch_details'] = $str;\n //new invoice field\n update_post_meta( $order_id, 'shippingMethod', sanitize_text_field( $str ) );\n\n // todo: remove these 2 lines, no longer used\n //for the field additional field in admin\n $updated = (update_post_meta( $order_id, '_dispatch_details', $str))?'true':'false'; //checkout field manager adds a _ to the front of the field name...\n hog(print_r(array('billycart', $order_id, \"_dispatch_details ($updated): \".$str),true));\n }\n\n if ( @$_POST['pickup_date'] && @$_POST['pickup_time'] ) {\n //pickup time = morning or arvo,\n $str = \"Pickup scheduled for: \".esc_attr( $_POST['pickup_time'] ).\" on \".esc_attr( $_POST['pickup_date'] );\n $_POST['dispatch_details'] = $str;\n //new invoice field\n update_post_meta( $order_id, 'shippingMethod', sanitize_text_field( $str ) );\n\n // todo: remove these 2 lines, no longer used\n $updated = (update_post_meta( $order_id, '_dispatch_details', $str))?'true':'false';\n hog(print_r(array('billycart', $order_id, \"_dispatch_details ($updated): \".$str),true));\n }\n\n\n\n if ( @$_POST['pickup_date'] ) {\n //It does: update post meta for this order\n update_post_meta( $order_id, 'pickup_date', esc_attr( $_POST['pickup_date'] ) );\n }\n if ( @$_POST['pickup_time'] ) {\n update_post_meta( $order_id, 'pickup_time', esc_attr( $_POST['pickup_time'] ) );\n }\n if ( @$_POST['delivery_date'] ) {\n update_post_meta( $order_id, 'delivery_date', esc_attr( $_POST['delivery_date'] ) );\n }\n if ( @$_POST['delivery_zone_id'] ) {\n update_post_meta( $order_id, 'delivery_zone_id', esc_attr( $_POST['delivery_zone_id'] ) );\n }\n if ( @$_POST['delivery_zone_title'] ) {\n update_post_meta( $order_id, 'delivery_zone_title', esc_attr( $_POST['delivery_zone_title'] ) );\n }\n\n }",
"public function test_getReplenishmentProcessById() {\n\n }",
"public function testCustomerPaymentMethodUpdateCustomerPaymentMethodBycustomerIdcustomerPaymentMethodId()\n {\n }",
"public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {\n $this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);\n }",
"public function test_addReplenishmentProcessTag() {\n\n }",
"public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }",
"public function test_getDuplicateReplenishmentProcessById() {\n\n }",
"protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }",
"public function update_by_mock_invoice_id() {\n\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n $mockInvoiceId = $this->input->post( 'mockInvoiceId' );\n unset( $_POST['mockInvoiceId'] );\n\n // Set any empty values to null\n array_replace_empty_with_null( $_POST );\n\n $updatedId = $this->mockinvoice_model->save( $_POST, $mockInvoiceId );\n }\n // Error handling - return some JSON if update successful\n if ( $updatedId ) {\n // Send back the POST details as JSON\n $this->json_library->print_array_json_unless_empty( $_POST );\n }\n }",
"public function testUpdateExternalShipment()\n {\n }",
"protected function postProcessUpdateReceipt()\n {\n }"
]
| [
"0.763807",
"0.6707467",
"0.6388299",
"0.636021",
"0.6327615",
"0.619549",
"0.6099532",
"0.60668606",
"0.6012192",
"0.59926766",
"0.5912831",
"0.5901459",
"0.58147943",
"0.5694091",
"0.5631779",
"0.5425129",
"0.5310978",
"0.5303625",
"0.5298002",
"0.5267126",
"0.52445257",
"0.524337",
"0.52270883",
"0.5223011",
"0.5208246",
"0.5170514",
"0.5169803",
"0.51471955",
"0.51257956",
"0.5092397"
]
| 0.8002282 | 0 |
Retrieve require js map | private function getRequireJsMap(array $map)
{
$jsonMap = [];
foreach ($map as $fileId => $fileInfo) {
if (!in_array(pathinfo($fileId, PATHINFO_EXTENSION), ['js', 'html'])) {
continue;
}
$fileId = '/' . $fileId; // add leading slash to match exclude patterns
$filePath = $this->minification->addMinifiedSign(str_replace(Repository::FILE_ID_SEPARATOR, '/', $fileId));
$filePath = substr($filePath, 1); // and remove
$jsonMap[$filePath] = '../../../../'
. $fileInfo['area'] . '/' . $fileInfo['theme'] . '/' . $fileInfo['locale'] . '/';
}
$jsonMap = json_encode($jsonMap);
return "require.config({\"config\": {\"baseUrlInterceptor\":{$jsonMap}}});";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadRequireJs() {}",
"public function getRequireJsModules(): array\n {\n return $this->requireJsModules;\n }",
"function get_map(){\n return $this->customizer_map_array;\n }",
"function kilman_get_js_module() {\n return array(\n 'name' => 'mod_kilman',\n 'fullpath' => '/mod/kilman/module.js',\n 'requires' => array('base', 'dom', 'event-delegate', 'event-key',\n 'core_question_engine', 'moodle-core-formchangechecker'),\n 'strings' => array(\n array('cancel', 'moodle'),\n array('flagged', 'question'),\n array('functiondisabledbysecuremode', 'quiz'),\n array('startattempt', 'quiz'),\n array('timesup', 'quiz'),\n array('changesmadereallygoaway', 'moodle'),\n ),\n );\n}",
"public function getIncludeScripts() {\n return array('http://maps.google.com/maps/api/js?sensor='\n . ($this->locatesUser ? 'true' : 'false'));\n }",
"public function get_js_module() {\n return array(\n 'name' => 'format_flexpage',\n 'fullpath' => '/course/format/flexpage/javascript.js',\n 'requires' => array(\n 'base',\n 'node',\n 'event-custom',\n 'json-parse',\n 'querystring',\n 'yui2-yahoo',\n 'yui2-dom',\n 'yui2-connection',\n 'yui2-dragdrop',\n 'yui2-event',\n 'yui2-element',\n 'yui2-button',\n 'yui2-container',\n 'yui2-menu',\n 'yui2-calendar',\n 'moodle-core-popuphelp'\n ),\n 'strings' => array(\n array('savechanges'),\n array('cancel'),\n array('choosedots'),\n array('close', 'form'),\n array('close', 'format_flexpage'),\n array('addpages', 'format_flexpage'),\n array('genericasyncfail', 'format_flexpage'),\n array('error', 'format_flexpage'),\n array('movepage', 'format_flexpage'),\n array('addactivities', 'format_flexpage'),\n array('formnamerequired', 'format_flexpage'),\n array('deletepage', 'format_flexpage'),\n array('deletemodwarn', 'format_flexpage'),\n array('continuedotdotdot', 'format_flexpage'),\n array('warning', 'format_flexpage'),\n array('actionbar', 'format_flexpage'),\n array('actionbar_help', 'format_flexpage'),\n )\n );\n }",
"protected function initFileIncluded() {\n\t\treturn [\n\t\t\t'JQUERY' => env_checker()['JQUERY'],\n\t\t\t'POPPER' => env_checker()['POPPER'],\n\t\t\t'TWBS_CSS' => env_checker()['TWBS_CSS'],\n\t\t\t'TWBS_JS' => env_checker()['TWBS_JS'],\n\t\t\t'title' => 'Sistem Informasi'\n\t\t];\n\t}",
"public function getRequire() {\n $content = $this->readFile();\n if (array_key_exists('require', $content)) {\n return $content['require'];\n }\n return [];\n }",
"private function load_module_info() {\n\t\t$data = array ();\n\t\t$data['module_label'] = $this->module_label;\n\t\t$data['module_labels'] = $this->module_labels;\n\t\t$data['module'] = $this->module;\n\t\treturn $data;\n\t}",
"public function get_js_common()\n {\n return array();\n }",
"public function getJs()\n {\n $result = array();\n foreach ($this->_packages as $package) {\n $config = $this->getConfig($package);\n if (!empty($config['js'])) {\n $result = array_merge($result, array_values($config['js']));\n }\n }\n return array_merge($result, $this->_js);\n }",
"public function getPackageMap()\n {\n return $this->map;\n }",
"public static function getMap()\n\t\t{\n\n\t\t\t$reflectionClass = new ReflectionClass(static::class);\n\t\t\treturn array_flip($reflectionClass->getConstants());\n\n\t\t}",
"public static function js_requirements(): array\n {\n $array = [];\n $api = Config::inst()->get(GoogleAddressField::class, 'google_map_api_location');\n $js_location = Config::inst()->get(GoogleAddressField::class, 'field_js_location');\n $js = ModuleResourceLoader::singleton()->resolveURL($js_location);\n if ($api) {\n $array[] = $api\n . '?'\n . '&libraries=places'\n . '&key=' . Config::inst()->get(GoogleAddressField::class, 'api_key');\n }\n if ($js) {\n $array[] = $js;\n }\n\n return $array;\n }",
"public function getJs();",
"public function getIncludedModules ();",
"public function getScripts()\n {\n $scripts = array();\n switch ($this->_jsEngine) {\n\n case self::ENGINE_MOOTOOLS:\n $scripts[] = $this->_confs['mootools']['path'] . $this->_confs['mootools']['name'];\n if ($this->_chartType === self::HIGHCHART) {\n $scripts[] = $this->_confs['highchartsMootoolsAdapter']['path'] . $this->_confs['highchartsMootoolsAdapter']['name'];\n } else {\n $scripts[] = $this->_confs['highstockMootoolsAdapter']['path'] . $this->_confs['highstockMootoolsAdapter']['name'];\n }\n break;\n\n case self::ENGINE_PROTOTYPE:\n $scripts[] = $this->_confs['prototype']['path'] . $this->_confs['prototype']['name'];\n if ($this->_chartType === self::HIGHCHART) {\n $scripts[] = $this->_confs['highchartsPrototypeAdapter']['path'] . $this->_confs['highchartsPrototypeAdapter']['name'];\n } else {\n $scripts[] = $this->_confs['highstockPrototypeAdapter']['path'] . $this->_confs['highstockPrototypeAdapter']['name'];\n }\n break;\n }\n\n switch ($this->_chartType) {\n case self::HIGHCHART:\n $scripts[] = $this->_confs['highcharts']['path'] . $this->_confs['highcharts']['name'];\n break;\n\n case self::HIGHSTOCK:\n $scripts[] = $this->_confs['highstock']['path'] . $this->_confs['highstock']['name'];\n break;\n\n case self::HIGHMAPS:\n $scripts[] = $this->_confs['highmaps']['path'] . $this->_confs['highmaps']['name'];\n break;\n }\n\n //Include scripts with keys given to be included via includeExtraScripts\n if (!empty($this->_extraScripts)) {\n foreach ($this->_extraScripts as $key) {\n $scripts[] = $this->_confs['extra'][$key]['path'] . $this->_confs['extra'][$key]['name'];\n }\n }\n\n return $scripts;\n }",
"public function getLoadedModules() {}",
"function getJs () {\n // some settings for controlling\n\n\t\t// map type\n\t\t$markerArray['###MAP_TYPE_MAPNIK###'] = $markerArray['###MAP_TYPE_TAH###'] = 0;\n\t\tif ($this->config['mapType'] != '') {\n\t\t\t// mapnik typoe\n\t\t\tif (strpos($this->config['mapType'], 'MAPNIK') !== FALSE) {\n\t\t\t\t$this->config['mapType'] = t3lib_div::rmFromList('MAPNIK', $this->config['mapType']);\n\t\t\t\t$markerArray['###MAP_TYPE_MAPNIK###'] = 1;\n\t\t\t\t$markerArray['###MAP_TYPE_MAPNIK_TITLE###'] = $this->conf['map.']['mapnik_title'];\n\t\t\t}\n\t\t\t// tiles@home typoe\n\t\t\tif (strpos($this->config['mapType'], 'TAH') !== FALSE) {\n\t\t\t\t$this->config['mapType'] = t3lib_div::rmFromList('TAH', $this->config['mapType']);\n\t\t\t\t$markerArray['###MAP_TYPE_TAH###'] = 1;\n\t\t\t\t$markerArray['###MAP_TYPE_TAH_TITLE###'] = $this->conf['map.']['tah_title'];\n\t\t\t}\n\n\t\t\t// check again because could be that mapnik / TAH are the only one selected\n\t\t\tif ($this->config['mapType'] == '') {\n\t\t\t\t$this->config['mapType'] = 'G_NORMAL_MAP';\n\t\t\t}\n\n\t\t\t$markerArray['###MAP_TYPES###'] = ',{mapTypes:[' . $this->config['mapType'] . ']}';\n\n\t\t}\n\n\t\tswitch ($this->config['mapNavControl']) {\n\t\t\tcase 'small':\n\t\t\tcase 1:\n\t\t\t\t$settings = 'map.addControl(new GSmallMapControl());';\n\t\t\t\tbreak;\n\t\t\tcase 'large':\n\t\t\tcase 2:\n\t\t\t\t$settings = 'map.addControl(new GLargeMapControl());';\n\t\t\t\tbreak;\n\t\t}\n\t\tif ($this->config['mapTypeControl'] == 'show' || $this->config['mapTypeControl'] == '1') {\n\t\t\t$settings .= 'map.addControl(new GMapTypeControl());';\n\t\t}\n\t\tif ($this->config['mapOverview'] == 1) {\n\t\t\t$settings .= 'map.addControl(new GOverviewMapControl());';\n\t\t}\n\n\t\tif ($this->config['mapControlOnMouseOver'] == 1) {\n\t\t\t$hideControlsOnMouseOut = 'map.hideControls();\n\t\t\t\tGEvent.addListener(map, \"mouseover\", function(){\n\t\t\t\tmap.showControls();\n\t\t\t\t});\n\t\t\t\tGEvent.addListener(map, \"mouseout\", function(){\n\t\t\t\tmap.hideControls();\n\t\t\t\t});';\n\t\t}\n\t\tif ($this->conf['enableDoubleClickZoom'] == 1) {\n\t\t\t$settings .= 'map.enableDoubleClickZoom();';\n\t\t}\n\t\tif ($this->conf['enableContinuousZoom'] == 1) {\n\t\t\t$settings .= 'map.enableContinuousZoom();';\n\t\t}\n\t\tif ($this->conf['enableScrollWheelZoom'] == 1) {\n\t\t\t$settings .= 'map.enableScrollWheelZoom();';\n\t\t}\n\n\t\t// urls\n\t\t$xmlUrlConf = $this->conf['xmlURL.'];\n\n\t\t\t// disable realurl for the xml url\n\t\t$realurlTmp = $GLOBALS['TSFE']->config['config']['tx_realurl_enable'];\n\t\t$GLOBALS['TSFE']->config['config']['tx_realurl_enable'] = 0;\n\t\t$url = $this->cObj2->typolink('', $xmlUrlConf);\n\t\t$GLOBALS['TSFE']->config['config']['tx_realurl_enable'] = $realurlTmp;\n\n\n\n\t\t$urlForIcons = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'uploads/tx_rggooglemap/';\n\t\t$urlExt = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\t// records for the selected categories\n\t\tif ($this->config['categoriesActive'] != '') {\n\t\t\t$selectedCat = 'var cat = new Array();\n\t\t\tcat[\"cb\"] = new Object();';\n\t\t\t$cats = t3lib_div::trimExplode(',', $this->config['categoriesActive']);\n\t\t\tforeach ($cats as $key => $value) {\n\t\t\t\t$selectedCat .= 'cat[\"cb\"]['.$value.'] = ' . $value . ';';\n\t\t\t}\n\t\t\t$selectedCat .= ' tx_rggooglemap_pi1processCat(cat);';\n\t\t} else {\n\t\t\t$selectedCat = ' tx_rggooglemap_pi1processCat(\"default\");';\n\t\t}\n\n\t\t// use cluster, default = 0\n\t\tswitch ($this->conf['map.']['activateCluster']) {\n\t\t\tcase 1:\n\t\t\t\t$addMarker = 'clusterer.AddMarker(marker,title);';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$addMarker = 'map.addOverlay( marker );';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$addMarker = 'map.addOverlay( marker );';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 0;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$markerArray['###HIDECONTROLSMOUSEOUT###'] = $hideControlsOnMouseOut;\n\t\t$markerArray['###POI_ON_START###'] = $this->getPoiOnStart();\n\t\t$markerArray['###SETTINGS###'] = $settings;\n\t\t$markerArray['###MAP_ZOOM###'] = $this->config['mapZoom'];\n\t\t$markerArray['###MAP_LNG###'] = $this->config['mapLng'];\n\t\t$markerArray['###MAP_LAT###'] = $this->config['mapLat'];\n\t\t$markerArray['###MAP_DIV###'] = $this->config['mapDiv'];\n\t\t$markerArray['###SELECTED_CAT###'] = $selectedCat;\n\t\t$markerArray['###ADD_MARKER###'] = $addMarker;\n\t\t$markerArray['###URL_ICONS###'] = $urlForIcons;\n\t\t$markerArray['###URL###'] = $url;\n\t\t$markerArray['###BOUNDS###'] = intval($this->config['useBoundsOnStart']);\n\t\t$markerArray['###DEBUG###'] = ($this->conf['map.']['debug']==1) ? '' : '//';\n\n\t\t// get coordinates from user's browser\n\t\t$markerArray['###USE_USER_LOCATION###'] = intval($this->conf['map.']['useUserLocationForMapCenter']) == 1 ? 1 : 0;\n\t\t$markerArray['###USE_USER_LOCATION_ZOOMLEVEL###'] = intval($this->conf['map.']['useUserLocationForMapCenter.']['zoomLevel']) == 0 ? 0 : intval($this->conf['map.']['useUserLocationForMapCenter.']['zoomLevel']);\n\n\t\t// create the gicons JS, needed for valid sizes, don't trust JS on that...\n\t\t$gicon = '';\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,image', 'tx_rggooglemap_cat', 'hidden=0 AND deleted=0');\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\n\t\t\t// set the correct paths if no icon is found\n\t\t\tif ($row['image'] == '') {\n\t\t\t\t$iconPath = $this->conf['map.']['defaultIcon'];\n\t\t\t\t$iconPathJS\t= t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $this->conf['map.']['defaultIcon'];\n\t\t\t} else {\n\t\t\t\t$iconPath = 'uploads/tx_rggooglemap/' . $row['image'];\n\t\t\t\t$iconPathJS\t= $urlForIcons.$row['image'];\n\t\t\t}\n\n\t\t\t$iconSize = @getimagesize($iconPath);\n\n\t\t\t// If icon size can't be get with php, use settings from TS\n\t\t\tif (!is_array($iconSize)) {\n\t\t\t\t$iconSizeConf = $this->conf['map.']['iconSize.'];\n\n\t\t\t\t$current = $row['uid'] . '.';\n\t\t\t\t$width = (intval($iconSizeConf[$current]['width']) > 0) ? intval($iconSizeConf[$current]['width']) : intval($iconSizeConf['default.']['width']);\n\t\t\t\t$height = (intval($iconSizeConf[$current]['height']) > 0) ? intval($iconSizeConf[$current]['height']) : intval($iconSizeConf['default.']['height']);\n\t\t\t} else {\n\t\t\t\t$width = $iconSize[0];\n\t\t\t\t$height = $iconSize[1];\n\t\t\t}\n\n\t\t\t$key = 'gicons[' . $row['uid'] . ']';\n\t\t\t$gicon .= $key . '= new GIcon(baseIcon);' . chr(10);\n\t\t\t$gicon .= $key . '.image = \"'.$iconPathJS.'\";' . chr(10);\n\t\t\t$gicon .= $key . '.iconSize = new GSize('.$width.', '.$height.');' . chr(10);\n\t\t\t$gicon .= $key . '.iconAnchor = new GPoint(' . ($width / 2) . ', ' . ($height / 2) . ');' . chr(10);\n\t\t\t$gicon .= $key . '.infoWindowAnchor = new GPoint(' . ($width / 2) . ', ' . ($height / 2) . ');' . chr(10) . chr(10);\n\t\t}\n\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\t$markerArray['###GICONS###'] = $gicon;\n\n\t\tif ($this->conf['map.']['activateCluster'] == 3) {\n\t\t\t$icon = str_replace('###CURRENT_URL###', t3lib_div::getIndpEnv('TYPO3_SITE_URL'), $this->conf['map.']['activateCluster.']['3.']['icon']);\n\t\t\t$markerArray['###GICONS###'].= $icon;\n\t\t}\n\n\t\t\t// Hook for adding client-processing code for the additional datasets which were generated within method getJs()\n\t\t$markerArray['###PROCESS_DATASETS###'] = '';\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t// Test if method exists as it might make sense not creating it for each corresponding hook entry\n\t\t\t\tif (method_exists($_procObj, 'getDatasetJSProcessing')) {\n\t\t\t\t\t$markerArray['###PROCESS_DATASETS###'] .= $_procObj->getDatasetJSProcessing($this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// Hook for processing of extra javascript\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$markerArray = $_procObj->extraGetJsProcessor($markerArray, $this);\n\t\t\t}\n\t\t}\n\n\t\t$jsTemplateCode = $this->cObj2->fileResource($this->conf['templateFileJS']);\n\t\t$template['all'] = $this->cObj2->getSubpart($jsTemplateCode, '###ALL###');\n\n\t\t$js = $this->cObj2->substituteMarkerArrayCached($template['all'], $markerArray);\n\n\t\treturn $js;\n\t}",
"public static function getCommandMap($keep = false) {\n\t if(!isset(self::$commandMap)) {\n\t $filename = self::getMapDir().'/'. self::getScope().'.php';\n\t if (!($map = @include ($filename))) {\n\t trigger_error ( \"Could not load $filename\", E_USER_WARNING );\n\t $map = array();\n\t }\n\t if($keep) {\n\t self::$commandMap = $map;\n\t }\n\t } else {\n\t $map = self::$commandMap;\n\t if(!$keep) {\n\t self::$commandMap = null;\n\t }\n\t }\n\t\treturn $map;\n\t}",
"function loadFileMap()\r\n{\r\n return false;\r\n $file_map_path = Gravitycar\\lib\\builders\\FileMapBuilder::getFileMapPath();\r\n if (file_exists($file_map_path)) {\r\n require_once($file_map_path);\r\n } else {\r\n buildFileMap();\r\n require_once($file_map_path);\r\n }\r\n return $map;\r\n}",
"public static function getMap()\n {\n return self::$map;\n }",
"public function loadModuleData() {}",
"public function getJavascriptIncludes() {}",
"public function loadInit() {}",
"protected function generateJson(){\n\n $sourceMap = array();\n $mappings = $this->generateMappings();\n\n // File version (always the first entry in the object) and must be a positive integer.\n $sourceMap['version'] = self::VERSION;\n\n\n // An optional name of the generated code that this source map is associated with.\n $file = $this->getOption('sourceMapFilename');\n if( $file ){\n $sourceMap['file'] = $file;\n }\n\n\n // An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry.\tThis value is prepended to the individual entries in the 'source' field.\n $root = $this->getOption('sourceRoot');\n if( $root ){\n $sourceMap['sourceRoot'] = $root;\n }\n\n\n // A list of original sources used by the 'mappings' entry.\n $sourceMap['sources'] = array();\n foreach($this->sources as $source_uri => $source_filename){\n $sourceMap['sources'][] = $this->normalizeFilename($source_filename);\n }\n\n\n // A list of symbol names used by the 'mappings' entry.\n $sourceMap['names'] = array();\n\n // A string with the encoded mapping data.\n $sourceMap['mappings'] = $mappings;\n\n if( $this->getOption('outputSourceFiles') ){\n // An optional list of source content, useful when the 'source' can't be hosted.\n // The contents are listed in the same order as the sources above.\n // 'null' may be used if some original sources should be retrieved by name.\n $sourceMap['sourcesContent'] = $this->getSourcesContent();\n }\n\n // less.js compat fixes\n if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){\n unset($sourceMap['sourceRoot']);\n }\n\n return json_encode($sourceMap);\n }",
"function getMap()\n {\n return array();\n }",
"public function getGoogleMapJS()\n\t{\n\t\tif(!isset($oGoogleMapService))\n\t\t\t$oGoogleMapService = Phpfox::getService('gmap.googlemap');\n\t\n\t\treturn $oGoogleMapService->getGoogleMap();\n\t}",
"function getScripts () {\n return array(\"template.js\");\n }",
"public function getClassMap()\n {\n return array();\n }"
]
| [
"0.68215054",
"0.6075022",
"0.5759074",
"0.5734098",
"0.5694984",
"0.5642087",
"0.5634207",
"0.5632614",
"0.55906177",
"0.5569664",
"0.5560661",
"0.55099",
"0.550801",
"0.54890877",
"0.54742324",
"0.5432718",
"0.5430894",
"0.5411922",
"0.5376324",
"0.5352512",
"0.5337745",
"0.5301415",
"0.52845776",
"0.52652127",
"0.52425134",
"0.52284056",
"0.5225892",
"0.5211285",
"0.5210015",
"0.52025056"
]
| 0.70515954 | 0 |
funcao que insere agencia | function inserirAgencia(){
$banco = abrirBanco();
//declarando as variáveis usadas na inserção dos dados
$nomeAgencia = $_POST["nomeAgencia"];
$cidadeAgencia = $_POST["cidadeAgencia"];
//a consulta sql
$sql = "INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')";
//executando a inclusão
$banco->query($sql);
//fechando a conexao com o banco
$banco->close();
voltarIndex();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function inserir()\n {\n }",
"public function inserir() {\n $query = '\n insert into tb_atividade(\n id_evento, nome, qntd_part, inscricao, valor, tipo, carga_hr, data_inicio, data_fim\n ) values ( \n :id_evento, \n :nome, \n :qntd_part, \n :inscricao, \n :valor, \n :tipo, \n :carga_hr, \n :data_inicio, \n :data_fim\n )';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id_evento', $this->atividade->__get('id_evento'));\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }",
"public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }",
"public function insertar($objeto){\r\n\t}",
"function AgenteInsert($Nombre, $Contacto, $Notas, $NombreArchivo, $Uuid, $IdInmobiliaria) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]agentes set\r\n\t\tNombre = '$Nombre',\r\n\t\tContacto = '$Contacto',\r\n\t\tNotas = '$Notas',\r\n\t\tNombreArchivo = '$NombreArchivo',\r\n\t\tUuid = '$Uuid',\r\n\t\tIdInmobiliaria = $IdInmobiliaria\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}",
"function insertar($bd);",
"public function insert($aluno) {\n\t}",
"function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}",
"function inserir($cidade, $bairro, $rua, $numeroTerreno, $quantidadeCasa, $valor, $idUsuario) #Funcionou\n {\n $conexao = new conexao();\n $sql = \"insert into terreno( Cidade, Bairro, Rua, NumeroTerreno, QuantidadeCasa, Valor, idUsuario) \n values('$cidade', '$bairro', '$rua', '$numeroTerreno', '$quantidadeCasa', '$valor', $idUsuario )\";\n mysqli_query($conexao->conectar(), $sql);\n echo \"<p> Inserido </p>\";\n }",
"public function insert($tienda);",
"public function insert($permiso);",
"public function insert($tarConvenio);",
"public function insert($actividades_fuera);",
"public function insert($usuario_has_hojaruta);",
"public function insert($otros_votos);",
"protected function fijarSentenciaInsert(){}",
"public function insert($producto);",
"protected function saveInsert()\n {\n }",
"function insertarAgencias($agencia,$email) {\r\n$sql = \"insert into tbagencias(idagencia,agencia,email)\r\nvalues ('','\".($agencia).\"','\".($email).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"public function insert($cotizacion);",
"function insertEtiquetaImpresa($etiqueta){\r\n\t\t\r\n\t$query = sprintf('INSERT INTO etiq_impresas(etiq_impresas_id, nombre, grupo, material, descripcion, ancho, alto, cantidad, colores, cambios, cliches, acabado, coste) VALUES (%d, \"%s\", \"%s\", %d, \"%s\", %f, %f, %d, %d, %d, %d, %d, %f)',\r\n\tgetUltimoArticulo()+1,\r\n\t$etiqueta->nombre,\r\n\t$etiqueta->grupo,\r\n\t$etiqueta->material,\r\n\t$etiqueta->descripcion,\r\n\t$etiqueta->ancho,\r\n\t$etiqueta->alto,\r\n\t$etiqueta->cantidad,\r\n\t$etiqueta->colores,\r\n\t$etiqueta->cambios,\r\n\t$etiqueta->cliches,\r\n\t$etiqueta->acabado,\r\n\t$etiqueta->coste);\r\n\tinsert_db($query);\r\n\t}",
"abstract public function insert();",
"public function insert($nu_pcp_op, $qtd_produzir, $qtd_produto,$dt_emissao, $ds_produto, $co_int_produto, $nu_lote, $nu_comprimento, $nu_largura, $nu_espessura,$corte_espessura, $co_pcp_ac, $tp_produto, $no_cor,$fator)\r\n\t{\r\n\t\t$row = $this->getMedidaCorte($co_pcp_ac, $co_int_produto);\r\n\t\t$sql = \"INSERT INTO tb_pcp_etiqueta (\r\n\t\t\t\t\tnu_pcp_op\r\n\t\t\t\t,\tqtd_produzir\r\n\t\t\t\t,\tqtd_produto\r\n\t\t\t\t,\tdt_emissao\r\n\t\t\t\t,\tds_produto\r\n\t\t\t\t,\tco_int_produto\r\n\t\t\t\t,\tnu_lote\r\n\t\t\t\t,\tnu_comprimento\r\n\t\t\t\t,\tnu_largura\r\n\t\t\t\t,\tcorte_nu_comprimento\r\n\t\t\t\t,\tcorte_nu_largura\r\n\t\t\t\t,\tcorte_nu_espessura\r\n\t\t\t\t,\tnu_espessura\r\n\t\t\t\t,\tco_pcp_ac\r\n\t\t\t\t,\ttp_produto\r\n\t\t\t\t,\tno_cor\r\n\t\t\t\t,\tnu_fator_multiplicador)\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'\".addslashes($nu_pcp_op).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produzir).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produto).\"'\r\n\t\t\t\t, '\".addslashes($dt_emissao).\"'\r\n\t\t\t\t, '\".addslashes($ds_produto).\"'\r\n\t\t\t\t, '\".addslashes($co_int_produto).\"'\r\n\t\t\t\t, '\".addslashes($nu_lote).\"'\r\n\t\t\t\t, '\".addslashes($nu_comprimento).\"'\r\n\t\t\t\t, '\".addslashes($nu_largura).\"'\r\n\t\t\t\t, '\".addslashes($row[0]).\"'\r\n\t\t\t\t, '\".addslashes($row[1]).\"'\r\n\t\t\t\t, '\".addslashes($corte_espessura).\"'\r\n\t\t\t\t, '\".addslashes($nu_espessura).\"'\r\n\t\t\t\t, \".$co_pcp_ac.\"\r\n\t\t\t\t, '\".addslashes($tp_produto).\"'\r\n\t\t\t\t, '\".addslashes($no_cor).\"'\r\n\t\t\t\t, '\".addslashes($fator).\"')\";\r\n\t\tmysql_query($sql,$this->conexaoERP);\r\n\t}",
"public abstract function insert();",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"public function agregarComentario($coment){\n \n $cliente=array(\n 'va_nombre_cliente'=>$coment['va_nombre'],\n 'va_email'=>$coment['va_email'], \n );\n $insert = $this->tableGateway->getSql()->insert()->into('ta_cliente')\n ->values($cliente);\n $statement = $this->tableGateway->getSql()->prepareStatementForSqlObject($insert);\n \n $statement->execute(); \n// $selectString2 = $this->tableGateway->getSql()->getSqlStringForSqlObject($insert);\n// $adapter=$this->tableGateway->getAdapter();\n// $result = $adapter->query($selectString2, $adapter::QUERY_MODE_EXECUTE);\n $idcliente=$this->tableGateway->getAdapter()->getDriver()->getLastGeneratedValue();//$this->tableGateway->getLastInsertValue();\n// var_dump($idcliente);Exit;\n\n// date_default_timezone_set('UTC');\n $comentario = array(\n 'tx_descripcion' => $coment['tx_descripcion'],\n 'Ta_plato_in_id' => $coment['Ta_plato_in_id'],\n 'Ta_cliente_in_id' => $idcliente,//$coment->Ta_cliente_in_id,\n 'Ta_puntaje_in_id' => $coment['Ta_puntaje_in_id'],\n 'Ta_plato_in_id'=>35,\n 'da_fecha'=>date('c')//date('Y-m-dTH:i:s.uZ')//'2013-12-12'\n );\n \n $id = (int) $coment['in_id'];\n if ($id == 0) { \n $insertcoment= $this->tableGateway->getSql()->insert()->into('ta_comentario')\n ->values($comentario);\n $statement2 = $this->tableGateway->getSql()->prepareStatementForSqlObject($insertcoment);\n $statement2->execute(); \n\n }\n \n }",
"public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }",
"public function insert($contenido);",
"public function insert($maeMedico);"
]
| [
"0.7317266",
"0.70757943",
"0.7013392",
"0.6997842",
"0.69646317",
"0.69528013",
"0.6949227",
"0.69331664",
"0.686351",
"0.68526584",
"0.68459475",
"0.6799076",
"0.67926675",
"0.67367244",
"0.6685608",
"0.66828966",
"0.66764516",
"0.6674532",
"0.66578585",
"0.66477484",
"0.66356593",
"0.6623873",
"0.66115177",
"0.6611099",
"0.6606185",
"0.6606185",
"0.6602472",
"0.6584123",
"0.6571118",
"0.6560133"
]
| 0.73745555 | 0 |
A test when there is a user logged in the status is logged in | public function testLoggedStatus(){
Session::flush();
$user = $this->postuser();
$status_message = $this->getStatus();
$this->assertResponseOk();
$this->assertTrue($status_message['message'] == 'user logged in');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function logInUserChangesToLoggedInStatus() {\n\t\t$user = new Tx_Oelib_Model_FrontEndUser();\n\t\t$this->subject->logInUser($user);\n\n\t\t$this->assertTrue(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}",
"public function loginUserConditionMatchesSingleLoggedInUser() {}",
"public function loginUserConditionMatchesSingleLoggedInUser() {}",
"protected function isUserLoggedIn() {}",
"protected function isUserLoggedIn() {}",
"public function testLoggedIn()\n {\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('success', $decoded->status);\n\n $this->assertEquals(true, $decoded->data->logged_in);\n }",
"public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }",
"private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }",
"public function loginUserConditionMatchesAnyLoggedInUser() {}",
"public function loginUserConditionMatchesAnyLoggedInUser() {}",
"abstract protected function isUserLoggedIn() ;",
"public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }",
"public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}",
"public function loginUserConditionMatchIfUserIsNotLoggedIn() {}",
"public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }",
"public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Partner) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }",
"public function is_logged_in() {\n\n\t}",
"public function testClientsPageAsLoggedInUser() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/clients')\n ->see($user->email);\n\n }",
"private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }",
"public function GetUserLoggedInStatus()\n {\n \n $this->User_Logged_In = isset($_SESSION['USER_LOGIN']['LOGIN_RECORD']) ? true : false;\n }",
"public function test_user_can_be_logged_in()\n {\n $user = factory(User::class)->create();\n\n $response = $this->actingAs($user)->get(route('login'));\n\n $response->assertRedirect('/home');\n }",
"public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}",
"function loggedin() {return $this->login_state!=0;}",
"public function testLoginIsOnlineTrue() : void\n {\n $res = self::$dataService->login( \"change_status\", $this->userA[\"id\"], \"\", \"\", [] );\n\n $this->assertIsArray( $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('status', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('msg', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('uid', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('name', $res, 'testLoginIsOnlineTrue' );\n $this->assertCount(4, $res, 'testLoginIsOnlineTrue' );\n $this->assertEquals( [ \"status\" => true, \"msg\" => \"Welcome back test5\", \"uid\" => \"112387623\", \"name\" => \"test5\" ], $res, 'testLoginIsOnlineTrue' );\n }",
"private function compare_with_login()\n {\n }",
"public static function sessionAndUserLoggedIn(){\n Verify::session();\n Verify::userLoggedIn();\n }",
"public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}",
"public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }",
"public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}",
"public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }"
]
| [
"0.7612605",
"0.7515454",
"0.7515185",
"0.74784476",
"0.74784476",
"0.73585045",
"0.72561693",
"0.7198328",
"0.7143894",
"0.71422756",
"0.70817685",
"0.7065611",
"0.70576364",
"0.69980127",
"0.69680476",
"0.6946099",
"0.693617",
"0.6929924",
"0.69293475",
"0.6911833",
"0.6887268",
"0.6883682",
"0.6878459",
"0.68489397",
"0.68361926",
"0.6832947",
"0.68302053",
"0.68048036",
"0.6792649",
"0.6782644"
]
| 0.7661023 | 0 |
Find the individual child nodes item has. From the example documentation, if the $item passed to this method was 'Italian', the result from this would assign a 'Pasta' and 'Pizza' node to the $result array. | private function childrenOf($item) {
$result = array();
foreach($this->items as $i) {
if ($i->parent_id == $item->id) {
$result[] = $i;
}
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function itemWithChildren($item) {\n $result = array();\n $children = $this->childrenOf($item);\n foreach ($children as $child) {\n $newItem = array();\n $newItem['title'] = $child->title;\n $newItem['children'] = $this->itemWithChildren($child);\n $newItem['parent_id'] = $child->parent_id;\n $newItem['user_id'] = $child->user_id;\n $newItem['points'] = $child->points;\n $newItem['is_done'] = $child->is_done;\n $newItem['id'] = $child->id;\n\n $newItem['status'] = empty($newItem['children']) ? $child->is_done : $this->getStatusFromChildren($newItem['children']);\n $newItem['total_points'] = empty($newItem['children']) ? $child->points : $this->sumOfChildrenPoints($newItem['children']);\n array_push($result, $newItem);\n }\n return $result;\n }",
"public function search($item)\n {\n $node = null;\n if (!$this->isEmpty()) {\n $node = $this->root->search($item);\n }\n return $node;\n }",
"protected function getChildrenRecursive($name, &$result)\n\t{\n\t\tItemHelper::getChildrenRecursive($name, $result, $this->children);\n\t}",
"public function getChildNodes() {}",
"public function getChildNodes() {}",
"abstract public function getItemChildren($itemName);",
"public function getChildNodes();",
"private function createItemArray()\n {\n $result = array();\n foreach($this->items as $item) {\n if ($item->parent_id == null) {\n $newItem = array();\n $newItem['title'] = $item->title;\n $newItem['children'] = $this->itemWithChildren($item);\n $newItem['parent_id'] = $item->parent_id;\n $newItem['user_id'] = $item->user_id;\n $newItem['points'] = $item->points;\n $newItem['is_done'] = $item->is_done;\n $newItem['id'] = $item->id;\n\n $newItem['status'] = empty($newItem['children']) ? $item->is_done : $this->getStatusFromChildren($newItem['children']);\n $newItem['total_points'] = empty($newItem['children']) ? $item->points : $this->sumOfChildrenPoints($newItem['children']);\n array_push($result, $newItem);\n }\n }\n return $result;\n }",
"function appendChildren ($item) {\n if (array_key_exists($item->name(),$this->parents)) {\n $this->menu[]=new Marker('start');\n foreach ( $this->children[$item->name()] as $child ) {\n $this->menu[]=$child;\n $this->appendChildren($child);\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }\n }",
"public function getChildren() {\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\t$children = $placeRepository->findAllChildren($this);\n\t\treturn $children;\n\t}",
"protected function children($item)\n {\n if ($item instanceof Item && $item->hasChildren()) {\n $this->render($item->getChildren());\n }\n }",
"protected function _renderChildren(ItemInterface $item, array $options)\n {\n if ($options['depth'] !== null) {\n $options['depth'] = $options['depth'] - 1;\n }\n\n if ($options['matchingDepth'] !== null &&\n $options['matchingDepth'] > 0\n ) {\n $options['matchingDepth'] = $options['matchingDepth'] - 1;\n }\n\n $children = [];\n foreach ($item->getChildren() as $child) {\n $children[] = $this->_renderItem($child, $options);\n }\n\n return $children;\n }",
"public function getChild($id){\n foreach ($this->children as $node){\n if($node->itemID === $id){\n return $node;\n }\n }\n return null;\n }",
"public function getDescendants();",
"public function getChildNodesById()\n {\n if (! $this->_allChildrenKnown) {\n $this->loadChildNodes();\n }\n return $this->_childNodesById;\n }",
"private function _findSingleNode($result)\n {\n if ($result->length) {\n return $result->item(0);\n }\n return false;\n }",
"public function find() {\n return call_user_func_array(array($this->children(), 'find'), func_get_args());\n }",
"public function getChildrenQuery();",
"public function element_get_childs($id) {\n global $db;\n $child_nodes = $db->fetch_table(\"SELECT ID_KAT, KAT_TABLE FROM `\".$this->table.\"`\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$id.\" ORDER BY ORDER_FIELD\");\n $childs = array();\n foreach ($child_nodes as $index => $data) {\n $childs[] = $this->element_read($data[\"ID_KAT\"]);\n }\n return $childs;\n }",
"public function get_children();",
"public function appendChildCopy($item) {}",
"public function FirstChildOf($item)\n {\n $sql = Access::SqlBuilder();\n if ($item)\n {\n $tblNavItem = NavigationItem::Schema()->Table();\n $where = $sql->IsNull($tblNavItem->Field('Previous'))\n ->And_($sql->Equals($tblNavItem->Field('Parent'), $sql->Value($item->GetID())));\n \n return NavigationItem::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }",
"public function getChildrenByName($name) {\n $this->select->from($this);\n $this->select->where(\"C.child_full_name LIKE ?\", '%' . $name . '%');\n\n return $this->fetchAll($this->select);\n }",
"function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }",
"public function getDescendants(NodeInterface $node)\r\n {\r\n $params = compact('node');\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, $params);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getDescendants($node);\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }",
"public function FirstChildOf($item)\n {\n if ($item)\n {\n $sql = Access::SqlBuilder();\n $tbl = PageContent::Schema()->Table();\n $where = $sql->Equals($tbl->Field('Parent'), $sql->Value($item->GetID()))\n ->And_($sql->IsNull($tbl->Field('Previous')));\n \n return PageContent::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }",
"public function getChilds();",
"public function analyse(object $item): array\n {\n $nodes = [];\n\n foreach ($item->categories as $category) {\n $nodes[] = new Relation\\Node('CATEGORY', $category);\n }\n\n foreach ($item->topics as $topic) {\n $nodes[] = new Relation\\Node('TOPIC', $topic);\n }\n\n return $nodes;\n }",
"public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }",
"public function getChildNodes() : array {\n return $this->childNodes;\n }"
]
| [
"0.6323263",
"0.57218003",
"0.527311",
"0.52576196",
"0.5255184",
"0.52422726",
"0.515096",
"0.50878656",
"0.49307808",
"0.492695",
"0.49257013",
"0.4924297",
"0.49222302",
"0.49186355",
"0.4890973",
"0.4869141",
"0.4862315",
"0.4861063",
"0.48282668",
"0.48101488",
"0.47987607",
"0.47925192",
"0.47903138",
"0.47838247",
"0.47727993",
"0.4763341",
"0.47449824",
"0.47421026",
"0.47402248",
"0.47111502"
]
| 0.6556531 | 0 |
Generate the HTML list () representation of the hierarchical array. | private function htmlFromArray($hierarchicalArray) {
$html = '';
foreach($hierarchicalArray as $item) {
$html .= "<ul>";
$html .= "<li style='color: ". ( ($item['status'] == 1) ? "green" : "red" ) ."'>". $item['title'] . "<span style='color:black;'> --- ". $item['total_points'] ."</span></li>";
if(count($item['children']) > 0) {
$html .= $this->htmlFromArray($item['children']);
}
$html .= "</ul>";
}
return $html;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeList($array) \n { \n //Base case: an empty array produces no list \n if (empty($array)) return '';\n\n //Recursive Step: make a list with child lists \n $output = '<ol class=\"dd-list\">'; \n foreach ($array as $key => $subArray) { \n $output .= '<li class=\"dd-item dd3-item\" data-id=\"' . $subArray['ID'] .'\">\n\t\t\t\t\t\t\t\t\t<div class=\"dd-handle dd3-handle\" > </div>\n\t\t\t\t\t\t\t\t\t<div class=\"dd3-content\" >' . $subArray['Title'] .'</div>'. makeList($subArray['children']) . '\n\t\t\t\t\t\t</li>'; \n } \n $output .= '</ol>'; \n \n return $output; \n }",
"public function treeUl($list) {\n $output = '';\n if (is_array($list) || $list instanceof Iterator) {\n if (count($list) > 0) {\n $output = \"<ul>\\n\";\n foreach ($list as $item) {\n $output .= \"\\t<li>\";\n if(is_string($item)) {\n $output .= $this->_view->escape($item);\n } else {\n $output .= $this->treeUl($item);\n }\n $output .= \"</li>\\n\";\n }\n $output .= \"</ul>\\n\";\n }\n }\n return $output;\n }",
"function toHTML($array_name, $ident = 0, $mark=\"\"){\n static $s1;\n if (is_array($array_name)){\n $s1=$s1.'<ul class=\"level_'.$ident.'\">\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.'\">'.$k .'</li>'. \" \" . \"\n \";\n $this->toHTML($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.' \">'.$k . \"</li>\n \" . $v .\"\";\n }\n }\n $s1=$s1.'</ul>\n ';\n }else{\n $s1=$s1.\"Error = \" . $array_name;\n }\n return $s1;\n }",
"function make_list(array $array)\n {\n echo \"<ul>\";\n \n foreach($array as $numb)\n {\n make_tag(\"li\", $numb);\n }\n\n echo \"</ul>\";\n }",
"function scrappy_renderList( $data ) {\n if ( !is_array( $data ) ) return; \n $html = '';\n foreach ( $data as $key => $value ) {\n $html .= '<ul style=\"padding-left:15px\">';\n if (is_object( $value ) ) $value = get_object_vars( $value );\n if (is_array( $value ) ) {\n $html .= '<li><strong>' . $key .':</strong> ';\n $html .= scrappy_renderList( $value );\n $html .= '</li>';\n } else {\n $html .= '<li><strong>' . $key .':</strong> '. $value . '</li>';\n }\n $html .= '</ul>'; \n }\n return $html;\n}",
"public function toHtml() {\n\t\techo '<ol '.$this->getAttributes().'>'.$this->renderChildren().'</ol>';\n\t}",
"public function __toString()\n\t{\n\t\t$list_html = $this->build_list($this->data);\n\t\t\n\t\treturn $list_html;\n\t}",
"public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }",
"function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for ($i = 0; $i < sizeof($array); $i++) {\n $alist .= \"<li>$array[$i]\";\n }\n $alist .= \"</ul>\";\n return $alist;\n}",
"function htmldump ( $array ) {\r\n\t\tforeach($array as $key => $val) {\r\n\t\t\t$return .= $this->ul(\r\n\t\t\t\t\t\t$this->li($this->font($key)) .\r\n\t\t\t\t\t\t\t$this->ul(\r\n\t\t\t\t\t\t\t\t$this->font(is_array($val) ? $this->htmldump($val) : $this->li($val))\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}",
"public static function htmlList(array $elements, $recursive = false)\n {\n static $level = 0;\n \n $output = \"<ul class='level_{$level}'>\";\n \n foreach ($elements as $element)\n {\n if(is_array($element) && !empty($element))\n {\n $level++;\n $output .= self::htmlList($element, $recursive);\n }\n else\n $output .= \"<li class='level_{$level}'>{$element}</li>\";\n }\n return $output .= '</ul>';\n }",
"public function asHtmlRecursive()\n {\n $html = $this->asHtml() . '<ul id=\"' . $this->getPrefix() . '__'\n . $this->getId() . '__children\" class=\"rule-param-start\">';\n foreach ($this->getConditions() as $cond) {\n $html .= '<li>' . $cond->asHtmlRecursive() . '</li>';\n }\n $html .= '<li>' . $this->getNewChildElement()->getHtml() . '</li></ul>';\n\n return $html;\n }",
"function listArrayRecursive($array_name, $ident = 0, $mark=\"\"){\n static $s;\n if (is_array($array_name)){\n $s=$s.'<ul>\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s=$s.$mark; }\n $s=$s.'<li>'.$k .'</li>\n';\n $this->listArrayRecursive($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s=$s.$mark; }\n $s=$s.'<li>'.$k . \"</li>\" . $v . \"\n \";\n }\n \n }\n $s=$s.'</ul>\n ';\n }else{\n $s=$s.\"Error = \" . $array_name;\n }\n return $s;\n }",
"public function renderTree()\n {\n $structure = $this->_module->treeStructure + $this->_module->dataStructure;\n extract($structure);\n $nodeDepth = $currDepth = $counter = 0;\n $jsSelect = '$('.$this->id.').treeview(\"collapseAll\");';\n $out = Html::beginTag('ul', ['class' => 'kv-tree']) . \"\\n\";\n foreach ($this->_nodes as $node) {\n /**\n * @var Tree $node\n */\n if (!$this->isAdmin && !$node->isVisible() || !$this->showInactive && !$node->isActive()) {\n continue;\n }\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeDepth = $node->$depthAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeLeft = $node->$leftAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeRight = $node->$rightAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeKey = $node->$keyAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeName = $node->$nameAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIcon = $node->$iconAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIconType = $node->$iconTypeAttribute;\n\n $isChild = ($nodeRight == $nodeLeft + 1);\n $indicators = '';\n\n if (isset($this->nodeLabel)) {\n $label = $this->nodeLabel;\n $nodeName = is_callable($label) ? $label($node) :\n (is_array($label) ? ArrayHelper::getValue($label, $nodeKey, $nodeName) : $nodeName);\n }\n if ($nodeDepth == $currDepth) {\n if ($counter > 0) {\n $out .= \"</li>\\n\";\n }\n } elseif ($nodeDepth > $currDepth) {\n $out .= Html::beginTag('ul') . \"\\n\";\n $currDepth = $currDepth + ($nodeDepth - $currDepth);\n } elseif ($nodeDepth < $currDepth) {\n $out .= str_repeat(\"</li>\\n</ul>\", $currDepth - $nodeDepth) . \"</li>\\n\";\n $currDepth = $currDepth - ($currDepth - $nodeDepth);\n }\n if (trim($indicators) == null) {\n $indicators = ' ';\n }\n $nodeOptions = [\n 'data-key' => $nodeKey,\n 'data-lft' => $nodeLeft,\n 'data-rgt' => $nodeRight,\n 'data-lvl' => $nodeDepth,\n 'data-readonly' => static::parseBool($node->isReadonly()),\n 'data-movable-u' => static::parseBool($node->isMovable('u')),\n 'data-movable-d' => static::parseBool($node->isMovable('d')),\n 'data-movable-l' => static::parseBool($node->isMovable('l')),\n 'data-movable-r' => static::parseBool($node->isMovable('r')),\n 'data-removable' => static::parseBool($node->isRemovable()),\n 'data-removable-all' => static::parseBool($node->isRemovableAll()),\n ];\n\n $css = [];\n if (!$isChild) {\n $css[] = 'kv-parent ';\n }\n if (!$node->isVisible() && $this->isAdmin) {\n $css[] = 'kv-invisible';\n }\n if ($this->showCheckbox && in_array($node->id, $this->selected)) {\n $css[] = 'kv-selected ';\n $jsSelect .= '$('.$this->id.').treeview(\"checkNode\", \"'.$node->id.'\");';\n }\n if ($node->isCollapsed()) {\n $css[] = 'kv-collapsed ';\n }\n if ($node->isDisabled()) {\n $css[] = 'kv-disabled ';\n }\n if (!$node->isActive()) {\n $css[] = 'kv-inactive ';\n }\n $indicators .= $this->renderToggleIconContainer(false) . \"\\n\";\n $indicators .= $this->showCheckbox ? $this->renderCheckboxIconContainer(false) . \"\\n\" : '';\n if (!empty($css)) {\n Html::addCssClass($nodeOptions, $css);\n }\n $out .= Html::beginTag('li', $nodeOptions) . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-tree-list']) . \"\\n\" .\n Html::beginTag('div', ['class' => 'kv-node-indicators']) . \"\\n\" .\n $indicators . \"\\n\" .\n '</div>' . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-node-detail']) . \"\\n\" .\n $this->renderNodeIcon($nodeIcon, $nodeIconType, $isChild) . \"\\n\" .\n Html::tag('span', $nodeName, ['class' => 'kv-node-label']) . \"\\n\" .\n '</div>' . \"\\n\" .\n '</div>' . \"\\n\";\n ++$counter;\n }\n if (isset($jsSelect)) {\n $this->view->registerJs(\n $jsSelect,\n View::POS_READY,\n 'treeviewinput-selected'\n );\n }\n $out .= str_repeat(\"</li>\\n</ul>\", $nodeDepth) . \"</li>\\n\";\n $out .= \"</ul>\\n\";\n return Html::tag('div', $this->renderRoot() . $out, $this->treeOptions);\n }",
"function createList($array,$id='',$class='',$type='ul',$gilder='') {\n\tif(!is_array($array)) return false;\n\t\n\t$type = strtolower($type);\n\tif($type!='ul' && $type!='ol') $type = 'ul'; // defaults to <ul>\n\t\n\t$special = '';\n\tif(!is_array($class)) $class = array($class);\n\tif(in_array('hfeed',$class)) {\n\t\t$special = 'hfeed';\n\t\t$special_key = array_search($special, $class);\n\t\tunset($class[$special_key]);\n\t}\n\t\n\t$list = '';\n\t$array = array_values($array);\n\tfor($i=0; $i<count($array); $i++) {\n\t\t$list .= formatListItem($array,'li',$i,$special,$gilder);\n\t}\t\n\t\n\treturn '<'.$type.addAttributes('',$id,$class).'>'.\"\\n\".$list.'</'.$type.'>'.\"\\n\";\n}",
"public function generateTreeHtml()\n {\n $htmlWriter = new Writer();\n\n return $htmlWriter->render( $this->mapRedisSchema(), $this->getNamespaceSeparator() );\n }",
"function listify($array, $class='list', $vary=true, $textfield = false, $childfield = false){\n if(!$array) return;\n static $i = -1;\n static $recursion = 0;\n ++$recursion;\n if($vary === true) $vary = array('odd', 'even');\n $vlen = count($vary);\n $result = '';\n $result = '<ul'.($class?' class=\"'.$class.'\"':'').'>';\n foreach($array as $key => $li) {\n $result .= '<li'.($vary?' class=\"'.$vary[++$i%$vlen].'\"':'').'>'\n .($textfield ? @$li[$textfield] : (is_array($li) ? $key : $li))\n .(is_array($li)\n ? ($childfield\n ? (isset($li[$childfield])\n ? listify($li[$childfield], false, $vary, $textfield, $childfield)\n : ''\n )\n : listify($li, false, $vary, $textfield, $childfield)\n )\n : '');\n }\n $result .= '</ul>';\n --$recursion;\n if(!$recursion) $i = 0;\n return $result;\n}",
"function generate_tree_list($array, $parent = 0, $level = 0)\n\t{\n\t\t$has_children = false;\n\n\t\t// Loop through each item of the list array\n\t\tforeach($array as $key => $value)\n\t\t{\n\t\t\t// For the first run, get the first item with a parent_id of 0 (= root category)\n\t\t\t// (or whatever id is passed to the function)\n\t\t\t//\n\t\t\t// For every subsequent run, look for items with a parent_id matching the current item's key (id)\n\t\t\t// (eg. get all items with a parent_id of 2)\n\t\t\t//\n\t\t\t// This will return false (stop) when it find no more matching items/children\n\t\t\t//\n\t\t\t// If this array item's parent_id value is the same as that passed to the function\n\t\t\t// eg. [parent_id] => 0 == $parent = 0 (true)\n\t\t\t// eg. [parent_id] => 20 == $parent = 0 (false)\n\t\t\t//\n\t\t\tif ($value['cat_parent'] == $parent) \n\t\t\t{\n\t\t\t\t// Only print the wrapper ('<ul>') if this is the first child (otherwise just print the item) \n\t\t\t\t// Will be false each time the function is called again\n\t\t\t\tif ($has_children === false)\n\t\t\t\t{\n\t\t\t\t\t// Switch the flag, start the list wrapper, increase the level count\n\t\t\t\t\t$has_children = true; \n\t\t\t\t\tif($level==0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<ul id=\"browser\" class=\"filetree\">\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"\\n\".'<ul>';\n\t\t\t\t\t}\n\t\t\t\t\t$level++;\n\t\t\t\t}\n\t \t\t// Print the list item\n\t\t\t\techo \"\\n\".'<li><span class=\"folder\">' . $value['cat_name'] . '</span>';\n\t\t\t\techo $this->get_articles($value['cat_id'], $value['cat_uri']);\n\t\t\t\t// Repeat function, using the current item's key (id) as the parent_id argument\n\t\t\t\t// Gives us a nested list of subcategories\n\t\t\t\t$this->generate_tree_list($array, $key, $level); \n\t\t\t\t// Close the item\n\t\t\t\techo \"</li>\\n\";\n\t \t}\n\t\t}\n\t\t// If we opened the wrapper above, close it.\n\t \tif ($has_children === true) echo '</ul>'.\"\\n\";\n\t}",
"function printCollectionTree(){\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}",
"public function render()\n {\n $fromListTree = array();\n $this->getFromListTree($fromListTree);\n $style = $this->getStyle();\n $func = $this->getFunction();\n $valueList = array(); $valueArray = array();\n $this->getFromList($valueList, $this->getSelectedList());\n foreach ($valueList as $vl) {\n $valueArray[] = $vl['val'];\n }\n $sHTML = \"<script>\n \t\t\t\tvar \".$this->m_Name.\"_optlist = new Array(); \n \t\t\t\tvar \".$this->m_Name.\"_optlist_default = new Array();\n \t\t\t</script>\";\n $sHTML .= \"<div name=\\\"\" . $this->m_Name . \"\\\" ID=\\\"\" . $this->m_Name .\"\\\" $this->m_HTMLAttr $style>\";\n\t\t$sHTML .= \"<ul>\";\n\t\t$i = 0;\n foreach ($fromListTree as $treeNode)\n {\n\n //$sHTML .= \"<input type=\\\"checkbox\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"<br/>\";\n $sHTML .= \"<li style=\\\"padding-top:10px;\\\">\".str_repeat(\"- - \", $treeNode[\"level\"]).\"<strong>\".$treeNode['txt'].\"</strong>\".\"</li>\";\n $sublist = array();\n $this->getDOFromList($sublist, $this->getSelectFrom().\",[folder_id]='\".$treeNode['id'].\"'\");\n foreach($sublist as $option){\n $test = array_search($option['val'], $valueArray);\n\t if ($test === false)\n\t {\n\t $selectedStr = '';\n\t }\n\t else\n\t {\n\t $selectedStr = \"CHECKED\";\n\t $sHTML .= \"<script>\".$this->m_Name.\"_optlist_default.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n\t } \t\n \t$sHTML .= \"<li><label style=\\\"float:none;color:#888888;display:inline;\\\">\".str_repeat(\"- - \", $treeNode[\"level\"]).\"<input type=\\\"checkbox\\\" id=\\\"\".$this->m_Name.\"_\".$i.\"\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"</label></li>\";\n \t$sHTML .= \"<script>\".$this->m_Name.\"_optlist.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n \t$i++;\n }\n \n }\n $sHTML .= \"</ul></div>\";\n return $sHTML;\n }",
"function list_array( $des_array ){\n\tif( is_array( $des_array ) ){\n\t\techo '<ul>';\n\t\tforeach( $des_array as $item ){\n\t\t\techo '<li>' . $item . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}",
"public function renderList()\n {\n $html = '';\n foreach ($this->data as $listItem) {\n $html .= $this->render($listItem);\n }\n return $html;\n }",
"function renderTree($arvore) {\n $lastLevel = 0;\n//Outer list item\n $html = \"<ul class=\\\"jstree\\\">\";\n//Iterating tree from tree root\n foreach ($arvore->fetchTree() as $node) {\n//If we are on the item of the same level, closing <li> tag before printing item\n if (($node['level'] == $lastLevel) and ($lastLevel > 0)) {\n $html .= '</li>';\n }\n//If we are printing a next-level item, starting a new <ul>\n if ($node['level'] > $lastLevel) {\n $html .= '<ul>';\n }\n//If we are going to return back by several levels, closing appropriate tags\n if ($node['level'] < $lastLevel) {\n $html .= str_repeat(\"</li></ul>\", $lastLevel - $node['level']) . '</li>';\n }\n//Priting item without closing tag\n $html .= '\n <li id=\"tree_node[' . $node['uuid'] . ']\">\n <ins class=\"jstree-icon\"> </ins>\n <a><ins class=\"jstree-icon\"> </ins>' . $node['nome'] . '</a>';\n//Refreshing last level of the item\n $lastLevel = $node['level'];\n }\n $html .= \"</ul>\";\n return $html;\n}",
"function array_pp($arr){\n\t$retStr = '<ul>';\n\tif (is_array($arr)){\n\t\tforeach ($arr as $key=>$val){\n\n\t\t\t$key = str_replace('_', ' ', $key);\n\t\t\t$key = ucwords($key);\n\n\t\t\tif (is_array($val)){\n\t\t\t\t$retStr .= '<li>' . $key . ': ' . array_pp($val) . '</li>';\n\t\t\t}else{\n\t\t\t\t$retStr .= '<li>' . $key . ': ' . $val . '</li>';\n\t\t\t}\n\t\t}\n\t}\n\t$retStr .= '</ul>';\n\treturn $retStr;\n}",
"private function prepareHTML(){\n\t$first=true;\n\t\t\n\tforeach($this->objarr as $key=>$val){\n\t\t$a=\"\";\n\t if($val->getAClass()!=\"\") $a.=\" class=\\\"\".$val->getAClass().\"\\\"\";\n\t if($val->getAId()!=\"\") $a.=\" id=\\\"\".$val->getAId().\"\\\"\";\n\t $ul=\"\";\n\t if($val->getUlClass()!=\"\") $ul.=\" class=\\\"\".$val->getUlClass().\"\\\"\";\n\t if($val->getUlId()!=\"\") $ul.=\" id=\\\"\".$val->getUlId().\"\\\"\";\n\t $li=\"\";\n\t if($val->getLiClass()!=\"\") $li.=\" class=\\\"\".$val->getLiClass().\"\\\"\";\n\t if($val->getLiId()!=\"\") $li.=\" id=\\\"\".$val->getLiId().\"\\\"\";\n\t\n\t\tif(!$val->getIntegrated()){ //se l' oggetto non è stato integrato come figlio di qualche altro oggetto\n\t if($first){\n\t $this->html.=\"<ul>\\n<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\";\n\t $first=false;\n\t\t }else{\n\t\t \t$this->html=$this->replace_last_occurence($this->html, \"</ul>\", \n\t\t \t\"<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\");\n\t\t }\n\t\t \t\n\t\t $this->prepareRecursiveHTML($val);\n\t\t}//close if(!$val->getIntegrated())\n\t}//close foreach\n\t\n}",
"public function __toString() {\n\t\treturn $this->result . ($this->ordered ? '</ol>' : '</ul>') . PHP_EOL;\n\t}",
"function renderNavigation(array $array)\n {\n $html = '';\n\n foreach ( $array as $item=>$attributes){\n\n // Set the title of the navigation point\n $title = (isset($attributes['title']) ? $attributes['title'] : $item );\n\n // if a icon is passed to the array a icon tag will be created\n $icon = (isset($attributes['icon']) ? sprintf('<i class=\"%s\"></i>',$attributes['icon']) : null );\n // pass together the whole anchor tag\n $anchor = sprintf('<a href=\"%s\">%s%s</a>',$attributes['url'],$icon,$title);\n\n // Check if there is a submenu. If Yes, run that itself through this macro\n $submenu = (isset($attributes['sub-menu']) ? sprintf('<ul class=\"sub-menu\">%s</ul>',renderNavigation($attributes['sub-menu'])) : null );\n\n // Check for the current URL if it matches any Anchors\n $class = '';\n if(strstr(Request::fullUrl(),$attributes['url']))\n $class = 'class=\"on\"';\n\n // and wrap it into the listitem\n $html .= sprintf('<li %s>%s%s</li>',$class,$anchor,$submenu);\n\n }\n\n // Pass back the entire navigation list\n return $html;\n }",
"function loopListItems($content) {\n\tif (is_array($content)) {\n\t\tforeach ($content as $parent => $child) {\n\t\t\t$children = loopListItems($child);\n\n\t\t\t// Don't let array indexes print as their own array\n\t\t\tif (!is_numeric($parent)) {\n\t\t\t\t$result .= \"\n\t\t\t\t\t<li>{$parent}\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t{$children}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\";\n\t\t\t} else {\n\t\t\t\t$result .= $children;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$result = \"<li>{$content}</li>\";\n\t}\n\n\treturn $result;\n}",
"function renderTreeOrgaos($arvore) {\n $lastLevel = 1;\n//Outer list item\n $html = \"<ul class=\\\"jstree\\\">\";\n//Iterating tree from tree root\n foreach ($arvore as $node) {\n//If we are on the item of the same level, closing <li> tag before printing item\n if (($node['level'] == $lastLevel) and ($lastLevel > 0)) {\n $html .= '</li>';\n }\n//If we are printing a next-level item, starting a new <ul>\n if ($node['level'] > $lastLevel) {\n $html .= '<ul>';\n }\n//If we are going to return back by several levels, closing appropriate tags\n if ($node['level'] < $lastLevel) {\n $html .= str_repeat(\"</li></ul>\", $lastLevel - $node['level']) . '</li>';\n }\n//Priting item without closing tag\n $html .= '\n <li id=\"tree_node[' . $node['uuid'] . ']\">\n <ins class=\"jstree-icon\"> </ins>\n <a><ins class=\"jstree-icon\"> </ins>' . $node['nome'] . '</a>';\n//Refreshing last level of the item\n $lastLevel = $node['level'];\n }\n $html .= \"</ul>\";\n return $html;\n}",
"public function output() {\n\t\treturn array_merge(\n\t\t\tarray(\"<ul data-divider-theme='b' id='list_{$this->options['id']}' \".($this->options['inset']?'data-inset=\"true\" ':'').($this->options['actions']?\"data-split-icon='{$this->options['icon']}' data-split-theme='a'\":\"\").\" data-role='listview'>\"),\n\t\t\t$this->items,\n\t\t\tarray(\"</ul>\"));\n\t}"
]
| [
"0.75124466",
"0.71984017",
"0.70638716",
"0.70274454",
"0.6869798",
"0.68629116",
"0.6725132",
"0.6677111",
"0.66623545",
"0.6646143",
"0.65818644",
"0.65482134",
"0.6508053",
"0.6503844",
"0.6491401",
"0.6407998",
"0.64017045",
"0.6382789",
"0.6359215",
"0.6357238",
"0.63556844",
"0.6336041",
"0.6320601",
"0.628618",
"0.62524444",
"0.6246797",
"0.62006664",
"0.61910564",
"0.6190028",
"0.6187792"
]
| 0.7536651 | 0 |
$investigation = $this>Investigation>refer($shelter_id, $investigation_id); | public function refer($shelter_id, $investigation_id) {
$investigation = $this->Investigation->find('first', array(
'conditions' => array(
'Investigation.id' => $investigation_id
)
));
if ($this->request->is('post')) {
$note = $this->request->data('Investigation.note');
//$investigation = $this->Investigation->refer($shelter_id, $investigation_id);
$investigation = $this->Investigation->refer(1, $investigation_id);
$this->loadModel('Shelter');
$shelter = $this->Shelter->read(null, $shelter_id);
if($this->request->data('Investigation.message_shelter')) {
SendSMS::go($shelter['Shelter']['phone'], $note);
}
// create history item
$this->loadModel('History');
$this->History->markAsReferred($investigation_id);
$this->redirect('/investigations/agency');
}
$this->set(compact('investigation'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function referal() {\n return $this->hasMany('App\\Referal','refered_by');\n }",
"public function referred(){\n\t\treturn $this->hasMany('App\\Referrals', 'StudentId');\n\t}",
"function &getInvestigator($id) {\n foreach ($this->investigators as $investigator) {\n if ($investigator->getId() == $id) {\n return $investigator;\n }\n }\n\t\treturn null;\n\t}",
"public function getReferenceTo() {}",
"public function referenceAction ()\n {\n $speciesId = (int) $this->getHelper('DataFormatter')->naturalKeyToId($this->_getParam('species'));\n $synonymId = (int) $this->getHelper('DataFormatter')->naturalKeyToId($this->_getParam('synonym'));\n $referenceId = $this->_getParam('id');\n $references = false;\n $sn = false;\n\n $detailsModel = new ACI_Model_Details($this->_db);\n\n if ($referenceId) {\n $ids = explode(',', $referenceId);\n foreach ($ids as $id) {\n $references[] = $detailsModel->getReferenceById($id);\n }\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(count($ids));\n }\n elseif ($speciesId) {\n $taxa = $detailsModel->getScientificName($speciesId);\n if ($taxa instanceof ACI_Model_Table_Taxa) {\n $references = $detailsModel->getReferencesByTaxonId(\n $taxa->id);\n $numReferences = count($references);\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(\n $numReferences, $taxa->name);\n }\n }\n elseif ($synonymId) {\n $taxa = $detailsModel->getSynonymName($synonymId);\n if ($taxa instanceof ACI_Model_Table_Taxa) {\n $references = $detailsModel->getReferencesBySynonymId(\n $taxa->id);\n $numReferences = count($references);\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(\n $numReferences, $taxa->taxaFullName);\n }\n }\n $this->view->title = $this->view->translate('Literature_references');\n $this->view->headTitle($this->view->title, 'APPEND');\n $this->_logger->debug($references);\n $this->view->references = $references;\n $this->view->sn = $sn;\n $this->view->preface = $preface;\n }",
"public function researcher(){\n return $this->belongsTo('App\\GoldilocksResearcher', 'researcher_id');\n }",
"public function refer() {\n return $this->hasMany('\\App\\Refer', 'referTypeId');\n }",
"public function getReference(){\n return $this->reference;\n }",
"public function referee()\n {\n return $this->hasOne('App\\Models\\Referee');\n }",
"function getReference() {\n return $this->reference;\n }",
"public function refits()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'refit_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"public function consultation() \n {\n return $this->belongsTo('App\\Client\\Consultation');\n\n }",
"public function getOurReference(): string;",
"public function refits1()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'se_id', 'refit_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"public function\tgetReferidoInfo(){\r\t\t\r\t\t$model_ref = $this->getModel( 'referido' );\r\t\t$idref = JRequest::getInt( 'idref' );\r\t\t\r\t\t$model_ref->instance( $idref );\r\t\t$inf_ref = $model_ref->getReferidoInf();\r\t\t\r\t\tif( !empty($inf_ref) ){\r\t\t\t\r\t\t\t$model_ref\r\t\t}\r\t\t\r\t}",
"public function refits2()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'refit_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"function getReference($id)\n {\n return $this->model->where('order_id', $id)->groupBy('reference')->first()->reference;\n }",
"function &act() {\n return $this->reference;\n }",
"public function getRel(): string;",
"function &getPrimaryInvestigator() {\n foreach ($this->investigators as $investigator) {\n if ($investigator->getPrimaryContact() == true) {\n return $investigator;\n }\n }\n\t\treturn null;\n\t}",
"public function acessarRelatorios(){\n\n }",
"public function testReportsReferralsGet()\n {\n }",
"public function getReference() {\n return $this->reference;\n }",
"public function referenceBy()\n {\n return $this->belongsTo(Employee::class, 'reference_by');\n }",
"public function GetByRef( $ref ){\n return $this->genericRepository->GetEntityRepository()->findOneBy( array( 'externalReference' => $ref ) );\n }",
"public function termoReferencia()\n {\n return $this->belongsTo(TermoReferencia::class, 'id_termo_referencia', 'id');\n }",
"public function get_reference() {\n return $this->reference;\n }",
"public function getReference()\r\n {\r\n return $this->reference;\r\n }",
"public function getReferencia()\n {\n return $this->referencia;\n }",
"public function getReferencia()\n {\n return $this->referencia;\n }"
]
| [
"0.59257346",
"0.58999413",
"0.57948905",
"0.57023984",
"0.5591613",
"0.5545335",
"0.5501912",
"0.54542",
"0.53877765",
"0.5354222",
"0.5345861",
"0.5306764",
"0.52794105",
"0.52665704",
"0.52276516",
"0.5208388",
"0.5205237",
"0.5200974",
"0.5200709",
"0.5195093",
"0.51916486",
"0.51865596",
"0.51375216",
"0.512372",
"0.51166165",
"0.51152915",
"0.50657606",
"0.50599414",
"0.505613",
"0.505613"
]
| 0.73122716 | 0 |
Unlock account user by hash. | static function unlock_account() {
$model = \Auth::$model;
# hash GET param exists
if ($hash = data('hash')) {
# verificando se ha algum usuário com a hash.
$user = $model::first(array(
'fields' => 'id, hash_unlock_account',
'where' => "hash_unlock_account = '$hash'"
));
if (!empty($user)) {
$user->hash_unlock_account = '';
$user->login_attempts = 0;
$user->edit() ?
flash('Sua conta foi desbloqueada.') :
flash('Algo ocorreu errado. Tente novamente mais tarte.', 'error');
}
}
go('/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function logoutUser($hash){\n\n }",
"public function logoutUser($hash){\n $where = array(\n \"hash\" => $hash\n );\n $user = $this->select($where);\n if( !empty($user) ){\n $this->delete($user[0]);\n }\n\n }",
"protected function unlock($user)\n {\n $newPass = bin2hex(random_bytes(6));\n $this->users->unlock(['id' => $user->getId(), 'pass' => $this->password->hash($newPass)]);\n $this->mail->send($this->mail->unlock($user, $newPass));\n }",
"function unlockAccount($userid){\n $query = \"UPDATE users_account SET status ='Active' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"public static function email_unlock_account() {\n\n if ($u = static::check_record_existence()) {\n\n # definindo conta como não confirmada.\n $u->hash_unlock_account = \\Security::random(32);\n if (!$u->edit())\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n\n $m = auth_model();\n if ($m::first(array('where' => 'id = \\'' . $u->id . '\\''))->emailUnlockAccount())\n flash('Email com as instruções para Desbloqueamento de conta enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }",
"private function destroyEmployeeHash($uid, $hash)\n {\n $removeSql = \"DELETE FROM employee_hash WHERE ehash_value='$hash' AND ehash_employee='$uid'\";\n $this->DBH->query($removeSql);\n }",
"public function actionPasswordReset ($hash) {\n $user = DbUser::model()->findByAttributes(array(\n 'hash' => $hash,\n ));\n if (empty($user)) {\n $this->redirect(array('site/login'));\n }\n $user->scenario = 'changePassword';\n if (!empty($_POST['DbUser'])) {\n $user->attributes = $_POST['DbUser'];\n //reset the user hash so it cant be re-used after saving\n if ($user->resetHash()) {\n //attempt to automatically login otherwise send to login page\n $login = new LoginForm;\n $login->username = $user->username;\n $login->password = $user->passwordNew;\n if ($login->validate() && $login->login()) {\n $this->redirect(array('site/index'));\n }\n\n $this->redirect(array('site/login'));\n }\n }\n\n //reset password fields so encrypted string is not shown in form\n $user->password = null;\n $user->passwordConfirm = null;\n $this->render('changePassword', array(\n 'user' => $user,\n ));\n }",
"function delete_hash($userid,$hash){\n\t\t$this->stmt = $this->db->delete('activation');\n // set where values\n $this->stmt->where('userid','i',$userid);\n\t\t$this->stmt->where('hash','i',$hash);\n\t\treturn parent::set();\n\t}",
"public function confirmAccount(string $hash): void;",
"private function unlockByIdUser($data)\n {\n $sql = \"DELETE FROM {$this->config->dbTablePrefix}keyword_lock\n WHERE `by_id_user`={$data['id_user']}\";\n\n $this->model->dba->query($sql); \n }",
"private function userForAuth($hash){\n\n }",
"function unlockUser($uName) {\n\n Util::throwExceptionIfNullOrBlank($uName, \"User Name\");\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"user\":{\"userName\":\"' . $uName . '\"}}}';\n\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/unlock\";\n $response = RestClient::put($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }",
"public function getUserByHash($hash=''){\n\n if($hash!='')\n {\n \n //consulta validade do link HASH\n $sql = new Sql();\n $res = $sql->select('SELECT * FROM pwd_recovery WHERE \n hash_recovery = :hash_recovery AND\n DATE_ADD(dt_register, INTERVAL 1 HOUR) >= NOW() LIMIT 0,1',\n array(':hash_recovery'=>$hash));\n \n \n //caso nada encontrado então ou o HASH é inválido ou o tempo limite expirou\n if(count($res)==0){\n //sinaliza como não alterado pois o hash é invalido\n $_result = 0;\n }\n else\n {\n //recebe ID USUARIO que sera necessario para o update da senha \n $recoveryData = $res[0];\n $_result = $recoveryData['id_usuario']; \n } \n return $_result;\n \n }\n else\n {\n return false;\n }\n\n }",
"public function unlock(): void;",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }",
"public function getHash($hash)\n {\n return $this->user->where('hash' , '=' , $hash)->first();\n }",
"public function unlock()\r\n {\r\n frameEbbs::_()->getModule('backup')->unlock();\r\n }",
"public function removeUser($username, $hash)\n\t{\n\t\t$this -> fetchOnlineUsersFromFile();\n\n\t\tunset($this -> online_users[$hash]);\n\n\t\t$this -> updateOnlineUsersFile();\n\t}",
"public static function unhash($hash) {\n Object::tracert(__FILE__,__CLASS__,__METHOD__, self::UKEY);\n $len = strlen($hash);\n $ceil = bcpow(self::$range, $len);\n $mmiprimes = array_values(self::$range === 36 ? self::$goldenPrimes36 : self::$goldenPrimes62);\n $mmi = $mmiprimes[$len];\n $num = self::unbaseX($hash);\n $dec = bcmod(bcmul($num, $mmi), $ceil);\n return $dec;\n }",
"public function unlock() {\n }",
"public static function fetchForPasswordReset($hash)\n {\n $id = base_convert(substr($hash, 10), 36, 10);\n \n $user = static::fetchUserById($id);\n if (!$user || static::generatePasswordResetHash($user) != $hash) return null; // invalid hash\n \n return $user;\n }",
"public function updateHash($hash, $password)\n {\n return $this->user->where('hash' , '=' , $hash)->update(['hash' => null, 'password' => $password]);\n }",
"public function unlock($uri, Sabre_DAV_Locks_LockInfo $lockInfo)\n {\n $query = 'DELETE FROM '. $this->DB->Tbl['core_lock'].' WHERE `uri`=\"'.$this->DB->esc($uri).'\" AND `token`=\"'.$this->DB->esc($lockInfo->token).'\"';\n return $this->DB->query($query);\n }",
"function Unlock( $uri, $lockToken )\r\n\t{\r\n\t\t$this->addHeader( \"Lock-Token\", \"<$lockToken>\" );\r\n\t\tif( $this->sendCommand( \"UNLOCK $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}",
"public function deleteHash($user_id){\r\n\t\t$query = $this->connection->prepare('DELETE FROM password_reset WHERE user_ID = :user_id');\r\n\t\treturn $query->execute(array('user_id' => $user_id));\r\n\t}"
]
| [
"0.7260432",
"0.70276505",
"0.62472713",
"0.6214747",
"0.6119245",
"0.60331064",
"0.59967935",
"0.599631",
"0.59360933",
"0.5884661",
"0.58180374",
"0.5800626",
"0.5786046",
"0.5773707",
"0.56095463",
"0.56095463",
"0.56095463",
"0.56095463",
"0.56095463",
"0.5555076",
"0.5523667",
"0.55177474",
"0.55096674",
"0.5509467",
"0.5484505",
"0.54838544",
"0.54577845",
"0.54218566",
"0.5417455",
"0.53829473"
]
| 0.82686746 | 0 |
Get the default directory for session files. | protected function getDefaultDirectory()
{
// Default to ~/.platformsh/.session, but if it's not writable, fall
// back to the temporary directory.
$home = $this->getHomeDirectory();
if ($home !== null) {
$default = rtrim($home, '/') . '/.platformsh/.session';
if ($this->canWrite($default)) {
return $default;
}
}
$temp = sys_get_temp_dir() . '/.platformsh-client/.session';
if ($this->canWrite($temp)) {
return $temp;
}
throw new \RuntimeException('Unable to find a writable session storage directory');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessionDirectoryPath();",
"public function getDefaultDirectory(): string|null;",
"public function getDefaultInstallDirectory() {\n return $this->getConfig(\"default_install_directory\");\n }",
"protected function get_default_root_path(): string {\n return dirname($this->nowqsPath, 4) . DIRECTORY_SEPARATOR;\n }",
"public function getDefaultFolder() {}",
"public function getDefaultFolder() {}",
"public function getDefaultTemplateRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultTemplateRootPath);\r\n }",
"function default_database_directory() {\n $configdir = isset($_SERVER['CONFIG_DIR']) ? $_SERVER['CONFIG_DIR'] : 'local';\n $local_default_file_path_inc = $configdir.DIRECTORY_SEPARATOR.'default-file-path.inc';\n if (file_exists($local_default_file_path_inc)) {\n try {\n @include($local_default_file_path_inc);\n } catch (Exception $e) {\n unset($default_file_path);\n }\n return isset($default_file_path) ? $default_file_path : \"\";\n }\n}",
"public function defaultOutputPath()\n {\n static $defaultPath;\n\n if ($defaultPath === null) {\n $defaultPath = sprintf(\n '%1$s/%2$s',\n $this->filterPath(static::DEFAULT_DIRNAME),\n $this->filterPath(static::DEFAULT_BASENAME)\n );\n }\n\n return $defaultPath;\n }",
"function getDefaultFolder() ;",
"public function getDefaultLayoutRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultLayoutRootPath);\r\n }",
"public function get_default_cache_dir()\n\t{\n\t\t$plugin_wp_dir = plugin_dir_path($this->plugin_file);\n\t\t$cache_dir = trailingslashit($plugin_wp_dir) . 'cache/';\n\t\t$cache_dir = str_replace('\\\\', '/', $cache_dir);\n\n\t\treturn $cache_dir;\n\t}",
"public static function getDefaultFolder()\n {\n return apply_filters(\n 'lf_default_views_folder',\n Loc::lolita()->baseDir() . DS . 'app' . DS . 'views' . DS\n );\n }",
"public function getCurrentDirectory();",
"public function getCurrentDirectory();",
"private static function getDefaultPidFile(): string\n {\n return \\getcwd() . \\DIRECTORY_SEPARATOR . '.web-server-pid';\n }",
"private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }",
"public function getSavePath(): string\n {\n return session_save_path();\n }",
"public static function get_directory(): string {\n return Simply_Static\\Options::instance()->get('local_dir') ?: '';\n }",
"public function getRootDir()\n {\n return sys_get_temp_dir() . '/base-kernel/' . 'kernel-' . substr(\n hash(\n 'md5',\n json_encode([\n $this->bundlesToLoad,\n $this->configuration,\n $this->routes,\n ])\n ),\n 0,\n 10\n );\n }",
"public function getJournalDir(): string\n {\n return $_ENV['DB_JOURNAL_DIR'] ?? self::DEFAULT_FILE_DIR;\n }",
"protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }",
"private function getSessionSavePath() {}",
"public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }",
"public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }",
"public function getDefaultConfigurationFileLocation() {}",
"public function getBaseDirectory()\n {\n return $this->getParam(DirectoryKeys::BASE);\n }",
"public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }",
"public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}",
"public function getDefaultPartialRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultPartialRootPath);\r\n }"
]
| [
"0.7502687",
"0.72565943",
"0.6938768",
"0.683527",
"0.67522883",
"0.6750491",
"0.67405456",
"0.67253673",
"0.6653799",
"0.66280484",
"0.6455601",
"0.6453387",
"0.6416251",
"0.63499206",
"0.63499206",
"0.6298146",
"0.629094",
"0.6288659",
"0.62781996",
"0.62071025",
"0.6161537",
"0.61604977",
"0.615083",
"0.61450833",
"0.6131274",
"0.6121635",
"0.61203235",
"0.6117531",
"0.6108034",
"0.60914737"
]
| 0.756073 | 0 |
Configure an AspectContainer with advisors, aspects and pointcuts | protected function configureAop(AspectContainer $container) {
$container->registerAspect(new SecurityAspect());
$container->registerAspect(new TransactionAspect());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function configureAop(AspectContainer $container)\n {\n }",
"public function __construct(AspectContainer $container, string $pointcutExpression, Advice $advice)\n {\n $this->container = $container;\n $this->pointcutExpression = $pointcutExpression;\n parent::__construct($advice);\n }",
"public function addAspect(IAspect $aspect);",
"public function configureContainer(ContainerConfigurator $container): void;",
"private function configureContainer()\n {\n // Build the DI container.\n $builder = new ContainerBuilder;\n $builder->addDefinitions(__DIR__ . '/config/di.php');\n\n $this->container = $builder->build();\n }",
"public function __construct(AspectContainer $container, Reader $annotationReader)\n {\n $this('empty')\n ->is(/* empty */);\n\n $stringConverter = $this->getNodeToStringConverter();\n\n $this('pointcutExpression')\n ->is('pointcutExpression', '||', 'conjugatedExpression')\n ->call(fn($first, $_0, $second) => new OrPointcut($first, $second))\n ->is('conjugatedExpression')\n ;\n\n $this('conjugatedExpression')\n ->is('conjugatedExpression', '&&', 'negatedExpression')\n ->call(fn($first, $_0, $second) => new AndPointcut($first, $second))\n ->is('negatedExpression')\n ;\n\n $this('negatedExpression')\n ->is('!', 'brakedExpression')\n ->call(fn($_0, $item) => new NotPointcut($item))\n ->is('brakedExpression')\n ;\n\n $this('brakedExpression')\n ->is('(', 'pointcutExpression', ')')\n ->call(fn($_0, $e, $_1) => $e)\n ->is('singlePointcut')\n ;\n\n $this('singlePointcut')\n ->is('accessPointcut')\n ->is('annotatedAccessPointcut')\n ->is('executionPointcut')\n ->is('annotatedExecutionPointcut')\n ->is('withinPointcut')\n ->is('annotatedWithinPointcut')\n ->is('initializationPointcut')\n ->is('staticInitializationPointcut')\n ->is('cflowbelowPointcut')\n ->is('dynamicExecutionPointcut')\n ->is('matchInheritedPointcut')\n ->is('pointcutReference')\n ;\n\n $this('accessPointcut')\n ->is('access', '(', 'propertyAccessReference', ')')\n ->call(fn($_0, $_1, $propertyReference) => $propertyReference)\n ;\n\n $this('executionPointcut')\n ->is('execution', '(', 'methodExecutionReference', ')')\n ->call(fn($_0, $_1, $methodReference) => $methodReference)\n ->is('execution', '(', 'functionExecutionReference', ')')\n ->call(fn($_0, $_1, $functionReference) => $functionReference)\n ;\n\n $this('withinPointcut')\n ->is('within', '(', 'classFilter', ')')\n ->call(\n function ($_0, $_1, $classFilter) {\n $pointcut = new TruePointcut(PointFilter::KIND_ALL);\n $pointcut->setClassFilter($classFilter);\n\n return $pointcut;\n }\n )\n ;\n\n $this('annotatedAccessPointcut')\n ->is('annotation', 'access', '(', 'namespaceName', ')')\n ->call(\n function ($_0, $_1, $_2, $annotationClassName) use ($annotationReader) {\n $kindProperty = PointFilter::KIND_PROPERTY;\n\n return new AnnotationPointcut($kindProperty, $annotationReader, $annotationClassName);\n }\n )\n ;\n\n $this('annotatedExecutionPointcut')\n ->is('annotation', 'execution', '(', 'namespaceName', ')')\n ->call(\n function ($_0, $_1, $_2, $annotationClassName) use ($annotationReader) {\n $kindMethod = PointFilter::KIND_METHOD;\n\n return new AnnotationPointcut($kindMethod, $annotationReader, $annotationClassName);\n }\n )\n ;\n\n $this('annotatedWithinPointcut')\n ->is('annotation', 'within', '(', 'namespaceName', ')')\n ->call(\n function ($_0, $_1, $_2, $annotationClassName) use ($annotationReader) {\n $pointcut = new TruePointcut(PointFilter::KIND_ALL);\n $kindClass = PointFilter::KIND_CLASS;\n $classFilter = new AnnotationPointcut($kindClass, $annotationReader, $annotationClassName);\n $pointcut->setClassFilter($classFilter);\n\n return $pointcut;\n }\n )\n ;\n\n $this('initializationPointcut')\n ->is('initialization', '(', 'classFilter', ')')\n ->call(\n function ($_0, $_1, $classFilter) {\n $pointcut = new TruePointcut(PointFilter::KIND_INIT + PointFilter::KIND_CLASS);\n $pointcut->setClassFilter($classFilter);\n\n return $pointcut;\n }\n )\n ;\n\n $this('staticInitializationPointcut')\n ->is('staticinitialization', '(', 'classFilter', ')')\n ->call(\n function ($_0, $_1, $classFilter) {\n $pointcut = new TruePointcut(PointFilter::KIND_STATIC_INIT + PointFilter::KIND_CLASS);\n $pointcut->setClassFilter($classFilter);\n\n return $pointcut;\n }\n )\n ;\n\n $this('cflowbelowPointcut')\n ->is('cflowbelow', '(', 'executionPointcut', ')')\n ->call(fn($_0, $_1, $pointcut) => new CFlowBelowMethodPointcut($pointcut))\n ;\n\n $this('matchInheritedPointcut')\n ->is('matchInherited', '(', ')')\n ->call(fn() => new MatchInheritedPointcut())\n ;\n\n $this('dynamicExecutionPointcut')\n // ideally, this should be 'dynamic', 'methodExecutionReference'\n ->is('dynamic', '(', 'memberReference', '(', 'argumentList', ')', ')')\n ->call(\n function ($_0, $_1, ClassMemberReference $reference) {\n $memberFilter = new AndPointFilter(\n $reference->getVisibilityFilter(),\n $reference->getAccessTypeFilter()\n );\n\n $pointcut = new MagicMethodPointcut($reference->getMemberNamePattern(), $memberFilter);\n $pointcut->setClassFilter($reference->getClassFilter());\n\n return $pointcut;\n }\n )\n ;\n\n $this('pointcutReference')\n ->is('namespaceName', '->', 'namePatternPart')\n ->call(fn($className, $_0, $name) => new PointcutReference($container, \"{$className}->{$name}\"))\n ;\n\n $this('propertyAccessReference')\n ->is('memberReference')\n ->call(\n function (ClassMemberReference $reference) {\n $memberFilter = new AndPointFilter(\n $reference->getVisibilityFilter(),\n $reference->getAccessTypeFilter()\n );\n\n $pointcut = new SignaturePointcut(\n PointFilter::KIND_PROPERTY,\n $reference->getMemberNamePattern(),\n $memberFilter\n );\n\n $pointcut->setClassFilter($reference->getClassFilter());\n\n return $pointcut;\n }\n )\n ;\n\n $this('methodExecutionReference')\n ->is('memberReference', '(', 'argumentList', ')')\n ->call(\n function (ClassMemberReference $reference) {\n $memberFilter = new AndPointFilter(\n $reference->getVisibilityFilter(),\n $reference->getAccessTypeFilter()\n );\n\n $pointcut = new SignaturePointcut(\n PointFilter::KIND_METHOD,\n $reference->getMemberNamePattern(),\n $memberFilter\n );\n\n $pointcut->setClassFilter($reference->getClassFilter());\n\n return $pointcut;\n }\n )\n ->is('memberReference', '(', 'argumentList', ')', ':', 'namespaceName')\n ->call(\n function (ClassMemberReference $reference, $_0, $_1, $_2, $_3, $returnType) {\n $memberFilter = new AndPointFilter(\n $reference->getVisibilityFilter(),\n $reference->getAccessTypeFilter(),\n new ReturnTypeFilter($returnType)\n );\n\n $pointcut = new SignaturePointcut(\n PointFilter::KIND_METHOD,\n $reference->getMemberNamePattern(),\n $memberFilter\n );\n\n $pointcut->setClassFilter($reference->getClassFilter());\n\n return $pointcut;\n }\n )\n ;\n\n $this('functionExecutionReference')\n ->is('namespacePattern', 'nsSeparator', 'namePatternPart', '(', 'argumentList', ')')\n ->call(\n function ($namespacePattern, $_0, $namePattern) {\n $nsFilter = new SimpleNamespaceFilter($namespacePattern);\n $pointcut = new FunctionPointcut($namePattern);\n $pointcut->setNamespaceFilter($nsFilter);\n\n return $pointcut;\n }\n )\n ->is('namespacePattern', 'nsSeparator', 'namePatternPart', '(', 'argumentList', ')', ':', 'namespaceName')\n ->call(\n function ($namespacePattern, $_0, $namePattern, $_1, $_2, $_3, $_4, $returnType) {\n $nsFilter = new SimpleNamespaceFilter($namespacePattern);\n $typeFilter = new ReturnTypeFilter($returnType);\n $pointcut = new FunctionPointcut($namePattern, $typeFilter);\n $pointcut->setNamespaceFilter($nsFilter);\n\n return $pointcut;\n }\n )\n ;\n\n $this('memberReference')\n ->is('memberModifiers', 'classFilter', 'memberAccessType', 'namePatternPart')\n ->call(\n function (\n ModifierMatcherFilter $memberModifiers,\n PointFilter $classFilter,\n ModifierMatcherFilter $memberAccessType,\n $namePattern\n ) {\n $reference = new ClassMemberReference(\n $classFilter,\n $memberModifiers,\n $memberAccessType,\n $namePattern\n );\n\n return $reference;\n }\n )\n ;\n\n $this('classFilter')\n ->is('namespacePattern')\n ->call(\n function ($pattern) {\n $truePointFilter = TruePointFilter::getInstance();\n\n return $pattern === '**'\n ? $truePointFilter\n : new SignaturePointcut(PointFilter::KIND_CLASS, $pattern, $truePointFilter);\n }\n )\n ->is('namespacePattern', '+')\n ->call(fn($parentClassName) => new InheritanceClassFilter($parentClassName))\n ;\n\n $this('argumentList')\n ->is('*');\n\n $this('memberAccessType')\n ->is('::')\n ->call(fn() => new ModifierMatcherFilter(ReflectionMethod::IS_STATIC))\n ->is('->')\n ->call(\n function () {\n $modifierMatcherFilter = new ModifierMatcherFilter();\n $modifierMatcherFilter->notMatch(ReflectionMethod::IS_STATIC);\n\n return $modifierMatcherFilter;\n }\n )\n ;\n\n $this('namespacePattern')\n ->is('**')\n ->call($stringConverter)\n ->is('namePatternPart')\n ->is('namespacePattern', 'nsSeparator', 'namePatternPart')\n ->call($stringConverter)\n ->is('namespacePattern', 'nsSeparator', '**')\n ->call($stringConverter)\n ;\n\n $this('namePatternPart')\n ->is('*')\n ->call($stringConverter)\n ->is('namePart')\n ->call($stringConverter)\n ->is('namePatternPart', '*')\n ->call($stringConverter)\n ->is('namePatternPart', 'namePart')\n ->call($stringConverter)\n ->is('namePatternPart', '|', 'namePart')\n ->call($stringConverter)\n ;\n\n $this('namespaceName')\n ->is('namePart')\n ->call($stringConverter)\n ->is('namespaceName', 'nsSeparator', 'namePart')\n ->call($stringConverter)\n ;\n\n $this('memberModifiers')\n ->is('memberModifier', '|', 'memberModifiers')\n ->call(fn($modifier, $_0, ModifierMatcherFilter $matcher) => $matcher->orMatch($modifier))\n ->is('memberModifier', 'memberModifiers')\n ->call(fn($modifier, ModifierMatcherFilter $matcher) => $matcher->andMatch($modifier))\n ->is('memberModifier')\n ->call(fn($modifier) => new ModifierMatcherFilter($modifier))\n ;\n\n $converter = $this->getModifierConverter();\n $this('memberModifier')\n ->is('public')\n ->call($converter)\n ->is('protected')\n ->call($converter)\n ->is('private')\n ->call($converter)\n ->is('final')\n ->call($converter)\n ;\n\n $this->start('pointcutExpression');\n }",
"public function addAOPAspectToAOPProxy(IAspect $aspect) {\n $this->AdviceChain->addAspect($aspect);\n }",
"private function _loadAspect($aspect)\n {\n $aspects = array();\n if (isset($aspect['id'])) {\n $name = $aspect['id'];\n } else {\n $name = BeanDefinition::generateName('AspectYAML');\n }\n if (isset($aspect['expression'])) {\n $expression = $aspect['expression'];\n } else {\n $expression = '';\n }\n $aspectBean = $aspect['ref'];\n $type = $aspect['type'];\n if ($type == 'method') {\n $type = AspectDefinition::ASPECT_METHOD;\n } else if ($type == 'exception') {\n $type = AspectDefinition::ASPECT_EXCEPTION;\n } else {\n throw new BeanFactoryException('Invalid aspect type');\n }\n $pointcuts = array();\n foreach ($aspect['pointcuts'] as $pointcut) {\n if (isset($pointcut['id'])) {\n $pointcutName = $pointcut['id'];\n } else {\n $pointcutName = BeanDefinition::generateName('PointcutYAML');\n }\n if (isset($pointcut['expression'])) {\n $pointcutDef = clone $this->_templatePointcutDef;\n $pointcutDef->setName($pointcutName);\n $pointcutDef->setExpression($pointcut['expression']);\n $pointcutDef->setMethod($pointcut['method']);\n $this->_aspectManager->setPointcut($pointcutDef);\n $pointcuts[] = $pointcutName;\n } else if (isset($pointcut['pointcut-ref'])) {\n $pointcuts[] = $pointcut['pointcut-ref'];\n }\n }\n return new AspectDefinition($name, $pointcuts, $type, $aspectBean, $expression);\n }",
"public function weaveAspects(CompilerInterface $compiler): void\n {\n foreach ($this->container as $dependency) {\n if ($dependency instanceof Dependency) {\n $dependency->weaveAspects($compiler, $this->pointcuts);\n }\n }\n }",
"public function configure()\n\t{\n\t\t$this->dispatcher->connect('context.load_factories', array($this, 'loadExtraFactories'));\n\t}",
"protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'project';\n $this->name = 'nestedset-categories';\n $this->briefDescription = 'reorganization of categories to NestedSet behavior';\n $this->detailedDescription = <<<EOF\nreorganization of categories to NestedSet behavior\n [php symfony project:nestedset-categories|INFO]\nEOF;\n }",
"public function configureContainer(OrkestraConfiguration $configuration): void;",
"public function process(ContainerBuilder $container)\n {\n if (!$container->has('vt.aclmanager')) {\n return;\n }\n\n $aclmanager = $container->findDefinition('vt.aclmanager');\n\n $aclDefinitions = $container->findTaggedServiceIds('acl');\n foreach ($aclDefinitions as $id => $tags) {\n $aclmanager->addMethodCall('_addACL', array(new Reference($id)));\n }\n }",
"protected function initializeContext(): void\n {\n $this->context->setAspect('date', new DateTimeAspect(new \\DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])));\n $this->context->setAspect('visibility', new VisibilityAspect(true, true));\n $this->context->setAspect('workspace', new WorkspaceAspect(0));\n $this->context->setAspect('backend.user', new UserAspect(null));\n }",
"protected function configure()\n {\n $this\n ->setName('generate-container')\n ->setDescription('Generate container')\n ->addOption(\n 'mode',\n 'm',\n Input\\InputOption::VALUE_OPTIONAL,\n 'The mode (dev, live, test)',\n null\n )\n ->addOption(\n 'debug',\n 'd',\n Input\\InputOption::VALUE_NONE,\n 'Debug the container output'\n )\n ->addOption(\n 'dev-build',\n 'b',\n Input\\InputOption::VALUE_NONE,\n 'Build the database'\n );\n }",
"protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'frontend'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'prod'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'banshee';\n $this->name = 'build-playlist-by-ratio';\n $this->briefDescription = 'Generate a playlist based on the rating:play ratios';\n $this->detailedDescription = <<<EOF\nThe [recent-tracks|INFO] Generate a playlist based on the rating:play ratios\nCall it with:\n\n [php symfony test:regen-playlist|INFO]\nEOF;\n }",
"protected function configureCommands(AbstractDependencyInjectionContainer $container) {\n /* @var $commandCollection CommandCollectionInterface */\n $commandCollection = $container->get(AbstractDependencyInjectionContainer::buildQualifiedComponentKey(['norma', 'framework', 'cli', CommandCollectionInterface::class]));\n $commandsConfigCallable = (require_once $this->normaDir . '/app/config/runtime-' . $this->runtime . '/commands.php') ?? function() {};\n $commandsConfig = $container->call($commandsConfigCallable);\n $commandCollection->addCommands($commandsConfig ?? []);\n }",
"protected function configure()\n {\n /*\n * allow refresh video cache for one/all publisher(s) and one/all waterfall tag(s)\n * priority:\n * - all-publishers\n * - publisher\n * - all-waterfall-tags\n * - vid\n */\n $this\n ->setName('tc:cache:refresh-video-ad-tags')\n ->setDescription('Create initial ad slot cache if needed to avoid slams')\n ->addOption('publisher', 'p', InputOption::VALUE_OPTIONAL, 'update all video ad tags belongs to the given publisher')\n ->addOption('all-publishers', null, InputOption::VALUE_NONE, 'update all video ad tags belongs to the given publisher')\n ->addOption('vid', 'w', InputOption::VALUE_OPTIONAL, 'id of video ad tag whose cache is being to refreshed')\n ->addOption('all-waterfall-tags', null, InputOption::VALUE_NONE, 'id of video ad tag whose cache is being to refreshed');\n }",
"public function __construct(ContainerInterface $container)\n {\n $this->container = $container;\n $admins = $this->getContainer()->getParameter('bluebear.admins');\n // dispatch an event with admins configurations to allow dynamic admin creation\n $event = new AdminFactoryEvent();\n $event->setAdminsConfiguration($admins);\n /** @var EventDispatcher $eventDispatcher */\n $eventDispatcher = $this->container->get('event_dispatcher');\n $eventDispatcher->dispatch(self::ADMIN_CREATION, $event);\n\n // creating configured admin\n foreach ($admins as $adminName => $adminConfig) {\n $this->createAdminFromConfig($adminName, $adminConfig);\n }\n }",
"protected function configure()\n {\n $this\n ->setName('tc:cache:refresh-adslots')\n ->setDescription('Create initial ad slot cache if needed to avoid slams')\n ->addOption(\n 'publisher',\n 'p',\n InputOption::VALUE_OPTIONAL,\n 'The publisher\\'s id for updating all own ad slots'\n );\n }",
"public function process(ContainerBuilder $container)\n {\n if (!$container->hasParameter($this->enabledParameter)) {\n return;\n }\n\n $chainDriverDefService = $this->getChainDriverServiceName($container);\n $chainDriverDef = $container->getDefinition($chainDriverDefService);\n foreach ($this->namespaces as $namespace) {\n $chainDriverDef->addMethodCall('addDriver', array($this->driver, $namespace));\n }\n }",
"protected function configure()\n {\n foreach ($this->getArguments() as $argument) {\n $this->addArgument($argument[0], $argument[1], $argument[2], $argument[3]);\n }\n\n foreach ($this->getOptions() as $option) {\n $this->addOption($option[0], $option[1], $option[2], $option[3], $option[4]);\n }\n }",
"protected function configure()\n {\n try {\n $this\n ->setName('offensive-words')\n ->setDescription('Manages offensive words')\n ;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }",
"public function __construct(Container $container)\n {\n $this->container = $container;\n $this->container->register(TracyServiceProvider::class);\n if (!$this->container['config']->get('tracy.active')) {\n $this->registerHanlders();\n }\n }",
"private function configureDispatcher()\n {\n $dispatcher = new Dispatcher($this->container);\n $this->setDispatcher($dispatcher);\n $this->container->set('dispatcher', $dispatcher);\n }",
"protected function configure()\n {\n // with options '-c', '-p' (alias '--password'), '-h' (alias '--help')\n // looks like:\n // $ php index.php demons\n // $ php index.php demons -h\n $this->setName('demo')\n ->setDescription('Demo command shows example.')\n ->disableOptions();\n }",
"protected function setupContainer(Container $container)\n {\n $this->container = $container;\n\n if (! $this->container->bound('config')) {\n $this->container->instance('config', new Fluent);\n }\n }",
"public function __construct()\n {\n //$builder->addDefinitions('ConfigDI.php');\n //self::$container = $builder->build();\n }",
"protected function configure()\n {\n $this->setName('project:FactoryMethod')\n ->setDescription('Demo of Symfony Factory Method Pattern');\n }",
"public function configure(ContainerBuilder $container)\n {\n $container->register('packages.plugin.bitbucket.adapter', 'SLONline\\Packages\\Plugin\\Bitbucket\\SyncAdapter')\n ->addArgument(new Reference('doctrine.orm.entity_manager'))\n ->addArgument(new Reference('router.url_generator'));\n\n $container->getDefinition('packages.helper.sync')\n ->addMethodCall('registerAdapter', [new Reference('packages.plugin.bitbucket.adapter')]);\n\n $container->register('packages.plugin.bitbucket.package_subscriber',\n 'SLONline\\Packages\\Plugin\\Bitbucket\\PackageSubscriber')\n ->addArgument(new Reference('packages.plugin.bitbucket.adapter'))\n ->addArgument(new Reference('doctrine.orm.entity_manager'))\n ->addTag('kernel.event_subscriber');\n\n $container->register('packages.plugin.bitbucket.remote_subscriber',\n 'SLONline\\Packages\\Plugin\\Bitbucket\\RemoteSubscriber')\n ->addArgument(new Reference('packages.plugin.bitbucket.adapter'))\n ->addArgument(new Reference('doctrine.orm.entity_manager'))\n ->addTag('kernel.event_subscriber');\n\n $container->getDefinition('packages.controller_manager')\n ->addMethodCall('registerController',\n [Actions::REMOTE_NEW, 'SLONline\\Packages\\Plugin\\Bitbucket\\Controller::newAction'])\n ->addMethodCall('registerController',\n [Actions::REMOTE_CREATE, 'SLONline\\Packages\\Plugin\\Bitbucket\\Controller::createAction'])\n ->addMethodCall('registerController',\n [Actions::REMOTE_EDIT, 'SLONline\\Packages\\Plugin\\Bitbucket\\Controller::editAction'])\n ->addMethodCall('registerController',\n [Actions::REMOTE_UPDATE, 'SLONline\\Packages\\Plugin\\Bitbucket\\Controller::updateAction']);\n }"
]
| [
"0.7459088",
"0.6128755",
"0.60932237",
"0.56092423",
"0.5601645",
"0.546396",
"0.5323014",
"0.5210158",
"0.51463664",
"0.5128503",
"0.5121235",
"0.51201266",
"0.5103017",
"0.5070572",
"0.50565577",
"0.50511634",
"0.5048153",
"0.50261164",
"0.50247574",
"0.5020384",
"0.49972525",
"0.49958652",
"0.49860823",
"0.49806327",
"0.49487016",
"0.4947295",
"0.4942445",
"0.4920255",
"0.4914308",
"0.48819423"
]
| 0.73447657 | 1 |
Evaluate closures in the entire data array. Merge in entry data at this point as well if available. | public function evaluate(array $data, array $arguments = [], $parseData = null)
{
$data = evaluate($data, $arguments);
/**
* In addition to evaluating we need
* to merge in entry data as best we can.
*/
foreach ($data as &$value) {
if (is_string($value) and str_contains($value, '{{')) {
$value = $this->parseValue($value, $parseData);
}
}
if ($this->evaluators) {
$data = $this->runEvaluators($data);
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function calculate(array $data);",
"private function verifyData()\n {\n return function ($data) {\n return $data['render_data'];\n };\n }",
"public function reduce(Closure $closure);",
"function calculate_data() {\n $this->data = $this->get_default_data();\n\n // Get extra icons... send list of filters but don't include exceptions - as we do need the filter list here\n $exceptions = $this->get_filter_exceptions();\n $rest_of_filters = array();\n foreach ($this->filter->_fields as $key => $value) {\n if (!in_array($key,$exceptions)) {\n $rest_of_filters[] = $key;\n }\n }\n // Pass the rest_of_filters array, but then also let the method know this is a special config filter\n $extra_icons = $this->filter->get_sql_filter('',\n $rest_of_filters,\n $this->allow_interactive_filters(),\n $this->allow_configured_filters(),\n '',\n true);\n\n foreach ($this->data as $key => $value) {\n\n //If key is in choices array and not in extra_icons\n if (array_key_exists($key,$this->checkboxes_filter->options['choices']) &&\n !strpos($extra_icons,$key)) {\n // then we need to remove it from $this->data in fact...\n unset($this->data[$key]);\n continue;\n }\n //first step - try getting the item value directly\n $data_item = $this->get_data_item($key);\n\n if ($data_item !== FALSE) {\n $this->data[$key]->value = $data_item;\n } else {\n //backup plan - use SQL query to get the item value\n\n $use_filters = true;\n $sql = $this->get_data_item_sql($key, $use_filters);\n if ($sql !== FALSE) {\n //parse SQL for a WHERE clause\n\n $has_where_clause = php_report::sql_has_where_clause($sql);\n\n $conditional_symbol = 'WHERE';\n\n if($has_where_clause) {\n $conditional_symbol = 'AND';\n }\n\n // apply filters if applicable\n if(!empty($this->filter) && !empty($use_filters)) {\n // Include filter_exceptions here so that our config type filter is not included in the filters added to the final sql\n $sql_filter = $this->filter->get_sql_filter('',\n $this->get_filter_exceptions($key),\n $this->allow_interactive_filters(),\n $this->allow_configured_filters());\n if(!empty($sql_filter)) {\n $sql .= \" {$conditional_symbol} ({$sql_filter})\";\n }\n }\n //obtain field value\n if ($field_data = get_field_sql($sql)) {\n $this->data[$key]->value = $field_data;\n }\n }\n }\n }\n\n }",
"public function doProcessData() {}",
"abstract public function mapValues(\\Closure $f): self;",
"public function mergeProvider()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(\n // Each entry represents an array to merge against.\n array(\n 'foo' => 'bar',\n 'baz' => 12\n ),\n array(\n 'bar' => 'baz',\n 'foo' => 12\n ),\n array(\n 'honey' => 'tasty'\n )\n ),\n array(\n // Each entry represents an array to merge against.\n array(\n 'foo' => 'bar',\n 'baz' => 12\n ),\n range(1, 100),\n array(\n 'honey' => 'bear'\n )\n ),\n );\n }",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }",
"public function reduce(callable $callback, $initialValue = null)\n\t{\n\t\t$data = $initialValue;\n\t\t\n\t\tforeach ($this->data as $key => $value)\n\t\t{\n\t\t\t$data = $callback($value, $key, $data);\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"function evalValues()\t{\n\t\t// Check required, set failure if not ok.\n\t\treset($this->requiredArr);\n\t\t$masterTable=$this->conf['blogData']?'tx_metafeedit_comments':$this->theTable;\n\t\t$tempArr=array();\n\t\twhile(list(,$theField)=each($this->requiredArr))\t{\n\t\t\tif (!trim($this->dataArr[$theField]) )\t{\n\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\n\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\n\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Evaluate: This evaluates for more advanced things than 'required' does. But it returns the same error code, so you must let the required-message tell, if further evaluation has failed!\n\t\t$recExist=0;\n\t\t$evalValues=$this->conf['blogData']?$this->metafeeditlib->getBlogEvalValues($this->conf):$this->conf[$this->conf['cmdKey'].'.']['evalValues.'];\n\t\tif (is_array($evalValues))\t{\n\t\t\tswitch($this->conf['inputvar.']['cmd'])\t{\n\t\t\t\tcase 'edit':\n\t\t\t\t\tif (isset($this->dataArr['pid']))\t{\t\t\t// This may be tricked if the input has the pid-field set but the edit-field list does NOT allow the pid to be edited. Then the pid may be false.\n\t\t\t\t\t\t$recordTestPid = intval($this->dataArr['pid']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tempRecArr = $GLOBALS['TSFE']->sys_page->getRawRecord($masterTable,$this->dataArr[$this->conf['uidField']]);\n\t\t\t\t\t\t$recordTestPid = intval($tempRecArr['pid'])?intval($tempRecArr['pid']):$this->thePid;\n\t\t\t\t\t}\n\t\t\t\t\t$recExist=1;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$recordTestPid = $this->thePid ? $this->thePid : t3lib_div::intval_positive($this->dataArr['pid']);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treset($evalValues);\n\t\t\twhile(list($theField,$theValue)=each($evalValues))\t{\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'uniqueGlobal':\n\t\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField],$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueFields':\n\n\t\t\t\t\t \t\t$i=0;\t\n\t\t\t\t\t\t\tforeach($cmdParts as $cmdP) {\n\t\t\t\t\t\t\t\tif ($i>0 && trim($cmdP)) $Where.= \" and \".$cmdParts[$i].\"='\".$this->dataArr[$cmdParts[$i]].\"'\";\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$Where.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_mvalue_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueLocal':\n\t\t\t\t\t\tcase 'uniqueInPid':\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'twice':\n\t\t\t\t\t\t\tif (strcmp($this->dataArr[$theField], $this->dataArr[$theField.'_again']))\t{\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_twice',$this->conf));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif (trim($this->dataArr[$theField])) {\n\t\t\t\t\t\t\t\tif (!$this->cObj->checkEmail($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_valid_email',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'required':\n\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atLeast':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])<$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_min_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'invert':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=$this->dataArr[$theField]?0:1;\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atMost':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])>$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_max_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'inBranch':\n\t\t\t\t\t\t\t$pars = explode(';',$cmdParts[1]);\n\t\t\t\t\t\t\tif (intval($pars[0]))\t{\n\t\t\t\t\t\t\t\t$pid_list = $this->cObj->getTreeList(\n\t\t\t\t\t\t\t\t\tintval($pars[0]),\n\t\t\t\t\t\t\t\t\tintval($pars[1]) ? intval($pars[1]) : 999,\n\t\t\t\t\t\t\t\t\tintval($pars[2])\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (!$pid_list || !t3lib_div::inList($pid_list,$this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_notInList',$this->conf)), $pid_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'unsetEmpty':\n\t\t\t\t\t\t\tif (!$this->dataArr[$theField])\t{\n\t\t\t\t\t\t\t\t$hash = array_flip($tempArr);\n\t\t\t\t\t\t\t\tunset($hash[$theField]);\n\t\t\t\t\t\t\t\t$tempArr = array_keys($hash);\n\t\t\t\t\t\t\t\tunset($this->failureMsg[$theField]);\n\t\t\t\t\t\t\t\tunset($this->dataArr[$theField]);\t// This should prevent the field from entering the database.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//should go in parse values ?\n\t\t\t\t\t\tcase 'wwwURL':\n\t\t\t\t\t\t\t\tif ($this->dataArr[$theField]) {\n\t\t\t\t\t\t\t\t\t\t$wwwURLOptions = array (\n\t\t\t\t\t\t\t\t\t\t'AssumeProtocol' => 'http' ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowBracks' => TRUE ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowedProtocols' => array(0 => 'http', 1 => 'https', ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Require' => array('Protocol' => FALSE , 'User' => FALSE , 'Password' => FALSE , 'Server' => TRUE , 'Resource' => FALSE , 'TLD' => TRUE , 'Port' => FALSE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Forbid' => array('Protocol' => FALSE , 'User' => TRUE , 'Password' => TRUE , 'Server' => FALSE , 'Resource' => FALSE , 'TLD' => FALSE , 'Port' => TRUE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$wwwURLResult = tx_metafeedit_srfeuserregister_pi1_urlvalidator::_ValURL($this->dataArr[$theField], $wwwURLOptions);\n\t\t\t\t\t\t\t\t\t\tif ($wwwURLResult['Result'] = 'EW_OK' ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dataArr[$theField] = $wwwURLResult['Value'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###'] = is_array($this->failureMsg[$theField]) ? implode('<br />',$this->failureMsg[$theField]) : '';\n\t\t\t\t//$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###']?'tx-metafeedit-form-error ':'';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=is_array($this->failureMsg[$theField])?'tx-metafeedit-form-field-error ':'';\n\t\t\t}\n\t\t}\n\t\t//$this->failure=implode(',',$tempArr);\t //$failure will show which fields were not OK\n\t\tif (count($this->failureMsg) >0) {\n\t\t\t$this->failure=1;\n\t\t\tif (count($tempArr)) {\n\t\t\t\tforeach($tempArr as $ta) {\n\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$ta.'###']='tx-metafeedit-form-field-error ';\n\t\t\t\t}\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t}\n\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->metafeeditlib->getLL('error_occured',$this->conf));\n\t\t} else { \n\t\t\t$this->failure=0;\n\t\t\tif (count($tempArr)) {\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->getFailure('_FORM', '_REQUIRED', $this->metafeeditlib->getLL('error_required',$this->conf))); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Call to user eval function\n\n\t\t\n\t\tif ($this->conf['userFunc_afterEval']) t3lib_div::callUserFunction($this->conf['userFunc_afterEval'],$this->conf,$this);\n\n\t}",
"protected function computeItems() {\n $items = [];\n $callback = $this->getSetting('compute_callback');\n if (is_callable($callback)) {\n $items = $callback($this);\n }\n return $items;\n }",
"private function filterData(array $data, callable $function) {\n\t\t$output = array();\n\n\t\tforeach ($data as $key => $value) {\n\t\t\tif ($function($key, $value)) {\n\t\t\t\t$output[$key]=$value;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}",
"function postProcess($data) {\r\n if ($data) {\r\n foreach ($data as $key => $entry) {\r\n // is it in use?\r\n $inUse = $this->Event->checkEvaluationToolInUse('3',$entry['Survey']['id']) ;\r\n\r\n // Put in the custom inUse column\r\n $data[$key]['!Custom']['inUse'] = $inUse ? \"Yes\" : \"No\";\r\n\r\n // Decide whether the course is release or not ->\r\n // (from the events controller postProcess function)\r\n $releaseDate = strtotime($entry[\"Survey\"][\"release_date_begin\"]);\r\n $endDate = strtotime($entry[\"Survey\"][\"release_date_end\"]);\r\n $timeNow = strtotime($entry[0][\"now()\"]);\r\n\r\n if (!$releaseDate) $releaseDate = 0;\r\n if (!$endDate) $endDate = 0;\r\n\r\n $isReleased = \"\";\r\n if ($timeNow < $releaseDate) {\r\n $isReleased = \"Not Yet Open\";\r\n } else if ($timeNow > $endDate) {\r\n $isReleased = \"Already Closed\";\r\n } else {\r\n $isReleased = \"Open Now\";\r\n }\r\n\r\n // Put in the custom isReleased string\r\n $data[$key]['!Custom']['isReleased'] = $isReleased;\r\n }\r\n }\r\n // Return the processed data back\r\n return $data;\r\n }",
"public function evaluate();",
"public function evaluate();",
"function reduce($key,$handler,$finalize=null){\n\t\t$this->_reduce[$key]=[$handler,$finalize];\n\t}",
"public function process()\r\n {\r\n // jobs in the pool\r\n while (count($this->work)) {\r\n $this->collect(function ($task) {\r\n // If a task was marked as done\r\n // collect its results\r\n if ($task->isGarbage()) {\r\n $tmpObj = new stdclass();\r\n $tmpObj->complete = $task->complete;\r\n //this is how you get your completed data back out [accessed by $pool->process()]\r\n $this->data[] = $tmpObj;\r\n }\r\n return $task->isGarbage();\r\n });\r\n }\r\n // All jobs are done\r\n // we can shutdown the pool\r\n $this->shutdown();\r\n return $this->data;\r\n }",
"function processData() ;",
"public function doAlgorithm(array $data): array;",
"function\n_ats2phppre_arrayref_patsfun_8__closurerize($env0)\n{\n return array(function($cenv, $arg0) { return _ats2phppre_arrayref_patsfun_8($cenv[1], $arg0); }, $env0);\n}",
"public function handle(Data $data, Closure $next): mixed\n {\n $this->registrar->loadDeclarations();\n\n // We won't overload the declarations if the data is not empty.\n $data->declarations = $this->registrar->getDeclarations();\n\n return $next($data);\n }",
"public function getData()\n {\n if ($this->today == $this->first_day) {\n $data = $this->getAllData();\n }\n\n if (!empty($data)) {\n foreach ($data as $datum) {\n $this->handleData($datum);\n }\n }\n\n }",
"public function processData() {}",
"public function __invoke() {\n $args = func_get_args();\n $numArgs = count($args);\n\n if ($numArgs > 0) {\n\t$callback = function ($applicativeFun, $applicativeArg) {\n\t return $applicativeFun->apply($applicativeArg);\n\t};\n\t$result = array_reduce($args, $callback, $this);\n } else {\n\t$result = $this->apply();\n }\n\n return $result;\n }",
"public function applyData($data): ?array;",
"public function map(Closure $callback, array $data = []) {\n\t\tif (empty($data)) {\n\t\t\t$this->_value = array_map($callback, $this->_value);\n\t\t} else {\n\t\t\t$this->_value = array_map($callback, $this->_value, $data);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function __invoke()\n {\n $closure = $this->closure;\n return $closure();\n }",
"public function applyRules(&$data = [])\n {\n $filters = $this->filters;\n return array_walk($data, function (&$item, $key) use (&$data, $filters) {\n $res = true;\n for($i=0; $i<count($filters); $i++){\n $operator = $filters[$i][1];\n $operands = [$data[$key][$i]];\n for($j=2;$j<count($filters[$i]);$j++){\n $operands[] = $filters[$i][$j];\n }\n $this->convertType($operands, $filters[$i][0]);\n switch($operator){\n case '=':\n $res = ($res && ($operands[0] == $operands[1]));\n break;\n case '!=':\n $res = ($data[$filters[$i]] != $operand);\n break;\n case '>':\n $res = ($data[$filters[$i]] > $operand);\n break;\n case '<':\n $res = ($data[$filters[$i]] < $operand);\n break;\n case '>=':\n $res = ($data[$filters[$i]] >= $operand);\n break;\n case '<=':\n $res = ($data[$filters[$i]] <= $operand);\n break;\n case 'between':\n $operands[] = $filters[$i][3];\n $res = (($data[$filters[$i]] >= $operand) && ($data[$filters[$i]] <= $operand2));\n break;\n case 'in':\n\n break;\n }\n if(!$res){\n break;\n }\n }\n (!$res && unset($data[$key]));\n });\n }",
"private function _compile_data()\n {\n $this->_set_platform();\n\n foreach (array('_set_robot', '_set_browser', '_set_mobile') as $function)\n {\n if ($this->$function() === TRUE)\n {\n break;\n }\n }\n }",
"function reduce($callable, $initial = null);"
]
| [
"0.50319624",
"0.48877615",
"0.48689067",
"0.48399433",
"0.4791173",
"0.4746769",
"0.4654871",
"0.46485627",
"0.46466678",
"0.46428496",
"0.46153817",
"0.46110988",
"0.45993873",
"0.45864278",
"0.45864278",
"0.45853823",
"0.45851576",
"0.4562102",
"0.45519933",
"0.45267427",
"0.44519573",
"0.44396788",
"0.4415025",
"0.43982834",
"0.43639588",
"0.4361804",
"0.4360898",
"0.435393",
"0.43519187",
"0.43423977"
]
| 0.502286 | 1 |
fin de funcion doLikeDiv / Agrega el boton like $p_dir > direccion a la que se le dara like | function doLikeButton($p_dir){
echo '<div class="fb-like" data-href="'. $p_dir .'" data-width="300" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_list_and_divs($curdir, &$list, &$divs, &$ids) {\n $entries = scandir($_SERVER['DOCUMENT_ROOT'] . $curdir);\n $subdirs = array();\n $files = array();\n\n $list .= \"<ul class=\\\"bullets pointer\\\">\\n\";\n \n foreach ($entries as $name) {\n if ($name == \"..\" || $name == \".\") continue;\n $name = rtrim($curdir, '/') . '/' . $name;\n if (is_dir($_SERVER['DOCUMENT_ROOT'] . $name)) {\n\t$subdirs[] = $name;\n }\n else {\n\t$files[] = $name;\n }\n }\n\n foreach ($subdirs as $sub) {\n $list .= \"<li><span style='font-weight: bold; font-size: 115%;'>\";\n $list .= file_title($sub) . \"</span>\\n\";\n create_list_and_divs($sub, $list, $divs, $ids);\n $list .= \"</li>\";\n }\n\n foreach ($files as $file) {\n $ext = file_ext($file);\n $title = file_title($file);\n $id = sanitize_id($title);\n $ids[] = $id;\n\n $list .= \"<li>\\n\";\n $list .= create_nav($file, $ext, $id, $title) . \"\\n\";\n $list .= \"</li>\\n\";\n\n // this extra style gunk is necessary to force the iframe inside to fill this div\n $divs .= \"<div id=\\\"$id\\\" class=\\\"hidden\\\" \" .\n\t \"style=\\\"width: 100%; height: 100%; position: relative; \" .\n\t \"top: 0; left: 0; bottom: 0; right: 0;\\\"\" .\n\t \">\\n\";\n $divs .= create_body($file, $ext, $id, $title);\n $divs .= \"</div>\\n\";\n }\n\n $list .= \"</ul>\\n\";\n }",
"function buscar($dir,&$archivo_buscar) \n{ // Funcion Recursiva \n // Autor DeeRme \n // http://deerme.org \n if ( is_dir($dir) ) \n { \n // Recorremos Directorio \n $d=opendir($dir); \n while( $archivo = readdir($d) ) \n { \n if ( $archivo!=\".\" AND $archivo!=\"..\" ) \n { \n \n if ( is_file($dir.'/'.$archivo) ) \n { \n // Es Archivo \n if ( $archivo == $archivo_buscar ) \n { \n return ($dir.'/'.$archivo); \n } \n \n } \n \n if ( is_dir($dir.'/'.$archivo) ) \n { \n // Es Directorio \n // Volvemos a llamar \n $r=buscar($dir.'/'.$archivo,$archivo_buscar); \n if ( basename($r) == $archivo_buscar ) \n { \n return $r; \n } \n \n \n } \n \n \n \n \n \n } \n \n } \n \n } \n return FALSE; \n}",
"function thescandir($dir, $level){\n\t$is_dir = true;\n\t\n\tif( !($files = @scandir($dir)) ) // s'il y a une erreur au scandir c'est que c'est un fichier.\n\t{\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t$is_dir = false;\n\t\t\n\t\t// si c'est bien un fichier PHP\n\t\tif( substr(strtolower(strrchr(basename($basename), \".\")), 1) == 'php' ){\n\t\t\t// On ajoute le fichier au listing\n\t\t\t$offset = count( $_SESSION['Listing_Fichiers'] );\n\t\t\t$_SESSION['Listing_Fichiers'][$offset] = $dir;//$basename;\n\t\t\t//echo \"base : \".$basename.\" | dir : \".$dir.\"<br/>\";\n\t\t}\n\t}\n\telse\n\t{\n\t\tif($dir != \".\" and $dir != \"..\" )\n\t\t{\n\n\t\t}\n\t\t$is_dir = true;\n\t\t$level ++;\n\t}\n\t\n\tif($dir != \".\" and $dir != \"..\" )\n\t{\n\t\t$extension = pathinfo($dir,PATHINFO_EXTENSION);\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t\n\t}\n\t\n\t// recursivité\n\t$i=0;\n\twhile( @$files[$i] )\n\t{\n\t\tif($files[$i] != \".\" and $files[$i] != \"..\")\n\t\t{\t\t\t\t\n\t\t\t$newdir = $dir.\"/\".$files[$i];//concatène les noms de dossiers\n\t\t\t\t\n\t\t\tif($dir == \".\")\n\t\t\t\t$newdir = $files[$i];\n\t\t\t\t\n\t\t\tthescandir($newdir, $level); \n\t\t}\n\t\t\n\t\t$i++;\n\t}\n\n\t\n}",
"function displayDir($dir,$path,$origPath) {\n\t\t\n\t\t// Get the template\n\t\t$templateUrl = $conf['templateFile'];\n\t\tif (empty($templateUrl)) $templateUrl = \"EXT:\".$this->extKey.\"/pi1/simplefilebrowser_pi1_template.html\";\n \t\t$this->templateCode = $this->cObj->fileResource($templateUrl);\n\t\t\n\t\t$template = $this->cObj->getSubpart($this->templateCode,'###SIMPLEFILEBROWSER_ENTRY###');\n\n\t\tif ($path != $origPath) {\n\t\t\t$content .= '<a href=\"'.$this->pi_linkTP_keepPIvars_url(array(path=>substr($path,0,strrpos($path,\"/\",1)))).'\">';\n\t\t\t$content .= '<img src=\"'.t3lib_extMgm::siteRelPath('simplefilebrowser').'res/icon_folder.gif\" border=\"0\" class=\"dpIcon\"> '.'<strong>..</strong>'.\"<br>\";\n\t\t\t$content .= '</a>';\n\t\t} \n\t\t\n\t\tif (is_array($dir['dir'])) {\n\t\t\tforeach ($dir['dir'] as $key => $elem) {\n\t\t\t\t$content .= '<a href=\"'.$this->pi_linkTP_keepPIvars_url(array(path=>$path.\"/\".$elem)).'\">';\n\t\t\t\t$content .= '<img src=\"'.t3lib_extMgm::siteRelPath('simplefilebrowser').'res/icon_folder.gif\" border=\"0\" class=\"dpIcon\"> '.$elem.\"<br>\";\n\t\t\t\t$content .= '</a>';\n\t\t\t}\n\t\t}\n\t\tif (is_array($dir['files'])) {\n\t\t\n\t\t\t// get additional information like modification date\n\t\t\t$dateFormat = (!empty($this->conf['dateFormat'])) ? $this->conf['dateFormat'] : \"d.m.Y H:i\";\n\t\t\t$fullDir = t3lib_div::getAllFilesAndFoldersInPath(array(),$path);\n\t\t\tforeach ($fullDir as $key => $elem) {\n\t\t\t\t$info = stat($elem);\n\t\t\t\t$addinfo[$key]['modifydate'] = date($dateFormat,$info['mtime']);\n\t\t\t}\n\t\t\t\n\t\t\t// Specify the last entry\n\t\t\t$last = end($dir['files']);\n\n\t\t\tforeach ($dir['files'] as $key => $elem) {\n\t\t\t\t$filename = $this->getFileName($elem);\n\t\t\t\t$mimetype = $this->getMimeType($filename);\n\t\t\t\t$ext = $mimetype['extension'];\n\t\t\t\t\n\t\t\t\tif ($elem == $last) {\n\t\t\t\t\t$markers['###JOIN###'] = '<img src=\"'.t3lib_extMgm::siteRelPath('simplefilebrowser').'res/join_end.gif\" border=\"0\" class=\"dpIcon\">';\n\t\t\t\t} else {\n\t\t\t\t\t$markers['###JOIN###'] = '<img src=\"'.t3lib_extMgm::siteRelPath('simplefilebrowser').'res/join.gif\" border=\"0\" class=\"dpIcon\">';\n\t\t\t\t}\n\t\t\t\t//echo $key;\n\t\t\t\t$link = '<a href=\"'.$this->pi_linkTP_keepPIvars_url(array(file=>$key, path=>$path)).'\">';\n\t\t\t\t$link .= '<img src=\"'.t3lib_extMgm::siteRelPath('simplefilebrowser').'res/icon_'.$ext.'.gif\" border=\"0\" class=\"dpIcon\"> '.$elem;\n\t\t\t\t$link .= '</a>';\n\t\t\t\t$markers['###LINK###'] = $link;\n\t\t\t\t\n\t\t\t\t$subTemplate = $this->cObj->getSubpart($template,'###SHOWDATEWRAP###');\n\t\t\t\t\n\t\t\t\tif ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showdate', 'sDEF')) {\n\t\t\t\t\t$subMarkerContent = $this->cObj->substituteMarker($subTemplate,'###SHOWDATE###',$addinfo[$key]['modifydate']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$subMarkers['###SHOWDATEWRAP###'] = $subMarkerContent;\n\t\t\t\t\n\t\t\t\t//$content .= $this->cObj->substituteMarkerArrayCached($template,$markers,$subMarkers);\n\t\t\t\t// code to replace substituteMarkerArrayCache\n\t\t\t\t$content .= $this->cObj->substituteMarkerArray($template, $markers);\n\t\t\t\tforeach ($subMarkers as $subPart => $subContent) {\n \t\t\t\t$content = $this->cObj->substituteSubpart($content, $subPart, $subContent);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}",
"function directory_scan($directory, $withfiles) {\n\t$scanned_directory = array_diff(scandir($directory), array(\"..\", \".\")); //This removes all of the unessesary results\n\n\tfor ($i = 0; ($i < count(scandir($directory))) && $withfiles == true; $i = $i + 1) {\n\t\tif (isset($scanned_directory[$i]) && (is_dir($directory . \"/\" . $scanned_directory[$i]) == FALSE)) { // If current item is a file, make it a download link\n\t\t\techo \"<div class='fileDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='movefrom[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/file.svg' class='foldersvg'/>\";\n\t\t\techo \"<p class='fileLink'>\" . $scanned_directory[$i] . \"</p>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='fileinfo'><b>Type</b>: \" . mime_content_type($directory. \"/\" . $scanned_directory[$i]) . \" <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 0) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\t\t\t\n\t\t\techo \"</div>\";\n\t\t} else if (isset($scanned_directory[$i]) && $directory . \"/\" . $scanned_directory[$i] != \"uploads/\" . $_SESSION[\"username\"] . \"/Trash\") { // Makes this a special dir box if a item is folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='movefrom[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\techo \"<input type='button' class='folderButton' value='\" . $scanned_directory[$i] . \"' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Type</b>: Folder <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 1) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\n\t\t\techo \"</div>\"; \n\t\t}\n\t}\n\t\n\tfor ($i = 0; ($i < count(scandir($directory))) && $withfiles == false; $i = $i + 1) { //$withfiles only outputs files when true. when false, it will output files and folders. This is for the right-side of the page\n\t\tif ($i==0 && $directory != \"uploads/\" . $_SESSION[\"username\"]) { //when $i gets to its first iteration, output the \"back a directory\" folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='moveto[../]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\techo \"<input type='button' class='folderButton' value='../' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Info</b>: Selecting this will move your selection back a folder.</p> \";\n\t\t\techo \"</div>\";\n\t\t}\n\t\t\n\t\tif (isset($scanned_directory[$i]) && is_dir($directory . \"/\" . $scanned_directory[$i])) { // Makes this a special dir box if an item is folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='moveto[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\tif ($directory . \"/\" . $scanned_directory[$i] == \"uploads/\" . $_SESSION[\"username\"] . \"/Trash\") {\n\t\t\t\techo \"<img src='Assets/SVG/bin.svg' class='foldersvg'/>\";\n\t\t\t} else {\n\t\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\t}\n\t\t\techo \"<input type='button' class='folderButton' value='\" . $scanned_directory[$i] . \"' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Type</b>: Folder <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 1) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\n\t\t\techo \"</div>\";\n\t\t}\n\t}\n\n}",
"function LoadMyFile($folderId = null, $showDirectory, $showAddButton=\"\", $action=\"\")\n {\n $html = \"<div class='content-panel'>\";\n\n //Recuperation des dossiers et fichiers\n $folders = FolderHelper::GetByUser($this->Core, $folderId);\n $files = FileHelper::GetByUser($this->Core, $folderId);\n\n if(count($folders) > 0 || count($files) > 0 )\n {\n //Entete\n /* $html .= \"<div class='headFolder titleBlue' >\";\n $html .= \"<b class='blueTree'> </b>\" ;\n $html .= \"<span class='blueTree name' ><b>\".$this->Core->GetCode(\"Name\").\"</b></span>\" ;\n $html .= \"<span class='blueTree'><b>\".$this->Core->GetCode(\"DateCreated\").\"</b></span>\" ;\n $html .= \"<span class='blueTree'><b>\".$this->Core->GetCode(\"DateModified\").\"</b></span>\" ;\n $html .= \"<span class='blueTree'><b>\".$this->Core->GetCode(\"Users\").\"</b></span>\" ;\n $html .= \"</span>\"; \n $html .= \"</div>\" ;*/\n }\n\n //Retour répertoire parent\n if($folderId != null)\n {\n //Recuperation du dossier\n $folder = new FileFolder($this->Core);\n $folder->GetById($folderId);\n\n //Si je suis le propriétaire du dossier \n if( ($folder->ParentId->Value == \"\" && $folder->UserId->Value == $this->Core->User->IdEntite )\n || $folder->Parent->Value->UserId->Value == $this->Core->User->IdEntite \n || FolderHelper::IsAutorized($this->Core, $folder->ParentId->Value) \n )\n {\n //On affiche le repertoire parent\n if($showDirectory)\n {\n $html .= \"<div class='folder' >\";\n $html .= \"<i class='icon-folder-close blueOne'> </i>\" ;\n $html .= \"<span class='blueOne name' id='\".$folder->ParentId->Value.\"' >...</span>\" ;\n }\n }\n else\n { \n if($showDirectory)\n {\n //Retour à la racine des dossier partage\n $html .= \"<div class='folder' >\";\n $html .= \"<i class='icon-folder-close blueOne'> </i>\" ;\n $html .= \"<span class='blueOne' onclick= 'FileAction.LoadSharedFile()' >...</span>\" ;\n }\n }\n }\n\n\n //Ajout des dossier\n if(count($folders) > 0 && $showDirectory)\n {\n $i=0;\n\n foreach($folders as $folder)\n {\n $html .= \"<div class='folder' >\";\n $html .= \"<i class='icon-folder-close blueOne'> </i>\" ;\n $html .= \"<span class='blueOne name' id='\".$folder->IdEntite.\"' >\".$folder->Name->Value.\"</span>\" ;\n\n //Dossier d'application\n if($folder->AppName->Value != \"\")\n {\n $img = new Image(\"../Apps/\".$folder->AppName->Value.\"/Images/logo.png\");\n $img->Title->Value = $img;\n $html .= \"<span >\".$img->Show().\"</span>\" ;\n }\n else\n {\n $html .= \"<span ></span>\" ;\n }\n\n $html .= \"<span class='date'>\".$folder->DateCreated->Value.\"</span>\" ;\n $html .= \"<span class='date'>\".$folder->DateModified->Value.\"</span>\" ;\n\n //Partagé avec\n $html .= \"<span class='date'>\".FolderHelper::GetConcatUser($this->Core, $folder->IdEntite) .\"</span>\" ;\n\n //Bouton d'action\n if($folder->UserId->Value == $this->Core->User->IdEntite)\n {\n $html .= \"<span class='action'>\";\n $html .= \"<i class='icon-share' id='\".$folder->IdEntite.\"' title='\".$this->Core->GetCode('File.Share').\"' onClick='FileAction.ShareFolder(this)' > </i>\" ;\n $html .= \"<i class='icon-remove' id='\".$folder->IdEntite.\"' title='\".$this->Core->GetCode('File.Remove').\"' onClick='FileAction.RemoveFolder(this)' > </i></span>\" ;\n }\n\n $html .= \"</div>\" ;\n }\n }\n\n //Ajout de fichier\n if($showAddButton)\n {\n $btnAdd = new Button(BUTTON);\n $btnAdd->Value = $this->Core->GetCode(\"AddFile\");\n $btnAdd->OnClick = $action;\n $html .= \"<div>\".$btnAdd->Show().\"</div>\";\n }\n\n //Ajout des fichier\n if(count($files) > 0)\n {\n foreach($files as $file)\n {\n if($i==1)\n {\n $i=0;\n $class='lineClair';\n }\n else\n {\n $i=1;\n $class='lineFonce';\n }\n $html .= \"<div class='file $class' >\";\n $html .= \"<i class='icon-file blueTree'> </i>\" ;\n $html .= \"<span class='blueOne name' id='\".$file->IdEntite.\"' >\".$file->Name->Value.\"</span>\" ;\n\n //Fichier d'application\n if($file->AppName->Value != \"\")\n {\n $img = new Image(\"../Apps/\".$file->AppName->Value.\"/Images/logo.png\");\n $img->Title->Value = $img;\n $html .= \"<span >\".$img->Show().\"</span>\" ;\n }\n else\n {\n $html .= \"<span ></span>\" ;\n }\n\n $html .= \"<span class='date'>\".$file->DateCreated->Value.\"</span>\" ;\n $html .= \"<span class='date'>\".$file->DateModified->Value.\"</span>\" ;\n\n //Partagé avec\n $html .= \"<span class='date'>\".FileHelper::GetConcatUser($this->Core, $file->IdEntite) .\"</span>\" ;\n\n if($file->UserId->Value == $this->Core->User->IdEntite)\n {\n $html .= \"<span class='action'><i class='icon-share' id='\".$file->IdEntite.\"' title='\".$this->Core->GetCode('File.Share').\"' onClick='FileAction.ShareFile(this)' > </i>\" ;\n $html .= \"<i class='icon-remove' id='\".$file->IdEntite.\"' title='\".$this->Core->GetCode('File.Remove').\"' onClick='FileAction.RemoveFile(this)' > </i></span>\" ;\n }\n\n $html .= \"</div>\" ;\n }\n }\n\n $html .= \"</div>\";\n\n if($html != \"<div class='content-panel'>\")\n {\n return $html;\n }\n else\n {\n return \"File.NoFolder\";\n }\n }",
"function checkDirectory($dir){\r\n\t\t\t\t\t\t\tif (is_dir($dir)) {\r\n\t\t\t\t\t\t\t\tif ($dh = opendir($dir)) {\r\n\t\t\t\t\t\t\t\t\twhile (($file = readdir($dh)) !== false) {\r\n\t\t\t\t\t\t\t\t\t\t if ($file == '.' || $file == '..') {\r\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t$file_path = $dir . DIRECTORY_SEPARATOR . $file;\r\n\t\t\t\t\t\t\t\t\t\tif(is_dir($file_path)){\r\n\t\t\t\t\t\t\t\t\t\t\techo \"<p class='content_title'>$file <p>\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"<p>$file <p>\";\r\n\t\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\tclosedir($dh);\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}",
"function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}",
"function listar_directorios_ruta($ruta, $vlpadre){\n if (is_dir($ruta)) { \n if ($dh = opendir($ruta)) { \n\t\t$tmstmp = time();\n\t\t $rutabase = \"../docs/\".$_POST[\"idcliente\"].\"/\";\n\t\tmkdir($rutabase, 0777); \n\t\t \n while (($file = readdir($dh)) !== false) { \n //esta l�nea la utilizar�amos si queremos listar todo lo que hay en el directorio \n //mostrar�a tanto archivos como directorios \n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta . $file); \n if (is_dir($ruta . $file) && $file!=\".\" && $file!=\"..\"){ \n //solo si el archivo es un directorio, distinto que \".\" y \"..\" \n echo \"<br>Directorio: \".$ruta.\" --\".$file; \n\t\t\t\t$carpeta = creacarpetacliente($_POST[\"idcliente\"], substr($ruta,2).$file, $vlpadre );\n\t\t\t\t//print \"<br>EL Id de carpeta es: \".$carpeta;\n\t\t\t\t//exit;\n\t\t\t\tmkdir($rutabase.$carpeta, 0777);\n listar_directorios_ruta($ruta . $file . \"/\", $carpeta); \n } elseif($file!=\".\" && $file!=\"..\" && $file!=\"cmasivo.php\" && $file!=\"proceso.php\"){\n\t\t\t$arrfile =split(\"/\",substr($ruta,1).$file );\n\t\t\t\t$totarr = count($arrfile)-1;\n\n\t\t\t\t$tamano= filesize($rutabase.$vlpadre.\"/\".$arrfile[$totarr]);\n\t\t\t\tcopy($ruta.$file , $rutabase.$vlpadre.\"/\".$arrfile[$totarr] );\n\t\t\t\t echo \"<br>Copiar y subir a BD Archivo: $ruta$file\".\" -- \".$rutabase.$vlpadre.\"/\".$arrfile[$totarr];\n\t\t\t\t$pathtofile = $_POST[\"idcliente\"].\"/\".$vlpadre.\"/\".$arrfile[$totarr];\n\t\t\t\tinsertaarchivobd($_POST[\"idcliente\"], substr($ruta,1).$file, $pathtofile, $vlpadre, $tamano );\n\t\t\t\t\n\t\t\t}\n } \n closedir($dh); \n } \n }else \n echo \"<br>No es ruta valida\"; \n}",
"function showJpgDirectory($path, $allowParent) {\n\n\t// Check folder exists\n\tif (!is_dir($path)) {\n\t\techo \"Unable to find directory!\";\n\t\treturn false;\n\t}\n\t\n // Try and open the directory\n\tif ($handle = opendir($path)) {\n\n\t\t// loop over the directory\n\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\n\t\t\tswitch(filetype($path.'/'.$entry)):\n\t\t\t\tcase \"file\":\n\t\t\t\t\t// Get the file extention\n\t\t\t\t\t$lastbullet = strrchr($entry,'.');\n\t\t\t\t\t$ext = strtolower(substr($lastbullet,1));\n\t\t\t\t\t\n\t\t\t\t\t// Only show JPG images\n\t\t\t\t\tif ($ext == \"jpg\") {\n\t\t\t\t\t\techo \"<img src='/rbwebdesigns/wiki/imagelib/$entry' class='libicon' />$entry<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"dir\":\n if(!$allowParent && ($entry == \".\" || $entry == \"..\")) {\n // Don't display link as we don't want to go to higher dir \n } else {\n\t\t\t\t\t echo \"<a href='#' onclick='showDirectory($entry)'>$entry</a><br/>\";\n }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tendswitch;\n\t\t}\n\t\tclosedir($handle);\n\t}\n}",
"function drive()\r\n {\r\n $r='';\r\n foreach (range(\"A\", \"Z\") as $val) {\r\n if(is_dir($val.\":\".DIRECTORY_SEPARATOR))\r\n {\r\n \r\n $ad=$val.\":\".DIRECTORY_SEPARATOR;\r\n $r=$r.=\"<a href='?act=file&dir=$ad'>$val:\".DIRECTORY_SEPARATOR.\"</a> \";\r\n }\r\n }\r\n return $r;\r\n }",
"function show_perfil($visitado){\n\t\t\n\t\tif ($visitado != null) {\n\n\t\t\t$posts = show_posts2($visitado);\n\t\t\tif (count($posts)) {\n\t\t\t\t\t\t\t// Passando frase por frase\n\t\t\t\t\t\t\tforeach($posts as $key = > $list) {\n\n\t\t\t\t\t\t\t\t\t$tempo = time_elapsed_string($list['stamp']);\n\t\t\t\t\t\t\t\t\t$str = $list['userid'];\n\t\t\t\t\t\t\t\t\t$id_post = $list['id'];\n\t\t\t\t\t\t\t\t\t$tag1 = $list['tag1'];\n\t\t\t\t\t\t\t\t\t$tag2 = $list['tag2'];\n\t\t\t\t\t\t\t\t\t$tag3 = $list['tag3'];\n\n\n\t\t\t\t\t\t\t\t\t//vendo a cor dos botões\n\t\t\t\t\t\t\t\t\t$query1 = $list['id'];\n\n\t\t\t\t\t\t\t\t\t$pontos = apreciados($query1);\n\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"select ponto_ruim,ponto_coracao,ponto_estrela from apreciados where id_apreciado='$query1' and id_apreciador='$id_principal'\");\n\t\t\t\t\t\t\t\t\t$row0 = mysql_fetch_array($sql);\n\t\t\t\t\t\t\t\t\t$ponto_ruim = $row0['ponto_ruim'];\n\t\t\t\t\t\t\t\t\t$ponto_estrela = $row0['ponto_estrela'];\n\t\t\t\t\t\t\t\t\t$ponto_coracao = $row0['ponto_coracao'];\n\n\t\t\t\t\t\t\t\t\tif ($ponto_ruim == 1) {\n\t\t\t\t\t\t\t\t\t\t\t$corlike = 'span_hang2';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t$corlike = 'span_hang';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ($ponto_estrela == 1) {\n\t\t\t\t\t\t\t\t\t\t\t$corlike2 = 'span_estrela2';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t$corlike2 = 'span_estrela';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ($ponto_coracao == 1) {\n\t\t\t\t\t\t\t\t\t\t\t$corlike3 = 'span_coracao2';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t$corlike3 = 'span_coracao';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// fim vendo a cor dos botões\n\t\t\t\t\t\t\t\t\t//CONTAINER DO POST\n\t\t\t\t\t\t\t\t\techo \"<div class=\\\"post\\\" lang='$id_post' >\";\n\t\t\t\t\t\t\t\t\techo \"<div class=\\\"top-post\\\" lang='$id_post'>\";\n\t\t\t\t\t\t\t\t\techo \"<div>\";\n\t\t\t\t\t\t\t\t\techo \"<img class=\\\"circulo\\\" onclick=\\\"location.href='perfil.php?id=$str'\\\" src=\\\"getImagem.php?cod=\".$list['userid'].\"\\\"/>\";\n\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\techo \"<h1 onclick=\\\"location.href='perfil.php?id=$str'\\\">\".$list['nome'].' '.$list['sobrenome'].\"</h1>\";\n\n\t\t\t\t\t\t\t\t\t// ---- tags --- \n\t\t\t\t\t\t\t\t\tif ($tag1 != null) {\n\t\t\t\t\t\t\t\t\t\t\tif ($tag2 != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($tag3 != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<div class=\\\"exibir_tag\\\">\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag1'\\\" >\".$tag1.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag2'\\\" >\".$tag2.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag3'\\\" >\".$tag3.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<div class=\\\"exibir_tag\\\">\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag1'\\\" >\".$tag1.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag2'\\\" >\".$tag2.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<div class=\\\"exibir_tag\\\">\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \" <span class=\\\"tag_container\\\" onclick=\\\"location.href='painel_tags.php?id=$tag1'\\\" >\".$tag1.\"</span>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"<div class=\\\"exibir_tag\\\">\";\n\t\t\t\t\t\t\t\t\t\t\techo \"<span ></span>\";\n\t\t\t\t\t\t\t\t\t\t\techo \"</div>\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// ---- fim tags --- \n\t\t\t\t\t\t\t\t\techo \"<h2>\".$tempo.\"</h2>\";\n\t\t\t\t\t\t\t\t\t// fecha div top\n\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\techo \"<div class=\\\"container\\\">\";\n\t\t\t\t\t\t\t\t\techo \"<img class=\\\"foto1\\\" src=\\\"getImagem1.php?cod=\".$query1.\"\\\"/>\";\n\t\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t\t\techo \"<div class=\\\"post-bot\\\" lang='$id_post'>\";\n\t\t\t\t\t\t\t\t\techo \"<a alt=\\\"ponto_estrela\\\" class=\\\"hvr-icon-pop\\\">Contemplar<span id=\\\"\".$id_post.\"est\\\" class=\\\"$corlike2\\\"></span></a>\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"ponto_estrela\\\">\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"valor1\\\">\".$pontos['ponto_estrela'].\"</span>\";\n\t\t\t\t\t\t\t\t\techo \"</span>\";\n\t\t\t\t\t\t\t\t\techo \"<a alt=\\\"ponto_coracao\\\" class=\\\"hvr-icon-coracao\\\">Admirar<span id=\\\"$id_post\\\" class=\\\"$corlike3\\\"></span></a>\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"ponto_coracao\\\">\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"valor2\\\">\".$pontos['ponto_coracao'].\"</span>\";\n\t\t\t\t\t\t\t\t\techo \"</span>\";\n\t\t\t\t\t\t\t\t\techo \"<a alt=\\\"ponto_ruim\\\" class=\\\"hvr-icon-hang\\\">Desprezar<span id=\\\"\".$id_post.\"desp\\\" class=\\\"$corlike\\\"></span></a>\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"ponto_ruim\\\">\";\n\t\t\t\t\t\t\t\t\techo \"<span class=\\\"valor3\\\">\".$pontos['ponto_ruim'].\"</span>\";\n\t\t\t\t\t\t\t\t\techo \"</span>\";\n\t\t\t\t\t\t\t\t\techo \"</div>\";\n\n\t\t\t\t\t\t\t\t\techo \"</div>\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<p style=\\\"position:relative; left:300px; font-size:25px; margin-bottom:250px;\\\"><b> <?php print ($dados_visitado['nome']); ?> não tem postagens.</b></p>\";\n\t\t\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\t\t\theader('location:painel.php');\n\t\t}\n\t\t\n\t}",
"function pilihmedia(){\n\t\t$idp = explode(\"_\",$_POST['idparent']);\n\t\t$id_ini = end($idp);\n\t\t$ini = $this->m_fmanager->ini_folder($id_ini);\n\t\tif(count($idp)==1){\n\t\t\t$komponen = \"assets/media/upload/\".$ini->link.\"/\";\n\t\t} else {\n\t\t\t$komponen = \"\";\n\t\t\tfor($i=0;$i<count($idp)-1;$i++){\n\t\t\t\t$iniF = $this->m_fmanager->ini_folder($idp[$i]);\n\t\t\t\t$komponen = $komponen.$iniF->link.\"/\";\n\t\t\t}\n\t\t\t$komponen = \"assets/media/upload/\".$komponen.$ini->link.\"/\";\n\t\t}\n\n\t\t$idd = end($idp);\n\t\t$data['idp'] = $_POST['idparent'];\n\t\t$data['level'] = $_POST['level'];\n\t\t$data['folder'] = $this->m_fmanager->ini_folder($idd);\n\t\t$data['isi'] = $this->m_fmanager->getfile($idd);\n\t\t$data['idd'] = $idd;\n\t\t$data['path'] = $komponen;\n\n\t\t$this->load->view('fmanager/pilihmedia',$data);\n\t}",
"function presentarImagenesPublicacion($idPP)\r\n {\r\n $id=$idPP;\r\n $directory=('upload/');\r\n $dirint = dir($directory);\r\n if ($idPP == null) {\r\n $id = $this->ultimoId();\r\n }\r\n\r\n while(($archivo = $dirint->read()) !== false)\r\n {\r\n $str = $archivo;\r\n $caracteres = preg_split('/_/', $str, -1, PREG_SPLIT_NO_EMPTY);\r\n // var_dump($caracteres);\r\n // $items = (string)$id;\r\n // var_dump($items);\r\n if ($caracteres['0'] === $id){\r\n $imagen = $id.'_'.$caracteres['1'];\r\n // var_dump($imagen);\r\n echo '<div class=\"col-md-6\" style=\"width:20%;\"><img src=\"/inmobiitla/upload/'.$imagen.'\" class=\"img-responsive img-thumbnail\" /></div>'.\"\\n\";\r\n }\r\n }\r\n $dirint->close();\r\n }",
"function filets_sep_installe_dist() {\n//cs_log('filets_sep_installe_dist()');\n\tinclude_spip('inc/texte');\n\t// Tester si on echappe en span ou en div\n\t$mode = preg_match(',<('._BALISES_BLOCS.'|p)(\\W|$),iS', _FILETS_SEP_BALISE_DEBUT)?'div':'span';\n\t$bt = defined('_DIR_PLUGIN_PORTE_PLUME');\n\t$filets = array();\n\t// filets numeriques\n\tfor($i=0; $i<=_FILETS_SEP_MAX_CSS; $i++) {\n\t\t$filets[6][] = $i;\n\t\t$filets[1][\"$i\"] = cs_code_echappement(_FILETS_SEP_BALISE_DEBUT.\" class='filet_sep filet_sep_$i'\"._FILETS_SEP_BALISE_FIN, '', $mode);\n\t}\n\t// filets image\t\n\t$path = find_in_path('img/filets');\n\t$dossier = opendir($path);\n\tif($path) while ($image = readdir($dossier)) {\n\t\tif (preg_match(',^(([a-z0-9_-]+)'._FILETS_REG_EXT.'),', $image, $reg)) {\n\t\t\t$filets[0][] = '__'.$reg[1].'__';\n\t\t\t$filets[6][] = preg_quote($reg[1]);\n\t\t\t$filets[2][] = $reg[2];\n\t\t\tlist(,$haut) = @getimagesize($path.'/'.$reg[1]);\n\t\t\tif ($haut) $haut=\"height:{$haut}px;\";\n\t\t\t$f = url_absolue($path).'/'.$reg[1];\n\t\t\t$filets[1][$reg[1]] = cs_code_echappement(_FILETS_SEP_BALISE_DEBUT.\" class=\\\"filet_sep filet_sep_image\\\" style=\\\"$haut background-image: url($f);\\\"\"._FILETS_SEP_BALISE_FIN, '', $mode);\n\t\t\tif($bt)\n\t\t\t\t$filets[4]['filet_'.str_replace('.','_',$reg[1])] = $reg[1];\n\t\t}\n\t}\n\t// RegExpr finale\n\t$filets[6] = _FILETS_REG_DEBUT . join('|', $filets[6]) . _FILETS_REG_FIN;\n\tif($bt) for($i=0; $i<=_FILETS_SEP_MAX_CSS; $i++)\n\t\t$filets[5]['filet_'.$i] = $i;\n\treturn array($filets);\n}",
"function dir_list($file)\n{\n $file_list = scandir($file);\n foreach($file_list as $item)\n {\n if($item == '.' || $item == '..')continue;\n \n $file_path = $file . '/' . $item;\n if(is_dir($file_path))\n {\n echo \"<font color='red'>$file_path</font><br/>\";\n dir_list($file_path);\n }\n else{\n echo $file_path . \"<br>\";\n }\n }\n}",
"function admin_showgal($real_path) {// global $get, $uri;\n\t/*$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}*/\n\techo '<div class=\"show_img\">';\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}",
"function getDirectories($dir)\r\n{\r\n\tglobal $debug;\r\n\t$directories = getFolderList($dir);\r\n\t// Only bother with it if there are any subdirectories here\r\n\tif (count($directories)>0)\r\n\t{\r\n\t\t$getDirectories = '<div class=\"list-group\">';\r\n\t\tforeach($directories as $directory)\r\n\t\t{\r\n\t\t\t// Only bother with it if there are playable tracks or subdirectories\r\n\t\t\tif ( getTracksCount($directory)>0 || getFoldersCount($directory)>0 )\r\n\t\t\t{\r\n\t\t\t\t$getDirectories .= '<a href=\"?dir='.rawurlencode($directory);\r\n\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$getDirectories .= '&debug=log';\r\n\t\t\t\t}\r\n\t\t\t\t$getDirectories .= '\" class=\"list-group-item\" title=\"Open this directory\">'.substr($directory,strrpos($directory,\"/\")+1).'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\t\tunset($directories);\r\n\t\t$getDirectories .= '</div>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$getDirectories = '';\r\n\t}\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"getDirectories(\".$dir.\")\\n----------\\n\";\r\n\t\t$log .= \"getDirectories = \".$getDirectories.\"\\n\\n\";\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $getDirectories;\r\n}",
"function recursiveDirectory($directory){\n foreach(glob(\"{$directory}/*\") as $file)\n {\n //echo \"recorriendo el FICHERO $file<br>\";\n\n if(is_dir($file)) {\n //echo \"directorio $directory fichero $file<br>\";\n anadirImagen($file);\n recursiveDirectory($file);\n } else {\n\n anadirImagen($file);\n\n }\n }\n anadirImagen($directory);\n $parent = dirname($directory);\n while (strcmp($parent, 'Repositorio') != 0) {\n anadirImagen($parent);\n $parent = dirname($parent);\n }\n}",
"function displayDirectories($dir)\r\n{\r\n\t// $bcI is the iterator from getBreadcrumbs()\r\n\tglobal $group, $bcI, $debug;\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"displayDirectories(\".$dir.\")\\n----------\\n\";\r\n\t}\r\n\tif ( $group==true && $bcI==2 )\r\n\t{\r\n\t\t$getDirectories = getGroupedDirectories($dir);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"getDirectories = getGroupedDirectories(\".$dir.\")\\n\\n\";\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$getDirectories = getDirectories($dir);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"getDirectories = getDirectories(\".$dir.\")\\n\\n\";\r\n\t\t}\r\n\t}\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $getDirectories;\r\n}",
"function wiki_explode_path($dir, $l='[', $p=']', $prefix='?page=') {\n $temp = explode('/', preg_replace('/\\/+/', '/', $dir)); //TODO zkopirovat do jukeboxu\n $out = '';\n for($j=sizeof($temp)-1;$j>=0;$j--) {\n $dir = '';\n for($i=0;$i<(sizeof($temp)-$j);$i++) {\n $dir.=$temp[$i];\n if($i<sizeof($temp)-1) $dir.='/';\n }\n if($temp[$i-1]!='') $out.=$l.'<a href=\"'.$prefix.rawurlencode($dir).'\">'.htmlspecialchars($temp[$i-1]).'</a>'.$p;\n }\n return($out);\n}",
"function dir_tree($dir,$search_string=\"0000\") {\r\n global $debug_jon,$dir_to_search;\r\n if($string_to_search==\"000\") return \"NoFile\";\r\n $path = '';\r\n $stack[] = $dir;\r\n while ($stack) {\r\n $thisdir = array_pop($stack);\r\n if ($dircont = scandir($thisdir)) {\r\n $i=0;\r\n while (isset($dircont[$i])) {\r\n if ($dircont[$i] !== '.' && $dircont[$i] !== '..') {\r\n $current_file = \"{$thisdir}/{$dircont[$i]}\";\r\n\t\t\t\t \r\n if (is_file($current_file)) {\r\n\t\t\t\t\t\t//$current_file=mb_convert_encoding($current_file,\"utf8\",\"8859-1\");\r\n\t\t\t\t\t\t$current_file= iconv( \"iso-8859-7\",\"utf-8\", $current_file );\r\n\t\t\t\t\t\t$dircont[$i]= iconv( \"iso-8859-7\",\"utf-8\", $dircont[$i] );\r\n\t\t\t\t\t if (strpos($current_file,$search_string)) {\r\n\t\t\t\t\t\t\t\techo \"<h3><a href='$current_file' target=_blank >$dircont[$i]</a></h3>\";\r\n\t\t\t\t\t\t\t\t//if($debug_jon) \r\n\t\t\t\t\t\t\t\t//echo \"<h2>smartDOWNLOADFILE ONLY<a href='../$dir_to_search/download.php?f=\". urlencode(\"$current_file\").\"' target=_blank >$dircont[$i]</a></h2>\";\r\n\t\t\t\t\t\t}\t\t\t\t \r\n $path[] = \"{$thisdir}/{$dircont[$i]}\";\r\n\t\t\t\t\t \r\n } elseif (is_dir($current_file)) {\r\n $path[] = \"{$thisdir}/{$dircont[$i]}\";\r\n $stack[] = $current_file;\r\n }\r\n }\r\n $i++;\r\n }\r\n }\r\n }\r\n return $path;\r\n}",
"function PCODER_ListadoVisualExploracionArchivos($RutaExploracion=\"\",$Filtro_contenido=\"\",$TituloExploracion=\"\",$PermitirDescarga=1)\n {\n global $MULTILANG_TotalRegistros,$MULTILANG_Explorar,$MULTILANG_Filtro,$MULTILANG_Descargar,$MULTILANG_Tipo,$MULTILANG_Fecha,$MULTILANG_Peso;\n //Si la ruta de exploracion es diferente de vacio hace el proceso de busqueda de archivos\n if ($RutaExploracion!=\"\")\n {\n //Inicia Marco de presentacion de archivos\n echo '\n <div class=\"panel panel-default\"> <!-- Clase chat-panel para altura -->\n <div class=\"well well-sm\">\n <span class=\"label label-primary\">'.$TituloExploracion.'</span> '.$MULTILANG_Explorar.' <b>'.$RutaExploracion.'</b> '.$MULTILANG_Filtro.' '.$Filtro_contenido.':\n </div>\n <div class=\"panel-body\">\n <ul class=\"chat\">';\n\n $ConteoElementos=0;\n $TotalTamanoElementos=0;\n \n //Obtiene la lista de archivos\n $ListadoArchivos=PCODER_ListadoExploracionArchivos($RutaExploracion,$Filtro_contenido);\n \n //Recorre el arreglo de archivos encontrados para presentarlo\n $ContenidoDirectorio = opendir($RutaExploracion);\n foreach ($ListadoArchivos as $Archivo)\n {\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t<li class=\"left clearfix\">\n\t\t\t\t\t\t\t<span class=\"chat-img pull-left\">\n\t\t\t\t\t\t\t\t<i class=\"fa fa-file-archive-o fa-2x fa-fw icon-gray\"></i>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class=\"chat-body clearfix\">\n\t\t\t\t\t\t\t\t<div class=\"header\">\n\t\t\t\t\t\t\t\t\t<strong class=\"primary-font\">'.$Archivo[\"Nombre\"].'</strong> \n\t\t\t\t\t\t\t\t\t<small class=\"pull-right text-muted\">';\n\t\t\t\t\t\t\t\t\t\t//Si se debe presentar el boton de descarga lo agrega (por defecto), sino no lo muestra\n\t\t\t\t\t\t\t\t\t\tif($PermitirDescarga==1)\n\t\t\t\t\t\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"'.$Archivo[\"Enlace\"].'\" class=\"btn btn-xs btn-default\"><i class=\"fa fa-download fa-fw\"></i> '.$MULTILANG_Descargar.'</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<br>';\n\n\t\t\t\t\t\t\t\t\t\techo ''.$MULTILANG_Peso.' <span class=\"badge\">'.$Archivo[\"Tamano\"].' Kb</span>\n\t\t\t\t\t\t\t\t\t</small>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t<i class=\"icon-gray\"> \n\t\t\t\t\t\t\t\t\t'.$MULTILANG_Fecha.': '.$Archivo[\"Fecha\"].'\n\t\t\t\t\t\t\t\t\t('.$MULTILANG_Tipo.' '.$Archivo[\"Tipo\"].')\n\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>'; \n\t\t\t\t\t\t$ConteoElementos++;\n\t\t\t\t\t\t$TotalTamanoElementos+=$Archivo[\"Tamano\"];\n }\n\n //Cierra Marco de presentacion de archivos\n echo '\n </ul>\n </div> <!-- /.panel-body -->\n <div class=\"well well-sm\">'.$MULTILANG_TotalRegistros.': <b>'.$ConteoElementos.'</b> '.$MULTILANG_Peso.': <b>'.$TotalTamanoElementos.' Kb</b></div>\n </div> <!-- /.panel .chat-panel -->';\n }\n }",
"private function listMyFolder($dir = APPPATH) {\n $ffs = scandir($dir);\n\n unset($ffs[array_search('.', $ffs, true)]);\n unset($ffs[array_search('..', $ffs, true)]);\n unset($ffs[array_search('.DS_Store', $ffs, true)]);\n unset($ffs[array_search('', $ffs, true)]);\n\n if (count($ffs) < 1) {\n return;\n }\n\n $ul = '<ul>';\n foreach ($ffs as $ff) {\n if (is_dir($dir . '/' . $ff)) {\n $ul .= '<li>';\n $ul .= $ff;\n $ul .= $this->listMyFolder($dir . '/' . $ff . \"/\");\n $ul .= '</li>';\n } else {\n // Search for color class\n switch ($ff) {\n case '.htaccess' :\n $class = 'text-default';\n break;\n case 'Buildigniter.php' :\n $class = 'text-danger';\n break;\n default :\n $class = 'text-info';\n break;\n }\n // Folder search\n if (strpos($dir . $ff, '_buildigniter')) {\n $class = 'text-danger';\n }\n $ul .= '<li class=\"' . $class . '\" data-jstree=\\'{\"icon\":\"fa fa-file\"}\\'>' . $ff . '</li>';\n }\n }\n $ul .= '</ul>';\n\n return $ul;\n }",
"function list_dir($chdir) {\r\n\t/* some globals, some cleaning */\r\n\tglobal $root, $prefix, $PHP_SELF, $SERVER_NAME, $showsize, $display, $excludedir, $excludefile;\r\n\tunset($sdirs);\r\n\tunset($sfiles);\r\n\tchdir($chdir);\r\n\t$self = basename($PHP_SELF);\r\n\r\n\t/* open current directory */\r\n\t$handle = opendir('.');\r\n\t/* read directory. If the item is a directory, place it in $sdirs, if it's a filetype we want\r\n\t * and not this file, put it in $sfiles */\r\n\twhile ($file = readdir($handle))\r\n\t{\r\n\t\tif(is_dir($file) && $file != \".\" && $file != \"..\" && !in_array($file, $excludedir))\r\n\t\t{ $sdirs[] = $file; }\r\n\t\telseif(is_file($file) && $file != \"$self\" && array_key_exists(get_extension($file), $display)\r\n\t\t\t&& !in_array($file, $excludefile))\r\n\t\t{ $sfiles[] = $file; }\r\n\t}\r\n\r\n\t/* count the slashes to determine how deep we're in the directory tree and how many\r\n\t * nice bars we need to add */\r\n\t$dir = getcwd();\r\n\t$dir1 = str_replace($root, \"\", $dir.\"/\");\r\n\t$count = substr_count($dir1, \"/\") + substr_count($dir1, \"\\\\\") - (substr_count($root, \"/\")-1);\r\n\r\n\t/* display directory names and recursively list all of them */\r\n\tif(isset($sdirs) && is_array($sdirs)) {\r\n\t\tsort($sdirs);\r\n\t\treset($sdirs);\r\n\r\n\t\tfor($y=0; $y<sizeof($sdirs); $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t \t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif> \"; }\r\n\t\t\tif((isset($sfiles) && is_array($sfiles)) || $y<sizeof($sdirs)-1)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/folder.gif> <a href=\\\"http://$SERVER_NAME$prefix/$dir1$sdirs[$y]\\\" target=\\\"_blank\\\" class=\\\"blau10b\\\">$sdirs[$y]</a>\";\r\n\t\t\tlist_dir($dir.\"/\".$sdirs[$y]);\r\n\t\t}\r\n\t}\r\n\r\n\tchdir($chdir);\r\n\r\n\t/* iterate through the array of files and display them */\r\n\tif(isset($sfiles) && is_array($sfiles)) {\r\n\t\tsort($sfiles);\r\n\t\treset($sfiles);\r\n\r\n\t\t$sizeof = sizeof($sfiles);\r\n\r\n\t\t/* what file types shall be displayed? */\r\n\t\tfor($y=0; $y<$sizeof; $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif> \"; }\r\n\t\t\tif($y == ($sizeof -1))\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/\";\r\n\t\t\techo $display[get_extension($sfiles[$y])];\r\n\t\t\techo \"> \";\r\n\r\n\r\n\t\t\t\t$valorlink=\"$prefix/$dir1$sfiles[$y]\";\r\n\t\t\t\t//echo \"<a href=\\\"$valorlink\\\" class=\\\"blau10\\\" target=\\\"_blank\\\">$sfiles[$y]</a>\";\r\n\t\t\t\techo '<a href=\"#\" class=\"blau10\" onclick=\"OpenFile(\\''.$valorlink.'\\');return false;\">'.$sfiles[$y].'</a>';\r\n\r\n\t\t\t/*if (!isset($_GET['nocopy'])) {\r\n\t\t\t\t//per copiar link\r\n\t\t\t\techo \"<input type=hidden name=\\\"$dir1$sfiles[$y]\\\" id=\\\"$dir1$sfiles[$y]\\\" value=\\\"$valorlink\\\">\";\r\n\t\t\t\techo \" <a href=\\\"javascript:CopyClipboard('$dir1$sfiles[$y]')\\\" title=\\\"copiar el vincle al portapapers\\\">copiar vincle</a>\";\r\n\t\t\t\t//fi\r\n\t\t\t}*/\r\n\r\n\t\t\tif($showsize) {\r\n\t\t\t\t$fsize = @filesize($sfiles[$y])/1024;\r\n\t\t\t\tprintf(\" (%.2f kB)\", $fsize);\r\n\t\t\t}\r\n\t\t\techo \"</td></tr>\";\r\n\r\n\r\n\r\n\t\t}\r\n\t\techo \"<tr><td>\";\r\n\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif> \"; }\r\n\t\techo \"</td></tr>\\n\";\r\n\t}\r\n}",
"function getfoldercontent($folder, &$dir_array, &$pic_array, &$expic_array)\r\n{\r\n global $xoopsModuleConfig;\r\n\r\n $dir = opendir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder);\r\n while($file = readdir($dir)){\r\n if(is_dir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if ($file != \".\" && $file != \"..\")\r\n $dir_array[] = $file;\r\n }\r\n if(is_file(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if(strncmp($file, $xoopsModuleConfig['thumb_pfx'], strlen($xoopsModuleConfig['thumb_pfx'])) != 0\r\n && strncmp($file, $xoopsModuleConfig['normal_pfx'], strlen($xoopsModuleConfig['normal_pfx'])) != 0)\r\n $pic_array[] = $file;\r\n }\r\n }\r\n closedir($dir);\r\n\r\n natcasesort($dir_array);\r\n natcasesort($pic_array);\r\n}",
"public abstract function dir();",
"function list_dir($chdir,$id_item_parent1,$mon_dir=\"\")\r\n{\r\n\t global $id_item,$mon_path,$rep;\r\n\r\n\t $var_retour = \"\"; \r\n\t unset($sdirs);\r\n\t unset($sfiles);\r\n\t chdir($chdir);\r\n \r\n\t $self = basename($_SERVER['PHP_SELF']);\r\n\t $handle = opendir('.');\r\n\t while ($file = readdir($handle))\r\n\t {\r\n //echo($file.\"<br>\");\r\n\t \tif(is_dir($file) && $file != \".\" && $file != \"..\")\r\n\t \t{ $sdirs[] = $file; }\r\n\t\telseif (is_file($file))\r\n\t\t{ $sfiles[] = $file; }\r\n\t }\r\n\t \r\n\t $dir = getcwd();\r\n\t $dir1 = str_replace($root, \"\", $dir);\r\n\t $count = substr_count($dir1, \"/\") + substr_count($dir1, \"\\\\\");\r\n \r\n\t if(is_array($sdirs))\r\n\t {\r\n\t\t sort($sdirs);\r\n\t \t reset($sdirs);\r\n\t\t \r\n\t \t for($y=0; $y<sizeof($sdirs); $y++)\r\n\t \t {\r\n\t\t\t $id_item++;\r\n\t\t\t // on n'affiche pas les répertoires\r\n\t\t\t //echo htmlentities($sdirs[$y]);\r\n \r\n\t\t\t $cwd1[0] = $dir;\r\n\t \t\t $cwd1[1] = $sdirs[$y];\r\n\t\t\t $chdir = join(\"/\", $cwd1);\r\n\t\t\t \r\n\t\t\t $var_retour = $var_retour.list_dir($chdir,$id_item,$chdir);\r\n\t\t }\r\n\t }\r\n\t \t\t \r\n\t chdir($chdir);\r\n\t \r\n\t if(is_array($sfiles))\r\n\t {\r\n\t \t sort($sfiles);\r\n\t \t reset($sfiles);\r\n\t\t \r\n\t\t $sizeof = sizeof($sfiles);\r\n\t\t \r\n\t\t for($y=0; $y<$sizeof; $y++)\r\n\t\t {\r\n\t\t\t $id_item++;\r\n\t\t\t if ($mon_dir) {\r\n\t\t\t\t $nom_path = str_replace($mon_path,\"\",$mon_dir).\"/\";\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t $nom_path = $rep;\r\n\t\t\t }\r\n\r\n\t\t\t$var_retour = $var_retour.\"<option value=\\\"\".$sfiles[$y].\"\\\">\".$sfiles[$y].\"</option>\"; \r\n\t\t }\r\n\t }\r\n\r\n\t return $var_retour;\r\n}",
"public function pantepdivor($anho,$div){\n\n\t\t\t$this->db->select('a.idmonedafk,c.numcategoria,a.enero_ant,a.febrero_ant,a.marzo_ant,a.abril_ant,a.mayo_ant,a.junio_ant,a.julio_ant,a.agosto_ant,a.septiembre_ant,a.octubre_ant,a.noviembre_ant,a.diciembre_ant');\n\t\t\t$this->db->from('anteproyecto a');\n\t\t\t$this->db->join('proyecto pro','a.idprofk = pro.idproyecto');\n\t\t\t$this->db->join('categoria c','pro.idcategoria = c.id');\n\t \t\t$this->db->where('a.anho',$anho);\n\t \t\t$this->db->where('pro.iddivision',$div);\n\t \t\t$this->db->where('pro.iddom',1);\n\t\t\treturn $this->db->get(); \n\n\t\t}",
"function recurDir($pathName) {\n if (!is_dir($pathName) && !is_readable($pathName)) {\n return false;\n }\n $strCtn = \"<ul>\";\n\t\t// template目录流\n $opendir = opendir($pathName);\n\t\t\n\t\t// 初始化template目录index.php文件title标签文本\n\t\t$f_title = '';\n\t\t$md_fdata = '';\n\t\t\n\t\t// 循环template目录流\n while (false !== ($fileName = readdir($opendir))) {\n\t\t\tif($fileName !== \".\" && $fileName !== \"..\"){\n\t\t\t\t// 获取活动index.php文件\n $m_path = file_exists($pathName.\"/\".$fileName.\"/index.php\") ? $pathName.\"/\".$fileName.\"/index.php\" : $pathName.\"/\".$fileName.\"/index.html\";\n\t\t\t\tif (file_exists($m_path)) {\n $timestamp = filemtime($m_path);\n $filemtime = date(\"20y年m月d日 g:i a\",$timestamp+3600*8);\n\n\t\t\t\t\t// 读取index.php文件\n\t\t\t\t\t$f_txt = file_get_contents($m_path);\n\t\t\t\t\t\n\t\t\t\t\t// 匹配title标签内容\n\t\t\t\t\tif (preg_match(\"/<title>(.*)<\\/title>/\",$f_txt,$matches)) {\n\t\t\t\t\t\t$f_title = $matches[1];\t\n\t\t\t\t\t\n\t\t\t\t\t// 匹配不成功,继续打开block目录流,循环各个区块文件中的title标签内容\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$block_path = is_dir($pathName.\"/\".$fileName.\"/\".\"block\") ? $pathName.\"/\".$fileName.\"/\".\"block\" : $pathName.\"/\".$fileName.\"/\".\"blocks\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_dir($block_path)) {\n\t\t\t\t\t\t\t$block_opendir = opendir($block_path);\n\t\t\t\t\t\t\twhile (false !== ($block_file = readdir($block_opendir))) {\n\t\t\t\t\t\t\t\tif($block_file !== \".\" && $block_file !== \"..\") {\n\t\t\t\t\t\t\t\t\t// 拼接block目录文件完整路径\n\t\t\t\t\t\t\t\t\t$block_fpath = $block_path.\"/\".$block_file;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (file_exists($block_fpath)) {\n\t\t\t\t\t\t\t\t\t\t$block_txt = file_get_contents($block_fpath);\n\t\t\t\t\t\t\t\t\t\tif (preg_match(\"/<title>(.*)<\\/title>/\",$block_txt,$matches)) {\n\t\t\t\t\t\t\t\t\t\t\t$f_title = $matches[1];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n $fullName = $pathName.\"/\".$fileName;\n //if(in_array($fileName,$arr)) {\n // $fullName = 'http://'.$_SERVER ['HTTP_HOST'].'/tms/?page='.$fileName;\n //}\n\t\t\t\t\n\t\t\t\t// 读取README.md文件内容\n\t\t\t\t$md_path = $pathName.\"/\".$fileName.\"/README.md\";\n\t\t\t\tif (file_exists($md_path)) {\n\t\t\t\t\t$md_fopen = fopen($md_path, \"rt\");\n\t\t\t\t\tif (filesize($md_path) !== 0) {\n\t\t\t\t\t\t$md_fdata = preg_replace(\"/\\r{1,}\\n{1,}/m\",\"<br>\",file_get_contents($md_path));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$md_fdata = '内容为空';\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$md_fdata = '未创建README.md文件';\t\n\t\t\t\t}\n\t\t\t\t\n if (is_dir($fullName)) {\n $strCtn.= \"<li><div class=\\\"title-wrap\\\"><a class=\\\"title\\\" href=\\\"$fullName\\\" title=\\\"$f_title\\\" target=\\\"_blank\\\"><strong>\".$f_title.\"</strong></a></div>\n\t\t\t\t\t<div class=\\\"remark\\\"><span class=\\\"dir\\\">所在目录:$fileName</span>\n\t\t\t\t\t<span class=\\\"access-time\\\">最后一次修改时间:$filemtime</span></div>\n\t\t\t\t\t<div class=\\\"reademe\\\"><h4>$fileName/README.md:</h4><div class=\\\"reademe-ctn\\\">$md_fdata</div></div></li>\";\n }\n }\n\t\t\t// 将上一次循环中的title标签内容清空\n\t\t\t$f_title = '';\n\t\t\t$md_fdata = '';\n };\n $strCtn.= \"</ul>\";\n echo $strCtn;\n }"
]
| [
"0.5822057",
"0.5544465",
"0.5371695",
"0.5329354",
"0.5314456",
"0.53091085",
"0.52829826",
"0.5238815",
"0.5231389",
"0.51893073",
"0.5153802",
"0.51463085",
"0.51444364",
"0.5113673",
"0.51021844",
"0.50831175",
"0.50741214",
"0.50523484",
"0.5049621",
"0.5013767",
"0.50090355",
"0.50090015",
"0.4992885",
"0.49588823",
"0.49575388",
"0.48973143",
"0.4894988",
"0.4891122",
"0.48697403",
"0.48525038"
]
| 0.61710095 | 0 |
Display the performance of an employee. | public function show(Request $request, int $companyId, int $employeeId)
{
$company = InstanceHelper::getLoggedCompany();
$loggedEmployee = InstanceHelper::getLoggedEmployee();
try {
$employee = Employee::where('company_id', $companyId)
->where('id', $employeeId)
->with('teams')
->with('company')
->with('pronoun')
->with('user')
->with('status')
->firstOrFail();
} catch (ModelNotFoundException $e) {
return redirect('home');
}
// surveys
$surveys = EmployeePerformanceViewHelper::latestRateYourManagerSurveys($employee);
// if there are no surveys, redirect to the employee profile page
if (! $surveys) {
return redirect()->route('employees.show', [
'company' => $company,
'employee' => $employee,
]);
}
// all the teams the employee belongs to
$employeeTeams = EmployeeShowViewHelper::teams($employee->teams, $employee);
// all teams in company
$teams = $company->teams()->with('leader')->get();
$teams = EmployeeShowViewHelper::teams($teams, $employee);
// information about the logged employee
$permissions = EmployeeShowViewHelper::permissions($loggedEmployee, $employee);
// information about the employee, that depends on what the logged Employee can see
$employee = EmployeeShowViewHelper::informationAboutEmployee($employee, $permissions);
return Inertia::render('Employee/Performance/Index', [
'menu' => 'performance',
'employee' => $employee,
'permissions' => $permissions,
'notifications' => NotificationHelper::getNotifications(InstanceHelper::getLoggedEmployee()),
'employeeTeams' => $employeeTeams,
'positions' => PositionCollection::prepare($company->positions()->get()),
'teams' => $teams,
'pronouns' => PronounCollection::prepare(Pronoun::all()),
'surveys' => $surveys,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function show(Employee $employee)\n {\n //\n }",
"public function showEmployees() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n // get all the employees from the db.\n $included_employee = $employeeModel->getAll();\n $data = array(\"included_employees\" => $included_employee);\n return $this->render(\"listEmployees\", $data);\n }",
"public function actionStaffPerformance()\n {\n $s_date = '';\n $e_date = '';\n $user = '';\n $export = Yii::$app->request->get('export');\n $search = Yii::$app->request->get('search');\n if(isset($export) && !isset($search)) {\n $this->StaffPerformanceExport();\n }\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['start_date']))\n $s_date = Yii::$app->request->queryParams['ActivityCountSearch']['start_date'];\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['end_date']))\n $e_date = Yii::$app->request->queryParams['ActivityCountSearch']['end_date'];\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['user_id']))\n $user = Yii::$app->request->queryParams['ActivityCountSearch']['user_id'];\n $searchModel = new ActivityCountSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('staff_performance', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 's_date' => $s_date,\n 'e_date' => $e_date,\n 'user' => $user,\n ]);\n }",
"public function show(Emploitime $emploitime)\n {\n //\n }",
"public function show(EmployeeInfo $employee)\n {\n\n }",
"public function show(RequireEmployee $requireEmployee)\n {\n //\n }",
"public function show(Employees $employees)\n {\n //\n }",
"public function index(Employee $employee)\n {\n return view('backend.employees.skill.index', compact('employee'));\n }",
"public function showAction(Employee $admin)\n {\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$ContractEntity = $em->getRepository('BoAdminBundle:Contracts');\n\t\t$aContract = $ContractEntity->getTeacherContracts($admin);\n\t\t$this->createActivity(\"Admin\",$admin->getName().\" \".$admin->getFirstname().\" is consulted by this user\");\n $em = $this->getDoctrine()->getManager();\n $aSecurityCotes = $em->getRepository('BoAdminBundle:SecurityCote')->findBy(array('employee'=>$admin));\n return $this->render('admin/show.html.twig', array(\n 'admin' => $admin,\n\t\t\t'securityCotes'=>$aSecurityCotes,\n\t\t\t'contracts'=>$aContract,\n\t\t\t'status'=>$ContractEntity->getStatus($aContract),\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }",
"public function show(Employee $employee)\n {\n\n if(auth()->user()->employee_id ==$employee->id ||auth()->user()->type =='admin'||Employee::find(auth()->user()->employee_id)->is_hr == 1)\n\n { $attends = Attendance::where('finger_print_id',$employee->finger_print_id)->get();\n\n $custodies= Custody::all();\n $vacations = Vacation::where('type','request')->where('employee_id','=',$employee->id)->get();\n $national_vacations=Vacation::where('type','annual')->get();\n $title = __('admin.employee');\n $employee_id=$employee->id;\n $remps = Rate::where('employee_id','=',$employee->id)\n ->where('Is_rated','=',0)\n ->pluck('rated_employee_id');\n $rated_employees = [];\n foreach ($remps as $value) {\n $rated_employees[] = @\\App\\Employee::where('id', $value)->first();\n }\n $ratour_count=Rate::where('rated_employee_id','=',$employee_id)->count();\n if($ratour_count!=0){\n $rated_work=Rate::where('rated_employee_id','=',$employee_id)->sum('work')/$ratour_count;\n $rated_apperance=Rate::where('rated_employee_id','=',$employee_id)->sum('apperance')/$ratour_count;\n $rated_effeciant=Rate::where('rated_employee_id','=',$employee_id)->sum('effeciant')/$ratour_count;\n $rated_target=Rate::where('rated_employee_id','=',$employee_id)->sum('target')/$ratour_count;\n $rated_ideas=Rate::where('rated_employee_id','=',$employee_id)->sum('ideas')/$ratour_count;\n $total_kpi=$rated_work+$rated_apperance+$rated_effeciant+$rated_target+$rated_ideas;\n $kpi_percent=(int)(($total_kpi/25)*100);\n }\n else{\n $kpi_percent=0;\n $rated_work=0;\n $rated_apperance=0;\n $rated_effeciant=0;\n $rated_target=0;\n $rated_ideas=0;\n }\n return view('admin.employee.show', compact('employee','title','vacations','national_vacations','custodies','rated_employees','employee_id','kpi_percent','rated_work','rated_apperance','rated_effeciant','rated_target','rated_ideas','attends'));\n }\n else {\n session()->flash('error', __('admin.you_dont_have_permission'));\n return back();\n }}",
"public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}",
"public function actionDayPerformance()\n {\n $s_date = '';\n $e_date = '';\n $user = '';\n $export = Yii::$app->request->get('export');\n $search = Yii::$app->request->get('search');\n if(isset($export) && !isset($search)) {\n $this->DayPerformanceExport();\n }\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['start_date']))\n $s_date = Yii::$app->request->queryParams['ActivityCountSearch']['start_date'];\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['end_date']))\n $e_date = Yii::$app->request->queryParams['ActivityCountSearch']['end_date'];\n if (isset(Yii::$app->request->queryParams['ActivityCountSearch']['user_id']))\n $user = Yii::$app->request->queryParams['ActivityCountSearch']['user_id'];\n $searchModel = new ActivityCountSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n if($s_date=='')\n $s_date = date(\"M-d-Y\");\n if($e_date=='')\n $e_date = date(\"M-d-Y\");\n return $this->render('day_performance', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 's_date' => $s_date,\n 'e_date' => $e_date,\n 'user' => $user,\n ]);\n }",
"private function listEmployee()\n\t{\n\t\t$employees = $this->employee->getEmployee();\n\t\t$cnt = 1;\n\t\tforeach($employees as $key => $val)\n\t\t{\n\t\t\t$arr = array('CNT' => $cnt,\n\t\t\t\t\t\t 'EMPLOYEE_NAME' => $val['name_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_ID' => $val['id_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_MAIL' => $val['mail_employee']);\n\t\t\t$cnt ++;\n\t\t\t$this->view->addToReplace($arr);\n\t\t\t$this->arrRender['LISTEMPLOYEES'] .= $this->view->\n\t\t\tsetTemplateFile('employeeslist')->renderFile();\n\t\t}\n\t}",
"public function show($emp_id)\n {\n //$employee = Employee::find($emp_id);\n //return view('HR.Employees')->with ('name', $name);\n }",
"public function show(Emprendedore $emprendedore)\n {\n //\n }",
"public function get_employeebenefit()\n { \n $employee = $this->settings->all_employee();\n return view('backend.ajax.get_employee',compact('employee'));\n }",
"public function show(Abz_Employees $sample_data)\n {\n //\n }",
"public function show($id)\n {\n $model_performance = new Performance();\n $performance = $model_performance->show_performance($id);\n return $performance;\n }"
]
| [
"0.6471945",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.6358917",
"0.62681067",
"0.61531407",
"0.60602224",
"0.6039842",
"0.6039599",
"0.6009537",
"0.582305",
"0.57939243",
"0.5772022",
"0.57397336",
"0.562073",
"0.5582144",
"0.55539197",
"0.553956",
"0.55377644",
"0.5528673",
"0.5504677"
]
| 0.6501106 | 0 |
Parse reference links from longdescription. | private static function parse_reference_links( $longdesc ) {
$description = '';
foreach ( explode( "\n", $longdesc ) as $line ) {
if ( 0 === strpos( $line, '#' ) ) {
break;
}
$description .= $line . "\n";
}
// Fires if it has description text at the head of `$longdesc`.
if ( $description ) {
$links = []; // An array of URLs from the description.
$pattern = '/\[.+?\]\((https?:\/\/.+?)\)/';
$newdesc = preg_replace_callback(
$pattern,
function( $matches ) use ( &$links ) {
static $count = 0;
$count++;
$links[] = $matches[1];
return str_replace( '(' . $matches[1] . ')', '[' . $count . ']', $matches[0] );
},
$description
);
$footnote = '';
$link_count = count( $links );
for ( $i = 0; $i < $link_count; $i++ ) {
$n = $i + 1;
$footnote .= '[' . $n . '] ' . $links[ $i ] . "\n";
}
if ( $footnote ) {
$newdesc = trim( $newdesc ) . "\n\n---\n" . $footnote;
$longdesc = str_replace( trim( $description ), trim( $newdesc ), $longdesc );
}
}
return $longdesc;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function parse_references()\n {\n if($html = Functions::lookup_with_cache($this->page['taxa_refs'], $this->download_options)) {\n if(preg_match_all(\"/im_field_taxonomic_name%3A(.*?)\\\"/ims\", $html, $arr)) {\n $total = count($arr[1]); $i = 0;\n // print_r($arr[1]); exit;\n foreach($arr[1] as $taxon_id) {\n $i++; echo \"\\ntaxon [$taxon_id]: $i of $total\\n\";\n $taxon_refs = self::get_taxon_refs($taxon_id);\n self::write_taxon_refs($taxon_refs, $taxon_id);\n // print_r($refs); exit(\"\\nstopx 100\\n\");\n // if($i == 1) break; //debug only\n }\n }\n }\n }",
"function ind_hrefparser($text) {\n\t$answer = false;\n\t$regexp = \"<a\\s[^>]*href=(\\\"??)([^\\\" >]*?)\\\\1[^>]*>(.*)<\\/a>\";\n\tif(preg_match_all(\"/$regexp/siU\", $text, $matches)) {\n\t\t$answer['url'] = $matches[2][0];\n\t\t$answer['chapter'] = $matches[3][0];\n\t}\n\treturn $answer;\n}",
"public function detect_links()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:(?:https?|ftp):\\/\\/|(?:www|ftp)\\.)(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})(?::[0-9]{1,5})?(?:\\/[^\\s'\\\"]*)?(?:(?<![,\\)\\.])|[\\S])/\",\r\n\t\t\t$child->get_text(),\r\n\t\t\t$matches,\r\n\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\tif(substr($match[0], 0, 3) === 'ftp' && $match[0][3] !== ':')\r\n\t\t\t\t\t$url = 'ftp://' . $match[0];\r\n\t\t\t\telse if($match[0][0] === 'w')\r\n\t\t\t\t\t$url = 'http://' . $match[0];\r\n\t\t\t\telse\r\n\t\t\t\t\t$url = $match[0];\r\n\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('url', array('default' => htmlentities($url, ENT_QUOTES | ENT_IGNORE, \"UTF-8\")));\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_URL));\r\n\r\n\t\treturn $this;\r\n\t}",
"function parseLinksOld($text)\n{\n\t// ADD LINE BREAKS\n\t$text = nl2br($text);\n\t\n\t/*\n\tthe counting method doesn't work - if there is, for example, a case with 1 instance of plain www and 3 instances of https://www,\n\tthen the count is < 0 and the www will not get replaced\n\t*/\n\t// COUNT THE NUMBER OF OCCURRENCES OF \"WWW\" WITHOUT A PRECEEDING \"HTTP\"\n\t$numWWW \t= substr_count ( $text, 'www.' );\n\t$numHTTPWWW = substr_count ( $text, '://www.' );\n\t$numHTTPSWWW = substr_count($text, 'https://www');\n\t$w = $numWWW - $numHTTPWWW - $numHTTPSWWW;\n\n\t// REPLACE ALL INSTANCES OF \"WWW\" WITH \"HTTP://WWW\" SO THAT PARSING FUNCTION WILL HANDLE ALL CASES\n\tif ($w > 0) { $text = str_replace ( 'www', 'http://www', $text, $w ); }\n\t\n\t// BEGIN PARSING\n\t$needle = 'http';\n\t$needleLength = strlen($needle);\n\t$needleCount = substr_count ( $text, $needle );\n\t\n\t// DECLARE ARRAYS FOR THE LINKS\n\t$needles = array();\n\t$tags = array();\n\t$hyperlinks = array();\n\n\t// LOOP THROUGH ALL LINKS AND PARSE THEM\n\tfor ( $i = 0; $i < $needleCount; $i++ )\n\t{\n\t\t// DETERMINE START POS OF LINK\n\t\t$needleStart = strpos($text, $needle, $needleStart + $needleLength );\n\n\t\t// DETERMINE ENDPOINT OF LINK - EITHER A SPACE OR LINE BREAK\n\t\t$distSpace \t= abs(stripos($text, ' ', $needleStart) - $needleStart); \n\t\t$distNL \t= abs(stripos($text, \"\\n\", $needleStart) - $needleStart); \n\t\t$distBR\t\t= abs(stripos($text, '<br>', $needleStart) - $needleStart);\n\t\tif ($distSpace <= $distNL) { $needleLength = $distSpace; } else { $needleLength = $distNL; } $needleLength += 0;\n\n\t\t// PARSE OUT THE LINK FROM BETWEEN THE START POS AND ENDPOINT\n\t\t$needleParsed = substr($text, $needleStart, $needleLength);\n\t\t$needleUntrimmed = $needleParsed;\n\n\t\t// TRIM EXTRA CHARACTERS ( periods or parentheses or <br> tags from end of string )\n\t\t$needleTrim1 = substr($needleParsed, 0, strlen($needleParsed)-1);\n\t\t$needleTrim2 = substr($needleParsed, 0, strlen($needleParsed)-2);\n\n\t\t$lastChar \t\t= substr($needleParsed, -1);\n\t\t$secondLastChar = substr($needleParsed, -2, 1);\n\n\t\tif ($lastChar == '.' or $lastChar == ',' or $lastChar == ')') \t\t\t\t\t\t{ $needleParsed = $needleTrim1; }\n\t\tif ($secondLastChar == '.' or $secondLastChar == ',' or $secondLastChar == ')') \t{ $needleParsed = $needleTrim2; }\n\n\t\t$needleTrimBR \t= substr($needleParsed, 0, strlen($needleParsed)-3);\n\t\tif ( substr_count ( $needleParsed, '<br') > 0 )\t\t\t\t\t\t\t\t\t\t{ $needleParsed = $needleTrimBR; }\n\n\t\t// THE LINK SHOULD NOW BE PROPERLY PARSED\t\n\n\t\t// CONSTRUCT THE <a> TAG\n\t\t$needleTag = '<a href = \"'.$needleParsed.'\" target = \"_blank\">'.$needleParsed.'</a>'; \n\t\t// COULD EVENTUALLY DEFINE A VALUE FOR HREF AND DISPLAY TEXT SEPARATELY?\n\n\t\t// UPDATE THE LINK ARRAYS\n\t\t$needles[$i] = $needleParsed;\n\t\t$tags[$i] = $needleTag;\n\t\t$hyperlinks[$i] = array($needleParsed, $needleTag);\n\t\t\n\t} // END FOR LOOP\n\n\t// REPLACE THE LINK TEXT WITH THE <a> TAGS (USING THE ARRAYS AS PARAMS IN THE STR REPLACE FUNCTION)\n\t$parsed = str_replace($needles, $tags, $text);\n\treturn $parsed;\n\n}",
"function get_links_from_text($raw) {\r\n\t// via http://stackoverflow.com/a/5289151/2496685\r\n\t$reg_exUrl = \"(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))\";\r\n\t$matches = array();\r\n\tpreg_match_all($reg_exUrl, $raw, $matches);\r\n\treturn $matches[0];\r\n}",
"function parse_urls($str, $maxurl_len = 35, $target = \"_blank\")\r\n\t{\r\n\t\tif(preg_match_all('/((ht|f)tps?:\\/\\/([\\w\\.]+\\.)?[\\w-]+(\\.[a-zA-Z]{2,4})?[^\\s\\r\\n\\(\\)\"\\'<>\\,\\!]+)/si', $str, $urls))\r\n\t\t{\r\n\t\t\t$offset1 = ceil(0.65 * $maxurl_len) - 2;\r\n\t\t\t$offset2 = ceil(0.30 * $maxurl_len) - 1;\r\n\r\n\t\t\tforeach(array_unique($urls[1]) AS $url)\r\n\t\t\t{\r\n\t\t\t\tif ($maxurl_len AND strlen($url) > $maxurl_len)\r\n\t\t\t\t{\r\n\t\t\t\t\t$urltext = substr($url, 0, $offset1) . '...' . substr($url, -$offset2);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$urltext = $url;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$str = str_replace($url, '<a href=\"'. $url .'\" target=\"'. $target .'\" title=\"'. $url .'\">'. $urltext .'</a>', $str);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $str;\r\n\t}",
"function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}",
"public function removeUrlsFromReferences()\n {\n foreach ($this->findAll() as $doc) {\n $ref = $doc->getReference();\n if (strpos($ref, 'http://esmeree.fr')) {\n $ref = preg_replace('#'.preg_quote('http://esmeree.fr', '#').'[^\\s]+#', '', $ref);\n $doc->setReference($ref);\n }\n }\n }",
"function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }",
"function lesson_decode_content_links ($content,$restore) {\n \n global $CFG;\n \n $result = $content;\n \n //Link to the list of lessons\n \n $searchstring='/\\$@(LESSONINDEX)\\*([0-9]+)@\\$/';\n //We look for it\n preg_match_all($searchstring,$content,$foundset);\n //If found, then we are going to look for its new id (in backup tables)\n if ($foundset[0]) {\n //print_object($foundset); //Debug\n //Iterate over foundset[2]. They are the old_ids\n foreach($foundset[2] as $old_id) {\n //We get the needed variables here (course id)\n $rec = backup_getid($restore->backup_unique_code,\"course\",$old_id);\n //Personalize the searchstring\n $searchstring='/\\$@(LESSONINDEX)\\*('.$old_id.')@\\$/';\n //If it is a link to this course, update the link to its new location\n if($rec->new_id) {\n //Now replace it\n $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/lesson/index.php?id='.$rec->new_id,$result);\n } else { \n //It's a foreign link so leave it as original\n $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/lesson/index.php?id='.$old_id,$result);\n }\n }\n }\n\n //Link to lesson view by moduleid\n\n $searchstring='/\\$@(LESSONVIEWBYID)\\*([0-9]+)@\\$/';\n //We look for it\n preg_match_all($searchstring,$result,$foundset);\n //If found, then we are going to look for its new id (in backup tables)\n if ($foundset[0]) {\n //print_object($foundset); //Debug\n //Iterate over foundset[2]. They are the old_ids\n foreach($foundset[2] as $old_id) {\n //We get the needed variables here (course_modules id)\n $rec = backup_getid($restore->backup_unique_code,\"course_modules\",$old_id);\n //Personalize the searchstring\n $searchstring='/\\$@(LESSONVIEWBYID)\\*('.$old_id.')@\\$/';\n //If it is a link to this course, update the link to its new location\n if($rec->new_id) {\n //Now replace it\n $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/lesson/view.php?id='.$rec->new_id,$result);\n } else {\n //It's a foreign link so leave it as original\n $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/lesson/view.php?id='.$old_id,$result);\n }\n }\n }\n\n return $result;\n }",
"public function testLinkWithPipes()\n {\n // for example: golem.de is expanded to <https://golem.de|golem.de>\n $data = <<<'EOT'\n{\n \"client_msg_id\": \"5510681d-1c33-41aa-a0ee-62779cd9e8ad\",\n \"type\": \"message\",\n \"text\": \"Link mit pipe <https://golem.de|golem.de>\",\n \"user\": \"UF53JT12T\",\n \"ts\": \"1546266336.001000\"\n}\nEOT;\n\n $message = json_decode($data, true);\n $result = Message::extract_links($message);\n\n $this->assertEquals(count($result), 1);\n $this->assertEquals($result[0]['link'], 'https://golem.de');\n $this->assertEquals($result[0]['title'], null);\n $this->assertEquals($result[0]['source'], 'golem.de');\n }",
"function extractHrefs($html){\n\t$dom = new DOMDocument;\n\t//Parse the HTML. The @ is used to suppress any parsing errors\n\t//that will be thrown if the $html string isn't valid XHTML.\n\t@$dom->loadHTML($html);\n\t//Get all links. You could also use any other tag name here,\n\t//like 'img' or 'table', to extract other tags.\n\t$links = $dom->getElementsByTagName('a');\n\t$hrefs=array();\n\t//Iterate over the extracted links and display their URLs\n\tforeach ($links as $link){\n\t\t$hrefs[]=array('title'=>truncate_utf8($link->nodeValue,128),'link'=>$link->getAttribute('href'));\n\t}\n\treturn $hrefs;\n}",
"public static function parseLinks( $text ) {\n\t\t# Don't let this get flooded\n\t\t$max = 10;\n\t\t$count = 0;\n\n\t\t$linkList = '';\n\t\t# Normalize space characters\n\t\t$text = str_replace( array(\"\\r\",\"\\t\"), array(\"\\n\",\" \"), htmlspecialchars($text) );\n\t\t# Split out each line as a link\n\t\t$lines = explode( \"\\n\", $text );\n\t\tforeach( $lines as $line ) {\n\t\t\t$links = explode(\" \",$line,2);\n\t\t\t$link = $links[0];\n\t\t\t# Any explanation text is not part of the link...\n\t\t\t$extra = isset($links[1]) ? ' '.$links[1] : '';\n\t\t\tif( strpos($link,'.') ) {\n\t\t\t\t$link = ( strpos($link,'http://')===false ) ? 'http://'.$link : $link;\n\t\t\t\t$linkList .= \"<li><a href='$link'>$link</a>$extra</li>\\n\";\n\t\t\t}\n\t\t\t$count++;\n\t\t\tif( $count >= $max )\n\t\t\t\tbreak;\n\t\t}\n\t\tif( $linkList == '' ) {\n\t\t\t$linkList = wfMsgHtml( 'confirmaccount-none-p' );\n\t\t} else {\n\t\t\t$linkList = \"<ul>{$linkList}</ul>\";\n\t\t}\n\t\treturn $linkList;\n\t}",
"function thinkup_extract_urls_filter ( $tu_post ) {\n\n $regex = '/[a-z]+:\\/\\/[a-z0-9-_]+\\.[a-z0-9-_@:~%&\\?\\+#\\/.=]+[^:\\.,\\)\\s*$]/i';\n\n if ( preg_match_all($regex, $tu_post->wp_post->post_content, $matches) ) {\n\n $tu_post->links = array_merge($tu_post->links, $matches[0]);\n\n }\n\n return $tu_post;\n\n}",
"function _linkReferences() {\n\tif (is_array($this->_haveRefs)) {\n\t\tforeach ($this->_haveRefs as $node) {\n\t\tif (!empty($node->data)) {\n\t\t\t$key = key($node->data);\n\t\t\t// If it's an array, don't check.\n\t\t\tif (is_array($node->data[$key])) {\n\t\t\tforeach ($node->data[$key] as $k => $v) {\n\t\t\t\t$this->_linkRef($node,$key,$k,$v);\n\t\t\t}\n\t\t\t} else {\n\t\t\t$this->_linkRef($node,$key);\n\t\t\t}\n\t\t}\n\t\t}\n\t}\n\treturn true;\n\t}",
"function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}",
"function extract_hotlinks($content) {\n\n\n\n\t}",
"public function getLinks(){\n\t\t\n\t\t// Get the global config\n\t\tglobal $CrawlerConfig;\n\t\t\n\t\t// Create DOM object and load HTML\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Get links\n\t\t$links = $dom->getElementsByTagName('a');\n\t\t\n\t\t// Extract links data\n\t\tforeach ($links as $tag){\n\t\t\t\n\t\t\t// Get the hyperlink reference\n\t\t\t$url = trim($tag->getAttribute('href'));\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$url = self::filterUrl($url);\n\t\t\tif($url === false) continue;\n\t\t\t\n\t\t\t// Skip URL's that start with #\n\t\t\tif(substr($url, \"0\", 1) == \"#\") continue;\n\t\t\t\n\t\t\t// Skip mailto links\n\t\t\tif(strpos($url, \"mailto:\") !== false) continue;\n\t\t\t\n\t\t\t// Skip links that don't match the 'FOLLOW_LINKS_LIKE' config param\n\t\t\tif(\n\t\t\t\t!empty($CrawlerConfig['FOLLOW_LINKS_LIKE']) &&\n\t\t\t\tstrpos($url, $CrawlerConfig['FOLLOW_LINKS_LIKE']) === false\n\t\t\t) continue;\n\t\t\t\n\t\t\t// Skip links that DO match the \"IGNORE_LINKS_LIKE\" config param\n\t\t\tif(!empty($CrawlerConfig['IGNORE_LINKS_LIKE'])){\n\t\t\t\tforeach($CrawlerConfig['IGNORE_LINKS_LIKE'] as $l){\n\t\t\t\t\tif(strpos($url, $l) !== false) continue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dump it to the array\n\t\t\tarray_push($ret, array(\n\t\t\t\t\"url\" => $url,\n\t\t\t\t\"title\" => $tag->textContent ///$tag->childNodes->item(0)->nodeValue\n\t\t\t));\t\t\t\n }\n\t\t\n\t\t$ret = self::doopScooper($ret, array(\"url\"));\n\t\t\t\t\n\t\treturn $ret;\n\t}",
"function autoLinkReferences(DOMNode $node) {\n\t// Don’t link inside .h-cite elements or headers\n\tif ($node->nodeType == XML_ELEMENT_NODE and strstr(' ' . $node->getAttribute('class') . ' ', ' h-cite '))\n\t\treturn;\n\t\n\tif ($node->nodeType == XML_TEXT_NODE):\n\t\t$node->data = preg_replace_callback('/Article \\d+/', function ($matches) {\n\t\t\treturn 'REPLACE_BEGIN_ELEMENTa href=\"#' . slugify($matches[0]) . '\"REPLACE_END_ELEMENT' . $matches[0] . 'REPLACE_BEGIN_ELEMENT/aREPLACE_END_ELEMENT';\n\t\t}, $node->data);\n\tendif;\n\t\n\t// Loop through each child node\n\tif ($node->hasChildNodes() and !isheader($node)):\n\t\tforeach ($node->childNodes as $n):\n\t\t\tautoLinkReferences($n);\n\t\tendforeach;\n\tendif;\n}",
"public static function urlReferencesBox ($string)\r\n\t{\r\n\t\t# Loop through each line\r\n\t\t$lines = explode (\"\\n\", $string);\r\n\t\tforeach ($lines as $index => $line) {\r\n\t\t\t\r\n\t\t\t# Default to the line as-is\r\n\t\t\t$list[$index] = $line;\r\n\t\t\t\r\n\t\t\t# Explode by the first space (after the first URL) if it exists\r\n\t\t\t$parts = preg_split (\"/[\\s]+/\", $line, 2);\r\n\t\t\tif (count ($parts) == 2) {\r\n\t\t\t\t$list[$index] = \"<a href=\\\"{$parts[0]}\\\" target=\\\"_blank\\\">{$parts[1]}</a>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Compile the list\r\n\t\t$html = self::htmlUl ($list);\r\n\t\t\r\n\t\t# Return the HTML\r\n\t\treturn $html;\r\n\t}",
"static protected function bbcodeLinkParser($text, &$list)\n {\n $list['in'] = array_merge(\n $list['in'],\n array('`([^=\\]])((?:https?|ftp)://\\S+[[:alnum:]]/?)`si',\n\t '`([^=\\]])((?<!//)(www\\.\\S+[[:alnum:]]/?))`si',\n\t '`\\[url(?:\\=?)(.*?)\\](.*?)\\[/url\\]`is',\n\t '`\\[img(.*?)\\](.*?)\\[/img\\]`is',\n\t )); \n $list['out'] = array_merge(\n $list['out'],\n array('<a href=\"$2\">$2</a>',\n\t '<a href=\"http://$2\">$2</a>',\n\t '<a href=\"$1\">$2</a>',\n\t '<img $1 src=\"$2\" />',\n\t ));\n }",
"public function getReferences() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('references'));\n return (is_array($result)) ? reset($result) : $result;\n }",
"public function linksProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\LinkedArticle()]]];\n }",
"public function getDocsLinks()\n {\n $links = array();\n\t\t$docs_tree = $this->getDocsTree();\t\n\t\t$links = $this->getDocsLangLinks($docs_tree);\n return $links;\n }",
"public function fetchDescriptions(&$phpDoc, &$shortDescription, &$longDescription) {\n\n\t\t//Fetch short and long description\n\t\t$keys = array_keys($phpDoc);\n\t\tfor ($i = 0; $i < count($keys); $i++) {\n\t\t\t$next = (isset($keys[$i + 1]) ? $phpDoc[$keys[$i + 1]] : null);\n\t\t\t$current = (isset($keys[$i]) ? $phpDoc[$keys[$i]] : null);\n\t\t\t$previous = (isset($keys[$i - 1]) ? $phpDoc[$keys[$i - 1]] : null);\n\n\t\t\tif (strlen($shortDescription) == 0 && strlen($next) == 0 && strlen($previous) == 0 && strlen($current) > 0) {\n\t\t\t\t$shortDescription = $current;\n\t\t\t} else {\n\t\t\t\tif (strlen($current) > 0) {\n\t\t\t\t\t$longDescription .= $current . PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }",
"function amap_ma_get_entity_description($desc) {\n $entity_description = preg_replace('/[^(\\x20-\\x7F)]*/', '', $desc);\n $entity_description = amap_ma_remove_shits($entity_description);\n\n // code below replace the " with \" from href of a tag. \n // The Regular Expression filter\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if (preg_match($reg_exUrl, $entity_description, $url)) {\n $temp1 = preg_replace($reg_exUrl, \"mmmfffmmm\", $entity_description);\n $temp2 = str_replace('"', \"\\\"\", $url[0]);\n $entity_description = str_replace('"mmmfffmmm', \"\\\"{$temp2}\", $temp1);\n }\n\n return $entity_description;\n}",
"function links() {\n return array(\n\n );\n }",
"function _shortenURL(&$ret){\n\t $links = explode('<a', $ret);\n\t $countlinks = count($links);\n\t for ($i = 0; $i < $countlinks; $i++){\n\t\t\t$link = $links[$i];\t\t\t\n\t\t\t$link = (preg_match('#(.*)(href=\")#is', $link)) ? '<a' . $link : $link;\n\t\n\t\t\t$begin = strpos($link, '>') + 1;\n\t\t\t$end = strpos($link, '<', $begin);\n\t\t\t$length = $end - $begin;\n\t\t\t$urlname = substr($link, $begin, $length);\n\n\t\t\t$chunked = (strlen($urlname) > 50 && preg_match('#^(http://|ftp://|www\\.)#is', $urlname)) ? substr_replace($urlname, '...', 30, -10) : $urlname;\n\t\t\t$ret = str_replace('>' . $urlname . '<', '>' . $chunked . '<', $ret); \n\t\n\t }\n\t}",
"private function parseLinks($str) {\n\n //parse URL\n $str = preg_replace('/(https{0,1}:\\/\\/[\\w\\-\\.\\/#?&=]*)/','<a href=\"$1\">$1</a>',$str);\n //parse @ID\n $str = preg_replace('/@(\\w+)/','@<a href=\"http://twitter.com/$1\" class=\"at\">$1</a>',$str);\n //parse #hashtag\n $str = preg_replace('/\\s#(\\w+)/',' <a href=\"http://twitter.com/#!/search?q=%23$1\" class=\"hashtag\">#$1</a>',$str);\n\n return $str; \n }"
]
| [
"0.5898778",
"0.5855734",
"0.56484807",
"0.56460124",
"0.5576293",
"0.55487746",
"0.5403831",
"0.528787",
"0.5257685",
"0.5257004",
"0.52569366",
"0.5211511",
"0.5188169",
"0.5151941",
"0.5140594",
"0.51305133",
"0.51248246",
"0.5118302",
"0.5097134",
"0.5095748",
"0.5088709",
"0.5087154",
"0.50715524",
"0.50538504",
"0.503343",
"0.5018264",
"0.50174934",
"0.50141597",
"0.50042063",
"0.49826786"
]
| 0.8403241 | 0 |
Maybe register callback in WooCommerce Subscription hooks. | protected function _maybe_register_callback_in_subscriptions() {
if ( ! class_exists( 'WC_Subscriptions_Order' ) ) {
return;
}
add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
add_action( 'woocommerce_subscription_failing_payment_method_' . $this->id, array( $this, 'update_failing_payment_method' ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mwznb_subscribe_callback() {\r\n\tif (!isset($_POST['mwznb_form_nonce']) || !wp_verify_nonce($_POST['mwznb_form_nonce'], basename(__FILE__))) {\r\n\t\texit(MailWizzApi_Json::encode(array(\r\n 'result' => 'error', \r\n 'message' => __('Invalid nonce!', 'mwznb')\r\n )));\r\n\t}\r\n\r\n $uid = isset($_POST['uid']) ? sanitize_text_field($_POST['uid']) : null;\r\n if ($uid) {\r\n unset($_POST['uid']);\r\n }\r\n unset($_POST['action'], $_POST['mwznb_form_nonce']);\r\n \r\n if (empty($uid) || !($uidData = get_option('mwznb_widget_instance_' . $uid))) {\r\n exit(MailWizzApi_Json::encode(array(\r\n 'result' => 'error', \r\n 'message' => __('Please try again later!', 'mwznb')\r\n )));\r\n }\r\n \r\n $keys = array('api_url', 'public_key', 'private_key', 'list_uid');\r\n foreach ($keys as $key) {\r\n if (!isset($uidData[$key])) {\r\n exit(MailWizzApi_Json::encode(array(\r\n 'result' => 'error', \r\n 'message' => __('Please try again later!', 'mwznb')\r\n )));\r\n }\r\n }\r\n \r\n $oldSdkConfig = MailWizzApi_Base::getConfig();\r\n MailWizzApi_Base::setConfig(mwznb_build_sdk_config($uidData['api_url'], $uidData['public_key'], $uidData['private_key']));\r\n\r\n $endpoint = new MailWizzApi_Endpoint_ListSubscribers();\r\n $response = $endpoint->create($uidData['list_uid'], $_POST);\r\n $response = $response->body->toArray();\r\n \r\n mwznb_restore_sdk_config($oldSdkConfig);\r\n unset($oldSdkConfig);\r\n \r\n if (isset($response['status']) && $response['status'] == 'error' && isset($response['error'])) {\r\n $errorMessage = $response['error'];\r\n if (is_array($errorMessage)) {\r\n $errorMessage = implode(\"\\n\", array_values($errorMessage));\r\n }\r\n exit(MailWizzApi_Json::encode(array(\r\n 'result' => 'error', \r\n 'message' => $errorMessage\r\n )));\r\n }\r\n \r\n if (isset($response['status']) && $response['status'] == 'success') {\r\n exit(MailWizzApi_Json::encode(array(\r\n 'result' => 'success', \r\n 'message' => __('Please check your email to confirm the subscription!', 'mwznb')\r\n )));\r\n }\r\n \r\n exit(MailWizzApi_Json::encode(array(\r\n 'result' => 'success', \r\n 'message' => __('Unknown error!', 'mwznb')\r\n )));\r\n}",
"public static function subscriptionIncremented($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionIncremented', $callback);\n }",
"public function woocommerce_loaded() {\n /*************************************/\n /* Adding AJAX function */\n /*************************************/\n add_action( 'init', 'waes_ajax_function' );\n function waes_ajax_function() {\n add_action('wp_ajax_waes_load_sku', 'waes_load_sku');\n }\n }",
"function wp_aff_handle_woocommerce_subscription_payment($order) {\n if (!is_object($order)) {\n $order = new WC_Order($order);\n }\n\n $order_id = $order->id;\n $total = $order->order_total;\n $shipping = $order->get_total_shipping();//get_shipping();\n $sale_amount = $total - $shipping;\n $txn_id = $order_id . \"_\" . date(\"Y-m-d\"); //Add the subscription charge date to make this unique\n $item_id = \"\";\n $buyer_email = $order->billing_email;\n $buyer_name = $order->billing_first_name . \" \" . $order->billing_last_name;\n \n $referrer = get_post_meta($order_id, '_wp_aff_ap_id', true);\n if(empty($referrer)){\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - couldn't get referrer ID from cookie. Checking IP address...\", true);\n $ip_address = get_post_meta($order_id, '_customer_ip_address', true);\n if (empty($ip_address)) {\n wp_affiliate_log_debug(\"WooCommerce Subscription Affiliate integration - customer IP address is missing in WooCommerce order.\", false);\n return;\n }\n $referrer = wp_aff_get_referrer_id_from_ip_address($ip_address);\n }\n \n $order_status = $order->status;\n\n //apply filter for coupon check\n $referrer = apply_filters('aff_woo_before_awarding_commission_filter', $referrer, $order);\n\n $debug_data = \"WooCommerce subscripiton payment - Commission tracking debug data: \" . $referrer . \"|\" . $sale_amount . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $ip_address . \"|\" . $buyer_name;\n wp_affiliate_log_debug($debug_data, true);\n\n if (!empty($referrer)) {\n wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, '', '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - This is not an affiliate referred sale!\", true);\n }\n}",
"function buy_annual_subscription_action() {\n // Annual subscription + membership product ID: 11327\n $product_id = 11326;\n $added_product = WC()->cart->add_to_cart($product_id);\n\n if ($added_product !== '') {\n echo \"Subscription added to cart!\";\n } else {\n echo \"Subscription not add to cart!\";\n }\n\n wp_die();\n }",
"public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );\n\t}",
"public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);",
"public static function init() {\n\n\t\tadd_action( 'woocommerce_email_classes', __CLASS__ . '::add_emails', 10, 1 );\n\n\t\tadd_action( 'woocommerce_init', __CLASS__ . '::hook_transactional_emails' );\n\n\t\tadd_filter( 'woocommerce_resend_order_emails_available', __CLASS__ . '::renewal_order_emails_available', -1 ); // run before other plugins so we don't remove their emails\n\n\t\tadd_action( 'woocommerce_subscriptions_email_order_details', __CLASS__ . '::order_download_details', 10, 4 );\n\t\tadd_action( 'woocommerce_subscriptions_email_order_details', __CLASS__ . '::order_details', 10, 4 );\n\t}",
"public static function klawoo_subscribe() {\n\t\t$url = 'http://app.klawoo.com/subscribe';\n\n\t\tif( !empty( $_POST ) ) {\n\t\t\t$params = $_POST;\n\t\t} else {\n\t\t\texit();\n\t\t}\n\t\t$method = 'POST';\n\t\t$qs = http_build_query( $params );\n\n\t\t$options = array(\n\t\t\t'timeout' => 15,\n\t\t\t'method' => $method\n\t\t);\n\n\t\tif ( $method == 'POST' ) {\n\t\t\t$options['body'] = $qs;\n\t\t} else {\n\t\t\tif ( strpos( $url, '?' ) !== false ) {\n\t\t\t\t$url .= '&'.$qs;\n\t\t\t} else {\n\t\t\t\t$url .= '?'.$qs;\n\t\t\t}\n\t\t}\n\n\t\t$response = wp_remote_request( $url, $options );\n\n\t\tif ( wp_remote_retrieve_response_code( $response ) == 200 ) {\n\t\t\t$data = $response['body'];\n\t\t\tif ( $data != 'error' ) {\n\n\t\t\t\t$message_start = substr( $data, strpos( $data,'<body>' ) + 6 );\n\t\t\t\t$remove = substr( $message_start, strpos( $message_start,'</body>' ) );\n\t\t\t\t$message = trim( str_replace( $remove, '', $message_start ) );\n\t\t\t\techo ( $message );\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\texit();\n\t}",
"function hook_message_subscribe_get_subscribers_alter(&$uids, $values) {\n\n}",
"public function register_hooks() {\n\t\tadd_filter( 'pre_update_option_block_lab_license_key', array( $this, 'save_license_key' ) );\n\t}",
"public function subscribe(): void;",
"function pressforward_ab_subscriber() {\n\trequire( dirname( __FILE__ ) . '/includes/pressforward-ab-subscribe.php' );\n\treturn PF_AB_Subscriber::init();\n}",
"abstract public function add_subscription( Payment_Subscription $subscription );",
"public static function subscriptionDiscountAdded($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountAdded', $callback);\n }",
"public function supportsHookSubscribers()\n {\n return true;\n }",
"public static function init() {\n\n\t\tadd_action( 'woocommerce_email_classes', __CLASS__ . '::add_emails', 12, 1 );\n\n\t\tadd_action( 'woocommerce_subscriptions_after_apply_retry_rule', __CLASS__ . '::send_email', 0, 2 );\n\n\t\tadd_action( 'woocommerce_order_status_failed', __CLASS__ . '::maybe_detach_email', 9 );\n\n\t\tadd_action( 'woocommerce_order_status_changed', __CLASS__ . '::maybe_reattach_email', 100, 3 );\n\t}",
"public function subscribe($subscriber): void;",
"public function subscribe()\r\n {\r\n /* Fire our meta box setup function on the post editor screen. */\r\n add_action('load-post.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n add_action('load-post-new.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n }",
"public function supportsHookSubscribers()\n {\n return false;\n }",
"public function register_hooks() {\n\t\t\\add_action( 'admin_action_duplicate_post_check_changes', [ $this, 'check_changes_action_handler' ] );\n\t}",
"function pgm_add_subscription( $subscriber_id, $list_id ) {\n\n // setup default return value\n $subscription_saved = false;\n\n // IF the subscriber does NOT have the current list subscription\n if( !pgm_subscriber_has_subscription( $subscriber_id, $list_id ) ){\n\n // get subscriptions and append new $list_id\n $subscriptions = pgm_get_subscriptions( $subscriber_id );\n $subscriptions[]=$list_id;\n\n // update pgm_subscriptions\n update_field( pgm_get_acf_key('pgm_subscriptions'), $subscriptions, $subscriber_id );\n\n // subscriptions updated!\n $subscription_saved = true;\n\n }\n\n // return result\n return $subscription_saved;\n\n}",
"abstract protected function register_hook_callbacks();",
"public function subscribe($subscriber);",
"abstract protected function registerCallback();",
"public function onSubscriptionCreate(SubscriptionInterface $subscription, OrderItemInterface $order_item);",
"function wpcf7_knews_subscription ($WPCF7_ContactForm) {\n\t\n\t$submission = WPCF7_Submission::get_instance();\n\t$posted_data =& $submission->get_posted_data();\t \n\n\tif(isset($posted_data['knews-subscription'])) {\n\n\t\t$email = $posted_data['email'];\n\t\t\n\t\t$id_list_news = $posted_data['knews-subscription'];\n\t\t$lang = ICL_LANGUAGE_CODE;\n\t\t$lang_locale = get_locale();\n\t\t\n\t\t$extra_fields = $posted_data;\n\t\t$custom_fields = array();\n\t\t\tforeach ($extra_fields as $field) {\n\t\t\t\t$custom_fields[1]=$posted_data['name'];\n\t\t\t\t$custom_fields[2]=$posted_data['surname'];\n\t\t\t}\n\t\n\t\t$bypass_confirmation = true;\n\t\t\n\t\tapply_filters('knews_add_user_db', 0, $email, $id_list_news, $lang, $lang_locale, $custom_fields, $bypass_confirmation);\n\t\t\t\n\t}\t\n}",
"function it_exchange_paypal_pro_addon_register_webhook() {\n\t$key = 'paypal_pro';\n\t$param = apply_filters( 'it_exchange_paypal_pro_webhook', 'it_exchange_paypal_pro' );\n\tit_exchange_register_webhook( $key, $param );\n}",
"public function subscribes();",
"public function track_helper_subscriptions_refresh() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_update' );\n\t}"
]
| [
"0.6343357",
"0.62112117",
"0.6181692",
"0.61550903",
"0.613899",
"0.6079373",
"0.6058273",
"0.6037571",
"0.6024137",
"0.60170764",
"0.59910655",
"0.5941497",
"0.58847654",
"0.5868321",
"0.5858017",
"0.5840045",
"0.5819449",
"0.578131",
"0.5779185",
"0.5778699",
"0.57622695",
"0.57549304",
"0.5749753",
"0.57435656",
"0.57177776",
"0.57056034",
"0.56958234",
"0.5692719",
"0.5685288",
"0.5667938"
]
| 0.8077533 | 0 |
Checks whether order is part of subscription. | public function is_subscription( $order_id ) {
return ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function order_contains_subscription( $order ) {\n\t\treturn WC_Subscriptions_Order::order_contains_subscription( $order );\n\t}",
"protected function order_contains_subscription( $order_id ) {\n\t\treturn class_exists( 'WC_Subscriptions_Order' ) && ( WC_Subscriptions_Order::order_contains_subscription( $order_id ) || WC_Subscriptions_Renewal_Order::is_renewal( $order_id ) );\n\t}",
"public function everSubscribed()\n {\n return !empty($this->billing_subscription);\n }",
"public function subscribed()\n {\n if ($this->billing_free) {\n if (!$this->billing_subscription_ends_at\n || time() < strtotime($this->billing_subscription_ends_at)\n ) {\n return true;\n }\n }\n \n if (!isset($this->cardUpFront) || $this->cardUpFront) {\n return $this->billingIsActive() || $this->onGracePeriod();\n }\n \n return $this->billingIsActive() || $this->onGracePeriod() || $this->onTrial();\n }",
"private function has_publisher_subscription()\n {\n $has_subscription = false;\n if (isset($this->options['subscription']) && $this->options['subscription'] == 1)\n {\n $has_subscription = true;\n }\n return $has_subscription;\n }",
"public function hasRecurringOrders();",
"function wcs_is_subscription( $subscription ) {\n\n\tif ( is_object( $subscription ) && is_a( $subscription, 'WC_Subscription' ) ) {\n\t\t$is_subscription = true;\n\t} elseif ( is_numeric( $subscription ) && 'shop_subscription' == get_post_type( $subscription ) ) {\n\t\t$is_subscription = true;\n\t} else {\n\t\t$is_subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_is_subscription', $is_subscription, $subscription );\n}",
"public function isSubscribed()\n {\n return null !== $this->queue;\n }",
"protected function maybe_handle_subscription( $order ) {\n\t\tif ( ! class_exists( 'WC_Subscriptions' ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( ! wcs_order_contains_subscription( $order ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\t$subscription = current( wcs_get_subscriptions_for_order( $order->get_id() ) );\n\t\t$subscription_id = $subscription->get_id();\n\n\t\t$ppec_billing = get_post_meta( $subscription_id, '_ppec_billing_agreement_id', true );\n\n\t\tif ( empty( $ppec_billing ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( $subscription->has_status( apply_filters( 'woocommerce_paypal_express_checkout_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {\n\t\t\treturn array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription' ), $order->get_id() ) ) );\n\t\t}\n\n\t\t$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );\n\n\t\tforeach ( $renewal_orders as $renewal_order_id ) {\n\t\t\tdelete_post_meta( $renewal_order_id, '_woo_pp_txnData' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_ppec_billing_agreement_id' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_paypal_status' );\n\t\t}\n\n\t\tdelete_post_meta( $subscription_id, '_woo_pp_txnData' );\n\t\tdelete_post_meta( $subscription_id, '_ppec_billing_agreement_id' );\n\t\tdelete_post_meta( $subscription_id, '_paypal_status' );\n\n\t\treturn array( true, false, array( __( 'PayPal Checkout Subscriptions Data Erased.', 'woocommerce-gateway-paypal-express-checkout' ) ) );\n\t}",
"public function canSubscribe()\n {\n if ($this->getDateLimitSigningUp() > date('Y-m-d H:i:s') && count($this->getParticipants())<$this->getNbSigningUpMax() && $this->getState()->getId() == 2)\n {\n return true;\n }\n return false;\n }",
"public function canHandleSubscriptions():bool\n {\n return false;\n }",
"public function hasRecurringOrder(OrderInterface $order);",
"public static function is_subscription($items)\n {\n $is_subscription = false;\n if (sizeof($items) == 1) {\n foreach ($items as $cart_item_key => $cart_item) {\n $is_recurrent = (method_exists($cart_item, 'get_meta')) ?\n $cart_item->get_meta('_used_gateway') : get_post_meta($cart_item['product_id'], '_mp_recurring_is_recurrent', true);\n if ($is_recurrent == 'yes') {\n $is_subscription = true;\n }\n }\n }\n return $is_subscription;\n }",
"function wcs_is_view_subscription_page() {\n\tglobal $wp;\n\n\treturn ( is_page( wc_get_page_id( 'myaccount' ) ) && isset( $wp->query_vars['view-subscription'] ) ) ? true : false;\n}",
"public function is_order_voided( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\treturn ( $this->order_has_status( $order, 'voided' ) );\n\t}",
"public function isOrder();",
"public function hasInvoiceNeedsCapture($order)\n {\n foreach ($order->getInvoiceCollection() as $invoice) {\n /* @var $invoice Mage_Sales_Model_Order_Invoice */\n if ($invoice->canCapture()) {\n return true;\n }\n }\n\n return false;\n }",
"public function isSubscribed(): bool;",
"function comment_subscription_status() {\n\tglobal $comment;\n\treturn !!_stc()->is_subscribed( $comment->comment_ID );\n}",
"public function hasActiveSubscription()\n {\n return $this->user->hasActiveSubscription();\n }",
"public function is_order_ready( WC_Order $order ) {\n\n\t\t// Assume it's not ready\n\t\t$is_ready = false;\n\n\t\t// Only continue checking if the order hasn't already been sent to AvaTax\n\t\tif ( ! $this->is_order_posted( $order ) ) {\n\n\t\t\t$status = $order->get_status();\n\n\t\t\t/**\n\t\t\t * Filter the order statuses that allow manual order sending.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param array $ready_statuses The valid statuses.\n\t\t\t */\n\t\t\t$ready_statuses = apply_filters( 'wc_avatax_order_ready_statuses', array(\n\t\t\t\t'processing',\n\t\t\t\t'completed',\n\t\t\t) );\n\n\t\t\t// See if the order has one of the ready statuses\n\t\t\t$is_ready = in_array( $status, $ready_statuses );\n\n\t\t\t// If not, and Order Status Manager is active, then check the status' paid property\n\t\t\tif ( class_exists( 'WC_Order_Status_Manager_Order_Status' ) && ! $is_ready ) {\n\n\t\t\t\t$status = new WC_Order_Status_Manager_Order_Status( $status );\n\n\t\t\t\t$is_ready = ( $status->get_id() > 0 && ! $status->is_core_status() && $status->is_paid() );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter whether an order is ready to be sent to AvaTax.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $is_ready\n\t\t * @param int $order_id The order ID\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_order_is_ready', $is_ready, SV_WC_Order_Compatibility::get_prop( $order, 'id' ) );\n\t}",
"public function hasSubscribers(){\n return $this->subscriber_count > 1;\n }",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"public function status_subscription(){\n\t\t\treturn true;\n\t\t}",
"function wcs_do_subscriptions_exist() {\n\tglobal $wpdb;\n\t$sql = $wpdb->prepare( \"SELECT ID FROM {$wpdb->posts} WHERE post_type = %s LIMIT 1;\", 'shop_subscription' );\n\n\t// query is the fastest, every other built in method uses this. Plus, the return value is the number of rows found\n\t$num_rows_found = $wpdb->query( $sql );\n\n\treturn ( 0 !== $num_rows_found ) ? true: false;\n}",
"function checkSubscriptionRenewal($order)\n {\n $plan = & $order['PaidOrder']['plan_info']['plan_array'];\n if($order['PaidOrder']['order_status'] == 'Complete') /* The order had already been procesed in the past */\n {\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidTxnLog->addNote(\"Subscription Renewal\");\n $new_expiration = PaidOrderModel::getExpirationDate($plan['duration_period'],$plan['duration_number'],$order['PaidOrder']['order_expires']);\n $order['PaidOrder']['order_expires'] = $new_expiration;\n $plan['moderation'] = 0; // If it was published before no need to moderate it again\n }\n\n return $order;\n }",
"public function isAvailable(Order $order)\n {\n $availabilityPolicy = AvailabilityPolicyFactory::create($this, $order);\n\n return $availabilityPolicy->isAvailable();\n }",
"public function canStoreOrder();",
"protected function subscriptionIsPresent($items)\n {\n if ($items instanceof Collection) {\n foreach ($items as $item) {\n if ($this->quoteItemHelper->hasSubscription($item)) {\n return true;\n }\n }\n }\n return false;\n }",
"protected function hasCreatedPackSubscription(): bool\n {\n return !!$this->packSubscription;\n }"
]
| [
"0.73145604",
"0.71832657",
"0.7039286",
"0.6850785",
"0.6809523",
"0.6675408",
"0.66322035",
"0.66141546",
"0.6545899",
"0.64850605",
"0.6462891",
"0.6410539",
"0.63974303",
"0.6393335",
"0.635925",
"0.6325357",
"0.6325065",
"0.63184077",
"0.62597966",
"0.6235251",
"0.6195706",
"0.6187806",
"0.6185301",
"0.6133964",
"0.61316407",
"0.61245066",
"0.6119253",
"0.6118779",
"0.60782003",
"0.6077719"
]
| 0.75912994 | 0 |
Process reference transaction response used when creating payment for scheduled subscription. | protected function _process_reference_transaction_response( $order, $response ) {
$client = wc_gateway_ppec()->client;
try {
if ( ! $client->response_has_success_status( $response ) ) {
throw new Exception( __( 'PayPal API error', 'woocommerce-gateway-paypal-express-checkout' ) );
}
$status = ! empty( $response['PAYMENTSTATUS'] ) ? $response['PAYMENTSTATUS'] : '';
switch ( $status ) {
case 'Pending':
/* translators: placeholder is pending reason from PayPal API. */
$order_note = sprintf( __( 'PayPal transaction held: %s', 'woocommerce-gateway-paypal-express-checkout' ), $response['PENDINGREASON'] );
if ( ! $order->has_status( 'on-hold' ) ) {
$order->update_status( 'on-hold', $order_note );
} else {
$order->add_order_note( $order_note );
}
break;
case 'Completed':
case 'Processed':
case 'In-Progress':
$transaction_id = $response['TRANSACTIONID'];
$order->add_order_note( sprintf( __( 'PayPal payment approved (ID: %s)', 'woocommerce-gateway-paypal-express-checkout' ), $transaction_id ) );
$order->payment_complete( $transaction_id );
break;
default:
throw new Exception( __( 'PayPal payment declined', 'woocommerce-gateway-paypal-express-checkout' ) );
}
} catch ( Exception $e ) {
$order->update_status( 'failed', $e->getMessage() );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function handleGatewayCallback($reference)\n {\n $curl = curl_init();\n $sk = config('app.ps_secret'); // Paystack secret key\n $url = config('app.ps_url'); // Paystack payment url\n\n curl_setopt_array($curl, \n [\n CURLOPT_URL => \"{$url}/transaction/verify/\" . rawurlencode($reference),\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer {$sk}\",\n \"cache-control: no-cache\"\n ],\n ]\n );\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n if ($err) {\n // there was an error contacting thereturn [\n return [\n 'status' => false,\n 'error' => $err\n ];\n }\n\n $tranx = json_decode($response);\n\n if (!$tranx->status) {\n // there was an error from the API\n return [\n 'status' => false,\n 'error' => $tranx->message\n ];\n }\n\n if ('success' == $tranx->data->status) {\n // transaction was successful...\n // please check other things like whether you already gave value for this ref\n // if the email matches the customer who owns the product etc\n // Give value\n\n $transaction_ref = $tranx->data->metadata->transaction_ref;\n return [\n 'status' => true,\n 'transaction_ref' => $transaction_ref,\n 'payment_reference' => $reference\n ];\n }\n }",
"public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }",
"public function process_response( $response, $order ) {\n \t\t$this->log( 'Processing response: ' . print_r( $response, true ) . PHP_EOL);\n\t\t$this->log( 'CAPTURED => ' . print_r( $response->status == 'CAPTURED' ) . PHP_EOL);\n\n \t\t$order_id = version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->id : $order->get_id();\n\n \t\t// Store charge data\n \t\tupdate_post_meta( $order_id, '_xendit_charge_id', $response->id );\n \t\tupdate_post_meta( $order_id, '_xendit_charge_captured', $response->status == 'CAPTURED' ? 'yes' : 'no' );\n\n \t\t// Store other data such as fees\n \t\tif ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) {\n \t\t\t// Fees and Net needs to both come from Xendit to be accurate as the returned\n \t\t\t// values are in the local currency of the Xendit account, not from WC.\n \t\t\t$fee = ! empty( $response->balance_transaction->fee ) ? WC_Xendit::format_number( $response->balance_transaction, 'fee' ) : 0;\n \t\t\t$net = ! empty( $response->balance_transaction->net ) ? WC_Xendit::format_number( $response->balance_transaction, 'net' ) : 0;\n \t\t\tupdate_post_meta( $order_id, 'Xendit Fee', $fee );\n \t\t\tupdate_post_meta( $order_id, 'Net Revenue From Xendit', $net );\n \t\t}\n\n \t\t$order->payment_complete( $response->id );\n\t\t$message = sprintf( __( 'Xendit charge complete (Charge ID: %s)', 'woocommerce-gateway-xendit' ), $response->id );\n\t\t$order->add_order_note( $message );\n\t\t$this->log( 'Success: ' . $message );\n\n \t\tdo_action( 'wc_gateway_xendit_process_response', $response, $order );\n\n \t\treturn $response;\n \t}",
"public function handleGatewayCallback($txref)\n {\n \n\n // dd($txref);\n $verified_data = Http::withToken(env('PAYSTACK_SECRET_KEY'))->get('https://api.paystack.co/transaction/verify/'.$txref);\n\n if($verified_data->successful()) {\n\n }\n\n dd(json_decode($verified_data));\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n }",
"function handleFuturePayPayment(&$input, &$ids, &$objects) {\r\n $recur =& $objects['contributionRecur'];\r\n \r\n // make sure the invoice ids match\r\n // make sure the invoice is valid and matches what we have in the contribution record\r\n if ( $recur->invoice_id != $input['invoice'] ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Failure : Invoice values dont match between database and IPN request\");\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n \r\n // fix dates that already exist\r\n $dates = array( 'create', 'start', 'end', 'cancel', 'modified' );\r\n foreach ( $dates as $date ) {\r\n $name = \"{$date}_date\";\r\n if ( $recur->$name ) {\r\n $recur->$name = CRM_Utils_Date::isoToMysql( $recur->$name );\r\n }\r\n }\r\n\r\n //contribution_status_id:\r\n //0=Completed,1=Pending,2=Cancelled,3=Overdue,4=Failed,5=InProgress\r\n if ($input['transStatus']=='Y') {//rawAuthMessage=Authorised\r\n // futurepay payment accepted\r\n if ($input['rawAuthMessage']!='Authorised') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n if (_getContributionCount($recur)>=$recur->installments) {\r\n // final installement\r\n $recur->contribution_status_id=0;//0=Completed\r\n $recur->end_date=$now;\r\n }\r\n else {\r\n $recur->contribution_status_id=5;//5=In Progress\r\n $recur->modified_date = $now;\r\n }\r\n }\r\n else if ($input['transStatus']=='N') {//rawAuthMessage=Declined\r\n // futurepay payment declined\r\n $recur->contribution_status_id=4;//4=Failed\r\n $recur->end_date = $now;\r\n if ($input['rawAuthMessage']!='Declined') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n $checkForEndOfAgreement=false;\r\n }\r\n else if ($input['futurePayStatusChange']=='Merchant Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Merchant';\r\n }\r\n else if ($input['futurePayStatusChange']=='Customer Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Donor';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized FuturePay operation. input=\".print_r($input,true));\r\n return false;\r\n }\r\n $recur->save();\r\n \r\n if ($input['transStatus']=='Y') {\r\n // create a new contribution for this recurring contribution\r\n $contributionType = $objects['contributionType'];\r\n $contribution = new CRM_Contribute_DAO_Contribution();\r\n $contribution->domain_id = CRM_Core_Config::domainID( );\r\n $contribution->contact_id = $ids[\"contact\"];\r\n $contribution->contribution_type_id = $contributionType->id;\r\n $contribution->contribution_page_id = $ids['contributionPage'];\r\n $contribution->contribution_recur_id = $ids['contributionRecur'];\r\n $contribution->receive_date = $now;\r\n $contribution->invoice_id = md5( uniqid( rand( ), true ) );\r\n $contribution->total_amount = $input[\"amount\"];\r\n $objects['contribution'] =& $contribution;\r\n \r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaciton();\r\n $this->completeTransaction($input,$ids,$objects,$transaction,true);//true=recurring\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }\r\n }",
"function handleSinglePayment(&$input, &$ids, &$objects) {\r\n $contribution =& $objects['contribution'];\r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaction();\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n $this->completeTransaction($input,$ids,$objects,$transaction,false);// false= not recurring\r\n $output = '<div id=\"logo\"><h1>Thank you</h1><p>Your payment was successful.</p><p>Please <a href=\"' . $ids[\"thankyoupage\"] . '\">click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n $this->cancelled($objects,$transaction);\r\n $output = '<h1>Transaction Cancelled</h1><p>Your payment was cancelled or rejected.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else {\r\n CRM_Core_Error::debug_log_message(\"Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n $output = '<h1>Error</h1><p>There was an error while processing your payment.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n return false;\r\n }\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }",
"public function doReferenceTransaction($ref) {\n\t\t$nvpstr =\n\t\t\t'&REFERENCEID=' . $ref .\n\t\t\t'&AMT=10' .\n\t\t\t'&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0';\n\n\t\t$this->hash_call('DoReferenceTransaction', $nvpstr);\n\t}",
"protected function _processTransactionPaymentRefunded($parameters) {\n\t\t\t$invoices = $invoiceData = $invoiceDeductions = $orderMergeData = $processedInvoiceIds = $pendingInvoiceOrders = $transactionData = $unpaidInvoiceIds = $userData = array();\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['invoice_id']) &&\n\t\t\t\t!empty($parameters['user'])\n\t\t\t) {\n\t\t\t\t$invoice = $this->_call('invoices', array(\n\t\t\t\t\t'methodName' => 'invoice',\n\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t'invoices',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t'id' => $parameters['invoice_id']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($invoice['data'])) {\n\t\t\t\t\t$invoiceDeductions = $this->_call('invoices', array(\n\t\t\t\t\t\t'methodName' => 'calculateDeductionsFromInvoice',\n\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t$invoice['data']['invoice'],\n\t\t\t\t\t\t\t$parameters['payment_amount']\n\t\t\t\t\t\t)\n\t\t\t\t\t));\n\t\t\t\t\t$amountToDeductFromBalance = min(0, $invoiceDeductions['remainder']);\n\n\t\t\t\t\tforeach ($invoiceDeductions as $key => $invoiceDeduction) {\n\t\t\t\t\t\t$processedInvoiceIds[] = $invoiceDeduction['id'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($amountToDeductFromBalance < 0) {\n\t\t\t\t\t\t$invoiceDeductions['balance'] = array(\n\t\t\t\t\t\t\t'amount_deducted' => ($amountDeductedFromBalance = round(max(($parameters['user']['balance'] * -1), $amountToDeductFromBalance) * 100) / 100),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$invoiceDeductions['remainder'] = $amountToDeductFromBalance - $amountDeductedFromBalance;\n\t\t\t\t\t\t$userData = array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'id' => $parameters['user']['id'],\n\t\t\t\t\t\t\t\t'balance' => max(0, $amountToRefundExceedingBalance = round(($parameters['user']['balance'] + $amountToDeductFromBalance) * 100) / 100)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ($amountToRefundExceedingBalance < 0) {\n\t\t\t\t\t\t\t$balanceTransactions = $this->fetch('transactions', array(\n\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t'payment_method_id' => 'balance',\n\t\t\t\t\t\t\t\t\t'processed' => true,\n\t\t\t\t\t\t\t\t\t'processing' => false,\n\t\t\t\t\t\t\t\t\t'transaction_method' => 'PaymentCompleted',\n\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id'],\n\t\t\t\t\t\t\t\t\t'NOT' => array(\n\t\t\t\t\t\t\t\t\t\t'invoice_id' => $processedInvoiceIds\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t\t'invoice_id',\n\t\t\t\t\t\t\t\t\t'payment_amount',\n\t\t\t\t\t\t\t\t\t'payment_transaction_id',\n\t\t\t\t\t\t\t\t\t'plan_id'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t\t\t\t'field' => 'created',\n\t\t\t\t\t\t\t\t\t'order' => 'DESC'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($balanceTransactions['count'])) {\n\t\t\t\t\t\t\t\tforeach ($balanceTransactions['data'] as $balanceTransaction) {\n\t\t\t\t\t\t\t\t\tif (!empty($balanceTransaction['invoice_id'])) {\n\t\t\t\t\t\t\t\t\t\t$invoice = $this->_call('invoices', array(\n\t\t\t\t\t\t\t\t\t\t\t'methodName' => 'invoice',\n\t\t\t\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'invoices',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id' => $balanceTransaction['invoice_id']\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t!empty($invoice['data']) &&\n\t\t\t\t\t\t\t\t\t\t\t$amountToRefundExceedingBalance < 0\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t$invoiceDeductions = $this->_call('invoices', array(\n\t\t\t\t\t\t\t\t\t\t\t\t'methodName' => 'calculateDeductionsFromInvoice',\n\t\t\t\t\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t$invoice['data']['invoice'],\n\t\t\t\t\t\t\t\t\t\t\t\t\tmax(min(($balanceTransaction['payment_amount'] * -1), $amountToRefundExceedingBalance), $amountToRefundExceedingBalance),\n\t\t\t\t\t\t\t\t\t\t\t\t\t$invoiceDeductions\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t\t$amountToRefundExceedingBalance = min(0, $invoiceDeductions['remainder']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($invoiceDeductions as $key => $invoiceDeduction) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!isset($invoiceDeduction['amount_deducted']) ||\n\t\t\t\t\t\t\t$invoiceDeduction['amount_deducted'] >= 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tunset($invoiceDeductions[$key]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!empty($invoiceDeduction['id'])) {\n\t\t\t\t\t\t\t\t$invoiceDeductionData = array(\n\t\t\t\t\t\t\t\t\t'amount_paid' => round(($invoiceDeduction['amount_paid'] + $invoiceDeduction['amount_deducted']) * 100) / 100,\n\t\t\t\t\t\t\t\t\t'id' => $invoiceDeduction['id'],\n\t\t\t\t\t\t\t\t\t'payable' => true,\n\t\t\t\t\t\t\t\t\t'remainder_pending' => $invoiceDeduction['remainder_pending']\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif (!empty($invoiceDeduction['status'])) {\n\t\t\t\t\t\t\t\t\t$invoiceDeductionData['status'] = $invoiceDeduction['status'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$invoiceData[$invoiceDeduction['id']] = $invoiceDeductionData;\n\t\t\t\t\t\t\t\t$orderMergeParameters = array(\n\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t'amount_merged >' => 0,\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id' => $invoiceDeduction['id']\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t\t'amount_merged',\n\t\t\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t\t\t'initial_invoice_id'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t\t\t\t\t'field' => 'created',\n\t\t\t\t\t\t\t\t\t\t'order' => 'ASC'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$orderMerges = $this->fetch('order_merges', $orderMergeParameters);\n\n\t\t\t\t\t\t\t\tif (!empty($orderMerges['count'])) {\n\t\t\t\t\t\t\t\t\t$amountDeducted = $invoiceDeduction['amount_deducted'];\n\n\t\t\t\t\t\t\t\t\tforeach ($orderMerges['data'] as $orderMerge) {\n\t\t\t\t\t\t\t\t\t\tif ($amountDeducted === 0) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$amountDeductedFromAmountMerged = $amountDeducted + $orderMerge['amount_merged'];\n\t\t\t\t\t\t\t\t\t\t$amountDeducted = min(0, $amountDeductedFromAmountMerged);\n\t\t\t\t\t\t\t\t\t\t$orderMergeData[] = array(\n\t\t\t\t\t\t\t\t\t\t\t'amount_merged' => max(0, $amountDeductedFromAmountMerged),\n\t\t\t\t\t\t\t\t\t\t\t'id' => $orderMerge['id']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$transactionData[] = array(\n\t\t\t\t\t\t\t\t'customer_email' => $parameters['user']['email'],\n\t\t\t\t\t\t\t\t'id' => uniqid() . time(),\n\t\t\t\t\t\t\t\t'invoice_id' => $invoiceDeduction['id'],\n\t\t\t\t\t\t\t\t'parent_transaction_id' => $parameters['parent_transaction_id'],\n\t\t\t\t\t\t\t\t'payment_amount' => $invoiceDeduction['amount_deducted'],\n\t\t\t\t\t\t\t\t'payment_currency' => $this->settings['billing']['currency'],\n\t\t\t\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t\t\t\t'payment_status' => 'completed',\n\t\t\t\t\t\t\t\t'payment_status_message' => 'Payment refunded.',\n\t\t\t\t\t\t\t\t'payment_transaction_id' => $parameters['payment_transaction_id'],\n\t\t\t\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t\t\t\t'processed' => true,\n\t\t\t\t\t\t\t\t'transaction_charset' => $this->settings['database']['charset'],\n\t\t\t\t\t\t\t\t'transaction_date' => date('Y-m-d H:i:s', time()),\n\t\t\t\t\t\t\t\t'transaction_method' => 'PaymentRefundProcessed',\n\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!empty($invoiceDeduction['id'])) {\n\t\t\t\t\t\t\t$unpaidInvoiceIds[] = $invoiceDeduction['id'];\n\t\t\t\t\t\t\t$invoiceData[$invoiceDeduction['id']]['warning_level'] = 5;\n\t\t\t\t\t\t\t$invoiceOrders = $this->_call('invoices', array(\n\t\t\t\t\t\t\t\t'methodName' => 'retrieveInvoiceOrders',\n\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t$invoiceDeduction\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tforeach ($invoiceOrders as $invoiceOrder) {\n\t\t\t\t\t\t\t\tif (empty($pendingInvoiceOrders[$invoiceOrder['id']])) {\n\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']] = $invoiceOrder;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($invoiceDeduction['amount_deducted'] < 0) {\n\t\t\t\t\t\t\t\t\t$priceActive = $pendingInvoiceOrders[$invoiceOrder['id']]['price_active'];\n\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']]['price_active'] = max(0, round(($pendingInvoiceOrders[$invoiceOrder['id']]['price_active'] + $invoiceDeduction['amount_deducted']) * 100) / 100);\n\t\t\t\t\t\t\t\t\t$invoiceDeduction['amount_deducted'] = min(0, $invoiceDeduction['amount_deducted'] + $priceActive);\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']]['price_active'] === 0 &&\n\t\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']]['status'] == 'active'\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']]['quantity_active'] = 0;\n\t\t\t\t\t\t\t\t\t\t$pendingInvoiceOrders[$invoiceOrder['id']]['status'] = 'pending';\n\t\t\t\t\t\t\t\t\t\t$actionData = array(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'chunks' => ($chunks = ceil($invoiceOrder['quantity_active'] / 10000)),\n\t\t\t\t\t\t\t\t\t\t\t\t'encoded_parameters' => json_encode(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'remove',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $invoiceOrder\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'item_count' => ($itemCount = $invoiceOrder['quantity_active']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'proxies'\n\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t'foreign_key' => 'order_id',\n\t\t\t\t\t\t\t\t\t\t\t\t'foreign_value' => $invoiceOrder['id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'processed' => ($processOrder = ($chunks == 1)),\n\t\t\t\t\t\t\t\t\t\t\t\t'progress' => ($processOrder ? 100 : 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tif ($processOrder) {\n\t\t\t\t\t\t\t\t\t\t\t$this->_call('proxies', array(\n\t\t\t\t\t\t\t\t\t\t\t\t'methodName' => 'remove',\n\t\t\t\t\t\t\t\t\t\t\t\t'methodParameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'proxies',\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => $invoiceOrder\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$this->save('actions', $actionData);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tempty($unpaidInvoiceIds) ||\n\t\t\t\t\t\t\t$this->delete('invoice_items', array(\n\t\t\t\t\t\t\t\t'invoice_id' => $unpaidInvoiceIds\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\t$this->save('invoices', array_values($invoiceData)) &&\n\t\t\t\t\t\t$this->save('orders', array_values($pendingInvoiceOrders)) &&\n\t\t\t\t\t\t$this->save('order_merges', $orderMergeData) &&\n\t\t\t\t\t\t$this->save('transactions', $transactionData) &&\n\t\t\t\t\t\t$this->save('users', $userData)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t\t'subject' => 'Transaction #' . $parameters['payment_transaction_id'] . ' refund confirmation',\n\t\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t\t'name' => 'payment_refunded',\n\t\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t\t'deductions' => $transactionData,\n\t\t\t\t\t\t\t\t\t'transaction' => array_merge($parameters, array(\n\t\t\t\t\t\t\t\t\t\t'payment_method' => $this->_retrieveTransactionPaymentMethod($parameters['payment_method_id'])\n\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->_sendMail($mailParameters);\n\n\t\t\t\t\t\tforeach ($pendingInvoiceOrders as $pendingInvoiceOrder) {\n\t\t\t\t\t\t\tif ($pendingInvoiceOrder['quantity_active'] === 0) {\n\t\t\t\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t\t\t\t'subject' => 'Order #' . $pendingInvoiceOrder['id'] . ' is deactivated',\n\t\t\t\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t\t\t\t'name' => 'order_deactivated',\n\t\t\t\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t\t\t\t'order' => $pendingInvoiceOrder,\n\t\t\t\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}",
"public static function getTransactionReference($response)\n {\n\n if ($response->offsetExists('object')\n && 'charge' === $response->offsetGet('object')\n && $response->offsetExists('id')\n ){\n return $response->offsetGet('id');\n }\n\n // $hasTransactionObjects = ['refund'];\n // if ($response->offsetExists('object')\n // && in_array($response['object'], $hasTransactionObjects, true)\n // && $response['->offsetExists(d'])\n // ){\n // return $response->offsetGet('id');\n // }\n\n return null; //parent::getTransactionReference();\n }",
"public function getTransactionReference()\n {\n $reference = [];\n\n foreach (['SecurityKey', 'TxAuthNo', 'VPSTxId', 'VendorTxCode'] as $key) {\n $value = $this->getDataItem($key);\n\n if ($value !== null) {\n $reference[$key] = $value;\n }\n }\n\n // The reference is null if we have no transaction details.\n\n if (empty($reference)) {\n return;\n }\n\n // Remaining transaction details supplied by the merchant site\n // if not already in the response (it will be for Sage Pay Form).\n\n if (! array_key_exists('VendorTxCode', $reference)) {\n $reference['VendorTxCode'] = $this->getTransactionId();\n }\n\n ksort($reference);\n\n return json_encode($reference);\n }",
"public function check_reference_transactions() {\n\n\t\t$req = new LLMS_PayPal_Request( $this );\n\t\t$r = $req->check_reference_transactions();\n\n\t\t// errorrrrrrr\n\t\tif ( is_wp_error( $r ) ) {\n\n\t\t\t// this is the not enabled message, we'll make the message a little more instructive for our purposes\n\t\t\tif ( 11452 == $r->get_error_code() ) {\n\n\t\t\t\tLLMS_Admin_Settings::set_error( sprintf( __( 'Reference transactions are not enabled for your PayPal account, please follow the instructions <a href=\"https://lifterlms.com/docs/lifterlms-paypal-reference-transactions\" target=\"_blank\">here</a> and try again later.', 'lifterlms-paypal' ), '#' ) );\n\n\t\t\t}\n\n\t\t\t// a different error, display the generic error\n\t\t\telse {\n\n\t\t\t\tLLMS_Admin_Settings::set_error( $r->get_error_message() );\n\n\t\t\t}\n\n\t\t\tupdate_option( $this->get_option_name( 'reference_transactions_enabled' ), 'no' );\n\n\t\t}\n\n\t\t// success\n\t\telse {\n\n\t\t\tLLMS_Admin_Settings::set_message( __( 'Reference transactions are enabled on your PayPal account. Recurring access plans can now be purchased using PayPal.', 'lifterlms-paypal' ) );\n\t\t\tupdate_option( $this->get_option_name( 'reference_transactions_enabled' ), 'yes' );\n\n\t\t}\n\n\t}",
"function successful_request($atos_response) {\n\t\t\tglobal $woocommerce;\n\n\t\t\tif (isset($atos_response)) {\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tswitch ($atos_response['code_reponse']) {\n\t\t\t\t\t\t// transaction authorised\n\t\t\t\t\t\tcase 'ok':\n\t\t\t\t\t\t\t$transauthorised = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$transauthorised = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ($transauthorised == true) {\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t// put code here to update/store the order with the a successful transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order = &new WC_Order( $order_id );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($order->status !== 'completed') {\n\t\t\t\t\t\t\tif ($order->status == 'processing') {\n\t\t\t\t\t\t\t\t// This is the second call - do nothing\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement Atos: REUSSI<br><br>Référence Transaction: ' . $order_id);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->add_order_note('info<br><br>Response Code: ' . $atos_response['real_response_code'] . '<br> Bank Code:' . $atos_response['real_code']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement réussi','customer');\n\t\t\t\t\t\t\t\t// Empty the Cart\n\t\t\t\t\t\t\t\t$woocommerce->cart->empty_cart();\n\t\t\t\t\t\t\t\t//update order status\n\t\t\t\t\t\t\t\t$order->update_status('processing');\n\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} else {\n\t\t\t\t\t\t// put code here to update/store the order with the a failed transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order \t\t\t= new woocommerce_order( (int) $order_id );\t\t\t\t\t\n\t\t\t\t\t\t$order->update_status('failed');\n\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t$order->add_order_note('Paiement Atos: ECHEC<br><br>Référence Transaction: ' . $order_id);\n\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t$order->add_order_note('Paiement échoué','customer');\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//$nOutputProcessedOK = 30;\n\t\t\t\t\t//$szOutputMessage = \"Error updating website system, please ask the developer to check code\";\n\t\t\t\t}\n\t\t\t\t//echo string back for gateway to read - this confirms the script ran correctly.\n\t\t\t\t//echo(\"StatusCode=\".$nOutputProcessedOK.\"&Message=\".$szOutputMessage);\n\t\t\t}\n\t\t}",
"public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }",
"public function submitPayment()\n {\n return array('error'=>0, 'transactionReference'=>'');\n \n }",
"public function return_handler() {\n\t\t@ob_clean();\n\t\theader( 'HTTP/1.1 200 OK' );\n\n\t\tif ( isset( $_REQUEST['reference'] ) && isset( $_REQUEST['paymentId'] ) && isset( $_REQUEST['signature'] ) ) {\n\t\t\t$signature = strtoupper( md5( $_REQUEST['amount'] . $_REQUEST['reference'] . $_REQUEST['paymentId'] . $_REQUEST['paymentDate'] . $_REQUEST['paymentStatus'] . $this->private_key ) );\n\t\t\t$order_id = absint( $_REQUEST['reference'] );\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\tif ( hash_equals( $signature, $_REQUEST['signature'] ) ) {\n\t\t\t\t$order_complete = $this->process_order_status( $order, $_REQUEST['paymentId'], $_REQUEST['paymentStatus'], $_REQUEST['paymentDate'] );\n\n\t\t\t\tif ( ! $order_complete ) {\n\t\t\t\t\t$order->update_status( 'failed', __( 'Payment was declined by Simplify Commerce.', 'woocommerce' ) );\n\t\t\t\t}\n\n\t\t\t\twp_redirect( $this->get_return_url( $order ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\n\t\twp_redirect( wc_get_page_permalink( 'cart' ) );\n\t\texit();\n\t}",
"public function process_gateway_notification() {\r\n\t\t$order_id = self::get_post_var( 'OrderID' );\r\n\t\t$message = self::get_post_var( 'Message' );\r\n\t\t$status_code = self::get_post_var( 'StatusCode' );\r\n\t\t$prev_status_code = self::get_post_var( 'PreviousStatusCode' );\r\n\t\t$session_id = explode( ' ', self::get_post_var( 'OrderDescription' ) );\r\n\r\n\t\tif ( is_numeric( $status_code ) ) {\r\n\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\tswitch ( $status_code ) {\r\n\t\t\t\tcase PS_TRX_RESULT_SUCCESS:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::ACCEPTED_PAYMENT;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_REFERRED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DECLINED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DUPLICATE:\r\n\t\t\t\t\t$processed = ( PS_TRX_RESULT_SUCCESS === $prev_status_code )\r\n\t\t\t\t\t\t? WPSC_Purchase_Log::ACCEPTED_PAYMENT\r\n\t\t\t\t\t\t: WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_FAILED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twp_die( 'Unsupported StatusCode. Please contact support.',\r\n\t\t\t\t\t\t'Unsupported StatusCode',\r\n\t\t\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array(\r\n\t\t\t\t'processed' => $processed,\r\n\t\t\t\t'transactid' => $order_id,\r\n\t\t\t\t'notes' => $message,\r\n\t\t\t\t'date' => time(),\r\n\t\t\t);\r\n\t\t\twpsc_update_purchase_log_details( $session_id[4], $data, 'sessionid' );\r\n\r\n\t\t\tswitch ( $processed ) {\r\n\t\t\t\tcase WPSC_Purchase_Log::ACCEPTED_PAYMENT:\r\n\t\t\t\t\ttransaction_results( $session_id, false, $order_id );\r\n\t\t\t\t\t// Thank you for purchasing.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WPSC_Purchase_Log::PAYMENT_DECLINED:\r\n\t\t\t\t\t// Sorry, your transaction was not accepted.\r\n\t\t\t\t\t$this->go_to_transaction_results( null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Thank you, your purchase is pending.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twp_die( 'Unexpected response from the payment gateway. Please contact support.',\r\n\t\t\t\t'Unexpected response from the payment gateway',\r\n\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t);\r\n\t\t}\r\n\t}",
"function wtsRefuseBanqReturn($orderoid, $ref, $bqstatus){\n $this->refuseBanqReturn($orderoid, $bqstatus);\n }",
"function wtsValidateBanqReturn($orderoid, $ref, $bqstatus, $bqtransid=NULL){\n $this->paiementCarte($orderoid, $bqstatus, $bqtransid);\n $this->postOrderActions($orderoid, true);\n }",
"public function callback()\n {\n $transaction = PaytmWallet::with('receive');\n\n $response = $transaction->response(); // To get raw response as array\n $invoiceId = $this->getInvoiceId($response['ORDERID']);\n \\Storage::put('/txn/_' . $response['ORDERID'] . '.json', json_encode($response));\n\n if ($transaction->isSuccessful()) {\n $payment = (new \\Modules\\Payments\\Helpers\\PaymentEngine('paytm', $response))->transact();\n toastr()->success('Payment received successfully', langapp('response_status'));\n return redirect()->route('invoices.index');\n }\n // Schedule Job to check transaction\n RecheckPaytmStatus::dispatch($response['ORDERID'])->delay(now()->addMinutes(3));\n toastr()->warning('We will verify your transaction shortly', langapp('response_status'));\n return redirect()->route('invoices.index');\n }",
"public function transactionGetResults ($reference);",
"function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }",
"function handleFuturepayAgreement(&$input, &$ids, &$objects) {\r\n $recur = $objects['contributionRecur'];\r\n $contribution =& $objects['contribution'];\r\n\r\n\r\n // remove the contribution which was added since\r\n // this is a new futurepay notification rather than\r\n // an actual payment\r\n $res=CRM_Contribute_BAO_Contribution::deleteContribution($contribution->id);\r\n if (!$res) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Problem encountered while deleting unwanted Contribution id=\".$contribution->id.\" res=\".print_r($res,true));\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n // futurepay agreemement made\r\n\r\n // update and save recur details\r\n $recur->create_date=$now;\r\n $recur->contribution_status_id=1;//pending ... no contribution yet made\r\n $recur->save();\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n // futurepay agreement cancelled \r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }",
"public function record_subscription_payment() { }",
"public function confirmWireTransferReference()\n {\n $id = (int) $_POST['id'];\n if (empty($id))\n return json_encode(array(\n 'success' => false,\n 'error' => array('message' => 'Invalid service id')\n ));\n\n $uid = (int) $_POST['uid'];\n $reference = filter_var($_GET['ref'], FILTER_SANITIZE_STRING);\n $companyService = new CompanyService();\n $success = $companyService->setServiceWireTransferReference($id, $reference);\n if ($success) {\n $notificationService = new NotificationService();\n $notificationService->registerEvent(\n \"wire_transfer_reference_confirmed\",\n $id,\n $uid\n );\n }\n\n return json_encode(array(\n 'success' => $success\n ));\n }",
"public function processPayment();",
"public function callback()\n {\n \n $status = request()->status;\n\n //if payment is successful\n if ($status == 'successful') {\n \n $transactionID = Flutterwave::getTransactionIDFromCallback();\n $data = Flutterwave::verifyTransaction($transactionID); \n \n \n //{{$data =(object)$data;}};\n //return view('tickets.pay', compact('data'));\n //dd($data);\n\n }\n elseif ($status == 'cancelled'){\n //Put desired action/code after transaction has been cancelled here\n }\n else{\n\n //Put desired action/code after transaction has failed here\n }\n\n return redirect()->route('dashboard.index')->with('success', 'payment done succefuly');\n // Get the transaction from your DB using the transaction reference (txref)\n // Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue\n // Confirm that the currency on your db transaction is equal to the returned currency\n // Confirm that the db transaction amount is equal to the returned amount\n // Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)\n // Give value for the transaction\n // Update the transaction to note that you have given value for the transaction\n // You can also redirect to your success page from here\n\n }",
"public function callback() {\n $order = $this->getsale((isset($_POST['x_invoice_num']) ? (int) $_POST['x_invoice_num'] : '0'));\n $arr = array(\n 'trans-id' => (isset($_POST['x_trans_id']) ? $_POST['x_trans_id'] : ''),\n 'amount' => (isset($_POST['x_amount']) ? $this->num_format($_POST['x_amount']) : ''),\n 'refund-amount' => '',\n 'currency' => $this->settings->currency,\n 'code-id' => (isset($order->saleID) ? $order->code . '-' . $order->saleID : '0-0'),\n 'pay-status' => (isset($_POST['x_response_code']) ? $_POST['x_response_code'] : ''),\n 'message' => (isset($_POST['x_response_reason_text']) ? '[' . $_POST['x_response_reason_code'] . '] ' . $_POST['x_response_reason_text'] : ''),\n 'inv-status' => '',\n 'fraud-status' => ''\n );\n return $arr;\n }",
"public function process()\n {\n parent::process();\n $data = $this->getBody();\n if (!isset($data)) {\n $data = array();\n }\n\n try {\n if ($this->_validateSchema()) {\n $resultSet = $this->_processLookup($data);\n $customer = $resultSet['customer'];\n if (!is_null($customer)) {\n $response = array(\n 'customer' => $customer,\n 'destination_id' => $this->getPublisherPseudonym(),\n 'correlation_id' => $this->getCorrelationId(),\n );\n $this->_sendSuccess($response);\n }\n if (sizeof($resultSet['errors']) > 0) {\n $response = array(\n 'errors' => $resultSet['errors'],\n 'destination_id' => $this->getPublisherPseudonym(),\n 'correlation_id' => $this->getCorrelationId(),\n );\n $this->_sendFailure($response);\n }\n }\n } catch (Exception $ex) {\n Mage::logException($ex);\n\n\n $errorResponse = array(\n 'id' => $data['id'],\n 'errors' => array(\n array(\n 'code' => empty($code) ? '-1' : '' . $code,\n 'message' => $ex->getMessage(),\n 'parameters' => null\n )\n ),\n 'destination_id' => $this->getPublisherPseudonym(),\n 'correlation_id' => $this->getCorrelationId(),\n );\n $this->_sendFailure($errorResponse);\n }\n return $this;\n }",
"function processSubscriptionPlan(&$order,$post_vars)\n {\n $c = & $this->c;\n\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n\n $PaidOrder = ClassRegistry::getClass('PaidOrderModel');\n\n # Begin txn validation\n // Assign posted variables to local variables\n $txn_type = Sanitize::getString($post_vars,'txn_type');\n\n $payment_status = Sanitize::getString($post_vars,'payment_status');\n\n $pending_reason = Sanitize::getString($post_vars,'pending_reason',__t(\"N/A\",true));\n\n // Extract custom fields\n $custom = json_decode($post_vars['custom'],true);\n\n $user_id = $custom['user_id'];\n\n $order_id = $custom['order_id']; // Local order id\n\n // Check the payment_status is Completed\n if ($txn_type == 'subscr_payment' && $payment_status == \"Completed\")\n {\n $result = $this->validateTxn($order,$post_vars);\n\n if($result) $order = $this->checkSubscriptionRenewal($order);\n }\n elseif($txn_type == 'subscr_signup')\n {\n $order_status = 'Processing';\n\n $PaidTxnLog->addNote(\"Payment status: \" . __t(\"New subscription\",true));\n\n return false; // This isn't a payment notification\n }\n elseif(Sanitize::getString($post_vars,'pending_reason'))\n {\n $PaidTxnLog->addNote(\"Pending reason: {$pending_reason}\");\n\n $PaidTxnLog->addNote(\"Txn type: {$txn_type}\");\n\n $result = false;\n }\n else /*if($txn_type == 'subscr_cancel')*/\n {\n $payment_status = \"Cancelled\";\n\n $PaidTxnLog->addNote(\"Payment status: \" . __t(\"Cancelled\",true));\n\n $result = false;\n }\n # End txn validation\n\n if ($result)\n {\n $order_status = 'Complete';\n\n $order['PaidOrder']['order_status'] = $order_status;\n\n $c->Paidlistings->processSuccessfulOrder($order);\n }\n else\n {\n switch($payment_status)\n {\n case 'Pending':\n $order_status = 'Pending';\n break;\n case 'Denied':\n $order_status = 'Failed';\n break;\n case 'Reversed':\n $order_status = 'Fraud';\n break;\n case 'Cancelled':\n $order_status = 'Cancelled';\n break;\n break;\n default:\n $order_status = 'Pending';\n break;\n }\n\n $PaidTxnLog->addNote(\"Payment status: {$order_status}\");\n\n $PaidTxnLog->addNote(\"Order active: 0\");\n\n $PaidOrder->updateOrder($order,array('order_status'=>$order_status,'order_active'=>0));\n }\n return $result;\n\n }"
]
| [
"0.6807607",
"0.6216509",
"0.6092531",
"0.5993062",
"0.5970466",
"0.58522445",
"0.58122176",
"0.57300836",
"0.57126147",
"0.56970793",
"0.5652897",
"0.56362396",
"0.56090647",
"0.55589944",
"0.5557577",
"0.55318934",
"0.5529978",
"0.5522464",
"0.5519557",
"0.551316",
"0.54826266",
"0.54683995",
"0.54614735",
"0.5452465",
"0.54248554",
"0.5413424",
"0.5409427",
"0.53961587",
"0.5377815",
"0.5372235"
]
| 0.70716196 | 0 |
Update billing agreement ID for a subscription after using PPEC to complete a payment to make up for an automatic renewal payment which previously failed. | public function update_failing_payment_method( $subscription, $renewal_order ) {
update_post_meta( is_callable( array( $subscription, 'get_id' ) ) ? $subscription->get_id() : $subscription->id, '_ppec_billing_agreement_id', $renewal_order->ppec_billing_agreement_id );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function do_process_subscription_payment( $subscription ) {\n\t\t\t$subscription_id = $subscription;\n\t\t\tif ( is_object( $subscription ) ) {\n\t\t\t\t$subscription_id = $subscription->ID;\n\t\t\t}\n\n\t\t\t$subscription_ord = wcs_get_subscription( $subscription_id );\n\t\t\t$subscription_orders = $subscription_ord->get_related_orders();\n\n\t\t\t$order_id = current( $subscription_orders );\n\t\t\t$order = new WC_Order( $order_id );\n\n\t\t\t$user_id = $subscription_ord->get_user_id();\n\t\t\tif ( ! $user_id ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$billing_email = version_compare( WC_VERSION, '3.0', '<' ) ? $subscription_ord->billing_email : $subscription_ord->get_billing_email();\n\n\t\t\t$renewal = false;\n\t\t\t// Its first subscription\n\t\t\t$event_sale_name = apply_filters( 'do_woo_drip_action_order', __( 'Subscription', 'do_woo_drip' ) );\n\t\t\t// Its renewal\n\t\t\tif ( count( $subscription_orders ) > 1 ) {\n\t\t\t\t$renewal = true;\n\t\t\t\t$event_sale_name = apply_filters( 'do_woo_drip_action_order_renew', __( 'Renew', 'do_woo_drip' ) );\n\t\t\t}\n\n\t\t\t// Subscriber Parameters\n\t\t\t$subscriber_params = array(\n\t\t\t\t'account_id' => $this->_drip_account_id,\n\t\t\t\t'email' => $billing_email,\n\t\t\t\t'time_zone' => wc_timezone_string(),\n\t\t\t\t'custom_fields' => $this->drip_custom_fields( $order, $user_id, $renewal ),\n\t\t\t\t'tags' => apply_filters( 'do_woo_drip_tag_customer', array(\n\t\t\t\t\t__( 'WooSubscriber', 'do_woo_drip' ),\n\t\t\t\t) )\n\t\t\t);\n\n\t\t\t$this->_drip_api->drip_create_or_update_subscriber( $this->_drip_account_id, array( 'subscribers' => array( $subscriber_params ) ) );\n\n\t\t\t// Product name\n\t\t\t$products = implode( ', ', array_map( function ( $product ) {\n\t\t\t\treturn version_compare( WC_VERSION, '3.0', '<' ) ? $product['name'] : $product->get_name();\n\t\t\t}, $order->get_items() ) );\n\n\t\t\t// Product ID\n\t\t\t$product_ids = implode( ', ', array_filter( array_map( function ( $product ) {\n\t\t\t\tif ( is_a( $product, 'WC_Order_Item_Product' ) ) {\n\t\t\t\t\treturn $product->get_product_id();\n\t\t\t\t}\n\t\t\t}, $order->get_items() ) ) );\n\n\t\t\t// Billing cycle & Variation ID\n\t\t\t$billing_cycle = $variation_id = $product_type = array();\n\t\t\tforeach ( $order->get_items() as $key => $val ) {\n\t\t\t\t$bill_type = wc_get_order_item_meta( $key, 'pa_billingcycle', true );\n\t\t\t\tif ( $bill_type ) {\n\t\t\t\t\tarray_push( $billing_cycle, $bill_type );\n\t\t\t\t}\n\n\t\t\t\t$variation = wc_get_order_item_meta( $key, '_variation_id', true );\n\t\t\t\tif ( $variation > 0 ) {\n\t\t\t\t\tarray_push( $variation_id, $variation );\n\t\t\t\t}\n\n\t\t\t\t$prodtype = wc_get_order_item_meta( $key, 'pa_producttype', true );\n\t\t\t\tif ( $prodtype ) {\n\t\t\t\t\tarray_push( $product_type, $prodtype );\n\t\t\t\t} elseif ( $variation > 0 ) {\n\t\t\t\t\t$variation_name = get_post_meta( $variation, 'attribute_pa_producttype', true );\n\t\t\t\t\tif ( $variation_name ) {\n\t\t\t\t\t\tarray_push( $product_type, $variation_name );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$billing_cycle = implode( ', ', array_filter( $billing_cycle ) );\n\t\t\t$variation_id = implode( ', ', array_filter( $variation_id ) );\n\t\t\t$product_type = implode( ', ', array_filter( $product_type ) );\n\n\t\t\tif ( empty( $billing_cycle ) ) {\n\t\t\t\t$billing_cycle = $subscription_ord->get_billing_period();\n\t\t\t}\n\n\t\t\t// $is_subscriber Variable\n\t\t\t$is_sub_action = $this->_drip_api->drip_fetch_subscriber( $this->_drip_account_id, $billing_email );\n\n\t\t\tif ( $is_sub_action ) {\n\t\t\t\t$is_subscriber = $is_sub_action['id'];\n\t\t\t} else {\n\t\t\t\t$is_subscriber = false;\n\t\t\t}\n\n\t\t\t$event_params = array(\n\t\t\t\t'account_id' => $this->_drip_account_id,\n\t\t\t\t'email' => $billing_email,\n\t\t\t\t'action' => $event_sale_name,\n\t\t\t\t'properties' => $this->drip_event_properties( $order->get_total(), $products, $order_id, $product_ids, $product_type, $billing_cycle, $variation_id ),\n\t\t\t);\n\n\n\t\t\t// Check if subscriber exists and if so, send data to Drip\n\t\t\tif ( $is_subscriber ) {\n\n\t\t\t\t$this->_drip_api->drip_record_event( $this->_drip_account_id, array( 'events' => array( $event_params ) ) );\n\n\t\t\t}\n\t\t}",
"public function record_subscription_payment() { }",
"public function update_billing_agreement($agreementId,$agreement){\n\n if(count(array_filter($agreement['shipping_address'])) == 0){\n unset($agreement['shipping_address']);\n }\n \n try { \n $patch = new Patch();\n $patch->setOp('replace')\n ->setPath('/')\n ->setValue(json_decode(json_encode(array_filter($agreement)))); \n\n $patchRequest = new PatchRequest();\n $patchRequest->addPatch($patch);\n\n $createdAgreement = new Agreement();\n $createdAgreement->setId($agreementId);\n $requestArray= clone $createdAgreement;\n $createdAgreement->update($patchRequest, $this->_api_context); \n $agreement = Agreement::get($agreementId, $this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['AGREEMENT']= $agreement->toArray(); \n $returnArray['RAWREQUEST']=$requestArray;\n $returnArray['RAWRESPONSE']=$agreement->toJSON();\n return $returnArray; \n \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }",
"function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}",
"public function update_purchaseorder($ponbr) {\n\t\t\t$purchaseorder = $this->create_purchaseorderheader($ponbr);\n\t\t\t$purchaseorder['LineItem'] = $this->create_purchaseorderdetails($ponbr);\n\t\t\t$this->response = $this->curl_put($this->endpoints['purchase-order'], $purchaseorder, $json = true);\n\t\t\t$this->response['response']['PurchaseOrderNumber'] = isset($this->response['response']['PurchaseOrderNumber']) ? $this->response['response']['PurchaseOrderNumber'] : $purchaseorder['ID'];\n\t\t\t$this->process_response();\n\t\t\t//$this->response['response']['request'] = $purchaseorder;\n\t\t\treturn $this->response['response'];\n\t\t}",
"public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"'\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }",
"function charge_credit_card() {\n\nif ( is_user_logged_in() ) {\n\t\n\t require 'vendor/autoload.php';\n\n define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n \n ///////////////////////------- FUNCTION CANCEL SUBSCRIPTION --------////////////////////////////\n \n function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }\n \n///////////////////------------- SUBSCRIPTION USERS -----------------/////////////////////\n function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }\n ///////////////////------------- ONCE PAID USERS -----------------/////////////////////\n function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }\n \n ///////////////////////////////--------- FUNCTION END -----------/////////////////////////////////// \nif(!empty($_POST['amount'])) {\n $payment_type = $_POST['payment_type'];\n $card = $_POST['card'];\n $mn = $_POST['mn'];\n $yr = $_POST['yr'];\n $exp = $mn.''.$yr;\n $code = $_POST['code'];\n $fullname = $_POST['fullname'];\n $interval = 30; // 30 days interval\n // monthly subscription $75 (run on authorize live mode only)\n if(isset($payment_type) && $payment_type == \"monthly\") {\n\t $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t \t $amount = $monthpaid;\n \t\t$peramaters = array($amount,$card,$exp,$code,$fullname,$interval);\n \t$ret = createSubscription($peramaters);\n\t\t\n\t\t//print_r($ret); exit(0);\n \t } \n else { \n // cancel monthly subscription first\n global $wpdb;\n \t$current_user = wp_get_current_user();\n\t$user_id = $current_user->ID;\n \t$table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t\tif($subscribe > 0)\n\t\tcancelSubscription($subscribe);\n // pay once $1500 (run on both authorize live and test mode)\n $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n \t\t$amount = $oncepaid;\n\t \t$peramaters = array($amount,$card,$exp,$code,$fullname);\n \t\tchargeCreditCard($peramaters);\n \t\t}\n\n}\n/////////////////////////////////////////////////////////////////////////\n\nif(isset($_GET['subid']) && $_GET['subid'] > 0) { \n \n\t$subid = $_GET['subid'];\n\tcancelSubscription($subid); \n}\n\n\n\n\n/* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\t*/\n\t\n$current_user = wp_get_current_user();\n$username = $current_user->user_login;\n$user_email = $current_user->user_email;\n$user_firstname = $current_user->user_firstname;\n$user_lastname = $current_user->user_lastname;\n$user_id = $current_user->ID;\n$thefullname = $user_firstname?$user_firstname.' '.$user_lastname:'';\t\n ?>\n <style>\n\t #sjkfrm input[type=text] {\n\t\t border:solid 1px #666666;\n\t\tborder-radius: 15px;\n\t\tborder: 2px solid #666666;\n\t\tpadding: 5px; \n\t\theight: 50px; \n\t\t }\n\t.form-control{\n\t\tborder: 2px solid #999 !important;\n\t\tborder-radius: 8px;\n\t\theight:40px !important;\n\t\twidth: 70%;\n\t\t}\n\t.thimg{\n\t\twidth: 70%;\n\t\t}\t\n\t@media only screen and (max-width: 700px) {\n\t\t.form-control{\n\t\t\twidth: 100%;\n\t\t}\n\t\t.thimg{\n\t\twidth: 100%;\n\t\t}\n\t\t}\t\n\t.selbx{\n\t\tborder: 2px solid #999 !important;\n\t\theight:40px !important;\n\t\t}\t \n\t.sbmt{\n\t\tbackground-color:#6dcd62;\n\t\tcolor:#FFF;\n\t\tpadding:12px 35px;\n\t\tborder-radius: 8px;\n\t\tborder: none 0px;\n\t\tmargin-bottom: 20px;\n\t\t}\n\t.sbmt:hover{\n\t\tbackground-color:#090;\n\t\t}\t\n </style>\n <?php \n /* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $oncePaid = $wpdb->get_var( \"SELECT amount FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe == '-' order by id desc\" );\n echo $oncePaid; exit(0);\n if($oncePaid == 1000) {\n\t ?>\n <h2 style=\"color:#7066ce\">You have already paid $1500 for perfect cNanny</h2><br />\n <p>You have already paid $1500 for perfect cNanny. so you need not to be subscribed again</p>\n <?php\n\t $disp = 'style=\"display:none\"';\n\t } else {\n\t$disp = 'style=\"display:block\"';\t \n\t}*/\n ?> \n<form action=\"\" id=\"jkfrm\" method=\"post\" enctype=\"multipart/form-data\" name=\"payment\" autocomplete=\"off\" onsubmit=\"check_exp()\" <?php //echo $disp; ?>>\n\t<style type=\"text/css\">\n #checkout_card_number {\n background-image: url('<?php echo WP_PLUGIN_URL; ?>/authorizejk/cards.png');\n background-position: 3px 3px;\n background-size: 40px 252px; /* 89 x 560 */\n background-repeat: no-repeat;\n padding-left: 48px !important;\n }\n\tlabel span {\n\t\tfont-size:12px;\n\t\tfont-weight:600 !important;\n\t\tcolor:#666 !important;\n\t\t}\n\t/*input.pw {\n -webkit-text-security: disc;\n\t}*/\n\t\n\t\n\t\n\n\n#username,\n#pw {\n display: inline-block;\n width: 150px;\n background: #FFF;\n \tborder: 2px solid #999 !important;\n border-radius: 8px;\n height: 40px !important;\n\tline-height: 40px;\n padding: 0px 5px;\n letter-spacing: 2px;\n\toverflow:hidden;\n}\n#pw {\n -webkit-text-security: disc;\n\t\n}\n\n\n </style>\n <?php\n\t global $wpdb;\n $table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t?>\n <!--<h2 style=\"color:#6dcd62; font-weight:bold;\">$75/month</h2><br />-->\n <?php if(!empty($subscribe)) { \n\tif(empty($ret)) {\n\t\twp_redirect(site_url().'/already-subscribe'); exit(0);\n\t}\n\t?>\n\n <small>Don't worry, you can <a href=\"?subid=<?php echo $subscribe; ?>\" onclick=\"return confirm('Are you sure that you want to cancel monthly subscription from Cnanny?')\">cancel</a> at any time</small><br />\n \n <?php $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <input type=\"radio\" name=\"payment_type\" value=\"yearly\" checked=\"checked\" style=\"clear:both\" /> <label style=\"margin-top:20px;\"> Pay Once $<?php echo $oncepaid; ?> for hiring perfect cNanny</label>\n <?php } else { ?>\n <?php $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75; ?>\n <br />\n <input type=\"radio\" name=\"payment_type\" value=\"monthly\" checked=\"checked\" /> <label> Monthly Subscribe $<?php echo $monthpaid; ?></label>\n <?php } ?>\n <br /><br />\n <img src=\"<?php echo WP_PLUGIN_URL; ?>/authorizejk/cclogos.gif\" class=\"thimg\" /><br /><br />\n <label style=\"\">Full Name <span>(as it appears on your card)</span></label> <input type=\"text\" name=\"fullname\" maxlength=\"80\" required=\"required\" class=\"input-text form-control validate-alpha required\" placeholder=\"\" autocomplete=\"off\" value=\"<?php echo $thefullname; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $monthpaid; ?>\" /><br />\n <label>Card Number <span>(no dashes or spaces)</span></label><input id=\"checkout_card_number\" name=\"card\" required=\"required\" class=\"input-text form-control validate-creditcard required\" type=\"text\" maxlength=\"16\" data-stripe=\"number\" placeholder=\"\" autocomplete=\"off\"><br />\n <script type=\"text/javascript\">\n\t$ = jQuery.noConflict();\n var $cardinput = $('#checkout_card_number');\n $('#checkout_card_number').validateCreditCard(function(result)\n {\t\t\n //console.log(result);\n if (result.card_type != null)\n {\t\t\t\t\n switch (result.card_type.name)\n {\n case \"visa\":\n $cardinput.css('background-position', '3px -34px');\n $cardinput.addClass('card_visa');\n break;\n \n case \"visa_electron\":\n $cardinput.css('background-position', '3px -72px');\n $cardinput.addClass('card_visa_electron');\n break;\n \n case \"mastercard\":\n $cardinput.css('background-position', '3px -110px');\n $cardinput.addClass('card_mastercard');\n break;\n \n case \"maestro\":\n $cardinput.css('background-position', '3px -148px');\n $cardinput.addClass('card_maestro');\n break;\n \n case \"discover\":\n $cardinput.css('background-position', '3px -186px');\n $cardinput.addClass('card_discover');\n break;\n \n case \"amex\":\n $cardinput.css('background-position', '3px -223px');\n $cardinput.addClass('card_amex');\n break;\n \n default:\n $cardinput.css('background-position', '3px 3px');\n break;\t\t\t\t\t\n }\n } else {\n $cardinput.css('background-position', '3px 3px');\n }\n \n // Check for valid card numbere - only show validation checks for invalid Luhn when length is correct so as not to confuse user as they type.\n if (result.length_valid || $cardinput.val().length > 16)\n {\n if (result.luhn_valid) {\n $cardinput.parent().removeClass('has-error').addClass('has-success');\n } else {\n $cardinput.parent().removeClass('has-success').addClass('has-error');\n }\n } else {\n $cardinput.parent().removeClass('has-success').removeClass('has-error');\n }\n });\n\t//------------------------------------------------------\n\tfunction check_exp() {\n\tvar yr = document.getElementById(\"yrt\").value;\t\n\tvar currentTime = new Date();\n\tvar curr_month = currentTime.getMonth() + 1;\n\tvar theyear = <?php echo date('y'); ?>;\n\tif(yr == theyear) {\n\t\tvar mnt = document.getElementById(\"mnt\").value;\n\t\tif(mnt < curr_month) {\n\t\t\talert('Please select a valid Expiry Date');\n\t\t\t}\n\t}\n\t\n}\n\nfunction set_type() { //\n\tvar pw = $('#pw').text();\n\tdocument.getElementById(\"code\").value = pw;\n\t//alert(pw);\n\t}\n \n </script>\n \n <label>Expiry Date</label><br />\n <select name=\"mn\" class=\"selbx required\" id=\"mnt\" required>\n <option value=\"\">Select Month</option>\n <option value=\"01\">January</option>\n <option value=\"02\">February</option>\n <option value=\"03\">March</option>\n <option value=\"04\">April</option>\n <option value=\"05\">May</option>\n <option value=\"06\">June</option>\n <option value=\"07\">July</option>\n <option value=\"08\">August</option>\n <option value=\"09\">September</option>\n <option value=\"10\">October</option>\n <option value=\"11\">November</option>\n <option value=\"12\">December</option>\n </select>\n <select name=\"yr\" class=\"selbx required\" id=\"yrt\" required onchange=\"check_exp()\">\n <option value=\"\">Select Year</option>\n \n\n <?php \n $y = date('y');\n for($i=1;$i<=12;$i++) {\n ?>\n <option value=\"<?php echo $y; ?>\"><?php echo '20'.$y; ?></option>\n <?php $y++; } ?>\n </select>\n <br />\n <input type=\"text\" name=\"card_number\" value=\"0000 0000 0000 0000\" style=\"display:none\" /><br />\n \n <?php\n if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0) { // Firefox\n ?>\n\t <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"password\" id=\"codeff\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /><br />\n\t<?php\n} else { // other browsers\n ?>\n <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"hidden\" id=\"code\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /> <br /><div contenteditable id=\"pw\"></div><br /><br />\n <?php\n}\n ?> \n\n\n \n\n \n \n <?php if(!empty($subscribe)) { \n\t\n\t $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <strong id=\"st\">You will be charged $<?php echo $oncepaid; ?> for hiring perfect cNanny</strong><br /><br />\n <?php } else { \n\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t?>\n <strong id=\"st\">You will be charged $<?php echo $monthpaid; ?> every month</strong><br /><br />\n <?php } ?>\n \n <!-- prevent auto save in browser-->\n <div style=\"display:none\">\n <input type=\"text\" name=\"cardinfo\" id=\"txtUserName\" value=\"0000 0000 0000 0000\"/>\n\t<input type=\"text\" name=\"txtPass\" id=\"txtPass\" value=\"9999999999\"/>\n </div>\n \n \n <input type=\"submit\" class=\"sbmt\" value=\"Pay Now\" onclick=\"set_type();\" /><br />\n <strong>Don't want to pay right now?</strong> <a href=\"<?php echo site_url(); ?>/parent-search\">Continue browsing</a><br />\n <strong>Questions?</strong> <a href=\"<?php echo site_url(); ?>/contact-us\">Contact us</a>\n <script>document.addEventListener('contextmenu', event => event.preventDefault());\n payment.setAttribute( \"autocomplete\", \"off\" ); payment.code.setAttribute( \"autocomplete\", \"off\" );\n\thideFrm(); //hide form and show success massage\n </script>\n</form><br />\n<script>\nhideFrm(); //hide form and show success massage\n</script>\n <?php\n\t} else {\n\t\twp_redirect('login');\n\t\t}\n}",
"public function updateSubscriptionBilling(Subscription &$subscription, $data)\r\n {\r\n $subscription->setProductId($data['productId']);\r\n $subscription->setPurchasedToken($data['purchasedToken']);\r\n\r\n $this->entityManager->merge($subscription);\r\n $this->entityManager->flush();\r\n return $subscription;\r\n }",
"function update($pid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($pid, $this->title) == TRUE){ \n\n\t// Form validation\n $this->form_validation->set_rules('tdate', 'Invoice Date', 'required|callback_valid_period');\n $this->form_validation->set_rules('tnote', 'Note', 'required');\n $this->form_validation->set_rules('tcosts', 'Landed Cost', 'numeric');\n $this->form_validation->set_rules('tdocno', 'Docno', '');\n $this->form_validation->set_rules('cacc', 'Account', 'required');\n\n if ($this->form_validation->run($this) == TRUE && $this->valid_confirmation($pid) == TRUE)\n {\n $purchase_returns = $this->model->get_by_id($pid)->row();\n\n $purchase_return = array('log' => $this->decodedd->log, 'docno' => $this->input->post('tdocno'),\n 'dates' => $this->input->post('tdate'), 'acc' => $this->input->post('cacc'), 'notes' => $this->input->post('tnote'),\n 'user' => $this->decodedd->userid, 'costs' => $this->input->post('tcosts'),\n 'balance' => floatval($this->input->post('tcosts')+$purchase_returns->total)\n );\n if ($this->model->update($pid,$purchase_return) == true){ $this->error = 'transaction successfully saved..!'; }else{ $this->reject(); }\n }\n elseif ($this->valid_confirmation($pid) != TRUE){ $this->reject(\"Journal already approved..!\"); }\n else{ $this->reject(validation_errors()); }\n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response(); \n }",
"function ihc_update_stripe_subscriptions(){\n\tglobal $wpdb;\n\t$data = $wpdb->get_results(\"SELECT id, txn_id, payment_data FROM \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\t\tWHERE txn_id LIKE 'ch_%';\");\n\tif (count($data)){\n\n\t\t//loading stripe libs\n\t\trequire_once IHC_PATH . 'classes/stripe/init.php';\n\t\t$secret_key = get_option('ihc_stripe_secret_key');\n\t\t\\Stripe\\Stripe::setApiKey($secret_key);\n\n\t\tforeach ($data as $obj){\n\t\t\t$payment_data = json_decode($obj->payment_data);\n\t\t\tif (!empty($payment_data->customer)){\n\t\t\t\t$replace_txn_id = $payment_data->customer;\n\t\t\t} else {\n\t\t\t\t$stripe_obj = \\Stripe\\Charge::retrieve($obj->txn_id);\n\t\t\t\tif (!empty($stripe_obj->customer)){\n\t\t\t\t\t$replace_txn_id = $stripe_obj->customer;\n\t\t\t\t}\n\t\t\t\tunset($stripe_obj);\n\t\t\t}\n\t\t\tif (!empty($replace_txn_id)){\n\t\t\t\t$wpdb->query(\"UPDATE \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\tSET txn_id='\" . $replace_txn_id . \"'\n\t\t\t\t\t\t\t\tWHERE id= '\" . $obj->id . \"';\n\t\t\t\t\t\t\");\n\t\t\t\tunset($replace_txn_id);\n\t\t\t}\n\t\t}//end foreach\n\t}\n}",
"public function UpdatePayment($data)\n { \n \n \n $metadata=$data['data']['metadata']; \n $type_id=Subscription::where('user_id',$metadata['user_id'])\n ->orderBy('id', 'desc')\n ->first(); \n \n \n // Store Payment \n $payment= Payment::create([\n 'user_id'=>$metadata['user_id'],\n 'type'=> 'Subscription',\n 'type_id'=>$type_id->id,\n 'reference'=>$data['data']['reference'],\n 'currency'=>$data['data']['currency'],\n 'channel'=>$data['data']['channel'],\n 'amount'=>$data['data']['amount'],\n 'status'=>$data['data']['status'], \n 'gateway'=>\"PAYSTACK\", \n 'transaction_date'=>$data['data']['transaction_date'],\n ]);\n \n // update the subscribtion plan previously created with active status\n Subscription::where('user_id',$metadata['user_id'])\n ->where('id',$type_id->id)\n ->update([\n 'status'=>'active'\n ]); \n }",
"function wp_aff_handle_woocommerce_subscription_payment($order) {\n if (!is_object($order)) {\n $order = new WC_Order($order);\n }\n\n $order_id = $order->id;\n $total = $order->order_total;\n $shipping = $order->get_total_shipping();//get_shipping();\n $sale_amount = $total - $shipping;\n $txn_id = $order_id . \"_\" . date(\"Y-m-d\"); //Add the subscription charge date to make this unique\n $item_id = \"\";\n $buyer_email = $order->billing_email;\n $buyer_name = $order->billing_first_name . \" \" . $order->billing_last_name;\n \n $referrer = get_post_meta($order_id, '_wp_aff_ap_id', true);\n if(empty($referrer)){\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - couldn't get referrer ID from cookie. Checking IP address...\", true);\n $ip_address = get_post_meta($order_id, '_customer_ip_address', true);\n if (empty($ip_address)) {\n wp_affiliate_log_debug(\"WooCommerce Subscription Affiliate integration - customer IP address is missing in WooCommerce order.\", false);\n return;\n }\n $referrer = wp_aff_get_referrer_id_from_ip_address($ip_address);\n }\n \n $order_status = $order->status;\n\n //apply filter for coupon check\n $referrer = apply_filters('aff_woo_before_awarding_commission_filter', $referrer, $order);\n\n $debug_data = \"WooCommerce subscripiton payment - Commission tracking debug data: \" . $referrer . \"|\" . $sale_amount . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $ip_address . \"|\" . $buyer_name;\n wp_affiliate_log_debug($debug_data, true);\n\n if (!empty($referrer)) {\n wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, '', '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - This is not an affiliate referred sale!\", true);\n }\n}",
"public function api_entry_subscribeAPN() {\n parent::validateParams(array('user', 'udid', 'devicetoken'));\n\n $users = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if (!$this->Mdl_Users->get($_POST[\"user\"])) parent::returnWithErr(\"User id is not valid.\");\n\n $user = $this->Mdl_Users->update(array(\n 'id' => $_POST[\"user\"],\n 'udid' => $_POST[\"udid\"],\n 'devicetoken' => $_POST[\"devicetoken\"]\n ));\n\n parent::returnWithoutErr(\"Subscription has been done successfully.\", $user);\n }",
"private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}",
"function checkSubscriptionRenewal($order)\n {\n $plan = & $order['PaidOrder']['plan_info']['plan_array'];\n if($order['PaidOrder']['order_status'] == 'Complete') /* The order had already been procesed in the past */\n {\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidTxnLog->addNote(\"Subscription Renewal\");\n $new_expiration = PaidOrderModel::getExpirationDate($plan['duration_period'],$plan['duration_number'],$order['PaidOrder']['order_expires']);\n $order['PaidOrder']['order_expires'] = $new_expiration;\n $plan['moderation'] = 0; // If it was published before no need to moderate it again\n }\n\n return $order;\n }",
"public function reactivate_billing_agreement($agreementId,$note){\n try {\n \n $agreementStateDescriptor = new AgreementStateDescriptor();\n if(!empty(trim($note))){\n $agreementStateDescriptor->setNote($note);\n }\n $suspendedAgreement = new Agreement();\n $suspendedAgreement->setId($agreementId);\n $suspendedAgreement->reActivate($agreementStateDescriptor, $this->_api_context); \n $agreement = Agreement::get($agreementId, $this->_api_context); \n $returnArray['RESULT'] = 'Success'; \n $returnArray['AGREEMENT']= $agreement->toArray();\n $returnArray['RAWREQUEST']='{id:'.$agreementId.'}';\n $returnArray['RAWRESPONSE']=$agreement->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n } \n }",
"function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }",
"function handleFuturepayAgreement(&$input, &$ids, &$objects) {\r\n $recur = $objects['contributionRecur'];\r\n $contribution =& $objects['contribution'];\r\n\r\n\r\n // remove the contribution which was added since\r\n // this is a new futurepay notification rather than\r\n // an actual payment\r\n $res=CRM_Contribute_BAO_Contribution::deleteContribution($contribution->id);\r\n if (!$res) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Problem encountered while deleting unwanted Contribution id=\".$contribution->id.\" res=\".print_r($res,true));\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n // futurepay agreemement made\r\n\r\n // update and save recur details\r\n $recur->create_date=$now;\r\n $recur->contribution_status_id=1;//pending ... no contribution yet made\r\n $recur->save();\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n // futurepay agreement cancelled \r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"public function testUpdateCertificate()\n {\n }",
"public function confirmBillingAgreement($requestParameters = array());",
"function _renewSubscription(&$subscription) {\n\t\tif ($subscription->isNonExpiring()) return;\n\n\t\t$subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());\n\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->getDateEnd());\n\n\t\t// if the subscription is expired, extend it to today + duration of subscription\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$subscription->setDateEnd(mktime(23, 59, 59, date(\"m\", $dateEnd)+$duration, date(\"d\", $dateEnd), date(\"Y\", $dateEnd)));\n\n\t\t// Reset reminder dates\n\t\t$subscription->setDateRemindedBefore(null);\n\t\t$subscription->setDateRemindedAfter(null);\n\n\t\t$this->updateSubscription($subscription);\n\t}",
"public function update_subscription( $data ) {\r\n global $wpdb;\r\n\r\n // leave only the required keys\r\n $data = array_intersect_key( $data, LaterPay_Helper_Subscription::get_default_options() );\r\n\r\n // fill values that weren't set from defaults\r\n $data = array_merge( LaterPay_Helper_Subscription::get_default_options(), $data );\r\n\r\n unset( $data['lp_id'] ); // unset key ( used in WP schema ) before inserting to custom table.\r\n\r\n // pass_id is a primary key, set by autoincrement\r\n $id = $data['id'];\r\n unset( $data['id'] );\r\n\r\n // format for insert and update statement\r\n $format = array(\r\n '%d', // duration\r\n '%d', // period\r\n '%d', // access_to\r\n '%d', // access_category\r\n '%f', // price\r\n '%s', // revenue_model\r\n '%s', // title\r\n '%s', // description\r\n );\r\n\r\n if ( empty( $id ) ) {\r\n $wpdb->insert(\r\n $this->table,\r\n $data,\r\n $format\r\n );\r\n $data['id'] = $wpdb->insert_id;\r\n } else {\r\n $wpdb->update(\r\n $this->table,\r\n $data,\r\n array( 'id' => $id ),\r\n $format,\r\n array( '%d' ) // pass_id\r\n );\r\n $data['id'] = $id;\r\n }\r\n\r\n // purge cache\r\n LaterPay_Helper_Cache::purge_cache();\r\n\r\n return $data;\r\n }",
"public function getBillingAgreementId()\n {\n return $this->billing_agreement_id;\n }",
"public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}",
"static function acknowledgeInvoice($invoice_id) {\n global $wpdb;\n $returnval = $wpdb->update(\n \"wp_invoice\",\n array( 'acknowledged_date' => current_time('mysql', 1) ),\n array( 'id' => $invoice_id ) );\n \n if(false === $returnval) {\n throw new DatabaseException(\"Error occurred during UPDATE\");\n }\n }",
"public function updateSubscription( $email )\n\t {\n\t \t$obj = Doctrine_Core::getTable ( 'User' )->findOneByemail ( $email );\n\t \t$obj->downloadStatus = \"paid\";\n\t \t$obj->save();\n\t \treturn $obj->id;\n\t }",
"function handleFuturePayPayment(&$input, &$ids, &$objects) {\r\n $recur =& $objects['contributionRecur'];\r\n \r\n // make sure the invoice ids match\r\n // make sure the invoice is valid and matches what we have in the contribution record\r\n if ( $recur->invoice_id != $input['invoice'] ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Failure : Invoice values dont match between database and IPN request\");\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n \r\n // fix dates that already exist\r\n $dates = array( 'create', 'start', 'end', 'cancel', 'modified' );\r\n foreach ( $dates as $date ) {\r\n $name = \"{$date}_date\";\r\n if ( $recur->$name ) {\r\n $recur->$name = CRM_Utils_Date::isoToMysql( $recur->$name );\r\n }\r\n }\r\n\r\n //contribution_status_id:\r\n //0=Completed,1=Pending,2=Cancelled,3=Overdue,4=Failed,5=InProgress\r\n if ($input['transStatus']=='Y') {//rawAuthMessage=Authorised\r\n // futurepay payment accepted\r\n if ($input['rawAuthMessage']!='Authorised') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n if (_getContributionCount($recur)>=$recur->installments) {\r\n // final installement\r\n $recur->contribution_status_id=0;//0=Completed\r\n $recur->end_date=$now;\r\n }\r\n else {\r\n $recur->contribution_status_id=5;//5=In Progress\r\n $recur->modified_date = $now;\r\n }\r\n }\r\n else if ($input['transStatus']=='N') {//rawAuthMessage=Declined\r\n // futurepay payment declined\r\n $recur->contribution_status_id=4;//4=Failed\r\n $recur->end_date = $now;\r\n if ($input['rawAuthMessage']!='Declined') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n $checkForEndOfAgreement=false;\r\n }\r\n else if ($input['futurePayStatusChange']=='Merchant Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Merchant';\r\n }\r\n else if ($input['futurePayStatusChange']=='Customer Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Donor';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized FuturePay operation. input=\".print_r($input,true));\r\n return false;\r\n }\r\n $recur->save();\r\n \r\n if ($input['transStatus']=='Y') {\r\n // create a new contribution for this recurring contribution\r\n $contributionType = $objects['contributionType'];\r\n $contribution = new CRM_Contribute_DAO_Contribution();\r\n $contribution->domain_id = CRM_Core_Config::domainID( );\r\n $contribution->contact_id = $ids[\"contact\"];\r\n $contribution->contribution_type_id = $contributionType->id;\r\n $contribution->contribution_page_id = $ids['contributionPage'];\r\n $contribution->contribution_recur_id = $ids['contributionRecur'];\r\n $contribution->receive_date = $now;\r\n $contribution->invoice_id = md5( uniqid( rand( ), true ) );\r\n $contribution->total_amount = $input[\"amount\"];\r\n $objects['contribution'] =& $contribution;\r\n \r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaciton();\r\n $this->completeTransaction($input,$ids,$objects,$transaction,true);//true=recurring\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }\r\n }",
"public function change_failing_payment_method( $original_order, $renewal_order, $subscription_key ) {\n\t\t$new_customer_id = get_post_meta( $renewal_order->id, '_simplify_customer_id', true );\n\n\t\tupdate_post_meta( $original_order->id, '_simplify_customer_id', $new_customer_id );\n\t}",
"function lb_subscription_set_billing_period($account, $subscription, $billing_period) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($entity, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n if ($account_subscription_data['billing_period'] != $billing_period) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_billing_period'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $billing_period,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}",
"public function create_billing_agreement() {\n\n\t\tif ( ! isset( $_GET['action'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( $_GET['action'] ) {\n\n\t\t\t// create billing agreement for reference transaction.\n\t\t\tcase 'cartflows_ppec_paypal_create_billing_agreement':\n\t\t\t\t// bail if no token.\n\t\t\t\tif ( ! isset( $_GET['token'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// get token to retrieve checkout details with.\n\t\t\t\t$token = esc_attr( $_GET['token'] );\n\t\t\t\t$order_id = intval( $_GET['order_id'] );\n\t\t\t\t$step_id = intval( $_GET['step_id'] );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t$express_checkout_details_response = $this->perform_express_checkout_details_request( $token );\n\n\t\t\t\t\t// Make sure the billing agreement was accepted.\n\t\t\t\t\tif ( 1 == $express_checkout_details_response['BILLINGAGREEMENTACCEPTEDSTATUS'] ) {\n\n\t\t\t\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t\t\t\tif ( is_null( $order ) ) {\n\t\t\t\t\t\t\tthrow new Exception( __( 'Unable to find order for PayPal billing agreement.', 'cartflows-pro' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// we need to process an initial payment.\n\t\t\t\t\t\tif ( $order->get_total() > 0 ) {\n\n\t\t\t\t\t\t\t$billing_agreement_response = $this->perform_express_checkout_request(\n\t\t\t\t\t\t\t\t$token,\n\t\t\t\t\t\t\t\t$order,\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'payment_action' => 'Sale',\n\t\t\t\t\t\t\t\t\t'payer_id' => $this->get_value_from_response( $express_checkout_details_response, 'PAYERID' ),\n\t\t\t\t\t\t\t\t\t'step_id' => $step_id,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $this->has_error_api_response( $billing_agreement_response ) ) {\n\n\t\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->set_payment_method( 'paypal' );\n\n\t\t\t\t\t\t// Store the billing agreement ID on the order and subscriptions.\n\t\t\t\t\t\tupdate_post_meta( wcf_pro()->wc_common->get_order_id( $order ), '_paypal_subscription_id', $this->get_value_from_response( $billing_agreement_response, 'BILLINGAGREEMENTID' ) );\n\n\t\t\t\t\t\t$order->payment_complete( $billing_agreement_response['PAYMENTINFO_0_TRANSACTIONID'] );\n\n\t\t\t\t\t\t$redirect_url = add_query_arg( 'utm_nooverride', '1', $order->get_checkout_order_received_url() );\n\n\t\t\t\t\t\t// redirect customer to order received page.\n\t\t\t\t\t\twp_safe_redirect( esc_url_raw( $redirect_url ) );\n\t\t\t\t\t\texit;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\twp_safe_redirect( wc_get_cart_url() );\n\t\t\t\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t} catch ( Exception $e ) {\n\n\t\t\t\t\twc_add_notice( __( 'An error occurred, please try again or try an alternate form of payment.', 'cartflows-pro' ), 'error' );\n\n\t\t\t\t\twp_redirect( wc_get_cart_url() );\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t}\n\t}"
]
| [
"0.5642252",
"0.55757",
"0.55435115",
"0.5502806",
"0.54807085",
"0.5475747",
"0.5450901",
"0.54300827",
"0.54254454",
"0.542412",
"0.5400753",
"0.5393481",
"0.5390116",
"0.5388922",
"0.5378061",
"0.53779125",
"0.53589946",
"0.5356405",
"0.53406596",
"0.53221995",
"0.52827847",
"0.5282169",
"0.526231",
"0.5256796",
"0.5242167",
"0.5242002",
"0.52304107",
"0.5224355",
"0.52147686",
"0.5211342"
]
| 0.6052091 | 0 |
Construct the object, increasing vehicle count, making a future salt, and setting the vehicle number. | function __construct($weight, $cap, $top_speed = NULL) {
//make a salt for this vehicle's password
$this->vehicle_salt = $this->create_salt();
//set vehicle number and then increment vehicle count
$this->vehicle_number = Vehicle::$vehicle_count++;
//handle initing all general characteristics that all vehicles have
$this->weight = $weight;
$this->capacity = $cap;
//not all vehicles have a hard set top speed, so we let that be NULL
$this->top_speed = $top_speed;
echo "Created new Vehicle, NUMBER: " . Vehicle::$vehicle_count . PHP_EOL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n Vehicle::factory()->count(10)->create();\n\n }",
"function __construct() {\n\n echo $this->wheel_count;\n echo self::$door_count++;\n \n }",
"function __construct() {\n self::$_count++;\n }",
"public function __construct() {\n self::$_compteur++; // Instantiation of the variable $ _counter which belongs to the class so use of self and not $this\n }",
"public function __construct()\n {\n $this->id = rand(1, 10000);\n $this->createCartStructure();\n }",
"function __construct() {\n // initialize things when class is instantiated\n $this->id = rand(100, 1000000);\n echo \"The created animal was assigned an id of \" . $this->id . \"<br>\";\n Animal::$numberOfAnimals+=1;\n }",
"public function run()\n {\n Model::unguard();\n\n VehicleType::factory()->count(2)->create();\n $vehicle = Vehicle::factory()->count(10)->create();\n }",
"public function __construct($num)\n {\n $this->setName();\n \n $this->_stats = array(\n \"tank\" => 0,\n \"hellicopter\" => 0,\n \"airplane\" => 0,\n \"ship\" => 0,\n \"soldier\" => 0\n );\n echo \"<br />Creating army with \" . $num . \" soldiers.. <br />\" . PHP_EOL;\n $this->_numOfSoldiers = $num;\n for ($i = 0; $i < $num; $i++)\n {\n $this->addSoldier();\n }\n }",
"public function __construct() {\n\n\t\t$this->GENFrequency();\n\t\t$this->GENUTCTime();\n\t\t$this->GENModulation();\n\n\t\t$this->coding_rate = \"4/5\";\n\n\t\t$gtwCount = mt_rand(1,4);\n\t\t$this->gateways = [];\n\t\tfor ( $idx = 0; $idx < $gtwCount; $idx++ ) {\n\t\t\t$this->gateways[] = new dummyGatewayMetadata();\n\t\t}\n\t\tif ( 1 === mt_rand(0,1) ) {\n\t\t\t$this->location = new dummyLocation();\n\t\t}\n\n\t}",
"public function __construct($givenNumber){\r\n\t\t\t$this->secretNumber = 4;\r\n\t\t\t$this->publicNumber = $this->secretNumber * $givenNumber;\r\n\t\t\t$this->tellSecrets();\r\n\t\t}",
"public function __construct($count)\n {\n $this->count = $count;\n }",
"public function run()\n {\n Voucher::factory()->count(10)->create();\n }",
"public function run()\n {\n factory(Car::class, count(self::$models))->create()\n ->each(function ($c) {\n $c->models = self::$models[random_int(0, count(self::$models) - 1)];\n $c->save();\n });\n }",
"public function __construct()\n {\n\n $this->count = 10;\n }",
"private function __construct() \n {\n $this->id = random_int(1, 10);\n }",
"public function __construct($name, $initialval = 1, $autounlock = true) {}",
"public function __construct($model = null)\n {\n if ($model) {\n $this->model = $model;\n }\n\n $this->lockID = bin2hex(random_bytes(32));\n }",
"public function __construct()\n {\n $this->rememberIdentifier = bin2hex(random_bytes(32));\n $this->enabled = '0';\n $this->confirmationToken = bin2hex(random_bytes(32));\n }",
"public function __construct($number = 0)\n {\n $this->value = $number;\n echo 'Class Created with Value: ' . $number . '<br>';\n }",
"function __construct($k)\n {\n $this->count = $k + 1;\n }",
"protected function createVehicles($vehicle)\n {\n $vehicleCount = 0;\n if (isset($vehicle['attributes']['validate'])) {\n foreach ($vehicle['attributes']['validate'] as &$validator) {\n if ($validator['type'] === 'php') {\n if (strpos($validator['source'], ':/') === false && strpos($validator['source'], '/') !== 0) {\n $validator['source'] = $this->tplBase . '/' . $validator['source'];\n }\n }\n }\n }\n if (isset($vehicle['attributes']['resolve'])) {\n foreach ($vehicle['attributes']['resolve'] as &$resolver) {\n if ($resolver['type'] === 'php') {\n if (strpos($resolver['source'], ':/') === false && strpos($resolver['source'], '/') !== 0) {\n $resolver['source'] = $this->tplBase . '/' . $resolver['source'];\n }\n }\n }\n }\n switch ($vehicle['vehicle_class']) {\n case '\\\\Teleport\\\\Transport\\\\xPDOObjectVehicle':\n case 'xPDOObjectVehicle':\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n if ($realClass === false) {\n $this->request->log(\"Invalid class {$vehicle['object']['class']} specified; skipping vehicle\");\n break;\n }\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $iterator = $this->modx->getIterator($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n foreach ($iterator as $object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n } elseif (isset($vehicle['object']['data'])) {\n /** @var \\xPDOObject $object */\n $object = $this->modx->newObject($vehicle['object']['class']);\n if ($object instanceof $realClass) {\n $object->fromArray($vehicle['object']['data'], '', true, true);\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOObjectVehicles for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\xPDOCollectionVehicle':\n $objCnt = 0;\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $limit = isset($vehicle['object']['limit']) ? (integer)$vehicle['object']['limit'] : 0;\n if ($limit < 1) {\n $limit = 500;\n }\n $offset = 0;\n $criteria = $this->modx->newQuery($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n if (!isset($vehicle['object']['orderBy']) || !is_array($vehicle['object']['orderBy'])) {\n $pk = (array)$this->modx->getPK($realClass);\n foreach ($pk as &$primaryKey) {\n $primaryKey = $this->modx->escape($primaryKey);\n }\n $orderBy = array_fill_keys($pk, 'ASC');\n } else {\n $orderBy = $vehicle['object']['orderBy'];\n }\n foreach ($orderBy as $by => $direction) {\n $criteria->sortby($by, $direction);\n }\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n while (!empty($set)) {\n foreach ($set as &$object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n }\n if (!empty($set) && $this->package->put($set, $vehicle['attributes'])) {\n $vehicleCount++;\n $objCnt = $objCnt + count($set);\n }\n $offset += $limit;\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOCollectionVehicles with {$objCnt} total objects for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\MySQLVehicle':\n /* collect table names from classes and grab any additional tables/data not listed */\n $modxDatabase = $this->modx->getOption('dbname', null, $this->modx->getOption('database'));\n $modxTablePrefix = $this->modx->getOption('table_prefix', null, '');\n\n $coreTables = array();\n foreach ($vehicle['object']['classes'] as $class) {\n $coreTables[$class] = $this->modx->quote($this->modx->literal($this->modx->getTableName($class)));\n }\n\n $stmt = $this->modx->query(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (\" . implode(',', $coreTables) . \")\");\n $extraTables = $stmt->fetchAll(\\PDO::FETCH_COLUMN);\n\n if (is_array($extraTables) && !empty($extraTables)) {\n $excludeExtraTablePrefix = isset($vehicle['object']['excludeExtraTablePrefix']) && is_array($vehicle['object']['excludeExtraTablePrefix'])\n ? $vehicle['object']['excludeExtraTablePrefix'] : array();\n $excludeExtraTables = isset($vehicle['object']['excludeExtraTables']) && is_array($vehicle['object']['excludeExtraTables'])\n ? $vehicle['object']['excludeExtraTables'] : array();\n foreach ($extraTables as $extraTable) {\n if (in_array($extraTable, $excludeExtraTables)) continue;\n\n $instances = 0;\n $object = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n $attributes = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n\n /* remove modx table_prefix if table starts with it */\n $extraTableName = $extraTable;\n if (!empty($modxTablePrefix) && strpos($extraTableName, $modxTablePrefix) === 0) {\n $extraTableName = substr($extraTableName, strlen($modxTablePrefix));\n $addTablePrefix = true;\n } elseif (!empty($modxTablePrefix) || in_array($extraTableName, $excludeExtraTablePrefix)) {\n $addTablePrefix = false;\n } else {\n $addTablePrefix = true;\n }\n $object['tableName'] = $extraTableName;\n $this->request->log(\"Extracting non-core table {$extraTableName}\");\n\n /* generate the CREATE TABLE statement */\n $stmt = $this->modx->query(\"SHOW CREATE TABLE {$this->modx->escape($extraTable)}\");\n $resultSet = $stmt->fetch(\\PDO::FETCH_NUM);\n $stmt->closeCursor();\n if (isset($resultSet[1])) {\n if ($addTablePrefix) {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\";\n $object['table'] = str_replace(\"CREATE TABLE {$this->modx->escape($extraTable)}\", \"CREATE TABLE {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\", $resultSet[1]);\n } else {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape($extraTableName)}\";\n $object['table'] = $resultSet[1];\n }\n\n /* collect the rows and generate INSERT statements */\n $object['data'] = array();\n $stmt = $this->modx->query(\"SELECT * FROM {$this->modx->escape($extraTable)}\");\n if (!$stmt) {\n $this->request->log(\"Skipping table {$extraTable} as SELECT query failed\");\n break;\n }\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n if ($instances === 0) {\n $fields = implode(', ', array_map(array($this->modx, 'escape'), array_keys($row)));\n }\n $values = array();\n foreach ($row as $key => $value) {\n switch (gettype($value)) {\n case 'string':\n $values[] = $this->modx->quote($value);\n break;\n case 'NULL':\n case 'array':\n case 'object':\n case 'resource':\n case 'unknown type':\n $values[] = 'NULL';\n break;\n default:\n $values[] = (string)$value;\n break;\n }\n }\n $values = implode(', ', $values);\n if ($addTablePrefix) {\n $object['data'][] = \"INSERT INTO {$this->modx->escape('[[++table_prefix]]' . $extraTableName)} ({$fields}) VALUES ({$values})\";\n } else {\n $object['data'][] = \"INSERT INTO {$this->modx->escape($extraTable)} ({$fields}) VALUES ({$values})\";\n }\n $instances++;\n }\n }\n\n if (!$this->package->put($object, $attributes)) {\n $this->request->log(\"Could not package rows for table {$extraTable}\");\n } else {\n $this->request->log(\"Packaged {$instances} rows for non-core table {$extraTable}\");\n $vehicleCount++;\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} {$vehicle['vehicle_class']} vehicles for non-core tables\");\n } else {\n $this->request->log(\"No non-core tables found for packaging\");\n }\n break;\n case 'xPDOScriptVehicle':\n if (isset($vehicle['object']['source'])) {\n if (strpos($vehicle['object']['source'], ':/') === false && strpos($vehicle['object']['source'], '/') !== 0) {\n $vehicle['object']['source'] = $this->tplBase . '/' . $vehicle['object']['source'];\n }\n }\n case 'xPDOFileVehicle':\n case 'xPDOTransportVehicle':\n default:\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } else {\n if ($this->package->put($vehicle['object'], $vehicle['attributes'])) {\n $this->request->log(\"Packaged 1 {$vehicle['vehicle_class']}\" . (isset($vehicle['object']['source'])\n ? \" from {$vehicle['object']['source']}\" : \"\"));\n $vehicleCount++;\n }\n }\n break;\n }\n return $vehicleCount;\n }",
"function __construct(){\n\t self::$all++;\n\t $this->id = self::$all;\n\t}",
"public function __construct( ) {\n $this->setVotes1(0);\n $this->setVotes2(0);\n }",
"public function createNumber(): void\n {\n if ($this->id === null) {\n throw new LogicException('number generator require id');\n }\n $this->number = 1234 + $this->id * 7;\n }",
"public function generateAndSetInvoiceNumber();",
"public function testCarSeed()\n {\n $seedCount = 50;\n $cars = Cars::all();\n $carsCount = count($cars);\n $this->assertEquals($carsCount, $carsCount,\"Before seeding\");\n $statement = \"The count before seeding is \" .$carsCount. \" . \";\n ExampleTest::validate($this,$statement);\n factory(Cars::class, $seedCount)->create();\n $newCars = Cars::all();\n $newCarsCount = count($newCars);\n $this->assertEquals($seedCount, ($newCarsCount - $carsCount),\"After seeding\");\n $statement = \"The total number records is \".$newCarsCount.\". The number of records inserted by DB seed is \" .$seedCount. \" . \";\n ExampleTest::validate($this,$statement);\n }",
"public function __construct()\n {\n $this->_id = new ObjectID;\n $this->secret = uniqid(bin2hex(random_bytes(2)), true);\n }",
"public function run()\n {\n $vehicles = factory( Vehicle::class, 5)->create();\n }",
"public function __construct()\n {\n //generate identifier only once, here a 64 characters length code\n $this->code = substr(hash('sha512', bin2hex(openssl_random_pseudo_bytes(64))), 0, 64);\n }",
"function __construct() {\n\t\t//Generate a random id between 1 and 1000000\n\t\t$this->id = rand(100, 1000000);\n\n\t\techo $this->id . \" has been assigned</br>\";\n\n\t\t//You access static attributes with Class::$static_att\n\n\t\tAnimal::$number_of_animals++;\n\t}"
]
| [
"0.59956527",
"0.57472825",
"0.56817096",
"0.56410927",
"0.56385684",
"0.5559427",
"0.55009264",
"0.5380114",
"0.5366548",
"0.52731806",
"0.52660185",
"0.5260278",
"0.5251112",
"0.52493083",
"0.5246661",
"0.5173989",
"0.516852",
"0.5138927",
"0.51358205",
"0.5114065",
"0.510486",
"0.51038826",
"0.5102882",
"0.5101872",
"0.5075987",
"0.5073203",
"0.5065561",
"0.50562096",
"0.5019165",
"0.50076795"
]
| 0.6851982 | 0 |
Increase the vehicle's speed by providing an acceleration rate (m/s^2) and a duration (s). Also going to pretend there is no friction. | public function accelerate($rate, $duration) {
//make sure engine is on
if (!$this->engine_on) {
echo PHP_EOL;
$this->action("ERROR: Engine not on! Start vehicle first!");
return;
}
//engine is on, go!
//if $rate is negative, pass it off to decelerate
if ($rate < 0) {
$this->decelerate(abs($rate), $duration);
return;
}
echo PHP_EOL;
$speed_increase = $rate * $duration;
//tell us what's happening
$this->action(
"is accelerating by {$rate}m/s^2 for $duration seconds for a total speed increase of: {$speed_increase}m/s"
);
if ($this->current_speed + $speed_increase >= $this->top_speed){
$this->action("has reached its top speed of: {$this->top_speed}m/s");
$this->current_speed = $this->top_speed;
}
else {
$this->current_speed += $speed_increase;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function accelerate(float $velocity): void\n {\n if ($velocity < 0) {\n throw new InvalidArgumentException('Accelerating must be positive velocity.', E_ERROR);\n }\n $this->setVelocity($this->getVelocity() + $velocity);\n }",
"public function Accelerate($mphIncrease)\r\n {\r\n echo \"<b><u>Command Received: Accelerate by \" . $mphIncrease . \"mph</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Accelerating by \" . $mphIncrease . \"<br />\";\r\n $this->speed = $this->speed + $mphIncrease;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function change_speed($speed) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n\r\n //engine is on, go!\r\n echo PHP_EOL;\r\n $this->action(\"is changing speed to $speed\");\r\n\r\n //get difference in desired and current speed, use it to get rate, we\r\n // will always use a duration of 5 seconds.\r\n $diff = abs($this->current_speed - $speed);\r\n $dura = 5;\r\n $rate = $diff / $dura;\r\n\r\n //figure out if we're acceling or deceling\r\n if ($speed > $this->current_speed) {\r\n $this->accelerate($rate, $dura);\r\n }\r\n else {\r\n $this->decelerate($rate, $dura);\r\n }\r\n }",
"public function setSpeedAttribute(float $speed): void\n {\n $this->attributes['speed'] = $speed;\n }",
"public function setSpeed($value)\n {\n return $this->set(self::SPEED, $value);\n }",
"public function decelerate(float $velocity): void\n {\n if ($velocity > 0) {\n throw new InvalidArgumentException('Accelerating must be negative velocity.', E_ERROR);\n }\n $this->setVelocity($this->getVelocity() + $velocity);\n }",
"public function decelerate($rate, $duration) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n //engine is on, go!\r\n\r\n //if $rate is negative, pass it off to accelerate\r\n if ($rate < 0) {\r\n $this->accelerate(abs($rate), $duration);\r\n return;\r\n }\r\n echo PHP_EOL;\r\n\r\n $speed_decrease = $rate * $duration;\r\n\r\n //tell us what's happening\r\n $this->action(\r\n \"is decelerating by {$rate}m/s^2 for $duration seconds for a total speed decrease of: {$speed_decrease}m/s\"\r\n );\r\n\r\n if ($this->current_speed - $speed_decrease <= 0) {\r\n $this->action(\"has reach a speed of 0 m/s and has stopped\");\r\n $this->current_speed = 0;\r\n }\r\n else {\r\n $this->current_speed -= $speed_decrease;\r\n }\r\n }",
"private function setVelocity(float $velocity): void\n {\n $this->velocity = $velocity;\n $this->notify(CarObserver::VELOCITY);\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }",
"public function setSpeed($value){\n\t\t$value = (int) $value;\n\t\tif ($value < 28) $value=28;\n\t\tif ($value > 128) $value=128;\n\t\t$this->_sendPacketToController(self::SET_SPEED, pack('C', $value));\n\t\treturn $this->_getResponse();\n\t}",
"public function setSpeed($speed)\n {\n $this->speed = $speed;\n return $this;\n }",
"public function setSpeed($speed = 3)\n {\n if ($speed < 0 || $speed > 6) {\n $speed = 3;\n }\n $command = 'S'. $speed . self::CRLF;\n $this->device->buffer .= $command;\n return $command;\n }",
"public function getSpeedAttribute(): float\n {\n return $this->attributes['speed'];\n }",
"public function getSpeed(): float\n {\n return $this->speed;\n }",
"public function setProduceSpeed($value)\n {\n return $this->set(self::_PRODUCE_SPEED, $value);\n }",
"public function getSpeed()\r\n {\r\n return $this->speed;\r\n }",
"public function setAccelerationPeriod($period)\n {\n $payload = '';\n $payload .= pack('V', $period);\n\n $this->sendRequest(self::FUNCTION_SET_ACCELERATION_PERIOD, $payload);\n }",
"public function setSpeedUnit($speedUnit) {\n $this->cSpeedUnit = $speedUnit;\n $this->cLatestObservations.setOutputWindSpUnit($speedUnit);\n }",
"public function Decelerate($mphDecrease)\r\n {\r\n echo \"<b><u>Command Received: Decelerate by \" . $mphDecrease . \"mph</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Decelerating by \" . $mphDecrease . \"<br />\";\r\n $this->speed = $this->speed - $mphDecrease;\r\n if($this->speed < 0){$this->speed = 0;}\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function duration($duration) {\n $this->duration = $duration;\n }",
"public function accelerate()\n {\n }",
"public function CurrentSpeed()\r\n {\r\n echo \"<b><u>Command Received: Display Speed</b></u><br />\";\r\n echo $this->carName . \" is traveling at \" . $this->speed . \" mph.<br />\";\r\n }",
"public function getSpeed(): float\n {\n $elapsed = $this->getSecondsElapsed();\n if (0 === $elapsed) {\n return 0.0;\n }\n return $this->value / $elapsed;\n }",
"public function getSpeedUnit() {\n return $this->cSpeedUnit;\n }",
"public function setMaxSpeed($val){\n $this->maxSpeed = $val;\n return $this;\n }",
"public function setDuration(float $duration) {\n $this->transaction->setDuration($duration);\n }",
"public function setInputSpeedUnit($inputSpeedUnit) {\n $this->cInputSpeedUnit = $inputSpeedUnit;\n $this->cLatestObservations.setInputWindSpUnit($inputSpeedUnit);\n }",
"public function setDuration(int $duration): void\n {\n $this->duration = $duration;\n }",
"public function setFilmSpeed( FilmSpeedInterface $filmspeed );"
]
| [
"0.6875982",
"0.68017757",
"0.6493758",
"0.64079857",
"0.6100264",
"0.6085745",
"0.60552675",
"0.6003016",
"0.58228856",
"0.5781426",
"0.56494397",
"0.5447254",
"0.5357371",
"0.5354695",
"0.5316456",
"0.52345675",
"0.51513916",
"0.5142515",
"0.508259",
"0.5073991",
"0.50125396",
"0.4986729",
"0.49390125",
"0.49053866",
"0.48876223",
"0.4887501",
"0.4848832",
"0.48182547",
"0.4816653",
"0.48045674"
]
| 0.7384996 | 0 |
Decrease the vehicle's speed by providing an acceleration rate (m/s^2) and a duration (s). If the rate is negative, pass it to acceleration (negative deceleration == acceleration) | public function decelerate($rate, $duration) {
//make sure engine is on
if (!$this->engine_on) {
echo PHP_EOL;
$this->action("ERROR: Engine not on! Start vehicle first!");
return;
}
//engine is on, go!
//if $rate is negative, pass it off to accelerate
if ($rate < 0) {
$this->accelerate(abs($rate), $duration);
return;
}
echo PHP_EOL;
$speed_decrease = $rate * $duration;
//tell us what's happening
$this->action(
"is decelerating by {$rate}m/s^2 for $duration seconds for a total speed decrease of: {$speed_decrease}m/s"
);
if ($this->current_speed - $speed_decrease <= 0) {
$this->action("has reach a speed of 0 m/s and has stopped");
$this->current_speed = 0;
}
else {
$this->current_speed -= $speed_decrease;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function Decelerate($mphDecrease)\r\n {\r\n echo \"<b><u>Command Received: Decelerate by \" . $mphDecrease . \"mph</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Decelerating by \" . $mphDecrease . \"<br />\";\r\n $this->speed = $this->speed - $mphDecrease;\r\n if($this->speed < 0){$this->speed = 0;}\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function accelerate($rate, $duration) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n\r\n //engine is on, go!\r\n\r\n //if $rate is negative, pass it off to decelerate\r\n if ($rate < 0) {\r\n $this->decelerate(abs($rate), $duration);\r\n return;\r\n }\r\n echo PHP_EOL;\r\n\r\n $speed_increase = $rate * $duration;\r\n\r\n //tell us what's happening\r\n $this->action(\r\n \"is accelerating by {$rate}m/s^2 for $duration seconds for a total speed increase of: {$speed_increase}m/s\"\r\n );\r\n\r\n if ($this->current_speed + $speed_increase >= $this->top_speed){\r\n $this->action(\"has reached its top speed of: {$this->top_speed}m/s\");\r\n $this->current_speed = $this->top_speed;\r\n }\r\n else {\r\n $this->current_speed += $speed_increase;\r\n }\r\n }",
"public function decelerate(float $velocity): void\n {\n if ($velocity > 0) {\n throw new InvalidArgumentException('Accelerating must be negative velocity.', E_ERROR);\n }\n $this->setVelocity($this->getVelocity() + $velocity);\n }",
"public function change_speed($speed) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n\r\n //engine is on, go!\r\n echo PHP_EOL;\r\n $this->action(\"is changing speed to $speed\");\r\n\r\n //get difference in desired and current speed, use it to get rate, we\r\n // will always use a duration of 5 seconds.\r\n $diff = abs($this->current_speed - $speed);\r\n $dura = 5;\r\n $rate = $diff / $dura;\r\n\r\n //figure out if we're acceling or deceling\r\n if ($speed > $this->current_speed) {\r\n $this->accelerate($rate, $dura);\r\n }\r\n else {\r\n $this->decelerate($rate, $dura);\r\n }\r\n }",
"public function Stop()\r\n {\r\n echo \"<b><u>Command Received: Stop Vehicle</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Stopping...<br />\";\r\n $this->speed = 0;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function Accelerate($mphIncrease)\r\n {\r\n echo \"<b><u>Command Received: Accelerate by \" . $mphIncrease . \"mph</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Accelerating by \" . $mphIncrease . \"<br />\";\r\n $this->speed = $this->speed + $mphIncrease;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function accelerate(float $velocity): void\n {\n if ($velocity < 0) {\n throw new InvalidArgumentException('Accelerating must be positive velocity.', E_ERROR);\n }\n $this->setVelocity($this->getVelocity() + $velocity);\n }",
"public function decreaseAmount(): void;",
"public function discharging(float $seconds): void\n {\n $this->capacity = 1 - ($seconds / $this->getMaxWorkingTime());\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }",
"public function decrement(LaramoreModel $model, $value, $decrement=1);",
"public static function decrement($key, $rate = null) {\r\n self::count($key, -1, $rate);\r\n }",
"public function setSpeed($value)\n {\n return $this->set(self::SPEED, $value);\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }",
"public static function stop(): float\n {\n $elapsed = static::elapsed();\n\n static::clear();\n\n return $elapsed;\n }",
"public function destroy(AirlineRate $airlineRate)\n {\n //\n }",
"public static function destroyDuration();",
"public function getSpeed(): float\n {\n return $this->speed;\n }",
"public function unRate()\n {\n\n }",
"public function setMaxSpeed($val){\n $this->maxSpeed = $val;\n return $this;\n }",
"public function getSpeedAttribute(): float\n {\n return $this->attributes['speed'];\n }",
"public function setDuration(float $duration) {\n $this->transaction->setDuration($duration);\n }",
"public function setSpeedAttribute(float $speed): void\n {\n $this->attributes['speed'] = $speed;\n }",
"public function setDuration($value)\n {\n $this->duration = $value;\n }",
"public static function decrement($stats, $sampleRate=1) {\n\t\tStatsD::updateStats($stats, -1, $sampleRate, 'c');\n\t}",
"public function getDuration(): float;",
"function revItUp($x) {\r\n return $this->speedometer + 5; \r\n }",
"function stop_timing() {\n $this->time = number_format(microtime(true) - $this->start_time, 3);\n }",
"public function getSpeed()\r\n {\r\n return $this->speed;\r\n }",
"public function getVelocity(): float\n {\n return $this->velocity;\n }"
]
| [
"0.6706126",
"0.63894016",
"0.6351853",
"0.54388183",
"0.5437738",
"0.5421077",
"0.5198288",
"0.514183",
"0.50479466",
"0.50055534",
"0.49584106",
"0.49565533",
"0.4935635",
"0.49083826",
"0.48947474",
"0.48320657",
"0.48265338",
"0.48130295",
"0.47844753",
"0.47628754",
"0.4753481",
"0.47372302",
"0.47332588",
"0.47330344",
"0.47303456",
"0.472865",
"0.47240958",
"0.4624372",
"0.46006164",
"0.45848656"
]
| 0.7851707 | 0 |
Provide a method for a vehicle to change its speed to one passed in, will still accelerate or decelerate though because we can't just magically change speed. | public function change_speed($speed) {
//make sure engine is on
if (!$this->engine_on) {
echo PHP_EOL;
$this->action("ERROR: Engine not on! Start vehicle first!");
return;
}
//engine is on, go!
echo PHP_EOL;
$this->action("is changing speed to $speed");
//get difference in desired and current speed, use it to get rate, we
// will always use a duration of 5 seconds.
$diff = abs($this->current_speed - $speed);
$dura = 5;
$rate = $diff / $dura;
//figure out if we're acceling or deceling
if ($speed > $this->current_speed) {
$this->accelerate($rate, $dura);
}
else {
$this->decelerate($rate, $dura);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSpeed($value)\n {\n return $this->set(self::SPEED, $value);\n }",
"public function setSpeedAttribute(float $speed): void\n {\n $this->attributes['speed'] = $speed;\n }",
"public function setSpeed($speed)\n {\n $this->speed = $speed;\n return $this;\n }",
"public function Accelerate($mphIncrease)\r\n {\r\n echo \"<b><u>Command Received: Accelerate by \" . $mphIncrease . \"mph</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Accelerating by \" . $mphIncrease . \"<br />\";\r\n $this->speed = $this->speed + $mphIncrease;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }",
"public function getSpeed()\r\n {\r\n return $this->speed;\r\n }",
"public function setSpeed($value){\n\t\t$value = (int) $value;\n\t\tif ($value < 28) $value=28;\n\t\tif ($value > 128) $value=128;\n\t\t$this->_sendPacketToController(self::SET_SPEED, pack('C', $value));\n\t\treturn $this->_getResponse();\n\t}",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }",
"public function getSpeed(): float\n {\n return $this->speed;\n }",
"public function accelerate($rate, $duration) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n\r\n //engine is on, go!\r\n\r\n //if $rate is negative, pass it off to decelerate\r\n if ($rate < 0) {\r\n $this->decelerate(abs($rate), $duration);\r\n return;\r\n }\r\n echo PHP_EOL;\r\n\r\n $speed_increase = $rate * $duration;\r\n\r\n //tell us what's happening\r\n $this->action(\r\n \"is accelerating by {$rate}m/s^2 for $duration seconds for a total speed increase of: {$speed_increase}m/s\"\r\n );\r\n\r\n if ($this->current_speed + $speed_increase >= $this->top_speed){\r\n $this->action(\"has reached its top speed of: {$this->top_speed}m/s\");\r\n $this->current_speed = $this->top_speed;\r\n }\r\n else {\r\n $this->current_speed += $speed_increase;\r\n }\r\n }",
"public function setSpeed($speed = 3)\n {\n if ($speed < 0 || $speed > 6) {\n $speed = 3;\n }\n $command = 'S'. $speed . self::CRLF;\n $this->device->buffer .= $command;\n return $command;\n }",
"public function CurrentSpeed()\r\n {\r\n echo \"<b><u>Command Received: Display Speed</b></u><br />\";\r\n echo $this->carName . \" is traveling at \" . $this->speed . \" mph.<br />\";\r\n }",
"public function getSpeedAttribute(): float\n {\n return $this->attributes['speed'];\n }",
"public function getSpeedUnit() {\n return $this->cSpeedUnit;\n }",
"private function setVelocity(float $velocity): void\n {\n $this->velocity = $velocity;\n $this->notify(CarObserver::VELOCITY);\n }",
"public function setSpeedUnit($speedUnit) {\n $this->cSpeedUnit = $speedUnit;\n $this->cLatestObservations.setOutputWindSpUnit($speedUnit);\n }",
"public function setMaxSpeed($val){\n $this->maxSpeed = $val;\n return $this;\n }",
"public function get_speed() {\r\n echo PHP_EOL;\r\n $this->action(\"checking current speed\");\r\n $this->action(\"current speed is: {$this->current_speed}\");\r\n }",
"public function accelerate(float $velocity): void\n {\n if ($velocity < 0) {\n throw new InvalidArgumentException('Accelerating must be positive velocity.', E_ERROR);\n }\n $this->setVelocity($this->getVelocity() + $velocity);\n }",
"public function setProduceSpeed($value)\n {\n return $this->set(self::_PRODUCE_SPEED, $value);\n }",
"public function accelerate()\n {\n }",
"public function setMaxSpeed(int $maxSpeed) : void\n {\n $this->maxSpeed = $maxSpeed;\n }",
"public function getSpeed(): float\n {\n $elapsed = $this->getSecondsElapsed();\n if (0 === $elapsed) {\n return 0.0;\n }\n return $this->value / $elapsed;\n }",
"public function setInputSpeedUnit($inputSpeedUnit) {\n $this->cInputSpeedUnit = $inputSpeedUnit;\n $this->cLatestObservations.setInputWindSpUnit($inputSpeedUnit);\n }",
"public function setSpeed(int $row)\n {\n $this->checkRow($row);\n\n $payload = $this->processor->getPayload();\n\n if (!isset($payload['speed'])) {\n throw new NotAllowedParameterException('The parameter must be integer');\n }\n\n $this->redis->set('message' . $row . '_scroll_speed', $payload['speed']);\n $this->setStatus(false);\n\n return $this->processor->makeJsonResponse(true, []);\n }",
"public function getSpeed()\n {\n $value = $this->get(self::SPEED);\n return $value === null ? (integer)$value : $value;\n }",
"public function getSpeed() {\n $speed = $GLOBALS['max_speed_mph']*(1-$this->getCarSize()/(2000*$this->distance));\n return $speed;\n if($this->getCarSize() == 0)\n return $GLOBALS['max_speed_mph'];\n $v = $this->getCarsPerHour();\n $d = $this->getCarSize() / $this->distance;\n $s = $v / $d;\n return $s > $GLOBALS['max_speed_mph'] ? $GLOBALS['max_speed_mph'] : $s;\n }",
"function setSpeed($down = NULL, $up = NULL)\n{\n $append = \"\";\n \n if($down != NULL)\n $append.=' -d'.$down;\n else if($down == 0)\n $append.=' -D';\n \n if($up != NULL)\n $append.=' -u'.$up;\n else if($up == 0)\n $append.=' -U';\n \n return generateQuery($append);\n \n}",
"public function getWindSpeed();",
"public function decelerate($rate, $duration) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n //engine is on, go!\r\n\r\n //if $rate is negative, pass it off to accelerate\r\n if ($rate < 0) {\r\n $this->accelerate(abs($rate), $duration);\r\n return;\r\n }\r\n echo PHP_EOL;\r\n\r\n $speed_decrease = $rate * $duration;\r\n\r\n //tell us what's happening\r\n $this->action(\r\n \"is decelerating by {$rate}m/s^2 for $duration seconds for a total speed decrease of: {$speed_decrease}m/s\"\r\n );\r\n\r\n if ($this->current_speed - $speed_decrease <= 0) {\r\n $this->action(\"has reach a speed of 0 m/s and has stopped\");\r\n $this->current_speed = 0;\r\n }\r\n else {\r\n $this->current_speed -= $speed_decrease;\r\n }\r\n }"
]
| [
"0.69849366",
"0.67787296",
"0.6470276",
"0.63673824",
"0.63160217",
"0.62928694",
"0.6292402",
"0.6231505",
"0.6197077",
"0.603632",
"0.60068953",
"0.5987028",
"0.5977294",
"0.592089",
"0.5888272",
"0.58835876",
"0.58236545",
"0.57961965",
"0.56930697",
"0.5689779",
"0.55722094",
"0.5453022",
"0.54371285",
"0.54206496",
"0.54004",
"0.5388831",
"0.538132",
"0.5295131",
"0.52756304",
"0.52739924"
]
| 0.735738 | 0 |
Very simple function that will make changes to the direction variable that correspond to the vehicle moving to the left. We will implement it as a method so child classes do not need to know how to manipulate direction in order to use turns. We can check to see if the engine is on here instead of making child classes check in their turn code. | protected function left($deg) {
//make sure engine is on
if (!$this->engine_on) {
echo PHP_EOL;
$this->action("LEFT TURN ERROR: Engine not on! Start vehicle first!");
return;
}
//it is, go
$this->direction -= $deg;
//keep the direction ranging between 0 and 360 so it's easy to figure out where we're
// facing
if ($this->direction < 0) {
$this->direction += 360;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function turnLeft(string $direction): string\n {\n return match ($direction) {\n DIRECTION_NORTH => DIRECTION_WEST,\n DIRECTION_EAST => DIRECTION_NORTH,\n DIRECTION_SOUTH => DIRECTION_EAST,\n DIRECTION_WEST => DIRECTION_SOUTH,\n };\n }",
"function change_direction($current_dir,$turn){\r\n\tglobal $NORTH,$SOUTH,$EAST,$WEST;\r\n\t\r\n\tif($current_dir == $NORTH && $turn == \"L\"){\r\n\t\treturn $WEST;\r\n\t}\r\n\tif($current_dir == $NORTH && $turn == \"R\"){\r\n\t\treturn $EAST;\r\n\t}\r\n\t\r\n\tif($current_dir == $SOUTH && $turn == \"L\"){\r\n\t\treturn $EAST;\r\n\t}\r\n\tif($current_dir == $SOUTH && $turn == \"R\"){\r\n\t\treturn $WEST;\r\n\t}\r\n\t\r\n\tif($current_dir == $EAST && $turn == \"L\"){\r\n\t\treturn $NORTH;\r\n\t}\r\n\tif($current_dir == $EAST && $turn == \"R\"){\r\n\t\treturn $SOUTH;\r\n\t}\r\n\t\r\n\tif($current_dir == $WEST && $turn == \"L\"){\r\n\t\treturn $SOUTH;\r\n\t}\r\n\tif($current_dir == $WEST && $turn == \"R\"){\r\n\t\treturn $NORTH;\r\n\t}\r\n\t\r\n}",
"public function moveLeft() : Tetris {\n // check if the block can be moved to the left\n if ($this->block->canMove('left')) {\n // move the block to the left\n $this->block->setX($this->block->getX() - 1);\n }\n\n // return the game for chained method calling\n return $this;\n }",
"abstract public function moveLeft($id);",
"public function turnRight();",
"private function turn($direction) {\n if ($this->facing === 'N') {\n // Currently facing North.\n $this->facing = ($direction === 'L' ? 'W' : 'E');\n } else if ($this->facing === 'E') {\n // Currently facing East.\n $this->facing = ($direction === 'L' ? 'N' : 'S');\n } else if ($this->facing === 'S') {\n // Currently facing South.\n $this->facing = ($direction === 'L' ? 'E' : 'W');\n } else if ($this->facing === 'W') {\n // Currently facing South.\n $this->facing = ($direction === 'L' ? 'S' : 'N');\n }\n }",
"public function moveForward ();",
"function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }",
"public function rotateLeft();",
"public function incrTurnsLeft($increment) {\n $this->setTurnsLeft($this->getTurnsLeft() + $increment);\n }",
"public function getDirection() {}",
"private function changeTurn()\n {\n $this->_turn = 1 - $this->_turn; // 1-0 = 1, 1-1 = 0\n }",
"function getLeft() ;",
"public function getDirection();",
"public function getDirection();",
"public function getDirection();",
"public function isLeftHanded()\n {\n return $this->leftHanded;\n }",
"private function changeDirection(string $command)\n {\n switch ($command) {\n case 'TL':\n if ('E' === $this->currentDirection) {\n $this->currentDirection = 'N';\n } elseif ('N' === $this->currentDirection) {\n $this->currentDirection = 'W';\n } elseif ('W' === $this->currentDirection) {\n $this->currentDirection = 'S';\n } elseif ('S' === $this->currentDirection) {\n $this->currentDirection = 'E';\n }\n break;\n case 'TR':\n if ('E' === $this->currentDirection) {\n $this->currentDirection = 'S';\n } elseif ('N' === $this->currentDirection) {\n $this->currentDirection = 'E';\n } elseif ('W' === $this->currentDirection) {\n $this->currentDirection = 'N';\n } elseif ('S' === $this->currentDirection) {\n $this->currentDirection = 'W';\n }\n break;\n }\n }",
"public function getLeft() {}",
"public function toLeft($right);",
"public function getTurnsLeft()\n {\n return $this->turnsLeft;\n }",
"public function get_direction() {\r\n echo PHP_EOL;\r\n $this->action(\"checking current direction\");\r\n //can easily display the degree, and will, but also do cardinal\r\n\r\n //since North is direction's \"origin\", it occurs when $direction == 0\r\n if ($this->direction == 0) {\r\n $this->action(\"is facing true north\");\r\n }\r\n //other cases are easily handled as well\r\n else {\r\n $this->action(\"is facing {$this->direction}° clockwise from true north\");\r\n if ($this->direction < 90) {\r\n $this->action(\"is facing north east\");\r\n }\r\n //we rotate clockwise, this is east\r\n elseif ($this->direction == 90) {\r\n $this->action(\"is facing east\");\r\n }\r\n elseif ($this->direction < 180) {\r\n $this->action(\"is facing south east\");\r\n }\r\n elseif ($this->direction == 180) {\r\n $this->action(\"is facing south\");\r\n }\r\n elseif ($this->direction < 270) {\r\n $this->action(\"is facing south west\");\r\n }\r\n elseif ($this->direction == 270) {\r\n $this->action(\"is facing west\");\r\n }\r\n else {\r\n //direction must be greater than 270. 360 resets the direction\r\n // back to zero, so first if will catch it, thus we are facing NW\r\n $this->action(\"is facing north west\");\r\n }\r\n }\r\n }",
"public function setDirection($value) {\r\n $this->direction = $value;\r\n }",
"public function turn()\n {\n }",
"public function commandTurn(string $command): Mover\n {\n $this->roverDirection = match ($command) {\n COMMAND_LEFT => self::turnLeft($this->roverDirection),\n COMMAND_RIGHT => self::turnRight($this->roverDirection),\n };\n\n return $this;\n }",
"public function getDirection(): string;",
"public function getLeftSide() {\n return $this->left;\n }",
"public function setDirection($direction);",
"public function setOnlyLeft()\n {\n $this->value['text-align'] = 'left';\n $this->_onlyLeft = true;\n }",
"public function treeMove($direction) {\n\t\t$model = $this->Controller->modelClass;\n\t\t$check = $this->Controller->{$model}->find('first', array(\n\t\t\t'fields' => array($model . '.id'),\n\t\t\t'conditions' => array($model . '.id' => $this->Controller->data[$model]['id']),\n\t\t\t'recursive' => -1,\n\t\t\t'callbacks' => false\n\t\t));\n\n\t\tif (empty($check[$model]['id'])) {\n\t\t\t$this->Controller->notice(__d('libs', 'Nothing found to move'), array(\n\t\t\t\t'redirect' => false\n\t\t\t));\n\t\t\treturn false;\n\t\t}\n\n\t\t$message = __d('libs', 'Error occured reordering the records');\n\t\tswitch(strtolower($direction)) {\n\t\t\tcase 'up':\n\t\t\t\t$message = __d('libs', 'The record was moved up');\n\t\t\t\tif (!$this->Controller->{$model}->moveUp($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record up');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'down':\n\t\t\t\t$message = __d('libs', 'The record was moved down');\n\t\t\t\tif (!$this->Controller->{$model}->moveDown($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record down');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->Controller->notice($message, array('redirect' => false));\n\n\t\treturn true;\n\t}"
]
| [
"0.6504182",
"0.63857794",
"0.62435335",
"0.59912705",
"0.5983712",
"0.59518814",
"0.5796274",
"0.57881474",
"0.5717177",
"0.5519405",
"0.5495452",
"0.5490135",
"0.54313177",
"0.53608954",
"0.53608954",
"0.53608954",
"0.53417546",
"0.5336825",
"0.5331397",
"0.5253875",
"0.5226874",
"0.5226459",
"0.5193433",
"0.5144372",
"0.5143261",
"0.51334894",
"0.51319283",
"0.5130632",
"0.5101083",
"0.5098068"
]
| 0.69137794 | 0 |
Turn the vehicle's windshield wipers on and say so | public function wipers_on() {
echo PHP_EOL;
$this->action("turning windshield wipers on");
$this->wipers_on = TRUE;
$this->action("windshield wipers are on");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function wipers_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers off\");\r\n $this->wipers_on = FALSE;\r\n $this->action(\"windshield wipers are off\");\r\n }",
"public function check_wipers() {\r\n echo PHP_EOL;\r\n $this->action(\"checking wipers\");\r\n $this->action($this->wipers_on ? \"windshield wipers are on\" : \"windshield wipers are off\");\r\n }",
"public function switchOn();",
"public function headlights_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights on\");\r\n $this->lights_on = TRUE;\r\n $this->action(\"headlights are on\");\r\n }",
"public function ledsOn()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_LEDS_ON, $payload);\n }",
"private function ledOn()\n {\n $this->ledPin->setValue(PinInterface::VALUE_HIGH);\n }",
"public function setElectricTeamFrontWindshieldWipers($value) {\n switch ($value) {\n case 0 :\n return 0;\n break;\n case 6 :\n return 10;\n break;\n }\n }",
"public function powerUp()\n {\n if ($this->motor_power)\n $this->motor_power->setValue(1);\n }",
"public function setWind( Wind $wind ) {\n $this->wind = $wind;\n }",
"public function turn_on()\n {\n $this->testing = TRUE;\n }",
"public function walkDoors()\n {\n for($i = 1; $i <= self::NUMBER_OF_WALKS; $i++)\n {\n foreach ($this->doors as $door)\n {\n if ($door->getNumber() % $i === 0)\n {\n $door->toggle();\n }\n }\n }\n }",
"public function check_headlights() {\r\n echo PHP_EOL;\r\n $this->action(\"checking headlights\");\r\n $this->action($this->lights_on ? \"headlights are on\" : \"headlights are off\");\r\n }",
"public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }",
"public function setW($dw) {}",
"public function startPowerUnits() {\n\t\techo \"power units started.<br>\";\n\t\t$this->missionControl->setState($this->missionControl->getRetractArms());\n\t}",
"public function turn()\n {\n }",
"public function turnOn(){\n\t\treturn \"Turn On executed\";\n\t}",
"function eis_device_poweron() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// do nothing\n\treturn true;\n}",
"public function SwitchLight($id)\n {\n if ( !array_key_exists($id, $this->rooms)){\n throw new Exception(\"Nie ma takiego pomieszczenia\", 1);\n }\n $pin = $this->rooms[$id];\n if ($this->RelayStat($pin)) {\n $this->RelayOff($pin);\n }\n else {\n $this->RelayOn($pin);\n }\n }",
"public function setPower()\n {\n $this->_role->power = 200;\n }",
"public function ability() {\n\n $this->startMove(3, 0.2);\n echo \"THE ENGINE IS OVERHEATED!\\n\";\n $this->switchEngine();\n\n\n\n\n }",
"public function getWind() {\n\n return $this->wind;\n }",
"public function turnOn($light,$brightness=255)\r\n {\r\n $lightname = $light;\r\n $light = $this->bulbNameToID($light);\r\n $isgroup = 'NO';\r\n $data = '<?xml version=\"1.0\"?>\r\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <s:Body>\r\n <u:SetDeviceStatus xmlns:u=\"urn:Belkin:service:bridge:1\">\r\n <DeviceStatusList><?xml version="1.0" encoding="UTF-8"?><DeviceStatus><DeviceID>'.$light.'</DeviceID><CapabilityID>10008</CapabilityID><CapabilityValue>'.$brightness.':0</CapabilityValue><IsGroupAction>'.$isgroup.'</IsGroupAction></DeviceStatus></DeviceStatusList>\r\n </u:SetDeviceStatus>\r\n </s:Body>\r\n </s:Envelope>';\r\n $headers_array = array(\r\n 'Content-type: text/xml; charset=\"utf-8\"',\r\n 'SOAPACTION: \"urn:Belkin:service:bridge:1#SetDeviceStatus\"',\r\n 'Accept: ',\r\n );\r\n $url = \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/upnp/control/bridge1\";\r\n $response = $this->sendCurl($url,$data,$headers_array);\r\n $this->getStatus($lightname);\r\n }",
"public function getWindSpeed();",
"public function enable();",
"public function enable();",
"protected function get_wind( ) {\n// Format is dddssKT where ddd = degrees from North, ss = speed, KT for knots,\n// or dddssGggKT where G stands for gust and gg = gust speed. (ss or gg can be a 3-digit number.)\n// KT can be replaced with MPH for meters per second or KMH for kilometers per hour.\n\n if (preg_match('#^([0-9G]{5,10}|VRB[0-9]{2,3})(KT|MPS|KMH)$#',$this->current_group_text,$pieces)) {\n $this->wxInfo['ITEMS'][$this->tend]['CODE_WIND'] = $this->current_group_text;\n $this->current_group_text = $pieces[1];\n $unit = $pieces[2];\n if ($this->current_group_text == '00000') {\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = '0'; // no wind\n }\n else {\n preg_match('#([0-9]{3}|VRB)([0-9]{2,3})G?([0-9]{2,3})?#',$this->current_group_text,$pieces);\n if ($pieces[1] == 'VRB') {\n $direction = 'VAR';\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n }\n else {\n $angle = (integer) $pieces[1];\n $compass = array('N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW');\n $direction = $compass[round($angle / 22.5) % 16];\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION'] = round($angle / 22.5)*22.5;\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n// $this->wxInfo['WIND_DIRECTION_TEXT'] =round($angle / 22.5);\n }\n\n if (isset($pieces[3]) && trim($pieces[3])!='') $this->wxInfo['ITEMS'][$this->tend]['WIND_GUST'] = $this->convertSpeed($pieces[3], $unit);\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = $this->convertSpeed($pieces[2], $unit);\n }\n $this->current_ptr++;\n }\n $this->current_group++;\n }",
"function updateDoorSwitch($dserial, $sserial) {\n\t$query = sprintf(\"UPDATE DoorTriggers SET switchserial=%s WHERE doorserial=%s\",\n\t\tmysql_real_escape_string($sserial),\n\t\tmysql_real_escape_string($dserial)\n\t);\n\t\n\tdb_query($query);\n}",
"public function test() {\r\n //echo LandVehicle::$land_count;\r\n\r\n //test starting the Vehicle and setting the key\r\n $this->start('abc');\r\n $key = '1234ac';\r\n $this->set_password($key);\r\n $this->start(\"abc\");\r\n $this->start($key);\r\n $this->engine_state();\r\n\r\n //get bearings and turn on wipers/headlights\r\n $this->get_direction();\r\n $this->check_headlights();\r\n $this->headlights_on();\r\n $this->wipers_on();\r\n $this->check_wipers();\r\n\r\n //start driving\r\n $this->accelerate(25, 4);\r\n $this->get_speed();\r\n $this->change_speed(1000);\r\n $this->get_speed();\r\n $this->turn_left(180);\r\n $this->get_direction();\r\n $this->turn_right(360);\r\n $this->get_direction();\r\n $this->turn_left(90.4);\r\n $this->get_direction();\r\n $this->turn_right(270.4);\r\n $this->get_direction();\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n //come to a stop after many turns\r\n $this->change_speed(0);\r\n $this->get_speed();\r\n\r\n //ensure we can't get negative speeds\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n $this->engine_state();\r\n //ensure we will stop with current_speed at 0 when stop() is called.\r\n $this->accelerate(50, 2);\r\n $this->stop();\r\n $this->engine_state();\r\n\r\n //one last headlight test\r\n $this->check_headlights();\r\n $this->headlights_off();\r\n }",
"public function activate()\n\t{\n\t\techo \"fight...\\n\";\n\t}"
]
| [
"0.68858397",
"0.67571133",
"0.64585125",
"0.6389512",
"0.6058146",
"0.5924737",
"0.58427685",
"0.58376217",
"0.5661815",
"0.56383085",
"0.5576052",
"0.55307835",
"0.54582673",
"0.54477835",
"0.52952784",
"0.5288335",
"0.5268739",
"0.52103925",
"0.5181608",
"0.51578444",
"0.5092936",
"0.5086808",
"0.50705683",
"0.5056637",
"0.5022211",
"0.5022211",
"0.5019691",
"0.49978495",
"0.4990745",
"0.4984862"
]
| 0.83995223 | 0 |
Turn the vehicle's windshield wipers off and say so | public function wipers_off() {
echo PHP_EOL;
$this->action("turning windshield wipers off");
$this->wipers_on = FALSE;
$this->action("windshield wipers are off");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }",
"public function turnOff() //Einschalten geht nur über WOL! \n { \n $this->lg_handshake();\n $command = '{\"id\":\"turnOff\",\"type\":\"request\",\"uri\":\"ssap://system/turnOff\"}'; \n $this->send_command($command); \n }",
"public function powerDown()\n {\n if ($this->motor_power)\n $this->motor_power->setValue(0);\n }",
"public function wipers_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers on\");\r\n $this->wipers_on = TRUE;\r\n $this->action(\"windshield wipers are on\");\r\n }",
"public function ledsOff()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_LEDS_OFF, $payload);\n }",
"private function ledOff()\n {\n $this->ledPin->setValue(PinInterface::VALUE_LOW);\n }",
"public function shutDoor()\n {\n return false;\n }",
"public function off()\n {\n echo 'The tv is off now.' . PHP_EOL;\n }",
"function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// do nothing\n\treturn true;\n}",
"public function turnOff(){\n\t\treturn \"Turn Off executed\";\n\t}",
"function tideways_disable()\n{\n}",
"public function check_wipers() {\r\n echo PHP_EOL;\r\n $this->action(\"checking wipers\");\r\n $this->action($this->wipers_on ? \"windshield wipers are on\" : \"windshield wipers are off\");\r\n }",
"public function Stop()\r\n {\r\n echo \"<b><u>Command Received: Stop Vehicle</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Stopping...<br />\";\r\n $this->speed = 0;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }",
"public function turnOff($light)\r\n {\r\n $lightname = $light;\r\n $light = $this->bulbNameToID($light);\r\n $isgroup = 'NO';\r\n $data = '<?xml version=\"1.0\"?>\r\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <s:Body>\r\n <u:SetDeviceStatus xmlns:u=\"urn:Belkin:service:bridge:1\">\r\n <DeviceStatusList><?xml version="1.0" encoding="UTF-8"?><DeviceStatus><DeviceID>'.$light.'</DeviceID><CapabilityID>10008</CapabilityID><CapabilityValue>0:0</CapabilityValue><IsGroupAction>'.$isgroup.'</IsGroupAction></DeviceStatus></DeviceStatusList>\r\n </u:SetDeviceStatus>\r\n </s:Body>\r\n </s:Envelope>';\r\n $headers_array = array(\r\n 'Content-type: text/xml; charset=\"utf-8\"',\r\n 'SOAPACTION: \"urn:Belkin:service:bridge:1#SetDeviceStatus\"',\r\n 'Accept: ',\r\n );\r\n $url = \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/upnp/control/bridge1\";\r\n $response = $this->sendCurl($url,$data,$headers_array);\r\n $this->getStatus($lightname);\r\n }",
"public function powerUp()\n {\n if ($this->motor_power)\n $this->motor_power->setValue(1);\n }",
"public function canpoweroff()\n\t{\n\t\treturn $this->Players->canpoweroff($this->SqueezePlyrID);\n\t}",
"public function onOffSetting()\n\t{\n\t\treturn \"eco_loans_on\";\n\t}",
"public function unsetWaterSupplyThroughPipes() : void\n {\n $this->waterSuppliedThroughPipes = false;\n }",
"public function forceSourceOff()\n {\n $this->sendCommand(static::RCMD_SRC_FORCE_OFF);\n }",
"public function disable();",
"public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }",
"public function walkDoors()\n {\n for($i = 1; $i <= self::NUMBER_OF_WALKS; $i++)\n {\n foreach ($this->doors as $door)\n {\n if ($door->getNumber() % $i === 0)\n {\n $door->toggle();\n }\n }\n }\n }",
"public function onDisable() {\n\t}",
"public static function powerOff($id)\n {\n return self::action($id, 'poweroff');\n }",
"public function disable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'no' );\n\t}",
"public function videoconferenciaNoInterrumpirOFF( ) {\n $this->setNoInterrumpir(\"ON\");\n// $this->setNoInterrumpir(\"AUTOANSWER\");\n }",
"public function ShutdownCar()\r\n {\r\n echo \"<b><u>Command Received: Shutdown Engine</b></u><br />\";\r\n if($this->speed > 0)\r\n {\r\n echo \"Stopping prior to shutting down the engine... <br />\";\r\n $this->speed = 0;\r\n }\r\n $this->carEngine->stopEngine();\r\n echo $this->carName . \"'s engine has been shut down <br />\";\r\n }",
"public function switchOn();",
"public function halt();",
"public function orientationCalculationOff()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_ORIENTATION_CALCULATION_OFF, $payload);\n }"
]
| [
"0.6940853",
"0.665587",
"0.6653931",
"0.6568121",
"0.65494555",
"0.6472957",
"0.6152214",
"0.61125106",
"0.5893043",
"0.5890121",
"0.58431864",
"0.57530046",
"0.5743271",
"0.56316966",
"0.5598257",
"0.55520046",
"0.55294603",
"0.547954",
"0.5339683",
"0.532005",
"0.5300609",
"0.529425",
"0.52655345",
"0.5259371",
"0.5247095",
"0.5235794",
"0.52343357",
"0.5233929",
"0.5226775",
"0.5205794"
]
| 0.86797 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.